@layers-app/shared 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/assets/svg/flags/es.svg.js +4 -0
  2. package/dist/assets/svg/flags/ru.svg.js +4 -0
  3. package/dist/assets/svg/flags/us.svg.js +4 -0
  4. package/dist/assets/svg/globeIcon.svg.js +5 -0
  5. package/dist/assets/svg/socials/github.svg.js +5 -0
  6. package/dist/assets/svg/socials/instagram.svg.js +5 -0
  7. package/dist/assets/svg/socials/x.svg.js +5 -0
  8. package/dist/assets/svg/socials/youtube.svg.js +5 -0
  9. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +30 -30
  11. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  12. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  13. package/dist/components/AppContainer/hooks/useAppContainer.js +45 -42
  14. package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
  15. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +1 -0
  16. package/dist/components/AppContainer/types.d.ts +1 -0
  17. package/dist/components/AppContainer/types.d.ts.map +1 -1
  18. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
  19. package/dist/components/FilePicker/FilePicker.d.ts +33 -2
  20. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  21. package/dist/components/FilePicker/FilePicker.js +161 -110
  22. package/dist/components/FilePicker/FilePicker.module.css.js +9 -7
  23. package/dist/components/FilePicker/FilePickerGoogleDrive.d.ts +22 -0
  24. package/dist/components/FilePicker/FilePickerGoogleDrive.d.ts.map +1 -0
  25. package/dist/components/FilePicker/FilePickerGoogleDrive.js +86 -0
  26. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  27. package/dist/components/FilePicker/FilePickerUnsplash.js +69 -52
  28. package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +15 -15
  29. package/dist/components/FormViewer/hooks/useInterpolateText.js +3 -3
  30. package/dist/components/FormViewer/store/formStore.js +3 -3
  31. package/dist/components/FormViewer/store/selectors.js +1 -1
  32. package/dist/components/GroupAvatar/index.d.ts +1 -0
  33. package/dist/components/GroupAvatar/index.d.ts.map +1 -1
  34. package/dist/components/GroupAvatar/index.js +9 -8
  35. package/dist/components/ImageCropper/ImageCropper.d.ts +19 -0
  36. package/dist/components/ImageCropper/ImageCropper.d.ts.map +1 -0
  37. package/dist/components/ImageCropper/ImageCropper.js +356 -0
  38. package/dist/components/ImageCropper/ImageCropper.module.css.js +51 -0
  39. package/dist/components/ImageCropper/cropUtils.d.ts +22 -0
  40. package/dist/components/ImageCropper/cropUtils.d.ts.map +1 -0
  41. package/dist/components/ImageCropper/cropUtils.js +42 -0
  42. package/dist/components/ImageCropper/index.d.ts +4 -0
  43. package/dist/components/ImageCropper/index.d.ts.map +1 -0
  44. package/dist/components/ImageCropper/useCropInteraction.d.ts +28 -0
  45. package/dist/components/ImageCropper/useCropInteraction.d.ts.map +1 -0
  46. package/dist/components/ImageCropper/useCropInteraction.js +76 -0
  47. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts +21 -0
  48. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts.map +1 -0
  49. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.js +73 -0
  50. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +19 -0
  51. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts +6 -0
  52. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts.map +1 -0
  53. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.js +60 -0
  54. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts +6 -0
  55. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts.map +1 -0
  56. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.js +21 -0
  57. package/dist/components/IntegrationFlowAnimation/icons/NotionIcon.d.ts +6 -0
  58. package/dist/components/IntegrationFlowAnimation/icons/NotionIcon.d.ts.map +1 -0
  59. package/dist/components/IntegrationFlowAnimation/icons/NotionIcon.js +35 -0
  60. package/dist/components/IntegrationFlowAnimation/icons/index.d.ts +4 -0
  61. package/dist/components/IntegrationFlowAnimation/icons/index.d.ts.map +1 -0
  62. package/dist/components/IntegrationFlowAnimation/index.d.ts +5 -0
  63. package/dist/components/IntegrationFlowAnimation/index.d.ts.map +1 -0
  64. package/dist/components/LanguagePicker/LanguagePicker.d.ts +2 -1
  65. package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
  66. package/dist/components/LanguagePicker/LanguagePicker.js +26 -22
  67. package/dist/components/MediaLibrary/MediaLibrary.d.ts +3 -0
  68. package/dist/components/MediaLibrary/MediaLibrary.d.ts.map +1 -0
  69. package/dist/components/MediaLibrary/MediaLibrary.js +93 -0
  70. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +17 -0
  71. package/dist/components/MediaLibrary/MediaLibraryBreadcrumbs.d.ts +8 -0
  72. package/dist/components/MediaLibrary/MediaLibraryBreadcrumbs.d.ts.map +1 -0
  73. package/dist/components/MediaLibrary/MediaLibraryBreadcrumbs.js +22 -0
  74. package/dist/components/MediaLibrary/MediaLibraryBrowser.d.ts +12 -0
  75. package/dist/components/MediaLibrary/MediaLibraryBrowser.d.ts.map +1 -0
  76. package/dist/components/MediaLibrary/MediaLibraryBrowser.js +52 -0
  77. package/dist/components/MediaLibrary/MediaLibraryRow.d.ts +9 -0
  78. package/dist/components/MediaLibrary/MediaLibraryRow.d.ts.map +1 -0
  79. package/dist/components/MediaLibrary/MediaLibraryRow.js +29 -0
  80. package/dist/components/MediaLibrary/index.d.ts +4 -0
  81. package/dist/components/MediaLibrary/index.d.ts.map +1 -0
  82. package/dist/components/MediaLibrary/types.d.ts +31 -0
  83. package/dist/components/MediaLibrary/types.d.ts.map +1 -0
  84. package/dist/components/NoData/NoData.d.ts +6 -1
  85. package/dist/components/NoData/NoData.d.ts.map +1 -1
  86. package/dist/components/NoData/NoData.js +85 -82
  87. package/dist/components/SettingsSection/index.d.ts +12 -0
  88. package/dist/components/SettingsSection/index.d.ts.map +1 -0
  89. package/dist/components/SettingsSection/index.js +36 -0
  90. package/dist/components/SettingsSection/styles.module.css.js +7 -0
  91. package/dist/components/SocialLinkRow/index.d.ts +11 -0
  92. package/dist/components/SocialLinkRow/index.d.ts.map +1 -0
  93. package/dist/components/SocialLinkRow/index.js +109 -0
  94. package/dist/components/SortableList/components/SortableItem/SortableItem.js +3 -3
  95. package/dist/components/StorageUsageProgress/index.js +26 -24
  96. package/dist/components/TimezonePicker/index.d.ts +9 -0
  97. package/dist/components/TimezonePicker/index.d.ts.map +1 -0
  98. package/dist/components/TimezonePicker/index.js +90 -0
  99. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
  100. package/dist/components/WorkspaceMenu/WorkspaceItem.js +18 -17
  101. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
  102. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +70 -69
  103. package/dist/components/modals/RemoveConfirmModal.js +1 -1
  104. package/dist/components/table/components/TableHeaders.js +3 -3
  105. package/dist/components/table/components/TablePanel.js +1 -1
  106. package/dist/components/table/helpers/columns.js +3 -3
  107. package/dist/components/table/hooks/TableProvider.js +3 -3
  108. package/dist/components/table/selectors.js +6 -6
  109. package/dist/helpers/getFileType.d.ts +1 -2
  110. package/dist/helpers/getFileType.d.ts.map +1 -1
  111. package/dist/helpers/getFileType.js +5 -6
  112. package/dist/helpers/showNotifications.d.ts +14 -3
  113. package/dist/helpers/showNotifications.d.ts.map +1 -1
  114. package/dist/helpers/showNotifications.js +152 -61
  115. package/dist/helpers/showNotifications.module.css.js +29 -0
  116. package/dist/helpers/timezones.d.ts +12 -0
  117. package/dist/helpers/timezones.d.ts.map +1 -0
  118. package/dist/helpers/timezones.js +59 -0
  119. package/dist/hooks/useNumberQueryParam.js +3 -3
  120. package/dist/hooks/useVideoUploadGuard.d.ts +2 -0
  121. package/dist/hooks/useVideoUploadGuard.d.ts.map +1 -0
  122. package/dist/hooks/useVideoUploadGuard.js +24 -0
  123. package/dist/index.css +1 -1
  124. package/dist/index.d.ts +10 -1
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +449 -406
  127. package/dist/lang/locales/ui_en.json.js +24 -22
  128. package/dist/lang/locales/ui_es.json.js +20 -18
  129. package/dist/lang/locales/ui_ru.json.js +20 -18
  130. package/dist/lib/contentImport/index.d.ts +4 -0
  131. package/dist/lib/contentImport/index.d.ts.map +1 -0
  132. package/dist/lib/contentImport/lexicalSerializer.d.ts +19 -0
  133. package/dist/lib/contentImport/lexicalSerializer.d.ts.map +1 -0
  134. package/dist/lib/contentImport/lexicalSerializer.js +215 -0
  135. package/dist/lib/contentImport/types.d.ts +161 -0
  136. package/dist/lib/contentImport/types.d.ts.map +1 -0
  137. package/dist/lib/contentImport/utils.d.ts +35 -0
  138. package/dist/lib/contentImport/utils.d.ts.map +1 -0
  139. package/dist/lib/contentImport/utils.js +145 -0
  140. package/dist/node_modules/countries-and-timezones/esm/index.js +4031 -0
  141. package/dist/store/plansModal.d.ts.map +1 -1
  142. package/dist/store/plansModal.js +8 -7
  143. package/dist/utils/formatStorage.d.ts +7 -1
  144. package/dist/utils/formatStorage.d.ts.map +1 -1
  145. package/dist/utils/formatStorage.js +10 -5
  146. package/dist/utils/getCroppedBlob.d.ts +3 -0
  147. package/dist/utils/getCroppedBlob.d.ts.map +1 -0
  148. package/dist/utils/getCroppedBlob.js +21 -0
  149. package/package.json +1 -1
  150. package/dist/assets/images/flags/es.svg.js +0 -4
  151. package/dist/assets/images/flags/ru.svg.js +0 -4
  152. package/dist/assets/images/flags/us.svg.js +0 -4
  153. package/dist/components/PaymentSuccess/PaymentSuccess.d.ts +0 -2
  154. package/dist/components/PaymentSuccess/PaymentSuccess.d.ts.map +0 -1
  155. package/dist/components/PaymentSuccess/PaymentSuccess.js +0 -41
@@ -1,120 +1,141 @@
1
- import { jsx as e, jsxs as s } 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 C } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as F } from "@hugeicons/react";
6
- import { Flex as n, ActionIcon as E, Button as P, Text as J, Popover as u, Tabs as g, Stack as K } from "@mantine/core";
7
- import { useMenu as Q } from "../../hooks/useMenu.js";
8
- import { FilePickerGallery as W } from "./FilePickerGallery.js";
9
- import { FilePickerGiphy as X } from "./FilePickerGiphy.js";
10
- import { FilePickerLink as Y } from "./FilePickerLink.js";
11
- import { FilePickerUnsplash as Z } from "./FilePickerUnsplash.js";
12
- import { FilePickerUpload as _ } from "./FilePickerUpload.js";
13
- import z from "./FilePicker.module.css.js";
14
- const $ = [
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { useState as F, useMemo as M } from "react";
3
+ import { useTranslation as Q } from "react-i18next";
4
+ import { ImageAdd02Icon as P } from "@hugeicons/core-free-icons";
5
+ import { HugeiconsIcon as S } from "@hugeicons/react";
6
+ import { Flex as r, ActionIcon as W, Button as z, Text as X, Popover as g, Tabs as v, Stack as Y } from "@mantine/core";
7
+ import { isFeature as Z } from "../../helpers/feature.js";
8
+ import { useMenu as _ } from "../../hooks/useMenu.js";
9
+ import { MediaLibraryBrowser as $ } from "../MediaLibrary/MediaLibraryBrowser.js";
10
+ import { FilePickerGallery as T } from "./FilePickerGallery.js";
11
+ import { FilePickerGiphy as D } from "./FilePickerGiphy.js";
12
+ import { FilePickerLink as ee } from "./FilePickerLink.js";
13
+ import { FilePickerUnsplash as ne } from "./FilePickerUnsplash.js";
14
+ import { FilePickerGoogleDrive as ie } from "./FilePickerGoogleDrive.js";
15
+ import { FilePickerUpload as le } from "./FilePickerUpload.js";
16
+ import y from "./FilePicker.module.css.js";
17
+ const re = [
15
18
  "gallery",
16
19
  "upload",
17
20
  "link",
18
21
  "unsplash",
19
- "giphy"
20
- ], me = ({
21
- onChange: L,
22
- onRemove: j,
23
- onUpload: p,
24
- uploading: G = !1,
25
- showTabs: r = $,
26
- children: M,
27
- width: S = 610,
28
- position: A = "bottom-end",
29
- readOnly: B = !1,
30
- hasImage: I,
31
- giphyToken: t,
32
- unsplashClientId: o,
33
- type: f = "image",
34
- galleryCollection: c = [],
22
+ "giphy",
23
+ "googleDrive",
24
+ "media"
25
+ ], xe = ({
26
+ onChange: B,
27
+ onRemove: G,
28
+ onUpload: f,
29
+ uploading: I = !1,
30
+ showTabs: s = re,
31
+ children: V,
32
+ width: j = 610,
33
+ position: L = "bottom-end",
34
+ readOnly: A = !1,
35
+ hasImage: E,
36
+ giphyToken: d,
37
+ unsplashClientId: m,
38
+ type: b = "image",
39
+ galleryCollection: u = [],
35
40
  isValidMediaUrl: N,
36
41
  popoverProps: U,
37
- dropZoneProps: V,
38
- targetProps: w,
39
- onOpenedChange: D
42
+ dropZoneProps: H,
43
+ targetProps: O,
44
+ onOpenedChange: R,
45
+ googleDrive: i,
46
+ mediaLibrary: a
40
47
  }) => {
41
- const { t: l } = q("ui"), [v, m] = x(!1), { isMobile: b } = Q(), d = y(
48
+ const { t: l } = Q("ui"), [k, h] = F(!1), { isMobile: C } = _(), p = M(
42
49
  () => [
43
50
  {
44
51
  value: "gallery",
45
- label: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("span", { children: l("changeCover.gallery") }) }),
46
- visible: r.includes("gallery") && !!c.length
52
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.gallery") }) }),
53
+ visible: s.includes("gallery") && !!u.length
47
54
  },
48
55
  {
49
56
  value: "upload",
50
- label: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("span", { children: l("changeCover.upload") }) }),
51
- visible: r.includes("upload") && !!p
57
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.upload") }) }),
58
+ visible: s.includes("upload") && !!f
52
59
  },
53
60
  {
54
61
  value: "link",
55
- label: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("span", { children: l("changeCover.link") }) }),
56
- visible: r.includes("link")
62
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.link") }) }),
63
+ visible: s.includes("link")
57
64
  },
58
65
  {
59
66
  value: "unsplash",
60
- label: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("span", { children: l("changeCover.searchImages") }) }),
61
- visible: r.includes("unsplash") && o
67
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.searchImages") }) }),
68
+ visible: s.includes("unsplash") && m
62
69
  },
63
70
  {
64
71
  value: "giphy",
65
- label: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
66
- visible: r.includes("giphy") && t
72
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
73
+ visible: s.includes("giphy") && d
74
+ },
75
+ {
76
+ value: "googleDrive",
77
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.googleDrive", {
78
+ defaultValue: "Google Drive"
79
+ }) }) }),
80
+ visible: s.includes("googleDrive") && !!i
81
+ },
82
+ {
83
+ value: "media",
84
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.media", { defaultValue: "Media" }) }) }),
85
+ visible: s.includes("media") && !!a && Z()
67
86
  }
68
- ].filter((i) => i.visible),
87
+ ].filter((n) => n.visible),
69
88
  [
70
- r,
71
- o,
72
- t,
89
+ s,
90
+ m,
91
+ d,
73
92
  l,
74
- c.length,
75
- p
93
+ u.length,
94
+ f,
95
+ i,
96
+ a
76
97
  ]
77
- ), [a, H] = x(() => {
78
- if (d[0]) return d[0].value;
79
- const i = d.find((T) => T.visible);
80
- return i ? i.value : "";
81
- }), O = (i) => {
82
- p?.(i, m);
83
- }, h = (i) => {
84
- L?.(i), m(!1);
85
- }, R = y(() => b ? /* @__PURE__ */ s(E, { size: "lg", children: [
86
- /* @__PURE__ */ e(F, { icon: C, size: 22 }),
98
+ ), [o, q] = F(() => {
99
+ if (p[0]) return p[0].value;
100
+ const n = p.find((K) => K.visible);
101
+ return n ? n.value : "";
102
+ }), w = (n) => {
103
+ f?.(n, h);
104
+ }, c = (n) => {
105
+ B?.(n), h(!1);
106
+ }, J = M(() => C ? /* @__PURE__ */ t(W, { size: "lg", children: [
107
+ /* @__PURE__ */ e(S, { icon: P, size: 22 }),
87
108
  " "
88
109
  ] }) : /* @__PURE__ */ e(
89
- P,
110
+ z,
90
111
  {
91
112
  variant: "default",
92
113
  size: "xs",
93
- leftSection: /* @__PURE__ */ e(F, { icon: C, size: 16 }),
94
- children: /* @__PURE__ */ e(J, { fw: 600, size: "sm", children: l("changeCover.change") })
114
+ leftSection: /* @__PURE__ */ e(S, { icon: P, size: 16 }),
115
+ children: /* @__PURE__ */ e(X, { fw: 600, size: "sm", children: l("changeCover.change") })
95
116
  }
96
- ), [l, b]), k = (i) => {
97
- m(i), D?.(i);
117
+ ), [l, C]), x = (n) => {
118
+ h(n), R?.(n);
98
119
  };
99
- return /* @__PURE__ */ s(
100
- u,
120
+ return /* @__PURE__ */ t(
121
+ g,
101
122
  {
102
- width: S,
123
+ width: j,
103
124
  radius: "var(--mantine-spacing-sm)",
104
- position: A,
125
+ position: L,
105
126
  shadow: "md",
106
- opened: v,
107
- onChange: k,
127
+ opened: k,
128
+ onChange: x,
108
129
  withinPortal: !0,
109
130
  ...U || {},
110
131
  children: [
111
- /* @__PURE__ */ e(u.Target, { children: /* @__PURE__ */ e(n, { onClick: () => k(!v), ...w, children: M ?? R }) }),
112
- /* @__PURE__ */ s(u.Dropdown, { p: 0, children: [
113
- /* @__PURE__ */ e(n, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
114
- g,
132
+ /* @__PURE__ */ e(g.Target, { children: /* @__PURE__ */ e(r, { onClick: () => x(!k), ...O, children: V ?? J }) }),
133
+ /* @__PURE__ */ t(g.Dropdown, { p: 0, children: [
134
+ /* @__PURE__ */ e(r, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
135
+ v,
115
136
  {
116
137
  defaultValue: "gallery",
117
- value: a,
138
+ value: o,
118
139
  styles: {
119
140
  list: {
120
141
  alignItems: "center",
@@ -122,8 +143,8 @@ const $ = [
122
143
  }
123
144
  },
124
145
  w: "100%",
125
- children: /* @__PURE__ */ s(
126
- g.List,
146
+ children: /* @__PURE__ */ t(
147
+ v.List,
127
148
  {
128
149
  style: {
129
150
  gap: "4px"
@@ -131,21 +152,21 @@ const $ = [
131
152
  px: 8,
132
153
  h: 54,
133
154
  children: [
134
- d.map((i) => /* @__PURE__ */ e(
135
- g.Tab,
155
+ p.map((n) => /* @__PURE__ */ e(
156
+ v.Tab,
136
157
  {
137
- className: z.originalTab,
138
- disabled: B,
158
+ className: y.originalTab,
159
+ disabled: A,
139
160
  h: "100%",
140
161
  p: 0,
141
- value: i.value,
142
- onClick: () => H(i.value),
143
- children: /* @__PURE__ */ e(n, { className: z.customTab, px: "sm", h: 36, children: i.label })
162
+ value: n.value,
163
+ onClick: () => q(n.value),
164
+ children: /* @__PURE__ */ e(r, { className: y.customTab, px: "sm", h: 36, children: n.label })
144
165
  },
145
- i.value
166
+ n.value
146
167
  )),
147
- I && /* @__PURE__ */ e(
148
- P,
168
+ E && /* @__PURE__ */ e(
169
+ z,
149
170
  {
150
171
  variant: "subtle",
151
172
  fz: "sm",
@@ -153,7 +174,7 @@ const $ = [
153
174
  fw: 500,
154
175
  px: "sm",
155
176
  size: "30px",
156
- onClick: j,
177
+ onClick: G,
157
178
  color: "var(--mantine-color-gray-light-color)",
158
179
  style: { marginLeft: "auto" },
159
180
  children: l("remove")
@@ -164,39 +185,69 @@ const $ = [
164
185
  )
165
186
  }
166
187
  ) }),
167
- /* @__PURE__ */ s(K, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
168
- a === "gallery" && !!c.length && /* @__PURE__ */ e(
169
- W,
188
+ /* @__PURE__ */ t(Y, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
189
+ o === "gallery" && !!u.length && /* @__PURE__ */ e(
190
+ T,
170
191
  {
171
- galleryCollection: c,
172
- onChange: h
192
+ galleryCollection: u,
193
+ onChange: c
173
194
  }
174
195
  ),
175
- a === "upload" && /* @__PURE__ */ e(
176
- _,
196
+ o === "upload" && /* @__PURE__ */ e(
197
+ le,
177
198
  {
178
- type: f || "image",
179
- uploading: G,
180
- dropZoneProps: V,
181
- onUpload: O
199
+ type: b || "image",
200
+ uploading: I,
201
+ dropZoneProps: H,
202
+ onUpload: w
182
203
  }
183
204
  ),
184
- a === "link" && /* @__PURE__ */ e(
185
- Y,
205
+ o === "link" && /* @__PURE__ */ e(
206
+ ee,
186
207
  {
187
- type: f || "image",
188
- onChange: h,
208
+ type: b || "image",
209
+ onChange: c,
189
210
  isValidMediaUrl: N
190
211
  }
191
212
  ),
192
- a === "unsplash" && o && /* @__PURE__ */ e(
193
- Z,
213
+ o === "unsplash" && m && /* @__PURE__ */ e(
214
+ ne,
215
+ {
216
+ clientId: m,
217
+ onChange: c
218
+ }
219
+ ),
220
+ o === "giphy" && d && /* @__PURE__ */ e(D, { token: d, onChange: c }),
221
+ o === "googleDrive" && i && /* @__PURE__ */ e(
222
+ ie,
194
223
  {
195
- clientId: o,
196
- onChange: h
224
+ isConnected: i.isConnected,
225
+ connectedEmail: i.connectedEmail,
226
+ files: i.files,
227
+ isLoading: i.isLoading,
228
+ hasMore: i.hasMore,
229
+ isImporting: i.isImporting,
230
+ onSearch: i.onSearch,
231
+ onLoadMore: i.onLoadMore,
232
+ onSelect: (n) => {
233
+ i.onSelect(n, c);
234
+ },
235
+ error: i.error
197
236
  }
198
237
  ),
199
- a === "giphy" && t && /* @__PURE__ */ e(X, { token: t, onChange: h })
238
+ o === "media" && a && /* @__PURE__ */ e(
239
+ $,
240
+ {
241
+ items: a.items,
242
+ isLoading: a.isLoading,
243
+ breadcrumbs: a.breadcrumbs,
244
+ onFolderClick: a.onFolderClick,
245
+ onBreadcrumbClick: a.onBreadcrumbClick,
246
+ onSelect: (n) => {
247
+ a.onSelect?.(n), h(!1);
248
+ }
249
+ }
250
+ )
200
251
  ] })
201
252
  ] })
202
253
  ]
@@ -204,5 +255,5 @@ const $ = [
204
255
  );
205
256
  };
206
257
  export {
207
- me as FilePicker
258
+ xe as FilePicker
208
259
  };
@@ -1,13 +1,15 @@
1
- const t = "_itemImage_3fqzc_1", o = "_originalTab_3fqzc_14", a = "_customTab_3fqzc_20", c = "_button_3fqzc_28", _ = {
1
+ const t = "_itemImage_1me1c_1", o = "_imageAuthor_1me1c_14", a = "_originalTab_1me1c_22", e = "_customTab_1me1c_28", m = "_button_1me1c_36", _ = {
2
2
  itemImage: t,
3
- originalTab: o,
4
- customTab: a,
5
- button: c
3
+ imageAuthor: o,
4
+ originalTab: a,
5
+ customTab: e,
6
+ button: m
6
7
  };
7
8
  export {
8
- c as button,
9
- a as customTab,
9
+ m as button,
10
+ e as customTab,
10
11
  _ as default,
12
+ o as imageAuthor,
11
13
  t as itemImage,
12
- o as originalTab
14
+ a as originalTab
13
15
  };
@@ -0,0 +1,22 @@
1
+ interface GoogleDriveFile {
2
+ id: string;
3
+ name: string;
4
+ mimeType: string;
5
+ thumbnailLink?: string;
6
+ iconLink?: string;
7
+ }
8
+ interface FilePickerGoogleDriveProps {
9
+ isConnected: boolean;
10
+ connectedEmail?: string;
11
+ files: GoogleDriveFile[];
12
+ isLoading: boolean;
13
+ hasMore: boolean;
14
+ isImporting: boolean;
15
+ onSearch: (query: string) => void;
16
+ onLoadMore: () => void;
17
+ onSelect: (file: GoogleDriveFile) => void;
18
+ error: string | null;
19
+ }
20
+ export declare const FilePickerGoogleDrive: ({ isConnected, files, isLoading, hasMore, isImporting, onSearch, onLoadMore, onSelect, error, }: FilePickerGoogleDriveProps) => import("react/jsx-runtime").JSX.Element;
21
+ export {};
22
+ //# sourceMappingURL=FilePickerGoogleDrive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilePickerGoogleDrive.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGoogleDrive.tsx"],"names":[],"mappings":"AA6BA,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,0BAA0B;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,GAAI,iGAUnC,0BAA0B,4CAmH5B,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { useState as C, useRef as D, useEffect as y, useCallback as I } from "react";
3
+ import { useTranslation as T } from "react-i18next";
4
+ import { Search01Icon as G } from "@hugeicons/core-free-icons";
5
+ import { HugeiconsIcon as R } from "@hugeicons/react";
6
+ import { Center as h, Stack as a, Loader as g, Text as l, TextInput as V, Box as p, SimpleGrid as F, AspectRatio as L, Button as P } from "@mantine/core";
7
+ import { useDebouncedValue as j } from "@mantine/hooks";
8
+ import { NoData as w } from "../NoData/NoData.js";
9
+ import { FilePickerSkeletonLoader as B } from "./FilePickerSkeletonLoader.js";
10
+ import N from "./FilePicker.module.css.js";
11
+ const O = ({
12
+ isConnected: f,
13
+ files: o,
14
+ isLoading: n,
15
+ hasMore: v,
16
+ isImporting: x,
17
+ onSearch: c,
18
+ onLoadMore: k,
19
+ onSelect: b,
20
+ error: s
21
+ }) => {
22
+ const { t } = T("ui"), [m, S] = C(""), [u] = j(m, 800), d = D(c);
23
+ d.current = c, y(() => {
24
+ d.current(u);
25
+ }, [u]);
26
+ const z = I(
27
+ (r) => {
28
+ S(r.currentTarget.value);
29
+ },
30
+ []
31
+ );
32
+ return x ? /* @__PURE__ */ e(h, { h: 200, children: /* @__PURE__ */ i(a, { align: "center", gap: "xs", children: [
33
+ /* @__PURE__ */ e(g, { size: "sm" }),
34
+ /* @__PURE__ */ e(l, { size: "sm", c: "dimmed", children: t("externalDrive.importing", {
35
+ defaultValue: "Importing file..."
36
+ }) })
37
+ ] }) }) : f ? /* @__PURE__ */ i(a, { gap: "sm", children: [
38
+ s && /* @__PURE__ */ e(l, { size: "xs", c: "red", children: s }),
39
+ /* @__PURE__ */ e(
40
+ V,
41
+ {
42
+ leftSection: n ? /* @__PURE__ */ e(g, { size: 16 }) : /* @__PURE__ */ e(R, { size: 16, icon: G }),
43
+ maxLength: 50,
44
+ placeholder: t("externalDrive.searchFiles", {
45
+ defaultValue: "Search Google Drive"
46
+ }),
47
+ "data-autofocus": !0,
48
+ value: m,
49
+ onChange: z
50
+ }
51
+ ),
52
+ /* @__PURE__ */ i(p, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
53
+ !!o.length && /* @__PURE__ */ i(a, { gap: 8, children: [
54
+ /* @__PURE__ */ e(F, { cols: 4, spacing: 10, children: o.map((r) => /* @__PURE__ */ e(
55
+ L,
56
+ {
57
+ onClick: () => b(r),
58
+ ratio: 120 / 65,
59
+ className: N.itemImage,
60
+ style: {
61
+ backgroundImage: r.thumbnailLink ? `url(${r.thumbnailLink})` : void 0,
62
+ backgroundColor: r.thumbnailLink ? void 0 : "var(--mantine-color-gray-light)"
63
+ }
64
+ },
65
+ r.id
66
+ )) }),
67
+ v && /* @__PURE__ */ e(P, { variant: "subtle", loading: n, onClick: k, children: t("loadMore") })
68
+ ] }),
69
+ !o.length && !n && /* @__PURE__ */ e(p, { pb: 16, children: /* @__PURE__ */ e(
70
+ w,
71
+ {
72
+ size: 120,
73
+ illustration: "noImage",
74
+ description: t("changeCover.noResult"),
75
+ titleProps: { size: "xs", c: "dimmed" }
76
+ }
77
+ ) }),
78
+ !o.length && n && /* @__PURE__ */ e(B, {})
79
+ ] })
80
+ ] }) : /* @__PURE__ */ e(h, { h: 200, children: /* @__PURE__ */ e(a, { align: "center", gap: "sm", children: /* @__PURE__ */ e(l, { size: "sm", c: "dimmed", ta: "center", children: t("externalDrive.goToSettings", {
81
+ defaultValue: "Connect Google Drive in Settings to import files"
82
+ }) }) }) });
83
+ };
84
+ export {
85
+ O as FilePickerGoogleDrive
86
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerUnsplash.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUnsplash.tsx"],"names":[],"mappings":"AAmCA,eAAO,MAAM,kBAAkB,GAAI,yBAGhC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAwGA,CAAC"}
1
+ {"version":3,"file":"FilePickerUnsplash.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUnsplash.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,kBAAkB,GAAI,yBAGhC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAwHA,CAAC"}