sanity-plugin-media 2.3.0 → 2.3.1
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 +12 -3
- package/dist/index.esm.js +20 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Tool/index.tsx +5 -10
- package/src/contexts/ToolOptionsContext.tsx +1 -3
- package/src/index.ts +2 -47
- package/src/plugin.tsx +53 -0
package/dist/index.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var sanity = require('sanity');
|
|
7
8
|
var react = require('react');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var ui = require('@sanity/ui');
|
|
10
10
|
var isHotkey = require('is-hotkey');
|
|
11
11
|
var groq = require('groq');
|
|
@@ -11771,20 +11771,12 @@ const useRootPortalElement = () => {
|
|
|
11771
11771
|
}, [container]);
|
|
11772
11772
|
return container;
|
|
11773
11773
|
};
|
|
11774
|
-
const Tool =
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11780
|
-
return /* @__PURE__ */jsxRuntime.jsx(ToolOptionsProvider, {
|
|
11781
|
-
options,
|
|
11782
|
-
children: /* @__PURE__ */jsxRuntime.jsx(ui.Flex, {
|
|
11783
|
-
direction: "column",
|
|
11784
|
-
height: "fill",
|
|
11785
|
-
flex: 1,
|
|
11786
|
-
children: /* @__PURE__ */jsxRuntime.jsx(Browser, {})
|
|
11787
|
-
})
|
|
11774
|
+
const Tool = () => {
|
|
11775
|
+
return /* @__PURE__ */jsxRuntime.jsx(ui.Flex, {
|
|
11776
|
+
direction: "column",
|
|
11777
|
+
height: "fill",
|
|
11778
|
+
flex: 1,
|
|
11779
|
+
children: /* @__PURE__ */jsxRuntime.jsx(Browser, {})
|
|
11788
11780
|
});
|
|
11789
11781
|
};
|
|
11790
11782
|
var mediaTag = {
|
|
@@ -11821,8 +11813,20 @@ const mediaAssetSource = {
|
|
|
11821
11813
|
...plugin,
|
|
11822
11814
|
component: FormBuilderTool
|
|
11823
11815
|
};
|
|
11816
|
+
const tool = {
|
|
11817
|
+
...plugin,
|
|
11818
|
+
component: Tool
|
|
11819
|
+
};
|
|
11824
11820
|
const media = sanity.definePlugin(options => ({
|
|
11825
11821
|
name: "media",
|
|
11822
|
+
studio: {
|
|
11823
|
+
components: {
|
|
11824
|
+
layout: props => /* @__PURE__ */jsxRuntime.jsx(ToolOptionsProvider, {
|
|
11825
|
+
options,
|
|
11826
|
+
children: props.renderDefault(props)
|
|
11827
|
+
})
|
|
11828
|
+
}
|
|
11829
|
+
},
|
|
11826
11830
|
form: {
|
|
11827
11831
|
file: {
|
|
11828
11832
|
assetSources: prev => {
|
|
@@ -11839,11 +11843,7 @@ const media = sanity.definePlugin(options => ({
|
|
|
11839
11843
|
types: [mediaTag]
|
|
11840
11844
|
},
|
|
11841
11845
|
tools: prev => {
|
|
11842
|
-
return [...prev,
|
|
11843
|
-
...plugin,
|
|
11844
|
-
options,
|
|
11845
|
-
component: Tool
|
|
11846
|
-
}];
|
|
11846
|
+
return [...prev, tool];
|
|
11847
11847
|
}
|
|
11848
11848
|
}));
|
|
11849
11849
|
exports.media = media;
|