sanity-plugin-mux-input 2.3.5 → 2.3.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/dist/index.js +65 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -7
- package/src/actions/upload.ts +1 -1
- package/src/components/FileInputArea.tsx +4 -3
- package/src/components/Uploader.tsx +1 -1
- package/src/components/VideoDetails/VideoDetails.tsx +1 -1
- package/src/components/VideoThumbnail.tsx +1 -1
- package/src/components/documentPreview/PaneItemPreview.tsx +10 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-mux-input",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"description": "An input component that integrates Sanity Studio with Mux video encoding/hosting service.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@mux/mux-player-react": "^2.6.0",
|
|
57
57
|
"@mux/upchunk": "^3.4.0",
|
|
58
|
-
"@sanity/icons": "^
|
|
58
|
+
"@sanity/icons": "^3.0.0",
|
|
59
59
|
"@sanity/incompatible-plugin": "^1.0.4",
|
|
60
60
|
"@sanity/ui": "^2.1.11",
|
|
61
61
|
"@sanity/uuid": "^3.0.2",
|
|
62
62
|
"iso-639-1": "^3.1.2",
|
|
63
63
|
"jsonwebtoken-esm": "^1.0.5",
|
|
64
64
|
"lodash": "^4.17.21",
|
|
65
|
-
"react-rx": "^
|
|
65
|
+
"react-rx": "^3.0.0",
|
|
66
66
|
"rxjs": "^7.8.1",
|
|
67
67
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
68
68
|
"suspend-react": "^0.1.3",
|
|
@@ -71,12 +71,10 @@
|
|
|
71
71
|
"use-error-boundary": "^2.0.6"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@commitlint/cli": "^19.3.0",
|
|
75
|
-
"@commitlint/config-conventional": "^19.2.2",
|
|
76
74
|
"@sanity/client": "^6.18.2",
|
|
77
75
|
"@sanity/pkg-utils": "^6.8.16",
|
|
78
76
|
"@sanity/plugin-kit": "4.0.12",
|
|
79
|
-
"@sanity/semantic-release-preset": "^
|
|
77
|
+
"@sanity/semantic-release-preset": "^5.0.0",
|
|
80
78
|
"@sanity/vision": "^3.42.1",
|
|
81
79
|
"@types/lodash": "^4.17.4",
|
|
82
80
|
"@types/react": "^18.3.2",
|
|
@@ -84,7 +82,6 @@
|
|
|
84
82
|
"@types/styled-components": "^5.1.34",
|
|
85
83
|
"@typescript-eslint/eslint-plugin": "^7.0.2",
|
|
86
84
|
"@typescript-eslint/parser": "^7.0.2",
|
|
87
|
-
"cz-conventional-changelog": "^3.3.0",
|
|
88
85
|
"eslint": "^8.57.0",
|
|
89
86
|
"eslint-config-prettier": "^9.1.0",
|
|
90
87
|
"eslint-config-react-app": "^7.0.1",
|
|
@@ -103,6 +100,7 @@
|
|
|
103
100
|
"react-is": "^18.3.1",
|
|
104
101
|
"rimraf": "^5.0.7",
|
|
105
102
|
"sanity": "^3.42.1",
|
|
103
|
+
"semantic-release": "^24.0.0",
|
|
106
104
|
"styled-components": "^6.1.11",
|
|
107
105
|
"typescript": "^5.4.5",
|
|
108
106
|
"yalc": "1.0.0-pre.53"
|
package/src/actions/upload.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {uuid as generateUuid} from '@sanity/uuid'
|
|
2
|
-
import {concat, defer, from, of, throwError
|
|
2
|
+
import {concat, defer, from, type Observable, of, throwError} from 'rxjs'
|
|
3
3
|
import {catchError, mergeMap, mergeMapTo, switchMap} from 'rxjs/operators'
|
|
4
4
|
import type {SanityClient} from 'sanity'
|
|
5
5
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {PropsWithChildren, useRef, useState} from 'react'
|
|
2
|
-
import {Box, Button, Card, CardTone, Flex, Inline, Text} from '@sanity/ui'
|
|
3
|
-
import {FileInputButton} from './FileInputButton'
|
|
4
1
|
import {UploadIcon} from '@sanity/icons'
|
|
2
|
+
import {Box, Button, Card, CardTone, Flex, Inline, Text} from '@sanity/ui'
|
|
3
|
+
import {PropsWithChildren, useRef, useState} from 'react'
|
|
4
|
+
|
|
5
5
|
import {extractDroppedFiles} from '../util/extractFiles'
|
|
6
|
+
import {FileInputButton} from './FileInputButton'
|
|
6
7
|
|
|
7
8
|
interface FileInputAreaProps extends PropsWithChildren {
|
|
8
9
|
accept?: string
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {ErrorOutlineIcon} from '@sanity/icons'
|
|
2
2
|
import {Button, CardTone, Flex, Text, useToast} from '@sanity/ui'
|
|
3
3
|
import React, {useEffect, useReducer, useRef, useState} from 'react'
|
|
4
|
-
import {Subject, Subscription
|
|
4
|
+
import {type Observable, Subject, Subscription} from 'rxjs'
|
|
5
5
|
import {takeUntil, tap} from 'rxjs/operators'
|
|
6
6
|
import type {SanityClient} from 'sanity'
|
|
7
7
|
import {PatchEvent, set, setIfMissing} from 'sanity'
|
|
@@ -6,7 +6,7 @@ import {styled} from 'styled-components'
|
|
|
6
6
|
import {useClient} from '../hooks/useClient'
|
|
7
7
|
import useInView from '../hooks/useInView'
|
|
8
8
|
import {THUMBNAIL_ASPECT_RATIO} from '../util/constants'
|
|
9
|
-
import {
|
|
9
|
+
import {type AnimatedPosterSrcOptions, getAnimatedPosterSrc} from '../util/getAnimatedPosterSrc'
|
|
10
10
|
import {VideoAssetDocument} from '../util/types'
|
|
11
11
|
|
|
12
12
|
const Image = styled.img`
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// https://github.com/sanity-io/sanity/blob/next/packages/sanity/src/desk/components/paneItem/PaneItemPreview.tsx
|
|
3
3
|
import {Inline} from '@sanity/ui'
|
|
4
4
|
import {isNumber, isString} from 'lodash'
|
|
5
|
-
import {isValidElement} from 'react'
|
|
6
|
-
import {
|
|
5
|
+
import {isValidElement, useMemo} from 'react'
|
|
6
|
+
import {useObservable} from 'react-rx'
|
|
7
7
|
import type {SanityDocument, SchemaType} from 'sanity'
|
|
8
8
|
import type {PreviewValue} from 'sanity'
|
|
9
9
|
import {
|
|
@@ -44,12 +44,15 @@ export function PaneItemPreview(props: PaneItemPreviewProps) {
|
|
|
44
44
|
? value.title
|
|
45
45
|
: null
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
49
|
-
const {draft, published, isLoading} = useMemoObservable<PaneItemPreviewState>(
|
|
47
|
+
const observable = useMemo(
|
|
50
48
|
() => getPreviewStateObservable(props.documentPreviewStore, schemaType, value._id, title),
|
|
51
|
-
[props.documentPreviewStore, schemaType, value._id
|
|
52
|
-
)
|
|
49
|
+
[props.documentPreviewStore, schemaType, title, value._id]
|
|
50
|
+
)
|
|
51
|
+
const {draft, published, isLoading} = useObservable(observable, {
|
|
52
|
+
draft: null,
|
|
53
|
+
published: null,
|
|
54
|
+
isLoading: true,
|
|
55
|
+
})
|
|
53
56
|
|
|
54
57
|
const status = isLoading ? null : (
|
|
55
58
|
<Inline space={4}>
|