@fluid-app/portal-sdk 0.1.193 → 0.1.195

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 (23) hide show
  1. package/dist/{PortalContentApiProvider-Bxtd3cTD.mjs → PortalContentApiProvider-3zgq-z26.mjs} +54 -81
  2. package/dist/{PortalContentApiProvider-Bxtd3cTD.mjs.map → PortalContentApiProvider-3zgq-z26.mjs.map} +1 -1
  3. package/dist/{PortalContentApiProvider-D_0DbqrK.cjs → PortalContentApiProvider-Zoz_YDJM.cjs} +54 -81
  4. package/dist/{PortalContentApiProvider-D_0DbqrK.cjs.map → PortalContentApiProvider-Zoz_YDJM.cjs.map} +1 -1
  5. package/dist/{ProductsScreen-DliPMmcL.cjs → ProductsScreen-BLsyTVHI.cjs} +2 -2
  6. package/dist/{ProductsScreen-DjvCNiay.cjs → ProductsScreen-BiyYxql3.cjs} +2 -2
  7. package/dist/{ProductsScreen-DjvCNiay.cjs.map → ProductsScreen-BiyYxql3.cjs.map} +1 -1
  8. package/dist/{ProductsScreen-COiPDOoi.mjs → ProductsScreen-DNigWzOk.mjs} +2 -2
  9. package/dist/{ProductsScreen-COiPDOoi.mjs.map → ProductsScreen-DNigWzOk.mjs.map} +1 -1
  10. package/dist/{ProductsScreen-CIZEyhz1.mjs → ProductsScreen-xuQq68Lm.mjs} +2 -2
  11. package/dist/{ShareablesScreen-nK7fJqjp.cjs → ShareablesScreen-CP4uXPPz.cjs} +2 -2
  12. package/dist/{ShareablesScreen-U2Zgf6wh.mjs → ShareablesScreen-CfuQenlV.mjs} +6 -2
  13. package/dist/ShareablesScreen-CfuQenlV.mjs.map +1 -0
  14. package/dist/{ShareablesScreen-BWIRh8uv.cjs → ShareablesScreen-Df9GKUVi.cjs} +6 -2
  15. package/dist/ShareablesScreen-Df9GKUVi.cjs.map +1 -0
  16. package/dist/{ShareablesScreen-B2VncQCU.mjs → ShareablesScreen-w72hongE.mjs} +2 -2
  17. package/dist/index.cjs +7 -7
  18. package/dist/index.d.cts.map +1 -1
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs +7 -7
  21. package/package.json +17 -17
  22. package/dist/ShareablesScreen-BWIRh8uv.cjs.map +0 -1
  23. package/dist/ShareablesScreen-U2Zgf6wh.mjs.map +0 -1
@@ -8925,7 +8925,7 @@ function PlaylistsListingScreen(_props) {
8925
8925
  debouncedSearch,
8926
8926
  sortValue
8927
8927
  ];
8928
- const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage, isFetched, error } = useInfiniteQuery({
8928
+ const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage, error } = useInfiniteQuery({
8929
8929
  queryKey,
8930
8930
  queryFn: async ({ pageParam }) => {
8931
8931
  const response = await api.playlists.getPlaylists({
@@ -9055,7 +9055,7 @@ function PlaylistsListingScreen(_props) {
9055
9055
  showToast
9056
9056
  ]);
9057
9057
  if (isLoading) return /* @__PURE__ */ jsxs("div", {
9058
- className: "mx-auto space-y-6 px-2 md:px-10 md:py-6",
9058
+ className: "space-y-6 px-4 py-4 md:px-10 md:py-6",
9059
9059
  children: [/* @__PURE__ */ jsxs("div", {
9060
9060
  className: "flex items-center gap-3",
9061
9061
  children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-10 flex-1" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-24" })]
@@ -9067,52 +9067,53 @@ function PlaylistsListingScreen(_props) {
9067
9067
  }, i))
9068
9068
  })]
9069
9069
  });
9070
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
9071
- className: "mx-auto px-2 md:px-10",
9072
- children: hasSelection ? /* @__PURE__ */ jsx("div", {
9073
- className: "my-4",
9074
- children: /* @__PURE__ */ jsx(BulkSelectionBar, {
9070
+ return /* @__PURE__ */ jsxs("div", {
9071
+ className: "space-y-6 px-4 py-4 md:px-10 md:py-6",
9072
+ children: [
9073
+ hasSelection ? /* @__PURE__ */ jsx(BulkSelectionBar, {
9075
9074
  selectedCount: selectedIds.size,
9076
9075
  totalCount: allPlaylists.length,
9077
9076
  onSelectAll: handleSelectAll,
9078
9077
  onClearSelection: handleClearSelection,
9079
9078
  onBulkFavorite: handleBulkFavorite
9080
- })
9081
- }) : /* @__PURE__ */ jsx("div", {
9082
- className: "flex items-center justify-end py-4",
9083
- children: /* @__PURE__ */ jsx("div", {
9084
- className: "w-full max-w-sm",
9085
- children: /* @__PURE__ */ jsx(SearchSort, {
9086
- searchValue: searchTerm,
9087
- onSearchChange: setSearchTerm,
9088
- placeholder: "Search playlists...",
9089
- sortOptions: [
9090
- {
9091
- label: "Name (A-Z)",
9092
- value: "title"
9093
- },
9094
- {
9095
- label: "Name (Z-A)",
9096
- value: "-title"
9097
- },
9098
- {
9099
- label: "Date Created (Newest)",
9100
- value: "-created_at"
9101
- },
9102
- {
9103
- label: "Date Created (Oldest)",
9104
- value: "created_at"
9105
- }
9106
- ],
9107
- sortValue,
9108
- onSortChange: setSortValue
9079
+ }) : /* @__PURE__ */ jsx("div", {
9080
+ className: "flex justify-end",
9081
+ children: /* @__PURE__ */ jsx("div", {
9082
+ className: "w-full max-w-sm",
9083
+ children: /* @__PURE__ */ jsx(SearchSort, {
9084
+ searchValue: searchTerm,
9085
+ onSearchChange: setSearchTerm,
9086
+ placeholder: "Search playlists...",
9087
+ sortOptions: [
9088
+ {
9089
+ label: "Name (A-Z)",
9090
+ value: "title"
9091
+ },
9092
+ {
9093
+ label: "Name (Z-A)",
9094
+ value: "-title"
9095
+ },
9096
+ {
9097
+ label: "Date Created (Newest)",
9098
+ value: "-created_at"
9099
+ },
9100
+ {
9101
+ label: "Date Created (Oldest)",
9102
+ value: "created_at"
9103
+ }
9104
+ ],
9105
+ sortValue,
9106
+ onSortChange: setSortValue
9107
+ })
9109
9108
  })
9110
- })
9111
- })
9112
- }), /* @__PURE__ */ jsxs("div", {
9113
- className: "mx-auto space-y-8 px-2 md:px-10 md:py-8",
9114
- children: [
9115
- allPlaylists.length > 0 && /* @__PURE__ */ jsx("div", {
9109
+ }),
9110
+ allPlaylists.length === 0 ? /* @__PURE__ */ jsx("div", {
9111
+ className: "flex flex-col items-center justify-center py-16",
9112
+ children: /* @__PURE__ */ jsx("p", {
9113
+ className: "text-muted-foreground text-sm",
9114
+ children: searchTerm ? `No playlists match "${searchTerm}". Try a different search term.` : "There are no playlists available at the moment."
9115
+ })
9116
+ }) : /* @__PURE__ */ jsx("div", {
9116
9117
  className: GRID_CLASS$1,
9117
9118
  children: allPlaylists.map((playlist) => {
9118
9119
  const firstItem = playlist.items?.[0];
@@ -9135,27 +9136,20 @@ function PlaylistsListingScreen(_props) {
9135
9136
  }, playlist.id);
9136
9137
  })
9137
9138
  }),
9138
- /* @__PURE__ */ jsx("div", {
9139
- ref: observerTarget,
9140
- className: "h-1"
9141
- }),
9142
9139
  isFetchingNextPage && /* @__PURE__ */ jsx("div", {
9143
- className: "flex items-center justify-center",
9140
+ className: "flex justify-center py-4",
9144
9141
  children: /* @__PURE__ */ jsx("div", { className: "border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" })
9145
9142
  }),
9146
- isFetched && allPlaylists.length === 0 && /* @__PURE__ */ jsx("div", {
9147
- className: "flex flex-col items-center justify-center py-8 text-center",
9148
- children: /* @__PURE__ */ jsx("p", {
9149
- className: "text-muted-foreground text-sm",
9150
- children: searchTerm ? `No playlists match "${searchTerm}". Try a different search term.` : "There are no playlists available at the moment."
9151
- })
9143
+ /* @__PURE__ */ jsx("div", {
9144
+ ref: observerTarget,
9145
+ className: "h-1"
9152
9146
  }),
9153
9147
  error && /* @__PURE__ */ jsxs("p", {
9154
- className: "bg-destructive/10 text-destructive mx-auto my-6 rounded-lg px-3 py-2",
9148
+ className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
9155
9149
  children: ["Error: ", error.message]
9156
9150
  })
9157
9151
  ]
9158
- })] });
9152
+ });
9159
9153
  }
9160
9154
  //#endregion
9161
9155
  //#region ../../shareables/ui/src/constants.ts
@@ -9520,7 +9514,7 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
9520
9514
  return /* @__PURE__ */ jsxs("div", {
9521
9515
  className: "flex flex-col gap-4 px-4 py-4 md:px-10 md:py-6",
9522
9516
  children: [/* @__PURE__ */ jsxs("div", {
9523
- className: "mx-auto flex w-full max-w-[480px] flex-col gap-6 md:h-[calc(100vh-140px)] md:flex-row",
9517
+ className: "mx-auto flex w-full max-w-[480px] flex-col gap-6 md:h-[calc(100vh-140px)] md:max-w-none md:flex-row",
9524
9518
  children: [/* @__PURE__ */ jsx("div", {
9525
9519
  className: "aspect-square w-full md:aspect-auto md:h-full",
9526
9520
  children: /* @__PURE__ */ jsx("div", {
@@ -9569,7 +9563,7 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
9569
9563
  }),
9570
9564
  /* @__PURE__ */ jsx(Separator, { className: "border-foreground my-4" }),
9571
9565
  /* @__PURE__ */ jsxs("div", {
9572
- className: "hide-scrollbar bg-background h-full overflow-y-auto rounded-lg",
9566
+ className: "bg-background rounded-lg",
9573
9567
  children: [/* @__PURE__ */ jsx(TaggedProductsList, {
9574
9568
  products: taggedProducts,
9575
9569
  onProductClick: (productId) => onNavigate?.("product", String(productId))
@@ -11552,37 +11546,16 @@ const SHAREABLE_TYPE_MAP = {
11552
11546
  Page: "page",
11553
11547
  page: "page"
11554
11548
  };
11555
- /**
11556
- * Build a direct page URL on the company app for a given shareable.
11557
- *
11558
- * Portal runs at `<tenant>.portal.fluid.app`; the company app is at
11559
- * `<tenant>.fluid.app`. Strip the `.portal` segment to get the company
11560
- * origin, then append the type-specific path.
11561
- */
11562
- const SHARE_PATH_BY_TYPE = {
11563
- product: "/home/products",
11564
- media: "/home/media",
11565
- library: "/home/libraries",
11566
- page: "/home/pages"
11567
- };
11568
- function buildShareUrl(shareableType, shareUrl) {
11569
- const basePath = SHARE_PATH_BY_TYPE[shareableType];
11570
- if (!basePath) throw new Error(`Cannot build share URL for type "${shareableType}"`);
11571
- if (typeof window === "undefined") throw new Error(`Cannot build share URL in a non-browser environment (type: "${shareableType}")`);
11572
- const token = shareUrl.split("/s/")[1];
11573
- if (!token) throw new Error(`Share URL missing expected /s/ token segment: "${shareUrl}"`);
11574
- return `${window.location.origin.replace(/\.portal\./, ".")}${basePath}/${token}`;
11575
- }
11576
11549
  function createShareAdapter(client) {
11577
11550
  const portAdapter = createRawSharesAdapter(client);
11578
11551
  return { createShareLink: async (input) => {
11579
11552
  if (!input.relateableId) throw new Error("Cannot create share link without a relateableId");
11580
11553
  const shareableType = SHAREABLE_TYPE_MAP[input.relateableType];
11581
11554
  if (!shareableType) throw new Error(`Unknown shareable type: "${input.relateableType}"`);
11582
- return buildShareUrl(shareableType, (await portAdapter.createShare({
11555
+ return (await portAdapter.createShare({
11583
11556
  shareable_type: shareableType,
11584
11557
  shareable_id: input.relateableId
11585
- })).share.url);
11558
+ })).share.url;
11586
11559
  } };
11587
11560
  }
11588
11561
  function mapDamAsset(raw) {
@@ -11805,4 +11778,4 @@ function PortalContentApiProvider({ children }) {
11805
11778
  //#endregion
11806
11779
  export { ShareablesApp as a, ShareablesCoreProvider as c, ProductsApp as i, usePortalContentContext as n, useFilePickerApi as o, toggleFavorite as r, ShareablesUIProvider as s, PortalContentApiProvider as t };
11807
11780
 
11808
- //# sourceMappingURL=PortalContentApiProvider-Bxtd3cTD.mjs.map
11781
+ //# sourceMappingURL=PortalContentApiProvider-3zgq-z26.mjs.map