@fluid-app/portal-sdk 0.1.91 → 0.1.93
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-BtvcE4pE.cjs → AppDownloadScreen-D-lPD090.cjs} +2 -2
- package/dist/{AppDownloadScreen-BtvcE4pE.cjs.map → AppDownloadScreen-D-lPD090.cjs.map} +1 -1
- package/dist/{AppDownloadScreen-Dx2nilnX.cjs → AppDownloadScreen-D4CtPMfZ.cjs} +2 -2
- package/dist/{AppDownloadScreen-RX8GSAyq.mjs → AppDownloadScreen-RGClSpeA.mjs} +2 -2
- package/dist/{AppDownloadScreen-RX8GSAyq.mjs.map → AppDownloadScreen-RGClSpeA.mjs.map} +1 -1
- package/dist/{ContactsScreen-DttcI388.cjs → ContactsScreen-0h6EW-5L.cjs} +2 -2
- package/dist/{ContactsScreen-DttcI388.cjs.map → ContactsScreen-0h6EW-5L.cjs.map} +1 -1
- package/dist/{ContactsScreen-DOz11uQ_.mjs → ContactsScreen-B5mf_3YF.mjs} +2 -2
- package/dist/{ContactsScreen-DOz11uQ_.mjs.map → ContactsScreen-B5mf_3YF.mjs.map} +1 -1
- package/dist/{ContactsScreen-CKMZIQlF.cjs → ContactsScreen-CCvizFdr.cjs} +2 -2
- package/dist/{FluidProvider-Sc51VlLw.cjs → FluidProvider-C27-ijsq.cjs} +58 -12
- package/dist/FluidProvider-C27-ijsq.cjs.map +1 -0
- package/dist/{FluidProvider-Eohedipr.mjs → FluidProvider-Nd7xkDWq.mjs} +47 -13
- package/dist/FluidProvider-Nd7xkDWq.mjs.map +1 -0
- package/dist/{MessagingScreen-CdHBUykK.cjs → MessagingScreen-8myurYB8.cjs} +2 -2
- package/dist/{MessagingScreen-r67FUDf1.cjs → MessagingScreen-B8u8kkH-.cjs} +3 -3
- package/dist/{MessagingScreen-r67FUDf1.cjs.map → MessagingScreen-B8u8kkH-.cjs.map} +1 -1
- package/dist/{MessagingScreen-CMxjIURw.mjs → MessagingScreen-CJO9b5Do.mjs} +3 -3
- package/dist/{MessagingScreen-CMxjIURw.mjs.map → MessagingScreen-CJO9b5Do.mjs.map} +1 -1
- package/dist/{MessagingScreen-Cx0bbvfs.mjs → MessagingScreen-oGxMJtNT.mjs} +2 -2
- package/dist/{MySiteScreen-BhdmPFar.mjs → MySiteScreen-Cz-KTIDH.mjs} +3 -3
- package/dist/{MySiteScreen-BhdmPFar.mjs.map → MySiteScreen-Cz-KTIDH.mjs.map} +1 -1
- package/dist/{MySiteScreen-Cy7HpS3z.cjs → MySiteScreen-DHtQ-nrj.cjs} +3 -3
- package/dist/{MySiteScreen-Cy7HpS3z.cjs.map → MySiteScreen-DHtQ-nrj.cjs.map} +1 -1
- package/dist/{MySiteScreen-8lZTZzo0.cjs → MySiteScreen-DxKXda65.cjs} +3 -3
- package/dist/{OrdersScreen-D0TnBQc5.mjs → OrdersScreen-CRhvTsZX.mjs} +3 -3
- package/dist/{OrdersScreen-D0TnBQc5.mjs.map → OrdersScreen-CRhvTsZX.mjs.map} +1 -1
- package/dist/{OrdersScreen-DCOzHNIy.cjs → OrdersScreen-DDqDubNG.cjs} +2 -2
- package/dist/{OrdersScreen-BaqQzT1F.cjs → OrdersScreen-DGWU9MKQ.cjs} +3 -3
- package/dist/{OrdersScreen-BaqQzT1F.cjs.map → OrdersScreen-DGWU9MKQ.cjs.map} +1 -1
- package/dist/{ProductsScreen-2tlHXemg.mjs → ProductsScreen-28vbEj_q.mjs} +4 -4
- package/dist/{ProductsScreen-Ch6f5P2w.cjs → ProductsScreen-BCKYCxLP.cjs} +4 -4
- package/dist/{ProductsScreen-2pUHZJop.mjs → ProductsScreen-CUQi-Rj5.mjs} +7 -6
- package/dist/ProductsScreen-CUQi-Rj5.mjs.map +1 -0
- package/dist/{ProductsScreen-ueEJP0MJ.cjs → ProductsScreen-TQGuItSe.cjs} +7 -6
- package/dist/ProductsScreen-TQGuItSe.cjs.map +1 -0
- package/dist/{ProfileScreen-C8fpr9c3.cjs → ProfileScreen-C-WEgl6I.cjs} +3 -3
- package/dist/{ProfileScreen-C8fpr9c3.cjs.map → ProfileScreen-C-WEgl6I.cjs.map} +1 -1
- package/dist/{ProfileScreen-Age0TtEY.mjs → ProfileScreen-CSyji2kX.mjs} +3 -3
- package/dist/{ProfileScreen-Age0TtEY.mjs.map → ProfileScreen-CSyji2kX.mjs.map} +1 -1
- package/dist/{ProfileScreen-DEtgeBnE.cjs → ProfileScreen-mbsYsvbX.cjs} +2 -2
- package/dist/{ShareablesScreen-vFbWhVGF.mjs → ShareablesScreen-B3LWG6Vd.mjs} +7 -7
- package/dist/{ShareablesScreen-vFbWhVGF.mjs.map → ShareablesScreen-B3LWG6Vd.mjs.map} +1 -1
- package/dist/{ShareablesScreen-B6uPSvvK.cjs → ShareablesScreen-DDDnyfpn.cjs} +7 -7
- package/dist/{ShareablesScreen-B6uPSvvK.cjs.map → ShareablesScreen-DDDnyfpn.cjs.map} +1 -1
- package/dist/{ShareablesScreen-DBdNgtV1.mjs → ShareablesScreen-DWlRD2yD.mjs} +4 -4
- package/dist/{ShareablesScreen-CoPFz5ZB.cjs → ShareablesScreen-Du70lYZA.cjs} +4 -4
- package/dist/{ShopScreen-BKBaNPsG.cjs → ShopScreen-CWuSRymK.cjs} +67 -51
- package/dist/ShopScreen-CWuSRymK.cjs.map +1 -0
- package/dist/{ShopScreen-D-TXRWZR.mjs → ShopScreen-CzY8rJg9.mjs} +67 -51
- package/dist/ShopScreen-CzY8rJg9.mjs.map +1 -0
- package/dist/{ShopScreen-DPZSXS99.cjs → ShopScreen-DQzt93BK.cjs} +2 -2
- package/dist/{SubscriptionsScreen-CBqgpat5.mjs → SubscriptionsScreen-CViYObw9.mjs} +3 -3
- package/dist/{SubscriptionsScreen-CBqgpat5.mjs.map → SubscriptionsScreen-CViYObw9.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-BvS7o_XP.cjs → SubscriptionsScreen-CjxanPLb.cjs} +3 -3
- package/dist/{SubscriptionsScreen-BvS7o_XP.cjs.map → SubscriptionsScreen-CjxanPLb.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-IbsNz0Ki.cjs → SubscriptionsScreen-Dc4JwfWg.cjs} +2 -2
- package/dist/{dist-BF_4vk1z.cjs → dist-BSbac3uh.cjs} +1 -1
- package/dist/{dist-BF_4vk1z.cjs.map → dist-BSbac3uh.cjs.map} +1 -1
- package/dist/index.cjs +43 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -352
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +38 -352
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +43 -39
- package/dist/index.mjs.map +1 -1
- package/dist/products-BAtIML76.cjs +114 -0
- package/dist/{products-BKZ1siXg.cjs.map → products-BAtIML76.cjs.map} +1 -1
- package/dist/products-StJIeia3.mjs +61 -0
- package/dist/{products-DOO1TBcm.mjs.map → products-StJIeia3.mjs.map} +1 -1
- package/dist/{sortable.esm-Cz-CP2N8.mjs → sortable.esm-DSrWP4x9.mjs} +1 -1
- package/dist/{sortable.esm-Cz-CP2N8.mjs.map → sortable.esm-DSrWP4x9.mjs.map} +1 -1
- package/dist/{src-Zv3-NSUf.cjs → src-CMByt6YP.cjs} +1 -1
- package/dist/{src-CN7diUEw.mjs.map → src-CMByt6YP.cjs.map} +1 -1
- package/dist/{src-Ih5vEO6p.mjs → src-CyrJPIY1.mjs} +3 -3
- package/dist/{src-Ih5vEO6p.mjs.map → src-CyrJPIY1.mjs.map} +1 -1
- package/dist/{src-CN7diUEw.mjs → src-DryOJTBW.mjs} +1 -1
- package/dist/{src-Zv3-NSUf.cjs.map → src-DryOJTBW.mjs.map} +1 -1
- package/dist/{src-BbJs882O.cjs → src-t3t8YW1J.cjs} +3 -3
- package/dist/{src-BbJs882O.cjs.map → src-t3t8YW1J.cjs.map} +1 -1
- package/dist/{use-account-clients-DaliJYMa.cjs → use-account-clients-CF79cijO.cjs} +2 -2
- package/dist/{use-account-clients-DaliJYMa.cjs.map → use-account-clients-CF79cijO.cjs.map} +1 -1
- package/dist/{use-account-clients-CSWgrCKK.mjs → use-account-clients-CaLsedpw.mjs} +2 -2
- package/dist/{use-account-clients-CSWgrCKK.mjs.map → use-account-clients-CaLsedpw.mjs.map} +1 -1
- package/dist/{use-current-user-5erIFUd6.cjs → use-current-user-CNyndpb0.cjs} +3 -3
- package/dist/{use-current-user-5erIFUd6.cjs.map → use-current-user-CNyndpb0.cjs.map} +1 -1
- package/dist/{use-current-user-BBQg1iYf.mjs → use-current-user-Cv4FHFqm.mjs} +3 -3
- package/dist/{use-current-user-BBQg1iYf.mjs.map → use-current-user-Cv4FHFqm.mjs.map} +1 -1
- package/dist/{use-customer-account-Dzdps4By.cjs → use-customer-account-9HqKnQx5.cjs} +3 -3
- package/dist/{use-customer-account-Dzdps4By.cjs.map → use-customer-account-9HqKnQx5.cjs.map} +1 -1
- package/dist/{use-customer-account-CRYpHpFM.mjs → use-customer-account-CewcODTd.mjs} +3 -3
- package/dist/{use-customer-account-CRYpHpFM.mjs.map → use-customer-account-CewcODTd.mjs.map} +1 -1
- package/dist/{use-fluid-api-C5ZLs2TP.mjs → use-fluid-api-D1QuzLw0.mjs} +2 -2
- package/dist/{use-fluid-api-C5ZLs2TP.mjs.map → use-fluid-api-D1QuzLw0.mjs.map} +1 -1
- package/dist/{use-fluid-api-BUitsoDu.cjs → use-fluid-api-zeOS14jg.cjs} +2 -2
- package/dist/{use-fluid-api-BUitsoDu.cjs.map → use-fluid-api-zeOS14jg.cjs.map} +1 -1
- package/package.json +12 -12
- package/dist/FluidProvider-Eohedipr.mjs.map +0 -1
- package/dist/FluidProvider-Sc51VlLw.cjs.map +0 -1
- package/dist/ProductsScreen-2pUHZJop.mjs.map +0 -1
- package/dist/ProductsScreen-ueEJP0MJ.cjs.map +0 -1
- package/dist/ShopScreen-BKBaNPsG.cjs.map +0 -1
- package/dist/ShopScreen-D-TXRWZR.mjs.map +0 -1
- package/dist/products-BKZ1siXg.cjs +0 -29
- package/dist/products-DOO1TBcm.mjs +0 -18
|
@@ -662,6 +662,19 @@ function createPersister() {
|
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
664
|
//#endregion
|
|
665
|
+
//#region ../core/src/types/fluidos-api-context.ts
|
|
666
|
+
const FluidOsReadApiContext = createContext(null);
|
|
667
|
+
const FluidOsBuilderApiContext = createContext(null);
|
|
668
|
+
/** Provider for read-only manifest fetching (used by SDK). */
|
|
669
|
+
const FluidOsApiProvider = FluidOsReadApiContext.Provider;
|
|
670
|
+
FluidOsBuilderApiContext.Provider;
|
|
671
|
+
/** Optional variant that returns null when no provider is present. */
|
|
672
|
+
function useFluidOsApiOptional() {
|
|
673
|
+
const builderApi = useContext(FluidOsBuilderApiContext);
|
|
674
|
+
const readApi = useContext(FluidOsReadApiContext);
|
|
675
|
+
return builderApi ?? readApi;
|
|
676
|
+
}
|
|
677
|
+
//#endregion
|
|
665
678
|
//#region ../../api-clients/fluidos/src/namespaces/fluid_os.ts
|
|
666
679
|
/**
|
|
667
680
|
* Get active Fluid OS definition
|
|
@@ -3230,6 +3243,17 @@ function toNavigationItem(item) {
|
|
|
3230
3243
|
//#endregion
|
|
3231
3244
|
//#region src/transforms/index.ts
|
|
3232
3245
|
/**
|
|
3246
|
+
* Convert a raw FluidOS API response to RawManifestResponse.
|
|
3247
|
+
*
|
|
3248
|
+
* The wire format includes `navigation_items` and full theme objects,
|
|
3249
|
+
* but the generated OpenAPI types differ (e.g. `navigation_tree`, `themes: number[]`).
|
|
3250
|
+
* This function bridges that gap so callers avoid `as unknown as` casts.
|
|
3251
|
+
*/
|
|
3252
|
+
function toRawManifest(raw) {
|
|
3253
|
+
if (!raw.manifest) throw new Error("FluidOS API returned empty manifest");
|
|
3254
|
+
return raw;
|
|
3255
|
+
}
|
|
3256
|
+
/**
|
|
3233
3257
|
* Transform a raw FluidOS manifest API response into RepAppData.
|
|
3234
3258
|
*
|
|
3235
3259
|
* This is the top-level transform used by `FluidClient.app.get()`.
|
|
@@ -3513,14 +3537,14 @@ function createFluidClient(config) {
|
|
|
3513
3537
|
updateProfile: (data) => patch("/api/reps/me", data)
|
|
3514
3538
|
},
|
|
3515
3539
|
profile: { get: async () => {
|
|
3516
|
-
return transformManifestToRepAppData(await getFluidOSManifest(fetchClient, { platform: "browser" })).profile;
|
|
3540
|
+
return transformManifestToRepAppData(toRawManifest(await getFluidOSManifest(fetchClient, { platform: "browser" }))).profile;
|
|
3517
3541
|
} },
|
|
3518
3542
|
app: {
|
|
3519
3543
|
getRaw: async () => {
|
|
3520
|
-
return await getFluidOSManifest(fetchClient, { platform: "browser" });
|
|
3544
|
+
return toRawManifest(await getFluidOSManifest(fetchClient, { platform: "browser" }));
|
|
3521
3545
|
},
|
|
3522
3546
|
get: async () => {
|
|
3523
|
-
return transformManifestToRepAppData(await getFluidOSManifest(fetchClient, { platform: "browser" }));
|
|
3547
|
+
return transformManifestToRepAppData(toRawManifest(await getFluidOSManifest(fetchClient, { platform: "browser" })));
|
|
3524
3548
|
}
|
|
3525
3549
|
},
|
|
3526
3550
|
permissions: { get: () => get("/api/company/roles/my_permissions") },
|
|
@@ -3531,6 +3555,12 @@ function createFluidClient(config) {
|
|
|
3531
3555
|
};
|
|
3532
3556
|
}
|
|
3533
3557
|
//#endregion
|
|
3558
|
+
//#region src/adapters/fluidos-api-adapter.ts
|
|
3559
|
+
/** Create a FluidOsReadApi adapter backed by a FetchClient. */
|
|
3560
|
+
function createFluidOsReadAdapter(client) {
|
|
3561
|
+
return { getManifest: (params) => getFluidOSManifest(client, params) };
|
|
3562
|
+
}
|
|
3563
|
+
//#endregion
|
|
3534
3564
|
//#region src/providers/FluidThemeProvider.tsx
|
|
3535
3565
|
/**
|
|
3536
3566
|
* Theme Provider for Fluid SDK
|
|
@@ -3946,6 +3976,7 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
|
|
|
3946
3976
|
getAuthToken: () => configRef.current.getAuthToken?.() ?? null,
|
|
3947
3977
|
onAuthError: () => configRef.current.onAuthError?.()
|
|
3948
3978
|
}), [config.baseUrl]);
|
|
3979
|
+
const fluidOsApi = useMemo(() => createFluidOsReadAdapter(client.fetchClient), [client.fetchClient]);
|
|
3949
3980
|
const contextValue = useMemo(() => ({
|
|
3950
3981
|
client,
|
|
3951
3982
|
config: configRef.current
|
|
@@ -3980,14 +4011,17 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
|
|
|
3980
4011
|
client: queryClient ?? defaultQueryClient,
|
|
3981
4012
|
children: /* @__PURE__ */ jsx(FluidContext.Provider, {
|
|
3982
4013
|
value: contextValue,
|
|
3983
|
-
children: /* @__PURE__ */ jsx(
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
4014
|
+
children: /* @__PURE__ */ jsx(FluidOsApiProvider, {
|
|
4015
|
+
value: fluidOsApi,
|
|
4016
|
+
children: /* @__PURE__ */ jsx(CustomerIdEnricher, {
|
|
4017
|
+
baseUrl: dataSourceBaseUrl,
|
|
4018
|
+
getApiHeaders,
|
|
4019
|
+
variables: effectiveVariables,
|
|
4020
|
+
registry,
|
|
4021
|
+
themeProviderProps,
|
|
4022
|
+
onAuthError: config.onAuthError,
|
|
4023
|
+
children
|
|
4024
|
+
})
|
|
3991
4025
|
})
|
|
3992
4026
|
})
|
|
3993
4027
|
});
|
|
@@ -4049,6 +4083,6 @@ function useFluidContext() {
|
|
|
4049
4083
|
return context;
|
|
4050
4084
|
}
|
|
4051
4085
|
//#endregion
|
|
4052
|
-
export {
|
|
4086
|
+
export { extractTokenFromUrl as $, DEFAULT_FONT_SIZES as A, mergeDarkOverrides as B, buildThemeDefinition as C, serialiseTheme as D, deserialiseTheme as E, getDefaultThemeDefinition as F, RADIUS_KEYS as G, resolveTheme as H, generateThemeCSS as I, DEFAULT_AUTH_URL as J, SEMANTIC_COLOR_NAMES as K, deriveDarkVariant as L, DEFAULT_SPACING as M, DEFAULT_THEME_ID as N, DEFAULT_COLORS as O, DEFAULT_THEME_NAME as P, extractCompanyTokenFromUrl as Q, generateShades as R, removeTheme as S, createFetchClient as St, transformThemes as T, FONT_FAMILY_KEYS as U, parseColor as V, FONT_SIZE_KEYS as W, cleanTokenFromUrl as X, createDefaultAuthRedirect as Y, extractAllTokensFromUrl as Z, toNavigationItem as _, createPersister as _t, createScreen as a, decodeToken as at, applyTheme as b, updateCustomer as bt, FluidAuthProvider as c, isTokenExpired as ct, useThemeContext as d, AUTH_CONSTANTS as dt, hasTokenInUrl as et, ApiError as f, STORAGE_KEYS as ft, transformManifestToRepAppData as g, useFluidOsApiOptional as gt, toRawManifest as h, isUserType as ht, widgetPropertySchemas as i, storeToken as it, DEFAULT_RADII as j, DEFAULT_FONT_FAMILIES as k, useFluidAuthContext as l, isValidToken as lt, isApiError as m, USER_TYPES as mt, useFluidContext as n, getStoredToken as nt, createWidgetFromShareable as o, getTokenExpiration as ot, createFluidClient as p, URL_PARAMS as pt, SHADE_STEPS as q, DEFAULT_SDK_WIDGET_REGISTRY as r, hasStoredToken as rt, createWidgetRegistry as s, getTokenTimeRemaining as st, FluidProvider as t, clearTokens as tt, FluidThemeProvider as u, validateToken as ut, normalizeComponentTree as v, deleteDatabase as vt, getActiveThemeId as w, removeAllThemes as x, ApiError$1 as xt, toScreenDefinition as y, fetchCustomerAccount as yt, getForegroundColor as z };
|
|
4053
4087
|
|
|
4054
|
-
//# sourceMappingURL=FluidProvider-
|
|
4088
|
+
//# sourceMappingURL=FluidProvider-Nd7xkDWq.mjs.map
|