sanity-plugin-mux-input 2.1.1 → 2.2.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.
Files changed (66) hide show
  1. package/lib/index.cjs +4037 -4
  2. package/lib/index.cjs.map +1 -1
  3. package/lib/index.d.ts +14 -1
  4. package/lib/index.js +4026 -2
  5. package/lib/index.js.map +1 -1
  6. package/package.json +27 -28
  7. package/src/actions/assets.ts +30 -2
  8. package/src/components/ConfigureApi.tsx +9 -1
  9. package/src/components/FormField.tsx +8 -10
  10. package/src/components/IconInfo.tsx +23 -0
  11. package/src/components/Input.styled.tsx +0 -8
  12. package/src/components/Input.tsx +4 -3
  13. package/src/components/InputBrowser.tsx +1 -8
  14. package/src/components/Player.styled.tsx +5 -144
  15. package/src/components/Player.tsx +23 -109
  16. package/src/components/PlayerActionsMenu.tsx +0 -4
  17. package/src/components/SelectAsset.tsx +18 -58
  18. package/src/components/SelectSortOptions.tsx +45 -0
  19. package/src/components/SpinnerBox.tsx +17 -0
  20. package/src/components/StudioTool.tsx +20 -0
  21. package/src/components/VideoDetails/DeleteDialog.tsx +156 -0
  22. package/src/components/VideoDetails/VideoDetails.tsx +298 -0
  23. package/src/components/VideoDetails/VideoReferences.tsx +70 -0
  24. package/src/components/VideoDetails/useVideoDetails.ts +85 -0
  25. package/src/components/VideoInBrowser.tsx +183 -0
  26. package/src/components/VideoMetadata.tsx +43 -0
  27. package/src/components/VideoPlayer.tsx +69 -0
  28. package/src/components/VideoThumbnail.tsx +106 -0
  29. package/src/components/VideosBrowser.tsx +83 -0
  30. package/src/components/__legacy__Uploader.tsx +2 -9
  31. package/src/components/documentPreview/DocumentPreview.tsx +107 -0
  32. package/src/components/documentPreview/DraftStatus.tsx +34 -0
  33. package/src/components/documentPreview/MissingSchemaType.tsx +33 -0
  34. package/src/components/documentPreview/PaneItemPreview.tsx +71 -0
  35. package/src/components/documentPreview/PublishedStatus.tsx +35 -0
  36. package/src/components/documentPreview/TimeAgo.tsx +13 -0
  37. package/src/components/documentPreview/paneItemTypes.ts +7 -0
  38. package/src/components/icons/Resolution.tsx +12 -0
  39. package/src/components/icons/StopWatch.tsx +20 -0
  40. package/src/components/icons/ToolIcon.tsx +21 -0
  41. package/src/hooks/useAssets.ts +61 -0
  42. package/src/hooks/useCancelUpload.ts +2 -2
  43. package/src/hooks/useClient.ts +3 -1
  44. package/src/hooks/useDocReferences.ts +21 -0
  45. package/src/hooks/useInView.ts +45 -0
  46. package/src/index.ts +2 -0
  47. package/src/plugin.tsx +1 -1
  48. package/src/util/constants.ts +7 -0
  49. package/src/util/createSearchFilter.ts +78 -0
  50. package/src/util/formatSeconds.ts +22 -0
  51. package/src/util/getAnimatedPosterSrc.ts +1 -1
  52. package/src/util/getPlaybackId.ts +1 -1
  53. package/src/util/getPlaybackPolicy.ts +1 -1
  54. package/src/util/getVideoMetadata.ts +18 -0
  55. package/src/util/types.ts +16 -1
  56. package/lib/_chunks/Player-547f8e2a.cjs +0 -474
  57. package/lib/_chunks/Player-547f8e2a.cjs.map +0 -1
  58. package/lib/_chunks/Player-bfdb96f6.js +0 -465
  59. package/lib/_chunks/Player-bfdb96f6.js.map +0 -1
  60. package/lib/_chunks/index-39e38243.cjs +0 -3251
  61. package/lib/_chunks/index-39e38243.cjs.map +0 -1
  62. package/lib/_chunks/index-71899191.js +0 -3229
  63. package/lib/_chunks/index-71899191.js.map +0 -1
  64. package/src/components/EditThumbnailDialog.tsx +0 -74
  65. package/src/components/VideoSource.styled.tsx +0 -235
  66. package/src/components/VideoSource.tsx +0 -318
package/lib/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="react" />
2
+
1
3
  import type {PartialDeep} from 'type-fest'
2
4
  import {Plugin as Plugin_2} from 'sanity'
3
5
  import type {SanityDocument} from 'sanity'
@@ -9,6 +11,17 @@ declare interface Config {
9
11
  * @defaultValue 'none'
10
12
  */
11
13
  mp4_support: 'none' | 'standard'
14
+ /**
15
+ * How the videos browser should appear as a studio tool in Sanity's top navigation
16
+ *
17
+ * Pass `false` if you want to disable it.
18
+ **/
19
+ tool?:
20
+ | false
21
+ | {
22
+ title?: string
23
+ icon?: React.ComponentType
24
+ }
12
25
  }
13
26
 
14
27
  export declare const defaultConfig: Config
@@ -100,7 +113,7 @@ declare interface MuxVideoTrack {
100
113
 
101
114
  declare type PlaybackPolicy = 'signed' | 'public'
102
115
 
103
- export declare interface VideoAssetDocument extends Partial<SanityDocument> {
116
+ export declare interface VideoAssetDocument extends SanityDocument {
104
117
  type?: 'mux.videoAsset'
105
118
  status?: string
106
119
  assetId?: string