@replohq/sandbox-runtime 1.7.1 → 1.7.3

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 (123) hide show
  1. package/ClientErrorBoundary.d.ts +1 -1
  2. package/ClientErrorBoundary.js +0 -5
  3. package/DocumentReadyBeacon.js +0 -1
  4. package/LinkInterceptor.js +0 -1
  5. package/NavigationReceiver.js +0 -1
  6. package/NextErrorReporter.js +0 -1
  7. package/README.md +48 -0
  8. package/_vendor/replo-utils/lib/crypto.d.ts +2 -8
  9. package/_vendor/replo-utils/lib/fonts.d.ts +8 -0
  10. package/_vendor/replo-utils/lib/fonts.mjs +12 -14
  11. package/_vendor/replo-utils/lib/geometry.mjs +0 -1
  12. package/_vendor/replo-utils/lib/math.d.ts +0 -4
  13. package/_vendor/replo-utils/lib/math.mjs +0 -1
  14. package/_vendor/replo-utils/lib/posthogReplay.mjs +0 -1
  15. package/_vendor/replo-utils/react/use-iframe-rpc-channel.mjs +0 -1
  16. package/_vendor/replo-utils/react/use-viewport-snapshot-responder.mjs +9 -25
  17. package/_vendor/schemas/componentPreview.mjs +0 -4
  18. package/_vendor/schemas/designLibrary.mjs +0 -2
  19. package/_vendor/schemas/errors.d.ts +0 -3
  20. package/_vendor/schemas/generated/selectModeIframeRpc.d.ts +1 -1
  21. package/_vendor/schemas/iframeRpcChannel.d.ts +1 -1
  22. package/_vendor/schemas/iframeRpcChannel.mjs +0 -22
  23. package/_vendor/schemas/pageAnnotations.mjs +0 -3
  24. package/_vendor/schemas/selectMode.d.ts +0 -4
  25. package/_vendor/schemas/selectModeIframeRpc.d.ts +4 -4
  26. package/_vendor/schemas/selectModeIframeRpc.mjs +2 -12
  27. package/annotations/AnnotationLayerMount.js +0 -1
  28. package/annotations/annotationController.js +0 -3
  29. package/annotations/bridgeGate.js +0 -4
  30. package/buildMetadata.js +3 -3
  31. package/chunk-3YA3QXUQ.mjs +1 -4
  32. package/chunk-FLYEIRFK.mjs +0 -1
  33. package/chunk-G3S6ZNPF.mjs +0 -7
  34. package/chunk-JUKCUPQ6.mjs +5 -129
  35. package/chunk-SGKQ5HGT.mjs +0 -1
  36. package/chunk-TESFJQID.mjs +0 -1
  37. package/chunk-UOBGRB5I.mjs +0 -5
  38. package/design-library-preview/DesignLibraryPreview.js +0 -1
  39. package/next/component-preview-client.js +0 -1
  40. package/next/component-preview-href.js +0 -1
  41. package/next/component-preview-props.js +0 -1
  42. package/next/component-preview.js +0 -1
  43. package/next/config.js +0 -1
  44. package/package.json +4 -4
  45. package/posthog-relay.js +0 -5
  46. package/sandbox-runtime.js +0 -1
  47. package/select-mode/EditorSelection.d.ts +0 -2
  48. package/select-mode/EditorSelection.js +0 -1
  49. package/select-mode/annotationFrames.js +0 -1
  50. package/select-mode/descriptor/elementDescriptor.d.ts +0 -2
  51. package/select-mode/descriptor/elementDescriptor.js +0 -1
  52. package/select-mode/descriptor/styleExtraction.js +0 -1
  53. package/select-mode/displayModeStore.js +0 -2
  54. package/select-mode/fast-refresh-relay.js +0 -1
  55. package/select-mode/fiber.js +1 -5
  56. package/select-mode/hooks/useCrosshairCursor.d.ts +0 -2
  57. package/select-mode/hooks/useCrosshairCursor.js +0 -1
  58. package/select-mode/hooks/useEditModeStateMachine.js +0 -1
  59. package/select-mode/hooks/useOptimisticOverrides.js +0 -1
  60. package/select-mode/hooks/useParentMessaging.d.ts +0 -2
  61. package/select-mode/hooks/useParentMessaging.js +0 -1
  62. package/select-mode/hooks/useSelectModeController.js +0 -1
  63. package/select-mode/hooks/useSelectionHover.d.ts +0 -2
  64. package/select-mode/hooks/useSelectionHover.js +0 -1
  65. package/select-mode/hooks/useSelectionInteractions.d.ts +0 -2
  66. package/select-mode/hooks/useSelectionInteractions.js +0 -1
  67. package/select-mode/hooks/useSelectionScrollSync.d.ts +0 -2
  68. package/select-mode/hooks/useSelectionScrollSync.js +0 -1
  69. package/select-mode/hooks/useSiblingResolution.js +0 -1
  70. package/select-mode/iframeRpcChannel.d.ts +2 -2
  71. package/select-mode/iframeRpcChannel.js +0 -1
  72. package/select-mode/inlineTextMarks.js +0 -1
  73. package/select-mode/interactions/selectionGeometry.d.ts +0 -20
  74. package/select-mode/interactions/selectionGeometry.js +0 -1
  75. package/select-mode/optimisticOverrideDom.js +0 -1
  76. package/select-mode/selectModeSession.js +0 -1
  77. package/select-mode/selectionFrame.d.ts +0 -7
  78. package/select-mode/selectionFrame.js +0 -1
  79. package/select-mode/selectionPublish.js +0 -1
  80. package/select-mode/symbolicate.js +0 -1
  81. package/select-mode/tiptapInlineEditor.js +0 -5
  82. package/ClientErrorBoundary.js.map +0 -7
  83. package/DocumentReadyBeacon.js.map +0 -7
  84. package/LinkInterceptor.js.map +0 -7
  85. package/NavigationReceiver.js.map +0 -7
  86. package/NextErrorReporter.js.map +0 -7
  87. package/annotations/AnnotationLayerMount.js.map +0 -7
  88. package/annotations/annotationController.js.map +0 -7
  89. package/annotations/bridgeGate.js.map +0 -7
  90. package/buildMetadata.js.map +0 -7
  91. package/design-library-preview/DesignLibraryPreview.js.map +0 -7
  92. package/next/component-preview-client.js.map +0 -7
  93. package/next/component-preview-href.js.map +0 -7
  94. package/next/component-preview-props.js.map +0 -7
  95. package/next/component-preview.js.map +0 -7
  96. package/next/config.js.map +0 -7
  97. package/posthog-relay.js.map +0 -7
  98. package/sandbox-runtime.js.map +0 -7
  99. package/select-mode/EditorSelection.js.map +0 -7
  100. package/select-mode/annotationFrames.js.map +0 -7
  101. package/select-mode/descriptor/elementDescriptor.js.map +0 -7
  102. package/select-mode/descriptor/styleExtraction.js.map +0 -7
  103. package/select-mode/displayModeStore.js.map +0 -7
  104. package/select-mode/fast-refresh-relay.js.map +0 -7
  105. package/select-mode/fiber.js.map +0 -7
  106. package/select-mode/hooks/useCrosshairCursor.js.map +0 -7
  107. package/select-mode/hooks/useEditModeStateMachine.js.map +0 -7
  108. package/select-mode/hooks/useOptimisticOverrides.js.map +0 -7
  109. package/select-mode/hooks/useParentMessaging.js.map +0 -7
  110. package/select-mode/hooks/useSelectModeController.js.map +0 -7
  111. package/select-mode/hooks/useSelectionHover.js.map +0 -7
  112. package/select-mode/hooks/useSelectionInteractions.js.map +0 -7
  113. package/select-mode/hooks/useSelectionScrollSync.js.map +0 -7
  114. package/select-mode/hooks/useSiblingResolution.js.map +0 -7
  115. package/select-mode/iframeRpcChannel.js.map +0 -7
  116. package/select-mode/inlineTextMarks.js.map +0 -7
  117. package/select-mode/interactions/selectionGeometry.js.map +0 -7
  118. package/select-mode/optimisticOverrideDom.js.map +0 -7
  119. package/select-mode/selectModeSession.js.map +0 -7
  120. package/select-mode/selectionFrame.js.map +0 -7
  121. package/select-mode/selectionPublish.js.map +0 -7
  122. package/select-mode/symbolicate.js.map +0 -7
  123. package/select-mode/tiptapInlineEditor.js.map +0 -7
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  /**
3
- * NOTE (Max, 2026-06-10): Client-side error boundary. On a caught render error it
3
+ * Client-side error boundary. On a caught render error it
4
4
  * (1) reports the error to the parent editor via postMessage (so it can get reported to Sentry)
5
5
  * and (2) renders a neutral cover instead of going blank, so the preview never flashes the broken
6
6
  * page while the agent fixes it. The editor decides what to show on top (loading
@@ -34,10 +34,6 @@ function ClientErrorBoundary({ children }) {
34
34
  const errorObj = error instanceof Error ? error : new Error(String(error));
35
35
  window.parent.postMessage(
36
36
  {
37
- // TODO (Max, 2026-06-11, REPL-27851): When adding Sentry to miniapps, I'll ensure we listen to this message
38
- // and send it to Sentry. I'm not a fan of having 2 separate post messages for reporting errors (the 'error' post message in NextErrorReporter, and this one).
39
- // But there's no way for the NextErrorReporter to get the actual error object, so we'll
40
- // need a separate postMessage (this one, with an updated name).
41
37
  type: "replo-editor:client-error",
42
38
  payload: {
43
39
  pageRoute: window.location.pathname,
@@ -58,4 +54,3 @@ function ClientErrorBoundary({ children }) {
58
54
  export {
59
55
  ClientErrorBoundary
60
56
  };
61
- //# sourceMappingURL=ClientErrorBoundary.js.map
@@ -6,4 +6,3 @@ function DocumentReadyBeacon() {
6
6
  export {
7
7
  DocumentReadyBeacon
8
8
  };
9
- //# sourceMappingURL=DocumentReadyBeacon.js.map
@@ -169,4 +169,3 @@ function LinkInterceptor() {
169
169
  export {
170
170
  LinkInterceptor as default
171
171
  };
172
- //# sourceMappingURL=LinkInterceptor.js.map
@@ -22,4 +22,3 @@ function NavigationReceiver() {
22
22
  export {
23
23
  NavigationReceiver
24
24
  };
25
- //# sourceMappingURL=NavigationReceiver.js.map
@@ -129,4 +129,3 @@ function NextErrorReporter() {
129
129
  export {
130
130
  NextErrorReporter
131
131
  };
132
- //# sourceMappingURL=NextErrorReporter.js.map
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # `@replohq/sandbox-runtime`
2
+
3
+ The Replo sandbox runtime connects a Next.js development preview to Replo while
4
+ preserving normal application behavior in production. It provides preview
5
+ readiness, navigation, error reporting, selection, annotations, and design
6
+ library preview support through one root component.
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ pnpm add @replohq/sandbox-runtime @replohq/sdk @opennextjs/cloudflare @tanstack/react-query
12
+ ```
13
+
14
+ The package requires Next.js 15 or newer and React 19 or newer. React, React
15
+ DOM, and their type packages are peer dependencies and are normally already
16
+ present in a Next.js application.
17
+
18
+ ## Usage
19
+
20
+ Compose `SandboxRuntime` inside the SDK's `ReploProvider` in the root layout:
21
+
22
+ ```tsx
23
+ // app/layout.tsx
24
+ import { SandboxRuntime } from "@replohq/sandbox-runtime";
25
+ import { ReploProvider } from "@replohq/sdk/providers/replo-provider";
26
+
27
+ export default function RootLayout({ children }: React.PropsWithChildren) {
28
+ return (
29
+ <html lang="en">
30
+ <body>
31
+ <ReploProvider>
32
+ <SandboxRuntime>{children}</SandboxRuntime>
33
+ </ReploProvider>
34
+ </body>
35
+ </html>
36
+ );
37
+ }
38
+ ```
39
+
40
+ `SandboxRuntime` is a Client Component. In a development server it enables the
41
+ Replo preview integration. In a production build it renders `children`
42
+ unchanged, so the same composition can remain in the root layout for every
43
+ environment.
44
+
45
+ ## License
46
+
47
+ This package is proprietary software. See [LICENSE](./LICENSE)
48
+ (`SEE LICENSE IN LICENSE`) and the [Replo Terms of Service](https://replo.app/terms).
@@ -12,14 +12,8 @@ export declare function randomBase64Url(byteLength: number): string;
12
12
  * `crypto.getRandomValues`, which carries no such restriction.
13
13
  */
14
14
  export declare function randomUUID(): string;
15
- /**
16
- * Returns the SHA-256 of `input` as a 64-char lowercase hex string.
17
- *
18
- * Used for storing opaque secrets (e.g. public API tokens) where we want
19
- * constant-length hex output suitable for a `VARCHAR(64)` column with a
20
- * unique index.
21
- */
22
- export declare function sha256Hex(input: string): Promise<string>;
15
+ /** Strings use UTF-8; binary inputs are hashed unchanged. */
16
+ export declare function sha256Hex(input: string | Parameters<typeof crypto.subtle.digest>[1]): Promise<string>;
23
17
  export declare function constantTimeEqual({ left, right, }: {
24
18
  left: Uint8Array;
25
19
  right: Uint8Array;
@@ -1,3 +1,11 @@
1
+ /** Known symbol assets are not text typefaces; unknown families stay eligible. */
2
+ export declare function isKnownSymbolFontFamily(family: string): boolean;
3
+ export declare function getTypographyFonts<FontType extends {
4
+ family: string;
5
+ faces: {
6
+ cssFamily: string;
7
+ }[];
8
+ }>(fonts: FontType[]): FontType[];
1
9
  /**
2
10
  * Slugified family name, matching how `fontNameToCssVariable` derives a CSS var
3
11
  * (e.g. "DM Sans" → "dm-sans"), so a `--font-<slug>` var round-trips back to a
@@ -1,7 +1,6 @@
1
1
  import { isArray_default } from '../../../chunk-TESFJQID.mjs';
2
2
  import { Symbol_default, isObjectLike_default, baseGetTag_default } from '../../../chunk-G3S6ZNPF.mjs';
3
3
 
4
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js
5
4
  function arrayMap(array, iteratee) {
6
5
  var index = -1, length = array == null ? 0 : array.length, result = Array(length);
7
6
  while (++index < length) {
@@ -11,7 +10,6 @@ function arrayMap(array, iteratee) {
11
10
  }
12
11
  var arrayMap_default = arrayMap;
13
12
 
14
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js
15
13
  var symbolTag = "[object Symbol]";
16
14
  function isSymbol(value) {
17
15
  return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
@@ -34,13 +32,11 @@ function baseToString(value) {
34
32
  }
35
33
  var baseToString_default = baseToString;
36
34
 
37
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js
38
35
  function toString(value) {
39
36
  return value == null ? "" : baseToString_default(value);
40
37
  }
41
38
  var toString_default = toString;
42
39
 
43
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js
44
40
  function baseSlice(array, start, end) {
45
41
  var index = -1, length = array.length;
46
42
  if (start < 0) {
@@ -60,7 +56,6 @@ function baseSlice(array, start, end) {
60
56
  }
61
57
  var baseSlice_default = baseSlice;
62
58
 
63
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castSlice.js
64
59
  function castSlice(array, start, end) {
65
60
  var length = array.length;
66
61
  end = end === void 0 ? length : end;
@@ -68,7 +63,6 @@ function castSlice(array, start, end) {
68
63
  }
69
64
  var castSlice_default = castSlice;
70
65
 
71
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js
72
66
  var rsAstralRange = "\\ud800-\\udfff";
73
67
  var rsComboMarksRange = "\\u0300-\\u036f";
74
68
  var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
@@ -82,13 +76,11 @@ function hasUnicode(string) {
82
76
  }
83
77
  var hasUnicode_default = hasUnicode;
84
78
 
85
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiToArray.js
86
79
  function asciiToArray(string) {
87
80
  return string.split("");
88
81
  }
89
82
  var asciiToArray_default = asciiToArray;
90
83
 
91
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeToArray.js
92
84
  var rsAstralRange2 = "\\ud800-\\udfff";
93
85
  var rsComboMarksRange2 = "\\u0300-\\u036f";
94
86
  var reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
@@ -114,13 +106,11 @@ function unicodeToArray(string) {
114
106
  }
115
107
  var unicodeToArray_default = unicodeToArray;
116
108
 
117
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToArray.js
118
109
  function stringToArray(string) {
119
110
  return hasUnicode_default(string) ? unicodeToArray_default(string) : asciiToArray_default(string);
120
111
  }
121
112
  var stringToArray_default = stringToArray;
122
113
 
123
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createCaseFirst.js
124
114
  function createCaseFirst(methodName) {
125
115
  return function(string) {
126
116
  string = toString_default(string);
@@ -132,17 +122,25 @@ function createCaseFirst(methodName) {
132
122
  }
133
123
  var createCaseFirst_default = createCaseFirst;
134
124
 
135
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/upperFirst.js
136
125
  var upperFirst = createCaseFirst_default("toUpperCase");
137
126
  var upperFirst_default = upperFirst;
138
127
 
139
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/capitalize.js
140
128
  function capitalize(string) {
141
129
  return upperFirst_default(toString_default(string).toLowerCase());
142
130
  }
143
131
  var capitalize_default = capitalize;
144
132
 
145
- // ../replo-utils/lib/fonts.ts
133
+ function isKnownSymbolFontFamily(family) {
134
+ const normalized = family.trim().replace(/^["']|["']$/gu, "");
135
+ return /(?:^|[\s_-])(?:icons?|symbols?)(?:$|[\s_-])/iu.test(normalized) || /^(?:webrupee|fontawesome(?:[0-9]+)?(?:free|pro|brands|duotone|sharp)?|icomoon|glyphicons|wingdings|webdings|materialicons)$/iu.test(
136
+ normalized.replace(/[\s_-]/gu, "")
137
+ );
138
+ }
139
+ function getTypographyFonts(fonts) {
140
+ return fonts.filter((font) => {
141
+ return !isKnownSymbolFontFamily(font.family) && (font.faces.length === 0 || font.faces.some((face) => !isKnownSymbolFontFamily(face.cssFamily)));
142
+ });
143
+ }
146
144
  function slugifyFontFamily(family) {
147
145
  return family.replace(/([a-z])([A-Z])/g, "$1-$2").split(/[\s_-]+/u).map((word) => word.toLowerCase()).join("-");
148
146
  }
@@ -219,4 +217,4 @@ var escapeFontFamilyName = (fontFamily) => {
219
217
  return fontFamily.replace(/"/g, '\\"').replace(/'/g, "\\'");
220
218
  };
221
219
 
222
- export { buildFontFaceCss, buildGoogleFontsCssUrl, describeFontFile, escapeFontFamilyName, fontFormatFromExtension, fontFormatFromMimeType, fontNameToCssVariable, fontNameToVariableName, quoteFontFamily, slugifyFontFamily };
220
+ export { buildFontFaceCss, buildGoogleFontsCssUrl, describeFontFile, escapeFontFamilyName, fontFormatFromExtension, fontFormatFromMimeType, fontNameToCssVariable, fontNameToVariableName, getTypographyFonts, isKnownSymbolFontFamily, quoteFontFamily, slugifyFontFamily };
@@ -1,4 +1,3 @@
1
- // ../replo-utils/lib/geometry.ts
2
1
  function isIntersecting(targetRect, destinationRect, { tolerance = 0 } = {}) {
3
2
  return targetRect.left <= destinationRect.right + tolerance && targetRect.right >= destinationRect.left - tolerance && targetRect.top <= destinationRect.bottom + tolerance && targetRect.bottom >= destinationRect.top - tolerance;
4
3
  }
@@ -40,8 +40,6 @@ export declare function randomBigString(): string;
40
40
  /**
41
41
  * Given a current value and a previous value, calculate the percentage change
42
42
  * from the previous value to the current value.
43
- *
44
- * @author Max 2025-04-01
45
43
  */
46
44
  export declare function calculatePercentageChange(current: number, previous: number): number | null;
47
45
  /**
@@ -54,7 +52,5 @@ export declare function calculatePercentageChange(current: number, previous: num
54
52
  * formatBytes(1536) // "1.50 KB"
55
53
  * formatBytes(1048576) // "1.00 MB"
56
54
  * formatBytes("1073741824") // "1.00 GB"
57
- *
58
- * @author Max 2024-08-28
59
55
  */
60
56
  export declare function formatBytes(bytes: number | string): string;
@@ -2,7 +2,6 @@ import { randomUUID } from '../../../chunk-SGKQ5HGT.mjs';
2
2
  import { isNumber_default } from '../../../chunk-FLYEIRFK.mjs';
3
3
  import '../../../chunk-G3S6ZNPF.mjs';
4
4
 
5
- // ../replo-utils/lib/math.ts
6
5
  var EPSILON = 0.03;
7
6
  function isCloseTo(number, comparator, epsilon = EPSILON) {
8
7
  return Math.abs(number - comparator) < epsilon;
@@ -1,4 +1,3 @@
1
- // ../replo-utils/lib/posthogReplay.ts
2
1
  var POSTHOG_REPLAY_SNAPSHOT_REQUEST = "posthog:replay:request-full-snapshot";
3
2
  var POSTHOG_REPLAY_READY_POLL_INTERVAL_MS = 100;
4
3
  var POSTHOG_REPLAY_READY_POLL_TIMEOUT_MS = 1e4;
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
 
3
- // ../replo-utils/react/use-iframe-rpc-channel.ts
4
3
  function useIframeRpcChannel(channel) {
5
4
  React.useEffect(() => {
6
5
  if (!channel) {
@@ -1,7 +1,6 @@
1
1
  import { startViewportSnapshotResponder } from '../../../chunk-3YA3QXUQ.mjs';
2
2
  import { useEffect } from 'react';
3
3
 
4
- // ../../node_modules/.pnpm/rrweb-snapshot@2.1.1/node_modules/rrweb-snapshot/dist/rrweb-snapshot.js
5
4
  var __defProp = Object.defineProperty;
6
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
6
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -44,7 +43,7 @@ function getUntaintedPrototype(key) {
44
43
  const defaultPrototype = defaultObj.prototype;
45
44
  const accessorNames = key in testableAccessors ? testableAccessors[key] : void 0;
46
45
  const isUntaintedAccessors = Boolean(
47
- accessorNames && // @ts-expect-error 2345
46
+ accessorNames &&
48
47
  accessorNames.every(
49
48
  (accessor) => {
50
49
  var _a, _b;
@@ -57,7 +56,6 @@ function getUntaintedPrototype(key) {
57
56
  const methodNames = key in testableMethods ? testableMethods[key] : void 0;
58
57
  const isUntaintedMethods = Boolean(
59
58
  methodNames && methodNames.every(
60
- // @ts-expect-error 2345
61
59
  (method) => {
62
60
  var _a;
63
61
  return typeof defaultPrototype[method] === "function" && ((_a = defaultPrototype[method]) == null ? void 0 : _a.toString().includes("[native code]"));
@@ -219,8 +217,6 @@ function isElement(n) {
219
217
  }
220
218
  function isShadowRoot(n) {
221
219
  const hostEl = (
222
- // anchor and textarea elements also have a `host` property
223
- // but only shadow roots have a `mode` property
224
220
  n && "host" in n && "mode" in n && index.host(n) || null
225
221
  );
226
222
  return Boolean(
@@ -279,9 +275,8 @@ function stringifyRule(rule2, sheetHref) {
279
275
  if (isCSSImportRule(rule2)) {
280
276
  let importStringified;
281
277
  try {
282
- importStringified = // for same-origin stylesheets,
283
- // we can access the imported stylesheet rules directly
284
- stringifyStylesheet(rule2.styleSheet) || // work around browser issues with the raw string `@import url(...)` statement
278
+ importStringified =
279
+ stringifyStylesheet(rule2.styleSheet) ||
285
280
  escapeImportStatement(rule2);
286
281
  } catch (error) {
287
282
  importStringified = rule2.cssText;
@@ -331,8 +326,6 @@ var Mirror = class {
331
326
  getMeta(n) {
332
327
  return this.nodeMetaMap.get(n) || null;
333
328
  }
334
- // removes the node from idNodeMap
335
- // doesn't remove the node from nodeMetaMap
336
329
  removeNodeFromMap(n) {
337
330
  const id = this.getId(n);
338
331
  this.idNodeMap.delete(id);
@@ -398,7 +391,6 @@ function is2DCanvasBlank(canvas) {
398
391
  const getImageData = ctx.getImageData;
399
392
  const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData ? getImageData[ORIGINAL_ATTRIBUTE_NAME] : getImageData;
400
393
  const pixelBuffer = new Uint32Array(
401
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
402
394
  originalGetImageData.call(
403
395
  ctx,
404
396
  x,
@@ -415,7 +407,6 @@ function is2DCanvasBlank(canvas) {
415
407
  function getInputType(element) {
416
408
  const type = element.type;
417
409
  return element.hasAttribute("data-rr-is-password") ? "password" : type ? (
418
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
419
410
  toLowerCase(type)
420
411
  ) : null;
421
412
  }
@@ -504,8 +495,7 @@ function splitCssText(cssText, style, _testNoPxNorm = false) {
504
495
  let j = 3;
505
496
  for (; j < textContentNorm.length; j++) {
506
497
  if (
507
- // keep consuming css identifiers (to get a decent chunk more quickly)
508
- textContentNorm[j].match(/[a-zA-Z0-9]/) || // substring needs to be unique to this section
498
+ textContentNorm[j].match(/[a-zA-Z0-9]/) ||
509
499
  textContentNorm.indexOf(textContentNorm.substring(0, j), 1) !== -1
510
500
  ) {
511
501
  continue;
@@ -854,7 +844,6 @@ function serializeNode(n, options) {
854
844
  type: NodeType.Document,
855
845
  childNodes: [],
856
846
  compatMode: n.compatMode
857
- // probably "BackCompat"
858
847
  };
859
848
  } else {
860
849
  return {
@@ -1147,8 +1136,6 @@ function slimDOMDefaults(_slimDOMOptions) {
1147
1136
  headMetaRobots: true,
1148
1137
  headMetaHttpEquiv: true,
1149
1138
  headMetaVerification: true,
1150
- // the following are off for slimDOMOptions === true,
1151
- // as they destroy some (hidden) info:
1152
1139
  headMetaAuthorship: _slimDOMOptions === "all",
1153
1140
  headMetaDescKeywords: _slimDOMOptions === "all",
1154
1141
  headTitleMutations: _slimDOMOptions === "all"
@@ -1162,9 +1149,9 @@ function slimDOMExcluded(sn, slimDOMOptions) {
1162
1149
  if (slimDOMOptions.comment && sn.type === NodeType.Comment) {
1163
1150
  return true;
1164
1151
  } else if (sn.type === NodeType.Element) {
1165
- if (slimDOMOptions.script && // script tag
1166
- (sn.tagName === "script" || // (module)preload link
1167
- sn.tagName === "link" && (sn.attributes.rel === "preload" && sn.attributes.as === "script" || sn.attributes.rel === "modulepreload") || // prefetch link
1152
+ if (slimDOMOptions.script &&
1153
+ (sn.tagName === "script" ||
1154
+ sn.tagName === "link" && (sn.attributes.rel === "preload" && sn.attributes.as === "script" || sn.attributes.rel === "modulepreload") ||
1168
1155
  sn.tagName === "link" && sn.attributes.rel === "prefetch" && typeof sn.attributes.href === "string" && extractFileExtension(sn.attributes.href) === "js")) {
1169
1156
  return true;
1170
1157
  } else if (slimDOMOptions.headFavicon && (sn.tagName === "link" && sn.attributes.rel === "shortcut icon" || sn.tagName === "meta" && (lowerIfExists(sn.attributes.name).match(
@@ -1174,7 +1161,7 @@ function slimDOMExcluded(sn, slimDOMOptions) {
1174
1161
  } else if (sn.tagName === "meta") {
1175
1162
  if (slimDOMOptions.headMetaDescKeywords && lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {
1176
1163
  return true;
1177
- } else if (slimDOMOptions.headMetaSocial && (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) || // og = opengraph (facebook)
1164
+ } else if (slimDOMOptions.headMetaSocial && (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||
1178
1165
  lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) || lowerIfExists(sn.attributes.name) === "pinterest")) {
1179
1166
  return true;
1180
1167
  } else if (slimDOMOptions.headMetaRobots && (lowerIfExists(sn.attributes.name) === "robots" || lowerIfExists(sn.attributes.name) === "googlebot" || lowerIfExists(sn.attributes.name) === "bingbot")) {
@@ -2067,7 +2054,7 @@ function requireNode() {
2067
2054
  set(node2, prop, value) {
2068
2055
  if (node2[prop] === value) return true;
2069
2056
  node2[prop] = value;
2070
- if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */
2057
+ if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" ||
2071
2058
  prop === "text") {
2072
2059
  node2.markDirty();
2073
2060
  }
@@ -4158,7 +4145,6 @@ function requireParser() {
4158
4145
  }
4159
4146
  }
4160
4147
  }
4161
- // Helpers
4162
4148
  getPosition(offset) {
4163
4149
  let pos = this.input.fromOffset(offset);
4164
4150
  return {
@@ -4317,7 +4303,6 @@ function requireParser() {
4317
4303
  }
4318
4304
  return spaces;
4319
4305
  }
4320
- // Errors
4321
4306
  spacesAndCommentsFromStart(tokens) {
4322
4307
  let next;
4323
4308
  let spaces = "";
@@ -5235,7 +5220,6 @@ postcss.Rule;
5235
5220
  postcss.Root;
5236
5221
  postcss.Node;
5237
5222
 
5238
- // ../replo-utils/react/use-viewport-snapshot-responder.tsx
5239
5223
  function measureViewportFrameRect(frameIndex) {
5240
5224
  const element = document.querySelectorAll("iframe")[frameIndex];
5241
5225
  if (!element) {
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- // ../schemas/componentPreview.ts
4
3
  var DATA_LOADER_KEYS = {
5
4
  SHOPIFY_PRODUCT: "shopify_storefront.product",
6
5
  SHOPIFY_COLLECTION: "shopify_storefront.collection",
@@ -29,7 +28,6 @@ var DATA_LOADER_KEYS = {
29
28
  };
30
29
  z.enum(Object.values(DATA_LOADER_KEYS));
31
30
 
32
- // ../schemas/componentPreview.ts
33
31
  var MAX_COMPONENT_PREVIEW_PROPS_BYTES = 16 * 1024;
34
32
  var componentPreviewPropNameSchema = z.string().min(1).max(80).regex(/^[A-Za-z_$][\w$]*$/u).refine((name) => {
35
33
  return !["__proto__", "constructor", "dangerouslySetInnerHTML"].includes(
@@ -49,8 +47,6 @@ var websiteBuilderToComponentPreviewMethodConfig = {
49
47
  props: componentPreviewPropsSchema,
50
48
  sourceRevision: z.string().min(1)
51
49
  }),
52
- // How the frame applied the update: in place via the client prop store,
53
- // via an in-frame server navigation, or not at all (already current).
54
50
  outputSchema: z.object({
55
51
  mode: z.enum(["client", "navigation", "unchanged"])
56
52
  }),
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- // ../schemas/designLibrary.ts
4
3
  var colorTypeSchema = z.enum([
5
4
  "basic",
6
5
  "foregroundPrimary",
@@ -55,7 +54,6 @@ z.discriminatedUnion("type", [
55
54
  savedStyleTextAttributesSchema
56
55
  ]).describe("SavedStyleAttributes");
57
56
 
58
- // ../schemas/designLibrary.ts
59
57
  var savedColorStyleSchema = z.object({
60
58
  type: z.literal("color"),
61
59
  name: z.string(),
@@ -186,9 +186,6 @@ export type ErrorDetails = {
186
186
  * Map of error keys to custom user-facing details. Should ONLY be used
187
187
  * in cases where we want to override the default behavior of ErrorUserFacingDetails
188
188
  * from the backend.
189
- *
190
- * TODO (Noah, 2024-01-15): Clean up these custom configs, all of them
191
- * are only used by Django (and 'base' can be moved directly into the reducer function)
192
189
  */
193
190
  export declare const CUSTOM_ERROR_KEY_TO_PROPS: {
194
191
  "shopifyArticle.failedToPublish": () => {
@@ -61,7 +61,7 @@ export type SelectModeParentMessage = {
61
61
  };
62
62
  export type SelectModeIframeMessage = {
63
63
  method: "iframeReady";
64
- data?: IframeRuntimeBuildMetadata;
64
+ data: IframeRuntimeBuildMetadata;
65
65
  } | {
66
66
  method: "elementSelected";
67
67
  data: {
@@ -16,7 +16,7 @@ export type IframeRpcChannelHandlerMeta<OutgoingMethods extends IframeRpcChannel
16
16
  channel: IframeRpcChannelRemote<OutgoingMethods>;
17
17
  };
18
18
  export type IframeRpcChannelHandlers<IncomingMethods extends IframeRpcChannelMethodConfig, OutgoingMethods extends IframeRpcChannelMethodConfig = IframeRpcChannelMethodConfig> = {
19
- [Method in keyof IncomingMethods]: (input: z.output<IncomingMethods[Method]["inputSchema"]>, meta: IframeRpcChannelHandlerMeta<OutgoingMethods>) => IsVoidMethod<IncomingMethods, Method> extends true ? void : // Valued handlers stay `unknown` so callers can return domain/generated
19
+ [Method in keyof IncomingMethods]: (input: z.output<IncomingMethods[Method]["inputSchema"]>, meta: IframeRpcChannelHandlerMeta<OutgoingMethods>) => IsVoidMethod<IncomingMethods, Method> extends true ? void :
20
20
  unknown | Promise<unknown>;
21
21
  };
22
22
  export type IframeRpcChannelInputHandlers<IncomingMethods extends IframeRpcChannelMethodConfig> = {
@@ -5,7 +5,6 @@ import '../../chunk-TESFJQID.mjs';
5
5
  import '../../chunk-G3S6ZNPF.mjs';
6
6
  import { z } from 'zod';
7
7
 
8
- // ../replo-utils/lib/log.ts
9
8
  var defaultLogger = {
10
9
  info: console.log,
11
10
  debug: console.debug,
@@ -39,7 +38,6 @@ var errorUserFacingDetailsMessageSchema = z.object({
39
38
  "billing.addPublishedElements",
40
39
  "billing.addShopifyThemeProject",
41
40
  "billing.addReploSite",
42
- // Agent Billing ONLY
43
41
  "agentBilling.shopifyThemeBuilder.publishedElements.exceeded",
44
42
  "agentBilling.shopifyThemeBuilder.projects.exceeded",
45
43
  "agentBilling.sites.exceeded",
@@ -48,14 +46,8 @@ var errorUserFacingDetailsMessageSchema = z.object({
48
46
  ]),
49
47
  message: z.string(),
50
48
  isRecoverable: z.boolean().optional(),
51
- // NOTE (Matt 2024-03-22): We support detail being an array of strings
52
- // in FullPageModal only.
53
49
  detail: z.array(z.string()).or(z.string()).optional(),
54
50
  key: z.string(),
55
- // Structured data for API callers next to the human message, e.g. the
56
- // current draft version on a project-context 409 or the offending paths on
57
- // a 422. The worker error handler serializes userFacingDetails as-is, so
58
- // this is the one place such data can travel without a second envelope.
59
51
  details: z.record(z.string(), z.unknown()).optional(),
60
52
  usage: z.object({
61
53
  current: z.number(),
@@ -101,15 +93,7 @@ var errorUserFacingDetailsMessageSchema = z.object({
101
93
  ]).optional()
102
94
  }).describe("ErrorUserFacingDetailsWithMessage");
103
95
  z.discriminatedUnion("type", [
104
- /**
105
- * Normal errors, show error UI depending on the type
106
- */
107
96
  errorUserFacingDetailsMessageSchema,
108
- /**
109
- * Errors which should be ignored by the frontend. This is uncommon, usually
110
- * you want to show an error in the UI, and if you don't want to then you catch
111
- * the error in your route.
112
- */
113
97
  z.object({
114
98
  type: z.literal("uncommon_none"),
115
99
  key: z.string(),
@@ -171,7 +155,6 @@ var IframeRpcChannelInvalidInputError = class extends IframeRpcChannelError {
171
155
  }
172
156
  };
173
157
 
174
- // ../schemas/iframeRpcChannel.ts
175
158
  var iframeRpcCallResultSchema = z.discriminatedUnion("type", [
176
159
  z.object({
177
160
  type: z.literal("success"),
@@ -308,7 +291,6 @@ function createIframeRpcChannel(options) {
308
291
  }
309
292
  try {
310
293
  const handler = handlers[
311
- // eslint-disable-next-line replo/no-as-cast -- NOTE (Noah, 2026-07-25): The method existence check above narrows this dynamic wire string to the configured handler keys.
312
294
  message.method
313
295
  ];
314
296
  const result = await handler(parsedInput.data, handlerMeta);
@@ -350,7 +332,6 @@ function createIframeRpcChannel(options) {
350
332
  return;
351
333
  }
352
334
  const handler = handlers[
353
- // eslint-disable-next-line replo/no-as-cast -- NOTE (Noah, 2026-08-07): Method existence check narrows this wire string to configured handler keys.
354
335
  message.method
355
336
  ];
356
337
  handler(parsedInput.data, handlerMeta);
@@ -493,9 +474,6 @@ function createIframeRpcChannel(options) {
493
474
  }, timeoutMs);
494
475
  pendingRequests.set(id, {
495
476
  method,
496
- // PendingRequest is shared across methods, so resolve is typed as
497
- // unknown; handleResponse already validated against this method's
498
- // outputSchema before calling it.
499
477
  resolve: (value) => {
500
478
  resolve(value);
501
479
  },
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- // ../schemas/pageAnnotations.ts
4
3
  var PAGE_ANNOTATIONS_PROTOCOL_VERSION = 1;
5
4
  var pageAnnotationColorSchema = z.enum(["red", "purple", "amber"]).describe("PageAnnotationColor");
6
5
  var pageAnnotationPlacementSchema = z.enum(["element", "pageTop"]).describe("PageAnnotationPlacement");
@@ -9,8 +8,6 @@ var pageAnnotationMarkerSchema = z.object({
9
8
  number: z.number().int().min(1).max(99),
10
9
  color: pageAnnotationColorSchema,
11
10
  selector: z.string().min(1).max(2e3),
12
- // "pageTop" markers ignore the selector and stack near the top of the
13
- // page (page-wide findings); "element" markers pin to their selector.
14
11
  placement: pageAnnotationPlacementSchema.default("element")
15
12
  }).describe("PageAnnotationMarker");
16
13
  var pageAnnotationViewportRectSchema = z.object({
@@ -312,8 +312,6 @@ export declare const selectModeFormatCommandSchema: z.ZodEnum<{
312
312
  * are pinned to this enum via `Extract<SelectModeSelectionType, …>`
313
313
  *
314
314
  * Renaming or adding a variant here is a TS error in all three.
315
- *
316
- * @author Kevin O'Connell 2026-04-20
317
315
  */
318
316
  export declare const selectModeSelectionTypeSchema: z.ZodEnum<{
319
317
  element: "element";
@@ -337,8 +335,6 @@ export declare const selectModeSelectionTypeSchema: z.ZodEnum<{
337
335
  * Distinct from the SDK-internal `SelectModeInteractionSession`, which
338
336
  * holds live DOM `Element` refs and live pointer/scroll geometry. This
339
337
  * type holds only the message-passable, serialized projection.
340
- *
341
- * @author Kevin O'Connell 2026-04-23
342
338
  */
343
339
  export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
344
340
  type: z.ZodLiteral<"none">;
@@ -356,13 +356,13 @@ export declare const canopyToWebsiteBuilderMethodConfig: {
356
356
  timeoutMs: number;
357
357
  };
358
358
  iframeReady: {
359
- inputSchema: z.ZodOptional<z.ZodObject<{
359
+ inputSchema: z.ZodObject<{
360
360
  packageName: z.ZodString;
361
361
  version: z.ZodString;
362
362
  branch: z.ZodNullable<z.ZodString>;
363
363
  commit: z.ZodNullable<z.ZodString>;
364
364
  builtAt: z.ZodNullable<z.ZodString>;
365
- }, z.core.$strip>>;
365
+ }, z.core.$strip>;
366
366
  outputSchema: z.ZodVoid;
367
367
  };
368
368
  elementSelected: {
@@ -776,13 +776,13 @@ export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.Z
776
776
  }, z.core.$strip>], "method">;
777
777
  export declare const selectModeIframeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
778
778
  method: z.ZodLiteral<"iframeReady">;
779
- data: z.ZodOptional<z.ZodObject<{
779
+ data: z.ZodObject<{
780
780
  packageName: z.ZodString;
781
781
  version: z.ZodString;
782
782
  branch: z.ZodNullable<z.ZodString>;
783
783
  commit: z.ZodNullable<z.ZodString>;
784
784
  builtAt: z.ZodNullable<z.ZodString>;
785
- }, z.core.$strip>>;
785
+ }, z.core.$strip>;
786
786
  }, z.core.$strip>, z.ZodObject<{
787
787
  method: z.ZodLiteral<"elementSelected">;
788
788
  data: z.ZodObject<{