@replohq/sandbox-runtime 1.5.1 → 1.6.0

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.
@@ -22,6 +22,12 @@ export declare const websiteBuilderToComponentPreviewMethodConfig: {
22
22
  };
23
23
  };
24
24
  export declare const componentPreviewToWebsiteBuilderMethodConfig: {
25
+ contentBoundsChanged: {
26
+ inputSchema: z.ZodObject<{
27
+ height: z.ZodNumber;
28
+ }, z.core.$strip>;
29
+ outputSchema: z.ZodVoid;
30
+ };
25
31
  iframeReady: {
26
32
  inputSchema: z.ZodUndefined;
27
33
  outputSchema: z.ZodVoid;
@@ -21,6 +21,8 @@ var DATA_LOADER_KEYS = {
21
21
  REVIEWS_IO_PRODUCT_REVIEW_AGGREGATE: "reviews_io.product_review_aggregate",
22
22
  LOOX_PRODUCT_REVIEWS: "loox.product_reviews",
23
23
  LOOX_PRODUCT_REVIEW_AGGREGATE: "loox.product_review_aggregate",
24
+ JUDGEME_PRODUCT_REVIEWS: "judgeme.product_reviews",
25
+ JUDGEME_PRODUCT_REVIEW_AGGREGATE: "judgeme.product_review_aggregate",
24
26
  STATSIG_EXPERIMENT: "statsig.experiment",
25
27
  CONTENTFUL_ENTRY: "contentful.entry",
26
28
  CONTENTFUL_ENTRIES: "contentful.entries"
@@ -56,6 +58,12 @@ var websiteBuilderToComponentPreviewMethodConfig = {
56
58
  }
57
59
  };
58
60
  var componentPreviewToWebsiteBuilderMethodConfig = {
61
+ contentBoundsChanged: {
62
+ inputSchema: z.object({
63
+ height: z.number().finite().min(0).max(1e5)
64
+ }),
65
+ outputSchema: z.void()
66
+ },
59
67
  iframeReady: {
60
68
  inputSchema: z.undefined(),
61
69
  outputSchema: z.void()
@@ -30,6 +30,8 @@ export declare const DATA_LOADER_KEYS: {
30
30
  readonly REVIEWS_IO_PRODUCT_REVIEW_AGGREGATE: "reviews_io.product_review_aggregate";
31
31
  readonly LOOX_PRODUCT_REVIEWS: "loox.product_reviews";
32
32
  readonly LOOX_PRODUCT_REVIEW_AGGREGATE: "loox.product_review_aggregate";
33
+ readonly JUDGEME_PRODUCT_REVIEWS: "judgeme.product_reviews";
34
+ readonly JUDGEME_PRODUCT_REVIEW_AGGREGATE: "judgeme.product_review_aggregate";
33
35
  readonly STATSIG_EXPERIMENT: "statsig.experiment";
34
36
  readonly CONTENTFUL_ENTRY: "contentful.entry";
35
37
  readonly CONTENTFUL_ENTRIES: "contentful.entries";
@@ -55,6 +57,8 @@ export declare const dataLoaderKeySchema: z.ZodEnum<{
55
57
  "reviews_io.product_review_aggregate": "reviews_io.product_review_aggregate";
56
58
  "loox.product_reviews": "loox.product_reviews";
57
59
  "loox.product_review_aggregate": "loox.product_review_aggregate";
60
+ "judgeme.product_reviews": "judgeme.product_reviews";
61
+ "judgeme.product_review_aggregate": "judgeme.product_review_aggregate";
58
62
  "statsig.experiment": "statsig.experiment";
59
63
  "contentful.entry": "contentful.entry";
60
64
  "contentful.entries": "contentful.entries";
package/buildMetadata.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sandbox-runtime",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "branch": "HEAD",
5
- "commit": "46993e27f13bdc44fb8069250240b6cdae88a508",
6
- "builtAt": "2026-09-04T14:54:15.479Z"
5
+ "commit": "bb46a5a8548eab10e5bee011e2a67e9bc3587e5a",
6
+ "builtAt": "2026-09-10T00:29:19.203Z"
7
7
  };
@@ -68,8 +68,42 @@ function useComponentPreviewChannel(onSetProps) {
68
68
  ...rpcChannel,
69
69
  subscribe() {
70
70
  const unsubscribe = rpcChannel.subscribe();
71
- createIframeRpcRemote(rpcChannel).iframeReady();
72
- return unsubscribe;
71
+ const remote = createIframeRpcRemote(rpcChannel);
72
+ remote.iframeReady();
73
+ const content = document.querySelector(
74
+ "[data-replo-component-preview]"
75
+ );
76
+ let timeout;
77
+ let lastHeight = -1;
78
+ const measure = () => {
79
+ clearTimeout(timeout);
80
+ timeout = setTimeout(() => {
81
+ if (!content) {
82
+ return;
83
+ }
84
+ const bounds = content.getBoundingClientRect();
85
+ const height = Math.min(
86
+ 1e5,
87
+ Math.ceil(
88
+ bounds.height + Math.max(0, bounds.top + window.scrollY)
89
+ )
90
+ );
91
+ if (height !== lastHeight) {
92
+ lastHeight = height;
93
+ remote.contentBoundsChanged({ height });
94
+ }
95
+ }, 100);
96
+ };
97
+ const observer = new ResizeObserver(measure);
98
+ if (content) {
99
+ observer.observe(content);
100
+ }
101
+ measure();
102
+ return () => {
103
+ clearTimeout(timeout);
104
+ observer.disconnect();
105
+ unsubscribe();
106
+ };
73
107
  }
74
108
  };
75
109
  }, [])
@@ -165,7 +199,7 @@ function ComponentPreviewStage({
165
199
  return { mode: "client" };
166
200
  }
167
201
  );
168
- return /* @__PURE__ */ jsx(Component, { ...props });
202
+ return /* @__PURE__ */ jsx("div", { "data-replo-component-preview": true, style: { display: "flow-root" }, children: /* @__PURE__ */ jsx(Component, { ...props }) });
169
203
  }
170
204
  export {
171
205
  ComponentPreviewNavigation,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../next/component-preview-client.tsx"],
4
- "sourcesContent": ["\"use client\";\n\nimport type { ComponentType } from \"react\";\nimport type { z } from \"zod\";\n\nimport { useEffect, useMemo, useRef, useState, useTransition } from \"react\";\n\nimport { useRouter } from \"next/navigation\";\n\nimport { useIframeRpcChannel } from \"replo-utils/react/use-iframe-rpc-channel\";\nimport {\n COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_ID,\n COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_VERSION,\n COMPONENT_PREVIEW_PARENT_ORIGIN_PARAM,\n componentPreviewToWebsiteBuilderMethodConfig,\n websiteBuilderToComponentPreviewMethodConfig,\n} from \"schemas/componentPreview\";\nimport {\n createIframeRpcChannel,\n createIframeRpcRemote,\n} from \"schemas/iframeRpcChannel\";\n\nimport { getComponentPreviewHref } from \"./component-preview-href\";\nimport {\n mergeClientProps,\n productReferencesChanged,\n} from \"./component-preview-props\";\n\ntype SetPropsInput = z.output<\n (typeof websiteBuilderToComponentPreviewMethodConfig)[\"setProps\"][\"inputSchema\"]\n>;\ntype SetPropsResult = z.output<\n (typeof websiteBuilderToComponentPreviewMethodConfig)[\"setProps\"][\"outputSchema\"]\n>;\n\nfunction getParentOrigin(): string | null {\n const fromQuery = new URLSearchParams(window.location.search).get(\n COMPONENT_PREVIEW_PARENT_ORIGIN_PARAM,\n );\n if (fromQuery) {\n try {\n return new URL(fromQuery).origin;\n } catch {\n return null;\n }\n }\n return document.referrer ? new URL(document.referrer).origin : null;\n}\n\nfunction getCurrentHref() {\n return `${window.location.pathname}${window.location.search}${window.location.hash}`;\n}\n\n// Child side of the preview channel: announces readiness on subscribe and\n// routes incoming setProps calls to the caller. React Doctor rejects passing a\n// useEffectEvent result into channel handlers, so freshness comes from a plain\n// ref the stable closure reads at call time.\nfunction useComponentPreviewChannel(\n onSetProps: (input: SetPropsInput) => Promise<SetPropsResult>,\n) {\n const onSetPropsRef = useRef(onSetProps);\n onSetPropsRef.current = onSetProps;\n useIframeRpcChannel(\n useMemo(() => {\n if (typeof window === \"undefined\") {\n return null;\n }\n const parentOrigin = getParentOrigin();\n if (!parentOrigin) {\n return null;\n }\n const rpcChannel = createIframeRpcChannel({\n subscriberWindow: window,\n channelIdentifier: COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_ID,\n version: COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_VERSION,\n getTargetWindow: () => {\n return window.parent === window ? null : window.parent;\n },\n targetOrigin: parentOrigin,\n isExpectedMessage: (event) => {\n return (\n event.source === window.parent && event.origin === parentOrigin\n );\n },\n outgoingMethods: componentPreviewToWebsiteBuilderMethodConfig,\n incomingMethods: websiteBuilderToComponentPreviewMethodConfig,\n handlers: {\n setProps: (input) => onSetPropsRef.current(input),\n },\n });\n return {\n ...rpcChannel,\n subscribe() {\n const unsubscribe = rpcChannel.subscribe();\n createIframeRpcRemote(rpcChannel).iframeReady();\n return unsubscribe;\n },\n };\n }, []),\n );\n}\n\n// Server-render an in-frame navigation and resolve once the transition\n// settles, so the parent's ack tracks the actual repaint.\nfunction useNavigateAndSettle() {\n const router = useRouter();\n const [isNavigationPending, startNavigation] = useTransition();\n const settleResolvers = useRef<(() => void)[]>([]);\n // eslint-disable-next-line replo/no-use-effect -- Resolves promises held by the RPC channel, an external system, once the navigation transition settles.\n useEffect(() => {\n if (!isNavigationPending) {\n const resolvers = settleResolvers.current;\n settleResolvers.current = [];\n for (const resolve of resolvers) {\n resolve();\n }\n }\n }, [isNavigationPending]);\n // A navigation that never settles (a hung RSC fetch) never resolves \u2014 the\n // parent's channel timeout turns that into the disconnected state, and the\n // caller's refs stay uncommitted so the next sync retries the navigation.\n return (href: string) => {\n return new Promise<void>((resolve) => {\n settleResolvers.current.push(resolve);\n startNavigation(() => {\n router.replace(href, { scroll: false });\n });\n });\n };\n}\n\nexport function ComponentPreviewNavigation() {\n const navigateAndSettle = useNavigateAndSettle();\n useComponentPreviewChannel(\n async ({ props, sourceRevision }): Promise<SetPropsResult> => {\n const nextHref = getComponentPreviewHref({\n currentUrl: window.location.href,\n props,\n sourceRevision,\n });\n if (nextHref === getCurrentHref()) {\n return { mode: \"unchanged\" };\n }\n await navigateAndSettle(nextHref);\n return { mode: \"navigation\" };\n },\n );\n return null;\n}\n\nexport function ComponentPreviewStage({\n Component,\n initialProps,\n initialRawProps,\n initialSourceRevision,\n}: {\n Component: ComponentType<Record<string, unknown>>;\n initialProps: Record<string, unknown>;\n initialRawProps: Record<string, unknown>;\n initialSourceRevision: string;\n}) {\n const [props, setProps] = useState(initialProps);\n // A fresh server render (mount or in-frame navigation) is authoritative;\n // its props replace whatever the client store held.\n const [lastInitialProps, setLastInitialProps] = useState(initialProps);\n if (initialProps !== lastInitialProps) {\n setLastInitialProps(initialProps);\n setProps(initialProps);\n }\n const propsRef = useRef(props);\n propsRef.current = props;\n const lastRawPropsRef = useRef(initialRawProps);\n const lastSourceRevisionRef = useRef(initialSourceRevision);\n const navigateAndSettle = useNavigateAndSettle();\n\n useComponentPreviewChannel(\n async ({\n props: nextRawProps,\n sourceRevision,\n }): Promise<SetPropsResult> => {\n const nextHref = getComponentPreviewHref({\n currentUrl: window.location.href,\n props: nextRawProps,\n sourceRevision,\n });\n if (nextHref === getCurrentHref()) {\n return { mode: \"unchanged\" };\n }\n if (\n sourceRevision !== lastSourceRevisionRef.current ||\n productReferencesChanged({\n previous: lastRawPropsRef.current,\n next: nextRawProps,\n })\n ) {\n await navigateAndSettle(nextHref);\n lastRawPropsRef.current = nextRawProps;\n lastSourceRevisionRef.current = sourceRevision;\n return { mode: \"navigation\" };\n }\n setProps(\n mergeClientProps({\n currentResolved: propsRef.current,\n nextRaw: nextRawProps,\n }),\n );\n lastRawPropsRef.current = nextRawProps;\n // Keep the URL canonical without a server round trip, so a manual frame\n // reload restores the current props and the unchanged-check stays exact.\n window.history.replaceState(null, \"\", nextHref);\n return { mode: \"client\" };\n },\n );\n\n return <Component {...props} />;\n}\n"],
5
- "mappings": ";AAsNS;AAjNT,SAAS,WAAW,SAAS,QAAQ,UAAU,qBAAqB;AAEpE,SAAS,iBAAiB;AAE1B,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AASP,SAAS,kBAAiC;AACxC,QAAM,YAAY,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE;AAAA,IAC5D;AAAA,EACF;AACA,MAAI,WAAW;AACb,QAAI;AACF,aAAO,IAAI,IAAI,SAAS,EAAE;AAAA,IAC5B,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO,SAAS,WAAW,IAAI,IAAI,SAAS,QAAQ,EAAE,SA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GAAG;AACjC,eAAO,EAAE,MAAM,YAAY;AAAA,MAC7B;AACA,UACE,mBAAmB,sBAAsB,WACzC,yBAAyB;AAAA,QACvB,UAAU,gBAAgB;AAAA,QAC1B,MAAM;AAAA,MACR,CAAC,GACD;AACA,cAAM,kBAAkB,QAAQ;AAChC,wBAAgB,UAAU;AAC1B,8BAAsB,UAAU;AAChC,eAAO,EAAE,MAAM,aAAa;AAAA,MAC9B;AACA;AAAA,QACE,iBAAiB;AAAA,UACf,iBAAiB,SAAS;AAAA,UAC1B,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AACA,sBAAgB,UAAU;AAG1B,aAAO,QAAQ,aAAa,MAAM,IAAI,QAAQ;AAC9C,aAAO,EAAE,MAAM,SAAS;AAAA,IAC1B;AAAA,EACF;AAEA,SAAO,oBAAC,aAAW,GAAG,OAAO;AAC/B;",
4
+ "sourcesContent": ["\"use client\";\n\nimport type { ComponentType } from \"react\";\nimport type { z } from \"zod\";\n\nimport { useEffect, useMemo, useRef, useState, useTransition } from \"react\";\n\nimport { useRouter } from \"next/navigation\";\n\nimport { useIframeRpcChannel } from \"replo-utils/react/use-iframe-rpc-channel\";\nimport {\n COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_ID,\n COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_VERSION,\n COMPONENT_PREVIEW_PARENT_ORIGIN_PARAM,\n componentPreviewToWebsiteBuilderMethodConfig,\n websiteBuilderToComponentPreviewMethodConfig,\n} from \"schemas/componentPreview\";\nimport {\n createIframeRpcChannel,\n createIframeRpcRemote,\n} from \"schemas/iframeRpcChannel\";\n\nimport { getComponentPreviewHref } from \"./component-preview-href\";\nimport {\n mergeClientProps,\n productReferencesChanged,\n} from \"./component-preview-props\";\n\ntype SetPropsInput = z.output<\n (typeof websiteBuilderToComponentPreviewMethodConfig)[\"setProps\"][\"inputSchema\"]\n>;\ntype SetPropsResult = z.output<\n (typeof websiteBuilderToComponentPreviewMethodConfig)[\"setProps\"][\"outputSchema\"]\n>;\n\nfunction getParentOrigin(): string | null {\n const fromQuery = new URLSearchParams(window.location.search).get(\n COMPONENT_PREVIEW_PARENT_ORIGIN_PARAM,\n );\n if (fromQuery) {\n try {\n return new URL(fromQuery).origin;\n } catch {\n return null;\n }\n }\n return document.referrer ? new URL(document.referrer).origin : null;\n}\n\nfunction getCurrentHref() {\n return `${window.location.pathname}${window.location.search}${window.location.hash}`;\n}\n\n// Child side of the preview channel: announces readiness on subscribe and\n// routes incoming setProps calls to the caller. React Doctor rejects passing a\n// useEffectEvent result into channel handlers, so freshness comes from a plain\n// ref the stable closure reads at call time.\nfunction useComponentPreviewChannel(\n onSetProps: (input: SetPropsInput) => Promise<SetPropsResult>,\n) {\n const onSetPropsRef = useRef(onSetProps);\n onSetPropsRef.current = onSetProps;\n useIframeRpcChannel(\n useMemo(() => {\n if (typeof window === \"undefined\") {\n return null;\n }\n const parentOrigin = getParentOrigin();\n if (!parentOrigin) {\n return null;\n }\n const rpcChannel = createIframeRpcChannel({\n subscriberWindow: window,\n channelIdentifier: COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_ID,\n version: COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_VERSION,\n getTargetWindow: () => {\n return window.parent === window ? null : window.parent;\n },\n targetOrigin: parentOrigin,\n isExpectedMessage: (event) => {\n return (\n event.source === window.parent && event.origin === parentOrigin\n );\n },\n outgoingMethods: componentPreviewToWebsiteBuilderMethodConfig,\n incomingMethods: websiteBuilderToComponentPreviewMethodConfig,\n handlers: {\n setProps: (input) => onSetPropsRef.current(input),\n },\n });\n return {\n ...rpcChannel,\n subscribe() {\n const unsubscribe = rpcChannel.subscribe();\n const remote = createIframeRpcRemote(rpcChannel);\n remote.iframeReady();\n const content = document.querySelector(\n \"[data-replo-component-preview]\",\n );\n let timeout: ReturnType<typeof setTimeout> | undefined;\n let lastHeight = -1;\n const measure = () => {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n if (!content) {\n return;\n }\n const bounds = content.getBoundingClientRect();\n const height = Math.min(\n 100_000,\n Math.ceil(\n bounds.height + Math.max(0, bounds.top + window.scrollY),\n ),\n );\n if (height !== lastHeight) {\n lastHeight = height;\n remote.contentBoundsChanged({ height });\n }\n }, 100);\n };\n const observer = new ResizeObserver(measure);\n if (content) {\n observer.observe(content);\n }\n measure();\n return () => {\n clearTimeout(timeout);\n observer.disconnect();\n unsubscribe();\n };\n },\n };\n }, []),\n );\n}\n\n// Server-render an in-frame navigation and resolve once the transition\n// settles, so the parent's ack tracks the actual repaint.\nfunction useNavigateAndSettle() {\n const router = useRouter();\n const [isNavigationPending, startNavigation] = useTransition();\n const settleResolvers = useRef<(() => void)[]>([]);\n // eslint-disable-next-line replo/no-use-effect -- Resolves promises held by the RPC channel, an external system, once the navigation transition settles.\n useEffect(() => {\n if (!isNavigationPending) {\n const resolvers = settleResolvers.current;\n settleResolvers.current = [];\n for (const resolve of resolvers) {\n resolve();\n }\n }\n }, [isNavigationPending]);\n // A navigation that never settles (a hung RSC fetch) never resolves \u2014 the\n // parent's channel timeout turns that into the disconnected state, and the\n // caller's refs stay uncommitted so the next sync retries the navigation.\n return (href: string) => {\n return new Promise<void>((resolve) => {\n settleResolvers.current.push(resolve);\n startNavigation(() => {\n router.replace(href, { scroll: false });\n });\n });\n };\n}\n\nexport function ComponentPreviewNavigation() {\n const navigateAndSettle = useNavigateAndSettle();\n useComponentPreviewChannel(\n async ({ props, sourceRevision }): Promise<SetPropsResult> => {\n const nextHref = getComponentPreviewHref({\n currentUrl: window.location.href,\n props,\n sourceRevision,\n });\n if (nextHref === getCurrentHref()) {\n return { mode: \"unchanged\" };\n }\n await navigateAndSettle(nextHref);\n return { mode: \"navigation\" };\n },\n );\n return null;\n}\n\nexport function ComponentPreviewStage({\n Component,\n initialProps,\n initialRawProps,\n initialSourceRevision,\n}: {\n Component: ComponentType<Record<string, unknown>>;\n initialProps: Record<string, unknown>;\n initialRawProps: Record<string, unknown>;\n initialSourceRevision: string;\n}) {\n const [props, setProps] = useState(initialProps);\n // A fresh server render (mount or in-frame navigation) is authoritative;\n // its props replace whatever the client store held.\n const [lastInitialProps, setLastInitialProps] = useState(initialProps);\n if (initialProps !== lastInitialProps) {\n setLastInitialProps(initialProps);\n setProps(initialProps);\n }\n const propsRef = useRef(props);\n propsRef.current = props;\n const lastRawPropsRef = useRef(initialRawProps);\n const lastSourceRevisionRef = useRef(initialSourceRevision);\n const navigateAndSettle = useNavigateAndSettle();\n\n useComponentPreviewChannel(\n async ({\n props: nextRawProps,\n sourceRevision,\n }): Promise<SetPropsResult> => {\n const nextHref = getComponentPreviewHref({\n currentUrl: window.location.href,\n props: nextRawProps,\n sourceRevision,\n });\n if (nextHref === getCurrentHref()) {\n return { mode: \"unchanged\" };\n }\n if (\n sourceRevision !== lastSourceRevisionRef.current ||\n productReferencesChanged({\n previous: lastRawPropsRef.current,\n next: nextRawProps,\n })\n ) {\n await navigateAndSettle(nextHref);\n lastRawPropsRef.current = nextRawProps;\n lastSourceRevisionRef.current = sourceRevision;\n return { mode: \"navigation\" };\n }\n setProps(\n mergeClientProps({\n currentResolved: propsRef.current,\n nextRaw: nextRawProps,\n }),\n );\n lastRawPropsRef.current = nextRawProps;\n // Keep the URL canonical without a server round trip, so a manual frame\n // reload restores the current props and the unchanged-check stays exact.\n window.history.replaceState(null, \"\", nextHref);\n return { mode: \"client\" };\n },\n );\n\n return (\n <div data-replo-component-preview style={{ display: \"flow-root\" }}>\n <Component {...props} />\n </div>\n );\n}\n"],
5
+ "mappings": ";AA0PM;AArPN,SAAS,WAAW,SAAS,QAAQ,UAAU,qBAAqB;AAEpE,SAAS,iBAAiB;AAE1B,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AASP,SAAS,kBAAiC;AACxC,QAAM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iBAAiB,SAAS;AAAA,UAC1B,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AACA,sBAAgB,UAAU;AAG1B,aAAO,QAAQ,aAAa,MAAM,IAAI,QAAQ;AAC9C,aAAO,EAAE,MAAM,SAAS;AAAA,IAC1B;AAAA,EACF;AAEA,SACE,oBAAC,SAAI,gCAA4B,MAAC,OAAO,EAAE,SAAS,YAAY,GAC9D,8BAAC,aAAW,GAAG,OAAO,GACxB;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -74,7 +74,7 @@ function createComponentPreviewPage(Component, options) {
74
74
  /* @__PURE__ */ jsx(ComponentPreviewNavigation, {}),
75
75
  /* @__PURE__ */ jsx(DocumentReadyBeacon, {}),
76
76
  /* @__PURE__ */ jsx(NextErrorReporter, {}),
77
- /* @__PURE__ */ jsx(Component, { ...resolvedProps })
77
+ /* @__PURE__ */ jsx("div", { "data-replo-component-preview": true, style: { display: "flow-root" }, children: /* @__PURE__ */ jsx(Component, { ...resolvedProps }) })
78
78
  ] });
79
79
  };
80
80
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../next/component-preview.tsx"],
4
- "sourcesContent": ["import type { ComponentType } from \"react\";\nimport type { ComponentPreviewProductReference } from \"schemas/generated/componentPreview\";\n\nimport {\n componentPreviewProductReferenceSchema,\n componentPreviewPropsSchema,\n MAX_COMPONENT_PREVIEW_PROPS_BYTES,\n} from \"schemas/componentPreview\";\n\nimport { DocumentReadyBeacon } from \"../DocumentReadyBeacon\";\nimport { NextErrorReporter } from \"../NextErrorReporter\";\nimport {\n ComponentPreviewNavigation,\n ComponentPreviewStage,\n} from \"./component-preview-client\";\n\nasync function getPreviewProps({\n value,\n getProduct,\n}: {\n value: unknown;\n getProduct?: (\n reference: ComponentPreviewProductReference,\n ) => Promise<unknown>;\n}): Promise<{\n rawProps: Record<string, unknown>;\n resolvedProps: Record<string, unknown>;\n}> {\n const previewPropsResult = componentPreviewPropsSchema.safeParse(value);\n if (!previewPropsResult.success) {\n return { rawProps: {}, resolvedProps: {} };\n }\n\n const rawProps: Record<string, unknown> = {};\n const resolvedProps: Record<string, unknown> = {};\n for (const [name, propValue] of Object.entries(previewPropsResult.data)) {\n rawProps[name] = propValue;\n const productReferenceResult =\n componentPreviewProductReferenceSchema.safeParse(propValue);\n if (!productReferenceResult.success) {\n resolvedProps[name] = propValue;\n continue;\n }\n // Without a resolver the raw reference passes through rather than the prop\n // silently vanishing; the component sees exactly what the URL carried.\n resolvedProps[name] = getProduct\n ? await getProduct(productReferenceResult.data)\n : propValue;\n }\n return { rawProps, resolvedProps };\n}\n\nasync function parseProps({\n value,\n getProduct,\n}: {\n value: string | string[] | undefined;\n getProduct?: (\n reference: ComponentPreviewProductReference,\n ) => Promise<unknown>;\n}) {\n if (\n typeof value !== \"string\" ||\n new TextEncoder().encode(value).byteLength >\n MAX_COMPONENT_PREVIEW_PROPS_BYTES\n ) {\n return { rawProps: {}, resolvedProps: {} };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch {\n return { rawProps: {}, resolvedProps: {} };\n }\n return await getPreviewProps({ value: parsed, getProduct });\n}\n\nexport function createComponentPreviewPage(\n Component: ComponentType<Record<string, unknown>>,\n options?: {\n getProduct?: (\n reference: ComponentPreviewProductReference,\n ) => Promise<unknown>;\n // Interactive components (\"use client\" in the component file) render\n // inside the client prop stage so plain prop edits apply without a server\n // round trip. Server components can only re-render via navigation.\n interactive?: boolean;\n },\n) {\n return async function ComponentPreviewPage({\n searchParams,\n }: {\n searchParams: Promise<{\n props?: string | string[];\n sourceRevision?: string | string[];\n }>;\n }) {\n const resolvedSearchParams = await searchParams;\n const { rawProps, resolvedProps } = await parseProps({\n value: resolvedSearchParams.props,\n getProduct: options?.getProduct,\n });\n if (options?.interactive) {\n return (\n <>\n <DocumentReadyBeacon />\n <NextErrorReporter />\n <ComponentPreviewStage\n Component={Component}\n initialProps={resolvedProps}\n initialRawProps={rawProps}\n initialSourceRevision={\n typeof resolvedSearchParams.sourceRevision === \"string\"\n ? resolvedSearchParams.sourceRevision\n : \"\"\n }\n />\n </>\n );\n }\n return (\n <>\n <ComponentPreviewNavigation />\n <DocumentReadyBeacon />\n <NextErrorReporter />\n <Component {...resolvedProps} />\n </>\n );\n };\n}\n"],
5
- "mappings": "AAwGQ,mBACE,KADF;AArGR;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,eAAe,gBAAgB;AAAA,EAC7B;AAAA,EACA;AACF,GAQG;AACD,QAAM,qBAAqB,4BAA4B,UAAU,KAAK;AACtE,MAAI,CAAC,mBAAmB,SAAS;AAC/B,WAAO,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE;AAAA,EAC3C;AAEA,QAAM,WAAoC,CAAC;AAC3C,QAAM,gBAAyC,CAAC;AAChD,aAAW,CAAC,MAAM,SAAS,KAAK,OAAO,QAAQ,mBAAmB,IAAI,GAAG;AACvE,aAAS,IAAI,IAAI;AACjB,UAAM,yBACJ,uCAAuC,UAAU,SAAS;AAC5D,QAAI,CAAC,uBAAuB,SAAS;AACnC,oBAAc,IAAI,IAAI;AACtB;AAAA,IACF;AAGA,kBAAc,IAAI,IAAI,aAClB,MAAM,WAAW,uBAAuB,IAAI,IAC5C;AAAA,EACN;AACA,SAAO,EAAE,UAAU,cAAc;AACnC;AAEA,eAAe,WAAW;AAAA,EACxB;AAAA,EACA;AACF,GAKG;AACD,MACE,OAAO,UAAU,YACjB,IAAI,YAAY,EAAE,OAAO,KAAK,EAAE,aAC9B,mCACF;AACA,WAAO,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE;AAAA,EAC3C;AACA,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,KAAK;AAAA,EAC3B,QAAQ;AACN,WAAO,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE;AAAA,EAC3C;AACA,SAAO,MAAM,gBAAgB,EAAE,OAAO,QAAQ,WAAW,CAAC;AAC5D;AAEO,SAAS,2BACd,WACA,SASA;AACA,SAAO,eAAe,qBAAqB;AAAA,IACzC;AAAA,EACF,GAKG;AACD,UAAM,uBAAuB,MAAM;AACnC,UAAM,EAAE,UAAU,cAAc,IAAI,MAAM,WAAW;AAAA,MACnD,OAAO,qBAAqB;AAAA,MAC5B,YAAY,SAAS;AAAA,IACvB,CAAC;AACD,QAAI,SAAS,aAAa;AACxB,aACE,iCACE;AAAA,4BAAC,uBAAoB;AAAA,QACrB,oBAAC,qBAAkB;AAAA,QACnB;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,cAAc;AAAA,YACd,iBAAiB;AAAA,YACjB,uBACE,OAAO,qBAAqB,mBAAmB,WAC3C,qBAAqB,iBACrB;AAAA;AAAA,QAER;AAAA,SACF;AAAA,IAEJ;AACA,WACE,iCACE;AAAA,0BAAC,8BAA2B;AAAA,MAC5B,oBAAC,uBAAoB;AAAA,MACrB,oBAAC,qBAAkB;AAAA,MACnB,oBAAC,aAAW,GAAG,eAAe;AAAA,OAChC;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import type { ComponentType } from \"react\";\nimport type { ComponentPreviewProductReference } from \"schemas/generated/componentPreview\";\n\nimport {\n componentPreviewProductReferenceSchema,\n componentPreviewPropsSchema,\n MAX_COMPONENT_PREVIEW_PROPS_BYTES,\n} from \"schemas/componentPreview\";\n\nimport { DocumentReadyBeacon } from \"../DocumentReadyBeacon\";\nimport { NextErrorReporter } from \"../NextErrorReporter\";\nimport {\n ComponentPreviewNavigation,\n ComponentPreviewStage,\n} from \"./component-preview-client\";\n\nasync function getPreviewProps({\n value,\n getProduct,\n}: {\n value: unknown;\n getProduct?: (\n reference: ComponentPreviewProductReference,\n ) => Promise<unknown>;\n}): Promise<{\n rawProps: Record<string, unknown>;\n resolvedProps: Record<string, unknown>;\n}> {\n const previewPropsResult = componentPreviewPropsSchema.safeParse(value);\n if (!previewPropsResult.success) {\n return { rawProps: {}, resolvedProps: {} };\n }\n\n const rawProps: Record<string, unknown> = {};\n const resolvedProps: Record<string, unknown> = {};\n for (const [name, propValue] of Object.entries(previewPropsResult.data)) {\n rawProps[name] = propValue;\n const productReferenceResult =\n componentPreviewProductReferenceSchema.safeParse(propValue);\n if (!productReferenceResult.success) {\n resolvedProps[name] = propValue;\n continue;\n }\n // Without a resolver the raw reference passes through rather than the prop\n // silently vanishing; the component sees exactly what the URL carried.\n resolvedProps[name] = getProduct\n ? await getProduct(productReferenceResult.data)\n : propValue;\n }\n return { rawProps, resolvedProps };\n}\n\nasync function parseProps({\n value,\n getProduct,\n}: {\n value: string | string[] | undefined;\n getProduct?: (\n reference: ComponentPreviewProductReference,\n ) => Promise<unknown>;\n}) {\n if (\n typeof value !== \"string\" ||\n new TextEncoder().encode(value).byteLength >\n MAX_COMPONENT_PREVIEW_PROPS_BYTES\n ) {\n return { rawProps: {}, resolvedProps: {} };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch {\n return { rawProps: {}, resolvedProps: {} };\n }\n return await getPreviewProps({ value: parsed, getProduct });\n}\n\nexport function createComponentPreviewPage(\n Component: ComponentType<Record<string, unknown>>,\n options?: {\n getProduct?: (\n reference: ComponentPreviewProductReference,\n ) => Promise<unknown>;\n // Interactive components (\"use client\" in the component file) render\n // inside the client prop stage so plain prop edits apply without a server\n // round trip. Server components can only re-render via navigation.\n interactive?: boolean;\n },\n) {\n return async function ComponentPreviewPage({\n searchParams,\n }: {\n searchParams: Promise<{\n props?: string | string[];\n sourceRevision?: string | string[];\n }>;\n }) {\n const resolvedSearchParams = await searchParams;\n const { rawProps, resolvedProps } = await parseProps({\n value: resolvedSearchParams.props,\n getProduct: options?.getProduct,\n });\n if (options?.interactive) {\n return (\n <>\n <DocumentReadyBeacon />\n <NextErrorReporter />\n <ComponentPreviewStage\n Component={Component}\n initialProps={resolvedProps}\n initialRawProps={rawProps}\n initialSourceRevision={\n typeof resolvedSearchParams.sourceRevision === \"string\"\n ? resolvedSearchParams.sourceRevision\n : \"\"\n }\n />\n </>\n );\n }\n return (\n <>\n <ComponentPreviewNavigation />\n <DocumentReadyBeacon />\n <NextErrorReporter />\n <div data-replo-component-preview style={{ display: \"flow-root\" }}>\n <Component {...resolvedProps} />\n </div>\n </>\n );\n };\n}\n"],
5
+ "mappings": "AAwGQ,mBACE,KADF;AArGR;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,eAAe,gBAAgB;AAAA,EAC7B;AAAA,EACA;AACF,GAQG;AACD,QAAM,qBAAqB,4BAA4B,UAAU,KAAK;AACtE,MAAI,CAAC,mBAAmB,SAAS;AAC/B,WAAO,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE;AAAA,EAC3C;AAEA,QAAM,WAAoC,CAAC;AAC3C,QAAM,gBAAyC,CAAC;AAChD,aAAW,CAAC,MAAM,SAAS,KAAK,OAAO,QAAQ,mBAAmB,IAAI,GAAG;AACvE,aAAS,IAAI,IAAI;AACjB,UAAM,yBACJ,uCAAuC,UAAU,SAAS;AAC5D,QAAI,CAAC,uBAAuB,SAAS;AACnC,oBAAc,IAAI,IAAI;AACtB;AAAA,IACF;AAGA,kBAAc,IAAI,IAAI,aAClB,MAAM,WAAW,uBAAuB,IAAI,IAC5C;AAAA,EACN;AACA,SAAO,EAAE,UAAU,cAAc;AACnC;AAEA,eAAe,WAAW;AAAA,EACxB;AAAA,EACA;AACF,GAKG;AACD,MACE,OAAO,UAAU,YACjB,IAAI,YAAY,EAAE,OAAO,KAAK,EAAE,aAC9B,mCACF;AACA,WAAO,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE;AAAA,EAC3C;AACA,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,KAAK;AAAA,EAC3B,QAAQ;AACN,WAAO,EAAE,UAAU,CAAC,GAAG,eAAe,CAAC,EAAE;AAAA,EAC3C;AACA,SAAO,MAAM,gBAAgB,EAAE,OAAO,QAAQ,WAAW,CAAC;AAC5D;AAEO,SAAS,2BACd,WACA,SASA;AACA,SAAO,eAAe,qBAAqB;AAAA,IACzC;AAAA,EACF,GAKG;AACD,UAAM,uBAAuB,MAAM;AACnC,UAAM,EAAE,UAAU,cAAc,IAAI,MAAM,WAAW;AAAA,MACnD,OAAO,qBAAqB;AAAA,MAC5B,YAAY,SAAS;AAAA,IACvB,CAAC;AACD,QAAI,SAAS,aAAa;AACxB,aACE,iCACE;AAAA,4BAAC,uBAAoB;AAAA,QACrB,oBAAC,qBAAkB;AAAA,QACnB;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,cAAc;AAAA,YACd,iBAAiB;AAAA,YACjB,uBACE,OAAO,qBAAqB,mBAAmB,WAC3C,qBAAqB,iBACrB;AAAA;AAAA,QAER;AAAA,SACF;AAAA,IAEJ;AACA,WACE,iCACE;AAAA,0BAAC,8BAA2B;AAAA,MAC5B,oBAAC,uBAAoB;AAAA,MACrB,oBAAC,qBAAkB;AAAA,MACnB,oBAAC,SAAI,gCAA4B,MAAC,OAAO,EAAE,SAAS,YAAY,GAC9D,8BAAC,aAAW,GAAG,eAAe,GAChC;AAAA,OACF;AAAA,EAEJ;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sandbox-runtime",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sandbox-runtime",
6
- "version": "1.5.1",
6
+ "version": "1.6.0",
7
7
  "branch": "HEAD",
8
- "commit": "46993e27f13bdc44fb8069250240b6cdae88a508",
9
- "builtAt": "2026-09-04T14:54:15.479Z"
8
+ "commit": "bb46a5a8548eab10e5bee011e2a67e9bc3587e5a",
9
+ "builtAt": "2026-09-10T00:29:19.203Z"
10
10
  },
11
11
  "description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",