@fluid-app/portal-sdk 0.1.192 → 0.1.193
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/{PortalContentApiProvider-Bwi7FOTs.mjs → PortalContentApiProvider-Bxtd3cTD.mjs} +242 -96
- package/dist/PortalContentApiProvider-Bxtd3cTD.mjs.map +1 -0
- package/dist/{PortalContentApiProvider-Cb-DGxBo.cjs → PortalContentApiProvider-D_0DbqrK.cjs} +242 -96
- package/dist/PortalContentApiProvider-D_0DbqrK.cjs.map +1 -0
- package/dist/{ProductsScreen-CdbwRM5O.mjs → ProductsScreen-CIZEyhz1.mjs} +2 -2
- package/dist/{ProductsScreen-Cd8hpH-3.mjs → ProductsScreen-COiPDOoi.mjs} +2 -2
- package/dist/{ProductsScreen-Cd8hpH-3.mjs.map → ProductsScreen-COiPDOoi.mjs.map} +1 -1
- package/dist/{ProductsScreen-BQqP8-N9.cjs → ProductsScreen-DjvCNiay.cjs} +2 -2
- package/dist/{ProductsScreen-BQqP8-N9.cjs.map → ProductsScreen-DjvCNiay.cjs.map} +1 -1
- package/dist/{ProductsScreen-DgPjO-HY.cjs → ProductsScreen-DliPMmcL.cjs} +2 -2
- package/dist/{ShareablesScreen-DoJ8EIDG.mjs → ShareablesScreen-B2VncQCU.mjs} +2 -2
- package/dist/{ShareablesScreen-C1PQmDVa.cjs → ShareablesScreen-BWIRh8uv.cjs} +2 -2
- package/dist/{ShareablesScreen-C1PQmDVa.cjs.map → ShareablesScreen-BWIRh8uv.cjs.map} +1 -1
- package/dist/{ShareablesScreen-BUuuUpDS.mjs → ShareablesScreen-U2Zgf6wh.mjs} +2 -2
- package/dist/{ShareablesScreen-BUuuUpDS.mjs.map → ShareablesScreen-U2Zgf6wh.mjs.map} +1 -1
- package/dist/{ShareablesScreen-BEm7wQaI.cjs → ShareablesScreen-nK7fJqjp.cjs} +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +19 -19
- package/dist/PortalContentApiProvider-Bwi7FOTs.mjs.map +0 -1
- package/dist/PortalContentApiProvider-Cb-DGxBo.cjs.map +0 -1
package/dist/{PortalContentApiProvider-Bwi7FOTs.mjs → PortalContentApiProvider-Bxtd3cTD.mjs}
RENAMED
|
@@ -6710,6 +6710,63 @@ const FilePicker = ({ config: configInput = {}, onFilesSelected, onClose, open,
|
|
|
6710
6710
|
})] });
|
|
6711
6711
|
};
|
|
6712
6712
|
//#endregion
|
|
6713
|
+
//#region ../../shareables/ui/src/hooks/use-thumbnail-meta.ts
|
|
6714
|
+
function useThumbnailMeta(src) {
|
|
6715
|
+
const [meta, setMeta] = useState(null);
|
|
6716
|
+
const [loadError, setLoadError] = useState(false);
|
|
6717
|
+
const fileName = src?.split("/").pop()?.split("?")[0] ?? "thumbnail";
|
|
6718
|
+
const handleLoad = useCallback((e) => {
|
|
6719
|
+
setLoadError(false);
|
|
6720
|
+
const img = e.currentTarget;
|
|
6721
|
+
setMeta((prev) => ({
|
|
6722
|
+
width: img.naturalWidth,
|
|
6723
|
+
height: img.naturalHeight,
|
|
6724
|
+
size: prev?.size ?? null
|
|
6725
|
+
}));
|
|
6726
|
+
}, []);
|
|
6727
|
+
const handleError = useCallback(() => {
|
|
6728
|
+
setLoadError(true);
|
|
6729
|
+
}, []);
|
|
6730
|
+
useEffect(() => {
|
|
6731
|
+
if (!src) {
|
|
6732
|
+
setMeta(null);
|
|
6733
|
+
return;
|
|
6734
|
+
}
|
|
6735
|
+
setMeta(null);
|
|
6736
|
+
const controller = new AbortController();
|
|
6737
|
+
fetch(src, {
|
|
6738
|
+
method: "HEAD",
|
|
6739
|
+
signal: controller.signal
|
|
6740
|
+
}).then((res) => {
|
|
6741
|
+
if (!res.ok) return;
|
|
6742
|
+
const len = res.headers.get("content-length");
|
|
6743
|
+
if (len) {
|
|
6744
|
+
const kb = Number(len) / 1024;
|
|
6745
|
+
const sizeStr = kb >= 1024 ? `${(kb / 1024).toFixed(1)} MB` : `${kb.toFixed(1)} KB`;
|
|
6746
|
+
setMeta((prev) => ({
|
|
6747
|
+
width: prev?.width ?? 0,
|
|
6748
|
+
height: prev?.height ?? 0,
|
|
6749
|
+
size: sizeStr
|
|
6750
|
+
}));
|
|
6751
|
+
}
|
|
6752
|
+
}).catch((err) => {
|
|
6753
|
+
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
6754
|
+
console.warn("[useThumbnailMeta] HEAD failed:", err);
|
|
6755
|
+
});
|
|
6756
|
+
return () => controller.abort();
|
|
6757
|
+
}, [src]);
|
|
6758
|
+
useEffect(() => {
|
|
6759
|
+
setLoadError(false);
|
|
6760
|
+
}, [src]);
|
|
6761
|
+
return {
|
|
6762
|
+
meta,
|
|
6763
|
+
fileName,
|
|
6764
|
+
handleLoad,
|
|
6765
|
+
handleError,
|
|
6766
|
+
loadError
|
|
6767
|
+
};
|
|
6768
|
+
}
|
|
6769
|
+
//#endregion
|
|
6713
6770
|
//#region ../../shareables/ui/src/components/playlists/RichTextEditor.tsx
|
|
6714
6771
|
function RichTextEditor({ value, onChange, placeholder = "Start writing...", className, editorClassName }) {
|
|
6715
6772
|
const editor = useEditor({
|
|
@@ -7432,44 +7489,66 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
7432
7489
|
setFrameSelectorOpen(true);
|
|
7433
7490
|
}, []);
|
|
7434
7491
|
const isMetadataLoaded = duration > 0;
|
|
7492
|
+
const { meta: imgMeta, fileName: thumbFileName, handleLoad: handleImgLoad, handleError: handleImgError, loadError: imgLoadError } = useThumbnailMeta(thumbnailUrl);
|
|
7435
7493
|
return /* @__PURE__ */ jsxs("div", {
|
|
7436
7494
|
className: "space-y-3",
|
|
7437
7495
|
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
7438
7496
|
className: "text-foreground mb-1.5 block text-sm font-medium",
|
|
7439
7497
|
children: "Thumbnail"
|
|
7440
7498
|
}), thumbnailUrl ? /* @__PURE__ */ jsxs("div", {
|
|
7441
|
-
className: "flex items-
|
|
7442
|
-
children: [/* @__PURE__ */ jsx("
|
|
7499
|
+
className: "flex items-start gap-4",
|
|
7500
|
+
children: [imgLoadError ? /* @__PURE__ */ jsx("div", {
|
|
7501
|
+
className: "bg-muted flex h-28 w-48 shrink-0 items-center justify-center rounded-md border",
|
|
7502
|
+
children: /* @__PURE__ */ jsx(ImageIcon, { className: "text-muted-foreground h-8 w-8" })
|
|
7503
|
+
}) : /* @__PURE__ */ jsx("img", {
|
|
7443
7504
|
src: thumbnailUrl,
|
|
7444
7505
|
alt: "Video thumbnail",
|
|
7445
|
-
className: "
|
|
7506
|
+
className: "w-48 shrink-0 rounded-md border object-contain",
|
|
7507
|
+
onLoad: handleImgLoad,
|
|
7508
|
+
onError: handleImgError
|
|
7446
7509
|
}), /* @__PURE__ */ jsxs("div", {
|
|
7447
|
-
className: "min-w-0 flex-1",
|
|
7448
|
-
children: [
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
className: "
|
|
7464
|
-
children:
|
|
7465
|
-
})
|
|
7466
|
-
|
|
7510
|
+
className: "min-w-0 flex-1 pt-1",
|
|
7511
|
+
children: [
|
|
7512
|
+
/* @__PURE__ */ jsx("p", {
|
|
7513
|
+
className: "text-foreground truncate text-sm font-medium",
|
|
7514
|
+
children: thumbFileName
|
|
7515
|
+
}),
|
|
7516
|
+
imgMeta && imgMeta.width > 0 && /* @__PURE__ */ jsxs("p", {
|
|
7517
|
+
className: "text-muted-foreground text-xs",
|
|
7518
|
+
children: [
|
|
7519
|
+
imgMeta.width,
|
|
7520
|
+
" × ",
|
|
7521
|
+
imgMeta.height,
|
|
7522
|
+
"px"
|
|
7523
|
+
]
|
|
7524
|
+
}),
|
|
7525
|
+
imgMeta?.size && /* @__PURE__ */ jsx("p", {
|
|
7526
|
+
className: "text-muted-foreground text-xs",
|
|
7527
|
+
children: imgMeta.size
|
|
7528
|
+
}),
|
|
7529
|
+
!disabled && /* @__PURE__ */ jsxs("div", {
|
|
7530
|
+
className: "mt-2 flex flex-col items-start gap-2",
|
|
7531
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
7532
|
+
variant: "outline",
|
|
7533
|
+
size: "sm",
|
|
7534
|
+
onClick: handleOpenDialog,
|
|
7535
|
+
className: "gap-1.5",
|
|
7536
|
+
children: [/* @__PURE__ */ jsx(Camera, { className: "h-3.5 w-3.5" }), "Select from video frame"]
|
|
7537
|
+
}), onThumbnailSelected && /* @__PURE__ */ jsxs(Button, {
|
|
7538
|
+
variant: "outline",
|
|
7539
|
+
size: "sm",
|
|
7540
|
+
onClick: onThumbnailSelected,
|
|
7541
|
+
className: "gap-1.5",
|
|
7542
|
+
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), "Select New Image"]
|
|
7543
|
+
})]
|
|
7544
|
+
})
|
|
7545
|
+
]
|
|
7467
7546
|
})]
|
|
7468
7547
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
7469
|
-
className: "flex items-center gap-
|
|
7548
|
+
className: "flex items-center gap-4",
|
|
7470
7549
|
children: [/* @__PURE__ */ jsx("div", {
|
|
7471
|
-
className: "bg-muted flex h-
|
|
7472
|
-
children: /* @__PURE__ */ jsx(Camera, { className: "text-muted-foreground h-
|
|
7550
|
+
className: "bg-muted flex h-28 w-48 shrink-0 items-center justify-center rounded-md border",
|
|
7551
|
+
children: /* @__PURE__ */ jsx(Camera, { className: "text-muted-foreground h-8 w-8" })
|
|
7473
7552
|
}), /* @__PURE__ */ jsxs("div", {
|
|
7474
7553
|
className: "min-w-0 flex-1",
|
|
7475
7554
|
children: [/* @__PURE__ */ jsx("p", {
|
|
@@ -7591,52 +7670,77 @@ function buildEditState(mediaItem) {
|
|
|
7591
7670
|
blockCrawler: mediaItem.seo?.block_crawler ?? mediaItem.settings?.seo?.block_crawler ?? false
|
|
7592
7671
|
};
|
|
7593
7672
|
}
|
|
7673
|
+
function ThumbnailWithMeta({ src, onReplace }) {
|
|
7674
|
+
const { meta, fileName, handleLoad, handleError, loadError } = useThumbnailMeta(src);
|
|
7675
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
7676
|
+
className: "flex items-start gap-4",
|
|
7677
|
+
children: [loadError ? /* @__PURE__ */ jsx("div", {
|
|
7678
|
+
className: "bg-muted flex h-28 w-48 shrink-0 items-center justify-center rounded-md border",
|
|
7679
|
+
children: /* @__PURE__ */ jsx(ImageIcon, { className: "text-muted-foreground h-8 w-8" })
|
|
7680
|
+
}) : /* @__PURE__ */ jsx("img", {
|
|
7681
|
+
src,
|
|
7682
|
+
alt: "Thumbnail",
|
|
7683
|
+
className: "w-48 shrink-0 rounded-md border object-contain",
|
|
7684
|
+
onLoad: handleLoad,
|
|
7685
|
+
onError: handleError
|
|
7686
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
7687
|
+
className: "min-w-0 flex-1 pt-1",
|
|
7688
|
+
children: [
|
|
7689
|
+
/* @__PURE__ */ jsx("p", {
|
|
7690
|
+
className: "text-foreground truncate text-sm font-medium",
|
|
7691
|
+
children: fileName
|
|
7692
|
+
}),
|
|
7693
|
+
meta && meta.width > 0 && /* @__PURE__ */ jsxs("p", {
|
|
7694
|
+
className: "text-muted-foreground text-xs",
|
|
7695
|
+
children: [
|
|
7696
|
+
meta.width,
|
|
7697
|
+
" × ",
|
|
7698
|
+
meta.height,
|
|
7699
|
+
"px"
|
|
7700
|
+
]
|
|
7701
|
+
}),
|
|
7702
|
+
meta?.size && /* @__PURE__ */ jsx("p", {
|
|
7703
|
+
className: "text-muted-foreground text-xs",
|
|
7704
|
+
children: meta.size
|
|
7705
|
+
}),
|
|
7706
|
+
/* @__PURE__ */ jsx("div", {
|
|
7707
|
+
className: "mt-2",
|
|
7708
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
7709
|
+
variant: "outline",
|
|
7710
|
+
size: "sm",
|
|
7711
|
+
onClick: onReplace,
|
|
7712
|
+
className: "gap-1.5",
|
|
7713
|
+
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), "Select New Image"]
|
|
7714
|
+
})
|
|
7715
|
+
})
|
|
7716
|
+
]
|
|
7717
|
+
})]
|
|
7718
|
+
});
|
|
7719
|
+
}
|
|
7594
7720
|
function CurrentMediaPreview({ mediaItem, pendingFileUrl, pendingKind }) {
|
|
7595
7721
|
const effectiveKind = pendingKind ?? mediaItem.content_format ?? mediaItem.kind;
|
|
7596
7722
|
const effectiveVideoUrl = pendingKind === "video" ? pendingFileUrl : mediaItem.video_url;
|
|
7597
7723
|
const effectiveImageUrl = pendingKind === "image" ? pendingFileUrl : pendingKind ? null : mediaItem.image_url;
|
|
7598
7724
|
const effectivePdfUrl = pendingKind === "pdf" ? pendingFileUrl : mediaItem.pdf_url;
|
|
7599
|
-
if (effectiveKind === "video" && effectiveVideoUrl) return /* @__PURE__ */
|
|
7600
|
-
className: "
|
|
7601
|
-
children:
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
className: "absolute inset-0 h-full w-full object-contain"
|
|
7609
|
-
})
|
|
7610
|
-
}), effectiveImageUrl && /* @__PURE__ */ jsxs("div", {
|
|
7611
|
-
className: "flex items-center gap-3",
|
|
7612
|
-
children: [/* @__PURE__ */ jsx("img", {
|
|
7613
|
-
src: effectiveImageUrl,
|
|
7614
|
-
alt: "Thumbnail",
|
|
7615
|
-
className: "h-16 w-16 shrink-0 rounded-md border object-cover"
|
|
7616
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
7617
|
-
className: "min-w-0 flex-1",
|
|
7618
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
7619
|
-
className: "text-foreground text-sm font-medium",
|
|
7620
|
-
children: "Thumbnail"
|
|
7621
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
7622
|
-
className: "text-muted-foreground text-xs",
|
|
7623
|
-
children: "Current video thumbnail"
|
|
7624
|
-
})]
|
|
7625
|
-
})]
|
|
7626
|
-
})]
|
|
7725
|
+
if (effectiveKind === "video" && effectiveVideoUrl) return /* @__PURE__ */ jsx("div", {
|
|
7726
|
+
className: "relative aspect-video w-full overflow-hidden rounded-lg border bg-black",
|
|
7727
|
+
children: /* @__PURE__ */ jsx("video", {
|
|
7728
|
+
src: effectiveVideoUrl,
|
|
7729
|
+
poster: effectiveImageUrl ?? void 0,
|
|
7730
|
+
controls: true,
|
|
7731
|
+
preload: "metadata",
|
|
7732
|
+
className: "absolute inset-0 h-full w-full object-contain"
|
|
7733
|
+
})
|
|
7627
7734
|
});
|
|
7628
|
-
if (effectiveKind === "pdf" && effectivePdfUrl) return /* @__PURE__ */
|
|
7629
|
-
className: "
|
|
7630
|
-
children:
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
children: "pdf"
|
|
7638
|
-
})]
|
|
7639
|
-
})]
|
|
7735
|
+
if (effectiveKind === "pdf" && effectivePdfUrl) return /* @__PURE__ */ jsx("div", {
|
|
7736
|
+
className: "relative w-full overflow-hidden rounded-lg border",
|
|
7737
|
+
children: /* @__PURE__ */ jsx("iframe", {
|
|
7738
|
+
src: `${effectivePdfUrl}#view=FitH`,
|
|
7739
|
+
sandbox: "allow-same-origin",
|
|
7740
|
+
className: "h-auto w-full",
|
|
7741
|
+
style: { minHeight: "50vh" },
|
|
7742
|
+
title: mediaItem.title ?? "PDF document"
|
|
7743
|
+
})
|
|
7640
7744
|
});
|
|
7641
7745
|
if (effectiveImageUrl) return /* @__PURE__ */ jsx("div", {
|
|
7642
7746
|
className: "relative aspect-video w-full overflow-hidden rounded-lg border",
|
|
@@ -7871,15 +7975,12 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
7871
7975
|
return /* @__PURE__ */ jsxs("div", {
|
|
7872
7976
|
className: "flex flex-col gap-4 px-4 pt-4 pb-24 md:px-10 md:py-6",
|
|
7873
7977
|
children: [
|
|
7874
|
-
/* @__PURE__ */
|
|
7875
|
-
className: "mx-auto flex w-full max-w-5xl
|
|
7876
|
-
children:
|
|
7877
|
-
className: "text-foreground
|
|
7978
|
+
/* @__PURE__ */ jsx("div", {
|
|
7979
|
+
className: "mx-auto flex w-full max-w-5xl items-center gap-3",
|
|
7980
|
+
children: /* @__PURE__ */ jsx("h1", {
|
|
7981
|
+
className: "text-foreground text-xl font-semibold break-words",
|
|
7878
7982
|
children: editState.title || displayTitle || "Media"
|
|
7879
|
-
})
|
|
7880
|
-
className: `inline-flex shrink-0 items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${editState.active ? "bg-green-100 text-green-800" : "bg-gray-100 text-gray-600"}`,
|
|
7881
|
-
children: editState.active ? "Active" : "Inactive"
|
|
7882
|
-
})]
|
|
7983
|
+
})
|
|
7883
7984
|
}),
|
|
7884
7985
|
/* @__PURE__ */ jsxs("div", {
|
|
7885
7986
|
className: "mx-auto grid w-full max-w-5xl grid-cols-1 gap-6 md:grid-cols-[3fr_1fr]",
|
|
@@ -7920,8 +8021,8 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
7920
8021
|
const rawContentFormat = mediaItem.content_format;
|
|
7921
8022
|
const effectiveKind = pendingKind ?? rawContentFormat ?? mediaItem.kind;
|
|
7922
8023
|
const effectiveVideoUrl = pendingKind === "video" ? pendingMediaFile?.file_url : mediaItem.video_url;
|
|
7923
|
-
if (
|
|
7924
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
8024
|
+
if (readOnly) return null;
|
|
8025
|
+
if (effectiveKind === "video" && effectiveVideoUrl) return /* @__PURE__ */ jsxs("div", {
|
|
7925
8026
|
className: "border-border mt-4 border-t pt-4",
|
|
7926
8027
|
children: [/* @__PURE__ */ jsx(VideoThumbnailSelector, {
|
|
7927
8028
|
videoUrl: effectiveVideoUrl,
|
|
@@ -7950,6 +8051,44 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
7950
8051
|
children: "Pending — save to apply"
|
|
7951
8052
|
})]
|
|
7952
8053
|
});
|
|
8054
|
+
if (effectiveKind === "pdf") {
|
|
8055
|
+
const currentThumbnail = pendingThumbnail ?? mediaItem.image_url;
|
|
8056
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8057
|
+
className: "border-border mt-4 border-t pt-4",
|
|
8058
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
8059
|
+
className: "space-y-3",
|
|
8060
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
8061
|
+
className: "text-foreground mb-1.5 block text-sm font-medium",
|
|
8062
|
+
children: "Thumbnail"
|
|
8063
|
+
}), currentThumbnail ? /* @__PURE__ */ jsx(ThumbnailWithMeta, {
|
|
8064
|
+
src: currentThumbnail,
|
|
8065
|
+
onReplace: () => setIsThumbnailPickerOpen(true)
|
|
8066
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
8067
|
+
className: "flex items-center gap-4",
|
|
8068
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
8069
|
+
className: "bg-muted flex h-28 w-48 shrink-0 items-center justify-center rounded-md border",
|
|
8070
|
+
children: /* @__PURE__ */ jsx(ImageIcon, { className: "text-muted-foreground h-8 w-8" })
|
|
8071
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
8072
|
+
className: "min-w-0 flex-1",
|
|
8073
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
8074
|
+
className: "text-muted-foreground mb-2 text-sm",
|
|
8075
|
+
children: "No thumbnail set"
|
|
8076
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
8077
|
+
variant: "outline",
|
|
8078
|
+
size: "sm",
|
|
8079
|
+
onClick: () => setIsThumbnailPickerOpen(true),
|
|
8080
|
+
className: "gap-1.5",
|
|
8081
|
+
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), "Select New Image"]
|
|
8082
|
+
})]
|
|
8083
|
+
})]
|
|
8084
|
+
})]
|
|
8085
|
+
}), pendingThumbnail && /* @__PURE__ */ jsx("p", {
|
|
8086
|
+
className: "text-muted-foreground mt-1.5 text-xs",
|
|
8087
|
+
children: "Pending — save to apply"
|
|
8088
|
+
})]
|
|
8089
|
+
});
|
|
8090
|
+
}
|
|
8091
|
+
return null;
|
|
7953
8092
|
})()
|
|
7954
8093
|
]
|
|
7955
8094
|
}),
|
|
@@ -8037,7 +8176,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8037
8176
|
className: "border-border bg-card rounded-lg border p-4 md:p-5",
|
|
8038
8177
|
children: [
|
|
8039
8178
|
/* @__PURE__ */ jsxs("div", {
|
|
8040
|
-
className: "mb-4 flex
|
|
8179
|
+
className: "mb-4 flex items-center justify-between",
|
|
8041
8180
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
8042
8181
|
className: "text-foreground text-base font-semibold",
|
|
8043
8182
|
children: "SEO And Link Sharing"
|
|
@@ -8224,14 +8363,24 @@ function deriveMediaType(mimeType) {
|
|
|
8224
8363
|
return "image";
|
|
8225
8364
|
}
|
|
8226
8365
|
function FilePreview({ result, mediaType }) {
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8366
|
+
const thumbnailSrc = mediaType === "image" ? result.file_url : result.thumbnail_url;
|
|
8367
|
+
if (thumbnailSrc) {
|
|
8368
|
+
const Icon = mediaType === "video" ? Video : mediaType === "pdf" ? FileText : null;
|
|
8369
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8370
|
+
className: "relative aspect-video w-full overflow-hidden rounded-lg border",
|
|
8371
|
+
children: [/* @__PURE__ */ jsx("img", {
|
|
8372
|
+
src: thumbnailSrc,
|
|
8373
|
+
alt: result.metadata.file_name,
|
|
8374
|
+
className: "absolute inset-0 h-full w-full object-cover"
|
|
8375
|
+
}), Icon && /* @__PURE__ */ jsxs("div", {
|
|
8376
|
+
className: "absolute bottom-2 left-2 flex items-center gap-1.5 rounded-md bg-black/60 px-2 py-1 text-white",
|
|
8377
|
+
children: [/* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ jsx("span", {
|
|
8378
|
+
className: "text-xs font-medium",
|
|
8379
|
+
children: mediaType === "video" ? "Video" : "PDF"
|
|
8380
|
+
})]
|
|
8381
|
+
})]
|
|
8382
|
+
});
|
|
8383
|
+
}
|
|
8235
8384
|
return /* @__PURE__ */ jsxs("div", {
|
|
8236
8385
|
className: "flex items-center gap-3 rounded-lg border p-4",
|
|
8237
8386
|
children: [/* @__PURE__ */ jsx(mediaType === "video" ? Video : FileText, { className: "text-muted-foreground h-8 w-8 shrink-0" }), /* @__PURE__ */ jsxs("div", {
|
|
@@ -8269,7 +8418,7 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
8269
8418
|
}) }), [onBack, navigate]));
|
|
8270
8419
|
const [title, setTitle] = useState("");
|
|
8271
8420
|
const [description, setDescription] = useState("");
|
|
8272
|
-
const [active
|
|
8421
|
+
const [active] = useState(true);
|
|
8273
8422
|
const [selectedResult, setSelectedResult] = useState(null);
|
|
8274
8423
|
const [isPickerOpen, setIsPickerOpen] = useState(false);
|
|
8275
8424
|
const [isCtaModalOpen, setIsCtaModalOpen] = useState(false);
|
|
@@ -8387,15 +8536,12 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
8387
8536
|
children: isCreating ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "Save"
|
|
8388
8537
|
})
|
|
8389
8538
|
}),
|
|
8390
|
-
/* @__PURE__ */
|
|
8539
|
+
/* @__PURE__ */ jsx("div", {
|
|
8391
8540
|
className: "mx-auto flex w-full max-w-5xl items-center gap-3",
|
|
8392
|
-
children:
|
|
8541
|
+
children: /* @__PURE__ */ jsx("h1", {
|
|
8393
8542
|
className: "text-foreground text-xl font-semibold",
|
|
8394
8543
|
children: title.trim() || "New Media"
|
|
8395
|
-
})
|
|
8396
|
-
className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${active ? "bg-green-100 text-green-800" : "bg-gray-100 text-gray-600"}`,
|
|
8397
|
-
children: active ? "Active" : "Inactive"
|
|
8398
|
-
})]
|
|
8544
|
+
})
|
|
8399
8545
|
}),
|
|
8400
8546
|
/* @__PURE__ */ jsxs("div", {
|
|
8401
8547
|
className: "mx-auto grid w-full max-w-5xl gap-6 md:grid-cols-[3fr_1fr]",
|
|
@@ -11081,7 +11227,7 @@ function createMediaAdapter(client) {
|
|
|
11081
11227
|
};
|
|
11082
11228
|
},
|
|
11083
11229
|
createMedia: async (mediaData) => {
|
|
11084
|
-
const contentFormat = mediaData.kind === "image" || mediaData.kind === "video" || mediaData.kind === "pdf" || mediaData.kind === "ppt"
|
|
11230
|
+
const contentFormat = mediaData.kind === "image" || mediaData.kind === "video" || mediaData.kind === "pdf" || mediaData.kind === "ppt" ? mediaData.kind : void 0;
|
|
11085
11231
|
return toBffMediumResponse((await portAdapter.createMedia({
|
|
11086
11232
|
title: mediaData.title ?? "",
|
|
11087
11233
|
description: mediaData.description,
|
|
@@ -11098,7 +11244,7 @@ function createMediaAdapter(client) {
|
|
|
11098
11244
|
if (mediaData.active !== void 0) updateBody.status = mediaData.active ? "active" : "draft";
|
|
11099
11245
|
const newUrl = mediaData.image_url ?? mediaData.video_url ?? mediaData.pdf_url ?? void 0;
|
|
11100
11246
|
if (newUrl !== void 0) updateBody.url = newUrl;
|
|
11101
|
-
if (mediaData.kind === "image" || mediaData.kind === "video" || mediaData.kind === "pdf" || mediaData.kind === "ppt"
|
|
11247
|
+
if (mediaData.kind === "image" || mediaData.kind === "video" || mediaData.kind === "pdf" || mediaData.kind === "ppt") updateBody.content_format = mediaData.kind;
|
|
11102
11248
|
if (mediaData.thumbnail_url !== void 0) updateBody.thumbnail_url = mediaData.thumbnail_url;
|
|
11103
11249
|
if (mediaData.settings?.cta) {
|
|
11104
11250
|
const rawType = mediaData.settings.cta.type;
|
|
@@ -11132,7 +11278,7 @@ function mapPlaylist(raw) {
|
|
|
11132
11278
|
title: raw.title ?? "",
|
|
11133
11279
|
description: raw.description ?? null,
|
|
11134
11280
|
items_count: raw.items_count ?? 0,
|
|
11135
|
-
user_id: raw.
|
|
11281
|
+
user_id: raw.member_id ?? void 0,
|
|
11136
11282
|
is_favorited: raw.is_favorited,
|
|
11137
11283
|
image_url: raw.image_url ?? null,
|
|
11138
11284
|
created_at: raw.created_at ?? "",
|
|
@@ -11659,4 +11805,4 @@ function PortalContentApiProvider({ children }) {
|
|
|
11659
11805
|
//#endregion
|
|
11660
11806
|
export { ShareablesApp as a, ShareablesCoreProvider as c, ProductsApp as i, usePortalContentContext as n, useFilePickerApi as o, toggleFavorite as r, ShareablesUIProvider as s, PortalContentApiProvider as t };
|
|
11661
11807
|
|
|
11662
|
-
//# sourceMappingURL=PortalContentApiProvider-
|
|
11808
|
+
//# sourceMappingURL=PortalContentApiProvider-Bxtd3cTD.mjs.map
|