sanity-plugin-media 5.0.6 → 5.0.7

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 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: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
162
+ icon: typeof ImageIcon;
162
163
  name: string;
163
164
  title: string;
164
165
  };
@@ -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":";;;;;KAqBY,YAAA;EACV,YAAA;EACA,eAAA,GAAkB,KAAA;EAClB,OAAA,EAAS,OAAA,CAAQ,aAAA;EACjB,MAAA,EAAQ,WAAA,CAAY,aAAA;EACpB,QAAA,EAAU,eAAA,CAAgB,aAAA;EAC1B,aAAA,EAAe,eAAA;EACf,eAAA,EAAiB,eAAA;EACjB,YAAA,EAAc,KAAA;EACd,UAAA;IACE,OAAA;IACA,cAAA;EAAA;EAEF,OAAA,GAAU,MAAA;AAAA;AAAA,cCpBC,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;iBAKZ,kBAAA,CAAmB,OAAA;EAAW,EAAA;AAAA,MAAa,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCJ/C,gBAAA;EACV,SAAS;AAAA;AAAA,KAGC,gBAAA;EACV,iBAAA;EACA,kBAAA;EACA,UAAA;IACE,OAAA,GAAU,aAAA,CACR,YAAA;MAAgB,oBAAA,GAAuB,KAAA,EAAO,YAAA,KAAiB,GAAA,CAAI,OAAA;IAAA;EAAA;EAGvE,UAAA;IACE,OAAA;IACA,cAAA;EAAA;EAEF,aAAA;EFRA;;;;EEaA,OAAA,GAAU,MAAA;AAAA;AAAA,KAGA,MAAA;EACV,KAAA;EACA,EAAA;EAAA,CACC,GAAA;AAAA;AAAA,KAGE,eAAA,YAA2B,MAAM;AAAA,KAEjC,YAAA;EACH,OAAA,GAAU,eAAA;EACV,WAAA,GAAc,eAAA;EACd,GAAA;IACE,KAAA;MACE,IAAA,GAAO,eAAA;IAAA;EAAA;EAGX,KAAA,GAAQ,eAAA;AAAA;AAAA,KAYE,KAAA,GAAQ,SAAA,GAAY,UAAU;AAAA,KAE9B,aAAA,GAAgB,CAAA,CAA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 {"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":";;;;;;KAqBY,YAAA;EACV,YAAA;EACA,eAAA,GAAkB,KAAA;EAClB,OAAA,EAAS,OAAA,CAAQ,aAAA;EACjB,MAAA,EAAQ,WAAA,CAAY,aAAA;EACpB,QAAA,EAAU,eAAA,CAAgB,aAAA;EAC1B,aAAA,EAAe,eAAA;EACf,eAAA,EAAiB,eAAA;EACjB,YAAA,EAAc,KAAA;EACd,UAAA;IACE,OAAA;IACA,cAAA;EAAA;EAEF,OAAA,GAAU,MAAA;AAAA;AAAA,cCpBC,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;iBAKZ,kBAAA,CAAmB,OAAA;EAAW,EAAA;AAAA,MAAa,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KCJ/C,gBAAA;EACV,SAAS;AAAA;AAAA,KAGC,gBAAA;EACV,iBAAA;EACA,kBAAA;EACA,UAAA;IACE,OAAA,GAAU,aAAA,CACR,YAAA;MAAgB,oBAAA,GAAuB,KAAA,EAAO,YAAA,KAAiB,GAAA,CAAI,OAAA;IAAA;EAAA;EAGvE,UAAA;IACE,OAAA;IACA,cAAA;EAAA;EAEF,aAAA;EFTA;;;;EEcA,OAAA,GAAU,MAAA;AAAA;AAAA,KAGA,MAAA;EACV,KAAA;EACA,EAAA;EAAA,CACC,GAAA;AAAA;AAAA,KAGE,eAAA,YAA2B,MAAM;AAAA,KAEjC,YAAA;EACH,OAAA,GAAU,eAAA;EACV,WAAA,GAAc,eAAA;EACd,GAAA;IACE,KAAA;MACE,IAAA,GAAO,eAAA;IAAA;EAAA;EAGX,KAAA,GAAQ,eAAA;AAAA;AAAA,KAYE,KAAA,GAAQ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AAAA,iBAChE,UAAA,CAAW,MAAA,EAAQ,oBAAA,GAAuB,oBAAoB"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { ThLargeIcon, ThListIcon, SortIcon, CloseIcon, SelectIcon, AddIcon, SearchIcon, PlugIcon, ClipboardIcon, DownloadIcon, ChevronDownIcon, ErrorOutlineIcon, WarningOutlineIcon, EditIcon, ArrowUpIcon, ArrowDownIcon, TrashIcon, ComposeIcon, Icon, UploadIcon, CheckmarkCircleIcon, WarningFilledIcon, ChevronUpIcon, ImageIcon } from "@sanity/icons";
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";
@@ -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 { Icon } from "@sanity/icons";
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) => {