@fluid-app/portal-sdk 0.1.106 → 0.1.108
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/{AppDownloadScreen-BBpvNeFO.mjs → AppDownloadScreen-BvcyEKCk.mjs} +2 -2
- package/dist/{AppDownloadScreen-BBpvNeFO.mjs.map → AppDownloadScreen-BvcyEKCk.mjs.map} +1 -1
- package/dist/{AppDownloadScreen-Da79ffTK.cjs → AppDownloadScreen-DzFc_CDn.cjs} +2 -2
- package/dist/{AppDownloadScreen-Da79ffTK.cjs.map → AppDownloadScreen-DzFc_CDn.cjs.map} +1 -1
- package/dist/{AppDownloadScreen-R3rcFWzL.cjs → AppDownloadScreen-Uc9N7K_K.cjs} +2 -2
- package/dist/{ContactsScreen-CGyCNeZy.mjs → ContactsScreen-BNqIi0XS.mjs} +5 -5
- package/dist/{ContactsScreen-CGyCNeZy.mjs.map → ContactsScreen-BNqIi0XS.mjs.map} +1 -1
- package/dist/{ContactsScreen-CFC32ATZ.cjs → ContactsScreen-C6cCTl51.cjs} +5 -5
- package/dist/{ContactsScreen-CFC32ATZ.cjs.map → ContactsScreen-C6cCTl51.cjs.map} +1 -1
- package/dist/{ContactsScreen-D81raD2s.cjs → ContactsScreen-D2DYk3A-.cjs} +6 -6
- package/dist/{FluidProvider-DbYLBGGg.cjs → FluidProvider-NnE6s3O0.cjs} +6 -458
- package/dist/FluidProvider-NnE6s3O0.cjs.map +1 -0
- package/dist/{FluidProvider-B59bzF__.mjs → FluidProvider-dTwaHRzI.mjs} +7 -483
- package/dist/FluidProvider-dTwaHRzI.mjs.map +1 -0
- package/dist/{MessagingScreen-TCOhXTPN.cjs → MessagingScreen-C_tCav2Y.cjs} +4 -4
- package/dist/{MessagingScreen-DsH-L7vB.cjs → MessagingScreen-DH0YxaOG.cjs} +8 -10
- package/dist/{MessagingScreen-DsH-L7vB.cjs.map → MessagingScreen-DH0YxaOG.cjs.map} +1 -1
- package/dist/{MessagingScreen-6SfuZqDC.mjs → MessagingScreen-Dv8HVEt-.mjs} +8 -10
- package/dist/MessagingScreen-Dv8HVEt-.mjs.map +1 -0
- package/dist/{MessagingScreen-Bg-7zNye.mjs → MessagingScreen-IzNlAXvD.mjs} +4 -4
- package/dist/{MySiteScreen-DDX4xcMv.cjs → MySiteScreen-Bda8FzQ9.cjs} +3 -3
- package/dist/{MySiteScreen-BHiMCIZ_.cjs → MySiteScreen-DydtAGvt.cjs} +3 -3
- package/dist/{MySiteScreen-BHiMCIZ_.cjs.map → MySiteScreen-DydtAGvt.cjs.map} +1 -1
- package/dist/{MySiteScreen-BI089vJc.mjs → MySiteScreen-t89PLodk.mjs} +3 -3
- package/dist/{MySiteScreen-BI089vJc.mjs.map → MySiteScreen-t89PLodk.mjs.map} +1 -1
- package/dist/{OrdersScreen-BQVbdyrZ.cjs → OrdersScreen-BhJkW3TG.cjs} +4 -4
- package/dist/{OrdersScreen-BQVbdyrZ.cjs.map → OrdersScreen-BhJkW3TG.cjs.map} +1 -1
- package/dist/{OrdersScreen-CaESWLWt.mjs → OrdersScreen-DP1WdqVT.mjs} +4 -4
- package/dist/{OrdersScreen-CaESWLWt.mjs.map → OrdersScreen-DP1WdqVT.mjs.map} +1 -1
- package/dist/{OrdersScreen-BsPW-2wm.cjs → OrdersScreen-DvaV61fj.cjs} +3 -3
- package/dist/{ProductsScreen-Bp_XLYgP.mjs → ProductsScreen-CFLI7j5s.mjs} +7 -7
- package/dist/{ProductsScreen-BFnsUrY1.cjs → ProductsScreen-CI9G5UJh.cjs} +7 -7
- package/dist/{ProductsScreen-ClC1fTWG.mjs → ProductsScreen-sEcByLGy.mjs} +5 -5
- package/dist/{ProductsScreen-ClC1fTWG.mjs.map → ProductsScreen-sEcByLGy.mjs.map} +1 -1
- package/dist/{ProductsScreen-D-mnWuJW.cjs → ProductsScreen-ssonMzdl.cjs} +5 -5
- package/dist/{ProductsScreen-D-mnWuJW.cjs.map → ProductsScreen-ssonMzdl.cjs.map} +1 -1
- package/dist/{ProfileScreen-COpbffE9.cjs → ProfileScreen-BPvudlCM.cjs} +10 -9
- package/dist/{ProfileScreen-COpbffE9.cjs.map → ProfileScreen-BPvudlCM.cjs.map} +1 -1
- package/dist/{ProfileScreen-B1zSJuVE.mjs → ProfileScreen-BWiBC4y3.mjs} +10 -9
- package/dist/{ProfileScreen-B1zSJuVE.mjs.map → ProfileScreen-BWiBC4y3.mjs.map} +1 -1
- package/dist/{ProfileScreen-p9Zqln4n.cjs → ProfileScreen-Bc4znBmb.cjs} +2 -2
- package/dist/{ShareablesScreen-BSOBA2bP.cjs → ShareablesScreen-BvBfPJ69.cjs} +7 -7
- package/dist/{ShareablesScreen-BOwl9-B0.mjs → ShareablesScreen-CIrWSh5q.mjs} +8 -7
- package/dist/{ShareablesScreen-BOwl9-B0.mjs.map → ShareablesScreen-CIrWSh5q.mjs.map} +1 -1
- package/dist/{ShareablesScreen-Bmghdz71.mjs → ShareablesScreen-CtQckby8.mjs} +7 -7
- package/dist/{ShareablesScreen-9toTptRT.cjs → ShareablesScreen-D3JVKFVA.cjs} +9 -8
- package/dist/{ShareablesScreen-9toTptRT.cjs.map → ShareablesScreen-D3JVKFVA.cjs.map} +1 -1
- package/dist/{ShopScreen-Cbv-zrHK.cjs → ShopScreen-BTTKNmtT.cjs} +6 -7
- package/dist/ShopScreen-BTTKNmtT.cjs.map +1 -0
- package/dist/{ShopScreen-BwNZxqnT.mjs → ShopScreen-CDscN4-a.mjs} +6 -7
- package/dist/{ShopScreen-BwNZxqnT.mjs.map → ShopScreen-CDscN4-a.mjs.map} +1 -1
- package/dist/{ShopScreen-M2hCxrwQ.cjs → ShopScreen-TWpb8sxs.cjs} +2 -2
- package/dist/{SubscriptionsScreen-CJwOjaBY.cjs → SubscriptionsScreen-B0drtNfN.cjs} +4 -4
- package/dist/{SubscriptionsScreen-CJwOjaBY.cjs.map → SubscriptionsScreen-B0drtNfN.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-YsIehRb5.mjs → SubscriptionsScreen-D-BXah4H.mjs} +4 -4
- package/dist/{SubscriptionsScreen-YsIehRb5.mjs.map → SubscriptionsScreen-D-BXah4H.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-Bfu-mgGS.cjs → SubscriptionsScreen-WtnN9Ka0.cjs} +4 -4
- package/dist/{UpgradeScreen-DI7DK6qt.cjs → UpgradeScreen-C-aIQL-y.cjs} +1 -1
- package/dist/{UpgradeScreen-DI7DK6qt.cjs.map → UpgradeScreen-C-aIQL-y.cjs.map} +1 -1
- package/dist/{UpgradeScreen-DfDZG52l.cjs → UpgradeScreen-CWgcMBwb.cjs} +1 -1
- package/dist/{UpgradeScreen-CTXUueQY.mjs → UpgradeScreen-GTOZCURK.mjs} +1 -1
- package/dist/{UpgradeScreen-CTXUueQY.mjs.map → UpgradeScreen-GTOZCURK.mjs.map} +1 -1
- package/dist/{dist-oYNtEpKP.mjs → dist-B1HwSrso.mjs} +2 -2
- package/dist/{dist-oYNtEpKP.mjs.map → dist-B1HwSrso.mjs.map} +1 -1
- package/dist/{dist-BSbac3uh.cjs → dist-BF_4vk1z.cjs} +1 -1
- package/dist/{dist-BSbac3uh.cjs.map → dist-BF_4vk1z.cjs.map} +1 -1
- package/dist/{dist-DRVtlgQ1.cjs → dist-BbS_7TvS.cjs} +1 -1
- package/dist/{dist-DRVtlgQ1.cjs.map → dist-BbS_7TvS.cjs.map} +1 -1
- package/dist/{dist-NMbUD0qE.mjs → dist-CMGXkSgZ.mjs} +1 -1
- package/dist/{dist-NMbUD0qE.mjs.map → dist-CMGXkSgZ.mjs.map} +1 -1
- package/dist/{dist-Ck9MGRmE.cjs → dist-DkYXiQQ1.cjs} +2 -2
- package/dist/{dist-Ck9MGRmE.cjs.map → dist-DkYXiQQ1.cjs.map} +1 -1
- package/dist/{es-BCKjXBqj.mjs → es-B84KtbcD.mjs} +1 -1
- package/dist/{es-BCKjXBqj.mjs.map → es-B84KtbcD.mjs.map} +1 -1
- package/dist/{es-DlWO6buB.cjs → es-BSkb3AZk.cjs} +1 -1
- package/dist/{es-DlWO6buB.cjs.map → es-BSkb3AZk.cjs.map} +1 -1
- package/dist/index.cjs +54 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -185
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +70 -185
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +53 -59
- package/dist/index.mjs.map +1 -1
- package/dist/{order-detail-CtTwAXfP.mjs → order-detail-B8jb-YB6.mjs} +1 -1
- package/dist/{order-detail-CtTwAXfP.mjs.map → order-detail-B8jb-YB6.mjs.map} +1 -1
- package/dist/{order-detail-CksE8d5w.cjs → order-detail-Bq7_UZ75.cjs} +1 -1
- package/dist/{order-detail-CksE8d5w.cjs.map → order-detail-Bq7_UZ75.cjs.map} +1 -1
- package/dist/{products-BAtIML76.cjs → products-3BKfOxrs.cjs} +1 -1
- package/dist/{products-BAtIML76.cjs.map → products-3BKfOxrs.cjs.map} +1 -1
- package/dist/{products-StJIeia3.mjs → products-DtutnMu9.mjs} +1 -1
- package/dist/{products-StJIeia3.mjs.map → products-DtutnMu9.mjs.map} +1 -1
- package/dist/{sortable.esm-DSrWP4x9.mjs → sortable.esm-Cz-CP2N8.mjs} +1 -1
- package/dist/{sortable.esm-DSrWP4x9.mjs.map → sortable.esm-Cz-CP2N8.mjs.map} +1 -1
- package/dist/{src-DryOJTBW.mjs → src-CN7diUEw.mjs} +1 -1
- package/dist/{src-DryOJTBW.mjs.map → src-CN7diUEw.mjs.map} +1 -1
- package/dist/{src-xEfkv04t.cjs → src-D5RNExKx.cjs} +6 -6
- package/dist/{src-xEfkv04t.cjs.map → src-D5RNExKx.cjs.map} +1 -1
- package/dist/{src-DjlwUaws.mjs → src-Dhvv96Yt.mjs} +6 -6
- package/dist/{src-DjlwUaws.mjs.map → src-Dhvv96Yt.mjs.map} +1 -1
- package/dist/{src-CMByt6YP.cjs → src-Zv3-NSUf.cjs} +1 -1
- package/dist/{src-CMByt6YP.cjs.map → src-Zv3-NSUf.cjs.map} +1 -1
- package/dist/{use-account-clients-CFM5q2J-.cjs → use-account-clients-CDTUFb6O.cjs} +5 -70
- package/dist/use-account-clients-CDTUFb6O.cjs.map +1 -0
- package/dist/{use-account-clients-BVe69HZV.mjs → use-account-clients-vDDhNW8x.mjs} +6 -65
- package/dist/use-account-clients-vDDhNW8x.mjs.map +1 -0
- package/dist/{use-current-user-CrHH290V.cjs → use-current-user-C7O5SJ_L.cjs} +3 -3
- package/dist/{use-current-user-CrHH290V.cjs.map → use-current-user-C7O5SJ_L.cjs.map} +1 -1
- package/dist/{use-current-user-SmbdS--3.mjs → use-current-user-Czzb9Zc4.mjs} +3 -3
- package/dist/{use-current-user-SmbdS--3.mjs.map → use-current-user-Czzb9Zc4.mjs.map} +1 -1
- package/dist/{use-customer-account-C1ypS2wX.mjs → use-customer-account-DHZ8wLs9.mjs} +6 -7
- package/dist/use-customer-account-DHZ8wLs9.mjs.map +1 -0
- package/dist/{use-customer-account-_IaCM92S.cjs → use-customer-account-zgiEdZ89.cjs} +6 -7
- package/dist/use-customer-account-zgiEdZ89.cjs.map +1 -0
- package/dist/{use-fluid-api-f1PKU6dS.mjs → use-fluid-api-D0kldm0L.mjs} +2 -2
- package/dist/{use-fluid-api-f1PKU6dS.mjs.map → use-fluid-api-D0kldm0L.mjs.map} +1 -1
- package/dist/{use-fluid-api-C2evcv_D.cjs → use-fluid-api-Wjw57-uD.cjs} +2 -2
- package/dist/{use-fluid-api-C2evcv_D.cjs.map → use-fluid-api-Wjw57-uD.cjs.map} +1 -1
- package/dist/use-fluid-auth-BPwsWZNu.cjs +50 -0
- package/dist/use-fluid-auth-BPwsWZNu.cjs.map +1 -0
- package/dist/use-fluid-auth-Dy5K7BQ9.mjs +45 -0
- package/dist/use-fluid-auth-Dy5K7BQ9.mjs.map +1 -0
- package/package.json +9 -9
- package/dist/FluidProvider-B59bzF__.mjs.map +0 -1
- package/dist/FluidProvider-DbYLBGGg.cjs.map +0 -1
- package/dist/MessagingScreen-6SfuZqDC.mjs.map +0 -1
- package/dist/ShopScreen-Cbv-zrHK.cjs.map +0 -1
- package/dist/use-account-clients-BVe69HZV.mjs.map +0 -1
- package/dist/use-account-clients-CFM5q2J-.cjs.map +0 -1
- package/dist/use-customer-account-C1ypS2wX.mjs.map +0 -1
- package/dist/use-customer-account-_IaCM92S.cjs.map +0 -1
- /package/dist/{src-BakNjVTk.mjs → src-B7j_mfeS.mjs} +0 -0
- /package/dist/{src-C_kOrGdZ.cjs → src-Bp-dRR29.cjs} +0 -0
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
3
|
-
const
|
|
2
|
+
const require_FluidProvider = require("./FluidProvider-NnE6s3O0.cjs");
|
|
3
|
+
const require_use_fluid_auth = require("./use-fluid-auth-BPwsWZNu.cjs");
|
|
4
4
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
5
5
|
//#region src/account/use-customer-account.ts
|
|
6
6
|
function useCustomerAccount({ enabled = true } = {}) {
|
|
7
|
-
const {
|
|
7
|
+
const { isAuthenticated, user } = require_use_fluid_auth.useFluidAuth();
|
|
8
8
|
const api = require_FluidProvider.useFluidPayApi();
|
|
9
|
-
const jwt = token ?? "";
|
|
10
9
|
const query = (0, _tanstack_react_query.useQuery)({
|
|
11
10
|
queryKey: ["fluidPayAccount", user?.id],
|
|
12
|
-
queryFn: () => api.customers.fetchAccount(
|
|
13
|
-
enabled:
|
|
11
|
+
queryFn: () => api.customers.fetchAccount(""),
|
|
12
|
+
enabled: isAuthenticated && enabled
|
|
14
13
|
});
|
|
15
14
|
return {
|
|
16
15
|
customerId: query.data?.customer?.id,
|
|
@@ -26,4 +25,4 @@ Object.defineProperty(exports, "useCustomerAccount", {
|
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
27
|
|
|
29
|
-
//# sourceMappingURL=use-customer-account-
|
|
28
|
+
//# sourceMappingURL=use-customer-account-zgiEdZ89.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-customer-account-zgiEdZ89.cjs","names":["useFluidAuth","useFluidPayApi"],"sources":["../src/account/use-customer-account.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useFluidPayApi } from \"@fluid-app/fluid-pay-core\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\n\nexport function useCustomerAccount({\n enabled = true,\n}: { enabled?: boolean } = {}) {\n const { isAuthenticated, user } = useFluidAuth();\n const api = useFluidPayApi();\n\n const query = useQuery({\n queryKey: [\"fluidPayAccount\", user?.id],\n // Session-based auth: fluid-pay APIs still accept a JWT parameter but\n // credentials are sent via HTTP-only cookies. Pass empty string until\n // fluid-pay-core is migrated to session auth.\n queryFn: () => api.customers.fetchAccount(\"\"),\n enabled: isAuthenticated && enabled,\n });\n\n return {\n customerId: query.data?.customer?.id,\n isLoadingCustomer: query.isLoading,\n isCustomerError: query.isError,\n };\n}\n"],"mappings":";;;;;AAIA,SAAgB,mBAAmB,EACjC,UAAU,SACe,EAAE,EAAE;CAC7B,MAAM,EAAE,iBAAiB,SAASA,uBAAAA,cAAc;CAChD,MAAM,MAAMC,sBAAAA,gBAAgB;CAE5B,MAAM,SAAA,GAAA,sBAAA,UAAiB;EACrB,UAAU,CAAC,mBAAmB,MAAM,GAAG;EAIvC,eAAe,IAAI,UAAU,aAAa,GAAG;EAC7C,SAAS,mBAAmB;EAC7B,CAAC;AAEF,QAAO;EACL,YAAY,MAAM,MAAM,UAAU;EAClC,mBAAmB,MAAM;EACzB,iBAAiB,MAAM;EACxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useFluidContext } from "./FluidProvider-
|
|
1
|
+
import { n as useFluidContext } from "./FluidProvider-dTwaHRzI.mjs";
|
|
2
2
|
//#region src/hooks/use-fluid-api.ts
|
|
3
3
|
/**
|
|
4
4
|
* Hook to access the Fluid API client
|
|
@@ -24,4 +24,4 @@ function useFluidApi() {
|
|
|
24
24
|
//#endregion
|
|
25
25
|
export { useFluidApi as t };
|
|
26
26
|
|
|
27
|
-
//# sourceMappingURL=use-fluid-api-
|
|
27
|
+
//# sourceMappingURL=use-fluid-api-D0kldm0L.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fluid-api-
|
|
1
|
+
{"version":3,"file":"use-fluid-api-D0kldm0L.mjs","names":[],"sources":["../src/hooks/use-fluid-api.ts"],"sourcesContent":["import { useFluidContext } from \"../providers/FluidProvider\";\nimport type { FluidClient } from \"../client/fluid-client\";\n\n/**\n * Hook to access the Fluid API client\n *\n * @example\n * ```tsx\n * function ProductList() {\n * const api = useFluidApi();\n *\n * const { data: products } = useQuery({\n * queryKey: [\"products\"],\n * queryFn: () => api.products.list(),\n * });\n *\n * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;\n * }\n * ```\n */\nexport function useFluidApi(): FluidClient {\n const { client } = useFluidContext();\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,cAA2B;CACzC,MAAM,EAAE,WAAW,iBAAiB;AACpC,QAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
1
|
+
const require_FluidProvider = require("./FluidProvider-NnE6s3O0.cjs");
|
|
2
2
|
//#region src/hooks/use-fluid-api.ts
|
|
3
3
|
/**
|
|
4
4
|
* Hook to access the Fluid API client
|
|
@@ -29,4 +29,4 @@ Object.defineProperty(exports, "useFluidApi", {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=use-fluid-api-
|
|
32
|
+
//# sourceMappingURL=use-fluid-api-Wjw57-uD.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fluid-api-
|
|
1
|
+
{"version":3,"file":"use-fluid-api-Wjw57-uD.cjs","names":["useFluidContext"],"sources":["../src/hooks/use-fluid-api.ts"],"sourcesContent":["import { useFluidContext } from \"../providers/FluidProvider\";\nimport type { FluidClient } from \"../client/fluid-client\";\n\n/**\n * Hook to access the Fluid API client\n *\n * @example\n * ```tsx\n * function ProductList() {\n * const api = useFluidApi();\n *\n * const { data: products } = useQuery({\n * queryKey: [\"products\"],\n * queryFn: () => api.products.list(),\n * });\n *\n * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;\n * }\n * ```\n */\nexport function useFluidApi(): FluidClient {\n const { client } = useFluidContext();\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,cAA2B;CACzC,MAAM,EAAE,WAAWA,sBAAAA,iBAAiB;AACpC,QAAO"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const require_FluidProvider = require("./FluidProvider-NnE6s3O0.cjs");
|
|
2
|
+
//#region src/hooks/use-fluid-auth.ts
|
|
3
|
+
/**
|
|
4
|
+
* useFluidAuth Hook
|
|
5
|
+
*
|
|
6
|
+
* Provides access to authentication state and utilities.
|
|
7
|
+
* This is the primary hook for interacting with auth in components.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Hook to access authentication state and utilities.
|
|
11
|
+
*
|
|
12
|
+
* Must be used within a `FluidAuthProvider`.
|
|
13
|
+
*
|
|
14
|
+
* @returns Authentication context with user info, loading state, and utilities
|
|
15
|
+
* @throws Error if used outside FluidAuthProvider
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* function UserProfile() {
|
|
20
|
+
* const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();
|
|
21
|
+
*
|
|
22
|
+
* if (isLoading) {
|
|
23
|
+
* return <Spinner />;
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* if (!isAuthenticated) {
|
|
27
|
+
* return <p>Please log in</p>;
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* return (
|
|
31
|
+
* <div>
|
|
32
|
+
* <p>Welcome, {user.full_name}!</p>
|
|
33
|
+
* <button onClick={clearAuth}>Log out</button>
|
|
34
|
+
* </div>
|
|
35
|
+
* );
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function useFluidAuth() {
|
|
40
|
+
return require_FluidProvider.useFluidAuthContext();
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
Object.defineProperty(exports, "useFluidAuth", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function() {
|
|
46
|
+
return useFluidAuth;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=use-fluid-auth-BPwsWZNu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-fluid-auth-BPwsWZNu.cjs","names":["useFluidAuthContext"],"sources":["../src/hooks/use-fluid-auth.ts"],"sourcesContent":["/**\n * useFluidAuth Hook\n *\n * Provides access to authentication state and utilities.\n * This is the primary hook for interacting with auth in components.\n */\n\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\nimport type { FluidAuthContextValue } from \"../auth/types\";\n\n/**\n * Hook to access authentication state and utilities.\n *\n * Must be used within a `FluidAuthProvider`.\n *\n * @returns Authentication context with user info, loading state, and utilities\n * @throws Error if used outside FluidAuthProvider\n *\n * @example\n * ```tsx\n * function UserProfile() {\n * const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();\n *\n * if (isLoading) {\n * return <Spinner />;\n * }\n *\n * if (!isAuthenticated) {\n * return <p>Please log in</p>;\n * }\n *\n * return (\n * <div>\n * <p>Welcome, {user.full_name}!</p>\n * <button onClick={clearAuth}>Log out</button>\n * </div>\n * );\n * }\n * ```\n */\nexport function useFluidAuth(): FluidAuthContextValue {\n return useFluidAuthContext();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,eAAsC;AACpD,QAAOA,sBAAAA,qBAAqB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { l as useFluidAuthContext } from "./FluidProvider-dTwaHRzI.mjs";
|
|
2
|
+
//#region src/hooks/use-fluid-auth.ts
|
|
3
|
+
/**
|
|
4
|
+
* useFluidAuth Hook
|
|
5
|
+
*
|
|
6
|
+
* Provides access to authentication state and utilities.
|
|
7
|
+
* This is the primary hook for interacting with auth in components.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Hook to access authentication state and utilities.
|
|
11
|
+
*
|
|
12
|
+
* Must be used within a `FluidAuthProvider`.
|
|
13
|
+
*
|
|
14
|
+
* @returns Authentication context with user info, loading state, and utilities
|
|
15
|
+
* @throws Error if used outside FluidAuthProvider
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* function UserProfile() {
|
|
20
|
+
* const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();
|
|
21
|
+
*
|
|
22
|
+
* if (isLoading) {
|
|
23
|
+
* return <Spinner />;
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* if (!isAuthenticated) {
|
|
27
|
+
* return <p>Please log in</p>;
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* return (
|
|
31
|
+
* <div>
|
|
32
|
+
* <p>Welcome, {user.full_name}!</p>
|
|
33
|
+
* <button onClick={clearAuth}>Log out</button>
|
|
34
|
+
* </div>
|
|
35
|
+
* );
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function useFluidAuth() {
|
|
40
|
+
return useFluidAuthContext();
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { useFluidAuth as t };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=use-fluid-auth-Dy5K7BQ9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-fluid-auth-Dy5K7BQ9.mjs","names":[],"sources":["../src/hooks/use-fluid-auth.ts"],"sourcesContent":["/**\n * useFluidAuth Hook\n *\n * Provides access to authentication state and utilities.\n * This is the primary hook for interacting with auth in components.\n */\n\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\nimport type { FluidAuthContextValue } from \"../auth/types\";\n\n/**\n * Hook to access authentication state and utilities.\n *\n * Must be used within a `FluidAuthProvider`.\n *\n * @returns Authentication context with user info, loading state, and utilities\n * @throws Error if used outside FluidAuthProvider\n *\n * @example\n * ```tsx\n * function UserProfile() {\n * const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();\n *\n * if (isLoading) {\n * return <Spinner />;\n * }\n *\n * if (!isAuthenticated) {\n * return <p>Please log in</p>;\n * }\n *\n * return (\n * <div>\n * <p>Welcome, {user.full_name}!</p>\n * <button onClick={clearAuth}>Log out</button>\n * </div>\n * );\n * }\n * ```\n */\nexport function useFluidAuth(): FluidAuthContextValue {\n return useFluidAuthContext();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,eAAsC;AACpD,QAAO,qBAAqB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-app/portal-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.108",
|
|
4
4
|
"description": "SDK for building custom Fluid portals",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -68,41 +68,41 @@
|
|
|
68
68
|
"@fluid-app/api-client-core": "0.1.0",
|
|
69
69
|
"@fluid-app/auth": "0.1.0",
|
|
70
70
|
"@fluid-app/cart-ui": "0.1.13",
|
|
71
|
+
"@fluid-app/company-switcher-ui": "0.1.0",
|
|
71
72
|
"@fluid-app/company-switcher-core": "0.1.0",
|
|
72
73
|
"@fluid-app/contacts-core": "0.1.0",
|
|
73
|
-
"@fluid-app/company-switcher-ui": "0.1.0",
|
|
74
74
|
"@fluid-app/contacts-ui": "0.1.0",
|
|
75
75
|
"@fluid-app/file-picker-api-client": "0.1.0",
|
|
76
76
|
"@fluid-app/fluid-pay-api-client": "0.1.0",
|
|
77
77
|
"@fluid-app/fluid-pay-core": "0.1.0",
|
|
78
|
-
"@fluid-app/fluidos-api-client": "0.1.0",
|
|
79
78
|
"@fluid-app/messaging-api-client": "0.1.0",
|
|
80
79
|
"@fluid-app/messaging-core": "0.1.0",
|
|
81
80
|
"@fluid-app/messaging-ui": "0.1.0",
|
|
82
81
|
"@fluid-app/mysite-ui": "0.1.0",
|
|
82
|
+
"@fluid-app/fluidos-api-client": "0.1.0",
|
|
83
|
+
"@fluid-app/orders-api-client": "0.1.0",
|
|
83
84
|
"@fluid-app/orders-core": "0.1.0",
|
|
84
85
|
"@fluid-app/orders-ui": "0.1.0",
|
|
85
|
-
"@fluid-app/orders-api-client": "0.1.0",
|
|
86
|
-
"@fluid-app/portal-app-download-ui": "0.1.0",
|
|
87
86
|
"@fluid-app/permissions": "0.1.0",
|
|
88
87
|
"@fluid-app/portal-core": "0.1.23",
|
|
89
88
|
"@fluid-app/portal-pro-upgrade-ui": "0.1.0",
|
|
89
|
+
"@fluid-app/portal-app-download-ui": "0.1.0",
|
|
90
90
|
"@fluid-app/portal-preview": "0.1.0",
|
|
91
91
|
"@fluid-app/portal-react": "0.1.0",
|
|
92
|
-
"@fluid-app/products-api-client": "0.1.0",
|
|
93
92
|
"@fluid-app/portal-widgets": "0.1.22",
|
|
94
93
|
"@fluid-app/products-core": "0.1.0",
|
|
95
|
-
"@fluid-app/
|
|
94
|
+
"@fluid-app/products-api-client": "0.1.0",
|
|
96
95
|
"@fluid-app/profile-ui": "0.1.0",
|
|
96
|
+
"@fluid-app/profile-core": "0.1.0",
|
|
97
97
|
"@fluid-app/query-persister": "0.1.0",
|
|
98
|
+
"@fluid-app/shareables-core": "0.1.0",
|
|
98
99
|
"@fluid-app/shareables-api-client": "0.1.0",
|
|
99
|
-
"@fluid-app/shareables-ui": "0.1.0",
|
|
100
100
|
"@fluid-app/shop-ui": "0.1.0",
|
|
101
|
-
"@fluid-app/shareables-core": "0.1.0",
|
|
102
101
|
"@fluid-app/subscriptions-api-client": "0.1.0",
|
|
103
102
|
"@fluid-app/subscriptions-core": "0.1.0",
|
|
104
103
|
"@fluid-app/subscriptions-ui": "0.1.0",
|
|
105
104
|
"@fluid-app/typescript-config": "0.0.0",
|
|
105
|
+
"@fluid-app/shareables-ui": "0.1.0",
|
|
106
106
|
"@fluid-app/ui-primitives": "0.1.13",
|
|
107
107
|
"@fluid-app/user-contacts-api-client": "0.1.0",
|
|
108
108
|
"@fluid-app/user-notes-api-client": "0.1.0",
|