sanity-plugin-media 6.0.8 → 6.0.9
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 +55 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ImageIcon } from "@sanity/icons/Image";
|
|
|
2
2
|
import { Preview, WithReferringDocuments, definePlugin, useClient, useColorSchemeValue, useDocumentStore, useFormValue, useSchema } from "sanity";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { Box, Button, Card, Checkbox, Container, Dialog, Flex, Grid, Inline, Label, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Spinner, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, Tooltip, rem, studioTheme, useLayer, useMediaIndex, usePortal, useToast } from "@sanity/ui";
|
|
5
|
-
import {
|
|
5
|
+
import { createContext, memo, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { isHotkey } from "is-hotkey-esm";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { createGlobalStyle, css, styled } from "styled-components";
|
|
@@ -6064,60 +6064,61 @@ const rootEpic = combineEpics(assetsDeleteEpic, assetsFetchEpic, assetsFetchAfte
|
|
|
6064
6064
|
function isSupportedAssetType(assetType) {
|
|
6065
6065
|
return assetType ? SUPPORTED_ASSET_TYPES.includes(assetType) : !1;
|
|
6066
6066
|
}
|
|
6067
|
-
|
|
6068
|
-
store
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
},
|
|
6107
|
-
uploads: {
|
|
6108
|
-
allIds: [],
|
|
6109
|
-
byIds: {}
|
|
6110
|
-
}
|
|
6067
|
+
function createReduxStore(props) {
|
|
6068
|
+
let epicMiddleware = createEpicMiddleware({ dependencies: { client: props.client } }), store = configureStore({
|
|
6069
|
+
reducer: rootReducer,
|
|
6070
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
6071
|
+
serializableCheck: !1,
|
|
6072
|
+
thunk: !1
|
|
6073
|
+
}).prepend(epicMiddleware),
|
|
6074
|
+
devTools: !0,
|
|
6075
|
+
preloadedState: {
|
|
6076
|
+
assets: {
|
|
6077
|
+
...initialState,
|
|
6078
|
+
assetTypes: isSupportedAssetType(props?.assetType) ? [props.assetType] : ["file", "image"]
|
|
6079
|
+
},
|
|
6080
|
+
debug: {
|
|
6081
|
+
badConnection: !1,
|
|
6082
|
+
enabled: !1
|
|
6083
|
+
},
|
|
6084
|
+
dialog: { items: [] },
|
|
6085
|
+
notifications: { items: [] },
|
|
6086
|
+
search: {
|
|
6087
|
+
facets: [],
|
|
6088
|
+
query: ""
|
|
6089
|
+
},
|
|
6090
|
+
selected: {
|
|
6091
|
+
assets: props.selectedAssets || [],
|
|
6092
|
+
document: props.document,
|
|
6093
|
+
documentAssetIds: props.document ? getDocumentAssetIds(props.document) : []
|
|
6094
|
+
},
|
|
6095
|
+
tags: {
|
|
6096
|
+
allIds: [],
|
|
6097
|
+
byIds: {},
|
|
6098
|
+
creating: !1,
|
|
6099
|
+
fetchCount: -1,
|
|
6100
|
+
fetching: !1,
|
|
6101
|
+
panelVisible: !0
|
|
6102
|
+
},
|
|
6103
|
+
uploads: {
|
|
6104
|
+
allIds: [],
|
|
6105
|
+
byIds: {}
|
|
6111
6106
|
}
|
|
6112
|
-
}
|
|
6113
|
-
}
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6107
|
+
}
|
|
6108
|
+
});
|
|
6109
|
+
return epicMiddleware.run(rootEpic), store;
|
|
6110
|
+
}
|
|
6111
|
+
function ReduxProvider(t0) {
|
|
6112
|
+
let $ = c(8), children, props;
|
|
6113
|
+
$[0] === t0 ? (children = $[1], props = $[2]) : ({children, ...props} = t0, $[0] = t0, $[1] = children, $[2] = props);
|
|
6114
|
+
let t1;
|
|
6115
|
+
$[3] === props ? t1 = $[4] : (t1 = () => createReduxStore(props), $[3] = props, $[4] = t1);
|
|
6116
|
+
let [store] = useState(t1), t2;
|
|
6117
|
+
return $[5] !== children || $[6] !== store ? (t2 = /* @__PURE__ */ jsx(Provider, {
|
|
6118
|
+
store,
|
|
6119
|
+
children
|
|
6120
|
+
}), $[5] = children, $[6] = store, $[7] = t2) : t2 = $[7], t2;
|
|
6121
|
+
}
|
|
6121
6122
|
const TagsPanel = () => {
|
|
6122
6123
|
let $ = c(2);
|
|
6123
6124
|
if (!useTypedSelector(_temp$2)) return null;
|