mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
fix typescript errors
This commit is contained in:
parent
ffe9103da6
commit
6294f5fa33
16 changed files with 27 additions and 16 deletions
|
|
@ -1,10 +1,6 @@
|
|||
import { userHasCanvas } from "@/app/actions/fetchers";
|
||||
import { RectProvider, ResizaleLayout } from "@/components/canvas/resizableLayout";
|
||||
import { redirect } from "next/navigation";
|
||||
import {
|
||||
RectProvider,
|
||||
ResizaleLayout,
|
||||
} from "../_canvas_comp/(components)/resizableLayout";
|
||||
|
||||
export default async function page({ params }: any) {
|
||||
const canvasExists = await userHasCanvas(params.id);
|
||||
if (!canvasExists.success) {
|
||||
|
|
|
|||
10
apps/web/app/api/canvas/route.ts
Normal file
10
apps/web/app/api/canvas/route.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
export function GET(req: Request){
|
||||
const id = new URL(req.url).searchParams.get("id");
|
||||
return new Response(JSON.stringify(id));
|
||||
}
|
||||
|
||||
export async function POST(req: Request){
|
||||
const body = await req.json();
|
||||
const id = new URL(req.url).searchParams.get("id");
|
||||
return new Response(JSON.stringify({body, id}));
|
||||
}
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Editor, Tldraw, setUserPreferences, TLStoreWithStatus } from "tldraw";
|
||||
import { createAssetFromUrl } from "../lib/createAssetUrl";
|
||||
import { createAssetFromUrl } from "../../lib/createAssetUrl";
|
||||
import "tldraw/tldraw.css";
|
||||
import { components } from "./enabledComp";
|
||||
import { twitterCardUtil } from "./twitterCard";
|
||||
import { textCardUtil } from "./textCard";
|
||||
import createEmbedsFromUrl from "../lib/createEmbeds";
|
||||
import { loadRemoteSnapshot } from "../lib/loadSnap";
|
||||
import createEmbedsFromUrl from "../../lib/createEmbeds";
|
||||
import { loadRemoteSnapshot } from "../../lib/loadSnap";
|
||||
import { SaveStatus } from "./savesnap";
|
||||
import { getAssetUrls } from "@tldraw/assets/selfHosted";
|
||||
import { memo } from "react";
|
||||
import DragContext from "../lib/context";
|
||||
import DragContext from "../../lib/context";
|
||||
import DropZone from "./dropComponent";
|
||||
import { useRect } from "./resizableLayout";
|
||||
// import "./canvas.css";
|
||||
|
|
@ -73,7 +73,7 @@ const TldrawComponent = memo(() => {
|
|||
});
|
||||
}, []);
|
||||
|
||||
setUserPreferences({ id: "supermemory",colorScheme: "dark" });
|
||||
setUserPreferences({ id: "supermemory", colorScheme: "dark" });
|
||||
|
||||
const assetUrls = getAssetUrls();
|
||||
return (
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
import React, { useRef, useCallback, useEffect, useContext } from "react";
|
||||
import { useEditor } from "tldraw";
|
||||
import DragContext, { DragContextType, useDragContext } from "../lib/context";
|
||||
import { handleExternalDroppedContent } from "../lib/createEmbeds";
|
||||
import DragContext, {
|
||||
DragContextType,
|
||||
useDragContext,
|
||||
} from "../../lib/context";
|
||||
import { handleExternalDroppedContent } from "../../lib/createEmbeds";
|
||||
|
||||
const stripHtmlTags = (html: string): string => {
|
||||
const div = document.createElement("div");
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
import { createTLStore, defaultShapeUtils, loadSnapshot } from "tldraw";
|
||||
import { twitterCardUtil } from "../(components)/twitterCard";
|
||||
import { textCardUtil } from "../(components)/textCard";
|
||||
import { getCanvasData } from "@/app/actions/fetchers";
|
||||
import { getCanvasData } from "../app/actions/fetchers";
|
||||
import { twitterCardUtil } from "../components/canvas/twitterCard";
|
||||
import { textCardUtil } from "../components/canvas/textCard";
|
||||
|
||||
export async function loadRemoteSnapshot(id:string) {
|
||||
const snapshot = await getCanvasData(id);
|
||||
|
||||
|
|
@ -17,7 +17,8 @@
|
|||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
"../../packages/ui/"
|
||||
"../../packages/ui/",
|
||||
"./components"
|
||||
],
|
||||
"exclude": ["node_modules/"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue