sanity-plugin-r2-video 0.1.9 → 0.1.10
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/dist/studio/index.js +217 -59
- package/package.json +1 -1
package/dist/studio/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { defineType, defineField, definePlugin, set, useClient } from 'sanity';
|
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
import { PlayIcon } from '@sanity/icons/Play';
|
|
7
7
|
import { UploadIcon } from '@sanity/icons/Upload';
|
|
8
|
-
import { Stack, Flex,
|
|
8
|
+
import { Box, Stack, Flex, Button, TextInput, Card, Text, Select, Grid, Checkbox, Dialog, Spinner, Switch } from '@sanity/ui';
|
|
9
9
|
import { AccessDeniedIcon } from '@sanity/icons/AccessDenied';
|
|
10
10
|
import { canEncodeVideo } from 'mediabunny';
|
|
11
11
|
import { WarningOutlineIcon } from '@sanity/icons/WarningOutline';
|
|
@@ -14,6 +14,7 @@ import { ChevronRightIcon } from '@sanity/icons/ChevronRight';
|
|
|
14
14
|
import { SearchIcon } from '@sanity/icons/Search';
|
|
15
15
|
import { SyncIcon } from '@sanity/icons/Sync';
|
|
16
16
|
import { TrashIcon } from '@sanity/icons/Trash';
|
|
17
|
+
import styled from 'styled-components';
|
|
17
18
|
import { FolderIcon } from '@sanity/icons/Folder';
|
|
18
19
|
|
|
19
20
|
// studio/client.ts
|
|
@@ -1324,32 +1325,43 @@ var SCHEMA_R2_VIDEO = defineType({
|
|
|
1324
1325
|
}
|
|
1325
1326
|
}
|
|
1326
1327
|
});
|
|
1327
|
-
var DialogDelete = ({
|
|
1328
|
+
var DialogDelete = ({ assets, onDeleted, onClose }) => {
|
|
1328
1329
|
const { config, client } = useR2VideoClient();
|
|
1329
|
-
const [
|
|
1330
|
+
const [blocked, setBlocked] = useState(null);
|
|
1330
1331
|
const [isDeleting, setIsDeleting] = useState(false);
|
|
1331
1332
|
const [error, setError] = useState(null);
|
|
1332
1333
|
useEffect(() => {
|
|
1333
|
-
|
|
1334
|
-
|
|
1334
|
+
Promise.all(
|
|
1335
|
+
assets.map(async (asset) => ({
|
|
1336
|
+
asset,
|
|
1337
|
+
documents: await findReferencingDocuments(client, asset._id)
|
|
1338
|
+
}))
|
|
1339
|
+
).then((checked) => {
|
|
1340
|
+
setBlocked(checked.filter((entry) => entry.documents.length > 0));
|
|
1341
|
+
}).catch(() => {
|
|
1342
|
+
setError("Could not check which documents use these videos.");
|
|
1335
1343
|
});
|
|
1336
|
-
}, [client,
|
|
1344
|
+
}, [client, assets]);
|
|
1337
1345
|
const confirmed = async () => {
|
|
1338
1346
|
setIsDeleting(true);
|
|
1339
1347
|
setError(null);
|
|
1340
1348
|
try {
|
|
1341
|
-
|
|
1349
|
+
for (const asset of assets) {
|
|
1350
|
+
await deleteVideoAsset(client, config, asset);
|
|
1351
|
+
}
|
|
1342
1352
|
onDeleted();
|
|
1343
1353
|
} catch (caught) {
|
|
1344
1354
|
setError(toMessage(caught));
|
|
1345
1355
|
setIsDeleting(false);
|
|
1346
1356
|
}
|
|
1347
1357
|
};
|
|
1348
|
-
const isBlocked =
|
|
1358
|
+
const isBlocked = blocked !== null && blocked.length > 0;
|
|
1359
|
+
const renditions = assets.flatMap((asset) => asset.renditions);
|
|
1360
|
+
const isOne = assets.length === 1;
|
|
1349
1361
|
return /* @__PURE__ */ jsx(
|
|
1350
1362
|
Dialog,
|
|
1351
1363
|
{
|
|
1352
|
-
header: "Delete video"
|
|
1364
|
+
header: isOne ? "Delete video" : `Delete ${assets.length} videos`,
|
|
1353
1365
|
id: "r2-video-delete",
|
|
1354
1366
|
width: 1,
|
|
1355
1367
|
onClose: isDeleting ? void 0 : onClose,
|
|
@@ -1360,32 +1372,42 @@ var DialogDelete = ({ asset, onDeleted, onClose }) => {
|
|
|
1360
1372
|
confirm: {
|
|
1361
1373
|
text: isDeleting ? "Deleting\u2026" : "Delete",
|
|
1362
1374
|
tone: "critical",
|
|
1363
|
-
disabled: isDeleting || isBlocked ||
|
|
1375
|
+
disabled: isDeleting || isBlocked || blocked === null,
|
|
1364
1376
|
onClick: confirmed
|
|
1365
1377
|
}
|
|
1366
1378
|
}
|
|
1367
1379
|
),
|
|
1368
1380
|
children: /* @__PURE__ */ jsx(Card, { padding: 4, children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
|
|
1369
1381
|
/* @__PURE__ */ jsxs(Text, { size: 1, children: [
|
|
1370
|
-
|
|
1371
|
-
" -
|
|
1372
|
-
|
|
1373
|
-
|
|
1382
|
+
isOne ? assets[0].filename : pluralize(assets.length, "video"),
|
|
1383
|
+
" -",
|
|
1384
|
+
" ",
|
|
1385
|
+
pluralize(renditions.length, "rendition"),
|
|
1386
|
+
",",
|
|
1374
1387
|
" ",
|
|
1375
|
-
formatSize(totalSize(
|
|
1376
|
-
", plus
|
|
1388
|
+
formatSize(totalSize(renditions)),
|
|
1389
|
+
", plus",
|
|
1390
|
+
" ",
|
|
1391
|
+
isOne ? "its poster" : "their posters",
|
|
1392
|
+
"."
|
|
1377
1393
|
] }),
|
|
1378
|
-
|
|
1394
|
+
blocked === null && !error && /* @__PURE__ */ jsx(Loading, { children: "Checking where they're used\u2026" }),
|
|
1379
1395
|
isBlocked && /* @__PURE__ */ jsx(Notice, { title: "Still in use", tone: "caution", children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
"
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1396
|
+
/* @__PURE__ */ jsxs(Text, { muted: true, size: 1, children: [
|
|
1397
|
+
"Remove ",
|
|
1398
|
+
isOne ? "it" : "these",
|
|
1399
|
+
" from these documents first:"
|
|
1400
|
+
] }),
|
|
1401
|
+
blocked.map((entry) => /* @__PURE__ */ jsxs(Text, { muted: true, size: 1, children: [
|
|
1402
|
+
!isOne && `${entry.asset.filename}: `,
|
|
1403
|
+
entry.documents.map((document) => document.title || document._id).join(", ")
|
|
1404
|
+
] }, entry.asset._id))
|
|
1387
1405
|
] }) }),
|
|
1388
|
-
|
|
1406
|
+
blocked !== null && blocked.length === 0 && /* @__PURE__ */ jsxs(Text, { muted: true, size: 1, children: [
|
|
1407
|
+
"Nothing references ",
|
|
1408
|
+
isOne ? "it" : "them",
|
|
1409
|
+
". This can't be undone."
|
|
1410
|
+
] }),
|
|
1389
1411
|
error && /* @__PURE__ */ jsx(Notice, { tone: "critical", children: error })
|
|
1390
1412
|
] }) })
|
|
1391
1413
|
}
|
|
@@ -1404,6 +1426,7 @@ var DialogDetails = ({
|
|
|
1404
1426
|
);
|
|
1405
1427
|
const [filename, setFilename] = useState(asset.filename);
|
|
1406
1428
|
const [isSaving, setIsSaving] = useState(false);
|
|
1429
|
+
const [isFlagged, setIsFlagged] = useState(false);
|
|
1407
1430
|
const [error, setError] = useState(null);
|
|
1408
1431
|
const isBroken = asset.renditions.length === 0;
|
|
1409
1432
|
const trimmed = filename.trim();
|
|
@@ -1414,6 +1437,17 @@ var DialogDetails = ({
|
|
|
1414
1437
|
const reset = () => {
|
|
1415
1438
|
setFilename(asset.filename);
|
|
1416
1439
|
setFolderId(savedFolderId);
|
|
1440
|
+
setIsFlagged(false);
|
|
1441
|
+
};
|
|
1442
|
+
const attemptClose = () => {
|
|
1443
|
+
if (isSaving) {
|
|
1444
|
+
return;
|
|
1445
|
+
}
|
|
1446
|
+
if (isDirty) {
|
|
1447
|
+
setIsFlagged(true);
|
|
1448
|
+
return;
|
|
1449
|
+
}
|
|
1450
|
+
onClose();
|
|
1417
1451
|
};
|
|
1418
1452
|
const save = async () => {
|
|
1419
1453
|
if (!isDirty) {
|
|
@@ -1442,6 +1476,7 @@ var DialogDetails = ({
|
|
|
1442
1476
|
mutation = mutation.unset(removals);
|
|
1443
1477
|
}
|
|
1444
1478
|
await mutation.commit();
|
|
1479
|
+
setIsFlagged(false);
|
|
1445
1480
|
onChanged();
|
|
1446
1481
|
} catch (caught) {
|
|
1447
1482
|
reset();
|
|
@@ -1455,7 +1490,8 @@ var DialogDetails = ({
|
|
|
1455
1490
|
header: asset.filename || "Untitled video",
|
|
1456
1491
|
id: "r2-video-details",
|
|
1457
1492
|
width: 1,
|
|
1458
|
-
|
|
1493
|
+
onClickOutside: attemptClose,
|
|
1494
|
+
onClose: isSaving ? void 0 : attemptClose,
|
|
1459
1495
|
footer: /* @__PURE__ */ jsx(
|
|
1460
1496
|
DialogActions,
|
|
1461
1497
|
{
|
|
@@ -1520,6 +1556,7 @@ var DialogDetails = ({
|
|
|
1520
1556
|
}
|
|
1521
1557
|
) }) })
|
|
1522
1558
|
] }),
|
|
1559
|
+
isFlagged && /* @__PURE__ */ jsx(Notice, { tone: "caution", children: "Unsaved changes. Save them, or discard to close." }),
|
|
1523
1560
|
error && /* @__PURE__ */ jsx(Notice, { tone: "critical", children: error }),
|
|
1524
1561
|
/* @__PURE__ */ jsx(
|
|
1525
1562
|
VideoSummary,
|
|
@@ -1716,6 +1753,7 @@ var QUERY_ASSETS = `*[_type == "r2Video.asset"] | order(uploadedAt desc){
|
|
|
1716
1753
|
"hasAudio": coalesce(hasAudio, false),
|
|
1717
1754
|
"renditions": coalesce(renditions, []),
|
|
1718
1755
|
uploadedAt,
|
|
1756
|
+
"isUsed": count(*[references(^._id)]) > 0,
|
|
1719
1757
|
"posterUrl": poster.asset->url,
|
|
1720
1758
|
"folderName": folder->name
|
|
1721
1759
|
}`;
|
|
@@ -1737,8 +1775,22 @@ var matches = (asset, search) => {
|
|
|
1737
1775
|
const folderName = asset.folderName ?? "";
|
|
1738
1776
|
return asset.filename.toLowerCase().includes(term) || folderName.toLowerCase().includes(term);
|
|
1739
1777
|
};
|
|
1778
|
+
var SelectableCard = styled(Box)`
|
|
1779
|
+
position: relative;
|
|
1780
|
+
|
|
1781
|
+
& [data-checkbox] {
|
|
1782
|
+
opacity: 0;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
&:hover [data-checkbox],
|
|
1786
|
+
& [data-checkbox]:focus-within,
|
|
1787
|
+
& [data-checkbox][data-selected="true"] {
|
|
1788
|
+
opacity: 1;
|
|
1789
|
+
}
|
|
1790
|
+
`;
|
|
1740
1791
|
var ToolVideoLibrary = () => {
|
|
1741
1792
|
const { config, client } = useR2VideoClient();
|
|
1793
|
+
const { paths: allPaths } = useFolders();
|
|
1742
1794
|
const [assets, setAssets] = useState(null);
|
|
1743
1795
|
const [folders, setFolders] = useState([]);
|
|
1744
1796
|
const [search, setSearch] = useState("");
|
|
@@ -1748,6 +1800,9 @@ var ToolVideoLibrary = () => {
|
|
|
1748
1800
|
const [droppedFiles, setDroppedFiles] = useState([]);
|
|
1749
1801
|
const [detailing, setDetailing] = useState(null);
|
|
1750
1802
|
const [deleting, setDeleting] = useState(null);
|
|
1803
|
+
const [isUnusedOnly, setIsUnusedOnly] = useState(false);
|
|
1804
|
+
const [selectedIds, setSelectedIds] = useState([]);
|
|
1805
|
+
const [isMoving, setIsMoving] = useState(false);
|
|
1751
1806
|
const load = useCallback(() => {
|
|
1752
1807
|
client.fetch(QUERY_ASSETS).then(setAssets);
|
|
1753
1808
|
fetchFolders(client, config.folders.type).then(setFolders);
|
|
@@ -1777,8 +1832,29 @@ var ToolVideoLibrary = () => {
|
|
|
1777
1832
|
};
|
|
1778
1833
|
const visible = (assets ?? []).filter((asset) => {
|
|
1779
1834
|
const inFolder = !folderId || asset.folder && asset.folder._ref === folderId;
|
|
1780
|
-
|
|
1835
|
+
const isShown = !isUnusedOnly || !asset.isUsed;
|
|
1836
|
+
return matches(asset, search) && inFolder && isShown;
|
|
1781
1837
|
});
|
|
1838
|
+
const selected = visible.filter((asset) => selectedIds.includes(asset._id));
|
|
1839
|
+
const toggleSelected = (id) => {
|
|
1840
|
+
setSelectedIds((current) => {
|
|
1841
|
+
return current.includes(id) ? current.filter((entry) => entry !== id) : [...current, id];
|
|
1842
|
+
});
|
|
1843
|
+
};
|
|
1844
|
+
const moveSelected = async (targetId) => {
|
|
1845
|
+
setIsMoving(true);
|
|
1846
|
+
let transaction = client.transaction();
|
|
1847
|
+
for (const asset of selected) {
|
|
1848
|
+
transaction = targetId ? transaction.patch(
|
|
1849
|
+
asset._id,
|
|
1850
|
+
(patch) => patch.set({ folder: { _type: "reference", _ref: targetId } })
|
|
1851
|
+
) : transaction.patch(asset._id, (patch) => patch.unset(["folder"]));
|
|
1852
|
+
}
|
|
1853
|
+
await transaction.commit();
|
|
1854
|
+
setIsMoving(false);
|
|
1855
|
+
setSelectedIds([]);
|
|
1856
|
+
load();
|
|
1857
|
+
};
|
|
1782
1858
|
return /* @__PURE__ */ jsxs(
|
|
1783
1859
|
Flex,
|
|
1784
1860
|
{
|
|
@@ -1806,6 +1882,15 @@ var ToolVideoLibrary = () => {
|
|
|
1806
1882
|
onChange: (event) => setSearch(event.currentTarget.value)
|
|
1807
1883
|
}
|
|
1808
1884
|
) }),
|
|
1885
|
+
/* @__PURE__ */ jsx(
|
|
1886
|
+
Button,
|
|
1887
|
+
{
|
|
1888
|
+
mode: isUnusedOnly ? "default" : "ghost",
|
|
1889
|
+
text: "Unused",
|
|
1890
|
+
tone: isUnusedOnly ? "primary" : "default",
|
|
1891
|
+
onClick: () => setIsUnusedOnly(!isUnusedOnly)
|
|
1892
|
+
}
|
|
1893
|
+
),
|
|
1809
1894
|
/* @__PURE__ */ jsx(
|
|
1810
1895
|
Button,
|
|
1811
1896
|
{
|
|
@@ -1825,42 +1910,115 @@ var ToolVideoLibrary = () => {
|
|
|
1825
1910
|
}
|
|
1826
1911
|
)
|
|
1827
1912
|
] }),
|
|
1913
|
+
selected.length > 0 && /* @__PURE__ */ jsx(Card, { border: true, padding: 2, radius: 2, tone: "primary", children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 2, children: [
|
|
1914
|
+
/* @__PURE__ */ jsx(Box, { paddingX: 2, children: /* @__PURE__ */ jsxs(Text, { size: 1, weight: "medium", children: [
|
|
1915
|
+
pluralize(selected.length, "video"),
|
|
1916
|
+
" selected"
|
|
1917
|
+
] }) }),
|
|
1918
|
+
/* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxs(
|
|
1919
|
+
Select,
|
|
1920
|
+
{
|
|
1921
|
+
"aria-label": "Move to folder",
|
|
1922
|
+
disabled: isMoving,
|
|
1923
|
+
value: "",
|
|
1924
|
+
onChange: (event) => moveSelected(event.currentTarget.value),
|
|
1925
|
+
children: [
|
|
1926
|
+
/* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Move to\u2026" }),
|
|
1927
|
+
/* @__PURE__ */ jsx("option", { value: "", children: "No folder" }),
|
|
1928
|
+
allPaths.map((entry) => /* @__PURE__ */ jsx("option", { value: entry.id, children: entry.path }, entry.id))
|
|
1929
|
+
]
|
|
1930
|
+
}
|
|
1931
|
+
) }),
|
|
1932
|
+
/* @__PURE__ */ jsx(
|
|
1933
|
+
Button,
|
|
1934
|
+
{
|
|
1935
|
+
disabled: isMoving,
|
|
1936
|
+
mode: "ghost",
|
|
1937
|
+
text: "Clear",
|
|
1938
|
+
onClick: () => setSelectedIds([])
|
|
1939
|
+
}
|
|
1940
|
+
),
|
|
1941
|
+
/* @__PURE__ */ jsx(
|
|
1942
|
+
Button,
|
|
1943
|
+
{
|
|
1944
|
+
disabled: isMoving,
|
|
1945
|
+
icon: TrashIcon,
|
|
1946
|
+
mode: "ghost",
|
|
1947
|
+
text: "Delete",
|
|
1948
|
+
tone: "critical",
|
|
1949
|
+
onClick: () => setDeleting(selected)
|
|
1950
|
+
}
|
|
1951
|
+
)
|
|
1952
|
+
] }) }),
|
|
1828
1953
|
assets === null && /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Loading, { children: "Loading library\u2026" }) }),
|
|
1829
1954
|
assets !== null && visible.length === 0 && /* @__PURE__ */ jsx(Card, { padding: 5, radius: 2, tone: "transparent", children: /* @__PURE__ */ jsx(Text, { align: "center", muted: true, size: 1, children: "No videos here yet." }) }),
|
|
1830
|
-
/* @__PURE__ */ jsx(Grid, { gridTemplateColumns: [1, 2, 3, 4], gap: 3, children: visible.map((asset) => /* @__PURE__ */
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1955
|
+
/* @__PURE__ */ jsx(Grid, { gridTemplateColumns: [1, 2, 3, 4], gap: 3, children: visible.map((asset) => /* @__PURE__ */ jsxs(SelectableCard, { children: [
|
|
1956
|
+
/* @__PURE__ */ jsx(
|
|
1957
|
+
Box,
|
|
1958
|
+
{
|
|
1959
|
+
"data-checkbox": true,
|
|
1960
|
+
"data-selected": selectedIds.includes(asset._id),
|
|
1961
|
+
style: {
|
|
1962
|
+
position: "absolute",
|
|
1963
|
+
top: 14,
|
|
1964
|
+
left: 14,
|
|
1965
|
+
zIndex: 1
|
|
1966
|
+
},
|
|
1967
|
+
children: /* @__PURE__ */ jsx(
|
|
1968
|
+
Checkbox,
|
|
1842
1969
|
{
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1970
|
+
"aria-label": `Select ${asset.filename}`,
|
|
1971
|
+
checked: selectedIds.includes(asset._id),
|
|
1972
|
+
onChange: () => toggleSelected(asset._id)
|
|
1973
|
+
}
|
|
1974
|
+
)
|
|
1975
|
+
}
|
|
1976
|
+
),
|
|
1977
|
+
/* @__PURE__ */ jsx(
|
|
1978
|
+
Card,
|
|
1979
|
+
{
|
|
1980
|
+
as: "button",
|
|
1981
|
+
border: true,
|
|
1982
|
+
padding: 2,
|
|
1983
|
+
radius: 2,
|
|
1984
|
+
style: {
|
|
1985
|
+
cursor: "pointer",
|
|
1986
|
+
textAlign: "left",
|
|
1987
|
+
width: "100%"
|
|
1988
|
+
},
|
|
1989
|
+
onClick: (event) => {
|
|
1990
|
+
if (event.shiftKey) {
|
|
1991
|
+
toggleSelected(asset._id);
|
|
1992
|
+
return;
|
|
1850
1993
|
}
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1994
|
+
setDetailing(asset);
|
|
1995
|
+
},
|
|
1996
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
|
|
1997
|
+
/* @__PURE__ */ jsx(
|
|
1998
|
+
Box,
|
|
1999
|
+
{
|
|
2000
|
+
style: {
|
|
2001
|
+
aspectRatio: "16 / 9",
|
|
2002
|
+
backgroundImage: asset.posterUrl ? `url(${asset.posterUrl}?w=480&fit=crop&auto=format)` : void 0,
|
|
2003
|
+
backgroundPosition: "center",
|
|
2004
|
+
backgroundSize: "cover",
|
|
2005
|
+
borderRadius: 2
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
),
|
|
2009
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
|
|
2010
|
+
/* @__PURE__ */ jsx(Text, { size: 1, textOverflow: "ellipsis", weight: "medium", children: toTitle(asset, Boolean(folderId)) }),
|
|
2011
|
+
/* @__PURE__ */ jsxs(Text, { muted: true, size: 1, children: [
|
|
2012
|
+
asset.renditions.length,
|
|
2013
|
+
" sizes",
|
|
2014
|
+
asset.hasAudio ? " \xB7 audio" : "",
|
|
2015
|
+
asset.isUsed ? "" : " \xB7 unused"
|
|
2016
|
+
] })
|
|
1858
2017
|
] })
|
|
1859
2018
|
] })
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
)) })
|
|
2019
|
+
}
|
|
2020
|
+
)
|
|
2021
|
+
] }, asset._id)) })
|
|
1864
2022
|
] }) }) }),
|
|
1865
2023
|
isDragging && /* @__PURE__ */ jsx(DropToUpload, { isRejected }),
|
|
1866
2024
|
isUploadOpen && /* @__PURE__ */ jsx(
|
|
@@ -1885,7 +2043,7 @@ var ToolVideoLibrary = () => {
|
|
|
1885
2043
|
asset: detailing,
|
|
1886
2044
|
onChanged: load,
|
|
1887
2045
|
onDelete: () => {
|
|
1888
|
-
setDeleting(detailing);
|
|
2046
|
+
setDeleting([detailing]);
|
|
1889
2047
|
setDetailing(null);
|
|
1890
2048
|
},
|
|
1891
2049
|
onClose: () => setDetailing(null)
|
|
@@ -1894,7 +2052,7 @@ var ToolVideoLibrary = () => {
|
|
|
1894
2052
|
deleting && /* @__PURE__ */ jsx(
|
|
1895
2053
|
DialogDelete,
|
|
1896
2054
|
{
|
|
1897
|
-
|
|
2055
|
+
assets: deleting,
|
|
1898
2056
|
onClose: () => setDeleting(null),
|
|
1899
2057
|
onDeleted: () => {
|
|
1900
2058
|
setDeleting(null);
|