@replohq/sandbox-runtime 1.16.1 → 1.17.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.
- package/_vendor/replo-utils/lib/historyKeys.d.ts +2 -0
- package/_vendor/replo-utils/lib/historyKeys.mjs +18 -0
- package/_vendor/replo-utils/lib/viewportSnapshot.d.ts +1 -1
- package/_vendor/replo-utils/lib/viewportSnapshot.mjs +1 -1
- package/_vendor/replo-utils/react/use-viewport-snapshot-responder.mjs +28 -5222
- package/_vendor/schemas/errors.d.ts +3 -43
- package/_vendor/schemas/generated/selectModeIframeRpc.d.ts +43 -0
- package/_vendor/schemas/iframeRpcChannel.mjs +2 -0
- package/_vendor/schemas/reploError.d.ts +43 -0
- package/_vendor/schemas/selectModeIframeRpc.d.ts +146 -7
- package/_vendor/schemas/selectModeIframeRpc.mjs +73 -10
- package/buildMetadata.js +3 -3
- package/{chunk-3YA3QXUQ.mjs → chunk-B3PLD7SH.mjs} +29 -18
- package/package.json +4 -4
- package/rrweb-snapshot-GTQBXO2Y.mjs +5761 -0
- package/select-mode/EditorSelection.js +5 -1
- package/select-mode/fast-refresh-relay.js +82 -3
- package/select-mode/fiber.d.ts +6 -0
- package/select-mode/fiber.js +33 -0
- package/select-mode/hooks/useParentMessaging.js +10 -3
- package/select-mode/hooks/useSelectionHover.js +2 -1
- package/select-mode/hooks/useSelectionInteractions.js +10 -0
- package/select-mode/iframeRpcChannel.d.ts +45 -7
- package/select-mode/iframeRpcChannel.js +9 -8
- package/select-mode/section-canvas/SectionCanvas.d.ts +7 -0
- package/select-mode/section-canvas/SectionCanvas.js +599 -0
- package/select-mode/section-canvas/optimisticSectionMove.d.ts +39 -0
- package/select-mode/section-canvas/optimisticSectionMove.js +172 -0
- package/select-mode/section-canvas/sectionCanvasControls.d.ts +3 -0
- package/select-mode/section-canvas/sectionCanvasControls.js +8 -0
- package/select-mode/section-canvas/sectionCanvasStore.d.ts +71 -0
- package/select-mode/section-canvas/sectionCanvasStore.js +275 -0
- package/select-mode/section-canvas/sectionElements.d.ts +16 -0
- package/select-mode/section-canvas/sectionElements.js +94 -0
- package/select-mode/section-canvas/sectionGhost.d.ts +5 -0
- package/select-mode/section-canvas/sectionGhost.js +23 -0
- package/select-mode/symbolicate.d.ts +2 -0
- package/select-mode/symbolicate.js +18 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Which undo history step a key press asks for: Cmd/Ctrl+Z, Cmd/Ctrl+Shift+Z or Cmd/Ctrl+Y, never while typing in a field. */
|
|
2
|
+
export declare function historyStepForKey(event: Pick<KeyboardEvent, "key" | "metaKey" | "ctrlKey" | "altKey" | "shiftKey" | "target">): "undo" | "redo" | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function isTyping(target) {
|
|
2
|
+
return target instanceof HTMLElement && (target.isContentEditable || target.closest("[contenteditable]:not([contenteditable='false'])") !== null || ["INPUT", "TEXTAREA", "SELECT"].includes(target.tagName));
|
|
3
|
+
}
|
|
4
|
+
function historyStepForKey(event) {
|
|
5
|
+
if (!(event.metaKey || event.ctrlKey) || event.altKey) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
if (isTyping(event.target)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const key = event.key.toLowerCase();
|
|
12
|
+
if (key === "y" || key === "z" && event.shiftKey) {
|
|
13
|
+
return "redo";
|
|
14
|
+
}
|
|
15
|
+
return key === "z" ? "undo" : null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { historyStepForKey };
|
|
@@ -98,7 +98,7 @@ export declare function requestChildViewportContexts(input: Parameters<typeof re
|
|
|
98
98
|
*/
|
|
99
99
|
export declare function startViewportSnapshotResponder({ targetWindow, takeSnapshot, measureFrameRect, measureViewportContext, isTrustedRequester, cascadeTimeoutMs, }: {
|
|
100
100
|
targetWindow: RelayWindow;
|
|
101
|
-
takeSnapshot: () => unknown
|
|
101
|
+
takeSnapshot: () => unknown | Promise<unknown>;
|
|
102
102
|
measureFrameRect: (frameIndex: number) => ViewportFrameRect | null;
|
|
103
103
|
measureViewportContext?: () => ViewportFrameContext;
|
|
104
104
|
isTrustedRequester?: (origin: string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { VIEWPORT_CONTEXT_REQUEST, VIEWPORT_CONTEXT_RESPONSE, VIEWPORT_SNAPSHOT_MAX_DEPTH, VIEWPORT_SNAPSHOT_REQUEST, VIEWPORT_SNAPSHOT_RESPONSE, isTrustedViewportSnapshotRequester, requestChildViewportContexts, requestChildViewportSnapshots, startViewportSnapshotResponder } from '../../../chunk-
|
|
1
|
+
export { VIEWPORT_CONTEXT_REQUEST, VIEWPORT_CONTEXT_RESPONSE, VIEWPORT_SNAPSHOT_MAX_DEPTH, VIEWPORT_SNAPSHOT_REQUEST, VIEWPORT_SNAPSHOT_RESPONSE, isTrustedViewportSnapshotRequester, requestChildViewportContexts, requestChildViewportSnapshots, startViewportSnapshotResponder } from '../../../chunk-B3PLD7SH.mjs';
|