@fluid-app/portal-sdk 0.1.89 → 0.1.91

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 (109) hide show
  1. package/dist/{AppDownloadScreen--gGSPUDm.cjs → AppDownloadScreen-BtvcE4pE.cjs} +2 -2
  2. package/dist/{AppDownloadScreen--gGSPUDm.cjs.map → AppDownloadScreen-BtvcE4pE.cjs.map} +1 -1
  3. package/dist/{AppDownloadScreen-CDMvuvsQ.cjs → AppDownloadScreen-Dx2nilnX.cjs} +3 -3
  4. package/dist/{AppDownloadScreen-Bt--8jSo.mjs → AppDownloadScreen-RX8GSAyq.mjs} +2 -2
  5. package/dist/{AppDownloadScreen-Bt--8jSo.mjs.map → AppDownloadScreen-RX8GSAyq.mjs.map} +1 -1
  6. package/dist/{ContactsScreen-BZOjocjS.cjs → ContactsScreen-CKMZIQlF.cjs} +3 -3
  7. package/dist/{ContactsScreen-21VYWIsO.mjs → ContactsScreen-DOz11uQ_.mjs} +2 -2
  8. package/dist/{ContactsScreen-21VYWIsO.mjs.map → ContactsScreen-DOz11uQ_.mjs.map} +1 -1
  9. package/dist/{ContactsScreen-DH3K85c6.cjs → ContactsScreen-DttcI388.cjs} +2 -2
  10. package/dist/{ContactsScreen-DH3K85c6.cjs.map → ContactsScreen-DttcI388.cjs.map} +1 -1
  11. package/dist/{FluidProvider-CRiIzR8g.mjs → FluidProvider-Eohedipr.mjs} +3 -3
  12. package/dist/{FluidProvider-CRiIzR8g.mjs.map → FluidProvider-Eohedipr.mjs.map} +1 -1
  13. package/dist/{FluidProvider-Cwh9D2D_.cjs → FluidProvider-Sc51VlLw.cjs} +3 -3
  14. package/dist/{FluidProvider-Cwh9D2D_.cjs.map → FluidProvider-Sc51VlLw.cjs.map} +1 -1
  15. package/dist/{MessagingScreen-68mp7aIc.mjs → MessagingScreen-CMxjIURw.mjs} +3 -3
  16. package/dist/{MessagingScreen-68mp7aIc.mjs.map → MessagingScreen-CMxjIURw.mjs.map} +1 -1
  17. package/dist/{MessagingScreen-BIFFfpwv.cjs → MessagingScreen-CdHBUykK.cjs} +3 -3
  18. package/dist/{MessagingScreen-DbXef2ee.mjs → MessagingScreen-Cx0bbvfs.mjs} +3 -3
  19. package/dist/{MessagingScreen-Cljq2xIQ.cjs → MessagingScreen-r67FUDf1.cjs} +3 -3
  20. package/dist/{MessagingScreen-Cljq2xIQ.cjs.map → MessagingScreen-r67FUDf1.cjs.map} +1 -1
  21. package/dist/{MySiteScreen-D5yvFmK3.cjs → MySiteScreen-8lZTZzo0.cjs} +4 -4
  22. package/dist/{MySiteScreen-YujACNSf.mjs → MySiteScreen-BhdmPFar.mjs} +3 -3
  23. package/dist/{MySiteScreen-YujACNSf.mjs.map → MySiteScreen-BhdmPFar.mjs.map} +1 -1
  24. package/dist/{MySiteScreen-C4Ut8wxE.cjs → MySiteScreen-Cy7HpS3z.cjs} +3 -3
  25. package/dist/{MySiteScreen-C4Ut8wxE.cjs.map → MySiteScreen-Cy7HpS3z.cjs.map} +1 -1
  26. package/dist/{NestedWidget-zn_USrld.cjs → NestedWidget-BXbQcApb.cjs} +1 -1
  27. package/dist/{NestedWidget-L8ppxJib.mjs → NestedWidget-CzSHHhEl.mjs} +2 -2
  28. package/dist/NestedWidget-CzSHHhEl.mjs.map +1 -0
  29. package/dist/{NestedWidget-BGY4LSQq.cjs → NestedWidget-iootjKIl.cjs} +2 -2
  30. package/dist/NestedWidget-iootjKIl.cjs.map +1 -0
  31. package/dist/{OrdersScreen-CPJX2XiN.cjs → OrdersScreen-BaqQzT1F.cjs} +3 -3
  32. package/dist/{OrdersScreen-CPJX2XiN.cjs.map → OrdersScreen-BaqQzT1F.cjs.map} +1 -1
  33. package/dist/{OrdersScreen-BkxKQpwS.mjs → OrdersScreen-D0TnBQc5.mjs} +3 -3
  34. package/dist/{OrdersScreen-BkxKQpwS.mjs.map → OrdersScreen-D0TnBQc5.mjs.map} +1 -1
  35. package/dist/{OrdersScreen-BiuWTsM3.cjs → OrdersScreen-DCOzHNIy.cjs} +3 -3
  36. package/dist/{ProductsScreen-BPgkn9BH.mjs → ProductsScreen-2pUHZJop.mjs} +17 -12
  37. package/dist/ProductsScreen-2pUHZJop.mjs.map +1 -0
  38. package/dist/{ProductsScreen-DY6tKX9Q.mjs → ProductsScreen-2tlHXemg.mjs} +5 -5
  39. package/dist/{ProductsScreen-DiaGPT_Q.cjs → ProductsScreen-Ch6f5P2w.cjs} +5 -5
  40. package/dist/{ProductsScreen-B2BS6FY_.cjs → ProductsScreen-ueEJP0MJ.cjs} +17 -12
  41. package/dist/ProductsScreen-ueEJP0MJ.cjs.map +1 -0
  42. package/dist/{ProfileScreen-DKJrpeMw.mjs → ProfileScreen-Age0TtEY.mjs} +3 -3
  43. package/dist/{ProfileScreen-DKJrpeMw.mjs.map → ProfileScreen-Age0TtEY.mjs.map} +1 -1
  44. package/dist/{ProfileScreen-ueK01fjb.cjs → ProfileScreen-C8fpr9c3.cjs} +3 -3
  45. package/dist/{ProfileScreen-ueK01fjb.cjs.map → ProfileScreen-C8fpr9c3.cjs.map} +1 -1
  46. package/dist/{ProfileScreen-C6qbR0YJ.cjs → ProfileScreen-DEtgeBnE.cjs} +3 -3
  47. package/dist/{ShareablesScreen-o1VYr_1K.cjs → ShareablesScreen-B6uPSvvK.cjs} +21 -16
  48. package/dist/ShareablesScreen-B6uPSvvK.cjs.map +1 -0
  49. package/dist/{ShareablesScreen-CR3YKwZC.cjs → ShareablesScreen-CoPFz5ZB.cjs} +5 -5
  50. package/dist/{ShareablesScreen-BrLq61Q7.mjs → ShareablesScreen-DBdNgtV1.mjs} +5 -5
  51. package/dist/{ShareablesScreen-4hhIcSYA.mjs → ShareablesScreen-vFbWhVGF.mjs} +21 -16
  52. package/dist/ShareablesScreen-vFbWhVGF.mjs.map +1 -0
  53. package/dist/{ShopScreen-D8z0KYfh.cjs → ShopScreen-BKBaNPsG.cjs} +5 -5
  54. package/dist/{ShopScreen-D8z0KYfh.cjs.map → ShopScreen-BKBaNPsG.cjs.map} +1 -1
  55. package/dist/{ShopScreen-CfxPQVZD.mjs → ShopScreen-D-TXRWZR.mjs} +5 -5
  56. package/dist/{ShopScreen-CfxPQVZD.mjs.map → ShopScreen-D-TXRWZR.mjs.map} +1 -1
  57. package/dist/{ShopScreen-BVABhBmJ.cjs → ShopScreen-DPZSXS99.cjs} +3 -3
  58. package/dist/{SubscriptionsScreen-BF4NqbpU.cjs → SubscriptionsScreen-BvS7o_XP.cjs} +3 -3
  59. package/dist/{SubscriptionsScreen-BF4NqbpU.cjs.map → SubscriptionsScreen-BvS7o_XP.cjs.map} +1 -1
  60. package/dist/{SubscriptionsScreen-BSDYjJvj.mjs → SubscriptionsScreen-CBqgpat5.mjs} +3 -3
  61. package/dist/{SubscriptionsScreen-BSDYjJvj.mjs.map → SubscriptionsScreen-CBqgpat5.mjs.map} +1 -1
  62. package/dist/{SubscriptionsScreen-BRx_ocC3.cjs → SubscriptionsScreen-IbsNz0Ki.cjs} +3 -3
  63. package/dist/{dist-lO2OG0T5.cjs → dist-BF_4vk1z.cjs} +1 -1
  64. package/dist/{dist-lO2OG0T5.cjs.map → dist-BF_4vk1z.cjs.map} +1 -1
  65. package/dist/index.cjs +37 -37
  66. package/dist/index.d.cts.map +1 -1
  67. package/dist/index.d.mts.map +1 -1
  68. package/dist/index.mjs +37 -37
  69. package/dist/{products-CjZof7c2.cjs → products-BKZ1siXg.cjs} +1 -1
  70. package/dist/{products-CjZof7c2.cjs.map → products-BKZ1siXg.cjs.map} +1 -1
  71. package/dist/{products-Dkwd_Bh0.mjs → products-DOO1TBcm.mjs} +1 -1
  72. package/dist/{products-Dkwd_Bh0.mjs.map → products-DOO1TBcm.mjs.map} +1 -1
  73. package/dist/{sortable.esm-CzzU6kIR.mjs → sortable.esm-Cz-CP2N8.mjs} +1 -1
  74. package/dist/{sortable.esm-CzzU6kIR.mjs.map → sortable.esm-Cz-CP2N8.mjs.map} +1 -1
  75. package/dist/{src-bzRRiTN4.cjs → src-BbJs882O.cjs} +58 -41
  76. package/dist/src-BbJs882O.cjs.map +1 -0
  77. package/dist/{src-p8DA1dH0.mjs → src-CN7diUEw.mjs} +102 -50
  78. package/dist/src-CN7diUEw.mjs.map +1 -0
  79. package/dist/{src-BjmyVJoe.mjs → src-Ih5vEO6p.mjs} +57 -44
  80. package/dist/src-Ih5vEO6p.mjs.map +1 -0
  81. package/dist/{src-Dt66UB0B.cjs → src-Zv3-NSUf.cjs} +103 -117
  82. package/dist/src-Zv3-NSUf.cjs.map +1 -0
  83. package/dist/{use-account-clients-Bg1xqjMk.mjs → use-account-clients-CSWgrCKK.mjs} +2 -2
  84. package/dist/{use-account-clients-Bg1xqjMk.mjs.map → use-account-clients-CSWgrCKK.mjs.map} +1 -1
  85. package/dist/{use-account-clients-BVb_nhg7.cjs → use-account-clients-DaliJYMa.cjs} +2 -2
  86. package/dist/{use-account-clients-BVb_nhg7.cjs.map → use-account-clients-DaliJYMa.cjs.map} +1 -1
  87. package/dist/{use-current-user-DFQ8gYkR.cjs → use-current-user-5erIFUd6.cjs} +3 -3
  88. package/dist/{use-current-user-DFQ8gYkR.cjs.map → use-current-user-5erIFUd6.cjs.map} +1 -1
  89. package/dist/{use-current-user-DqLNoj-3.mjs → use-current-user-BBQg1iYf.mjs} +3 -3
  90. package/dist/{use-current-user-DqLNoj-3.mjs.map → use-current-user-BBQg1iYf.mjs.map} +1 -1
  91. package/dist/{use-customer-account-CY9HqWvJ.mjs → use-customer-account-CRYpHpFM.mjs} +3 -3
  92. package/dist/{use-customer-account-CY9HqWvJ.mjs.map → use-customer-account-CRYpHpFM.mjs.map} +1 -1
  93. package/dist/{use-customer-account-D599KeSp.cjs → use-customer-account-Dzdps4By.cjs} +3 -3
  94. package/dist/{use-customer-account-D599KeSp.cjs.map → use-customer-account-Dzdps4By.cjs.map} +1 -1
  95. package/dist/{use-fluid-api-DHF7svon.cjs → use-fluid-api-BUitsoDu.cjs} +2 -2
  96. package/dist/{use-fluid-api-DHF7svon.cjs.map → use-fluid-api-BUitsoDu.cjs.map} +1 -1
  97. package/dist/{use-fluid-api-CyK8Yoj-.mjs → use-fluid-api-C5ZLs2TP.mjs} +2 -2
  98. package/dist/{use-fluid-api-CyK8Yoj-.mjs.map → use-fluid-api-C5ZLs2TP.mjs.map} +1 -1
  99. package/package.json +15 -15
  100. package/dist/NestedWidget-BGY4LSQq.cjs.map +0 -1
  101. package/dist/NestedWidget-L8ppxJib.mjs.map +0 -1
  102. package/dist/ProductsScreen-B2BS6FY_.cjs.map +0 -1
  103. package/dist/ProductsScreen-BPgkn9BH.mjs.map +0 -1
  104. package/dist/ShareablesScreen-4hhIcSYA.mjs.map +0 -1
  105. package/dist/ShareablesScreen-o1VYr_1K.cjs.map +0 -1
  106. package/dist/src-BjmyVJoe.mjs.map +0 -1
  107. package/dist/src-Dt66UB0B.cjs.map +0 -1
  108. package/dist/src-bzRRiTN4.cjs.map +0 -1
  109. package/dist/src-p8DA1dH0.mjs.map +0 -1
@@ -4,9 +4,8 @@ const require_ScreenHeaderContext = require("./ScreenHeaderContext-wrJlkhgN.cjs"
4
4
  const require_dist$3 = require("./dist-thaj08s5.cjs");
5
5
  const require_es = require("./es-xQF-WIMq.cjs");
6
6
  const require_dist$4 = require("./dist-BK4mvUPm.cjs");
7
- const require_src$1 = require("./src-Dt66UB0B.cjs");
8
- const require_products = require("./products-CjZof7c2.cjs");
9
- const require_dist$5 = require("./dist-lO2OG0T5.cjs");
7
+ const require_products = require("./products-BKZ1siXg.cjs");
8
+ const require_dist$5 = require("./dist-BF_4vk1z.cjs");
10
9
  let react = require("react");
11
10
  react = require_chunk.__toESM(react);
12
11
  let _tanstack_react_query = require("@tanstack/react-query");
@@ -90,9 +89,23 @@ const shareablesKeys = {
90
89
  }
91
90
  };
92
91
  //#endregion
92
+ //#region ../../shareables/core/src/api-context.tsx
93
+ const ShareablesApiContext = (0, react.createContext)(null);
94
+ function ShareablesApiProvider({ api, children }) {
95
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareablesApiContext.Provider, {
96
+ value: api,
97
+ children
98
+ });
99
+ }
100
+ function useShareablesApi() {
101
+ const ctx = (0, react.useContext)(ShareablesApiContext);
102
+ if (!ctx) throw new Error("useShareablesApi must be used within a ShareablesApiProvider");
103
+ return ctx;
104
+ }
105
+ //#endregion
93
106
  //#region ../../shareables/core/src/hooks/use-share-link.ts
94
107
  function useShareLink(item, shareableType, contactId, locale = "en") {
95
- const client = useShareablesClient();
108
+ const api = useShareablesApi();
96
109
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
97
110
  const isIdRequired = shareableType !== "MySite";
98
111
  const isValidDatabaseId = item?.id && Number.isInteger(item.id) && item.id > 1;
@@ -110,7 +123,7 @@ function useShareLink(item, shareableType, contactId, locale = "en") {
110
123
  ...isIdRequired && item?.id && { relateableId: item.id },
111
124
  ...contactId && { contactId }
112
125
  };
113
- return await require_src$1.createShareLink(client, input);
126
+ return await api.share.createShareLink(input);
114
127
  },
115
128
  enabled: isIdRequired ? Boolean(shouldFetch && item?.id) : true,
116
129
  staleTime: 300 * 1e3,
@@ -132,12 +145,12 @@ function useShareLink(item, shareableType, contactId, locale = "en") {
132
145
  //#endregion
133
146
  //#region ../../shareables/core/src/hooks/use-product-media-counts.ts
134
147
  function useProductMediaCount(productId) {
135
- const client = useShareablesClient();
148
+ const api = useShareablesApi();
136
149
  return (0, _tanstack_react_query.useQuery)({
137
150
  queryKey: shareablesKeys.productMedia.count(productId),
138
151
  queryFn: async () => {
139
152
  try {
140
- return ((await require_src$1.getProductMedia(client, productId)).media || []).length;
153
+ return ((await api.productMedia.getProductMedia(productId)).media || []).length;
141
154
  } catch (error) {
142
155
  console.warn(`Failed to fetch media count for product ${productId}:`, error);
143
156
  return 0;
@@ -151,12 +164,11 @@ function useProductMediaCount(productId) {
151
164
  //#endregion
152
165
  //#region ../../shareables/core/src/hooks/use-media-mutations.ts
153
166
  const useCreateMediaMutation = (options) => {
154
- const client = useShareablesClient();
167
+ const api = useShareablesApi();
155
168
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
156
- const repContext = useRepContext();
157
169
  return (0, _tanstack_react_query.useMutation)({
158
170
  mutationFn: (payload) => {
159
- return require_src$1.createMedia(client, payload, repContext);
171
+ return api.media.createMedia(payload);
160
172
  },
161
173
  onSuccess: (data) => {
162
174
  queryClient.invalidateQueries({ queryKey: shareablesKeys.media.all });
@@ -179,11 +191,11 @@ function isCancellationError(error) {
179
191
  //#endregion
180
192
  //#region ../../shareables/core/src/hooks/use-playlist-mutations.ts
181
193
  const useAddItemToPlaylistMutation = (options) => {
182
- const client = useShareablesClient();
194
+ const api = useShareablesApi();
183
195
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
184
196
  return (0, _tanstack_react_query.useMutation)({
185
197
  mutationFn: ({ playlistId, data }) => {
186
- return require_src$1.addItemToPlaylist(client, playlistId, { items: [data] });
198
+ return api.playlists.addItemToPlaylist(playlistId, { items: [data] });
187
199
  },
188
200
  onMutate: async ({ playlistId, newItem }) => {
189
201
  await queryClient.cancelQueries({ queryKey: shareablesKeys.playlists.detail(playlistId) });
@@ -215,11 +227,11 @@ const useAddItemToPlaylistMutation = (options) => {
215
227
  });
216
228
  };
217
229
  const useRemoveItemsFromPlaylistMutation = (options) => {
218
- const client = useShareablesClient();
230
+ const api = useShareablesApi();
219
231
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
220
232
  return (0, _tanstack_react_query.useMutation)({
221
233
  mutationFn: ({ playlistId, itemIds }) => {
222
- return require_src$1.removeItemsFromPlaylist(client, playlistId, { item_ids: itemIds });
234
+ return api.playlists.removeItemsFromPlaylist(playlistId, { item_ids: itemIds });
223
235
  },
224
236
  onMutate: async ({ playlistId, itemIds }) => {
225
237
  await queryClient.cancelQueries({ queryKey: shareablesKeys.playlists.detail(playlistId) });
@@ -256,11 +268,11 @@ const useRemoveItemsFromPlaylistMutation = (options) => {
256
268
  });
257
269
  };
258
270
  const useCreatePlaylistMutation = (options) => {
259
- const client = useShareablesClient();
271
+ const api = useShareablesApi();
260
272
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
261
273
  return (0, _tanstack_react_query.useMutation)({
262
274
  mutationFn: (input) => {
263
- return require_src$1.createPlaylist(client, input);
275
+ return api.playlists.createPlaylist(input);
264
276
  },
265
277
  onSuccess: (createdPlaylist) => {
266
278
  queryClient.invalidateQueries({ queryKey: shareablesKeys.playlists.all });
@@ -274,11 +286,11 @@ const useCreatePlaylistMutation = (options) => {
274
286
  });
275
287
  };
276
288
  const useUpdatePlaylistMutation = (options) => {
277
- const client = useShareablesClient();
289
+ const api = useShareablesApi();
278
290
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
279
291
  return (0, _tanstack_react_query.useMutation)({
280
292
  mutationFn: ({ playlistId, data }) => {
281
- return require_src$1.updatePlaylist(client, playlistId, data);
293
+ return api.playlists.updatePlaylist(playlistId, data);
282
294
  },
283
295
  onSuccess: (_, { playlistId }) => {
284
296
  queryClient.invalidateQueries({ queryKey: shareablesKeys.playlists.all });
@@ -1097,6 +1109,7 @@ var MarketingAssetsGrid_default = react.default.memo(MarketingAssetsGrid);
1097
1109
  //#endregion
1098
1110
  //#region ../../shareables/ui/src/components/screens/ProductDetailScreen.tsx
1099
1111
  function ProductDetailScreen({ productId, countryCode, onNavigate, onBack }) {
1112
+ const api = useShareablesApi();
1100
1113
  const client = useShareablesClient();
1101
1114
  const { navigate, showToast, onFileDownload } = useShareablesUI();
1102
1115
  const [activeTab, setActiveTab] = (0, react.useState)("All");
@@ -1111,7 +1124,7 @@ function ProductDetailScreen({ productId, countryCode, onNavigate, onBack }) {
1111
1124
  "public",
1112
1125
  productId
1113
1126
  ],
1114
- queryFn: () => require_src$1.getProductMedia(client, Number(productId))
1127
+ queryFn: () => api.productMedia.getProductMedia(Number(productId))
1115
1128
  });
1116
1129
  const { shareLink, loading: shareLinkLoading, error: shareLinkError } = useShareLink({ id: Number(productId) }, "Product");
1117
1130
  const product = productResponse?.product;
@@ -1289,7 +1302,7 @@ function getMediaKindLabel(kind) {
1289
1302
  }
1290
1303
  }
1291
1304
  function MediaListingScreen({ onNavigate }) {
1292
- const client = useShareablesClient();
1305
+ const api = useShareablesApi();
1293
1306
  const repContext = useRepContext();
1294
1307
  const { navigate, readOnly } = useShareablesUI();
1295
1308
  require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => readOnly ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
@@ -1318,12 +1331,12 @@ function MediaListingScreen({ onNavigate }) {
1318
1331
  const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage, error } = (0, _tanstack_react_query.useInfiniteQuery)({
1319
1332
  queryKey: shareablesKeys.media.list(debouncedSearch, sortDesc, repContext),
1320
1333
  queryFn: async ({ pageParam = 1 }) => {
1321
- return (await require_src$1.getMedia(client, {
1334
+ return (await api.media.getMedia({
1322
1335
  page: pageParam,
1323
1336
  per_page: PAGE_SIZE$2,
1324
1337
  search_query: debouncedSearch || void 0,
1325
1338
  sorted_by: sortDesc ? "title_desc" : "title_asc"
1326
- }, repContext)).media;
1339
+ })).media;
1327
1340
  },
1328
1341
  getNextPageParam: (lastPage, allPages) => lastPage.length === PAGE_SIZE$2 ? allPages.length + 1 : void 0,
1329
1342
  initialPageParam: 1
@@ -1473,13 +1486,13 @@ function getBadgeLabel(kind) {
1473
1486
  }
1474
1487
  }
1475
1488
  function MediaDetailScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
1476
- const client = useShareablesClient();
1489
+ const api = useShareablesApi();
1477
1490
  const repContext = useRepContext();
1478
1491
  const { navigate, showToast, onFileDownload } = useShareablesUI();
1479
1492
  const [isDescriptionExpanded, setIsDescriptionExpanded] = (0, react.useState)(false);
1480
1493
  const { data: mediaResponse, isLoading } = (0, _tanstack_react_query.useQuery)({
1481
1494
  queryKey: shareablesKeys.media.detail(Number(mediaId), repContext),
1482
- queryFn: () => require_src$1.getMediaById(client, Number(mediaId), void 0, repContext)
1495
+ queryFn: () => api.media.getMediaById(Number(mediaId))
1483
1496
  });
1484
1497
  const { shareLink, loading: shareLinkLoading, error: shareLinkError } = useShareLink({ id: Number(mediaId) }, "Medium");
1485
1498
  const mediaItem = mediaResponse?.media;
@@ -6929,7 +6942,7 @@ function BulkSelectionBar({ selectedCount, totalCount, onSelectAll, onClearSelec
6929
6942
  const PAGE_SIZE$1 = 12;
6930
6943
  const GRID_CLASS$1 = "grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4";
6931
6944
  function PlaylistsListingScreen(_props) {
6932
- const client = useShareablesClient();
6945
+ const api = useShareablesApi();
6933
6946
  const { navigate, showToast, user, onToggleFavorite, onDeletePlaylist, readOnly } = useShareablesUI();
6934
6947
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
6935
6948
  require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => readOnly ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
@@ -6958,7 +6971,7 @@ function PlaylistsListingScreen(_props) {
6958
6971
  const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage, isFetched, error } = (0, _tanstack_react_query.useInfiniteQuery)({
6959
6972
  queryKey,
6960
6973
  queryFn: async ({ pageParam }) => {
6961
- const response = await require_src$1.getPlaylists(client, {
6974
+ const response = await api.playlists.getPlaylists({
6962
6975
  "filter[title]": debouncedSearch || void 0,
6963
6976
  "page[cursor]": pageParam,
6964
6977
  "page[limit]": PAGE_SIZE$1,
@@ -7429,7 +7442,7 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
7429
7442
  //#region ../../shareables/ui/src/components/screens/PlaylistDetailScreen.tsx
7430
7443
  const DEFAULT_IMAGE$1 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
7431
7444
  function PlaylistDetailScreen({ playlistId, onNavigate }) {
7432
- const client = useShareablesClient();
7445
+ const api = useShareablesApi();
7433
7446
  const { navigate, showToast, onDeletePlaylist, user, readOnly } = useShareablesUI();
7434
7447
  const [isDescriptionExpanded, setIsDescriptionExpanded] = (0, react.useState)(false);
7435
7448
  const [selectedPlaylistItemIndex, setSelectedPlaylistItemIndex] = (0, react.useState)(0);
@@ -7437,7 +7450,7 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
7437
7450
  const [isDeleting, setIsDeleting] = (0, react.useState)(false);
7438
7451
  const { data: playlistResponse, isLoading } = (0, _tanstack_react_query.useQuery)({
7439
7452
  queryKey: shareablesKeys.playlists.detail(Number(playlistId)),
7440
- queryFn: () => require_src$1.getPlaylistById(client, Number(playlistId))
7453
+ queryFn: () => api.playlists.getPlaylistById(Number(playlistId))
7441
7454
  });
7442
7455
  const { shareLink, loading: shareLinkLoading, error: shareLinkError } = useShareLink({ id: Number(playlistId) }, "Library");
7443
7456
  const playlist = playlistResponse?.playlist;
@@ -8289,8 +8302,7 @@ function computeOrderedItems(items) {
8289
8302
  }
8290
8303
  function PlaylistItemsSection({ playlistId }) {
8291
8304
  const { showToast, filePickerClient } = useShareablesUI();
8292
- const shareablesApiClient = useShareablesClient();
8293
- const repContext = useRepContext();
8305
+ const api = useShareablesApi();
8294
8306
  const [filePickerOpen, setFilePickerOpen] = (0, react.useState)(false);
8295
8307
  const { items: contextItems, updateItems, addItem, removeItem } = usePlaylistItems();
8296
8308
  const tableItems = contextItems;
@@ -8409,13 +8421,12 @@ function PlaylistItemsSection({ playlistId }) {
8409
8421
  loading: () => "",
8410
8422
  dismiss: () => {}
8411
8423
  },
8412
- shareablesClient: { media: { list: (filters) => require_src$1.getMedia(shareablesApiClient, filters ?? {}, repContext) } }
8424
+ shareablesClient: { media: { list: (filters) => api.media.getMedia(filters ?? {}) } }
8413
8425
  };
8414
8426
  }, [
8415
8427
  filePickerClient,
8416
8428
  showToast,
8417
- shareablesApiClient,
8418
- repContext
8429
+ api
8419
8430
  ]);
8420
8431
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8421
8432
  className: "border-border bg-card rounded-lg border p-4",
@@ -8567,7 +8578,7 @@ function PlaylistOpenGraphPreview({ playlist, playlistShareBaseUrl }) {
8567
8578
  //#endregion
8568
8579
  //#region ../../shareables/ui/src/components/screens/PlaylistCreateScreen.tsx
8569
8580
  function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onBack, hideHeader, renderHeaderSlot }) {
8570
- const client = useShareablesClient();
8581
+ const api = useShareablesApi();
8571
8582
  const { showToast, navigate, user } = useShareablesUI();
8572
8583
  const { items: contextItems } = usePlaylistItems();
8573
8584
  const { form, updateField, validateForm } = usePlaylistForm();
@@ -8673,7 +8684,7 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
8673
8684
  relateable_id: item.relateable.id,
8674
8685
  order: index + 1
8675
8686
  }));
8676
- await require_src$1.addItemToPlaylist(client, newPlaylistId, { items: itemsData });
8687
+ await api.playlists.addItemToPlaylist(newPlaylistId, { items: itemsData });
8677
8688
  } catch (itemError) {
8678
8689
  console.error("Error adding items to playlist:", itemError);
8679
8690
  showToast({
@@ -8691,7 +8702,7 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
8691
8702
  createMutation,
8692
8703
  updateMutation,
8693
8704
  showToast,
8694
- client,
8705
+ api,
8695
8706
  user?.id
8696
8707
  ]);
8697
8708
  const isSaving = createMutation.isPending || updateMutation.isPending;
@@ -8728,7 +8739,7 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
8728
8739
  ] });
8729
8740
  }
8730
8741
  function PlaylistCreateScreen({ playlistId, onBack, hideHeader, renderHeaderSlot }) {
8731
- const client = useShareablesClient();
8742
+ const api = useShareablesApi();
8732
8743
  const isEditMode = !!playlistId;
8733
8744
  const { data: playlistResponse, isLoading } = (0, _tanstack_react_query.useQuery)({
8734
8745
  queryKey: playlistId ? shareablesKeys.playlists.detail(parseInt(playlistId, 10)) : [
@@ -8736,7 +8747,7 @@ function PlaylistCreateScreen({ playlistId, onBack, hideHeader, renderHeaderSlot
8736
8747
  "detail",
8737
8748
  null
8738
8749
  ],
8739
- queryFn: () => require_src$1.getPlaylistById(client, parseInt(playlistId, 10)),
8750
+ queryFn: () => api.playlists.getPlaylistById(parseInt(playlistId, 10)),
8740
8751
  enabled: isEditMode
8741
8752
  });
8742
8753
  const playlist = playlistResponse?.playlist;
@@ -8773,7 +8784,7 @@ function formatFileSize(bytes) {
8773
8784
  }
8774
8785
  const DEFAULT_IMAGE = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
8775
8786
  function FilesListingScreen({ onNavigate }) {
8776
- const client = useShareablesClient();
8787
+ const api = useShareablesApi();
8777
8788
  const renderImage = useRenderImage();
8778
8789
  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, {
8779
8790
  className: "text-lg",
@@ -8794,7 +8805,7 @@ function FilesListingScreen({ onNavigate }) {
8794
8805
  const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage, error } = (0, _tanstack_react_query.useInfiniteQuery)({
8795
8806
  queryKey: ["shareables-files", debouncedSearch],
8796
8807
  queryFn: async ({ pageParam = 1 }) => {
8797
- return await require_src$1.getFileResources(client, {
8808
+ return await api.fileResources.getFileResources({
8798
8809
  search_query: debouncedSearch || void 0,
8799
8810
  pageParam: pageParam.toString(),
8800
8811
  pageSize: PAGE_SIZE.toString()
@@ -9010,6 +9021,12 @@ Object.defineProperty(exports, "ProductsApp", {
9010
9021
  return ProductsApp;
9011
9022
  }
9012
9023
  });
9024
+ Object.defineProperty(exports, "ShareablesApiProvider", {
9025
+ enumerable: true,
9026
+ get: function() {
9027
+ return ShareablesApiProvider;
9028
+ }
9029
+ });
9013
9030
  Object.defineProperty(exports, "ShareablesApp", {
9014
9031
  enumerable: true,
9015
9032
  get: function() {
@@ -9029,4 +9046,4 @@ Object.defineProperty(exports, "ShareablesUIProvider", {
9029
9046
  }
9030
9047
  });
9031
9048
 
9032
- //# sourceMappingURL=src-bzRRiTN4.cjs.map
9049
+ //# sourceMappingURL=src-BbJs882O.cjs.map