@nikala-ui/folio 0.15.0 → 0.16.0
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/cli/commands/init.js +89 -54
- package/dist/components/ui/code-block-commands.d.ts +4 -0
- package/dist/components/ui/code-block-commands.js +58 -0
- package/dist/components/ui/code-block.d.ts +2 -1
- package/dist/components/ui/code-block.jsx +4 -127
- package/dist/components/ui/code-highlighter.d.ts +2 -0
- package/dist/components/ui/code-highlighter.js +76 -0
- package/dist/config.js +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/mdx/builtin-languages.d.ts +34 -0
- package/dist/mdx/builtin-languages.js +54 -0
- package/dist/mdx/custom-languages.d.ts +10 -0
- package/dist/mdx/custom-languages.js +52 -0
- package/dist/mdx/highlighter.d.ts +2 -1
- package/dist/mdx/highlighter.js +19 -52
- package/dist/search/provider.d.ts +9 -0
- package/dist/search/provider.js +4 -2
- package/dist/server/plugin/constants.d.ts +2 -0
- package/dist/server/plugin/constants.js +2 -0
- package/dist/server/plugin/index.js +2 -1
- package/dist/server/plugin/virtual-modules.js +41 -2
- package/dist/templates/env.d.ts +31 -0
- package/dist/templates/locales/en.json +77 -0
- package/dist/themes/default/components/docs-landing-body.d.ts +17 -0
- package/dist/themes/default/components/docs-landing-body.jsx +17 -0
- package/dist/themes/default/components/docs-page-body.d.ts +21 -0
- package/dist/themes/default/components/docs-page-body.jsx +36 -0
- package/dist/themes/default/components/page-actions.d.ts +15 -0
- package/dist/themes/default/components/page-actions.jsx +60 -0
- package/dist/themes/default/components/page-header.d.ts +7 -0
- package/dist/themes/default/components/page-header.jsx +3 -0
- package/dist/themes/default/components/sidebar-footer.d.ts +6 -0
- package/dist/themes/default/components/sidebar-footer.jsx +12 -0
- package/dist/themes/default/components/sidebar-header.d.ts +8 -0
- package/dist/themes/default/components/sidebar-header.jsx +17 -0
- package/dist/themes/default/components/sidebar-mobile-nav.d.ts +7 -0
- package/dist/themes/default/components/sidebar-mobile-nav.jsx +17 -0
- package/dist/themes/default/components/sidebar-promo.d.ts +8 -0
- package/dist/themes/default/components/sidebar-promo.jsx +20 -0
- package/dist/themes/default/hooks/use-page-copy.d.ts +6 -0
- package/dist/themes/default/hooks/use-page-copy.js +26 -0
- package/dist/themes/default/layout.jsx +23 -147
- package/dist/themes/default/lib/layout-visibility.d.ts +8 -0
- package/dist/themes/default/lib/layout-visibility.js +24 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.jsx +2 -2
- package/dist/themes/default/sidebar.jsx +17 -47
- package/dist/types.d.ts +9 -0
- package/dist/vendor/docs-src/client/page-actions.ts +69 -0
- package/dist/vendor/docs-src/components/ui/code-block-commands.ts +65 -0
- package/dist/vendor/docs-src/components/ui/code-block.tsx +5 -132
- package/dist/vendor/docs-src/components/ui/code-highlighter.ts +76 -0
- package/dist/vendor/docs-src/navigation/index.ts +2 -0
- package/dist/vendor/docs-src/navigation/repository-links.ts +43 -0
- package/dist/vendor/docs-src/navigation/sidebar-state.ts +22 -0
- package/dist/vendor/docs-src/navigation/sidebar-tree.ts +15 -0
- package/dist/vendor/docs-src/search/provider.ts +83 -0
- package/dist/vendor/docs-src/themes/default/components/docs-landing-body.tsx +30 -0
- package/dist/vendor/docs-src/themes/default/components/docs-page-body.tsx +53 -0
- package/dist/vendor/docs-src/themes/default/components/page-actions.tsx +105 -0
- package/dist/vendor/docs-src/themes/default/components/page-header.tsx +31 -0
- package/dist/vendor/docs-src/themes/default/components/sidebar-footer.tsx +21 -0
- package/dist/vendor/docs-src/themes/default/components/sidebar-header.tsx +30 -0
- package/dist/vendor/docs-src/themes/default/components/sidebar-mobile-nav.tsx +33 -0
- package/dist/vendor/docs-src/themes/default/components/sidebar-promo.tsx +37 -0
- package/dist/vendor/docs-src/themes/default/content/breadcrumbs.tsx +43 -0
- package/dist/vendor/docs-src/themes/default/content/pager.tsx +19 -0
- package/dist/vendor/docs-src/themes/default/content/table-of-contents.tsx +32 -0
- package/dist/vendor/docs-src/themes/default/hooks/use-page-copy.ts +29 -0
- package/dist/vendor/docs-src/themes/default/icons.ts +16 -0
- package/dist/vendor/docs-src/themes/default/index.ts +46 -0
- package/dist/vendor/docs-src/themes/default/layout.tsx +176 -0
- package/dist/vendor/docs-src/themes/default/lib/layout-visibility.ts +39 -0
- package/dist/vendor/docs-src/themes/default/navbar.tsx +130 -0
- package/dist/vendor/docs-src/themes/default/navigation/mobile-table-of-contents.tsx +61 -0
- package/dist/vendor/docs-src/themes/default/navigation/sidebar-tree.tsx +202 -0
- package/dist/vendor/docs-src/themes/default/overlays/search-dialog.tsx +106 -0
- package/dist/vendor/docs-src/themes/default/sidebar.tsx +86 -0
- package/dist/vendor/docs-src/themes/index.ts +4 -0
- package/dist/vendor/docs-src/themes/types.ts +87 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const languageLoaders: {
|
|
2
|
+
readonly typescript: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
3
|
+
readonly javascript: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
4
|
+
readonly tsx: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
5
|
+
readonly jsx: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
6
|
+
readonly bash: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
7
|
+
readonly json: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
8
|
+
readonly css: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
9
|
+
readonly html: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
10
|
+
readonly markdown: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
11
|
+
readonly mdx: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
12
|
+
readonly rust: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
13
|
+
readonly python: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
14
|
+
readonly yaml: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
15
|
+
readonly toml: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
16
|
+
readonly sql: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
17
|
+
readonly diff: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
18
|
+
readonly c: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
19
|
+
readonly cpp: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
20
|
+
readonly go: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
21
|
+
readonly mermaid: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
22
|
+
readonly dockerfile: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
23
|
+
readonly zig: () => Promise<typeof import("@shikijs/langs/*")>;
|
|
24
|
+
};
|
|
25
|
+
/** Fence-language shorthands that resolve to a built-in language id. */
|
|
26
|
+
export declare const LANGUAGE_ALIASES: Readonly<Record<string, string>>;
|
|
27
|
+
/** Identifiers that always render without highlighting. */
|
|
28
|
+
export declare const PLAIN_TEXT_IDS: readonly ["text", "txt", "plain"];
|
|
29
|
+
/**
|
|
30
|
+
* Every identifier Folio already owns: loadable languages, shorthand aliases
|
|
31
|
+
* and plain-text names. Custom languages must not reuse any of them.
|
|
32
|
+
*/
|
|
33
|
+
export declare const RESERVED_LANGUAGE_IDS: ReadonlySet<string>;
|
|
34
|
+
export declare function normalizeLangAlias(lang: string): string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Built-in Shiki language catalog shared by the highlighter and config validation.
|
|
2
|
+
export const languageLoaders = {
|
|
3
|
+
typescript: () => import("@shikijs/langs/typescript"),
|
|
4
|
+
javascript: () => import("@shikijs/langs/javascript"),
|
|
5
|
+
tsx: () => import("@shikijs/langs/tsx"),
|
|
6
|
+
jsx: () => import("@shikijs/langs/jsx"),
|
|
7
|
+
bash: () => import("@shikijs/langs/shellscript"),
|
|
8
|
+
json: () => import("@shikijs/langs/json"),
|
|
9
|
+
css: () => import("@shikijs/langs/css"),
|
|
10
|
+
html: () => import("@shikijs/langs/html"),
|
|
11
|
+
markdown: () => import("@shikijs/langs/markdown"),
|
|
12
|
+
mdx: () => import("@shikijs/langs/mdx"),
|
|
13
|
+
rust: () => import("@shikijs/langs/rust"),
|
|
14
|
+
python: () => import("@shikijs/langs/python"),
|
|
15
|
+
yaml: () => import("@shikijs/langs/yaml"),
|
|
16
|
+
toml: () => import("@shikijs/langs/toml"),
|
|
17
|
+
sql: () => import("@shikijs/langs/sql"),
|
|
18
|
+
diff: () => import("@shikijs/langs/diff"),
|
|
19
|
+
c: () => import("@shikijs/langs/c"),
|
|
20
|
+
cpp: () => import("@shikijs/langs/cpp"),
|
|
21
|
+
go: () => import("@shikijs/langs/go"),
|
|
22
|
+
mermaid: () => import("@shikijs/langs/mermaid"),
|
|
23
|
+
dockerfile: () => import("@shikijs/langs/docker"),
|
|
24
|
+
zig: () => import("@shikijs/langs/zig"),
|
|
25
|
+
};
|
|
26
|
+
/** Fence-language shorthands that resolve to a built-in language id. */
|
|
27
|
+
export const LANGUAGE_ALIASES = {
|
|
28
|
+
shell: "bash",
|
|
29
|
+
sh: "bash",
|
|
30
|
+
zsh: "bash",
|
|
31
|
+
js: "javascript",
|
|
32
|
+
ts: "typescript",
|
|
33
|
+
py: "python",
|
|
34
|
+
rs: "rust",
|
|
35
|
+
yml: "yaml",
|
|
36
|
+
md: "markdown",
|
|
37
|
+
rb: "ruby",
|
|
38
|
+
cs: "csharp",
|
|
39
|
+
};
|
|
40
|
+
/** Identifiers that always render without highlighting. */
|
|
41
|
+
export const PLAIN_TEXT_IDS = ["text", "txt", "plain"];
|
|
42
|
+
/**
|
|
43
|
+
* Every identifier Folio already owns: loadable languages, shorthand aliases
|
|
44
|
+
* and plain-text names. Custom languages must not reuse any of them.
|
|
45
|
+
*/
|
|
46
|
+
export const RESERVED_LANGUAGE_IDS = new Set([
|
|
47
|
+
...Object.keys(languageLoaders),
|
|
48
|
+
...Object.keys(LANGUAGE_ALIASES),
|
|
49
|
+
...PLAIN_TEXT_IDS,
|
|
50
|
+
]);
|
|
51
|
+
export function normalizeLangAlias(lang) {
|
|
52
|
+
const id = lang.toLowerCase().trim();
|
|
53
|
+
return Object.hasOwn(LANGUAGE_ALIASES, id) ? LANGUAGE_ALIASES[id] : id;
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LanguageRegistration } from "shiki";
|
|
2
|
+
/** Lower-cased language name or alias mapped to its registration. */
|
|
3
|
+
export type CustomLanguageIndex = ReadonlyMap<string, LanguageRegistration>;
|
|
4
|
+
/**
|
|
5
|
+
* Validate `shiki.customLangs` and return the index used for lookups.
|
|
6
|
+
* Throws a `[folio]` error describing the first invalid registration.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createCustomLanguageIndex(languages: unknown): CustomLanguageIndex;
|
|
9
|
+
/** Throws a `[folio]` configuration error when `shiki.customLangs` is invalid. */
|
|
10
|
+
export declare function validateCustomLanguages(languages: unknown): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RESERVED_LANGUAGE_IDS } from "./builtin-languages.js";
|
|
2
|
+
function fail(index, message) {
|
|
3
|
+
throw new Error(`[folio] shiki.customLangs[${index}] ${message}`);
|
|
4
|
+
}
|
|
5
|
+
function readIdentifier(value, index, label) {
|
|
6
|
+
if (typeof value !== "string" || !value.trim())
|
|
7
|
+
fail(index, `${label} must be a non-empty string`);
|
|
8
|
+
const id = value.trim().toLowerCase();
|
|
9
|
+
if (/\s/.test(id))
|
|
10
|
+
fail(index, `${label} "${value}" must not contain whitespace`);
|
|
11
|
+
return id;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Validate `shiki.customLangs` and return the index used for lookups.
|
|
15
|
+
* Throws a `[folio]` error describing the first invalid registration.
|
|
16
|
+
*/
|
|
17
|
+
export function createCustomLanguageIndex(languages) {
|
|
18
|
+
const index = new Map();
|
|
19
|
+
if (languages === undefined)
|
|
20
|
+
return index;
|
|
21
|
+
if (!Array.isArray(languages))
|
|
22
|
+
throw new Error("[folio] shiki.customLangs must be an array of Shiki language registrations");
|
|
23
|
+
const scopes = new Set();
|
|
24
|
+
languages.forEach((entry, position) => {
|
|
25
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry))
|
|
26
|
+
fail(position, "must be a language registration object");
|
|
27
|
+
const language = entry;
|
|
28
|
+
const name = readIdentifier(language.name, position, "name");
|
|
29
|
+
if (typeof language.scopeName !== "string" || !language.scopeName.trim())
|
|
30
|
+
fail(position, "scopeName must be a non-empty string");
|
|
31
|
+
if (!Array.isArray(language.patterns))
|
|
32
|
+
fail(position, `("${language.name}") must define a patterns array`);
|
|
33
|
+
if (language.aliases !== undefined && !Array.isArray(language.aliases))
|
|
34
|
+
fail(position, `("${language.name}") aliases must be an array of strings`);
|
|
35
|
+
if (scopes.has(language.scopeName))
|
|
36
|
+
fail(position, `("${language.name}") scopeName "${language.scopeName}" is registered more than once`);
|
|
37
|
+
scopes.add(language.scopeName);
|
|
38
|
+
const ids = new Set([name, ...(language.aliases ?? []).map((alias) => readIdentifier(alias, position, "alias"))]);
|
|
39
|
+
for (const id of ids) {
|
|
40
|
+
if (RESERVED_LANGUAGE_IDS.has(id))
|
|
41
|
+
fail(position, `("${language.name}") uses "${id}", which is a built-in language or alias`);
|
|
42
|
+
if (index.has(id))
|
|
43
|
+
fail(position, `("${language.name}") uses "${id}", which is already registered by "${index.get(id).name}"`);
|
|
44
|
+
index.set(id, language);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return index;
|
|
48
|
+
}
|
|
49
|
+
/** Throws a `[folio]` configuration error when `shiki.customLangs` is invalid. */
|
|
50
|
+
export function validateCustomLanguages(languages) {
|
|
51
|
+
createCustomLanguageIndex(languages);
|
|
52
|
+
}
|
|
@@ -4,7 +4,8 @@ export declare function configureDocsHighlighter(config: ShikiConfig): void;
|
|
|
4
4
|
export declare function getDocsHighlighter(config?: ShikiConfig): Promise<Highlighter>;
|
|
5
5
|
/**
|
|
6
6
|
* Ensures a language is loaded in Shiki on-demand.
|
|
7
|
-
*
|
|
7
|
+
* Custom languages from `shiki.customLangs` are matched first by name or alias;
|
|
8
|
+
* otherwise a bundled language is loaded dynamically.
|
|
8
9
|
* Returns the resolved language identifier or "text" as fallback.
|
|
9
10
|
*/
|
|
10
11
|
export declare function ensureLanguage(highlighter: Highlighter, rawLang: string): Promise<string>;
|
package/dist/mdx/highlighter.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { createBundledHighlighter } from "shiki/core";
|
|
2
2
|
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
3
|
+
import { languageLoaders, normalizeLangAlias } from "./builtin-languages.js";
|
|
4
|
+
import { createCustomLanguageIndex } from "./custom-languages.js";
|
|
3
5
|
let highlighterPromise = null;
|
|
4
6
|
let activeShikiConfig = null;
|
|
5
7
|
let activeShikiConfigKey = null;
|
|
6
8
|
let activeAllowedLanguages = null;
|
|
9
|
+
let activeCustomLanguages = new Map();
|
|
7
10
|
const DEFAULT_BASE_LANGS = [
|
|
8
11
|
"typescript",
|
|
9
12
|
"javascript",
|
|
@@ -22,30 +25,6 @@ const DEFAULT_BASE_LANGS = [
|
|
|
22
25
|
"sql",
|
|
23
26
|
"diff",
|
|
24
27
|
];
|
|
25
|
-
const languageLoaders = {
|
|
26
|
-
typescript: () => import("@shikijs/langs/typescript"),
|
|
27
|
-
javascript: () => import("@shikijs/langs/javascript"),
|
|
28
|
-
tsx: () => import("@shikijs/langs/tsx"),
|
|
29
|
-
jsx: () => import("@shikijs/langs/jsx"),
|
|
30
|
-
bash: () => import("@shikijs/langs/shellscript"),
|
|
31
|
-
json: () => import("@shikijs/langs/json"),
|
|
32
|
-
css: () => import("@shikijs/langs/css"),
|
|
33
|
-
html: () => import("@shikijs/langs/html"),
|
|
34
|
-
markdown: () => import("@shikijs/langs/markdown"),
|
|
35
|
-
mdx: () => import("@shikijs/langs/mdx"),
|
|
36
|
-
rust: () => import("@shikijs/langs/rust"),
|
|
37
|
-
python: () => import("@shikijs/langs/python"),
|
|
38
|
-
yaml: () => import("@shikijs/langs/yaml"),
|
|
39
|
-
toml: () => import("@shikijs/langs/toml"),
|
|
40
|
-
sql: () => import("@shikijs/langs/sql"),
|
|
41
|
-
diff: () => import("@shikijs/langs/diff"),
|
|
42
|
-
c: () => import("@shikijs/langs/c"),
|
|
43
|
-
cpp: () => import("@shikijs/langs/cpp"),
|
|
44
|
-
go: () => import("@shikijs/langs/go"),
|
|
45
|
-
mermaid: () => import("@shikijs/langs/mermaid"),
|
|
46
|
-
dockerfile: () => import("@shikijs/langs/docker"),
|
|
47
|
-
zig: () => import("@shikijs/langs/zig"),
|
|
48
|
-
};
|
|
49
28
|
const DEFAULT_LIGHT_THEME = "github-light";
|
|
50
29
|
const DEFAULT_DARK_THEME = "github-dark";
|
|
51
30
|
const themeLoaders = {
|
|
@@ -58,6 +37,7 @@ const createDocsHighlighter = createBundledHighlighter({
|
|
|
58
37
|
engine: () => createJavaScriptRegexEngine(),
|
|
59
38
|
});
|
|
60
39
|
export function configureDocsHighlighter(config) {
|
|
40
|
+
activeCustomLanguages = createCustomLanguageIndex(config.customLangs);
|
|
61
41
|
activeShikiConfig = config;
|
|
62
42
|
activeShikiConfigKey = JSON.stringify(config);
|
|
63
43
|
activeAllowedLanguages = config.langs
|
|
@@ -85,11 +65,25 @@ export async function getDocsHighlighter(config) {
|
|
|
85
65
|
}
|
|
86
66
|
/**
|
|
87
67
|
* Ensures a language is loaded in Shiki on-demand.
|
|
88
|
-
*
|
|
68
|
+
* Custom languages from `shiki.customLangs` are matched first by name or alias;
|
|
69
|
+
* otherwise a bundled language is loaded dynamically.
|
|
89
70
|
* Returns the resolved language identifier or "text" as fallback.
|
|
90
71
|
*/
|
|
91
72
|
export async function ensureLanguage(highlighter, rawLang) {
|
|
92
73
|
const normalized = normalizeLangAlias(rawLang);
|
|
74
|
+
const custom = activeCustomLanguages.get(normalized);
|
|
75
|
+
if (custom) {
|
|
76
|
+
if (highlighter.getLoadedLanguages().includes(custom.name))
|
|
77
|
+
return custom.name;
|
|
78
|
+
try {
|
|
79
|
+
await highlighter.loadLanguage(custom);
|
|
80
|
+
return custom.name;
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
console.warn(`[folio] Failed to load custom Shiki language "${custom.name}":`, err);
|
|
84
|
+
return "text";
|
|
85
|
+
}
|
|
86
|
+
}
|
|
93
87
|
if (!normalized || normalized === "text" || normalized === "txt" || normalized === "plain") {
|
|
94
88
|
return "text";
|
|
95
89
|
}
|
|
@@ -141,33 +135,6 @@ export async function ensureTheme(highlighter, themeName) {
|
|
|
141
135
|
}
|
|
142
136
|
return DEFAULT_DARK_THEME;
|
|
143
137
|
}
|
|
144
|
-
function normalizeLangAlias(lang) {
|
|
145
|
-
const l = lang.toLowerCase().trim();
|
|
146
|
-
switch (l) {
|
|
147
|
-
case "shell":
|
|
148
|
-
case "sh":
|
|
149
|
-
case "zsh":
|
|
150
|
-
return "bash";
|
|
151
|
-
case "js":
|
|
152
|
-
return "javascript";
|
|
153
|
-
case "ts":
|
|
154
|
-
return "typescript";
|
|
155
|
-
case "py":
|
|
156
|
-
return "python";
|
|
157
|
-
case "rs":
|
|
158
|
-
return "rust";
|
|
159
|
-
case "yml":
|
|
160
|
-
return "yaml";
|
|
161
|
-
case "md":
|
|
162
|
-
return "markdown";
|
|
163
|
-
case "rb":
|
|
164
|
-
return "ruby";
|
|
165
|
-
case "cs":
|
|
166
|
-
return "csharp";
|
|
167
|
-
default:
|
|
168
|
-
return l;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
138
|
export async function highlightCode(code, options = {}) {
|
|
172
139
|
const highlighter = await getDocsHighlighter();
|
|
173
140
|
const rawLang = options.lang || "text";
|
|
@@ -4,9 +4,18 @@ export interface SearchContext {
|
|
|
4
4
|
query: string;
|
|
5
5
|
pages: PageData[];
|
|
6
6
|
}
|
|
7
|
+
export interface SearchAdapterRuntime {
|
|
8
|
+
/** Browser module that exports the adapter factory. */
|
|
9
|
+
module: string;
|
|
10
|
+
/** Named export containing a factory that receives the optional adapter options. */
|
|
11
|
+
exportName: string;
|
|
12
|
+
/** JSON-serializable options passed to the browser adapter factory. */
|
|
13
|
+
options?: unknown;
|
|
14
|
+
}
|
|
7
15
|
export interface SearchAdapter {
|
|
8
16
|
name: string;
|
|
9
17
|
search: (context: SearchContext) => PageData[] | Promise<PageData[]>;
|
|
18
|
+
runtime?: SearchAdapterRuntime;
|
|
10
19
|
}
|
|
11
20
|
export type ConfiguredSearchProvider = NonNullable<DocsConfig["search"]>["provider"];
|
|
12
21
|
export interface ResolvedSearchProvider {
|
package/dist/search/provider.js
CHANGED
|
@@ -17,7 +17,7 @@ export const localSearchAdapter = {
|
|
|
17
17
|
*/
|
|
18
18
|
export function resolveSearchProvider(search) {
|
|
19
19
|
const configuredProvider = search?.provider;
|
|
20
|
-
if (configuredProvider && typeof configuredProvider !== "string") {
|
|
20
|
+
if (configuredProvider && typeof configuredProvider !== "string" && typeof configuredProvider.search === "function") {
|
|
21
21
|
return {
|
|
22
22
|
requested: configuredProvider.name,
|
|
23
23
|
active: configuredProvider.name,
|
|
@@ -25,7 +25,9 @@ export function resolveSearchProvider(search) {
|
|
|
25
25
|
implementation: configuredProvider,
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
const requested = configuredProvider
|
|
28
|
+
const requested = typeof configuredProvider === "string"
|
|
29
|
+
? configuredProvider.trim() || LOCAL_SEARCH_PROVIDER
|
|
30
|
+
: configuredProvider?.name || LOCAL_SEARCH_PROVIDER;
|
|
29
31
|
return {
|
|
30
32
|
requested,
|
|
31
33
|
active: LOCAL_SEARCH_PROVIDER,
|
|
@@ -12,6 +12,8 @@ export declare const VIRTUAL_ICONS_ID = "virtual:folio-icons";
|
|
|
12
12
|
export declare const RESOLVED_ICONS_ID: string;
|
|
13
13
|
export declare const VIRTUAL_THEME_ID = "virtual:folio-theme";
|
|
14
14
|
export declare const RESOLVED_THEME_ID: string;
|
|
15
|
+
export declare const VIRTUAL_HIGHLIGHT_LANGUAGES_ID = "virtual:folio-highlight-languages";
|
|
16
|
+
export declare const RESOLVED_HIGHLIGHT_LANGUAGES_ID: string;
|
|
15
17
|
export declare const VIRTUAL_SHIKI_ID = "virtual:folio-shiki-stub";
|
|
16
18
|
export declare const RESOLVED_SHIKI_ID: string;
|
|
17
19
|
export declare const CONFIG_FILENAMES: Set<string>;
|
|
@@ -12,6 +12,8 @@ export const VIRTUAL_ICONS_ID = "virtual:folio-icons";
|
|
|
12
12
|
export const RESOLVED_ICONS_ID = "\0" + VIRTUAL_ICONS_ID;
|
|
13
13
|
export const VIRTUAL_THEME_ID = "virtual:folio-theme";
|
|
14
14
|
export const RESOLVED_THEME_ID = "\0" + VIRTUAL_THEME_ID;
|
|
15
|
+
export const VIRTUAL_HIGHLIGHT_LANGUAGES_ID = "virtual:folio-highlight-languages";
|
|
16
|
+
export const RESOLVED_HIGHLIGHT_LANGUAGES_ID = "\0" + VIRTUAL_HIGHLIGHT_LANGUAGES_ID;
|
|
15
17
|
export const VIRTUAL_SHIKI_ID = "virtual:folio-shiki-stub";
|
|
16
18
|
export const RESOLVED_SHIKI_ID = "\0" + VIRTUAL_SHIKI_ID;
|
|
17
19
|
export const CONFIG_FILENAMES = new Set([
|
|
@@ -4,7 +4,7 @@ import { compileMdx } from "../../mdx/compiler.js";
|
|
|
4
4
|
import { loadConfig } from "../../config.js";
|
|
5
5
|
import { resolveDefaultThemeMode } from "../../theme-mode.js";
|
|
6
6
|
import { createFolioBuildSession } from "./lifecycle.js";
|
|
7
|
-
import { CONFIG_FILENAMES, RESOLVED_CONFIG_ID, RESOLVED_ICONS_ID, RESOLVED_ROUTES_ID, RESOLVED_SHIKI_ID, RESOLVED_SOURCES_ID, RESOLVED_THEME_ID, RESOLVED_TREE_ID, VIRTUAL_CONFIG_ID, VIRTUAL_COMPONENTS_ID, VIRTUAL_ICONS_ID, VIRTUAL_ROUTES_ID, VIRTUAL_SOURCES_ID, VIRTUAL_THEME_ID, VIRTUAL_TREE_ID, } from "./constants.js";
|
|
7
|
+
import { CONFIG_FILENAMES, RESOLVED_CONFIG_ID, RESOLVED_HIGHLIGHT_LANGUAGES_ID, RESOLVED_ICONS_ID, RESOLVED_ROUTES_ID, RESOLVED_SHIKI_ID, RESOLVED_SOURCES_ID, RESOLVED_THEME_ID, RESOLVED_TREE_ID, VIRTUAL_CONFIG_ID, VIRTUAL_COMPONENTS_ID, VIRTUAL_HIGHLIGHT_LANGUAGES_ID, VIRTUAL_ICONS_ID, VIRTUAL_ROUTES_ID, VIRTUAL_SOURCES_ID, VIRTUAL_THEME_ID, VIRTUAL_TREE_ID, } from "./constants.js";
|
|
8
8
|
import { escapeHtmlAttribute, getServerModuleDir, getTailwindSourceDirectives } from "./styles.js";
|
|
9
9
|
import { createVirtualModuleLoader } from "./virtual-modules.js";
|
|
10
10
|
import { getComponentSourceDir } from "./components.js";
|
|
@@ -64,6 +64,7 @@ export function nikalaDocsPlugin(options = {}) {
|
|
|
64
64
|
[VIRTUAL_ROUTES_ID]: RESOLVED_ROUTES_ID, [VIRTUAL_SOURCES_ID]: RESOLVED_SOURCES_ID,
|
|
65
65
|
[VIRTUAL_COMPONENTS_ID]: "\0" + VIRTUAL_COMPONENTS_ID, [VIRTUAL_ICONS_ID]: RESOLVED_ICONS_ID,
|
|
66
66
|
[RESOLVED_ICONS_ID]: RESOLVED_ICONS_ID, [VIRTUAL_THEME_ID]: RESOLVED_THEME_ID,
|
|
67
|
+
[VIRTUAL_HIGHLIGHT_LANGUAGES_ID]: RESOLVED_HIGHLIGHT_LANGUAGES_ID,
|
|
67
68
|
};
|
|
68
69
|
return virtualIds[id] || null;
|
|
69
70
|
},
|
|
@@ -5,7 +5,26 @@ import { scanContentDirectories } from "../../core/content-scanner.js";
|
|
|
5
5
|
import { buildConfiguredSidebarTree, buildSidebarTree } from "../../core/route-tree.js";
|
|
6
6
|
import { serializeModuleValue } from "../module-serialization.js";
|
|
7
7
|
import { collectComponentExports, collectStaticComponentFiles, getComponentSourceDir, toLucideComponentName } from "./components.js";
|
|
8
|
-
import { RESOLVED_COMPONENTS_ID, RESOLVED_CONFIG_ID, RESOLVED_ICONS_ID, RESOLVED_ROUTES_ID, RESOLVED_SHIKI_ID, RESOLVED_SOURCES_ID, RESOLVED_THEME_ID, RESOLVED_TREE_ID, } from "./constants.js";
|
|
8
|
+
import { RESOLVED_COMPONENTS_ID, RESOLVED_CONFIG_ID, RESOLVED_HIGHLIGHT_LANGUAGES_ID, RESOLVED_ICONS_ID, RESOLVED_ROUTES_ID, RESOLVED_SHIKI_ID, RESOLVED_SOURCES_ID, RESOLVED_THEME_ID, RESOLVED_TREE_ID, } from "./constants.js";
|
|
9
|
+
function getSearchAdapterRuntime(provider) {
|
|
10
|
+
if (!provider || typeof provider !== "object" || !provider.runtime)
|
|
11
|
+
return undefined;
|
|
12
|
+
if (typeof provider.runtime !== "object" || Array.isArray(provider.runtime)) {
|
|
13
|
+
throw new Error("[folio] Search adapter runtime must be an object");
|
|
14
|
+
}
|
|
15
|
+
const runtime = provider.runtime;
|
|
16
|
+
if (typeof runtime.module !== "string" || typeof runtime.exportName !== "string") {
|
|
17
|
+
throw new Error("[folio] Search adapter runtime requires module and exportName");
|
|
18
|
+
}
|
|
19
|
+
if (!runtime.module.trim() || !runtime.exportName.trim()) {
|
|
20
|
+
throw new Error("[folio] Search adapter runtime requires module and exportName");
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
module: runtime.module,
|
|
24
|
+
exportName: runtime.exportName,
|
|
25
|
+
options: runtime.options,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
9
28
|
export function createVirtualModuleLoader(state, moduleDir) {
|
|
10
29
|
return async function load(id) {
|
|
11
30
|
const current = state();
|
|
@@ -17,8 +36,28 @@ export const bundledLanguages = {};
|
|
|
17
36
|
export const bundledThemes = {};
|
|
18
37
|
export default { createHighlighter, bundledLanguages, bundledThemes };
|
|
19
38
|
`;
|
|
39
|
+
if (id === RESOLVED_HIGHLIGHT_LANGUAGES_ID) {
|
|
40
|
+
return `export default ${serializeModuleValue(resolvedConfig.shiki?.customLangs ?? [])};`;
|
|
41
|
+
}
|
|
20
42
|
if (id === RESOLVED_CONFIG_ID) {
|
|
21
|
-
|
|
43
|
+
// Grammars load lazily through virtual:folio-highlight-languages, so keep
|
|
44
|
+
// them out of the eagerly loaded client config.
|
|
45
|
+
const { customLangs: _customLangs, ...clientShiki } = resolvedConfig.shiki ?? {};
|
|
46
|
+
const serializedConfig = serializeModuleValue(resolvedConfig.shiki ? { ...resolvedConfig, shiki: clientShiki } : resolvedConfig);
|
|
47
|
+
const runtime = getSearchAdapterRuntime(resolvedConfig.search?.provider);
|
|
48
|
+
if (!runtime)
|
|
49
|
+
return `export default ${serializedConfig};`;
|
|
50
|
+
return `import * as searchRuntime from ${serializeModuleValue(runtime.module)};
|
|
51
|
+
const config = ${serializedConfig};
|
|
52
|
+
const provider = config.search?.provider;
|
|
53
|
+
const createAdapter = searchRuntime[${serializeModuleValue(runtime.exportName)}];
|
|
54
|
+
if (provider?.runtime) {
|
|
55
|
+
if (typeof createAdapter !== "function") {
|
|
56
|
+
throw new Error(${serializeModuleValue(`[folio] Search adapter runtime export "${runtime.exportName}" was not found in "${runtime.module}"`)});
|
|
57
|
+
}
|
|
58
|
+
config.search = { ...config.search, provider: createAdapter(provider.runtime.options) };
|
|
59
|
+
}
|
|
60
|
+
export default config;`;
|
|
22
61
|
}
|
|
23
62
|
if (id === RESOLVED_TREE_ID) {
|
|
24
63
|
const pages = [...await lifecycleSession.pages()];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module "*.css";
|
|
4
|
+
|
|
5
|
+
declare module "virtual:folio-config" {
|
|
6
|
+
const config: any;
|
|
7
|
+
export default config;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare module "virtual:folio-highlight-languages" {
|
|
11
|
+
const languages: Array<{ name: string; aliases?: string[]; [key: string]: unknown }>;
|
|
12
|
+
export default languages;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare module "virtual:folio-tree" {
|
|
16
|
+
export const pages: any[];
|
|
17
|
+
export const tree: any[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare module "virtual:folio-routes" {
|
|
21
|
+
export const routes: Record<string, () => Promise<any>>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module "virtual:folio-components" {
|
|
25
|
+
const components: Record<string, any>;
|
|
26
|
+
export default components;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module "virtual:folio-icons" {
|
|
30
|
+
export const icons: Record<string, any>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"navigation.search": "Search docs...",
|
|
3
|
+
"navigation.searchLabel": "Search documentation",
|
|
4
|
+
"navigation.toggleSidebar": "Toggle documentation sidebar",
|
|
5
|
+
"navigation.closeSidebar": "Close documentation sidebar",
|
|
6
|
+
"navigation.documentation": "Documentation",
|
|
7
|
+
"navigation.primary": "Primary navigation",
|
|
8
|
+
"navigation.github": "GitHub",
|
|
9
|
+
"navigation.chooseLanguage": "Choose language",
|
|
10
|
+
"navigation.toggleNavigation": "Toggle navigation",
|
|
11
|
+
"navigation.toggleSidebarRail": "Toggle sidebar rail",
|
|
12
|
+
"navigation.sidebar": "Sidebar",
|
|
13
|
+
"navigation.collapse": "Collapse",
|
|
14
|
+
"navigation.expand": "Expand",
|
|
15
|
+
"navigation.breadcrumb": "Breadcrumb",
|
|
16
|
+
"actions.viewSource": "View source",
|
|
17
|
+
"actions.copyPage": "Copy page",
|
|
18
|
+
"actions.copyAsMarkdown": "Copy as Markdown",
|
|
19
|
+
"actions.learnMore": "Learn more",
|
|
20
|
+
"actions.copyDocumentationPage": "Copy documentation page",
|
|
21
|
+
"actions.openInProvider": "Open in {provider}",
|
|
22
|
+
"actions.copied": "Copied",
|
|
23
|
+
"actions.prompt": "Prompt",
|
|
24
|
+
"actions.copyContext": "Copy context",
|
|
25
|
+
"actions.copyCliCommand": "Copy CLI command",
|
|
26
|
+
"actions.copyCode": "Copy code",
|
|
27
|
+
"actions.exitFullscreen": "Exit fullscreen",
|
|
28
|
+
"actions.expandFullscreen": "Expand fullscreen",
|
|
29
|
+
"tableOfContents.title": "On this page",
|
|
30
|
+
"search.placeholder": "Search documentation...",
|
|
31
|
+
"search.empty": "No matching documents found.",
|
|
32
|
+
"search.pages": "Pages",
|
|
33
|
+
"search.by": "Search by",
|
|
34
|
+
"search.commandPlaceholder": "Search commands...",
|
|
35
|
+
"search.noResults": "No results found for {query}.",
|
|
36
|
+
"pagination.previous": "Previous",
|
|
37
|
+
"pagination.next": "Next",
|
|
38
|
+
"theme.toggle": "Toggle theme",
|
|
39
|
+
"theme.light": "Light",
|
|
40
|
+
"theme.dark": "Dark",
|
|
41
|
+
"theme.system": "System",
|
|
42
|
+
"theme.mode": "Theme mode",
|
|
43
|
+
"theme.brandAccentColor": "Brand accent color",
|
|
44
|
+
"theme.borderRadius": "Border radius",
|
|
45
|
+
"viewer.preview": "Preview",
|
|
46
|
+
"viewer.code": "Code",
|
|
47
|
+
"viewer.desktopViewport": "Desktop viewport",
|
|
48
|
+
"viewer.tabletViewport": "Tablet viewport",
|
|
49
|
+
"viewer.mobileViewport": "Mobile viewport",
|
|
50
|
+
"viewer.desktopSize": "Desktop size",
|
|
51
|
+
"viewer.tabletSize": "Tablet size",
|
|
52
|
+
"viewer.mobileSize": "Mobile size",
|
|
53
|
+
"viewer.toggleBackgroundGrid": "Toggle background grid",
|
|
54
|
+
"viewer.canvasGrid": "Canvas grid",
|
|
55
|
+
"viewer.resetPreviewCanvas": "Reset preview canvas",
|
|
56
|
+
"viewer.resetCanvas": "Reset canvas",
|
|
57
|
+
"viewer.copyAiContext": "Copy AI context",
|
|
58
|
+
"viewer.copyCodeForAi": "Copy code for AI",
|
|
59
|
+
"viewer.copyCliInstallation": "Copy CLI installation",
|
|
60
|
+
"viewer.fullscreenPreview": "Fullscreen preview",
|
|
61
|
+
"viewer.exitFullscreen": "Exit fullscreen",
|
|
62
|
+
"code.copied": "Code copied",
|
|
63
|
+
"code.copy": "Copy code",
|
|
64
|
+
"command.navigate": "Navigate",
|
|
65
|
+
"command.select": "Select",
|
|
66
|
+
"command.close": "Close",
|
|
67
|
+
"image.avatar": "Avatar",
|
|
68
|
+
"status.loading": "Loading...",
|
|
69
|
+
"status.loadingLabel": "Loading",
|
|
70
|
+
"accessibility.callout": "Callout",
|
|
71
|
+
"errors.pageNotFound": "Page not found",
|
|
72
|
+
"errors.pageNotFoundDescription": "The requested documentation page could not be found.",
|
|
73
|
+
"apiTable.property": "Property",
|
|
74
|
+
"apiTable.type": "Type",
|
|
75
|
+
"apiTable.default": "Default",
|
|
76
|
+
"apiTable.description": "Description"
|
|
77
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
import type { BreadcrumbItemData } from "../../types.js";
|
|
3
|
+
export interface DocsLandingBodyProps {
|
|
4
|
+
breadcrumbs?: BreadcrumbItemData[];
|
|
5
|
+
showBreadcrumbs: boolean;
|
|
6
|
+
showPager: boolean;
|
|
7
|
+
prev?: {
|
|
8
|
+
title: string;
|
|
9
|
+
href: string;
|
|
10
|
+
};
|
|
11
|
+
next?: {
|
|
12
|
+
title: string;
|
|
13
|
+
href: string;
|
|
14
|
+
};
|
|
15
|
+
children?: JSX.Element;
|
|
16
|
+
}
|
|
17
|
+
export declare const DocsLandingBody: Component<DocsLandingBodyProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Show } from "solid-js";
|
|
2
|
+
import { Container } from "@/components/ui/container";
|
|
3
|
+
import { DocsBreadcrumbs } from "../content/breadcrumbs.jsx";
|
|
4
|
+
import { DocsPager } from "../content/pager.jsx";
|
|
5
|
+
export const DocsLandingBody = (props) => (<Container as="main" size="2xl" class="min-w-0 max-w-full flex-1 py-8 sm:py-12 lg:py-16">
|
|
6
|
+
<Container as="article" size="xl" class="mx-auto min-w-0 px-0 sm:px-4">
|
|
7
|
+
<Show when={props.showBreadcrumbs && props.breadcrumbs && props.breadcrumbs.length > 0}>
|
|
8
|
+
<DocsBreadcrumbs items={props.breadcrumbs} class="mb-6"/>
|
|
9
|
+
</Show>
|
|
10
|
+
<Container as="div" size="full" class="prose prose-zinc dark:prose-invert max-w-none px-0" data-docs-page-content>
|
|
11
|
+
{props.children}
|
|
12
|
+
</Container>
|
|
13
|
+
<Show when={props.showPager && (props.prev || props.next)}>
|
|
14
|
+
<DocsPager prev={props.prev} next={props.next}/>
|
|
15
|
+
</Show>
|
|
16
|
+
</Container>
|
|
17
|
+
</Container>);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
import type { BreadcrumbItemData } from "../../types.js";
|
|
3
|
+
import type { PageData, TocItem } from "../../../types.js";
|
|
4
|
+
export interface DocsPageBodyProps {
|
|
5
|
+
breadcrumbs?: BreadcrumbItemData[];
|
|
6
|
+
currentPage?: PageData;
|
|
7
|
+
toc?: TocItem[];
|
|
8
|
+
prev?: {
|
|
9
|
+
title: string;
|
|
10
|
+
href: string;
|
|
11
|
+
};
|
|
12
|
+
next?: {
|
|
13
|
+
title: string;
|
|
14
|
+
href: string;
|
|
15
|
+
};
|
|
16
|
+
showToc: boolean;
|
|
17
|
+
pageActions: JSX.Element;
|
|
18
|
+
sidebarPromo?: NonNullable<NonNullable<import("../../../types.js").DocsNavigationConfig["sidebar"]>["promo"]>;
|
|
19
|
+
children?: JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
export declare const DocsPageBody: Component<DocsPageBodyProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Show } from "solid-js";
|
|
2
|
+
import { Container } from "@/components/ui/container";
|
|
3
|
+
import { DocsBreadcrumbs } from "../content/breadcrumbs.jsx";
|
|
4
|
+
import { DocsPager } from "../content/pager.jsx";
|
|
5
|
+
import { DocsTableOfContents } from "../content/table-of-contents.jsx";
|
|
6
|
+
import { DocsMobileTableOfContents } from "../navigation/mobile-table-of-contents.jsx";
|
|
7
|
+
import { SidebarPromo } from "./sidebar-promo.jsx";
|
|
8
|
+
export const DocsPageBody = (props) => (<Container as="main" size="2xl" class="min-w-0 w-full max-w-[96rem] flex-1 grid grid-cols-1 xl:grid-cols-[minmax(0,1fr)_16rem] items-start gap-4 sm:gap-8 py-6 sm:py-8">
|
|
9
|
+
<Container as="article" size="full" class="min-w-0 max-w-none mx-0 px-0 sm:px-4 w-full">
|
|
10
|
+
<Show when={props.breadcrumbs && props.breadcrumbs.length > 0}>
|
|
11
|
+
<DocsBreadcrumbs items={props.breadcrumbs} class="mb-6"/>
|
|
12
|
+
</Show>
|
|
13
|
+
<Show when={props.currentPage?.title}>
|
|
14
|
+
{props.pageActions}
|
|
15
|
+
</Show>
|
|
16
|
+
<Show when={props.showToc}>
|
|
17
|
+
<DocsMobileTableOfContents items={props.toc} class="mb-6"/>
|
|
18
|
+
</Show>
|
|
19
|
+
<Container as="div" size="full" class="prose prose-zinc dark:prose-invert max-w-none px-0 sm:px-0 lg:px-0" data-docs-page-content>
|
|
20
|
+
{props.children}
|
|
21
|
+
</Container>
|
|
22
|
+
<Show when={props.prev || props.next}>
|
|
23
|
+
<DocsPager prev={props.prev} next={props.next}/>
|
|
24
|
+
</Show>
|
|
25
|
+
</Container>
|
|
26
|
+
<Show when={props.showToc && props.currentPage?.url} keyed>
|
|
27
|
+
<Container as="aside" size="sm" class="hidden xl:block w-64 shrink-0 self-start px-0 sticky top-14 z-10 h-fit max-h-[calc(100vh-3.5rem)] overflow-y-auto bg-background">
|
|
28
|
+
<div class="flex flex-col gap-5">
|
|
29
|
+
<DocsTableOfContents items={props.toc} class="max-h-none"/>
|
|
30
|
+
<Show when={props.sidebarPromo}>
|
|
31
|
+
{(promo) => <SidebarPromo promo={promo()}/>}
|
|
32
|
+
</Show>
|
|
33
|
+
</div>
|
|
34
|
+
</Container>
|
|
35
|
+
</Show>
|
|
36
|
+
</Container>);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Accessor, type Component } from "solid-js";
|
|
2
|
+
import type { DocsAiProvider, DocsPageAction } from "../../../types.js";
|
|
3
|
+
export interface PageActionsProps {
|
|
4
|
+
sourceUrl?: string;
|
|
5
|
+
pageActions: readonly DocsPageAction[];
|
|
6
|
+
aiProviders: readonly DocsAiProvider[];
|
|
7
|
+
copyPageEnabled: boolean;
|
|
8
|
+
copyMarkdownEnabled: boolean;
|
|
9
|
+
pageUrl?: string;
|
|
10
|
+
pageTitle?: string;
|
|
11
|
+
markdown: Accessor<string>;
|
|
12
|
+
onCopyPage: () => void;
|
|
13
|
+
onCopyMarkdown: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const PageActions: Component<PageActionsProps>;
|