@layers-app/shared 0.4.4 → 0.4.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.
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +72 -79
- package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
- package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
- package/dist/components/AppContainer/components/Header.js +6 -5
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/SidebarToggleButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/SidebarToggleButton.js +25 -16
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -33
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +54 -36
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +2 -0
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +84 -37
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +7 -7
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +138 -84
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
- package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
- package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
- package/dist/components/Chat/CallMessage/CallMessage.module.css.js +15 -0
- package/dist/components/Chat/CallMessage/index.d.ts +21 -0
- package/dist/components/Chat/CallMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/CallMessage/index.js +49 -0
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +9 -0
- package/dist/components/Chat/ChatBubble/index.d.ts +14 -0
- package/dist/components/Chat/ChatBubble/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatBubble/index.js +32 -0
- package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +17 -0
- package/dist/components/Chat/ChatHeader/index.d.ts +42 -0
- package/dist/components/Chat/ChatHeader/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatHeader/index.js +78 -0
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +49 -0
- package/dist/components/Chat/ChatInput/index.d.ts +74 -0
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/index.js +288 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
- package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +15 -0
- package/dist/components/Chat/ChatLayout/index.d.ts +17 -0
- package/dist/components/Chat/ChatLayout/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatLayout/index.js +43 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +21 -0
- package/dist/components/Chat/ChatMessage/index.d.ts +47 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatMessage/index.js +206 -0
- package/dist/components/Chat/ChatPill/ChatPill.module.css.js +11 -0
- package/dist/components/Chat/ChatPill/index.d.ts +12 -0
- package/dist/components/Chat/ChatPill/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatPill/index.js +21 -0
- package/dist/components/Chat/DayMeta/index.d.ts +11 -0
- package/dist/components/Chat/DayMeta/index.d.ts.map +1 -0
- package/dist/components/Chat/DayMeta/index.js +9 -0
- package/dist/components/Chat/DialogItem/DialogItem.module.css.js +17 -0
- package/dist/components/Chat/DialogItem/index.d.ts +41 -0
- package/dist/components/Chat/DialogItem/index.d.ts.map +1 -0
- package/dist/components/Chat/DialogItem/index.js +107 -0
- package/dist/components/Chat/DialogList/DialogList.module.css.js +7 -0
- package/dist/components/Chat/DialogList/index.d.ts +11 -0
- package/dist/components/Chat/DialogList/index.d.ts.map +1 -0
- package/dist/components/Chat/DialogList/index.js +19 -0
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +13 -0
- package/dist/components/Chat/MediaDocument/index.d.ts +15 -0
- package/dist/components/Chat/MediaDocument/index.d.ts.map +1 -0
- package/dist/components/Chat/MediaDocument/index.js +73 -0
- package/dist/components/Chat/MessageActions/MessageActions.module.css.js +7 -0
- package/dist/components/Chat/MessageActions/index.d.ts +23 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageActions/index.js +68 -0
- package/dist/components/Chat/MessageAuthor/index.d.ts +20 -0
- package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageAuthor/index.js +36 -0
- package/dist/components/Chat/MessageForward/MessageForward.module.css.js +7 -0
- package/dist/components/Chat/MessageForward/index.d.ts +13 -0
- package/dist/components/Chat/MessageForward/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageForward/index.js +30 -0
- package/dist/components/Chat/MessageList/MessageList.module.css.js +21 -0
- package/dist/components/Chat/MessageList/index.d.ts +39 -0
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageList/index.js +159 -0
- package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +13 -0
- package/dist/components/Chat/MessageMeta/index.d.ts +16 -0
- package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageMeta/index.js +33 -0
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +15 -0
- package/dist/components/Chat/MessageReactions/index.d.ts +32 -0
- package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReactions/index.js +72 -0
- package/dist/components/Chat/MessageReply/MessageReply.module.css.js +15 -0
- package/dist/components/Chat/MessageReply/index.d.ts +15 -0
- package/dist/components/Chat/MessageReply/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReply/index.js +40 -0
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +11 -0
- package/dist/components/Chat/MessageStatus/index.d.ts +14 -0
- package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageStatus/index.js +68 -0
- package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +11 -0
- package/dist/components/Chat/ServiceMessage/index.d.ts +13 -0
- package/dist/components/Chat/ServiceMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ServiceMessage/index.js +21 -0
- package/dist/components/Chat/UnreadSeparator/index.d.ts +11 -0
- package/dist/components/Chat/UnreadSeparator/index.d.ts.map +1 -0
- package/dist/components/Chat/UnreadSeparator/index.js +13 -0
- package/dist/components/Chat/colors.d.ts +7 -0
- package/dist/components/Chat/colors.d.ts.map +1 -0
- package/dist/components/Chat/colors.js +30 -0
- package/dist/components/Chat/icons.d.ts +9 -0
- package/dist/components/Chat/icons.d.ts.map +1 -0
- package/dist/components/Chat/icons.js +49 -0
- package/dist/components/Chat/index.d.ts +24 -0
- package/dist/components/Chat/index.d.ts.map +1 -0
- package/dist/components/Chat/mock-data.d.ts +32 -0
- package/dist/components/Chat/mock-data.d.ts.map +1 -0
- package/dist/components/Chat/types.d.ts +159 -0
- package/dist/components/Chat/types.d.ts.map +1 -0
- package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
- package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +81 -68
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +53 -11
- package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +43 -20
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/types.js +9 -0
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +23 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +126 -88
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +28 -25
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +90 -33
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
- package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
- package/dist/components/ErrorPage/components/Error403.js +25 -21
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.d.ts +5 -1
- package/dist/components/ErrorPage/index.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.js +17 -10
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +135 -161
- package/dist/components/FilePicker/FilePicker.module.css.js +8 -12
- package/dist/components/FilePicker/FilePickerGallery.js +13 -13
- package/dist/components/FilePicker/FilePickerGiphy.js +4 -4
- package/dist/components/FilePicker/FilePickerGoogleDrive.js +3 -3
- package/dist/components/FilePicker/FilePickerUnsplash.js +18 -18
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +55 -47
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
- package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
- package/dist/components/NavMenu/NavMenu.d.ts +7 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/NavMenu.js +54 -44
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
- package/dist/components/NavMenu/types.d.ts +4 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/Notification.module.css.js +1 -1
- package/dist/components/PillTabs/PillTabs.d.ts +19 -0
- package/dist/components/PillTabs/PillTabs.d.ts.map +1 -0
- package/dist/components/PillTabs/PillTabs.js +50 -0
- package/dist/components/PillTabs/PillTabs.module.css.js +11 -0
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
- package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
- package/dist/components/modals/RemoveConfirmModal.js +1 -1
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +41 -37
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.d.ts +15 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +114 -72
- package/dist/helpers/showNotifications.module.css.js +16 -4
- package/dist/hooks/useUiPref.d.ts +2 -0
- package/dist/hooks/useUiPref.d.ts.map +1 -0
- package/dist/hooks/useUiPref.js +80 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +588 -527
- package/dist/lang/locales/ui_en.json.js +5 -5
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/docs/README.md +499 -499
- package/package.json +78 -75
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { ImageAdd02Icon as
|
|
5
|
-
import { HugeiconsIcon as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { getEnvConfig as
|
|
8
|
-
import { isFeature as
|
|
9
|
-
import { useMenu as
|
|
10
|
-
import { usePlatform as
|
|
11
|
-
import { MediaLibraryBrowser as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useMemo as d, useEffect as ee } from "react";
|
|
3
|
+
import { useTranslation as ne } from "react-i18next";
|
|
4
|
+
import { ImageAdd02Icon as B } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { HugeiconsIcon as E } from "@hugeicons/react";
|
|
6
|
+
import { Flex as s, ActionIcon as le, Button as V, Text as ie, Box as re, Popover as P, Stack as ae } from "@mantine/core";
|
|
7
|
+
import { getEnvConfig as A } from "../../config/envConfig.js";
|
|
8
|
+
import { isFeature as oe } from "../../helpers/feature.js";
|
|
9
|
+
import { useMenu as te } from "../../hooks/useMenu.js";
|
|
10
|
+
import { usePlatform as se } from "../../hooks/usePlatform.js";
|
|
11
|
+
import { MediaLibraryBrowser as ce } from "../MediaLibrary/MediaLibraryBrowser.js";
|
|
12
|
+
import { PillTabs as de } from "../PillTabs/PillTabs.js";
|
|
13
|
+
import { FilePickerGallery as ue } from "./FilePickerGallery.js";
|
|
14
|
+
import { FilePickerGiphy as he } from "./FilePickerGiphy.js";
|
|
14
15
|
import { FilePickerLink as me } from "./FilePickerLink.js";
|
|
15
|
-
import { FilePickerUnsplash as
|
|
16
|
-
import { FilePickerGoogleDrive as
|
|
17
|
-
import { FilePickerUpload as
|
|
18
|
-
import { coverCollections as
|
|
19
|
-
|
|
20
|
-
const Ce = [
|
|
16
|
+
import { FilePickerUnsplash as pe } from "./FilePickerUnsplash.js";
|
|
17
|
+
import { FilePickerGoogleDrive as fe } from "./FilePickerGoogleDrive.js";
|
|
18
|
+
import { FilePickerUpload as ge } from "./FilePickerUpload.js";
|
|
19
|
+
import { coverCollections as ve } from "./coverCollections.js";
|
|
20
|
+
const be = [
|
|
21
21
|
"gallery",
|
|
22
22
|
"upload",
|
|
23
23
|
"link",
|
|
@@ -25,120 +25,120 @@ const Ce = [
|
|
|
25
25
|
"giphy",
|
|
26
26
|
"googleDrive",
|
|
27
27
|
"media"
|
|
28
|
-
],
|
|
29
|
-
onChange:
|
|
30
|
-
onRemove:
|
|
28
|
+
], Oe = ({
|
|
29
|
+
onChange: j,
|
|
30
|
+
onRemove: L,
|
|
31
31
|
onUpload: b,
|
|
32
|
-
uploading:
|
|
33
|
-
showTabs:
|
|
34
|
-
children:
|
|
35
|
-
width:
|
|
36
|
-
position:
|
|
37
|
-
readOnly:
|
|
38
|
-
hasImage:
|
|
39
|
-
giphyToken:
|
|
40
|
-
unsplashClientId:
|
|
32
|
+
uploading: U = !1,
|
|
33
|
+
showTabs: a = be,
|
|
34
|
+
children: _,
|
|
35
|
+
width: H = 610,
|
|
36
|
+
position: O = "bottom-end",
|
|
37
|
+
readOnly: X = !1,
|
|
38
|
+
hasImage: $,
|
|
39
|
+
giphyToken: Ce,
|
|
40
|
+
unsplashClientId: ke,
|
|
41
41
|
type: S = "image",
|
|
42
|
-
galleryCollection:
|
|
43
|
-
isValidMediaUrl:
|
|
44
|
-
popoverProps:
|
|
45
|
-
dropZoneProps:
|
|
46
|
-
targetProps:
|
|
47
|
-
onOpenedChange:
|
|
42
|
+
galleryCollection: u = [],
|
|
43
|
+
isValidMediaUrl: q,
|
|
44
|
+
popoverProps: w,
|
|
45
|
+
dropZoneProps: J,
|
|
46
|
+
targetProps: K,
|
|
47
|
+
onOpenedChange: N,
|
|
48
48
|
googleDrive: l,
|
|
49
|
-
mediaLibrary:
|
|
50
|
-
inline:
|
|
49
|
+
mediaLibrary: r,
|
|
50
|
+
inline: h = !1,
|
|
51
51
|
tab: C,
|
|
52
|
-
uploadIcon:
|
|
52
|
+
uploadIcon: Q
|
|
53
53
|
}) => {
|
|
54
|
-
const { t: i } =
|
|
54
|
+
const { t: i } = ne("ui"), [x, m] = T(!1), { isMobile: y } = te(), I = se(), p = d(() => u.length > 0 ? u : h ? ve.map((n) => ({
|
|
55
55
|
...n,
|
|
56
56
|
title: i(`coverGroups.${n.id}`, { defaultValue: n.id })
|
|
57
|
-
})) :
|
|
57
|
+
})) : u, [u, h, i]), o = d(() => [
|
|
58
58
|
{
|
|
59
59
|
value: "gallery",
|
|
60
|
-
label: /* @__PURE__ */ e(
|
|
61
|
-
visible:
|
|
60
|
+
label: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("span", { children: i("changeCover.gallery") }) }),
|
|
61
|
+
visible: a.includes("gallery") && !!p.length
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
value: "upload",
|
|
65
|
-
label: /* @__PURE__ */ e(
|
|
66
|
-
visible:
|
|
65
|
+
label: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("span", { children: i("changeCover.upload") }) }),
|
|
66
|
+
visible: a.includes("upload") && !!b
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
value: "link",
|
|
70
|
-
label: /* @__PURE__ */ e(
|
|
71
|
-
visible:
|
|
70
|
+
label: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("span", { children: i("changeCover.link") }) }),
|
|
71
|
+
visible: a.includes("link")
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
value: "unsplash",
|
|
75
|
-
label: /* @__PURE__ */ e(
|
|
76
|
-
visible:
|
|
75
|
+
label: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("span", { children: i("changeCover.searchImages") }) }),
|
|
76
|
+
visible: a.includes("unsplash") && A().media?.unsplashEnabled !== !1
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
value: "giphy",
|
|
80
|
-
label: /* @__PURE__ */ e(
|
|
81
|
-
visible:
|
|
80
|
+
label: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
|
|
81
|
+
visible: a.includes("giphy") && I.has("giphy") && A().media?.giphyEnabled !== !1
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
value: "googleDrive",
|
|
85
|
-
label: /* @__PURE__ */ e(
|
|
85
|
+
label: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("span", { children: i("changeCover.googleDrive", {
|
|
86
86
|
defaultValue: "Google Drive"
|
|
87
87
|
}) }) }),
|
|
88
|
-
visible:
|
|
88
|
+
visible: a.includes("googleDrive") && !!l
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
value: "media",
|
|
92
|
-
label: /* @__PURE__ */ e(
|
|
93
|
-
visible:
|
|
92
|
+
label: /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("span", { children: i("changeCover.media", { defaultValue: "Media" }) }) }),
|
|
93
|
+
visible: a.includes("media") && !!r && oe()
|
|
94
94
|
}
|
|
95
|
-
].filter((
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
].filter((F) => F.visible), [
|
|
96
|
+
a,
|
|
97
|
+
I,
|
|
98
98
|
i,
|
|
99
|
-
|
|
99
|
+
p.length,
|
|
100
100
|
b,
|
|
101
101
|
l,
|
|
102
|
-
|
|
103
|
-
]),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
const k =
|
|
108
|
-
|
|
109
|
-
},
|
|
102
|
+
r
|
|
103
|
+
]), f = C !== void 0, [R, M] = T(() => C !== void 0 ? "" : o[0]?.value ?? "");
|
|
104
|
+
ee(() => {
|
|
105
|
+
f || o.length && M((n) => n && o.some((F) => F.value === n) ? n : o[0].value);
|
|
106
|
+
}, [o, f]);
|
|
107
|
+
const k = d(() => o.map((n) => n.value), [o]), g = f ? C : R, t = d(() => g && k.includes(g) ? g : k[0] ?? "", [g, k]), W = (n) => {
|
|
108
|
+
f || M(n);
|
|
109
|
+
}, Y = (n) => {
|
|
110
110
|
b?.(n, m);
|
|
111
111
|
}, c = (n) => {
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
/* @__PURE__ */ e(
|
|
112
|
+
j?.(n), h || m(!1);
|
|
113
|
+
}, Z = d(() => y ? /* @__PURE__ */ v(le, { size: "lg", children: [
|
|
114
|
+
/* @__PURE__ */ e(E, { icon: B, size: 22 }),
|
|
115
115
|
" "
|
|
116
116
|
] }) : /* @__PURE__ */ e(
|
|
117
|
-
|
|
117
|
+
V,
|
|
118
118
|
{
|
|
119
119
|
variant: "default",
|
|
120
120
|
size: "xs",
|
|
121
|
-
leftSection: /* @__PURE__ */ e(
|
|
122
|
-
children: /* @__PURE__ */ e(
|
|
121
|
+
leftSection: /* @__PURE__ */ e(E, { icon: B, size: 16 }),
|
|
122
|
+
children: /* @__PURE__ */ e(ie, { fw: 600, size: "sm", children: i("changeCover.change") })
|
|
123
123
|
}
|
|
124
|
-
), [i,
|
|
125
|
-
m(n),
|
|
126
|
-
},
|
|
127
|
-
t === "gallery" && !!
|
|
128
|
-
|
|
124
|
+
), [i, y]), z = (n) => {
|
|
125
|
+
m(n), N?.(n);
|
|
126
|
+
}, G = /* @__PURE__ */ v(ae, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
|
|
127
|
+
t === "gallery" && !!p.length && /* @__PURE__ */ e(
|
|
128
|
+
ue,
|
|
129
129
|
{
|
|
130
|
-
galleryCollection:
|
|
130
|
+
galleryCollection: p,
|
|
131
131
|
onChange: c
|
|
132
132
|
}
|
|
133
133
|
),
|
|
134
134
|
t === "upload" && /* @__PURE__ */ e(
|
|
135
|
-
|
|
135
|
+
ge,
|
|
136
136
|
{
|
|
137
137
|
type: S || "image",
|
|
138
|
-
uploading:
|
|
139
|
-
dropZoneProps:
|
|
140
|
-
onUpload:
|
|
141
|
-
icon:
|
|
138
|
+
uploading: U,
|
|
139
|
+
dropZoneProps: J,
|
|
140
|
+
onUpload: Y,
|
|
141
|
+
icon: Q
|
|
142
142
|
}
|
|
143
143
|
),
|
|
144
144
|
t === "link" && /* @__PURE__ */ e(
|
|
@@ -146,13 +146,13 @@ const Ce = [
|
|
|
146
146
|
{
|
|
147
147
|
type: S || "image",
|
|
148
148
|
onChange: c,
|
|
149
|
-
isValidMediaUrl:
|
|
149
|
+
isValidMediaUrl: q
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
|
-
t === "unsplash" && /* @__PURE__ */ e(
|
|
153
|
-
t === "giphy" && /* @__PURE__ */ e(
|
|
152
|
+
t === "unsplash" && /* @__PURE__ */ e(pe, { onChange: c }),
|
|
153
|
+
t === "giphy" && /* @__PURE__ */ e(he, { onChange: c }),
|
|
154
154
|
t === "googleDrive" && l && /* @__PURE__ */ e(
|
|
155
|
-
|
|
155
|
+
fe,
|
|
156
156
|
{
|
|
157
157
|
isConnected: l.isConnected,
|
|
158
158
|
connectedEmail: l.connectedEmail,
|
|
@@ -168,104 +168,78 @@ const Ce = [
|
|
|
168
168
|
error: l.error
|
|
169
169
|
}
|
|
170
170
|
),
|
|
171
|
-
t === "media" &&
|
|
172
|
-
|
|
171
|
+
t === "media" && r && /* @__PURE__ */ e(
|
|
172
|
+
ce,
|
|
173
173
|
{
|
|
174
|
-
items:
|
|
175
|
-
isLoading:
|
|
176
|
-
breadcrumbs:
|
|
177
|
-
onFolderClick:
|
|
178
|
-
onBreadcrumbClick:
|
|
174
|
+
items: r.items,
|
|
175
|
+
isLoading: r.isLoading,
|
|
176
|
+
breadcrumbs: r.breadcrumbs,
|
|
177
|
+
onFolderClick: r.onFolderClick,
|
|
178
|
+
onBreadcrumbClick: r.onBreadcrumbClick,
|
|
179
179
|
onSelect: (n) => {
|
|
180
|
-
|
|
180
|
+
r.onSelect?.(n), m(!1);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
)
|
|
184
|
-
] }),
|
|
185
|
-
|
|
184
|
+
] }), D = /* @__PURE__ */ e(
|
|
185
|
+
de,
|
|
186
186
|
{
|
|
187
|
-
defaultValue: "gallery",
|
|
188
187
|
value: t,
|
|
189
|
-
onChange: (n) =>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
188
|
+
onChange: (n) => W(n),
|
|
189
|
+
height: 54,
|
|
190
|
+
pillPaddingX: 12,
|
|
191
|
+
items: o.map((n) => ({
|
|
192
|
+
value: n.value,
|
|
193
|
+
label: n.label,
|
|
194
|
+
disabled: X
|
|
195
|
+
})),
|
|
196
|
+
rightSlot: $ && /* @__PURE__ */ e(
|
|
197
|
+
V,
|
|
199
198
|
{
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
disabled: $,
|
|
211
|
-
h: "100%",
|
|
212
|
-
p: 0,
|
|
213
|
-
value: n.value,
|
|
214
|
-
onClick: () => z(n.value),
|
|
215
|
-
children: /* @__PURE__ */ e(r, { className: w.customTab, px: "sm", h: 36, children: n.label })
|
|
216
|
-
},
|
|
217
|
-
n.value
|
|
218
|
-
)),
|
|
219
|
-
q && /* @__PURE__ */ e(
|
|
220
|
-
A,
|
|
221
|
-
{
|
|
222
|
-
variant: "subtle",
|
|
223
|
-
fz: "sm",
|
|
224
|
-
lh: "sm",
|
|
225
|
-
fw: 500,
|
|
226
|
-
px: "sm",
|
|
227
|
-
size: "30px",
|
|
228
|
-
onClick: U,
|
|
229
|
-
color: "var(--mantine-color-gray-light-color)",
|
|
230
|
-
style: { marginLeft: "auto" },
|
|
231
|
-
children: i("remove")
|
|
232
|
-
}
|
|
233
|
-
)
|
|
234
|
-
]
|
|
199
|
+
variant: "subtle",
|
|
200
|
+
fz: "sm",
|
|
201
|
+
lh: "sm",
|
|
202
|
+
fw: 500,
|
|
203
|
+
px: "sm",
|
|
204
|
+
size: "30px",
|
|
205
|
+
onClick: L,
|
|
206
|
+
color: "var(--mantine-color-gray-light-color)",
|
|
207
|
+
style: { marginLeft: "auto" },
|
|
208
|
+
children: i("remove")
|
|
235
209
|
}
|
|
236
210
|
)
|
|
237
211
|
}
|
|
238
|
-
)
|
|
239
|
-
return
|
|
240
|
-
|
|
212
|
+
);
|
|
213
|
+
return h ? /* @__PURE__ */ e(
|
|
214
|
+
re,
|
|
241
215
|
{
|
|
242
216
|
"data-file-picker-inline": !0,
|
|
243
217
|
bdrs: 8,
|
|
244
218
|
p: 12,
|
|
245
219
|
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-7))",
|
|
246
|
-
children:
|
|
220
|
+
children: G
|
|
247
221
|
}
|
|
248
|
-
) : /* @__PURE__ */
|
|
249
|
-
|
|
222
|
+
) : /* @__PURE__ */ v(
|
|
223
|
+
P,
|
|
250
224
|
{
|
|
251
|
-
width:
|
|
225
|
+
width: H,
|
|
252
226
|
radius: "var(--mantine-spacing-sm)",
|
|
253
|
-
position:
|
|
227
|
+
position: O,
|
|
254
228
|
shadow: "md",
|
|
255
|
-
opened:
|
|
256
|
-
onChange:
|
|
229
|
+
opened: x,
|
|
230
|
+
onChange: z,
|
|
257
231
|
withinPortal: !0,
|
|
258
|
-
...
|
|
232
|
+
...w || {},
|
|
259
233
|
children: [
|
|
260
|
-
/* @__PURE__ */ e(
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
263
|
-
|
|
234
|
+
/* @__PURE__ */ e(P.Target, { children: /* @__PURE__ */ e(s, { onClick: () => z(!x), ...K, children: _ ?? Z }) }),
|
|
235
|
+
/* @__PURE__ */ v(P.Dropdown, { p: 0, children: [
|
|
236
|
+
D,
|
|
237
|
+
G
|
|
264
238
|
] })
|
|
265
239
|
]
|
|
266
240
|
}
|
|
267
241
|
);
|
|
268
242
|
};
|
|
269
243
|
export {
|
|
270
|
-
|
|
244
|
+
Oe as FilePicker
|
|
271
245
|
};
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
itemImage:
|
|
1
|
+
const e = "_itemImage_119se_1", t = "_imageAuthor_119se_27", o = "_button_119se_43", s = "_pickerDropZone_119se_63", _ = {
|
|
2
|
+
itemImage: e,
|
|
3
3
|
imageAuthor: t,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
button: _,
|
|
7
|
-
pickerDropZone: a
|
|
4
|
+
button: o,
|
|
5
|
+
pickerDropZone: s
|
|
8
6
|
};
|
|
9
7
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
n as default,
|
|
8
|
+
o as button,
|
|
9
|
+
_ as default,
|
|
13
10
|
t as imageAuthor,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
a as pickerDropZone
|
|
11
|
+
e as itemImage,
|
|
12
|
+
s as pickerDropZone
|
|
17
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d, useMemo as f } from "react";
|
|
3
3
|
import { useTranslation as x } from "react-i18next";
|
|
4
4
|
import { Search01Icon as $ } from "@hugeicons/core-free-icons";
|
|
@@ -6,17 +6,17 @@ import { HugeiconsIcon as v } from "@hugeicons/react";
|
|
|
6
6
|
import { Stack as m, FocusTrap as g, TextInput as I, Text as u, SimpleGrid as w, AspectRatio as C } from "@mantine/core";
|
|
7
7
|
import S from "./FilePicker.module.css.js";
|
|
8
8
|
const G = ({
|
|
9
|
-
galleryCollection:
|
|
9
|
+
galleryCollection: i,
|
|
10
10
|
onChange: p
|
|
11
11
|
}) => {
|
|
12
|
-
const { t: a } = x("ui"), [
|
|
13
|
-
const e =
|
|
14
|
-
return e ?
|
|
12
|
+
const { t: a } = x("ui"), [s, h] = d(""), c = f(() => {
|
|
13
|
+
const e = s.trim().toLowerCase();
|
|
14
|
+
return e ? i.map((t) => ({
|
|
15
15
|
...t,
|
|
16
|
-
items: t.items.filter((
|
|
17
|
-
})).filter((t) => t.items.length > 0) :
|
|
18
|
-
}, [
|
|
19
|
-
return /* @__PURE__ */
|
|
16
|
+
items: t.items.filter((n) => `${t.title} ${t.id} ${t.path} ${n}`.toLowerCase().includes(e))
|
|
17
|
+
})).filter((t) => t.items.length > 0) : i;
|
|
18
|
+
}, [i, s]);
|
|
19
|
+
return /* @__PURE__ */ l(m, { gap: "sm", children: [
|
|
20
20
|
/* @__PURE__ */ r(g, { active: !0, children: /* @__PURE__ */ r(
|
|
21
21
|
I,
|
|
22
22
|
{
|
|
@@ -24,11 +24,11 @@ const G = ({
|
|
|
24
24
|
maxLength: 50,
|
|
25
25
|
placeholder: a("changeCover.searchImage"),
|
|
26
26
|
"data-autofocus": !0,
|
|
27
|
-
value:
|
|
27
|
+
value: s,
|
|
28
28
|
onChange: (e) => h(e.currentTarget.value)
|
|
29
29
|
}
|
|
30
30
|
) }),
|
|
31
|
-
/* @__PURE__ */ r(m, { gap: "xs", mah: 400, w: "100%", style: { overflow: "auto" }, children:
|
|
31
|
+
/* @__PURE__ */ r(m, { gap: "xs", mah: 400, w: "100%", style: { overflow: "auto" }, children: c.length === 0 && s.trim() ? /* @__PURE__ */ r(u, { fz: "xs", c: "dimmed", ta: "center", py: "xs", children: a("changeCover.noResult") }) : c.map((e) => /* @__PURE__ */ l(m, { gap: 4, pb: "sm", children: [
|
|
32
32
|
/* @__PURE__ */ r("a", { target: "_blank", href: e?.url || "#", rel: "noreferrer", children: /* @__PURE__ */ r(
|
|
33
33
|
u,
|
|
34
34
|
{
|
|
@@ -41,7 +41,7 @@ const G = ({
|
|
|
41
41
|
children: e.title
|
|
42
42
|
}
|
|
43
43
|
) }),
|
|
44
|
-
/* @__PURE__ */ r(w, { spacing: 10, cols: 4, children: e.items.map((t,
|
|
44
|
+
/* @__PURE__ */ r(w, { spacing: 10, cols: 4, children: e.items.map((t, n) => {
|
|
45
45
|
const o = "/images/covers/" + e.path + t;
|
|
46
46
|
return /* @__PURE__ */ r(
|
|
47
47
|
C,
|
|
@@ -53,7 +53,7 @@ const G = ({
|
|
|
53
53
|
backgroundImage: `url(${o})`
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
`${e.id}-${t}-${
|
|
56
|
+
`${e.id}-${t}-${n}`
|
|
57
57
|
);
|
|
58
58
|
}) })
|
|
59
59
|
] }, e.id)) })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as l, useMemo as
|
|
2
|
+
import { useState as l, useMemo as y, useEffect as f, useCallback as I } from "react";
|
|
3
3
|
import { useTranslation as S } from "react-i18next";
|
|
4
4
|
import { Search01Icon as P } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as T } from "@hugeicons/react";
|
|
@@ -15,7 +15,7 @@ const k = (c) => (c || []).reduce((o, i) => (o[i.id] = i, o), {}), U = ({
|
|
|
15
15
|
const { t: o } = S("ui"), [i, v] = l(""), [m] = F(i, 800), [u, p] = l(1), [d, h] = l({}), { data: r, isLoading: s } = N(
|
|
16
16
|
{ q: m, limit: 24, offset: (u - 1) * 24 + 1 },
|
|
17
17
|
u
|
|
18
|
-
), a =
|
|
18
|
+
), a = y(
|
|
19
19
|
() => Object.values({ ...d, ...k(r?.items) }),
|
|
20
20
|
[d, r?.items]
|
|
21
21
|
), g = M(() => {
|
|
@@ -28,7 +28,7 @@ const k = (c) => (c || []).reduce((o, i) => (o[i.id] = i, o), {}), U = ({
|
|
|
28
28
|
}, [r?.items, g]), f(() => {
|
|
29
29
|
h({});
|
|
30
30
|
}, [m]);
|
|
31
|
-
const
|
|
31
|
+
const x = I(
|
|
32
32
|
(t) => {
|
|
33
33
|
v(t.currentTarget.value), p(1);
|
|
34
34
|
},
|
|
@@ -43,7 +43,7 @@ const k = (c) => (c || []).reduce((o, i) => (o[i.id] = i, o), {}), U = ({
|
|
|
43
43
|
placeholder: o("changeCover.searchGifs"),
|
|
44
44
|
"data-autofocus": !0,
|
|
45
45
|
value: i,
|
|
46
|
-
onChange:
|
|
46
|
+
onChange: x
|
|
47
47
|
}
|
|
48
48
|
) }),
|
|
49
49
|
/* @__PURE__ */ n(C, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as C, useRef as D, useEffect as
|
|
2
|
+
import { useState as C, useRef as D, useEffect as I, useCallback as y } from "react";
|
|
3
3
|
import { useTranslation as T } from "react-i18next";
|
|
4
4
|
import { Search01Icon as G } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as R } from "@hugeicons/react";
|
|
@@ -20,10 +20,10 @@ const O = ({
|
|
|
20
20
|
error: s
|
|
21
21
|
}) => {
|
|
22
22
|
const { t } = T("ui"), [m, S] = C(""), [u] = j(m, 800), d = D(c);
|
|
23
|
-
d.current = c,
|
|
23
|
+
d.current = c, I(() => {
|
|
24
24
|
d.current(u);
|
|
25
25
|
}, [u]);
|
|
26
|
-
const z =
|
|
26
|
+
const z = y(
|
|
27
27
|
(r) => {
|
|
28
28
|
S(r.currentTarget.value);
|
|
29
29
|
},
|
|
@@ -9,22 +9,22 @@ import { NoData as A } from "../NoData/NoData.js";
|
|
|
9
9
|
import { FilePickerSkeletonLoader as Q } from "./FilePickerSkeletonLoader.js";
|
|
10
10
|
import { useUnsplashPhotos as R } from "./api/unsplashApi.js";
|
|
11
11
|
import b from "./FilePicker.module.css.js";
|
|
12
|
-
const
|
|
12
|
+
const v = (l) => (l || []).reduce((t, o) => (t[o.id] = o, t), {}), X = ({
|
|
13
13
|
onChange: l
|
|
14
14
|
}) => {
|
|
15
|
-
const { t
|
|
15
|
+
const { t } = z("ui"), [o, x] = m(""), [u] = q(o, 800), [y, h] = m(1), [p, d] = m({}), { data: a, isLoading: n } = R(
|
|
16
16
|
{
|
|
17
17
|
query: u,
|
|
18
|
-
page:
|
|
18
|
+
page: y,
|
|
19
19
|
per_page: 24,
|
|
20
20
|
order_by: "popular"
|
|
21
21
|
}
|
|
22
22
|
), i = P(
|
|
23
|
-
() => Object.values({ ...p, ...
|
|
23
|
+
() => Object.values({ ...p, ...v(a?.items) }),
|
|
24
24
|
[p, a?.items]
|
|
25
25
|
), g = w(() => {
|
|
26
26
|
setTimeout(() => {
|
|
27
|
-
d((
|
|
27
|
+
d((r) => ({ ...r, ...v(a?.items) }));
|
|
28
28
|
}, 0);
|
|
29
29
|
}, 100);
|
|
30
30
|
f(() => {
|
|
@@ -33,8 +33,8 @@ const y = (l) => (l || []).reduce((r, o) => (r[o.id] = o, r), {}), X = ({
|
|
|
33
33
|
d({});
|
|
34
34
|
}, [u]);
|
|
35
35
|
const I = T(
|
|
36
|
-
(
|
|
37
|
-
|
|
36
|
+
(r) => {
|
|
37
|
+
x(r.currentTarget.value), h(1);
|
|
38
38
|
},
|
|
39
39
|
[]
|
|
40
40
|
);
|
|
@@ -44,7 +44,7 @@ const y = (l) => (l || []).reduce((r, o) => (r[o.id] = o, r), {}), X = ({
|
|
|
44
44
|
{
|
|
45
45
|
leftSection: n ? /* @__PURE__ */ e(F, { size: 16 }) : /* @__PURE__ */ e(j, { size: 16, icon: L }),
|
|
46
46
|
maxLength: 50,
|
|
47
|
-
placeholder:
|
|
47
|
+
placeholder: t("changeCover.searchImage"),
|
|
48
48
|
"data-autofocus": !0,
|
|
49
49
|
value: o,
|
|
50
50
|
onChange: I
|
|
@@ -52,42 +52,42 @@ const y = (l) => (l || []).reduce((r, o) => (r[o.id] = o, r), {}), X = ({
|
|
|
52
52
|
) }),
|
|
53
53
|
/* @__PURE__ */ s(c, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
|
|
54
54
|
!!i.length && /* @__PURE__ */ s(k, { gap: 8, children: [
|
|
55
|
-
/* @__PURE__ */ e(M, { cols: 4, spacing: 10, children: i.map((
|
|
55
|
+
/* @__PURE__ */ e(M, { cols: 4, spacing: 10, children: i.map((r) => /* @__PURE__ */ s(c, { children: [
|
|
56
56
|
/* @__PURE__ */ e(
|
|
57
57
|
N,
|
|
58
58
|
{
|
|
59
|
-
onClick: () => l?.(
|
|
59
|
+
onClick: () => l?.(r.urls.regular),
|
|
60
60
|
ratio: 120 / 65,
|
|
61
61
|
className: b.itemImage,
|
|
62
62
|
style: {
|
|
63
|
-
backgroundImage: `url(${
|
|
63
|
+
backgroundImage: `url(${r.urls.small})`
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
67
|
/* @__PURE__ */ e(c, { className: b.imageAuthor, children: /* @__PURE__ */ s(C, { truncate: !0, c: "gray", size: "xs", children: [
|
|
68
|
-
|
|
68
|
+
t("changeCover.photoBy"),
|
|
69
69
|
" ",
|
|
70
70
|
/* @__PURE__ */ e(
|
|
71
71
|
C,
|
|
72
72
|
{
|
|
73
73
|
component: "a",
|
|
74
74
|
inherit: !0,
|
|
75
|
-
href:
|
|
75
|
+
href: r.user.links.html,
|
|
76
76
|
target: "_blank",
|
|
77
77
|
rel: "noopener noreferrer",
|
|
78
78
|
onClick: (S) => S.stopPropagation(),
|
|
79
|
-
children:
|
|
79
|
+
children: r.user.name
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
82
|
] }) })
|
|
83
|
-
] },
|
|
83
|
+
] }, r.id)) }),
|
|
84
84
|
a?.hasMore && /* @__PURE__ */ e(
|
|
85
85
|
_,
|
|
86
86
|
{
|
|
87
87
|
variant: "subtle",
|
|
88
88
|
loading: n,
|
|
89
|
-
onClick: () => h((
|
|
90
|
-
children:
|
|
89
|
+
onClick: () => h((r) => r + 1),
|
|
90
|
+
children: t("loadMore")
|
|
91
91
|
}
|
|
92
92
|
)
|
|
93
93
|
] }),
|
|
@@ -96,7 +96,7 @@ const y = (l) => (l || []).reduce((r, o) => (r[o.id] = o, r), {}), X = ({
|
|
|
96
96
|
{
|
|
97
97
|
size: 120,
|
|
98
98
|
illustration: "noImage",
|
|
99
|
-
description:
|
|
99
|
+
description: t("changeCover.noResult"),
|
|
100
100
|
titleProps: { size: "xs", c: "dimmed" }
|
|
101
101
|
}
|
|
102
102
|
) }),
|