sanity-plugin-media 2.3.1 → 2.4.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/LICENSE +1 -1
- package/README.md +23 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.js +4181 -10697
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5341 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +18 -24
- package/src/components/AssetGridVirtualized/index.tsx +2 -2
- package/src/components/AssetMetadata/index.tsx +2 -2
- package/src/components/AssetTableVirtualized/index.tsx +2 -2
- package/src/components/Browser/index.tsx +2 -2
- package/src/components/ButtonAssetCopy/index.tsx +1 -1
- package/src/components/CardAsset/index.tsx +3 -3
- package/src/components/DebugControls/index.tsx +1 -1
- package/src/components/Dialog/index.tsx +1 -1
- package/src/components/DialogAssetEdit/index.tsx +22 -3
- package/src/components/DialogConfirm/index.tsx +2 -2
- package/src/components/DialogSearchFacets/index.tsx +2 -2
- package/src/components/DialogTagCreate/index.tsx +3 -3
- package/src/components/DialogTagEdit/index.tsx +3 -3
- package/src/components/DialogTags/index.tsx +2 -2
- package/src/components/Dialogs/index.tsx +1 -1
- package/src/components/DocumentList/index.tsx +1 -1
- package/src/components/FileAssetPreview/index.tsx +1 -1
- package/src/components/FileIcon/index.tsx +2 -2
- package/src/components/FormBuilderTool/index.tsx +2 -2
- package/src/components/FormFieldInputText/index.tsx +1 -1
- package/src/components/FormFieldInputTextarea/index.tsx +1 -1
- package/src/components/FormSubmitButton/index.tsx +1 -1
- package/src/components/Image/index.tsx +2 -2
- package/src/components/Items/index.tsx +1 -1
- package/src/components/ReduxProvider/index.tsx +4 -4
- package/src/components/SearchFacet/index.tsx +3 -3
- package/src/components/SearchFacetNumber/index.tsx +1 -1
- package/src/components/SearchFacetSelect/index.tsx +1 -1
- package/src/components/SearchFacetString/index.tsx +2 -2
- package/src/components/SearchFacetTags/index.tsx +1 -1
- package/src/components/SearchFacets/index.tsx +1 -1
- package/src/components/SearchFacetsControl/index.tsx +9 -1
- package/src/components/TableHeader/index.tsx +2 -2
- package/src/components/TableRowAsset/index.tsx +10 -2
- package/src/components/Tag/index.tsx +2 -2
- package/src/components/TagsVirtualized/index.tsx +2 -2
- package/src/components/TextInputNumber/index.tsx +1 -1
- package/src/components/TextInputSearch/index.tsx +1 -1
- package/src/components/UploadDropzone/index.tsx +2 -2
- package/src/config/searchFacets.ts +11 -1
- package/src/constants.ts +7 -1
- package/src/contexts/AssetSourceDispatchContext.tsx +1 -1
- package/src/contexts/DropzoneDispatchContext.tsx +1 -1
- package/src/contexts/ToolOptionsContext.tsx +25 -7
- package/src/formSchema/index.ts +1 -0
- package/src/hooks/useKeyPress.ts +1 -1
- package/src/hooks/useOnScreen.ts +1 -1
- package/src/hooks/usePortalPopoverProps.ts +1 -1
- package/src/hooks/useTypedSelector.ts +2 -2
- package/src/modules/assets/actions.ts +1 -1
- package/src/modules/assets/index.ts +7 -3
- package/src/modules/debug/index.ts +1 -1
- package/src/modules/dialog/index.ts +2 -2
- package/src/modules/index.ts +3 -3
- package/src/modules/notifications/index.ts +1 -1
- package/src/modules/search/index.ts +1 -1
- package/src/modules/selectors.ts +2 -2
- package/src/modules/tags/index.ts +2 -2
- package/src/modules/uploads/index.ts +2 -2
- package/src/operators/debugThrottle.ts +1 -1
- package/src/plugin.tsx +5 -3
- package/src/styled/react-select/creatable.tsx +2 -2
- package/src/styled/react-select/single.tsx +2 -2
- package/src/types/index.ts +8 -2
- package/src/utils/blocksToText.ts +1 -1
- package/src/utils/constructFilter.ts +2 -2
- package/src/utils/getAssetResolution.ts +1 -1
- package/src/utils/getSchemeColor.ts +1 -1
- package/src/utils/getTagSelectOptions.ts +1 -1
- package/src/utils/getUniqueDocuments.ts +1 -1
- package/src/utils/imageDprUrl.ts +1 -1
- package/src/utils/typeGuards.ts +1 -1
- package/src/utils/uploadSanityAsset.ts +1 -1
- package/dist/index.cjs.mjs +0 -5
- package/dist/index.esm.js +0 -11810
- package/dist/index.esm.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -95,6 +95,29 @@ export default defineConfig({
|
|
|
95
95
|
})
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
### Plugin Config
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
// sanity.config.ts
|
|
102
|
+
export default defineConfig({
|
|
103
|
+
//...
|
|
104
|
+
plugins: [
|
|
105
|
+
media({
|
|
106
|
+
creditLine: {
|
|
107
|
+
enabled: true,
|
|
108
|
+
// boolean - enables an optional "Credit Line" field in the plugin.
|
|
109
|
+
// Used to store credits e.g. photographer, licence information
|
|
110
|
+
excludeSources: ['unsplash'],
|
|
111
|
+
// string | string[] - when used with 3rd party asset sources, you may
|
|
112
|
+
// wish to prevent users overwriting the creditLine based on the `source.name`
|
|
113
|
+
},
|
|
114
|
+
maximumUploadSize: 10000000
|
|
115
|
+
// number - maximum file size (in bytes) that can be uploaded through the plugin interface
|
|
116
|
+
})
|
|
117
|
+
],
|
|
118
|
+
})
|
|
119
|
+
```
|
|
120
|
+
|
|
98
121
|
## Known issues
|
|
99
122
|
|
|
100
123
|
<details>
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {AssetSourceComponentProps} from 'sanity'
|
|
2
|
+
import {MediaToolOptions} from '@types'
|
|
3
|
+
import {Plugin as Plugin_2} from 'sanity'
|
|
4
|
+
import {default as React_2} from 'react'
|
|
5
|
+
|
|
6
|
+
export declare const media: Plugin_2<void | MediaToolOptions>
|
|
7
|
+
|
|
8
|
+
export declare const mediaAssetSource: {
|
|
9
|
+
component: (props: AssetSourceComponentProps) => React_2.JSX.Element
|
|
10
|
+
icon: React_2.ForwardRefExoticComponent<
|
|
11
|
+
Omit<React_2.SVGProps<SVGSVGElement>, 'ref'> & React_2.RefAttributes<SVGSVGElement>
|
|
12
|
+
>
|
|
13
|
+
name: string
|
|
14
|
+
title: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {MediaToolOptions}
|
|
18
|
+
|
|
19
|
+
export {}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {AssetSourceComponentProps} from 'sanity'
|
|
2
|
-
import {
|
|
2
|
+
import {MediaToolOptions} from '@types'
|
|
3
3
|
import {Plugin as Plugin_2} from 'sanity'
|
|
4
4
|
import {default as React_2} from 'react'
|
|
5
5
|
|
|
6
6
|
export declare const media: Plugin_2<void | MediaToolOptions>
|
|
7
7
|
|
|
8
8
|
export declare const mediaAssetSource: {
|
|
9
|
-
component: (props: AssetSourceComponentProps) =>
|
|
9
|
+
component: (props: AssetSourceComponentProps) => React_2.JSX.Element
|
|
10
10
|
icon: React_2.ForwardRefExoticComponent<
|
|
11
11
|
Omit<React_2.SVGProps<SVGSVGElement>, 'ref'> & React_2.RefAttributes<SVGSVGElement>
|
|
12
12
|
>
|
|
@@ -14,8 +14,6 @@ export declare const mediaAssetSource: {
|
|
|
14
14
|
title: string
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export
|
|
18
|
-
maximumUploadSize?: number
|
|
19
|
-
}
|
|
17
|
+
export {MediaToolOptions}
|
|
20
18
|
|
|
21
19
|
export {}
|