@fluid-app/portal-sdk 0.1.428 → 0.1.430

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.
@@ -57,6 +57,6 @@ require("./use-portal-card-add-3ds-flow-OFAaY1ms.cjs");
57
57
  require("./display-Bbu9dVv-.cjs");
58
58
  require("./Combobox-CMWzBod7.cjs");
59
59
  require("./prop-types-BL9DoSxF.cjs");
60
- const require_SubscriptionsScreen = require("./SubscriptionsScreen-BJWA3S9y.cjs");
60
+ const require_SubscriptionsScreen = require("./SubscriptionsScreen-CHssmfkf.cjs");
61
61
  exports.SubscriptionsScreen = require_SubscriptionsScreen.SubscriptionsScreen;
62
62
  exports.subscriptionsScreenPropertySchema = require_SubscriptionsScreen.subscriptionsScreenPropertySchema;
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions-api-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/subscriptions-api-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAenE,KAAK,uBAAuB,GAAG,OAAO,CACpC,UAAU,CAAC,OAAO,YAAY,CAAC,kBAAkB,CAAC,CACnD,CAAC;AAMF,KAAK,eAAe,GAAG,WAAW,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC,CAAC;AAe5E;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,eAAe,GACnB,aAAa,CAAC,8BAA8B,CA+N9C;AAuGD;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,WAAW,GAClB,gBAAgB,CA6IlB"}
1
+ {"version":3,"file":"subscriptions-api-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/subscriptions-api-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAenE,KAAK,uBAAuB,GAAG,OAAO,CACpC,UAAU,CAAC,OAAO,YAAY,CAAC,kBAAkB,CAAC,CACnD,CAAC;AAMF,KAAK,eAAe,GAAG,WAAW,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC,CAAC;AAe5E;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,eAAe,GACnB,aAAa,CAAC,8BAA8B,CAgO9C;AAuGD;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,WAAW,GAClB,gBAAgB,CA6IlB"}
package/dist/index.cjs CHANGED
@@ -72,7 +72,7 @@ require("./Combobox-CMWzBod7.cjs");
72
72
  require("./prop-types-BL9DoSxF.cjs");
73
73
  require("./use-mysite-portal-C_V5cNaa.cjs");
74
74
  const require_ProfileScreen = require("./ProfileScreen-GJzKpyV2.cjs");
75
- const require_SubscriptionsScreen = require("./SubscriptionsScreen-BJWA3S9y.cjs");
75
+ const require_SubscriptionsScreen = require("./SubscriptionsScreen-CHssmfkf.cjs");
76
76
  require("./dist-BY7oIoRh.cjs");
77
77
  require("./es-C0D2Nzch.cjs");
78
78
  require("./dist-D2JCrLWW.cjs");
@@ -1850,7 +1850,7 @@ function resolveMemberTypePage(registry, memberTypeSlug, currentSlug, baseSlug)
1850
1850
  //#region src/shell/system-screen-map.ts
1851
1851
  const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-BgufOBvz.cjs")).then((m) => ({ default: m.ProfileScreen })));
1852
1852
  const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-CdMqtyp-.cjs")).then((m) => ({ default: m.OrdersScreen })));
1853
- const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-RMjqJpCY.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
1853
+ const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-wxcIwNni.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
1854
1854
  const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-B9cy5cow.cjs")).then((m) => ({ default: m.MessagingScreen })));
1855
1855
  const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-CHZ0KEUy.cjs")).then((m) => ({ default: m.ContactsScreen })));
1856
1856
  const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-BsjQ3GzV.cjs")).then((m) => ({ default: m.ShopScreen })));
@@ -2023,6 +2023,29 @@ var AppShellErrorBoundary = class extends react.Component {
2023
2023
  }
2024
2024
  };
2025
2025
  //#endregion
2026
+ //#region src/shell/native-theme-bridge.ts
2027
+ const PORTAL_NATIVE_THEME_MESSAGE_TYPE = "fluid.portal.theme";
2028
+ function colorToSrgbHex(color) {
2029
+ const srgb = color.to("srgb");
2030
+ srgb.alpha = 1;
2031
+ return srgb.toString({ format: "hex" });
2032
+ }
2033
+ function createPortalNativeThemeMessage({ resolvedTheme, mode }) {
2034
+ return {
2035
+ type: PORTAL_NATIVE_THEME_MESSAGE_TYPE,
2036
+ version: 1,
2037
+ payload: {
2038
+ themeId: resolvedTheme.id,
2039
+ mode,
2040
+ colors: { muted: colorToSrgbHex(resolvedTheme[mode].muted.base) }
2041
+ }
2042
+ };
2043
+ }
2044
+ function postPortalNativeThemeMessage(message) {
2045
+ if (typeof window === "undefined") return;
2046
+ window.ReactNativeWebView?.postMessage(JSON.stringify(message));
2047
+ }
2048
+ //#endregion
2026
2049
  //#region src/shell/SdkLogoutButton.tsx
2027
2050
  /**
2028
2051
  * Sidebar footer slot. Renders Theme toggle + Log out.
@@ -2227,9 +2250,14 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2227
2250
  const metaEl = meta;
2228
2251
  const theme = resolvedTheme;
2229
2252
  function update(prefersDark) {
2230
- const hex = ((themeMode === "auto" ? prefersDark ? "dark" : "light" : themeMode) === "dark" ? theme.dark.muted.base : theme.light.muted.base).toString();
2231
- metaEl.content = hex;
2232
- document.body.style.backgroundColor = hex;
2253
+ const nativeThemeMessage = createPortalNativeThemeMessage({
2254
+ resolvedTheme: theme,
2255
+ mode: themeMode === "auto" ? prefersDark ? "dark" : "light" : themeMode
2256
+ });
2257
+ const mutedColor = nativeThemeMessage.payload.colors.muted;
2258
+ metaEl.content = mutedColor;
2259
+ document.body.style.backgroundColor = mutedColor;
2260
+ postPortalNativeThemeMessage(nativeThemeMessage);
2233
2261
  }
2234
2262
  const mql = window.matchMedia("(prefers-color-scheme: dark)");
2235
2263
  update(mql.matches);
@@ -3467,7 +3495,7 @@ const screenPropertySchemas = {
3467
3495
  MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-B9cy5cow.cjs")).then((m) => m.messagingScreenPropertySchema),
3468
3496
  ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-CHZ0KEUy.cjs")).then((m) => m.contactsScreenPropertySchema),
3469
3497
  OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-CdMqtyp-.cjs")).then((m) => m.ordersScreenPropertySchema),
3470
- SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-RMjqJpCY.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
3498
+ SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-wxcIwNni.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
3471
3499
  CustomersScreen: () => Promise.resolve().then(() => require("./CustomersScreen-BM08PF8p.cjs")).then((m) => m.customersScreenPropertySchema),
3472
3500
  MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-ClWFu_8I.cjs")).then((m) => m.mySiteScreenPropertySchema),
3473
3501
  ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-BAzK2RgL.cjs")).then((m) => m.shareablesScreenPropertySchema),