@fluid-app/portal-sdk 0.1.767 → 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.
@@ -67,7 +67,7 @@ import "./translation-adapter-C37avOSN.mjs";
67
67
  import "./translation-adapter-D4UNUw8I.mjs";
68
68
  import "./translation-adapter-BGwgAecf.mjs";
69
69
  import "./sidebar-BqTwYEfE.mjs";
70
- import { n as messagingScreenPropertySchema, t as MessagingScreen } from "./MessagingScreen-BrI2GbhQ.mjs";
70
+ import { n as messagingScreenPropertySchema, t as MessagingScreen } from "./MessagingScreen-BJP0MihF.mjs";
71
71
  import "./ScreenHeaderContext-D7jhJX8j.mjs";
72
72
  import "./dist-D8bAvP_X.mjs";
73
73
  import "./es-C23yRFfb.mjs";
@@ -2349,8 +2349,17 @@ const memberSettingsSchema = zod.z.object({
2349
2349
  channelDetailsSchema.extend(memberSettingsSchema.shape);
2350
2350
  //#endregion
2351
2351
  //#region ../../messaging/core/src/cable/cable-url.ts
2352
- /** Builds a Cable URL without exposing credentials for storefront sessions. */
2353
- function messagingCableUrl(url, origin, token, sessionAuthentication) {
2352
+ const MEMBER_PREVIEW_PARAMS = [
2353
+ "theme_template_id",
2354
+ "member_preview_site_id",
2355
+ "preview_theme_id"
2356
+ ];
2357
+ /**
2358
+ * Builds a Cable URL without exposing credentials for storefront sessions.
2359
+ * A storefront session socket carries the page's member preview selectors,
2360
+ * so a previewed site is checked the same way the page was.
2361
+ */
2362
+ function messagingCableUrl(url, origin, token, sessionAuthentication, pageUrl) {
2354
2363
  const address = new URL(url, origin);
2355
2364
  if (sessionAuthentication) {
2356
2365
  const storefront = new URL(origin);
@@ -2358,6 +2367,11 @@ function messagingCableUrl(url, origin, token, sessionAuthentication) {
2358
2367
  if (address.host !== storefront.host || ![storefront.protocol, protocol].includes(address.protocol)) throw new Error("Member session WebSocket must use the storefront origin");
2359
2368
  address.searchParams.delete("token");
2360
2369
  address.searchParams.set("member_storefront", "true");
2370
+ const page = pageUrl ? new URL(pageUrl, origin) : null;
2371
+ for (const name of MEMBER_PREVIEW_PARAMS) {
2372
+ const selected = page?.searchParams.get(name);
2373
+ if (selected) address.searchParams.set(name, selected);
2374
+ }
2361
2375
  } else if (token) address.searchParams.set("token", token);
2362
2376
  return address.toString();
2363
2377
  }
@@ -3182,7 +3196,7 @@ function useMessagingCable(options) {
3182
3196
  };
3183
3197
  const connectAt = (url) => {
3184
3198
  try {
3185
- consumer = import_actioncable.createConsumer(messagingCableUrl(url, window.location.origin, token, sessionAuthentication));
3199
+ consumer = import_actioncable.createConsumer(messagingCableUrl(url, window.location.origin, token, sessionAuthentication, window.location.href));
3186
3200
  } catch (err) {
3187
3201
  console.error("[ws] failed to create consumer", err);
3188
3202
  return;
@@ -61265,4 +61279,4 @@ Object.defineProperty(exports, "useMessagingConfig", {
61265
61279
  }
61266
61280
  });
61267
61281
 
61268
- //# sourceMappingURL=MessagingScreen-Ctfvxg4y.cjs.map
61282
+ //# sourceMappingURL=MessagingScreen-oLnywrum.cjs.map