sanity-plugin-media 5.0.4 → 5.0.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/index.d.ts.map +1 -1
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/package.json +11 -12
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":";;;;;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;
|
|
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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/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
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";
|
|
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
|
-
import { useRef, useCallback, useEffect, createContext, useContext, useMemo, useState,
|
|
5
|
+
import { useRef, useCallback, useEffect, createContext, useContext, useMemo, useState, memo, Component } from "react";
|
|
6
6
|
import { isHotkey } from "is-hotkey-esm";
|
|
7
7
|
import { css, createGlobalStyle, styled } from "styled-components";
|
|
8
8
|
import { useSelector, useDispatch, Provider } from "react-redux";
|
|
@@ -2471,7 +2471,7 @@ const getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asse
|
|
|
2471
2471
|
error
|
|
2472
2472
|
] }) }), fallbackPlacements: ["top", "left"], placement: "right", portal: !0, children: /* @__PURE__ */ jsx(StyledErrorOutlineIcon, {}) }) })
|
|
2473
2473
|
] }) }),
|
|
2474
|
-
description && /* @__PURE__ */ jsx(Box, { marginY: 3, children: /* @__PURE__ */ jsx(Text, { htmlFor: name, muted: !0, size: 1, children: description }) })
|
|
2474
|
+
description && /* @__PURE__ */ jsx(Box, { marginY: 3, children: /* @__PURE__ */ jsx(Text, { as: "label", htmlFor: name, muted: !0, size: 1, children: description }) })
|
|
2475
2475
|
] });
|
|
2476
2476
|
}, FormFieldInputTags = (props) => {
|
|
2477
2477
|
const {
|
|
@@ -2526,7 +2526,7 @@ const getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asse
|
|
|
2526
2526
|
]
|
|
2527
2527
|
}
|
|
2528
2528
|
);
|
|
2529
|
-
}, FormFieldInputText =
|
|
2529
|
+
}, FormFieldInputText = (props) => {
|
|
2530
2530
|
const {
|
|
2531
2531
|
description,
|
|
2532
2532
|
disabled,
|
|
@@ -2535,13 +2535,14 @@ const getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asse
|
|
|
2535
2535
|
name,
|
|
2536
2536
|
placeholder,
|
|
2537
2537
|
value,
|
|
2538
|
+
ref,
|
|
2538
2539
|
...rest
|
|
2539
2540
|
} = props;
|
|
2540
2541
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
2541
2542
|
/* @__PURE__ */ jsx(FormFieldInputLabel, { description, error, label, name }),
|
|
2542
2543
|
/* @__PURE__ */ jsx(TextInput, { ...rest, autoComplete: "off", autoFocus: !0, defaultValue: value, disabled, id: name, name, placeholder, ref })
|
|
2543
2544
|
] });
|
|
2544
|
-
}
|
|
2545
|
+
}, FormFieldInputTextarea = (props) => {
|
|
2545
2546
|
const {
|
|
2546
2547
|
description,
|
|
2547
2548
|
disabled,
|
|
@@ -2551,13 +2552,14 @@ const getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asse
|
|
|
2551
2552
|
placeholder,
|
|
2552
2553
|
rows,
|
|
2553
2554
|
value,
|
|
2555
|
+
ref,
|
|
2554
2556
|
...rest
|
|
2555
2557
|
} = props;
|
|
2556
2558
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
2557
2559
|
/* @__PURE__ */ jsx(FormFieldInputLabel, { description, error, label, name }),
|
|
2558
2560
|
/* @__PURE__ */ jsx(TextArea, { ...rest, autoComplete: "off", defaultValue: value, disabled, id: name, name, placeholder, ref, rows })
|
|
2559
2561
|
] });
|
|
2560
|
-
}
|
|
2562
|
+
};
|
|
2561
2563
|
function toStringField(value) {
|
|
2562
2564
|
if (typeof value == "string") return value;
|
|
2563
2565
|
if (typeof value == "object" && value !== null)
|
|
@@ -3723,22 +3725,24 @@ const CardWrapper = styled(Flex).withConfig({
|
|
|
3723
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({
|
|
3724
3726
|
displayName: "StyledItemContainer",
|
|
3725
3727
|
componentId: "sc-9owt7i-0"
|
|
3726
|
-
})`height:${CARD_HEIGHT}px;width:${CARD_WIDTH}px;`, ItemContainer =
|
|
3728
|
+
})`height:${CARD_HEIGHT}px;width:${CARD_WIDTH}px;`, ItemContainer = (props) => {
|
|
3727
3729
|
const {
|
|
3728
3730
|
context,
|
|
3731
|
+
ref,
|
|
3729
3732
|
...rest
|
|
3730
3733
|
} = props;
|
|
3731
3734
|
return /* @__PURE__ */ jsx(StyledItemContainer, { ref, ...rest });
|
|
3732
|
-
}
|
|
3735
|
+
}, StyledListContainer = styled.div.withConfig({
|
|
3733
3736
|
displayName: "StyledListContainer",
|
|
3734
3737
|
componentId: "sc-9owt7i-1"
|
|
3735
|
-
})`display:grid;grid-template-columns:repeat(auto-fill,${CARD_WIDTH}px);grid-template-rows:repeat(auto-fill,${CARD_HEIGHT}px);justify-content:center;margin:0 auto;`, ListContainer =
|
|
3738
|
+
})`display:grid;grid-template-columns:repeat(auto-fill,${CARD_WIDTH}px);grid-template-rows:repeat(auto-fill,${CARD_HEIGHT}px);justify-content:center;margin:0 auto;`, ListContainer = (props) => {
|
|
3736
3739
|
const {
|
|
3737
3740
|
context,
|
|
3741
|
+
ref,
|
|
3738
3742
|
...rest
|
|
3739
3743
|
} = props;
|
|
3740
3744
|
return /* @__PURE__ */ jsx(StyledListContainer, { ref, ...rest });
|
|
3741
|
-
}
|
|
3745
|
+
}, AssetGridVirtualized = (props) => {
|
|
3742
3746
|
const {
|
|
3743
3747
|
items,
|
|
3744
3748
|
onLoadMore
|