doccupine 0.0.98 → 0.0.99
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/dist/index.js +0 -0
- package/dist/templates/components/MDXComponents.d.ts +1 -1
- package/dist/templates/components/MDXComponents.js +3 -1
- package/dist/templates/components/layout/Code.d.ts +1 -1
- package/dist/templates/components/layout/Code.js +228 -3
- package/dist/templates/mdx/code.mdx.d.ts +1 -1
- package/dist/templates/mdx/code.mdx.js +43 -1
- package/dist/templates/package.js +1 -1
- package/package.json +1 -1
- package/dist/index.test.d.ts +0 -1
- package/dist/index.test.js +0 -48
- package/dist/metadata.d.ts +0 -11
- package/dist/metadata.js +0 -52
- package/dist/templates/accordion.mdx.d.ts +0 -1
- package/dist/templates/accordion.mdx.js +0 -41
- package/dist/templates/api/theme/routes.d.ts +0 -1
- package/dist/templates/api/theme/routes.js +0 -28
- package/dist/templates/app/api/theme/routes.d.ts +0 -1
- package/dist/templates/app/api/theme/routes.js +0 -29
- package/dist/templates/app/error.d.ts +0 -1
- package/dist/templates/app/error.js +0 -45
- package/dist/templates/app/layout.d.ts +0 -34
- package/dist/templates/app/layout.js +0 -184
- package/dist/templates/callouts.mdx.d.ts +0 -1
- package/dist/templates/callouts.mdx.js +0 -57
- package/dist/templates/cards.mdx.d.ts +0 -1
- package/dist/templates/cards.mdx.js +0 -25
- package/dist/templates/click-outside.d.ts +0 -1
- package/dist/templates/click-outside.js +0 -28
- package/dist/templates/code.d.ts +0 -1
- package/dist/templates/code.js +0 -202
- package/dist/templates/code.mdx.d.ts +0 -1
- package/dist/templates/code.mdx.js +0 -46
- package/dist/templates/commands.mdx.d.ts +0 -1
- package/dist/templates/commands.mdx.js +0 -48
- package/dist/templates/components/ClickOutside.d.ts +0 -1
- package/dist/templates/components/ClickOutside.js +0 -29
- package/dist/templates/components/layout/ClientThemeProvider.d.ts +0 -1
- package/dist/templates/components/layout/ClientThemeProvider.js +0 -85
- package/dist/templates/components/layout/CopyButton.d.ts +0 -1
- package/dist/templates/components/layout/CopyButton.js +0 -85
- package/dist/templates/components/layout/RenderMarkdown.d.ts +0 -1
- package/dist/templates/components/layout/RenderMarkdown.js +0 -61
- package/dist/templates/components/layout/Stepts.d.ts +0 -1
- package/dist/templates/components/layout/Stepts.js +0 -114
- package/dist/templates/components/layout/ThemeToggle.d.ts +0 -1
- package/dist/templates/components/layout/ThemeToggle.js +0 -107
- package/dist/templates/constants.d.ts +0 -5
- package/dist/templates/constants.js +0 -5
- package/dist/templates/docs-components.d.ts +0 -1
- package/dist/templates/docs-components.js +0 -441
- package/dist/templates/docs.d.ts +0 -1
- package/dist/templates/docs.js +0 -48
- package/dist/templates/fields.mdx.d.ts +0 -1
- package/dist/templates/fields.mdx.js +0 -42
- package/dist/templates/footer.d.ts +0 -1
- package/dist/templates/footer.js +0 -9
- package/dist/templates/header.d.ts +0 -1
- package/dist/templates/header.js +0 -275
- package/dist/templates/home.d.ts +0 -1
- package/dist/templates/home.js +0 -74
- package/dist/templates/home.mdx.d.ts +0 -1
- package/dist/templates/home.mdx.js +0 -44
- package/dist/templates/homemdx.d.ts +0 -1
- package/dist/templates/homemdx.js +0 -59
- package/dist/templates/icon.d.ts +0 -1
- package/dist/templates/icon.js +0 -20
- package/dist/templates/icons.mdx.d.ts +0 -1
- package/dist/templates/icons.mdx.js +0 -44
- package/dist/templates/image-embeds.mdx.d.ts +0 -1
- package/dist/templates/image-embeds.mdx.js +0 -103
- package/dist/templates/layout.d.ts +0 -1
- package/dist/templates/layout.js +0 -69
- package/dist/templates/list-table.mdx.d.ts +0 -1
- package/dist/templates/list-table.mdx.js +0 -85
- package/dist/templates/mdx/config.mdx.d.ts +0 -1
- package/dist/templates/mdx/config.mdx.js +0 -47
- package/dist/templates/mdx/deployment.mdx.d.ts +0 -1
- package/dist/templates/mdx/deployment.mdx.js +0 -61
- package/dist/templates/mdx/image-embeds.mdx.d.ts +0 -1
- package/dist/templates/mdx/image-embeds.mdx.js +0 -95
- package/dist/templates/mdx/links.mdx.d.ts +0 -1
- package/dist/templates/mdx/links.mdx.js +0 -45
- package/dist/templates/mdx/list-and-tables.mdx.d.ts +0 -1
- package/dist/templates/mdx/list-and-tables.mdx.js +0 -78
- package/dist/templates/mdx/list-table.mdx.d.ts +0 -1
- package/dist/templates/mdx/list-table.mdx.js +0 -78
- package/dist/templates/mdx/platform/deployments.mdx.d.ts +0 -1
- package/dist/templates/mdx/platform/deployments.mdx.js +0 -36
- package/dist/templates/mdx/platform/sections-settings.mdx.d.ts +0 -1
- package/dist/templates/mdx/platform/sections-settings.mdx.js +0 -46
- package/dist/templates/mdx/stepts.mdx.d.ts +0 -1
- package/dist/templates/mdx/stepts.mdx.js +0 -60
- package/dist/templates/mdx/text.mdx.d.ts +0 -1
- package/dist/templates/mdx/text.mdx.js +0 -139
- package/dist/templates/middleware.d.ts +0 -1
- package/dist/templates/middleware.js +0 -28
- package/dist/templates/not-found.d.ts +0 -1
- package/dist/templates/not-found.js +0 -22
- package/dist/templates/pictograms.d.ts +0 -1
- package/dist/templates/pictograms.js +0 -67
- package/dist/templates/shared-styles.d.ts +0 -1
- package/dist/templates/shared-styles.js +0 -792
- package/dist/templates/structures.d.ts +0 -2
- package/dist/templates/structures.js +0 -208
- package/dist/templates/tabs.mdx.d.ts +0 -1
- package/dist/templates/tabs.mdx.js +0 -59
- package/dist/templates/text.mdx.d.ts +0 -1
- package/dist/templates/text.mdx.js +0 -142
- package/dist/templates/theme-toggle.d.ts +0 -1
- package/dist/templates/theme-toggle.js +0 -111
- package/dist/templates/theme.d.ts +0 -1
- package/dist/templates/theme.js +0 -307
- package/dist/templates/typography.d.ts +0 -1
- package/dist/templates/typography.js +0 -52
- package/dist/templates/update.mdx.d.ts +0 -1
- package/dist/templates/update.mdx.js +0 -58
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export const codeMdxTemplate = `---
|
|
2
|
-
title: "Code"
|
|
3
|
-
description: "Doccupine CLI commands"
|
|
4
|
-
date: "2025-01-15"
|
|
5
|
-
category: "Components"
|
|
6
|
-
categoryOrder: 1
|
|
7
|
-
order: 3
|
|
8
|
-
---
|
|
9
|
-
# Code
|
|
10
|
-
Learn how to display inline code and code blocks in documentation.
|
|
11
|
-
|
|
12
|
-
## Adding Code Samples
|
|
13
|
-
Both inline code snippets and full code blocks are supported. Code blocks offer customization for syntax highlighting and more to improve readability and user experience.
|
|
14
|
-
|
|
15
|
-
### Inline Code
|
|
16
|
-
Highlight code within text by wrapping it with backticks:
|
|
17
|
-
|
|
18
|
-
\`\`\`text
|
|
19
|
-
Enclose any \`word\` or \`phrase\` in backticks to format it as code.
|
|
20
|
-
\`\`\`
|
|
21
|
-
|
|
22
|
-
Enclose any \`word\` or \`phrase\` in backticks to format it as code.
|
|
23
|
-
|
|
24
|
-
## Code Blocks
|
|
25
|
-
To present larger code samples, use triple backticks for fenced code blocks. Each block can be copied, and—if assistant features are enabled—users can request explanations.
|
|
26
|
-
|
|
27
|
-
You may specify the language for highlighting:
|
|
28
|
-
|
|
29
|
-
~~~text
|
|
30
|
-
\`\`\`java
|
|
31
|
-
class HelloWorld {
|
|
32
|
-
public static void main(String[] args) {
|
|
33
|
-
System.out.println("Hello, World!");
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
\`\`\`
|
|
37
|
-
~~~
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
\`\`\`java
|
|
41
|
-
class HelloWorld {
|
|
42
|
-
public static void main(String[] args) {
|
|
43
|
-
System.out.println("Hello, World!");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
\`\`\``;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const commandsMdxTemplate = "---\ntitle: \"Commands\"\ndescription: \"Doccupine CLI commands\"\ndate: \"2025-01-15\"\ncategory: \"General\"\ncategoryOrder: 0\norder: 1\n---\n# Commands\n\nIn this page, you can find all the commands available in Doccupine CLI.\n\n## Run Doccupine CLI\n\nCreate a new directory for your project and navigate to it in your terminal. Run the following command to create a new Doccupine project:\n\n~~~bash\nnpx doccupine\n~~~\n\nOnce you run the command, Doccupine will ask you to select a directory to store your MDX files. Choose the directory where you want to create your documentation files.\nAfter selecting the directory, Doccupine will ask you to enter the name of the directory for the generated website. Enter the name of the directory where you want to create your website.\n\nThis will start the development server on port 3000. Open your browser and navigate to http://localhost:3000 to view your documentation.\n\n## Generate the website\n\n~~~bash\nnpx doccupine build\n~~~\n\nThis will generate the build files for your documentation website without starting the development server. You can then deploy the generated files to a hosting service of your choice.\n\n## Show current configuration\n\n~~~bash\nnpx doccupine config --show\n~~~\n\nThis will show the current configuration for Doccupine.\n\n## Reset configuration\n\n~~~bash\nnpx doccupine config --reset\n~~~\n \nThis will reset the current configuration for Doccupine.";
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export const commandsMdxTemplate = `---
|
|
2
|
-
title: "Commands"
|
|
3
|
-
description: "Doccupine CLI commands"
|
|
4
|
-
date: "2025-01-15"
|
|
5
|
-
category: "General"
|
|
6
|
-
categoryOrder: 0
|
|
7
|
-
order: 1
|
|
8
|
-
---
|
|
9
|
-
# Commands
|
|
10
|
-
|
|
11
|
-
In this page, you can find all the commands available in Doccupine CLI.
|
|
12
|
-
|
|
13
|
-
## Run Doccupine CLI
|
|
14
|
-
|
|
15
|
-
Create a new directory for your project and navigate to it in your terminal. Run the following command to create a new Doccupine project:
|
|
16
|
-
|
|
17
|
-
~~~bash
|
|
18
|
-
npx doccupine
|
|
19
|
-
~~~
|
|
20
|
-
|
|
21
|
-
Once you run the command, Doccupine will ask you to select a directory to store your MDX files. Choose the directory where you want to create your documentation files.
|
|
22
|
-
After selecting the directory, Doccupine will ask you to enter the name of the directory for the generated website. Enter the name of the directory where you want to create your website.
|
|
23
|
-
|
|
24
|
-
This will start the development server on port 3000. Open your browser and navigate to http://localhost:3000 to view your documentation.
|
|
25
|
-
|
|
26
|
-
## Generate the website
|
|
27
|
-
|
|
28
|
-
~~~bash
|
|
29
|
-
npx doccupine build
|
|
30
|
-
~~~
|
|
31
|
-
|
|
32
|
-
This will generate the build files for your documentation website without starting the development server. You can then deploy the generated files to a hosting service of your choice.
|
|
33
|
-
|
|
34
|
-
## Show current configuration
|
|
35
|
-
|
|
36
|
-
~~~bash
|
|
37
|
-
npx doccupine config --show
|
|
38
|
-
~~~
|
|
39
|
-
|
|
40
|
-
This will show the current configuration for Doccupine.
|
|
41
|
-
|
|
42
|
-
## Reset configuration
|
|
43
|
-
|
|
44
|
-
~~~bash
|
|
45
|
-
npx doccupine config --reset
|
|
46
|
-
~~~
|
|
47
|
-
|
|
48
|
-
This will reset the current configuration for Doccupine.`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const clickOutsideTemplate = "import { RefObject, useCallback, useEffect } from \"react\";\n\nexport function useOnClickOutside(\n refs: RefObject<HTMLElement | null>[],\n cb: () => void,\n) {\n // Stable callback ref to avoid re-subscribing on every render\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (\n refs.every(\n (ref) => !ref.current || !ref.current.contains(event.target as Node),\n )\n ) {\n cb();\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [...refs, cb],\n );\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [handleClickOutside]);\n}\n";
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const clickOutsideTemplate = `import { RefObject, useCallback, useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
export function useOnClickOutside(
|
|
4
|
-
refs: RefObject<HTMLElement | null>[],
|
|
5
|
-
cb: () => void,
|
|
6
|
-
) {
|
|
7
|
-
// Stable callback ref to avoid re-subscribing on every render
|
|
8
|
-
const handleClickOutside = useCallback(
|
|
9
|
-
(event: MouseEvent) => {
|
|
10
|
-
if (
|
|
11
|
-
refs.every(
|
|
12
|
-
(ref) => !ref.current || !ref.current.contains(event.target as Node),
|
|
13
|
-
)
|
|
14
|
-
) {
|
|
15
|
-
cb();
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
-
[...refs, cb],
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
24
|
-
return () => {
|
|
25
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
26
|
-
};
|
|
27
|
-
}, [handleClickOutside]);
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const clientThemeProviderTemplate = "\"use client\";\nimport React, { useCallback, useContext, useEffect, useState } from \"react\";\nimport { ThemeProvider as StyledThemeProvider } from \"styled-components\";\nimport { Theme } from \"@/app/theme\";\nimport { GlobalStyles } from \"@/components/layout/GlobalStyles\";\n\ntype ThemeMode = \"light\" | \"dark\";\n\ntype ThemeContextValue = {\n /** The styled-components theme object \u2014 same reference in both modes;\n the values it points to are CSS variables that flip per active class. */\n theme: Theme;\n /** Active mode, derived from the \"dark\" class on <html>. */\n mode: ThemeMode;\n /** Update the active mode: flips the class and persists the cookie. */\n setMode: (m: ThemeMode) => void;\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | null>(null);\n\nfunction useThemeOverride() {\n const ctx = useContext(ThemeContext);\n if (!ctx) {\n throw new Error(\"useThemeOverride must be used within ClientThemeProvider\");\n }\n return ctx;\n}\n\nfunction readMode(): ThemeMode {\n if (typeof document === \"undefined\") return \"light\";\n return document.documentElement.classList.contains(\"dark\") ? \"dark\" : \"light\";\n}\n\nfunction ClientThemeProvider({\n children,\n theme,\n}: {\n children: React.ReactNode;\n theme: Theme;\n}) {\n // Mode lives in React state so consumers (e.g. ThemeToggle) re-render when\n // the user toggles. The visual swap itself is driven entirely by the\n // \"dark\" class on <html> + CSS variables \u2014 React doesn't drive paint.\n // The lazy initializer reads the class set by the theme-init blocking\n // script (SSR returns \"light\"); no rendered markup branches on mode, so\n // reading the DOM during the hydration render can't cause a mismatch.\n const [mode, setModeState] = useState<ThemeMode>(readMode);\n\n useEffect(() => {\n // Backfill the cookie if the theme-init script didn't get to write one\n // (rare \u2014 e.g. cookies disabled at first paint).\n try {\n const has = document.cookie\n .split(\";\")\n .some((c) => c.trim().startsWith(\"theme=\"));\n if (!has) {\n const m = readMode();\n document.cookie = `theme=${m};path=/;max-age=31536000;SameSite=Lax`;\n }\n } catch {}\n }, []);\n\n const setMode = useCallback((next: ThemeMode) => {\n if (typeof document !== \"undefined\") {\n document.documentElement.classList.toggle(\"dark\", next === \"dark\");\n document.documentElement.style.colorScheme = next;\n try {\n document.cookie = `theme=${next};path=/;max-age=31536000;SameSite=Lax`;\n } catch {}\n }\n setModeState(next);\n }, []);\n\n return (\n <ThemeContext.Provider value={{ theme, mode, setMode }}>\n <StyledThemeProvider theme={theme}>\n <GlobalStyles />\n {children}\n </StyledThemeProvider>\n </ThemeContext.Provider>\n );\n}\n\nexport { ClientThemeProvider, useThemeOverride };\n";
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
export const clientThemeProviderTemplate = `"use client";
|
|
2
|
-
import React, { useCallback, useContext, useEffect, useState } from "react";
|
|
3
|
-
import { ThemeProvider as StyledThemeProvider } from "styled-components";
|
|
4
|
-
import { Theme } from "@/app/theme";
|
|
5
|
-
import { GlobalStyles } from "@/components/layout/GlobalStyles";
|
|
6
|
-
|
|
7
|
-
type ThemeMode = "light" | "dark";
|
|
8
|
-
|
|
9
|
-
type ThemeContextValue = {
|
|
10
|
-
/** The styled-components theme object — same reference in both modes;
|
|
11
|
-
the values it points to are CSS variables that flip per active class. */
|
|
12
|
-
theme: Theme;
|
|
13
|
-
/** Active mode, derived from the "dark" class on <html>. */
|
|
14
|
-
mode: ThemeMode;
|
|
15
|
-
/** Update the active mode: flips the class and persists the cookie. */
|
|
16
|
-
setMode: (m: ThemeMode) => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const ThemeContext = React.createContext<ThemeContextValue | null>(null);
|
|
20
|
-
|
|
21
|
-
function useThemeOverride() {
|
|
22
|
-
const ctx = useContext(ThemeContext);
|
|
23
|
-
if (!ctx) {
|
|
24
|
-
throw new Error("useThemeOverride must be used within ClientThemeProvider");
|
|
25
|
-
}
|
|
26
|
-
return ctx;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function readMode(): ThemeMode {
|
|
30
|
-
if (typeof document === "undefined") return "light";
|
|
31
|
-
return document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function ClientThemeProvider({
|
|
35
|
-
children,
|
|
36
|
-
theme,
|
|
37
|
-
}: {
|
|
38
|
-
children: React.ReactNode;
|
|
39
|
-
theme: Theme;
|
|
40
|
-
}) {
|
|
41
|
-
// Mode lives in React state so consumers (e.g. ThemeToggle) re-render when
|
|
42
|
-
// the user toggles. The visual swap itself is driven entirely by the
|
|
43
|
-
// "dark" class on <html> + CSS variables — React doesn't drive paint.
|
|
44
|
-
// The lazy initializer reads the class set by the theme-init blocking
|
|
45
|
-
// script (SSR returns "light"); no rendered markup branches on mode, so
|
|
46
|
-
// reading the DOM during the hydration render can't cause a mismatch.
|
|
47
|
-
const [mode, setModeState] = useState<ThemeMode>(readMode);
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
// Backfill the cookie if the theme-init script didn't get to write one
|
|
51
|
-
// (rare — e.g. cookies disabled at first paint).
|
|
52
|
-
try {
|
|
53
|
-
const has = document.cookie
|
|
54
|
-
.split(";")
|
|
55
|
-
.some((c) => c.trim().startsWith("theme="));
|
|
56
|
-
if (!has) {
|
|
57
|
-
const m = readMode();
|
|
58
|
-
document.cookie = \`theme=\${m};path=/;max-age=31536000;SameSite=Lax\`;
|
|
59
|
-
}
|
|
60
|
-
} catch {}
|
|
61
|
-
}, []);
|
|
62
|
-
|
|
63
|
-
const setMode = useCallback((next: ThemeMode) => {
|
|
64
|
-
if (typeof document !== "undefined") {
|
|
65
|
-
document.documentElement.classList.toggle("dark", next === "dark");
|
|
66
|
-
document.documentElement.style.colorScheme = next;
|
|
67
|
-
try {
|
|
68
|
-
document.cookie = \`theme=\${next};path=/;max-age=31536000;SameSite=Lax\`;
|
|
69
|
-
} catch {}
|
|
70
|
-
}
|
|
71
|
-
setModeState(next);
|
|
72
|
-
}, []);
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<ThemeContext.Provider value={{ theme, mode, setMode }}>
|
|
76
|
-
<StyledThemeProvider theme={theme}>
|
|
77
|
-
<GlobalStyles />
|
|
78
|
-
{children}
|
|
79
|
-
</StyledThemeProvider>
|
|
80
|
-
</ThemeContext.Provider>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export { ClientThemeProvider, useThemeOverride };
|
|
85
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const copyButtonTemplate = "\"use client\";\nimport { useState } from \"react\";\nimport styled from \"styled-components\";\nimport { Icon } from \"@/components/layout/Icon\";\nimport { mq, Theme } from \"@/app/theme\";\n\ninterface CopyButtonProps {\n content: string;\n}\n\nconst StyledCopyWrapper = styled.div`\n position: relative;\n padding-top: 70px;\n\n ${mq(\"lg\")} {\n padding-top: 80px;\n }\n`;\n\nconst StyledCopyButton = styled.button<{ theme: Theme; $copied: boolean }>`\n background: transparent;\n border: solid 1px\n ${({ theme, $copied }) =>\n $copied ? theme.colors.success : theme.colors.grayLight};\n color: ${({ theme, $copied }) =>\n $copied ? theme.colors.success : theme.colors.primary};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n padding: 4px 8px;\n font-size: 12px;\n font-family: ${({ theme }) => theme.fonts.mono};\n cursor: pointer;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 4px;\n margin-right: -6px;\n\n & svg.lucide {\n color: ${({ theme, $copied }) =>\n $copied ? theme.colors.success : theme.colors.primary};\n }\n\n &:hover {\n border-color: ${({ theme, $copied }) =>\n $copied ? theme.colors.success : theme.colors.primary};\n }\n\n &:active {\n transform: scale(0.95);\n }\n`;\n\nfunction CopyButton({ content }: CopyButtonProps) {\n const [copied, setCopied] = useState(false);\n\n const handleCopyContent = async () => {\n try {\n await navigator.clipboard.writeText(content);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch (err) {\n console.error(\"Failed to copy:\", err);\n }\n };\n\n return (\n <StyledCopyWrapper>\n <StyledCopyButton onClick={handleCopyContent} $copied={copied}>\n {copied ? (\n <>\n <Icon name=\"check\" size={12} />\n <span>Copied!</span>\n </>\n ) : (\n <>\n <Icon name=\"copy\" size={12} />\n <span>Copy Content</span>\n </>\n )}\n </StyledCopyButton>\n </StyledCopyWrapper>\n );\n}\n\nexport { CopyButton };";
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
export const copyButtonTemplate = `"use client";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import styled from "styled-components";
|
|
4
|
-
import { Icon } from "@/components/layout/Icon";
|
|
5
|
-
import { mq, Theme } from "@/app/theme";
|
|
6
|
-
|
|
7
|
-
interface CopyButtonProps {
|
|
8
|
-
content: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const StyledCopyWrapper = styled.div\`
|
|
12
|
-
position: relative;
|
|
13
|
-
padding-top: 70px;
|
|
14
|
-
|
|
15
|
-
\${mq("lg")} {
|
|
16
|
-
padding-top: 80px;
|
|
17
|
-
}
|
|
18
|
-
\`;
|
|
19
|
-
|
|
20
|
-
const StyledCopyButton = styled.button<{ theme: Theme; $copied: boolean }>\`
|
|
21
|
-
background: transparent;
|
|
22
|
-
border: solid 1px
|
|
23
|
-
\${({ theme, $copied }) =>
|
|
24
|
-
$copied ? theme.colors.success : theme.colors.grayLight};
|
|
25
|
-
color: \${({ theme, $copied }) =>
|
|
26
|
-
$copied ? theme.colors.success : theme.colors.primary};
|
|
27
|
-
border-radius: \${({ theme }) => theme.spacing.radius.xs};
|
|
28
|
-
padding: 4px 8px;
|
|
29
|
-
font-size: 12px;
|
|
30
|
-
font-family: \${({ theme }) => theme.fonts.mono};
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
transition: all 0.2s ease;
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
gap: 4px;
|
|
36
|
-
margin-right: -6px;
|
|
37
|
-
|
|
38
|
-
& svg.lucide {
|
|
39
|
-
color: \${({ theme, $copied }) =>
|
|
40
|
-
$copied ? theme.colors.success : theme.colors.primary};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&:hover {
|
|
44
|
-
border-color: \${({ theme, $copied }) =>
|
|
45
|
-
$copied ? theme.colors.success : theme.colors.primary};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&:active {
|
|
49
|
-
transform: scale(0.95);
|
|
50
|
-
}
|
|
51
|
-
\`;
|
|
52
|
-
|
|
53
|
-
function CopyButton({ content }: CopyButtonProps) {
|
|
54
|
-
const [copied, setCopied] = useState(false);
|
|
55
|
-
|
|
56
|
-
const handleCopyContent = async () => {
|
|
57
|
-
try {
|
|
58
|
-
await navigator.clipboard.writeText(content);
|
|
59
|
-
setCopied(true);
|
|
60
|
-
setTimeout(() => setCopied(false), 2000);
|
|
61
|
-
} catch (err) {
|
|
62
|
-
console.error("Failed to copy:", err);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<StyledCopyWrapper>
|
|
68
|
-
<StyledCopyButton onClick={handleCopyContent} $copied={copied}>
|
|
69
|
-
{copied ? (
|
|
70
|
-
<>
|
|
71
|
-
<Icon name="check" size={12} />
|
|
72
|
-
<span>Copied!</span>
|
|
73
|
-
</>
|
|
74
|
-
) : (
|
|
75
|
-
<>
|
|
76
|
-
<Icon name="copy" size={12} />
|
|
77
|
-
<span>Copy Content</span>
|
|
78
|
-
</>
|
|
79
|
-
)}
|
|
80
|
-
</StyledCopyButton>
|
|
81
|
-
</StyledCopyWrapper>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export { CopyButton };`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const renderMarkdownTemplate = "import React from \"react\";\nimport { StyledMarkdownContainer } from \"@/components/layout/DocsComponents\";\nimport { MDXRemote } from \"next-mdx-remote/rsc\";\nimport remarkGfm from \"remark-gfm\";\nimport { useMDXComponents } from \"@/components/MDXComponents\";\n\nfunction extractAllTextFromChildren(children: React.ReactNode): string {\n if (children == null) return \"\";\n\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (typeof children === \"boolean\") return \"\";\n\n if (Array.isArray(children)) {\n return children.map(extractAllTextFromChildren).join(\"\");\n }\n\n if (React.isValidElement(children)) {\n const element = children as React.ReactElement<any>;\n return extractAllTextFromChildren(element.props.children);\n }\n\n return \"\";\n}\n\nfunction normalizeMarkdownSpacing(input: string): string {\n return (\n input\n // Ensure a blank line before headings\n .replace(/([^\\n])(#[\\s]+)/g, '$1\\n\\n$2')\n\n // Ensure a blank line before fenced code blocks\n .replace(/([^\\n])(~~~|```)/g, '$1\\n\\n$2')\n\n // Ensure a blank line before images/links if they start a line\n .replace(/([^\\n])(!\\[)/g, '$1\\n\\n$2')\n );\n}\n\nfunction RenderMarkdown({ children }: { children: React.ReactNode }) {\n const childrenAsString = extractAllTextFromChildren(children);\n const normalizedChildren = normalizeMarkdownSpacing(childrenAsString);\n const components = useMDXComponents({});\n\n return (\n <StyledMarkdownContainer>\n <MDXRemote\n source={normalizedChildren}\n options={{\n mdxOptions: {\n remarkPlugins: [remarkGfm],\n },\n }}\n components={components}\n />\n </StyledMarkdownContainer>\n );\n}\n\nexport { RenderMarkdown };\n";
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export const renderMarkdownTemplate = `import React from "react";
|
|
2
|
-
import { StyledMarkdownContainer } from "@/components/layout/DocsComponents";
|
|
3
|
-
import { MDXRemote } from "next-mdx-remote/rsc";
|
|
4
|
-
import remarkGfm from "remark-gfm";
|
|
5
|
-
import { useMDXComponents } from "@/components/MDXComponents";
|
|
6
|
-
|
|
7
|
-
function extractAllTextFromChildren(children: React.ReactNode): string {
|
|
8
|
-
if (children == null) return "";
|
|
9
|
-
|
|
10
|
-
if (typeof children === "string") return children;
|
|
11
|
-
if (typeof children === "number") return String(children);
|
|
12
|
-
if (typeof children === "boolean") return "";
|
|
13
|
-
|
|
14
|
-
if (Array.isArray(children)) {
|
|
15
|
-
return children.map(extractAllTextFromChildren).join("");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (React.isValidElement(children)) {
|
|
19
|
-
const element = children as React.ReactElement<any>;
|
|
20
|
-
return extractAllTextFromChildren(element.props.children);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return "";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function normalizeMarkdownSpacing(input: string): string {
|
|
27
|
-
return (
|
|
28
|
-
input
|
|
29
|
-
// Ensure a blank line before headings
|
|
30
|
-
.replace(/([^\\n])(#[\\s]+)/g, '$1\\n\\n$2')
|
|
31
|
-
|
|
32
|
-
// Ensure a blank line before fenced code blocks
|
|
33
|
-
.replace(/([^\\n])(~~~|\`\`\`)/g, '$1\\n\\n$2')
|
|
34
|
-
|
|
35
|
-
// Ensure a blank line before images/links if they start a line
|
|
36
|
-
.replace(/([^\\n])(!\\[)/g, '$1\\n\\n$2')
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function RenderMarkdown({ children }: { children: React.ReactNode }) {
|
|
41
|
-
const childrenAsString = extractAllTextFromChildren(children);
|
|
42
|
-
const normalizedChildren = normalizeMarkdownSpacing(childrenAsString);
|
|
43
|
-
const components = useMDXComponents({});
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<StyledMarkdownContainer>
|
|
47
|
-
<MDXRemote
|
|
48
|
-
source={normalizedChildren}
|
|
49
|
-
options={{
|
|
50
|
-
mdxOptions: {
|
|
51
|
-
remarkPlugins: [remarkGfm],
|
|
52
|
-
},
|
|
53
|
-
}}
|
|
54
|
-
components={components}
|
|
55
|
-
/>
|
|
56
|
-
</StyledMarkdownContainer>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { RenderMarkdown };
|
|
61
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const stepsTemplate = "\"use client\";\nimport React from \"react\";\nimport styled, { useTheme } from \"styled-components\";\nimport { styledText, Theme } from \"cherry-styled-components/src/lib\";\nimport { rgba } from \"polished\";\nimport { Icon, IconProps } from \"@/components/layout/Icon\";\n\nconst StyledStepsContainer = styled.div<{ theme: Theme }>`\n position: relative;\n width: 100%;\n`;\n\nconst StyledStep = styled.div<{ theme: Theme }>`\n background: ${({ theme }) => theme.colors.light};\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n padding: 0 0 20px 52px;\n margin: 0;\n position: relative;\n ${({ theme }) => styledText(theme)}\n color: ${({ theme }) => theme.colors.grayDark};\n\n &::after {\n content: \"\";\n position: absolute;\n left: 16px;\n top: 0;\n width: 1px;\n height: 100%;\n background: ${({ theme }) => theme.colors.primary};\n background: linear-gradient(\n 180deg,\n ${({ theme }) => theme.colors.primary},\n ${({ theme }) => rgba(theme.colors.primary, 0)}\n );\n border-radius: 4px;\n }\n`;\n\nconst StepNumber = styled.div<{ theme: Theme }>`\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background: ${({ theme }) => theme.colors.primary};\n color: ${({ theme }) => theme.colors.light};\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 700;\n margin-bottom: 12px;\n ${({ theme }) => styledText(theme)};\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1;\n`;\n\nconst StyledStepTitle = styled.h3<{ theme: Theme }>`\n margin: 0 0 10px 0;\n padding: 2px 0 0 0;\n color: ${({ theme }) => theme.colors.dark};\n ${({ theme }) => styledText(theme)};\n`;\n\nconst StepContent = styled.div<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.grayDark};\n ${({ theme }) => styledText(theme)};\n\n & > .code-wrapper {\n margin: 10px 0;\n }\n`;\n\ninterface StepProps extends React.HTMLAttributes<HTMLDivElement> {\n title: string;\n children: React.ReactNode;\n icon?: IconProps;\n}\n\nfunction Step({ title, children, icon, ...props }: StepProps) {\n return null;\n}\n\ninterface StepsProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode;\n}\n\nfunction Steps({ children, ...props }: StepsProps) {\n const theme = useTheme() as Theme;\n\n const steps = React.Children.toArray(children).filter(\n (child): child is React.ReactElement<StepProps> =>\n React.isValidElement(child),\n );\n\n return (\n <StyledStepsContainer theme={theme}>\n {steps.map((step, index) => {\n const { title, children: stepContent, icon } = step.props;\n\n return (\n <StyledStep key={index} theme={theme}>\n <StepNumber theme={theme}>{index + 1}</StepNumber>\n {icon && <Icon name={icon} color={theme.colors.primary} />}\n <StyledStepTitle theme={theme}>{title}</StyledStepTitle>\n <StepContent theme={theme}>{stepContent}</StepContent>\n </StyledStep>\n );\n })}\n </StyledStepsContainer>\n );\n}\n\nexport { Steps, Step };\n";
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
export const stepsTemplate = `"use client";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import styled, { useTheme } from "styled-components";
|
|
4
|
-
import { styledText, Theme } from "cherry-styled-components/src/lib";
|
|
5
|
-
import { rgba } from "polished";
|
|
6
|
-
import { Icon, IconProps } from "@/components/layout/Icon";
|
|
7
|
-
|
|
8
|
-
const StyledStepsContainer = styled.div<{ theme: Theme }>\`
|
|
9
|
-
position: relative;
|
|
10
|
-
width: 100%;
|
|
11
|
-
\`;
|
|
12
|
-
|
|
13
|
-
const StyledStep = styled.div<{ theme: Theme }>\`
|
|
14
|
-
background: \${({ theme }) => theme.colors.light};
|
|
15
|
-
border-radius: \${({ theme }) => theme.spacing.radius.lg};
|
|
16
|
-
padding: 0 0 20px 52px;
|
|
17
|
-
margin: 0;
|
|
18
|
-
position: relative;
|
|
19
|
-
\${({ theme }) => styledText(theme)}
|
|
20
|
-
color: \${({ theme }) => theme.colors.grayDark};
|
|
21
|
-
|
|
22
|
-
&::after {
|
|
23
|
-
content: "";
|
|
24
|
-
position: absolute;
|
|
25
|
-
left: 16px;
|
|
26
|
-
top: 0;
|
|
27
|
-
width: 1px;
|
|
28
|
-
height: 100%;
|
|
29
|
-
background: \${({ theme }) => theme.colors.primary};
|
|
30
|
-
background: linear-gradient(
|
|
31
|
-
180deg,
|
|
32
|
-
\${({ theme }) => theme.colors.primary},
|
|
33
|
-
\${({ theme }) => rgba(theme.colors.primary, 0)}
|
|
34
|
-
);
|
|
35
|
-
border-radius: 4px;
|
|
36
|
-
}
|
|
37
|
-
\`;
|
|
38
|
-
|
|
39
|
-
const StepNumber = styled.div<{ theme: Theme }>\`
|
|
40
|
-
width: 32px;
|
|
41
|
-
height: 32px;
|
|
42
|
-
border-radius: 50%;
|
|
43
|
-
background: \${({ theme }) => theme.colors.primary};
|
|
44
|
-
color: \${({ theme }) => theme.colors.light};
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
font-weight: 700;
|
|
49
|
-
margin-bottom: 12px;
|
|
50
|
-
\${({ theme }) => styledText(theme)};
|
|
51
|
-
position: absolute;
|
|
52
|
-
left: 0;
|
|
53
|
-
top: 0;
|
|
54
|
-
z-index: 1;
|
|
55
|
-
\`;
|
|
56
|
-
|
|
57
|
-
const StyledStepTitle = styled.h3<{ theme: Theme }>\`
|
|
58
|
-
margin: 0 0 10px 0;
|
|
59
|
-
padding: 2px 0 0 0;
|
|
60
|
-
color: \${({ theme }) => theme.colors.dark};
|
|
61
|
-
\${({ theme }) => styledText(theme)};
|
|
62
|
-
\`;
|
|
63
|
-
|
|
64
|
-
const StepContent = styled.div<{ theme: Theme }>\`
|
|
65
|
-
color: \${({ theme }) => theme.colors.grayDark};
|
|
66
|
-
\${({ theme }) => styledText(theme)};
|
|
67
|
-
|
|
68
|
-
& > .code-wrapper {
|
|
69
|
-
margin: 10px 0;
|
|
70
|
-
}
|
|
71
|
-
\`;
|
|
72
|
-
|
|
73
|
-
interface StepProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
74
|
-
title: string;
|
|
75
|
-
children: React.ReactNode;
|
|
76
|
-
icon?: IconProps;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function Step({ title, children, icon, ...props }: StepProps) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface StepsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
84
|
-
children: React.ReactNode;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function Steps({ children, ...props }: StepsProps) {
|
|
88
|
-
const theme = useTheme() as Theme;
|
|
89
|
-
|
|
90
|
-
const steps = React.Children.toArray(children).filter(
|
|
91
|
-
(child): child is React.ReactElement<StepProps> =>
|
|
92
|
-
React.isValidElement(child),
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<StyledStepsContainer theme={theme}>
|
|
97
|
-
{steps.map((step, index) => {
|
|
98
|
-
const { title, children: stepContent, icon } = step.props;
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<StyledStep key={index} theme={theme}>
|
|
102
|
-
<StepNumber theme={theme}>{index + 1}</StepNumber>
|
|
103
|
-
{icon && <Icon name={icon} color={theme.colors.primary} />}
|
|
104
|
-
<StyledStepTitle theme={theme}>{title}</StyledStepTitle>
|
|
105
|
-
<StepContent theme={theme}>{stepContent}</StepContent>
|
|
106
|
-
</StyledStep>
|
|
107
|
-
);
|
|
108
|
-
})}
|
|
109
|
-
</StyledStepsContainer>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export { Steps, Step };
|
|
114
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const themeToggleTemplate = "\"use client\";\nimport { resetButton } from \"cherry-styled-components\";\nimport styled, { css } from \"styled-components\";\nimport { Theme } from \"@/app/theme\";\nimport { Icon } from \"@/components/layout/Icon\";\nimport { useThemeOverride } from \"@/components/layout/ClientThemeProvider\";\n\nconst StyledThemeToggle = styled.button<{ theme: Theme; $hidden?: boolean }>`\n ${resetButton}\n width: 59px;\n height: 32px;\n border-radius: 30px;\n display: flex;\n position: relative;\n margin: auto 0;\n transform: scale(1);\n background: ${({ theme }) => theme.colors.light};\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n\n &::after {\n content: \"\";\n position: absolute;\n top: 3px;\n left: 3px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 20%, transparent)`};\n transition: all 0.3s ease;\n z-index: 1;\n }\n\n /* Knob position depends on the active mode, signaled by the \"dark\" class\n on <html>. Pure CSS \u2014 no JS conditional needed for the visual swap. */\n :root.dark &::after {\n transform: translateX(27px);\n }\n\n ${({ $hidden }) =>\n $hidden &&\n css`\n display: none;\n `}\n\n & svg {\n width: 16px;\n height: 16px;\n object-fit: contain;\n margin: auto;\n transition: all 0.3s ease;\n position: relative;\n z-index: 2;\n }\n\n & .lucide-sun {\n transform: translateX(1px);\n }\n\n & .lucide-moon-star {\n transform: translateX(-1px);\n }\n\n & svg[stroke] {\n stroke: ${({ theme }) => theme.colors.primary};\n }\n\n &:hover {\n transform: scale(1.05);\n color: ${({ theme }) => theme.colors.accent};\n\n & svg[stroke] {\n stroke: ${({ theme }) => theme.colors.accent};\n }\n }\n\n &:active {\n transform: scale(0.97);\n }\n`;\n\nfunction ToggleTheme({ $hidden }: { $hidden?: boolean }) {\n const { mode, setMode } = useThemeOverride();\n\n return (\n <StyledThemeToggle\n onClick={() => setMode(mode === \"dark\" ? \"light\" : \"dark\")}\n $hidden={$hidden}\n aria-label=\"Toggle Theme\"\n >\n <Icon name=\"Sun\" className=\"light\" />\n <Icon name=\"MoonStar\" className=\"dark\" />\n </StyledThemeToggle>\n );\n}\n\nfunction ToggleThemeLoading() {\n return (\n <StyledThemeToggle $hidden aria-label=\"Toggle Theme\">\n <Icon name=\"MoonStar\" className=\"dark\" />\n <Icon name=\"Sun\" className=\"light\" />\n </StyledThemeToggle>\n );\n}\n\nexport { ToggleTheme, ToggleThemeLoading };\n";
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
export const themeToggleTemplate = `"use client";
|
|
2
|
-
import { resetButton } from "cherry-styled-components";
|
|
3
|
-
import styled, { css } from "styled-components";
|
|
4
|
-
import { Theme } from "@/app/theme";
|
|
5
|
-
import { Icon } from "@/components/layout/Icon";
|
|
6
|
-
import { useThemeOverride } from "@/components/layout/ClientThemeProvider";
|
|
7
|
-
|
|
8
|
-
const StyledThemeToggle = styled.button<{ theme: Theme; $hidden?: boolean }>\`
|
|
9
|
-
\${resetButton}
|
|
10
|
-
width: 59px;
|
|
11
|
-
height: 32px;
|
|
12
|
-
border-radius: 30px;
|
|
13
|
-
display: flex;
|
|
14
|
-
position: relative;
|
|
15
|
-
margin: auto 0;
|
|
16
|
-
transform: scale(1);
|
|
17
|
-
background: \${({ theme }) => theme.colors.light};
|
|
18
|
-
border: solid 1px \${({ theme }) => theme.colors.grayLight};
|
|
19
|
-
|
|
20
|
-
&::after {
|
|
21
|
-
content: "";
|
|
22
|
-
position: absolute;
|
|
23
|
-
top: 3px;
|
|
24
|
-
left: 3px;
|
|
25
|
-
width: 24px;
|
|
26
|
-
height: 24px;
|
|
27
|
-
border-radius: 50%;
|
|
28
|
-
background: \${({ theme }) =>
|
|
29
|
-
\`color-mix(in srgb, \${theme.colors.primaryLight} 20%, transparent)\`};
|
|
30
|
-
transition: all 0.3s ease;
|
|
31
|
-
z-index: 1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Knob position depends on the active mode, signaled by the "dark" class
|
|
35
|
-
on <html>. Pure CSS — no JS conditional needed for the visual swap. */
|
|
36
|
-
:root.dark &::after {
|
|
37
|
-
transform: translateX(27px);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
\${({ $hidden }) =>
|
|
41
|
-
$hidden &&
|
|
42
|
-
css\`
|
|
43
|
-
display: none;
|
|
44
|
-
\`}
|
|
45
|
-
|
|
46
|
-
& svg {
|
|
47
|
-
width: 16px;
|
|
48
|
-
height: 16px;
|
|
49
|
-
object-fit: contain;
|
|
50
|
-
margin: auto;
|
|
51
|
-
transition: all 0.3s ease;
|
|
52
|
-
position: relative;
|
|
53
|
-
z-index: 2;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
& .lucide-sun {
|
|
57
|
-
transform: translateX(1px);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
& .lucide-moon-star {
|
|
61
|
-
transform: translateX(-1px);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
& svg[stroke] {
|
|
65
|
-
stroke: \${({ theme }) => theme.colors.primary};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&:hover {
|
|
69
|
-
transform: scale(1.05);
|
|
70
|
-
color: \${({ theme }) => theme.colors.accent};
|
|
71
|
-
|
|
72
|
-
& svg[stroke] {
|
|
73
|
-
stroke: \${({ theme }) => theme.colors.accent};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&:active {
|
|
78
|
-
transform: scale(0.97);
|
|
79
|
-
}
|
|
80
|
-
\`;
|
|
81
|
-
|
|
82
|
-
function ToggleTheme({ $hidden }: { $hidden?: boolean }) {
|
|
83
|
-
const { mode, setMode } = useThemeOverride();
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<StyledThemeToggle
|
|
87
|
-
onClick={() => setMode(mode === "dark" ? "light" : "dark")}
|
|
88
|
-
$hidden={$hidden}
|
|
89
|
-
aria-label="Toggle Theme"
|
|
90
|
-
>
|
|
91
|
-
<Icon name="Sun" className="light" />
|
|
92
|
-
<Icon name="MoonStar" className="dark" />
|
|
93
|
-
</StyledThemeToggle>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function ToggleThemeLoading() {
|
|
98
|
-
return (
|
|
99
|
-
<StyledThemeToggle $hidden aria-label="Toggle Theme">
|
|
100
|
-
<Icon name="MoonStar" className="dark" />
|
|
101
|
-
<Icon name="Sun" className="light" />
|
|
102
|
-
</StyledThemeToggle>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export { ToggleTheme, ToggleThemeLoading };
|
|
107
|
-
`;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_DESCRIPTION = "Doccupine is a free and open-source documentation platform. Write MDX, get a production-ready site with AI chat, built-in components, and an MCP server - in one command.";
|
|
2
|
-
export declare const DEFAULT_SITE_NAME = "Doccupine";
|
|
3
|
-
export declare const DEFAULT_META_DESCRIPTION = "Generated with Doccupine";
|
|
4
|
-
export declare const DEFAULT_FAVICON = "https://docs.doccupine.com/favicon.ico";
|
|
5
|
-
export declare const DEFAULT_OG_IMAGE = "https://docs.doccupine.com/preview.png";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_DESCRIPTION = "Doccupine is a free and open-source documentation platform. Write MDX, get a production-ready site with AI chat, built-in components, and an MCP server - in one command.";
|
|
2
|
-
export const DEFAULT_SITE_NAME = "Doccupine";
|
|
3
|
-
export const DEFAULT_META_DESCRIPTION = "Generated with Doccupine";
|
|
4
|
-
export const DEFAULT_FAVICON = "https://docs.doccupine.com/favicon.ico";
|
|
5
|
-
export const DEFAULT_OG_IMAGE = "https://docs.doccupine.com/preview.png";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const docsComponentsTemplate = "\n\"use client\";\nimport { mq, Theme } from \"@/app/theme\";\nimport {\n resetButton,\n styledStrong,\n styledText,\n} from \"cherry-styled-components/src/lib\";\nimport Link from \"next/link\";\nimport { rgba } from \"polished\";\nimport React from \"react\";\nimport styled, { css } from \"styled-components\";\nimport { interactiveStyles } from \"./SharedStyled\";\n\ninterface DocsProps {\n children: React.ReactNode;\n}\n\nconst StyledDocsWrapper = styled.div<{ theme: Theme }>`\n position: relative;\n`;\n\nconst StyledDocsSidebar = styled.div<{ theme: Theme }>`\n position: sticky;\n top: 90px;\n min-width: 200px;\n float: left;\n z-index: 999;\n\n ${mq(\"lg\")} {\n z-index: 2;\n }\n`;\n\nconst StyledDocsContainer = styled.div<{ theme: Theme }>`\n position: relative;\n padding: 0;\n width: 100%;\n\n ${mq(\"lg\")} {\n padding-left: 230px;\n }\n\n & ul {\n list-style: none;\n padding: 0;\n margin: 0;\n\n & li {\n text-indent: 0;\n display: block;\n position: relative;\n padding: 0 0 0 15px;\n margin: 0;\n ${({ theme }) => styledText(theme)};\n min-height: 23px;\n\n $mq: \"lg\" {\n min-height: 27px;\n }\n\n &::before {\n content: \"\";\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: ${({ theme }) => theme.colors.primary};\n position: absolute;\n top: 8px;\n left: 2px;\n\n ${mq(\"lg\")} {\n top: 10px;\n }\n }\n }\n }\n\n & ol {\n padding: 0;\n margin: 0;\n\n & > li {\n position: relative;\n padding: 0;\n counter-increment: item;\n padding: 0;\n margin: 0;\n ${({ theme }) => styledText(theme)};\n\n &::before {\n content: counter(item) \".\";\n display: inline-block;\n margin: 0 4px 0 0;\n font-weight: 700;\n color: ${({ theme }) => theme.colors.primary};\n min-width: max-content;\n }\n }\n }\n`;\n\nexport const StyledMarkdownContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 20px;\n flex-wrap: wrap;\n flex: 1;\n`;\n\ninterface Props {\n theme?: Theme;\n $isActive?: boolean;\n}\n\nexport const StyledSidebar = styled.nav<Props>`\n position: fixed;\n overflow-y: auto;\n max-height: calc(100svh - 70px);\n width: 100%;\n background: ${({ theme }) => theme.colors.light};\n z-index: 99;\n top: 70px;\n height: 100%;\n padding: 20px 0;\n opacity: 0;\n pointer-events: none;\n transition: all 0.3s ease;\n transform: translateY(30px);\n\n ${mq(\"lg\")} {\n width: 220px;\n left: 20px;\n background: transparent;\n padding: 20px 20px 20px 0;\n opacity: 1;\n pointer-events: all;\n transform: translateY(0);\n }\n\n ${mq(\"xl\")} {\n width: 220px;\n left: calc(50% - 610px);\n }\n\n ${mq(\"xxl\")} {\n width: 220px;\n left: calc(50% - 690px);\n }\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n transform: translateY(0);\n opacity: 1;\n pointer-events: all;\n `}\n`;\n\nexport const StyledSidebarList = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nexport const StyledStrong = styled.strong<{ theme: Theme }>`\n font-weight: 600;\n ${({ theme }) => styledStrong(theme)};\n`;\n\nexport const StyledSidebarListItem = styled.li`\n display: flex;\n gap: 10px;\n clear: both;\n`;\n\nexport const StyledSidebarListItemLink = styled(Link)<Props>`\n text-decoration: none;\n font-size: ${({ theme }) => theme.fontSizes.strong.xs};\n line-height: 2.1;\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.grayDark : theme.colors.primary};\n padding: 0 0 0 20px;\n display: flex;\n transition: all 0.3s ease;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n\n ${mq(\"lg\")} {\n font-size: ${({ theme }) => theme.fontSizes.strong.lg};\n line-height: 2.1;\n }\n\n @media (hover: hover) {\n &:hover {\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};\n border-color: ${({ theme }) => theme.colors.info};\n }\n }\n\n ${({ $isActive, theme }) =>\n $isActive &&\n `\n\t\t\tcolor: ${theme.colors.dark};\n\t\t\tborder-color: ${theme.colors.info};\n\t\t\tfont-weight: 600;\n\t`};\n`;\n\nexport const StyleMobileBar = styled.button<Props>`\n ${resetButton};\n position: fixed;\n z-index: 1000;\n bottom: 0;\n right: 20px;\n font-size: ${({ theme }) => theme.fontSizes.strong.lg};\n line-height: ${({ theme }) => theme.fontSizes.strong.lg};\n box-shadow: ${({ theme }) => theme.shadows.sm};\n background: ${({ theme }) =>\n theme.isDark\n ? rgba(theme.colors.grayLight, 0.7)\n : rgba(theme.colors.light, 0.7)};\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.dark : theme.colors.primary};\n backdrop-filter: blur(10px);\n -webkit-backdrop-filter: blur(10px);\n padding: 30px;\n border-radius: 100px;\n margin: 0 0 20px 0;\n font-weight: 600;\n display: flex;\n justify-content: flex-start;\n width: auto;\n\n ${mq(\"lg\")} {\n display: none;\n }\n\n ${({ $isActive }) => $isActive && `position: fixed; `};\n`;\n\nexport const StyledMobileBurger = styled.span<Props>`\n display: block;\n margin: auto 0;\n width: 18px;\n height: 18px;\n position: relative;\n overflow: hidden;\n background: transparent;\n position: relative;\n\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n width: 18px;\n height: 3px;\n border-radius: 3px;\n background: ${({ theme }) =>\n theme.isDark ? theme.colors.dark : theme.colors.primary};\n transition: all 0.3s ease;\n }\n\n &::before {\n top: 3px;\n }\n\n &::after {\n bottom: 3px;\n }\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n &::before {\n transform: translateY(5px) rotate(45deg);\n }\n\n &::after {\n transform: translateY(-4px) rotate(-45deg);\n }\n `};\n`;\n\nexport const StyledInlineButton = styled.button<{ theme: Theme }>`\n ${resetButton};\n ${interactiveStyles};\n color: ${({ theme }) => theme.colors.primary};\n vertical-align: middle;\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n padding: 0;\n width: 18px;\n height: 18px;\n display: flex;\n margin: auto 0;\n transition: all 0.3s ease;\n\n @media (hover: hover) {\n &:hover {\n color: ${({ theme }) => theme.colors.light};\n background: ${({ theme }) => theme.colors.primary};\n border-color: ${({ theme }) => theme.colors.primary};\n }\n }\n\n & svg {\n vertical-align: middle;\n width: 12px;\n height: 12px;\n margin: auto;\n }\n`;\n\nexport const StyledPlusButton = styled.button<{ theme: Theme }>`\n ${resetButton};\n color: ${({ theme }) => theme.colors.primary};\n vertical-align: middle;\n padding: 0;\n width: 100%;\n height: 18px;\n display: flex;\n margin: auto 0;\n transition: all 0.3s ease;\n position: relative;\n margin: 20px 0 0 0;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 100%;\n height: 1px;\n border-radius: 3px;\n background: ${({ theme }) => theme.colors.grayLight};\n transition: all 0.3s ease;\n z-index: -1;\n }\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 18px;\n height: 18px;\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n background: ${({ theme }) => theme.colors.light};\n transition: all 0.3s ease;\n z-index: -1;\n }\n\n box-shadow: 0 0 0 0px ${({ theme }) => theme.colors.primary};\n\n @media (hover: hover) {\n &:hover {\n &::after {\n border-color: ${({ theme }) => theme.colors.primary};\n }\n }\n }\n\n &:focus {\n &::after {\n border-color: ${({ theme }) => theme.colors.primary};\n box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};\n }\n }\n\n &:active {\n &::after {\n box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n }\n\n @media (hover: hover) {\n &:hover {\n color: ${({ theme }) => theme.colors.light};\n\n &::after {\n background: ${({ theme }) => theme.colors.primary};\n border-color: ${({ theme }) => theme.colors.primary};\n }\n }\n }\n\n & svg {\n vertical-align: middle;\n width: 14px;\n height: 14px;\n margin: auto;\n }\n`;\n\nexport const StyledFullHeightInput = styled.div`\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 20px;\n flex: 1;\n\n & > span {\n height: 100%;\n width: 100%;\n }\n\n & textarea {\n height: 100%;\n }\n`;\n\nexport const StyledEditorWrapper = styled.div`\n flex: 1;\n\n &:empty {\n display: none;\n }\n`;\n\nfunction DocsWrapper({ children }: DocsProps) {\n return <StyledDocsWrapper>{children}</StyledDocsWrapper>;\n}\n\nfunction DocsSidebar({ children }: DocsProps) {\n return <StyledDocsSidebar>{children}</StyledDocsSidebar>;\n}\n\nfunction DocsContainer({ children }: DocsProps) {\n return <StyledDocsContainer>{children}</StyledDocsContainer>;\n}\n\nexport { DocsWrapper, DocsSidebar, DocsContainer };\n";
|