sanity-plugin-mux-input 1.1.5 → 1.2.0-main.1

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 (78) hide show
  1. package/README.md +41 -19
  2. package/lib/cjs/Input.8380eb24.js +3591 -0
  3. package/lib/cjs/Input.8380eb24.js.map +1 -0
  4. package/lib/cjs/Input.f632a169.js +410 -0
  5. package/lib/cjs/Input.f632a169.js.map +1 -0
  6. package/lib/cjs/Preview.3e13819d.js +53 -0
  7. package/lib/cjs/Preview.3e13819d.js.map +1 -0
  8. package/lib/cjs/index.js +381 -0
  9. package/lib/cjs/index.js.map +1 -0
  10. package/lib/esm/Input.8733ca54.js +3588 -0
  11. package/lib/esm/Input.8733ca54.js.map +1 -0
  12. package/lib/esm/Input.e91a8018.js +407 -0
  13. package/lib/esm/Input.e91a8018.js.map +1 -0
  14. package/lib/esm/Preview.0ca0dc85.js +53 -0
  15. package/lib/esm/Preview.0ca0dc85.js.map +1 -0
  16. package/lib/esm/index.js +374 -0
  17. package/lib/esm/index.js.map +1 -0
  18. package/lib/types/index.d.ts +15 -0
  19. package/lib/types/index.d.ts.map +1 -0
  20. package/package.json +92 -50
  21. package/sanity.json +2 -10
  22. package/v2-incompatible.js +11 -0
  23. package/build/actions/assets.js +0 -37
  24. package/build/actions/assets.js.map +0 -1
  25. package/build/actions/secrets.js +0 -125
  26. package/build/actions/secrets.js.map +0 -1
  27. package/build/actions/upload.js +0 -280
  28. package/build/actions/upload.js.map +0 -1
  29. package/build/clients/SanityClient.js +0 -19
  30. package/build/clients/SanityClient.js.map +0 -1
  31. package/build/clients/upChunkObservable.js +0 -66
  32. package/build/clients/upChunkObservable.js.map +0 -1
  33. package/build/components/FileInputButton.js +0 -84
  34. package/build/components/FileInputButton.js.map +0 -1
  35. package/build/components/Input.css +0 -30
  36. package/build/components/Input.js +0 -821
  37. package/build/components/Input.js.map +0 -1
  38. package/build/components/MuxLogo.js +0 -19
  39. package/build/components/MuxLogo.js.map +0 -1
  40. package/build/components/Preview.css +0 -16
  41. package/build/components/Preview.js +0 -95
  42. package/build/components/Preview.js.map +0 -1
  43. package/build/components/SelectAsset.css +0 -56
  44. package/build/components/SelectAsset.js +0 -162
  45. package/build/components/SelectAsset.js.map +0 -1
  46. package/build/components/Setup.css +0 -7
  47. package/build/components/Setup.js +0 -311
  48. package/build/components/Setup.js.map +0 -1
  49. package/build/components/UploadPlaceholder.css +0 -81
  50. package/build/components/UploadPlaceholder.js +0 -92
  51. package/build/components/UploadPlaceholder.js.map +0 -1
  52. package/build/components/Uploader.css +0 -28
  53. package/build/components/Uploader.js +0 -534
  54. package/build/components/Uploader.js.map +0 -1
  55. package/build/components/Video.css +0 -21
  56. package/build/components/Video.js +0 -360
  57. package/build/components/Video.js.map +0 -1
  58. package/build/config.js +0 -17
  59. package/build/config.js.map +0 -1
  60. package/build/index.js +0 -22
  61. package/build/index.js.map +0 -1
  62. package/build/schema/mux.video.js +0 -41
  63. package/build/schema/mux.video.js.map +0 -1
  64. package/build/schema/mux.videoAsset.js +0 -29
  65. package/build/schema/mux.videoAsset.js.map +0 -1
  66. package/build/util/extractFiles.js +0 -70
  67. package/build/util/extractFiles.js.map +0 -1
  68. package/build/util/formatTime.js +0 -28
  69. package/build/util/formatTime.js.map +0 -1
  70. package/build/util/generateJwt.js +0 -30
  71. package/build/util/generateJwt.js.map +0 -1
  72. package/build/util/getPosterSrc.js +0 -46
  73. package/build/util/getPosterSrc.js.map +0 -1
  74. package/build/util/getStoryboardSrc.js +0 -26
  75. package/build/util/getStoryboardSrc.js.map +0 -1
  76. package/build/util/getVideoSrc.js +0 -23
  77. package/build/util/getVideoSrc.js.map +0 -1
  78. package/config.dist.json +0 -3
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Mux Video Input Sanity Plugin
2
2
 
3
- This is a plugin which let you use [Mux](https://www.mux.com) video assets in your Sanity studio.
3
+ > **NOTE**
4
+ >
5
+ > This is the **Sanity Studio v3 version** of sanity-plugin-mux-input.
6
+ >
7
+ > For the v2 version, please refer to the [studio-v2 branch](https://github.com/sanity-io/sanity-plugin-mux-input).
8
+
9
+ This is a plugin that let you use [Mux](https://www.mux.com) video assets in your Sanity studio.
4
10
 
5
11
  The Mux plugin for Sanity gives you a way to upload and preview videos easily.
6
12
 
@@ -10,8 +16,8 @@ Not familiar with Sanity? [Visit www.sanity.io](https://www.sanity.io/)
10
16
 
11
17
  ## Quick start
12
18
 
13
- - While in your project folder, run `sanity install mux-input`.
14
- Read more about [using plugins in Sanity here](https://www.sanity.io/docs/plugins).
19
+ - While in your project folder, run `npm i sanity-plugin-mux-input`.
20
+ Read more about [using plugins in Sanity here](https://beta.sanity.io/docs/platform/studio/plugin).
15
21
 
16
22
  * Make a schema type that uses the plugin's type `mux.video`, for example:
17
23
 
@@ -43,11 +49,11 @@ Not familiar with Sanity? [Visit www.sanity.io](https://www.sanity.io/)
43
49
  The token is stored in the dataset as a document of the type `mux.apiKey` with the id `secrets.mux`.
44
50
  Having the ID be non-root ensures that only editors are able to see it.
45
51
 
46
- The Mux plugin will find it’s access tokens by fetching this document.
52
+ The Mux plugin will find its access tokens by fetching this document.
47
53
 
48
54
  # Playing videos in the frontend
49
55
 
50
- We have made an own player which supports poster images for the videos as set with this plugin, see [`sanity-mux-player`](https://github.com/sanity-io/sanity-mux-player)
56
+ We have made our own player which supports poster images for the videos as set with this plugin, see [`sanity-mux-player`](https://github.com/sanity-io/sanity-mux-player)
51
57
 
52
58
  You could use any player which supports HLS, just point the video source to:
53
59
 
@@ -61,36 +67,52 @@ More information for this feature of the plugin can be found on Mux's [documenta
61
67
 
62
68
  # Enabling MP4 support
63
69
 
64
- To enable [static MP4 renditions](https://docs.mux.com/guides/video/enable-static-mp4-renditions), create or open the config file found in `config/mux-input.json` in your studio folder. This file is automatically created the first time the studio starts after adding the plugin.
70
+ To enable [static MP4 renditions](https://docs.mux.com/guides/video/enable-static-mp4-renditions), add `mp4_support: 'standard'` to the `options` of your `mux.video` schema type.
71
+
72
+ js```
73
+ import {muxInput} from 'sanity-plugin-mux-input'
74
+
75
+ export deafult createConfig({
76
+ plugins: [muxInput({
77
+ mp4_support: "standard"
78
+ })]
79
+ })
65
80
 
66
- ```
67
- {
68
- "mp4_support": "standard"
69
- }
70
81
  ```
71
82
 
72
- Currently `mp4_support` is the only supported MUX option and this supports a value of either `standard` or `none` (the default).
83
+ Currently, `mp4_support` is the only supported MUX option and this supports a value of either `standard` or `none` (the default).
73
84
 
74
85
  # Contributing
75
86
 
76
87
  Issues are actively monitored and PRs are welcome. When developing this plugin the easiest setup is:
77
88
 
78
89
  1. Fork this repo.
79
- 1. Install the sanity cli and create a sanity project: `npm install -g @sanity/cli && sanity init`. Follow the prompts, starting out with the blog template is a good way to go.
90
+ 1. Create a studio v3 project: `npm create sanity@dev-preview`. Follow the prompts, starting out with the blog template is a good way to go.
80
91
  1. `cd` into your project directory, run `npm install && npm start` - your sanity studio should be running on http://localhost:3333.
81
- 1. `cd` into the `plugins` director of your project.
92
+ 1. `cd` into the `plugins` directory of your project.
82
93
  1. Fork this repo and clone your fork into the `plugins` directory inside your project `git clone git@github.com:your-fork/sanity-plugin-mux-input.git`.
83
94
  1. Open `sanity.json`, go to the `plugins` array and add `mux-input`.
84
95
  1. Re-start the sanity studio server with `npm start`.
85
96
  1. Edit `schemas/post.js` and add follow the plugin documentation to add a `mux.video` type field.
86
- 1. Your studio should reload, and now when you edit the plugin code it should reload the studio, when you're done create a branch, put in a PR and a maintainer will review it. Thank you!
97
+ 1. Your studio should reload, and now when you edit the plugin code it should reload the studio, when you're done creating a branch, put in a PR and a maintainer will review it. Thank you!
98
+
99
+ # Publishing
87
100
 
88
- ## Publishing
101
+ Publishing is done by pushing [Conventional Commits](https://github.com/semantic-release/semantic-release#how-does-it-work).
102
+ On the [studio-v2](/tree/studio-v2) branch this will result in:
89
103
 
90
- ### Test
104
+ - a new version on the `latest` dist-tag.
105
+ - running `yarn add sanity-plugin-mux-input` or `npm i sanity-plugin-mux-input` will fetch the new version.
106
+ - running `sanity install mux-input` will fetch the new version.
107
+ - studio-v3 users are unaffected.
108
+ On the [main](/tree/main) branch this will result in:
109
+ - a new prerelease version on the `studio-v3` dist-tag.
110
+ - running `yarn add sanity-plugin-mux-input@studio-v3` or `npm i sanity-plugin-mux-input@studio-v3` will fetch the new version.
111
+ - running `sanity install mux-input` won't fetch the new version.
91
112
 
92
- `yarn semantic-release`
113
+ After Studio v3 turns stable this behavior will change. The v2 version will then be available on the `studio-v2` dist-tag, and `studio-v3` is upgraded to live on `latest`.
93
114
 
94
- ### Go live
115
+ # Test
95
116
 
96
- `yarn semantic-release -- --no-ci`
117
+ `npm test`
118
+ ```