sanity-plugin-mux-input 2.8.1 → 2.9.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.
package/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # Mux Video Input Sanity Plugin
2
2
 
3
- > This is a **Sanity Studio v3** plugin.
4
3
  > For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/sanity-plugin-mux-input/tree/studio-v2).
5
4
 
6
5
  This plugin lets you use [Mux](https://www.mux.com) video assets in your Sanity studio.
package/dist/index.d.mts CHANGED
@@ -56,6 +56,9 @@ declare interface MuxAsset {
56
56
  unexpected_media_file_parameters?: 'non-standard'
57
57
  test?: boolean
58
58
  }
59
+ meta?: {
60
+ title?: string
61
+ }
59
62
  }
60
63
 
61
64
  declare interface MuxAudioTrack {
package/dist/index.d.ts CHANGED
@@ -56,6 +56,9 @@ declare interface MuxAsset {
56
56
  unexpected_media_file_parameters?: 'non-standard'
57
57
  test?: boolean
58
58
  }
59
+ meta?: {
60
+ title?: string
61
+ }
59
62
  }
60
63
 
61
64
  declare interface MuxAudioTrack {
package/dist/index.js CHANGED
@@ -257,7 +257,7 @@ function muxAssetToSanityDocument(asset) {
257
257
  _createdAt: parseMuxDate(asset.created_at).toISOString(),
258
258
  assetId: asset.id,
259
259
  playbackId,
260
- filename: `Asset #${sanity.truncateString(asset.id, 15)}`,
260
+ filename: asset.meta?.title ?? `Asset #${sanity.truncateString(asset.id, 15)}`,
261
261
  status: asset.status,
262
262
  data: asset
263
263
  };
@@ -916,7 +916,7 @@ function VideoPlayer({
916
916
  crossOrigin: "anonymous",
917
917
  metadata: {
918
918
  player_name: "Sanity Admin Dashboard",
919
- player_version: "2.8.1",
919
+ player_version: "2.9.0",
920
920
  page_type: "Preview Player"
921
921
  },
922
922
  audio: isAudio,
@@ -2310,7 +2310,7 @@ const InputFallback = () => /* @__PURE__ */ jsxRuntime.jsx("div", { style: { pad
2310
2310
  }
2311
2311
  ) }), useAccessControl = (config) => {
2312
2312
  const user = sanity.useCurrentUser();
2313
- return { hasConfigAccess: !config?.allowedRolesForConfiguration || user?.roles?.some((role) => config.allowedRolesForConfiguration.includes(role.name)) };
2313
+ return { hasConfigAccess: !config?.allowedRolesForConfiguration?.length || user?.roles?.some((role) => config.allowedRolesForConfiguration.includes(role.name)) };
2314
2314
  };
2315
2315
  function Onboard(props) {
2316
2316
  const { setDialogState } = props, handleOpen = React.useCallback(() => setDialogState("secrets"), [setDialogState]), { hasConfigAccess } = useAccessControl(props.config);