@fluid-app/portal-sdk 0.1.314 → 0.1.315
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/{MessagingScreen-BAWob9Xh.mjs → MessagingScreen-BgDi-Gar.mjs} +0 -1
- package/dist/{OrdersScreen-BvC2vAPI.mjs → OrdersScreen-CSddnx1C.mjs} +0 -2
- package/dist/{ProfileScreen-B4nb_OZG.mjs → ProfileScreen-0Uimme9y.mjs} +1 -2
- package/dist/{ProfileScreen-1eUj1pwW.mjs → ProfileScreen-BOyEWw2y.mjs} +5 -3
- package/dist/ProfileScreen-BOyEWw2y.mjs.map +1 -0
- package/dist/{ProfileScreen-CCpujV84.cjs → ProfileScreen-C-UWLnEr.cjs} +5 -3
- package/dist/ProfileScreen-C-UWLnEr.cjs.map +1 -0
- package/dist/{ProfileScreen-CQhgY8xm.cjs → ProfileScreen-D2Z8BQtq.cjs} +1 -1
- package/dist/{ShareablesScreen-QclWhq3D.cjs → ShareablesScreen-BeEEI0mD.cjs} +88 -5
- package/dist/ShareablesScreen-BeEEI0mD.cjs.map +1 -0
- package/dist/{ShareablesScreen-7umiVWD0.mjs → ShareablesScreen-CaYM4JHC.mjs} +1 -3
- package/dist/{ShareablesScreen-PL7O47Gv.cjs → ShareablesScreen-QAqtL2DB.cjs} +1 -1
- package/dist/{ShareablesScreen-yXCq_akC.mjs → ShareablesScreen-Qqr8uE9h.mjs} +89 -6
- package/dist/ShareablesScreen-Qqr8uE9h.mjs.map +1 -0
- package/dist/{ShopScreen-D_XPdJVC.mjs → ShopScreen-O0wjoQ-a.mjs} +0 -2
- package/dist/{SubscriptionsScreen-CaVTy07E.mjs → SubscriptionsScreen-BJoy1y6u.mjs} +0 -2
- package/dist/index.cjs +6 -6
- package/dist/index.mjs +14 -14
- package/package.json +15 -15
- package/dist/ProfileScreen-1eUj1pwW.mjs.map +0 -1
- package/dist/ProfileScreen-CCpujV84.cjs.map +0 -1
- package/dist/ShareablesScreen-QclWhq3D.cjs.map +0 -1
- package/dist/ShareablesScreen-yXCq_akC.mjs.map +0 -1
|
@@ -924,11 +924,27 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
|
|
|
924
924
|
}
|
|
925
925
|
//#endregion
|
|
926
926
|
//#region ../../shareables/ui/src/components/SharePage/SharePageImageDisplay.tsx
|
|
927
|
-
function
|
|
927
|
+
function buildPdfSrc(url, page = 1) {
|
|
928
|
+
try {
|
|
929
|
+
const parsed = new URL(url);
|
|
930
|
+
parsed.hash = `page=${page}&view=FitH`;
|
|
931
|
+
return parsed.toString();
|
|
932
|
+
} catch {
|
|
933
|
+
return `${url}#page=${page}&view=FitH`;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
function SharePageImageDisplay({ displayImage, displayTitle, displayVideo, displayPdf, isVideo, badgeLabel, rounded = true, showBadge = true }) {
|
|
928
937
|
const [isPreviewOpen, setIsPreviewOpen] = (0, react.useState)(false);
|
|
938
|
+
const [currentPage, setCurrentPage] = (0, react.useState)(1);
|
|
929
939
|
const renderImage = useRenderImage();
|
|
940
|
+
const handlePrevPage = () => {
|
|
941
|
+
setCurrentPage((prev) => prev > 1 ? prev - 1 : prev);
|
|
942
|
+
};
|
|
943
|
+
const handleNextPage = () => {
|
|
944
|
+
setCurrentPage((prev) => prev + 1);
|
|
945
|
+
};
|
|
930
946
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
931
|
-
className: `relative h-full w-full overflow-hidden bg-gray-100 ${rounded ? "rounded-2xl" : ""}`,
|
|
947
|
+
className: `relative flex h-full w-full flex-col overflow-hidden bg-gray-100 ${rounded ? "rounded-2xl" : ""}`,
|
|
932
948
|
children: [
|
|
933
949
|
isVideo ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("video", {
|
|
934
950
|
src: displayVideo || "",
|
|
@@ -937,7 +953,45 @@ function SharePageImageDisplay({ displayImage, displayTitle, displayVideo, isVid
|
|
|
937
953
|
muted: true,
|
|
938
954
|
loop: true,
|
|
939
955
|
controls: true
|
|
940
|
-
}) :
|
|
956
|
+
}) : displayPdf ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
957
|
+
src: buildPdfSrc(displayPdf, currentPage),
|
|
958
|
+
className: "min-h-0 w-full flex-1",
|
|
959
|
+
title: displayTitle || "PDF document"
|
|
960
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
961
|
+
className: "flex items-center justify-center gap-4 py-3",
|
|
962
|
+
children: [
|
|
963
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
|
|
964
|
+
onClick: handlePrevPage,
|
|
965
|
+
disabled: currentPage <= 1,
|
|
966
|
+
variant: "outline",
|
|
967
|
+
size: "sm",
|
|
968
|
+
className: "h-8 w-8 p-0",
|
|
969
|
+
"aria-label": "Previous page",
|
|
970
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeft, { className: "h-4 w-4" })
|
|
971
|
+
}),
|
|
972
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
973
|
+
className: "flex items-center gap-2",
|
|
974
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
975
|
+
type: "number",
|
|
976
|
+
min: "1",
|
|
977
|
+
value: currentPage,
|
|
978
|
+
onChange: (e) => {
|
|
979
|
+
const page = parseInt(e.target.value);
|
|
980
|
+
if (page > 0) setCurrentPage(page);
|
|
981
|
+
},
|
|
982
|
+
className: "border-input bg-background w-14 rounded-md border px-2 py-1 text-center text-sm focus:ring-1 focus:outline-none"
|
|
983
|
+
})
|
|
984
|
+
}),
|
|
985
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
|
|
986
|
+
onClick: handleNextPage,
|
|
987
|
+
variant: "outline",
|
|
988
|
+
size: "sm",
|
|
989
|
+
className: "h-8 w-8 p-0",
|
|
990
|
+
"aria-label": "Next page",
|
|
991
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "h-4 w-4" })
|
|
992
|
+
})
|
|
993
|
+
]
|
|
994
|
+
})] }) : renderImage({
|
|
941
995
|
src: displayImage,
|
|
942
996
|
alt: displayTitle,
|
|
943
997
|
fill: true,
|
|
@@ -948,7 +1002,7 @@ function SharePageImageDisplay({ displayImage, displayTitle, displayVideo, isVid
|
|
|
948
1002
|
className: "absolute top-3 right-3 z-0 bg-gray-100 text-gray-900 hover:bg-gray-100",
|
|
949
1003
|
children: badgeLabel
|
|
950
1004
|
}),
|
|
951
|
-
isVideo && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
|
|
1005
|
+
(isVideo || displayPdf) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
|
|
952
1006
|
onClick: () => setIsPreviewOpen(true),
|
|
953
1007
|
className: "absolute top-3 left-3 z-0 flex h-8 w-8 items-center justify-center rounded-full bg-white/90 text-gray-700 backdrop-blur-sm transition-colors hover:bg-white",
|
|
954
1008
|
variant: "ghost",
|
|
@@ -971,6 +1025,32 @@ function SharePageImageDisplay({ displayImage, displayTitle, displayVideo, isVid
|
|
|
971
1025
|
controls: true,
|
|
972
1026
|
onClick: (e) => e.stopPropagation()
|
|
973
1027
|
})]
|
|
1028
|
+
}),
|
|
1029
|
+
isPreviewOpen && displayPdf && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1030
|
+
className: "fixed inset-0 z-9999 flex items-center justify-center bg-black/70 backdrop-blur-sm",
|
|
1031
|
+
onClick: () => setIsPreviewOpen(false),
|
|
1032
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
|
|
1033
|
+
onClick: (e) => {
|
|
1034
|
+
e.stopPropagation();
|
|
1035
|
+
setIsPreviewOpen(false);
|
|
1036
|
+
},
|
|
1037
|
+
className: "absolute top-4 right-4 z-10000 flex h-10 w-10 items-center justify-center rounded-full bg-white/90 text-gray-900 backdrop-blur-sm transition-colors hover:bg-white",
|
|
1038
|
+
variant: "ghost",
|
|
1039
|
+
size: "sm",
|
|
1040
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "h-5 w-5" })
|
|
1041
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1042
|
+
className: "relative",
|
|
1043
|
+
onClick: (e) => e.stopPropagation(),
|
|
1044
|
+
style: {
|
|
1045
|
+
width: "95vw",
|
|
1046
|
+
height: "90vh"
|
|
1047
|
+
},
|
|
1048
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
1049
|
+
src: buildPdfSrc(displayPdf, currentPage),
|
|
1050
|
+
className: "h-full w-full rounded-lg bg-white",
|
|
1051
|
+
title: displayTitle || "PDF document"
|
|
1052
|
+
})
|
|
1053
|
+
})]
|
|
974
1054
|
})
|
|
975
1055
|
]
|
|
976
1056
|
});
|
|
@@ -2163,7 +2243,9 @@ function MediaDetailScreen({ mediaId, onNavigate, onBack }) {
|
|
|
2163
2243
|
const displayTitle = mediaItem?.title || "";
|
|
2164
2244
|
const displayImage = mediaItem?.image_url || "";
|
|
2165
2245
|
const displayVideo = mediaItem?.video_url || "";
|
|
2246
|
+
const displayPdf = mediaItem?.pdf_url || "";
|
|
2166
2247
|
const isVideo = mediaItem?.kind === "video" && !!displayVideo;
|
|
2248
|
+
const isPdf = mediaItem?.kind === "pdf" && !!displayPdf;
|
|
2167
2249
|
const badgeLabel = getBadgeLabel(mediaItem?.kind ?? null, {
|
|
2168
2250
|
video: t("media_type_video"),
|
|
2169
2251
|
image: t("media_type_image"),
|
|
@@ -2211,6 +2293,7 @@ function MediaDetailScreen({ mediaId, onNavigate, onBack }) {
|
|
|
2211
2293
|
displayImage,
|
|
2212
2294
|
displayTitle,
|
|
2213
2295
|
displayVideo: isVideo ? displayVideo : void 0,
|
|
2296
|
+
displayPdf: isPdf ? displayPdf : void 0,
|
|
2214
2297
|
isVideo,
|
|
2215
2298
|
badgeLabel,
|
|
2216
2299
|
rounded: true,
|
|
@@ -13913,4 +13996,4 @@ Object.defineProperty(exports, "shareablesScreenPropertySchema", {
|
|
|
13913
13996
|
}
|
|
13914
13997
|
});
|
|
13915
13998
|
|
|
13916
|
-
//# sourceMappingURL=ShareablesScreen-
|
|
13999
|
+
//# sourceMappingURL=ShareablesScreen-BeEEI0mD.cjs.map
|