Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 197 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"react-markdown": "^10.1.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.1",
"shiki": "^4.4.3",
"zod": "^4.0.0"
},
"devDependencies": {
Expand Down
14 changes: 13 additions & 1 deletion site/src/app/routes/_page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Outlet, createFileRoute } from "@tanstack/react-router";
import { DemoSourcesProvider } from "../../shared/demo-workbench/DemoSurface";
import { demoSources } from "../../shared/demo-workbench/demo-sources";
import { PageFrame, PageLeadProvider } from "../../shared/ui/primitives";
import { SiteBreadcrumb } from "../breadcrumb";
import { findSiteRoute, siteRoutes, usePathname } from "../router";
Expand All @@ -9,10 +11,20 @@ export const Route = createFileRoute("/_page")({

function InteriorPage() {
const route = findSiteRoute(usePathname());
const sources = demoSources(route.path);
const content = <Outlet />;
if (sources !== undefined) {
return (
<PageFrame>
<SiteBreadcrumb route={route} routes={siteRoutes} />
<DemoSourcesProvider sources={sources}>{content}</DemoSourcesProvider>
</PageFrame>
);
}
return (
<PageLeadProvider lead={<SiteBreadcrumb route={route} routes={siteRoutes} />}>
<PageFrame>
<Outlet />
{content}
</PageFrame>
</PageLeadProvider>
);
Expand Down
3 changes: 3 additions & 0 deletions site/src/routes/canvas-demo/CanvasDemoRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, type PointerEvent } from "react";
import { DemoSurface } from "../../shared/demo-workbench/DemoSurface";
import {
createObjectEditor,
type ObjectDocument,
Expand Down Expand Up @@ -76,6 +77,7 @@ export function CanvasDemoRoute() {
Pick a box, drag it, then fill the selection. The board is the editor.
</PageHeader>

<DemoSurface>
<ProductApp
toolbarLabel="Canvas actions"
canvasClassName="relative min-h-[22rem] overflow-hidden"
Expand Down Expand Up @@ -117,6 +119,7 @@ export function CanvasDemoRoute() {
})}
</section>
</ProductApp>
</DemoSurface>
</PageFrame>
);
}
5 changes: 4 additions & 1 deletion site/src/routes/database-demo/DatabaseDemoRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DemoSurface } from "../../shared/demo-workbench/DemoSurface";
import { PageFrame, PageHeader } from "../../shared/ui/primitives";
import { DatabaseTableDemo } from "./DatabaseTableDemo";

Expand All @@ -7,7 +8,9 @@ export function DatabaseDemoRoute() {
<PageHeader illustration="database" title="Database Demo">
One canonical database, typed property editors, persistent view configuration, structural selection, and native text leases.
</PageHeader>
<DatabaseTableDemo />
<DemoSurface>
<DatabaseTableDemo />
</DemoSurface>
</PageFrame>
);
}
3 changes: 3 additions & 0 deletions site/src/routes/document-demo/DocumentDemoRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useRef, useState, type ClipboardEvent } from "react";
import { DemoSurface } from "../../shared/demo-workbench/DemoSurface";
import {
type BlockDocument,
type DocumentClipboard,
Expand Down Expand Up @@ -169,6 +170,7 @@ export function DocumentDemoRoute() {
)}
>A deliberately small interface for selection, clipboard, history, keyboard input, and canonical JSON publication.</PageHeader>

<DemoSurface>
<ProductApp
toolbarLabel="Document actions"
toolbar={(
Expand Down Expand Up @@ -255,6 +257,7 @@ export function DocumentDemoRoute() {
<p className={classes("mb-0 mt-3", ui.text.meta)}>Shift-click selects a range. Mod-click adds or removes a block. Arrow keys move the selection when focus is on the surface.</p>
</section>
</ProductApp>
</DemoSurface>
</PageFrame>
);
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/routes/editing-demos/ClipboardDemoRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState } from "react";
import { DemoSurface } from "../../shared/demo-workbench/DemoSurface";
import { type BlockDocument, type DocumentClipboard } from "@interactive-os/json-document-editing";
import { useDocumentEditor, useEditing } from "@interactive-os/json-document-react";
import { Inspector } from "../../shared/ui/inspector";
Expand Down Expand Up @@ -56,6 +57,7 @@ export function ClipboardDemoRoute() {
Selection에서 시작해 copy 또는 cut으로 구조화된 payload를 만들고 paste에 넘깁니다.
</PageHeader>

<DemoSurface>
<div className="grid gap-4 lg:grid-cols-3">
<section className={classes("p-4", ui.surface.raised)} aria-labelledby="clipboard-input">
<p className={ui.text.label}>1 · Selection</p>
Expand Down Expand Up @@ -98,6 +100,7 @@ export function ClipboardDemoRoute() {
]} />
</section>
</div>
</DemoSurface>
</PageFrame>
);
}
3 changes: 3 additions & 0 deletions site/src/routes/editing-demos/HistoryDemoRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState } from "react";
import { DemoSurface } from "../../shared/demo-workbench/DemoSurface";
import { type BlockDocument } from "@interactive-os/json-document-editing";
import { useDocumentEditor, useEditing } from "@interactive-os/json-document-react";
import { Inspector } from "../../shared/ui/inspector";
Expand Down Expand Up @@ -50,6 +51,7 @@ export function HistoryDemoRoute() {
편집을 한 번 commit하고, 만들어진 History 항목으로 document.value와 Selection을 함께 복원합니다.
</PageHeader>

<DemoSurface>
<div className="grid gap-4 lg:grid-cols-3">
<section className={classes("p-4", ui.surface.raised)} aria-labelledby="history-input">
<p className={ui.text.label}>1 · 편집</p>
Expand Down Expand Up @@ -104,6 +106,7 @@ export function HistoryDemoRoute() {
]} />
</section>
</div>
</DemoSurface>
</PageFrame>
);
}
Loading