@fluid-app/portal-sdk 0.1.280 → 0.1.281

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.
Files changed (72) hide show
  1. package/dist/{ContactsScreen-D42uVkfI.mjs → ContactsScreen-CMETL0o1.mjs} +33 -36
  2. package/dist/ContactsScreen-CMETL0o1.mjs.map +1 -0
  3. package/dist/{ContactsScreen-CVUFwHD0.cjs → ContactsScreen-CNM9nqb1.cjs} +33 -36
  4. package/dist/ContactsScreen-CNM9nqb1.cjs.map +1 -0
  5. package/dist/{ContactsScreen-BWgTp9z6.cjs → ContactsScreen-CZLLBgUB.cjs} +2 -2
  6. package/dist/{MessagingScreen-ihaUzGp0.mjs → MessagingScreen-BvVhwvm8.mjs} +2 -2
  7. package/dist/{MessagingScreen-CE8MTQxn.cjs → MessagingScreen-C3yCIWo4.cjs} +41 -62
  8. package/dist/MessagingScreen-C3yCIWo4.cjs.map +1 -0
  9. package/dist/{MessagingScreen-r73abdKa.mjs → MessagingScreen-C7W5-K1N.mjs} +41 -62
  10. package/dist/{MessagingScreen-r73abdKa.mjs.map → MessagingScreen-C7W5-K1N.mjs.map} +1 -1
  11. package/dist/{MessagingScreen-DIbrm4HW.cjs → MessagingScreen-sc1u2IwX.cjs} +2 -2
  12. package/dist/{MySiteScreen-B1_Xx5-L.cjs → MySiteScreen-BiRsdk3F.cjs} +5 -10
  13. package/dist/MySiteScreen-BiRsdk3F.cjs.map +1 -0
  14. package/dist/{MySiteScreen-Dx8wYdv3.mjs → MySiteScreen-CfCr1_w0.mjs} +5 -10
  15. package/dist/{MySiteScreen-Dx8wYdv3.mjs.map → MySiteScreen-CfCr1_w0.mjs.map} +1 -1
  16. package/dist/{MySiteScreen-CFyr06DP.cjs → MySiteScreen-D2ivRa2e.cjs} +2 -2
  17. package/dist/{OrdersScreen-RNTW7SCI.mjs → OrdersScreen-BCFfxurP.mjs} +2 -2
  18. package/dist/{OrdersScreen-BQKy-1vC.cjs → OrdersScreen-CSkiK7j8.cjs} +13 -15
  19. package/dist/OrdersScreen-CSkiK7j8.cjs.map +1 -0
  20. package/dist/{OrdersScreen-C-32UkcG.cjs → OrdersScreen-DOCdTWOx.cjs} +2 -2
  21. package/dist/{OrdersScreen-9wp4AWDC.mjs → OrdersScreen-NzGaufXO.mjs} +13 -15
  22. package/dist/OrdersScreen-NzGaufXO.mjs.map +1 -0
  23. package/dist/{ProfileScreen-OZZ9Zcab.mjs → ProfileScreen-CkRFE_jb.mjs} +5 -6
  24. package/dist/{ProfileScreen-OZZ9Zcab.mjs.map → ProfileScreen-CkRFE_jb.mjs.map} +1 -1
  25. package/dist/{ProfileScreen-BdMZsorI.mjs → ProfileScreen-Cm4WZ54w.mjs} +2 -2
  26. package/dist/{ProfileScreen-BvIfbjnw.cjs → ProfileScreen-Dacb369p.cjs} +5 -6
  27. package/dist/ProfileScreen-Dacb369p.cjs.map +1 -0
  28. package/dist/{ProfileScreen-BrdjkmQd.cjs → ProfileScreen-zzk5SGP5.cjs} +2 -2
  29. package/dist/ScreenHeaderContext-CsfhnuJk.cjs +86 -0
  30. package/dist/ScreenHeaderContext-CsfhnuJk.cjs.map +1 -0
  31. package/dist/ScreenHeaderContext-Dn12BZyj.mjs +62 -0
  32. package/dist/ScreenHeaderContext-Dn12BZyj.mjs.map +1 -0
  33. package/dist/{ShareablesScreen-BP1Ed_Sv.cjs → ShareablesScreen-BwFmwYNG.cjs} +2 -2
  34. package/dist/{ShareablesScreen-DwxcReCu.cjs → ShareablesScreen-C6pCPvmx.cjs} +1101 -1144
  35. package/dist/ShareablesScreen-C6pCPvmx.cjs.map +1 -0
  36. package/dist/{ShareablesScreen-tq0taJJe.mjs → ShareablesScreen-kr2RL4FN.mjs} +2 -2
  37. package/dist/{ShareablesScreen-C5ZRdX-y.mjs → ShareablesScreen-uMQYLpTv.mjs} +1101 -1144
  38. package/dist/ShareablesScreen-uMQYLpTv.mjs.map +1 -0
  39. package/dist/{ShopScreen-B-OBQ2S7.mjs → ShopScreen-BqDNPM7i.mjs} +36 -47
  40. package/dist/{ShopScreen-B-OBQ2S7.mjs.map → ShopScreen-BqDNPM7i.mjs.map} +1 -1
  41. package/dist/{ShopScreen-Cn94XVxx.mjs → ShopScreen-CpCBdW0Z.mjs} +2 -2
  42. package/dist/{ShopScreen-zdvCwxBT.cjs → ShopScreen-DRnPRtV7.cjs} +36 -47
  43. package/dist/ShopScreen-DRnPRtV7.cjs.map +1 -0
  44. package/dist/{ShopScreen-CQDkeQrR.cjs → ShopScreen-SN91S9Ao.cjs} +2 -2
  45. package/dist/{SubscriptionsScreen-CRHHXzrB.cjs → SubscriptionsScreen-D4C8a7-e.cjs} +13 -15
  46. package/dist/SubscriptionsScreen-D4C8a7-e.cjs.map +1 -0
  47. package/dist/{SubscriptionsScreen-Dx7Evic_.mjs → SubscriptionsScreen-DCeby11T.mjs} +13 -15
  48. package/dist/SubscriptionsScreen-DCeby11T.mjs.map +1 -0
  49. package/dist/{SubscriptionsScreen-DH10SUZK.cjs → SubscriptionsScreen-DzwK-Sck.cjs} +2 -2
  50. package/dist/index.cjs +35 -34
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.cts.map +1 -1
  53. package/dist/index.d.mts.map +1 -1
  54. package/dist/index.mjs +35 -34
  55. package/dist/index.mjs.map +1 -1
  56. package/package.json +18 -18
  57. package/dist/ContactsScreen-CVUFwHD0.cjs.map +0 -1
  58. package/dist/ContactsScreen-D42uVkfI.mjs.map +0 -1
  59. package/dist/MessagingScreen-CE8MTQxn.cjs.map +0 -1
  60. package/dist/MySiteScreen-B1_Xx5-L.cjs.map +0 -1
  61. package/dist/OrdersScreen-9wp4AWDC.mjs.map +0 -1
  62. package/dist/OrdersScreen-BQKy-1vC.cjs.map +0 -1
  63. package/dist/ProfileScreen-BvIfbjnw.cjs.map +0 -1
  64. package/dist/ScreenHeaderContext-BDjNSUfr.mjs +0 -85
  65. package/dist/ScreenHeaderContext-BDjNSUfr.mjs.map +0 -1
  66. package/dist/ScreenHeaderContext-PbjwAMeB.cjs +0 -109
  67. package/dist/ScreenHeaderContext-PbjwAMeB.cjs.map +0 -1
  68. package/dist/ShareablesScreen-C5ZRdX-y.mjs.map +0 -1
  69. package/dist/ShareablesScreen-DwxcReCu.cjs.map +0 -1
  70. package/dist/ShopScreen-zdvCwxBT.cjs.map +0 -1
  71. package/dist/SubscriptionsScreen-CRHHXzrB.cjs.map +0 -1
  72. package/dist/SubscriptionsScreen-Dx7Evic_.mjs.map +0 -1
@@ -3,7 +3,7 @@ const require_portal_tenant = require("./portal_tenant-DG4gKXnu.cjs");
3
3
  const require_portal_tenant_content = require("./portal_tenant_content-C1R1xxDP.cjs");
4
4
  const require_PortalTenantClientProvider = require("./PortalTenantClientProvider-CVv-4rQ9.cjs");
5
5
  const require_src = require("./src-B0ut9PTw.cjs");
6
- const require_ScreenHeaderContext = require("./ScreenHeaderContext-PbjwAMeB.cjs");
6
+ const require_ScreenHeaderContext = require("./ScreenHeaderContext-CsfhnuJk.cjs");
7
7
  const require_use_store = require("./use-store-DvtLtZ3f.cjs");
8
8
  const require_use_account = require("./use-account-DlmM-lMR.cjs");
9
9
  const require_AppNavigationContext = require("./AppNavigationContext-C1-hd9Rw.cjs");
@@ -770,13 +770,6 @@ const SORT_OPTIONS$1 = [
770
770
  function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNavigate }) {
771
771
  const client = useShareablesClient();
772
772
  const { navigate } = useShareablesUI();
773
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
774
- className: "text-lg",
775
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
776
- className: "font-semibold",
777
- children: "Products"
778
- }) })
779
- }) }), []));
780
773
  const [searchTerm, setSearchTerm] = (0, react.useState)("");
781
774
  const [debouncedSearch, setDebouncedSearch] = (0, react.useState)("");
782
775
  const [sortValue, setSortValue] = (0, react.useState)("created_at_desc");
@@ -857,7 +850,13 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
857
850
  className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
858
851
  children: "Failed to load products. Please try again."
859
852
  })] });
860
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
853
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
854
+ className: "text-lg",
855
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
856
+ className: "font-semibold",
857
+ children: "Products"
858
+ }) })
859
+ }) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
861
860
  isLoading,
862
861
  isEmpty: !error && products.length === 0 && !isFetchingNextPage && !hasNextPage,
863
862
  emptyMessage: debouncedSearch ? "No products match your search." : "No products available.",
@@ -900,7 +899,7 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
900
899
  onClick: () => navigate(`product/${product.id}`)
901
900
  }, product.id))
902
901
  })
903
- });
902
+ })] });
904
903
  }
905
904
  //#endregion
906
905
  //#region ../../shareables/ui/src/components/SharePage/SharePageImageDisplay.tsx
@@ -1530,28 +1529,6 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
1530
1529
  const displayTitle = portalProduct?.name || legacyProduct?.title || "";
1531
1530
  const productImage = portalProduct?.images?.[0]?.url || legacyProduct?.image_url || "";
1532
1531
  const displayDescription = portalProduct?.description || legacyProduct?.description || legacyProduct?.stripped || "";
1533
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
1534
- className: "text-lg",
1535
- children: [
1536
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
1537
- href: "#",
1538
- onClick: (e) => {
1539
- e.preventDefault();
1540
- (onBack ?? (() => navigate("products")))();
1541
- },
1542
- children: "Products"
1543
- }) }),
1544
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
1545
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
1546
- className: "font-semibold",
1547
- children: displayTitle || "Product"
1548
- }) })
1549
- ]
1550
- }) }), [
1551
- displayTitle,
1552
- onBack,
1553
- navigate
1554
- ]));
1555
1532
  const displayPrice = (() => {
1556
1533
  if (legacyProduct?.display_price) return legacyProduct.display_price;
1557
1534
  const price = portalProduct?.price ?? legacyProduct?.price;
@@ -1584,7 +1561,24 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
1584
1561
  const handleMediaItemClick = (0, react.useCallback)((mediaItem) => {
1585
1562
  onNavigate?.("media", String(mediaItem.id));
1586
1563
  }, [onNavigate]);
1587
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ShareableDetailLayout, {
1564
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
1565
+ className: "text-lg",
1566
+ children: [
1567
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
1568
+ href: "#",
1569
+ onClick: (e) => {
1570
+ e.preventDefault();
1571
+ (onBack ?? (() => navigate("products")))();
1572
+ },
1573
+ children: "Products"
1574
+ }) }),
1575
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
1576
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
1577
+ className: "font-semibold",
1578
+ children: displayTitle || "Product"
1579
+ }) })
1580
+ ]
1581
+ }) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ShareableDetailLayout, {
1588
1582
  isLoading: isLoadingProduct,
1589
1583
  notFound: !product,
1590
1584
  notFoundMessage: "Product not found or failed to load.",
@@ -1652,7 +1646,7 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
1652
1646
  relateable_type: "Product"
1653
1647
  })
1654
1648
  })]
1655
- });
1649
+ })] });
1656
1650
  }
1657
1651
  //#endregion
1658
1652
  //#region ../../shareables/ui/src/components/OwnerFilterTabs.tsx
@@ -1725,18 +1719,6 @@ function MediaListingScreen(_props) {
1725
1719
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
1726
1720
  const { navigate, readOnly, showToast } = useShareablesUI();
1727
1721
  const [pendingDeleteId, setPendingDeleteId] = (0, react.useState)(null);
1728
- require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => readOnly ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
1729
- onClick: () => navigate("media/new"),
1730
- size: "sm",
1731
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "mr-1 h-4 w-4" }), "Add Media"]
1732
- }), [navigate, readOnly]));
1733
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
1734
- className: "text-lg",
1735
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
1736
- className: "font-semibold",
1737
- children: "Media"
1738
- }) })
1739
- }) }), []));
1740
1722
  const [searchTerm, setSearchTerm] = (0, react.useState)("");
1741
1723
  const [debouncedSearch, setDebouncedSearch] = (0, react.useState)("");
1742
1724
  const [sortValue, setSortValue] = (0, react.useState)("newest");
@@ -1884,80 +1866,95 @@ function MediaListingScreen(_props) {
1884
1866
  className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
1885
1867
  children: ["Error: ", error.message]
1886
1868
  })] });
1887
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
1888
- isLoading,
1889
- isEmpty: !error && filteredItems.length === 0 && !isFetchingNextPage && !hasNextPage,
1890
- emptyMessage: getFilteredEmptyMessage({
1891
- searchTerm: debouncedSearch,
1892
- ownerFilter,
1893
- hasOtherFilters: kindFilter !== "all",
1894
- entityName: "media",
1895
- defaultMessage: "No media available."
1896
- }),
1897
- filters: filterBar,
1898
- footer,
1899
- sentinelRef,
1900
- loadingFilterShape: "search-view",
1901
- children: viewMode === "grid" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1902
- className: SHAREABLE_GRID_CLASS,
1903
- children: filteredItems.map((item) => {
1904
- const canEdit = !readOnly && item.owner_type === "user";
1905
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1906
- className: "relative",
1907
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareItemCard, {
1908
- title: item.title ?? "",
1869
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1870
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderActions, { children: readOnly ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
1871
+ onClick: () => navigate("media/new"),
1872
+ size: "sm",
1873
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "mr-1 h-4 w-4" }), "Add Media"]
1874
+ }) }),
1875
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
1876
+ className: "text-lg",
1877
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
1878
+ className: "font-semibold",
1879
+ children: "Media"
1880
+ }) })
1881
+ }) }) }),
1882
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
1883
+ isLoading,
1884
+ isEmpty: !error && filteredItems.length === 0 && !isFetchingNextPage && !hasNextPage,
1885
+ emptyMessage: getFilteredEmptyMessage({
1886
+ searchTerm: debouncedSearch,
1887
+ ownerFilter,
1888
+ hasOtherFilters: kindFilter !== "all",
1889
+ entityName: "media",
1890
+ defaultMessage: "No media available."
1891
+ }),
1892
+ filters: filterBar,
1893
+ footer,
1894
+ sentinelRef,
1895
+ loadingFilterShape: "search-view",
1896
+ children: viewMode === "grid" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1897
+ className: SHAREABLE_GRID_CLASS,
1898
+ children: filteredItems.map((item) => {
1899
+ const canEdit = !readOnly && item.owner_type === "user";
1900
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1901
+ className: "relative",
1902
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareItemCard, {
1903
+ title: item.title ?? "",
1904
+ imageUrl: item.image_url,
1905
+ href: `media/${item.id}`,
1906
+ badge: { text: getMediaKindLabel(item.kind) },
1907
+ isVideo: item.kind === "video",
1908
+ subtitle: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1909
+ className: "flex items-center gap-1.5",
1910
+ children: [getMediaKindLabel(item.kind), item.owner_type === "user" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Badge, {
1911
+ variant: "secondary",
1912
+ className: "px-1.5 py-0 text-[10px] leading-4",
1913
+ children: "My Media"
1914
+ })]
1915
+ })
1916
+ }), canEdit && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1917
+ className: "absolute top-2 right-2",
1918
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MediaRowActionsMenu, { onDelete: () => setPendingDeleteId(item.id) })
1919
+ })]
1920
+ }, item.id);
1921
+ })
1922
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1923
+ className: SHAREABLE_LIST_CLASS,
1924
+ children: filteredItems.map((item) => {
1925
+ const canEdit = !readOnly && item.owner_type === "user";
1926
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListRow, {
1909
1927
  imageUrl: item.image_url,
1910
- href: `media/${item.id}`,
1911
- badge: { text: getMediaKindLabel(item.kind) },
1912
- isVideo: item.kind === "video",
1913
- subtitle: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1914
- className: "flex items-center gap-1.5",
1915
- children: [getMediaKindLabel(item.kind), item.owner_type === "user" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Badge, {
1916
- variant: "secondary",
1917
- className: "px-1.5 py-0 text-[10px] leading-4",
1918
- children: "My Media"
1919
- })]
1920
- })
1921
- }), canEdit && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1922
- className: "absolute top-2 right-2",
1923
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MediaRowActionsMenu, { onDelete: () => setPendingDeleteId(item.id) })
1924
- })]
1925
- }, item.id);
1926
- })
1927
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1928
- className: SHAREABLE_LIST_CLASS,
1929
- children: filteredItems.map((item) => {
1930
- const canEdit = !readOnly && item.owner_type === "user";
1931
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListRow, {
1932
- imageUrl: item.image_url,
1933
- imageAlt: item.title ?? "",
1934
- title: item.title ?? "Untitled",
1935
- subtitle: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [getMediaKindLabel(item.kind), item.owner_type === "user" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Badge, {
1936
- variant: "secondary",
1937
- className: "px-1.5 py-0 text-[10px] leading-4",
1938
- children: "My Media"
1939
- })] }),
1940
- onClick: () => navigate(`media/${item.id}`),
1941
- trailing: canEdit && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MediaRowActionsMenu, { onDelete: () => setPendingDeleteId(item.id) })
1942
- }, item.id);
1928
+ imageAlt: item.title ?? "",
1929
+ title: item.title ?? "Untitled",
1930
+ subtitle: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [getMediaKindLabel(item.kind), item.owner_type === "user" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Badge, {
1931
+ variant: "secondary",
1932
+ className: "px-1.5 py-0 text-[10px] leading-4",
1933
+ children: "My Media"
1934
+ })] }),
1935
+ onClick: () => navigate(`media/${item.id}`),
1936
+ trailing: canEdit && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MediaRowActionsMenu, { onDelete: () => setPendingDeleteId(item.id) })
1937
+ }, item.id);
1938
+ })
1943
1939
  })
1940
+ }),
1941
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialog, {
1942
+ open: pendingDeleteId !== null,
1943
+ onOpenChange: (open) => !open && setPendingDeleteId(null),
1944
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogContent, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogTitle, { children: "Delete this media?" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogDescription, { children: "This removes the item from your media library. Shared links that point to it will stop working." })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogCancel, {
1945
+ disabled: isDeleting,
1946
+ children: "Cancel"
1947
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogAction, {
1948
+ onClick: (e) => {
1949
+ e.preventDefault();
1950
+ confirmDelete();
1951
+ },
1952
+ disabled: isDeleting,
1953
+ className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1954
+ children: isDeleting ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Delete"
1955
+ })] })] })
1944
1956
  })
1945
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialog, {
1946
- open: pendingDeleteId !== null,
1947
- onOpenChange: (open) => !open && setPendingDeleteId(null),
1948
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogContent, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogTitle, { children: "Delete this media?" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogDescription, { children: "This removes the item from your media library. Shared links that point to it will stop working." })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogCancel, {
1949
- disabled: isDeleting,
1950
- children: "Cancel"
1951
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogAction, {
1952
- onClick: (e) => {
1953
- e.preventDefault();
1954
- confirmDelete();
1955
- },
1956
- disabled: isDeleting,
1957
- className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1958
- children: isDeleting ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Delete"
1959
- })] })] })
1960
- })] });
1957
+ ] });
1961
1958
  }
1962
1959
  //#endregion
1963
1960
  //#region ../../shareables/ui/src/components/SharePage/TaggedProductsList.tsx
@@ -2098,85 +2095,75 @@ function MediaDetailScreen({ mediaId, onNavigate, onBack }) {
2098
2095
  const displayImage = mediaItem?.image_url || "";
2099
2096
  const displayVideo = mediaItem?.video_url || "";
2100
2097
  const isVideo = mediaItem?.kind === "video" && !!displayVideo;
2101
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
2102
- className: "text-lg",
2103
- children: [
2104
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
2105
- href: "#",
2106
- onClick: (e) => {
2107
- e.preventDefault();
2108
- (onBack ?? (() => navigate("media")))();
2109
- },
2110
- children: "Media"
2111
- }) }),
2112
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
2113
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
2114
- className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]",
2115
- children: displayTitle || "Media"
2116
- }) })
2117
- ]
2118
- }) }), [
2119
- displayTitle,
2120
- onBack,
2121
- navigate
2122
- ]));
2123
- require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => {
2124
- if (readOnly || !mediaItem || mediaItem.owner_type !== "user") return null;
2125
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
2098
+ const badgeLabel = getBadgeLabel(mediaItem?.kind ?? null);
2099
+ const rawDescription = mediaItem?.description?.body || mediaItem?.stripped || "";
2100
+ const downloadUrl = isVideo ? displayVideo : mediaItem?.pdf_url || displayImage;
2101
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
2102
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
2103
+ className: "text-lg",
2104
+ children: [
2105
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
2106
+ href: "#",
2107
+ onClick: (e) => {
2108
+ e.preventDefault();
2109
+ (onBack ?? (() => navigate("media")))();
2110
+ },
2111
+ children: "Media"
2112
+ }) }),
2113
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
2114
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
2115
+ className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]",
2116
+ children: displayTitle || "Media"
2117
+ }) })
2118
+ ]
2119
+ }) }) }),
2120
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderActions, { children: readOnly || !mediaItem || mediaItem.owner_type !== "user" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
2126
2121
  size: "sm",
2127
2122
  variant: "outline",
2128
2123
  onClick: () => navigate(`media/${mediaId}/edit`),
2129
2124
  className: "flex items-center gap-1.5",
2130
2125
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pencil, { className: "h-3.5 w-3.5" }), "Edit"]
2131
- });
2132
- }, [
2133
- readOnly,
2134
- mediaItem,
2135
- navigate,
2136
- mediaId
2137
- ]));
2138
- const badgeLabel = getBadgeLabel(mediaItem?.kind ?? null);
2139
- const rawDescription = mediaItem?.description?.body || mediaItem?.stripped || "";
2140
- const downloadUrl = isVideo ? displayVideo : mediaItem?.pdf_url || displayImage;
2141
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableDetailLayout, {
2142
- isLoading,
2143
- notFound: !mediaItem,
2144
- notFoundMessage: "Media not found or failed to load.",
2145
- title: displayTitle,
2146
- description: rawDescription,
2147
- containerHeightClass: "md:h-[calc(95vh-140px)]",
2148
- image: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2149
- className: "relative h-full overflow-hidden",
2150
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SharePageImageDisplay, {
2151
- displayImage,
2126
+ }) }),
2127
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableDetailLayout, {
2128
+ isLoading,
2129
+ notFound: !mediaItem,
2130
+ notFoundMessage: "Media not found or failed to load.",
2131
+ title: displayTitle,
2132
+ description: rawDescription,
2133
+ containerHeightClass: "md:h-[calc(95vh-140px)]",
2134
+ image: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2135
+ className: "relative h-full overflow-hidden",
2136
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SharePageImageDisplay, {
2137
+ displayImage,
2138
+ displayTitle,
2139
+ displayVideo: isVideo ? displayVideo : void 0,
2140
+ isVideo,
2141
+ badgeLabel,
2142
+ rounded: true,
2143
+ showBadge: false
2144
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2145
+ className: "bg-background/80 text-foreground absolute top-3 right-3 z-0 inline-flex h-8 items-center rounded-full px-3 text-xs font-medium shadow-md backdrop-blur-sm",
2146
+ children: badgeLabel
2147
+ })]
2148
+ }),
2149
+ actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssetActions, {
2150
+ downloadUrl: downloadUrl || null,
2152
2151
  displayTitle,
2153
- displayVideo: isVideo ? displayVideo : void 0,
2152
+ shareLink: shareLinkError ? null : shareLink || null,
2153
+ shareLinkLoading,
2154
2154
  isVideo,
2155
- badgeLabel,
2156
- rounded: true,
2157
- showBadge: false
2158
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2159
- className: "bg-background/80 text-foreground absolute top-3 right-3 z-0 inline-flex h-8 items-center rounded-full px-3 text-xs font-medium shadow-md backdrop-blur-sm",
2160
- children: badgeLabel
2161
- })]
2162
- }),
2163
- actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssetActions, {
2164
- downloadUrl: downloadUrl || null,
2165
- displayTitle,
2166
- shareLink: shareLinkError ? null : shareLink || null,
2167
- shareLinkLoading,
2168
- isVideo,
2169
- relateableId: Number(mediaId),
2170
- relateableType: "Medium"
2171
- }),
2172
- children: taggedProducts.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Separator, { className: "bg-foreground my-4" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2173
- className: "bg-background rounded-lg",
2174
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaggedProductsList, {
2175
- products: taggedProducts,
2176
- onProductClick: (productId) => onNavigate?.("product", String(productId))
2177
- })
2178
- })] })
2179
- });
2155
+ relateableId: Number(mediaId),
2156
+ relateableType: "Medium"
2157
+ }),
2158
+ children: taggedProducts.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Separator, { className: "bg-foreground my-4" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2159
+ className: "bg-background rounded-lg",
2160
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaggedProductsList, {
2161
+ products: taggedProducts,
2162
+ onProductClick: (productId) => onNavigate?.("product", String(productId))
2163
+ })
2164
+ })] })
2165
+ })
2166
+ ] });
2180
2167
  }
2181
2168
  //#endregion
2182
2169
  //#region ../../file-picker/core/src/query-keys.ts
@@ -8765,42 +8752,47 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
8765
8752
  } };
8766
8753
  }, [filePickerApi, showToast]);
8767
8754
  const displayTitle = mediaItem?.title ?? "";
8768
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
8769
- className: "text-lg",
8770
- children: [
8771
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
8772
- href: "#",
8773
- onClick: (e) => {
8774
- e.preventDefault();
8775
- (onBack ?? (() => navigate("media")))();
8776
- },
8777
- children: "Media"
8778
- }) }),
8779
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
8780
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
8781
- href: "#",
8782
- onClick: (e) => {
8783
- e.preventDefault();
8784
- navigate(`media/${mediaId}`);
8785
- },
8786
- className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
8787
- children: displayTitle || "Media"
8788
- }) }),
8789
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
8790
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
8791
- className: "font-semibold",
8792
- children: "Edit"
8793
- }) })
8794
- ]
8795
- }) }), [
8796
- displayTitle,
8797
- onBack,
8798
- navigate,
8799
- mediaId
8800
- ]));
8801
- require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => {
8802
- if (readOnly || !mediaItem) return null;
8803
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8755
+ if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8756
+ className: "flex items-center justify-center py-16",
8757
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-8" })
8758
+ });
8759
+ if (!mediaItem) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8760
+ className: "flex flex-col items-center justify-center py-16",
8761
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8762
+ className: "text-destructive text-sm",
8763
+ children: "Media not found or failed to load."
8764
+ })
8765
+ });
8766
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
8767
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
8768
+ className: "text-lg",
8769
+ children: [
8770
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
8771
+ href: "#",
8772
+ onClick: (e) => {
8773
+ e.preventDefault();
8774
+ (onBack ?? (() => navigate("media")))();
8775
+ },
8776
+ children: "Media"
8777
+ }) }),
8778
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
8779
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
8780
+ href: "#",
8781
+ onClick: (e) => {
8782
+ e.preventDefault();
8783
+ navigate(`media/${mediaId}`);
8784
+ },
8785
+ className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
8786
+ children: displayTitle || "Media"
8787
+ }) }),
8788
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
8789
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
8790
+ className: "font-semibold",
8791
+ children: "Edit"
8792
+ }) })
8793
+ ]
8794
+ }) }) }),
8795
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderActions, { children: readOnly || !mediaItem ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8804
8796
  className: "flex items-center gap-2",
8805
8797
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuTrigger, {
8806
8798
  asChild: true,
@@ -8823,407 +8815,390 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
8823
8815
  size: "sm",
8824
8816
  children: isSaving ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Save"
8825
8817
  })]
8826
- });
8827
- }, [
8828
- readOnly,
8829
- mediaItem,
8830
- isDirty,
8831
- isSaving,
8832
- handleSave
8833
- ]));
8834
- if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8835
- className: "flex items-center justify-center py-16",
8836
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-8" })
8837
- });
8838
- if (!mediaItem) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8839
- className: "flex flex-col items-center justify-center py-16",
8840
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8841
- className: "text-destructive text-sm",
8842
- children: "Media not found or failed to load."
8843
- })
8844
- });
8845
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8846
- className: "flex flex-col gap-4 px-4 pt-4 pb-24 md:px-10 md:py-6",
8847
- children: [
8848
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8849
- className: "mx-auto flex w-full max-w-5xl items-center gap-3",
8850
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
8851
- className: "text-foreground text-xl font-semibold break-words",
8852
- children: editState.title || displayTitle || "Media"
8853
- })
8854
- }),
8855
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8856
- className: "mx-auto grid w-full max-w-5xl grid-cols-1 gap-6 md:grid-cols-[3fr_1fr]",
8857
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8858
- className: "space-y-6",
8859
- children: [
8860
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8861
- className: "border-border bg-card rounded-lg border p-4 md:p-5",
8862
- children: [
8863
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8864
- className: "mb-4 flex flex-wrap items-center justify-between gap-2",
8865
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
8866
- className: "text-foreground text-base font-semibold",
8867
- children: "Media"
8868
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8869
- className: "flex flex-wrap items-center gap-2",
8870
- children: [!readOnly && filePickerContextValue && filePickerApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
8871
- onClick: () => setIsPickerOpen(true),
8872
- variant: "outline",
8873
- size: "sm",
8874
- children: "Replace Media"
8875
- }), !readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
8876
- variant: "outline",
8877
- size: "sm",
8878
- onClick: () => setIsCtaModalOpen(true),
8879
- className: editState.ctaEnabled ? "border-primary text-primary" : "",
8880
- children: ["CTA Button: ", editState.ctaEnabled ? "On" : "Off"]
8881
- })]
8882
- })]
8883
- }),
8884
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CurrentMediaPreview, {
8885
- mediaItem,
8886
- pendingFileUrl: pendingMediaFile ? pendingMediaFile.file_url : null,
8887
- pendingKind: pendingMediaFile ? deriveUpdateFieldsFromResult(pendingMediaFile).kind : null
8888
- }),
8889
- (() => {
8890
- const pendingKind = pendingMediaFile ? deriveUpdateFieldsFromResult(pendingMediaFile).kind : null;
8891
- const rawContentFormat = mediaItem.content_format;
8892
- const effectiveKind = pendingKind ?? rawContentFormat ?? mediaItem.kind;
8893
- const effectiveVideoUrl = pendingKind === "video" ? pendingMediaFile?.file_url : mediaItem.video_url;
8894
- if (readOnly) return null;
8895
- if (effectiveKind === "video" && effectiveVideoUrl) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8896
- className: "border-border mt-4 border-t pt-4",
8897
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(VideoThumbnailSelector, {
8898
- videoUrl: effectiveVideoUrl,
8899
- thumbnailUrl: pendingThumbnail ?? mediaItem.image_url,
8900
- onThumbnailCaptured: async (blob) => {
8901
- if (!uploadThumbnail) {
8902
- showToast({
8903
- title: "Thumbnail capture is not available in this context",
8904
- type: "error"
8905
- });
8906
- return;
8907
- }
8908
- try {
8909
- setPendingThumbnail(await uploadThumbnail(blob, `thumbnail-${mediaId}.jpg`));
8910
- } catch (error) {
8911
- showToast({
8912
- title: "Failed to upload thumbnail",
8913
- type: "error",
8914
- error
8915
- });
8916
- }
8917
- },
8918
- onThumbnailSelected: () => setIsThumbnailPickerOpen(true)
8919
- }), pendingThumbnail && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8920
- className: "text-muted-foreground mt-1.5 text-xs",
8921
- children: "Pending — save to apply"
8818
+ }) }),
8819
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8820
+ className: "flex flex-col gap-4 px-4 pt-4 pb-24 md:px-10 md:py-6",
8821
+ children: [
8822
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8823
+ className: "mx-auto flex w-full max-w-5xl items-center gap-3",
8824
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
8825
+ className: "text-foreground text-xl font-semibold break-words",
8826
+ children: editState.title || displayTitle || "Media"
8827
+ })
8828
+ }),
8829
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8830
+ className: "mx-auto grid w-full max-w-5xl grid-cols-1 gap-6 md:grid-cols-[3fr_1fr]",
8831
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8832
+ className: "space-y-6",
8833
+ children: [
8834
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8835
+ className: "border-border bg-card rounded-lg border p-4 md:p-5",
8836
+ children: [
8837
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8838
+ className: "mb-4 flex flex-wrap items-center justify-between gap-2",
8839
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
8840
+ className: "text-foreground text-base font-semibold",
8841
+ children: "Media"
8842
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8843
+ className: "flex flex-wrap items-center gap-2",
8844
+ children: [!readOnly && filePickerContextValue && filePickerApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
8845
+ onClick: () => setIsPickerOpen(true),
8846
+ variant: "outline",
8847
+ size: "sm",
8848
+ children: "Replace Media"
8849
+ }), !readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
8850
+ variant: "outline",
8851
+ size: "sm",
8852
+ onClick: () => setIsCtaModalOpen(true),
8853
+ className: editState.ctaEnabled ? "border-primary text-primary" : "",
8854
+ children: ["CTA Button: ", editState.ctaEnabled ? "On" : "Off"]
8855
+ })]
8922
8856
  })]
8923
- });
8924
- if (effectiveKind === "pdf") {
8925
- const currentThumbnail = pendingThumbnail ?? mediaItem.image_url;
8926
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8857
+ }),
8858
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CurrentMediaPreview, {
8859
+ mediaItem,
8860
+ pendingFileUrl: pendingMediaFile ? pendingMediaFile.file_url : null,
8861
+ pendingKind: pendingMediaFile ? deriveUpdateFieldsFromResult(pendingMediaFile).kind : null
8862
+ }),
8863
+ (() => {
8864
+ const pendingKind = pendingMediaFile ? deriveUpdateFieldsFromResult(pendingMediaFile).kind : null;
8865
+ const rawContentFormat = mediaItem.content_format;
8866
+ const effectiveKind = pendingKind ?? rawContentFormat ?? mediaItem.kind;
8867
+ const effectiveVideoUrl = pendingKind === "video" ? pendingMediaFile?.file_url : mediaItem.video_url;
8868
+ if (readOnly) return null;
8869
+ if (effectiveKind === "video" && effectiveVideoUrl) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8927
8870
  className: "border-border mt-4 border-t pt-4",
8928
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8929
- className: "space-y-3",
8930
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
8931
- className: "text-foreground mb-1.5 block text-sm font-medium",
8932
- children: "Thumbnail"
8933
- }), currentThumbnail ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThumbnailWithMeta, {
8934
- src: currentThumbnail,
8935
- onReplace: () => setIsThumbnailPickerOpen(true)
8936
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8937
- className: "flex items-center gap-4",
8938
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8939
- className: "bg-muted flex h-28 w-48 shrink-0 items-center justify-center rounded-md border",
8940
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ImageIcon, { className: "text-muted-foreground h-8 w-8" })
8941
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8942
- className: "min-w-0 flex-1",
8943
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8944
- className: "text-muted-foreground mb-2 text-sm",
8945
- children: "No thumbnail set"
8946
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
8947
- variant: "outline",
8948
- size: "sm",
8949
- onClick: () => setIsThumbnailPickerOpen(true),
8950
- className: "gap-1.5",
8951
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ImageIcon, { className: "h-3.5 w-3.5" }), "Select New Image"]
8952
- })]
8953
- })]
8954
- })]
8871
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(VideoThumbnailSelector, {
8872
+ videoUrl: effectiveVideoUrl,
8873
+ thumbnailUrl: pendingThumbnail ?? mediaItem.image_url,
8874
+ onThumbnailCaptured: async (blob) => {
8875
+ if (!uploadThumbnail) {
8876
+ showToast({
8877
+ title: "Thumbnail capture is not available in this context",
8878
+ type: "error"
8879
+ });
8880
+ return;
8881
+ }
8882
+ try {
8883
+ setPendingThumbnail(await uploadThumbnail(blob, `thumbnail-${mediaId}.jpg`));
8884
+ } catch (error) {
8885
+ showToast({
8886
+ title: "Failed to upload thumbnail",
8887
+ type: "error",
8888
+ error
8889
+ });
8890
+ }
8891
+ },
8892
+ onThumbnailSelected: () => setIsThumbnailPickerOpen(true)
8955
8893
  }), pendingThumbnail && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8956
8894
  className: "text-muted-foreground mt-1.5 text-xs",
8957
8895
  children: "Pending — save to apply"
8958
8896
  })]
8959
8897
  });
8960
- }
8961
- return null;
8962
- })()
8963
- ]
8964
- }),
8965
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8966
- className: "border-border bg-card rounded-lg border p-4 md:p-5",
8967
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
8968
- className: "text-foreground mb-4 text-base font-semibold",
8969
- children: "Media Details"
8970
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8971
- className: "flex flex-col gap-4",
8972
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8973
- className: "flex flex-col gap-1.5",
8974
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Label, {
8975
- htmlFor: "media-title",
8976
- children: ["Title ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8977
- className: "text-destructive",
8978
- children: "*"
8979
- })]
8980
- }), readOnly ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8981
- className: "text-foreground text-sm",
8982
- children: displayTitle
8983
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
8984
- id: "media-title",
8985
- value: editState.title,
8986
- onChange: (e) => setEditState((s) => ({
8987
- ...s,
8988
- title: e.target.value
8989
- })),
8990
- placeholder: "Enter media title"
8991
- })]
8992
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8993
- className: "flex flex-col gap-1.5",
8994
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, { children: "Description" }), readOnly ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8995
- className: "text-foreground/70 text-sm leading-relaxed",
8996
- children: stripTags(editState.description)
8997
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RichTextEditor, {
8998
- value: editState.description,
8999
- onChange: (val) => setEditState((s) => ({
9000
- ...s,
9001
- description: val
9002
- })),
9003
- placeholder: "Start writing..."
9004
- })]
9005
- })]
9006
- })]
9007
- }),
9008
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MediaProductTagging, {
9009
- products: taggedProducts,
9010
- onAddProduct: async (productId) => {
9011
- if (!mediaProductsApi) return;
9012
- try {
9013
- await mediaProductsApi.addMediaProduct(Number(mediaId), { id: productId });
9014
- await refetchProducts();
9015
- } catch (error) {
9016
- showToast({
9017
- title: `Failed to add product: ${error instanceof Error ? error.message : "Unknown error"}`,
9018
- type: "error",
9019
- error
9020
- });
9021
- }
9022
- },
9023
- onRemoveProduct: async (productId) => {
9024
- if (!mediaProductsApi) return;
9025
- try {
9026
- await mediaProductsApi.removeMediaProduct(Number(mediaId), productId);
9027
- await refetchProducts();
9028
- } catch (error) {
9029
- showToast({
9030
- title: `Failed to remove product: ${error instanceof Error ? error.message : "Unknown error"}`,
9031
- type: "error",
9032
- error
9033
- });
9034
- }
9035
- },
9036
- onSearchProducts: searchProducts ?? (async () => ({
9037
- products: [],
9038
- nextCursor: null
9039
- })),
9040
- disabled: readOnly || !mediaProductsApi
9041
- })
9042
- ]
9043
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9044
- className: "space-y-6",
9045
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9046
- className: "border-border bg-card rounded-lg border p-4 md:p-5",
9047
- children: [
8898
+ if (effectiveKind === "pdf") {
8899
+ const currentThumbnail = pendingThumbnail ?? mediaItem.image_url;
8900
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8901
+ className: "border-border mt-4 border-t pt-4",
8902
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8903
+ className: "space-y-3",
8904
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
8905
+ className: "text-foreground mb-1.5 block text-sm font-medium",
8906
+ children: "Thumbnail"
8907
+ }), currentThumbnail ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThumbnailWithMeta, {
8908
+ src: currentThumbnail,
8909
+ onReplace: () => setIsThumbnailPickerOpen(true)
8910
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8911
+ className: "flex items-center gap-4",
8912
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8913
+ className: "bg-muted flex h-28 w-48 shrink-0 items-center justify-center rounded-md border",
8914
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ImageIcon, { className: "text-muted-foreground h-8 w-8" })
8915
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8916
+ className: "min-w-0 flex-1",
8917
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8918
+ className: "text-muted-foreground mb-2 text-sm",
8919
+ children: "No thumbnail set"
8920
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
8921
+ variant: "outline",
8922
+ size: "sm",
8923
+ onClick: () => setIsThumbnailPickerOpen(true),
8924
+ className: "gap-1.5",
8925
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ImageIcon, { className: "h-3.5 w-3.5" }), "Select New Image"]
8926
+ })]
8927
+ })]
8928
+ })]
8929
+ }), pendingThumbnail && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8930
+ className: "text-muted-foreground mt-1.5 text-xs",
8931
+ children: "Pending save to apply"
8932
+ })]
8933
+ });
8934
+ }
8935
+ return null;
8936
+ })()
8937
+ ]
8938
+ }),
9048
8939
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9049
- className: "mb-4 flex items-center justify-between",
8940
+ className: "border-border bg-card rounded-lg border p-4 md:p-5",
9050
8941
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
9051
- className: "text-foreground text-base font-semibold",
9052
- children: "SEO And Link Sharing"
9053
- }), !readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9054
- variant: "ghost",
9055
- size: "sm",
9056
- onClick: () => setSeoExpanded((prev) => !prev),
9057
- children: seoExpanded ? "Done" : "Edit"
9058
- })]
9059
- }),
9060
- (() => {
9061
- const seoThumbnailUrl = (pendingMediaFile ? deriveUpdateFieldsFromResult(pendingMediaFile) : null)?.image_url ?? pendingThumbnail ?? mediaItem?.image_url;
9062
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9063
- className: "bg-muted/40 border-border mb-4 rounded-md border p-3",
8942
+ className: "text-foreground mb-4 text-base font-semibold",
8943
+ children: "Media Details"
8944
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8945
+ className: "flex flex-col gap-4",
9064
8946
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9065
- className: "mb-2 flex items-center gap-2",
9066
- children: [seoThumbnailUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
9067
- src: seoThumbnailUrl,
9068
- alt: "SEO preview",
9069
- className: "h-8 w-8 shrink-0 rounded object-cover"
9070
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9071
- className: "bg-muted flex h-8 w-8 items-center justify-center rounded",
9072
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ImageIcon, { className: "text-muted-foreground h-4 w-4" })
9073
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9074
- className: "min-w-0 flex-1",
9075
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9076
- className: "text-foreground truncate text-xs font-medium",
9077
- children: editState.seoTitle || displayTitle || "Your page title"
9078
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9079
- className: "text-muted-foreground truncate text-xs",
9080
- children: mediaItem?.preview_link ?? mediaItem?.canonical_url ?? "yoursite.com/media/..."
9081
- })]
9082
- })]
9083
- }), editState.seoDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9084
- className: "text-muted-foreground line-clamp-2 text-xs",
9085
- children: editState.seoDescription
9086
- })]
9087
- });
9088
- })(),
9089
- seoExpanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9090
- className: "flex flex-col gap-4",
9091
- children: [
9092
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9093
8947
  className: "flex flex-col gap-1.5",
9094
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
9095
- htmlFor: "seo-title",
9096
- children: "SEO Title"
9097
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
9098
- id: "seo-title",
9099
- value: editState.seoTitle,
8948
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Label, {
8949
+ htmlFor: "media-title",
8950
+ children: ["Title ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8951
+ className: "text-destructive",
8952
+ children: "*"
8953
+ })]
8954
+ }), readOnly ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8955
+ className: "text-foreground text-sm",
8956
+ children: displayTitle
8957
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
8958
+ id: "media-title",
8959
+ value: editState.title,
9100
8960
  onChange: (e) => setEditState((s) => ({
9101
8961
  ...s,
9102
- seoTitle: e.target.value
8962
+ title: e.target.value
9103
8963
  })),
9104
- placeholder: "Page title for search engines"
8964
+ placeholder: "Enter media title"
9105
8965
  })]
9106
- }),
9107
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8966
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9108
8967
  className: "flex flex-col gap-1.5",
9109
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
9110
- htmlFor: "seo-description",
9111
- children: "SEO Description"
9112
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Textarea, {
9113
- id: "seo-description",
9114
- value: editState.seoDescription,
9115
- onChange: (e) => setEditState((s) => ({
8968
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, { children: "Description" }), readOnly ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8969
+ className: "text-foreground/70 text-sm leading-relaxed",
8970
+ children: stripTags(editState.description)
8971
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RichTextEditor, {
8972
+ value: editState.description,
8973
+ onChange: (val) => setEditState((s) => ({
9116
8974
  ...s,
9117
- seoDescription: e.target.value
8975
+ description: val
9118
8976
  })),
9119
- placeholder: "Description for search engines",
9120
- rows: 3
8977
+ placeholder: "Start writing..."
9121
8978
  })]
9122
- }),
9123
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9124
- className: "flex items-center justify-between gap-3",
8979
+ })]
8980
+ })]
8981
+ }),
8982
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MediaProductTagging, {
8983
+ products: taggedProducts,
8984
+ onAddProduct: async (productId) => {
8985
+ if (!mediaProductsApi) return;
8986
+ try {
8987
+ await mediaProductsApi.addMediaProduct(Number(mediaId), { id: productId });
8988
+ await refetchProducts();
8989
+ } catch (error) {
8990
+ showToast({
8991
+ title: `Failed to add product: ${error instanceof Error ? error.message : "Unknown error"}`,
8992
+ type: "error",
8993
+ error
8994
+ });
8995
+ }
8996
+ },
8997
+ onRemoveProduct: async (productId) => {
8998
+ if (!mediaProductsApi) return;
8999
+ try {
9000
+ await mediaProductsApi.removeMediaProduct(Number(mediaId), productId);
9001
+ await refetchProducts();
9002
+ } catch (error) {
9003
+ showToast({
9004
+ title: `Failed to remove product: ${error instanceof Error ? error.message : "Unknown error"}`,
9005
+ type: "error",
9006
+ error
9007
+ });
9008
+ }
9009
+ },
9010
+ onSearchProducts: searchProducts ?? (async () => ({
9011
+ products: [],
9012
+ nextCursor: null
9013
+ })),
9014
+ disabled: readOnly || !mediaProductsApi
9015
+ })
9016
+ ]
9017
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9018
+ className: "space-y-6",
9019
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9020
+ className: "border-border bg-card rounded-lg border p-4 md:p-5",
9021
+ children: [
9022
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9023
+ className: "mb-4 flex items-center justify-between",
9024
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
9025
+ className: "text-foreground text-base font-semibold",
9026
+ children: "SEO And Link Sharing"
9027
+ }), !readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9028
+ variant: "ghost",
9029
+ size: "sm",
9030
+ onClick: () => setSeoExpanded((prev) => !prev),
9031
+ children: seoExpanded ? "Done" : "Edit"
9032
+ })]
9033
+ }),
9034
+ (() => {
9035
+ const seoThumbnailUrl = (pendingMediaFile ? deriveUpdateFieldsFromResult(pendingMediaFile) : null)?.image_url ?? pendingThumbnail ?? mediaItem?.image_url;
9036
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9037
+ className: "bg-muted/40 border-border mb-4 rounded-md border p-3",
9125
9038
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9126
- className: "flex flex-col gap-0.5",
9127
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9128
- className: "text-foreground text-sm font-medium",
9129
- children: "Block Crawlers"
9130
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9131
- className: "text-muted-foreground text-xs",
9132
- children: "Prevent search engines from indexing"
9039
+ className: "mb-2 flex items-center gap-2",
9040
+ children: [seoThumbnailUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
9041
+ src: seoThumbnailUrl,
9042
+ alt: "SEO preview",
9043
+ className: "h-8 w-8 shrink-0 rounded object-cover"
9044
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9045
+ className: "bg-muted flex h-8 w-8 items-center justify-center rounded",
9046
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ImageIcon, { className: "text-muted-foreground h-4 w-4" })
9047
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9048
+ className: "min-w-0 flex-1",
9049
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9050
+ className: "text-foreground truncate text-xs font-medium",
9051
+ children: editState.seoTitle || displayTitle || "Your page title"
9052
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9053
+ className: "text-muted-foreground truncate text-xs",
9054
+ children: mediaItem?.preview_link ?? mediaItem?.canonical_url ?? "yoursite.com/media/..."
9055
+ })]
9133
9056
  })]
9134
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Switch, {
9135
- checked: editState.blockCrawler,
9136
- onCheckedChange: (checked) => setEditState((s) => ({
9137
- ...s,
9138
- blockCrawler: checked
9139
- })),
9140
- "aria-label": "Block search engine crawlers"
9057
+ }), editState.seoDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9058
+ className: "text-muted-foreground line-clamp-2 text-xs",
9059
+ children: editState.seoDescription
9141
9060
  })]
9142
- })
9143
- ]
9144
- })
9145
- ]
9146
- })
9147
- })]
9148
- }),
9149
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialog, {
9150
- open: isDeleteOpen,
9151
- onOpenChange: setIsDeleteOpen,
9152
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogContent, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogTitle, { children: "Delete Media" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogDescription, { children: [
9153
- "Are you sure you want to delete “",
9154
- displayTitle,
9155
- "”? This action cannot be undone."
9156
- ] })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogCancel, {
9157
- disabled: isDeleting,
9158
- children: "Cancel"
9159
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogAction, {
9160
- onClick: handleDelete,
9161
- disabled: isDeleting,
9162
- className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
9163
- children: isDeleting ? "Deleting..." : "Delete"
9164
- })] })] })
9165
- }),
9166
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CtaModal, {
9167
- open: isCtaModalOpen,
9168
- onOpenChange: setIsCtaModalOpen,
9169
- ctaEnabled: editState.ctaEnabled,
9170
- ctaType: editState.ctaType,
9171
- ctaButtonText: editState.ctaButtonText,
9172
- ctaUrl: editState.ctaUrl,
9173
- onDone: (ctaState) => {
9174
- setEditState((s) => ({
9175
- ...s,
9176
- ctaEnabled: ctaState.enabled,
9177
- ctaType: ctaState.type,
9178
- ctaButtonText: ctaState.buttonText,
9179
- ctaUrl: ctaState.url
9180
- }));
9181
- }
9182
- }),
9183
- filePickerContextValue && filePickerApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerApiProvider, {
9184
- api: filePickerApi,
9185
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerProvider, {
9186
- value: filePickerContextValue,
9187
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePicker, {
9188
- open: isPickerOpen,
9189
- onFilesSelected: handleFilesSelected,
9190
- onClose: () => setIsPickerOpen(false),
9191
- config: {
9192
- maxFiles: 1,
9193
- allowedMethods: [
9194
- "dam",
9195
- "upload",
9196
- "url"
9061
+ });
9062
+ })(),
9063
+ seoExpanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9064
+ className: "flex flex-col gap-4",
9065
+ children: [
9066
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9067
+ className: "flex flex-col gap-1.5",
9068
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
9069
+ htmlFor: "seo-title",
9070
+ children: "SEO Title"
9071
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
9072
+ id: "seo-title",
9073
+ value: editState.seoTitle,
9074
+ onChange: (e) => setEditState((s) => ({
9075
+ ...s,
9076
+ seoTitle: e.target.value
9077
+ })),
9078
+ placeholder: "Page title for search engines"
9079
+ })]
9080
+ }),
9081
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9082
+ className: "flex flex-col gap-1.5",
9083
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
9084
+ htmlFor: "seo-description",
9085
+ children: "SEO Description"
9086
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Textarea, {
9087
+ id: "seo-description",
9088
+ value: editState.seoDescription,
9089
+ onChange: (e) => setEditState((s) => ({
9090
+ ...s,
9091
+ seoDescription: e.target.value
9092
+ })),
9093
+ placeholder: "Description for search engines",
9094
+ rows: 3
9095
+ })]
9096
+ }),
9097
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9098
+ className: "flex items-center justify-between gap-3",
9099
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9100
+ className: "flex flex-col gap-0.5",
9101
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9102
+ className: "text-foreground text-sm font-medium",
9103
+ children: "Block Crawlers"
9104
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9105
+ className: "text-muted-foreground text-xs",
9106
+ children: "Prevent search engines from indexing"
9107
+ })]
9108
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Switch, {
9109
+ checked: editState.blockCrawler,
9110
+ onCheckedChange: (checked) => setEditState((s) => ({
9111
+ ...s,
9112
+ blockCrawler: checked
9113
+ })),
9114
+ "aria-label": "Block search engine crawlers"
9115
+ })]
9116
+ })
9117
+ ]
9118
+ })
9197
9119
  ]
9198
- }
9120
+ })
9121
+ })]
9122
+ }),
9123
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialog, {
9124
+ open: isDeleteOpen,
9125
+ onOpenChange: setIsDeleteOpen,
9126
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogContent, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogTitle, { children: "Delete Media" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogDescription, { children: [
9127
+ "Are you sure you want to delete “",
9128
+ displayTitle,
9129
+ "”? This action cannot be undone."
9130
+ ] })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogCancel, {
9131
+ disabled: isDeleting,
9132
+ children: "Cancel"
9133
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogAction, {
9134
+ onClick: handleDelete,
9135
+ disabled: isDeleting,
9136
+ className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
9137
+ children: isDeleting ? "Deleting..." : "Delete"
9138
+ })] })] })
9139
+ }),
9140
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CtaModal, {
9141
+ open: isCtaModalOpen,
9142
+ onOpenChange: setIsCtaModalOpen,
9143
+ ctaEnabled: editState.ctaEnabled,
9144
+ ctaType: editState.ctaType,
9145
+ ctaButtonText: editState.ctaButtonText,
9146
+ ctaUrl: editState.ctaUrl,
9147
+ onDone: (ctaState) => {
9148
+ setEditState((s) => ({
9149
+ ...s,
9150
+ ctaEnabled: ctaState.enabled,
9151
+ ctaType: ctaState.type,
9152
+ ctaButtonText: ctaState.buttonText,
9153
+ ctaUrl: ctaState.url
9154
+ }));
9155
+ }
9156
+ }),
9157
+ filePickerContextValue && filePickerApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerApiProvider, {
9158
+ api: filePickerApi,
9159
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerProvider, {
9160
+ value: filePickerContextValue,
9161
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePicker, {
9162
+ open: isPickerOpen,
9163
+ onFilesSelected: handleFilesSelected,
9164
+ onClose: () => setIsPickerOpen(false),
9165
+ config: {
9166
+ maxFiles: 1,
9167
+ allowedMethods: [
9168
+ "dam",
9169
+ "upload",
9170
+ "url"
9171
+ ]
9172
+ }
9173
+ })
9199
9174
  })
9200
- })
9201
- }),
9202
- filePickerContextValue && filePickerApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerApiProvider, {
9203
- api: filePickerApi,
9204
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerProvider, {
9205
- value: filePickerContextValue,
9206
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePicker, {
9207
- open: isThumbnailPickerOpen,
9208
- onFilesSelected: (results) => {
9209
- const result = results[0];
9210
- if (result) setPendingThumbnail(result.file_url);
9211
- setIsThumbnailPickerOpen(false);
9212
- },
9213
- onClose: () => setIsThumbnailPickerOpen(false),
9214
- config: {
9215
- maxFiles: 1,
9216
- allowedMethods: [
9217
- "dam",
9218
- "upload",
9219
- "url"
9220
- ]
9221
- }
9175
+ }),
9176
+ filePickerContextValue && filePickerApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerApiProvider, {
9177
+ api: filePickerApi,
9178
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerProvider, {
9179
+ value: filePickerContextValue,
9180
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePicker, {
9181
+ open: isThumbnailPickerOpen,
9182
+ onFilesSelected: (results) => {
9183
+ const result = results[0];
9184
+ if (result) setPendingThumbnail(result.file_url);
9185
+ setIsThumbnailPickerOpen(false);
9186
+ },
9187
+ onClose: () => setIsThumbnailPickerOpen(false),
9188
+ config: {
9189
+ maxFiles: 1,
9190
+ allowedMethods: [
9191
+ "dam",
9192
+ "upload",
9193
+ "url"
9194
+ ]
9195
+ }
9196
+ })
9222
9197
  })
9223
9198
  })
9224
- })
9225
- ]
9226
- });
9199
+ ]
9200
+ })
9201
+ ] });
9227
9202
  }
9228
9203
  //#endregion
9229
9204
  //#region ../../shareables/ui/src/components/screens/MediaCreateScreen.tsx
@@ -9268,24 +9243,6 @@ function FilePreview({ result, mediaType }) {
9268
9243
  function MediaCreateScreen({ onNavigate, onBack }) {
9269
9244
  const { navigate, showToast, filePickerApi } = useShareablesUI();
9270
9245
  const user = useShareablesUser();
9271
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
9272
- className: "text-lg",
9273
- children: [
9274
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
9275
- href: "#",
9276
- onClick: (e) => {
9277
- e.preventDefault();
9278
- (onBack ?? (() => navigate("media")))();
9279
- },
9280
- children: "Media"
9281
- }) }),
9282
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
9283
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
9284
- className: "font-semibold",
9285
- children: "New Media"
9286
- }) })
9287
- ]
9288
- }) }), [onBack, navigate]));
9289
9246
  const [title, setTitle] = (0, react.useState)("");
9290
9247
  const [description, setDescription] = (0, react.useState)("");
9291
9248
  const [active] = (0, react.useState)(true);
@@ -9372,12 +9329,6 @@ function MediaCreateScreen({ onNavigate, onBack }) {
9372
9329
  seoDescription,
9373
9330
  seoBlockCrawler
9374
9331
  ]);
9375
- require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9376
- onClick: handleSave,
9377
- disabled: isCreating,
9378
- size: "sm",
9379
- children: isCreating ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Save"
9380
- }), [handleSave, isCreating]));
9381
9332
  const handleFilesSelected = (0, react.useCallback)((results) => {
9382
9333
  const result = results[0];
9383
9334
  if (!result) return;
@@ -9400,222 +9351,248 @@ function MediaCreateScreen({ onNavigate, onBack }) {
9400
9351
  dismiss: () => {}
9401
9352
  } };
9402
9353
  }, [filePickerApi, showToast]);
9403
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9404
- className: "flex flex-col gap-4 px-4 py-4 md:px-10 md:py-6",
9405
- children: [
9406
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9407
- className: "mx-auto flex w-full max-w-5xl items-center gap-3",
9408
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
9409
- className: "text-foreground text-xl font-semibold",
9410
- children: title.trim() || "New Media"
9411
- })
9412
- }),
9413
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9414
- className: "mx-auto grid w-full max-w-5xl gap-6 md:grid-cols-[3fr_1fr]",
9415
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9416
- className: "space-y-6",
9354
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
9355
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
9356
+ className: "text-lg",
9357
+ children: [
9358
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
9359
+ href: "#",
9360
+ onClick: (e) => {
9361
+ e.preventDefault();
9362
+ (onBack ?? (() => navigate("media")))();
9363
+ },
9364
+ children: "Media"
9365
+ }) }),
9366
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
9367
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
9368
+ className: "font-semibold",
9369
+ children: "New Media"
9370
+ }) })
9371
+ ]
9372
+ }) }) }),
9373
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderActions, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9374
+ onClick: handleSave,
9375
+ disabled: isCreating,
9376
+ size: "sm",
9377
+ children: isCreating ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Save"
9378
+ }) }),
9379
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9380
+ className: "flex flex-col gap-4 px-4 py-4 md:px-10 md:py-6",
9381
+ children: [
9382
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9383
+ className: "mx-auto flex w-full max-w-5xl items-center gap-3",
9384
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
9385
+ className: "text-foreground text-xl font-semibold",
9386
+ children: title.trim() || "New Media"
9387
+ })
9388
+ }),
9389
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9390
+ className: "mx-auto grid w-full max-w-5xl gap-6 md:grid-cols-[3fr_1fr]",
9417
9391
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9418
- className: "border-border bg-card rounded-lg border p-5",
9392
+ className: "space-y-6",
9419
9393
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9420
- className: "mb-4 flex items-center justify-between",
9421
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
9422
- className: "text-foreground text-base font-semibold",
9423
- children: "Media"
9424
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9425
- className: "flex items-center gap-2",
9426
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9394
+ className: "border-border bg-card rounded-lg border p-5",
9395
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9396
+ className: "mb-4 flex items-center justify-between",
9397
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
9398
+ className: "text-foreground text-base font-semibold",
9399
+ children: "Media"
9400
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9401
+ className: "flex items-center gap-2",
9402
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9403
+ onClick: () => setIsPickerOpen(true),
9404
+ variant: "outline",
9405
+ size: "sm",
9406
+ disabled: !filePickerApi,
9407
+ children: "Select Media"
9408
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
9409
+ variant: "outline",
9410
+ size: "sm",
9411
+ onClick: () => setIsCtaModalOpen(true),
9412
+ className: ctaEnabled ? "border-primary text-primary" : "",
9413
+ children: ["CTA Button: ", ctaEnabled ? "On" : "Off"]
9414
+ })]
9415
+ })]
9416
+ }), selectedResult && mediaType ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9417
+ className: "flex flex-col gap-3",
9418
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePreview, {
9419
+ result: selectedResult,
9420
+ mediaType
9421
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9427
9422
  onClick: () => setIsPickerOpen(true),
9428
9423
  variant: "outline",
9429
9424
  size: "sm",
9430
- disabled: !filePickerApi,
9431
- children: "Select Media"
9432
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
9433
- variant: "outline",
9434
- size: "sm",
9435
- onClick: () => setIsCtaModalOpen(true),
9436
- className: ctaEnabled ? "border-primary text-primary" : "",
9437
- children: ["CTA Button: ", ctaEnabled ? "On" : "Off"]
9425
+ className: "w-fit",
9426
+ children: "Replace"
9438
9427
  })]
9439
- })]
9440
- }), selectedResult && mediaType ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9441
- className: "flex flex-col gap-3",
9442
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePreview, {
9443
- result: selectedResult,
9444
- mediaType
9445
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9428
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
9429
+ type: "button",
9446
9430
  onClick: () => setIsPickerOpen(true),
9447
- variant: "outline",
9448
- size: "sm",
9449
- className: "w-fit",
9450
- children: "Replace"
9451
- })]
9452
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
9453
- type: "button",
9454
- onClick: () => setIsPickerOpen(true),
9455
- disabled: !filePickerApi,
9456
- className: "border-border text-muted-foreground hover:bg-muted/30 flex h-40 w-full flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors disabled:cursor-not-allowed disabled:opacity-50",
9457
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Upload, { className: "h-6 w-6" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9458
- className: "text-sm",
9459
- children: "No media uploaded. Click to upload an image, video, or PDF."
9431
+ disabled: !filePickerApi,
9432
+ className: "border-border text-muted-foreground hover:bg-muted/30 flex h-40 w-full flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors disabled:cursor-not-allowed disabled:opacity-50",
9433
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Upload, { className: "h-6 w-6" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9434
+ className: "text-sm",
9435
+ children: "No media uploaded. Click to upload an image, video, or PDF."
9436
+ })]
9460
9437
  })]
9461
- })]
9462
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9463
- className: "border-border bg-card rounded-lg border p-5",
9464
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
9465
- className: "text-foreground mb-4 text-base font-semibold",
9466
- children: "Media Details"
9467
9438
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9468
- className: "flex flex-col gap-4",
9469
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9470
- className: "flex flex-col gap-1.5",
9471
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Label, {
9472
- htmlFor: "media-title",
9473
- children: ["Title ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9474
- className: "text-destructive",
9475
- children: "*"
9476
- })]
9477
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
9478
- id: "media-title",
9479
- value: title,
9480
- onChange: (e) => setTitle(e.target.value),
9481
- placeholder: "Enter media title",
9482
- required: true
9483
- })]
9439
+ className: "border-border bg-card rounded-lg border p-5",
9440
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
9441
+ className: "text-foreground mb-4 text-base font-semibold",
9442
+ children: "Media Details"
9484
9443
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9485
- className: "flex flex-col gap-1.5",
9486
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, { children: "Description" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RichTextEditor, {
9487
- value: description,
9488
- onChange: setDescription,
9489
- placeholder: "Start writing..."
9490
- })]
9491
- })]
9492
- })]
9493
- })]
9494
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9495
- className: "space-y-6",
9496
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9497
- className: "border-border bg-card rounded-lg border p-5",
9498
- children: [
9499
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9500
- className: "mb-4 flex items-center justify-between",
9501
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
9502
- className: "text-foreground text-base font-semibold",
9503
- children: "SEO And Link Sharing"
9504
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9505
- variant: "ghost",
9506
- size: "sm",
9507
- onClick: () => setSeoExpanded((prev) => !prev),
9508
- children: seoExpanded ? "Done" : "Edit"
9509
- })]
9510
- }),
9511
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9512
- className: "bg-muted/40 border-border mb-4 rounded-md border p-3",
9444
+ className: "flex flex-col gap-4",
9513
9445
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9514
- className: "mb-2 flex items-center gap-2",
9515
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9516
- className: "bg-muted flex h-8 w-8 items-center justify-center rounded",
9517
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ImageIcon, { className: "text-muted-foreground h-4 w-4" })
9518
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9519
- className: "min-w-0 flex-1",
9520
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9521
- className: "text-foreground truncate text-xs font-medium",
9522
- children: seoTitle || "Your page title"
9523
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9524
- className: "text-muted-foreground truncate text-xs",
9525
- children: "yoursite.com/media/..."
9446
+ className: "flex flex-col gap-1.5",
9447
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Label, {
9448
+ htmlFor: "media-title",
9449
+ children: ["Title ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9450
+ className: "text-destructive",
9451
+ children: "*"
9526
9452
  })]
9453
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
9454
+ id: "media-title",
9455
+ value: title,
9456
+ onChange: (e) => setTitle(e.target.value),
9457
+ placeholder: "Enter media title",
9458
+ required: true
9459
+ })]
9460
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9461
+ className: "flex flex-col gap-1.5",
9462
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, { children: "Description" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RichTextEditor, {
9463
+ value: description,
9464
+ onChange: setDescription,
9465
+ placeholder: "Start writing..."
9527
9466
  })]
9528
- }), seoDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9529
- className: "text-muted-foreground line-clamp-2 text-xs",
9530
- children: seoDescription
9531
9467
  })]
9532
- }),
9533
- seoExpanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9534
- className: "flex flex-col gap-4",
9535
- children: [
9536
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9537
- className: "flex flex-col gap-1.5",
9538
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
9539
- htmlFor: "seo-title",
9540
- children: "SEO Title"
9541
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
9542
- id: "seo-title",
9543
- value: seoTitle,
9544
- onChange: (e) => setSeoTitle(e.target.value),
9545
- placeholder: "Page title for search engines"
9546
- })]
9547
- }),
9548
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9549
- className: "flex flex-col gap-1.5",
9550
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
9551
- htmlFor: "seo-description",
9552
- children: "SEO Description"
9553
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Textarea, {
9554
- id: "seo-description",
9555
- value: seoDescription,
9556
- onChange: (e) => setSeoDescription(e.target.value),
9557
- placeholder: "Description for search engines",
9558
- rows: 3
9468
+ })]
9469
+ })]
9470
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9471
+ className: "space-y-6",
9472
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9473
+ className: "border-border bg-card rounded-lg border p-5",
9474
+ children: [
9475
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9476
+ className: "mb-4 flex items-center justify-between",
9477
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
9478
+ className: "text-foreground text-base font-semibold",
9479
+ children: "SEO And Link Sharing"
9480
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
9481
+ variant: "ghost",
9482
+ size: "sm",
9483
+ onClick: () => setSeoExpanded((prev) => !prev),
9484
+ children: seoExpanded ? "Done" : "Edit"
9485
+ })]
9486
+ }),
9487
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9488
+ className: "bg-muted/40 border-border mb-4 rounded-md border p-3",
9489
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9490
+ className: "mb-2 flex items-center gap-2",
9491
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9492
+ className: "bg-muted flex h-8 w-8 items-center justify-center rounded",
9493
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ImageIcon, { className: "text-muted-foreground h-4 w-4" })
9494
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9495
+ className: "min-w-0 flex-1",
9496
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9497
+ className: "text-foreground truncate text-xs font-medium",
9498
+ children: seoTitle || "Your page title"
9499
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9500
+ className: "text-muted-foreground truncate text-xs",
9501
+ children: "yoursite.com/media/..."
9502
+ })]
9559
9503
  })]
9560
- }),
9561
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9562
- className: "flex items-center justify-between gap-3",
9563
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9564
- className: "flex flex-col gap-0.5",
9565
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9566
- className: "text-foreground text-sm font-medium",
9567
- children: "Block Crawlers"
9568
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9569
- className: "text-muted-foreground text-xs",
9570
- children: "Prevent search engines from indexing"
9504
+ }), seoDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9505
+ className: "text-muted-foreground line-clamp-2 text-xs",
9506
+ children: seoDescription
9507
+ })]
9508
+ }),
9509
+ seoExpanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9510
+ className: "flex flex-col gap-4",
9511
+ children: [
9512
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9513
+ className: "flex flex-col gap-1.5",
9514
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
9515
+ htmlFor: "seo-title",
9516
+ children: "SEO Title"
9517
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
9518
+ id: "seo-title",
9519
+ value: seoTitle,
9520
+ onChange: (e) => setSeoTitle(e.target.value),
9521
+ placeholder: "Page title for search engines"
9522
+ })]
9523
+ }),
9524
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9525
+ className: "flex flex-col gap-1.5",
9526
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
9527
+ htmlFor: "seo-description",
9528
+ children: "SEO Description"
9529
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Textarea, {
9530
+ id: "seo-description",
9531
+ value: seoDescription,
9532
+ onChange: (e) => setSeoDescription(e.target.value),
9533
+ placeholder: "Description for search engines",
9534
+ rows: 3
9535
+ })]
9536
+ }),
9537
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9538
+ className: "flex items-center justify-between gap-3",
9539
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9540
+ className: "flex flex-col gap-0.5",
9541
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9542
+ className: "text-foreground text-sm font-medium",
9543
+ children: "Block Crawlers"
9544
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9545
+ className: "text-muted-foreground text-xs",
9546
+ children: "Prevent search engines from indexing"
9547
+ })]
9548
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Switch, {
9549
+ checked: seoBlockCrawler,
9550
+ onCheckedChange: setSeoBlockCrawler,
9551
+ "aria-label": "Block search engine crawlers"
9571
9552
  })]
9572
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Switch, {
9573
- checked: seoBlockCrawler,
9574
- onCheckedChange: setSeoBlockCrawler,
9575
- "aria-label": "Block search engine crawlers"
9576
- })]
9577
- })
9578
- ]
9579
- })
9580
- ]
9581
- })
9582
- })]
9583
- }),
9584
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CtaModal, {
9585
- open: isCtaModalOpen,
9586
- onOpenChange: setIsCtaModalOpen,
9587
- ctaEnabled,
9588
- ctaType,
9589
- ctaButtonText,
9590
- ctaUrl,
9591
- onDone: (ctaState) => {
9592
- setCtaEnabled(ctaState.enabled);
9593
- setCtaType(ctaState.type);
9594
- setCtaButtonText(ctaState.buttonText);
9595
- setCtaUrl(ctaState.url);
9596
- }
9597
- }),
9598
- filePickerContextValue && filePickerApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerApiProvider, {
9599
- api: filePickerApi,
9600
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerProvider, {
9601
- value: filePickerContextValue,
9602
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePicker, {
9603
- open: isPickerOpen,
9604
- onFilesSelected: handleFilesSelected,
9605
- onClose: () => setIsPickerOpen(false),
9606
- config: {
9607
- maxFiles: 1,
9608
- allowedMethods: [
9609
- "dam",
9610
- "upload",
9611
- "url"
9553
+ })
9554
+ ]
9555
+ })
9612
9556
  ]
9613
- }
9557
+ })
9558
+ })]
9559
+ }),
9560
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CtaModal, {
9561
+ open: isCtaModalOpen,
9562
+ onOpenChange: setIsCtaModalOpen,
9563
+ ctaEnabled,
9564
+ ctaType,
9565
+ ctaButtonText,
9566
+ ctaUrl,
9567
+ onDone: (ctaState) => {
9568
+ setCtaEnabled(ctaState.enabled);
9569
+ setCtaType(ctaState.type);
9570
+ setCtaButtonText(ctaState.buttonText);
9571
+ setCtaUrl(ctaState.url);
9572
+ }
9573
+ }),
9574
+ filePickerContextValue && filePickerApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerApiProvider, {
9575
+ api: filePickerApi,
9576
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerProvider, {
9577
+ value: filePickerContextValue,
9578
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePicker, {
9579
+ open: isPickerOpen,
9580
+ onFilesSelected: handleFilesSelected,
9581
+ onClose: () => setIsPickerOpen(false),
9582
+ config: {
9583
+ maxFiles: 1,
9584
+ allowedMethods: [
9585
+ "dam",
9586
+ "upload",
9587
+ "url"
9588
+ ]
9589
+ }
9590
+ })
9614
9591
  })
9615
9592
  })
9616
- })
9617
- ]
9618
- });
9593
+ ]
9594
+ })
9595
+ ] });
9619
9596
  }
9620
9597
  //#endregion
9621
9598
  //#region ../../shareables/ui/src/components/playlists/PlaylistCard.tsx
@@ -9765,18 +9742,6 @@ function PlaylistsListingScreen(_props) {
9765
9742
  const api = useShareablesApi();
9766
9743
  const { navigate, showToast, user, onToggleFavorite, onDeletePlaylist, readOnly } = useShareablesUI();
9767
9744
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
9768
- require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => readOnly ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
9769
- onClick: () => navigate("playlists/new"),
9770
- size: "sm",
9771
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "mr-1 h-4 w-4" }), "Create Playlist"]
9772
- }), [navigate, readOnly]));
9773
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
9774
- className: "text-lg",
9775
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
9776
- className: "font-semibold",
9777
- children: "Playlists"
9778
- }) })
9779
- }) }), []));
9780
9745
  const [searchTerm, setSearchTerm] = (0, react.useState)("");
9781
9746
  const [debouncedSearch, setDebouncedSearch] = (0, react.useState)("");
9782
9747
  const [sortValue, setSortValue] = (0, react.useState)("title");
@@ -9981,115 +9946,131 @@ function PlaylistsListingScreen(_props) {
9981
9946
  className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
9982
9947
  children: ["Error: ", error.message]
9983
9948
  })] });
9984
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
9985
- isLoading,
9986
- filters: filterBar,
9987
- isEmpty: filteredPlaylists.length === 0 && !isFetchingNextPage && !hasNextPage,
9988
- emptyMessage: getFilteredEmptyMessage({
9989
- searchTerm,
9990
- ownerFilter,
9991
- entityName: "playlists",
9992
- defaultMessage: "There are no playlists available at the moment."
9993
- }),
9994
- footer,
9995
- sentinelRef: observerTarget,
9996
- loadingFilterShape: "search-view",
9997
- children: viewMode === "grid" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9998
- className: GRID_CLASS,
9999
- children: filteredPlaylists.map((playlist) => {
10000
- const firstItem = playlist.items?.[0];
10001
- const imageUrl = playlist.image_url ?? firstItem?.image_url ?? firstItem?.relateable?.image_url ?? firstItem?.relateable?.compressed_image_url;
10002
- const itemCount = playlist.items_count ?? playlist.items?.length ?? 0;
10003
- const canEdit = !readOnly && playlist.user_id === user?.id;
10004
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlaylistCard, {
10005
- title: playlist.title || "Untitled Playlist",
10006
- imageUrl,
10007
- href: `playlists/${playlist.id}`,
10008
- itemCount,
10009
- isFavorited: playlist.is_favorited,
10010
- isSelectable: true,
10011
- isSelected: selectedIds.has(playlist.id),
10012
- canEdit,
10013
- onSelectionChange: (selected) => handleToggleSelection(playlist.id, selected),
10014
- onToggleFavorite: onToggleFavorite ? () => handleFavorite(playlist.id) : void 0,
10015
- onEdit: () => handleEdit(playlist.id),
10016
- onDelete: onDeletePlaylist ? () => setPendingDeleteId(playlist.id) : void 0
10017
- }, playlist.id);
10018
- })
10019
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
10020
- className: SHAREABLE_LIST_CLASS,
10021
- children: filteredPlaylists.map((playlist) => {
10022
- const firstItem = playlist.items?.[0];
10023
- const imageUrl = playlist.image_url ?? firstItem?.image_url ?? firstItem?.relateable?.image_url ?? firstItem?.relateable?.compressed_image_url;
10024
- const itemCount = playlist.items_count ?? playlist.items?.length ?? 0;
10025
- const canEdit = !readOnly && playlist.user_id === user?.id;
10026
- const isSelected = selectedIds.has(playlist.id);
10027
- const title = playlist.title || "Untitled Playlist";
10028
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListRow, {
10029
- imageUrl,
10030
- title,
10031
- subtitle: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Badge, {
10032
- variant: "secondary",
10033
- className: "px-1.5 py-0 text-[10px] leading-4",
10034
- children: [
10035
- itemCount,
10036
- " ",
10037
- itemCount === 1 ? "item" : "items"
10038
- ]
10039
- }),
10040
- onClick: () => navigate(`playlists/${playlist.id}`),
10041
- leading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Checkbox, {
10042
- checked: isSelected,
10043
- onCheckedChange: (checked) => handleToggleSelection(playlist.id, checked === true),
10044
- "aria-label": `Select ${title}`
10045
- }),
10046
- trailing: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [onToggleFavorite && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
10047
- type: "button",
10048
- onClick: () => handleFavorite(playlist.id),
10049
- "aria-label": playlist.is_favorited ? "Unfavorite" : "Favorite",
10050
- className: "hover:bg-muted-foreground/10 flex h-8 w-8 items-center justify-center rounded-md transition-colors",
10051
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Heart, { className: require_src.cn("h-4 w-4 transition-colors", playlist.is_favorited ? "fill-destructive text-destructive" : "text-muted-foreground") })
10052
- }), canEdit && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuTrigger, {
10053
- asChild: true,
10054
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
10055
- variant: "ghost",
10056
- size: "sm",
10057
- className: "h-8 w-8 p-0",
10058
- "aria-label": "Playlist actions",
10059
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MoreVertical, { className: "h-4 w-4" })
10060
- })
10061
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuContent, {
10062
- align: "end",
10063
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
10064
- onClick: () => handleEdit(playlist.id),
10065
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pencil, { className: "mr-2 h-4 w-4" }), "Edit"]
10066
- }), onDeletePlaylist && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuSeparator, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
10067
- variant: "destructive",
10068
- onClick: () => setPendingDeleteId(playlist.id),
10069
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Trash2, { className: "mr-2 h-4 w-4" }), "Delete"]
10070
- })] })]
10071
- })] })] })
10072
- }, playlist.id);
9949
+ const isEmpty = filteredPlaylists.length === 0 && !isFetchingNextPage && !hasNextPage;
9950
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
9951
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderActions, { children: readOnly ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
9952
+ onClick: () => navigate("playlists/new"),
9953
+ size: "sm",
9954
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "mr-1 h-4 w-4" }), "Create Playlist"]
9955
+ }) }),
9956
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
9957
+ className: "text-lg",
9958
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
9959
+ className: "font-semibold",
9960
+ children: "Playlists"
9961
+ }) })
9962
+ }) }) }),
9963
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
9964
+ isLoading,
9965
+ filters: filterBar,
9966
+ isEmpty,
9967
+ emptyMessage: getFilteredEmptyMessage({
9968
+ searchTerm,
9969
+ ownerFilter,
9970
+ entityName: "playlists",
9971
+ defaultMessage: "There are no playlists available at the moment."
9972
+ }),
9973
+ footer,
9974
+ sentinelRef: observerTarget,
9975
+ loadingFilterShape: "search-view",
9976
+ children: viewMode === "grid" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9977
+ className: GRID_CLASS,
9978
+ children: filteredPlaylists.map((playlist) => {
9979
+ const firstItem = playlist.items?.[0];
9980
+ const imageUrl = playlist.image_url ?? firstItem?.image_url ?? firstItem?.relateable?.image_url ?? firstItem?.relateable?.compressed_image_url;
9981
+ const itemCount = playlist.items_count ?? playlist.items?.length ?? 0;
9982
+ const canEdit = !readOnly && playlist.user_id === user?.id;
9983
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlaylistCard, {
9984
+ title: playlist.title || "Untitled Playlist",
9985
+ imageUrl,
9986
+ href: `playlists/${playlist.id}`,
9987
+ itemCount,
9988
+ isFavorited: playlist.is_favorited,
9989
+ isSelectable: true,
9990
+ isSelected: selectedIds.has(playlist.id),
9991
+ canEdit,
9992
+ onSelectionChange: (selected) => handleToggleSelection(playlist.id, selected),
9993
+ onToggleFavorite: onToggleFavorite ? () => handleFavorite(playlist.id) : void 0,
9994
+ onEdit: () => handleEdit(playlist.id),
9995
+ onDelete: onDeletePlaylist ? () => setPendingDeleteId(playlist.id) : void 0
9996
+ }, playlist.id);
9997
+ })
9998
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9999
+ className: SHAREABLE_LIST_CLASS,
10000
+ children: filteredPlaylists.map((playlist) => {
10001
+ const firstItem = playlist.items?.[0];
10002
+ const imageUrl = playlist.image_url ?? firstItem?.image_url ?? firstItem?.relateable?.image_url ?? firstItem?.relateable?.compressed_image_url;
10003
+ const itemCount = playlist.items_count ?? playlist.items?.length ?? 0;
10004
+ const canEdit = !readOnly && playlist.user_id === user?.id;
10005
+ const isSelected = selectedIds.has(playlist.id);
10006
+ const title = playlist.title || "Untitled Playlist";
10007
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListRow, {
10008
+ imageUrl,
10009
+ title,
10010
+ subtitle: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Badge, {
10011
+ variant: "secondary",
10012
+ className: "px-1.5 py-0 text-[10px] leading-4",
10013
+ children: [
10014
+ itemCount,
10015
+ " ",
10016
+ itemCount === 1 ? "item" : "items"
10017
+ ]
10018
+ }),
10019
+ onClick: () => navigate(`playlists/${playlist.id}`),
10020
+ leading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Checkbox, {
10021
+ checked: isSelected,
10022
+ onCheckedChange: (checked) => handleToggleSelection(playlist.id, checked === true),
10023
+ "aria-label": `Select ${title}`
10024
+ }),
10025
+ trailing: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [onToggleFavorite && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
10026
+ type: "button",
10027
+ onClick: () => handleFavorite(playlist.id),
10028
+ "aria-label": playlist.is_favorited ? "Unfavorite" : "Favorite",
10029
+ className: "hover:bg-muted-foreground/10 flex h-8 w-8 items-center justify-center rounded-md transition-colors",
10030
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Heart, { className: require_src.cn("h-4 w-4 transition-colors", playlist.is_favorited ? "fill-destructive text-destructive" : "text-muted-foreground") })
10031
+ }), canEdit && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuTrigger, {
10032
+ asChild: true,
10033
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
10034
+ variant: "ghost",
10035
+ size: "sm",
10036
+ className: "h-8 w-8 p-0",
10037
+ "aria-label": "Playlist actions",
10038
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MoreVertical, { className: "h-4 w-4" })
10039
+ })
10040
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuContent, {
10041
+ align: "end",
10042
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
10043
+ onClick: () => handleEdit(playlist.id),
10044
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pencil, { className: "mr-2 h-4 w-4" }), "Edit"]
10045
+ }), onDeletePlaylist && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuSeparator, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
10046
+ variant: "destructive",
10047
+ onClick: () => setPendingDeleteId(playlist.id),
10048
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Trash2, { className: "mr-2 h-4 w-4" }), "Delete"]
10049
+ })] })]
10050
+ })] })] })
10051
+ }, playlist.id);
10052
+ })
10073
10053
  })
10074
- })
10075
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialog, {
10076
- open: pendingDeleteId !== null,
10077
- onOpenChange: (open) => {
10078
- if (!open && !isDeleting) setPendingDeleteId(null);
10079
- },
10080
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogContent, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogTitle, { children: "Delete this playlist?" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogDescription, { children: "This removes the playlist from your library. Shared links that point to it will stop working." })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogCancel, {
10081
- disabled: isDeleting,
10082
- children: "Cancel"
10083
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogAction, {
10084
- onClick: (e) => {
10085
- e.preventDefault();
10086
- confirmDelete();
10054
+ }),
10055
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialog, {
10056
+ open: pendingDeleteId !== null,
10057
+ onOpenChange: (open) => {
10058
+ if (!open && !isDeleting) setPendingDeleteId(null);
10087
10059
  },
10088
- disabled: isDeleting,
10089
- className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
10090
- children: isDeleting ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Delete"
10091
- })] })] })
10092
- })] });
10060
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogContent, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogTitle, { children: "Delete this playlist?" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogDescription, { children: "This removes the playlist from your library. Shared links that point to it will stop working." })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogCancel, {
10061
+ disabled: isDeleting,
10062
+ children: "Cancel"
10063
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogAction, {
10064
+ onClick: (e) => {
10065
+ e.preventDefault();
10066
+ confirmDelete();
10067
+ },
10068
+ disabled: isDeleting,
10069
+ className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
10070
+ children: isDeleting ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Delete"
10071
+ })] })] })
10072
+ })
10073
+ ] });
10093
10074
  }
10094
10075
  //#endregion
10095
10076
  //#region ../../shareables/ui/src/constants.ts
@@ -10262,40 +10243,6 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
10262
10243
  const playlist = playlistResponse?.playlist;
10263
10244
  const canEdit = !readOnly && playlist?.user_id === user?.id;
10264
10245
  const displayTitle = playlist?.title || "";
10265
- require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => {
10266
- if (!canEdit) return null;
10267
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
10268
- className: "flex items-center gap-2",
10269
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
10270
- variant: "outline",
10271
- size: "sm",
10272
- onClick: () => navigate(`playlists/${playlistId}/edit`),
10273
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pencil, { className: "mr-1 h-3.5 w-3.5" }), "Edit"]
10274
- })
10275
- });
10276
- }, [
10277
- canEdit,
10278
- navigate,
10279
- playlistId
10280
- ]));
10281
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
10282
- className: "text-lg",
10283
- children: [
10284
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
10285
- href: "#",
10286
- onClick: (e) => {
10287
- e.preventDefault();
10288
- navigate("playlists");
10289
- },
10290
- children: "Playlists"
10291
- }) }),
10292
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
10293
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
10294
- className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]",
10295
- children: displayTitle || "Playlist"
10296
- }) })
10297
- ]
10298
- }) }), [displayTitle, navigate]));
10299
10246
  const taggedProducts = playlist?.items?.filter((item) => item.relateable_type === "Product" || item.relateable_type === "EnrollmentPack").map((item) => item.relateable).filter((p) => !!p) || [];
10300
10247
  const playableItems = playlist?.items?.filter((item) => item.relateable_type === "Medium" || item.relateable_type === "Page") ?? [];
10301
10248
  const selectedPlaylistItem = playableItems[selectedPlaylistItemIndex] ?? playableItems[0];
@@ -10304,49 +10251,78 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
10304
10251
  const selectedKind = selectedPlaylistItem?.kind ?? selectedPlaylistItem?.relateable?.kind;
10305
10252
  const displayVideo = selectedKind === "video" ? selectedPlaylistItem?.video_url ?? selectedPlaylistItem?.relateable?.video_url ?? void 0 : void 0;
10306
10253
  const isVideo = selectedKind === "video" && !!displayVideo;
10307
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ShareableDetailLayout, {
10308
- isLoading,
10309
- notFound: !playlist,
10310
- notFoundMessage: "Playlist not found or failed to load.",
10311
- title: displayTitle,
10312
- description: displayDescription,
10313
- image: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
10314
- className: "relative h-full overflow-hidden rounded-2xl",
10315
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SharePageImageDisplay, {
10316
- displayImage,
10254
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
10255
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderActions, { children: canEdit ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
10256
+ className: "flex items-center gap-2",
10257
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
10258
+ variant: "outline",
10259
+ size: "sm",
10260
+ onClick: () => navigate(`playlists/${playlistId}/edit`),
10261
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pencil, { className: "mr-1 h-3.5 w-3.5" }), "Edit"]
10262
+ })
10263
+ }) : null }),
10264
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
10265
+ className: "text-lg",
10266
+ children: [
10267
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
10268
+ href: "#",
10269
+ onClick: (e) => {
10270
+ e.preventDefault();
10271
+ navigate("playlists");
10272
+ },
10273
+ children: "Playlists"
10274
+ }) }),
10275
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
10276
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
10277
+ className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]",
10278
+ children: displayTitle || "Playlist"
10279
+ }) })
10280
+ ]
10281
+ }) }) }),
10282
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ShareableDetailLayout, {
10283
+ isLoading,
10284
+ notFound: !playlist,
10285
+ notFoundMessage: "Playlist not found or failed to load.",
10286
+ title: displayTitle,
10287
+ description: displayDescription,
10288
+ image: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
10289
+ className: "relative h-full overflow-hidden rounded-2xl",
10290
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SharePageImageDisplay, {
10291
+ displayImage,
10292
+ displayTitle,
10293
+ displayVideo,
10294
+ isVideo,
10295
+ badgeLabel: "Playlist"
10296
+ })
10297
+ }),
10298
+ actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssetActions, {
10299
+ downloadUrl: null,
10317
10300
  displayTitle,
10318
- displayVideo,
10301
+ shareLink: shareLinkError ? null : shareLink || null,
10302
+ shareLinkLoading,
10319
10303
  isVideo,
10320
- badgeLabel: "Playlist"
10321
- })
10322
- }),
10323
- actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssetActions, {
10324
- downloadUrl: null,
10325
- displayTitle,
10326
- shareLink: shareLinkError ? null : shareLink || null,
10327
- shareLinkLoading,
10328
- isVideo,
10329
- relateableId: Number(playlistId),
10330
- relateableType: "Library"
10331
- }),
10332
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Separator, { className: "border-foreground my-4" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10333
- className: "bg-background rounded-lg",
10334
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaggedProductsList, {
10335
- products: taggedProducts,
10336
- onProductClick: (productId) => onNavigate?.("product", String(productId))
10337
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlaylistItemsList, {
10338
- items: playableItems,
10339
- onSelectItem: setSelectedPlaylistItemIndex,
10340
- selectedItemIndex: selectedPlaylistItemIndex,
10341
- onNavigateToItem: (itemId, relateableType) => {
10342
- if (!NAVIGABLE_RELATEABLE_TYPES.has(relateableType ?? "")) return;
10343
- if (relateableType === "Product") onNavigate?.("product", String(itemId));
10344
- else if (relateableType === "Page") onNavigate?.("page", String(itemId));
10345
- else if (relateableType === "Medium") onNavigate?.("media", String(itemId));
10346
- }
10304
+ relateableId: Number(playlistId),
10305
+ relateableType: "Library"
10306
+ }),
10307
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Separator, { className: "border-foreground my-4" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10308
+ className: "bg-background rounded-lg",
10309
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaggedProductsList, {
10310
+ products: taggedProducts,
10311
+ onProductClick: (productId) => onNavigate?.("product", String(productId))
10312
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlaylistItemsList, {
10313
+ items: playableItems,
10314
+ onSelectItem: setSelectedPlaylistItemIndex,
10315
+ selectedItemIndex: selectedPlaylistItemIndex,
10316
+ onNavigateToItem: (itemId, relateableType) => {
10317
+ if (!NAVIGABLE_RELATEABLE_TYPES.has(relateableType ?? "")) return;
10318
+ if (relateableType === "Product") onNavigate?.("product", String(itemId));
10319
+ else if (relateableType === "Page") onNavigate?.("page", String(itemId));
10320
+ else if (relateableType === "Medium") onNavigate?.("media", String(itemId));
10321
+ }
10322
+ })]
10347
10323
  })]
10348
- })]
10349
- });
10324
+ })
10325
+ ] });
10350
10326
  }
10351
10327
  //#endregion
10352
10328
  //#region ../../shareables/ui/src/components/playlists/form/PlaylistFormProvider.tsx
@@ -10542,78 +10518,72 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
10542
10518
  setIsDeleteOpen(false);
10543
10519
  }
10544
10520
  };
10545
- require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10546
- className: "flex items-center gap-2",
10547
- children: [playlistId && onDeletePlaylist && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuTrigger, {
10548
- asChild: true,
10549
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
10550
- variant: "outline",
10521
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
10522
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderActions, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10523
+ className: "flex items-center gap-2",
10524
+ children: [playlistId && onDeletePlaylist && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuTrigger, {
10525
+ asChild: true,
10526
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
10527
+ variant: "outline",
10528
+ size: "sm",
10529
+ className: "h-8 w-8 p-0",
10530
+ "aria-label": "Playlist actions",
10531
+ disabled: isMutating,
10532
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MoreVertical, { className: "h-4 w-4" })
10533
+ })
10534
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuContent, {
10535
+ align: "end",
10536
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
10537
+ onClick: () => setIsDeleteOpen(true),
10538
+ className: "text-destructive focus:text-destructive",
10539
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Trash2, { className: "mr-2 h-4 w-4" }), "Delete"]
10540
+ })
10541
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
10542
+ onClick: () => {
10543
+ onSubmit().catch(() => {});
10544
+ },
10545
+ disabled: isMutating || !isDirty || !isFormValid,
10551
10546
  size: "sm",
10552
- className: "h-8 w-8 p-0",
10553
- "aria-label": "Playlist actions",
10554
- disabled: isMutating,
10555
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MoreVertical, { className: "h-4 w-4" })
10556
- })
10557
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuContent, {
10558
- align: "end",
10559
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
10560
- onClick: () => setIsDeleteOpen(true),
10561
- className: "text-destructive focus:text-destructive",
10562
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Trash2, { className: "mr-2 h-4 w-4" }), "Delete"]
10563
- })
10564
- })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
10565
- onClick: () => {
10566
- onSubmit().catch(() => {});
10547
+ children: isSaving ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Save"
10548
+ })]
10549
+ }) }),
10550
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
10551
+ className: "text-lg",
10552
+ children: [
10553
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
10554
+ href: "#",
10555
+ onClick: (e) => {
10556
+ e.preventDefault();
10557
+ navigate("playlists");
10558
+ },
10559
+ children: "Playlists"
10560
+ }) }),
10561
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
10562
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
10563
+ className: "font-semibold",
10564
+ children: isEditMode ? "Edit Playlist" : "New Playlist"
10565
+ }) })
10566
+ ]
10567
+ }) }) }),
10568
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialog, {
10569
+ open: isDeleteOpen,
10570
+ onOpenChange: (open) => {
10571
+ if (!open && !isDeleting) setIsDeleteOpen(false);
10567
10572
  },
10568
- disabled: isMutating || !isDirty || !isFormValid,
10569
- size: "sm",
10570
- children: isSaving ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Save"
10571
- })]
10572
- }), [
10573
- playlistId,
10574
- onDeletePlaylist,
10575
- isMutating,
10576
- isDirty,
10577
- isFormValid,
10578
- isSaving,
10579
- onSubmit
10580
- ]));
10581
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
10582
- className: "text-lg",
10583
- children: [
10584
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
10585
- href: "#",
10573
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogContent, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogTitle, { children: "Delete this playlist?" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogDescription, { children: "This removes the playlist from your library. Shared links that point to it will stop working." })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogCancel, {
10574
+ disabled: isDeleting,
10575
+ children: "Cancel"
10576
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogAction, {
10586
10577
  onClick: (e) => {
10587
10578
  e.preventDefault();
10588
- navigate("playlists");
10579
+ handleDelete();
10589
10580
  },
10590
- children: "Playlists"
10591
- }) }),
10592
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
10593
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
10594
- className: "font-semibold",
10595
- children: isEditMode ? "Edit Playlist" : "New Playlist"
10596
- }) })
10597
- ]
10598
- }) }), [isEditMode, navigate]));
10599
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialog, {
10600
- open: isDeleteOpen,
10601
- onOpenChange: (open) => {
10602
- if (!open && !isDeleting) setIsDeleteOpen(false);
10603
- },
10604
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogContent, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogTitle, { children: "Delete this playlist?" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogDescription, { children: "This removes the playlist from your library. Shared links that point to it will stop working." })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.AlertDialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogCancel, {
10605
- disabled: isDeleting,
10606
- children: "Cancel"
10607
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.AlertDialogAction, {
10608
- onClick: (e) => {
10609
- e.preventDefault();
10610
- handleDelete();
10611
- },
10612
- disabled: isDeleting,
10613
- className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
10614
- children: isDeleting ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Delete"
10615
- })] })] })
10616
- });
10581
+ disabled: isDeleting,
10582
+ className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
10583
+ children: isDeleting ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Spinner, { className: "size-4" }) : "Delete"
10584
+ })] })] })
10585
+ })
10586
+ ] });
10617
10587
  }
10618
10588
  //#endregion
10619
10589
  //#region ../../shareables/ui/src/components/playlists/form/PlaylistFormDetails.tsx
@@ -11300,42 +11270,6 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
11300
11270
  const { form, updateField, validateForm } = usePlaylistForm();
11301
11271
  const playlistTitle = form.title || "";
11302
11272
  const slugValue = form.slug ?? "";
11303
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
11304
- className: "text-lg",
11305
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
11306
- href: "#",
11307
- onClick: (e) => {
11308
- e.preventDefault();
11309
- (onBack ?? (() => navigate("playlists")))();
11310
- },
11311
- children: "Playlists"
11312
- }) }), isEditMode ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
11313
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
11314
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
11315
- href: "#",
11316
- onClick: (e) => {
11317
- e.preventDefault();
11318
- navigate(`playlists/${playlistId}`);
11319
- },
11320
- className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
11321
- children: playlistTitle || "Playlist"
11322
- }) }),
11323
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
11324
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
11325
- className: "font-semibold",
11326
- children: "Edit"
11327
- }) })
11328
- ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
11329
- className: "font-semibold",
11330
- children: "New Playlist"
11331
- }) })] })]
11332
- }) }), [
11333
- isEditMode,
11334
- playlistTitle,
11335
- onBack,
11336
- navigate,
11337
- playlistId
11338
- ]));
11339
11273
  (0, react.useEffect)(() => {
11340
11274
  const isCustomSlug = form.custom_slug || playlist?.custom_slug || false;
11341
11275
  if (playlistTitle && !isCustomSlug) {
@@ -11462,6 +11396,36 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
11462
11396
  await onSaveForm();
11463
11397
  };
11464
11398
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
11399
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
11400
+ className: "text-lg",
11401
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
11402
+ href: "#",
11403
+ onClick: (e) => {
11404
+ e.preventDefault();
11405
+ (onBack ?? (() => navigate("playlists")))();
11406
+ },
11407
+ children: "Playlists"
11408
+ }) }), isEditMode ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
11409
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
11410
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
11411
+ href: "#",
11412
+ onClick: (e) => {
11413
+ e.preventDefault();
11414
+ navigate(`playlists/${playlistId}`);
11415
+ },
11416
+ className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
11417
+ children: playlistTitle || "Playlist"
11418
+ }) }),
11419
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}),
11420
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
11421
+ className: "font-semibold",
11422
+ children: "Edit"
11423
+ }) })
11424
+ ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
11425
+ className: "font-semibold",
11426
+ children: "New Playlist"
11427
+ }) })] })]
11428
+ }) }) }),
11465
11429
  renderHeaderSlot?.({
11466
11430
  onSubmit: handleSubmit,
11467
11431
  isSaving,
@@ -11537,13 +11501,6 @@ const DEFAULT_IMAGE$1 = "https://assets.fluid.app/fluid-admin/images/we-commerce
11537
11501
  function FilesListingScreen({ onNavigate }) {
11538
11502
  const api = useShareablesApi();
11539
11503
  const renderImage = useRenderImage();
11540
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
11541
- className: "text-lg",
11542
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
11543
- className: "font-semibold",
11544
- children: "Files"
11545
- }) })
11546
- }) }), []));
11547
11504
  const [searchTerm, setSearchTerm] = (0, react.useState)("");
11548
11505
  const [debouncedSearch, setDebouncedSearch] = (0, react.useState)("");
11549
11506
  (0, react.useEffect)(() => {
@@ -11581,7 +11538,13 @@ function FilesListingScreen({ onNavigate }) {
11581
11538
  className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
11582
11539
  children: "Failed to load files. Please try again."
11583
11540
  })] });
11584
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
11541
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
11542
+ className: "text-lg",
11543
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
11544
+ className: "font-semibold",
11545
+ children: "Files"
11546
+ }) })
11547
+ }) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
11585
11548
  isLoading,
11586
11549
  isEmpty: !error && files.length === 0 && !isFetchingNextPage && !hasNextPage,
11587
11550
  emptyMessage: debouncedSearch ? `No files match "${debouncedSearch}". Try a different search term.` : "No files available.",
@@ -11649,7 +11612,7 @@ function FilesListingScreen({ onNavigate }) {
11649
11612
  }, file.id);
11650
11613
  })
11651
11614
  })
11652
- });
11615
+ })] });
11653
11616
  }
11654
11617
  //#endregion
11655
11618
  //#region ../../shareables/ui/src/components/screens/PagesListingScreen.tsx
@@ -11661,13 +11624,6 @@ function toApiSort(value) {
11661
11624
  function PagesListingScreen({ onNavigate }) {
11662
11625
  const api = useShareablesApi();
11663
11626
  const renderImage = useRenderImage();
11664
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
11665
- className: "text-lg",
11666
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
11667
- className: "font-semibold",
11668
- children: "Pages"
11669
- }) })
11670
- }) }), []));
11671
11627
  const [searchTerm, setSearchTerm] = (0, react.useState)("");
11672
11628
  const [debouncedSearch, setDebouncedSearch] = (0, react.useState)("");
11673
11629
  const [sortValue, setSortValue] = (0, react.useState)("newest");
@@ -11711,7 +11667,13 @@ function PagesListingScreen({ onNavigate }) {
11711
11667
  hasNextPage,
11712
11668
  isFetchingNextPage
11713
11669
  ]);
11714
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
11670
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbList, {
11671
+ className: "text-lg",
11672
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
11673
+ className: "font-semibold",
11674
+ children: "Pages"
11675
+ }) })
11676
+ }) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableListLayout, {
11715
11677
  isLoading,
11716
11678
  error,
11717
11679
  errorMessage: "Failed to load pages. Please try again.",
@@ -11790,7 +11752,7 @@ function PagesListingScreen({ onNavigate }) {
11790
11752
  }, page.id);
11791
11753
  })
11792
11754
  })
11793
- });
11755
+ })] });
11794
11756
  }
11795
11757
  //#endregion
11796
11758
  //#region ../../shareables/ui/src/components/screens/PageDetailScreen.tsx
@@ -11809,7 +11771,7 @@ function PageDetailScreen({ pageId, onBack }) {
11809
11771
  id: page?.id,
11810
11772
  share_link: pageResponse?.share_link ?? void 0
11811
11773
  }, "Page");
11812
- require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
11774
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenHeaderContext.ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
11813
11775
  className: "text-lg",
11814
11776
  children: [
11815
11777
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
@@ -11826,12 +11788,7 @@ function PageDetailScreen({ pageId, onBack }) {
11826
11788
  children: displayTitle || "Page"
11827
11789
  }) })
11828
11790
  ]
11829
- }) }), [
11830
- displayTitle,
11831
- onBack,
11832
- navigate
11833
- ]));
11834
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableDetailLayout, {
11791
+ }) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareableDetailLayout, {
11835
11792
  isLoading,
11836
11793
  notFound: !page && !isLoading,
11837
11794
  notFoundMessage: "Page not found or failed to load.",
@@ -11862,7 +11819,7 @@ function PageDetailScreen({ pageId, onBack }) {
11862
11819
  relateableId: page.id,
11863
11820
  relateableType: "Page"
11864
11821
  })
11865
- });
11822
+ })] });
11866
11823
  }
11867
11824
  //#endregion
11868
11825
  //#region ../../shareables/ui/src/components/ShareablesApp.tsx
@@ -13497,4 +13454,4 @@ Object.defineProperty(exports, "shareablesScreenPropertySchema", {
13497
13454
  }
13498
13455
  });
13499
13456
 
13500
- //# sourceMappingURL=ShareablesScreen-DwxcReCu.cjs.map
13457
+ //# sourceMappingURL=ShareablesScreen-C6pCPvmx.cjs.map