@fluid-app/portal-sdk 0.1.766 → 0.1.768

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.
@@ -68,7 +68,7 @@ require("./translation-adapter-CNWV4qPx.cjs");
68
68
  require("./translation-adapter-DFTj_Ydf.cjs");
69
69
  require("./translation-adapter-BhsWM9YE.cjs");
70
70
  require("./sidebar-BnZL8dM6.cjs");
71
- const require_MessagingScreen = require("./MessagingScreen-Ctfvxg4y.cjs");
71
+ const require_MessagingScreen = require("./MessagingScreen-oLnywrum.cjs");
72
72
  require("./ScreenHeaderContext-fJKG4BUl.cjs");
73
73
  require("./dist-CJZYdYE0.cjs");
74
74
  require("./es-CX93V_6s.cjs");
@@ -2344,8 +2344,17 @@ const memberSettingsSchema = z.object({
2344
2344
  channelDetailsSchema.extend(memberSettingsSchema.shape);
2345
2345
  //#endregion
2346
2346
  //#region ../../messaging/core/src/cable/cable-url.ts
2347
- /** Builds a Cable URL without exposing credentials for storefront sessions. */
2348
- function messagingCableUrl(url, origin, token, sessionAuthentication) {
2347
+ const MEMBER_PREVIEW_PARAMS = [
2348
+ "theme_template_id",
2349
+ "member_preview_site_id",
2350
+ "preview_theme_id"
2351
+ ];
2352
+ /**
2353
+ * Builds a Cable URL without exposing credentials for storefront sessions.
2354
+ * A storefront session socket carries the page's member preview selectors,
2355
+ * so a previewed site is checked the same way the page was.
2356
+ */
2357
+ function messagingCableUrl(url, origin, token, sessionAuthentication, pageUrl) {
2349
2358
  const address = new URL(url, origin);
2350
2359
  if (sessionAuthentication) {
2351
2360
  const storefront = new URL(origin);
@@ -2353,6 +2362,11 @@ function messagingCableUrl(url, origin, token, sessionAuthentication) {
2353
2362
  if (address.host !== storefront.host || ![storefront.protocol, protocol].includes(address.protocol)) throw new Error("Member session WebSocket must use the storefront origin");
2354
2363
  address.searchParams.delete("token");
2355
2364
  address.searchParams.set("member_storefront", "true");
2365
+ const page = pageUrl ? new URL(pageUrl, origin) : null;
2366
+ for (const name of MEMBER_PREVIEW_PARAMS) {
2367
+ const selected = page?.searchParams.get(name);
2368
+ if (selected) address.searchParams.set(name, selected);
2369
+ }
2356
2370
  } else if (token) address.searchParams.set("token", token);
2357
2371
  return address.toString();
2358
2372
  }
@@ -3156,7 +3170,7 @@ function useMessagingCable(options) {
3156
3170
  };
3157
3171
  const connectAt = (url) => {
3158
3172
  try {
3159
- consumer = createConsumer(messagingCableUrl(url, window.location.origin, token, sessionAuthentication));
3173
+ consumer = createConsumer(messagingCableUrl(url, window.location.origin, token, sessionAuthentication, window.location.href));
3160
3174
  } catch (err) {
3161
3175
  console.error("[ws] failed to create consumer", err);
3162
3176
  return;
@@ -58669,4 +58683,4 @@ const messagingScreenPropertySchema = {
58669
58683
  //#endregion
58670
58684
  export { BottomNavVisibilityProvider as a, useMessagingAuth as i, messagingScreenPropertySchema as n, useBottomNavHidden as o, useMessagingConfig as r, MessagingScreen as t };
58671
58685
 
58672
- //# sourceMappingURL=MessagingScreen-BrI2GbhQ.mjs.map
58686
+ //# sourceMappingURL=MessagingScreen-BJP0MihF.mjs.map