@fluid-app/portal-sdk 0.1.194 → 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.
- package/dist/{PortalContentApiProvider-Bxtd3cTD.mjs → PortalContentApiProvider-3zgq-z26.mjs} +54 -81
- package/dist/{PortalContentApiProvider-Bxtd3cTD.mjs.map → PortalContentApiProvider-3zgq-z26.mjs.map} +1 -1
- package/dist/{PortalContentApiProvider-D_0DbqrK.cjs → PortalContentApiProvider-Zoz_YDJM.cjs} +54 -81
- package/dist/{PortalContentApiProvider-D_0DbqrK.cjs.map → PortalContentApiProvider-Zoz_YDJM.cjs.map} +1 -1
- package/dist/{ProductsScreen-DliPMmcL.cjs → ProductsScreen-BLsyTVHI.cjs} +2 -2
- package/dist/{ProductsScreen-DjvCNiay.cjs → ProductsScreen-BiyYxql3.cjs} +2 -2
- package/dist/{ProductsScreen-DjvCNiay.cjs.map → ProductsScreen-BiyYxql3.cjs.map} +1 -1
- package/dist/{ProductsScreen-COiPDOoi.mjs → ProductsScreen-DNigWzOk.mjs} +2 -2
- package/dist/{ProductsScreen-COiPDOoi.mjs.map → ProductsScreen-DNigWzOk.mjs.map} +1 -1
- package/dist/{ProductsScreen-CIZEyhz1.mjs → ProductsScreen-xuQq68Lm.mjs} +2 -2
- package/dist/{ShareablesScreen-BDdgmBeh.cjs → ShareablesScreen-CP4uXPPz.cjs} +2 -2
- package/dist/{ShareablesScreen-Bk0VnMyz.mjs → ShareablesScreen-CfuQenlV.mjs} +2 -2
- package/dist/{ShareablesScreen-Bk0VnMyz.mjs.map → ShareablesScreen-CfuQenlV.mjs.map} +1 -1
- package/dist/{ShareablesScreen-ivCaHKjM.cjs → ShareablesScreen-Df9GKUVi.cjs} +2 -2
- package/dist/{ShareablesScreen-ivCaHKjM.cjs.map → ShareablesScreen-Df9GKUVi.cjs.map} +1 -1
- package/dist/{ShareablesScreen-C4OnaaH6.mjs → ShareablesScreen-w72hongE.mjs} +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +16 -16
package/dist/{PortalContentApiProvider-Bxtd3cTD.mjs → PortalContentApiProvider-3zgq-z26.mjs}
RENAMED
|
@@ -8925,7 +8925,7 @@ function PlaylistsListingScreen(_props) {
|
|
|
8925
8925
|
debouncedSearch,
|
|
8926
8926
|
sortValue
|
|
8927
8927
|
];
|
|
8928
|
-
const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage,
|
|
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: "
|
|
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(
|
|
9071
|
-
className: "
|
|
9072
|
-
children:
|
|
9073
|
-
|
|
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
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
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
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
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
|
|
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
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
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
|
|
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: "
|
|
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
|
|
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-
|
|
11781
|
+
//# sourceMappingURL=PortalContentApiProvider-3zgq-z26.mjs.map
|