Skip to content

Commit efc8855

Browse files
committed
clean up
1 parent f8216d2 commit efc8855

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

apps/web/client/src/app/project/[id]/_components/canvas/frame/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { GestureScreen } from './gesture';
55
import { ResizeHandles } from './resize-handles';
66
import { RightClickMenu } from './right-click';
77
import { TopBar } from './top-bar';
8-
import { FrameComponent } from './web-frame';
8+
import { FrameComponent } from './view';
99

1010
export const FrameView = observer(({ frame }: { frame: Frame }) => {
1111
const [isResizing, setIsResizing] = useState(false);

apps/web/client/src/components/store/editor/frames/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FrameView } from '@/app/project/[id]/_components/canvas/frame/web-frame.tsx';
1+
import type { FrameView } from '@/app/project/[id]/_components/canvas/frame/view';
22
import { api } from '@/trpc/client';
33
import { toDbFrame, toDbPartialFrame } from '@onlook/db';
44
import { type Frame } from '@onlook/models';

apps/web/client/src/components/store/editor/insert/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FrameView } from '@/app/project/[id]/_components/canvas/frame/web-frame';
1+
import type { FrameView } from '@/app/project/[id]/_components/canvas/frame/view';
22
import { DefaultSettings, EditorAttributes } from '@onlook/constants';
33
import type {
44
DomElement,

apps/web/client/src/components/store/editor/overlay/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FrameView } from '@/app/project/[id]/_components/canvas/frame/web-frame';
1+
import type { FrameView } from '@/app/project/[id]/_components/canvas/frame/view';
22
import { EditorAttributes } from '@onlook/constants';
33
import type { ElementPosition, RectDimensions } from '@onlook/models';
44

@@ -92,7 +92,7 @@ export function getRelativeMousePositionToFrameView(
9292
const canvasContainer = document.getElementById(EditorAttributes.CANVAS_CONTAINER_ID);
9393
if (!canvasContainer) {
9494
console.error('Canvas container not found');
95-
return rect;
95+
return rect satisfies ElementPosition;
9696
}
9797

9898
// Get canvas transform matrix to handle scaling and translation
@@ -102,5 +102,5 @@ export function getRelativeMousePositionToFrameView(
102102

103103
const x = (e.clientX - rect.left) / scale;
104104
const y = (e.clientY - rect.top) / scale;
105-
return { x, y };
105+
return { x, y } satisfies ElementPosition;
106106
}

apps/web/client/src/components/store/editor/text/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FrameView } from '@/app/project/[id]/_components/canvas/frame/web-frame';
1+
import type { FrameView } from '@/app/project/[id]/_components/canvas/frame/view';
22
import type { DomElement, EditTextResult, ElementPosition } from '@onlook/models';
33
import { makeAutoObservable } from 'mobx';
44
import type { EditorEngine } from '../engine';

packages/db/src/schema/canvas/frame.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { relations } from "drizzle-orm";
22
import { numeric, pgTable, uuid, varchar } from "drizzle-orm/pg-core";
33
import { createInsertSchema, createUpdateSchema } from "drizzle-zod";
4-
import { branches } from "../project/branch";
4+
import { branches } from "../project";
55
import { canvases } from "./canvas";
66

77
export const frames = pgTable("frames", {
@@ -22,7 +22,10 @@ export const frames = pgTable("frames", {
2222
}).enableRLS();
2323

2424
export const frameInsertSchema = createInsertSchema(frames);
25-
export const frameUpdateSchema = createUpdateSchema(frames);
25+
export const frameUpdateSchema = createUpdateSchema(frames).omit({
26+
id: true,
27+
canvasId: true,
28+
});
2629

2730
export type Frame = typeof frames.$inferSelect;
2831
export type NewFrame = typeof frames.$inferInsert;

0 commit comments

Comments
 (0)