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 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 { Component, createContext, memo, useContext, useEffect, useMemo, useRef, useState } from "react";
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
- var ReduxProvider = class extends Component {
6068
- store;
6069
- constructor(props) {
6070
- super(props);
6071
- let epicMiddleware = createEpicMiddleware({ dependencies: { client: props.client } });
6072
- this.store = configureStore({
6073
- reducer: rootReducer,
6074
- middleware: (getDefaultMiddleware) => getDefaultMiddleware({
6075
- serializableCheck: !1,
6076
- thunk: !1
6077
- }).prepend(epicMiddleware),
6078
- devTools: !0,
6079
- preloadedState: {
6080
- assets: {
6081
- ...initialState,
6082
- assetTypes: isSupportedAssetType(props?.assetType) ? [props.assetType] : ["file", "image"]
6083
- },
6084
- debug: {
6085
- badConnection: !1,
6086
- enabled: !1
6087
- },
6088
- dialog: { items: [] },
6089
- notifications: { items: [] },
6090
- search: {
6091
- facets: [],
6092
- query: ""
6093
- },
6094
- selected: {
6095
- assets: props.selectedAssets || [],
6096
- document: props.document,
6097
- documentAssetIds: props.document ? getDocumentAssetIds(props.document) : []
6098
- },
6099
- tags: {
6100
- allIds: [],
6101
- byIds: {},
6102
- creating: !1,
6103
- fetchCount: -1,
6104
- fetching: !1,
6105
- panelVisible: !0
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
- }), epicMiddleware.run(rootEpic);
6113
- }
6114
- render() {
6115
- return /* @__PURE__ */ jsx(Provider, {
6116
- store: this.store,
6117
- children: this.props.children
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;