@docubook/create 1.9.1 → 1.11.2

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.
Files changed (129) hide show
  1. package/README.md +1 -3
  2. package/package.json +4 -5
  3. package/src/cli/program.js +32 -0
  4. package/src/cli/promptHandler.js +73 -0
  5. package/src/dist/LICENSE +21 -0
  6. package/src/dist/README.md +37 -0
  7. package/src/dist/app/docs/[[...slug]]/page.tsx +105 -0
  8. package/src/dist/app/docs/layout.tsx +16 -0
  9. package/src/dist/app/error.tsx +44 -0
  10. package/src/dist/app/layout.tsx +96 -0
  11. package/src/dist/app/not-found.tsx +19 -0
  12. package/src/dist/app/page.tsx +96 -0
  13. package/src/dist/components/GithubStart.tsx +44 -0
  14. package/src/dist/components/Sponsor.tsx +69 -0
  15. package/src/dist/components/anchor.tsx +84 -0
  16. package/src/dist/components/contexts/theme-provider.tsx +9 -0
  17. package/src/dist/components/docs-breadcrumb.tsx +47 -0
  18. package/src/dist/components/docs-menu.tsx +45 -0
  19. package/src/dist/components/edit-on-github.tsx +33 -0
  20. package/src/dist/components/footer.tsx +85 -0
  21. package/src/dist/components/leftbar.tsx +95 -0
  22. package/src/dist/components/markdown/AccordionMdx.tsx +47 -0
  23. package/src/dist/components/markdown/ButtonMdx.tsx +52 -0
  24. package/src/dist/components/markdown/CardGroupMdx.tsx +28 -0
  25. package/src/dist/components/markdown/CardMdx.tsx +41 -0
  26. package/src/dist/components/markdown/CopyMdx.tsx +33 -0
  27. package/src/dist/components/markdown/ImageMdx.tsx +25 -0
  28. package/src/dist/components/markdown/KeyboardMdx.tsx +102 -0
  29. package/src/dist/components/markdown/LinkMdx.tsx +14 -0
  30. package/src/dist/components/markdown/NoteMdx.tsx +52 -0
  31. package/src/dist/components/markdown/OutletMdx.tsx +29 -0
  32. package/src/dist/components/markdown/PreMdx.tsx +19 -0
  33. package/src/dist/components/markdown/ReleaseMdx.tsx +109 -0
  34. package/src/dist/components/markdown/StepperMdx.tsx +41 -0
  35. package/src/dist/components/markdown/TooltipsMdx.tsx +28 -0
  36. package/src/dist/components/markdown/YoutubeMdx.tsx +22 -0
  37. package/src/dist/components/markdown/mdx-provider.tsx +29 -0
  38. package/src/dist/components/mob-toc.tsx +128 -0
  39. package/src/dist/components/navbar.tsx +87 -0
  40. package/src/dist/components/pagination.tsx +49 -0
  41. package/src/dist/components/scroll-to-top.tsx +86 -0
  42. package/src/dist/components/search.tsx +214 -0
  43. package/src/dist/components/sublink.tsx +133 -0
  44. package/src/dist/components/theme-toggle.tsx +71 -0
  45. package/src/dist/components/toc-observer.tsx +264 -0
  46. package/src/dist/components/toc.tsx +27 -0
  47. package/src/dist/components/typography.tsx +9 -0
  48. package/src/dist/components/ui/accordion.tsx +58 -0
  49. package/src/dist/components/ui/animated-shiny-text.tsx +40 -0
  50. package/src/dist/components/ui/aurora.tsx +45 -0
  51. package/src/dist/components/ui/avatar.tsx +50 -0
  52. package/src/dist/components/ui/badge.tsx +37 -0
  53. package/src/dist/components/ui/breadcrumb.tsx +115 -0
  54. package/src/dist/components/ui/button.tsx +57 -0
  55. package/src/dist/components/ui/card.tsx +76 -0
  56. package/src/dist/components/ui/collapsible.tsx +11 -0
  57. package/src/dist/components/ui/command.tsx +153 -0
  58. package/src/dist/components/ui/dialog.tsx +124 -0
  59. package/src/dist/components/ui/dropdown-menu.tsx +200 -0
  60. package/src/dist/components/ui/icon-cloud.tsx +324 -0
  61. package/src/dist/components/ui/input.tsx +25 -0
  62. package/src/dist/components/ui/interactive-hover-button.tsx +35 -0
  63. package/src/dist/components/ui/popover.tsx +33 -0
  64. package/src/dist/components/ui/scroll-area.tsx +48 -0
  65. package/src/dist/components/ui/separator.tsx +30 -0
  66. package/src/dist/components/ui/sheet.tsx +140 -0
  67. package/src/dist/components/ui/shine-border.tsx +64 -0
  68. package/src/dist/components/ui/skeleton.tsx +15 -0
  69. package/src/dist/components/ui/sonner.tsx +31 -0
  70. package/src/dist/components/ui/table.tsx +117 -0
  71. package/src/dist/components/ui/tabs.tsx +55 -0
  72. package/src/dist/components/ui/toggle-group.tsx +61 -0
  73. package/src/dist/components/ui/toggle.tsx +46 -0
  74. package/src/dist/components.json +17 -0
  75. package/src/dist/contents/docs/getting-started/changelog/index.mdx +512 -0
  76. package/src/dist/contents/docs/getting-started/components/accordion/index.mdx +72 -0
  77. package/src/dist/contents/docs/getting-started/components/button/index.mdx +42 -0
  78. package/src/dist/contents/docs/getting-started/components/card/index.mdx +70 -0
  79. package/src/dist/contents/docs/getting-started/components/card-group/index.mdx +49 -0
  80. package/src/dist/contents/docs/getting-started/components/code-block/index.mdx +41 -0
  81. package/src/dist/contents/docs/getting-started/components/custom/index.mdx +38 -0
  82. package/src/dist/contents/docs/getting-started/components/image/index.mdx +37 -0
  83. package/src/dist/contents/docs/getting-started/components/index.mdx +9 -0
  84. package/src/dist/contents/docs/getting-started/components/keyboard/index.mdx +117 -0
  85. package/src/dist/contents/docs/getting-started/components/link/index.mdx +34 -0
  86. package/src/dist/contents/docs/getting-started/components/note/index.mdx +46 -0
  87. package/src/dist/contents/docs/getting-started/components/release-note/index.mdx +130 -0
  88. package/src/dist/contents/docs/getting-started/components/stepper/index.mdx +47 -0
  89. package/src/dist/contents/docs/getting-started/components/tabs/index.mdx +70 -0
  90. package/src/dist/contents/docs/getting-started/components/tooltips/index.mdx +22 -0
  91. package/src/dist/contents/docs/getting-started/components/youtube/index.mdx +21 -0
  92. package/src/dist/contents/docs/getting-started/customize/index.mdx +94 -0
  93. package/src/dist/contents/docs/getting-started/installation/index.mdx +84 -0
  94. package/src/dist/contents/docs/getting-started/introduction/index.mdx +50 -0
  95. package/src/dist/contents/docs/getting-started/project-structure/index.mdx +87 -0
  96. package/src/dist/contents/docs/getting-started/quick-start-guide/index.mdx +127 -0
  97. package/src/dist/docu.json +100 -0
  98. package/src/dist/hooks/index.ts +2 -0
  99. package/src/dist/hooks/useActiveSection.ts +68 -0
  100. package/src/dist/hooks/useScrollPosition.ts +28 -0
  101. package/src/dist/lib/markdown.ts +244 -0
  102. package/src/dist/lib/routes-config.ts +28 -0
  103. package/src/dist/lib/toc.ts +9 -0
  104. package/src/dist/lib/utils.ts +80 -0
  105. package/src/dist/next-env.d.ts +5 -0
  106. package/src/dist/next.config.mjs +14 -0
  107. package/src/dist/package.json +58 -0
  108. package/src/dist/postcss.config.js +6 -0
  109. package/src/dist/public/favicon.ico +0 -0
  110. package/src/dist/public/images/docu.svg +6 -0
  111. package/src/dist/public/images/example-img.png +0 -0
  112. package/src/dist/public/images/img-playground.png +0 -0
  113. package/src/dist/public/images/new-editor.png +0 -0
  114. package/src/dist/public/images/og-image.png +0 -0
  115. package/src/dist/public/images/release-note.png +0 -0
  116. package/src/dist/public/images/snippet.png +0 -0
  117. package/src/dist/public/images/vercel.png +0 -0
  118. package/src/dist/public/images/view-changelog.png +0 -0
  119. package/src/dist/styles/editor.css +57 -0
  120. package/src/dist/styles/globals.css +156 -0
  121. package/src/dist/styles/syntax.css +100 -0
  122. package/src/dist/tailwind.config.ts +112 -0
  123. package/src/dist/tsconfig.json +26 -0
  124. package/src/index.js +19 -0
  125. package/src/installer/projectInstaller.js +125 -0
  126. package/src/utils/display.js +83 -0
  127. package/src/utils/logger.js +11 -0
  128. package/src/utils/packageManager.js +54 -0
  129. package/create.js +0 -211
@@ -0,0 +1,244 @@
1
+ import { compileMDX } from "next-mdx-remote/rsc";
2
+ import path from "path";
3
+ import { promises as fs } from "fs";
4
+ import remarkGfm from "remark-gfm";
5
+ import rehypePrism from "rehype-prism-plus";
6
+ import rehypeAutolinkHeadings from "rehype-autolink-headings";
7
+ import rehypeSlug from "rehype-slug";
8
+ import rehypeCodeTitles from "rehype-code-titles";
9
+ import { page_routes, ROUTES } from "./routes-config";
10
+ import { visit } from "unist-util-visit";
11
+ import matter from "gray-matter";
12
+
13
+ // custom components imports
14
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
15
+ import Pre from "@/components/markdown/PreMdx";
16
+ import Note from "@/components/markdown/NoteMdx";
17
+ import { Stepper, StepperItem } from "@/components/markdown/StepperMdx";
18
+ import Image from "@/components/markdown/ImageMdx";
19
+ import Link from "@/components/markdown/LinkMdx";
20
+ import Outlet from "@/components/markdown/OutletMdx";
21
+ import Youtube from "@/components/markdown/YoutubeMdx";
22
+ import Tooltip from "@/components/markdown/TooltipsMdx";
23
+ import Card from "@/components/markdown/CardMdx";
24
+ import Button from "@/components/markdown/ButtonMdx";
25
+ import Accordion from "@/components/markdown/AccordionMdx";
26
+ import CardGroup from "@/components/markdown/CardGroupMdx";
27
+ import Kbd from "@/components/markdown/KeyboardMdx";
28
+ import { Release, Changes } from "@/components/markdown/ReleaseMdx";
29
+
30
+ // add custom components
31
+ const components = {
32
+ Tabs,
33
+ TabsContent,
34
+ TabsList,
35
+ TabsTrigger,
36
+ pre: Pre,
37
+ Note,
38
+ Stepper,
39
+ StepperItem,
40
+ img: Image,
41
+ a: Link,
42
+ Outlet,
43
+ Youtube,
44
+ Tooltip,
45
+ Card,
46
+ Button,
47
+ Accordion,
48
+ CardGroup,
49
+ Kbd,
50
+ Release,
51
+ Changes,
52
+ };
53
+
54
+ // can be used for other pages like blogs, Guides etc
55
+ async function parseMdx<Frontmatter>(rawMdx: string) {
56
+ return await compileMDX<Frontmatter>({
57
+ source: rawMdx,
58
+ options: {
59
+ parseFrontmatter: true,
60
+ mdxOptions: {
61
+ rehypePlugins: [
62
+ preProcess,
63
+ rehypeCodeTitles,
64
+ rehypePrism,
65
+ rehypeSlug,
66
+ rehypeAutolinkHeadings,
67
+ postProcess,
68
+ ],
69
+ remarkPlugins: [remarkGfm],
70
+ },
71
+ },
72
+ components,
73
+ });
74
+ }
75
+
76
+ // logic for docs
77
+ export type BaseMdxFrontmatter = {
78
+ title: string;
79
+ description: string;
80
+ image: string;
81
+ date: string;
82
+ };
83
+
84
+ export async function getDocsForSlug(slug: string) {
85
+ try {
86
+ const contentPath = getDocsContentPath(slug);
87
+ const rawMdx = await fs.readFile(contentPath, "utf-8");
88
+ return await parseMdx<BaseMdxFrontmatter>(rawMdx);
89
+ } catch (err) {
90
+ console.log(err);
91
+ }
92
+ }
93
+
94
+ export async function getDocsTocs(slug: string) {
95
+ const contentPath = getDocsContentPath(slug);
96
+ const rawMdx = await fs.readFile(contentPath, "utf-8");
97
+ // captures between ## - #### can modify accordingly
98
+ const headingsRegex = /^(#{2,4})\s(.+)$/gm;
99
+ let match;
100
+ const extractedHeadings = [];
101
+ while ((match = headingsRegex.exec(rawMdx)) !== null) {
102
+ const headingLevel = match[1].length;
103
+ const headingText = match[2].trim();
104
+ const slug = sluggify(headingText);
105
+ extractedHeadings.push({
106
+ level: headingLevel,
107
+ text: headingText,
108
+ href: `#${slug}`,
109
+ });
110
+ }
111
+ return extractedHeadings;
112
+ }
113
+
114
+ export function getPreviousNext(path: string) {
115
+ const index = page_routes.findIndex(({ href }) => href == `/${path}`);
116
+ return {
117
+ prev: page_routes[index - 1],
118
+ next: page_routes[index + 1],
119
+ };
120
+ }
121
+
122
+ function sluggify(text: string) {
123
+ const slug = text.toLowerCase().replace(/\s+/g, "-");
124
+ return slug.replace(/[^a-z0-9-]/g, "");
125
+ }
126
+
127
+ function getDocsContentPath(slug: string) {
128
+ return path.join(process.cwd(), "/contents/docs/", `${slug}/index.mdx`);
129
+ }
130
+
131
+ function justGetFrontmatterFromMD<Frontmatter>(rawMd: string): Frontmatter {
132
+ return matter(rawMd).data as Frontmatter;
133
+ }
134
+
135
+ export async function getAllChilds(pathString: string) {
136
+ const items = pathString.split("/").filter((it) => it != "");
137
+ let page_routes_copy = ROUTES;
138
+
139
+ let prevHref = "";
140
+ for (let it of items) {
141
+ const found = page_routes_copy.find((innerIt) => innerIt.href == `/${it}`);
142
+ if (!found) break;
143
+ prevHref += found.href;
144
+ page_routes_copy = found.items ?? [];
145
+ }
146
+ if (!prevHref) return [];
147
+
148
+ return await Promise.all(
149
+ page_routes_copy.map(async (it) => {
150
+ const totalPath = path.join(
151
+ process.cwd(),
152
+ "/contents/docs/",
153
+ prevHref,
154
+ it.href,
155
+ "index.mdx"
156
+ );
157
+ const raw = await fs.readFile(totalPath, "utf-8");
158
+ return {
159
+ ...justGetFrontmatterFromMD<BaseMdxFrontmatter>(raw),
160
+ href: `/docs${prevHref}${it.href}`,
161
+ };
162
+ })
163
+ );
164
+ }
165
+
166
+ // for copying the code in pre
167
+ const preProcess = () => (tree: any) => {
168
+ visit(tree, (node) => {
169
+ if (node?.type === "element" && node?.tagName === "pre") {
170
+ const [codeEl] = node.children;
171
+ if (codeEl.tagName !== "code") return;
172
+ node.raw = codeEl.children?.[0].value;
173
+ }
174
+ });
175
+ };
176
+
177
+ const postProcess = () => (tree: any) => {
178
+ visit(tree, "element", (node) => {
179
+ if (node?.type === "element" && node?.tagName === "pre") {
180
+ node.properties["raw"] = node.raw;
181
+ }
182
+ });
183
+ };
184
+
185
+ // export type Author = {
186
+ // avatar?: string;
187
+ // handle: string;
188
+ // username: string;
189
+ // handleUrl: string;
190
+ // };
191
+
192
+ // Blog related types and functions have been removed
193
+ /*
194
+ export type BlogMdxFrontmatter = BaseMdxFrontmatter & {
195
+ date: string;
196
+ authors: Author[];
197
+ cover: string;
198
+ };
199
+
200
+ export async function getAllBlogStaticPaths() {
201
+ try {
202
+ const blogFolder = path.join(process.cwd(), "/contents/blogs/");
203
+ const res = await fs.readdir(blogFolder);
204
+ return res.map((file) => file.split(".")[0]);
205
+ } catch (err) {
206
+ console.log(err);
207
+ return [];
208
+ }
209
+ }
210
+
211
+ export async function getAllBlogs() {
212
+ const blogFolder = path.join(process.cwd(), "/contents/blogs/");
213
+ const files = await fs.readdir(blogFolder);
214
+ const uncheckedRes = await Promise.all(
215
+ files.map(async (file) => {
216
+ try {
217
+ const filepath = path.join(process.cwd(), `/contents/blogs/${file}`);
218
+ const rawMdx = await fs.readFile(filepath, "utf-8");
219
+ return {
220
+ ...justGetFrontmatterFromMD<BlogMdxFrontmatter>(rawMdx),
221
+ slug: file.split(".")[0],
222
+ };
223
+ } catch (err) {
224
+ console.log(err);
225
+ return null;
226
+ }
227
+ })
228
+ );
229
+ return uncheckedRes.filter((it) => !!it) as (BlogMdxFrontmatter & {
230
+ slug: string;
231
+ })[];
232
+ }
233
+
234
+ export async function getBlogForSlug(slug: string) {
235
+ try {
236
+ const blogFile = path.join(process.cwd(), "/contents/blogs/", `${slug}.mdx`);
237
+ const rawMdx = await fs.readFile(blogFile, "utf-8");
238
+ return await parseMdx<BlogMdxFrontmatter>(rawMdx);
239
+ } catch (err) {
240
+ console.log(err);
241
+ return null;
242
+ }
243
+ }
244
+ */
@@ -0,0 +1,28 @@
1
+ import docuConfig from "@/docu.json"; // Import JSON file
2
+
3
+ export type EachRoute = {
4
+ title: string;
5
+ href: string;
6
+ noLink?: boolean; // Sekarang mendukung boolean
7
+ items?: EachRoute[];
8
+ };
9
+
10
+ export const ROUTES: EachRoute[] = docuConfig.routes;
11
+
12
+ type Page = { title: string; href: string };
13
+
14
+ function getRecursiveAllLinks(node: EachRoute): Page[] {
15
+ const ans: Page[] = [];
16
+ if (!node.noLink) {
17
+ ans.push({ title: node.title, href: node.href });
18
+ }
19
+ node.items?.forEach((subNode) => {
20
+ const temp = { ...subNode, href: `${node.href}${subNode.href}` };
21
+ ans.push(...getRecursiveAllLinks(temp));
22
+ });
23
+ return ans;
24
+ }
25
+
26
+ export const page_routes: Page[] = ROUTES.map((route) =>
27
+ getRecursiveAllLinks(route)
28
+ ).flat();
@@ -0,0 +1,9 @@
1
+ export interface TocItem {
2
+ level: number;
3
+ text: string;
4
+ href: string;
5
+ }
6
+
7
+ export interface MobTocProps {
8
+ tocs: TocItem[];
9
+ }
@@ -0,0 +1,80 @@
1
+ import { type ClassValue, clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ import { EachRoute, ROUTES } from "./routes-config";
4
+
5
+ export function cn(...inputs: ClassValue[]) {
6
+ return twMerge(clsx(inputs));
7
+ }
8
+
9
+ export function helperSearch(
10
+ query: string,
11
+ node: EachRoute,
12
+ prefix: string,
13
+ currenLevel: number,
14
+ maxLevel?: number
15
+ ) {
16
+ const res: EachRoute[] = [];
17
+ let parentHas = false;
18
+
19
+ const nextLink = `${prefix}${node.href}`;
20
+ if (!node.noLink && node.title.toLowerCase().includes(query.toLowerCase())) {
21
+ res.push({ ...node, items: undefined, href: nextLink });
22
+ parentHas = true;
23
+ }
24
+ const goNext = maxLevel ? currenLevel < maxLevel : true;
25
+ if (goNext)
26
+ node.items?.forEach((item) => {
27
+ const innerRes = helperSearch(
28
+ query,
29
+ item,
30
+ nextLink,
31
+ currenLevel + 1,
32
+ maxLevel
33
+ );
34
+ if (!!innerRes.length && !parentHas && !node.noLink) {
35
+ res.push({ ...node, items: undefined, href: nextLink });
36
+ parentHas = true;
37
+ }
38
+ res.push(...innerRes);
39
+ });
40
+ return res;
41
+ }
42
+
43
+ export function advanceSearch(query: string) {
44
+ return ROUTES.map((node) =>
45
+ helperSearch(query, node, "", 1, query.length == 0 ? 2 : undefined)
46
+ ).flat();
47
+ }
48
+
49
+ // Thursday, May 23, 2024
50
+ export function formatDate(dateStr: string): string {
51
+ const [day, month, year] = dateStr.split("-").map(Number);
52
+ const date = new Date(year, month - 1, day);
53
+
54
+ const options: Intl.DateTimeFormatOptions = {
55
+ weekday: "long",
56
+ year: "numeric",
57
+ month: "long",
58
+ day: "numeric",
59
+ };
60
+
61
+ return date.toLocaleDateString("en-US", options);
62
+ }
63
+
64
+ // May 23, 2024
65
+ export function formatDate2(dateStr: string): string {
66
+ const [day, month, year] = dateStr.split("-").map(Number);
67
+ const date = new Date(year, month - 1, day);
68
+
69
+ const options: Intl.DateTimeFormatOptions = {
70
+ month: "short",
71
+ day: "numeric",
72
+ year: "numeric",
73
+ };
74
+ return date.toLocaleDateString("en-US", options);
75
+ }
76
+
77
+ export function stringToDate(date: string) {
78
+ const [day, month, year] = date.split("-").map(Number);
79
+ return new Date(year, month - 1, day);
80
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+
4
+ // NOTE: This file should not be edited
5
+ // see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
@@ -0,0 +1,14 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ images: {
4
+ remotePatterns: [
5
+ {
6
+ protocol: "https",
7
+ hostname: "**",
8
+ },
9
+ ],
10
+ },
11
+ };
12
+
13
+ export default nextConfig;
14
+
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "docubook",
3
+ "version": "1.11.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "lint": "next lint"
10
+ },
11
+ "dependencies": {
12
+ "@radix-ui/react-accordion": "^1.2.0",
13
+ "@radix-ui/react-avatar": "^1.1.0",
14
+ "@radix-ui/react-collapsible": "^1.1.0",
15
+ "@radix-ui/react-dialog": "^1.1.6",
16
+ "@radix-ui/react-dropdown-menu": "^2.1.1",
17
+ "@radix-ui/react-popover": "^1.1.6",
18
+ "@radix-ui/react-scroll-area": "^1.2.0",
19
+ "@radix-ui/react-separator": "^1.0.3",
20
+ "@radix-ui/react-slot": "^1.1.0",
21
+ "@radix-ui/react-tabs": "^1.1.0",
22
+ "@radix-ui/react-toggle": "^1.1.2",
23
+ "@radix-ui/react-toggle-group": "^1.1.2",
24
+ "class-variance-authority": "^0.7.0",
25
+ "clsx": "^2.1.1",
26
+ "cmdk": "1.0.0",
27
+ "framer-motion": "^12.4.1",
28
+ "geist": "^1.3.1",
29
+ "gray-matter": "^4.0.3",
30
+ "lucide-react": "^0.511.0",
31
+ "next": "^14.2.6",
32
+ "next-mdx-remote": "^5.0.0",
33
+ "next-themes": "^0.3.0",
34
+ "react": "^18.3.1",
35
+ "react-dom": "^18.3.1",
36
+ "rehype-autolink-headings": "^7.1.0",
37
+ "rehype-code-titles": "^1.2.0",
38
+ "rehype-prism-plus": "^2.0.0",
39
+ "rehype-slug": "^6.0.0",
40
+ "remark-gfm": "^4.0.0",
41
+ "sonner": "^1.4.3",
42
+ "tailwind-merge": "^2.5.2",
43
+ "tailwindcss-animate": "^1.0.7",
44
+ "unist-util-visit": "^5.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@tailwindcss/typography": "^0.5.14",
48
+ "@types/node": "^20",
49
+ "@types/react": "^18",
50
+ "@types/react-dom": "^18",
51
+ "autoprefixer": "^10.4.20",
52
+ "eslint": "^8",
53
+ "eslint-config-next": "^14.2.6",
54
+ "postcss": "^8",
55
+ "tailwindcss": "^3.4.10",
56
+ "typescript": "^5"
57
+ }
58
+ }
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ };
Binary file
@@ -0,0 +1,6 @@
1
+ <svg width="327" height="335" viewBox="0 0 327 335" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M134.103 1.7165C107.452 6.5525 81.1909 18.8685 60.4439 36.2595C30.8829 61.0385 12.4479 92.0965 2.83192 133.323C0.321925 144.087 0.0549229 147.042 0.00192291 164.706C-0.0630771 186.652 1.50693 198.42 6.67593 214.706C18.9379 253.34 43.3039 285.232 77.9359 307.975C94.2639 318.697 115.026 327.03 137.444 331.859C146.485 333.806 150.931 334.125 169.444 334.143C188.084 334.163 192.307 333.866 201.193 331.917C239.319 323.553 273.06 302.754 294.546 274.372C315.119 247.198 324.941 219.782 326.139 186.191C327.234 155.472 321.61 127.148 309.099 100.375L304.511 90.5565L307.727 84.8815C310.757 79.5355 310.944 78.6235 310.944 69.2055C310.944 60.2955 310.641 58.5885 308.165 53.5455C300.945 38.8445 284.462 30.7025 270.472 34.9275L265.999 36.2775L258.472 30.6295C242.001 18.2715 222.519 9.2235 200.253 3.5915C188.74 0.678503 186.554 0.453499 166.444 0.113499C148.298 -0.194501 143.253 0.0565031 134.103 1.7165ZM152.944 29.8145C139.264 31.7855 118.102 39.5405 109.301 45.8075L106.348 47.9105L110.021 51.4765C121.832 62.9485 119.715 79.6665 104.652 93.8655C89.6179 108.038 70.8619 112.228 58.8769 104.095C56.8599 102.726 55.1049 101.742 54.9769 101.907C54.8479 102.071 53.1859 104.905 51.2819 108.205C46.0699 117.238 40.6489 130.512 37.7099 141.436C35.3249 150.303 35.0749 152.962 35.0129 170.206C34.9449 189.163 34.9519 189.227 38.2089 198.557C43.1559 212.726 48.3319 220.763 59.8809 232.206C72.2309 244.441 82.5579 251.01 100.684 258.161C107.977 261.038 119.458 265.557 126.198 268.202C144.252 275.288 153.014 280.829 172.073 297.216L176.203 300.766L185.982 298.647C218.657 291.568 249.221 274.758 274.055 250.208C295.044 229.458 305.061 206.48 306.168 176.54C307.047 152.773 302.951 135.224 290.92 111.205C268.15 65.7505 229.779 35.9725 185.944 29.7405C177.661 28.5625 161.375 28.5995 152.944 29.8145ZM157.857 98.5295C140.791 104.429 122 125.955 116.933 145.409C110.8 168.956 124.23 187.581 145.721 185.335C167.772 183.03 189.05 157.209 191.148 130.206C193.002 106.35 177.608 91.7015 157.857 98.5295ZM237.453 100.461C230.522 107.392 229.801 119.16 235.403 133.941C238.484 142.069 244.743 151.066 253.055 159.312C267.734 173.874 280.745 175.51 287.394 163.629C289.456 159.946 289.832 157.978 289.764 151.229C289.628 137.701 282.163 121.805 269.784 108.683C261.637 100.046 255.318 96.7055 247.13 96.7055C241.619 96.7055 240.948 96.9655 237.453 100.461ZM163.103 127.759C155.424 133.799 159.206 149.959 167.907 148.286C175.153 146.891 179.183 134.457 174.371 128.34C171.793 125.061 166.856 124.807 163.103 127.759ZM246.479 127.64C245.01 130.385 245.217 132.608 247.382 137.378C252.078 147.72 261.885 145.902 259.852 135.066C258.469 127.693 249.204 122.549 246.479 127.64ZM224.444 172.036C215.52 174.085 209.444 178.216 209.444 182.232C209.444 187.886 219.911 196.985 230.125 200.212L235.305 201.849L233.958 206.326C230.901 216.482 226.825 219.169 215.515 218.483C205.127 217.852 196.189 213.46 187.987 204.956C182.003 198.752 179.094 197.456 176.644 199.906C170.995 205.555 186.262 221.925 202.556 227.689C207.335 229.379 211.997 230.073 221.066 230.444C242.551 231.322 257.348 226.786 267.283 216.281C273.119 210.111 273.908 206.711 270.085 204.206C267.022 202.2 265.64 202.864 261.667 208.25C259.865 210.693 256.644 213.584 254.509 214.673C249.567 217.194 242.939 218.315 241.996 216.79C241.612 216.168 241.885 212.482 242.603 208.598C243.8 202.129 244.246 201.288 247.927 198.583C255.823 192.78 261.356 183.477 260.037 178.219C259.708 176.91 257.978 174.796 256.192 173.522C253.304 171.463 251.67 171.182 241.444 170.99C234.917 170.867 227.566 171.319 224.444 172.036Z" fill="#2281E3"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M152.944 29.8145C139.264 31.7855 118.102 39.5405 109.301 45.8075L106.348 47.9105L110.021 51.4765C121.832 62.9485 119.715 79.6665 104.652 93.8655C89.6179 108.038 70.8619 112.228 58.8769 104.095C56.8599 102.726 55.1049 101.742 54.9769 101.907C54.8479 102.071 53.1859 104.905 51.2819 108.205C46.0699 117.238 40.6489 130.512 37.7099 141.436C35.3249 150.303 35.0749 152.962 35.0129 170.206C34.9449 189.163 34.9519 189.227 38.2089 198.557C43.1559 212.726 48.3319 220.763 59.8809 232.206C72.2309 244.441 82.5579 251.01 100.684 258.161C107.977 261.038 119.458 265.557 126.198 268.202C144.252 275.288 153.014 280.829 172.073 297.216L176.203 300.766L185.982 298.647C218.657 291.568 249.221 274.758 274.055 250.208C295.044 229.458 305.061 206.48 306.168 176.54C307.047 152.773 302.951 135.224 290.92 111.205C268.15 65.7505 229.779 35.9725 185.944 29.7405C177.661 28.5625 161.375 28.5995 152.944 29.8145ZM116.933 145.409C122 125.955 140.791 104.429 157.857 98.5295C177.608 91.7015 193.002 106.35 191.148 130.206C189.05 157.209 167.772 183.03 145.721 185.335C124.23 187.581 110.8 168.956 116.933 145.409ZM235.403 133.941C229.801 119.16 230.522 107.392 237.453 100.461C240.948 96.9655 241.619 96.7055 247.13 96.7055C255.318 96.7055 261.637 100.046 269.784 108.683C282.163 121.805 289.628 137.701 289.764 151.229C289.832 157.978 289.456 159.946 287.394 163.629C280.745 175.51 267.734 173.874 253.055 159.312C244.743 151.066 238.484 142.069 235.403 133.941ZM209.444 182.232C209.444 178.216 215.52 174.085 224.444 172.036C227.566 171.319 234.917 170.867 241.444 170.99C251.67 171.182 253.304 171.463 256.192 173.522C257.978 174.796 259.708 176.91 260.037 178.219C261.356 183.477 255.823 192.78 247.927 198.583C244.246 201.288 243.8 202.129 242.603 208.598C241.885 212.482 241.612 216.168 241.996 216.79C242.939 218.315 249.567 217.194 254.509 214.673C256.644 213.584 259.865 210.693 261.667 208.25C265.64 202.864 267.022 202.2 270.085 204.206C273.908 206.711 273.119 210.111 267.283 216.281C257.348 226.786 242.551 231.322 221.066 230.444C211.997 230.073 207.335 229.379 202.556 227.689C186.262 221.925 170.995 205.555 176.644 199.906C179.094 197.456 182.003 198.752 187.987 204.956C196.189 213.46 205.127 217.852 215.515 218.483C226.825 219.169 230.901 216.482 233.958 206.326L235.305 201.849L230.125 200.212C219.911 196.985 209.444 187.886 209.444 182.232Z" fill="white"/>
4
+ <path d="M163.103 127.759C155.424 133.799 159.206 149.959 167.907 148.286C175.153 146.891 179.183 134.457 174.371 128.34C171.793 125.061 166.856 124.807 163.103 127.759Z" fill="white"/>
5
+ <path d="M246.479 127.64C245.01 130.385 245.217 132.608 247.382 137.378C252.078 147.72 261.885 145.902 259.852 135.066C258.469 127.693 249.204 122.549 246.479 127.64Z" fill="white"/>
6
+ </svg>
@@ -0,0 +1,57 @@
1
+ /* GitHub-style editor customizations */
2
+ .editor-container {
3
+ @apply relative font-mono text-sm leading-relaxed;
4
+ height: 100%;
5
+ min-height: 600px;
6
+ }
7
+
8
+ .editor-textarea {
9
+ @apply w-full h-full min-h-[600px] p-4 pl-14 bg-background resize-none focus:outline-none;
10
+ line-height: 1.5rem;
11
+ tab-size: 2;
12
+ counter-reset: line;
13
+ }
14
+
15
+ /* Line numbers */
16
+ .editor-line-numbers {
17
+ @apply absolute left-0 top-0 bottom-0 w-10 bg-muted/30 border-r select-none;
18
+ padding: 1rem 0;
19
+ overflow: hidden;
20
+ }
21
+
22
+ .editor-line-numbers-content {
23
+ @apply text-right pr-2 text-muted-foreground/70;
24
+ font-size: 13px;
25
+ line-height: 1.5rem;
26
+ }
27
+
28
+ .editor-line-numbers-content > div {
29
+ height: 1.5rem;
30
+ }
31
+
32
+ .editor-line-numbers-content > div::before {
33
+ content: attr(data-line-number);
34
+ display: block;
35
+ }
36
+
37
+ /* Selection styling */
38
+ .editor-textarea::selection {
39
+ @apply bg-primary/20;
40
+ }
41
+
42
+ .dark .editor-textarea::selection {
43
+ @apply bg-primary/30;
44
+ }
45
+
46
+ /* Scrollbar styling */
47
+ .editor-textarea::-webkit-scrollbar {
48
+ @apply w-2;
49
+ }
50
+
51
+ .editor-textarea::-webkit-scrollbar-track {
52
+ @apply bg-transparent;
53
+ }
54
+
55
+ .editor-textarea::-webkit-scrollbar-thumb {
56
+ @apply bg-muted-foreground/20 rounded-full hover:bg-muted-foreground/30;
57
+ }