create-ncblock 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/bin/cli.js +33 -0
- package/package.json +25 -0
- package/scripts/init.ts +527 -0
- package/scripts/scaffold-assets/AGENTS.md +65 -0
- package/scripts/utils/templates.ts +293 -0
- package/sdk-version.json +1 -0
- package/templates/debug/README.md +36 -0
- package/templates/debug/_gitignore +2 -0
- package/templates/debug/custom_blocks.json +9 -0
- package/templates/debug/dist/assets/index-Cet2SsjS.css +2 -0
- package/templates/debug/dist/assets/index-DAzv_fuh.js +9 -0
- package/templates/debug/dist/custom_blocks.json +9 -0
- package/templates/debug/dist/index.html +16 -0
- package/templates/debug/index.html +15 -0
- package/templates/debug/node_modules/.bin/browserslist +21 -0
- package/templates/debug/node_modules/.bin/esbuild +21 -0
- package/templates/debug/node_modules/.bin/jiti +21 -0
- package/templates/debug/node_modules/.bin/rollup +21 -0
- package/templates/debug/node_modules/.bin/tsc +21 -0
- package/templates/debug/node_modules/.bin/tsserver +21 -0
- package/templates/debug/node_modules/.bin/tsx +21 -0
- package/templates/debug/node_modules/.bin/vite +21 -0
- package/templates/debug/node_modules/.vite/deps/_metadata.json +50 -0
- package/templates/debug/node_modules/.vite/deps/package.json +3 -0
- package/templates/debug/node_modules/.vite/deps/react-CsV5wVHy.js +770 -0
- package/templates/debug/node_modules/.vite/deps/react-CsV5wVHy.js.map +1 -0
- package/templates/debug/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/debug/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/debug/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/debug/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/debug/node_modules/.vite/deps/react.js +2 -0
- package/templates/debug/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/debug/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/debug/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/debug/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/debug/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/debug/node_modules/.vite/deps/valibot.js.map +1 -0
- package/templates/debug/node_modules/.vite-temp/vite.config.ts.timestamp-1778623720803-0bcf523a67aa8.mjs +15 -0
- package/templates/debug/package.json +30 -0
- package/templates/debug/src/index.css +62 -0
- package/templates/debug/src/index.tsx +1963 -0
- package/templates/debug/tsconfig.json +17 -0
- package/templates/debug/vite.config.ts +8 -0
- package/templates/empty/README.md +10 -0
- package/templates/empty/_gitignore +2 -0
- package/templates/empty/custom_blocks.json +12 -0
- package/templates/empty/dist/assets/index-CodJADav.js +9 -0
- package/templates/empty/dist/custom_blocks.json +12 -0
- package/templates/empty/dist/index.html +15 -0
- package/templates/empty/index.html +15 -0
- package/templates/empty/node_modules/.bin/esbuild +21 -0
- package/templates/empty/node_modules/.bin/jiti +21 -0
- package/templates/empty/node_modules/.bin/tsc +21 -0
- package/templates/empty/node_modules/.bin/tsserver +21 -0
- package/templates/empty/node_modules/.bin/tsx +21 -0
- package/templates/empty/node_modules/.bin/vite +21 -0
- package/templates/empty/node_modules/.vite/deps/_metadata.json +50 -0
- package/templates/empty/node_modules/.vite/deps/package.json +3 -0
- package/templates/empty/node_modules/.vite/deps/react-CsV5wVHy.js +770 -0
- package/templates/empty/node_modules/.vite/deps/react-CsV5wVHy.js.map +1 -0
- package/templates/empty/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/empty/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/empty/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/empty/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/empty/node_modules/.vite/deps/react.js +2 -0
- package/templates/empty/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/empty/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/empty/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/empty/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/empty/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/empty/node_modules/.vite/deps/valibot.js.map +1 -0
- package/templates/empty/package.json +28 -0
- package/templates/empty/src/index.tsx +12 -0
- package/templates/empty/tsconfig.json +17 -0
- package/templates/empty/vite.config.ts +7 -0
- package/templates/gantt-chart/node_modules/.bin/tsc +21 -0
- package/templates/gantt-chart/node_modules/.bin/tsserver +21 -0
- package/templates/gantt-chart/node_modules/.bin/vite +21 -0
- package/templates/gantt-chart/node_modules/.vite/deps/_metadata.json +50 -0
- package/templates/gantt-chart/node_modules/.vite/deps/package.json +3 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react-CsV5wVHy.js +770 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react-CsV5wVHy.js.map +1 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react.js +2 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/gantt-chart/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/gantt-chart/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/gantt-chart/node_modules/.vite/deps/valibot.js.map +1 -0
- package/templates/hello-world/node_modules/.bin/tsc +21 -0
- package/templates/hello-world/node_modules/.bin/tsserver +21 -0
- package/templates/hello-world/node_modules/.bin/vite +21 -0
- package/templates/hello-world/node_modules/.vite/deps/_metadata.json +50 -0
- package/templates/hello-world/node_modules/.vite/deps/package.json +3 -0
- package/templates/hello-world/node_modules/.vite/deps/react-CsV5wVHy.js +770 -0
- package/templates/hello-world/node_modules/.vite/deps/react-CsV5wVHy.js.map +1 -0
- package/templates/hello-world/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/hello-world/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/hello-world/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/hello-world/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/hello-world/node_modules/.vite/deps/react.js +2 -0
- package/templates/hello-world/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/hello-world/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/hello-world/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/hello-world/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/hello-world/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/hello-world/node_modules/.vite/deps/valibot.js.map +1 -0
- package/templates/interactive-resize/node_modules/.bin/tsc +21 -0
- package/templates/interactive-resize/node_modules/.bin/tsserver +21 -0
- package/templates/interactive-resize/node_modules/.bin/vite +21 -0
- package/templates/interactive-resize/node_modules/.vite/deps/_metadata.json +50 -0
- package/templates/interactive-resize/node_modules/.vite/deps/package.json +3 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react-CsV5wVHy.js +770 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react-CsV5wVHy.js.map +1 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react.js +2 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/interactive-resize/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/interactive-resize/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/interactive-resize/node_modules/.vite/deps/valibot.js.map +1 -0
- package/templates/org-chart/node_modules/.bin/tsc +21 -0
- package/templates/org-chart/node_modules/.bin/tsserver +21 -0
- package/templates/org-chart/node_modules/.bin/vite +21 -0
- package/templates/org-chart/node_modules/.vite/deps/_metadata.json +50 -0
- package/templates/org-chart/node_modules/.vite/deps/package.json +3 -0
- package/templates/org-chart/node_modules/.vite/deps/react-CsV5wVHy.js +770 -0
- package/templates/org-chart/node_modules/.vite/deps/react-CsV5wVHy.js.map +1 -0
- package/templates/org-chart/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/org-chart/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/org-chart/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/org-chart/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/org-chart/node_modules/.vite/deps/react.js +2 -0
- package/templates/org-chart/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/org-chart/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/org-chart/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/org-chart/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/org-chart/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/org-chart/node_modules/.vite/deps/valibot.js.map +1 -0
- package/templates/radar-chart/README.md +55 -0
- package/templates/radar-chart/_gitignore +2 -0
- package/templates/radar-chart/custom_blocks.json +34 -0
- package/templates/radar-chart/dist/assets/index-DOf05oXg.css +2 -0
- package/templates/radar-chart/dist/assets/index-DWpNd1qt.js +9 -0
- package/templates/radar-chart/dist/custom_blocks.json +34 -0
- package/templates/radar-chart/dist/index.html +16 -0
- package/templates/radar-chart/index.html +15 -0
- package/templates/radar-chart/node_modules/.bin/esbuild +21 -0
- package/templates/radar-chart/node_modules/.bin/jiti +21 -0
- package/templates/radar-chart/node_modules/.bin/tsc +21 -0
- package/templates/radar-chart/node_modules/.bin/tsserver +21 -0
- package/templates/radar-chart/node_modules/.bin/tsx +21 -0
- package/templates/radar-chart/node_modules/.bin/vite +21 -0
- package/templates/radar-chart/node_modules/.vite/deps/_metadata.json +50 -0
- package/templates/radar-chart/node_modules/.vite/deps/package.json +3 -0
- package/templates/radar-chart/node_modules/.vite/deps/react-CsV5wVHy.js +770 -0
- package/templates/radar-chart/node_modules/.vite/deps/react-CsV5wVHy.js.map +1 -0
- package/templates/radar-chart/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/radar-chart/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/radar-chart/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/radar-chart/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/radar-chart/node_modules/.vite/deps/react.js +2 -0
- package/templates/radar-chart/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/radar-chart/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/radar-chart/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/radar-chart/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/radar-chart/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/radar-chart/node_modules/.vite/deps/valibot.js.map +1 -0
- package/templates/radar-chart/package.json +30 -0
- package/templates/radar-chart/src/index.css +44 -0
- package/templates/radar-chart/src/index.tsx +531 -0
- package/templates/radar-chart/tsconfig.json +17 -0
- package/templates/radar-chart/vite.config.ts +8 -0
- package/templates/table-view/README.md +43 -0
- package/templates/table-view/_gitignore +2 -0
- package/templates/table-view/custom_blocks.json +9 -0
- package/templates/table-view/dist/assets/index-Bd8u_e4X.js +12 -0
- package/templates/table-view/dist/assets/index-BkZn3aQZ.css +1 -0
- package/templates/table-view/dist/custom_blocks.json +9 -0
- package/templates/table-view/dist/index.html +16 -0
- package/templates/table-view/index.html +15 -0
- package/templates/table-view/node_modules/.bin/esbuild +21 -0
- package/templates/table-view/node_modules/.bin/jiti +21 -0
- package/templates/table-view/node_modules/.bin/rollup +21 -0
- package/templates/table-view/node_modules/.bin/tsc +21 -0
- package/templates/table-view/node_modules/.bin/tsserver +21 -0
- package/templates/table-view/node_modules/.bin/tsx +21 -0
- package/templates/table-view/node_modules/.bin/vite +21 -0
- package/templates/table-view/node_modules/.vite/deps/@tanstack_react-table.js +2809 -0
- package/templates/table-view/node_modules/.vite/deps/@tanstack_react-table.js.map +1 -0
- package/templates/table-view/node_modules/.vite/deps/_metadata.json +56 -0
- package/templates/table-view/node_modules/.vite/deps/package.json +3 -0
- package/templates/table-view/node_modules/.vite/deps/react-D5jdVkJj.js +790 -0
- package/templates/table-view/node_modules/.vite/deps/react-D5jdVkJj.js.map +1 -0
- package/templates/table-view/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/table-view/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/table-view/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/table-view/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/table-view/node_modules/.vite/deps/react.js +2 -0
- package/templates/table-view/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/table-view/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/table-view/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/table-view/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/table-view/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/table-view/node_modules/.vite/deps/valibot.js.map +1 -0
- package/templates/table-view/package.json +31 -0
- package/templates/table-view/src/index.css +256 -0
- package/templates/table-view/src/index.tsx +1814 -0
- package/templates/table-view/src/table-model.ts +663 -0
- package/templates/table-view/tsconfig.json +17 -0
- package/templates/table-view/vite.config.ts +8 -0
- package/templates/us-heatmap/node_modules/.bin/tsc +21 -0
- package/templates/us-heatmap/node_modules/.bin/tsserver +21 -0
- package/templates/us-heatmap/node_modules/.bin/vite +21 -0
- package/templates/us-heatmap/node_modules/.vite/deps/_metadata.json +50 -0
- package/templates/us-heatmap/node_modules/.vite/deps/package.json +3 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react-CsV5wVHy.js +770 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react-CsV5wVHy.js.map +1 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react-dom.js +185 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react-dom_client.js +14384 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react.js +2 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react_jsx-dev-runtime.js +204 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react_jsx-runtime.js +208 -0
- package/templates/us-heatmap/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/templates/us-heatmap/node_modules/.vite/deps/valibot.js +6623 -0
- package/templates/us-heatmap/node_modules/.vite/deps/valibot.js.map +1 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { execSync } from "child_process"
|
|
2
|
+
import {
|
|
3
|
+
copyFileSync,
|
|
4
|
+
existsSync,
|
|
5
|
+
mkdirSync,
|
|
6
|
+
mkdtempSync,
|
|
7
|
+
readdirSync,
|
|
8
|
+
readFileSync,
|
|
9
|
+
rmSync,
|
|
10
|
+
statSync,
|
|
11
|
+
writeFileSync,
|
|
12
|
+
} from "fs"
|
|
13
|
+
import { tmpdir } from "os"
|
|
14
|
+
import { resolve } from "path"
|
|
15
|
+
|
|
16
|
+
type StoredTemplateMetadata = {
|
|
17
|
+
title?: string
|
|
18
|
+
description?: string
|
|
19
|
+
recommended?: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type TemplatePackageJson = {
|
|
23
|
+
name?: string
|
|
24
|
+
notionCustomTemplate?: StoredTemplateMetadata
|
|
25
|
+
dependencies?: Record<string, string>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type TemplateMetadata = {
|
|
29
|
+
name: string
|
|
30
|
+
dir: string
|
|
31
|
+
title: string
|
|
32
|
+
description: string
|
|
33
|
+
recommended: boolean
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
37
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function readTemplatePackageJson(path: string): TemplatePackageJson {
|
|
41
|
+
return JSON.parse(readFileSync(path, "utf-8")) as TemplatePackageJson
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function readTemplateMetadata(
|
|
45
|
+
templateBaseDir: string,
|
|
46
|
+
name: string,
|
|
47
|
+
): TemplateMetadata | null {
|
|
48
|
+
const dir = resolve(templateBaseDir, name)
|
|
49
|
+
if (
|
|
50
|
+
!statSync(dir).isDirectory() ||
|
|
51
|
+
!existsSync(resolve(dir, "package.json"))
|
|
52
|
+
) {
|
|
53
|
+
return null
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const pkgPath = resolve(dir, "package.json")
|
|
57
|
+
const pkg = readTemplatePackageJson(pkgPath)
|
|
58
|
+
const metadata = isRecord(pkg.notionCustomTemplate)
|
|
59
|
+
? pkg.notionCustomTemplate
|
|
60
|
+
: undefined
|
|
61
|
+
|
|
62
|
+
if (
|
|
63
|
+
typeof metadata?.title !== "string" ||
|
|
64
|
+
metadata.title.trim().length === 0
|
|
65
|
+
) {
|
|
66
|
+
throw new Error(`Template "${name}" is missing notionCustomTemplate.title`)
|
|
67
|
+
}
|
|
68
|
+
if (
|
|
69
|
+
typeof metadata.description !== "string" ||
|
|
70
|
+
metadata.description.trim().length === 0
|
|
71
|
+
) {
|
|
72
|
+
throw new Error(
|
|
73
|
+
`Template "${name}" is missing notionCustomTemplate.description`,
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
name,
|
|
79
|
+
dir,
|
|
80
|
+
title: metadata.title.trim(),
|
|
81
|
+
description: metadata.description.trim(),
|
|
82
|
+
recommended: metadata.recommended === true,
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function getTemplates(templateBaseDir: string): TemplateMetadata[] {
|
|
87
|
+
return readdirSync(templateBaseDir)
|
|
88
|
+
.map(name => readTemplateMetadata(templateBaseDir, name))
|
|
89
|
+
.filter((template): template is TemplateMetadata => template !== null)
|
|
90
|
+
.sort((left, right) => {
|
|
91
|
+
if (left.recommended !== right.recommended) {
|
|
92
|
+
return left.recommended ? -1 : 1
|
|
93
|
+
}
|
|
94
|
+
return left.name.localeCompare(right.name)
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function listTemplates(templateBaseDir: string): string[] {
|
|
99
|
+
return getTemplates(templateBaseDir).map(template => template.name)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function getTemplateByName(
|
|
103
|
+
templateBaseDir: string,
|
|
104
|
+
templateName: string,
|
|
105
|
+
): TemplateMetadata | undefined {
|
|
106
|
+
return getTemplates(templateBaseDir).find(
|
|
107
|
+
template => template.name === templateName,
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type ScaffoldTemplateOptions = {
|
|
112
|
+
root: string
|
|
113
|
+
templateDir: string
|
|
114
|
+
dest: string
|
|
115
|
+
name: string
|
|
116
|
+
overwrite?: boolean
|
|
117
|
+
/**
|
|
118
|
+
* If true, pack the in-repo SDK and rewrite the dep to `file:./<tgz>` so
|
|
119
|
+
* scaffolded projects exercise uncommitted SDK changes. Used by
|
|
120
|
+
* `test-scaffold` in CI. Default is false: the dep is rewritten to the SDK
|
|
121
|
+
* version pinned in `sdk/package.json` so users install from the registry.
|
|
122
|
+
*/
|
|
123
|
+
localSdk?: boolean
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const SDK_PACKAGE_NAME = "ncblock"
|
|
127
|
+
|
|
128
|
+
function readSdkVersion(root: string): string {
|
|
129
|
+
const versionFile = resolve(root, "sdk-version.json")
|
|
130
|
+
if (existsSync(versionFile)) {
|
|
131
|
+
const data = JSON.parse(readFileSync(versionFile, "utf-8"))
|
|
132
|
+
if (typeof data.version !== "string") {
|
|
133
|
+
throw new Error("sdk-version.json is missing a version")
|
|
134
|
+
}
|
|
135
|
+
return data.version
|
|
136
|
+
}
|
|
137
|
+
const sdkPkg = JSON.parse(
|
|
138
|
+
readFileSync(resolve(root, "sdk/package.json"), "utf-8"),
|
|
139
|
+
)
|
|
140
|
+
if (typeof sdkPkg.version !== "string") {
|
|
141
|
+
throw new Error("sdk/package.json is missing a version")
|
|
142
|
+
}
|
|
143
|
+
return sdkPkg.version
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function packLocalSdk(root: string, dest: string): string {
|
|
147
|
+
const sdkDir = resolve(root, "sdk")
|
|
148
|
+
const tgzOutput = execSync("npm pack --pack-destination .", {
|
|
149
|
+
cwd: sdkDir,
|
|
150
|
+
encoding: "utf-8",
|
|
151
|
+
}).trim()
|
|
152
|
+
const tgz = tgzOutput.split(/\r?\n/).at(-1) ?? tgzOutput
|
|
153
|
+
const tgzPath = resolve(sdkDir, tgz)
|
|
154
|
+
copyFileSync(tgzPath, resolve(dest, tgz))
|
|
155
|
+
rmSync(tgzPath, { force: true })
|
|
156
|
+
return `file:./${tgz}`
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function copyDirectoryContents(
|
|
160
|
+
sourceDir: string,
|
|
161
|
+
targetDir: string,
|
|
162
|
+
options: {
|
|
163
|
+
overwrite: boolean
|
|
164
|
+
exclude?: Set<string>
|
|
165
|
+
},
|
|
166
|
+
) {
|
|
167
|
+
mkdirSync(targetDir, { recursive: true })
|
|
168
|
+
|
|
169
|
+
for (const entry of readdirSync(sourceDir, { withFileTypes: true })) {
|
|
170
|
+
if (options.exclude?.has(entry.name)) {
|
|
171
|
+
continue
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const sourcePath = resolve(sourceDir, entry.name)
|
|
175
|
+
// npm strips .gitignore from published packages, so the publish script
|
|
176
|
+
// renames them to _gitignore. Restore the original name when scaffolding.
|
|
177
|
+
const targetName = entry.name === "_gitignore" ? ".gitignore" : entry.name
|
|
178
|
+
const targetPath = resolve(targetDir, targetName)
|
|
179
|
+
|
|
180
|
+
if (entry.isDirectory()) {
|
|
181
|
+
copyDirectoryContents(sourcePath, targetPath, options)
|
|
182
|
+
continue
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (!entry.isFile()) {
|
|
186
|
+
continue
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (!options.overwrite && existsSync(targetPath)) {
|
|
190
|
+
continue
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
copyFileSync(sourcePath, targetPath)
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function scaffoldTemplate({
|
|
198
|
+
root,
|
|
199
|
+
templateDir,
|
|
200
|
+
dest,
|
|
201
|
+
name,
|
|
202
|
+
overwrite = false,
|
|
203
|
+
localSdk = false,
|
|
204
|
+
}: ScaffoldTemplateOptions) {
|
|
205
|
+
copyDirectoryContents(templateDir, dest, {
|
|
206
|
+
overwrite,
|
|
207
|
+
exclude: new Set(["README.md", "package.json"]),
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
// Scaffolded projects are standalone, not workspace members. If the user
|
|
211
|
+
// scaffolds inside an existing pnpm workspace (e.g. this repo), pnpm walks
|
|
212
|
+
// up, finds the workspace root, and the install ends up partial. A local
|
|
213
|
+
// .npmrc with `ignore-workspace=true` makes pnpm treat the project as
|
|
214
|
+
// standalone regardless of where it lives.
|
|
215
|
+
const npmrcPath = resolve(dest, ".npmrc")
|
|
216
|
+
if (overwrite || !existsSync(npmrcPath)) {
|
|
217
|
+
writeFileSync(npmrcPath, "ignore-workspace=true\n")
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const readmeTarget = resolve(dest, "README.md")
|
|
221
|
+
if (overwrite || !existsSync(readmeTarget)) {
|
|
222
|
+
const readme = readFileSync(resolve(templateDir, "README.md"), "utf-8")
|
|
223
|
+
writeFileSync(readmeTarget, readme.replace(/\{\{name\}\}/g, name))
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const agentsTarget = resolve(dest, "AGENTS.md")
|
|
227
|
+
if (overwrite || !existsSync(agentsTarget)) {
|
|
228
|
+
const agentsSource = resolve(root, "scripts/scaffold-assets/AGENTS.md")
|
|
229
|
+
const agents = readFileSync(agentsSource, "utf-8")
|
|
230
|
+
writeFileSync(agentsTarget, agents.replace(/\{\{name\}\}/g, name))
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const pkgPath = resolve(dest, "package.json")
|
|
234
|
+
const pkg = JSON.parse(
|
|
235
|
+
readFileSync(resolve(templateDir, "package.json"), "utf-8"),
|
|
236
|
+
)
|
|
237
|
+
pkg.name = name
|
|
238
|
+
delete pkg.notionCustomTemplate
|
|
239
|
+
if (pkg.dependencies?.[SDK_PACKAGE_NAME]) {
|
|
240
|
+
pkg.dependencies[SDK_PACKAGE_NAME] = localSdk
|
|
241
|
+
? packLocalSdk(root, dest)
|
|
242
|
+
: `^${readSdkVersion(root)}`
|
|
243
|
+
}
|
|
244
|
+
writeFileSync(pkgPath, JSON.stringify(pkg, null, "\t") + "\n")
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export type ScaffoldedTemplate = {
|
|
248
|
+
template: string
|
|
249
|
+
dest: string
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
type ScaffoldAllOptions = {
|
|
253
|
+
root: string
|
|
254
|
+
templatesDir: string
|
|
255
|
+
pm: string
|
|
256
|
+
install?: boolean
|
|
257
|
+
localSdk?: boolean
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export function scaffoldAllTemplates({
|
|
261
|
+
root,
|
|
262
|
+
templatesDir,
|
|
263
|
+
pm,
|
|
264
|
+
install = true,
|
|
265
|
+
localSdk = false,
|
|
266
|
+
}: ScaffoldAllOptions): ScaffoldedTemplate[] {
|
|
267
|
+
const templates = listTemplates(templatesDir)
|
|
268
|
+
const results: ScaffoldedTemplate[] = []
|
|
269
|
+
|
|
270
|
+
for (const template of templates) {
|
|
271
|
+
const dest = mkdtempSync(resolve(tmpdir(), `custom-${template}-`))
|
|
272
|
+
const templateDir = resolve(templatesDir, template)
|
|
273
|
+
|
|
274
|
+
console.log(`[${template}] Scaffolding → ${dest}`)
|
|
275
|
+
scaffoldTemplate({
|
|
276
|
+
root,
|
|
277
|
+
templateDir,
|
|
278
|
+
dest,
|
|
279
|
+
name: template,
|
|
280
|
+
overwrite: true,
|
|
281
|
+
localSdk,
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
if (install) {
|
|
285
|
+
console.log(`[${template}] Installing dependencies...`)
|
|
286
|
+
execSync(`${pm} install`, { cwd: dest, stdio: "inherit" })
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
results.push({ template, dest })
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return results
|
|
293
|
+
}
|
package/sdk-version.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"0.0.7"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# {{name}}
|
|
2
|
+
|
|
3
|
+
A [Notion custom view](https://developers.notion.com) block with a debug UI for inspecting postMessage traffic.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run dev # Start Vite dev server
|
|
9
|
+
npm run build # Build to dist/
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Project structure
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
src/
|
|
16
|
+
index.tsx # Debug UI with message log (edit this)
|
|
17
|
+
index.css # Tailwind CSS entrypoint
|
|
18
|
+
index.html # Vite entry HTML
|
|
19
|
+
custom_blocks.json # Manifest declaring required data sources (served at runtime)
|
|
20
|
+
dist/ # Built output: index.html + assets/ + custom_blocks.json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This template includes Tailwind by default.
|
|
24
|
+
|
|
25
|
+
## How it works
|
|
26
|
+
|
|
27
|
+
Vite bundles `src/index.tsx` into `dist/`. When embedded in Notion, the SDK hooks from `ncblock` communicate with the host via `postMessage`.
|
|
28
|
+
|
|
29
|
+
The debug template includes a message log that intercepts and displays all incoming and outgoing `postMessage` events, making it useful for understanding the Notion host communication protocol.
|
|
30
|
+
|
|
31
|
+
### SDK hooks
|
|
32
|
+
|
|
33
|
+
- **`useCustomBlockContext()`** -- returns `{ customBlockId, parent, page }` describing the block's location in the document tree
|
|
34
|
+
- **`useTheme()`** -- returns the host's current theme (`"light"` or `"dark"`)
|
|
35
|
+
- **`useDataSourceDefinitions()`** -- returns resolved data-source definitions
|
|
36
|
+
- **`useDataSource(key)`** -- returns `{ items, collectionSchema, propertySchemasById, propertySchemasByKey, isLoading, hasMore, fetchMore, error }`. Each `item` has `{ id, propertiesById, propertiesByKey }`. The four built-ins (`created_time`, `last_edited_time`, `created_by`, `last_edited_by`) appear in `propertiesById` / `propertySchemasById`, never in the `*ByKey` views.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-600:oklch(57.7% .245 27.325);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-600:oklch(66.6% .179 58.318);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-600:oklch(59.6% .145 163.225);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-700:oklch(49.1% .27 292.581);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-stone-100:oklch(97% .001 106.424);--color-stone-800:oklch(26.8% .007 34.298);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--leading-tight:1.25;--radius-md:.375rem;--radius-lg:.5rem;--ease-out:cubic-bezier(0, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-1\/2{left:50%}.z-10{z-index:10}.z-1000{z-index:1000}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-\[9px\]{margin-left:9px}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing) * 2)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-7{height:calc(var(--spacing) * 7)}.max-h-\[360px\]{max-height:360px}.max-h-\[400px\]{max-height:400px}.min-h-7{min-height:calc(var(--spacing) * 7)}.w-2{width:calc(var(--spacing) * 2)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-7{width:calc(var(--spacing) * 7)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-full{width:100%}.max-w-\[80\%\]{max-width:80%}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-\[4px\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\(--border\){border-color:var(--border)}.border-\(--border-subtle\){border-color:var(--border-subtle)}.border-\(--error-border\){border-color:var(--error-border)}.border-\(--error-color\){border-color:var(--error-color)}.bg-\(--app-bg\){background-color:var(--app-bg)}.bg-\(--button-bg\){background-color:var(--button-bg)}.bg-\(--card-bg\){background-color:var(--card-bg)}.bg-\(--chip-bg\){background-color:var(--chip-bg)}.bg-\(--error-surface\){background-color:var(--error-surface)}.bg-\(--hover-bg\){background-color:var(--hover-bg)}.bg-\(--status-color\){background-color:var(--status-color)}.bg-\(--toast-bg\){background-color:var(--toast-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-8{padding-block:calc(var(--spacing) * 8)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pl-1{padding-left:calc(var(--spacing) * 1)}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[28px\]{font-size:28px}.text-\[32px\]{font-size:32px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[-0\.03em\]{--tw-tracking:-.03em;letter-spacing:-.03em}.tracking-\[0\.04em\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\[0\.05em\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\(--button-fg\){color:var(--button-fg)}.text-\(--error-color\){color:var(--error-color)}.text-\(--foreground\){color:var(--foreground)}.text-\(--muted\){color:var(--muted)}.text-\(--received-color\){color:var(--received-color)}.text-\(--sent-color\){color:var(--sent-color)}.text-\(--status-color\){color:var(--status-color)}.text-\(--status-waiting\){color:var(--status-waiting)}.text-\(--toast-fg\){color:var(--toast-fg)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-\(--toast-shadow\){--tw-shadow:var(--toast-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-\[opacity\,background-color\]{transition-property:opacity,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\/trigger\:text-\(--foreground\):is(:where(.group\/trigger):hover *){color:var(--foreground)}}.focus-within\:opacity-100:focus-within{opacity:1}@media (hover:hover){.hover\:border-\(--foreground\)\/20:hover{border-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.hover\:border-\(--foreground\)\/20:hover{border-color:color-mix(in oklab, var(--foreground) 20%, transparent)}}.hover\:bg-\(--hover-bg\):hover{background-color:var(--hover-bg)}.hover\:text-\(--foreground\):hover{color:var(--foreground)}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\(--foreground\):focus{border-color:var(--foreground)}.focus-visible\:opacity-100:focus-visible{opacity:1}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-\(--button-bg\):focus-visible{--tw-ring-color:var(--button-bg)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}}:root{font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}:root,[data-theme=light]{--app-bg:var(--color-white);--card-bg:var(--color-stone-100);--foreground:var(--color-stone-800);--muted:#29252466}@supports (color:color-mix(in lab, red, red)){:root,[data-theme=light]{--muted:color-mix(in oklab, var(--color-stone-800) 40%, transparent)}}:root,[data-theme=light]{--border:#29252417}@supports (color:color-mix(in lab, red, red)){:root,[data-theme=light]{--border:color-mix(in oklab, var(--color-stone-800) 9%, transparent)}}:root,[data-theme=light]{--border-subtle:#2925240f}@supports (color:color-mix(in lab, red, red)){:root,[data-theme=light]{--border-subtle:color-mix(in oklab, var(--color-stone-800) 6%, transparent)}}:root,[data-theme=light]{--sent-color:var(--color-violet-700);--received-color:var(--color-emerald-600);--toast-bg:var(--color-white);--toast-fg:var(--color-stone-800);--error-color:var(--color-red-600);--button-bg:var(--color-stone-800);--button-fg:var(--color-white);--hover-bg:#2925240a}@supports (color:color-mix(in lab, red, red)){:root,[data-theme=light]{--hover-bg:color-mix(in oklab, var(--color-stone-800) 4%, transparent)}}:root,[data-theme=light]{--chip-bg:#2925240a}@supports (color:color-mix(in lab, red, red)){:root,[data-theme=light]{--chip-bg:color-mix(in oklab, var(--color-stone-800) 4%, transparent)}}:root,[data-theme=light]{--status-standalone:var(--color-violet-700);--status-connected:var(--color-emerald-600);--status-waiting:var(--color-amber-600);--error-border:#e4001433}@supports (color:color-mix(in lab, red, red)){:root,[data-theme=light]{--error-border:color-mix(in oklab, var(--color-red-600) 20%, transparent)}}:root,[data-theme=light]{--error-surface:#e4001414}@supports (color:color-mix(in lab, red, red)){:root,[data-theme=light]{--error-surface:color-mix(in oklab, var(--color-red-600) 8%, transparent)}}:root,[data-theme=light]{--toast-shadow:0 2px 8px #00000026}@supports (color:color-mix(in lab, red, red)){:root,[data-theme=light]{--toast-shadow:0 2px 8px color-mix(in oklab, var(--color-black) 15%, transparent)}}[data-theme=dark]{--app-bg:#191919;--card-bg:var(--color-zinc-800);--foreground:var(--color-zinc-200);--muted:#fff6}@supports (color:color-mix(in lab, red, red)){[data-theme=dark]{--muted:color-mix(in oklab, var(--color-white) 40%, transparent)}}[data-theme=dark]{--border:#ffffff14}@supports (color:color-mix(in lab, red, red)){[data-theme=dark]{--border:color-mix(in oklab, var(--color-white) 8%, transparent)}}[data-theme=dark]{--border-subtle:#ffffff0d}@supports (color:color-mix(in lab, red, red)){[data-theme=dark]{--border-subtle:color-mix(in oklab, var(--color-white) 5%, transparent)}}[data-theme=dark]{--sent-color:var(--color-violet-400);--received-color:var(--color-emerald-400);--toast-bg:var(--color-zinc-800);--toast-fg:var(--color-zinc-200);--error-color:var(--color-red-300);--button-bg:var(--color-zinc-200);--button-fg:var(--color-zinc-900);--hover-bg:#ffffff0a}@supports (color:color-mix(in lab, red, red)){[data-theme=dark]{--hover-bg:color-mix(in oklab, var(--color-white) 4%, transparent)}}[data-theme=dark]{--chip-bg:#ffffff0d}@supports (color:color-mix(in lab, red, red)){[data-theme=dark]{--chip-bg:color-mix(in oklab, var(--color-white) 5%, transparent)}}[data-theme=dark]{--status-standalone:var(--color-violet-400);--status-connected:var(--color-emerald-400);--status-waiting:var(--color-amber-400);--error-border:#ffa3a333}@supports (color:color-mix(in lab, red, red)){[data-theme=dark]{--error-border:color-mix(in oklab, var(--color-red-300) 20%, transparent)}}[data-theme=dark]{--error-surface:#ffa3a314}@supports (color:color-mix(in lab, red, red)){[data-theme=dark]{--error-surface:color-mix(in oklab, var(--color-red-300) 8%, transparent)}}[data-theme=dark]{--toast-shadow:0 2px 8px #00000026}@supports (color:color-mix(in lab, red, red)){[data-theme=dark]{--toast-shadow:0 2px 8px color-mix(in oklab, var(--color-black) 15%, transparent)}}body{margin:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}
|