@fluid-app/portal-sdk 0.1.219 → 0.1.220

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 (59) hide show
  1. package/dist/{AppDownloadScreen-CZ0EOIZ5.mjs → AppDownloadScreen-Bhix461K.mjs} +1 -1
  2. package/dist/{AppDownloadScreen-CZ0EOIZ5.mjs.map → AppDownloadScreen-Bhix461K.mjs.map} +1 -1
  3. package/dist/{AppDownloadScreen-CBoC31wL.cjs → AppDownloadScreen-DwBzuPcF.cjs} +1 -1
  4. package/dist/{AppDownloadScreen-CBoC31wL.cjs.map → AppDownloadScreen-DwBzuPcF.cjs.map} +1 -1
  5. package/dist/{MySiteScreen-CyzM9hX3.mjs → MySiteScreen-BAPWqDfm.mjs} +2 -3
  6. package/dist/{MySiteScreen-CyzM9hX3.mjs.map → MySiteScreen-BAPWqDfm.mjs.map} +1 -1
  7. package/dist/{MySiteScreen-DPQ66oRs.cjs → MySiteScreen-CEX1qxdj.cjs} +2 -3
  8. package/dist/{MySiteScreen-DxLcG3-S.cjs → MySiteScreen-DaNlmVSi.cjs} +15 -16
  9. package/dist/{MySiteScreen-DxLcG3-S.cjs.map → MySiteScreen-DaNlmVSi.cjs.map} +1 -1
  10. package/dist/{PortalProductsApiProvider-CE71zDj9.mjs → PortalProductsApiProvider-BwIRudl_.mjs} +1 -1
  11. package/dist/{PortalProductsApiProvider-CE71zDj9.mjs.map → PortalProductsApiProvider-BwIRudl_.mjs.map} +1 -1
  12. package/dist/{PortalProductsApiProvider-Ca1oeTtJ.cjs → PortalProductsApiProvider-CRaocswH.cjs} +1 -1
  13. package/dist/{PortalProductsApiProvider-Ca1oeTtJ.cjs.map → PortalProductsApiProvider-CRaocswH.cjs.map} +1 -1
  14. package/dist/{ShareablesScreen-YlMqyP-B.cjs → ShareablesScreen-CqvPzH1v.cjs} +3 -5
  15. package/dist/{PortalContentApiProvider-x81DXmOR.mjs → ShareablesScreen-DV2nikzp.mjs} +188 -38
  16. package/dist/ShareablesScreen-DV2nikzp.mjs.map +1 -0
  17. package/dist/{PortalContentApiProvider-DXnplIOD.cjs → ShareablesScreen-DwnMBftJ.cjs} +185 -75
  18. package/dist/ShareablesScreen-DwnMBftJ.cjs.map +1 -0
  19. package/dist/{ShopScreen-BOjri6Dm.cjs → ShopScreen-C-Ki6fuh.cjs} +2 -2
  20. package/dist/{ShopScreen-B4afB5sE.mjs → ShopScreen-C2K1C2tt.mjs} +2 -2
  21. package/dist/{ShopScreen-B4afB5sE.mjs.map → ShopScreen-C2K1C2tt.mjs.map} +1 -1
  22. package/dist/{ShopScreen-Untg6XBY.cjs → ShopScreen-smzNn37E.cjs} +2 -2
  23. package/dist/{ShopScreen-Untg6XBY.cjs.map → ShopScreen-smzNn37E.cjs.map} +1 -1
  24. package/dist/{UpgradeScreen-BdY0rCoF.cjs → UpgradeScreen-CNXQ1hcP.cjs} +1 -1
  25. package/dist/{UpgradeScreen-Dau5Elx4.mjs → UpgradeScreen-ChLiVSf7.mjs} +1 -1
  26. package/dist/{UpgradeScreen-Dau5Elx4.mjs.map → UpgradeScreen-ChLiVSf7.mjs.map} +1 -1
  27. package/dist/{UpgradeScreen-DrBa2uzD.cjs → UpgradeScreen-DMJUK4dl.cjs} +1 -1
  28. package/dist/{UpgradeScreen-DrBa2uzD.cjs.map → UpgradeScreen-DMJUK4dl.cjs.map} +1 -1
  29. package/dist/{dist-DWs3-WOI.cjs → dist-Bxa9x0H9.cjs} +218 -1
  30. package/dist/{dist-DWs3-WOI.cjs.map → dist-Bxa9x0H9.cjs.map} +1 -1
  31. package/dist/index.cjs +17 -46
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +1 -20
  34. package/dist/index.d.cts.map +1 -1
  35. package/dist/index.d.mts +1 -20
  36. package/dist/index.d.mts.map +1 -1
  37. package/dist/index.mjs +18 -45
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/{sortable.esm-CJLSD-Ce.mjs → sortable.esm-fSGrAZU2.mjs} +141 -2
  40. package/dist/sortable.esm-fSGrAZU2.mjs.map +1 -0
  41. package/package.json +12 -12
  42. package/dist/PortalContentApiProvider-DXnplIOD.cjs.map +0 -1
  43. package/dist/PortalContentApiProvider-x81DXmOR.mjs.map +0 -1
  44. package/dist/ProductsScreen-3yjIMjYY.cjs +0 -15
  45. package/dist/ProductsScreen-BVyLOe2K.mjs +0 -13
  46. package/dist/ProductsScreen-R0MfWYZJ.cjs +0 -103
  47. package/dist/ProductsScreen-R0MfWYZJ.cjs.map +0 -1
  48. package/dist/ProductsScreen-z9hXfFeJ.mjs +0 -91
  49. package/dist/ProductsScreen-z9hXfFeJ.mjs.map +0 -1
  50. package/dist/ShareablesScreen-Co_gFZva.cjs +0 -200
  51. package/dist/ShareablesScreen-Co_gFZva.cjs.map +0 -1
  52. package/dist/ShareablesScreen-DpwFh0ky.mjs +0 -15
  53. package/dist/ShareablesScreen-tkaf9R5N.mjs +0 -188
  54. package/dist/ShareablesScreen-tkaf9R5N.mjs.map +0 -1
  55. package/dist/sortable.esm-CJLSD-Ce.mjs.map +0 -1
  56. package/dist/use-mysite-portal-D29HLD1z.mjs +0 -142
  57. package/dist/use-mysite-portal-D29HLD1z.mjs.map +0 -1
  58. package/dist/use-mysite-portal-DxNQ3uTi.cjs +0 -220
  59. package/dist/use-mysite-portal-DxNQ3uTi.cjs.map +0 -1
@@ -1,5 +1,144 @@
1
+ import { n as useMySiteApi } from "./mysite-api-context-bXtZ8Gbm.mjs";
1
2
  import React, { createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
3
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
2
4
  import { createPortal, unstable_batchedUpdates } from "react-dom";
5
+ //#region ../../mysite/ui/src/portal/hooks/use-mysite-portal.ts
6
+ const PORTAL_MYSITE_KEYS = {
7
+ profile: () => ["portal-mysite", "profile"],
8
+ links: () => ["portal-mysite", "links"],
9
+ favorites: () => ["portal-mysite", "favorites"],
10
+ themes: () => ["portal-mysite", "themes"]
11
+ };
12
+ function usePortalMySiteProfile() {
13
+ const api = useMySiteApi();
14
+ return useQuery({
15
+ queryKey: PORTAL_MYSITE_KEYS.profile(),
16
+ queryFn: () => api.fetchProfile()
17
+ });
18
+ }
19
+ function usePortalUpdateProfile(options) {
20
+ const api = useMySiteApi();
21
+ const queryClient = useQueryClient();
22
+ return useMutation({
23
+ mutationFn: (body) => api.updateProfile(body),
24
+ onSuccess: (data) => {
25
+ queryClient.setQueryData(PORTAL_MYSITE_KEYS.profile(), data);
26
+ queryClient.invalidateQueries({ queryKey: PORTAL_MYSITE_KEYS.profile() });
27
+ options?.onSuccess?.();
28
+ }
29
+ });
30
+ }
31
+ function usePortalUpdateSettings(options) {
32
+ const api = useMySiteApi();
33
+ const queryClient = useQueryClient();
34
+ return useMutation({
35
+ mutationFn: (body) => api.updateSettings(body),
36
+ onSuccess: () => {
37
+ queryClient.invalidateQueries({ queryKey: PORTAL_MYSITE_KEYS.profile() });
38
+ options?.onSuccess?.();
39
+ }
40
+ });
41
+ }
42
+ function usePortalLinks() {
43
+ const api = useMySiteApi();
44
+ return useQuery({
45
+ queryKey: PORTAL_MYSITE_KEYS.links(),
46
+ queryFn: () => api.listLinks()
47
+ });
48
+ }
49
+ function usePortalCreateLink() {
50
+ const api = useMySiteApi();
51
+ const queryClient = useQueryClient();
52
+ return useMutation({
53
+ mutationFn: (body) => api.createLink(body),
54
+ onSuccess: () => {
55
+ queryClient.invalidateQueries({ queryKey: PORTAL_MYSITE_KEYS.links() });
56
+ }
57
+ });
58
+ }
59
+ function usePortalUpdateLink() {
60
+ const api = useMySiteApi();
61
+ const queryClient = useQueryClient();
62
+ return useMutation({
63
+ mutationFn: ({ linkId, body }) => api.updateLink(linkId, body),
64
+ onSuccess: () => {
65
+ queryClient.invalidateQueries({ queryKey: PORTAL_MYSITE_KEYS.links() });
66
+ }
67
+ });
68
+ }
69
+ function usePortalDeleteLink() {
70
+ const api = useMySiteApi();
71
+ const queryClient = useQueryClient();
72
+ return useMutation({
73
+ mutationFn: (linkId) => api.deleteLink(linkId),
74
+ onSuccess: () => {
75
+ queryClient.invalidateQueries({ queryKey: PORTAL_MYSITE_KEYS.links() });
76
+ }
77
+ });
78
+ }
79
+ function usePortalReorderLinks() {
80
+ const api = useMySiteApi();
81
+ const queryClient = useQueryClient();
82
+ return useMutation({
83
+ mutationFn: ({ orderedIds }) => api.reorderLinks(orderedIds),
84
+ onMutate: async ({ optimisticItems }) => {
85
+ await queryClient.cancelQueries({ queryKey: PORTAL_MYSITE_KEYS.links() });
86
+ const previousData = queryClient.getQueryData(PORTAL_MYSITE_KEYS.links());
87
+ queryClient.setQueryData(PORTAL_MYSITE_KEYS.links(), optimisticItems);
88
+ return { previousData };
89
+ },
90
+ onError: (_err, _vars, context) => {
91
+ if (context?.previousData) queryClient.setQueryData(PORTAL_MYSITE_KEYS.links(), context.previousData);
92
+ },
93
+ onSettled: () => {
94
+ queryClient.invalidateQueries({ queryKey: PORTAL_MYSITE_KEYS.links() });
95
+ }
96
+ });
97
+ }
98
+ function usePortalFavorites() {
99
+ const api = useMySiteApi();
100
+ return useQuery({
101
+ queryKey: PORTAL_MYSITE_KEYS.favorites(),
102
+ queryFn: () => api.listFavorites()
103
+ });
104
+ }
105
+ function usePortalDeleteFavorite() {
106
+ const api = useMySiteApi();
107
+ const queryClient = useQueryClient();
108
+ return useMutation({
109
+ mutationFn: (favoriteId) => api.deleteFavorite(favoriteId),
110
+ onSuccess: () => {
111
+ queryClient.invalidateQueries({ queryKey: PORTAL_MYSITE_KEYS.favorites() });
112
+ }
113
+ });
114
+ }
115
+ function usePortalReorderFavorites() {
116
+ const api = useMySiteApi();
117
+ const queryClient = useQueryClient();
118
+ return useMutation({
119
+ mutationFn: ({ orderedIds }) => api.reorderFavorites(orderedIds),
120
+ onMutate: async ({ optimisticItems }) => {
121
+ await queryClient.cancelQueries({ queryKey: PORTAL_MYSITE_KEYS.favorites() });
122
+ const previousData = queryClient.getQueryData(PORTAL_MYSITE_KEYS.favorites());
123
+ queryClient.setQueryData(PORTAL_MYSITE_KEYS.favorites(), optimisticItems);
124
+ return { previousData };
125
+ },
126
+ onError: (_err, _vars, context) => {
127
+ if (context?.previousData) queryClient.setQueryData(PORTAL_MYSITE_KEYS.favorites(), context.previousData);
128
+ },
129
+ onSettled: () => {
130
+ queryClient.invalidateQueries({ queryKey: PORTAL_MYSITE_KEYS.favorites() });
131
+ }
132
+ });
133
+ }
134
+ function usePortalMySiteThemes() {
135
+ const api = useMySiteApi();
136
+ return useQuery({
137
+ queryKey: PORTAL_MYSITE_KEYS.themes(),
138
+ queryFn: () => api.listThemes()
139
+ });
140
+ }
141
+ //#endregion
3
142
  //#region ../../../node_modules/.pnpm/@dnd-kit+utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js
4
143
  function useCombinedRefs() {
5
144
  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
@@ -3027,6 +3166,6 @@ function isAfter(a, b) {
3027
3166
  return a.data.current.sortable.index < b.data.current.sortable.index;
3028
3167
  }
3029
3168
  //#endregion
3030
- export { verticalListSortingStrategy as a, PointerSensor as c, useSensors as d, CSS as f, useSortable as i, closestCenter as l, arrayMove as n, DndContext as o, sortableKeyboardCoordinates as r, KeyboardSensor as s, SortableContext as t, useSensor as u };
3169
+ export { usePortalUpdateLink as C, usePortalReorderLinks as S, usePortalUpdateSettings as T, usePortalFavorites as _, verticalListSortingStrategy as a, usePortalMySiteThemes as b, PointerSensor as c, useSensors as d, CSS as f, usePortalDeleteLink as g, usePortalDeleteFavorite as h, useSortable as i, closestCenter as l, usePortalCreateLink as m, arrayMove as n, DndContext as o, PORTAL_MYSITE_KEYS as p, sortableKeyboardCoordinates as r, KeyboardSensor as s, SortableContext as t, useSensor as u, usePortalLinks as v, usePortalUpdateProfile as w, usePortalReorderFavorites as x, usePortalMySiteProfile as y };
3031
3170
 
3032
- //# sourceMappingURL=sortable.esm-CJLSD-Ce.mjs.map
3171
+ //# sourceMappingURL=sortable.esm-fSGrAZU2.mjs.map