@fluid-app/portal-sdk 0.1.199 → 0.1.201
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/{ContactsScreen-DvohvoOE.cjs → ContactsScreen-BQ6pvYOa.cjs} +291 -281
- package/dist/ContactsScreen-BQ6pvYOa.cjs.map +1 -0
- package/dist/{ContactsScreen-Cheiwaxn.cjs → ContactsScreen-Bw2GcYtk.cjs} +2 -2
- package/dist/{ContactsScreen-BtBNMZzG.mjs → ContactsScreen-BzRFTCBS.mjs} +17 -7
- package/dist/ContactsScreen-BzRFTCBS.mjs.map +1 -0
- package/dist/{FluidProvider-D177ez3m.cjs → FluidProvider-BRkRo8Wl.cjs} +12 -992
- package/dist/FluidProvider-BRkRo8Wl.cjs.map +1 -0
- package/dist/{FluidProvider-DiJy4Zve.mjs → FluidProvider-BTZAiT69.mjs} +9 -820
- package/dist/FluidProvider-BTZAiT69.mjs.map +1 -0
- package/dist/{MessagingScreen-Cu3tcpPs.mjs → MessagingScreen-Bk3Eh1dN.mjs} +2 -2
- package/dist/{MessagingScreen-Cu3tcpPs.mjs.map → MessagingScreen-Bk3Eh1dN.mjs.map} +1 -1
- package/dist/{MessagingScreen-Ysi48svi.cjs → MessagingScreen-DN2eQRxF.cjs} +6 -6
- package/dist/{MessagingScreen-gKidMcrr.cjs → MessagingScreen-DtDbS3VZ.cjs} +2 -2
- package/dist/{MessagingScreen-gKidMcrr.cjs.map → MessagingScreen-DtDbS3VZ.cjs.map} +1 -1
- package/dist/{PortalContentApiProvider-CPnqELEX.cjs → PortalContentApiProvider-BDbrZCyI.cjs} +115 -89
- package/dist/PortalContentApiProvider-BDbrZCyI.cjs.map +1 -0
- package/dist/{PortalContentApiProvider-CWRAw9kL.mjs → PortalContentApiProvider-CzLqEN5C.mjs} +116 -90
- package/dist/PortalContentApiProvider-CzLqEN5C.mjs.map +1 -0
- package/dist/{ProductsScreen-CQ5-A8AL.cjs → ProductsScreen-68jB202M.cjs} +2 -2
- package/dist/{ProductsScreen-CQ5-A8AL.cjs.map → ProductsScreen-68jB202M.cjs.map} +1 -1
- package/dist/{ProductsScreen-CexZ0gx9.mjs → ProductsScreen-BeNUsjh1.mjs} +2 -2
- package/dist/{ProductsScreen-Al6H4ujs.mjs → ProductsScreen-BidL3ZF5.mjs} +2 -2
- package/dist/{ProductsScreen-Al6H4ujs.mjs.map → ProductsScreen-BidL3ZF5.mjs.map} +1 -1
- package/dist/{ProductsScreen-BnwMOZ4-.cjs → ProductsScreen-Bq0f4pQL.cjs} +2 -2
- package/dist/{ProfileScreen-CGS7YkcT.cjs → ProfileScreen-BMNq0NEB.cjs} +6 -6
- package/dist/{ProfileScreen-hE1S_99P.mjs → ProfileScreen-D-pTegtY.mjs} +3 -3
- package/dist/{ProfileScreen-hE1S_99P.mjs.map → ProfileScreen-D-pTegtY.mjs.map} +1 -1
- package/dist/{ProfileScreen-DJZoMzE6.cjs → ProfileScreen-D5OxmzhM.cjs} +101 -101
- package/dist/{ProfileScreen-DJZoMzE6.cjs.map → ProfileScreen-D5OxmzhM.cjs.map} +1 -1
- package/dist/{QuickShareWidget-0GD4KWAr.cjs → QuickShareWidget-C_p3tPs5.cjs} +2 -2
- package/dist/QuickShareWidget-C_p3tPs5.cjs.map +1 -0
- package/dist/{QuickShareWidget-DZzrQjOx.mjs → QuickShareWidget-xKcV3ZQ5.mjs} +2 -2
- package/dist/QuickShareWidget-xKcV3ZQ5.mjs.map +1 -0
- package/dist/{ShareablesScreen-CzTU7e0l.mjs → ShareablesScreen-BRfgOnpL.mjs} +2 -2
- package/dist/{ShareablesScreen-CzTU7e0l.mjs.map → ShareablesScreen-BRfgOnpL.mjs.map} +1 -1
- package/dist/{ShareablesScreen-DujtMoAi.cjs → ShareablesScreen-BYP65ZnU.cjs} +2 -2
- package/dist/{ShareablesScreen-CmZ5CX99.cjs → ShareablesScreen-CCqADUXE.cjs} +2 -2
- package/dist/{ShareablesScreen-CmZ5CX99.cjs.map → ShareablesScreen-CCqADUXE.cjs.map} +1 -1
- package/dist/{ShareablesScreen-yscAsNpq.mjs → ShareablesScreen-YnNF0dD6.mjs} +2 -2
- package/dist/{ShopScreen-Bdo59te-.mjs → ShopScreen-BOJGcSyG.mjs} +3 -3
- package/dist/{ShopScreen-Bdo59te-.mjs.map → ShopScreen-BOJGcSyG.mjs.map} +1 -1
- package/dist/{ShopScreen-R9zk7d5d.cjs → ShopScreen-BzyBZ24D.cjs} +6 -6
- package/dist/{ShopScreen-DKlDKNom.cjs → ShopScreen-DeLp93hN.cjs} +3 -3
- package/dist/{ShopScreen-DKlDKNom.cjs.map → ShopScreen-DeLp93hN.cjs.map} +1 -1
- package/dist/{SpacerWidget-Da_sNa_X.mjs → SpacerWidget-BJFO-Xyh.mjs} +2 -2
- package/dist/SpacerWidget-BJFO-Xyh.mjs.map +1 -0
- package/dist/{SpacerWidget-CLFbkgoz.cjs → SpacerWidget-D9lOLPr5.cjs} +2 -2
- package/dist/SpacerWidget-D9lOLPr5.cjs.map +1 -0
- package/dist/{TableWidget-lKjTu7Go.cjs → TableWidget-C7qiWZc3.cjs} +1 -1
- package/dist/{TableWidget-B65hwjKS.mjs → TableWidget-DRByd9ig.mjs} +9 -9
- package/dist/TableWidget-DRByd9ig.mjs.map +1 -0
- package/dist/{TableWidget-FDbnEYZb.cjs → TableWidget-DUnz9hrD.cjs} +9 -9
- package/dist/TableWidget-DUnz9hrD.cjs.map +1 -0
- package/dist/index.cjs +68 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +126 -133
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +126 -133
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +25 -25
- package/dist/src-BNcNh8fM.cjs +963 -0
- package/dist/src-BNcNh8fM.cjs.map +1 -0
- package/dist/src-BjCPR0aG.mjs +788 -0
- package/dist/src-BjCPR0aG.mjs.map +1 -0
- package/package.json +16 -16
- package/dist/ContactsScreen-BtBNMZzG.mjs.map +0 -1
- package/dist/ContactsScreen-DvohvoOE.cjs.map +0 -1
- package/dist/FluidProvider-D177ez3m.cjs.map +0 -1
- package/dist/FluidProvider-DiJy4Zve.mjs.map +0 -1
- package/dist/PortalContentApiProvider-CPnqELEX.cjs.map +0 -1
- package/dist/PortalContentApiProvider-CWRAw9kL.mjs.map +0 -1
- package/dist/QuickShareWidget-0GD4KWAr.cjs.map +0 -1
- package/dist/QuickShareWidget-DZzrQjOx.mjs.map +0 -1
- package/dist/SpacerWidget-CLFbkgoz.cjs.map +0 -1
- package/dist/SpacerWidget-Da_sNa_X.mjs.map +0 -1
- package/dist/TableWidget-B65hwjKS.mjs.map +0 -1
- package/dist/TableWidget-FDbnEYZb.cjs.map +0 -1
- package/dist/countries-api-context-Dob_AzPO.mjs +0 -13
- package/dist/countries-api-context-Dob_AzPO.mjs.map +0 -1
- package/dist/countries-api-context-G-NW4BoH.cjs +0 -25
- package/dist/countries-api-context-G-NW4BoH.cjs.map +0 -1
package/dist/{PortalContentApiProvider-CWRAw9kL.mjs → PortalContentApiProvider-CzLqEN5C.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as useDropzone } from "./es-BeIE2Uzn.mjs";
|
|
2
2
|
import { A as playlists_update, C as playlists_create, D as playlists_items_remove, E as playlists_items_list, M as shares_list, O as playlists_list, T as playlists_items_add, _ as media_products_add, a as content_playlists_metrics_share_visits, b as media_show, c as dam_asset_paths_list, d as dam_assets_discard, f as dam_assets_list, g as media_list, h as media_destroy, i as content_pages_metrics_visits, j as shares_create, k as playlists_show, l as dam_assets_create, m as media_create, n as content_media_metrics_visits, o as content_playlists_metrics_visits, p as dam_query, r as content_pages_metrics_share_visits, s as dam_asset_paths_create, t as content_media_metrics_share_visits, u as dam_assets_destroy, v as media_products_list, w as playlists_destroy, x as media_update, y as media_products_remove } from "./portal_tenant_content-DzIQtSLE.mjs";
|
|
3
3
|
import { n as usePortalTenantClient } from "./PortalTenantClientProvider-4ZmY6hac.mjs";
|
|
4
|
-
import { $ as DropdownMenuSeparator, $t as BreadcrumbPage, A as Select, At as Checkbox, B as Form, C as Skeleton, Et as CardContent, G as FormMessage, H as FormField, J as DropdownMenuContent, K as Label, L as Input, M as SelectItem, N as SelectTrigger, P as SelectValue, Qt as BreadcrumbList, S as Slider, U as FormItem, V as FormControl, W as FormLabel, Xt as BreadcrumbItem, Y as DropdownMenuItem, Yt as Breadcrumb, Zt as BreadcrumbLink, _ as Switch, an as AlertDialog, bn as useZodForm, c as Tabs, cn as AlertDialogContent,
|
|
4
|
+
import { $ as DropdownMenuSeparator, $t as BreadcrumbPage, A as Select, At as Checkbox, B as Form, C as Skeleton, Et as CardContent, G as FormMessage, H as FormField, J as DropdownMenuContent, K as Label, L as Input, M as SelectItem, N as SelectTrigger, P as SelectValue, Qt as BreadcrumbList, S as Slider, U as FormItem, V as FormControl, W as FormLabel, Xt as BreadcrumbItem, Y as DropdownMenuItem, Yt as Breadcrumb, Zt as BreadcrumbLink, _ as Switch, an as AlertDialog, bn as useZodForm, c as Tabs, cn as AlertDialogContent, dn as AlertDialogHeader, dt as DialogPortal, en as BreadcrumbSeparator, et as DropdownMenuSub, fn as AlertDialogTitle, ft as DialogTitle, ht as PopoverTrigger, i as TooltipTrigger, it as Dialog, j as SelectContent, k as Separator, l as TabsList, ln as AlertDialogDescription, lt as DialogHeader, mn as Content, mt as PopoverContent, n as TooltipContent, nt as DropdownMenuSubTrigger, on as AlertDialogAction, ot as DialogContent, pn as Button, pt as Popover, q as DropdownMenu, r as TooltipProvider, rt as DropdownMenuTrigger, s as Textarea, sn as AlertDialogCancel, st as DialogDescription, t as Tooltip, tn as Badge, tt as DropdownMenuSubContent, u as TabsTrigger, un as AlertDialogFooter, ut as DialogOverlay, wt as Card, xn as cn, y as Spinner } from "./src-BTbz18gY.mjs";
|
|
5
5
|
import { n as useScreenHeaderActions, r as useScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-BD6Zo-ep.mjs";
|
|
6
6
|
import { a as useEditor, o as Placeholder, r as EditorContent, t as StarterKit } from "./dist-tv6N_HgZ.mjs";
|
|
7
7
|
import { t as SearchSort } from "./SearchSort-TmRTxK16.mjs";
|
|
@@ -617,7 +617,7 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
|
|
|
617
617
|
}, [handleIntersect]);
|
|
618
618
|
const products = useMemo(() => {
|
|
619
619
|
if (!data) return [];
|
|
620
|
-
if (usePortal) return data?.pages.flatMap((page) => page.products.map((p) => ({
|
|
620
|
+
if (usePortal) return data?.pages.flatMap((page) => (page.products ?? []).map((p) => ({
|
|
621
621
|
id: p.id ?? 0,
|
|
622
622
|
title: p.name ?? "",
|
|
623
623
|
image_url: p.images?.[0]?.url ?? null,
|
|
@@ -8937,6 +8937,7 @@ function PlaylistsListingScreen(_props) {
|
|
|
8937
8937
|
const [sortValue, setSortValue] = useState("title");
|
|
8938
8938
|
const [ownerFilter, setOwnerFilter] = useState("all");
|
|
8939
8939
|
const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
|
|
8940
|
+
const [pendingDeleteId, setPendingDeleteId] = useState(null);
|
|
8940
8941
|
useEffect(() => {
|
|
8941
8942
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
8942
8943
|
}, [ownerFilter]);
|
|
@@ -9068,27 +9069,31 @@ function PlaylistsListingScreen(_props) {
|
|
|
9068
9069
|
const handleEdit = useCallback((playlistId) => {
|
|
9069
9070
|
navigate(`playlists/${playlistId}/edit`);
|
|
9070
9071
|
}, [navigate]);
|
|
9071
|
-
const
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9072
|
+
const { mutate: deletePlaylist, isPending: isDeleting } = useMutation({
|
|
9073
|
+
mutationFn: (playlistId) => {
|
|
9074
|
+
if (!onDeletePlaylist) return Promise.reject(/* @__PURE__ */ new Error("Delete not available"));
|
|
9075
|
+
return onDeletePlaylist(playlistId);
|
|
9076
|
+
},
|
|
9077
|
+
onSuccess: () => {
|
|
9076
9078
|
queryClient.invalidateQueries({ queryKey: shareablesKeys.playlists.all });
|
|
9077
9079
|
showToast({
|
|
9078
9080
|
title: "Playlist deleted",
|
|
9079
9081
|
type: "success"
|
|
9080
9082
|
});
|
|
9081
|
-
|
|
9083
|
+
setPendingDeleteId(null);
|
|
9084
|
+
},
|
|
9085
|
+
onError: (error) => {
|
|
9082
9086
|
showToast({
|
|
9083
9087
|
title: "Failed to delete playlist",
|
|
9084
|
-
type: "error"
|
|
9088
|
+
type: "error",
|
|
9089
|
+
error
|
|
9085
9090
|
});
|
|
9091
|
+
setPendingDeleteId(null);
|
|
9086
9092
|
}
|
|
9087
|
-
}
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
]);
|
|
9093
|
+
});
|
|
9094
|
+
const confirmDelete = useCallback(() => {
|
|
9095
|
+
if (pendingDeleteId != null) deletePlaylist(pendingDeleteId);
|
|
9096
|
+
}, [pendingDeleteId, deletePlaylist]);
|
|
9092
9097
|
if (isLoading) return /* @__PURE__ */ jsxs("div", {
|
|
9093
9098
|
className: "space-y-6 px-4 py-4 md:px-10 md:py-6",
|
|
9094
9099
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -9176,7 +9181,7 @@ function PlaylistsListingScreen(_props) {
|
|
|
9176
9181
|
onSelectionChange: (selected) => handleToggleSelection(playlist.id, selected),
|
|
9177
9182
|
onToggleFavorite: onToggleFavorite ? () => handleFavorite(playlist.id) : void 0,
|
|
9178
9183
|
onEdit: () => handleEdit(playlist.id),
|
|
9179
|
-
onDelete: onDeletePlaylist ? () =>
|
|
9184
|
+
onDelete: onDeletePlaylist ? () => setPendingDeleteId(playlist.id) : void 0
|
|
9180
9185
|
}, playlist.id);
|
|
9181
9186
|
})
|
|
9182
9187
|
}),
|
|
@@ -9191,6 +9196,24 @@ function PlaylistsListingScreen(_props) {
|
|
|
9191
9196
|
error && /* @__PURE__ */ jsxs("p", {
|
|
9192
9197
|
className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
|
|
9193
9198
|
children: ["Error: ", error.message]
|
|
9199
|
+
}),
|
|
9200
|
+
/* @__PURE__ */ jsx(AlertDialog, {
|
|
9201
|
+
open: pendingDeleteId !== null,
|
|
9202
|
+
onOpenChange: (open) => {
|
|
9203
|
+
if (!open && !isDeleting) setPendingDeleteId(null);
|
|
9204
|
+
},
|
|
9205
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Delete this playlist?" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This removes the playlist from your library. Shared links that point to it will stop working." })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
9206
|
+
disabled: isDeleting,
|
|
9207
|
+
children: "Cancel"
|
|
9208
|
+
}), /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
9209
|
+
onClick: (e) => {
|
|
9210
|
+
e.preventDefault();
|
|
9211
|
+
confirmDelete();
|
|
9212
|
+
},
|
|
9213
|
+
disabled: isDeleting,
|
|
9214
|
+
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
9215
|
+
children: isDeleting ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "Delete"
|
|
9216
|
+
})] })] })
|
|
9194
9217
|
})
|
|
9195
9218
|
]
|
|
9196
9219
|
});
|
|
@@ -9276,7 +9299,7 @@ function TaggedProductsList({ products, onProductClick }) {
|
|
|
9276
9299
|
const displayPrice = resolvePrice(product);
|
|
9277
9300
|
return /* @__PURE__ */ jsxs("button", {
|
|
9278
9301
|
onClick: (e) => handleProductClick(product.id, e),
|
|
9279
|
-
className: "group bg-muted hover:bg-muted
|
|
9302
|
+
className: "group bg-muted hover:bg-muted/60 flex w-[168px] shrink-0 flex-col gap-2 rounded-lg p-3 text-left transition-all",
|
|
9280
9303
|
children: [/* @__PURE__ */ jsx("div", {
|
|
9281
9304
|
className: "bg-background relative h-[168px] w-full overflow-hidden rounded-lg",
|
|
9282
9305
|
children: renderImage({
|
|
@@ -9378,7 +9401,7 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
|
|
|
9378
9401
|
const fileType = getFileType(item.media_format ?? relateable?.media_format, item.image_url ?? relateable?.image_url);
|
|
9379
9402
|
return /* @__PURE__ */ jsxs("div", {
|
|
9380
9403
|
onClick: () => handleCardClick(index),
|
|
9381
|
-
className: `hover:bg-muted
|
|
9404
|
+
className: `hover:bg-muted/60 flex w-full cursor-pointer items-start gap-3 rounded-lg p-3 text-left transition-all ${index === selectedItemIndex ? "bg-muted/60" : "bg-muted"}`,
|
|
9382
9405
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
9383
9406
|
className: "bg-background relative h-[104px] w-[104px] shrink-0 overflow-hidden rounded-lg",
|
|
9384
9407
|
children: [renderImage({
|
|
@@ -9458,11 +9481,9 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
|
|
|
9458
9481
|
const DEFAULT_IMAGE$1 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
|
|
9459
9482
|
function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
9460
9483
|
const api = useShareablesApi();
|
|
9461
|
-
const { navigate,
|
|
9484
|
+
const { navigate, user, readOnly } = useShareablesUI();
|
|
9462
9485
|
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false);
|
|
9463
9486
|
const [selectedPlaylistItemIndex, setSelectedPlaylistItemIndex] = useState(0);
|
|
9464
|
-
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
|
|
9465
|
-
const [isDeleting, setIsDeleting] = useState(false);
|
|
9466
9487
|
const { data: playlistResponse, isLoading } = useQuery({
|
|
9467
9488
|
queryKey: shareablesKeys.playlists.detail(Number(playlistId)),
|
|
9468
9489
|
queryFn: () => api.playlists.getPlaylistById(Number(playlistId))
|
|
@@ -9473,25 +9494,19 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
|
9473
9494
|
const displayTitle = playlist?.title || "";
|
|
9474
9495
|
useScreenHeaderActions(useMemo(() => {
|
|
9475
9496
|
if (!canEdit) return null;
|
|
9476
|
-
return /* @__PURE__ */
|
|
9497
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9477
9498
|
className: "flex items-center gap-2",
|
|
9478
|
-
children:
|
|
9499
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
9479
9500
|
variant: "outline",
|
|
9480
9501
|
size: "sm",
|
|
9481
9502
|
onClick: () => navigate(`playlists/${playlistId}/edit`),
|
|
9482
9503
|
children: [/* @__PURE__ */ jsx(Pencil, { className: "mr-1 h-3.5 w-3.5" }), "Edit"]
|
|
9483
|
-
})
|
|
9484
|
-
variant: "destructive",
|
|
9485
|
-
size: "sm",
|
|
9486
|
-
onClick: () => setIsDeleteOpen(true),
|
|
9487
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-1 h-3.5 w-3.5" }), "Delete"]
|
|
9488
|
-
})]
|
|
9504
|
+
})
|
|
9489
9505
|
});
|
|
9490
9506
|
}, [
|
|
9491
9507
|
canEdit,
|
|
9492
9508
|
navigate,
|
|
9493
|
-
playlistId
|
|
9494
|
-
onDeletePlaylist
|
|
9509
|
+
playlistId
|
|
9495
9510
|
]));
|
|
9496
9511
|
useScreenHeaderBreadcrumbs(useMemo(() => /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, {
|
|
9497
9512
|
className: "text-lg",
|
|
@@ -9511,31 +9526,6 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
|
9511
9526
|
}) })
|
|
9512
9527
|
]
|
|
9513
9528
|
}) }), [displayTitle, navigate]));
|
|
9514
|
-
const handleDelete = useCallback(async () => {
|
|
9515
|
-
if (!onDeletePlaylist) return;
|
|
9516
|
-
setIsDeleting(true);
|
|
9517
|
-
try {
|
|
9518
|
-
await onDeletePlaylist(Number(playlistId));
|
|
9519
|
-
showToast({
|
|
9520
|
-
title: "Playlist deleted successfully",
|
|
9521
|
-
type: "success"
|
|
9522
|
-
});
|
|
9523
|
-
navigate("playlists");
|
|
9524
|
-
} catch {
|
|
9525
|
-
showToast({
|
|
9526
|
-
title: "Failed to delete playlist",
|
|
9527
|
-
type: "error"
|
|
9528
|
-
});
|
|
9529
|
-
} finally {
|
|
9530
|
-
setIsDeleting(false);
|
|
9531
|
-
setIsDeleteOpen(false);
|
|
9532
|
-
}
|
|
9533
|
-
}, [
|
|
9534
|
-
onDeletePlaylist,
|
|
9535
|
-
playlistId,
|
|
9536
|
-
showToast,
|
|
9537
|
-
navigate
|
|
9538
|
-
]);
|
|
9539
9529
|
const selectedPlaylistItem = playlist?.items?.[selectedPlaylistItemIndex];
|
|
9540
9530
|
const displayImage = selectedPlaylistItem?.image_url ?? selectedPlaylistItem?.relateable?.image_url ?? selectedPlaylistItem?.relateable?.compressed_image_url ?? DEFAULT_IMAGE$1;
|
|
9541
9531
|
const strippedDescription = stripTags(playlist?.description || playlist?.search_engine_optimizer?.description || "");
|
|
@@ -9555,9 +9545,9 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
|
9555
9545
|
children: "Playlist not found or failed to load."
|
|
9556
9546
|
})
|
|
9557
9547
|
});
|
|
9558
|
-
return /* @__PURE__ */
|
|
9548
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9559
9549
|
className: "flex flex-col gap-4 px-4 py-4 md:px-10 md:py-6",
|
|
9560
|
-
children:
|
|
9550
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
9561
9551
|
className: "mx-auto flex w-full max-w-[480px] flex-col gap-6 md:h-[calc(100vh-140px)] md:max-w-none md:flex-row",
|
|
9562
9552
|
children: [/* @__PURE__ */ jsx("div", {
|
|
9563
9553
|
className: "aspect-square w-full md:aspect-auto md:h-full",
|
|
@@ -9625,21 +9615,7 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
|
9625
9615
|
})
|
|
9626
9616
|
]
|
|
9627
9617
|
})]
|
|
9628
|
-
})
|
|
9629
|
-
open: isDeleteOpen,
|
|
9630
|
-
onOpenChange: setIsDeleteOpen,
|
|
9631
|
-
children: /* @__PURE__ */ jsxs(DialogContent, { children: [/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Delete Playlist" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Are you sure you want to delete this playlist? This action cannot be undone." })] }), /* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button, {
|
|
9632
|
-
variant: "outline",
|
|
9633
|
-
onClick: () => setIsDeleteOpen(false),
|
|
9634
|
-
disabled: isDeleting,
|
|
9635
|
-
children: "Cancel"
|
|
9636
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
9637
|
-
variant: "destructive",
|
|
9638
|
-
onClick: () => void handleDelete(),
|
|
9639
|
-
disabled: isDeleting,
|
|
9640
|
-
children: isDeleting ? "Deleting..." : "Delete"
|
|
9641
|
-
})] })] })
|
|
9642
|
-
})]
|
|
9618
|
+
})
|
|
9643
9619
|
});
|
|
9644
9620
|
}
|
|
9645
9621
|
//#endregion
|
|
@@ -9838,19 +9814,30 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
9838
9814
|
};
|
|
9839
9815
|
useScreenHeaderActions(useMemo(() => /* @__PURE__ */ jsxs("div", {
|
|
9840
9816
|
className: "flex items-center gap-2",
|
|
9841
|
-
children: [playlistId && onDeletePlaylist && /* @__PURE__ */ jsxs(
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9817
|
+
children: [playlistId && onDeletePlaylist && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
9818
|
+
asChild: true,
|
|
9819
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
9820
|
+
variant: "outline",
|
|
9821
|
+
size: "sm",
|
|
9822
|
+
className: "h-8 w-8 p-0",
|
|
9823
|
+
"aria-label": "Playlist actions",
|
|
9824
|
+
disabled: isMutating,
|
|
9825
|
+
children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" })
|
|
9826
|
+
})
|
|
9827
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
9828
|
+
align: "end",
|
|
9829
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
9830
|
+
onClick: () => setIsDeleteOpen(true),
|
|
9831
|
+
className: "text-destructive focus:text-destructive",
|
|
9832
|
+
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), "Delete"]
|
|
9833
|
+
})
|
|
9834
|
+
})] }), /* @__PURE__ */ jsx(Button, {
|
|
9848
9835
|
onClick: () => {
|
|
9849
9836
|
onSubmit().catch(() => {});
|
|
9850
9837
|
},
|
|
9851
9838
|
disabled: isMutating || !isDirty || !isFormValid,
|
|
9852
9839
|
size: "sm",
|
|
9853
|
-
children: isSaving ? "
|
|
9840
|
+
children: isSaving ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "Save"
|
|
9854
9841
|
})]
|
|
9855
9842
|
}), [
|
|
9856
9843
|
playlistId,
|
|
@@ -9879,19 +9866,22 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
9879
9866
|
}) })
|
|
9880
9867
|
]
|
|
9881
9868
|
}) }), [isEditMode, navigate]));
|
|
9882
|
-
return /* @__PURE__ */ jsx(
|
|
9869
|
+
return /* @__PURE__ */ jsx(AlertDialog, {
|
|
9883
9870
|
open: isDeleteOpen,
|
|
9884
|
-
onOpenChange:
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9871
|
+
onOpenChange: (open) => {
|
|
9872
|
+
if (!open && !isDeleting) setIsDeleteOpen(false);
|
|
9873
|
+
},
|
|
9874
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Delete this playlist?" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This removes the playlist from your library. Shared links that point to it will stop working." })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
9888
9875
|
disabled: isDeleting,
|
|
9889
9876
|
children: "Cancel"
|
|
9890
|
-
}), /* @__PURE__ */ jsx(
|
|
9891
|
-
|
|
9892
|
-
|
|
9877
|
+
}), /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
9878
|
+
onClick: (e) => {
|
|
9879
|
+
e.preventDefault();
|
|
9880
|
+
handleDelete();
|
|
9881
|
+
},
|
|
9893
9882
|
disabled: isDeleting,
|
|
9894
|
-
|
|
9883
|
+
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
9884
|
+
children: isDeleting ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "Delete"
|
|
9895
9885
|
})] })] })
|
|
9896
9886
|
});
|
|
9897
9887
|
}
|
|
@@ -10452,6 +10442,42 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
10452
10442
|
const { form, updateField, validateForm } = usePlaylistForm();
|
|
10453
10443
|
const playlistTitle = form.title || "";
|
|
10454
10444
|
const slugValue = form.slug ?? "";
|
|
10445
|
+
useScreenHeaderBreadcrumbs(useMemo(() => /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, {
|
|
10446
|
+
className: "text-lg",
|
|
10447
|
+
children: [/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, {
|
|
10448
|
+
href: "#",
|
|
10449
|
+
onClick: (e) => {
|
|
10450
|
+
e.preventDefault();
|
|
10451
|
+
(onBack ?? (() => navigate("playlists")))();
|
|
10452
|
+
},
|
|
10453
|
+
children: "Playlists"
|
|
10454
|
+
}) }), isEditMode ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
10455
|
+
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
10456
|
+
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, {
|
|
10457
|
+
href: "#",
|
|
10458
|
+
onClick: (e) => {
|
|
10459
|
+
e.preventDefault();
|
|
10460
|
+
navigate(`playlists/${playlistId}`);
|
|
10461
|
+
},
|
|
10462
|
+
className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
|
|
10463
|
+
children: playlistTitle || "Playlist"
|
|
10464
|
+
}) }),
|
|
10465
|
+
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
10466
|
+
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
10467
|
+
className: "font-semibold",
|
|
10468
|
+
children: "Edit"
|
|
10469
|
+
}) })
|
|
10470
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(BreadcrumbSeparator, {}), /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
10471
|
+
className: "font-semibold",
|
|
10472
|
+
children: "New Playlist"
|
|
10473
|
+
}) })] })]
|
|
10474
|
+
}) }), [
|
|
10475
|
+
isEditMode,
|
|
10476
|
+
playlistTitle,
|
|
10477
|
+
onBack,
|
|
10478
|
+
navigate,
|
|
10479
|
+
playlistId
|
|
10480
|
+
]));
|
|
10455
10481
|
useEffect(() => {
|
|
10456
10482
|
const isCustomSlug = form.custom_slug || playlist?.custom_slug || false;
|
|
10457
10483
|
if (playlistTitle && !isCustomSlug) {
|
|
@@ -11924,4 +11950,4 @@ function PortalContentApiProvider({ children }) {
|
|
|
11924
11950
|
//#endregion
|
|
11925
11951
|
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 };
|
|
11926
11952
|
|
|
11927
|
-
//# sourceMappingURL=PortalContentApiProvider-
|
|
11953
|
+
//# sourceMappingURL=PortalContentApiProvider-CzLqEN5C.mjs.map
|