sanity-plugin-mux-input 2.3.0 → 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.
- package/lib/index.cjs +54 -43
- package/lib/index.cjs.map +1 -1
- package/lib/index.esm.js +37 -20
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +37 -20
- package/lib/index.js.map +1 -1
- package/package.json +17 -17
- package/src/components/ConfigureApi.styled.tsx +1 -2
- package/src/components/ConfigureApi.tsx +1 -0
- package/src/components/FileInputButton.tsx +1 -1
- package/src/components/FileInputMenuItem.styled.tsx +1 -1
- package/src/components/IconInfo.tsx +0 -1
- package/src/components/ImportVideosFromMux.tsx +2 -1
- package/src/components/Input.styled.tsx +0 -1
- package/src/components/InputBrowser.tsx +1 -1
- package/src/components/InputError.tsx +1 -1
- package/src/components/Player.styled.tsx +1 -1
- package/src/components/PlayerActionsMenu.tsx +3 -1
- package/src/components/SpinnerBox.tsx +0 -1
- package/src/components/StudioTool.tsx +2 -3
- package/src/components/UploadConfiguration.tsx +1 -0
- package/src/components/UploadPlaceholder.tsx +1 -1
- package/src/components/UploadProgress.tsx +1 -2
- package/src/components/Uploader.styled.tsx +1 -1
- package/src/components/VideoDetails/DeleteDialog.tsx +1 -0
- package/src/components/VideoDetails/VideoDetails.tsx +2 -0
- package/src/components/VideoDetails/VideoReferences.tsx +2 -3
- package/src/components/VideoInBrowser.tsx +2 -1
- package/src/components/VideoMetadata.tsx +1 -2
- package/src/components/VideoThumbnail.tsx +1 -1
- package/src/components/VideosBrowser.tsx +4 -4
- package/src/components/documentPreview/DraftStatus.tsx +1 -1
- package/src/components/documentPreview/MissingSchemaType.tsx +0 -1
- package/src/components/documentPreview/PaneItemPreview.tsx +5 -5
- package/src/components/documentPreview/PublishedStatus.tsx +1 -1
- package/src/components/documentPreview/TimeAgo.tsx +0 -1
- package/src/components/icons/Resolution.tsx +1 -1
- package/src/components/icons/StopWatch.tsx +1 -1
- package/src/components/icons/ToolIcon.tsx +0 -2
- package/src/components/withFocusRing/withFocusRing.ts +2 -2
- package/src/hooks/useImportMuxAssets.ts +2 -1
package/lib/index.js
CHANGED
|
@@ -3,8 +3,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import { ErrorOutlineIcon, RetrieveIcon, RetryIcon, CheckmarkCircleIcon, SortIcon, WarningOutlineIcon, EditIcon, PublishIcon, DocumentIcon, TrashIcon, CheckmarkIcon, RevertIcon, SearchIcon, ClockIcon, CropIcon, CalendarIcon, TagIcon, LockIcon, PlayIcon, PlugIcon, UploadIcon, ResetIcon, EllipsisHorizontalIcon, AddIcon, TranslateIcon, DocumentVideoIcon } from "@sanity/icons";
|
|
4
4
|
import { Card, Box, Spinner, Stack, Text, Checkbox, Button, Dialog, Flex, Heading, Code, MenuButton, Menu, MenuItem, Tooltip, Inline, useToast, TabList, Tab, TabPanel, TextInput, Label as Label$1, Grid, useClickOutside, Popover, MenuDivider, Radio, Autocomplete, rem } from "@sanity/ui";
|
|
5
5
|
import React, { useState, useMemo, useEffect, useRef, useId, memo, isValidElement, useCallback, useReducer, createElement, forwardRef, Suspense } from "react";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import compact from "lodash/compact.js";
|
|
7
|
+
import toLower from "lodash/toLower.js";
|
|
8
|
+
import trim from "lodash/trim.js";
|
|
9
|
+
import uniq from "lodash/uniq.js";
|
|
10
|
+
import words from "lodash/words.js";
|
|
11
|
+
import { styled, css } from "styled-components";
|
|
8
12
|
import { uuid } from "@sanity/uuid";
|
|
9
13
|
import { defer, timer, of, Observable, concat, throwError, from, Subject } from "rxjs";
|
|
10
14
|
import { expand, concatMap, tap, switchMap, mergeMap, catchError, mergeMapTo, takeUntil } from "rxjs/operators";
|
|
@@ -12,6 +16,8 @@ import { suspend, clear, preload } from "suspend-react";
|
|
|
12
16
|
import MuxPlayer from "@mux/mux-player-react";
|
|
13
17
|
import { usePaneRouter } from "sanity/desk";
|
|
14
18
|
import { IntentLink } from "sanity/router";
|
|
19
|
+
import isNumber from "lodash/isNumber.js";
|
|
20
|
+
import isString from "lodash/isString.js";
|
|
15
21
|
import { useMemoObservable } from "react-rx";
|
|
16
22
|
import useSWR from "swr";
|
|
17
23
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
@@ -534,6 +540,7 @@ function ImportVideosDialog(props) {
|
|
|
534
540
|
return /* @__PURE__ */ jsx(
|
|
535
541
|
Dialog,
|
|
536
542
|
{
|
|
543
|
+
animate: !0,
|
|
537
544
|
header: "Import videos from Mux",
|
|
538
545
|
zOffset: DIALOGS_Z_INDEX,
|
|
539
546
|
id: "video-details-dialog",
|
|
@@ -762,7 +769,7 @@ function getVideoSrc({ asset, client }) {
|
|
|
762
769
|
}
|
|
763
770
|
return `https://stream.mux.com/${playbackId}.m3u8?${searchParams}`;
|
|
764
771
|
}
|
|
765
|
-
var name = "sanity-plugin-mux-input", version = "2.3.
|
|
772
|
+
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 = [
|
|
766
773
|
"sanity",
|
|
767
774
|
"video",
|
|
768
775
|
"mux",
|
|
@@ -801,11 +808,11 @@ var name = "sanity-plugin-mux-input", version = "2.3.0", description = "An input
|
|
|
801
808
|
"type-check": "tsc --noEmit",
|
|
802
809
|
watch: "pkg-utils watch --strict"
|
|
803
810
|
}, dependencies = {
|
|
804
|
-
"@mux/mux-player-react": "^2.
|
|
811
|
+
"@mux/mux-player-react": "^2.4.1",
|
|
805
812
|
"@mux/upchunk": "^3.3.2",
|
|
806
|
-
"@sanity/icons": "^2.
|
|
813
|
+
"@sanity/icons": "^2.11.7",
|
|
807
814
|
"@sanity/incompatible-plugin": "^1.0.4",
|
|
808
|
-
"@sanity/ui": "^2.0
|
|
815
|
+
"@sanity/ui": "^2.1.0",
|
|
809
816
|
"@sanity/uuid": "^3.0.2",
|
|
810
817
|
"iso-639-1": "^3.1.2",
|
|
811
818
|
"jsonwebtoken-esm": "^1.0.5",
|
|
@@ -818,20 +825,20 @@ var name = "sanity-plugin-mux-input", version = "2.3.0", description = "An input
|
|
|
818
825
|
"type-fest": "^4.10.2",
|
|
819
826
|
"use-error-boundary": "^2.0.6"
|
|
820
827
|
}, devDependencies = {
|
|
821
|
-
"@commitlint/cli": "^
|
|
822
|
-
"@commitlint/config-conventional": "^
|
|
823
|
-
"@sanity/client": "^6.
|
|
824
|
-
"@sanity/pkg-utils": "^
|
|
828
|
+
"@commitlint/cli": "^19.2.1",
|
|
829
|
+
"@commitlint/config-conventional": "^19.1.0",
|
|
830
|
+
"@sanity/client": "^6.15.11",
|
|
831
|
+
"@sanity/pkg-utils": "^6.0.1",
|
|
825
832
|
"@sanity/plugin-kit": "^3.1.10",
|
|
826
833
|
"@sanity/semantic-release-preset": "^4.1.7",
|
|
827
|
-
"@sanity/vision": "^3.
|
|
828
|
-
"@types/lodash": "^4.
|
|
829
|
-
"@types/react": "^18.2.
|
|
834
|
+
"@sanity/vision": "^3.36.4",
|
|
835
|
+
"@types/lodash": "^4.17.0",
|
|
836
|
+
"@types/react": "^18.2.74",
|
|
830
837
|
"@types/react-is": "^18.2.4",
|
|
831
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
832
|
-
"@typescript-eslint/parser": "^7.
|
|
838
|
+
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
839
|
+
"@typescript-eslint/parser": "^7.6.0",
|
|
833
840
|
"cz-conventional-changelog": "^3.3.0",
|
|
834
|
-
eslint: "^8.
|
|
841
|
+
eslint: "^8.57.0",
|
|
835
842
|
"eslint-config-prettier": "^9.1.0",
|
|
836
843
|
"eslint-config-sanity": "^7.1.2",
|
|
837
844
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -840,14 +847,14 @@ var name = "sanity-plugin-mux-input", version = "2.3.0", description = "An input
|
|
|
840
847
|
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
841
848
|
husky: "^9.0.11",
|
|
842
849
|
"lint-staged": "^15.2.2",
|
|
843
|
-
"npm-run-
|
|
850
|
+
"npm-run-all2": "^5.0.0",
|
|
844
851
|
prettier: "^3.2.5",
|
|
845
|
-
"prettier-plugin-packagejson": "^2.4.
|
|
852
|
+
"prettier-plugin-packagejson": "^2.4.14",
|
|
846
853
|
react: "^18.2.0",
|
|
847
854
|
"react-dom": "^18.2.0",
|
|
848
855
|
"react-is": "^18.2.0",
|
|
849
856
|
rimraf: "^5.0.5",
|
|
850
|
-
sanity: "^3.
|
|
857
|
+
sanity: "^3.36.4",
|
|
851
858
|
"semantic-release": "^23.0.7",
|
|
852
859
|
"styled-components": "^6.1.8",
|
|
853
860
|
typescript: "5.4.2",
|
|
@@ -1015,6 +1022,7 @@ function DraftStatus(props) {
|
|
|
1015
1022
|
return /* @__PURE__ */ jsx(
|
|
1016
1023
|
Tooltip,
|
|
1017
1024
|
{
|
|
1025
|
+
animate: !0,
|
|
1018
1026
|
portal: !0,
|
|
1019
1027
|
content: /* @__PURE__ */ jsx(Box, { padding: 2, children: /* @__PURE__ */ jsx(Text, { size: 1, children: document2 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1020
1028
|
"Edited ",
|
|
@@ -1029,6 +1037,7 @@ function PublishedStatus(props) {
|
|
|
1029
1037
|
return /* @__PURE__ */ jsx(
|
|
1030
1038
|
Tooltip,
|
|
1031
1039
|
{
|
|
1040
|
+
animate: !0,
|
|
1032
1041
|
portal: !0,
|
|
1033
1042
|
content: /* @__PURE__ */ jsx(Box, { padding: 2, children: /* @__PURE__ */ jsx(Text, { size: 1, children: document2 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1034
1043
|
"Published ",
|
|
@@ -1168,6 +1177,7 @@ function DeleteDialog({
|
|
|
1168
1177
|
return /* @__PURE__ */ jsx(
|
|
1169
1178
|
Dialog,
|
|
1170
1179
|
{
|
|
1180
|
+
animate: !0,
|
|
1171
1181
|
header: "Delete video",
|
|
1172
1182
|
zOffset: DIALOGS_Z_INDEX,
|
|
1173
1183
|
id: "deleting-video-details-dialog",
|
|
@@ -1363,6 +1373,7 @@ const AssetInput = (props) => /* @__PURE__ */ jsx(FormField$1, { title: props.la
|
|
|
1363
1373
|
}, []), /* @__PURE__ */ jsxs(
|
|
1364
1374
|
Dialog,
|
|
1365
1375
|
{
|
|
1376
|
+
animate: !0,
|
|
1366
1377
|
header: displayInfo.title,
|
|
1367
1378
|
zOffset: DIALOGS_Z_INDEX,
|
|
1368
1379
|
id: "video-details-dialog",
|
|
@@ -1416,6 +1427,7 @@ const AssetInput = (props) => /* @__PURE__ */ jsx(FormField$1, { title: props.la
|
|
|
1416
1427
|
state === "closing" && /* @__PURE__ */ jsx(
|
|
1417
1428
|
Dialog,
|
|
1418
1429
|
{
|
|
1430
|
+
animate: !0,
|
|
1419
1431
|
header: "You have unsaved changes",
|
|
1420
1432
|
zOffset: DIALOGS_Z_INDEX,
|
|
1421
1433
|
id: "closing-video-details-dialog",
|
|
@@ -1708,6 +1720,7 @@ function VideoInBrowser({
|
|
|
1708
1720
|
playbackPolicy === "signed" && /* @__PURE__ */ jsx(
|
|
1709
1721
|
Tooltip,
|
|
1710
1722
|
{
|
|
1723
|
+
animate: !0,
|
|
1711
1724
|
content: /* @__PURE__ */ jsx(Card, { padding: 2, radius: 2, children: /* @__PURE__ */ jsx(IconInfo, { icon: LockIcon, text: "Signed playback policy", size: 2 }) }),
|
|
1712
1725
|
placement: "right",
|
|
1713
1726
|
fallbackPlacements: ["top", "bottom"],
|
|
@@ -1791,7 +1804,7 @@ function VideoInBrowser({
|
|
|
1791
1804
|
);
|
|
1792
1805
|
}
|
|
1793
1806
|
function VideosBrowser({ onSelect }) {
|
|
1794
|
-
const { assets, isLoading, searchQuery, setSearchQuery, setSort, sort } = useAssets(), [editedAsset, setEditedAsset] =
|
|
1807
|
+
const { assets, isLoading, searchQuery, setSearchQuery, setSort, sort } = useAssets(), [editedAsset, setEditedAsset] = useState(null), freshEditedAsset = useMemo(
|
|
1795
1808
|
() => assets.find((a) => a._id === (editedAsset == null ? void 0 : editedAsset._id)) || editedAsset,
|
|
1796
1809
|
[editedAsset, assets]
|
|
1797
1810
|
), placement = onSelect ? "input" : "tool";
|
|
@@ -2673,6 +2686,7 @@ function ConfigureApi({ secrets, setDialogState }) {
|
|
|
2673
2686
|
}, [firstField]), /* @__PURE__ */ jsx(
|
|
2674
2687
|
Dialog,
|
|
2675
2688
|
{
|
|
2689
|
+
animate: !0,
|
|
2676
2690
|
id,
|
|
2677
2691
|
onClose: handleClose,
|
|
2678
2692
|
header: /* @__PURE__ */ jsx(Header, {}),
|
|
@@ -3349,6 +3363,7 @@ function PlayerActionsMenu(props) {
|
|
|
3349
3363
|
isSigned && /* @__PURE__ */ jsx(
|
|
3350
3364
|
Tooltip,
|
|
3351
3365
|
{
|
|
3366
|
+
animate: !0,
|
|
3352
3367
|
content: /* @__PURE__ */ jsx(Box, { padding: 2, children: /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: "Signed playback policy" }) }),
|
|
3353
3368
|
placement: "right",
|
|
3354
3369
|
portal: !0,
|
|
@@ -3358,6 +3373,7 @@ function PlayerActionsMenu(props) {
|
|
|
3358
3373
|
/* @__PURE__ */ jsx(
|
|
3359
3374
|
Popover,
|
|
3360
3375
|
{
|
|
3376
|
+
animate: !0,
|
|
3361
3377
|
content: /* @__PURE__ */ jsxs(Menu, { ref: setMenuRef, children: [
|
|
3362
3378
|
/* @__PURE__ */ jsx(Box, { padding: 2, children: /* @__PURE__ */ jsx(Label$1, { muted: !0, size: 1, children: "Replace" }) }),
|
|
3363
3379
|
/* @__PURE__ */ jsx(
|
|
@@ -3676,6 +3692,7 @@ function UploadConfiguration({
|
|
|
3676
3692
|
return /* @__PURE__ */ jsx(
|
|
3677
3693
|
Dialog,
|
|
3678
3694
|
{
|
|
3695
|
+
animate: !0,
|
|
3679
3696
|
open: !0,
|
|
3680
3697
|
id: "upload-configuration",
|
|
3681
3698
|
zOffset: 1e3,
|