deepspace 0.12.0 → 0.14.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.
- package/CHANGELOG.md +162 -0
- package/dist/{chunk-ZJ43EK3N.js → chunk-233GQU2H.js} +492 -365
- package/dist/chunk-233GQU2H.js.map +1 -0
- package/dist/cli.js +536 -172
- package/dist/cli.js.map +1 -1
- package/dist/documentation-client-core.d.ts +2 -2
- package/dist/documentation-client-core.js +1 -1
- package/dist/documentation-default-renderer.cjs +34 -34
- package/dist/documentation-react.d.ts +1 -1
- package/dist/documentation-react.js +1 -1
- package/dist/documentation-runtime.js +10 -10
- package/dist/documentation-server-core.d.ts +2 -2
- package/dist/documentation-server-core.js +1 -1
- package/dist/documentation.js +2 -2
- package/dist/documentation.js.map +1 -1
- package/dist/index.d.ts +28 -3
- package/dist/index.js +93 -8
- package/dist/index.js.map +1 -1
- package/dist/{public-BGRX_Cjd.d.ts → public-BtArwbVM.d.ts} +8 -0
- package/dist/server.d.ts +143 -27
- package/dist/server.js +427 -91
- package/dist/server.js.map +1 -1
- package/dist/worker.d.ts +140 -24
- package/dist/worker.js +432 -91
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZJ43EK3N.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// src/documentation/runtime/app.tsx
|
|
2
2
|
import {
|
|
3
3
|
useCallback,
|
|
4
|
-
useEffect as
|
|
5
|
-
useState as
|
|
4
|
+
useEffect as useEffect8,
|
|
5
|
+
useState as useState7
|
|
6
6
|
} from "react";
|
|
7
7
|
|
|
8
8
|
// src/documentation/runtime/article.tsx
|
|
9
9
|
import {
|
|
10
|
-
useEffect as
|
|
10
|
+
useEffect as useEffect3,
|
|
11
11
|
useMemo,
|
|
12
|
-
useRef as
|
|
13
|
-
useState as
|
|
12
|
+
useRef as useRef3,
|
|
13
|
+
useState as useState3
|
|
14
14
|
} from "react";
|
|
15
15
|
import { createPortal } from "react-dom";
|
|
16
16
|
|
|
@@ -131,6 +131,16 @@ function errorMessage(error) {
|
|
|
131
131
|
return error instanceof Error ? error.message : String(error);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// src/documentation/runtime/code-block.tsx
|
|
135
|
+
import {
|
|
136
|
+
createContext,
|
|
137
|
+
useContext,
|
|
138
|
+
useEffect,
|
|
139
|
+
useId,
|
|
140
|
+
useRef,
|
|
141
|
+
useState
|
|
142
|
+
} from "react";
|
|
143
|
+
|
|
134
144
|
// src/documentation/runtime/icons.tsx
|
|
135
145
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
136
146
|
function Icon({ children, ...props }) {
|
|
@@ -245,15 +255,134 @@ function ListIcon(props) {
|
|
|
245
255
|
return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M4 6h16M4 12h11M4 18h7", stroke: "currentColor", strokeLinecap: "round", strokeWidth: "1.8" }) });
|
|
246
256
|
}
|
|
247
257
|
|
|
248
|
-
// src/documentation/runtime/
|
|
249
|
-
import { useEffect, useRef, useState } from "react";
|
|
258
|
+
// src/documentation/runtime/code-block.tsx
|
|
250
259
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
260
|
+
var CodeBlockContext = createContext({
|
|
261
|
+
assistantEnabled: false,
|
|
262
|
+
onAsk: () => {
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
var CodeBlockControlsProvider = CodeBlockContext.Provider;
|
|
266
|
+
function CodeBlockActions({ readCode }) {
|
|
267
|
+
const { assistantEnabled, onAsk } = useContext(CodeBlockContext);
|
|
268
|
+
const [copied, setCopied] = useState(false);
|
|
269
|
+
const copy = async () => {
|
|
270
|
+
await writeClipboardText(readCode());
|
|
271
|
+
setCopied(true);
|
|
272
|
+
window.setTimeout(() => setCopied(false), 1400);
|
|
273
|
+
};
|
|
274
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
275
|
+
/* @__PURE__ */ jsx2("button", { "aria-label": copied ? "Code copied" : "Copy code", onClick: () => {
|
|
276
|
+
void copy();
|
|
277
|
+
}, type: "button", children: copied ? /* @__PURE__ */ jsx2(CheckIcon, {}) : /* @__PURE__ */ jsx2(CopyIcon, {}) }),
|
|
278
|
+
assistantEnabled && /* @__PURE__ */ jsx2(
|
|
279
|
+
"button",
|
|
280
|
+
{
|
|
281
|
+
"aria-label": "Ask the documentation assistant about this code",
|
|
282
|
+
onClick: () => onAsk(readCode().trim().slice(0, 1200)),
|
|
283
|
+
type: "button",
|
|
284
|
+
children: /* @__PURE__ */ jsx2(SparkIcon, {})
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
] });
|
|
288
|
+
}
|
|
289
|
+
function codeBlockLanguage(className) {
|
|
290
|
+
return /(?:^|\s)(?:language|lang)-([a-z0-9+#-]{1,20})/i.exec(className)?.[1] ?? "";
|
|
291
|
+
}
|
|
292
|
+
function childCodeClassName(children) {
|
|
293
|
+
const code = children;
|
|
294
|
+
return typeof code?.props?.className === "string" ? code.props.className : "";
|
|
295
|
+
}
|
|
296
|
+
function CodeBlock({ children, ...props }) {
|
|
297
|
+
const preRef = useRef(null);
|
|
298
|
+
const language = codeBlockLanguage(childCodeClassName(children));
|
|
299
|
+
const readCode = () => preRef.current?.querySelector("code")?.textContent ?? preRef.current?.textContent ?? "";
|
|
300
|
+
return /* @__PURE__ */ jsxs2("div", { className: "documentation-code-block", children: [
|
|
301
|
+
/* @__PURE__ */ jsx2("pre", { ...props, ref: preRef, children }),
|
|
302
|
+
language ? /* @__PURE__ */ jsx2("span", { className: "documentation-code-language", children: language }) : null,
|
|
303
|
+
/* @__PURE__ */ jsx2("div", { className: "documentation-code-actions", children: /* @__PURE__ */ jsx2(CodeBlockActions, { readCode }) })
|
|
304
|
+
] });
|
|
305
|
+
}
|
|
306
|
+
var TAB_SELECTION_KEY = "deepspace-documentation-tab-selection";
|
|
307
|
+
var TAB_CHANGE_EVENT = "deepspace-documentation-tab-change";
|
|
308
|
+
function TabGroup({
|
|
309
|
+
className,
|
|
310
|
+
panels,
|
|
311
|
+
title
|
|
312
|
+
}) {
|
|
313
|
+
const groupId = useId();
|
|
314
|
+
const [active, setActive] = useState(0);
|
|
315
|
+
const controlsRef = useRef(null);
|
|
316
|
+
useEffect(() => {
|
|
317
|
+
const stored = safeStorageGet(TAB_SELECTION_KEY);
|
|
318
|
+
const index = stored ? panels.findIndex((panel) => panel.label === stored) : -1;
|
|
319
|
+
if (index >= 0) setActive(index);
|
|
320
|
+
}, [panels]);
|
|
321
|
+
useEffect(() => {
|
|
322
|
+
const sync = (event) => {
|
|
323
|
+
const detail = event.detail;
|
|
324
|
+
if (!detail?.label || detail.source === groupId) return;
|
|
325
|
+
const index = panels.findIndex((panel) => panel.label === detail.label);
|
|
326
|
+
if (index >= 0) setActive(index);
|
|
327
|
+
};
|
|
328
|
+
document.addEventListener(TAB_CHANGE_EVENT, sync);
|
|
329
|
+
return () => document.removeEventListener(TAB_CHANGE_EVENT, sync);
|
|
330
|
+
}, [groupId, panels]);
|
|
331
|
+
const select = (index, broadcast) => {
|
|
332
|
+
setActive(index);
|
|
333
|
+
const label = panels[index]?.label;
|
|
334
|
+
if (!broadcast || !label) return;
|
|
335
|
+
safeStorageSet(TAB_SELECTION_KEY, label);
|
|
336
|
+
document.dispatchEvent(new CustomEvent(TAB_CHANGE_EVENT, { detail: { label, source: groupId } }));
|
|
337
|
+
};
|
|
338
|
+
const onKeyDown = (event, index) => {
|
|
339
|
+
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return;
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
const next = event.key === "Home" ? 0 : event.key === "End" ? panels.length - 1 : (index + (event.key === "ArrowRight" ? 1 : -1) + panels.length) % panels.length;
|
|
342
|
+
select(next, true);
|
|
343
|
+
controlsRef.current?.querySelectorAll("button")[next]?.focus();
|
|
344
|
+
};
|
|
345
|
+
return /* @__PURE__ */ jsxs2("div", { className, "data-tab-group": true, children: [
|
|
346
|
+
title,
|
|
347
|
+
/* @__PURE__ */ jsx2("div", { className: "documentation-tab-buttons", ref: controlsRef, role: "tablist", children: panels.map((panel, index) => /* @__PURE__ */ jsx2(
|
|
348
|
+
"button",
|
|
349
|
+
{
|
|
350
|
+
"aria-selected": index === active,
|
|
351
|
+
id: `documentation-tab-${groupId}-${index}`,
|
|
352
|
+
onClick: () => select(index, true),
|
|
353
|
+
onKeyDown: (event) => onKeyDown(event, index),
|
|
354
|
+
role: "tab",
|
|
355
|
+
tabIndex: index === active ? 0 : -1,
|
|
356
|
+
type: "button",
|
|
357
|
+
children: panel.label
|
|
358
|
+
},
|
|
359
|
+
panel.label
|
|
360
|
+
)) }),
|
|
361
|
+
panels.map((panel, index) => /* @__PURE__ */ jsx2(
|
|
362
|
+
"section",
|
|
363
|
+
{
|
|
364
|
+
"aria-labelledby": `documentation-tab-${groupId}-${index}`,
|
|
365
|
+
className: "documentation-tab",
|
|
366
|
+
"data-tab": true,
|
|
367
|
+
"data-tab-title": panel.label,
|
|
368
|
+
hidden: index !== active,
|
|
369
|
+
role: "tabpanel",
|
|
370
|
+
children: panel.content
|
|
371
|
+
},
|
|
372
|
+
panel.label
|
|
373
|
+
))
|
|
374
|
+
] });
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// src/documentation/runtime/page-actions.tsx
|
|
378
|
+
import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
379
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
251
380
|
function PageActions({
|
|
252
381
|
data,
|
|
253
382
|
onAssistantOpen
|
|
254
383
|
}) {
|
|
255
|
-
const [copied, setCopied] =
|
|
256
|
-
const detailsRef =
|
|
384
|
+
const [copied, setCopied] = useState2(null);
|
|
385
|
+
const detailsRef = useRef2(null);
|
|
257
386
|
const actions = data.config.contextual.actions.filter((action) => {
|
|
258
387
|
if (data.page.route === "/404") return false;
|
|
259
388
|
if (action === "assistant" && data.config.assistant.access === "disabled") return false;
|
|
@@ -261,7 +390,7 @@ function PageActions({
|
|
|
261
390
|
return true;
|
|
262
391
|
});
|
|
263
392
|
const primary = actions[0];
|
|
264
|
-
|
|
393
|
+
useEffect2(() => {
|
|
265
394
|
const closeOnPointerDown = (event) => {
|
|
266
395
|
const details = detailsRef.current;
|
|
267
396
|
if (details && !details.contains(event.target)) details.open = false;
|
|
@@ -328,116 +457,123 @@ function PageActions({
|
|
|
328
457
|
}
|
|
329
458
|
closeMenu();
|
|
330
459
|
};
|
|
331
|
-
const content = (icon, label, description, menuItem, external = false) => menuItem ? /* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
460
|
+
const content = (icon, label, description, menuItem, external = false) => menuItem ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
461
|
+
/* @__PURE__ */ jsx3("span", { className: "documentation-contextual-action-icon", children: icon }),
|
|
462
|
+
/* @__PURE__ */ jsxs3("span", { className: "documentation-contextual-action-copy", children: [
|
|
463
|
+
/* @__PURE__ */ jsx3("strong", { children: label }),
|
|
464
|
+
/* @__PURE__ */ jsx3("small", { children: description })
|
|
336
465
|
] }),
|
|
337
|
-
external && /* @__PURE__ */
|
|
338
|
-
] }) : /* @__PURE__ */
|
|
466
|
+
external && /* @__PURE__ */ jsx3(ExternalIcon, { className: "documentation-contextual-action-external" })
|
|
467
|
+
] }) : /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
339
468
|
icon,
|
|
340
469
|
label
|
|
341
470
|
] });
|
|
342
471
|
const renderAction = (action, menuItem = false) => {
|
|
343
472
|
const role = menuItem ? "menuitem" : void 0;
|
|
344
473
|
if (action === "view") {
|
|
345
|
-
return /* @__PURE__ */
|
|
474
|
+
return /* @__PURE__ */ jsx3("a", { href: data.page.markdownUrl, onClick: closeMenu, role, children: content(/* @__PURE__ */ jsx3(FileIcon, {}), "View as Markdown", "Open the raw Markdown page", menuItem) }, action);
|
|
346
475
|
}
|
|
347
476
|
if (action === "assistant") {
|
|
348
|
-
return /* @__PURE__ */
|
|
477
|
+
return /* @__PURE__ */ jsx3("button", { role, type: "button", onClick: () => {
|
|
349
478
|
closeMenu();
|
|
350
479
|
onAssistantOpen(`Explain the key ideas on ${data.page.title}.`);
|
|
351
|
-
}, children: content(/* @__PURE__ */
|
|
480
|
+
}, children: content(/* @__PURE__ */ jsx3(OrbitMark, {}), "Ask about this page", "Use the DeepSpace agent with page context", menuItem) }, action);
|
|
352
481
|
}
|
|
353
482
|
if (action === "chatgpt" || action === "claude") {
|
|
354
483
|
const label2 = action === "chatgpt" ? "Open in ChatGPT" : "Open in Claude";
|
|
355
|
-
return /* @__PURE__ */
|
|
484
|
+
return /* @__PURE__ */ jsx3("button", { role, type: "button", onClick: () => openAiContext(action), children: content(/* @__PURE__ */ jsx3(MessageIcon, {}), label2, "Ask questions about this page", menuItem, true) }, action);
|
|
356
485
|
}
|
|
357
486
|
if (action === "mcp") {
|
|
358
487
|
const label2 = copied === action ? "MCP URL copied" : "Copy MCP server URL";
|
|
359
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ jsx3("button", { role, type: "button", onClick: copyMcp, children: content(copied === action ? /* @__PURE__ */ jsx3(CheckIcon, {}) : /* @__PURE__ */ jsx3(CopyIcon, {}), label2, "Copy the same-release documentation endpoint", menuItem) }, action);
|
|
360
489
|
}
|
|
361
490
|
if (action === "add-mcp") {
|
|
362
491
|
const label2 = copied === action ? "Install command copied" : "Copy MCP install command";
|
|
363
|
-
return /* @__PURE__ */
|
|
492
|
+
return /* @__PURE__ */ jsx3("button", { role, type: "button", onClick: copyMcpInstall, children: content(copied === action ? /* @__PURE__ */ jsx3(CheckIcon, {}) : /* @__PURE__ */ jsx3(TerminalIcon, {}), label2, "Copy npx command to install MCP server", menuItem) }, action);
|
|
364
493
|
}
|
|
365
494
|
if (action === "cursor" || action === "vscode") {
|
|
366
495
|
const label2 = action === "cursor" ? "Connect to Cursor" : "Connect to VS Code";
|
|
367
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ jsx3("button", { role, type: "button", onClick: () => openMcpEditor(action), children: content(/* @__PURE__ */ jsx3(EditorIcon, {}), label2, `Install MCP server in ${action === "cursor" ? "Cursor" : "VS Code"}`, menuItem, true) }, action);
|
|
368
497
|
}
|
|
369
498
|
const label = copied === action ? "Page copied" : "Copy page";
|
|
370
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ jsx3("button", { role, type: "button", onClick: copyPage, children: content(copied === action ? /* @__PURE__ */ jsx3(CheckIcon, {}) : /* @__PURE__ */ jsx3(CopyIcon, {}), label, "Copy page as Markdown for LLMs", menuItem) }, action);
|
|
371
500
|
};
|
|
372
|
-
return /* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
actions.length > 0 && /* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */
|
|
501
|
+
return /* @__PURE__ */ jsxs3("div", { className: "documentation-contextual-actions", "aria-label": "Page actions", children: [
|
|
502
|
+
/* @__PURE__ */ jsx3("div", { className: "documentation-contextual-primary", "aria-live": "polite", children: renderAction(primary) }),
|
|
503
|
+
actions.length > 0 && /* @__PURE__ */ jsxs3("details", { ref: detailsRef, children: [
|
|
504
|
+
/* @__PURE__ */ jsx3("summary", { "aria-label": "More page actions", children: /* @__PURE__ */ jsx3(ChevronDownIcon, {}) }),
|
|
505
|
+
/* @__PURE__ */ jsx3("div", { "aria-label": "More page actions", className: "documentation-contextual-menu", role: "menu", children: actions.map((action) => renderAction(action, true)) })
|
|
377
506
|
] })
|
|
378
507
|
] });
|
|
379
508
|
}
|
|
380
509
|
|
|
381
510
|
// src/documentation/runtime/article.tsx
|
|
382
|
-
import { Fragment as
|
|
511
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
512
|
+
var HTML_PROSE_SCOPE = '.documentation-prose[data-prose="html"]';
|
|
383
513
|
function Article({
|
|
384
514
|
children,
|
|
385
515
|
data,
|
|
386
516
|
launcher,
|
|
387
517
|
onAssistantOpen
|
|
388
518
|
}) {
|
|
389
|
-
const articleRef =
|
|
519
|
+
const articleRef = useRef3(null);
|
|
390
520
|
const codeBlocks = useCodeBlockMounts(articleRef, data.page.route);
|
|
391
|
-
useArticleEnhancements(articleRef, data
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
521
|
+
useArticleEnhancements(articleRef, data);
|
|
522
|
+
const controls = useMemo(() => ({
|
|
523
|
+
assistantEnabled: data.config.assistant.access !== "disabled",
|
|
524
|
+
onAsk: (code) => onAssistantOpen(`Explain this ${data.page.title} example and the important details:
|
|
525
|
+
|
|
526
|
+
${code}`)
|
|
527
|
+
}), [data.config.assistant.access, data.page.title, onAssistantOpen]);
|
|
528
|
+
return /* @__PURE__ */ jsxs4("article", { className: "documentation-article", ref: articleRef, children: [
|
|
529
|
+
/* @__PURE__ */ jsx4(Breadcrumbs, { items: data.breadcrumbs }),
|
|
530
|
+
/* @__PURE__ */ jsxs4("header", { className: "documentation-article-header", children: [
|
|
531
|
+
/* @__PURE__ */ jsxs4("div", { className: "documentation-article-meta", children: [
|
|
532
|
+
data.config.theme.eyebrowStyle !== "none" && /* @__PURE__ */ jsx4("div", { className: "documentation-eyebrow", children: data.page.kind === "openapi" ? "API reference" : data.config.theme.eyebrowStyle === "breadcrumbs" ? data.breadcrumbs.join(" / ") : data.breadcrumbs[0] ?? "Documentation" }),
|
|
533
|
+
/* @__PURE__ */ jsx4(PageActions, { data, onAssistantOpen })
|
|
398
534
|
] }),
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
data.page.description && /* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ jsx4("h1", { children: data.page.title }),
|
|
536
|
+
data.page.description && /* @__PURE__ */ jsx4("p", { className: "documentation-lede", children: data.page.description })
|
|
401
537
|
] }),
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
CodeBlockActions,
|
|
538
|
+
/* @__PURE__ */ jsx4(OutlineDisclosure, { headings: outlineHeadings(data.page.headings) }),
|
|
539
|
+
/* @__PURE__ */ jsxs4(CodeBlockControlsProvider, { value: controls, children: [
|
|
540
|
+
children ?? /* @__PURE__ */ jsx4(
|
|
541
|
+
"div",
|
|
407
542
|
{
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
${code}`),
|
|
412
|
-
pre: mount.pre
|
|
543
|
+
className: "documentation-prose",
|
|
544
|
+
"data-prose": "html",
|
|
545
|
+
dangerouslySetInnerHTML: { __html: data.page.html }
|
|
413
546
|
}
|
|
414
547
|
),
|
|
415
|
-
mount
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
548
|
+
codeBlocks.map((mount) => createPortal(
|
|
549
|
+
/* @__PURE__ */ jsx4(CodeBlockActions, { readCode: () => readPreText(mount.pre) }),
|
|
550
|
+
mount.host,
|
|
551
|
+
mount.key
|
|
552
|
+
))
|
|
553
|
+
] }),
|
|
554
|
+
data.page.openapi?.playground && /* @__PURE__ */ jsx4(ApiPlayground, { operation: data.page.openapi }),
|
|
419
555
|
launcher,
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
data.previous ? /* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ jsxs4("nav", { className: "documentation-pagination", "aria-label": "Page navigation", children: [
|
|
557
|
+
data.previous ? /* @__PURE__ */ jsxs4("a", { rel: "prev", href: documentationPublicPath(data.basePath, data.previous.route), children: [
|
|
558
|
+
/* @__PURE__ */ jsx4("small", { children: "Previous" }),
|
|
559
|
+
/* @__PURE__ */ jsxs4("span", { children: [
|
|
560
|
+
/* @__PURE__ */ jsx4(ChevronRightIcon, { className: "is-back" }),
|
|
425
561
|
data.previous.title
|
|
426
562
|
] })
|
|
427
|
-
] }) : /* @__PURE__ */
|
|
428
|
-
data.next ? /* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
563
|
+
] }) : /* @__PURE__ */ jsx4("span", {}),
|
|
564
|
+
data.next ? /* @__PURE__ */ jsxs4("a", { rel: "next", href: documentationPublicPath(data.basePath, data.next.route), children: [
|
|
565
|
+
/* @__PURE__ */ jsx4("small", { children: "Next" }),
|
|
566
|
+
/* @__PURE__ */ jsxs4("span", { children: [
|
|
431
567
|
data.next.title,
|
|
432
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ jsx4(ChevronRightIcon, {})
|
|
433
569
|
] })
|
|
434
|
-
] }) : /* @__PURE__ */
|
|
570
|
+
] }) : /* @__PURE__ */ jsx4("span", {})
|
|
435
571
|
] })
|
|
436
572
|
] });
|
|
437
573
|
}
|
|
438
574
|
function Breadcrumbs({ items }) {
|
|
439
|
-
return /* @__PURE__ */
|
|
440
|
-
index > 0 && /* @__PURE__ */
|
|
575
|
+
return /* @__PURE__ */ jsx4("nav", { className: "documentation-breadcrumbs", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ jsxs4("span", { children: [
|
|
576
|
+
index > 0 && /* @__PURE__ */ jsx4(ChevronRightIcon, {}),
|
|
441
577
|
item
|
|
442
578
|
] }, `${item}:${items.slice(0, index + 1).join("/")}`)) });
|
|
443
579
|
}
|
|
@@ -448,7 +584,7 @@ function OutlineLinks({
|
|
|
448
584
|
active,
|
|
449
585
|
headings
|
|
450
586
|
}) {
|
|
451
|
-
return /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ jsx4(Fragment3, { children: headings.map((heading) => /* @__PURE__ */ jsx4(
|
|
452
588
|
"a",
|
|
453
589
|
{
|
|
454
590
|
"aria-current": active === heading.id ? "location" : void 0,
|
|
@@ -461,21 +597,21 @@ function OutlineLinks({
|
|
|
461
597
|
}
|
|
462
598
|
function OutlineDisclosure({ headings }) {
|
|
463
599
|
if (headings.length === 0) return null;
|
|
464
|
-
return /* @__PURE__ */
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */
|
|
600
|
+
return /* @__PURE__ */ jsxs4("details", { className: "documentation-outline-disclosure", children: [
|
|
601
|
+
/* @__PURE__ */ jsxs4("summary", { children: [
|
|
602
|
+
/* @__PURE__ */ jsx4(ListIcon, {}),
|
|
467
603
|
"On this page"
|
|
468
604
|
] }),
|
|
469
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ jsx4("nav", { className: "documentation-outline", "aria-label": "On this page", children: /* @__PURE__ */ jsx4(OutlineLinks, { active: "", headings }) })
|
|
470
606
|
] });
|
|
471
607
|
}
|
|
472
608
|
function ContextRail({
|
|
473
609
|
data
|
|
474
610
|
}) {
|
|
475
611
|
const headings = useMemo(() => outlineHeadings(data.page.headings), [data.page.headings]);
|
|
476
|
-
const [active, setActive] =
|
|
477
|
-
|
|
478
|
-
|
|
612
|
+
const [active, setActive] = useState3(headings[0]?.id ?? "");
|
|
613
|
+
useEffect3(() => setActive(headings[0]?.id ?? ""), [headings]);
|
|
614
|
+
useEffect3(() => {
|
|
479
615
|
if (typeof IntersectionObserver === "undefined") return;
|
|
480
616
|
const elements = headings.map((heading) => document.getElementById(heading.id)).filter(Boolean);
|
|
481
617
|
const observer = new IntersectionObserver((entries) => {
|
|
@@ -485,16 +621,16 @@ function ContextRail({
|
|
|
485
621
|
elements.forEach((element) => observer.observe(element));
|
|
486
622
|
return () => observer.disconnect();
|
|
487
623
|
}, [headings]);
|
|
488
|
-
return /* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
/* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ jsx4("aside", { className: "documentation-context-rail", "aria-label": "Page context", children: headings.length > 0 && /* @__PURE__ */ jsxs4("nav", { className: "documentation-outline", "aria-label": "On this page", children: [
|
|
625
|
+
/* @__PURE__ */ jsx4("h2", { children: "On this page" }),
|
|
626
|
+
/* @__PURE__ */ jsx4(OutlineLinks, { active, headings })
|
|
491
627
|
] }) });
|
|
492
628
|
}
|
|
493
629
|
function ApiPlayground({ operation }) {
|
|
494
|
-
const [body, setBody] =
|
|
495
|
-
const [token, setToken] =
|
|
496
|
-
const [responseText, setResponseText] =
|
|
497
|
-
const [sending, setSending] =
|
|
630
|
+
const [body, setBody] = useState3("");
|
|
631
|
+
const [token, setToken] = useState3("");
|
|
632
|
+
const [responseText, setResponseText] = useState3("No request sent.");
|
|
633
|
+
const [sending, setSending] = useState3(false);
|
|
498
634
|
if (!operation.baseUrl) return null;
|
|
499
635
|
const url = `${operation.baseUrl.replace(/\/$/, "")}${operation.path}`;
|
|
500
636
|
const send = async () => {
|
|
@@ -519,40 +655,40 @@ ${text}`);
|
|
|
519
655
|
setSending(false);
|
|
520
656
|
}
|
|
521
657
|
};
|
|
522
|
-
return /* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ jsxs4("section", { className: "documentation-playground", "data-playground": true, children: [
|
|
659
|
+
/* @__PURE__ */ jsxs4("div", { className: "documentation-playground-title", children: [
|
|
660
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
661
|
+
/* @__PURE__ */ jsx4("span", { className: `method method-${operation.method.toLowerCase()}`, children: operation.method }),
|
|
662
|
+
/* @__PURE__ */ jsx4("strong", { children: "Try this operation" })
|
|
527
663
|
] }),
|
|
528
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ jsx4("code", { children: url })
|
|
529
665
|
] }),
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ jsx4("p", { children: "Requests run in your browser. Tokens stay in memory and never enter search or assistant context." }),
|
|
667
|
+
/* @__PURE__ */ jsxs4("label", { children: [
|
|
668
|
+
/* @__PURE__ */ jsx4("span", { children: "Bearer token" }),
|
|
669
|
+
/* @__PURE__ */ jsx4("input", { type: "password", autoComplete: "off", value: token, onChange: (event) => setToken(event.target.value), placeholder: "Optional" })
|
|
534
670
|
] }),
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ jsxs4("label", { children: [
|
|
672
|
+
/* @__PURE__ */ jsx4("span", { children: "JSON body" }),
|
|
673
|
+
/* @__PURE__ */ jsx4("textarea", { rows: 7, spellCheck: "false", value: body, onChange: (event) => setBody(event.target.value), placeholder: "{}" })
|
|
538
674
|
] }),
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ jsx4("button", { type: "button", disabled: sending, onClick: send, children: sending ? "Sending\u2026" : `Send ${operation.method} request` }),
|
|
676
|
+
/* @__PURE__ */ jsx4("pre", { "aria-live": "polite", children: responseText })
|
|
541
677
|
] });
|
|
542
678
|
}
|
|
543
679
|
function useCodeBlockMounts(articleRef, route) {
|
|
544
|
-
const [mounts, setMounts] =
|
|
545
|
-
|
|
680
|
+
const [mounts, setMounts] = useState3([]);
|
|
681
|
+
useEffect3(() => {
|
|
546
682
|
const article = articleRef.current;
|
|
547
683
|
if (!article) return;
|
|
548
684
|
const created = [];
|
|
549
685
|
const next = [];
|
|
550
|
-
article.querySelectorAll("
|
|
686
|
+
article.querySelectorAll(HTML_PROSE_SCOPE + " pre").forEach((pre, index) => {
|
|
551
687
|
const block = document.createElement("div");
|
|
552
688
|
block.className = "documentation-code-block";
|
|
553
689
|
pre.replaceWith(block);
|
|
554
690
|
block.appendChild(pre);
|
|
555
|
-
const language = codeBlockLanguage(pre);
|
|
691
|
+
const language = codeBlockLanguage(pre.querySelector("code")?.className ?? "");
|
|
556
692
|
if (language) {
|
|
557
693
|
const label = document.createElement("span");
|
|
558
694
|
label.className = "documentation-code-language";
|
|
@@ -573,42 +709,15 @@ function useCodeBlockMounts(articleRef, route) {
|
|
|
573
709
|
}, [articleRef, route]);
|
|
574
710
|
return mounts;
|
|
575
711
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
578
|
-
return /(?:^|\s)(?:language|lang)-([a-z0-9+#-]{1,20})/i.exec(className)?.[1] ?? "";
|
|
712
|
+
function readPreText(pre) {
|
|
713
|
+
return pre.querySelector("code")?.textContent ?? pre.textContent ?? "";
|
|
579
714
|
}
|
|
580
|
-
function
|
|
581
|
-
|
|
582
|
-
onAsk,
|
|
583
|
-
pre
|
|
584
|
-
}) {
|
|
585
|
-
const [copied, setCopied] = useState2(false);
|
|
586
|
-
const copy = async () => {
|
|
587
|
-
await writeClipboardText(pre.querySelector("code")?.textContent ?? pre.textContent ?? "");
|
|
588
|
-
setCopied(true);
|
|
589
|
-
window.setTimeout(() => setCopied(false), 1400);
|
|
590
|
-
};
|
|
591
|
-
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
592
|
-
/* @__PURE__ */ jsx3("button", { "aria-label": copied ? "Code copied" : "Copy code", onClick: () => {
|
|
593
|
-
void copy();
|
|
594
|
-
}, type: "button", children: copied ? /* @__PURE__ */ jsx3(CheckIcon, {}) : /* @__PURE__ */ jsx3(CopyIcon, {}) }),
|
|
595
|
-
assistantEnabled && /* @__PURE__ */ jsx3(
|
|
596
|
-
"button",
|
|
597
|
-
{
|
|
598
|
-
"aria-label": "Ask the documentation assistant about this code",
|
|
599
|
-
onClick: () => onAsk(pre.querySelector("code")?.textContent?.trim().slice(0, 1200) ?? ""),
|
|
600
|
-
type: "button",
|
|
601
|
-
children: /* @__PURE__ */ jsx3(SparkIcon, {})
|
|
602
|
-
}
|
|
603
|
-
)
|
|
604
|
-
] });
|
|
605
|
-
}
|
|
606
|
-
function useArticleEnhancements(articleRef, data, onAssistantOpen) {
|
|
607
|
-
useEffect2(() => {
|
|
715
|
+
function useArticleEnhancements(articleRef, data) {
|
|
716
|
+
useEffect3(() => {
|
|
608
717
|
const article = articleRef.current;
|
|
609
718
|
if (!article) return;
|
|
610
719
|
const cleanups = [];
|
|
611
|
-
article.querySelectorAll(
|
|
720
|
+
article.querySelectorAll(`${HTML_PROSE_SCOPE} [data-tab-group]`).forEach((group, groupIndex) => {
|
|
612
721
|
if (group.querySelector(":scope > .documentation-tab-buttons")) return;
|
|
613
722
|
const tabs = Array.from(group.querySelectorAll(":scope > [data-tab]"));
|
|
614
723
|
if (tabs.length === 0) return;
|
|
@@ -677,14 +786,14 @@ function useArticleEnhancements(articleRef, data, onAssistantOpen) {
|
|
|
677
786
|
});
|
|
678
787
|
});
|
|
679
788
|
return () => cleanups.reverse().forEach((cleanup) => cleanup());
|
|
680
|
-
}, [articleRef, data.
|
|
789
|
+
}, [articleRef, data.page.route]);
|
|
681
790
|
}
|
|
682
791
|
|
|
683
792
|
// src/documentation/runtime/assistant.tsx
|
|
684
793
|
import {
|
|
685
|
-
useEffect as
|
|
686
|
-
useRef as
|
|
687
|
-
useState as
|
|
794
|
+
useEffect as useEffect5,
|
|
795
|
+
useRef as useRef4,
|
|
796
|
+
useState as useState4
|
|
688
797
|
} from "react";
|
|
689
798
|
|
|
690
799
|
// src/client/ai-stream.ts
|
|
@@ -732,9 +841,9 @@ function completedDocumentationAssistantTranscript(messages, maxMessages = 12) {
|
|
|
732
841
|
}
|
|
733
842
|
|
|
734
843
|
// src/documentation/runtime/dialog.ts
|
|
735
|
-
import { useEffect as
|
|
844
|
+
import { useEffect as useEffect4 } from "react";
|
|
736
845
|
function useDialogFocus(open, ref, onClose, trap = true, restoreId) {
|
|
737
|
-
|
|
846
|
+
useEffect4(() => {
|
|
738
847
|
if (!open) return;
|
|
739
848
|
const previous = document.activeElement;
|
|
740
849
|
const element = ref.current;
|
|
@@ -774,7 +883,7 @@ function useDialogFocus(open, ref, onClose, trap = true, restoreId) {
|
|
|
774
883
|
}
|
|
775
884
|
|
|
776
885
|
// src/documentation/runtime/assistant.tsx
|
|
777
|
-
import { jsx as
|
|
886
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
778
887
|
function AssistantLauncher({
|
|
779
888
|
input,
|
|
780
889
|
name,
|
|
@@ -789,18 +898,18 @@ function AssistantLauncher({
|
|
|
789
898
|
if (!question) return;
|
|
790
899
|
onSubmit(question);
|
|
791
900
|
};
|
|
792
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ jsxs5(
|
|
793
902
|
"form",
|
|
794
903
|
{
|
|
795
904
|
className: "documentation-assistant-launcher",
|
|
796
905
|
id: "deepspace-documentation-assistant-launcher",
|
|
797
906
|
onSubmit: submit,
|
|
798
907
|
children: [
|
|
799
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ jsxs5("button", { className: "documentation-launcher-agent", type: "button", onClick: onOpen, "aria-label": `Open the ${subject} agent`, children: [
|
|
800
909
|
"Ask ",
|
|
801
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ jsx5("span", { className: "documentation-launcher-agent-name", children: "AI" })
|
|
802
911
|
] }),
|
|
803
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ jsx5(
|
|
804
913
|
"input",
|
|
805
914
|
{
|
|
806
915
|
"aria-label": `Ask the ${subject} agent`,
|
|
@@ -811,11 +920,11 @@ function AssistantLauncher({
|
|
|
811
920
|
value: input
|
|
812
921
|
}
|
|
813
922
|
),
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ jsxs5("span", { "aria-hidden": "true", className: "documentation-launcher-hint", children: [
|
|
924
|
+
/* @__PURE__ */ jsx5("kbd", { children: "\u2318" }),
|
|
925
|
+
/* @__PURE__ */ jsx5("kbd", { children: "I" })
|
|
817
926
|
] }),
|
|
818
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ jsx5("button", { className: "documentation-launcher-send", type: "submit", disabled: !input.trim(), "aria-label": "Send question to documentation agent", children: /* @__PURE__ */ jsx5(SendIcon, {}) })
|
|
819
928
|
]
|
|
820
929
|
}
|
|
821
930
|
);
|
|
@@ -832,18 +941,18 @@ function DocumentationAssistant({
|
|
|
832
941
|
seed,
|
|
833
942
|
suggestions
|
|
834
943
|
}) {
|
|
835
|
-
const panelRef =
|
|
836
|
-
const formRef =
|
|
837
|
-
const messagesRef =
|
|
838
|
-
const abortRef =
|
|
839
|
-
const queuedQuestionRef =
|
|
840
|
-
const handledSeedRef =
|
|
841
|
-
const [messages, setMessages] =
|
|
944
|
+
const panelRef = useRef4(null);
|
|
945
|
+
const formRef = useRef4(null);
|
|
946
|
+
const messagesRef = useRef4(null);
|
|
947
|
+
const abortRef = useRef4(null);
|
|
948
|
+
const queuedQuestionRef = useRef4(null);
|
|
949
|
+
const handledSeedRef = useRef4(0);
|
|
950
|
+
const [messages, setMessages] = useState4([
|
|
842
951
|
{ id: "welcome", role: "assistant", text: `I can search the ${documentationSubject(name)} and cite the exact pages I use.` }
|
|
843
952
|
]);
|
|
844
|
-
const [sending, setSending] =
|
|
953
|
+
const [sending, setSending] = useState4(false);
|
|
845
954
|
useDialogFocus(open, panelRef, onClose, false, "deepspace-documentation-assistant-launcher-input");
|
|
846
|
-
|
|
955
|
+
useEffect5(() => {
|
|
847
956
|
if (!open || seed.id === 0 || handledSeedRef.current === seed.id) return;
|
|
848
957
|
handledSeedRef.current = seed.id;
|
|
849
958
|
if (!seed.submit || !seed.value?.trim()) return;
|
|
@@ -851,11 +960,11 @@ function DocumentationAssistant({
|
|
|
851
960
|
const frame = window.requestAnimationFrame(() => formRef.current?.requestSubmit());
|
|
852
961
|
return () => window.cancelAnimationFrame(frame);
|
|
853
962
|
}, [open, seed]);
|
|
854
|
-
|
|
963
|
+
useEffect5(() => {
|
|
855
964
|
const element = messagesRef.current;
|
|
856
965
|
if (element) element.scrollTop = element.scrollHeight;
|
|
857
966
|
}, [messages]);
|
|
858
|
-
|
|
967
|
+
useEffect5(() => () => abortRef.current?.abort(), []);
|
|
859
968
|
if (!open) return null;
|
|
860
969
|
const submit = async (event) => {
|
|
861
970
|
event?.preventDefault();
|
|
@@ -939,7 +1048,7 @@ function DocumentationAssistant({
|
|
|
939
1048
|
}
|
|
940
1049
|
};
|
|
941
1050
|
const defaults = suggestions ?? ["How do I get started?", "Show me a complete example", "What should I understand first?"];
|
|
942
|
-
return /* @__PURE__ */
|
|
1051
|
+
return /* @__PURE__ */ jsxs5(
|
|
943
1052
|
"aside",
|
|
944
1053
|
{
|
|
945
1054
|
"aria-label": "Documentation assistant",
|
|
@@ -948,31 +1057,31 @@ function DocumentationAssistant({
|
|
|
948
1057
|
ref: panelRef,
|
|
949
1058
|
role: "complementary",
|
|
950
1059
|
children: [
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
1060
|
+
/* @__PURE__ */ jsxs5("header", { children: [
|
|
1061
|
+
/* @__PURE__ */ jsx5("div", { children: /* @__PURE__ */ jsxs5("span", { children: [
|
|
1062
|
+
/* @__PURE__ */ jsxs5("strong", { id: "deepspace-documentation-assistant-title", children: [
|
|
954
1063
|
"Ask ",
|
|
955
1064
|
name
|
|
956
1065
|
] }),
|
|
957
|
-
/* @__PURE__ */
|
|
1066
|
+
/* @__PURE__ */ jsx5("small", { children: "Answers from this documentation build" })
|
|
958
1067
|
] }) }),
|
|
959
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ jsx5("button", { type: "button", onClick: onClose, "aria-label": "Close documentation assistant", children: /* @__PURE__ */ jsx5(CloseIcon, {}) })
|
|
960
1069
|
] }),
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
messages.map((message) => /* @__PURE__ */
|
|
963
|
-
message.role === "assistant" ? /* @__PURE__ */
|
|
964
|
-
message.state === "streaming" && !message.text && /* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ jsxs5("div", { className: "documentation-assistant-messages", ref: messagesRef, "aria-live": "polite", children: [
|
|
1071
|
+
messages.map((message) => /* @__PURE__ */ jsx5("div", { className: `documentation-assistant-message is-${message.role}${message.state ? ` is-${message.state}` : ""}`, children: /* @__PURE__ */ jsxs5("div", { children: [
|
|
1072
|
+
message.role === "assistant" ? /* @__PURE__ */ jsx5(AssistantMarkdown, { value: message.text }) : message.text,
|
|
1073
|
+
message.state === "streaming" && !message.text && /* @__PURE__ */ jsxs5("span", { className: "documentation-assistant-activity", role: "status", children: [
|
|
1074
|
+
/* @__PURE__ */ jsx5("span", { "aria-hidden": "true" }),
|
|
966
1075
|
message.status ?? "Working\u2026"
|
|
967
1076
|
] })
|
|
968
1077
|
] }) }, message.id)),
|
|
969
|
-
messages.length === 1 && /* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
defaults.map((suggestion) => /* @__PURE__ */
|
|
1078
|
+
messages.length === 1 && /* @__PURE__ */ jsxs5("div", { className: "documentation-assistant-suggestions", children: [
|
|
1079
|
+
/* @__PURE__ */ jsx5("p", { children: "Try asking" }),
|
|
1080
|
+
defaults.map((suggestion) => /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => onInputChange(suggestion), children: suggestion }, suggestion))
|
|
972
1081
|
] })
|
|
973
1082
|
] }),
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
/* @__PURE__ */
|
|
1083
|
+
/* @__PURE__ */ jsxs5("form", { className: "documentation-assistant-composer", onSubmit: submit, ref: formRef, children: [
|
|
1084
|
+
/* @__PURE__ */ jsx5(
|
|
976
1085
|
"textarea",
|
|
977
1086
|
{
|
|
978
1087
|
"aria-label": "Ask a documentation question",
|
|
@@ -990,9 +1099,9 @@ function DocumentationAssistant({
|
|
|
990
1099
|
value: input
|
|
991
1100
|
}
|
|
992
1101
|
),
|
|
993
|
-
sending ? /* @__PURE__ */
|
|
1102
|
+
sending ? /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => abortRef.current?.abort(), "aria-label": "Stop response", children: /* @__PURE__ */ jsx5(StopIcon, {}) }) : /* @__PURE__ */ jsx5("button", { type: "submit", disabled: !input.trim(), "aria-label": "Send question", children: /* @__PURE__ */ jsx5(SendIcon, {}) })
|
|
994
1103
|
] }),
|
|
995
|
-
/* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ jsx5("footer", { children: "Responses cite this deployment and may still contain mistakes." })
|
|
996
1105
|
]
|
|
997
1106
|
}
|
|
998
1107
|
);
|
|
@@ -1005,7 +1114,7 @@ function AssistantMarkdown({ value }) {
|
|
|
1005
1114
|
const index = match.index ?? 0;
|
|
1006
1115
|
if (index > cursor) blocks.push(...renderAssistantText(value.slice(cursor, index), `text-${cursor}`));
|
|
1007
1116
|
blocks.push(
|
|
1008
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsx5(
|
|
1009
1118
|
AssistantCodeBlock,
|
|
1010
1119
|
{
|
|
1011
1120
|
code: (match[2] ?? "").replace(/\n$/, ""),
|
|
@@ -1017,21 +1126,21 @@ function AssistantMarkdown({ value }) {
|
|
|
1017
1126
|
cursor = index + match[0].length;
|
|
1018
1127
|
}
|
|
1019
1128
|
if (cursor < value.length) blocks.push(...renderAssistantText(value.slice(cursor), `text-${cursor}`));
|
|
1020
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ jsx5("div", { className: "documentation-assistant-markdown", children: blocks });
|
|
1021
1130
|
}
|
|
1022
1131
|
function AssistantCodeBlock({ code, language }) {
|
|
1023
|
-
const [copied, setCopied] =
|
|
1132
|
+
const [copied, setCopied] = useState4(false);
|
|
1024
1133
|
const copy = async () => {
|
|
1025
1134
|
await writeClipboardText(code);
|
|
1026
1135
|
setCopied(true);
|
|
1027
1136
|
window.setTimeout(() => setCopied(false), 1400);
|
|
1028
1137
|
};
|
|
1029
|
-
return /* @__PURE__ */
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ jsxs5("figure", { className: "documentation-assistant-code", children: [
|
|
1139
|
+
/* @__PURE__ */ jsxs5("figcaption", { children: [
|
|
1140
|
+
/* @__PURE__ */ jsx5("span", { children: language || "Code" }),
|
|
1141
|
+
/* @__PURE__ */ jsx5("button", { type: "button", onClick: copy, children: copied ? "Copied" : "Copy" })
|
|
1033
1142
|
] }),
|
|
1034
|
-
/* @__PURE__ */
|
|
1143
|
+
/* @__PURE__ */ jsx5("pre", { children: /* @__PURE__ */ jsx5("code", { children: code }) })
|
|
1035
1144
|
] });
|
|
1036
1145
|
}
|
|
1037
1146
|
function renderAssistantText(value, keyPrefix) {
|
|
@@ -1046,7 +1155,7 @@ function renderAssistantText(value, keyPrefix) {
|
|
|
1046
1155
|
}
|
|
1047
1156
|
const heading = line.match(/^(#{1,4})\s+(.+)$/);
|
|
1048
1157
|
if (heading) {
|
|
1049
|
-
blocks.push(/* @__PURE__ */
|
|
1158
|
+
blocks.push(/* @__PURE__ */ jsx5("strong", { className: "documentation-assistant-heading", children: renderInlineMarkdown(heading[2]) }, `${keyPrefix}-heading-${index}`));
|
|
1050
1159
|
index += 1;
|
|
1051
1160
|
continue;
|
|
1052
1161
|
}
|
|
@@ -1058,10 +1167,10 @@ function renderAssistantText(value, keyPrefix) {
|
|
|
1058
1167
|
const candidate = lines[index]?.trim() ?? "";
|
|
1059
1168
|
const match = unordered ? candidate.match(/^[-*]\s+(.+)$/) : candidate.match(/^\d+[.)]\s+(.+)$/);
|
|
1060
1169
|
if (!match) break;
|
|
1061
|
-
items.push(/* @__PURE__ */
|
|
1170
|
+
items.push(/* @__PURE__ */ jsx5("li", { children: renderInlineMarkdown(match[1]) }, `${keyPrefix}-item-${index}`));
|
|
1062
1171
|
index += 1;
|
|
1063
1172
|
}
|
|
1064
|
-
blocks.push(unordered ? /* @__PURE__ */
|
|
1173
|
+
blocks.push(unordered ? /* @__PURE__ */ jsx5("ul", { children: items }, `${keyPrefix}-list-${index}`) : /* @__PURE__ */ jsx5("ol", { children: items }, `${keyPrefix}-list-${index}`));
|
|
1065
1174
|
continue;
|
|
1066
1175
|
}
|
|
1067
1176
|
const paragraph = [line];
|
|
@@ -1072,7 +1181,7 @@ function renderAssistantText(value, keyPrefix) {
|
|
|
1072
1181
|
paragraph.push(candidate);
|
|
1073
1182
|
index += 1;
|
|
1074
1183
|
}
|
|
1075
|
-
blocks.push(/* @__PURE__ */
|
|
1184
|
+
blocks.push(/* @__PURE__ */ jsx5("p", { children: paragraph.map((part, partIndex) => /* @__PURE__ */ jsxs5("span", { children: [
|
|
1076
1185
|
renderInlineMarkdown(part),
|
|
1077
1186
|
partIndex < paragraph.length - 1 && " "
|
|
1078
1187
|
] }, `${partIndex}:${part.slice(0, 18)}`)) }, `${keyPrefix}-paragraph-${index}`));
|
|
@@ -1083,68 +1192,68 @@ function renderInlineMarkdown(value) {
|
|
|
1083
1192
|
const pattern = /(\[[^\]]+\]\((?:https?:\/\/|\/)[^)]+\)|`[^`]+`|\*\*[^*]+\*\*)/g;
|
|
1084
1193
|
return value.split(pattern).filter(Boolean).map((part, index) => {
|
|
1085
1194
|
const link = part.match(/^\[([^\]]+)\]\(((?:https?:\/\/|\/)[^)]+)\)$/);
|
|
1086
|
-
if (link) return /* @__PURE__ */
|
|
1087
|
-
if (part.startsWith("`") && part.endsWith("`")) return /* @__PURE__ */
|
|
1088
|
-
if (part.startsWith("**") && part.endsWith("**")) return /* @__PURE__ */
|
|
1089
|
-
return /* @__PURE__ */
|
|
1195
|
+
if (link) return /* @__PURE__ */ jsx5("a", { href: link[2], ...externalProps(link[2]), children: link[1] }, `${index}:${part}`);
|
|
1196
|
+
if (part.startsWith("`") && part.endsWith("`")) return /* @__PURE__ */ jsx5("code", { children: part.slice(1, -1) }, `${index}:${part}`);
|
|
1197
|
+
if (part.startsWith("**") && part.endsWith("**")) return /* @__PURE__ */ jsx5("strong", { children: part.slice(2, -2) }, `${index}:${part}`);
|
|
1198
|
+
return /* @__PURE__ */ jsx5("span", { children: part }, `${index}:${part}`);
|
|
1090
1199
|
});
|
|
1091
1200
|
}
|
|
1092
1201
|
|
|
1093
1202
|
// src/documentation/runtime/navigation.tsx
|
|
1094
|
-
import { useEffect as
|
|
1095
|
-
import { Fragment as
|
|
1203
|
+
import { useEffect as useEffect6, useRef as useRef5, useState as useState5 } from "react";
|
|
1204
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1096
1205
|
function DocumentationHeader({
|
|
1097
1206
|
data,
|
|
1098
1207
|
onMenuOpen,
|
|
1099
1208
|
onSearchOpen
|
|
1100
1209
|
}) {
|
|
1101
|
-
return /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsxs6("header", { className: "documentation-header", children: [
|
|
1211
|
+
/* @__PURE__ */ jsx6(
|
|
1103
1212
|
"a",
|
|
1104
1213
|
{
|
|
1105
1214
|
className: "documentation-brand",
|
|
1106
1215
|
href: data.config.theme.logoHref ?? documentationPublicPath(data.basePath, "/"),
|
|
1107
1216
|
"aria-label": `${documentationSubject(data.config.name)} home`,
|
|
1108
1217
|
...externalProps(data.config.theme.logoHref ?? documentationPublicPath(data.basePath, "/")),
|
|
1109
|
-
children: /* @__PURE__ */
|
|
1218
|
+
children: /* @__PURE__ */ jsx6(BrandLogo, { data })
|
|
1110
1219
|
}
|
|
1111
1220
|
),
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ jsx6("div", { className: "documentation-header-center", children: /* @__PURE__ */ jsxs6("button", { className: "documentation-search-trigger", type: "button", onClick: onSearchOpen, "aria-label": "Search documentation", children: [
|
|
1222
|
+
/* @__PURE__ */ jsx6(SearchIcon, {}),
|
|
1223
|
+
/* @__PURE__ */ jsx6("span", { children: "Search documentation" }),
|
|
1224
|
+
/* @__PURE__ */ jsx6("kbd", { children: "\u2318K" })
|
|
1116
1225
|
] }) }),
|
|
1117
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ jsx6("nav", { className: "documentation-top-links", "aria-label": "Product navigation", children: data.config.links.map((link) => /* @__PURE__ */ jsxs6("a", { href: link.href, ...externalProps(link.href), children: [
|
|
1118
1227
|
link.label,
|
|
1119
|
-
isExternal(link.href) && /* @__PURE__ */
|
|
1228
|
+
isExternal(link.href) && /* @__PURE__ */ jsx6(ExternalIcon, {})
|
|
1120
1229
|
] }, `${link.label}:${link.href}`)) }),
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
1230
|
+
/* @__PURE__ */ jsxs6("div", { className: "documentation-mobile-actions", children: [
|
|
1231
|
+
/* @__PURE__ */ jsx6("button", { className: "documentation-icon-button", type: "button", onClick: onSearchOpen, "aria-label": "Search documentation", children: /* @__PURE__ */ jsx6(SearchIcon, {}) }),
|
|
1232
|
+
/* @__PURE__ */ jsx6("button", { className: "documentation-icon-button", type: "button", onClick: onMenuOpen, "aria-label": "Open documentation navigation", children: /* @__PURE__ */ jsx6(MenuIcon, {}) })
|
|
1124
1233
|
] })
|
|
1125
1234
|
] });
|
|
1126
1235
|
}
|
|
1127
1236
|
function BrandLogo({ data }) {
|
|
1128
1237
|
const { logo, logoDark } = data.config.theme;
|
|
1129
1238
|
if (logo) {
|
|
1130
|
-
return /* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1240
|
+
/* @__PURE__ */ jsx6("img", { className: "documentation-brand-logo documentation-brand-logo-light", src: logo, alt: "" }),
|
|
1241
|
+
/* @__PURE__ */ jsx6("img", { className: "documentation-brand-logo documentation-brand-logo-dark", src: logoDark ?? logo, alt: "" }),
|
|
1242
|
+
/* @__PURE__ */ jsx6("span", { className: "documentation-brand-product", children: "Documentation" })
|
|
1134
1243
|
] });
|
|
1135
1244
|
}
|
|
1136
|
-
return /* @__PURE__ */
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1246
|
+
/* @__PURE__ */ jsx6("span", { className: "documentation-brand-mark", children: /* @__PURE__ */ jsx6(OrbitMark, {}) }),
|
|
1247
|
+
/* @__PURE__ */ jsx6("span", { className: "documentation-brand-name", children: data.config.name })
|
|
1139
1248
|
] });
|
|
1140
1249
|
}
|
|
1141
1250
|
function DesktopSidebar({ data }) {
|
|
1142
|
-
return /* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
!data.config.theme.strictMode && /* @__PURE__ */
|
|
1146
|
-
data.config.footer.length > 0 && /* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1251
|
+
return /* @__PURE__ */ jsxs6("aside", { className: "documentation-sidebar", "aria-label": "Documentation navigation", children: [
|
|
1252
|
+
/* @__PURE__ */ jsx6("nav", { className: "documentation-page-tree", children: /* @__PURE__ */ jsx6(NavigationTree, { activeRoute: data.page.route, basePath: data.basePath, nodes: data.navigation }) }),
|
|
1253
|
+
/* @__PURE__ */ jsxs6("div", { className: "documentation-sidebar-footer", children: [
|
|
1254
|
+
!data.config.theme.strictMode && /* @__PURE__ */ jsx6(ThemeControls, { defaultMode: data.config.theme.defaultMode ?? "system" }),
|
|
1255
|
+
data.config.footer.length > 0 && /* @__PURE__ */ jsx6("nav", { "aria-label": "Documentation footer", children: data.config.footer.map((link) => /* @__PURE__ */ jsx6("a", { href: link.href, ...externalProps(link.href), children: link.label }, `${link.label}:${link.href}`)) }),
|
|
1256
|
+
/* @__PURE__ */ jsx6("span", { children: "Built on DeepSpace" })
|
|
1148
1257
|
] })
|
|
1149
1258
|
] });
|
|
1150
1259
|
}
|
|
@@ -1154,26 +1263,26 @@ function NavigationTree({
|
|
|
1154
1263
|
depth = 0,
|
|
1155
1264
|
nodes
|
|
1156
1265
|
}) {
|
|
1157
|
-
return /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ jsx6(Fragment4, { children: nodes.map((node) => {
|
|
1158
1267
|
if (node.kind === "group") {
|
|
1159
1268
|
const active2 = containsRoute(node, activeRoute);
|
|
1160
1269
|
if (depth === 0) {
|
|
1161
|
-
return /* @__PURE__ */
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ jsxs6("section", { className: "documentation-nav-section", children: [
|
|
1271
|
+
/* @__PURE__ */ jsx6("h2", { children: node.label }),
|
|
1272
|
+
/* @__PURE__ */ jsx6(NavigationTree, { activeRoute, basePath, depth: depth + 1, nodes: node.items })
|
|
1164
1273
|
] }, `group:${node.label}`);
|
|
1165
1274
|
}
|
|
1166
|
-
return /* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
/* @__PURE__ */
|
|
1169
|
-
/* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ jsxs6("details", { className: "documentation-nav-folder", open: active2, children: [
|
|
1276
|
+
/* @__PURE__ */ jsxs6("summary", { children: [
|
|
1277
|
+
/* @__PURE__ */ jsx6("span", { children: node.label }),
|
|
1278
|
+
/* @__PURE__ */ jsx6(ChevronDownIcon, {})
|
|
1170
1279
|
] }),
|
|
1171
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ jsx6("div", { children: /* @__PURE__ */ jsx6(NavigationTree, { activeRoute, basePath, depth: depth + 1, nodes: node.items }) })
|
|
1172
1281
|
] }, `group:${node.label}`);
|
|
1173
1282
|
}
|
|
1174
1283
|
const href = node.kind === "page" ? documentationPublicPath(basePath, node.route) : node.href;
|
|
1175
1284
|
const active = node.kind === "page" && node.route === activeRoute;
|
|
1176
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ jsxs6(
|
|
1177
1286
|
"a",
|
|
1178
1287
|
{
|
|
1179
1288
|
"aria-current": active ? "page" : void 0,
|
|
@@ -1181,8 +1290,8 @@ function NavigationTree({
|
|
|
1181
1290
|
href,
|
|
1182
1291
|
...externalProps(href),
|
|
1183
1292
|
children: [
|
|
1184
|
-
/* @__PURE__ */
|
|
1185
|
-
isExternal(href) && /* @__PURE__ */
|
|
1293
|
+
/* @__PURE__ */ jsx6("span", { children: node.label }),
|
|
1294
|
+
isExternal(href) && /* @__PURE__ */ jsx6(ExternalIcon, {})
|
|
1186
1295
|
]
|
|
1187
1296
|
},
|
|
1188
1297
|
`${node.kind}:${href}`
|
|
@@ -1194,47 +1303,47 @@ function MobileNavigation({
|
|
|
1194
1303
|
onClose,
|
|
1195
1304
|
open
|
|
1196
1305
|
}) {
|
|
1197
|
-
const dialogRef =
|
|
1306
|
+
const dialogRef = useRef5(null);
|
|
1198
1307
|
useDialogFocus(open, dialogRef, onClose);
|
|
1199
1308
|
if (!open) return null;
|
|
1200
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ jsx6("div", { className: "documentation-modal-layer", role: "presentation", onMouseDown: (event) => {
|
|
1201
1310
|
if (event.currentTarget === event.target) onClose();
|
|
1202
|
-
}, children: /* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
/* @__PURE__ */
|
|
1311
|
+
}, children: /* @__PURE__ */ jsxs6("div", { className: "documentation-mobile-nav", role: "dialog", "aria-modal": "true", "aria-label": "Documentation navigation", ref: dialogRef, children: [
|
|
1312
|
+
/* @__PURE__ */ jsxs6("header", { children: [
|
|
1313
|
+
/* @__PURE__ */ jsx6(
|
|
1205
1314
|
"a",
|
|
1206
1315
|
{
|
|
1207
1316
|
"aria-label": `${documentationSubject(data.config.name)} home`,
|
|
1208
1317
|
className: "documentation-brand",
|
|
1209
1318
|
href: data.config.theme.logoHref ?? documentationPublicPath(data.basePath, "/"),
|
|
1210
1319
|
...externalProps(data.config.theme.logoHref ?? documentationPublicPath(data.basePath, "/")),
|
|
1211
|
-
children: /* @__PURE__ */
|
|
1320
|
+
children: /* @__PURE__ */ jsx6(BrandLogo, { data })
|
|
1212
1321
|
}
|
|
1213
1322
|
),
|
|
1214
|
-
/* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ jsx6("button", { className: "documentation-icon-button", type: "button", onClick: onClose, "aria-label": "Close documentation navigation", "data-autofocus": true, children: /* @__PURE__ */ jsx6(CloseIcon, {}) })
|
|
1215
1324
|
] }),
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
!data.config.theme.strictMode && /* @__PURE__ */
|
|
1219
|
-
data.config.footer.map((link) => /* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ jsx6("nav", { className: "documentation-page-tree", children: /* @__PURE__ */ jsx6(NavigationTree, { activeRoute: data.page.route, basePath: data.basePath, nodes: data.navigation }) }),
|
|
1326
|
+
/* @__PURE__ */ jsxs6("footer", { children: [
|
|
1327
|
+
!data.config.theme.strictMode && /* @__PURE__ */ jsx6(ThemeControls, { defaultMode: data.config.theme.defaultMode ?? "system" }),
|
|
1328
|
+
data.config.footer.map((link) => /* @__PURE__ */ jsx6("a", { href: link.href, ...externalProps(link.href), children: link.label }, `${link.label}:${link.href}`))
|
|
1220
1329
|
] })
|
|
1221
1330
|
] }) });
|
|
1222
1331
|
}
|
|
1223
1332
|
function ThemeControls({ defaultMode }) {
|
|
1224
|
-
const [mode, setMode] =
|
|
1225
|
-
|
|
1333
|
+
const [mode, setMode] = useState5(defaultMode);
|
|
1334
|
+
useEffect6(() => {
|
|
1226
1335
|
const saved = safeStorageGet("deepspace-documentation-theme");
|
|
1227
1336
|
if (saved === "light" || saved === "dark" || saved === "system") setMode(saved);
|
|
1228
1337
|
}, []);
|
|
1229
|
-
|
|
1338
|
+
useEffect6(() => applyThemeMode(mode), [mode]);
|
|
1230
1339
|
const choose = (next) => {
|
|
1231
1340
|
setMode(next);
|
|
1232
1341
|
safeStorageSet("deepspace-documentation-theme", next);
|
|
1233
1342
|
};
|
|
1234
|
-
return /* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ jsxs6("div", { className: "documentation-theme-controls", role: "group", "aria-label": "Theme preference", children: [
|
|
1344
|
+
/* @__PURE__ */ jsx6("button", { "aria-pressed": mode === "system", "aria-label": "Use system theme", onClick: () => choose("system"), type: "button", children: /* @__PURE__ */ jsx6(SystemIcon, {}) }),
|
|
1345
|
+
/* @__PURE__ */ jsx6("button", { "aria-pressed": mode === "light", "aria-label": "Use light theme", onClick: () => choose("light"), type: "button", children: /* @__PURE__ */ jsx6(SunIcon, {}) }),
|
|
1346
|
+
/* @__PURE__ */ jsx6("button", { "aria-pressed": mode === "dark", "aria-label": "Use dark theme", onClick: () => choose("dark"), type: "button", children: /* @__PURE__ */ jsx6(MoonIcon, {}) })
|
|
1238
1347
|
] });
|
|
1239
1348
|
}
|
|
1240
1349
|
function containsRoute(node, route) {
|
|
@@ -1253,12 +1362,12 @@ function applyThemeMode(mode) {
|
|
|
1253
1362
|
|
|
1254
1363
|
// src/documentation/runtime/search.tsx
|
|
1255
1364
|
import {
|
|
1256
|
-
useEffect as
|
|
1365
|
+
useEffect as useEffect7,
|
|
1257
1366
|
useMemo as useMemo2,
|
|
1258
|
-
useRef as
|
|
1259
|
-
useState as
|
|
1367
|
+
useRef as useRef6,
|
|
1368
|
+
useState as useState6
|
|
1260
1369
|
} from "react";
|
|
1261
|
-
import { Fragment as
|
|
1370
|
+
import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1262
1371
|
function SearchCommand({
|
|
1263
1372
|
assistantEnabled,
|
|
1264
1373
|
basePath,
|
|
@@ -1268,25 +1377,25 @@ function SearchCommand({
|
|
|
1268
1377
|
onNavigate,
|
|
1269
1378
|
open
|
|
1270
1379
|
}) {
|
|
1271
|
-
const dialogRef =
|
|
1272
|
-
const resultsRef =
|
|
1273
|
-
const [index, setIndex] =
|
|
1274
|
-
const [loading, setLoading] =
|
|
1275
|
-
const [query, setQuery] =
|
|
1276
|
-
const [activeIndex, setActiveIndex] =
|
|
1380
|
+
const dialogRef = useRef6(null);
|
|
1381
|
+
const resultsRef = useRef6(null);
|
|
1382
|
+
const [index, setIndex] = useState6(null);
|
|
1383
|
+
const [loading, setLoading] = useState6(false);
|
|
1384
|
+
const [query, setQuery] = useState6("");
|
|
1385
|
+
const [activeIndex, setActiveIndex] = useState6(0);
|
|
1277
1386
|
useDialogFocus(open, dialogRef, onClose);
|
|
1278
|
-
|
|
1387
|
+
useEffect7(() => {
|
|
1279
1388
|
if (!open || index || loading) return;
|
|
1280
1389
|
setLoading(true);
|
|
1281
1390
|
fetch(documentationPublicPath(basePath, "/search.json")).then((response) => response.ok ? response.json() : []).then(setIndex).catch(() => setIndex([])).finally(() => setLoading(false));
|
|
1282
1391
|
}, [basePath, index, loading, open]);
|
|
1283
|
-
|
|
1392
|
+
useEffect7(() => {
|
|
1284
1393
|
if (!open) {
|
|
1285
1394
|
setQuery("");
|
|
1286
1395
|
setActiveIndex(0);
|
|
1287
1396
|
}
|
|
1288
1397
|
}, [open]);
|
|
1289
|
-
|
|
1398
|
+
useEffect7(() => {
|
|
1290
1399
|
resultsRef.current?.querySelector(`#documentation-search-option-${activeIndex}`)?.scrollIntoView({ block: "nearest" });
|
|
1291
1400
|
}, [activeIndex, query]);
|
|
1292
1401
|
const preparedIndex = useMemo2(() => prepareSearchIndex(index ?? []), [index]);
|
|
@@ -1313,12 +1422,12 @@ function SearchCommand({
|
|
|
1313
1422
|
}
|
|
1314
1423
|
}
|
|
1315
1424
|
};
|
|
1316
|
-
return /* @__PURE__ */
|
|
1425
|
+
return /* @__PURE__ */ jsx7("div", { className: "documentation-modal-layer documentation-search-layer", role: "presentation", onMouseDown: (event) => {
|
|
1317
1426
|
if (event.currentTarget === event.target) onClose();
|
|
1318
|
-
}, children: /* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
/* @__PURE__ */
|
|
1427
|
+
}, children: /* @__PURE__ */ jsxs7("div", { className: "documentation-search-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Search documentation", ref: dialogRef, children: [
|
|
1428
|
+
/* @__PURE__ */ jsxs7("label", { className: "documentation-search-input", children: [
|
|
1429
|
+
/* @__PURE__ */ jsx7(SearchIcon, {}),
|
|
1430
|
+
/* @__PURE__ */ jsx7(
|
|
1322
1431
|
"input",
|
|
1323
1432
|
{
|
|
1324
1433
|
"aria-activedescendant": selectableCount > 0 ? `documentation-search-option-${activeIndex}` : void 0,
|
|
@@ -1337,21 +1446,21 @@ function SearchCommand({
|
|
|
1337
1446
|
value: query
|
|
1338
1447
|
}
|
|
1339
1448
|
),
|
|
1340
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ jsx7("kbd", { children: "Esc" })
|
|
1341
1450
|
] }),
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
!query.trim() && /* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ jsxs7("div", { className: "documentation-search-results", id: "documentation-search-results", ref: resultsRef, role: "listbox", "aria-label": "Search results", children: [
|
|
1452
|
+
!query.trim() && /* @__PURE__ */ jsxs7("div", { className: "documentation-search-empty", children: [
|
|
1453
|
+
/* @__PURE__ */ jsx7(OrbitMark, {}),
|
|
1454
|
+
/* @__PURE__ */ jsx7("strong", { children: "Find an answer in this commit" }),
|
|
1455
|
+
/* @__PURE__ */ jsx7("span", { children: "Search pages, headings, APIs, and examples." })
|
|
1347
1456
|
] }),
|
|
1348
|
-
query.trim() && loading && /* @__PURE__ */
|
|
1349
|
-
query.trim() && !loading && results.length === 0 && /* @__PURE__ */
|
|
1457
|
+
query.trim() && loading && /* @__PURE__ */ jsx7("div", { className: "documentation-search-state", children: "Searching this documentation\u2026" }),
|
|
1458
|
+
query.trim() && !loading && results.length === 0 && /* @__PURE__ */ jsxs7("div", { className: "documentation-search-state", children: [
|
|
1350
1459
|
"No documentation matched \u201C",
|
|
1351
1460
|
query.trim(),
|
|
1352
1461
|
"\u201D."
|
|
1353
1462
|
] }),
|
|
1354
|
-
results.map((result, resultIndex) => /* @__PURE__ */
|
|
1463
|
+
results.map((result, resultIndex) => /* @__PURE__ */ jsxs7(
|
|
1355
1464
|
"a",
|
|
1356
1465
|
{
|
|
1357
1466
|
"aria-selected": activeIndex === resultIndex,
|
|
@@ -1362,21 +1471,21 @@ function SearchCommand({
|
|
|
1362
1471
|
onMouseEnter: () => setActiveIndex(resultIndex),
|
|
1363
1472
|
role: "option",
|
|
1364
1473
|
children: [
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
1367
|
-
/* @__PURE__ */
|
|
1368
|
-
result.kind === "section" ? /* @__PURE__ */
|
|
1474
|
+
/* @__PURE__ */ jsx7("span", { className: "documentation-search-kind", children: result.kind === "section" ? /* @__PURE__ */ jsx7(HashIcon, {}) : /* @__PURE__ */ jsx7(FileIcon, {}) }),
|
|
1475
|
+
/* @__PURE__ */ jsxs7("span", { className: "documentation-search-copy", children: [
|
|
1476
|
+
/* @__PURE__ */ jsx7("strong", { children: highlightMatch(result.title, query) }),
|
|
1477
|
+
result.kind === "section" ? /* @__PURE__ */ jsxs7("span", { className: "documentation-search-crumbs", children: [
|
|
1369
1478
|
result.context,
|
|
1370
|
-
/* @__PURE__ */
|
|
1479
|
+
/* @__PURE__ */ jsx7(ChevronRightIcon, {}),
|
|
1371
1480
|
result.title
|
|
1372
|
-
] }) : /* @__PURE__ */
|
|
1481
|
+
] }) : /* @__PURE__ */ jsx7("small", { children: result.context })
|
|
1373
1482
|
] }),
|
|
1374
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ jsx7(ChevronRightIcon, {})
|
|
1375
1484
|
]
|
|
1376
1485
|
},
|
|
1377
1486
|
result.href
|
|
1378
1487
|
)),
|
|
1379
|
-
assistantEnabled && query.trim() && /* @__PURE__ */
|
|
1488
|
+
assistantEnabled && query.trim() && /* @__PURE__ */ jsxs7(
|
|
1380
1489
|
"button",
|
|
1381
1490
|
{
|
|
1382
1491
|
"aria-selected": activeIndex === results.length,
|
|
@@ -1387,28 +1496,28 @@ function SearchCommand({
|
|
|
1387
1496
|
role: "option",
|
|
1388
1497
|
type: "button",
|
|
1389
1498
|
children: [
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ jsx7(SparkIcon, {}),
|
|
1500
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1501
|
+
/* @__PURE__ */ jsx7("strong", { children: "Ask DeepSpace" }),
|
|
1502
|
+
/* @__PURE__ */ jsx7("small", { children: "Answer from the current documentation with citations" })
|
|
1394
1503
|
] }),
|
|
1395
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ jsx7(ChevronRightIcon, {})
|
|
1396
1505
|
]
|
|
1397
1506
|
}
|
|
1398
1507
|
)
|
|
1399
1508
|
] }),
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
/* @__PURE__ */
|
|
1402
|
-
/* @__PURE__ */
|
|
1403
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ jsxs7("footer", { children: [
|
|
1510
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1511
|
+
/* @__PURE__ */ jsx7("kbd", { children: "\u2191" }),
|
|
1512
|
+
/* @__PURE__ */ jsx7("kbd", { children: "\u2193" }),
|
|
1404
1513
|
" select"
|
|
1405
1514
|
] }),
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1515
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1516
|
+
/* @__PURE__ */ jsx7("kbd", { children: "\u21B5" }),
|
|
1408
1517
|
" open"
|
|
1409
1518
|
] }),
|
|
1410
|
-
/* @__PURE__ */
|
|
1411
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1520
|
+
/* @__PURE__ */ jsx7("kbd", { children: "esc" }),
|
|
1412
1521
|
" close"
|
|
1413
1522
|
] })
|
|
1414
1523
|
] })
|
|
@@ -1474,9 +1583,9 @@ function highlightMatch(value, query) {
|
|
|
1474
1583
|
if (!normalizedQuery) return value;
|
|
1475
1584
|
const index = value.toLowerCase().indexOf(normalizedQuery.toLowerCase());
|
|
1476
1585
|
if (index < 0) return value;
|
|
1477
|
-
return /* @__PURE__ */
|
|
1586
|
+
return /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
1478
1587
|
value.slice(0, index),
|
|
1479
|
-
/* @__PURE__ */
|
|
1588
|
+
/* @__PURE__ */ jsx7("mark", { children: value.slice(index, index + normalizedQuery.length) }),
|
|
1480
1589
|
value.slice(index + normalizedQuery.length)
|
|
1481
1590
|
] });
|
|
1482
1591
|
}
|
|
@@ -1485,18 +1594,18 @@ function normalizeSearch(value) {
|
|
|
1485
1594
|
}
|
|
1486
1595
|
|
|
1487
1596
|
// src/documentation/runtime/app.tsx
|
|
1488
|
-
import { jsx as
|
|
1597
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1489
1598
|
function DocumentationApp({
|
|
1490
1599
|
data,
|
|
1491
1600
|
children,
|
|
1492
1601
|
navigating = false,
|
|
1493
1602
|
onNavigate
|
|
1494
1603
|
}) {
|
|
1495
|
-
const [mobileNavOpen, setMobileNavOpen] =
|
|
1496
|
-
const [searchOpen, setSearchOpen] =
|
|
1497
|
-
const [assistantOpen, setAssistantOpen] =
|
|
1498
|
-
const [assistantDraft, setAssistantDraft] =
|
|
1499
|
-
const [assistantSeed, setAssistantSeed] =
|
|
1604
|
+
const [mobileNavOpen, setMobileNavOpen] = useState7(false);
|
|
1605
|
+
const [searchOpen, setSearchOpen] = useState7(false);
|
|
1606
|
+
const [assistantOpen, setAssistantOpen] = useState7(false);
|
|
1607
|
+
const [assistantDraft, setAssistantDraft] = useState7("");
|
|
1608
|
+
const [assistantSeed, setAssistantSeed] = useState7({ id: 0, submit: false });
|
|
1500
1609
|
const assistantAccess = data.config.assistant.access === "disabled" ? null : data.config.assistant.access;
|
|
1501
1610
|
const assistantEnabled = assistantAccess !== null;
|
|
1502
1611
|
const appClassName = [
|
|
@@ -1511,7 +1620,7 @@ function DocumentationApp({
|
|
|
1511
1620
|
setSearchOpen(false);
|
|
1512
1621
|
setAssistantOpen(true);
|
|
1513
1622
|
}, []);
|
|
1514
|
-
|
|
1623
|
+
useEffect8(() => {
|
|
1515
1624
|
const handleKeydown = (event) => {
|
|
1516
1625
|
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
|
1517
1626
|
event.preventDefault();
|
|
@@ -1525,18 +1634,18 @@ function DocumentationApp({
|
|
|
1525
1634
|
document.addEventListener("keydown", handleKeydown);
|
|
1526
1635
|
return () => document.removeEventListener("keydown", handleKeydown);
|
|
1527
1636
|
}, [data.config.assistant.access, openAssistant]);
|
|
1528
|
-
|
|
1637
|
+
useEffect8(() => {
|
|
1529
1638
|
setMobileNavOpen(false);
|
|
1530
1639
|
setSearchOpen(false);
|
|
1531
1640
|
}, [data.page.route]);
|
|
1532
|
-
return /* @__PURE__ */
|
|
1641
|
+
return /* @__PURE__ */ jsxs8(
|
|
1533
1642
|
"div",
|
|
1534
1643
|
{
|
|
1535
1644
|
"aria-busy": navigating || void 0,
|
|
1536
1645
|
className: appClassName,
|
|
1537
1646
|
children: [
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ jsx8("a", { className: "documentation-skip-link", href: "#documentation-content", children: "Skip to main content" }),
|
|
1648
|
+
/* @__PURE__ */ jsx8(
|
|
1540
1649
|
DocumentationHeader,
|
|
1541
1650
|
{
|
|
1542
1651
|
data,
|
|
@@ -1544,14 +1653,14 @@ function DocumentationApp({
|
|
|
1544
1653
|
onSearchOpen: () => setSearchOpen(true)
|
|
1545
1654
|
}
|
|
1546
1655
|
),
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ jsxs8("div", { className: "documentation-frame", children: [
|
|
1657
|
+
/* @__PURE__ */ jsx8(DesktopSidebar, { data }),
|
|
1658
|
+
/* @__PURE__ */ jsx8("main", { className: "documentation-main", id: "documentation-content", children: /* @__PURE__ */ jsxs8("div", { className: "documentation-reader-grid", children: [
|
|
1659
|
+
/* @__PURE__ */ jsx8("div", { className: "documentation-reader-column", children: /* @__PURE__ */ jsx8(
|
|
1551
1660
|
Article,
|
|
1552
1661
|
{
|
|
1553
1662
|
data,
|
|
1554
|
-
launcher: assistantAccess && !assistantOpen ? /* @__PURE__ */
|
|
1663
|
+
launcher: assistantAccess && !assistantOpen ? /* @__PURE__ */ jsx8("div", { className: "documentation-launcher-dock", children: /* @__PURE__ */ jsx8(
|
|
1555
1664
|
AssistantLauncher,
|
|
1556
1665
|
{
|
|
1557
1666
|
input: assistantDraft,
|
|
@@ -1565,10 +1674,10 @@ function DocumentationApp({
|
|
|
1565
1674
|
children
|
|
1566
1675
|
}
|
|
1567
1676
|
) }),
|
|
1568
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ jsx8(ContextRail, { data })
|
|
1569
1678
|
] }) })
|
|
1570
1679
|
] }),
|
|
1571
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ jsx8(
|
|
1572
1681
|
MobileNavigation,
|
|
1573
1682
|
{
|
|
1574
1683
|
data,
|
|
@@ -1576,7 +1685,7 @@ function DocumentationApp({
|
|
|
1576
1685
|
open: mobileNavOpen
|
|
1577
1686
|
}
|
|
1578
1687
|
),
|
|
1579
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx8(
|
|
1580
1689
|
SearchCommand,
|
|
1581
1690
|
{
|
|
1582
1691
|
assistantEnabled,
|
|
@@ -1588,7 +1697,7 @@ function DocumentationApp({
|
|
|
1588
1697
|
open: searchOpen
|
|
1589
1698
|
}
|
|
1590
1699
|
),
|
|
1591
|
-
assistantAccess && /* @__PURE__ */
|
|
1700
|
+
assistantAccess && /* @__PURE__ */ jsx8(
|
|
1592
1701
|
DocumentationAssistant,
|
|
1593
1702
|
{
|
|
1594
1703
|
access: assistantAccess,
|
|
@@ -1610,74 +1719,82 @@ function DocumentationApp({
|
|
|
1610
1719
|
|
|
1611
1720
|
// src/documentation/runtime/mdx-components.tsx
|
|
1612
1721
|
import { Children, createElement, isValidElement } from "react";
|
|
1613
|
-
import { Fragment as
|
|
1722
|
+
import { Fragment as Fragment6, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1614
1723
|
function Callout({ children, title, kind }) {
|
|
1615
1724
|
const label = title ?? kind.charAt(0).toUpperCase() + kind.slice(1);
|
|
1616
|
-
return /* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1725
|
+
return /* @__PURE__ */ jsxs9("aside", { className: `documentation-callout documentation-callout-${kind}`, children: [
|
|
1726
|
+
/* @__PURE__ */ jsx9("strong", { children: label }),
|
|
1618
1727
|
children
|
|
1619
1728
|
] });
|
|
1620
1729
|
}
|
|
1621
1730
|
function Note(props) {
|
|
1622
|
-
return /* @__PURE__ */
|
|
1731
|
+
return /* @__PURE__ */ jsx9(Callout, { ...props, kind: "note" });
|
|
1623
1732
|
}
|
|
1624
1733
|
function Tip(props) {
|
|
1625
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ jsx9(Callout, { ...props, kind: "tip" });
|
|
1626
1735
|
}
|
|
1627
1736
|
function Warning(props) {
|
|
1628
|
-
return /* @__PURE__ */
|
|
1737
|
+
return /* @__PURE__ */ jsx9(Callout, { ...props, kind: "warning" });
|
|
1629
1738
|
}
|
|
1630
1739
|
function Info(props) {
|
|
1631
|
-
return /* @__PURE__ */
|
|
1740
|
+
return /* @__PURE__ */ jsx9(Callout, { ...props, kind: "info" });
|
|
1632
1741
|
}
|
|
1633
1742
|
function Card({ children, href, label, title }) {
|
|
1634
|
-
const content = /* @__PURE__ */
|
|
1635
|
-
title ?? label ? /* @__PURE__ */
|
|
1743
|
+
const content = /* @__PURE__ */ jsxs9(Fragment6, { children: [
|
|
1744
|
+
title ?? label ? /* @__PURE__ */ jsx9("strong", { children: title ?? label }) : null,
|
|
1636
1745
|
children
|
|
1637
1746
|
] });
|
|
1638
|
-
return href ? /* @__PURE__ */
|
|
1747
|
+
return href ? /* @__PURE__ */ jsxs9("a", { className: "documentation-card", href, children: [
|
|
1639
1748
|
content,
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
] }) : /* @__PURE__ */
|
|
1749
|
+
/* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "\u2192" })
|
|
1750
|
+
] }) : /* @__PURE__ */ jsx9("div", { className: "documentation-card", children: content });
|
|
1642
1751
|
}
|
|
1643
1752
|
function Accordion({ children, label, title }) {
|
|
1644
|
-
return /* @__PURE__ */
|
|
1645
|
-
/* @__PURE__ */
|
|
1753
|
+
return /* @__PURE__ */ jsxs9("details", { className: "documentation-accordion", children: [
|
|
1754
|
+
/* @__PURE__ */ jsx9("summary", { children: title ?? label ?? "Details" }),
|
|
1646
1755
|
children
|
|
1647
1756
|
] });
|
|
1648
1757
|
}
|
|
1649
1758
|
function AccordionGroup({ children }) {
|
|
1650
|
-
return /* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ jsx9("div", { className: "documentation-accordion-group", children });
|
|
1651
1760
|
}
|
|
1652
1761
|
function Step({ children, label, title }) {
|
|
1653
|
-
return /* @__PURE__ */
|
|
1654
|
-
title ?? label ? /* @__PURE__ */
|
|
1762
|
+
return /* @__PURE__ */ jsxs9("section", { className: "documentation-step", children: [
|
|
1763
|
+
title ?? label ? /* @__PURE__ */ jsx9("h3", { children: title ?? label }) : null,
|
|
1655
1764
|
children
|
|
1656
1765
|
] });
|
|
1657
1766
|
}
|
|
1658
1767
|
function Steps({ children }) {
|
|
1659
|
-
return /* @__PURE__ */
|
|
1768
|
+
return /* @__PURE__ */ jsx9("div", { className: "documentation-steps", children });
|
|
1660
1769
|
}
|
|
1661
1770
|
function Tab({ children, label, title }) {
|
|
1662
|
-
return /* @__PURE__ */
|
|
1771
|
+
return /* @__PURE__ */ jsx9("section", { className: "documentation-tab", "data-tab": true, "data-tab-title": title ?? label ?? "Tab", children });
|
|
1663
1772
|
}
|
|
1664
1773
|
function Tabs({ children }) {
|
|
1665
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ jsx9(TabGroup, { className: "documentation-tabs", panels: tabPanels(children) });
|
|
1666
1775
|
}
|
|
1667
1776
|
function CodeGroup({ children, label, title }) {
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1777
|
+
const panels = Children.toArray(children).map((child, index) => ({
|
|
1778
|
+
label: codeBlockTitle(child) ?? `Example ${index + 1}`,
|
|
1779
|
+
content: child
|
|
1780
|
+
}));
|
|
1781
|
+
return /* @__PURE__ */ jsx9(
|
|
1782
|
+
TabGroup,
|
|
1783
|
+
{
|
|
1784
|
+
className: "documentation-code-group",
|
|
1785
|
+
panels,
|
|
1786
|
+
title: title ?? label ? /* @__PURE__ */ jsx9("div", { className: "documentation-code-group-title", children: title ?? label }) : void 0
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
1789
|
+
}
|
|
1790
|
+
function tabPanels(children) {
|
|
1791
|
+
return Children.toArray(children).map((child, index) => {
|
|
1792
|
+
const props = isValidElement(child) ? child.props : void 0;
|
|
1793
|
+
return {
|
|
1794
|
+
label: props?.title ?? props?.label ?? `Tab ${index + 1}`,
|
|
1795
|
+
content: props && "children" in props ? props.children : child
|
|
1796
|
+
};
|
|
1797
|
+
});
|
|
1681
1798
|
}
|
|
1682
1799
|
function codeBlockTitle(node) {
|
|
1683
1800
|
if (!isValidElement(node)) return void 0;
|
|
@@ -1692,10 +1809,13 @@ function Heading({ level, ...props }) {
|
|
|
1692
1809
|
`h${level}`,
|
|
1693
1810
|
props,
|
|
1694
1811
|
props.children,
|
|
1695
|
-
id ? /* @__PURE__ */
|
|
1812
|
+
id ? /* @__PURE__ */ jsx9("a", { "aria-label": "Link to this section", className: "documentation-heading-anchor", href: `#${id}`, children: "#" }) : null
|
|
1696
1813
|
);
|
|
1697
1814
|
}
|
|
1698
1815
|
var documentationMdxComponents = {
|
|
1816
|
+
/** React renders the code-block wrapper so nothing has to move a `pre` that
|
|
1817
|
+
* the reconciler already owns. */
|
|
1818
|
+
pre: CodeBlock,
|
|
1699
1819
|
Accordion,
|
|
1700
1820
|
AccordionGroup,
|
|
1701
1821
|
Card,
|
|
@@ -1708,25 +1828,32 @@ var documentationMdxComponents = {
|
|
|
1708
1828
|
Tabs,
|
|
1709
1829
|
Tip,
|
|
1710
1830
|
Warning,
|
|
1711
|
-
h1: (props) => /* @__PURE__ */
|
|
1712
|
-
h2: (props) => /* @__PURE__ */
|
|
1713
|
-
h3: (props) => /* @__PURE__ */
|
|
1714
|
-
h4: (props) => /* @__PURE__ */
|
|
1715
|
-
h5: (props) => /* @__PURE__ */
|
|
1716
|
-
h6: (props) => /* @__PURE__ */
|
|
1831
|
+
h1: (props) => /* @__PURE__ */ jsx9(Heading, { ...props, level: 1 }),
|
|
1832
|
+
h2: (props) => /* @__PURE__ */ jsx9(Heading, { ...props, level: 2 }),
|
|
1833
|
+
h3: (props) => /* @__PURE__ */ jsx9(Heading, { ...props, level: 3 }),
|
|
1834
|
+
h4: (props) => /* @__PURE__ */ jsx9(Heading, { ...props, level: 4 }),
|
|
1835
|
+
h5: (props) => /* @__PURE__ */ jsx9(Heading, { ...props, level: 5 }),
|
|
1836
|
+
h6: (props) => /* @__PURE__ */ jsx9(Heading, { ...props, level: 6 })
|
|
1717
1837
|
};
|
|
1718
1838
|
|
|
1719
1839
|
// src/documentation/runtime/public.tsx
|
|
1720
|
-
import { jsx as
|
|
1840
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1721
1841
|
var DefaultDocumentation = DocumentationApp;
|
|
1722
1842
|
function DocumentationContent({
|
|
1723
1843
|
data,
|
|
1724
1844
|
Page
|
|
1725
1845
|
}) {
|
|
1726
1846
|
if (!Page) {
|
|
1727
|
-
return /* @__PURE__ */
|
|
1847
|
+
return /* @__PURE__ */ jsx10(
|
|
1848
|
+
"div",
|
|
1849
|
+
{
|
|
1850
|
+
className: "documentation-prose",
|
|
1851
|
+
"data-prose": "html",
|
|
1852
|
+
dangerouslySetInnerHTML: { __html: data.page.html }
|
|
1853
|
+
}
|
|
1854
|
+
);
|
|
1728
1855
|
}
|
|
1729
|
-
return /* @__PURE__ */
|
|
1856
|
+
return /* @__PURE__ */ jsx10("div", { className: "documentation-prose", "data-prose": "react", children: /* @__PURE__ */ jsx10(Page, { components: documentationMdxComponents }) });
|
|
1730
1857
|
}
|
|
1731
1858
|
|
|
1732
1859
|
export {
|
|
@@ -1748,4 +1875,4 @@ export {
|
|
|
1748
1875
|
DefaultDocumentation,
|
|
1749
1876
|
DocumentationContent
|
|
1750
1877
|
};
|
|
1751
|
-
//# sourceMappingURL=chunk-
|
|
1878
|
+
//# sourceMappingURL=chunk-233GQU2H.js.map
|