deepspace 0.10.1 → 0.10.2
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 +8 -0
- package/dist/chunk-T7V4GUIN.js +1638 -0
- package/dist/chunk-T7V4GUIN.js.map +1 -0
- package/dist/cli.js +731 -324
- package/dist/cli.js.map +1 -1
- package/dist/documentation-client-core.d.ts +18 -0
- package/dist/documentation-client-core.js +395 -0
- package/dist/documentation-client-core.js.map +1 -0
- package/dist/documentation-default-renderer.cjs +124 -0
- package/dist/documentation-react.d.ts +2 -0
- package/dist/documentation-react.js +35 -0
- package/dist/documentation-react.js.map +1 -0
- package/dist/documentation-runtime.js +71 -0
- package/dist/documentation-server-core.d.ts +11 -0
- package/dist/documentation-server-core.js +48 -0
- package/dist/documentation-server-core.js.map +1 -0
- package/dist/documentation.d.ts +366 -0
- package/dist/documentation.js +3953 -0
- package/dist/documentation.js.map +1 -0
- package/dist/feature-installer.js +145 -0
- package/dist/feature-installer.js.map +1 -1
- package/dist/index.d.ts +177 -1
- package/dist/index.js +133 -0
- package/dist/index.js.map +1 -1
- package/dist/public-BGRX_Cjd.d.ts +234 -0
- package/dist/schema.d.ts +186 -0
- package/dist/schema.js +610 -0
- package/dist/schema.js.map +1 -0
- package/dist/server.d.ts +83 -4
- package/dist/server.js +296 -1
- package/dist/server.js.map +1 -1
- package/dist/testing.d.ts +5 -8
- package/dist/testing.js +48 -14
- package/dist/testing.js.map +1 -1
- package/dist/worker.d.ts +249 -5
- package/dist/worker.js +1438 -19
- package/dist/worker.js.map +1 -1
- package/features/admin-page/src/admin-schema.ts +1 -1
- package/features/ai-chat/feature.json +2 -2
- package/features/ai-chat/src/ChatPanel.tsx +6 -11
- package/features/ai-chat/src/ai-chat-schema.ts +1 -2
- package/features/canvas/src/canvas-schema.ts +1 -1
- package/features/documentation/content/index.mdx +14 -0
- package/features/documentation/content/quickstart.mdx +12 -0
- package/features/documentation/documentation.json +18 -0
- package/features/documentation/feature.json +68 -0
- package/features/{docs → documents}/feature.json +27 -27
- package/features/{docs/src/DocsEditorPage.tsx → documents/src/DocumentsEditorPage.tsx} +74 -74
- package/features/{docs/src/DocsListPage.tsx → documents/src/DocumentsListPage.tsx} +102 -102
- package/features/{docs/src/DocsOutlinePanel.tsx → documents/src/DocumentsOutlinePanel.tsx} +9 -9
- package/features/{docs/src/DocsPresence.tsx → documents/src/DocumentsPresence.tsx} +18 -18
- package/features/{docs → documents}/src/InviteDialog.tsx +21 -21
- package/features/{docs → documents}/src/LibrarySidebar.tsx +25 -25
- package/features/documents/src/__tests__/documents-presence-access.test.ts +71 -0
- package/features/{docs/src/docs-library-types.ts → documents/src/documents-library-types.ts} +3 -3
- package/features/{docs/src/docs-schema.ts → documents/src/documents-schema.ts} +6 -6
- package/features/{docs/src/docs-ui.css → documents/src/documents-ui.css} +89 -89
- package/features/{docs → documents}/src/editor/DocEditorSurface.tsx +11 -11
- package/features/{docs/src/editor/DocsTiptapToolbar.tsx → documents/src/editor/DocumentsTiptapToolbar.tsx} +21 -21
- package/features/{docs → documents}/src/editor/useDocEditor.ts +4 -4
- package/features/{docs/src/use-docs-presence-access.ts → documents/src/use-documents-presence-access.ts} +51 -51
- package/features/file-attachments/src/attachments-schema.ts +1 -1
- package/features/items/src/items-schema.ts +1 -1
- package/features/leaderboard/src/leaderboard-schema.ts +1 -1
- package/features/messaging/src/ChatMultiPage.tsx +1 -1
- package/features/messaging/src/ChatPage.tsx +1 -1
- package/features/messaging/src/messaging-schema.ts +2 -2
- package/features/tasks/src/tasks-schema.ts +1 -1
- package/features/testing/src/test-schema.ts +2 -2
- package/package.json +26 -1
- package/features/docs/src/__tests__/docs-presence-access.test.ts +0 -71
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { D as DocumentationRuntimeData, a as DocumentationPageComponent, b as DocumentationSiteComponent } from './public-BGRX_Cjd.js';
|
|
3
|
+
export { A as Accordion, c as AccordionGroup, C as Card, d as CodeGroup, e as DefaultDocumentation, f as DocumentationApp, g as DocumentationAppProps, h as DocumentationContent, i as DocumentationSiteProps, I as Info, N as Note, S as Step, j as Steps, T as Tab, k as Tabs, l as Tip, W as Warning } from './public-BGRX_Cjd.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
declare function DocumentationRuntimeRoot({ initialData, loadPage, pages, Site, }: {
|
|
7
|
+
initialData: DocumentationRuntimeData;
|
|
8
|
+
loadPage?: (route: string) => Promise<void>;
|
|
9
|
+
pages?: Record<string, DocumentationPageComponent>;
|
|
10
|
+
Site?: DocumentationSiteComponent;
|
|
11
|
+
}): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function hydrateDocumentation({ loadPage, pages, Site, }?: {
|
|
13
|
+
loadPage?: (route: string) => Promise<void>;
|
|
14
|
+
pages?: Record<string, DocumentationPageComponent>;
|
|
15
|
+
Site?: DocumentationSiteComponent;
|
|
16
|
+
}): void;
|
|
17
|
+
|
|
18
|
+
export { DocumentationPageComponent, DocumentationRuntimeRoot, DocumentationSiteComponent, hydrateDocumentation };
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Accordion,
|
|
3
|
+
AccordionGroup,
|
|
4
|
+
Card,
|
|
5
|
+
CodeGroup,
|
|
6
|
+
DefaultDocumentation,
|
|
7
|
+
DocumentationApp,
|
|
8
|
+
DocumentationContent,
|
|
9
|
+
Info,
|
|
10
|
+
Note,
|
|
11
|
+
Step,
|
|
12
|
+
Steps,
|
|
13
|
+
Tab,
|
|
14
|
+
Tabs,
|
|
15
|
+
Tip,
|
|
16
|
+
Warning,
|
|
17
|
+
documentationLogicalPath,
|
|
18
|
+
documentationPublicPath
|
|
19
|
+
} from "./chunk-T7V4GUIN.js";
|
|
20
|
+
|
|
21
|
+
// src/documentation/runtime/client.tsx
|
|
22
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
23
|
+
import { flushSync } from "react-dom";
|
|
24
|
+
import { hydrateRoot } from "react-dom/client";
|
|
25
|
+
|
|
26
|
+
// src/documentation/runtime/client-document.ts
|
|
27
|
+
function currentRuntimeDocument(data) {
|
|
28
|
+
return {
|
|
29
|
+
canonical: document.querySelector('link[rel="canonical"]')?.href ?? null,
|
|
30
|
+
data,
|
|
31
|
+
description: document.querySelector('meta[name="description"]')?.content ?? null,
|
|
32
|
+
openGraph: readOpenGraph(document),
|
|
33
|
+
robots: document.querySelector('meta[name="robots"]')?.content ?? null,
|
|
34
|
+
title: document.title
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function syncDocument(runtime, target) {
|
|
38
|
+
document.title = runtime.title;
|
|
39
|
+
syncMeta("description", runtime.description);
|
|
40
|
+
syncMeta("robots", runtime.robots);
|
|
41
|
+
syncLink("canonical", runtime.canonical);
|
|
42
|
+
for (const property of ["og:title", "og:description", "og:url"]) {
|
|
43
|
+
syncMeta(property, runtime.openGraph[property], "property");
|
|
44
|
+
}
|
|
45
|
+
document.body.dataset.route = runtime.data.page.route === "/404" ? target.pathname : runtime.data.page.route;
|
|
46
|
+
}
|
|
47
|
+
function readOpenGraph(source) {
|
|
48
|
+
return Object.fromEntries(
|
|
49
|
+
["og:title", "og:description", "og:url"].map((property) => [
|
|
50
|
+
property,
|
|
51
|
+
source.querySelector(`meta[property="${property}"]`)?.content ?? null
|
|
52
|
+
])
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function syncMeta(name, content, attribute = "name") {
|
|
56
|
+
let element = document.head.querySelector(`meta[${attribute}="${name}"]`);
|
|
57
|
+
if (!content) {
|
|
58
|
+
element?.remove();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!element) {
|
|
62
|
+
element = document.createElement("meta");
|
|
63
|
+
element.setAttribute(attribute, name);
|
|
64
|
+
document.head.appendChild(element);
|
|
65
|
+
}
|
|
66
|
+
element.content = content;
|
|
67
|
+
}
|
|
68
|
+
function syncLink(rel, href) {
|
|
69
|
+
let element = document.head.querySelector(`link[rel="${rel}"]`);
|
|
70
|
+
if (!href) {
|
|
71
|
+
element?.remove();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!element) {
|
|
75
|
+
element = document.createElement("link");
|
|
76
|
+
element.rel = rel;
|
|
77
|
+
document.head.appendChild(element);
|
|
78
|
+
}
|
|
79
|
+
element.href = href;
|
|
80
|
+
}
|
|
81
|
+
function locationKey(url) {
|
|
82
|
+
return `${url.pathname}${url.search}`;
|
|
83
|
+
}
|
|
84
|
+
function routeDataUrl(url, basePath) {
|
|
85
|
+
const logical = documentationLogicalPath(basePath, url.pathname);
|
|
86
|
+
if (logical === null) throw new Error(`${url.pathname} is outside the documentation route`);
|
|
87
|
+
const clean = logical.replace(/^\/+|\/+$/g, "");
|
|
88
|
+
return `${documentationPublicPath(basePath, `/data/${clean || "index"}.json`)}${url.search}`;
|
|
89
|
+
}
|
|
90
|
+
function scrollToTarget(target, restoredScroll) {
|
|
91
|
+
if (target.hash) {
|
|
92
|
+
const id = decodeURIComponent(target.hash.slice(1));
|
|
93
|
+
document.getElementById(id)?.scrollIntoView();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
window.scrollTo({ top: restoredScroll ?? 0, behavior: "instant" });
|
|
97
|
+
}
|
|
98
|
+
function currentHistoryState() {
|
|
99
|
+
return history.state && typeof history.state === "object" ? history.state : {};
|
|
100
|
+
}
|
|
101
|
+
function replaceHistoryScroll(scrollY) {
|
|
102
|
+
history.replaceState(
|
|
103
|
+
{ ...currentHistoryState(), deepspaceDocumentation: true, scrollY },
|
|
104
|
+
"",
|
|
105
|
+
window.location.href
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function focusArticleHeading() {
|
|
109
|
+
const heading = document.querySelector(".documentation-article h1");
|
|
110
|
+
if (!heading) return;
|
|
111
|
+
heading.tabIndex = -1;
|
|
112
|
+
heading.focus({ preventScroll: true });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// src/documentation/resource-path.ts
|
|
116
|
+
var RESOURCE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
117
|
+
"7z",
|
|
118
|
+
"avif",
|
|
119
|
+
"css",
|
|
120
|
+
"csv",
|
|
121
|
+
"gif",
|
|
122
|
+
"gz",
|
|
123
|
+
"ico",
|
|
124
|
+
"jpeg",
|
|
125
|
+
"jpg",
|
|
126
|
+
"js",
|
|
127
|
+
"json",
|
|
128
|
+
"map",
|
|
129
|
+
"md",
|
|
130
|
+
"mjs",
|
|
131
|
+
"mp3",
|
|
132
|
+
"mp4",
|
|
133
|
+
"pdf",
|
|
134
|
+
"png",
|
|
135
|
+
"svg",
|
|
136
|
+
"tar",
|
|
137
|
+
"txt",
|
|
138
|
+
"wasm",
|
|
139
|
+
"webm",
|
|
140
|
+
"webp",
|
|
141
|
+
"woff",
|
|
142
|
+
"woff2",
|
|
143
|
+
"xml",
|
|
144
|
+
"yaml",
|
|
145
|
+
"yml",
|
|
146
|
+
"zip"
|
|
147
|
+
]);
|
|
148
|
+
function isNativeDocumentationResourcePath(pathname) {
|
|
149
|
+
const leaf = pathname.slice(pathname.lastIndexOf("/") + 1);
|
|
150
|
+
const extension = leaf.includes(".") ? leaf.slice(leaf.lastIndexOf(".") + 1).toLowerCase() : "";
|
|
151
|
+
return extension !== "" && RESOURCE_EXTENSIONS.has(extension);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/documentation/runtime/routing.ts
|
|
155
|
+
var RESOURCE_ROUTES = /* @__PURE__ */ new Set(["/mcp"]);
|
|
156
|
+
var RESOURCE_PREFIXES = ["/api/", "/assets/", "/data/", "/media/", "/.well-known/"];
|
|
157
|
+
function shouldHandleDocumentationNavigation(href, basePath = "/docs") {
|
|
158
|
+
if (!href.startsWith("/") || href.startsWith("//")) return false;
|
|
159
|
+
const pathname = href.split(/[?#]/, 1)[0] ?? "";
|
|
160
|
+
const logical = documentationLogicalPath(basePath, pathname);
|
|
161
|
+
if (!logical || RESOURCE_ROUTES.has(logical)) return false;
|
|
162
|
+
if (RESOURCE_PREFIXES.some((prefix) => logical.startsWith(prefix))) return false;
|
|
163
|
+
return !isNativeDocumentationResourcePath(logical);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// src/documentation/runtime/client.tsx
|
|
167
|
+
import { jsx } from "react/jsx-runtime";
|
|
168
|
+
function DocumentationRuntimeRoot({
|
|
169
|
+
initialData,
|
|
170
|
+
loadPage,
|
|
171
|
+
pages = {},
|
|
172
|
+
Site = DefaultDocumentation
|
|
173
|
+
}) {
|
|
174
|
+
const [data, setData] = useState(initialData);
|
|
175
|
+
const basePath = initialData.basePath;
|
|
176
|
+
const [navigating, setNavigating] = useState(false);
|
|
177
|
+
const cacheRef = useRef(/* @__PURE__ */ new Map());
|
|
178
|
+
const inFlightRef = useRef(/* @__PURE__ */ new Map());
|
|
179
|
+
const siteDataRef = useRef({ config: initialData.config, navigation: initialData.navigation });
|
|
180
|
+
const navigationIdRef = useRef(0);
|
|
181
|
+
const restoringHistoryRef = useRef(false);
|
|
182
|
+
const scrollFrameRef = useRef(null);
|
|
183
|
+
const renderedLocationRef = useRef(locationKey(new URL(window.location.href)));
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
const root = document.getElementById("deepspace-documentation-root");
|
|
186
|
+
root?.setAttribute("data-documentation-hydrated", "true");
|
|
187
|
+
cacheRef.current.set(locationKey(new URL(window.location.href)), currentRuntimeDocument(initialData));
|
|
188
|
+
const previous = history.scrollRestoration;
|
|
189
|
+
history.scrollRestoration = "manual";
|
|
190
|
+
replaceHistoryScroll(window.scrollY);
|
|
191
|
+
const handleScroll = () => {
|
|
192
|
+
if (restoringHistoryRef.current) return;
|
|
193
|
+
if (scrollFrameRef.current !== null) return;
|
|
194
|
+
scrollFrameRef.current = window.requestAnimationFrame(() => {
|
|
195
|
+
scrollFrameRef.current = null;
|
|
196
|
+
replaceHistoryScroll(window.scrollY);
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
const handlePopState = () => {
|
|
200
|
+
const restoredScroll = currentHistoryState().scrollY;
|
|
201
|
+
restoringHistoryRef.current = true;
|
|
202
|
+
void navigate(window.location.href, "none", restoredScroll);
|
|
203
|
+
};
|
|
204
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
205
|
+
window.addEventListener("popstate", handlePopState);
|
|
206
|
+
return () => {
|
|
207
|
+
window.removeEventListener("scroll", handleScroll);
|
|
208
|
+
window.removeEventListener("popstate", handlePopState);
|
|
209
|
+
if (scrollFrameRef.current !== null) window.cancelAnimationFrame(scrollFrameRef.current);
|
|
210
|
+
history.scrollRestoration = previous;
|
|
211
|
+
root?.removeAttribute("data-documentation-hydrated");
|
|
212
|
+
};
|
|
213
|
+
}, []);
|
|
214
|
+
const load = useCallback(async (target) => {
|
|
215
|
+
const key = locationKey(target);
|
|
216
|
+
const cached = cacheRef.current.get(key);
|
|
217
|
+
if (cached) return cached;
|
|
218
|
+
const pending = inFlightRef.current.get(key);
|
|
219
|
+
if (pending) return pending;
|
|
220
|
+
const request = (async () => {
|
|
221
|
+
const response = await fetch(routeDataUrl(target, basePath), {
|
|
222
|
+
headers: { Accept: "application/json", "x-deepspace-documentation-navigation": "true" }
|
|
223
|
+
});
|
|
224
|
+
if (!response.ok) throw new Error(`Route data returned ${response.status}`);
|
|
225
|
+
const routeDocument = await response.json();
|
|
226
|
+
if (!routeDocument?.data?.page || typeof routeDocument.title !== "string") {
|
|
227
|
+
throw new Error("Navigation response did not contain valid DeepSpace documentation route data");
|
|
228
|
+
}
|
|
229
|
+
const runtime = {
|
|
230
|
+
...routeDocument,
|
|
231
|
+
data: { ...siteDataRef.current, ...routeDocument.data }
|
|
232
|
+
};
|
|
233
|
+
cacheRef.current.set(key, runtime);
|
|
234
|
+
return runtime;
|
|
235
|
+
})();
|
|
236
|
+
inFlightRef.current.set(key, request);
|
|
237
|
+
try {
|
|
238
|
+
return await request;
|
|
239
|
+
} finally {
|
|
240
|
+
if (inFlightRef.current.get(key) === request) inFlightRef.current.delete(key);
|
|
241
|
+
}
|
|
242
|
+
}, [basePath]);
|
|
243
|
+
const navigate = useCallback(async (href, historyMode = "push", restoredScroll) => {
|
|
244
|
+
const target = new URL(href, window.location.href);
|
|
245
|
+
if (target.origin !== window.location.origin) {
|
|
246
|
+
window.location.assign(target.href);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const currentUrl = new URL(window.location.href);
|
|
250
|
+
const targetKey = locationKey(target);
|
|
251
|
+
if (targetKey === renderedLocationRef.current) {
|
|
252
|
+
if (historyMode === "push" && target.href !== currentUrl.href) {
|
|
253
|
+
replaceHistoryScroll(window.scrollY);
|
|
254
|
+
history.pushState({ deepspaceDocumentation: true, scrollY: 0 }, "", target.href);
|
|
255
|
+
}
|
|
256
|
+
scrollToTarget(target, historyMode === "none" ? restoredScroll : void 0);
|
|
257
|
+
restoringHistoryRef.current = false;
|
|
258
|
+
replaceHistoryScroll(window.scrollY);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
const navigationId = ++navigationIdRef.current;
|
|
262
|
+
const progressTimer = window.setTimeout(() => {
|
|
263
|
+
if (navigationId === navigationIdRef.current) setNavigating(true);
|
|
264
|
+
}, 120);
|
|
265
|
+
try {
|
|
266
|
+
const runtime = await load(target);
|
|
267
|
+
await loadPage?.(runtime.data.page.route);
|
|
268
|
+
if (navigationId !== navigationIdRef.current) return;
|
|
269
|
+
if (historyMode === "push") {
|
|
270
|
+
replaceHistoryScroll(window.scrollY);
|
|
271
|
+
history.pushState({ deepspaceDocumentation: true, scrollY: 0 }, "", target.href);
|
|
272
|
+
}
|
|
273
|
+
syncDocument(runtime, target);
|
|
274
|
+
renderedLocationRef.current = targetKey;
|
|
275
|
+
const startViewTransition = typeof document.startViewTransition === "function" ? document.startViewTransition.bind(document) : void 0;
|
|
276
|
+
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
277
|
+
if (startViewTransition && !prefersReducedMotion) {
|
|
278
|
+
const transition = startViewTransition(() => {
|
|
279
|
+
flushSync(() => setData(runtime.data));
|
|
280
|
+
});
|
|
281
|
+
await transition.updateCallbackDone;
|
|
282
|
+
} else {
|
|
283
|
+
flushSync(() => setData(runtime.data));
|
|
284
|
+
}
|
|
285
|
+
scrollToTarget(target, historyMode === "none" ? restoredScroll : void 0);
|
|
286
|
+
restoringHistoryRef.current = false;
|
|
287
|
+
replaceHistoryScroll(window.scrollY);
|
|
288
|
+
focusArticleHeading();
|
|
289
|
+
if (navigationId === navigationIdRef.current) setNavigating(false);
|
|
290
|
+
} catch (error) {
|
|
291
|
+
if (navigationId !== navigationIdRef.current) return;
|
|
292
|
+
restoringHistoryRef.current = false;
|
|
293
|
+
console.error("[DeepSpace Documentation] Client navigation failed; falling back to a document navigation", error);
|
|
294
|
+
window.location.assign(target.href);
|
|
295
|
+
} finally {
|
|
296
|
+
window.clearTimeout(progressTimer);
|
|
297
|
+
}
|
|
298
|
+
}, [load, loadPage]);
|
|
299
|
+
const prefetch = useCallback((href) => {
|
|
300
|
+
const target = new URL(href, window.location.href);
|
|
301
|
+
if (target.origin !== window.location.origin || cacheRef.current.has(locationKey(target))) return;
|
|
302
|
+
void load(target).then((runtime) => loadPage?.(runtime.data.page.route)).catch(() => {
|
|
303
|
+
});
|
|
304
|
+
}, [load, loadPage]);
|
|
305
|
+
useEffect(() => {
|
|
306
|
+
const root = document.getElementById("deepspace-documentation-root");
|
|
307
|
+
if (!root) return;
|
|
308
|
+
const anchorFor = (target) => target instanceof Element ? target.closest("a[href]") : null;
|
|
309
|
+
const handleClick = (event) => {
|
|
310
|
+
if (event.defaultPrevented || event.button !== 0) return;
|
|
311
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
312
|
+
const anchor = anchorFor(event.target);
|
|
313
|
+
if (!anchor || anchor.target || anchor.hasAttribute("download")) return;
|
|
314
|
+
const href = anchor.getAttribute("href");
|
|
315
|
+
if (!href || !shouldHandleDocumentationNavigation(href, basePath)) return;
|
|
316
|
+
const url = new URL(href, window.location.href);
|
|
317
|
+
if (url.origin !== window.location.origin) return;
|
|
318
|
+
if (url.pathname === window.location.pathname && url.search === window.location.search && url.hash) return;
|
|
319
|
+
event.preventDefault();
|
|
320
|
+
void navigate(`${url.pathname}${url.search}${url.hash}`);
|
|
321
|
+
};
|
|
322
|
+
const handlePrefetch = (event) => {
|
|
323
|
+
const href = anchorFor(event.target)?.getAttribute("href");
|
|
324
|
+
if (href && shouldHandleDocumentationNavigation(href, basePath)) prefetch(href);
|
|
325
|
+
};
|
|
326
|
+
root.addEventListener("click", handleClick);
|
|
327
|
+
root.addEventListener("focusin", handlePrefetch);
|
|
328
|
+
root.addEventListener("mouseover", handlePrefetch);
|
|
329
|
+
root.addEventListener("pointerdown", handlePrefetch);
|
|
330
|
+
return () => {
|
|
331
|
+
root.removeEventListener("click", handleClick);
|
|
332
|
+
root.removeEventListener("focusin", handlePrefetch);
|
|
333
|
+
root.removeEventListener("mouseover", handlePrefetch);
|
|
334
|
+
root.removeEventListener("pointerdown", handlePrefetch);
|
|
335
|
+
};
|
|
336
|
+
}, [basePath, navigate, prefetch]);
|
|
337
|
+
useEffect(() => {
|
|
338
|
+
const timer = window.setTimeout(() => {
|
|
339
|
+
if (data.previous) prefetch(documentationPublicPath(basePath, data.previous.route));
|
|
340
|
+
if (data.next) prefetch(documentationPublicPath(basePath, data.next.route));
|
|
341
|
+
}, 350);
|
|
342
|
+
return () => window.clearTimeout(timer);
|
|
343
|
+
}, [basePath, data.next, data.page.route, data.previous, prefetch]);
|
|
344
|
+
const content = /* @__PURE__ */ jsx(DocumentationContent, { Page: pages[data.page.route], data });
|
|
345
|
+
return /* @__PURE__ */ jsx(
|
|
346
|
+
Site,
|
|
347
|
+
{
|
|
348
|
+
data,
|
|
349
|
+
navigating,
|
|
350
|
+
onNavigate: (href) => {
|
|
351
|
+
void navigate(href);
|
|
352
|
+
},
|
|
353
|
+
onPrefetch: prefetch,
|
|
354
|
+
children: content
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
var hydrated = false;
|
|
359
|
+
function hydrateDocumentation({
|
|
360
|
+
loadPage,
|
|
361
|
+
pages,
|
|
362
|
+
Site
|
|
363
|
+
} = {}) {
|
|
364
|
+
const root = document.getElementById("deepspace-documentation-root");
|
|
365
|
+
const payload = document.getElementById("deepspace-documentation-data");
|
|
366
|
+
if (hydrated || !root || !payload?.textContent) return;
|
|
367
|
+
try {
|
|
368
|
+
const initialData = JSON.parse(payload.textContent);
|
|
369
|
+
hydrated = true;
|
|
370
|
+
hydrateRoot(root, /* @__PURE__ */ jsx(DocumentationRuntimeRoot, { initialData, loadPage, pages, Site }));
|
|
371
|
+
} catch (error) {
|
|
372
|
+
root.setAttribute("data-hydration-error", "true");
|
|
373
|
+
console.error("[DeepSpace Documentation] Unable to hydrate the documentation surface", error);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
export {
|
|
377
|
+
Accordion,
|
|
378
|
+
AccordionGroup,
|
|
379
|
+
Card,
|
|
380
|
+
CodeGroup,
|
|
381
|
+
DefaultDocumentation,
|
|
382
|
+
DocumentationApp,
|
|
383
|
+
DocumentationContent,
|
|
384
|
+
DocumentationRuntimeRoot,
|
|
385
|
+
Info,
|
|
386
|
+
Note,
|
|
387
|
+
Step,
|
|
388
|
+
Steps,
|
|
389
|
+
Tab,
|
|
390
|
+
Tabs,
|
|
391
|
+
Tip,
|
|
392
|
+
Warning,
|
|
393
|
+
hydrateDocumentation
|
|
394
|
+
};
|
|
395
|
+
//# sourceMappingURL=documentation-client-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/documentation/runtime/client.tsx","../src/documentation/runtime/client-document.ts","../src/documentation/resource-path.ts","../src/documentation/runtime/routing.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react'\nimport { flushSync } from 'react-dom'\nimport { hydrateRoot } from 'react-dom/client'\nimport type { DocumentationRuntimeData, DocumentationRuntimeRouteDocument } from '../types'\nimport { documentationPublicPath } from '../routing'\nimport {\n currentHistoryState,\n currentRuntimeDocument,\n focusArticleHeading,\n locationKey,\n replaceHistoryScroll,\n routeDataUrl,\n scrollToTarget,\n syncDocument,\n type RuntimeDocument,\n} from './client-document'\nimport {\n DefaultDocumentation,\n DocumentationContent,\n type DocumentationPageComponent,\n type DocumentationSiteComponent,\n} from './public'\nimport { shouldHandleDocumentationNavigation } from './routing'\nexport * from './public'\n\n\ntype HistoryMode = 'none' | 'push'\n\nexport function DocumentationRuntimeRoot({\n initialData,\n loadPage,\n pages = {},\n Site = DefaultDocumentation as DocumentationSiteComponent,\n}: {\n initialData: DocumentationRuntimeData\n loadPage?: (route: string) => Promise<void>\n pages?: Record<string, DocumentationPageComponent>\n Site?: DocumentationSiteComponent\n}) {\n const [data, setData] = useState(initialData)\n const basePath = initialData.basePath\n const [navigating, setNavigating] = useState(false)\n const cacheRef = useRef(new Map<string, RuntimeDocument>())\n const inFlightRef = useRef(new Map<string, Promise<RuntimeDocument>>())\n const siteDataRef = useRef({ config: initialData.config, navigation: initialData.navigation })\n const navigationIdRef = useRef(0)\n const restoringHistoryRef = useRef(false)\n const scrollFrameRef = useRef<number | null>(null)\n const renderedLocationRef = useRef(locationKey(new URL(window.location.href)))\n\n useEffect(() => {\n const root = document.getElementById('deepspace-documentation-root')\n root?.setAttribute('data-documentation-hydrated', 'true')\n cacheRef.current.set(locationKey(new URL(window.location.href)), currentRuntimeDocument(initialData))\n const previous = history.scrollRestoration\n history.scrollRestoration = 'manual'\n replaceHistoryScroll(window.scrollY)\n const handleScroll = (): void => {\n if (restoringHistoryRef.current) return\n if (scrollFrameRef.current !== null) return\n scrollFrameRef.current = window.requestAnimationFrame(() => {\n scrollFrameRef.current = null\n replaceHistoryScroll(window.scrollY)\n })\n }\n const handlePopState = (): void => {\n const restoredScroll = currentHistoryState().scrollY\n restoringHistoryRef.current = true\n void navigate(window.location.href, 'none', restoredScroll)\n }\n window.addEventListener('scroll', handleScroll, { passive: true })\n window.addEventListener('popstate', handlePopState)\n return () => {\n window.removeEventListener('scroll', handleScroll)\n window.removeEventListener('popstate', handlePopState)\n if (scrollFrameRef.current !== null) window.cancelAnimationFrame(scrollFrameRef.current)\n history.scrollRestoration = previous\n root?.removeAttribute('data-documentation-hydrated')\n }\n // The initial payload is immutable for the lifetime of this hydrated root.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const load = useCallback(async (target: URL): Promise<RuntimeDocument> => {\n const key = locationKey(target)\n const cached = cacheRef.current.get(key)\n if (cached) return cached\n const pending = inFlightRef.current.get(key)\n if (pending) return pending\n const request = (async (): Promise<RuntimeDocument> => {\n const response = await fetch(routeDataUrl(target, basePath), {\n headers: { Accept: 'application/json', 'x-deepspace-documentation-navigation': 'true' },\n })\n if (!response.ok) throw new Error(`Route data returned ${response.status}`)\n const routeDocument = await response.json() as DocumentationRuntimeRouteDocument\n if (!routeDocument?.data?.page || typeof routeDocument.title !== 'string') {\n throw new Error('Navigation response did not contain valid DeepSpace documentation route data')\n }\n const runtime: RuntimeDocument = {\n ...routeDocument,\n data: { ...siteDataRef.current, ...routeDocument.data },\n }\n cacheRef.current.set(key, runtime)\n return runtime\n })()\n inFlightRef.current.set(key, request)\n try {\n return await request\n } finally {\n if (inFlightRef.current.get(key) === request) inFlightRef.current.delete(key)\n }\n }, [basePath])\n\n const navigate = useCallback(async (\n href: string,\n historyMode: HistoryMode = 'push',\n restoredScroll?: number,\n ): Promise<void> => {\n const target = new URL(href, window.location.href)\n if (target.origin !== window.location.origin) {\n window.location.assign(target.href)\n return\n }\n const currentUrl = new URL(window.location.href)\n const targetKey = locationKey(target)\n if (targetKey === renderedLocationRef.current) {\n if (historyMode === 'push' && target.href !== currentUrl.href) {\n replaceHistoryScroll(window.scrollY)\n history.pushState({ deepspaceDocumentation: true, scrollY: 0 }, '', target.href)\n }\n scrollToTarget(target, historyMode === 'none' ? restoredScroll : undefined)\n restoringHistoryRef.current = false\n replaceHistoryScroll(window.scrollY)\n return\n }\n\n const navigationId = ++navigationIdRef.current\n const progressTimer = window.setTimeout(() => {\n if (navigationId === navigationIdRef.current) setNavigating(true)\n }, 120)\n try {\n const runtime = await load(target)\n await loadPage?.(runtime.data.page.route)\n if (navigationId !== navigationIdRef.current) return\n if (historyMode === 'push') {\n replaceHistoryScroll(window.scrollY)\n history.pushState({ deepspaceDocumentation: true, scrollY: 0 }, '', target.href)\n }\n syncDocument(runtime, target)\n renderedLocationRef.current = targetKey\n const startViewTransition = typeof document.startViewTransition === 'function'\n ? document.startViewTransition.bind(document)\n : undefined\n const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n if (startViewTransition && !prefersReducedMotion) {\n const transition = startViewTransition(() => {\n flushSync(() => setData(runtime.data))\n })\n await transition.updateCallbackDone\n } else {\n flushSync(() => setData(runtime.data))\n }\n scrollToTarget(target, historyMode === 'none' ? restoredScroll : undefined)\n restoringHistoryRef.current = false\n replaceHistoryScroll(window.scrollY)\n focusArticleHeading()\n if (navigationId === navigationIdRef.current) setNavigating(false)\n } catch (error) {\n if (navigationId !== navigationIdRef.current) return\n restoringHistoryRef.current = false\n console.error('[DeepSpace Documentation] Client navigation failed; falling back to a document navigation', error)\n window.location.assign(target.href)\n } finally {\n window.clearTimeout(progressTimer)\n }\n }, [load, loadPage])\n\n const prefetch = useCallback((href: string): void => {\n const target = new URL(href, window.location.href)\n if (target.origin !== window.location.origin || cacheRef.current.has(locationKey(target))) return\n void load(target).then((runtime) => loadPage?.(runtime.data.page.route)).catch(() => {\n // Prefetch is opportunistic; an explicit navigation still retries.\n })\n }, [load, loadPage])\n\n useEffect(() => {\n const root = document.getElementById('deepspace-documentation-root')\n if (!root) return\n const anchorFor = (target: EventTarget | null): HTMLAnchorElement | null =>\n target instanceof Element ? target.closest<HTMLAnchorElement>('a[href]') : null\n const handleClick = (event: MouseEvent): void => {\n if (event.defaultPrevented || event.button !== 0) return\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return\n const anchor = anchorFor(event.target)\n if (!anchor || anchor.target || anchor.hasAttribute('download')) return\n const href = anchor.getAttribute('href')\n if (!href || !shouldHandleDocumentationNavigation(href, basePath)) return\n const url = new URL(href, window.location.href)\n if (url.origin !== window.location.origin) return\n if (url.pathname === window.location.pathname && url.search === window.location.search && url.hash) return\n event.preventDefault()\n void navigate(`${url.pathname}${url.search}${url.hash}`)\n }\n const handlePrefetch = (event: Event): void => {\n const href = anchorFor(event.target)?.getAttribute('href')\n if (href && shouldHandleDocumentationNavigation(href, basePath)) prefetch(href)\n }\n root.addEventListener('click', handleClick)\n root.addEventListener('focusin', handlePrefetch)\n root.addEventListener('mouseover', handlePrefetch)\n root.addEventListener('pointerdown', handlePrefetch)\n return () => {\n root.removeEventListener('click', handleClick)\n root.removeEventListener('focusin', handlePrefetch)\n root.removeEventListener('mouseover', handlePrefetch)\n root.removeEventListener('pointerdown', handlePrefetch)\n }\n }, [basePath, navigate, prefetch])\n\n useEffect(() => {\n const timer = window.setTimeout(() => {\n if (data.previous) prefetch(documentationPublicPath(basePath, data.previous.route))\n if (data.next) prefetch(documentationPublicPath(basePath, data.next.route))\n }, 350)\n return () => window.clearTimeout(timer)\n }, [basePath, data.next, data.page.route, data.previous, prefetch])\n\n const content = <DocumentationContent Page={pages[data.page.route]} data={data} />\n return (\n <Site\n data={data}\n navigating={navigating}\n onNavigate={(href) => { void navigate(href) }}\n onPrefetch={prefetch}\n >\n {content}\n </Site>\n )\n}\n\n\nlet hydrated = false\n\nexport function hydrateDocumentation({\n loadPage,\n pages,\n Site,\n}: {\n loadPage?: (route: string) => Promise<void>\n pages?: Record<string, DocumentationPageComponent>\n Site?: DocumentationSiteComponent\n} = {}): void {\n const root = document.getElementById('deepspace-documentation-root')\n const payload = document.getElementById('deepspace-documentation-data')\n if (hydrated || !root || !payload?.textContent) return\n try {\n const initialData = JSON.parse(payload.textContent) as DocumentationRuntimeData\n hydrated = true\n hydrateRoot(root, <DocumentationRuntimeRoot initialData={initialData} loadPage={loadPage} pages={pages} Site={Site} />)\n } catch (error) {\n root.setAttribute('data-hydration-error', 'true')\n console.error('[DeepSpace Documentation] Unable to hydrate the documentation surface', error)\n }\n}\n","import type { DocumentationRuntimeData, DocumentationRuntimeRouteDocument } from '../types'\nimport { documentationLogicalPath, documentationPublicPath } from '../routing'\n\nexport interface RuntimeDocument extends Omit<DocumentationRuntimeRouteDocument, 'data'> {\n data: DocumentationRuntimeData\n}\n\nexport interface DocumentationHistoryState {\n deepspaceDocumentation?: boolean\n scrollY?: number\n [key: string]: unknown\n}\n\nexport function currentRuntimeDocument(data: DocumentationRuntimeData): RuntimeDocument {\n return {\n canonical: document.querySelector<HTMLLinkElement>('link[rel=\"canonical\"]')?.href ?? null,\n data,\n description: document.querySelector<HTMLMetaElement>('meta[name=\"description\"]')?.content ?? null,\n openGraph: readOpenGraph(document),\n robots: document.querySelector<HTMLMetaElement>('meta[name=\"robots\"]')?.content ?? null,\n title: document.title,\n }\n}\n\nexport function syncDocument(runtime: RuntimeDocument, target: URL): void {\n document.title = runtime.title\n syncMeta('description', runtime.description)\n syncMeta('robots', runtime.robots)\n syncLink('canonical', runtime.canonical)\n for (const property of ['og:title', 'og:description', 'og:url'] as const) {\n syncMeta(property, runtime.openGraph[property], 'property')\n }\n document.body.dataset.route = runtime.data.page.route === '/404'\n ? target.pathname\n : runtime.data.page.route\n}\n\nfunction readOpenGraph(source: Document): DocumentationRuntimeRouteDocument['openGraph'] {\n return Object.fromEntries(\n ['og:title', 'og:description', 'og:url'].map((property) => [\n property,\n source.querySelector<HTMLMetaElement>(`meta[property=\"${property}\"]`)?.content ?? null,\n ]),\n ) as DocumentationRuntimeRouteDocument['openGraph']\n}\n\nfunction syncMeta(name: string, content: string | null, attribute: 'name' | 'property' = 'name'): void {\n let element = document.head.querySelector<HTMLMetaElement>(`meta[${attribute}=\"${name}\"]`)\n if (!content) {\n element?.remove()\n return\n }\n if (!element) {\n element = document.createElement('meta')\n element.setAttribute(attribute, name)\n document.head.appendChild(element)\n }\n element.content = content\n}\n\nfunction syncLink(rel: string, href: string | null): void {\n let element = document.head.querySelector<HTMLLinkElement>(`link[rel=\"${rel}\"]`)\n if (!href) {\n element?.remove()\n return\n }\n if (!element) {\n element = document.createElement('link')\n element.rel = rel\n document.head.appendChild(element)\n }\n element.href = href\n}\n\nexport function locationKey(url: URL): string {\n return `${url.pathname}${url.search}`\n}\n\nexport function routeDataUrl(url: URL, basePath: string): string {\n const logical = documentationLogicalPath(basePath, url.pathname)\n if (logical === null) throw new Error(`${url.pathname} is outside the documentation route`)\n const clean = logical.replace(/^\\/+|\\/+$/g, '')\n return `${documentationPublicPath(basePath, `/data/${clean || 'index'}.json`)}${url.search}`\n}\n\nexport function scrollToTarget(target: URL, restoredScroll?: number): void {\n if (target.hash) {\n const id = decodeURIComponent(target.hash.slice(1))\n document.getElementById(id)?.scrollIntoView()\n return\n }\n window.scrollTo({ top: restoredScroll ?? 0, behavior: 'instant' })\n}\n\nexport function currentHistoryState(): DocumentationHistoryState {\n return history.state && typeof history.state === 'object'\n ? history.state as DocumentationHistoryState\n : {}\n}\n\nexport function replaceHistoryScroll(scrollY: number): void {\n history.replaceState(\n { ...currentHistoryState(), deepspaceDocumentation: true, scrollY },\n '',\n window.location.href,\n )\n}\n\nexport function focusArticleHeading(): void {\n const heading = document.querySelector<HTMLElement>('.documentation-article h1')\n if (!heading) return\n heading.tabIndex = -1\n heading.focus({ preventScroll: true })\n}\n","const RESOURCE_EXTENSIONS = new Set([\n '7z', 'avif', 'css', 'csv', 'gif', 'gz', 'ico', 'jpeg', 'jpg', 'js', 'json', 'map',\n 'md', 'mjs', 'mp3', 'mp4', 'pdf', 'png', 'svg', 'tar', 'txt', 'wasm', 'webm',\n 'webp', 'woff', 'woff2', 'xml', 'yaml', 'yml', 'zip',\n])\n\n/** Distinguish generated documentation resources from authored page routes. */\nexport function isNativeDocumentationResourcePath(pathname: string): boolean {\n const leaf = pathname.slice(pathname.lastIndexOf('/') + 1)\n const extension = leaf.includes('.') ? leaf.slice(leaf.lastIndexOf('.') + 1).toLowerCase() : ''\n return extension !== '' && RESOURCE_EXTENSIONS.has(extension)\n}\n\n/** Encode a compiler-owned logical path without collapsing its segment boundaries. */\nexport function encodeNativeDocumentationPath(pathname: string): string {\n return pathname.split('/').map((segment) => encodeURIComponent(segment)).join('/')\n}\n\n/** Normalize one URL pathname while preserving encoded slashes as data, not separators. */\nexport function canonicalNativeDocumentationRequestPath(pathname: string): string | null {\n try {\n return pathname\n .split('/')\n .map((segment) => encodeURIComponent(decodeURIComponent(segment)))\n .join('/')\n } catch {\n return null\n }\n}\n","import { documentationLogicalPath } from '../routing'\nimport { isNativeDocumentationResourcePath } from '../resource-path'\n\nconst RESOURCE_ROUTES = new Set(['/mcp'])\nconst RESOURCE_PREFIXES = ['/api/', '/assets/', '/data/', '/media/', '/.well-known/'] as const\n\n/** Return true only for pages compiled into the client-side documentation graph. */\nexport function shouldHandleDocumentationNavigation(href: string, basePath = '/docs'): boolean {\n if (!href.startsWith('/') || href.startsWith('//')) return false\n const pathname = href.split(/[?#]/, 1)[0] ?? ''\n const logical = documentationLogicalPath(basePath, pathname)\n if (!logical || RESOURCE_ROUTES.has(logical)) return false\n if (RESOURCE_PREFIXES.some((prefix) => logical.startsWith(prefix))) return false\n return !isNativeDocumentationResourcePath(logical)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;;;ACWrB,SAAS,uBAAuB,MAAiD;AACtF,SAAO;AAAA,IACL,WAAW,SAAS,cAA+B,uBAAuB,GAAG,QAAQ;AAAA,IACrF;AAAA,IACA,aAAa,SAAS,cAA+B,0BAA0B,GAAG,WAAW;AAAA,IAC7F,WAAW,cAAc,QAAQ;AAAA,IACjC,QAAQ,SAAS,cAA+B,qBAAqB,GAAG,WAAW;AAAA,IACnF,OAA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