radiant-docs 0.1.40 → 0.1.42
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/package.json +1 -1
- package/template/astro.config.mjs +42 -40
- package/template/package-lock.json +7 -0
- package/template/package.json +3 -2
- package/template/public/favicon.svg +16 -8
- package/template/scripts/remove-assistant-for-non-pro.mjs +28 -0
- package/template/src/components/Header.astro +151 -17
- package/template/src/components/MdxPage.astro +76 -22
- package/template/src/components/PagePagination.astro +44 -8
- package/template/src/components/Sidebar.astro +10 -1
- package/template/src/components/TableOfContents.astro +159 -53
- package/template/src/components/chat/AssistantDocsWidget.astro +16 -0
- package/template/src/components/chat/AssistantDocsWidget.tsx +615 -0
- package/template/src/components/chat/AssistantEmbedPanel.tsx +2679 -0
- package/template/src/components/chat/AssistantEmbedPanelPage.astro +95 -0
- package/template/src/components/user/Accordion.astro +2 -2
- package/template/src/components/user/AccordionGroup.astro +1 -1
- package/template/src/components/user/Callout.astro +10 -4
- package/template/src/components/user/Card.astro +488 -0
- package/template/src/components/user/CardGradient.astro +964 -0
- package/template/src/components/user/CodeBlock.astro +1 -1
- package/template/src/components/user/CodeGroup.astro +1 -1
- package/template/src/components/user/Column.astro +25 -0
- package/template/src/components/user/Columns.astro +200 -0
- package/template/src/components/user/ComponentPreviewBlock.astro +1 -1
- package/template/src/components/user/Image.astro +1 -1
- package/template/src/components/user/Step.astro +1 -1
- package/template/src/components/user/Steps.astro +1 -1
- package/template/src/components/user/Tab.astro +1 -3
- package/template/src/components/user/Tabs.astro +2 -2
- package/template/src/layouts/Layout.astro +13 -156
- package/template/src/lib/assistant-chrome-defaults.ts +86 -0
- package/template/src/lib/assistant-chrome.ts +39 -0
- package/template/src/lib/assistant-embed-script.ts +1088 -0
- package/template/src/lib/assistant-panel-config.ts +80 -0
- package/template/src/lib/favicon.ts +31 -0
- package/template/src/lib/theme-css.ts +176 -0
- package/template/src/lib/validation.ts +668 -41
- package/template/src/pages/-/assistant/embed.js.ts +15 -0
- package/template/src/pages/-/assistant/panel.astro +5 -0
- package/template/src/pages/404.astro +4 -4
- package/template/src/styles/global.css +81 -4
- package/template/src/components/chat/AskAiWidget.tsx +0 -2011
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { renderAssistantEmbedScript } from "../../../lib/assistant-embed-script";
|
|
2
|
+
import { getConfig } from "../../../lib/validation";
|
|
3
|
+
|
|
4
|
+
export const prerender = true;
|
|
5
|
+
|
|
6
|
+
export async function GET(): Promise<Response> {
|
|
7
|
+
const config = await getConfig();
|
|
8
|
+
|
|
9
|
+
return new Response(renderAssistantEmbedScript(config), {
|
|
10
|
+
headers: {
|
|
11
|
+
"Content-Type": "application/javascript; charset=utf-8",
|
|
12
|
+
"Cache-Control": "no-cache, max-age=0, must-revalidate",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -9,10 +9,10 @@ import Layout from "../layouts/Layout.astro";
|
|
|
9
9
|
pageDescription="The page you requested could not be found."
|
|
10
10
|
>
|
|
11
11
|
<section
|
|
12
|
-
class="mx-auto mt-
|
|
12
|
+
class="mx-auto mt-20 h-full my-auto flex max-w-xl flex-col items-center gap-5 rounded-2xl text-center"
|
|
13
13
|
>
|
|
14
14
|
<p
|
|
15
|
-
class="font-mono text-sm font-medium tracking-[0.22em] text-neutral-500 uppercase dark:
|
|
15
|
+
class="rounded border border-neutral-200 bg-neutral-50 px-1 py-px pr-0.5 font-mono text-sm font-medium tracking-[0.22em] text-neutral-500 uppercase dark:border-neutral-800 dark:bg-neutral-900/60 dark:text-neutral-400"
|
|
16
16
|
>
|
|
17
17
|
404
|
|
18
18
|
</p>
|
|
@@ -27,7 +27,7 @@ import Layout from "../layouts/Layout.astro";
|
|
|
27
27
|
<div class="flex flex-wrap items-center justify-center gap-3">
|
|
28
28
|
<button
|
|
29
29
|
type="button"
|
|
30
|
-
class="inline-flex items-center justify-center gap-1.5 rounded-lg [corner-shape:superellipse(1.2)] border
|
|
30
|
+
class="inline-flex items-center justify-center gap-1.5 rounded-lg [corner-shape:superellipse(1.2)] border border-neutral-200 bg-white px-4 py-2 text-sm font-medium text-neutral-700/85 shadow-xs transition hover:bg-neutral-50 hover:text-neutral-700 dark:border-neutral-800 dark:bg-neutral-900/60 dark:text-neutral-300 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-100 cursor-pointer"
|
|
31
31
|
onclick="history.back()"
|
|
32
32
|
>
|
|
33
33
|
<Icon name="lucide:arrow-big-left-dash" class="size-4" />
|
|
@@ -35,7 +35,7 @@ import Layout from "../layouts/Layout.astro";
|
|
|
35
35
|
</button>
|
|
36
36
|
<a
|
|
37
37
|
href={withBasePath("/")}
|
|
38
|
-
class="inline-flex items-center justify-center gap-2 rounded-lg [corner-shape:superellipse(1.2)] border border-border px-4 py-2 text-sm font-[350]
|
|
38
|
+
class="inline-flex items-center justify-center gap-2 rounded-lg [corner-shape:superellipse(1.2)] border border-border bg-linear-to-b from-neutral-900/85 to-neutral-900 px-4 py-2 text-sm font-[350] text-white shadow-sm transition hover:opacity-95 dark:from-neutral-100 dark:to-neutral-200 dark:font-[450] dark:text-neutral-950"
|
|
39
39
|
>
|
|
40
40
|
<Icon name="lucide:house" class="size-4" />
|
|
41
41
|
Take me home
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
|
|
112
112
|
/* Prose styling */
|
|
113
113
|
.prose-rules {
|
|
114
|
-
@apply
|
|
114
|
+
@apply prose max-w-none *:my-6 *:first:mt-0 *:last:mb-0 prose-h2:mt-7 prose-h2:mb-2 prose-h2:scroll-mt-24 prose-h3:mb-2 prose-h3:scroll-mt-24 prose-headings:font-semibold prose-p:mt-0 prose-p:mb-4 prose-ol:mt-0 prose-ol:mb-5 prose-ul:mt-0 prose-ul:mb-5 prose-a:decoration-(--color-theme) prose-a:decoration-from-font prose-blockquote:border-(--color-theme)/30 dark:prose-blockquote:border-(--color-theme)/30;
|
|
115
115
|
--tw-prose-body: var(--color-neutral-700);
|
|
116
116
|
--tw-prose-headings: var(--color-neutral-900);
|
|
117
117
|
--tw-prose-lead: var(--color-neutral-600);
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
--tw-prose-pre-bg: var(--color-neutral-800);
|
|
135
135
|
--tw-prose-th-borders: var(--color-neutral-300);
|
|
136
136
|
--tw-prose-td-borders: var(--color-neutral-200);
|
|
137
|
-
--tw-prose-invert-body: var(--color-neutral-
|
|
137
|
+
--tw-prose-invert-body: var(--color-neutral-200);
|
|
138
138
|
--tw-prose-invert-headings: white;
|
|
139
139
|
--tw-prose-invert-lead: var(--color-neutral-400);
|
|
140
140
|
--tw-prose-invert-links: white;
|
|
@@ -175,7 +175,54 @@
|
|
|
175
175
|
--tw-prose-td-borders: var(--tw-prose-invert-td-borders);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
.prose-
|
|
178
|
+
.rd-prose-block {
|
|
179
|
+
margin-block: 1.5rem;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.prose-rules > .rd-accordion:has(+ .rd-accordion) {
|
|
183
|
+
margin-block-end: 0 !important;
|
|
184
|
+
margin-bottom: 0 !important;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.prose-rules > .rd-accordion + .rd-accordion {
|
|
188
|
+
margin-block-start: 0 !important;
|
|
189
|
+
margin-top: 0 !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.prose-rules > .react-renderer,
|
|
193
|
+
.prose-rules > [data-node-view-content-react],
|
|
194
|
+
.prose-rules > [data-node-view-content-react] > .react-renderer {
|
|
195
|
+
margin-block: 0 !important;
|
|
196
|
+
max-width: none !important;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@layer base {
|
|
200
|
+
.prose-rules > .rd-prose-block:first-child,
|
|
201
|
+
.prose-rules > .react-renderer:first-child > .rd-prose-block,
|
|
202
|
+
.prose-rules > [data-node-view-content-react]:first-child > :first-child,
|
|
203
|
+
.prose-rules > [data-node-view-content-react] > .rd-prose-block:first-child,
|
|
204
|
+
.prose-rules
|
|
205
|
+
> [data-node-view-content-react]
|
|
206
|
+
> .react-renderer:first-child
|
|
207
|
+
> .rd-prose-block {
|
|
208
|
+
margin-block-start: 0 !important;
|
|
209
|
+
margin-top: 0 !important;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.prose-rules > .rd-prose-block:last-child,
|
|
213
|
+
.prose-rules > .react-renderer:last-child > .rd-prose-block,
|
|
214
|
+
.prose-rules > [data-node-view-content-react]:last-child > :last-child,
|
|
215
|
+
.prose-rules > [data-node-view-content-react] > .rd-prose-block:last-child,
|
|
216
|
+
.prose-rules
|
|
217
|
+
> [data-node-view-content-react]
|
|
218
|
+
> .react-renderer:last-child
|
|
219
|
+
> .rd-prose-block {
|
|
220
|
+
margin-block-end: 0 !important;
|
|
221
|
+
margin-bottom: 0 !important;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.prose-rules :is(h2, h3) {
|
|
179
226
|
@apply relative;
|
|
180
227
|
padding-left: 0.375rem;
|
|
181
228
|
margin-left: -0.375rem;
|
|
@@ -197,8 +244,38 @@
|
|
|
197
244
|
@apply opacity-100;
|
|
198
245
|
}
|
|
199
246
|
|
|
247
|
+
.prose-rules
|
|
248
|
+
:is(h2, h3, h4, h5, h6)
|
|
249
|
+
> .heading-anchor[data-copy-state="copied"] {
|
|
250
|
+
@apply opacity-100 bg-green-500/5 text-green-700/80 dark:bg-green-900/20 dark:text-green-600/80;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.prose-rules .heading-anchor-icons {
|
|
254
|
+
@apply grid size-3.5 place-items-center;
|
|
255
|
+
}
|
|
256
|
+
|
|
200
257
|
.prose-rules .heading-anchor-icon {
|
|
201
|
-
@apply h-3.5 w-3.5;
|
|
258
|
+
@apply col-start-1 row-start-1 h-3.5 w-3.5 origin-center transition-all duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.prose-rules .heading-anchor-link-icon {
|
|
262
|
+
@apply scale-100 rotate-0 opacity-100;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.prose-rules .heading-anchor-check-icon {
|
|
266
|
+
@apply scale-50 rotate-6 opacity-0;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.prose-rules
|
|
270
|
+
.heading-anchor[data-copy-state="copied"]
|
|
271
|
+
.heading-anchor-link-icon {
|
|
272
|
+
@apply scale-50 -rotate-6 opacity-0;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.prose-rules
|
|
276
|
+
.heading-anchor[data-copy-state="copied"]
|
|
277
|
+
.heading-anchor-check-icon {
|
|
278
|
+
@apply scale-110 rotate-0 opacity-100;
|
|
202
279
|
}
|
|
203
280
|
|
|
204
281
|
@media (max-width: 1023px) {
|