@fluid-app/portal-sdk 0.1.178 → 0.1.179

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 (32) hide show
  1. package/dist/{FluidProvider-TKGU3gSm.mjs → FluidProvider-Bjlw3uIJ.mjs} +54 -84
  2. package/dist/FluidProvider-Bjlw3uIJ.mjs.map +1 -0
  3. package/dist/{FluidProvider-CIuinUdw.cjs → FluidProvider-XHTzXe-E.cjs} +53 -89
  4. package/dist/FluidProvider-XHTzXe-E.cjs.map +1 -0
  5. package/dist/{MessagingScreen-CwMR1WJG.cjs → MessagingScreen-BcpCwuYL.cjs} +2 -2
  6. package/dist/{MessagingScreen-CwMR1WJG.cjs.map → MessagingScreen-BcpCwuYL.cjs.map} +1 -1
  7. package/dist/{MessagingScreen-BUC8Fwaz.mjs → MessagingScreen-CxWUaN04.mjs} +2 -2
  8. package/dist/{MessagingScreen-BUC8Fwaz.mjs.map → MessagingScreen-CxWUaN04.mjs.map} +1 -1
  9. package/dist/{MessagingScreen-XzPsvsXP.cjs → MessagingScreen-D35g9qBs.cjs} +2 -2
  10. package/dist/{ProductsScreen-C0KlCDt_.mjs → ProductsScreen-08MJy-SJ.mjs} +2 -0
  11. package/dist/{ProfileScreen-De6Xdkr4.cjs → ProfileScreen-C-8qFmXB.cjs} +2 -2
  12. package/dist/{ProfileScreen-De6Xdkr4.cjs.map → ProfileScreen-C-8qFmXB.cjs.map} +1 -1
  13. package/dist/{ProfileScreen-BuDwsZ3f.mjs → ProfileScreen-CQJyNrls.mjs} +2 -2
  14. package/dist/{ProfileScreen-BuDwsZ3f.mjs.map → ProfileScreen-CQJyNrls.mjs.map} +1 -1
  15. package/dist/{ProfileScreen-CD0p8061.cjs → ProfileScreen-CZDMIHZ9.cjs} +2 -2
  16. package/dist/{ShareablesScreen-_S-OESoe.mjs → ShareablesScreen-jHqnOgXM.mjs} +2 -0
  17. package/dist/{ShopScreen-DqUle1Zv.cjs → ShopScreen-BeuMn_38.cjs} +2 -2
  18. package/dist/{ShopScreen-Bg5pr5RL.mjs → ShopScreen-ChzQkJ1u.mjs} +2 -2
  19. package/dist/{ShopScreen-Bg5pr5RL.mjs.map → ShopScreen-ChzQkJ1u.mjs.map} +1 -1
  20. package/dist/{ShopScreen-z1kE-juB.cjs → ShopScreen-GBG7PGT3.cjs} +2 -2
  21. package/dist/{ShopScreen-z1kE-juB.cjs.map → ShopScreen-GBG7PGT3.cjs.map} +1 -1
  22. package/dist/index.cjs +61 -62
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +110 -20
  25. package/dist/index.d.cts.map +1 -1
  26. package/dist/index.d.mts +110 -20
  27. package/dist/index.d.mts.map +1 -1
  28. package/dist/index.mjs +65 -66
  29. package/dist/index.mjs.map +1 -1
  30. package/package.json +16 -16
  31. package/dist/FluidProvider-CIuinUdw.cjs.map +0 -1
  32. package/dist/FluidProvider-TKGU3gSm.mjs.map +0 -1
@@ -476,21 +476,6 @@ function createPersister() {
476
476
  });
477
477
  }
478
478
  //#endregion
479
- //#region ../core/src/fluidos-api-context.ts
480
- const FluidOsReadApiContext = createContext(null);
481
- const FluidOsBuilderApiContext = createContext(null);
482
- /** Provider for read-only manifest fetching (used by SDK). */
483
- const FluidOsApiProvider = FluidOsReadApiContext.Provider;
484
- FluidOsBuilderApiContext.Provider;
485
- /** Hook for read-only manifest fetching (used by SDK). */
486
- function useFluidOsApi() {
487
- const builderApi = useContext(FluidOsBuilderApiContext);
488
- const readApi = useContext(FluidOsReadApiContext);
489
- if (builderApi) return builderApi;
490
- if (!readApi) throw new Error("useFluidOsApi must be used within a FluidOsApiProvider or FluidOsBuilderApiProvider");
491
- return readApi;
492
- }
493
- //#endregion
494
479
  //#region ../core/src/app-definition-api-context.ts
495
480
  const AppDefinitionApiContext = createContext(null);
496
481
  const AppDefinitionApiProvider = AppDefinitionApiContext.Provider;
@@ -843,52 +828,48 @@ function createDataSourceApiAdapter(client, contentClient) {
843
828
  };
844
829
  }
845
830
  //#endregion
846
- //#region ../../api-clients/fluidos/src/namespaces/fluid_os.ts
847
- /**
848
- * Get active Fluid OS definition
849
- * Retrieve the active Fluid OS definition manifest for a specific platform
850
- *
851
- * @param client - Fetch client instance
852
- * @param params - params
853
- */
854
- async function getFluidOSManifest(client, params) {
855
- return client.get(`/api/fluid_os/definitions/active`, params);
856
- }
857
- //#endregion
858
- //#region src/adapters/fluidos-api-adapter.ts
859
- /** Create a FluidOsReadApi adapter backed by a FetchClient. */
860
- function createFluidOsReadAdapter(client) {
861
- return { getManifest: (params) => getFluidOSManifest(client, params) };
862
- }
863
- //#endregion
864
831
  //#region src/adapters/app-definition-api-adapter.ts
865
- function mapManifest(raw) {
866
- return {
867
- id: raw.definition_id ?? 0,
868
- name: raw.name ?? "",
869
- version: raw.published_version?.toString() ?? null,
870
- components: [],
871
- active: true
872
- };
873
- }
874
832
  /**
875
833
  * Creates an AppDefinitionApi adapter backed by the portal-tenant BFF client.
876
834
  *
877
- * Maps the generated portal-tenant `app_manifest_show` response to the
878
- * `AppDefinitionApi` port, applying runtime defaults for optional BFF fields
879
- * so TypeScript catches schema drift at compile time via `satisfies`.
835
+ * Maps the generated `app_manifest_show` response to the `AppDefinitionApi`
836
+ * port, applying runtime defaults for optional BFF fields so TypeScript
837
+ * catches schema drift at compile time via `satisfies`.
880
838
  */
881
839
  function createAppDefinitionApiAdapter(client) {
882
- return { fetchDefinition: async () => {
840
+ async function fetchManifest() {
883
841
  const response = await app_manifest_show(client);
884
842
  return {
885
- definition: mapManifest(response.manifest ?? {}),
843
+ manifest: response.manifest,
886
844
  meta: {
887
845
  request_id: response.meta?.request_id ?? "",
888
846
  timestamp: response.meta?.timestamp ?? ""
889
847
  }
890
848
  };
891
- } };
849
+ }
850
+ return {
851
+ fetchManifest,
852
+ fetchDefinition: async () => {
853
+ const { manifest, meta } = await fetchManifest();
854
+ return {
855
+ definition: mapManifestToDefinition(manifest),
856
+ meta
857
+ };
858
+ }
859
+ };
860
+ }
861
+ /**
862
+ * Synthesize the legacy `{ definition }` shape from the new manifest
863
+ * response. Retained only so deprecated callers keep building.
864
+ */
865
+ function mapManifestToDefinition(manifest) {
866
+ return {
867
+ id: manifest.definition_id ?? 0,
868
+ name: manifest.name ?? "",
869
+ version: manifest.published_version?.toString() ?? null,
870
+ components: [],
871
+ active: true
872
+ };
892
873
  }
893
874
  //#endregion
894
875
  //#region src/adapters/account-api-adapter.ts
@@ -2526,14 +2507,6 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
2526
2507
  }, []);
2527
2508
  const configRef = useRef(config);
2528
2509
  configRef.current = config;
2529
- const fluidOsFetchClient = useMemo(() => createFetchClient({
2530
- baseUrl: configRef.current.baseUrl,
2531
- ...configRef.current.getAuthToken ? { getAuthToken: () => configRef.current.getAuthToken?.() ?? null } : {},
2532
- onAuthError: () => configRef.current.onAuthError?.(),
2533
- defaultHeaders: configRef.current.defaultHeaders,
2534
- credentials: "include"
2535
- }), [config.baseUrl]);
2536
- const fluidOsApi = useMemo(() => createFluidOsReadAdapter(fluidOsFetchClient), [fluidOsFetchClient]);
2537
2510
  const csrfToken = typeof document !== "undefined" ? document.querySelector("meta[name=\"csrf-token\"]")?.getAttribute("content") : null;
2538
2511
  const portalTenantClient = useMemo(() => createFetchClient({
2539
2512
  baseUrl: configRef.current.baseUrl,
@@ -2575,32 +2548,29 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
2575
2548
  value: contextValue,
2576
2549
  children: /* @__PURE__ */ jsx(PortalTenantClientProvider, {
2577
2550
  value: portalTenantClient,
2578
- children: /* @__PURE__ */ jsx(FluidOsApiProvider, {
2579
- value: fluidOsApi,
2580
- children: /* @__PURE__ */ jsx(AppDefinitionApiProvider, {
2581
- value: appDefinitionApi,
2582
- children: /* @__PURE__ */ jsx(AccountApiProvider, {
2583
- value: accountApi,
2584
- children: /* @__PURE__ */ jsx(StoreApiProvider, {
2585
- value: storeApi,
2586
- children: /* @__PURE__ */ jsx(PayApiProvider, {
2587
- value: payApi,
2588
- children: /* @__PURE__ */ jsx(CountriesApiProvider, {
2589
- value: countriesApi,
2590
- children: /* @__PURE__ */ jsx(LanguagesApiProvider, {
2591
- value: languagesApi,
2592
- children: /* @__PURE__ */ jsx(MySiteApiProvider, {
2593
- value: mysiteApi,
2594
- children: /* @__PURE__ */ jsx(DataSourceApiProvider, {
2595
- value: dataSourceApi,
2596
- children: /* @__PURE__ */ jsx(ProviderStack, {
2597
- baseUrl: dataSourceBaseUrl,
2598
- getApiHeaders,
2599
- variables: effectiveVariables,
2600
- registry,
2601
- themeProviderProps,
2602
- children
2603
- })
2551
+ children: /* @__PURE__ */ jsx(AppDefinitionApiProvider, {
2552
+ value: appDefinitionApi,
2553
+ children: /* @__PURE__ */ jsx(AccountApiProvider, {
2554
+ value: accountApi,
2555
+ children: /* @__PURE__ */ jsx(StoreApiProvider, {
2556
+ value: storeApi,
2557
+ children: /* @__PURE__ */ jsx(PayApiProvider, {
2558
+ value: payApi,
2559
+ children: /* @__PURE__ */ jsx(CountriesApiProvider, {
2560
+ value: countriesApi,
2561
+ children: /* @__PURE__ */ jsx(LanguagesApiProvider, {
2562
+ value: languagesApi,
2563
+ children: /* @__PURE__ */ jsx(MySiteApiProvider, {
2564
+ value: mysiteApi,
2565
+ children: /* @__PURE__ */ jsx(DataSourceApiProvider, {
2566
+ value: dataSourceApi,
2567
+ children: /* @__PURE__ */ jsx(ProviderStack, {
2568
+ baseUrl: dataSourceBaseUrl,
2569
+ getApiHeaders,
2570
+ variables: effectiveVariables,
2571
+ registry,
2572
+ themeProviderProps,
2573
+ children
2604
2574
  })
2605
2575
  })
2606
2576
  })
@@ -2642,6 +2612,6 @@ function useFluidContext() {
2642
2612
  return context;
2643
2613
  }
2644
2614
  //#endregion
2645
- export { mergeDarkOverrides as A, usePayApi as B, DEFAULT_THEME_ID as C, deriveDarkVariant as D, generateThemeCSS as E, RADIUS_KEYS as F, useFluidOsApi as H, SEMANTIC_COLOR_NAMES as I, SHADE_STEPS as L, resolveTheme as M, FONT_FAMILY_KEYS as N, generateShades as O, FONT_SIZE_KEYS as P, ApiError as R, DEFAULT_SPACING as S, getDefaultThemeDefinition as T, createPersister as U, useAppDefinitionApi as V, deleteDatabase as W, serialiseTheme as _, createScreen as a, DEFAULT_FONT_SIZES as b, FluidThemeProvider as c, removeAllThemes as d, removeTheme as f, deserialiseTheme as g, transformThemes as h, widgetPropertySchemas as i, parseColor as j, getForegroundColor as k, useThemeContext as l, getActiveThemeId as m, useFluidContext as n, createWidgetFromShareable as o, buildThemeDefinition as p, DEFAULT_SDK_WIDGET_REGISTRY as r, createWidgetRegistry as s, FluidProvider as t, applyTheme as u, DEFAULT_COLORS as v, DEFAULT_THEME_NAME as w, DEFAULT_RADII as x, DEFAULT_FONT_FAMILIES as y, useLanguagesApi as z };
2615
+ export { mergeDarkOverrides as A, usePayApi as B, DEFAULT_THEME_ID as C, deriveDarkVariant as D, generateThemeCSS as E, RADIUS_KEYS as F, createPersister as H, SEMANTIC_COLOR_NAMES as I, SHADE_STEPS as L, resolveTheme as M, FONT_FAMILY_KEYS as N, generateShades as O, FONT_SIZE_KEYS as P, ApiError as R, DEFAULT_SPACING as S, getDefaultThemeDefinition as T, deleteDatabase as U, useAppDefinitionApi as V, serialiseTheme as _, createScreen as a, DEFAULT_FONT_SIZES as b, FluidThemeProvider as c, removeAllThemes as d, removeTheme as f, deserialiseTheme as g, transformThemes as h, widgetPropertySchemas as i, parseColor as j, getForegroundColor as k, useThemeContext as l, getActiveThemeId as m, useFluidContext as n, createWidgetFromShareable as o, buildThemeDefinition as p, DEFAULT_SDK_WIDGET_REGISTRY as r, createWidgetRegistry as s, FluidProvider as t, applyTheme as u, DEFAULT_COLORS as v, DEFAULT_THEME_NAME as w, DEFAULT_RADII as x, DEFAULT_FONT_FAMILIES as y, useLanguagesApi as z };
2646
2616
 
2647
- //# sourceMappingURL=FluidProvider-TKGU3gSm.mjs.map
2617
+ //# sourceMappingURL=FluidProvider-Bjlw3uIJ.mjs.map