sanity-plugin-mux-input 2.0.11 → 2.0.13
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/lib/_chunks/Input-623a8bfd.js +189 -0
- package/lib/_chunks/Input-623a8bfd.js.map +1 -0
- package/lib/_chunks/Input-87c22ca4.cjs +189 -0
- package/lib/_chunks/Input-87c22ca4.cjs.map +1 -0
- package/lib/_chunks/{Preview-bf9729e4.js → Preview-3fc296dd.js} +2 -2
- package/lib/_chunks/{Preview-bf9729e4.js.map → Preview-3fc296dd.js.map} +1 -1
- package/lib/_chunks/{Preview-13dab9ac.cjs → Preview-d397ad81.cjs} +2 -2
- package/lib/_chunks/{Preview-13dab9ac.cjs.map → Preview-d397ad81.cjs.map} +1 -1
- package/lib/_chunks/{VideoSource.styled-626b50aa.js → VideoSource.styled-60895dfb.js} +2 -2
- package/lib/_chunks/{VideoSource.styled-626b50aa.js.map → VideoSource.styled-60895dfb.js.map} +1 -1
- package/lib/_chunks/{VideoSource.styled-8a7ad588.cjs → VideoSource.styled-b45e75bf.cjs} +2 -2
- package/lib/_chunks/{VideoSource.styled-8a7ad588.cjs.map → VideoSource.styled-b45e75bf.cjs.map} +1 -1
- package/lib/_chunks/{index-24ed281f.cjs → index-6ba0e5b7.cjs} +3 -3
- package/lib/_chunks/{index-24ed281f.cjs.map → index-6ba0e5b7.cjs.map} +1 -1
- package/lib/_chunks/{index-4ba017a8.js → index-eb275a55.js} +3 -3
- package/lib/_chunks/{index-4ba017a8.js.map → index-eb275a55.js.map} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/package.json +20 -20
- package/src/actions/secrets.ts +1 -1
- package/src/actions/upload.ts +5 -5
- package/src/components/FileInputButton.tsx +1 -1
- package/src/components/Player.tsx +1 -1
- package/src/components/UploadPlaceholder.tsx +1 -1
- package/src/components/Uploader.styled.tsx +1 -1
- package/src/components/__legacy__Uploader.tsx +1 -1
- package/src/hooks/useSaveSecrets.ts +1 -1
- package/src/util/asserters.ts +1 -1
- package/lib/_chunks/Input-168c8663.cjs +0 -189
- package/lib/_chunks/Input-168c8663.cjs.map +0 -1
- package/lib/_chunks/Input-8f597807.js +0 -189
- package/lib/_chunks/Input-8f597807.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-mux-input",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "An input component that integrates Sanity Studio with Mux video encoding/hosting service.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -69,29 +69,29 @@
|
|
|
69
69
|
"@sanity/uuid": "^3",
|
|
70
70
|
"classnames": "^2.3.2",
|
|
71
71
|
"jsonwebtoken-esm": "^2.0.1",
|
|
72
|
-
"media-chrome": "^0.18.
|
|
72
|
+
"media-chrome": "^0.18.4",
|
|
73
73
|
"motion": "^10",
|
|
74
74
|
"rxjs": "^7",
|
|
75
75
|
"scroll-into-view-if-needed": "^3",
|
|
76
76
|
"suspend-react": "^0.0.9",
|
|
77
|
-
"swr": "^2.0.
|
|
77
|
+
"swr": "^2.0.4",
|
|
78
78
|
"use-device-pixel-ratio": "^1.1.2",
|
|
79
79
|
"use-error-boundary": "^2.0.6"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@commitlint/cli": "^17.4.
|
|
83
|
-
"@commitlint/config-conventional": "^17.4.
|
|
82
|
+
"@commitlint/cli": "^17.4.4",
|
|
83
|
+
"@commitlint/config-conventional": "^17.4.4",
|
|
84
84
|
"@rollup/plugin-alias": "^4.0.3",
|
|
85
|
-
"@sanity/pkg-utils": "^2.2.
|
|
86
|
-
"@sanity/plugin-kit": "^3.1.
|
|
85
|
+
"@sanity/pkg-utils": "^2.2.6",
|
|
86
|
+
"@sanity/plugin-kit": "^3.1.7",
|
|
87
87
|
"@sanity/semantic-release-preset": "^4.0.0",
|
|
88
|
-
"@sanity/vision": "^3.
|
|
89
|
-
"@types/react": "^18.0.
|
|
88
|
+
"@sanity/vision": "^3.5.0",
|
|
89
|
+
"@types/react": "^18.0.28",
|
|
90
90
|
"@types/styled-components": "^5.1.26",
|
|
91
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
92
|
-
"@typescript-eslint/parser": "^5.
|
|
91
|
+
"@typescript-eslint/eslint-plugin": "^5.53.0",
|
|
92
|
+
"@typescript-eslint/parser": "^5.53.0",
|
|
93
93
|
"cz-conventional-changelog": "^3.3.0",
|
|
94
|
-
"eslint": "^8.
|
|
94
|
+
"eslint": "^8.35.0",
|
|
95
95
|
"eslint-config-prettier": "^8.6.0",
|
|
96
96
|
"eslint-config-react-app": "^7.0.1",
|
|
97
97
|
"eslint-config-sanity": "^6.0.0",
|
|
@@ -101,20 +101,20 @@
|
|
|
101
101
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
102
102
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
103
103
|
"husky": "^8.0.3",
|
|
104
|
-
"lint-staged": "^13.1.
|
|
105
|
-
"next": "^13.1
|
|
106
|
-
"next-sanity": "^4.1.
|
|
104
|
+
"lint-staged": "^13.1.2",
|
|
105
|
+
"next": "^13.2.1",
|
|
106
|
+
"next-sanity": "^4.1.5",
|
|
107
107
|
"npm-run-all": "^4.1.5",
|
|
108
|
-
"prettier": "^2.8.
|
|
109
|
-
"prettier-plugin-packagejson": "^2.4.
|
|
108
|
+
"prettier": "^2.8.4",
|
|
109
|
+
"prettier-plugin-packagejson": "^2.4.3",
|
|
110
110
|
"react": "^18.2.0",
|
|
111
111
|
"react-dom": "^18.2.0",
|
|
112
112
|
"react-is": "^18.2.0",
|
|
113
113
|
"rimraf": "^4.1.2",
|
|
114
|
-
"rollup": "^3.
|
|
115
|
-
"sanity": "^3.
|
|
114
|
+
"rollup": "^3.17.3",
|
|
115
|
+
"sanity": "^3.5.0",
|
|
116
116
|
"styled-components": "^5.3.6",
|
|
117
|
-
"type-fest": "^3.
|
|
117
|
+
"type-fest": "^3.6.1",
|
|
118
118
|
"typescript": "^4.9.5"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
package/src/actions/secrets.ts
CHANGED
package/src/actions/upload.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
-
import type {SanityClient} from 'sanity'
|
|
3
2
|
import {uuid as generateUuid} from '@sanity/uuid'
|
|
4
|
-
import {
|
|
3
|
+
import {concat, defer, from, type Observable, of, throwError} from 'rxjs'
|
|
5
4
|
import {catchError, mergeMap, mergeMapTo, switchMap} from 'rxjs/operators'
|
|
5
|
+
import type {SanityClient} from 'sanity'
|
|
6
6
|
|
|
7
7
|
import {createUpChunkObservable} from '../clients/upChunkObservable'
|
|
8
8
|
import type {Config, MuxAsset} from '../util/types'
|
|
@@ -11,7 +11,7 @@ import {testSecretsObservable} from './secrets'
|
|
|
11
11
|
|
|
12
12
|
export function cancelUpload(client: SanityClient, uuid: string) {
|
|
13
13
|
return client.observable.request({
|
|
14
|
-
url: `/addons/mux/uploads/${client.
|
|
14
|
+
url: `/addons/mux/uploads/${client.config().dataset}/${uuid}`,
|
|
15
15
|
withCredentials: true,
|
|
16
16
|
method: 'DELETE',
|
|
17
17
|
})
|
|
@@ -44,7 +44,7 @@ export function uploadUrl(
|
|
|
44
44
|
filename: validUrl.split('/').slice(-1)[0],
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
const dataset = client.
|
|
47
|
+
const dataset = client.config().dataset
|
|
48
48
|
return defer(() =>
|
|
49
49
|
client.observable.request({
|
|
50
50
|
url: `/addons/mux/assets/${dataset}`,
|
|
@@ -115,7 +115,7 @@ export function uploadFile(
|
|
|
115
115
|
url: string
|
|
116
116
|
}
|
|
117
117
|
}>({
|
|
118
|
-
url: `/addons/mux/uploads/${client.
|
|
118
|
+
url: `/addons/mux/uploads/${client.config().dataset}`,
|
|
119
119
|
withCredentials: true,
|
|
120
120
|
method: 'POST',
|
|
121
121
|
headers: {
|
|
@@ -18,6 +18,7 @@ import {useClient} from '../hooks/useClient'
|
|
|
18
18
|
import type {DialogState, SetDialogState} from '../hooks/useDialogState'
|
|
19
19
|
import {getVideoSrc} from '../util/getVideoSrc'
|
|
20
20
|
import type {MuxInputProps, VideoAssetDocument} from '../util/types'
|
|
21
|
+
import pluginPkg from './../../package.json'
|
|
21
22
|
import EditThumbnailDialog from './EditThumbnailDialog'
|
|
22
23
|
import {
|
|
23
24
|
PosterImage,
|
|
@@ -27,7 +28,6 @@ import {
|
|
|
27
28
|
VideoContainer,
|
|
28
29
|
} from './Player.styled'
|
|
29
30
|
import {UploadProgress} from './UploadProgress'
|
|
30
|
-
import pluginPkg from './../../package.json'
|
|
31
31
|
|
|
32
32
|
interface Props extends Pick<MuxInputProps, 'onChange' | 'readOnly'> {
|
|
33
33
|
buttons?: React.ReactNode
|
|
@@ -5,7 +5,7 @@ import React, {useCallback} from 'react'
|
|
|
5
5
|
import styled from 'styled-components'
|
|
6
6
|
|
|
7
7
|
import type {SetDialogState} from '../hooks/useDialogState'
|
|
8
|
-
import {type FileInputButtonProps
|
|
8
|
+
import {FileInputButton, type FileInputButtonProps} from './FileInputButton'
|
|
9
9
|
|
|
10
10
|
const UploadCard = styled(Card)`
|
|
11
11
|
&& {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-nested-ternary */
|
|
2
2
|
// This component needs to be refactored into a functional component
|
|
3
3
|
|
|
4
|
-
import type {SanityClient} from 'sanity'
|
|
5
4
|
import React, {Component} from 'react'
|
|
6
5
|
import {type Observable, Subject} from 'rxjs'
|
|
7
6
|
import {takeUntil, tap} from 'rxjs/operators'
|
|
7
|
+
import type {SanityClient} from 'sanity'
|
|
8
8
|
import {PatchEvent, set, setIfMissing} from 'sanity'
|
|
9
9
|
|
|
10
10
|
import {uploadFile, uploadUrl} from '../actions/upload'
|
package/src/util/asserters.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {type InputProps, type PreviewLayoutKey, type PreviewProps
|
|
1
|
+
import {type InputProps, isObjectInputProps, type PreviewLayoutKey, type PreviewProps} from 'sanity'
|
|
2
2
|
|
|
3
3
|
import type {MuxInputPreviewProps, MuxInputProps} from './types'
|
|
4
4
|
|