@publier/shell 2.1.1

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 (141) hide show
  1. package/README.md +1 -0
  2. package/dist/build-integration.d.mts +7 -0
  3. package/dist/build-integration.mjs +1 -0
  4. package/dist/index-DWtFsw7E.d.mts +1033 -0
  5. package/dist/index.d.mts +33 -0
  6. package/dist/index.mjs +1 -0
  7. package/dist/integration-BIJIcnAT.mjs +99 -0
  8. package/dist/integration-CKjtSkwa.d.mts +183 -0
  9. package/dist/integration.d.mts +2 -0
  10. package/dist/integration.mjs +1 -0
  11. package/dist/loaders/index.d.mts +54 -0
  12. package/dist/loaders/index.mjs +1 -0
  13. package/dist/plugins/remark-asides.d.mts +8 -0
  14. package/dist/plugins/remark-asides.mjs +2 -0
  15. package/dist/plugins/remark-snippets.d.mts +11 -0
  16. package/dist/plugins/remark-snippets.mjs +1 -0
  17. package/dist/plugins/remark-structure.d.mts +13 -0
  18. package/dist/plugins/remark-structure.mjs +1 -0
  19. package/dist/plugins/remark-vars.d.mts +7 -0
  20. package/dist/plugins/remark-vars.mjs +1 -0
  21. package/dist/presets-C7z73xlB.d.mts +16 -0
  22. package/dist/presets-DL0qjtya.mjs +1 -0
  23. package/dist/runtime/code-group-sync.d.mts +30 -0
  24. package/dist/runtime/code-group-sync.mjs +103 -0
  25. package/dist/runtime/lazy-upgrade-registry.d.mts +29 -0
  26. package/dist/runtime/lazy-upgrade-registry.mjs +1 -0
  27. package/dist/runtime/tabs-sync.d.mts +25 -0
  28. package/dist/runtime/tabs-sync.mjs +106 -0
  29. package/dist/search/index.d.mts +92 -0
  30. package/dist/search/index.mjs +1 -0
  31. package/dist/tailwind/css-plugin.d.mts +16 -0
  32. package/dist/tailwind/css-plugin.mjs +1 -0
  33. package/dist/tailwind/index.d.mts +6 -0
  34. package/dist/tailwind/index.mjs +1 -0
  35. package/dist/tailwind/loader.d.mts +94 -0
  36. package/dist/tailwind/loader.mjs +2 -0
  37. package/dist/theme-toggle-element-DzFjxwpS.mjs +1 -0
  38. package/dist/themes/almond.css +115 -0
  39. package/dist/themes/aspen.css +95 -0
  40. package/dist/themes/catppuccin.css +98 -0
  41. package/dist/themes/dark.css +98 -0
  42. package/dist/themes/dusk.css +98 -0
  43. package/dist/themes/emerald.css +95 -0
  44. package/dist/themes/light.css +95 -0
  45. package/dist/themes/maple.css +119 -0
  46. package/dist/themes/neutral.css +73 -0
  47. package/dist/themes/ocean.css +98 -0
  48. package/dist/themes/purple.css +95 -0
  49. package/dist/themes/ruby.css +95 -0
  50. package/dist/themes/solar.css +98 -0
  51. package/dist/themes/vitepress.css +95 -0
  52. package/package.json +189 -0
  53. package/publier-gate +0 -0
  54. package/src/astro-modules.d.ts +20 -0
  55. package/src/components/LastModified.astro +25 -0
  56. package/src/components/announcement-banner.astro +25 -0
  57. package/src/components/aside.astro +17 -0
  58. package/src/components/ask-ai.tsx +146 -0
  59. package/src/components/badge.astro +18 -0
  60. package/src/components/breadcrumbs.astro +23 -0
  61. package/src/components/callouts/caution.astro +13 -0
  62. package/src/components/callouts/check.astro +13 -0
  63. package/src/components/callouts/danger.astro +13 -0
  64. package/src/components/callouts/info.astro +13 -0
  65. package/src/components/callouts/note.astro +13 -0
  66. package/src/components/callouts/tip.astro +13 -0
  67. package/src/components/callouts/warning.astro +13 -0
  68. package/src/components/card-grid.astro +14 -0
  69. package/src/components/card.astro +18 -0
  70. package/src/components/code-group.astro +55 -0
  71. package/src/components/columns.astro +18 -0
  72. package/src/components/docs-layout.astro +25 -0
  73. package/src/components/file-tree-node.astro +13 -0
  74. package/src/components/file-tree.astro +9 -0
  75. package/src/components/icon.astro +18 -0
  76. package/src/components/index.ts +155 -0
  77. package/src/components/link-button.astro +21 -0
  78. package/src/components/link-card.astro +21 -0
  79. package/src/components/open-in-ai.astro +13 -0
  80. package/src/components/package-install.astro +17 -0
  81. package/src/components/panels.astro +16 -0
  82. package/src/components/search-button.astro +21 -0
  83. package/src/components/sidebar.astro +12 -0
  84. package/src/components/skip-link.astro +12 -0
  85. package/src/components/steps.astro +13 -0
  86. package/src/components/table-of-contents.astro +22 -0
  87. package/src/components/tabs.astro +17 -0
  88. package/src/components/theme-storage.ts +5 -0
  89. package/src/components/theme-toggle-element.ts +85 -0
  90. package/src/components/theme-toggle.astro +25 -0
  91. package/src/components/tile-grid.astro +13 -0
  92. package/src/components/tile.astro +17 -0
  93. package/src/components/top-nav-mobile.astro +11 -0
  94. package/src/components/top-nav.astro +20 -0
  95. package/src/components/types.ts +510 -0
  96. package/src/components/ui/blur-image.astro +60 -0
  97. package/src/components/ui/changelog-entry.astro +56 -0
  98. package/src/components/ui/cta-band.astro +30 -0
  99. package/src/components/ui/feature-grid.astro +38 -0
  100. package/src/components/ui/feature-section.astro +85 -0
  101. package/src/components/ui/frame.astro +52 -0
  102. package/src/components/ui/hero.astro +47 -0
  103. package/src/components/ui/jobs-list.astro +53 -0
  104. package/src/components/ui/logo-cloud.astro +68 -0
  105. package/src/components/ui/press-gallery.astro +52 -0
  106. package/src/components/ui/pricing-comparison-table.astro +73 -0
  107. package/src/components/ui/pricing-section.astro +113 -0
  108. package/src/components/ui/pricing-table.astro +54 -0
  109. package/src/components/ui/status-indicator.astro +38 -0
  110. package/src/components/ui/team-grid.astro +63 -0
  111. package/src/components/ui/testimonial-card.astro +42 -0
  112. package/src/components/ui/types.ts +323 -0
  113. package/src/components/update-badge.astro +15 -0
  114. package/src/components/version-switcher.astro +20 -0
  115. package/src/icons/index.tsx +246 -0
  116. package/src/icons/resolve.tsx +45 -0
  117. package/src/layouts/base-layout.astro +63 -0
  118. package/src/qwik.ts +3 -0
  119. package/src/routes/blog-index.astro +20 -0
  120. package/src/routes/blog-rss.xml.ts +40 -0
  121. package/src/routes/blog-slug.astro +32 -0
  122. package/src/routes/changelog-index.astro +25 -0
  123. package/src/routes/changelog-rss.xml.ts +47 -0
  124. package/src/routes/docs-slug.astro +31 -0
  125. package/src/routes/not-found.astro +14 -0
  126. package/src/runtime/banner-init.ts +9 -0
  127. package/src/runtime/lazy-upgrade-init.ts +5 -0
  128. package/src/runtime/sidebar-scroll-init.ts +3 -0
  129. package/src/runtime/theme-init.ts +16 -0
  130. package/src/schemas/blog.ts +37 -0
  131. package/src/schemas/changelog.ts +28 -0
  132. package/src/schemas/common.ts +82 -0
  133. package/src/schemas/docs.ts +101 -0
  134. package/src/schemas/index.ts +14 -0
  135. package/src/schemas/pages.ts +22 -0
  136. package/src/styles/base.css +627 -0
  137. package/src/styles/expressive-code.css +41 -0
  138. package/src/styles/rules.css +66 -0
  139. package/src/styles/tailwind-sources.css +17 -0
  140. package/src/tailwind/preset.css +193 -0
  141. package/src/virtual-modules.d.ts +164 -0
@@ -0,0 +1,25 @@
1
+ ---
2
+ import { shellRenderLastModified } from '@publier/native';
3
+
4
+ interface Props {
5
+ date: Date | string | null | undefined;
6
+ format?: 'relative' | 'absolute';
7
+ }
8
+
9
+ const { date, format = 'relative' } = Astro.props;
10
+
11
+ const parsed: Date | null = date
12
+ ? date instanceof Date
13
+ ? Number.isNaN(date.getTime())
14
+ ? null
15
+ : date
16
+ : (() => {
17
+ const d = new Date(date);
18
+ return Number.isNaN(d.getTime()) ? null : d;
19
+ })()
20
+ : null;
21
+
22
+ const html = shellRenderLastModified(parsed ? parsed.getTime() : null, Date.now(), format);
23
+ ---
24
+
25
+ <Fragment set:html={html} />
@@ -0,0 +1,25 @@
1
+ ---
2
+ import { shellRenderAnnouncementBanner } from '@publier/native';
3
+
4
+ export type AnnouncementBannerVariant = 'info' | 'warning' | 'success';
5
+
6
+ interface Props {
7
+ message: string;
8
+ href?: string;
9
+ variant?: AnnouncementBannerVariant;
10
+ dismissible?: boolean;
11
+ storageKey?: string;
12
+ }
13
+
14
+ const {
15
+ message,
16
+ href,
17
+ variant = 'info',
18
+ dismissible = true,
19
+ storageKey = 'publier-banner-dismissed',
20
+ } = Astro.props;
21
+
22
+ const html = shellRenderAnnouncementBanner(message, href ?? null, variant, dismissible, storageKey);
23
+ ---
24
+
25
+ <Fragment set:html={html} />
@@ -0,0 +1,17 @@
1
+ ---
2
+ import { shellRenderAside } from '@publier/native';
3
+
4
+ export type AsideType = 'note' | 'tip' | 'caution' | 'danger';
5
+
6
+ interface Props {
7
+ type?: AsideType;
8
+ title?: string;
9
+ }
10
+
11
+ const { type = 'note', title } = Astro.props;
12
+ const titleId = `publier-aside-${Math.random().toString(36).slice(2, 10)}`;
13
+ const slotHtml = await Astro.slots.render('default');
14
+ const html = shellRenderAside(type, title ?? null, slotHtml, titleId);
15
+ ---
16
+
17
+ <Fragment set:html={html} />
@@ -0,0 +1,146 @@
1
+ import { $, component$, useOnDocument, useSignal, useVisibleTask$ } from '@qwik.dev/core';
2
+ import { MessageCircle, Send, Sparkles, X } from '../icons/index';
3
+
4
+ export const AskAi = component$(() => {
5
+ const open = useSignal(false);
6
+ const input = useSignal('');
7
+ const textareaRef = useSignal<HTMLTextAreaElement>();
8
+
9
+
10
+ useOnDocument(
11
+ 'keydown',
12
+ $((e: Event) => {
13
+ const ke = e as KeyboardEvent;
14
+ if ((ke.metaKey || ke.ctrlKey) && ke.key === '/') {
15
+ ke.preventDefault();
16
+ open.value = !open.value;
17
+ }
18
+ if (ke.key === 'Escape' && open.value) {
19
+ open.value = false;
20
+ }
21
+ }),
22
+ );
23
+
24
+
25
+ useOnDocument(
26
+ 'publier:ai-toggle',
27
+ $(() => {
28
+ open.value = !open.value;
29
+ }),
30
+ );
31
+
32
+
33
+
34
+ // biome-ignore lint/correctness/noQwikUseVisibleTask: focusing a dialog input after it mounts requires DOM access.
35
+ useVisibleTask$(({ track }) => {
36
+ track(() => open.value);
37
+ if (open.value) {
38
+ textareaRef.value?.focus();
39
+ }
40
+ });
41
+
42
+ return (
43
+ <>
44
+ {}
45
+ <button
46
+ type="button"
47
+ class={[
48
+ 'fixed bottom-4 right-4 z-50 inline-flex items-center gap-2 rounded-full border border-border bg-background px-4 py-2.5 text-sm font-medium text-foreground shadow-lg transition-all hover:bg-accent',
49
+ open.value ? 'translate-y-10 opacity-0 pointer-events-none' : '',
50
+ ].join(' ')}
51
+ onClick$={() => {
52
+ open.value = true;
53
+ }}
54
+ aria-label="Ask AI"
55
+ >
56
+ <MessageCircle width={16} height={16} />
57
+ <span>Ask AI</span>
58
+ </button>
59
+
60
+ {}
61
+ {open.value && (
62
+ <>
63
+ {}
64
+ <div
65
+ class="fixed inset-0 z-50 bg-background/80 backdrop-blur-sm lg:hidden"
66
+ onClick$={() => {
67
+ open.value = false;
68
+ }}
69
+ />
70
+
71
+ {}
72
+ <div
73
+ role="dialog"
74
+ aria-modal="true"
75
+ aria-label="Ask AI"
76
+ class="fixed inset-x-2 top-4 z-50 flex flex-col rounded-2xl border border-border bg-background shadow-2xl lg:inset-x-auto lg:inset-y-2 lg:right-2 lg:w-[460px] lg:rounded-xl"
77
+ >
78
+ {}
79
+ <div class="flex items-center justify-between border-b border-border px-4 py-3">
80
+ <div class="flex items-center gap-2">
81
+ <Sparkles width={16} height={16} class="text-primary" />
82
+ <span class="text-sm font-medium">Ask AI</span>
83
+ </div>
84
+ <button
85
+ type="button"
86
+ class="rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
87
+ onClick$={() => {
88
+ open.value = false;
89
+ }}
90
+ aria-label="Close"
91
+ >
92
+ <X width={16} height={16} />
93
+ </button>
94
+ </div>
95
+
96
+ {}
97
+ <div class="flex-1 overflow-y-auto px-4 py-6">
98
+ <div class="flex flex-col items-center justify-center gap-3 text-center text-muted-foreground">
99
+ <div class="flex size-12 items-center justify-center rounded-full bg-accent">
100
+ <Sparkles width={24} height={24} class="text-primary" />
101
+ </div>
102
+ <p class="text-sm font-medium text-foreground">How can I help you?</p>
103
+ <p class="text-xs">Ask a question about the documentation.</p>
104
+ <p class="mt-4 text-xs">AI integration coming soon.</p>
105
+ </div>
106
+ </div>
107
+
108
+ {}
109
+ <div class="border-t border-border p-3">
110
+ <div class="flex items-end gap-2">
111
+ <textarea
112
+ ref={textareaRef}
113
+ class="max-h-32 min-h-[40px] flex-1 resize-none rounded-lg border border-border bg-muted/40 px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary focus:outline-none"
114
+ placeholder="Ask a question..."
115
+ rows={1}
116
+ value={input.value}
117
+ onInput$={(_, el) => {
118
+ input.value = el.value;
119
+ }}
120
+ />
121
+ <button
122
+ type="button"
123
+ class="flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50"
124
+ disabled={!input.value.trim()}
125
+ aria-label="Send"
126
+ >
127
+ <Send width={16} height={16} />
128
+ </button>
129
+ </div>
130
+ <div class="mt-2 flex items-center justify-between text-[10px] text-muted-foreground">
131
+ <span>
132
+ Press{' '}
133
+ <kbd class="rounded border border-border bg-background px-1 py-0.5 font-mono">
134
+ ⌘/
135
+ </kbd>{' '}
136
+ to toggle
137
+ </span>
138
+ <span>Powered by Publier AI</span>
139
+ </div>
140
+ </div>
141
+ </div>
142
+ </>
143
+ )}
144
+ </>
145
+ );
146
+ });
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { shellRenderBadge } from '@publier/native';
3
+
4
+ export type BadgeVariant = 'default' | 'note' | 'tip' | 'caution' | 'danger' | 'success';
5
+ export type BadgeSize = 'small' | 'medium' | 'large';
6
+
7
+ interface Props {
8
+ text: string;
9
+ variant?: BadgeVariant;
10
+ size?: BadgeSize;
11
+ class?: string;
12
+ }
13
+
14
+ const { text, variant = 'default', size = 'medium', class: customClass } = Astro.props;
15
+ const html = shellRenderBadge(text, variant, size, customClass ?? null);
16
+ ---
17
+
18
+ <Fragment set:html={html} />
@@ -0,0 +1,23 @@
1
+ ---
2
+ import { shellRenderBreadcrumbs } from '@publier/native';
3
+
4
+ export interface BreadcrumbItem {
5
+ label: string;
6
+ href?: string;
7
+ }
8
+
9
+ interface Props {
10
+ items: BreadcrumbItem[];
11
+ label?: string;
12
+ class?: string;
13
+ }
14
+
15
+ const { items, label, class: customClass } = Astro.props;
16
+ const html = shellRenderBreadcrumbs(
17
+ JSON.stringify(Array.isArray(items) ? items : []),
18
+ label ?? null,
19
+ customClass ?? null,
20
+ );
21
+ ---
22
+
23
+ <Fragment set:html={html} />
@@ -0,0 +1,13 @@
1
+ ---
2
+ import Aside from '../aside.astro';
3
+
4
+ interface Props {
5
+ title?: string;
6
+ }
7
+
8
+ const { title } = Astro.props;
9
+ ---
10
+
11
+ <Aside type="caution" title={title}>
12
+ <slot />
13
+ </Aside>
@@ -0,0 +1,13 @@
1
+ ---
2
+ import Aside from '../aside.astro';
3
+
4
+ interface Props {
5
+ title?: string;
6
+ }
7
+
8
+ const { title } = Astro.props;
9
+ ---
10
+
11
+ <Aside type="tip" title={title ?? 'Check'}>
12
+ <slot />
13
+ </Aside>
@@ -0,0 +1,13 @@
1
+ ---
2
+ import Aside from '../aside.astro';
3
+
4
+ interface Props {
5
+ title?: string;
6
+ }
7
+
8
+ const { title } = Astro.props;
9
+ ---
10
+
11
+ <Aside type="danger" title={title}>
12
+ <slot />
13
+ </Aside>
@@ -0,0 +1,13 @@
1
+ ---
2
+ import Aside from '../aside.astro';
3
+
4
+ interface Props {
5
+ title?: string;
6
+ }
7
+
8
+ const { title } = Astro.props;
9
+ ---
10
+
11
+ <Aside type="note" title={title ?? 'Info'}>
12
+ <slot />
13
+ </Aside>
@@ -0,0 +1,13 @@
1
+ ---
2
+ import Aside from '../aside.astro';
3
+
4
+ interface Props {
5
+ title?: string;
6
+ }
7
+
8
+ const { title } = Astro.props;
9
+ ---
10
+
11
+ <Aside type="note" title={title}>
12
+ <slot />
13
+ </Aside>
@@ -0,0 +1,13 @@
1
+ ---
2
+ import Aside from '../aside.astro';
3
+
4
+ interface Props {
5
+ title?: string;
6
+ }
7
+
8
+ const { title } = Astro.props;
9
+ ---
10
+
11
+ <Aside type="tip" title={title}>
12
+ <slot />
13
+ </Aside>
@@ -0,0 +1,13 @@
1
+ ---
2
+ import Aside from '../aside.astro';
3
+
4
+ interface Props {
5
+ title?: string;
6
+ }
7
+
8
+ const { title } = Astro.props;
9
+ ---
10
+
11
+ <Aside type="caution" title={title ?? 'Warning'}>
12
+ <slot />
13
+ </Aside>
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { shellRenderCardGrid } from '@publier/native';
3
+
4
+ interface Props {
5
+ minColumnWidth?: string;
6
+ class?: string;
7
+ }
8
+
9
+ const { minColumnWidth = '15rem', class: customClass } = Astro.props;
10
+ const slotHtml = await Astro.slots.render('default');
11
+ const html = shellRenderCardGrid(minColumnWidth, customClass ?? null, slotHtml);
12
+ ---
13
+
14
+ <Fragment set:html={html} />
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { shellRenderCard } from '@publier/native';
3
+
4
+ export type CardVariant = 'default' | 'note' | 'tip' | 'danger' | 'success';
5
+
6
+ interface Props {
7
+ title: string;
8
+ variant?: CardVariant;
9
+ class?: string;
10
+ }
11
+
12
+ const { title, variant = 'default', class: customClass } = Astro.props;
13
+ const iconSlot = Astro.slots.has('icon') ? await Astro.slots.render('icon') : null;
14
+ const slotHtml = await Astro.slots.render('default');
15
+ const html = shellRenderCard(title, variant, customClass ?? null, iconSlot, slotHtml);
16
+ ---
17
+
18
+ <Fragment set:html={html} />
@@ -0,0 +1,55 @@
1
+ ---
2
+ import { Code } from 'astro-expressive-code/components';
3
+
4
+ export interface CodeGroupItem {
5
+ label: string;
6
+ code: string;
7
+ lang?: string;
8
+ filename?: string;
9
+ }
10
+
11
+ interface Props {
12
+ items: CodeGroupItem[];
13
+ syncKey?: string;
14
+ }
15
+
16
+ const { items, syncKey } = Astro.props;
17
+ const id = `publier-cg-${Math.random().toString(36).slice(2, 10)}`;
18
+ ---
19
+
20
+ <tab-container
21
+ class="not-prose my-4 rounded-box overflow-hidden border border-base-300 bg-base-200"
22
+ data-publier-cg
23
+ data-sync-key={syncKey}
24
+ >
25
+ <div role="tablist" class="tabs tabs-border px-2">
26
+ {items.map((item, i) => (
27
+ <button
28
+ type="button"
29
+ role="tab"
30
+ id={`${id}-tab-${i}`}
31
+ aria-controls={`${id}-panel-${i}`}
32
+ aria-selected={i === 0 ? 'true' : 'false'}
33
+ tabindex={i === 0 ? 0 : -1}
34
+ class="tab font-mono"
35
+ data-tab-label={item.label}
36
+ >
37
+ {item.label}
38
+ </button>
39
+ ))}
40
+ </div>
41
+ {items.map((item, i) => (
42
+ <div
43
+ id={`${id}-panel-${i}`}
44
+ role="tabpanel"
45
+ aria-labelledby={`${id}-tab-${i}`}
46
+ hidden={i !== 0}
47
+ >
48
+ <Code
49
+ code={item.code}
50
+ lang={item.lang ?? 'plaintext'}
51
+ title={item.filename}
52
+ />
53
+ </div>
54
+ ))}
55
+ </tab-container>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { shellRenderColumns } from '@publier/native';
3
+
4
+ export type ColumnCount = 2 | 3 | 4;
5
+ export type ColumnGap = 'sm' | 'md' | 'lg';
6
+
7
+ interface Props {
8
+ cols?: ColumnCount;
9
+ gap?: ColumnGap;
10
+ class?: string;
11
+ }
12
+
13
+ const { cols = 2, gap = 'md', class: customClass } = Astro.props;
14
+ const slotHtml = await Astro.slots.render('default');
15
+ const html = shellRenderColumns(cols, gap, customClass ?? null, slotHtml);
16
+ ---
17
+
18
+ <Fragment set:html={html} />
@@ -0,0 +1,25 @@
1
+ ---
2
+ import { shellRenderDocsLayout } from '@publier/native';
3
+
4
+ interface BreadcrumbItem { label: string; href?: string }
5
+ interface Props {
6
+ class?: string;
7
+ breadcrumbs?: BreadcrumbItem[];
8
+ lastModified?: Date | string | null;
9
+ sidebarPersistKey?: string;
10
+ }
11
+
12
+ const { class: customClass, breadcrumbs, lastModified, sidebarPersistKey } = Astro.props;
13
+ const parsed = lastModified instanceof Date ? lastModified : lastModified ? new Date(lastModified) : null;
14
+ const lastModifiedMs = parsed && !Number.isNaN(parsed.getTime()) ? parsed.getTime() : null;
15
+ const [headerHtml, sidebarHtml, tocHtml, footerHtml, defaultHtml] = await Promise.all([
16
+ Astro.slots.render('header'), Astro.slots.render('sidebar'), Astro.slots.render('toc'),
17
+ Astro.slots.render('footer'), Astro.slots.render('default'),
18
+ ]);
19
+ const html = shellRenderDocsLayout(JSON.stringify({
20
+ customClass, breadcrumbs: Array.isArray(breadcrumbs) ? breadcrumbs : [],
21
+ sidebarPersistKey, headerHtml, sidebarHtml, tocHtml, footerHtml, defaultHtml,
22
+ lastModifiedMs, nowMs: Date.now(),
23
+ }));
24
+ ---
25
+ <Fragment set:html={html} />
@@ -0,0 +1,13 @@
1
+ ---
2
+ import { shellRenderFileTreeNode } from '@publier/native';
3
+ import type { FileTreeEntry } from './types.ts';
4
+
5
+ interface Props {
6
+ entry: FileTreeEntry;
7
+ }
8
+
9
+ const { entry } = Astro.props as Props;
10
+ const html = shellRenderFileTreeNode(JSON.stringify(entry));
11
+ ---
12
+
13
+ <Fragment set:html={html} />
@@ -0,0 +1,9 @@
1
+ ---
2
+ import { shellRenderFileTree } from '@publier/native';
3
+ import type { FileTreeProps } from './types.ts';
4
+
5
+ const { tree, label = 'File tree', class: customClass } = Astro.props as FileTreeProps;
6
+ const html = shellRenderFileTree(JSON.stringify(tree), label, customClass ?? null);
7
+ ---
8
+
9
+ <Fragment set:html={html} />
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { shellRenderIcon } from '@publier/native';
3
+ import { getIconDef } from '../icons/index';
4
+
5
+ interface Props {
6
+ name: string;
7
+ size?: number;
8
+ class?: string;
9
+ }
10
+
11
+ const { name, size = 16, class: customClass } = Astro.props;
12
+ const def = getIconDef(name);
13
+ const html = def
14
+ ? shellRenderIcon(def.path, def.fill ?? false, def.viewBox ?? null, def.strokeWidth ?? null, size, customClass ?? null)
15
+ : '';
16
+ ---
17
+
18
+ <Fragment set:html={html} />