feat: Full project management application scaffold
Complete architecture for a ClickUp/Notion/Miro-class project management app:
- Turborepo monorepo with Next.js 15, TypeScript, PostgreSQL (Drizzle ORM)
- Object-centered database schema (everything is an Object: tasks, projects, docs, whiteboards)
- NextAuth v5 authentication with credentials + OAuth providers
- tRPC v11 API layer with full CRUD for objects, properties, relations, templates, search
- Three-panel UI: collapsible sidebar, center content area, push-in right panel
- Purple/teal theme with light/dark mode via Shadcn/ui + Tailwind CSS
- Multiple views: List, Kanban board (dnd-kit), Table (spreadsheet), Embedded iframe
- TipTap rich text editor with slash commands, custom blocks (callout, toggle, mention, embed, divider), AI block
- Real-time collaboration via Yjs + Hocuspocus with presence/cursors
- tldraw whiteboard with custom shape cards (task, document, project)
- MCP server exposing all app data/tools for AI agents
- AI chat panel, editor AI slash commands, Cmd+K command palette
- Template system with built-in templates (Bug Report, Meeting Notes, Sprint)
- Full-text search with result highlighting
- Docker Compose for full-stack deployment (web + collab + postgres + redis)
Made-with: Cursor
2026-03-26 23:39:16 -04:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import * as React from "react";
|
|
|
|
|
import dynamic from "next/dynamic";
|
|
|
|
|
import type { Editor, TLStore } from "tldraw";
|
|
|
|
|
|
|
|
|
|
import { useCollaboration } from "@/lib/yjs-provider";
|
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
|
|
|
|
|
|
import { WhiteboardToolbar } from "./toolbar";
|
|
|
|
|
import { syncTldrawStoreWithYjs } from "./yjs-store";
|
feat: ECHODO app shell, Coolify deploy, Authentik + Umami
Bundles in-flight ECHODO work with the Coolify deployment configuration:
App
- New routes: ai, forms, planner, settings (templates/types), teams,
doc detail, whiteboard detail
- New components: app shell rework (icon-rail, top-header), forms
builder/renderer/responses, types manager, objects creation dialog,
card primitive, form + overview views
- New tRPC routers: favorites, forms, types, workspaces; updates to
health and objects routers
- Markdown backlog sync (packages/database) + cursor-sync schema/migrations
- Schema additions: forms, types, favorites, markdown_backlog, cursor_sync
- Initial Drizzle migrations checked in
Deployment
- docker/docker-compose.coolify.yml: drops bundled Postgres/Redis
(uses CT 102 shared services), removes host port mappings, adds
Coolify SERVICE_FQDN_* magic vars for web + collab
- .env.example rewritten as the full ECHODO/Coolify variable manifest
- NextAuth gains an Authentik OIDC provider (gated on env presence)
- Root layout injects Umami tracking script when configured;
metadata title flipped to ECHODO
Security
- .gitignore expanded to exclude AGENT-DEPLOY.md, .env.*, secrets/,
credentials.*, *.key, *.crt, *.pem, ssh keys
Made-with: Cursor
2026-04-26 15:34:34 -04:00
|
|
|
import { customShapeUtils } from "./shapes";
|
feat: Full project management application scaffold
Complete architecture for a ClickUp/Notion/Miro-class project management app:
- Turborepo monorepo with Next.js 15, TypeScript, PostgreSQL (Drizzle ORM)
- Object-centered database schema (everything is an Object: tasks, projects, docs, whiteboards)
- NextAuth v5 authentication with credentials + OAuth providers
- tRPC v11 API layer with full CRUD for objects, properties, relations, templates, search
- Three-panel UI: collapsible sidebar, center content area, push-in right panel
- Purple/teal theme with light/dark mode via Shadcn/ui + Tailwind CSS
- Multiple views: List, Kanban board (dnd-kit), Table (spreadsheet), Embedded iframe
- TipTap rich text editor with slash commands, custom blocks (callout, toggle, mention, embed, divider), AI block
- Real-time collaboration via Yjs + Hocuspocus with presence/cursors
- tldraw whiteboard with custom shape cards (task, document, project)
- MCP server exposing all app data/tools for AI agents
- AI chat panel, editor AI slash commands, Cmd+K command palette
- Template system with built-in templates (Bug Report, Meeting Notes, Sprint)
- Full-text search with result highlighting
- Docker Compose for full-stack deployment (web + collab + postgres + redis)
Made-with: Cursor
2026-03-26 23:39:16 -04:00
|
|
|
|
|
|
|
|
import "tldraw/tldraw.css";
|
|
|
|
|
|
|
|
|
|
export type WhiteboardCanvasProps = {
|
|
|
|
|
documentId?: string;
|
|
|
|
|
className?: string;
|
|
|
|
|
readOnly?: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function useHtmlDarkClass(): boolean {
|
|
|
|
|
const [dark, setDark] = React.useState(false);
|
|
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
const el = document.documentElement;
|
|
|
|
|
const read = () => setDark(el.classList.contains("dark"));
|
|
|
|
|
read();
|
|
|
|
|
const observer = new MutationObserver(read);
|
|
|
|
|
observer.observe(el, { attributes: true, attributeFilter: ["class"] });
|
|
|
|
|
return () => observer.disconnect();
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return dark;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type TldrawModule = typeof import("tldraw");
|
|
|
|
|
|
|
|
|
|
function TldrawCollabBody({
|
|
|
|
|
documentId,
|
|
|
|
|
readOnly,
|
|
|
|
|
className,
|
|
|
|
|
tldraw,
|
|
|
|
|
}: {
|
|
|
|
|
documentId: string;
|
|
|
|
|
readOnly: boolean;
|
|
|
|
|
className?: string;
|
|
|
|
|
tldraw: TldrawModule;
|
|
|
|
|
}) {
|
feat: ECHODO app shell, Coolify deploy, Authentik + Umami
Bundles in-flight ECHODO work with the Coolify deployment configuration:
App
- New routes: ai, forms, planner, settings (templates/types), teams,
doc detail, whiteboard detail
- New components: app shell rework (icon-rail, top-header), forms
builder/renderer/responses, types manager, objects creation dialog,
card primitive, form + overview views
- New tRPC routers: favorites, forms, types, workspaces; updates to
health and objects routers
- Markdown backlog sync (packages/database) + cursor-sync schema/migrations
- Schema additions: forms, types, favorites, markdown_backlog, cursor_sync
- Initial Drizzle migrations checked in
Deployment
- docker/docker-compose.coolify.yml: drops bundled Postgres/Redis
(uses CT 102 shared services), removes host port mappings, adds
Coolify SERVICE_FQDN_* magic vars for web + collab
- .env.example rewritten as the full ECHODO/Coolify variable manifest
- NextAuth gains an Authentik OIDC provider (gated on env presence)
- Root layout injects Umami tracking script when configured;
metadata title flipped to ECHODO
Security
- .gitignore expanded to exclude AGENT-DEPLOY.md, .env.*, secrets/,
credentials.*, *.key, *.crt, *.pem, ssh keys
Made-with: Cursor
2026-04-26 15:34:34 -04:00
|
|
|
const { doc, isConnected, isSynced } = useCollaboration(`object:${documentId}`);
|
feat: Full project management application scaffold
Complete architecture for a ClickUp/Notion/Miro-class project management app:
- Turborepo monorepo with Next.js 15, TypeScript, PostgreSQL (Drizzle ORM)
- Object-centered database schema (everything is an Object: tasks, projects, docs, whiteboards)
- NextAuth v5 authentication with credentials + OAuth providers
- tRPC v11 API layer with full CRUD for objects, properties, relations, templates, search
- Three-panel UI: collapsible sidebar, center content area, push-in right panel
- Purple/teal theme with light/dark mode via Shadcn/ui + Tailwind CSS
- Multiple views: List, Kanban board (dnd-kit), Table (spreadsheet), Embedded iframe
- TipTap rich text editor with slash commands, custom blocks (callout, toggle, mention, embed, divider), AI block
- Real-time collaboration via Yjs + Hocuspocus with presence/cursors
- tldraw whiteboard with custom shape cards (task, document, project)
- MCP server exposing all app data/tools for AI agents
- AI chat panel, editor AI slash commands, Cmd+K command palette
- Template system with built-in templates (Bug Report, Meeting Notes, Sprint)
- Full-text search with result highlighting
- Docker Compose for full-stack deployment (web + collab + postgres + redis)
Made-with: Cursor
2026-03-26 23:39:16 -04:00
|
|
|
const dark = useHtmlDarkClass();
|
|
|
|
|
|
|
|
|
|
const store = React.useMemo<TLStore>(
|
feat: ECHODO app shell, Coolify deploy, Authentik + Umami
Bundles in-flight ECHODO work with the Coolify deployment configuration:
App
- New routes: ai, forms, planner, settings (templates/types), teams,
doc detail, whiteboard detail
- New components: app shell rework (icon-rail, top-header), forms
builder/renderer/responses, types manager, objects creation dialog,
card primitive, form + overview views
- New tRPC routers: favorites, forms, types, workspaces; updates to
health and objects routers
- Markdown backlog sync (packages/database) + cursor-sync schema/migrations
- Schema additions: forms, types, favorites, markdown_backlog, cursor_sync
- Initial Drizzle migrations checked in
Deployment
- docker/docker-compose.coolify.yml: drops bundled Postgres/Redis
(uses CT 102 shared services), removes host port mappings, adds
Coolify SERVICE_FQDN_* magic vars for web + collab
- .env.example rewritten as the full ECHODO/Coolify variable manifest
- NextAuth gains an Authentik OIDC provider (gated on env presence)
- Root layout injects Umami tracking script when configured;
metadata title flipped to ECHODO
Security
- .gitignore expanded to exclude AGENT-DEPLOY.md, .env.*, secrets/,
credentials.*, *.key, *.crt, *.pem, ssh keys
Made-with: Cursor
2026-04-26 15:34:34 -04:00
|
|
|
() => tldraw.createTLStore({ shapeUtils: customShapeUtils }),
|
feat: Full project management application scaffold
Complete architecture for a ClickUp/Notion/Miro-class project management app:
- Turborepo monorepo with Next.js 15, TypeScript, PostgreSQL (Drizzle ORM)
- Object-centered database schema (everything is an Object: tasks, projects, docs, whiteboards)
- NextAuth v5 authentication with credentials + OAuth providers
- tRPC v11 API layer with full CRUD for objects, properties, relations, templates, search
- Three-panel UI: collapsible sidebar, center content area, push-in right panel
- Purple/teal theme with light/dark mode via Shadcn/ui + Tailwind CSS
- Multiple views: List, Kanban board (dnd-kit), Table (spreadsheet), Embedded iframe
- TipTap rich text editor with slash commands, custom blocks (callout, toggle, mention, embed, divider), AI block
- Real-time collaboration via Yjs + Hocuspocus with presence/cursors
- tldraw whiteboard with custom shape cards (task, document, project)
- MCP server exposing all app data/tools for AI agents
- AI chat panel, editor AI slash commands, Cmd+K command palette
- Template system with built-in templates (Bug Report, Meeting Notes, Sprint)
- Full-text search with result highlighting
- Docker Compose for full-stack deployment (web + collab + postgres + redis)
Made-with: Cursor
2026-03-26 23:39:16 -04:00
|
|
|
[documentId, tldraw],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
if (!doc || !isSynced) return;
|
|
|
|
|
return syncTldrawStoreWithYjs(store, doc);
|
|
|
|
|
}, [doc, isSynced, store]);
|
|
|
|
|
|
|
|
|
|
const editorRef = React.useRef<Editor | null>(null);
|
|
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
editorRef.current?.updateInstanceState({ isReadonly: readOnly });
|
|
|
|
|
}, [readOnly]);
|
|
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
editorRef.current?.user.updateUserPreferences({
|
|
|
|
|
colorScheme: dark ? "dark" : "light",
|
|
|
|
|
});
|
|
|
|
|
}, [dark]);
|
|
|
|
|
|
|
|
|
|
const { Tldraw } = tldraw;
|
|
|
|
|
|
|
|
|
|
const collab = React.useMemo(
|
|
|
|
|
() => ({ isConnected, isSynced }),
|
|
|
|
|
[isConnected, isSynced],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Tldraw
|
|
|
|
|
store={store}
|
feat: ECHODO app shell, Coolify deploy, Authentik + Umami
Bundles in-flight ECHODO work with the Coolify deployment configuration:
App
- New routes: ai, forms, planner, settings (templates/types), teams,
doc detail, whiteboard detail
- New components: app shell rework (icon-rail, top-header), forms
builder/renderer/responses, types manager, objects creation dialog,
card primitive, form + overview views
- New tRPC routers: favorites, forms, types, workspaces; updates to
health and objects routers
- Markdown backlog sync (packages/database) + cursor-sync schema/migrations
- Schema additions: forms, types, favorites, markdown_backlog, cursor_sync
- Initial Drizzle migrations checked in
Deployment
- docker/docker-compose.coolify.yml: drops bundled Postgres/Redis
(uses CT 102 shared services), removes host port mappings, adds
Coolify SERVICE_FQDN_* magic vars for web + collab
- .env.example rewritten as the full ECHODO/Coolify variable manifest
- NextAuth gains an Authentik OIDC provider (gated on env presence)
- Root layout injects Umami tracking script when configured;
metadata title flipped to ECHODO
Security
- .gitignore expanded to exclude AGENT-DEPLOY.md, .env.*, secrets/,
credentials.*, *.key, *.crt, *.pem, ssh keys
Made-with: Cursor
2026-04-26 15:34:34 -04:00
|
|
|
shapeUtils={customShapeUtils}
|
feat: Full project management application scaffold
Complete architecture for a ClickUp/Notion/Miro-class project management app:
- Turborepo monorepo with Next.js 15, TypeScript, PostgreSQL (Drizzle ORM)
- Object-centered database schema (everything is an Object: tasks, projects, docs, whiteboards)
- NextAuth v5 authentication with credentials + OAuth providers
- tRPC v11 API layer with full CRUD for objects, properties, relations, templates, search
- Three-panel UI: collapsible sidebar, center content area, push-in right panel
- Purple/teal theme with light/dark mode via Shadcn/ui + Tailwind CSS
- Multiple views: List, Kanban board (dnd-kit), Table (spreadsheet), Embedded iframe
- TipTap rich text editor with slash commands, custom blocks (callout, toggle, mention, embed, divider), AI block
- Real-time collaboration via Yjs + Hocuspocus with presence/cursors
- tldraw whiteboard with custom shape cards (task, document, project)
- MCP server exposing all app data/tools for AI agents
- AI chat panel, editor AI slash commands, Cmd+K command palette
- Template system with built-in templates (Bug Report, Meeting Notes, Sprint)
- Full-text search with result highlighting
- Docker Compose for full-stack deployment (web + collab + postgres + redis)
Made-with: Cursor
2026-03-26 23:39:16 -04:00
|
|
|
className={cn("h-full min-h-0 w-full min-w-0", className)}
|
|
|
|
|
inferDarkMode={false}
|
|
|
|
|
onMount={(editor) => {
|
|
|
|
|
editorRef.current = editor;
|
|
|
|
|
editor.updateInstanceState({ isReadonly: readOnly });
|
|
|
|
|
editor.user.updateUserPreferences({
|
|
|
|
|
colorScheme: dark ? "dark" : "light",
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
components={{
|
|
|
|
|
InFrontOfTheCanvas: () => (
|
|
|
|
|
<WhiteboardToolbar collab={collab} readOnly={readOnly} />
|
|
|
|
|
),
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function TldrawLocalBody({
|
|
|
|
|
readOnly,
|
|
|
|
|
className,
|
|
|
|
|
tldraw,
|
|
|
|
|
}: {
|
|
|
|
|
readOnly: boolean;
|
|
|
|
|
className?: string;
|
|
|
|
|
tldraw: TldrawModule;
|
|
|
|
|
}) {
|
|
|
|
|
const dark = useHtmlDarkClass();
|
|
|
|
|
const editorRef = React.useRef<Editor | null>(null);
|
|
|
|
|
|
feat: ECHODO app shell, Coolify deploy, Authentik + Umami
Bundles in-flight ECHODO work with the Coolify deployment configuration:
App
- New routes: ai, forms, planner, settings (templates/types), teams,
doc detail, whiteboard detail
- New components: app shell rework (icon-rail, top-header), forms
builder/renderer/responses, types manager, objects creation dialog,
card primitive, form + overview views
- New tRPC routers: favorites, forms, types, workspaces; updates to
health and objects routers
- Markdown backlog sync (packages/database) + cursor-sync schema/migrations
- Schema additions: forms, types, favorites, markdown_backlog, cursor_sync
- Initial Drizzle migrations checked in
Deployment
- docker/docker-compose.coolify.yml: drops bundled Postgres/Redis
(uses CT 102 shared services), removes host port mappings, adds
Coolify SERVICE_FQDN_* magic vars for web + collab
- .env.example rewritten as the full ECHODO/Coolify variable manifest
- NextAuth gains an Authentik OIDC provider (gated on env presence)
- Root layout injects Umami tracking script when configured;
metadata title flipped to ECHODO
Security
- .gitignore expanded to exclude AGENT-DEPLOY.md, .env.*, secrets/,
credentials.*, *.key, *.crt, *.pem, ssh keys
Made-with: Cursor
2026-04-26 15:34:34 -04:00
|
|
|
const store = React.useMemo<TLStore>(
|
|
|
|
|
() => tldraw.createTLStore({ shapeUtils: customShapeUtils }),
|
|
|
|
|
[tldraw],
|
|
|
|
|
);
|
|
|
|
|
|
feat: Full project management application scaffold
Complete architecture for a ClickUp/Notion/Miro-class project management app:
- Turborepo monorepo with Next.js 15, TypeScript, PostgreSQL (Drizzle ORM)
- Object-centered database schema (everything is an Object: tasks, projects, docs, whiteboards)
- NextAuth v5 authentication with credentials + OAuth providers
- tRPC v11 API layer with full CRUD for objects, properties, relations, templates, search
- Three-panel UI: collapsible sidebar, center content area, push-in right panel
- Purple/teal theme with light/dark mode via Shadcn/ui + Tailwind CSS
- Multiple views: List, Kanban board (dnd-kit), Table (spreadsheet), Embedded iframe
- TipTap rich text editor with slash commands, custom blocks (callout, toggle, mention, embed, divider), AI block
- Real-time collaboration via Yjs + Hocuspocus with presence/cursors
- tldraw whiteboard with custom shape cards (task, document, project)
- MCP server exposing all app data/tools for AI agents
- AI chat panel, editor AI slash commands, Cmd+K command palette
- Template system with built-in templates (Bug Report, Meeting Notes, Sprint)
- Full-text search with result highlighting
- Docker Compose for full-stack deployment (web + collab + postgres + redis)
Made-with: Cursor
2026-03-26 23:39:16 -04:00
|
|
|
React.useEffect(() => {
|
|
|
|
|
editorRef.current?.updateInstanceState({ isReadonly: readOnly });
|
|
|
|
|
}, [readOnly]);
|
|
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
editorRef.current?.user.updateUserPreferences({
|
|
|
|
|
colorScheme: dark ? "dark" : "light",
|
|
|
|
|
});
|
|
|
|
|
}, [dark]);
|
|
|
|
|
|
|
|
|
|
const { Tldraw } = tldraw;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Tldraw
|
feat: ECHODO app shell, Coolify deploy, Authentik + Umami
Bundles in-flight ECHODO work with the Coolify deployment configuration:
App
- New routes: ai, forms, planner, settings (templates/types), teams,
doc detail, whiteboard detail
- New components: app shell rework (icon-rail, top-header), forms
builder/renderer/responses, types manager, objects creation dialog,
card primitive, form + overview views
- New tRPC routers: favorites, forms, types, workspaces; updates to
health and objects routers
- Markdown backlog sync (packages/database) + cursor-sync schema/migrations
- Schema additions: forms, types, favorites, markdown_backlog, cursor_sync
- Initial Drizzle migrations checked in
Deployment
- docker/docker-compose.coolify.yml: drops bundled Postgres/Redis
(uses CT 102 shared services), removes host port mappings, adds
Coolify SERVICE_FQDN_* magic vars for web + collab
- .env.example rewritten as the full ECHODO/Coolify variable manifest
- NextAuth gains an Authentik OIDC provider (gated on env presence)
- Root layout injects Umami tracking script when configured;
metadata title flipped to ECHODO
Security
- .gitignore expanded to exclude AGENT-DEPLOY.md, .env.*, secrets/,
credentials.*, *.key, *.crt, *.pem, ssh keys
Made-with: Cursor
2026-04-26 15:34:34 -04:00
|
|
|
store={store}
|
|
|
|
|
shapeUtils={customShapeUtils}
|
feat: Full project management application scaffold
Complete architecture for a ClickUp/Notion/Miro-class project management app:
- Turborepo monorepo with Next.js 15, TypeScript, PostgreSQL (Drizzle ORM)
- Object-centered database schema (everything is an Object: tasks, projects, docs, whiteboards)
- NextAuth v5 authentication with credentials + OAuth providers
- tRPC v11 API layer with full CRUD for objects, properties, relations, templates, search
- Three-panel UI: collapsible sidebar, center content area, push-in right panel
- Purple/teal theme with light/dark mode via Shadcn/ui + Tailwind CSS
- Multiple views: List, Kanban board (dnd-kit), Table (spreadsheet), Embedded iframe
- TipTap rich text editor with slash commands, custom blocks (callout, toggle, mention, embed, divider), AI block
- Real-time collaboration via Yjs + Hocuspocus with presence/cursors
- tldraw whiteboard with custom shape cards (task, document, project)
- MCP server exposing all app data/tools for AI agents
- AI chat panel, editor AI slash commands, Cmd+K command palette
- Template system with built-in templates (Bug Report, Meeting Notes, Sprint)
- Full-text search with result highlighting
- Docker Compose for full-stack deployment (web + collab + postgres + redis)
Made-with: Cursor
2026-03-26 23:39:16 -04:00
|
|
|
className={cn("h-full min-h-0 w-full min-w-0", className)}
|
|
|
|
|
inferDarkMode={false}
|
|
|
|
|
onMount={(editor) => {
|
|
|
|
|
editorRef.current = editor;
|
|
|
|
|
editor.updateInstanceState({ isReadonly: readOnly });
|
|
|
|
|
editor.user.updateUserPreferences({
|
|
|
|
|
colorScheme: dark ? "dark" : "light",
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
components={{
|
|
|
|
|
InFrontOfTheCanvas: () => <WhiteboardToolbar readOnly={readOnly} />,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const TldynamicCollab = dynamic(
|
|
|
|
|
() =>
|
|
|
|
|
import("tldraw").then((tldraw) => {
|
|
|
|
|
function CollabLoaded(
|
|
|
|
|
props: Omit<WhiteboardCanvasProps, "documentId" | "readOnly"> & {
|
|
|
|
|
documentId: string;
|
|
|
|
|
readOnly: boolean;
|
|
|
|
|
},
|
|
|
|
|
) {
|
|
|
|
|
return <TldrawCollabBody {...props} tldraw={tldraw} />;
|
|
|
|
|
}
|
|
|
|
|
return CollabLoaded;
|
|
|
|
|
}),
|
|
|
|
|
{ ssr: false, loading: () => <WhiteboardLoading /> },
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const TldynamicLocal = dynamic(
|
|
|
|
|
() =>
|
|
|
|
|
import("tldraw").then((tldraw) => {
|
|
|
|
|
function LocalLoaded(props: { readOnly: boolean; className?: string }) {
|
|
|
|
|
return <TldrawLocalBody {...props} tldraw={tldraw} />;
|
|
|
|
|
}
|
|
|
|
|
return LocalLoaded;
|
|
|
|
|
}),
|
|
|
|
|
{ ssr: false, loading: () => <WhiteboardLoading /> },
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
function WhiteboardLoading() {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className="flex h-full min-h-[320px] w-full animate-pulse items-center justify-center rounded-lg border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.35)] text-xs text-muted-foreground"
|
|
|
|
|
aria-hidden
|
|
|
|
|
>
|
|
|
|
|
Loading whiteboard…
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function WhiteboardCanvas({ documentId, className, readOnly = false }: WhiteboardCanvasProps) {
|
|
|
|
|
const [client, setClient] = React.useState(false);
|
|
|
|
|
React.useEffect(() => setClient(true), []);
|
|
|
|
|
|
|
|
|
|
if (!client) {
|
|
|
|
|
return (
|
|
|
|
|
<div className={cn("relative flex min-h-0 flex-1 flex-col", className)}>
|
|
|
|
|
<WhiteboardLoading />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className={cn(
|
|
|
|
|
"relative flex min-h-0 flex-1 flex-col [&_.tl-container]:h-full [&_.tl-container]:min-h-0",
|
|
|
|
|
className,
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
{documentId ? (
|
|
|
|
|
<TldynamicCollab documentId={documentId} readOnly={!!readOnly} className={className} />
|
|
|
|
|
) : (
|
|
|
|
|
<TldynamicLocal readOnly={!!readOnly} className={className} />
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|