sanity-plugin-media 2.0.4 → 2.0.6
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 +8 -19
- package/lib/index.esm.js +1 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/package.json +5 -7
- package/src/components/AssetGridVirtualized/index.tsx +2 -1
- package/src/components/Browser/index.tsx +29 -25
- package/src/components/ButtonAssetCopy/index.tsx +4 -7
- package/src/components/CardUpload/index.tsx +12 -24
- package/src/components/DebugControls/index.tsx +1 -0
- package/src/components/DialogAssetEdit/index.tsx +5 -14
- package/src/components/FormBuilderTool/index.tsx +1 -1
- package/src/components/FormSubmitButton/index.tsx +1 -0
- package/src/components/OrderSelect/index.tsx +4 -0
- package/src/components/SearchFacetNumber/index.tsx +6 -3
- package/src/components/SearchFacetSelect/index.tsx +6 -3
- package/src/components/SearchFacetString/index.tsx +5 -3
- package/src/components/SearchFacetTags/index.tsx +5 -3
- package/src/components/SearchFacetsControl/index.tsx +7 -2
- package/src/components/TableRowUpload/index.tsx +12 -24
- package/src/components/Tag/index.tsx +2 -0
- package/src/components/TagViewHeader/index.tsx +2 -5
- package/src/hooks/useKeyPress.ts +14 -12
- package/src/hooks/usePortalPopoverProps.ts +12 -0
- package/src/modules/index.ts +18 -4
- package/src/components/FormFieldInputFilename/index.tsx +0 -50
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {PopoverProps, usePortal} from '@sanity/ui'
|
|
2
|
+
|
|
3
|
+
export function usePortalPopoverProps(): PopoverProps {
|
|
4
|
+
const portal = usePortal()
|
|
5
|
+
|
|
6
|
+
return {
|
|
7
|
+
constrainSize: true,
|
|
8
|
+
floatingBoundary: portal.element,
|
|
9
|
+
portal: true,
|
|
10
|
+
referenceBoundary: portal.element
|
|
11
|
+
}
|
|
12
|
+
}
|
package/src/modules/index.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ActionFromReducersMapObject,
|
|
3
|
+
Reducer,
|
|
4
|
+
StateFromReducersMapObject,
|
|
5
|
+
combineReducers
|
|
6
|
+
} from '@reduxjs/toolkit'
|
|
2
7
|
import {combineEpics} from 'redux-observable'
|
|
3
8
|
|
|
4
9
|
import assetsReducer, {
|
|
@@ -97,7 +102,7 @@ export const rootEpic = combineEpics(
|
|
|
97
102
|
uploadsCompleteQueueEpic
|
|
98
103
|
)
|
|
99
104
|
|
|
100
|
-
const reducers =
|
|
105
|
+
const reducers = {
|
|
101
106
|
assets: assetsReducer,
|
|
102
107
|
debug: debugReducer,
|
|
103
108
|
dialog: dialogReducer,
|
|
@@ -106,5 +111,14 @@ const reducers = combineReducers({
|
|
|
106
111
|
selected: selectedReducer,
|
|
107
112
|
tags: tagsReducer,
|
|
108
113
|
uploads: uploadsReducer
|
|
109
|
-
}
|
|
110
|
-
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
type ReducersMapObject = typeof reducers
|
|
117
|
+
|
|
118
|
+
// Workaround to avoid `$CombinedState` ts errors
|
|
119
|
+
// source: https://github.com/reduxjs/redux-toolkit/issues/2068#issuecomment-1130796500
|
|
120
|
+
// TODO: remove once we use `redux-toolkit` v2
|
|
121
|
+
export const rootReducer: Reducer<
|
|
122
|
+
StateFromReducersMapObject<ReducersMapObject>,
|
|
123
|
+
ActionFromReducersMapObject<ReducersMapObject>
|
|
124
|
+
> = combineReducers(reducers)
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import {Box, Flex, TextInput} from '@sanity/ui'
|
|
2
|
-
import React, {forwardRef} from 'react'
|
|
3
|
-
import {FieldError} from 'react-hook-form'
|
|
4
|
-
|
|
5
|
-
import FormFieldInputLabel from '../FormFieldInputLabel'
|
|
6
|
-
|
|
7
|
-
type Props = {
|
|
8
|
-
description?: string
|
|
9
|
-
extension: string
|
|
10
|
-
disabled?: boolean
|
|
11
|
-
error?: FieldError
|
|
12
|
-
label: string
|
|
13
|
-
name: string
|
|
14
|
-
placeholder?: string
|
|
15
|
-
value?: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type Ref = HTMLInputElement
|
|
19
|
-
|
|
20
|
-
const FormFieldInputText = forwardRef<Ref, Props>((props: Props, ref) => {
|
|
21
|
-
const {description, disabled, error, extension, label, name, placeholder, value} = props
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Box>
|
|
25
|
-
{/* Label */}
|
|
26
|
-
<FormFieldInputLabel description={description} error={error} label={label} name={name} />
|
|
27
|
-
|
|
28
|
-
{/* Input */}
|
|
29
|
-
<Flex>
|
|
30
|
-
<Box style={{flexGrow: 1}}>
|
|
31
|
-
<TextInput
|
|
32
|
-
autoComplete="off"
|
|
33
|
-
autoFocus
|
|
34
|
-
defaultValue={value}
|
|
35
|
-
disabled={disabled}
|
|
36
|
-
id={name}
|
|
37
|
-
name={name}
|
|
38
|
-
placeholder={placeholder}
|
|
39
|
-
ref={ref}
|
|
40
|
-
/>
|
|
41
|
-
</Box>
|
|
42
|
-
<Box style={{width: '70px'}}>
|
|
43
|
-
<TextInput defaultValue={`.${extension}`} disabled />
|
|
44
|
-
</Box>
|
|
45
|
-
</Flex>
|
|
46
|
-
</Box>
|
|
47
|
-
)
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
export default FormFieldInputText
|