sanity-plugin-mux-input 2.11.0 → 2.11.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-mux-input",
3
- "version": "2.11.0",
3
+ "version": "2.11.2",
4
4
  "description": "An input component that integrates Sanity Studio with Mux video encoding/hosting service.",
5
5
  "keywords": [
6
6
  "sanity",
@@ -70,11 +70,11 @@
70
70
  "use-error-boundary": "^2.0.6"
71
71
  },
72
72
  "devDependencies": {
73
- "@sanity/client": "^6.28.1",
74
- "@sanity/pkg-utils": "^6.13.4",
75
- "@sanity/plugin-kit": "4.0.19",
73
+ "@sanity/client": "^7.12.1",
74
+ "@sanity/pkg-utils": "^8.1.29",
75
+ "@sanity/plugin-kit": "^4.0.20",
76
76
  "@sanity/semantic-release-preset": "^5.0.0",
77
- "@sanity/vision": "^3.77.2",
77
+ "@sanity/vision": "^3.99.0",
78
78
  "@types/lodash": "^4.17.15",
79
79
  "@types/react": "^19.0.10",
80
80
  "@types/react-is": "^19.0.0",
@@ -96,10 +96,10 @@
96
96
  "react": "^19.0.0",
97
97
  "react-dom": "^19.0.0",
98
98
  "react-is": "^19.0.0",
99
- "sanity": "^3.77.2",
99
+ "sanity": "^3.99.0",
100
100
  "semantic-release": "^24.2.3",
101
101
  "styled-components": "^6.1.15",
102
- "typescript": "5.7.3"
102
+ "typescript": "5.9.3"
103
103
  },
104
104
  "peerDependencies": {
105
105
  "react": "^18.3 || ^19",
@@ -242,16 +242,17 @@ export function testUrl(url: string): Observable<string> {
242
242
  if (typeof url !== 'string') {
243
243
  return throwError(error)
244
244
  }
245
+ const trimmedUrl = url.trim()
245
246
  let parsed
246
247
  try {
247
- parsed = new URL(url)
248
+ parsed = new URL(trimmedUrl)
248
249
  } catch (err) {
249
250
  return throwError(error)
250
251
  }
251
252
  if (parsed && !parsed.protocol.match(/http:|https:/)) {
252
253
  return throwError(error)
253
254
  }
254
- return of(url)
255
+ return of(trimmedUrl)
255
256
  }
256
257
 
257
258
  function optionsFromFile(opts: {preserveFilename?: boolean}, file: File) {
@@ -274,7 +274,7 @@ export default function Uploader(props: Props) {
274
274
  event.preventDefault()
275
275
  event.stopPropagation()
276
276
  const clipboardData = event.clipboardData || (window as any).clipboardData
277
- const url = clipboardData.getData('text')
277
+ const url = clipboardData.getData('text')?.trim()
278
278
  if (!isValidUrl(url)) {
279
279
  toast.push({status: 'error', title: 'Invalid URL for Mux video input.'})
280
280
  return
@@ -1,4 +1,5 @@
1
- import MuxPlayer, {type MuxPlayerProps, type MuxPlayerRefAttributes} from '@mux/mux-player-react'
1
+ import {type MuxPlayerProps, type MuxPlayerRefAttributes} from '@mux/mux-player-react'
2
+ import MuxPlayer from '@mux/mux-player-react/lazy'
2
3
  import {ErrorOutlineIcon} from '@sanity/icons'
3
4
  import {Card, Text} from '@sanity/ui'
4
5
  import {type PropsWithChildren, useMemo, useRef} from 'react'
@@ -45,26 +45,26 @@ export function PaneItemPreview(props: PaneItemPreviewProps) {
45
45
  : null
46
46
 
47
47
  const observable = useMemo(
48
- () => getPreviewStateObservable(props.documentPreviewStore, schemaType, value._id, title),
49
- [props.documentPreviewStore, schemaType, title, value._id]
48
+ () => getPreviewStateObservable(props.documentPreviewStore, schemaType, value._id),
49
+ [props.documentPreviewStore, schemaType, value._id]
50
50
  )
51
- const {draft, published, isLoading} = useObservable(observable, {
52
- draft: null,
53
- published: null,
51
+ const {snapshot, original, isLoading} = useObservable(observable, {
54
52
  isLoading: true,
53
+ snapshot: null,
54
+ original: null,
55
55
  })
56
56
 
57
57
  const status = isLoading ? null : (
58
58
  <Inline space={4}>
59
59
  {presence && presence.length > 0 && <DocumentPreviewPresence presence={presence} />}
60
- <PublishedStatus document={published} />
61
- <DraftStatus document={draft} />
60
+ <PublishedStatus document={original} />
61
+ <DraftStatus document={snapshot} />
62
62
  </Inline>
63
63
  )
64
64
 
65
65
  return (
66
66
  <SanityDefaultPreview
67
- {...(getPreviewValueWithFallback({value, draft, published}) as any)}
67
+ {...(getPreviewValueWithFallback({snapshot, original, fallback: {title}}) as any)}
68
68
  isPlaceholder={isLoading}
69
69
  icon={icon}
70
70
  layout={layout}
@@ -0,0 +1,5 @@
1
+ import {type Theme} from '@sanity/ui/theme'
2
+
3
+ declare module 'styled-components' {
4
+ interface DefaultTheme extends Theme {}
5
+ }