@lupinum/ginko-docs 0.4.0-rc.8 → 0.4.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.
Files changed (296) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/LICENSE +1 -1
  3. package/README.md +206 -54
  4. package/app/app.config.ts +42 -55
  5. package/app/assets/docs.css +555 -0
  6. package/app/components/DocsBanner.vue +29 -0
  7. package/app/components/DocsExample.vue +43 -0
  8. package/app/components/DocsFooter.vue +19 -0
  9. package/app/components/DocsHeader.vue +112 -0
  10. package/app/components/DocsLanding.vue +55 -0
  11. package/app/components/DocsLanguage.vue +29 -0
  12. package/app/components/DocsNavTree.vue +38 -0
  13. package/app/components/DocsPage.vue +84 -0
  14. package/app/components/DocsPageActions.vue +47 -0
  15. package/app/components/DocsPost.vue +58 -0
  16. package/app/components/DocsSearch.vue +134 -0
  17. package/app/components/DocsShell.vue +20 -0
  18. package/app/components/DocsSidebar.vue +18 -0
  19. package/app/components/DocsTable.vue +11 -0
  20. package/app/components/DocsThemeToggle.vue +45 -0
  21. package/app/components/DocsToc.vue +73 -0
  22. package/app/composables/useDocs.ts +52 -0
  23. package/app/composables/useDocsBlog.ts +32 -0
  24. package/app/composables/useDocsCopy.ts +17 -0
  25. package/app/composables/useDocsPopover.ts +36 -0
  26. package/app/composables/useDocsSite.ts +10 -0
  27. package/app/docs-pages/blog.vue +47 -0
  28. package/app/docs-pages/changelog.vue +27 -0
  29. package/app/docs-pages/doc.vue +14 -0
  30. package/app/docs-pages/docs.vue +9 -0
  31. package/app/docs-pages/index.vue +12 -0
  32. package/app/docs-pages/post.vue +8 -0
  33. package/app/error.vue +23 -115
  34. package/app/layouts/default.vue +25 -7
  35. package/app/lib/blogTypes.ts +8 -0
  36. package/app/lib/docsFirst.ts +11 -0
  37. package/app/lib/docsInit.ts +18 -0
  38. package/app/lib/docsNav.ts +36 -0
  39. package/app/lib/docsPage.ts +44 -0
  40. package/app/lib/markdownComponents.ts +16 -0
  41. package/app/lib/previewToc.ts +18 -0
  42. package/dist/config.d.mts +232 -0
  43. package/dist/config.d.ts +232 -0
  44. package/dist/config.mjs +114 -0
  45. package/dist/pages.d.mts +5 -0
  46. package/dist/pages.d.ts +5 -0
  47. package/dist/pages.mjs +36 -0
  48. package/dist/shared/ginko-docs.BwbF7JBR.mjs +4 -0
  49. package/i18n/de.json +1 -0
  50. package/i18n/en.json +1 -0
  51. package/icons/README.md +2 -0
  52. package/icons/bluesky.svg +1 -0
  53. package/icons/claude.svg +1 -0
  54. package/icons/discord.svg +1 -0
  55. package/icons/github.svg +1 -0
  56. package/icons/linkedin.svg +1 -0
  57. package/icons/mastodon.svg +1 -0
  58. package/icons/openai.svg +1 -0
  59. package/icons/x.svg +1 -0
  60. package/icons/youtube.svg +1 -0
  61. package/nuxt.config.ts +34 -209
  62. package/package.json +43 -76
  63. package/public/_docs/fonts/LICENSE +188 -0
  64. package/public/_docs/fonts/inter-latin-wght-normal.woff2 +0 -0
  65. package/public/_docs/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  66. package/public/_docs/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
  67. package/server/feeds/blog-locale.get.ts +9 -0
  68. package/server/feeds/blog.get.ts +4 -0
  69. package/server/lib/blogFeed.ts +35 -0
  70. package/server/lib/rss.ts +57 -0
  71. package/server/mcp/handler.ts +108 -0
  72. package/server/routes/__ginko/docs-mcp.ts +35 -0
  73. package/shared/paths.ts +4 -0
  74. package/app/app.vue +0 -98
  75. package/app/assets/css/prose.css +0 -3240
  76. package/app/assets/css/tailwind.css +0 -394
  77. package/app/assets/css/theme-palettes.css +0 -309
  78. package/app/assets/css/theme-presets.css +0 -141
  79. package/app/components/OgImage/GinkoDocs.satori.vue +0 -238
  80. package/app/components/content/DocumentPageShell.vue +0 -55
  81. package/app/components/content/Feedback.vue +0 -102
  82. package/app/components/content/ImageZoomDialog.vue +0 -84
  83. package/app/components/content/PageMarkdownCopy.vue +0 -104
  84. package/app/components/content/imageZoom.ts +0 -25
  85. package/app/components/mdc/MdcAccordion.vue +0 -67
  86. package/app/components/mdc/MdcAccordionItem.vue +0 -42
  87. package/app/components/mdc/MdcApi.vue +0 -159
  88. package/app/components/mdc/MdcAside.vue +0 -23
  89. package/app/components/mdc/MdcCallout.vue +0 -61
  90. package/app/components/mdc/MdcCard.vue +0 -175
  91. package/app/components/mdc/MdcCards.vue +0 -30
  92. package/app/components/mdc/MdcCenter.vue +0 -71
  93. package/app/components/mdc/MdcCodeGroup.vue +0 -197
  94. package/app/components/mdc/MdcCodeTree.vue +0 -234
  95. package/app/components/mdc/MdcCollapse.vue +0 -61
  96. package/app/components/mdc/MdcColumn.vue +0 -70
  97. package/app/components/mdc/MdcDropcap.vue +0 -84
  98. package/app/components/mdc/MdcError.vue +0 -23
  99. package/app/components/mdc/MdcExcerpt.vue +0 -26
  100. package/app/components/mdc/MdcFigure.vue +0 -85
  101. package/app/components/mdc/MdcFiles.vue +0 -120
  102. package/app/components/mdc/MdcIdea.vue +0 -17
  103. package/app/components/mdc/MdcInfo.vue +0 -17
  104. package/app/components/mdc/MdcInlineToc.vue +0 -51
  105. package/app/components/mdc/MdcKbd.vue +0 -10
  106. package/app/components/mdc/MdcLayout.vue +0 -57
  107. package/app/components/mdc/MdcNote.vue +0 -17
  108. package/app/components/mdc/MdcQuiz.vue +0 -241
  109. package/app/components/mdc/MdcQuizQuestion.vue +0 -221
  110. package/app/components/mdc/MdcReadMore.vue +0 -70
  111. package/app/components/mdc/MdcSteps.vue +0 -59
  112. package/app/components/mdc/MdcSuccess.vue +0 -23
  113. package/app/components/mdc/MdcTab.vue +0 -17
  114. package/app/components/mdc/MdcTabs.vue +0 -150
  115. package/app/components/mdc/MdcTimeline.vue +0 -17
  116. package/app/components/mdc/MdcTimelineItem.vue +0 -40
  117. package/app/components/mdc/MdcWarning.vue +0 -23
  118. package/app/components/mdc/api.utils.ts +0 -132
  119. package/app/components/mdc/code-tree.utils.ts +0 -22
  120. package/app/components/mdc/icons.ts +0 -10
  121. package/app/components/mdc/quiz.utils.ts +0 -38
  122. package/app/components/prose/ProseA.vue +0 -27
  123. package/app/components/prose/ProseBlockquote.vue +0 -30
  124. package/app/components/prose/ProseCode.vue +0 -14
  125. package/app/components/prose/ProseEm.vue +0 -14
  126. package/app/components/prose/ProseH1.vue +0 -18
  127. package/app/components/prose/ProseH2.vue +0 -29
  128. package/app/components/prose/ProseH3.vue +0 -29
  129. package/app/components/prose/ProseH4.vue +0 -29
  130. package/app/components/prose/ProseH5.vue +0 -15
  131. package/app/components/prose/ProseH6.vue +0 -15
  132. package/app/components/prose/ProseHr.vue +0 -12
  133. package/app/components/prose/ProseImg.vue +0 -55
  134. package/app/components/prose/ProseLi.vue +0 -14
  135. package/app/components/prose/ProseOl.vue +0 -14
  136. package/app/components/prose/ProseP.vue +0 -14
  137. package/app/components/prose/ProsePre.vue +0 -180
  138. package/app/components/prose/ProseStrong.vue +0 -14
  139. package/app/components/prose/ProseTable.vue +0 -18
  140. package/app/components/prose/ProseTbody.vue +0 -14
  141. package/app/components/prose/ProseTd.vue +0 -14
  142. package/app/components/prose/ProseTh.vue +0 -14
  143. package/app/components/prose/ProseThead.vue +0 -14
  144. package/app/components/prose/ProseTr.vue +0 -14
  145. package/app/components/prose/ProseUl.vue +0 -14
  146. package/app/components/site/ModeToggle.vue +0 -81
  147. package/app/components/site/SiteBanner.vue +0 -97
  148. package/app/components/site/SiteFooter.vue +0 -90
  149. package/app/components/site/SiteHeader.vue +0 -371
  150. package/app/components/site/SiteHeroCode.vue +0 -173
  151. package/app/components/site/SiteInteractionLayer.vue +0 -42
  152. package/app/components/site/SiteLocaleSwitcher.vue +0 -190
  153. package/app/components/site/SiteLogoMark.vue +0 -12
  154. package/app/components/site/SiteSkipLink.vue +0 -14
  155. package/app/components/site/SiteSocialLinks.vue +0 -33
  156. package/app/components/site/header-utils.ts +0 -3
  157. package/app/components/site/mode-toggle.utils.ts +0 -18
  158. package/app/components/ui/badge/Badge.vue +0 -28
  159. package/app/components/ui/badge/index.ts +0 -24
  160. package/app/components/ui/button/Button.vue +0 -31
  161. package/app/components/ui/button/index.ts +0 -35
  162. package/app/components/ui/collapsible/Collapsible.vue +0 -15
  163. package/app/components/ui/collapsible/CollapsibleContent.vue +0 -25
  164. package/app/components/ui/collapsible/CollapsibleTrigger.vue +0 -12
  165. package/app/components/ui/collapsible/index.ts +0 -3
  166. package/app/components/ui/dropdown-menu/DropdownMenu.vue +0 -15
  167. package/app/components/ui/dropdown-menu/DropdownMenuContent.vue +0 -50
  168. package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +0 -41
  169. package/app/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +0 -15
  170. package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +0 -37
  171. package/app/components/ui/dropdown-menu/DropdownMenuSeparator.vue +0 -23
  172. package/app/components/ui/dropdown-menu/DropdownMenuTrigger.vue +0 -14
  173. package/app/components/ui/dropdown-menu/index.ts +0 -7
  174. package/app/components/ui/kbd/Kbd.vue +0 -23
  175. package/app/components/ui/kbd/index.ts +0 -21
  176. package/app/components/ui/scroll-area/ScrollArea.vue +0 -39
  177. package/app/components/ui/scroll-area/ScrollBar.vue +0 -33
  178. package/app/components/ui/scroll-area/index.ts +0 -2
  179. package/app/components/ui/separator/Separator.vue +0 -27
  180. package/app/components/ui/separator/index.ts +0 -1
  181. package/app/components/ui/sheet/Sheet.vue +0 -15
  182. package/app/components/ui/sheet/SheetContent.vue +0 -59
  183. package/app/components/ui/sheet/SheetDescription.vue +0 -21
  184. package/app/components/ui/sheet/SheetOverlay.vue +0 -26
  185. package/app/components/ui/sheet/SheetTitle.vue +0 -21
  186. package/app/components/ui/sheet/SheetTrigger.vue +0 -12
  187. package/app/components/ui/sheet/index.ts +0 -5
  188. package/app/components/ui/tabs/Tabs.vue +0 -24
  189. package/app/components/ui/tabs/TabsList.vue +0 -26
  190. package/app/components/ui/tabs/TabsTrigger.vue +0 -28
  191. package/app/components/ui/tabs/index.ts +0 -3
  192. package/app/composables/site-navigation.utils.ts +0 -133
  193. package/app/composables/useCanonicalUrl.ts +0 -9
  194. package/app/composables/useContentRouteAlternates.ts +0 -35
  195. package/app/composables/useGinkoAnalytics.ts +0 -52
  196. package/app/composables/useGinkoDocsConfig.ts +0 -6
  197. package/app/composables/useGinkoOgImage.ts +0 -20
  198. package/app/composables/useLocalizedPath.ts +0 -12
  199. package/app/composables/useLocalizedRouteSwitch.ts +0 -31
  200. package/app/composables/useMetaKey.ts +0 -18
  201. package/app/composables/usePageMarkdownActions.ts +0 -79
  202. package/app/composables/useProseAppearance.ts +0 -24
  203. package/app/composables/useSchemaJsonLd.ts +0 -25
  204. package/app/composables/useSiteNavigation.ts +0 -64
  205. package/app/config/site.utils.ts +0 -36
  206. package/app/features/docs/components/DocsBreadcrumb.vue +0 -37
  207. package/app/features/docs/components/DocsContributeLinks.vue +0 -75
  208. package/app/features/docs/components/DocsMobileToc.vue +0 -108
  209. package/app/features/docs/components/DocsPageContent.vue +0 -234
  210. package/app/features/docs/components/DocsPageNav.vue +0 -57
  211. package/app/features/docs/components/DocsSidebar.vue +0 -145
  212. package/app/features/docs/components/DocsSidebarDropdown.vue +0 -70
  213. package/app/features/docs/components/DocsSidebarItem.vue +0 -122
  214. package/app/features/docs/components/DocsSidebarList.vue +0 -35
  215. package/app/features/docs/components/DocsSidebarRow.vue +0 -27
  216. package/app/features/docs/components/DocsSidebarTabs.vue +0 -59
  217. package/app/features/docs/components/DocsToc.vue +0 -106
  218. package/app/features/docs/composables/useDocsNavigation.ts +0 -29
  219. package/app/features/docs/composables/useDocsNavigationData.ts +0 -18
  220. package/app/features/docs/composables/useRevealActive.ts +0 -58
  221. package/app/features/docs/composables/useScrollspy.ts +0 -135
  222. package/app/features/docs/docs-navigation.ts +0 -157
  223. package/app/features/docs/toc-context.ts +0 -6
  224. package/app/features/search/command-center.ts +0 -110
  225. package/app/features/search/components/SiteCommandCenter.vue +0 -359
  226. package/app/features/search/components/SiteSearchPageHighlight.vue +0 -126
  227. package/app/features/search/useCommandCenter.ts +0 -292
  228. package/app/layouts/blog.vue +0 -15
  229. package/app/layouts/docs.vue +0 -20
  230. package/app/lib/errors.ts +0 -37
  231. package/app/lib/schema-org.ts +0 -38
  232. package/app/pages/blog/[slug].vue +0 -228
  233. package/app/pages/blog/index.vue +0 -130
  234. package/app/pages/docs/[...slug].vue +0 -10
  235. package/app/pages/docs/index.vue +0 -19
  236. package/app/pages/index.vue +0 -278
  237. package/app/plugins/ginko-docs-theme.ts +0 -14
  238. package/app/plugins/ssr-width.ts +0 -6
  239. package/app/utils/content.ts +0 -67
  240. package/app/utils/file-icons.ts +0 -90
  241. package/app/utils/index.ts +0 -7
  242. package/app/utils/repository.ts +0 -20
  243. package/components.ts +0 -9
  244. package/content-collections.ts +0 -89
  245. package/content.js +0 -200
  246. package/content.ts +0 -104
  247. package/i18n/i18n.config.ts +0 -10
  248. package/i18n/locales.ts +0 -81
  249. package/i18n/messages/global/banner.ts +0 -8
  250. package/i18n/messages/global/blog.ts +0 -18
  251. package/i18n/messages/global/command.ts +0 -49
  252. package/i18n/messages/global/docs.ts +0 -36
  253. package/i18n/messages/global/errors.ts +0 -36
  254. package/i18n/messages/global/feedback.ts +0 -11
  255. package/i18n/messages/global/index.ts +0 -21
  256. package/i18n/messages/global/nav.ts +0 -26
  257. package/i18n/messages/global/site.ts +0 -4
  258. package/i18n/messages/global/theme.ts +0 -9
  259. package/i18n/messages/index.ts +0 -20
  260. package/i18n/messages/localize.ts +0 -35
  261. package/i18n/routes.ts +0 -33
  262. package/icon-bundle.ts +0 -116
  263. package/index.d.ts +0 -37
  264. package/modules/analytics-boundary.ts +0 -23
  265. package/modules/feature-routing.ts +0 -68
  266. package/modules/syntax-highlighting.ts +0 -120
  267. package/public/fonts/public-sans/LICENSE +0 -93
  268. package/public/fonts/public-sans/README.md +0 -12
  269. package/public/fonts/public-sans/public-sans-400-normal-latin.woff +0 -0
  270. package/public/fonts/public-sans/public-sans-500-normal-latin.woff +0 -0
  271. package/public/fonts/public-sans/public-sans-600-normal-latin.woff +0 -0
  272. package/public/fonts/public-sans/public-sans-700-normal-latin.woff +0 -0
  273. package/runtime/generate-favicons.mjs +0 -124
  274. package/runtime/server/agent-markdown.ts +0 -19
  275. package/server/api/_ginko-docs/redirects.get.ts +0 -28
  276. package/server/mcp/tools/get-page.ts +0 -14
  277. package/server/mcp/tools/list-pages.ts +0 -10
  278. package/server/middleware/redirects.ts +0 -22
  279. package/server/plugins/agent-markdown.ts +0 -6
  280. package/server/plugins/sitemap-policy.ts +0 -12
  281. package/server/routes/.well-known/ai-catalog.json.get.ts +0 -10
  282. package/server/routes/[locale]/blog/rss.xml.get.ts +0 -13
  283. package/server/routes/blog/rss.xml.get.ts +0 -5
  284. package/server/routes/mcp/server-card.get.ts +0 -14
  285. package/server/utils/blog-feed.ts +0 -51
  286. package/server/utils/feed.ts +0 -70
  287. package/server/utils/mcp-server-card.ts +0 -45
  288. package/server/utils/redirects.ts +0 -38
  289. package/server/utils/redirects.utils.ts +0 -58
  290. package/server/utils/sitemap.ts +0 -45
  291. package/shared/route-slugs.ts +0 -5
  292. package/shared/theme-palettes.ts +0 -37
  293. package/shared/theme-presets.ts +0 -3
  294. package/shared/types/app-config.ts +0 -172
  295. package/shared/types/nuxt-config.ts +0 -14
  296. package/tags.ts +0 -192
@@ -1,84 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, type CSSProperties } from "vue";
3
- import { cn } from "../../utils";
4
- import type { HTMLAttributes } from "vue";
5
-
6
- const props = withDefaults(
7
- defineProps<{
8
- /**
9
- * Drop cap spans this many line boxes (`initial-letter` size / sink).
10
- * Markdown props may arrive as strings.
11
- */
12
- lines?: number | string;
13
- class?: HTMLAttributes["class"];
14
- }>(),
15
- { lines: 2 },
16
- );
17
-
18
- const lineCount = computed(() => {
19
- const n = Math.round(Number(props.lines));
20
- if (Number.isFinite(n) && n >= 2 && n <= 4) return n;
21
- return 2;
22
- });
23
-
24
- const dropcapStyle = computed(
25
- (): CSSProperties => ({
26
- "--mdc-dropcap-lines": String(lineCount.value),
27
- }),
28
- );
29
- </script>
30
-
31
- <template>
32
- <div
33
- :class="
34
- cn(
35
- 'mdc-dropcap content-prose content-prose-trim not-prose my-6 text-pretty [&>p]:text-muted-foreground',
36
- '[&>p:not(:first-of-type)]:mt-4',
37
- '[&>p:first-of-type]:flow-root',
38
- props.class,
39
- )
40
- "
41
- :style="dropcapStyle"
42
- >
43
- <slot />
44
- </div>
45
- </template>
46
-
47
- <style scoped>
48
- .mdc-dropcap {
49
- --mdc-dropcap-lines: 2;
50
- }
51
-
52
- .mdc-dropcap :deep(p:first-of-type)::first-letter {
53
- font-weight: 600;
54
- color: var(--foreground);
55
- margin-inline-end: 0.15em;
56
- }
57
-
58
- /* CSS Inline Layout 3: typographic alignment vs float hacks (Chrome 110+, Safari + webkit prefix). */
59
- @supports (-webkit-initial-letter: 2) or (initial-letter: 1 1) {
60
- .mdc-dropcap :deep(p:first-of-type)::first-letter {
61
- -webkit-initial-letter: var(--mdc-dropcap-lines);
62
- initial-letter: var(--mdc-dropcap-lines);
63
- }
64
- }
65
-
66
- /* Firefox and legacy: float plus glyph height approximates N line boxes (`lh` ties to paragraph leading). */
67
- @supports (not ((-webkit-initial-letter: 2) or (initial-letter: 1 1))) {
68
- .mdc-dropcap :deep(p:first-of-type)::first-letter {
69
- float: left;
70
- line-height: 1;
71
- margin-top: 0.08em;
72
- margin-bottom: -0.06em;
73
- font-size: calc(var(--mdc-dropcap-lines) * 1.325em);
74
- }
75
-
76
- @supports (font-size: 1lh) {
77
- .mdc-dropcap :deep(p:first-of-type)::first-letter {
78
- font-size: calc(var(--mdc-dropcap-lines) * 1lh);
79
- margin-top: 0.05em;
80
- margin-bottom: -0.06em;
81
- }
82
- }
83
- }
84
- </style>
@@ -1,23 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from "vue";
3
- import MdcCallout from "./MdcCallout.vue";
4
-
5
- const props = defineProps<{
6
- title?: string;
7
- icon?: string;
8
- appearance?: "quiet" | "tint";
9
- class?: HTMLAttributes["class"];
10
- }>();
11
- </script>
12
-
13
- <template>
14
- <MdcCallout
15
- :title="title"
16
- :icon="icon"
17
- type="error"
18
- :appearance="appearance"
19
- :class="props.class"
20
- >
21
- <slot />
22
- </MdcCallout>
23
- </template>
@@ -1,26 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from "vue";
3
- import { useProseAppearance } from "../../composables/useProseAppearance";
4
- import { cn } from "../../utils";
5
-
6
- const props = defineProps<{
7
- label?: string;
8
- source?: string;
9
- appearance?: "quiet" | "tint";
10
- class?: HTMLAttributes["class"];
11
- }>();
12
-
13
- const appearance = useProseAppearance("excerpt", () => props.appearance);
14
- </script>
15
-
16
- <template>
17
- <figure :class="cn('content-excerpt not-prose', props.class)" :data-appearance="appearance">
18
- <p v-if="label" class="content-excerpt-label">
19
- {{ label }}
20
- </p>
21
- <blockquote class="content-excerpt-body content-prose content-prose-trim">
22
- <slot />
23
- </blockquote>
24
- <figcaption v-if="source" class="content-excerpt-source">{{ source }}</figcaption>
25
- </figure>
26
- </template>
@@ -1,85 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from "vue";
3
- import { Motion } from "motion-v";
4
- import { computed } from "vue";
5
- import { useI18n } from "#imports";
6
- import ImageZoomDialog from "#ginko-docs/components/content/ImageZoomDialog.vue";
7
- import { useGinkoDocsConfig } from "#ginko-docs/composables/useGinkoDocsConfig";
8
- import { cn } from "../../utils";
9
- import { useProseAppearance } from "../../composables/useProseAppearance";
10
-
11
- const props = withDefaults(
12
- defineProps<{
13
- src?: string;
14
- alt?: string;
15
- caption?: string;
16
- width?: string | number;
17
- height?: string | number;
18
- bleed?: boolean | string;
19
- aspect?: "auto" | "video" | "wide" | "square" | "portrait";
20
- fit?: "cover" | "contain";
21
- zoom?: boolean | string;
22
- class?: HTMLAttributes["class"];
23
- appearance?: "quiet" | "tint";
24
- }>(),
25
- {
26
- // Vue casts an absent Boolean-typed prop to false; "auto" preserves the
27
- // site-wide images.zoom default unless the author overrides it.
28
- zoom: "auto",
29
- },
30
- );
31
- const appearance = useProseAppearance("figure", () => props.appearance);
32
-
33
- const { t } = useI18n();
34
- const config = useGinkoDocsConfig();
35
- const zoomEnabled = computed(() => {
36
- if (props.zoom === "auto") return config.images?.zoom !== false;
37
- return props.zoom === true || props.zoom === "true";
38
- });
39
- const shouldBleed = computed(
40
- () => props.bleed === true || props.bleed === "true" || props.bleed === "outside",
41
- );
42
-
43
- const aspectClass = computed(() => {
44
- return {
45
- auto: "",
46
- video: "aspect-video",
47
- wide: "aspect-[21/9]",
48
- square: "aspect-square",
49
- portrait: "aspect-[4/5]",
50
- }[props.aspect ?? "auto"];
51
- });
52
-
53
- const imageClass = computed(() =>
54
- cn("w-full", aspectClass.value, props.fit === "contain" ? "object-contain" : "object-cover"),
55
- );
56
- </script>
57
-
58
- <template>
59
- <figure
60
- :class="cn('content-media not-prose', props.class)"
61
- :data-bleed="shouldBleed ? 'true' : undefined"
62
- :data-appearance="appearance"
63
- >
64
- <template v-if="src">
65
- <ImageZoomDialog v-if="zoomEnabled" :src="src" :alt="alt" :label="caption">
66
- <template #trigger="{ layoutId, transition }">
67
- <button
68
- type="button"
69
- class="block w-full cursor-zoom-in rounded-[inherit] focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
70
- :aria-label="`${t('docs.zoomImage')}: ${alt ?? ''}`"
71
- >
72
- <Motion as-child :layout-id="layoutId" :transition="transition">
73
- <img :src="src" :alt="alt" :width="width" :height="height" :class="imageClass" />
74
- </Motion>
75
- </button>
76
- </template>
77
- </ImageZoomDialog>
78
- <img v-else :src="src" :alt="alt" :width="width" :height="height" :class="imageClass" />
79
- </template>
80
- <slot />
81
- <figcaption v-if="caption || alt">
82
- {{ caption || alt }}
83
- </figcaption>
84
- </figure>
85
- </template>
@@ -1,120 +0,0 @@
1
- <script setup lang="ts">
2
- import type { VNode } from "vue";
3
- import { h, resolveComponent, useSlots } from "vue";
4
- import { useProseAppearance } from "../../composables/useProseAppearance";
5
- import { resolveFileIcon } from "../../utils/file-icons";
6
-
7
- type FileEntry = {
8
- name: string;
9
- path: string;
10
- children?: FileEntry[];
11
- };
12
-
13
- const props = defineProps<{
14
- active?: string;
15
- annotations?: Record<string, string>;
16
- appearance?: "quiet" | "tint";
17
- }>();
18
-
19
- const slots = useSlots();
20
- const appearance = useProseAppearance("files", () => props.appearance);
21
-
22
- function childrenOf(node: VNode): VNode[] {
23
- if (Array.isArray(node.children)) return node.children.filter(isVNode);
24
- if (node.children && typeof node.children === "object") {
25
- const slot = (node.children as { default?: () => unknown }).default;
26
- const children = typeof slot === "function" ? slot() : [];
27
- if (Array.isArray(children)) return children.filter(isVNode);
28
- return isVNode(children) ? [children] : [];
29
- }
30
- return [];
31
- }
32
-
33
- function isVNode(value: unknown): value is VNode {
34
- return value !== null && typeof value === "object" && "type" in value;
35
- }
36
-
37
- function textOf(value: unknown): string {
38
- if (typeof value === "string") return value;
39
- if (Array.isArray(value)) return value.map(textOf).join("");
40
- if (!isVNode(value)) return "";
41
- if (typeof value.children === "string") return value.children;
42
- if (value.children && typeof value.children === "object") {
43
- const slot = (value.children as { default?: () => unknown }).default;
44
- if (typeof slot === "function") return textOf(slot());
45
- }
46
- return childrenOf(value).map(textOf).join("");
47
- }
48
-
49
- function parseList(list: VNode, parent = ""): FileEntry[] {
50
- return childrenOf(list)
51
- .map((item) => {
52
- const children = childrenOf(item);
53
- const nested = children.length > 1 ? children.at(-1) : undefined;
54
- const name = children
55
- .filter((node) => node !== nested)
56
- .map(textOf)
57
- .join("")
58
- .trim();
59
- const path = parent ? `${parent}/${name}` : name;
60
- return {
61
- name,
62
- path,
63
- ...(nested ? { children: parseList(nested, path) } : {}),
64
- };
65
- })
66
- .filter((entry) => entry.name.length > 0);
67
- }
68
-
69
- function renderEntries(items: FileEntry[]): VNode {
70
- const Icon = resolveComponent("Icon");
71
- return h(
72
- "ul",
73
- { class: "content-files-list" },
74
- items.map((entry) => {
75
- const folder = Boolean(entry.children);
76
- const active = props.active === entry.path;
77
- return h("li", { key: entry.path, class: "content-files-item" }, [
78
- h(
79
- "div",
80
- {
81
- class: "content-files-row",
82
- "data-active": active || undefined,
83
- "aria-current": active ? "true" : undefined,
84
- },
85
- [
86
- h(Icon, {
87
- name: folder ? "lucide:folder-open" : resolveFileIcon(entry.name),
88
- class: "content-files-icon",
89
- "aria-hidden": "true",
90
- }),
91
- h("span", { class: "content-files-name" }, entry.name),
92
- props.annotations?.[entry.path]
93
- ? h("span", { class: "content-files-annotation" }, props.annotations[entry.path])
94
- : null,
95
- ],
96
- ),
97
- entry.children?.length ? renderEntries(entry.children) : null,
98
- ]);
99
- }),
100
- );
101
- }
102
-
103
- function renderFiles() {
104
- const list = slots.default?.()[0];
105
- const entries = list ? parseList(list) : [];
106
- if (!entries.length) return null;
107
- return h(
108
- "div",
109
- {
110
- class: "content-files not-prose",
111
- "data-appearance": appearance.value,
112
- },
113
- [renderEntries(entries)],
114
- );
115
- }
116
- </script>
117
-
118
- <template>
119
- <component :is="renderFiles" />
120
- </template>
@@ -1,17 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from "vue";
3
- import MdcCallout from "./MdcCallout.vue";
4
-
5
- const props = defineProps<{
6
- title?: string;
7
- icon?: string;
8
- appearance?: "quiet" | "tint";
9
- class?: HTMLAttributes["class"];
10
- }>();
11
- </script>
12
-
13
- <template>
14
- <MdcCallout :title="title" :icon="icon" type="idea" :appearance="appearance" :class="props.class">
15
- <slot />
16
- </MdcCallout>
17
- </template>
@@ -1,17 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from "vue";
3
- import MdcCallout from "./MdcCallout.vue";
4
-
5
- const props = defineProps<{
6
- title?: string;
7
- icon?: string;
8
- appearance?: "quiet" | "tint";
9
- class?: HTMLAttributes["class"];
10
- }>();
11
- </script>
12
-
13
- <template>
14
- <MdcCallout :title="title" :icon="icon" type="info" :appearance="appearance" :class="props.class">
15
- <slot />
16
- </MdcCallout>
17
- </template>
@@ -1,51 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from "vue";
3
- import { computed, inject } from "vue";
4
- import {
5
- Collapsible,
6
- CollapsibleContent,
7
- CollapsibleTrigger,
8
- } from "#ginko-docs/components/ui/collapsible";
9
- import DocsToc from "#ginko-docs/features/docs/components/DocsToc.vue";
10
- import { docsTocKey } from "#ginko-docs/features/docs/toc-context";
11
- import { filterTocByDepth } from "#ginko-docs/utils/content";
12
- import { useI18n } from "#imports";
13
- import { cn } from "../../utils";
14
-
15
- const props = defineProps<{
16
- title?: string;
17
- /** Restrict to headings up to this depth (within the page TOC depth). */
18
- depth?: number;
19
- open?: boolean | string;
20
- class?: HTMLAttributes["class"];
21
- }>();
22
-
23
- const { t } = useI18n();
24
- const pageToc = inject(docsTocKey, undefined);
25
-
26
- const items = computed(() => {
27
- const all = pageToc?.value ?? [];
28
- return props.depth ? filterTocByDepth(all, props.depth) : all;
29
- });
30
-
31
- const defaultOpen = computed(
32
- () => props.open !== undefined && props.open !== false && props.open !== "false",
33
- );
34
- </script>
35
-
36
- <template>
37
- <Collapsible
38
- v-if="items.length"
39
- :default-open="defaultOpen"
40
- :class="cn('content-inline-toc not-prose', props.class)"
41
- >
42
- <CollapsibleTrigger class="content-inline-toc-trigger">
43
- <Icon name="lucide:list" class="content-inline-toc-icon" aria-hidden="true" />
44
- <span class="content-inline-toc-title">{{ title ?? t("docs.toc") }}</span>
45
- <Icon name="lucide:chevron-down" class="content-inline-toc-chevron" aria-hidden="true" />
46
- </CollapsibleTrigger>
47
- <CollapsibleContent class="content-inline-toc-content">
48
- <DocsToc :items="items" :show-title="false" />
49
- </CollapsibleContent>
50
- </Collapsible>
51
- </template>
@@ -1,10 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from "vue";
3
- import { cn } from "../../utils";
4
-
5
- const props = defineProps<{ class?: HTMLAttributes["class"] }>();
6
- </script>
7
-
8
- <template>
9
- <kbd :class="cn('content-kbd', props.class)"><slot /></kbd>
10
- </template>
@@ -1,57 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, provide, type HTMLAttributes } from "vue";
3
- import { cn } from "../../utils";
4
-
5
- type ValueProp<T extends string> = T | { value?: T | string };
6
- type LayoutType = "default" | "card" | "border" | "border-dashed" | "outline" | "outline-dashed";
7
-
8
- const props = withDefaults(
9
- defineProps<{
10
- type?: ValueProp<LayoutType>;
11
- class?: HTMLAttributes["class"];
12
- }>(),
13
- {
14
- type: "default",
15
- },
16
- );
17
-
18
- const layoutTypeValue = computed<LayoutType>(() => {
19
- if (typeof props.type === "string") return props.type;
20
- return (props.type?.value as LayoutType | undefined) ?? "default";
21
- });
22
-
23
- const layoutRowClass = "content-layout-row";
24
-
25
- provide(
26
- "mdc-layout-type",
27
- computed(() => layoutTypeValue.value),
28
- );
29
- provide("mdc-inside-layout", true);
30
- </script>
31
-
32
- <template>
33
- <div :class="cn('content-layout h-full', props.class)">
34
- <div v-if="layoutTypeValue === 'card'" class="w-full">
35
- <div class="h-full">
36
- <div :class="layoutRowClass">
37
- <slot />
38
- </div>
39
- </div>
40
- </div>
41
- <div
42
- v-else
43
- :class="
44
- cn(
45
- layoutRowClass,
46
- 'h-full',
47
- layoutTypeValue === 'border' && 'content-layout-row-border',
48
- layoutTypeValue === 'border-dashed' && 'content-layout-row-border-dashed',
49
- layoutTypeValue === 'outline' && 'content-layout-row-outline',
50
- layoutTypeValue === 'outline-dashed' && 'content-layout-row-outline-dashed',
51
- )
52
- "
53
- >
54
- <slot />
55
- </div>
56
- </div>
57
- </template>
@@ -1,17 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from "vue";
3
- import MdcCallout from "./MdcCallout.vue";
4
-
5
- const props = defineProps<{
6
- title?: string;
7
- icon?: string;
8
- appearance?: "quiet" | "tint";
9
- class?: HTMLAttributes["class"];
10
- }>();
11
- </script>
12
-
13
- <template>
14
- <MdcCallout :title="title" :icon="icon" type="note" :appearance="appearance" :class="props.class">
15
- <slot />
16
- </MdcCallout>
17
- </template>