@fluid-app/portal-sdk 0.1.225 → 0.1.227

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 (56) hide show
  1. package/dist/{FluidProvider-CNzpDHOR.mjs → FluidProvider-1ny2_ye-.mjs} +43 -13
  2. package/dist/FluidProvider-1ny2_ye-.mjs.map +1 -0
  3. package/dist/{FluidProvider-DCna582u.cjs → FluidProvider-Bl8BC3N1.cjs} +43 -13
  4. package/dist/FluidProvider-Bl8BC3N1.cjs.map +1 -0
  5. package/dist/{MessagingScreen-DEt_lPGS.mjs → MessagingScreen-7VQtzmmg.mjs} +2 -2
  6. package/dist/{MessagingScreen-DEt_lPGS.mjs.map → MessagingScreen-7VQtzmmg.mjs.map} +1 -1
  7. package/dist/{MessagingScreen-BM-65fSe.cjs → MessagingScreen-BbCJ4ctF.cjs} +2 -2
  8. package/dist/{MessagingScreen-7pdCGDsA.cjs → MessagingScreen-CF2894Tr.cjs} +2 -2
  9. package/dist/{MessagingScreen-7pdCGDsA.cjs.map → MessagingScreen-CF2894Tr.cjs.map} +1 -1
  10. package/dist/{OrdersScreen-Dq-pg4aQ.cjs → OrdersScreen-BPrt9kNr.cjs} +2 -2
  11. package/dist/{OrdersScreen-Dq-pg4aQ.cjs.map → OrdersScreen-BPrt9kNr.cjs.map} +1 -1
  12. package/dist/{OrdersScreen-Dj_Bavxl.mjs → OrdersScreen-YWHy3VBL.mjs} +2 -2
  13. package/dist/{OrdersScreen-Dj_Bavxl.mjs.map → OrdersScreen-YWHy3VBL.mjs.map} +1 -1
  14. package/dist/{OrdersScreen-KG2SEc8_.cjs → OrdersScreen-knd6gnEi.cjs} +1 -1
  15. package/dist/{PortalProductsApiProvider-DzjO6yix.cjs → PortalProductsApiProvider-Bb5B1Hv5.cjs} +4 -4
  16. package/dist/{PortalProductsApiProvider-DzjO6yix.cjs.map → PortalProductsApiProvider-Bb5B1Hv5.cjs.map} +1 -1
  17. package/dist/{PortalProductsApiProvider-hhff3ssp.mjs → PortalProductsApiProvider-BeCWFRtF.mjs} +4 -4
  18. package/dist/PortalProductsApiProvider-BeCWFRtF.mjs.map +1 -0
  19. package/dist/{ProfileScreen-BUbLVaHH.mjs → ProfileScreen-BOvOpIS1.mjs} +2 -2
  20. package/dist/{ProfileScreen-BUbLVaHH.mjs.map → ProfileScreen-BOvOpIS1.mjs.map} +1 -1
  21. package/dist/{ProfileScreen-CRvTYZjQ.cjs → ProfileScreen-BT-SOUnq.cjs} +2 -2
  22. package/dist/{ProfileScreen-DQ4ahKtv.cjs → ProfileScreen-DE6Rrw23.cjs} +2 -2
  23. package/dist/{ProfileScreen-DQ4ahKtv.cjs.map → ProfileScreen-DE6Rrw23.cjs.map} +1 -1
  24. package/dist/{ShareablesScreen-DtR0PfSD.cjs → ShareablesScreen-AMlPuFFk.cjs} +328 -36
  25. package/dist/ShareablesScreen-AMlPuFFk.cjs.map +1 -0
  26. package/dist/{ShareablesScreen-DyaGwSlk.mjs → ShareablesScreen-CNARhXTE.mjs} +328 -36
  27. package/dist/ShareablesScreen-CNARhXTE.mjs.map +1 -0
  28. package/dist/{ShareablesScreen-C3JkUXfG.cjs → ShareablesScreen-DyGQ-Yo_.cjs} +2 -2
  29. package/dist/{ShopScreen-C8V_QlfB.mjs → ShopScreen-CJcGSrG4.mjs} +3 -3
  30. package/dist/{ShopScreen-C8V_QlfB.mjs.map → ShopScreen-CJcGSrG4.mjs.map} +1 -1
  31. package/dist/{ShopScreen-D_YIIi47.cjs → ShopScreen-IQ3tqLfP.cjs} +3 -3
  32. package/dist/{ShopScreen-_2S-9SvE.cjs → ShopScreen-yZUXE55P.cjs} +3 -3
  33. package/dist/{ShopScreen-_2S-9SvE.cjs.map → ShopScreen-yZUXE55P.cjs.map} +1 -1
  34. package/dist/{SubscriptionsScreen-CzqiU3hv.cjs → SubscriptionsScreen-BsOdTfJQ.cjs} +2 -2
  35. package/dist/{SubscriptionsScreen-CzqiU3hv.cjs.map → SubscriptionsScreen-BsOdTfJQ.cjs.map} +1 -1
  36. package/dist/{SubscriptionsScreen-BI5KiZX5.cjs → SubscriptionsScreen-CISCXowf.cjs} +1 -1
  37. package/dist/{SubscriptionsScreen-Bj_MwfT2.mjs → SubscriptionsScreen-mUaEWHn5.mjs} +2 -2
  38. package/dist/{SubscriptionsScreen-Bj_MwfT2.mjs.map → SubscriptionsScreen-mUaEWHn5.mjs.map} +1 -1
  39. package/dist/index.cjs +29 -20
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.mjs +29 -20
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/{portal_tenant-D6sxwKfH.mjs → portal_tenant-CFngP8OD.mjs} +10 -10
  44. package/dist/{portal_tenant-Dczq4fXP.cjs.map → portal_tenant-CFngP8OD.mjs.map} +1 -1
  45. package/dist/{portal_tenant-Dczq4fXP.cjs → portal_tenant-GpShCvG9.cjs} +17 -17
  46. package/dist/{portal_tenant-D6sxwKfH.mjs.map → portal_tenant-GpShCvG9.cjs.map} +1 -1
  47. package/dist/{portal_tenant_content-Da1Vvf0I.cjs → portal_tenant_content-Bnr0IyhM.cjs} +41 -25
  48. package/dist/{portal_tenant_content-CiwLspiV.mjs.map → portal_tenant_content-Bnr0IyhM.cjs.map} +1 -1
  49. package/dist/{portal_tenant_content-CiwLspiV.mjs → portal_tenant_content-WBAKi5Vl.mjs} +24 -14
  50. package/dist/{portal_tenant_content-Da1Vvf0I.cjs.map → portal_tenant_content-WBAKi5Vl.mjs.map} +1 -1
  51. package/package.json +12 -12
  52. package/dist/FluidProvider-CNzpDHOR.mjs.map +0 -1
  53. package/dist/FluidProvider-DCna582u.cjs.map +0 -1
  54. package/dist/PortalProductsApiProvider-hhff3ssp.mjs.map +0 -1
  55. package/dist/ShareablesScreen-DtR0PfSD.cjs.map +0 -1
  56. package/dist/ShareablesScreen-DyaGwSlk.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { r as __exportAll, t as useDropzone } from "./es-BkP8gyWU.mjs";
2
- import { A as playlists_show, C as playlists_create, D as playlists_items_remove, E as playlists_items_list, M as shares_create, N as shares_list, O as playlists_items_reorder, T as playlists_items_add, _ as media_products_add, a as content_playlists_metrics_share_visits, b as media_show, c as dam_asset_paths_list, d as dam_assets_discard, f as dam_assets_list, g as media_list, h as media_destroy, i as content_pages_metrics_visits, j as playlists_update, k as playlists_list, l as dam_assets_create, m as media_create, n as content_media_metrics_visits, o as content_playlists_metrics_visits, p as dam_query, r as content_pages_metrics_share_visits, s as dam_asset_paths_create, t as content_media_metrics_share_visits, u as dam_assets_destroy, v as media_products_list, w as playlists_destroy, x as media_update, y as media_products_remove } from "./portal_tenant_content-CiwLspiV.mjs";
2
+ import { A as playlists_list, C as pages_show, D as playlists_items_list, E as playlists_items_add, M as playlists_update, N as shares_create, O as playlists_items_remove, P as shares_list, S as pages_list, T as playlists_destroy, _ as media_products_add, a as content_playlists_by_shares, b as media_show, c as dam_asset_paths_list, d as dam_assets_discard, f as dam_assets_list, g as media_list, h as media_destroy, i as content_pages_by_visits, j as playlists_show, k as playlists_items_reorder, l as dam_assets_create, m as media_create, n as content_media_by_visits, o as content_playlists_by_visits, p as dam_query, r as content_pages_by_shares, s as dam_asset_paths_create, t as content_media_by_shares, u as dam_assets_destroy, v as media_products_list, w as playlists_create, x as media_update, y as media_products_remove } from "./portal_tenant_content-WBAKi5Vl.mjs";
3
3
  import { n as usePortalTenantClient } from "./PortalTenantClientProvider-CjJzBCTL.mjs";
4
4
  import { $ as DropdownMenuSeparator, A as Select, At as Checkbox, B as Form, C as Skeleton, Cn as AlertDialogFooter, Dn as Content, En as Button, Et as CardContent, G as FormMessage, H as FormField, J as DropdownMenuContent, K as Label, L as Input, M as SelectItem, N as SelectTrigger, Nn as useZodForm, P as SelectValue, Pn as cn, S as Slider, Sn as AlertDialogDescription, Tn as AlertDialogTitle, U as FormItem, V as FormControl, W as FormLabel, Y as DropdownMenuItem, _ as Switch, b as fluidToast, bn as AlertDialogCancel, c as Tabs, cn as Breadcrumb, dn as BreadcrumbList, dt as DialogPortal, et as DropdownMenuSub, fn as BreadcrumbPage, ft as DialogTitle, ht as PopoverTrigger, i as TooltipTrigger, it as Dialog, j as SelectContent, k as Separator, l as TabsList, ln as BreadcrumbItem, lt as DialogHeader, mn as Badge, mt as PopoverContent, n as TooltipContent, nt as DropdownMenuSubTrigger, ot as DialogContent, pn as BreadcrumbSeparator, pt as Popover, q as DropdownMenu, r as TooltipProvider, rt as DropdownMenuTrigger, s as Textarea, st as DialogDescription, t as Tooltip, tt as DropdownMenuSubContent, u as TabsTrigger, un as BreadcrumbLink, ut as DialogOverlay, vn as AlertDialog, wn as AlertDialogHeader, wt as Card, xn as AlertDialogContent, y as Spinner, yn as AlertDialogAction } from "./src-CCqVyAdS.mjs";
5
5
  import { n as useScreenHeaderActions, r as useScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-4WYXIqQ5.mjs";
@@ -10,7 +10,7 @@ import { a as useEditor, o as Placeholder, r as EditorContent, t as StarterKit }
10
10
  import { t as SearchSort } from "./SearchSort-BQ-nf9gJ.mjs";
11
11
  import { n as TextAlign, t as Underline } from "./dist-CsNsoBdu.mjs";
12
12
  import { a as verticalListSortingStrategy, c as PointerSensor, d as useSensors, f as CSS, i as useSortable, l as closestCenter, n as arrayMove, o as DndContext, p as PORTAL_MYSITE_KEYS, r as sortableKeyboardCoordinates, s as KeyboardSensor, t as SortableContext, u as useSensor } from "./sortable.esm-BSpvRpWg.mjs";
13
- import { o as usePortalProductsApi, t as PortalProductsApiProvider } from "./PortalProductsApiProvider-hhff3ssp.mjs";
13
+ import { o as usePortalProductsApi, t as PortalProductsApiProvider } from "./PortalProductsApiProvider-BeCWFRtF.mjs";
14
14
  import React, { PureComponent, createContext, createRef, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
15
15
  import { keepPreviousData, useInfiniteQuery, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
16
16
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -67,6 +67,20 @@ const shareablesKeys = {
67
67
  id
68
68
  ]
69
69
  },
70
+ pages: {
71
+ all: ["pages"],
72
+ list: (search, sort) => [
73
+ "pages",
74
+ "list",
75
+ search,
76
+ sort
77
+ ],
78
+ detail: (id) => [
79
+ "pages",
80
+ "detail",
81
+ id
82
+ ]
83
+ },
70
84
  productMedia: {
71
85
  all: ["productMedia"],
72
86
  counts: (ids) => [
@@ -456,7 +470,7 @@ async function getProduct(client, id, options) {
456
470
  }
457
471
  //#endregion
458
472
  //#region ../../shareables/ui/src/components/MediaShare/ShareItemCard.tsx
459
- const DEFAULT_IMAGE$5 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
473
+ const DEFAULT_IMAGE$6 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
460
474
  function ShareItemCard({ title, imageUrl, href, badge, isVideo = false, subtitle = "Click to find shareable assets" }) {
461
475
  const { navigate } = useShareablesUI();
462
476
  const renderImage = useRenderImage();
@@ -478,7 +492,7 @@ function ShareItemCard({ title, imageUrl, href, badge, isVideo = false, subtitle
478
492
  className: "bg-muted relative aspect-square overflow-hidden rounded-lg",
479
493
  children: [
480
494
  renderImage({
481
- src: imageUrl || DEFAULT_IMAGE$5,
495
+ src: imageUrl || DEFAULT_IMAGE$6,
482
496
  alt: title,
483
497
  fill: true,
484
498
  className: "object-cover transition-transform group-hover:scale-105"
@@ -676,7 +690,7 @@ function ToggleButton({ active, label, onClick, children }) {
676
690
  }
677
691
  //#endregion
678
692
  //#region ../../shareables/ui/src/components/screens/ProductsScreen.tsx
679
- const PAGE_SIZE$4 = 24;
693
+ const PAGE_SIZE$5 = 24;
680
694
  const SORT_OPTIONS$1 = [
681
695
  {
682
696
  label: "Newest",
@@ -729,11 +743,11 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
729
743
  queryKey: [
730
744
  "portal-product-catalog",
731
745
  debouncedSearch || "",
732
- PAGE_SIZE$4,
746
+ PAGE_SIZE$5,
733
747
  effectiveSort
734
748
  ],
735
749
  queryFn: async ({ pageParam }) => {
736
- return fetchPortalProducts(debouncedSearch, pageParam, PAGE_SIZE$4, effectiveSort);
750
+ return fetchPortalProducts(debouncedSearch, pageParam, PAGE_SIZE$5, effectiveSort);
737
751
  },
738
752
  getNextPageParam: (lastPage) => lastPage.meta?.pagination?.next_cursor ?? void 0,
739
753
  initialPageParam: void 0,
@@ -749,7 +763,7 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
749
763
  if (!client) throw new Error("Unreachable: client is null");
750
764
  return (await listProducts(client, {
751
765
  page: pageParam,
752
- per_page: PAGE_SIZE$4,
766
+ per_page: PAGE_SIZE$5,
753
767
  search_query: debouncedSearch || void 0,
754
768
  sorting: {
755
769
  id: "title",
@@ -760,7 +774,7 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
760
774
  published_stores: ["rep"]
761
775
  })).products;
762
776
  },
763
- getNextPageParam: (lastPage, allPages) => lastPage.length === PAGE_SIZE$4 ? allPages.length + 1 : void 0,
777
+ getNextPageParam: (lastPage, allPages) => lastPage.length === PAGE_SIZE$5 ? allPages.length + 1 : void 0,
764
778
  initialPageParam: 1,
765
779
  enabled: !fetchPortalProducts && !!client
766
780
  });
@@ -1631,7 +1645,7 @@ function OwnerFilterTabs({ value, onValueChange, myLabel = "Mine" }) {
1631
1645
  }
1632
1646
  //#endregion
1633
1647
  //#region ../../shareables/ui/src/components/screens/MediaListingScreen.tsx
1634
- const PAGE_SIZE$3 = 24;
1648
+ const PAGE_SIZE$4 = 24;
1635
1649
  function getMediaKindLabel(kind) {
1636
1650
  switch (kind) {
1637
1651
  case "video": return "Video";
@@ -1731,7 +1745,7 @@ function MediaListingScreen(_props) {
1731
1745
  "filter[title]": debouncedSearch || void 0,
1732
1746
  "filter[content_format]": bffKind,
1733
1747
  "page[cursor]": pageParam,
1734
- "page[limit]": PAGE_SIZE$3,
1748
+ "page[limit]": PAGE_SIZE$4,
1735
1749
  sort: bffSort
1736
1750
  });
1737
1751
  },
@@ -7026,7 +7040,7 @@ function RichTextEditor({ value, onChange, placeholder = "Start writing...", cla
7026
7040
  }
7027
7041
  //#endregion
7028
7042
  //#region ../../shareables/ui/src/components/media/MediaProductTagging.tsx
7029
- const PAGE_SIZE$2 = 25;
7043
+ const PAGE_SIZE$3 = 25;
7030
7044
  function ProductImage({ imageUrl, name }) {
7031
7045
  const [errored, setErrored] = useState(false);
7032
7046
  if (imageUrl && imageUrl.length > 0 && !errored) return /* @__PURE__ */ jsx("img", {
@@ -7060,7 +7074,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
7060
7074
  const runSearch = useCallback(async (q) => {
7061
7075
  setSearching(true);
7062
7076
  try {
7063
- const { products: results, nextCursor: cursor } = await onSearchProducts(q, { limit: PAGE_SIZE$2 });
7077
+ const { products: results, nextCursor: cursor } = await onSearchProducts(q, { limit: PAGE_SIZE$3 });
7064
7078
  setSearchResults(results);
7065
7079
  setNextCursor(cursor ?? null);
7066
7080
  } catch (error) {
@@ -7081,7 +7095,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
7081
7095
  try {
7082
7096
  const { products: results, nextCursor: cursor } = await onSearchProducts(query, {
7083
7097
  cursor: nextCursor,
7084
- limit: PAGE_SIZE$2
7098
+ limit: PAGE_SIZE$3
7085
7099
  });
7086
7100
  setSearchResults((prev) => [...prev, ...results]);
7087
7101
  setNextCursor(cursor ?? null);
@@ -8855,7 +8869,7 @@ function MediaCreateScreen({ onNavigate, onBack }) {
8855
8869
  }
8856
8870
  //#endregion
8857
8871
  //#region ../../shareables/ui/src/components/playlists/PlaylistCard.tsx
8858
- const DEFAULT_IMAGE$4 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
8872
+ const DEFAULT_IMAGE$5 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
8859
8873
  function PlaylistCard({ title, imageUrl, href, itemCount, isFavorited = false, isSelectable = false, isSelected = false, canEdit = false, onSelectionChange, onToggleFavorite, onEdit, onDelete }) {
8860
8874
  const { navigate } = useShareablesUI();
8861
8875
  const renderImage = useRenderImage();
@@ -8880,7 +8894,7 @@ function PlaylistCard({ title, imageUrl, href, itemCount, isFavorited = false, i
8880
8894
  className: "bg-muted relative aspect-square overflow-hidden rounded-lg",
8881
8895
  children: [
8882
8896
  renderImage({
8883
- src: imgError ? DEFAULT_IMAGE$4 : imageUrl || DEFAULT_IMAGE$4,
8897
+ src: imgError ? DEFAULT_IMAGE$5 : imageUrl || DEFAULT_IMAGE$5,
8884
8898
  alt: title,
8885
8899
  fill: true,
8886
8900
  className: "object-cover transition-transform group-hover:scale-105",
@@ -8995,7 +9009,7 @@ function BulkSelectionBar({ selectedCount, totalCount, onSelectAll, onClearSelec
8995
9009
  }
8996
9010
  //#endregion
8997
9011
  //#region ../../shareables/ui/src/components/screens/PlaylistsListingScreen.tsx
8998
- const PAGE_SIZE$1 = 12;
9012
+ const PAGE_SIZE$2 = 12;
8999
9013
  const GRID_CLASS = "grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4";
9000
9014
  function PlaylistsListingScreen(_props) {
9001
9015
  const api = useShareablesApi();
@@ -9040,7 +9054,7 @@ function PlaylistsListingScreen(_props) {
9040
9054
  const response = await api.playlists.getPlaylists({
9041
9055
  "filter[title]": debouncedSearch || void 0,
9042
9056
  "page[cursor]": pageParam,
9043
- "page[limit]": PAGE_SIZE$1,
9057
+ "page[limit]": PAGE_SIZE$2,
9044
9058
  sort: sortValue
9045
9059
  });
9046
9060
  return {
@@ -9349,7 +9363,7 @@ const NAVIGABLE_RELATEABLE_TYPES = new Set([
9349
9363
  ]);
9350
9364
  //#endregion
9351
9365
  //#region ../../shareables/ui/src/components/SharePage/TaggedProductsList.tsx
9352
- const DEFAULT_IMAGE$3 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
9366
+ const DEFAULT_IMAGE$4 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
9353
9367
  function resolvePrice(product) {
9354
9368
  let price = product.display_price || product.price;
9355
9369
  if (product.variants && product.variants.length > 0) {
@@ -9416,7 +9430,7 @@ function TaggedProductsList({ products, onProductClick }) {
9416
9430
  children: /* @__PURE__ */ jsx("div", {
9417
9431
  className: "scrollbar-none flex gap-4 overflow-x-auto pb-2",
9418
9432
  children: products.map((product, index) => {
9419
- const imageUrl = product.images?.[0]?.image_url || product.image_url || product.compressed_image_url || DEFAULT_IMAGE$3;
9433
+ const imageUrl = product.images?.[0]?.image_url || product.image_url || product.compressed_image_url || DEFAULT_IMAGE$4;
9420
9434
  const title = product.title || "Untitled";
9421
9435
  const displayPrice = resolvePrice(product);
9422
9436
  return /* @__PURE__ */ jsxs("button", {
@@ -9451,7 +9465,7 @@ function TaggedProductsList({ products, onProductClick }) {
9451
9465
  }
9452
9466
  //#endregion
9453
9467
  //#region ../../shareables/ui/src/components/SharePage/PlaylistItemsList.tsx
9454
- const DEFAULT_IMAGE$2 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
9468
+ const DEFAULT_IMAGE$3 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
9455
9469
  function getItemType(type, kind) {
9456
9470
  if (type === "Product") return "Product";
9457
9471
  if (type === "EnrollmentPack") return "Enrollment";
@@ -9509,7 +9523,7 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
9509
9523
  className: "space-y-3",
9510
9524
  children: items.map((item, index) => {
9511
9525
  const relateable = item.relateable;
9512
- const imageUrl = item.image_url ?? relateable?.image_url ?? relateable?.compressed_image_url ?? DEFAULT_IMAGE$2;
9526
+ const imageUrl = item.image_url ?? relateable?.image_url ?? relateable?.compressed_image_url ?? DEFAULT_IMAGE$3;
9513
9527
  const title = item.title ?? relateable?.title ?? "Untitled";
9514
9528
  const rawPrice = relateable?.display_price || relateable?.price;
9515
9529
  const price = rawPrice && parseFloat(rawPrice.replace(/[^0-9.-]/g, "")) > 0 ? rawPrice : null;
@@ -9600,7 +9614,7 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
9600
9614
  }
9601
9615
  //#endregion
9602
9616
  //#region ../../shareables/ui/src/components/screens/PlaylistDetailScreen.tsx
9603
- const DEFAULT_IMAGE$1 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
9617
+ const DEFAULT_IMAGE$2 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
9604
9618
  function PlaylistDetailScreen({ playlistId, onNavigate }) {
9605
9619
  const api = useShareablesApi();
9606
9620
  const { navigate, user, readOnly } = useShareablesUI();
@@ -9648,7 +9662,7 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
9648
9662
  ]
9649
9663
  }) }), [displayTitle, navigate]));
9650
9664
  const selectedPlaylistItem = playlist?.items?.[selectedPlaylistItemIndex];
9651
- const displayImage = selectedPlaylistItem?.image_url ?? selectedPlaylistItem?.relateable?.image_url ?? selectedPlaylistItem?.relateable?.compressed_image_url ?? DEFAULT_IMAGE$1;
9665
+ const displayImage = selectedPlaylistItem?.image_url ?? selectedPlaylistItem?.relateable?.image_url ?? selectedPlaylistItem?.relateable?.compressed_image_url ?? DEFAULT_IMAGE$2;
9652
9666
  const displayDescription = playlist?.description || playlist?.search_engine_optimizer?.description || "";
9653
9667
  const selectedKind = selectedPlaylistItem?.kind ?? selectedPlaylistItem?.relateable?.kind;
9654
9668
  const displayVideo = selectedKind === "video" ? selectedPlaylistItem?.video_url ?? selectedPlaylistItem?.relateable?.video_url ?? void 0 : void 0;
@@ -10787,14 +10801,14 @@ function PlaylistCreateScreen({ playlistId, onBack, hideHeader, renderHeaderSlot
10787
10801
  }
10788
10802
  //#endregion
10789
10803
  //#region ../../shareables/ui/src/components/screens/FilesListingScreen.tsx
10790
- const PAGE_SIZE = 24;
10804
+ const PAGE_SIZE$1 = 24;
10791
10805
  function formatFileSize(bytes) {
10792
10806
  if (bytes < 1024) return `${bytes} B`;
10793
10807
  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
10794
10808
  if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
10795
10809
  return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
10796
10810
  }
10797
- const DEFAULT_IMAGE = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
10811
+ const DEFAULT_IMAGE$1 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
10798
10812
  function FilesListingScreen({ onNavigate }) {
10799
10813
  const api = useShareablesApi();
10800
10814
  const renderImage = useRenderImage();
@@ -10820,7 +10834,7 @@ function FilesListingScreen({ onNavigate }) {
10820
10834
  return await api.fileResources.getFileResources({
10821
10835
  search_query: debouncedSearch || void 0,
10822
10836
  pageParam: pageParam.toString(),
10823
- pageSize: PAGE_SIZE.toString()
10837
+ pageSize: PAGE_SIZE$1.toString()
10824
10838
  });
10825
10839
  },
10826
10840
  getNextPageParam: (lastPage) => {
@@ -10889,7 +10903,7 @@ function FilesListingScreen({ onNavigate }) {
10889
10903
  className: "bg-muted relative aspect-square overflow-hidden rounded-lg",
10890
10904
  children: [
10891
10905
  renderImage({
10892
- src: file.preview_image_url || DEFAULT_IMAGE,
10906
+ src: file.preview_image_url || DEFAULT_IMAGE$1,
10893
10907
  alt: file.filename || "Untitled File",
10894
10908
  fill: true,
10895
10909
  className: "object-cover transition-transform group-hover:scale-105"
@@ -10923,6 +10937,219 @@ function FilesListingScreen({ onNavigate }) {
10923
10937
  });
10924
10938
  }
10925
10939
  //#endregion
10940
+ //#region ../../shareables/ui/src/components/screens/PagesListingScreen.tsx
10941
+ const PAGE_SIZE = 24;
10942
+ const DEFAULT_IMAGE = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
10943
+ function toApiSort(value) {
10944
+ return value === "newest" ? void 0 : value;
10945
+ }
10946
+ function PagesListingScreen({ onNavigate }) {
10947
+ const api = useShareablesApi();
10948
+ const renderImage = useRenderImage();
10949
+ useScreenHeaderBreadcrumbs(useMemo(() => /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, {
10950
+ className: "text-lg",
10951
+ children: /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
10952
+ className: "font-semibold",
10953
+ children: "Pages"
10954
+ }) })
10955
+ }) }), []));
10956
+ const [searchTerm, setSearchTerm] = useState("");
10957
+ const [debouncedSearch, setDebouncedSearch] = useState("");
10958
+ const [sortValue, setSortValue] = useState("newest");
10959
+ const observerTarget = useRef(null);
10960
+ useEffect(() => {
10961
+ const timer = setTimeout(() => setDebouncedSearch(searchTerm), 300);
10962
+ return () => clearTimeout(timer);
10963
+ }, [searchTerm]);
10964
+ const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage, error } = useInfiniteQuery({
10965
+ queryKey: shareablesKeys.pages.list(debouncedSearch, sortValue),
10966
+ queryFn: async ({ pageParam }) => {
10967
+ const response = await api.pages.listPages({
10968
+ cursor: pageParam,
10969
+ limit: PAGE_SIZE,
10970
+ "filter[title]": debouncedSearch || void 0,
10971
+ sort: toApiSort(sortValue)
10972
+ });
10973
+ return {
10974
+ pages: response.pages,
10975
+ nextCursor: response.meta.pagination?.next_cursor ?? null
10976
+ };
10977
+ },
10978
+ getNextPageParam: (lastPage) => lastPage.nextCursor ?? void 0,
10979
+ initialPageParam: void 0,
10980
+ placeholderData: keepPreviousData
10981
+ });
10982
+ const allPages = useMemo(() => data?.pages.flatMap((p) => p.pages) ?? [], [data?.pages]);
10983
+ useEffect(() => {
10984
+ const target = observerTarget.current;
10985
+ if (!target) return;
10986
+ const observer = new IntersectionObserver((entries) => {
10987
+ if (entries[0]?.isIntersecting && hasNextPage && !isFetchingNextPage) fetchNextPage();
10988
+ }, {
10989
+ threshold: 0,
10990
+ rootMargin: "200px"
10991
+ });
10992
+ observer.observe(target);
10993
+ return () => observer.disconnect();
10994
+ }, [
10995
+ fetchNextPage,
10996
+ hasNextPage,
10997
+ isFetchingNextPage
10998
+ ]);
10999
+ return /* @__PURE__ */ jsx(ShareableListLayout, {
11000
+ isLoading,
11001
+ error,
11002
+ errorMessage: "Failed to load pages. Please try again.",
11003
+ isEmpty: allPages.length === 0 && !isFetchingNextPage,
11004
+ emptyMessage: debouncedSearch ? `No pages match "${debouncedSearch}". Try a different search term.` : "No pages available.",
11005
+ filters: /* @__PURE__ */ jsx("div", {
11006
+ className: "flex justify-end",
11007
+ children: /* @__PURE__ */ jsx("div", {
11008
+ className: "w-full max-w-sm",
11009
+ children: /* @__PURE__ */ jsx(SearchSort, {
11010
+ searchValue: searchTerm,
11011
+ onSearchChange: setSearchTerm,
11012
+ placeholder: "Search pages...",
11013
+ sortOptions: [
11014
+ {
11015
+ label: "Newest first",
11016
+ value: "newest"
11017
+ },
11018
+ {
11019
+ label: "Title (A-Z)",
11020
+ value: "title_asc"
11021
+ },
11022
+ {
11023
+ label: "Title (Z-A)",
11024
+ value: "title_desc"
11025
+ }
11026
+ ],
11027
+ sortValue,
11028
+ onSortChange: (v) => setSortValue(v)
11029
+ })
11030
+ })
11031
+ }),
11032
+ footer: isFetchingNextPage && /* @__PURE__ */ jsx("div", {
11033
+ className: "flex justify-center py-4",
11034
+ children: /* @__PURE__ */ jsx("div", { className: "border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" })
11035
+ }),
11036
+ sentinelRef: observerTarget,
11037
+ children: /* @__PURE__ */ jsx("div", {
11038
+ className: SHAREABLE_GRID_CLASS,
11039
+ children: allPages.map((page) => {
11040
+ const title = page.title || "Untitled Page";
11041
+ const openDetail = () => onNavigate?.("pages", String(page.id));
11042
+ return /* @__PURE__ */ jsxs(Card, {
11043
+ role: "button",
11044
+ tabIndex: 0,
11045
+ onClick: openDetail,
11046
+ onKeyDown: (e) => {
11047
+ if (e.key === "Enter" || e.key === " ") {
11048
+ e.preventDefault();
11049
+ openDetail();
11050
+ }
11051
+ },
11052
+ className: "group hover:bg-muted cursor-pointer gap-0 overflow-hidden rounded-lg border-0 p-0 shadow-none transition-colors",
11053
+ children: [/* @__PURE__ */ jsxs("div", {
11054
+ className: "bg-muted relative aspect-square overflow-hidden rounded-lg",
11055
+ children: [renderImage({
11056
+ src: page.image_url || DEFAULT_IMAGE,
11057
+ alt: title,
11058
+ fill: true,
11059
+ className: "object-cover transition-transform group-hover:scale-105"
11060
+ }), /* @__PURE__ */ jsx(Badge, {
11061
+ className: "absolute top-2 right-2 shadow-lg",
11062
+ variant: page.status === "published" ? "default" : "secondary",
11063
+ children: page.status === "published" ? "Published" : "Unpublished"
11064
+ })]
11065
+ }), /* @__PURE__ */ jsxs("div", {
11066
+ className: "px-2 pt-2 pb-4",
11067
+ children: [/* @__PURE__ */ jsx("h3", {
11068
+ className: "text-foreground line-clamp-2 text-sm leading-tight font-bold",
11069
+ children: title
11070
+ }), page.description && /* @__PURE__ */ jsx("p", {
11071
+ className: "text-muted-foreground mt-1 line-clamp-2 text-xs",
11072
+ children: page.description
11073
+ })]
11074
+ })]
11075
+ }, page.id);
11076
+ })
11077
+ })
11078
+ });
11079
+ }
11080
+ //#endregion
11081
+ //#region ../../shareables/ui/src/components/screens/PageDetailScreen.tsx
11082
+ function PageDetailScreen({ pageId, onBack }) {
11083
+ const api = useShareablesApi();
11084
+ const { navigate } = useShareablesUI();
11085
+ const { data: pageResponse, isLoading } = useQuery({
11086
+ queryKey: shareablesKeys.pages.detail(Number(pageId)),
11087
+ queryFn: () => api.pages.getPage(Number(pageId))
11088
+ });
11089
+ const page = pageResponse?.page;
11090
+ const displayTitle = page?.title || "";
11091
+ const displayImage = page?.image_url || "";
11092
+ const description = page?.description ?? "";
11093
+ const { shareLink, loading: shareLinkLoading, error: shareLinkError } = useShareLink({
11094
+ id: page?.id,
11095
+ share_link: pageResponse?.share_link ?? void 0
11096
+ }, "Page");
11097
+ useScreenHeaderBreadcrumbs(useMemo(() => /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, {
11098
+ className: "text-lg",
11099
+ children: [
11100
+ /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, {
11101
+ href: "#",
11102
+ onClick: (e) => {
11103
+ e.preventDefault();
11104
+ (onBack ?? (() => navigate("pages")))();
11105
+ },
11106
+ children: "Pages"
11107
+ }) }),
11108
+ /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
11109
+ /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
11110
+ className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]",
11111
+ children: displayTitle || "Page"
11112
+ }) })
11113
+ ]
11114
+ }) }), [
11115
+ displayTitle,
11116
+ onBack,
11117
+ navigate
11118
+ ]));
11119
+ return /* @__PURE__ */ jsx(ShareableDetailLayout, {
11120
+ isLoading,
11121
+ notFound: !page && !isLoading,
11122
+ notFoundMessage: "Page not found or failed to load.",
11123
+ title: displayTitle,
11124
+ description,
11125
+ containerHeightClass: "md:h-[calc(95vh-140px)]",
11126
+ image: /* @__PURE__ */ jsxs("div", {
11127
+ className: "relative h-full overflow-hidden",
11128
+ children: [/* @__PURE__ */ jsx(SharePageImageDisplay, {
11129
+ displayImage,
11130
+ displayTitle,
11131
+ isVideo: false,
11132
+ badgeLabel: "Page",
11133
+ rounded: true,
11134
+ showBadge: false
11135
+ }), page && /* @__PURE__ */ jsx(Badge, {
11136
+ variant: page.status === "published" ? "default" : "secondary",
11137
+ 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",
11138
+ children: page.status === "published" ? "Published" : "Unpublished"
11139
+ })]
11140
+ }),
11141
+ actions: page && /* @__PURE__ */ jsx(AssetActions, {
11142
+ downloadUrl: null,
11143
+ displayTitle,
11144
+ shareLink: shareLinkError ? null : shareLink || null,
11145
+ shareLinkLoading,
11146
+ isVideo: false,
11147
+ relateableId: page.id,
11148
+ relateableType: "Page"
11149
+ })
11150
+ });
11151
+ }
11152
+ //#endregion
10926
11153
  //#region ../../shareables/ui/src/components/ShareablesApp.tsx
10927
11154
  function ShareablesApp({ screen, detailId, action, onNavigate, onBack, countryCode, fetchProducts, fetchProduct }) {
10928
11155
  const { readOnly } = useShareablesUI();
@@ -10962,6 +11189,13 @@ function ShareablesApp({ screen, detailId, action, onNavigate, onBack, countryCo
10962
11189
  case "files":
10963
11190
  content = /* @__PURE__ */ jsx(FilesListingScreen, { onNavigate });
10964
11191
  break;
11192
+ case "pages":
11193
+ case "page":
11194
+ content = detailId && detailId !== "new" ? /* @__PURE__ */ jsx(PageDetailScreen, {
11195
+ pageId: detailId,
11196
+ onBack
11197
+ }) : /* @__PURE__ */ jsx(PagesListingScreen, { onNavigate });
11198
+ break;
10965
11199
  default:
10966
11200
  content = detailId ? /* @__PURE__ */ jsx(ProductDetailScreen, {
10967
11201
  productId: detailId,
@@ -11731,6 +11965,63 @@ function createShareAdapter(client) {
11731
11965
  })).share.url;
11732
11966
  } };
11733
11967
  }
11968
+ function mapPage(raw) {
11969
+ return {
11970
+ id: raw.id ?? 0,
11971
+ title: raw.title ?? null,
11972
+ slug: raw.slug ?? null,
11973
+ source: raw.source ?? null,
11974
+ status: raw.status ?? "unpublished",
11975
+ countries: (raw.countries ?? []).map((c) => ({
11976
+ code: c.code ?? "",
11977
+ name: c.name ?? "",
11978
+ currency_code: c.currency_code ?? "",
11979
+ states: (c.states ?? []).map((s) => ({
11980
+ code: s.code ?? "",
11981
+ name: s.name ?? ""
11982
+ }))
11983
+ })),
11984
+ description: raw.description ?? null,
11985
+ image_url: raw.image_url ?? null
11986
+ };
11987
+ }
11988
+ function mapPagesMeta(raw) {
11989
+ return {
11990
+ request_id: raw?.request_id ?? null,
11991
+ timestamp: raw?.timestamp ?? "",
11992
+ pagination: raw?.pagination ? {
11993
+ cursor: raw.pagination.cursor ?? null,
11994
+ limit: raw.pagination.limit,
11995
+ next_cursor: raw.pagination.next_cursor ?? null,
11996
+ prev_cursor: raw.pagination.prev_cursor ?? null
11997
+ } : void 0
11998
+ };
11999
+ }
12000
+ function createRawPagesAdapter(client) {
12001
+ return {
12002
+ listPages: async (params) => {
12003
+ const response = await pages_list(client, {
12004
+ "page[cursor]": params?.cursor,
12005
+ "page[limit]": params?.limit,
12006
+ "filter[title]": params?.["filter[title]"],
12007
+ sort: params?.sort
12008
+ });
12009
+ return {
12010
+ pages: (response.pages ?? []).map(mapPage),
12011
+ meta: mapPagesMeta(response.meta)
12012
+ };
12013
+ },
12014
+ getPage: async (id) => {
12015
+ const response = await pages_show(client, id);
12016
+ if (!response.page) throw new Error(`Page ${id} not found`);
12017
+ return {
12018
+ page: mapPage(response.page),
12019
+ share_link: response.share_link ?? null,
12020
+ meta: mapPagesMeta(response.meta)
12021
+ };
12022
+ }
12023
+ };
12024
+ }
11734
12025
  function mapDamAsset(raw) {
11735
12026
  return {
11736
12027
  id: raw.id ?? 0,
@@ -11861,7 +12152,7 @@ function mapMetricsMeta(raw) {
11861
12152
  function createMetricsAdapter(client) {
11862
12153
  return {
11863
12154
  listMediaVisited: async (params) => {
11864
- const response = await content_media_metrics_visits(client, {
12155
+ const response = await content_media_by_visits(client, {
11865
12156
  period: params?.period,
11866
12157
  limit: params?.limit
11867
12158
  });
@@ -11871,7 +12162,7 @@ function createMetricsAdapter(client) {
11871
12162
  };
11872
12163
  },
11873
12164
  listMediaShareVisited: async (params) => {
11874
- const response = await content_media_metrics_share_visits(client, {
12165
+ const response = await content_media_by_shares(client, {
11875
12166
  period: params?.period,
11876
12167
  limit: params?.limit
11877
12168
  });
@@ -11881,7 +12172,7 @@ function createMetricsAdapter(client) {
11881
12172
  };
11882
12173
  },
11883
12174
  listPlaylistsVisited: async (params) => {
11884
- const response = await content_playlists_metrics_visits(client, {
12175
+ const response = await content_playlists_by_visits(client, {
11885
12176
  period: params?.period,
11886
12177
  limit: params?.limit
11887
12178
  });
@@ -11891,7 +12182,7 @@ function createMetricsAdapter(client) {
11891
12182
  };
11892
12183
  },
11893
12184
  listPlaylistsShareVisited: async (params) => {
11894
- const response = await content_playlists_metrics_share_visits(client, {
12185
+ const response = await content_playlists_by_shares(client, {
11895
12186
  period: params?.period,
11896
12187
  limit: params?.limit
11897
12188
  });
@@ -11901,7 +12192,7 @@ function createMetricsAdapter(client) {
11901
12192
  };
11902
12193
  },
11903
12194
  listPagesVisited: async (params) => {
11904
- const response = await content_pages_metrics_visits(client, {
12195
+ const response = await content_pages_by_visits(client, {
11905
12196
  period: params?.period,
11906
12197
  limit: params?.limit
11907
12198
  });
@@ -11911,7 +12202,7 @@ function createMetricsAdapter(client) {
11911
12202
  };
11912
12203
  },
11913
12204
  listPagesShareVisited: async (params) => {
11914
- const response = await content_pages_metrics_share_visits(client, {
12205
+ const response = await content_pages_by_shares(client, {
11915
12206
  period: params?.period,
11916
12207
  limit: params?.limit
11917
12208
  });
@@ -11959,7 +12250,8 @@ function createPortalContentDomainApiAdapter(client, productsApi) {
11959
12250
  fileResources: createFileResourcesAdapter(client),
11960
12251
  share: createShareAdapter(client),
11961
12252
  productMedia: createProductMediaAdapter(productsApi),
11962
- metrics: createMetricsAdapter(client)
12253
+ metrics: createMetricsAdapter(client),
12254
+ pages: createRawPagesAdapter(client)
11963
12255
  };
11964
12256
  }
11965
12257
  /**
@@ -12207,4 +12499,4 @@ const shareablesScreenPropertySchema = {
12207
12499
  //#endregion
12208
12500
  export { ShareablesScreen_exports as n, shareablesScreenPropertySchema as r, ShareablesScreen as t };
12209
12501
 
12210
- //# sourceMappingURL=ShareablesScreen-DyaGwSlk.mjs.map
12502
+ //# sourceMappingURL=ShareablesScreen-CNARhXTE.mjs.map