sanity-plugin-media 5.0.6 → 5.0.8
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/index.d.ts +14 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -28
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ImageIcon } from "@sanity/icons/Image";
|
|
1
2
|
import { SanityAssetDocument, SanityImageAssetDocument } from "@sanity/client";
|
|
2
3
|
import { ComponentType, JSX } from "react";
|
|
3
4
|
import * as z from "zod";
|
|
@@ -22,11 +23,11 @@ declare const tagOptionSchema: z.ZodObject<{
|
|
|
22
23
|
label: z.ZodString;
|
|
23
24
|
value: z.ZodString;
|
|
24
25
|
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
value: string;
|
|
26
26
|
label: string;
|
|
27
|
-
}, {
|
|
28
27
|
value: string;
|
|
28
|
+
}, {
|
|
29
29
|
label: string;
|
|
30
|
+
value: string;
|
|
30
31
|
}>;
|
|
31
32
|
declare function getAssetFormSchema(locales?: {
|
|
32
33
|
id: string;
|
|
@@ -40,35 +41,35 @@ declare function getAssetFormSchema(locales?: {
|
|
|
40
41
|
label: z.ZodString;
|
|
41
42
|
value: z.ZodString;
|
|
42
43
|
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
value: string;
|
|
44
44
|
label: string;
|
|
45
|
-
}, {
|
|
46
45
|
value: string;
|
|
46
|
+
}, {
|
|
47
47
|
label: string;
|
|
48
|
+
value: string;
|
|
48
49
|
}>, "many">>;
|
|
49
50
|
}, "strip", z.ZodTypeAny, {
|
|
50
51
|
tags: {
|
|
51
|
-
value: string;
|
|
52
52
|
label: string;
|
|
53
|
+
value: string;
|
|
53
54
|
}[] | null;
|
|
54
55
|
}, {
|
|
55
56
|
tags: {
|
|
56
|
-
value: string;
|
|
57
57
|
label: string;
|
|
58
|
+
value: string;
|
|
58
59
|
}[] | null;
|
|
59
60
|
}>;
|
|
60
61
|
}, "strip", z.ZodTypeAny, {
|
|
61
62
|
media: {
|
|
62
63
|
tags: {
|
|
63
|
-
value: string;
|
|
64
64
|
label: string;
|
|
65
|
+
value: string;
|
|
65
66
|
}[] | null;
|
|
66
67
|
};
|
|
67
68
|
}, {
|
|
68
69
|
media: {
|
|
69
70
|
tags: {
|
|
70
|
-
value: string;
|
|
71
71
|
label: string;
|
|
72
|
+
value: string;
|
|
72
73
|
}[] | null;
|
|
73
74
|
};
|
|
74
75
|
}>;
|
|
@@ -79,28 +80,28 @@ declare function getAssetFormSchema(locales?: {
|
|
|
79
80
|
opt: {
|
|
80
81
|
media: {
|
|
81
82
|
tags: {
|
|
82
|
-
value: string;
|
|
83
83
|
label: string;
|
|
84
|
+
value: string;
|
|
84
85
|
}[] | null;
|
|
85
86
|
};
|
|
86
87
|
};
|
|
88
|
+
title?: string | z.objectOutputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
87
89
|
altText?: string | z.objectOutputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
88
90
|
description?: string | z.objectOutputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
89
|
-
title?: string | z.objectOutputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
90
91
|
creditLine?: string | z.objectOutputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
91
92
|
}, {
|
|
92
93
|
originalFilename: string;
|
|
93
94
|
opt: {
|
|
94
95
|
media: {
|
|
95
96
|
tags: {
|
|
96
|
-
value: string;
|
|
97
97
|
label: string;
|
|
98
|
+
value: string;
|
|
98
99
|
}[] | null;
|
|
99
100
|
};
|
|
100
101
|
};
|
|
102
|
+
title?: string | z.objectInputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
101
103
|
altText?: string | z.objectInputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
102
104
|
description?: string | z.objectInputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
103
|
-
title?: string | z.objectInputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
104
105
|
creditLine?: string | z.objectInputType<Record<string, z.ZodTypeAny>, z.ZodTypeAny, "passthrough"> | undefined;
|
|
105
106
|
}>;
|
|
106
107
|
type MediaTagsOptions = {
|
|
@@ -158,7 +159,7 @@ type SanityReference = {
|
|
|
158
159
|
type TagSelectOption = z.infer<typeof tagOptionSchema>;
|
|
159
160
|
declare const mediaAssetSource: {
|
|
160
161
|
component: (props: import("sanity").AssetSourceComponentProps) => import("react").JSX.Element;
|
|
161
|
-
icon:
|
|
162
|
+
icon: typeof ImageIcon;
|
|
162
163
|
name: string;
|
|
163
164
|
title: string;
|
|
164
165
|
};
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/DialogAssetEdit/Details.tsx","../src/formSchema/index.ts","../src/types/index.ts","../src/plugin.tsx","../src/components/AutoTagInputWrapper/index.tsx","../src/utils/mediaField.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/DialogAssetEdit/Details.tsx","../src/formSchema/index.ts","../src/types/index.ts","../src/plugin.tsx","../src/components/AutoTagInputWrapper/index.tsx","../src/utils/mediaField.ts"],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { ImageIcon } from "@sanity/icons/Image";
|
|
3
3
|
import { useClient, useColorSchemeValue, useSchema, Preview, useDocumentStore, WithReferringDocuments, useFormValue, definePlugin } from "sanity";
|
|
4
4
|
import { Inline, Button, usePortal, MenuButton, Menu as Menu$2, MenuItem, MenuDivider, Box, studioTheme, Flex, Label, Text, rem, TextInput, Card, MenuGroup, useMediaIndex, Tooltip, Switch, Popover, Stack, Dialog as Dialog$1, TextArea, TabList, Tab, TabPanel, Container as Container$2, Spinner, Checkbox, Grid, useToast, PortalProvider, useLayer, Portal } from "@sanity/ui";
|
|
5
5
|
import { useRef, useCallback, useEffect, createContext, useContext, useMemo, useState, memo, Component } from "react";
|
|
6
6
|
import { isHotkey } from "is-hotkey-esm";
|
|
7
|
-
import {
|
|
7
|
+
import { createGlobalStyle, css, styled } from "styled-components";
|
|
8
8
|
import { useSelector, useDispatch, Provider } from "react-redux";
|
|
9
9
|
import { createAction, createSlice, isAnyOf, createSelector, combineReducers, configureStore } from "@reduxjs/toolkit";
|
|
10
10
|
import pluralize from "pluralize";
|
|
@@ -14,19 +14,42 @@ import { delay, mergeMap, filter, withLatestFrom, catchError, switchMap, bufferT
|
|
|
14
14
|
import groq from "groq";
|
|
15
15
|
import { nanoid } from "nanoid";
|
|
16
16
|
import { uuid } from "@sanity/uuid";
|
|
17
|
+
import { ThLargeIcon } from "@sanity/icons/ThLarge";
|
|
18
|
+
import { ThListIcon } from "@sanity/icons/ThList";
|
|
19
|
+
import { SortIcon } from "@sanity/icons/Sort";
|
|
17
20
|
import { useNProgress } from "@tanem/react-nprogress";
|
|
21
|
+
import { SelectIcon } from "@sanity/icons/Select";
|
|
22
|
+
import { CloseIcon } from "@sanity/icons/Close";
|
|
18
23
|
import { hues, white } from "@sanity/color";
|
|
19
24
|
import Select, { components } from "react-select";
|
|
20
25
|
import { Virtuoso, VirtuosoGrid, GroupedVirtuoso } from "react-virtuoso";
|
|
26
|
+
import { AddIcon } from "@sanity/icons/Add";
|
|
27
|
+
import { SearchIcon } from "@sanity/icons/Search";
|
|
28
|
+
import { PlugIcon } from "@sanity/icons/Plug";
|
|
21
29
|
import { Controller, useForm } from "react-hook-form";
|
|
22
30
|
import * as z from "zod";
|
|
23
31
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
32
|
+
import { DownloadIcon } from "@sanity/icons/Download";
|
|
24
33
|
import { format, formatRelative } from "date-fns";
|
|
25
34
|
import filesize from "filesize";
|
|
35
|
+
import { ClipboardIcon } from "@sanity/icons/Clipboard";
|
|
26
36
|
import copy from "copy-to-clipboard";
|
|
27
37
|
import { useIntentLink } from "sanity/router";
|
|
28
38
|
import { FileIcon as FileIcon$1, defaultStyles } from "react-file-icon";
|
|
29
39
|
import CreatableSelect from "react-select/creatable";
|
|
40
|
+
import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
|
|
41
|
+
import { ErrorOutlineIcon } from "@sanity/icons/ErrorOutline";
|
|
42
|
+
import { WarningOutlineIcon } from "@sanity/icons/WarningOutline";
|
|
43
|
+
import { ArrowDownIcon } from "@sanity/icons/ArrowDown";
|
|
44
|
+
import { ArrowUpIcon } from "@sanity/icons/ArrowUp";
|
|
45
|
+
import { EditIcon } from "@sanity/icons/Edit";
|
|
46
|
+
import { TrashIcon } from "@sanity/icons/Trash";
|
|
47
|
+
import { ComposeIcon } from "@sanity/icons/Compose";
|
|
48
|
+
import { ArrowRightIcon } from "@sanity/icons/ArrowRight";
|
|
49
|
+
import { UploadIcon } from "@sanity/icons/Upload";
|
|
50
|
+
import { CheckmarkCircleIcon } from "@sanity/icons/CheckmarkCircle";
|
|
51
|
+
import { WarningFilledIcon } from "@sanity/icons/WarningFilled";
|
|
52
|
+
import { ChevronUpIcon } from "@sanity/icons/ChevronUp";
|
|
30
53
|
import { useDropzone } from "react-dropzone";
|
|
31
54
|
const useKeyPress = (hotkey, onPress) => {
|
|
32
55
|
const keyPressed = useRef(!1), downHandler = useCallback((e) => {
|
|
@@ -52,7 +75,7 @@ const useKeyPress = (hotkey, onPress) => {
|
|
|
52
75
|
return context;
|
|
53
76
|
}, useVersionedClient = () => useClient({
|
|
54
77
|
apiVersion: "2025-10-02"
|
|
55
|
-
}), customScrollbar = css
|
|
78
|
+
}), customScrollbar = /* @__PURE__ */ css(["::-webkit-scrollbar{width:14px;}::-webkit-scrollbar-thumb{border-radius:10px;border:4px solid rgba(0,0,0,0);background:var(--card-border-color);background-clip:padding-box;&:hover{background:var(--card-muted-fg-color);background-clip:padding-box;}}"]), GlobalStyle = /* @__PURE__ */ createGlobalStyle([".media__custom-scrollbar{", '}div[data-ui="Box"]{', '}div[data-ui="Dialog"]{background-color:rgba(15,17,18,0.9);}'], customScrollbar, customScrollbar), useTypedSelector = useSelector, ORDER_DICTIONARY = {
|
|
56
79
|
_createdAt: {
|
|
57
80
|
asc: "Last created: Oldest first",
|
|
58
81
|
desc: "Last created: Newest first"
|
|
@@ -1706,7 +1729,7 @@ const Container$1 = /* @__PURE__ */ styled(Box).withConfig({
|
|
|
1706
1729
|
})(({
|
|
1707
1730
|
$scheme,
|
|
1708
1731
|
theme
|
|
1709
|
-
}) => css
|
|
1732
|
+
}) => css(["background:", ";border-radius:", ";"], getSchemeColor($scheme, "bg"), rem(theme.sanity.radius[2]))), SearchFacet = (props) => {
|
|
1710
1733
|
const {
|
|
1711
1734
|
children,
|
|
1712
1735
|
facet
|
|
@@ -1949,7 +1972,7 @@ const Container$1 = /* @__PURE__ */ styled(Box).withConfig({
|
|
|
1949
1972
|
componentId: "sc-cuu8kf-0"
|
|
1950
1973
|
})(({
|
|
1951
1974
|
theme
|
|
1952
|
-
}) => css
|
|
1975
|
+
}) => css(["> *{margin-bottom:", ";}"], rem(theme.sanity.space[2]))), SearchFacets = (props) => {
|
|
1953
1976
|
const {
|
|
1954
1977
|
layout = "inline"
|
|
1955
1978
|
} = props, searchFacets = useTypedSelector((state) => state.search.facets), Items2 = searchFacets.map((facet) => {
|
|
@@ -2285,7 +2308,7 @@ const getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asse
|
|
|
2285
2308
|
componentId: "sc-19eu02y-0"
|
|
2286
2309
|
})(({
|
|
2287
2310
|
theme
|
|
2288
|
-
}) => css
|
|
2311
|
+
}) => css(["text{font-family:", " !important;font-size:8px !important;font-weight:500 !important;}"], theme.sanity.fonts.text.family)), FileIcon = (props) => {
|
|
2289
2312
|
const {
|
|
2290
2313
|
extension,
|
|
2291
2314
|
onClick,
|
|
@@ -2324,10 +2347,10 @@ const getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asse
|
|
|
2324
2347
|
] }) : content = "No unpublished changes" : content = "There are validation errors that need to be fixed before this document can be published", /* @__PURE__ */ jsx(Tooltip, { animate: !0, content: /* @__PURE__ */ jsx(Box, { padding: 3, style: {
|
|
2325
2348
|
maxWidth: "185px"
|
|
2326
2349
|
}, children: /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: content }) }), disabled: "ontouchstart" in window, placement: "top", portal: !0, children: /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Button, { disabled, fontSize: 1, onClick, text: "Save and close", tone: "primary" }) }) });
|
|
2327
|
-
}, Image$1 = styled.img.withConfig({
|
|
2350
|
+
}, Image$1 = /* @__PURE__ */ styled.img.withConfig({
|
|
2328
2351
|
displayName: "Image",
|
|
2329
2352
|
componentId: "sc-hf3ld2-0"
|
|
2330
|
-
})
|
|
2353
|
+
})(["--checkerboard-color:", ";display:block;width:100%;height:100%;object-fit:contain;", ""], (props) => props.$scheme ? getSchemeColor(props.$scheme, "bg2") : "inherit", (props) => props.$showCheckerboard && css(["background-image:linear-gradient(45deg,var(--checkerboard-color) 25%,transparent 25%),linear-gradient(-45deg,var(--checkerboard-color) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--checkerboard-color) 75%),linear-gradient(-45deg,transparent 75%,var(--checkerboard-color) 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0;"])), {
|
|
2331
2354
|
radius: themeRadius,
|
|
2332
2355
|
space: themeSpace
|
|
2333
2356
|
} = studioTheme, reactSelectStyles = (scheme) => ({
|
|
@@ -3035,13 +3058,13 @@ const DialogAssetEdit = (props) => {
|
|
|
3035
3058
|
]
|
|
3036
3059
|
}
|
|
3037
3060
|
) : null;
|
|
3038
|
-
}, TagContainer = styled(Flex).withConfig({
|
|
3061
|
+
}, TagContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3039
3062
|
displayName: "TagContainer",
|
|
3040
3063
|
componentId: "sc-sujhn-0"
|
|
3041
|
-
})
|
|
3064
|
+
})(["height:", "px;"], PANEL_HEIGHT), ButtonContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3042
3065
|
displayName: "ButtonContainer",
|
|
3043
3066
|
componentId: "sc-sujhn-1"
|
|
3044
|
-
})
|
|
3067
|
+
})(["@media (pointer:fine){visibility:hidden;}@media (hover:hover) and (pointer:fine){", ":hover &{visibility:visible;}}"], TagContainer), TagButton = (props) => {
|
|
3045
3068
|
const {
|
|
3046
3069
|
disabled,
|
|
3047
3070
|
icon,
|
|
@@ -3253,7 +3276,7 @@ const DialogAssetEdit = (props) => {
|
|
|
3253
3276
|
selectedDocument && /* @__PURE__ */ jsx(Box, { display: ["none", "none", "block"], children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
3254
3277
|
/* @__PURE__ */ jsx("span", { style: {
|
|
3255
3278
|
margin: "0 0.5em"
|
|
3256
|
-
}, children: /* @__PURE__ */ jsx(
|
|
3279
|
+
}, children: /* @__PURE__ */ jsx(ArrowRightIcon, {}) }),
|
|
3257
3280
|
/* @__PURE__ */ jsx("span", { style: {
|
|
3258
3281
|
textTransform: "capitalize"
|
|
3259
3282
|
}, children: selectedDocument._type })
|
|
@@ -3301,22 +3324,22 @@ const DialogAssetEdit = (props) => {
|
|
|
3301
3324
|
id,
|
|
3302
3325
|
type: "upload"
|
|
3303
3326
|
})), ...assetItems];
|
|
3304
|
-
}), CardWrapper$1 = styled(Flex).withConfig({
|
|
3327
|
+
}), CardWrapper$1 = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3305
3328
|
displayName: "CardWrapper",
|
|
3306
3329
|
componentId: "sc-88amzd-0"
|
|
3307
|
-
})
|
|
3330
|
+
})(["box-sizing:border-box;height:100%;overflow:hidden;position:relative;width:100%;"]), CardContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3308
3331
|
displayName: "CardContainer",
|
|
3309
3332
|
componentId: "sc-88amzd-1"
|
|
3310
3333
|
})(({
|
|
3311
3334
|
$picked,
|
|
3312
3335
|
theme,
|
|
3313
3336
|
$updating
|
|
3314
|
-
}) => css
|
|
3337
|
+
}) => css(["border:1px solid transparent;height:100%;pointer-events:", ";position:relative;transition:all 300ms;user-select:none;width:100%;border:", ";", ""], $updating ? "none" : "auto", $picked ? `1px solid ${theme.sanity.color.spot.orange} !important` : "1px solid inherit", !$updating && css(["@media (hover:hover) and (pointer:fine){&:hover{border:1px solid var(--card-border-color);}}"]))), ContextActionContainer$2 = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3315
3338
|
displayName: "ContextActionContainer",
|
|
3316
3339
|
componentId: "sc-88amzd-2"
|
|
3317
3340
|
})(({
|
|
3318
3341
|
$scheme
|
|
3319
|
-
}) => css
|
|
3342
|
+
}) => css(["cursor:pointer;height:", "px;transition:all 300ms;@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}"], PANEL_HEIGHT, getSchemeColor($scheme, "bg"))), StyledWarningOutlineIcon = /* @__PURE__ */ styled(WarningFilledIcon).withConfig({
|
|
3320
3343
|
displayName: "StyledWarningOutlineIcon",
|
|
3321
3344
|
componentId: "sc-88amzd-3"
|
|
3322
3345
|
})(({
|
|
@@ -3647,10 +3670,10 @@ const createThrottler = (concurrency = DEFAULT_CONCURRENCY) => {
|
|
|
3647
3670
|
...uploadsSlice.actions
|
|
3648
3671
|
};
|
|
3649
3672
|
var uploadsReducer = uploadsSlice.reducer;
|
|
3650
|
-
const CardWrapper = styled(Flex).withConfig({
|
|
3673
|
+
const CardWrapper = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3651
3674
|
displayName: "CardWrapper",
|
|
3652
3675
|
componentId: "sc-11n35er-0"
|
|
3653
|
-
})
|
|
3676
|
+
})(["box-sizing:border-box;height:100%;overflow:hidden;position:relative;width:100%;"]), CardUpload = (props) => {
|
|
3654
3677
|
const {
|
|
3655
3678
|
id
|
|
3656
3679
|
} = props, scheme = useColorSchemeValue(), dispatch = useDispatch(), item = useTypedSelector((state) => selectUploadById(state, id));
|
|
@@ -3722,20 +3745,20 @@ const CardWrapper = styled(Flex).withConfig({
|
|
|
3722
3745
|
}, CARD_HEIGHT = 220, CARD_WIDTH = 240, VirtualCell = memo(({
|
|
3723
3746
|
item,
|
|
3724
3747
|
selected
|
|
3725
|
-
}) => item?.type === "asset" ? /* @__PURE__ */ jsx(CardAsset, { id: item.id, selected }) : item?.type === "upload" ? /* @__PURE__ */ jsx(CardUpload, { id: item.id }) : null), StyledItemContainer = styled.div.withConfig({
|
|
3748
|
+
}) => item?.type === "asset" ? /* @__PURE__ */ jsx(CardAsset, { id: item.id, selected }) : item?.type === "upload" ? /* @__PURE__ */ jsx(CardUpload, { id: item.id }) : null), StyledItemContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
3726
3749
|
displayName: "StyledItemContainer",
|
|
3727
3750
|
componentId: "sc-9owt7i-0"
|
|
3728
|
-
})
|
|
3751
|
+
})(["height:", "px;width:", "px;"], CARD_HEIGHT, CARD_WIDTH), ItemContainer = (props) => {
|
|
3729
3752
|
const {
|
|
3730
3753
|
context,
|
|
3731
3754
|
ref,
|
|
3732
3755
|
...rest
|
|
3733
3756
|
} = props;
|
|
3734
3757
|
return /* @__PURE__ */ jsx(StyledItemContainer, { ref, ...rest });
|
|
3735
|
-
}, StyledListContainer = styled.div.withConfig({
|
|
3758
|
+
}, StyledListContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
3736
3759
|
displayName: "StyledListContainer",
|
|
3737
3760
|
componentId: "sc-9owt7i-1"
|
|
3738
|
-
})
|
|
3761
|
+
})(["display:grid;grid-template-columns:repeat(auto-fill,", "px);grid-template-rows:repeat(auto-fill,", "px);justify-content:center;margin:0 auto;"], CARD_WIDTH, CARD_HEIGHT), ListContainer = (props) => {
|
|
3739
3762
|
const {
|
|
3740
3763
|
context,
|
|
3741
3764
|
ref,
|
|
@@ -3795,7 +3818,7 @@ const CardWrapper = styled(Flex).withConfig({
|
|
|
3795
3818
|
componentId: "sc-i9fhtm-0"
|
|
3796
3819
|
})(({
|
|
3797
3820
|
$scheme
|
|
3798
|
-
}) => css
|
|
3821
|
+
}) => css(["cursor:pointer;@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}"], getSchemeColor($scheme, "bg"))), TableHeader = () => {
|
|
3799
3822
|
const scheme = useColorSchemeValue(), dispatch = useDispatch(), fetching = useTypedSelector((state) => state.assets.fetching), itemsLength = useTypedSelector(selectAssetsLength), numPickedAssets = useTypedSelector(selectAssetsPickedLength), mediaIndex = useMediaIndex(), {
|
|
3800
3823
|
onSelect
|
|
3801
3824
|
} = useAssetSourceActions(), allSelected = numPickedAssets === itemsLength, handleContextActionClick = (e) => {
|
|
@@ -3841,12 +3864,12 @@ const CardWrapper = styled(Flex).withConfig({
|
|
|
3841
3864
|
$scheme,
|
|
3842
3865
|
$selected,
|
|
3843
3866
|
$updating
|
|
3844
|
-
}) => css
|
|
3867
|
+
}) => css(["align-items:center;cursor:", ";height:100%;pointer-events:", ";user-select:none;white-space:nowrap;", ""], $selected ? "default" : "pointer", $updating ? "none" : "auto", !$updating && css(["@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}"], getSchemeColor($scheme, "bg")))), ContextActionContainer = /* @__PURE__ */ styled(Flex).withConfig({
|
|
3845
3868
|
displayName: "ContextActionContainer",
|
|
3846
3869
|
componentId: "sc-1nb1qw9-1"
|
|
3847
3870
|
})(({
|
|
3848
3871
|
$scheme
|
|
3849
|
-
}) => css
|
|
3872
|
+
}) => css(["cursor:pointer;@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}"], getSchemeColor($scheme, "bg2"))), StyledWarningIcon = /* @__PURE__ */ styled(WarningFilledIcon).withConfig({
|
|
3850
3873
|
displayName: "StyledWarningIcon",
|
|
3851
3874
|
componentId: "sc-1nb1qw9-2"
|
|
3852
3875
|
})(({
|
|
@@ -4350,13 +4373,13 @@ const TagsPanel = () => useTypedSelector((state) => state.tags.panelVisible) ? /
|
|
|
4350
4373
|
right: 0,
|
|
4351
4374
|
top: 0,
|
|
4352
4375
|
width: "100%"
|
|
4353
|
-
}, children: /* @__PURE__ */ jsx(TagView, {}) }) }) : null, UploadContainer = styled.div.withConfig({
|
|
4376
|
+
}, children: /* @__PURE__ */ jsx(TagView, {}) }) }) : null, UploadContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
4354
4377
|
displayName: "UploadContainer",
|
|
4355
4378
|
componentId: "sc-1wiv2t5-0"
|
|
4356
|
-
})
|
|
4379
|
+
})(["color:white;height:100%;min-height:100%;right:0;top:0;width:100%;&:focus{outline:none;}"]), DragActiveContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
4357
4380
|
displayName: "DragActiveContainer",
|
|
4358
4381
|
componentId: "sc-1wiv2t5-1"
|
|
4359
|
-
})
|
|
4382
|
+
})(["align-items:center;background:rgba(0,0,0,0.75);display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;width:100%;z-index:3;"]);
|
|
4360
4383
|
async function filterFiles(fileList) {
|
|
4361
4384
|
const files = Array.from(fileList), filteredFiles = [];
|
|
4362
4385
|
for (const file of files)
|