radiant-docs 0.1.6 → 0.1.8

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 (78) hide show
  1. package/dist/index.js +32 -6
  2. package/package.json +3 -3
  3. package/template/astro.config.mjs +76 -3
  4. package/template/package-lock.json +924 -737
  5. package/template/package.json +7 -5
  6. package/template/scripts/generate-og-images.mjs +335 -0
  7. package/template/scripts/generate-og-metadata.mjs +173 -0
  8. package/template/scripts/rewrite-static-asset-host.mjs +408 -0
  9. package/template/scripts/stamp-image-versions.mjs +277 -0
  10. package/template/scripts/stamp-og-image-versions.mjs +199 -0
  11. package/template/scripts/stamp-pagefind-runtime-version.mjs +140 -0
  12. package/template/src/assets/fonts/geist-mono/cyrillic.woff2 +0 -0
  13. package/template/src/assets/fonts/geist-mono/latin-ext.woff2 +0 -0
  14. package/template/src/assets/fonts/geist-mono/latin.woff2 +0 -0
  15. package/template/src/assets/fonts/google-sans-flex/canadian-aboriginal.woff2 +0 -0
  16. package/template/src/assets/fonts/google-sans-flex/cherokee.woff2 +0 -0
  17. package/template/src/assets/fonts/google-sans-flex/latin-ext.woff2 +0 -0
  18. package/template/src/assets/fonts/google-sans-flex/latin.woff2 +0 -0
  19. package/template/src/assets/fonts/google-sans-flex/math.woff2 +0 -0
  20. package/template/src/assets/fonts/google-sans-flex/nushu.woff2 +0 -0
  21. package/template/src/assets/fonts/google-sans-flex/symbols.woff2 +0 -0
  22. package/template/src/assets/fonts/google-sans-flex/syriac.woff2 +0 -0
  23. package/template/src/assets/fonts/google-sans-flex/tifinagh.woff2 +0 -0
  24. package/template/src/assets/fonts/google-sans-flex/vietnamese.woff2 +0 -0
  25. package/template/src/components/Footer.astro +94 -0
  26. package/template/src/components/Header.astro +11 -66
  27. package/template/src/components/LogoLink.astro +103 -0
  28. package/template/src/components/MdxPage.astro +126 -11
  29. package/template/src/components/OpenApiPage.astro +1036 -69
  30. package/template/src/components/Search.astro +0 -2
  31. package/template/src/components/SidebarDropdown.astro +34 -14
  32. package/template/src/components/SidebarGroup.astro +3 -6
  33. package/template/src/components/SidebarLink.astro +22 -12
  34. package/template/src/components/SidebarMenu.astro +19 -16
  35. package/template/src/components/SidebarSegmented.astro +99 -0
  36. package/template/src/components/SidebarSubgroup.astro +12 -12
  37. package/template/src/components/ThemeSwitcher.astro +30 -7
  38. package/template/src/components/endpoint/PlaygroundBar.astro +32 -36
  39. package/template/src/components/endpoint/PlaygroundButton.astro +40 -4
  40. package/template/src/components/endpoint/PlaygroundField.astro +1068 -22
  41. package/template/src/components/endpoint/PlaygroundForm.astro +559 -61
  42. package/template/src/components/endpoint/RequestSnippets.astro +342 -193
  43. package/template/src/components/endpoint/ResponseDisplay.astro +161 -147
  44. package/template/src/components/endpoint/ResponseFieldTree.astro +134 -0
  45. package/template/src/components/endpoint/ResponseFields.astro +711 -68
  46. package/template/src/components/endpoint/ResponseSnippets.astro +299 -173
  47. package/template/src/components/sidebar/SidebarEndpointLink.astro +1 -1
  48. package/template/src/components/ui/CodeLanguageIcon.astro +19 -0
  49. package/template/src/components/ui/CodeTabEdge.astro +79 -0
  50. package/template/src/components/ui/Field.astro +103 -20
  51. package/template/src/components/ui/Icon.astro +32 -0
  52. package/template/src/components/ui/ListChevronsToggle.astro +31 -0
  53. package/template/src/components/ui/Tag.astro +1 -1
  54. package/template/src/components/user/{Accordian.astro → Accordion.astro} +6 -6
  55. package/template/src/components/user/Callout.astro +5 -9
  56. package/template/src/components/user/CodeBlock.astro +400 -0
  57. package/template/src/components/user/CodeGroup.astro +225 -0
  58. package/template/src/components/user/ComponentPreview.astro +1 -0
  59. package/template/src/components/user/ComponentPreviewBlock.astro +181 -0
  60. package/template/src/components/user/Image.astro +132 -0
  61. package/template/src/components/user/Steps.astro +1 -3
  62. package/template/src/components/user/Tabs.astro +2 -2
  63. package/template/src/content.config.ts +1 -0
  64. package/template/src/layouts/Layout.astro +109 -8
  65. package/template/src/lib/code/code-block.ts +546 -0
  66. package/template/src/lib/frontmatter-schema.ts +8 -7
  67. package/template/src/lib/mdx/remark-code-block-component.ts +342 -0
  68. package/template/src/lib/mdx/remark-demote-h1.ts +16 -0
  69. package/template/src/lib/pagefind.ts +19 -5
  70. package/template/src/lib/routes.ts +49 -31
  71. package/template/src/lib/utils.ts +20 -0
  72. package/template/src/lib/validation.ts +638 -200
  73. package/template/src/pages/[...slug].astro +18 -5
  74. package/template/src/styles/geist-mono.css +33 -0
  75. package/template/src/styles/global.css +89 -84
  76. package/template/src/styles/google-sans-flex.css +143 -0
  77. package/template/ec.config.mjs +0 -51
  78. /package/template/src/components/user/{AccordianGroup.astro → AccordionGroup.astro} +0 -0
@@ -2,7 +2,40 @@
2
2
  import { Icon } from "astro-icon/components";
3
3
  ---
4
4
 
5
- <div x-data="{ open: false }" class="shrink-0 ml-auto">
5
+ <div
6
+ x-data={`{
7
+ open: false,
8
+ backdropInteractionStarted: false,
9
+ openSyncTimeoutId: null,
10
+ init() {
11
+ this.$watch('open', (isOpen) => {
12
+ if (this.openSyncTimeoutId) {
13
+ window.clearTimeout(this.openSyncTimeoutId);
14
+ this.openSyncTimeoutId = null;
15
+ }
16
+
17
+ if (!isOpen) return;
18
+
19
+ window.dispatchEvent(new CustomEvent('rd:playground-opened'));
20
+ this.openSyncTimeoutId = window.setTimeout(() => {
21
+ window.dispatchEvent(new CustomEvent('rd:playground-opened'));
22
+ this.openSyncTimeoutId = null;
23
+ }, 220);
24
+ });
25
+ },
26
+ onOverlayPointerDown(event) {
27
+ this.backdropInteractionStarted = event.target === event.currentTarget;
28
+ },
29
+ onOverlayPointerUp(event) {
30
+ const releasedOnOverlay = event.target === event.currentTarget;
31
+ if (this.backdropInteractionStarted && releasedOnOverlay) {
32
+ this.open = false;
33
+ }
34
+ this.backdropInteractionStarted = false;
35
+ }
36
+ }`}
37
+ class="shrink-0 ml-auto"
38
+ >
6
39
  <button
7
40
  x-on:click="open = true"
8
41
  class="m-px flex items-center gap-1.5 px-4 py-[5px] text-sm font-medium rounded-lg bg-neutral-900 text-white/95 hover:text-white shadow-[inset_0_1px_0_rgb(255,255,255,0.3),0_0_0_1px_var(--color-neutral-800)] duration-200 transition-all whitespace-nowrap cursor-pointer relative before:absolute before:inset-0 before:shadow-sm before:rounded-lg before:bg-transparent"
@@ -29,13 +62,16 @@ import { Icon } from "astro-icon/components";
29
62
  <div
30
63
  x-show="open"
31
64
  x-transition
32
- x-on:click="open = false"
33
- class="relative z-50 flex min-h-screen items-center justify-center p-2 xs:p-4"
65
+ x-on:pointerdown="onOverlayPointerDown($event)"
66
+ x-on:pointerup="onOverlayPointerUp($event)"
67
+ x-on:pointercancel="backdropInteractionStarted = false"
68
+ class="relative z-50 flex min-h-screen items-center justify-center p-2 xs:p-4 md:p-8"
34
69
  >
35
70
  <div
36
71
  x-on:click.stop
72
+ x-on:pointerdown.stop="backdropInteractionStarted = false"
37
73
  x-trap.noscroll.inert="open"
38
- class="relative max-w-7xl w-full rounded-xl bg-white p-4 sm:p-6 shadow-lg"
74
+ class="relative flex max-h-[calc(100dvh-4rem)] max-w-7xl w-full overflow-hidden rounded-xl bg-white p-4 sm:p-6 pb-0! shadow-lg"
39
75
  >
40
76
  <slot />
41
77
  </div>