sanity-plugin-r2-video 0.1.4 → 0.1.5

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.
@@ -210,22 +210,6 @@ var formatBitrate = (bytes, seconds) => {
210
210
  }
211
211
  return `${(bytes * 8 / seconds / 1e6).toFixed(2)} Mbps`;
212
212
  };
213
- var OVERLAY_STYLE = {
214
- alignItems: "center",
215
- background: "rgba(0, 0, 0, 0.75)",
216
- color: "#fff",
217
- display: "flex",
218
- height: "100%",
219
- justifyContent: "center",
220
- position: "absolute",
221
- right: 0,
222
- top: 0,
223
- width: "100%",
224
- zIndex: 3
225
- };
226
- var DragOverlay = () => {
227
- return /* @__PURE__ */ jsx(Flex, { style: OVERLAY_STYLE, children: /* @__PURE__ */ jsx(Text, { size: 3, style: { color: "inherit" }, children: "Drop files to upload" }) });
228
- };
229
213
  var hasVideoFile = (transfer) => {
230
214
  return Array.from(transfer.items).some((item) => {
231
215
  if (item.kind !== "file") {
@@ -801,7 +785,7 @@ var DialogUpload = ({
801
785
  const stage = (files) => {
802
786
  setItems((existing) => [...existing, ...files.map(toItem)]);
803
787
  };
804
- const { isDragging, dropProps } = useFileDrop({
788
+ const { isDragging, isRejected, dropProps } = useFileDrop({
805
789
  isEnabled: !isBusy && canEncode !== false,
806
790
  onDrop: stage
807
791
  });
@@ -878,7 +862,7 @@ var DialogUpload = ({
878
862
  tone: "transparent",
879
863
  ...dropProps,
880
864
  children: [
881
- isDragging && /* @__PURE__ */ jsx(DragOverlay, {}),
865
+ isDragging && /* @__PURE__ */ jsx(DropToUpload, { isRejected }),
882
866
  /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
883
867
  /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
884
868
  /* @__PURE__ */ jsx(Flex, { justify: "center", children: /* @__PURE__ */ jsx(Text, { muted: true, size: 3, children: /* @__PURE__ */ jsx(UploadIcon, {}) }) }),
@@ -1448,7 +1432,7 @@ var DialogDetails = ({
1448
1432
  return /* @__PURE__ */ jsx(
1449
1433
  Dialog,
1450
1434
  {
1451
- header: asset.filename,
1435
+ header: asset.filename || "Untitled video",
1452
1436
  id: "r2-video-details",
1453
1437
  width: 1,
1454
1438
  onClose: isSaving ? void 0 : onClose,
@@ -1724,7 +1708,10 @@ var FolderSidebar = ({
1724
1708
  var QUERY_ASSETS = `*[_type == "r2Video.asset"] | order(uploadedAt desc){
1725
1709
  _id,
1726
1710
  _type,
1727
- filename,
1711
+
1712
+ // Both are absent on a document the pipeline never finished, and every
1713
+ // consumer of this query treats them as present
1714
+ "filename": coalesce(filename, ""),
1728
1715
  folder,
1729
1716
  poster,
1730
1717
  duration,
@@ -1782,7 +1769,7 @@ var ToolVideoLibrary = () => {
1782
1769
  const paths = resolveFolderPaths(folders).filter((entry) => {
1783
1770
  return counts.has(entry.id);
1784
1771
  });
1785
- const { isDragging, dropProps } = useFileDrop({
1772
+ const { isDragging, isRejected, dropProps } = useFileDrop({
1786
1773
  isEnabled: !isUploadOpen,
1787
1774
  onDrop: (files) => {
1788
1775
  setDroppedFiles(files);
@@ -1884,7 +1871,7 @@ var ToolVideoLibrary = () => {
1884
1871
  asset._id
1885
1872
  )) })
1886
1873
  ] }) }) }),
1887
- isDragging && /* @__PURE__ */ jsx(DragOverlay, {}),
1874
+ isDragging && /* @__PURE__ */ jsx(DropToUpload, { isRejected }),
1888
1875
  isUploadOpen && /* @__PURE__ */ jsx(
1889
1876
  DialogUpload,
1890
1877
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-r2-video",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Video for Sanity Studio, encoded in the browser and stored in Cloudflare R2 as a ladder of plain MP4s.",
5
5
  "keywords": [
6
6
  "sanity",