sanity-plugin-mux-input 2.3.1 → 2.3.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.
Files changed (41) hide show
  1. package/lib/index.cjs +36 -25
  2. package/lib/index.cjs.map +1 -1
  3. package/lib/index.esm.js +14 -3
  4. package/lib/index.esm.js.map +1 -1
  5. package/lib/index.js +14 -3
  6. package/lib/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/ConfigureApi.styled.tsx +1 -2
  9. package/src/components/ConfigureApi.tsx +1 -0
  10. package/src/components/FileInputButton.tsx +1 -1
  11. package/src/components/FileInputMenuItem.styled.tsx +1 -1
  12. package/src/components/IconInfo.tsx +0 -1
  13. package/src/components/ImportVideosFromMux.tsx +2 -1
  14. package/src/components/Input.styled.tsx +0 -1
  15. package/src/components/InputBrowser.tsx +1 -1
  16. package/src/components/InputError.tsx +1 -1
  17. package/src/components/Player.styled.tsx +1 -1
  18. package/src/components/PlayerActionsMenu.tsx +3 -1
  19. package/src/components/SpinnerBox.tsx +0 -1
  20. package/src/components/StudioTool.tsx +2 -3
  21. package/src/components/UploadConfiguration.tsx +1 -0
  22. package/src/components/UploadPlaceholder.tsx +1 -1
  23. package/src/components/UploadProgress.tsx +1 -2
  24. package/src/components/Uploader.styled.tsx +1 -1
  25. package/src/components/VideoDetails/DeleteDialog.tsx +1 -0
  26. package/src/components/VideoDetails/VideoDetails.tsx +2 -0
  27. package/src/components/VideoDetails/VideoReferences.tsx +2 -3
  28. package/src/components/VideoInBrowser.tsx +2 -1
  29. package/src/components/VideoMetadata.tsx +1 -2
  30. package/src/components/VideoThumbnail.tsx +1 -1
  31. package/src/components/VideosBrowser.tsx +4 -4
  32. package/src/components/documentPreview/DraftStatus.tsx +1 -1
  33. package/src/components/documentPreview/MissingSchemaType.tsx +0 -1
  34. package/src/components/documentPreview/PaneItemPreview.tsx +5 -5
  35. package/src/components/documentPreview/PublishedStatus.tsx +1 -1
  36. package/src/components/documentPreview/TimeAgo.tsx +0 -1
  37. package/src/components/icons/Resolution.tsx +1 -1
  38. package/src/components/icons/StopWatch.tsx +1 -1
  39. package/src/components/icons/ToolIcon.tsx +0 -2
  40. package/src/components/withFocusRing/withFocusRing.ts +2 -2
  41. package/src/hooks/useImportMuxAssets.ts +2 -1
package/lib/index.cjs CHANGED
@@ -19,11 +19,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
19
19
  mod
20
20
  ));
21
21
  Object.defineProperty(exports, "__esModule", { value: !0 });
22
- var sanity = require("sanity"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), ui = require("@sanity/ui"), React = require("react"), compact = require("lodash/compact.js"), toLower = require("lodash/toLower.js"), trim = require("lodash/trim.js"), uniq = require("lodash/uniq.js"), words = require("lodash/words.js"), styled = require("styled-components"), uuid = require("@sanity/uuid"), rxjs = require("rxjs"), operators = require("rxjs/operators"), suspendReact = require("suspend-react"), MuxPlayer = require("@mux/mux-player-react"), desk = require("sanity/desk"), router = require("sanity/router"), isNumber = require("lodash/isNumber.js"), isString = require("lodash/isString.js"), reactRx = require("react-rx"), useSWR = require("swr"), scrollIntoView = require("scroll-into-view-if-needed"), useErrorBoundary = require("use-error-boundary"), upchunk = require("@mux/upchunk"), reactIs = require("react-is"), LanguagesList = require("iso-639-1");
22
+ var sanity = require("sanity"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), ui = require("@sanity/ui"), React = require("react"), compact = require("lodash/compact.js"), toLower = require("lodash/toLower.js"), trim = require("lodash/trim.js"), uniq = require("lodash/uniq.js"), words = require("lodash/words.js"), styledComponents = require("styled-components"), uuid = require("@sanity/uuid"), rxjs = require("rxjs"), operators = require("rxjs/operators"), suspendReact = require("suspend-react"), MuxPlayer = require("@mux/mux-player-react"), desk = require("sanity/desk"), router = require("sanity/router"), isNumber = require("lodash/isNumber.js"), isString = require("lodash/isString.js"), reactRx = require("react-rx"), useSWR = require("swr"), scrollIntoView = require("scroll-into-view-if-needed"), useErrorBoundary = require("use-error-boundary"), upchunk = require("@mux/upchunk"), reactIs = require("react-is"), LanguagesList = require("iso-639-1");
23
23
  function _interopDefaultCompat(e) {
24
24
  return e && typeof e == "object" && "default" in e ? e : { default: e };
25
25
  }
26
- var React__default = /* @__PURE__ */ _interopDefaultCompat(React), compact__default = /* @__PURE__ */ _interopDefaultCompat(compact), toLower__default = /* @__PURE__ */ _interopDefaultCompat(toLower), trim__default = /* @__PURE__ */ _interopDefaultCompat(trim), uniq__default = /* @__PURE__ */ _interopDefaultCompat(uniq), words__default = /* @__PURE__ */ _interopDefaultCompat(words), styled__default = /* @__PURE__ */ _interopDefaultCompat(styled), MuxPlayer__default = /* @__PURE__ */ _interopDefaultCompat(MuxPlayer), isNumber__default = /* @__PURE__ */ _interopDefaultCompat(isNumber), isString__default = /* @__PURE__ */ _interopDefaultCompat(isString), useSWR__default = /* @__PURE__ */ _interopDefaultCompat(useSWR), scrollIntoView__default = /* @__PURE__ */ _interopDefaultCompat(scrollIntoView), LanguagesList__default = /* @__PURE__ */ _interopDefaultCompat(LanguagesList);
26
+ var React__default = /* @__PURE__ */ _interopDefaultCompat(React), compact__default = /* @__PURE__ */ _interopDefaultCompat(compact), toLower__default = /* @__PURE__ */ _interopDefaultCompat(toLower), trim__default = /* @__PURE__ */ _interopDefaultCompat(trim), uniq__default = /* @__PURE__ */ _interopDefaultCompat(uniq), words__default = /* @__PURE__ */ _interopDefaultCompat(words), MuxPlayer__default = /* @__PURE__ */ _interopDefaultCompat(MuxPlayer), isNumber__default = /* @__PURE__ */ _interopDefaultCompat(isNumber), isString__default = /* @__PURE__ */ _interopDefaultCompat(isString), useSWR__default = /* @__PURE__ */ _interopDefaultCompat(useSWR), scrollIntoView__default = /* @__PURE__ */ _interopDefaultCompat(scrollIntoView), LanguagesList__default = /* @__PURE__ */ _interopDefaultCompat(LanguagesList);
27
27
  const ToolIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
28
28
  "svg",
29
29
  {
@@ -366,7 +366,7 @@ function getAnimatedPosterSrc({
366
366
  }
367
367
  return `https://image.mux.com/${playbackId}/animated.gif?${searchParams}`;
368
368
  }
369
- const Image = styled__default.default.img`
369
+ const Image = styledComponents.styled.img`
370
370
  transition: opacity 0.175s ease-out 0s;
371
371
  display: block;
372
372
  width: 100%;
@@ -457,7 +457,7 @@ function VideoThumbnail({
457
457
  }
458
458
  );
459
459
  }
460
- const MissingAssetCheckbox = styled__default.default(ui.Checkbox)`
460
+ const MissingAssetCheckbox = styledComponents.styled(ui.Checkbox)`
461
461
  position: static !important;
462
462
 
463
463
  input::after {
@@ -539,6 +539,7 @@ function ImportVideosDialog(props) {
539
539
  return /* @__PURE__ */ jsxRuntime.jsx(
540
540
  ui.Dialog,
541
541
  {
542
+ animate: !0,
542
543
  header: "Import videos from Mux",
543
544
  zOffset: DIALOGS_Z_INDEX,
544
545
  id: "video-details-dialog",
@@ -767,7 +768,7 @@ function getVideoSrc({ asset, client }) {
767
768
  }
768
769
  return `https://stream.mux.com/${playbackId}.m3u8?${searchParams}`;
769
770
  }
770
- var name = "sanity-plugin-mux-input", version = "2.3.1", description = "An input component that integrates Sanity Studio with Mux video encoding/hosting service.", keywords = [
771
+ var name = "sanity-plugin-mux-input", version = "2.3.2", description = "An input component that integrates Sanity Studio with Mux video encoding/hosting service.", keywords = [
771
772
  "sanity",
772
773
  "video",
773
774
  "mux",
@@ -1020,6 +1021,7 @@ function DraftStatus(props) {
1020
1021
  return /* @__PURE__ */ jsxRuntime.jsx(
1021
1022
  ui.Tooltip,
1022
1023
  {
1024
+ animate: !0,
1023
1025
  portal: !0,
1024
1026
  content: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 2, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, children: document2 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1025
1027
  "Edited ",
@@ -1034,6 +1036,7 @@ function PublishedStatus(props) {
1034
1036
  return /* @__PURE__ */ jsxRuntime.jsx(
1035
1037
  ui.Tooltip,
1036
1038
  {
1039
+ animate: !0,
1037
1040
  portal: !0,
1038
1041
  content: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 2, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, children: document2 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1039
1042
  "Published ",
@@ -1106,7 +1109,7 @@ function DocumentPreview(props) {
1106
1109
  }
1107
1110
  );
1108
1111
  }
1109
- const Container = styled__default.default(ui.Box)`
1112
+ const Container = styledComponents.styled(ui.Box)`
1110
1113
  * {
1111
1114
  color: ${(props) => props.theme.sanity.color.base.fg};
1112
1115
  }
@@ -1173,6 +1176,7 @@ function DeleteDialog({
1173
1176
  return /* @__PURE__ */ jsxRuntime.jsx(
1174
1177
  ui.Dialog,
1175
1178
  {
1179
+ animate: !0,
1176
1180
  header: "Delete video",
1177
1181
  zOffset: DIALOGS_Z_INDEX,
1178
1182
  id: "deleting-video-details-dialog",
@@ -1368,6 +1372,7 @@ const AssetInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(FormField$1, { titl
1368
1372
  }, []), /* @__PURE__ */ jsxRuntime.jsxs(
1369
1373
  ui.Dialog,
1370
1374
  {
1375
+ animate: !0,
1371
1376
  header: displayInfo.title,
1372
1377
  zOffset: DIALOGS_Z_INDEX,
1373
1378
  id: "video-details-dialog",
@@ -1421,6 +1426,7 @@ const AssetInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(FormField$1, { titl
1421
1426
  state === "closing" && /* @__PURE__ */ jsxRuntime.jsx(
1422
1427
  ui.Dialog,
1423
1428
  {
1429
+ animate: !0,
1424
1430
  header: "You have unsaved changes",
1425
1431
  zOffset: DIALOGS_Z_INDEX,
1426
1432
  id: "closing-video-details-dialog",
@@ -1632,7 +1638,7 @@ ${displayInfo.id}`, icon: icons.TagIcon, size: 2 })
1632
1638
  displayInfo.title != displayInfo.id.slice(0, 12) && /* @__PURE__ */ jsxRuntime.jsx(IconInfo, { text: displayInfo.id.slice(0, 12), icon: icons.TagIcon, size: 1, muted: !0 })
1633
1639
  ] })
1634
1640
  ] });
1635
- }, PlayButton = styled__default.default.button`
1641
+ }, PlayButton = styledComponents.styled.button`
1636
1642
  display: block;
1637
1643
  padding: 0;
1638
1644
  margin: 0;
@@ -1713,6 +1719,7 @@ function VideoInBrowser({
1713
1719
  playbackPolicy === "signed" && /* @__PURE__ */ jsxRuntime.jsx(
1714
1720
  ui.Tooltip,
1715
1721
  {
1722
+ animate: !0,
1716
1723
  content: /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { padding: 2, radius: 2, children: /* @__PURE__ */ jsxRuntime.jsx(IconInfo, { icon: icons.LockIcon, text: "Signed playback policy", size: 2 }) }),
1717
1724
  placement: "right",
1718
1725
  fallbackPlacements: ["top", "bottom"],
@@ -1796,7 +1803,7 @@ function VideoInBrowser({
1796
1803
  );
1797
1804
  }
1798
1805
  function VideosBrowser({ onSelect }) {
1799
- const { assets, isLoading, searchQuery, setSearchQuery, setSort, sort } = useAssets(), [editedAsset, setEditedAsset] = React__default.default.useState(null), freshEditedAsset = React__default.default.useMemo(
1806
+ const { assets, isLoading, searchQuery, setSearchQuery, setSort, sort } = useAssets(), [editedAsset, setEditedAsset] = React.useState(null), freshEditedAsset = React.useMemo(
1800
1807
  () => assets.find((a) => a._id === (editedAsset == null ? void 0 : editedAsset._id)) || editedAsset,
1801
1808
  [editedAsset, assets]
1802
1809
  ), placement = onSelect ? "input" : "tool";
@@ -2617,7 +2624,7 @@ function MuxLogo({ height = 26 }) {
2617
2624
  }
2618
2625
  );
2619
2626
  }
2620
- const Logo = styled__default.default.span`
2627
+ const Logo = styledComponents.styled.span`
2621
2628
  display: inline-block;
2622
2629
  height: 0.8em;
2623
2630
  margin-right: 1em;
@@ -2678,6 +2685,7 @@ function ConfigureApi({ secrets, setDialogState }) {
2678
2685
  }, [firstField]), /* @__PURE__ */ jsxRuntime.jsx(
2679
2686
  ui.Dialog,
2680
2687
  {
2688
+ animate: !0,
2681
2689
  id,
2682
2690
  onClose: handleClose,
2683
2691
  header: /* @__PURE__ */ jsxRuntime.jsx(Header, {}),
@@ -3112,7 +3120,7 @@ function SelectAssets({ asset: selectedAsset, onChange, setDialogState }) {
3112
3120
  );
3113
3121
  return /* @__PURE__ */ jsxRuntime.jsx(VideosBrowser, { onSelect: handleSelect });
3114
3122
  }
3115
- const StyledDialog = styled__default.default(ui.Dialog)`
3123
+ const StyledDialog = styledComponents.styled(ui.Dialog)`
3116
3124
  > div[data-ui='DialogCard'] > div[data-ui='Card'] {
3117
3125
  height: 100%;
3118
3126
  }
@@ -3141,7 +3149,7 @@ const useCancelUpload = (asset, onChange) => {
3141
3149
  asset && (onChange(sanity.PatchEvent.from(sanity.unset())), asset.assetId && deleteAssetOnMux(client, asset.assetId), asset._id && client.delete(asset._id));
3142
3150
  }, [asset, client, onChange]);
3143
3151
  };
3144
- styled__default.default.div`
3152
+ styledComponents.styled.div`
3145
3153
  && {
3146
3154
  --media-background-color: transparent;
3147
3155
  --media-button-icon-width: 100%;
@@ -3160,7 +3168,7 @@ styled__default.default.div`
3160
3168
  }
3161
3169
  }
3162
3170
  `;
3163
- const TopControls = styled__default.default.div`
3171
+ const TopControls = styledComponents.styled.div`
3164
3172
  position: absolute;
3165
3173
  top: 0;
3166
3174
  right: 0;
@@ -3168,16 +3176,16 @@ const TopControls = styled__default.default.div`
3168
3176
  button {
3169
3177
  height: auto;
3170
3178
  }
3171
- `, CardWrapper = styled__default.default(ui.Card)`
3179
+ `, CardWrapper = styledComponents.styled(ui.Card)`
3172
3180
  min-height: 82px;
3173
3181
  box-sizing: border-box;
3174
- `, FlexWrapper = styled__default.default(ui.Flex)`
3182
+ `, FlexWrapper = styledComponents.styled(ui.Flex)`
3175
3183
  text-overflow: ellipsis;
3176
3184
  overflow: hidden;
3177
- `, LeftSection = styled__default.default(ui.Stack)`
3185
+ `, LeftSection = styledComponents.styled(ui.Stack)`
3178
3186
  position: relative;
3179
3187
  width: 60%;
3180
- `, CodeWrapper = styled__default.default(ui.Code)`
3188
+ `, CodeWrapper = styledComponents.styled(ui.Code)`
3181
3189
  position: relative;
3182
3190
  width: 100%;
3183
3191
 
@@ -3262,9 +3270,9 @@ function focusRingStyle(opts) {
3262
3270
  focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`
3263
3271
  ].filter(Boolean).join(",");
3264
3272
  }
3265
- const FileButton = styled__default.default(ui.MenuItem)(({ theme }) => {
3273
+ const FileButton = styledComponents.styled(ui.MenuItem)(({ theme }) => {
3266
3274
  const { focusRing } = theme.sanity, base = theme.sanity.color.base;
3267
- return styled.css`
3275
+ return styledComponents.css`
3268
3276
  position: relative;
3269
3277
 
3270
3278
  &:not([data-disabled='true']) {
@@ -3332,14 +3340,14 @@ const FileButton = styled__default.default(ui.MenuItem)(({ theme }) => {
3332
3340
  }
3333
3341
  )
3334
3342
  ] });
3335
- }), LockCard = styled__default.default(ui.Card)`
3343
+ }), LockCard = styledComponents.styled(ui.Card)`
3336
3344
  position: absolute;
3337
3345
  top: 0;
3338
3346
  left: 0;
3339
3347
  opacity: 0.6;
3340
3348
  mix-blend-mode: screen;
3341
3349
  background: transparent;
3342
- `, LockButton = styled__default.default(ui.Button)`
3350
+ `, LockButton = styledComponents.styled(ui.Button)`
3343
3351
  background: transparent;
3344
3352
  color: white;
3345
3353
  `;
@@ -3354,6 +3362,7 @@ function PlayerActionsMenu(props) {
3354
3362
  isSigned && /* @__PURE__ */ jsxRuntime.jsx(
3355
3363
  ui.Tooltip,
3356
3364
  {
3365
+ animate: !0,
3357
3366
  content: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 2, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { muted: !0, size: 1, children: "Signed playback policy" }) }),
3358
3367
  placement: "right",
3359
3368
  portal: !0,
@@ -3363,6 +3372,7 @@ function PlayerActionsMenu(props) {
3363
3372
  /* @__PURE__ */ jsxRuntime.jsx(
3364
3373
  ui.Popover,
3365
3374
  {
3375
+ animate: !0,
3366
3376
  content: /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { ref: setMenuRef, children: [
3367
3377
  /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 2, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { muted: !0, size: 1, children: "Replace" }) }),
3368
3378
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3681,6 +3691,7 @@ function UploadConfiguration({
3681
3691
  return /* @__PURE__ */ jsxRuntime.jsx(
3682
3692
  ui.Dialog,
3683
3693
  {
3694
+ animate: !0,
3684
3695
  open: !0,
3685
3696
  id: "upload-configuration",
3686
3697
  zOffset: 1e3,
@@ -3874,12 +3885,12 @@ function formatUploadConfig(config) {
3874
3885
  };
3875
3886
  }
3876
3887
  function withFocusRing(component) {
3877
- return styled__default.default(component)((props) => {
3888
+ return styledComponents.styled(component)((props) => {
3878
3889
  const border = {
3879
3890
  width: props.$border ? 1 : 0,
3880
3891
  color: "var(--card-border-color)"
3881
3892
  };
3882
- return styled.css`
3893
+ return styledComponents.css`
3883
3894
  --card-focus-box-shadow: ${focusRingBorderStyle(border)};
3884
3895
 
3885
3896
  border-radius: ${ui.rem(props.theme.sanity.radius[1])};
@@ -3926,7 +3937,7 @@ const ctrlKey = 17, cmdKey = 91, UploadCardWithFocusRing = withFocusRing(ui.Card
3926
3937
  }
3927
3938
  );
3928
3939
  }
3929
- ), HiddenInput$1 = styled__default.default.input.attrs({ type: "text" })`
3940
+ ), HiddenInput$1 = styledComponents.styled.input.attrs({ type: "text" })`
3930
3941
  position: absolute;
3931
3942
  border: 0;
3932
3943
  color: white;
@@ -3935,14 +3946,14 @@ const ctrlKey = 17, cmdKey = 91, UploadCardWithFocusRing = withFocusRing(ui.Card
3935
3946
  &:focus {
3936
3947
  outline: none;
3937
3948
  }
3938
- `, HiddenInput = styled__default.default.input`
3949
+ `, HiddenInput = styledComponents.styled.input`
3939
3950
  overflow: hidden;
3940
3951
  width: 0.1px;
3941
3952
  height: 0.1px;
3942
3953
  opacity: 0;
3943
3954
  position: absolute;
3944
3955
  z-index: -1;
3945
- `, Label = styled__default.default.label`
3956
+ `, Label = styledComponents.styled.label`
3946
3957
  position: relative;
3947
3958
  `, FileInputButton = ({ onSelect, accept, ...props }) => {
3948
3959
  const inputId = `FileSelect${React.useId()}`, inputRef = React.useRef(null), handleSelect = React.useCallback(