Skip to content

Commit 79746ed

Browse files
authored
Merge pull request #176 from morph-data/develop
Merge branch develop into release/v0.3.0
2 parents 9ff4cac + 40aa4ab commit 79746ed

12 files changed

Lines changed: 70 additions & 78 deletions

File tree

core/morph/include/starter_template/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Morph config files and directories
22
.morph
33

4+
# Morph build output
5+
dist
6+
47
# Node.js
58
node_modules
69

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export default function NotFound() {
22
return (
3-
<div>
3+
<>
44
<h1>404</h1>
55
<p>Page not found</p>
6-
</div>
6+
</>
77
);
88
}

core/morph/include/starter_template/src/pages/_app.tsx

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import { Head } from "@morph-data/frontend/components";
2-
import { RootErrorBoundary, Header, TableOfContents } from "./_morph-data-lib";
2+
import { TableOfContents } from "./_components/table-of-contents";
3+
import { Header } from "./_components/header";
34
import {
45
usePageMeta,
56
MdxComponentsProvider,
67
Outlet,
78
useRefresh,
89
extractComponents,
910
} from "@morph-data/frontend/components";
11+
import { ErrorBoundary } from "react-error-boundary";
12+
import { Callout } from "@/pages/_components/ui/callout";
13+
1014
import "./index.css";
1115

1216
const uiComponents = extractComponents(
@@ -27,7 +31,7 @@ export default function App() {
2731
useRefresh();
2832

2933
return (
30-
<RootErrorBoundary>
34+
<>
3135
<Head key={pageMeta?.pathname}>
3236
<title>{pageMeta?.title}</title>
3337
<link head-key="favicon" rel="icon" href="/static/favicon.ico" />
@@ -45,7 +49,17 @@ export default function App() {
4549
<div className="mt-4 p-2">
4650
<div className="grid gap-4 grid-cols-[1fr_32px] lg:grid-cols-[1fr_180px]">
4751
<div className="p-2">
48-
<Outlet />
52+
<ErrorBoundary
53+
fallbackRender={({ error }) => (
54+
<Callout variant="error" title="Error">
55+
{typeof error.message === "string"
56+
? error.message
57+
: "Something went wrong"}
58+
</Callout>
59+
)}
60+
>
61+
<Outlet />
62+
</ErrorBoundary>
4963
</div>
5064
<div>
5165
<TableOfContents
@@ -57,6 +71,12 @@ export default function App() {
5771
</div>
5872
</div>
5973
</MdxComponentsProvider>
60-
</RootErrorBoundary>
74+
</>
6175
);
6276
}
77+
78+
export const Catch = () => (
79+
<Callout variant="error" title="Error">
80+
Something went wrong
81+
</Callout>
82+
);

core/morph/include/starter_template/src/pages/_morph-data-lib/header.tsx renamed to core/morph/include/starter_template/src/pages/_components/header.tsx

File renamed without changes.

core/morph/include/starter_template/src/pages/_morph-data-lib/table-of-contents.tsx renamed to core/morph/include/starter_template/src/pages/_components/table-of-contents.tsx

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
HoverCardTrigger,
44
HoverCardContent,
55
} from "@/pages/_components/ui/hover-card";
6-
import { Card } from "@/pages/_components/ui/card";
76
import { Button } from "@/pages/_components/ui/button";
87
import { LucideTableOfContents } from "lucide-react";
98
import { cn } from "@/pages/_lib/utils";
@@ -24,14 +23,7 @@ export const TableOfContents: React.FC<TocProps> = ({ toc, className }) => {
2423
<div className={cn("toc text-sm w-full hidden lg:block", className)}>
2524
<div className="grid gird-cols-1 gap-2.5 w-full">
2625
{toc.map((entry) => (
27-
<a className="x-underline" href={`#${entry.id}`}>
28-
<div
29-
key={entry.id}
30-
className="text-zinc-400 hover:text-zinc-900 cursor-pointer font-normal decoration-zinc-400 decoration-0 line-clamp-2"
31-
>
32-
<span className="">{entry.value}</span>
33-
</div>
34-
</a>
26+
<Heading key={entry.id} entry={entry} />
3527
))}
3628
</div>
3729
</div>
@@ -43,23 +35,30 @@ export const TableOfContents: React.FC<TocProps> = ({ toc, className }) => {
4335
</Button>
4436
</HoverCardTrigger>
4537
<HoverCardContent className="w-[16rem]">
46-
<Card>
47-
<div className="grid gird-cols-1 gap-2.5 w-full">
48-
{toc.map((entry) => (
49-
<a className="x-underline" href={`#${entry.id}`}>
50-
<div
51-
key={entry.id}
52-
className="text-zinc-400 hover:text-zinc-900 cursor-pointer font-normal decoration-zinc-400 decoration-0 line-clamp-2"
53-
>
54-
{entry.value}
55-
</div>
56-
</a>
57-
))}
58-
</div>
59-
</Card>
38+
<div className="grid gird-cols-1 gap-2.5 w-full">
39+
{toc.map((entry) => (
40+
<Heading key={entry.id} entry={entry} />
41+
))}
42+
</div>
6043
</HoverCardContent>
6144
</HoverCard>
6245
</div>
6346
</>
6447
);
6548
};
49+
50+
const Heading = ({ entry }: { entry: Toc[number] }) => {
51+
return (
52+
<>
53+
<a
54+
href={`#${entry.id}`}
55+
className="inline-block x-underline text-zinc-400 hover:text-zinc-900 font-normal line-clamp-2"
56+
>
57+
{entry.value}
58+
</a>
59+
{entry.children?.map((child) => (
60+
<Heading entry={child} />
61+
))}
62+
</>
63+
);
64+
};

core/morph/include/starter_template/src/pages/_morph-data-lib/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

core/morph/include/starter_template/src/pages/_morph-data-lib/root-error-boundary.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
# Welcome to Morph
22

33
Morph is a Python + Markdown framework for building internal AI apps.
4+
5+
## 📚 Resources
6+
7+
- [🚀 Deploy Now](https://app.morph-data.io)
8+
- [📖 Documentation](https://docs.morph-data.io)
9+
- [💻 GitHub](https://github.com/morph-data/morph)
10+
11+
## 🛠️ Getting started
12+
13+
### Tutorials
14+
15+
- [🚀 Quickstart for AI App](https://docs.morph-data.io/docs/en/quickstart/building-app)
16+
- [📊 Dashboard tutorial](https://docs.morph-data.io/docs/en/develop/tutorials/plotly)
17+
- [📈 Pygwalker tutorial](https://docs.morph-data.io/docs/en/develop/tutorials/pygwalker)

core/morph/include/starter_template/tsconfig.app.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
{
2-
"files": [],
3-
"references": [
4-
{
5-
"path": "./tsconfig.app.json"
6-
},
7-
{
8-
"path": "./tsconfig.node.json"
9-
}
10-
],
2+
"extends": "@morph-data/frontend/tsconfig.app.json",
113
"compilerOptions": {
4+
"composite": true,
125
"baseUrl": ".",
136
"paths": {
147
"@/*": ["./src/*"]
158
}
16-
}
9+
},
10+
"include": ["src"]
1711
}

0 commit comments

Comments
 (0)