sanity-plugin-media 2.4.2 → 3.0.0
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.js +2 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -15
- package/src/components/AssetGridVirtualized/index.tsx +0 -1
- package/src/components/ButtonAssetCopy/index.tsx +1 -1
- package/src/components/Progress/index.tsx +0 -1
- package/src/components/SearchFacetTags/index.tsx +1 -1
- package/src/components/TableRowAsset/index.tsx +1 -1
- package/src/styled/react-select/creatable.tsx +0 -9
- package/src/styled/react-select/single.tsx +0 -8
package/dist/index.js
CHANGED
|
@@ -2033,7 +2033,6 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
|
|
|
2033
2033
|
radius: themeRadius$1,
|
|
2034
2034
|
space: themeSpace$1
|
|
2035
2035
|
} = ui.studioTheme, reactSelectStyles$1 = (scheme) => ({
|
|
2036
|
-
// @ts-expect-error - fix typings later
|
|
2037
2036
|
control: (styles, { isDisabled, isFocused }) => {
|
|
2038
2037
|
let boxShadow = "inset 0 0 0 1px var(--card-border-color)";
|
|
2039
2038
|
return isFocused && (boxShadow = `inset 0 0 0 1px ${getSchemeColor(scheme, "inputEnabledBorder")},
|
|
@@ -2055,7 +2054,6 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
|
|
|
2055
2054
|
}
|
|
2056
2055
|
};
|
|
2057
2056
|
},
|
|
2058
|
-
// @ts-expect-error - fix typings later
|
|
2059
2057
|
input: (styles) => ({
|
|
2060
2058
|
...styles,
|
|
2061
2059
|
color: "var(--card-fg-color)",
|
|
@@ -2063,19 +2061,16 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
|
|
|
2063
2061
|
fontSize: themeTextSizes[1].fontSize,
|
|
2064
2062
|
marginLeft: ui.rem(themeSpace$1[2])
|
|
2065
2063
|
}),
|
|
2066
|
-
// @ts-expect-error - fix typings later
|
|
2067
2064
|
menuList: (styles) => ({
|
|
2068
2065
|
...styles,
|
|
2069
2066
|
padding: 0
|
|
2070
2067
|
}),
|
|
2071
|
-
// @ts-expect-error - fix typings later
|
|
2072
2068
|
noOptionsMessage: (styles) => ({
|
|
2073
2069
|
...styles,
|
|
2074
2070
|
fontFamily: ui.studioTheme.fonts.text.family,
|
|
2075
2071
|
fontSize: themeTextSizes[1].fontSize,
|
|
2076
2072
|
lineHeight: "1em"
|
|
2077
2073
|
}),
|
|
2078
|
-
// @ts-expect-error - fix typings later
|
|
2079
2074
|
option: (styles, { isFocused }) => ({
|
|
2080
2075
|
...styles,
|
|
2081
2076
|
backgroundColor: isFocused ? getSchemeColor(scheme, "spotBlue") : "transparent",
|
|
@@ -2090,14 +2085,12 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
|
|
|
2090
2085
|
color: getSchemeColor(scheme, "bg")
|
|
2091
2086
|
}
|
|
2092
2087
|
}),
|
|
2093
|
-
// @ts-expect-error - fix typings later
|
|
2094
2088
|
placeholder: (styles) => ({
|
|
2095
2089
|
...styles,
|
|
2096
2090
|
fontSize: themeTextSizes[1].fontSize,
|
|
2097
2091
|
marginLeft: ui.rem(themeSpace$1[2]),
|
|
2098
2092
|
paddingLeft: 0
|
|
2099
2093
|
}),
|
|
2100
|
-
// @ts-expect-error - fix typings later
|
|
2101
2094
|
singleValue: (styles) => ({
|
|
2102
2095
|
...styles,
|
|
2103
2096
|
alignItems: "center",
|
|
@@ -2105,7 +2098,6 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
|
|
|
2105
2098
|
height: "100%",
|
|
2106
2099
|
marginLeft: ui.rem(themeSpace$1[2])
|
|
2107
2100
|
}),
|
|
2108
|
-
// @ts-expect-error - fix typings later
|
|
2109
2101
|
valueContainer: (styles) => ({
|
|
2110
2102
|
...styles,
|
|
2111
2103
|
margin: 0,
|
|
@@ -2549,7 +2541,7 @@ const imageDprUrl = (asset, options) => {
|
|
|
2549
2541
|
const val = formData[key];
|
|
2550
2542
|
return typeof val == "object" && val !== null && val.constructor !== Array ? acc[key] = sanitizeFormData(val) : val === "" || typeof val > "u" || val?.length === 0 ? acc[key] = null : typeof val == "string" && val ? acc[key] = formData[key].trim() : acc[key] = formData[key], acc;
|
|
2551
2543
|
}, {}), isFileAsset = (asset) => asset._type === "sanity.fileAsset", isImageAsset = (asset) => asset._type === "sanity.imageAsset", getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asset.metadata.dimensions.height}px`, ButtonAssetCopy = ({ disabled, url }) => {
|
|
2552
|
-
const popoverProps = usePortalPopoverProps(), refPopoverTimeout = react.useRef(), [popoverVisible, setPopoverVisible] = react.useState(!1), handleClick = () => {
|
|
2544
|
+
const popoverProps = usePortalPopoverProps(), refPopoverTimeout = react.useRef(null), [popoverVisible, setPopoverVisible] = react.useState(!1), handleClick = () => {
|
|
2553
2545
|
refPopoverTimeout.current && clearTimeout(refPopoverTimeout.current), setPopoverVisible(!0), copy__default.default(url), refPopoverTimeout.current = setTimeout(() => {
|
|
2554
2546
|
setPopoverVisible(!1);
|
|
2555
2547
|
}, 1250);
|
|
@@ -2697,7 +2689,6 @@ const imageDprUrl = (asset, options) => {
|
|
|
2697
2689
|
}
|
|
2698
2690
|
) : /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { extension: asset.extension, width: "50%" });
|
|
2699
2691
|
}, { radius: themeRadius, space: themeSpace } = ui.studioTheme, reactSelectStyles = (scheme) => ({
|
|
2700
|
-
// @ts-expect-error - fix typings later
|
|
2701
2692
|
control: (styles, { isFocused }) => {
|
|
2702
2693
|
let boxShadow = "inset 0 0 0 1px var(--card-border-color)";
|
|
2703
2694
|
return isFocused && (boxShadow = `inset 0 0 0 1px ${getSchemeColor(scheme, "inputEnabledBorder")},
|
|
@@ -2719,12 +2710,10 @@ const imageDprUrl = (asset, options) => {
|
|
|
2719
2710
|
}
|
|
2720
2711
|
};
|
|
2721
2712
|
},
|
|
2722
|
-
// @ts-expect-error - fix typings later
|
|
2723
2713
|
indicatorsContainer: (styles, { isDisabled }) => ({
|
|
2724
2714
|
...styles,
|
|
2725
2715
|
opacity: isDisabled ? 0.25 : 1
|
|
2726
2716
|
}),
|
|
2727
|
-
// @ts-expect-error - fix typings later
|
|
2728
2717
|
input: (styles) => ({
|
|
2729
2718
|
...styles,
|
|
2730
2719
|
color: "var(--card-fg-color)",
|
|
@@ -2734,7 +2723,6 @@ const imageDprUrl = (asset, options) => {
|
|
|
2734
2723
|
menuList: (styles) => ({
|
|
2735
2724
|
...styles
|
|
2736
2725
|
}),
|
|
2737
|
-
// @ts-expect-error - fix typings later
|
|
2738
2726
|
multiValue: (styles, { isDisabled }) => ({
|
|
2739
2727
|
...styles,
|
|
2740
2728
|
backgroundColor: getSchemeColor(scheme, "mutedHoveredBg"),
|
|
@@ -2746,7 +2734,6 @@ const imageDprUrl = (asset, options) => {
|
|
|
2746
2734
|
fontSize: "inherit",
|
|
2747
2735
|
padding: 0
|
|
2748
2736
|
}),
|
|
2749
|
-
// @ts-expect-error - fix typings later
|
|
2750
2737
|
multiValueRemove: (styles) => ({
|
|
2751
2738
|
...styles,
|
|
2752
2739
|
borderTopLeftRadius: 0,
|
|
@@ -2756,13 +2743,11 @@ const imageDprUrl = (asset, options) => {
|
|
|
2756
2743
|
backgroundColor: getSchemeColor(scheme, "mutedSelectedBg")
|
|
2757
2744
|
}
|
|
2758
2745
|
}),
|
|
2759
|
-
// @ts-expect-error - fix typings later
|
|
2760
2746
|
noOptionsMessage: (styles) => ({
|
|
2761
2747
|
...styles,
|
|
2762
2748
|
fontFamily: ui.studioTheme.fonts.text.family,
|
|
2763
2749
|
lineHeight: "1em"
|
|
2764
2750
|
}),
|
|
2765
|
-
// @ts-expect-error - fix typings later
|
|
2766
2751
|
option: (styles, { isFocused }) => ({
|
|
2767
2752
|
...styles,
|
|
2768
2753
|
backgroundColor: isFocused ? getSchemeColor(scheme, "spotBlue") : "transparent",
|
|
@@ -2774,12 +2759,10 @@ const imageDprUrl = (asset, options) => {
|
|
|
2774
2759
|
color: getSchemeColor(scheme, "bg")
|
|
2775
2760
|
}
|
|
2776
2761
|
}),
|
|
2777
|
-
// @ts-expect-error - fix typings later
|
|
2778
2762
|
placeholder: (styles) => ({
|
|
2779
2763
|
...styles,
|
|
2780
2764
|
marginLeft: ui.rem(themeSpace[2])
|
|
2781
2765
|
}),
|
|
2782
|
-
// @ts-expect-error - fix typings later
|
|
2783
2766
|
valueContainer: (styles) => ({
|
|
2784
2767
|
...styles,
|
|
2785
2768
|
margin: 0,
|
|
@@ -4331,7 +4314,6 @@ const CardWrapper = styledComponents.styled(ui.Flex)`
|
|
|
4331
4314
|
computeItemKey: (index) => items[index]?.id,
|
|
4332
4315
|
components: {
|
|
4333
4316
|
Item: ItemContainer,
|
|
4334
|
-
// @ts-expect-error - fix typings later
|
|
4335
4317
|
List: ListContainer
|
|
4336
4318
|
},
|
|
4337
4319
|
endReached: onLoadMore,
|
|
@@ -4479,7 +4461,7 @@ const CardWrapper = styledComponents.styled(ui.Flex)`
|
|
|
4479
4461
|
`), StyledWarningIcon = styledComponents.styled(icons.WarningFilledIcon)(({ theme }) => ({
|
|
4480
4462
|
color: theme.sanity.color.spot.red
|
|
4481
4463
|
})), TableRowAsset = (props) => {
|
|
4482
|
-
const { id, selected } = props, scheme = sanity.useColorSchemeValue(), shiftPressed = useKeyPress("shift"), [referenceCountVisible, setReferenceCountVisible] = react.useState(!1), refCountVisibleTimeout = react.useRef(), dispatch = reactRedux.useDispatch(), lastPicked = useTypedSelector((state) => state.assets.lastPicked), item = useTypedSelector((state) => selectAssetById(state, id)), mediaIndex = ui.useMediaIndex(), asset = item?.asset, error = item?.error, isOpaque = item?.asset?.metadata?.isOpaque, picked = item?.picked, updating = item?.updating, { onSelect } = useAssetSourceActions(), handleContextActionClick = react.useCallback(
|
|
4464
|
+
const { id, selected } = props, scheme = sanity.useColorSchemeValue(), shiftPressed = useKeyPress("shift"), [referenceCountVisible, setReferenceCountVisible] = react.useState(!1), refCountVisibleTimeout = react.useRef(null), dispatch = reactRedux.useDispatch(), lastPicked = useTypedSelector((state) => state.assets.lastPicked), item = useTypedSelector((state) => selectAssetById(state, id)), mediaIndex = ui.useMediaIndex(), asset = item?.asset, error = item?.error, isOpaque = item?.asset?.metadata?.isOpaque, picked = item?.picked, updating = item?.updating, { onSelect } = useAssetSourceActions(), handleContextActionClick = react.useCallback(
|
|
4483
4465
|
(e) => {
|
|
4484
4466
|
e.stopPropagation(), asset && (onSelect ? dispatch(dialogActions.showAssetEdit({ assetId: asset._id })) : shiftPressed.current && !picked ? dispatch(assetsActions.pickRange({ startId: lastPicked || asset._id, endId: asset._id })) : dispatch(assetsActions.pick({ assetId: asset._id, picked: !picked })));
|
|
4485
4467
|
},
|