@fluid-app/portal-sdk 0.1.232 → 0.1.233
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/{ShareablesScreen-DfrTNnRw.cjs → ShareablesScreen-DJ1yd3qu.cjs} +13 -17
- package/dist/ShareablesScreen-DJ1yd3qu.cjs.map +1 -0
- package/dist/{ShareablesScreen-DHKFnIOE.mjs → ShareablesScreen-DNjpEjLv.mjs} +13 -17
- package/dist/ShareablesScreen-DNjpEjLv.mjs.map +1 -0
- package/dist/{ShareablesScreen-DQjgnn2x.cjs → ShareablesScreen-DzswDadv.cjs} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +11 -11
- package/dist/ShareablesScreen-DHKFnIOE.mjs.map +0 -1
- package/dist/ShareablesScreen-DfrTNnRw.cjs.map +0 -1
|
@@ -65,6 +65,13 @@ const shareablesKeys = {
|
|
|
65
65
|
},
|
|
66
66
|
playlists: {
|
|
67
67
|
all: ["playlists"],
|
|
68
|
+
list: (search, sort, ownership) => [
|
|
69
|
+
"playlists",
|
|
70
|
+
"list",
|
|
71
|
+
search,
|
|
72
|
+
sort,
|
|
73
|
+
ownership
|
|
74
|
+
],
|
|
68
75
|
detail: (id) => [
|
|
69
76
|
"playlists",
|
|
70
77
|
"detail",
|
|
@@ -9655,17 +9662,13 @@ function PlaylistsListingScreen(_props) {
|
|
|
9655
9662
|
return () => clearTimeout(timer);
|
|
9656
9663
|
}, [searchTerm]);
|
|
9657
9664
|
const observerTarget = (0, react.useRef)(null);
|
|
9658
|
-
const queryKey = [
|
|
9659
|
-
...shareablesKeys.playlists.all,
|
|
9660
|
-
"list",
|
|
9661
|
-
debouncedSearch,
|
|
9662
|
-
sortValue
|
|
9663
|
-
];
|
|
9665
|
+
const queryKey = [...shareablesKeys.playlists.list(debouncedSearch, sortValue, ownerFilter)];
|
|
9664
9666
|
const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage, error } = (0, _tanstack_react_query.useInfiniteQuery)({
|
|
9665
9667
|
queryKey,
|
|
9666
9668
|
queryFn: async ({ pageParam }) => {
|
|
9667
9669
|
const response = await api.playlists.getPlaylists({
|
|
9668
9670
|
"filter[title]": debouncedSearch || void 0,
|
|
9671
|
+
"filter[ownership]": ownerFilter !== "all" ? ownerFilter : void 0,
|
|
9669
9672
|
"page[cursor]": pageParam,
|
|
9670
9673
|
"page[limit]": PAGE_SIZE$2,
|
|
9671
9674
|
sort: sortValue
|
|
@@ -9679,16 +9682,7 @@ function PlaylistsListingScreen(_props) {
|
|
|
9679
9682
|
initialPageParam: void 0,
|
|
9680
9683
|
placeholderData: _tanstack_react_query.keepPreviousData
|
|
9681
9684
|
});
|
|
9682
|
-
const
|
|
9683
|
-
const filteredPlaylists = (0, react.useMemo)(() => {
|
|
9684
|
-
if (ownerFilter === "all" || !user?.id) return allPlaylists;
|
|
9685
|
-
if (ownerFilter === "mine") return allPlaylists.filter((p) => p.user_id === user.id);
|
|
9686
|
-
return allPlaylists.filter((p) => p.user_id !== user.id);
|
|
9687
|
-
}, [
|
|
9688
|
-
allPlaylists,
|
|
9689
|
-
ownerFilter,
|
|
9690
|
-
user?.id
|
|
9691
|
-
]);
|
|
9685
|
+
const filteredPlaylists = (0, react.useMemo)(() => data?.pages.flatMap((page) => page.playlists) ?? [], [data?.pages]);
|
|
9692
9686
|
(0, react.useEffect)(() => {
|
|
9693
9687
|
const target = observerTarget.current;
|
|
9694
9688
|
if (!target) return;
|
|
@@ -12391,6 +12385,7 @@ function createRawPlaylistsAdapter(client) {
|
|
|
12391
12385
|
"page[cursor]": params?.cursor,
|
|
12392
12386
|
"page[limit]": params?.limit,
|
|
12393
12387
|
"filter[title]": params?.["filter[title]"],
|
|
12388
|
+
"filter[ownership]": params?.["filter[ownership]"],
|
|
12394
12389
|
sort: params?.sort
|
|
12395
12390
|
});
|
|
12396
12391
|
return {
|
|
@@ -12630,6 +12625,7 @@ function createPlaylistsAdapter(client) {
|
|
|
12630
12625
|
cursor: options?.["page[cursor]"],
|
|
12631
12626
|
limit: options?.["page[limit]"],
|
|
12632
12627
|
"filter[title]": options?.["filter[title]"],
|
|
12628
|
+
"filter[ownership]": options?.["filter[ownership]"],
|
|
12633
12629
|
sort: bffSort
|
|
12634
12630
|
});
|
|
12635
12631
|
return {
|
|
@@ -13473,4 +13469,4 @@ Object.defineProperty(exports, "shareablesScreenPropertySchema", {
|
|
|
13473
13469
|
}
|
|
13474
13470
|
});
|
|
13475
13471
|
|
|
13476
|
-
//# sourceMappingURL=ShareablesScreen-
|
|
13472
|
+
//# sourceMappingURL=ShareablesScreen-DJ1yd3qu.cjs.map
|