@terra-symposium/docs 0.0.0-stage → 0.1.17

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 (241) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +72 -2
  3. package/lib-dist/Docs.d.ts +22 -0
  4. package/lib-dist/Docs.d.ts.map +1 -0
  5. package/lib-dist/Docs.js +60 -0
  6. package/lib-dist/Docs.js.map +1 -0
  7. package/lib-dist/LocalDocsWorkspace.d.ts +30 -0
  8. package/lib-dist/LocalDocsWorkspace.d.ts.map +1 -0
  9. package/lib-dist/LocalDocsWorkspace.js +148 -0
  10. package/lib-dist/LocalDocsWorkspace.js.map +1 -0
  11. package/lib-dist/SiteLayout.d.ts +30 -0
  12. package/lib-dist/SiteLayout.d.ts.map +1 -0
  13. package/lib-dist/SiteLayout.js +34 -0
  14. package/lib-dist/SiteLayout.js.map +1 -0
  15. package/lib-dist/StaticWorkspace.d.ts +21 -0
  16. package/lib-dist/StaticWorkspace.d.ts.map +1 -0
  17. package/lib-dist/StaticWorkspace.js +179 -0
  18. package/lib-dist/StaticWorkspace.js.map +1 -0
  19. package/lib-dist/_Toolbar.d.ts +7 -0
  20. package/lib-dist/_Toolbar.d.ts.map +1 -0
  21. package/lib-dist/_Toolbar.js +85 -0
  22. package/lib-dist/_Toolbar.js.map +1 -0
  23. package/lib-dist/blocks.d.ts +23 -0
  24. package/lib-dist/blocks.d.ts.map +1 -0
  25. package/lib-dist/blocks.js +321 -0
  26. package/lib-dist/blocks.js.map +1 -0
  27. package/lib-dist/docs-catalog.d.ts +5 -0
  28. package/lib-dist/docs-catalog.d.ts.map +1 -0
  29. package/lib-dist/docs-catalog.js +38 -0
  30. package/lib-dist/docs-catalog.js.map +1 -0
  31. package/lib-dist/docs-style.css +31 -0
  32. package/lib-dist/fonts/Avara-Bold.woff2 +0 -0
  33. package/lib-dist/fonts/Avara-BoldItalic.woff2 +0 -0
  34. package/lib-dist/fonts/OFL-1.1.txt +93 -0
  35. package/lib-dist/fonts/README.md +5 -0
  36. package/lib-dist/host-runtime.d.ts +5 -0
  37. package/lib-dist/host-runtime.d.ts.map +1 -0
  38. package/lib-dist/host-runtime.js +21 -0
  39. package/lib-dist/host-runtime.js.map +1 -0
  40. package/lib-dist/host.d.ts +170 -0
  41. package/lib-dist/host.d.ts.map +1 -0
  42. package/lib-dist/host.js +2 -0
  43. package/lib-dist/host.js.map +1 -0
  44. package/lib-dist/index.d.ts +35 -0
  45. package/lib-dist/index.d.ts.map +1 -0
  46. package/lib-dist/index.js +28 -0
  47. package/lib-dist/index.js.map +1 -0
  48. package/lib-dist/markdown-model.d.ts +7 -0
  49. package/lib-dist/markdown-model.d.ts.map +1 -0
  50. package/lib-dist/markdown-model.js +181 -0
  51. package/lib-dist/markdown-model.js.map +1 -0
  52. package/lib-dist/markdown.d.ts +3 -0
  53. package/lib-dist/markdown.d.ts.map +1 -0
  54. package/lib-dist/markdown.js +83 -0
  55. package/lib-dist/markdown.js.map +1 -0
  56. package/lib-dist/navigation.d.ts +17 -0
  57. package/lib-dist/navigation.d.ts.map +1 -0
  58. package/lib-dist/navigation.js +9 -0
  59. package/lib-dist/navigation.js.map +1 -0
  60. package/lib-dist/schema.d.ts +135 -0
  61. package/lib-dist/schema.d.ts.map +1 -0
  62. package/lib-dist/schema.js +55 -0
  63. package/lib-dist/schema.js.map +1 -0
  64. package/lib-dist/style.css +1 -0
  65. package/lib-dist/terra/Workspace.d.ts +5 -0
  66. package/lib-dist/terra/Workspace.d.ts.map +1 -0
  67. package/lib-dist/terra/Workspace.js +9 -0
  68. package/lib-dist/terra/Workspace.js.map +1 -0
  69. package/lib-dist/terra/editor/TerraContentEditor.d.ts +10 -0
  70. package/lib-dist/terra/editor/TerraContentEditor.d.ts.map +1 -0
  71. package/lib-dist/terra/editor/TerraContentEditor.js +47 -0
  72. package/lib-dist/terra/editor/TerraContentEditor.js.map +1 -0
  73. package/lib-dist/terra/editor/_blocks.d.ts +71 -0
  74. package/lib-dist/terra/editor/_blocks.d.ts.map +1 -0
  75. package/lib-dist/terra/editor/_blocks.js +110 -0
  76. package/lib-dist/terra/editor/_blocks.js.map +1 -0
  77. package/lib-dist/terra/editor/docs/_Callout.d.ts +14 -0
  78. package/lib-dist/terra/editor/docs/_Callout.d.ts.map +1 -0
  79. package/lib-dist/terra/editor/docs/_Callout.js +41 -0
  80. package/lib-dist/terra/editor/docs/_Callout.js.map +1 -0
  81. package/lib-dist/terra/editor/docs/_CodeBlock.d.ts +39 -0
  82. package/lib-dist/terra/editor/docs/_CodeBlock.d.ts.map +1 -0
  83. package/lib-dist/terra/editor/docs/_CodeBlock.js +494 -0
  84. package/lib-dist/terra/editor/docs/_CodeBlock.js.map +1 -0
  85. package/lib-dist/terra/editor/docs/_DocsCode.d.ts +14 -0
  86. package/lib-dist/terra/editor/docs/_DocsCode.d.ts.map +1 -0
  87. package/lib-dist/terra/editor/docs/_DocsCode.js +95 -0
  88. package/lib-dist/terra/editor/docs/_DocsCode.js.map +1 -0
  89. package/lib-dist/terra/editor/docs/_DocsImage.d.ts +18 -0
  90. package/lib-dist/terra/editor/docs/_DocsImage.d.ts.map +1 -0
  91. package/lib-dist/terra/editor/docs/_DocsImage.js +62 -0
  92. package/lib-dist/terra/editor/docs/_DocsImage.js.map +1 -0
  93. package/lib-dist/terra/editor/docs/_Embed.d.ts +15 -0
  94. package/lib-dist/terra/editor/docs/_Embed.d.ts.map +1 -0
  95. package/lib-dist/terra/editor/docs/_Embed.js +27 -0
  96. package/lib-dist/terra/editor/docs/_Embed.js.map +1 -0
  97. package/lib-dist/terra/editor/docs/_Math.d.ts +31 -0
  98. package/lib-dist/terra/editor/docs/_Math.d.ts.map +1 -0
  99. package/lib-dist/terra/editor/docs/_Math.js +126 -0
  100. package/lib-dist/terra/editor/docs/_Math.js.map +1 -0
  101. package/lib-dist/terra/editor/docs/_Nodes.d.ts +15 -0
  102. package/lib-dist/terra/editor/docs/_Nodes.d.ts.map +1 -0
  103. package/lib-dist/terra/editor/docs/_Nodes.js +52 -0
  104. package/lib-dist/terra/editor/docs/_Nodes.js.map +1 -0
  105. package/lib-dist/terra/editor/docs/_Raw.d.ts +15 -0
  106. package/lib-dist/terra/editor/docs/_Raw.d.ts.map +1 -0
  107. package/lib-dist/terra/editor/docs/_Raw.js +26 -0
  108. package/lib-dist/terra/editor/docs/_Raw.js.map +1 -0
  109. package/lib-dist/terra/editor/docs/_Table.d.ts +12 -0
  110. package/lib-dist/terra/editor/docs/_Table.d.ts.map +1 -0
  111. package/lib-dist/terra/editor/docs/_Table.js +71 -0
  112. package/lib-dist/terra/editor/docs/_Table.js.map +1 -0
  113. package/lib-dist/terra/editor/docs/_Tabs.d.ts +14 -0
  114. package/lib-dist/terra/editor/docs/_Tabs.d.ts.map +1 -0
  115. package/lib-dist/terra/editor/docs/_Tabs.js +104 -0
  116. package/lib-dist/terra/editor/docs/_Tabs.js.map +1 -0
  117. package/lib-dist/terra/editor/docs/_TsDocs.d.ts +15 -0
  118. package/lib-dist/terra/editor/docs/_TsDocs.d.ts.map +1 -0
  119. package/lib-dist/terra/editor/docs/_TsDocs.js +81 -0
  120. package/lib-dist/terra/editor/docs/_TsDocs.js.map +1 -0
  121. package/lib-dist/terra/editor/docs/_math_inline.d.ts +14 -0
  122. package/lib-dist/terra/editor/docs/_math_inline.d.ts.map +1 -0
  123. package/lib-dist/terra/editor/docs/_math_inline.js +30 -0
  124. package/lib-dist/terra/editor/docs/_math_inline.js.map +1 -0
  125. package/lib-dist/terra/editor/docs/heading.d.ts +23 -0
  126. package/lib-dist/terra/editor/docs/heading.d.ts.map +1 -0
  127. package/lib-dist/terra/editor/docs/heading.js +60 -0
  128. package/lib-dist/terra/editor/docs/heading.js.map +1 -0
  129. package/lib-dist/terra/editor/docs/index.d.ts +13 -0
  130. package/lib-dist/terra/editor/docs/index.d.ts.map +1 -0
  131. package/lib-dist/terra/editor/docs/index.js +14 -0
  132. package/lib-dist/terra/editor/docs/index.js.map +1 -0
  133. package/lib-dist/terra/editor/types.d.ts +40 -0
  134. package/lib-dist/terra/editor/types.d.ts.map +1 -0
  135. package/lib-dist/terra/editor/types.js +11 -0
  136. package/lib-dist/terra/editor/types.js.map +1 -0
  137. package/lib-dist/terra/flow/Nodes.d.ts +78 -0
  138. package/lib-dist/terra/flow/Nodes.d.ts.map +1 -0
  139. package/lib-dist/terra/flow/Nodes.js +912 -0
  140. package/lib-dist/terra/flow/Nodes.js.map +1 -0
  141. package/lib-dist/terra/flow/_chrome.d.ts +267 -0
  142. package/lib-dist/terra/flow/_chrome.d.ts.map +1 -0
  143. package/lib-dist/terra/flow/_chrome.js +798 -0
  144. package/lib-dist/terra/flow/_chrome.js.map +1 -0
  145. package/lib-dist/terra/flow/_layout.d.ts +30 -0
  146. package/lib-dist/terra/flow/_layout.d.ts.map +1 -0
  147. package/lib-dist/terra/flow/_layout.js +53 -0
  148. package/lib-dist/terra/flow/_layout.js.map +1 -0
  149. package/lib-dist/terra/flow/menuContext.d.ts +13 -0
  150. package/lib-dist/terra/flow/menuContext.d.ts.map +1 -0
  151. package/lib-dist/terra/flow/menuContext.js +10 -0
  152. package/lib-dist/terra/flow/menuContext.js.map +1 -0
  153. package/lib-dist/terra/flow/powerSource.d.ts +16 -0
  154. package/lib-dist/terra/flow/powerSource.d.ts.map +1 -0
  155. package/lib-dist/terra/flow/powerSource.js +59 -0
  156. package/lib-dist/terra/flow/powerSource.js.map +1 -0
  157. package/lib-dist/terra/pages/docs/_attachments.d.ts +20 -0
  158. package/lib-dist/terra/pages/docs/_attachments.d.ts.map +1 -0
  159. package/lib-dist/terra/pages/docs/_attachments.js +904 -0
  160. package/lib-dist/terra/pages/docs/_attachments.js.map +1 -0
  161. package/lib-dist/terra/pages/docs/_blocks.d.ts +48 -0
  162. package/lib-dist/terra/pages/docs/_blocks.d.ts.map +1 -0
  163. package/lib-dist/terra/pages/docs/_blocks.js +192 -0
  164. package/lib-dist/terra/pages/docs/_blocks.js.map +1 -0
  165. package/lib-dist/terra/pages/docs/_custom.d.ts +5 -0
  166. package/lib-dist/terra/pages/docs/_custom.d.ts.map +1 -0
  167. package/lib-dist/terra/pages/docs/_custom.js +6 -0
  168. package/lib-dist/terra/pages/docs/_custom.js.map +1 -0
  169. package/lib-dist/terra/pages/docs/_editable.d.ts +61 -0
  170. package/lib-dist/terra/pages/docs/_editable.d.ts.map +1 -0
  171. package/lib-dist/terra/pages/docs/_editable.js +404 -0
  172. package/lib-dist/terra/pages/docs/_editable.js.map +1 -0
  173. package/lib-dist/terra/pages/docs/_export-dialog.d.ts +19 -0
  174. package/lib-dist/terra/pages/docs/_export-dialog.d.ts.map +1 -0
  175. package/lib-dist/terra/pages/docs/_export-dialog.js +78 -0
  176. package/lib-dist/terra/pages/docs/_export-dialog.js.map +1 -0
  177. package/lib-dist/terra/pages/docs/_helpers.d.ts +395 -0
  178. package/lib-dist/terra/pages/docs/_helpers.d.ts.map +1 -0
  179. package/lib-dist/terra/pages/docs/_helpers.js +911 -0
  180. package/lib-dist/terra/pages/docs/_helpers.js.map +1 -0
  181. package/lib-dist/terra/pages/docs/_icons.d.ts +20 -0
  182. package/lib-dist/terra/pages/docs/_icons.d.ts.map +1 -0
  183. package/lib-dist/terra/pages/docs/_icons.js +29 -0
  184. package/lib-dist/terra/pages/docs/_icons.js.map +1 -0
  185. package/lib-dist/terra/pages/docs/_main.d.ts +51 -0
  186. package/lib-dist/terra/pages/docs/_main.d.ts.map +1 -0
  187. package/lib-dist/terra/pages/docs/_main.js +1959 -0
  188. package/lib-dist/terra/pages/docs/_main.js.map +1 -0
  189. package/lib-dist/terra/pages/docs/_sidebar.d.ts +42 -0
  190. package/lib-dist/terra/pages/docs/_sidebar.d.ts.map +1 -0
  191. package/lib-dist/terra/pages/docs/_sidebar.js +2450 -0
  192. package/lib-dist/terra/pages/docs/_sidebar.js.map +1 -0
  193. package/lib-dist/terra/pages/docs/_toolbar.d.ts +23 -0
  194. package/lib-dist/terra/pages/docs/_toolbar.d.ts.map +1 -0
  195. package/lib-dist/terra/pages/docs/_toolbar.js +1539 -0
  196. package/lib-dist/terra/pages/docs/_toolbar.js.map +1 -0
  197. package/lib-dist/terra/pages/docs/_tree.d.ts +178 -0
  198. package/lib-dist/terra/pages/docs/_tree.d.ts.map +1 -0
  199. package/lib-dist/terra/pages/docs/_tree.js +1168 -0
  200. package/lib-dist/terra/pages/docs/_tree.js.map +1 -0
  201. package/lib-dist/terra/regex.mjs +398 -0
  202. package/lib-dist/terra/runtime/action-proxy.d.ts +5 -0
  203. package/lib-dist/terra/runtime/action-proxy.d.ts.map +1 -0
  204. package/lib-dist/terra/runtime/action-proxy.js +19 -0
  205. package/lib-dist/terra/runtime/action-proxy.js.map +1 -0
  206. package/lib-dist/terra/runtime/content.d.ts +150 -0
  207. package/lib-dist/terra/runtime/content.d.ts.map +1 -0
  208. package/lib-dist/terra/runtime/content.js +1171 -0
  209. package/lib-dist/terra/runtime/content.js.map +1 -0
  210. package/lib-dist/terra/runtime/leaf.d.ts +5 -0
  211. package/lib-dist/terra/runtime/leaf.d.ts.map +1 -0
  212. package/lib-dist/terra/runtime/leaf.js +13 -0
  213. package/lib-dist/terra/runtime/leaf.js.map +1 -0
  214. package/lib-dist/terra/runtime/nodes.d.ts +112 -0
  215. package/lib-dist/terra/runtime/nodes.d.ts.map +1 -0
  216. package/lib-dist/terra/runtime/nodes.js +534 -0
  217. package/lib-dist/terra/runtime/nodes.js.map +1 -0
  218. package/lib-dist/terra/runtime/runtime.d.ts +25 -0
  219. package/lib-dist/terra/runtime/runtime.d.ts.map +1 -0
  220. package/lib-dist/terra/runtime/runtime.js +50 -0
  221. package/lib-dist/terra/runtime/runtime.js.map +1 -0
  222. package/lib-dist/terra/runtime/shared.d.ts +35 -0
  223. package/lib-dist/terra/runtime/shared.d.ts.map +1 -0
  224. package/lib-dist/terra/runtime/shared.js +79 -0
  225. package/lib-dist/terra/runtime/shared.js.map +1 -0
  226. package/lib-dist/terra/runtime/types.d.ts +266 -0
  227. package/lib-dist/terra/runtime/types.d.ts.map +1 -0
  228. package/lib-dist/terra/runtime/types.js +18 -0
  229. package/lib-dist/terra/runtime/types.js.map +1 -0
  230. package/lib-dist/terra/runtime/ui.d.ts +31 -0
  231. package/lib-dist/terra/runtime/ui.d.ts.map +1 -0
  232. package/lib-dist/terra/runtime/ui.js +16 -0
  233. package/lib-dist/terra/runtime/ui.js.map +1 -0
  234. package/lib-dist/workspace.d.ts +78 -0
  235. package/lib-dist/workspace.d.ts.map +1 -0
  236. package/lib-dist/workspace.js +151 -0
  237. package/lib-dist/workspace.js.map +1 -0
  238. package/package.json +90 -3
  239. package/src/SiteLayout.astro +38 -0
  240. package/src/navigation.tsx +47 -0
  241. package/src/style.css +733 -0
@@ -0,0 +1,95 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // @ts-nocheck -- source-preserving extraction; public host contracts are typed in src/host.ts.
3
+ /** Docs code block renderer with view and edit modes. */
4
+ import { useEditor } from '@portabletext/editor';
5
+ import { useEffect, useRef, useState } from 'react';
6
+ import { ErrorBoundary } from '../../runtime/ui.js';
7
+ import { Button } from '@terra-symposium/styling/ui/terra-original';
8
+ import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@terra-symposium/styling/ui/terra-original';
9
+ import { Input } from '@terra-symposium/styling/ui/terra-original';
10
+ import { Label } from '@terra-symposium/styling/ui/terra-original';
11
+ import { CodeBlock } from './_CodeBlock.js';
12
+ /** Renders a Docs code block from its authored block.
13
+ *
14
+ * @param props - Authored code block and its language, title, and display settings.
15
+ * @returns The authored code block and its preview.
16
+ */
17
+ function Code({ block }) {
18
+ return (_jsx(ErrorBoundary, { name: 'Code', children: _jsx(CodeBlock, { code: block.value ?? '', language: block.language ?? 'text', source: block.source, tone: 'view' }) }));
19
+ }
20
+ Object.assign(Code, { displayName: 'DocsCodePreview' });
21
+ /** Adapts Portable Text's block-object contract to the code renderer. */
22
+ /**
23
+ * Renders the renderCode component.
24
+ *
25
+ * @param props - Portable Text renderer attributes, nested children, code block node, path, and read-only mode.
26
+ * @returns The code block renderer in editable or read-only mode.
27
+ */
28
+ export function renderCode({ attributes: attrs, children, node, path, readOnly }) {
29
+ return readOnly ? _jsx(Code, { block: node }) : _jsx(CodeEditor, { attributes: attrs, children: children, node: node, path: path });
30
+ }
31
+ Object.assign(renderCode, { displayName: 'DocsCodeRenderer' });
32
+ /** Connects the code block's local controls to its Portable Text state. */
33
+ /**
34
+ * Renders the CodeEditor component.
35
+ *
36
+ * @param props - Portable Text editor attributes, nested children, code node, and path used to update code content.
37
+ * @returns The editable code block controls.
38
+ */
39
+ function CodeEditor({ attributes: attrs, children, node, path }) {
40
+ const editor = useEditor();
41
+ const code = node;
42
+ const [endpoint, setEndpoint] = useState(code.source ?? '');
43
+ const [endpointDialog, setEndpointDialog] = useState(null);
44
+ const boundary = useRef(null);
45
+ useEffect(() => {
46
+ if (!boundary.current)
47
+ return;
48
+ const stop = (e) => e.stopPropagation();
49
+ const es = ['beforeinput', 'input', 'keydown', 'keyup', 'paste', 'copy', 'cut', 'focusin', 'focusout', 'pointerdown', 'pointerup'];
50
+ const element = boundary.current;
51
+ for (const e of es)
52
+ element.addEventListener(e, stop);
53
+ return () => {
54
+ for (const e of es)
55
+ element.removeEventListener(e, stop);
56
+ };
57
+ }, [code.source]);
58
+ useEffect(() => {
59
+ if (!boundary.current)
60
+ return;
61
+ const block = boundary.current;
62
+ block.__blockActions = code.source
63
+ ? [
64
+ {
65
+ text: 'Change API endpoint',
66
+ onSelect: () => setEndpointDialog('change'),
67
+ },
68
+ {
69
+ text: 'Convert to local definition',
70
+ onSelect: () => {
71
+ const received = boundary.current?.querySelector('[data-docs-code-received][data-state="received"]');
72
+ if (!received)
73
+ return;
74
+ const { source: _source, ...localCode } = code;
75
+ editor.send({ type: 'set', at: path, value: { ...localCode, language: code.language ?? 'json', value: received.textContent ?? '' } });
76
+ },
77
+ },
78
+ ]
79
+ : [{ text: 'Convert to received value', onSelect: () => setEndpointDialog('receive') }];
80
+ return () => {
81
+ delete block.__blockActions;
82
+ };
83
+ }, [code.language, code.source, editor, path]);
84
+ useEffect(() => setEndpoint(code.source ?? ''), [code.source]);
85
+ const update = (val, lang = code.language ?? 'text') => editor.send({ type: 'block.set', at: path, props: { language: lang, source: code.source, value: val } });
86
+ return (_jsx(ErrorBoundary, { name: 'CodeBlock', children: _jsxs(_Fragment, { children: [_jsxs("div", { ...attrs, ref: boundary, contentEditable: false, "data-terra-block": 'code', "data-docs-editor-block": 'code', children: [_jsx(CodeBlock, { code: code.value ?? '', expandAll: true, language: code.language ?? 'text', source: code.source, tone: 'edit', onCodeChange: v => update(v), onCommit: (v, l) => update(v, l), onLanguageChange: (l, v) => update(v, l) }), children] }), _jsx(Dialog, { open: endpointDialog !== null, onOpenChange: open => !open && setEndpointDialog(null), children: _jsxs(DialogContent, { "aria-describedby": undefined, children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: endpointDialog === 'receive' ? 'Convert to received value' : 'Change API endpoint' }) }), _jsx(Label, { htmlFor: 'docs-code-endpoint', children: "API endpoint" }), _jsx(Input, { id: 'docs-code-endpoint', value: endpoint, onChange: e => setEndpoint(e.currentTarget.value) }), _jsxs("div", { className: 'flex justify-end gap-2', children: [_jsx(Button, { variant: 'outline', onClick: () => setEndpointDialog(null), children: "Cancel" }), _jsx(Button, { disabled: !endpoint.trim(), onClick: () => {
87
+ const src = endpoint.trim();
88
+ if (!src)
89
+ return;
90
+ editor.send({ type: 'set', at: path, value: { ...code, language: code.language ?? 'json', source: src, value: code.value ?? '' } });
91
+ setEndpointDialog(null);
92
+ }, children: endpointDialog === 'receive' ? 'Receive value' : 'Change API endpoint' })] })] }) })] }) }));
93
+ }
94
+ Object.assign(CodeEditor, { displayName: 'DocsCodeEditor' });
95
+ //# sourceMappingURL=_DocsCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_DocsCode.js","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_DocsCode.tsx"],"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+ * astro/src/components/editor/docs/_DocsImage.tsx
3
+ * Docs image renderer with view and edit modes.
4
+ */
5
+ import type { DocsBlock, PortableTextBlockRendererProps } from '../types.js';
6
+ /** Sanity Portable Text image fields authored in documentation content. */
7
+ type DocsImgBlock = DocsBlock<'docImage'>;
8
+ /** Adapts Portable Text's block-object contract to the image renderer. */
9
+ /**
10
+ * Renders the renderImage component.
11
+ *
12
+ * @param props - Portable Text renderer attributes, nested children, image node, path, and read-only mode.
13
+ *
14
+ * @return The image renderer in editable or read-only mode.
15
+ */
16
+ export declare function renderImage({ attributes: attrs, children, node, path, readOnly }: PortableTextBlockRendererProps<DocsImgBlock>): JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=_DocsImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_DocsImage.d.ts","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_DocsImage.tsx"],"names":[],"mappings":"AACA;;;GAGG;AAkBH,OAAO,KAAK,EAAE,SAAS,EAAgC,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAM3G,2EAA2E;AAC3E,KAAK,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AAoC1C,0EAA0E;AAC1E;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,8BAA8B,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,OAAO,CAE5I"}
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // @ts-nocheck -- source-preserving extraction; public host contracts are typed in src/host.ts.
3
+ /**
4
+ * astro/src/components/editor/docs/_DocsImage.tsx
5
+ * Docs image renderer with view and edit modes.
6
+ */
7
+ /*//////////////////////////////////////////////////
8
+ IMPORTS
9
+ //////////////////////////////////////////////////*/
10
+ // API
11
+ import { useEditor } from '@portabletext/editor';
12
+ // COMPONENTS
13
+ import { AlertError } from '@terra-symposium/styling/ui/terra-original';
14
+ import { Button } from '@terra-symposium/styling/ui/terra-original';
15
+ import { ErrorBoundary } from '../../runtime/ui.js';
16
+ import { Empty } from '../../runtime/ui.js';
17
+ import { Image as ImageIcon, TrashCan as TrashIcon } from '@carbon/icons-react';
18
+ import { Input } from '@terra-symposium/styling/ui/terra-original';
19
+ const FIELD_LABEL = 'block text-sm font-medium text-primary-12';
20
+ /*//////////////////////////////////////////////////
21
+ HELPERS
22
+ //////////////////////////////////////////////////*/
23
+ /**
24
+ * Renders a Docs image block from its authored block.
25
+ *
26
+ * @param props - Authored image block containing the source URL, dimensions, and accessibility metadata.
27
+ *
28
+ * @return The image with its authored caption and alternate text.
29
+ */
30
+ function Img({ block }) {
31
+ if (!block.url)
32
+ return (_jsx(ErrorBoundary, { name: 'Image', children: _jsx(AlertError, { title: 'Image unavailable', description: 'This image block has no URL.' }) }));
33
+ return (_jsx(ErrorBoundary, { name: 'Image', children: _jsx("img", { src: block.url, alt: block.alt ?? '', className: 'max-w-full', ...(block.title === undefined ? {} : { title: block.title }), ...(block.width === undefined ? {} : { width: block.width }), ...(block.height === undefined ? {} : { height: block.height }) }) }));
34
+ }
35
+ Object.assign(Img, { displayName: 'DocsImagePreview' });
36
+ /** Adapts Portable Text's block-object contract to the image renderer. */
37
+ /**
38
+ * Renders the renderImage component.
39
+ *
40
+ * @param props - Portable Text renderer attributes, nested children, image node, path, and read-only mode.
41
+ *
42
+ * @return The image renderer in editable or read-only mode.
43
+ */
44
+ export function renderImage({ attributes: attrs, children, node, path, readOnly }) {
45
+ return readOnly ? _jsx(Img, { block: node }) : _jsx(ImgEditor, { attributes: attrs, children: children, node: node, path: path });
46
+ }
47
+ Object.assign(renderImage, { displayName: 'DocsImageRenderer' });
48
+ /** Connects the image block's local controls to its Portable Text state. */
49
+ /**
50
+ * Renders the ImageEditor component.
51
+ *
52
+ * @param props - Portable Text editor attributes, nested children, image node, and path used to update image metadata.
53
+ *
54
+ * @return The editable image block controls.
55
+ */
56
+ function ImgEditor({ attributes: attrs, children, node, path }) {
57
+ const editor = useEditor();
58
+ const update = (field, val) => editor.send({ type: 'block.set', at: path, props: { [field]: val } });
59
+ return (_jsx(ErrorBoundary, { name: 'ImageBlock', children: _jsxs("section", { ...attrs, contentEditable: false, className: 'my-8 rounded-xl border border-secondary-6 bg-secondary-1/40 p-4 shadow-sm sm:p-5', "data-terra-block": 'docImage', children: [_jsxs("div", { className: 'flex items-center gap-3 border-b border-secondary-5 pb-3 text-primary-12', children: [_jsx("span", { className: 'flex size-9 shrink-0 items-center justify-center rounded-lg bg-secondary-3 text-secondary-11', children: _jsx(ImageIcon, { className: 'size-5', "aria-hidden": 'true' }) }), _jsxs("div", { children: [_jsx("h3", { className: 'font-semibold', children: "Image" }), _jsx("p", { className: 'text-sm text-primary-11', children: "Docs image block" })] })] }), _jsxs("label", { className: `mt-4 ${FIELD_LABEL}`, children: [_jsx("span", { children: "Image URL" }), _jsx(Input, { className: 'mt-1.5', type: 'url', value: node.url ?? '', onChange: e => update('url', e.currentTarget.value), placeholder: 'https://example.com/image.png' })] }), node.url ? (_jsxs("figure", { className: 'mt-4 overflow-hidden rounded-lg border border-secondary-5 bg-primary-1', children: [_jsx("img", { src: node.url, alt: node.alt ?? '', title: node.title ?? undefined, className: 'max-h-[32rem] w-full object-contain', ...(node.width ? { width: node.width } : {}), ...(node.height ? { height: node.height } : {}) }), node.title ? _jsx("figcaption", { className: 'border-t border-secondary-5 px-3 py-2 text-sm text-primary-11', children: node.title }) : null] })) : (_jsx(Empty, { variant: 'preview', children: "Add an image URL to preview it here." })), _jsxs("div", { className: 'mt-4 grid gap-3 sm:grid-cols-2', children: [_jsxs("label", { className: FIELD_LABEL, children: [_jsx("span", { children: "Alternative text" }), _jsx(Input, { className: 'mt-1.5', value: node.alt ?? '', onChange: e => update('alt', e.currentTarget.value), placeholder: 'Describe the image' })] }), _jsxs("label", { className: FIELD_LABEL, children: [_jsx("span", { children: "Caption" }), _jsx(Input, { className: 'mt-1.5', value: node.title ?? '', onChange: e => update('title', e.currentTarget.value), placeholder: 'Optional caption' })] })] }), _jsxs("div", { className: 'mt-4 grid gap-3 sm:grid-cols-2', children: [_jsxs("label", { className: FIELD_LABEL, children: [_jsx("span", { children: "Width" }), _jsx(Input, { className: 'mt-1.5', value: node.width ?? '', onChange: e => update('width', e.currentTarget.value), placeholder: 'e.g. 640px' })] }), _jsxs("label", { className: FIELD_LABEL, children: [_jsx("span", { children: "Height" }), _jsx(Input, { className: 'mt-1.5', value: node.height ?? '', onChange: e => update('height', e.currentTarget.value), placeholder: 'e.g. auto' })] })] }), _jsx("p", { className: 'mt-3 text-xs leading-5 text-primary-10', children: "Use a stable, publicly accessible image URL. Uploading assets is part of real-content integration." }), _jsxs(Button, { className: 'mt-4', size: 'sm', variant: 'destructive', onClick: () => editor.send({ type: 'unset', at: path }), children: [_jsx(TrashIcon, { "aria-hidden": 'true' }), " Delete image"] }), children] }) }));
60
+ }
61
+ Object.assign(ImgEditor, { displayName: 'DocsImageEditor' });
62
+ //# sourceMappingURL=_DocsImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_DocsImage.js","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_DocsImage.tsx"],"names":[],"mappings":";AAAA,+FAA+F;AAC/F;;;GAGG;AAEH;;oDAEoD;AAEpD,MAAM;AACN,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,KAAK,EA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+ */
4
+ import type { DocsBlock } from '../types.js';
5
+ /**
6
+ * Renders the embed component.
7
+ *
8
+ * @param props - Embed block data containing the external source and title.
9
+ *
10
+ * @return Embedded content, or null when no source is available.
11
+ */
12
+ export declare function Embed({ block }: {
13
+ block: DocsBlock<'embed'>;
14
+ }): JSX.Element | null;
15
+ //# sourceMappingURL=_Embed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Embed.d.ts","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Embed.tsx"],"names":[],"mappings":"AACA;;GAEG;AAUH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAA+D,SAAS,CAAC,OAAO,CAAC,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAO/I"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // @ts-nocheck -- source-preserving extraction; public host contracts are typed in src/host.ts.
3
+ /**
4
+ * astro/src/components/editor/docs/_Embed.tsx
5
+ */
6
+ /*//////////////////////////////////////////////////
7
+ IMPORTS
8
+ //////////////////////////////////////////////////*/
9
+ // COMPONENTS
10
+ import { ErrorBoundary } from '../../runtime/ui.js';
11
+ /*//////////////////////////////////////////////////
12
+ HELPERS
13
+ //////////////////////////////////////////////////*/
14
+ /**
15
+ * Renders the embed component.
16
+ *
17
+ * @param props - Embed block data containing the external source and title.
18
+ *
19
+ * @return Embedded content, or null when no source is available.
20
+ */
21
+ export function Embed({ block }) {
22
+ if (!block.src)
23
+ return null;
24
+ return (_jsx(ErrorBoundary, { name: 'Embed', children: _jsx("iframe", { className: 'my-6 w-full border-0', src: block.src, title: block.title ?? block.src, style: { height: block.height ?? '500px', width: block.width ?? '100%' } }) }));
25
+ }
26
+ Object.assign(Embed, { displayName: 'DocsEmbed' });
27
+ //# sourceMappingURL=_Embed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Embed.js","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Embed.tsx"],"names":[],"mappings":";AAAA,+FAA+F;AAC/F;;GAEG;AAEH;;oDAEoD;AAEpD,aAAa;AACb,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKpD;;oDAEoD;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,KAAK,EAA8F;IAC1H,IAAI,CAAC,KAAK,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,CACN,KAAC,aAAa,IAAC,IAAI,EAAC,OAAO,YAC1B,iBAAQ,SAAS,EAAC,sBAAsB,EAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,MAAM,EAAE,GAAI,GACvJ,CAChB,CAAC;AACH,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * astro/src/components/editor/docs/_Math.tsx
3
+ * Docs math renderer with optional editing controls.
4
+ */
5
+ import type { DocsBlock, PortableTextBlockRendererProps } from '../types.js';
6
+ /** Sanity Portable Text math expression block fields. */
7
+ type MathBlockData = DocsBlock<'math'>;
8
+ /**
9
+ * Renders the formula display and, when supplied, its edit popover.
10
+ *
11
+ * @param props - Math source, inline or block mode, optional class name, and callback for updating authored source.
12
+ *
13
+ * @return The formatted math expression or editable math control.
14
+ */
15
+ export declare function renderMath({ code, inline, className, write }: {
16
+ code: string;
17
+ inline?: boolean;
18
+ className?: string;
19
+ write?: (code: string, inline?: boolean) => void;
20
+ }): JSX.Element;
21
+ /** Adapts Portable Text's block-object contract to the math renderer. */
22
+ /**
23
+ * Renders the renderMathBlock component.
24
+ *
25
+ * @param props - Portable Text renderer attributes, nested children, math node, path, and read-only mode.
26
+ *
27
+ * @return The math block renderer in editable or read-only mode.
28
+ */
29
+ export declare function renderMathBlock({ attributes: attrs, children, node, path, readOnly }: PortableTextBlockRendererProps<MathBlockData>): JSX.Element;
30
+ export {};
31
+ //# sourceMappingURL=_Math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Math.d.ts","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Math.tsx"],"names":[],"mappings":"AACA;;;GAGG;AAsBH,OAAO,KAAK,EAAE,SAAS,EAAgC,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAM3G,yDAAyD;AACzD,KAAK,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAMvC;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CA+EpL;AAcD,yEAAyE;AACzE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,8BAA8B,CAAC,aAAa,CAAC,GAAG,GAAG,CAAC,OAAO,CAEjJ"}
@@ -0,0 +1,126 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // @ts-nocheck -- source-preserving extraction; public host contracts are typed in src/host.ts.
3
+ /**
4
+ * astro/src/components/editor/docs/_Math.tsx
5
+ * Docs math renderer with optional editing controls.
6
+ */
7
+ /*//////////////////////////////////////////////////
8
+ IMPORTS
9
+ //////////////////////////////////////////////////*/
10
+ // API
11
+ import katex from 'katex';
12
+ import { cn } from '../../runtime/runtime.js';
13
+ import { createElement as __terraQualityCreateElement, useEffect, useMemo, useRef, useState } from 'react';
14
+ import { useEditor } from '@portabletext/editor';
15
+ // COMPONENTS
16
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
17
+ import { Button } from '@terra-symposium/styling/ui/terra-original';
18
+ import { Edit as EditIcon, FunctionMath as MathIcon } from '@carbon/icons-react';
19
+ import { ErrorBoundary } from '../../runtime/ui.js';
20
+ import { Popover, PopoverContent } from '@terra-symposium/styling/ui/terra-original';
21
+ import { Textarea } from '@terra-symposium/styling/ui/terra-original';
22
+ /*//////////////////////////////////////////////////
23
+ HELPERS
24
+ //////////////////////////////////////////////////*/
25
+ /**
26
+ * Renders the formula display and, when supplied, its edit popover.
27
+ *
28
+ * @param props - Math source, inline or block mode, optional class name, and callback for updating authored source.
29
+ *
30
+ * @return The formatted math expression or editable math control.
31
+ */
32
+ export function renderMath({ code, inline, className, write }) {
33
+ const [open, setOpen] = useState(false);
34
+ const [val, setVal] = useState(code);
35
+ const ref = useRef(null);
36
+ useEffect(() => {
37
+ setVal(code);
38
+ }, [code]);
39
+ useEffect(() => {
40
+ if (!ref.current || !write)
41
+ return;
42
+ ref.current.__blockActions = [
43
+ { text: 'Edit Formula', icon: _jsx(EditIcon, { className: 'mr-2 size-4', "aria-hidden": 'true' }), onSelect: () => setOpen(true) },
44
+ { text: `Set to ${inline ? 'Display' : 'Inline'}`, icon: _jsx(MathIcon, { className: 'mr-2 size-4', "aria-hidden": 'true' }), onSelect: () => write(code, !inline) },
45
+ ];
46
+ }, [code, inline, write]);
47
+ const math = __terraQualityCreateElement(inline ? 'span' : 'div', {
48
+ className: cn('docs-math', !inline && 'my-4 flex w-full justify-center overflow-x-auto', className),
49
+ dangerouslySetInnerHTML: {
50
+ __html: useMemo(() => {
51
+ if (!code)
52
+ return '';
53
+ try {
54
+ return katex.renderToString(code, { throwOnError: false, displayMode: !inline, strict: false });
55
+ }
56
+ catch (err) {
57
+ return `<span class="text-red-500">${String(err)}</span>`;
58
+ }
59
+ }, [code, inline]),
60
+ },
61
+ });
62
+ if (!write)
63
+ return math;
64
+ return (_jsx(ErrorBoundary, { name: 'MathBlock', children: _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx("span", { ref: ref, className: cn('docs-math-wrapper relative cursor-context-menu select-none outline-none ring-0', inline ? 'inline-block' : 'block'), contentEditable: false, "data-docs-editor-block": 'math', "data-math-inline": inline ? 'true' : 'false', "data-math-code": code, children: _jsx(PopoverPrimitive.Anchor, { className: cn('pointer-events-none', inline ? 'inline-block' : 'block'), children: math }) }), _jsxs(PopoverContent, { align: 'center', className: 'not-prose z-[120] w-96 space-y-4', onClick: e => e.stopPropagation(), onInteractOutside: e => {
65
+ if (e.target.closest('[data-radix-popper-content-wrapper], [data-radix-menu-content]'))
66
+ e.preventDefault();
67
+ }, children: [_jsxs("div", { className: 'space-y-2', children: [_jsx("h4", { className: 'text-sm font-semibold', children: "Edit LaTeX Formula" }), _jsx(Textarea, { "aria-label": 'LaTeX formula', value: val, onChange: e => setVal(e.target.value), placeholder: "f'(x) = ...", className: 'h-32 font-mono text-xs' })] }), _jsxs("div", { className: 'flex justify-end gap-2', children: [_jsx(Button, { variant: 'ghost', size: 'sm', onClick: () => {
68
+ setVal(code);
69
+ setOpen(false);
70
+ }, children: "Cancel" }), _jsx(Button, { variant: 'default', size: 'sm', onClick: () => {
71
+ write(val, inline);
72
+ setOpen(false);
73
+ }, children: "Save Formula" })] })] })] }) }));
74
+ }
75
+ /**
76
+ * Renders a Docs math block from its authored block.
77
+ *
78
+ * @param props - Authored expression and display mode from the math block.
79
+ *
80
+ * @return The rendered math expression.
81
+ */
82
+ function MathBlock({ block }) {
83
+ return renderMath({ code: block.code ?? '', inline: Boolean(block.inline) });
84
+ }
85
+ Object.assign(MathBlock, { displayName: 'DocsMathPreview' });
86
+ /** Adapts Portable Text's block-object contract to the math renderer. */
87
+ /**
88
+ * Renders the renderMathBlock component.
89
+ *
90
+ * @param props - Portable Text renderer attributes, nested children, math node, path, and read-only mode.
91
+ *
92
+ * @return The math block renderer in editable or read-only mode.
93
+ */
94
+ export function renderMathBlock({ attributes: attrs, children, node, path, readOnly }) {
95
+ return readOnly ? _jsx(MathBlock, { block: node }) : _jsx(MathEditor, { attributes: attrs, children: children, node: node, path: path });
96
+ }
97
+ Object.assign(renderMathBlock, { displayName: 'DocsMathRenderer' });
98
+ /** Connects the math block's local controls to its Portable Text state. */
99
+ /**
100
+ * Renders the MathEditor component.
101
+ *
102
+ * @param props - Portable Text editor attributes, nested children, math node, and path used to update the expression.
103
+ *
104
+ * @return The editable math expression controls.
105
+ */
106
+ function MathEditor(props) {
107
+ return _jsx(MathEditorContent, { ...props, editor: useEditor() });
108
+ }
109
+ Object.assign(MathEditor, { displayName: 'DocsMathEditor' });
110
+ /**
111
+ * Renders math controls using the editor context supplied by the Portable Text boundary.
112
+ *
113
+ * @param props - Portable Text attributes, children, math node, path, and editor context.
114
+ *
115
+ * @return The math block controls and any nested editor content.
116
+ */
117
+ function MathEditorContent({ attributes: attrs, children, node, path, editor }) {
118
+ const math = node;
119
+ return (_jsxs("div", { ...attrs, contentEditable: false, "data-terra-block": 'math', children: [renderMath({
120
+ code: math.code ?? '',
121
+ ...(math.inline === undefined ? {} : { inline: math.inline }),
122
+ write: (code, inline) => editor.send({ type: 'block.set', at: path, props: { code, inline } }),
123
+ }), children] }));
124
+ }
125
+ Object.assign(MathEditorContent, { displayName: 'DocsMathEditorContent' });
126
+ //# sourceMappingURL=_Math.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Math.js","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Math.tsx"],"names":[],"mappings":";AAAA,+FAA+F;AAC/F;;;GAGG;AAEH;;oDAEoD;AAEp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C,UAAU,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAA0F;IACrK,MAAM,IAAI,GAAG,IAA2C,CAAC;IACzD,OAAO,CACN,kBAAS,KAAK,EAAE,eAAe,EAAE,KAAK,sBAAmB,MAAM,aAC7D,UAAU,CAAC;gBACX,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;gBACrB,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC7D,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;aAC9F,CAAC,EACD,QAAQ,IACJ,CACN,CAAC;AACH,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * astro/src/components/editor/docs/_Nodes.tsx
3
+ */
4
+ import type { DocsBlock } from '../types.js';
5
+ /**
6
+ * Renders the nodes block component.
7
+ *
8
+ * @param props - Portable Text node props passed to the renderer.
9
+ *
10
+ * @return Rendered documentation node content.
11
+ */
12
+ export declare function NodesBlock({ block }: {
13
+ block: DocsBlock<'nodes'>;
14
+ }): JSX.Element;
15
+ //# sourceMappingURL=_Nodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Nodes.d.ts","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Nodes.tsx"],"names":[],"mappings":"AACA;;GAEG;AAeH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoD7C;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAyE,SAAS,CAAC,OAAO,CAAC,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAcvJ"}
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // @ts-nocheck -- source-preserving extraction; public host contracts are typed in src/host.ts.
3
+ /**
4
+ * astro/src/components/editor/docs/_Nodes.tsx
5
+ */
6
+ /*//////////////////////////////////////////////////
7
+ IMPORTS
8
+ //////////////////////////////////////////////////*/
9
+ // API
10
+ import { cn } from '../../runtime/runtime.js';
11
+ import { decodeNodesPayload } from '../../runtime/nodes.js';
12
+ // COMPONENTS
13
+ import Canvas from '../../flow/Nodes.js';
14
+ import { ErrorBoundary } from '../../runtime/ui.js';
15
+ /*//////////////////////////////////////////////////
16
+ HELPERS
17
+ //////////////////////////////////////////////////*/
18
+ /**
19
+ * Decodes and renders a Docs flow diagram.
20
+ *
21
+ * @param props - Node data, optional styling class, and rendering state used to display a graph preview.
22
+ *
23
+ * @return The graph preview for the supplied node data.
24
+ */
25
+ function NodesRenderer(props) {
26
+ const { className, nodes: rawNodes, edges: rawEdges, direction, height, nodeSep, rankSep, proximityConnect, ...rest } = props;
27
+ const resolvedHeight = Number.isFinite(Number(height)) ? Number(height) : 384;
28
+ return (_jsx(ErrorBoundary, { name: 'Nodes', children: _jsx("div", { className: cn('docs-block relative my-0 flow-root transition-all duration-200 [&>:first-child]:!mt-0 [&>:last-child]:!mb-0', className), "data-docs-editor-block": 'Nodes', style: { height: resolvedHeight, width: '100%' }, contentEditable: false, suppressContentEditableWarning: true, children: _jsx(Canvas, { ...rest, direction: direction, height: resolvedHeight, nodeSep: nodeSep, rankSep: rankSep, proximityConnect: proximityConnect, nodes: decodeNodesPayload(rawNodes).filter((n) => {
29
+ if (!n || typeof n !== 'object')
30
+ return false;
31
+ const val = n;
32
+ return typeof val.id === 'string' && Boolean(val.data && typeof val.data === 'object') && Boolean(val.position && typeof val.position === 'object');
33
+ }), edges: decodeNodesPayload(rawEdges).filter((e) => {
34
+ if (!e || typeof e !== 'object')
35
+ return false;
36
+ const val = e;
37
+ return typeof val.id === 'string' && typeof val.source === 'string' && typeof val.target === 'string';
38
+ }), className: className }) }) }));
39
+ }
40
+ Object.assign(NodesRenderer, { displayName: 'DocsNodesRenderer' });
41
+ /**
42
+ * Renders the nodes block component.
43
+ *
44
+ * @param props - Portable Text node props passed to the renderer.
45
+ *
46
+ * @return Rendered documentation node content.
47
+ */
48
+ export function NodesBlock({ block }) {
49
+ return (_jsx(ErrorBoundary, { name: 'NodesBlock', children: _jsx(NodesRenderer, { ...(block.nodes === undefined ? {} : { nodes: block.nodes }), ...(block.edges === undefined ? {} : { edges: block.edges }), ...(block.direction === 'TB' || block.direction === 'LR' ? { direction: block.direction } : {}), ...(block.height === undefined ? {} : { height: block.height }), ...(block.nodeSep === undefined ? {} : { nodeSep: block.nodeSep }), ...(block.proximityConnect === undefined ? {} : { proximityConnect: block.proximityConnect }), ...(block.rankSep === undefined ? {} : { rankSep: block.rankSep }) }) }));
50
+ }
51
+ Object.assign(NodesBlock, { displayName: 'DocsNodesBlock' });
52
+ //# sourceMappingURL=_Nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Nodes.js","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Nodes.tsx"],"names":[],"mappings":";AAAA,+FAA+F;AAC/F;;GAEG;AAEH;;oDAEoD;AAEpD,MAAM;AACN,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,aAAa;AACb,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOp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M,EAAE,CAAC,KAC5D,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,KAC/D,CAAC,KAAK,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC,KAC1F,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,GAClE,GACa,CAChB,CAAC;AACH,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * astro/src/components/editor/docs/_Raw.tsx
3
+ */
4
+ import type { DocsBlock } from '../types.js';
5
+ /**
6
+ * Renders the raw component.
7
+ *
8
+ * @param props - Raw block props containing the authored markup.
9
+ *
10
+ * @return Rendered raw documentation content.
11
+ */
12
+ export declare function Raw({ block }: {
13
+ block: DocsBlock<'raw'>;
14
+ }): JSX.Element;
15
+ //# sourceMappingURL=_Raw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Raw.d.ts","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Raw.tsx"],"names":[],"mappings":"AACA;;GAEG;AAWH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAuD,SAAS,CAAC,KAAK,CAAC,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAM5H"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // @ts-nocheck -- source-preserving extraction; public host contracts are typed in src/host.ts.
3
+ /**
4
+ * astro/src/components/editor/docs/_Raw.tsx
5
+ */
6
+ /*//////////////////////////////////////////////////
7
+ IMPORTS
8
+ //////////////////////////////////////////////////*/
9
+ // COMPONENTS
10
+ import { CodeBlock } from './_CodeBlock.js';
11
+ import { ErrorBoundary } from '../../runtime/ui.js';
12
+ /*//////////////////////////////////////////////////
13
+ HELPERS
14
+ //////////////////////////////////////////////////*/
15
+ /**
16
+ * Renders the raw component.
17
+ *
18
+ * @param props - Raw block props containing the authored markup.
19
+ *
20
+ * @return Rendered raw documentation content.
21
+ */
22
+ export function Raw({ block }) {
23
+ return (_jsx(ErrorBoundary, { name: 'Raw', children: _jsx(CodeBlock, { docsSource: true, code: block.markdown ?? '', language: 'mdx', tone: 'view' }) }));
24
+ }
25
+ Object.assign(Raw, { displayName: 'DocsRawMarkup' });
26
+ //# sourceMappingURL=_Raw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Raw.js","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Raw.tsx"],"names":[],"mappings":";AAAA,+FAA+F;AAC/F;;GAEG;AAEH;;oDAEoD;AAEpD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKpD;;oDAEoD;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAoF;IAC9G,OAAO,CACN,KAAC,aAAa,IAAC,IAAI,EAAC,KAAK,YACxB,KAAC,SAAS,IAAC,UAAU,QAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,QAAQ,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,GAAG,GAChE,CAChB,CAAC;AACH,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** Docs table renderer with view and edit modes. */
2
+ import type { DocsBlock, PortableTextBlockRendererProps } from '../types.js';
3
+ /** Sanity Portable Text table rows and headers. */
4
+ type TableBlock = DocsBlock<'table'>;
5
+ /** Adapts Portable Text's block-object contract to the table renderer.
6
+ *
7
+ * @param props - Portable Text renderer attributes, nested children, table node, path, and read-only mode.
8
+ * @returns The table renderer in editable or read-only mode.
9
+ */
10
+ export declare function renderTable({ attributes: attrs, children, node, path, readOnly }: PortableTextBlockRendererProps<TableBlock>): React.JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=_Table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_Table.d.ts","sourceRoot":"","sources":["../../../../src/terra/editor/docs/_Table.tsx"],"names":[],"mappings":"AACA,oDAAoD;AAYpD,OAAO,KAAK,EAAE,SAAS,EAAgC,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAG3G,mDAAmD;AACnD,KAAK,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AA0IrC;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,8BAA8B,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAEhJ"}