Skip to content

Commit cc792d4

Browse files
feat(studio): export the canvas edit overlay so a host can mount its handles (#4708)
1 parent e07ea1f commit cc792d4

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎packages/studio/src/components/editor/DomEditOverlay.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export {
4747
} from "./domEditOverlayGestures";
4848
export type { DomEditGroupPathOffsetCommit } from "./domEditOverlayGestures";
4949

50-
interface DomEditOverlayProps {
50+
export interface DomEditOverlayProps {
5151
iframeRef: RefObject<HTMLIFrameElement | null>;
5252
activeCompositionPath: string | null;
5353
selection: DomEditSelection | null;

‎packages/studio/src/components/editor/DomEditOverlayHover.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { expect, it, vi } from "vitest";
66
import type { DomEditSelection } from "./domEditing";
77
import "./domEditOverlayTestMocks";
88
import { DomEditOverlay } from "./DomEditOverlay";
9+
import { DomEditOverlay as PackageDomEditOverlay } from "../../index";
910

1011
(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
1112

@@ -74,3 +75,7 @@ it("rotates the hover box with the element", () => {
7475
it("leaves the hover box untransformed at angle zero", () => {
7576
expect(renderHover(0)).toBe("");
7677
});
78+
79+
it("is exported from the package entry, so a host can mount it with its own commits", () => {
80+
expect(PackageDomEditOverlay).toBe(DomEditOverlay);
81+
});

‎packages/studio/src/index.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ export { useDomStyleCommit } from "./hooks/useDomStyleCommit";
181181
export type { UseDomStyleCommitOptions } from "./hooks/useDomStyleCommit";
182182
export type { DomEditCommitDeclineReason, DomEditCommitOutcome } from "./hooks/domEditCommitRunner";
183183
export { resolveDomEditSelection } from "./components/editor/domEditingLayers";
184+
export { DomEditOverlay } from "./components/editor/DomEditOverlay";
185+
export type {
186+
DomEditGroupPathOffsetCommit,
187+
DomEditOverlayProps,
188+
} from "./components/editor/DomEditOverlay";
184189

185190
export {
186191
playSeamTransitionLoop,

0 commit comments

Comments
 (0)