@umami/shiso 0.55.0 → 0.61.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/CHANGELOG.md +12 -0
- package/README.md +9 -49
- package/bin/shiso.mjs +132 -0
- package/docs.schema.json +835 -0
- package/mdx.config.ts +143 -0
- package/package.json +73 -83
- package/scripts/check-package.mjs +18 -0
- package/scripts/generate-icon-registry.mjs +196 -0
- package/scripts/generate-last-modified.mjs +128 -0
- package/scripts/generate-search-index.mjs +252 -0
- package/scripts/load-docs-config.mjs +244 -0
- package/scripts/prerender.mjs +187 -0
- package/scripts/validate-config.mjs +104 -0
- package/scripts/vite-docs-config.mjs +60 -0
- package/src/App.tsx +39 -0
- package/src/components/Banner.tsx +69 -0
- package/src/components/CodeBlock.tsx +46 -0
- package/src/components/ConfiguredIcon.tsx +15 -0
- package/src/components/ContextualMenu.tsx +93 -0
- package/src/components/DocContent.tsx +100 -0
- package/src/components/Docs.tsx +126 -0
- package/src/components/Footer.tsx +84 -0
- package/src/components/Header.tsx +72 -0
- package/src/components/Layout.tsx +16 -0
- package/src/components/PageLinks.tsx +71 -0
- package/src/components/Search.tsx +208 -0
- package/src/components/SideNav.tsx +347 -0
- package/src/components/SocialIcon.tsx +88 -0
- package/src/components/ThemeToggle.tsx +34 -0
- package/src/components/TopNav.tsx +127 -0
- package/src/components/docs/Accordion.tsx +68 -0
- package/src/components/docs/Badge.tsx +171 -0
- package/src/components/docs/Callout.tsx +73 -0
- package/src/components/docs/Card.tsx +158 -0
- package/src/components/docs/CodeGroup.tsx +73 -0
- package/src/components/docs/Columns.tsx +20 -0
- package/src/components/docs/Expandable.tsx +28 -0
- package/src/components/docs/Frame.tsx +56 -0
- package/src/components/docs/Icon.tsx +30 -0
- package/src/components/docs/ParamField.tsx +45 -0
- package/src/components/docs/PropertiesTable.tsx +84 -0
- package/src/components/docs/ResponseField.tsx +36 -0
- package/src/components/docs/Steps.tsx +47 -0
- package/src/components/docs/Tabs.tsx +116 -0
- package/src/components/docs/Tooltip.tsx +21 -0
- package/src/components/docs/index.ts +15 -0
- package/src/components/docs/styles.ts +82 -0
- package/src/components/docs/utils.ts +118 -0
- package/src/components/icons/index.ts +17 -0
- package/src/components/ui/accordion.tsx +69 -0
- package/src/components/ui/alert.tsx +69 -0
- package/src/components/ui/badge.tsx +49 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/card.tsx +88 -0
- package/src/components/ui/collapsible.tsx +15 -0
- package/src/components/ui/command.tsx +173 -0
- package/src/components/ui/dialog.tsx +137 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/scroll-area.tsx +71 -0
- package/src/components/ui/sheet.tsx +124 -0
- package/src/components/ui/tabs.tsx +73 -0
- package/src/components/ui/tooltip.tsx +52 -0
- package/src/declarations.d.ts +9 -0
- package/src/entry-client.tsx +17 -0
- package/src/entry-server.tsx +77 -0
- package/src/generated/last-modified.ts +2 -0
- package/src/lib/content.ts +44 -0
- package/src/lib/docs-config.ts +682 -0
- package/src/lib/head.ts +220 -0
- package/src/lib/icon-registry.generated.ts +4 -0
- package/src/lib/icons.ts +29 -0
- package/src/lib/inline-markdown.tsx +86 -0
- package/src/lib/mdast.ts +56 -0
- package/src/lib/paths.ts +86 -0
- package/src/lib/remark-toc.ts +71 -0
- package/src/lib/search/config.ts +43 -0
- package/src/lib/search/provider.ts +80 -0
- package/src/lib/search/providers/local.ts +15 -0
- package/src/lib/search-index.generated.ts +4 -0
- package/src/lib/search.ts +100 -0
- package/src/lib/site-config.ts +104 -0
- package/src/lib/site-model.ts +221 -0
- package/src/lib/slug.ts +38 -0
- package/src/lib/types.ts +478 -0
- package/src/lib/utils.ts +6 -0
- package/src/pages/DocPage.tsx +33 -0
- package/src/styles/global.css +268 -0
- package/src/styles/tokens.css +114 -0
- package/types/client.d.ts +3 -0
- package/types/search.d.ts +17 -0
- package/vite.config.ts +342 -0
- package/LICENSE +0 -21
- package/dist/index.css +0 -189
- package/dist/index.d.ts +0 -57
- package/dist/index.js +0 -464
- package/dist/index.mjs +0 -437
- package/server/index.d.ts +0 -30
- package/server/index.js +0 -189
- package/styles.css +0 -4766
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LAST_MODIFIED } from '@/generated/last-modified';
|
|
2
|
+
import { CONTENT_DIR } from '@/lib/paths';
|
|
3
|
+
import type { DocModule } from '@/lib/types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Eagerly imports every content file at build time. Each module exports:
|
|
7
|
+
* - default: the compiled MDX component
|
|
8
|
+
* - frontmatter: parsed YAML frontmatter
|
|
9
|
+
* - toc: heading anchors injected by the remark-toc plugin
|
|
10
|
+
*
|
|
11
|
+
* Eager loading keeps server prerendering and client hydration in sync
|
|
12
|
+
* without Suspense, at the cost of bundling all pages together.
|
|
13
|
+
*
|
|
14
|
+
* The glob pattern must be a literal for Vite to statically analyze it, so it
|
|
15
|
+
* covers all of `content/` and the configured `$shiso.contentDir` is applied at
|
|
16
|
+
* lookup time instead. That also lets later versioned/localized content roots
|
|
17
|
+
* (`content/v2`, `content/es`) work without touching this glob.
|
|
18
|
+
*/
|
|
19
|
+
export const docModules = import.meta.glob('/content/**/*.{md,mdx}', {
|
|
20
|
+
eager: true,
|
|
21
|
+
}) as Record<string, DocModule>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Resolves a docs.json page reference (e.g. "components/tabs") to a module
|
|
25
|
+
* key (e.g. "/content/docs/components/tabs.mdx"). Returns undefined when the
|
|
26
|
+
* file does not exist, which makes config normalization fail at startup/build.
|
|
27
|
+
*/
|
|
28
|
+
export function resolveDocFile(fileSlug: string, contentDir = CONTENT_DIR): string | undefined {
|
|
29
|
+
const candidates = [`/${contentDir}/${fileSlug}.mdx`, `/${contentDir}/${fileSlug}.md`];
|
|
30
|
+
return candidates.find(candidate => candidate in docModules);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getDocModule(filePath: string): DocModule | undefined {
|
|
34
|
+
return docModules[filePath];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Last-modified date of a content file, captured from git history at build
|
|
39
|
+
* time (see scripts/generate-last-modified.mjs). ISO 8601, or undefined for
|
|
40
|
+
* files outside the generated map.
|
|
41
|
+
*/
|
|
42
|
+
export function getLastModified(filePath: string): string | undefined {
|
|
43
|
+
return LAST_MODIFIED[filePath];
|
|
44
|
+
}
|