@fluid-app/portal-sdk 0.1.142 → 0.1.143
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-CO-wctCB.cjs → AppDownloadScreen-BgG2WT8g.cjs} +2 -2
- package/dist/{AppDownloadScreen-CO-wctCB.cjs.map → AppDownloadScreen-BgG2WT8g.cjs.map} +1 -1
- package/dist/{AppDownloadScreen-Df1OPjkx.mjs → AppDownloadScreen-CFBcywVF.mjs} +2 -2
- package/dist/{AppDownloadScreen-Df1OPjkx.mjs.map → AppDownloadScreen-CFBcywVF.mjs.map} +1 -1
- package/dist/{AppDownloadScreen-nz3fgOVF.cjs → AppDownloadScreen-CfyCY70_.cjs} +2 -2
- package/dist/{ContactsScreen-cWDFP8e-.mjs → ContactsScreen-B0CcTg4i.mjs} +2 -2
- package/dist/{ContactsScreen-cWDFP8e-.mjs.map → ContactsScreen-B0CcTg4i.mjs.map} +1 -1
- package/dist/{ContactsScreen-BPeQemgG.cjs → ContactsScreen-C2SykfSe.cjs} +2 -2
- package/dist/{ContactsScreen-BPeQemgG.cjs.map → ContactsScreen-C2SykfSe.cjs.map} +1 -1
- package/dist/{ContactsScreen-gJB99SIY.cjs → ContactsScreen-cq-zMYwU.cjs} +2 -2
- package/dist/{FluidProvider-DAe8xcAD.cjs → FluidProvider-9laphShJ.cjs} +67 -20
- package/dist/FluidProvider-9laphShJ.cjs.map +1 -0
- package/dist/{FluidProvider-BIoYteOA.mjs → FluidProvider-D8lmeIsK.mjs} +62 -9
- package/dist/FluidProvider-D8lmeIsK.mjs.map +1 -0
- package/dist/{MessagingScreen-BsABB4tn.cjs → MessagingScreen-CQGyTGz7.cjs} +2 -2
- package/dist/{MessagingScreen-BgY-m0Pm.cjs → MessagingScreen-DY8FhtNu.cjs} +3 -3
- package/dist/{MessagingScreen-BgY-m0Pm.cjs.map → MessagingScreen-DY8FhtNu.cjs.map} +1 -1
- package/dist/{MessagingScreen-DKXOCrBj.mjs → MessagingScreen-DmwSYXYa.mjs} +3 -3
- package/dist/{MessagingScreen-DKXOCrBj.mjs.map → MessagingScreen-DmwSYXYa.mjs.map} +1 -1
- package/dist/{MySiteScreen-BTF8MZCU.cjs → MySiteScreen-3uoP4Nro.cjs} +2 -2
- package/dist/{MySiteScreen-D8lFT21T.mjs → MySiteScreen-CP4ePv25.mjs} +2 -2
- package/dist/{MySiteScreen-D8lFT21T.mjs.map → MySiteScreen-CP4ePv25.mjs.map} +1 -1
- package/dist/{MySiteScreen-DVjRy-nI.cjs → MySiteScreen-CZf06WvK.cjs} +2 -2
- package/dist/{MySiteScreen-DVjRy-nI.cjs.map → MySiteScreen-CZf06WvK.cjs.map} +1 -1
- package/dist/{OrdersScreen-CbCus7pT.cjs → OrdersScreen-B4s3yqWO.cjs} +2 -2
- package/dist/{OrdersScreen-CbCus7pT.cjs.map → OrdersScreen-B4s3yqWO.cjs.map} +1 -1
- package/dist/{OrdersScreen-BHtq-tvn.mjs → OrdersScreen-DE1lIZKm.mjs} +2 -2
- package/dist/{OrdersScreen-BHtq-tvn.mjs.map → OrdersScreen-DE1lIZKm.mjs.map} +1 -1
- package/dist/{OrdersScreen-BB_n4hgl.cjs → OrdersScreen-qnOfswUT.cjs} +2 -2
- package/dist/{ProductsScreen-CP29k8Z3.cjs → ProductsScreen-Bq1Q_T06.cjs} +2 -2
- package/dist/{ProductsScreen-CuMgdka9.cjs → ProductsScreen-CC1BM7Ye.cjs} +5 -5
- package/dist/{ProductsScreen-CuMgdka9.cjs.map → ProductsScreen-CC1BM7Ye.cjs.map} +1 -1
- package/dist/{ProductsScreen-DSgwSnVj.mjs → ProductsScreen-DA0yNpXn.mjs} +3 -2
- package/dist/{ProductsScreen-CU8nGFN5.mjs → ProductsScreen-chLWiA1J.mjs} +5 -5
- package/dist/{ProductsScreen-CU8nGFN5.mjs.map → ProductsScreen-chLWiA1J.mjs.map} +1 -1
- package/dist/{ProfileScreen-CjrhOuY3.cjs → ProfileScreen-CxvAKgdU.cjs} +2 -2
- package/dist/{ProfileScreen-CDZ632ue.cjs → ProfileScreen-Dm8EcLVL.cjs} +5 -5
- package/dist/{ProfileScreen-CDZ632ue.cjs.map → ProfileScreen-Dm8EcLVL.cjs.map} +1 -1
- package/dist/{ProfileScreen-BajH0_kR.mjs → ProfileScreen-DmV9jRth.mjs} +4 -4
- package/dist/{ProfileScreen-BajH0_kR.mjs.map → ProfileScreen-DmV9jRth.mjs.map} +1 -1
- package/dist/{ShareablesScreen-F3ockfKE.mjs → ShareablesScreen-B9iGTVVk.mjs} +6 -6
- package/dist/{ShareablesScreen-F3ockfKE.mjs.map → ShareablesScreen-B9iGTVVk.mjs.map} +1 -1
- package/dist/{ShareablesScreen-acj-gCLe.cjs → ShareablesScreen-CNmjazDa.cjs} +2 -2
- package/dist/{ShareablesScreen-ITLkfDHV.cjs → ShareablesScreen-CVkk0Lpn.cjs} +6 -6
- package/dist/{ShareablesScreen-ITLkfDHV.cjs.map → ShareablesScreen-CVkk0Lpn.cjs.map} +1 -1
- package/dist/{ShareablesScreen-B63fbgRJ.mjs → ShareablesScreen-D7cFD7Sn.mjs} +3 -2
- package/dist/{ShopScreen-3Z-9TKeI.cjs → ShopScreen-B5GJr-kG.cjs} +4 -4
- package/dist/{ShopScreen-3Z-9TKeI.cjs.map → ShopScreen-B5GJr-kG.cjs.map} +1 -1
- package/dist/{ShopScreen-DdIlnLcB.mjs → ShopScreen-BdyMXm0s.mjs} +4 -4
- package/dist/{ShopScreen-DdIlnLcB.mjs.map → ShopScreen-BdyMXm0s.mjs.map} +1 -1
- package/dist/{ShopScreen-Bit0Fdgr.cjs → ShopScreen-Che0Axn9.cjs} +2 -2
- package/dist/{SubscriptionsScreen-B2-iZojm.mjs → SubscriptionsScreen-BqiGuMsz.mjs} +3 -3
- package/dist/{SubscriptionsScreen-B2-iZojm.mjs.map → SubscriptionsScreen-BqiGuMsz.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-01RuJl73.cjs → SubscriptionsScreen-DHYHBWVD.cjs} +2 -2
- package/dist/{SubscriptionsScreen-DV5RUV66.cjs → SubscriptionsScreen-xNd35SPG.cjs} +3 -3
- package/dist/{SubscriptionsScreen-DV5RUV66.cjs.map → SubscriptionsScreen-xNd35SPG.cjs.map} +1 -1
- package/dist/index.cjs +34 -34
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +34 -34
- package/dist/{use-account-clients-CNDyBxm7.mjs → use-account-clients-B6QsWPOL.mjs} +3 -47
- package/dist/use-account-clients-B6QsWPOL.mjs.map +1 -0
- package/dist/{use-account-clients-nmrVvm98.cjs → use-account-clients-CrfXjWkZ.cjs} +2 -52
- package/dist/use-account-clients-CrfXjWkZ.cjs.map +1 -0
- package/dist/{use-current-user-5Kr_1nZZ.cjs → use-current-user-BcmQRCRx.cjs} +3 -3
- package/dist/{use-current-user-5Kr_1nZZ.cjs.map → use-current-user-BcmQRCRx.cjs.map} +1 -1
- package/dist/{use-current-user-DAxsYRk-.mjs → use-current-user-tKZEo3eh.mjs} +3 -3
- package/dist/{use-current-user-DAxsYRk-.mjs.map → use-current-user-tKZEo3eh.mjs.map} +1 -1
- package/dist/{use-fluid-api-BJ-PZ0Zx.mjs → use-fluid-api-9llkapbM.mjs} +2 -2
- package/dist/{use-fluid-api-BJ-PZ0Zx.mjs.map → use-fluid-api-9llkapbM.mjs.map} +1 -1
- package/dist/{use-fluid-api-uEqwymly.cjs → use-fluid-api-Cj5Bow8S.cjs} +2 -2
- package/dist/{use-fluid-api-uEqwymly.cjs.map → use-fluid-api-Cj5Bow8S.cjs.map} +1 -1
- package/dist/{use-fluid-auth-DXDtI7Ep.cjs → use-fluid-auth-D4NGGBW0.cjs} +2 -2
- package/dist/{use-fluid-auth-DXDtI7Ep.cjs.map → use-fluid-auth-D4NGGBW0.cjs.map} +1 -1
- package/dist/{use-fluid-auth-DrtkGGwT.mjs → use-fluid-auth-vb2QMUi4.mjs} +2 -2
- package/dist/{use-fluid-auth-DrtkGGwT.mjs.map → use-fluid-auth-vb2QMUi4.mjs.map} +1 -1
- package/dist/{use-portal-products-client-CXZj-fKI.cjs → use-portal-products-client-3JPetPQU.cjs} +2 -2
- package/dist/{use-portal-products-client-CXZj-fKI.cjs.map → use-portal-products-client-3JPetPQU.cjs.map} +1 -1
- package/dist/{use-portal-products-client-zvmWMf8p.mjs → use-portal-products-client-CJjec9vb.mjs} +2 -2
- package/dist/{use-portal-products-client-zvmWMf8p.mjs.map → use-portal-products-client-CJjec9vb.mjs.map} +1 -1
- package/package.json +15 -15
- package/dist/FluidProvider-BIoYteOA.mjs.map +0 -1
- package/dist/FluidProvider-DAe8xcAD.cjs.map +0 -1
- package/dist/use-account-clients-CNDyBxm7.mjs.map +0 -1
- package/dist/use-account-clients-nmrVvm98.cjs.map +0 -1
|
@@ -491,6 +491,15 @@ function useAppDefinitionApi() {
|
|
|
491
491
|
return api;
|
|
492
492
|
}
|
|
493
493
|
//#endregion
|
|
494
|
+
//#region ../core/src/account-api-context.ts
|
|
495
|
+
const AccountApiContext = createContext(null);
|
|
496
|
+
const AccountApiProvider = AccountApiContext.Provider;
|
|
497
|
+
function useAccountApi() {
|
|
498
|
+
const api = useContext(AccountApiContext);
|
|
499
|
+
if (!api) throw new Error("useAccountApi must be used within an AccountApiProvider");
|
|
500
|
+
return api;
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
494
503
|
//#region ../../platform/api-client-core/src/fetch-client.ts
|
|
495
504
|
/**
|
|
496
505
|
* API Error class compatible with fluid-admin's ApiError
|
|
@@ -2284,6 +2293,46 @@ function createAppDefinitionApiAdapter(client) {
|
|
|
2284
2293
|
} };
|
|
2285
2294
|
}
|
|
2286
2295
|
//#endregion
|
|
2296
|
+
//#region src/adapters/account-api-adapter.ts
|
|
2297
|
+
function mapAccount(raw) {
|
|
2298
|
+
return {
|
|
2299
|
+
id: raw.id ?? 0,
|
|
2300
|
+
member_type: raw.member_type ?? "rep",
|
|
2301
|
+
first_name: raw.first_name ?? "",
|
|
2302
|
+
last_name: raw.last_name ?? "",
|
|
2303
|
+
email: raw.email ?? "",
|
|
2304
|
+
phone: raw.phone ?? null,
|
|
2305
|
+
bio: raw.bio ?? null,
|
|
2306
|
+
avatar_url: raw.avatar_url ?? null,
|
|
2307
|
+
slug: raw.slug ?? "",
|
|
2308
|
+
social_links: raw.social_links ?? null
|
|
2309
|
+
};
|
|
2310
|
+
}
|
|
2311
|
+
function createAccountApiAdapter(client) {
|
|
2312
|
+
return {
|
|
2313
|
+
fetchAccount: async () => {
|
|
2314
|
+
const response = await account_show(client);
|
|
2315
|
+
return {
|
|
2316
|
+
account: mapAccount(response.account ?? {}),
|
|
2317
|
+
meta: {
|
|
2318
|
+
request_id: response.meta?.request_id ?? "",
|
|
2319
|
+
timestamp: response.meta?.timestamp ?? ""
|
|
2320
|
+
}
|
|
2321
|
+
};
|
|
2322
|
+
},
|
|
2323
|
+
updateAccount: async (body) => {
|
|
2324
|
+
const response = await account_update(client, body);
|
|
2325
|
+
return {
|
|
2326
|
+
account: mapAccount(response.account ?? {}),
|
|
2327
|
+
meta: {
|
|
2328
|
+
request_id: response.meta?.request_id ?? "",
|
|
2329
|
+
timestamp: response.meta?.timestamp ?? ""
|
|
2330
|
+
}
|
|
2331
|
+
};
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2334
|
+
}
|
|
2335
|
+
//#endregion
|
|
2287
2336
|
//#region src/providers/FluidThemeProvider.tsx
|
|
2288
2337
|
/**
|
|
2289
2338
|
* Theme Provider for Fluid SDK
|
|
@@ -2645,6 +2694,7 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
|
|
|
2645
2694
|
defaultHeaders: { ...csrfToken ? { "X-CSRF-Token": csrfToken } : {} }
|
|
2646
2695
|
}), [config.baseUrl, csrfToken]);
|
|
2647
2696
|
const appDefinitionApi = useMemo(() => createAppDefinitionApiAdapter(portalTenantClient), [portalTenantClient]);
|
|
2697
|
+
const accountApi = useMemo(() => createAccountApiAdapter(portalTenantClient), [portalTenantClient]);
|
|
2648
2698
|
const contextValue = useMemo(() => ({
|
|
2649
2699
|
client,
|
|
2650
2700
|
config: configRef.current
|
|
@@ -2679,13 +2729,16 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
|
|
|
2679
2729
|
value: fluidOsApi,
|
|
2680
2730
|
children: /* @__PURE__ */ jsx(AppDefinitionApiProvider, {
|
|
2681
2731
|
value: appDefinitionApi,
|
|
2682
|
-
children: /* @__PURE__ */ jsx(
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2732
|
+
children: /* @__PURE__ */ jsx(AccountApiProvider, {
|
|
2733
|
+
value: accountApi,
|
|
2734
|
+
children: /* @__PURE__ */ jsx(ProviderStack, {
|
|
2735
|
+
baseUrl: dataSourceBaseUrl,
|
|
2736
|
+
getApiHeaders,
|
|
2737
|
+
variables: effectiveVariables,
|
|
2738
|
+
registry,
|
|
2739
|
+
themeProviderProps,
|
|
2740
|
+
children
|
|
2741
|
+
})
|
|
2689
2742
|
})
|
|
2690
2743
|
})
|
|
2691
2744
|
})
|
|
@@ -2721,6 +2774,6 @@ function useFluidContext() {
|
|
|
2721
2774
|
return context;
|
|
2722
2775
|
}
|
|
2723
2776
|
//#endregion
|
|
2724
|
-
export { AUTH_CONSTANTS as $, DEFAULT_FONT_FAMILIES as A, getForegroundColor as B, removeTheme as C,
|
|
2777
|
+
export { AUTH_CONSTANTS as $, DEFAULT_FONT_FAMILIES as A, getForegroundColor as B, removeTheme as C, deserialiseTheme as D, transformThemes as E, DEFAULT_THEME_NAME as F, FONT_SIZE_KEYS as G, parseColor as H, getDefaultThemeDefinition as I, SHADE_STEPS as J, RADIUS_KEYS as K, generateThemeCSS as L, DEFAULT_RADII as M, DEFAULT_SPACING as N, serialiseTheme as O, DEFAULT_THEME_ID as P, clearTokens as Q, deriveDarkVariant as R, removeAllThemes as S, deleteDatabase as St, getActiveThemeId as T, resolveTheme as U, mergeDarkOverrides as V, FONT_FAMILY_KEYS as W, createDefaultAuthRedirect as X, DEFAULT_AUTH_URL as Y, cleanTokenFromUrl as Z, transformManifestToRepAppData as _, createFetchClient as _t, createScreen as a, products_media_list as at, toScreenDefinition as b, useFluidOsApiOptional as bt, FluidAuthProvider as c, subscriptions_cancel as ct, FluidThemeProvider as d, subscriptions_reactivate as dt, USER_TYPES as et, useThemeContext as f, subscriptions_resume as ft, toRawManifest as g, ApiError$1 as gt, isApiError as h, subscriptions_update as ht, widgetPropertySchemas as i, products_list as it, DEFAULT_FONT_SIZES as j, DEFAULT_COLORS as k, useFluidAuthContext as l, subscriptions_list as lt, createFluidClient as m, subscriptions_skip as mt, useFluidContext as n, orders_list as nt, createWidgetFromShareable as o, products_search as ot, ApiError as p, subscriptions_show as pt, SEMANTIC_COLOR_NAMES as q, DEFAULT_SDK_WIDGET_REGISTRY as r, orders_show as rt, createWidgetRegistry as s, products_show as st, FluidProvider as t, isUserType as tt, usePortalTenantClient as u, subscriptions_pause as ut, toNavigationItem as v, useAccountApi as vt, buildThemeDefinition as w, applyTheme as x, createPersister as xt, normalizeComponentTree as y, useAppDefinitionApi as yt, generateShades as z };
|
|
2725
2778
|
|
|
2726
|
-
//# sourceMappingURL=FluidProvider-
|
|
2779
|
+
//# sourceMappingURL=FluidProvider-D8lmeIsK.mjs.map
|