@omnitron-dev/lumen-ui 0.4.10 → 0.4.12
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/README.md +10 -5
- package/dist/blocks/code-block.d.ts.map +1 -1
- package/dist/blocks/component-example.d.ts +3 -1
- package/dist/blocks/component-example.d.ts.map +1 -1
- package/dist/blocks/index.js +1 -1
- package/dist/{chunk-L2KGVOK3.js → chunk-45RUHXKF.js} +6 -3
- package/dist/chunk-45RUHXKF.js.map +1 -0
- package/dist/{chunk-TQNHJCU2.js → chunk-6GXIVXBU.js} +6 -9
- package/dist/chunk-6GXIVXBU.js.map +1 -0
- package/dist/{chunk-HLB7FMNG.js → chunk-AJRKOSKX.js} +163 -166
- package/dist/chunk-AJRKOSKX.js.map +1 -0
- package/dist/{chunk-6NFMKJAX.js → chunk-F5K4PTVB.js} +40 -15
- package/dist/chunk-F5K4PTVB.js.map +1 -0
- package/dist/chunk-VGZSUVUN.js +236 -0
- package/dist/chunk-VGZSUVUN.js.map +1 -0
- package/dist/{chunk-AQ5PPDEV.js → chunk-X3LHELH6.js} +65 -40
- package/dist/chunk-X3LHELH6.js.map +1 -0
- package/dist/hydration/context.d.ts +2 -0
- package/dist/hydration/context.d.ts.map +1 -1
- package/dist/hydration/index.js +2 -2
- package/dist/hydration/shell.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/interactive/api-explorer.d.ts.map +1 -1
- package/dist/interactive/index.js +2 -2
- package/dist/interactive/playground.d.ts.map +1 -1
- package/dist/navigation/index.js +1 -1
- package/dist/navigation/navbar.d.ts.map +1 -1
- package/dist/navigation/section-nav.d.ts +1 -0
- package/dist/navigation/section-nav.d.ts.map +1 -1
- package/dist/search/index.js +1 -1
- package/dist/search/search-dialog.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/chunk-6NFMKJAX.js.map +0 -1
- package/dist/chunk-AQ5PPDEV.js.map +0 -1
- package/dist/chunk-HCY4QR4M.js +0 -197
- package/dist/chunk-HCY4QR4M.js.map +0 -1
- package/dist/chunk-HLB7FMNG.js.map +0 -1
- package/dist/chunk-L2KGVOK3.js.map +0 -1
- package/dist/chunk-TQNHJCU2.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,7 +7,9 @@ React components for Lumen documentation: navigation, document blocks, search an
|
|
|
7
7
|
- A shared document shell and selective island activation.
|
|
8
8
|
- Document tabs preserve labelled sections in static HTML. The shell adds Prism tabs with keyboard selection, fragment navigation and optional same-page synchronization through `syncKey`.
|
|
9
9
|
- Navigation, mathematical blocks, code examples and reference cards.
|
|
10
|
-
- Pagefind and Netron search adapters.
|
|
10
|
+
- Pagefind and Netron search adapters. Search uses the shared Prism dialog for its portal, keyboard focus, Escape handling and focus restoration. Its viewport-bounded frame stays stable while queries change; results scroll independently through Prism's scrollbar. Arrow keys move between the query and results. Pending results are inert, and superseded responses cannot replace the current query.
|
|
11
|
+
- Navbar menus, selectors, search fields and playground controls use Prism/MUI components and the host theme. Keep host CSS focused on layout and prose rather than overriding control states.
|
|
12
|
+
- Recorded playground output uses an expanded Prism disclosure, so the static result remains readable before hydration.
|
|
11
13
|
- Mermaid diagrams and host-controlled API or Netron playgrounds.
|
|
12
14
|
|
|
13
15
|
## Quick start
|
|
@@ -18,11 +20,12 @@ pnpm add @omnitron-dev/lumen-ui react react-dom
|
|
|
18
20
|
|
|
19
21
|
```tsx
|
|
20
22
|
import { useState } from 'react';
|
|
23
|
+
import { Button } from '@omnitron-dev/prism/ui';
|
|
21
24
|
import { LumenShell, PortalIslandHost } from '@omnitron-dev/lumen-ui/runtime';
|
|
22
25
|
|
|
23
26
|
function Counter({ initial = 0 }: { initial?: number }) {
|
|
24
27
|
const [count, setCount] = useState(initial);
|
|
25
|
-
return <
|
|
28
|
+
return <Button onClick={() => setCount(value => value + 1)}>{count}</Button>;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
export function Documentation() {
|
|
@@ -53,11 +56,11 @@ React and React DOM 19 are required. The Lumen builder supplies default layout s
|
|
|
53
56
|
</PortalIslandHost>
|
|
54
57
|
```
|
|
55
58
|
|
|
56
|
-
Each heading has `{ id, title, level }` and must refer to a real document anchor. The default Lumen client registers this component; custom clients add `DocSectionNav` to their existing `LumenShell` island registry.
|
|
59
|
+
Each heading has `{ id, title, level }` and must refer to a real document anchor. The default Lumen client registers this component; custom clients add `DocSectionNav` to their existing `LumenShell` island registry. Lumen delegates rendering and section tracking to Prism: the theme supplies readable text, a hierarchy rail, an aligned current-section marker and keyboard focus. No host CSS is required for these states. Set `ariaLabel` to translate the navigation landmark; `className` is available for host layout.
|
|
57
60
|
|
|
58
61
|
`DocPagination` from `/layout` renders native previous and next links with the document titles and directional Prism icons. Pass each available neighbour as `{ href, label }`. Set `labels={{ navigation, previous, next }}` to translate the landmark and directions. The links work before hydration and follow the document's reading direction.
|
|
59
62
|
|
|
60
|
-
The shared Prism scrollspy tracks the last section start above the reading line, including long sections and the final short section at the bottom. CSS `scroll-padding-top` on the scrolling element and `scroll-margin-top` on headings account for fixed headers; an explicit `offset` overrides the reading-line padding. Native links retain keyboard behavior and browser history, with no forced smooth scrolling. An explicit anchor destination near the bottom remains selected until the reader scrolls. Supplying `activeId` instead makes the indicator controlled by the host.
|
|
63
|
+
The shared Prism scrollspy tracks the last section start above the reading line, including long sections and the final short section at the bottom. CSS `scroll-padding-top` on the scrolling element and `scroll-margin-top` on headings account for fixed headers; an explicit `offset` overrides the reading-line padding. Native links retain keyboard behavior and browser history, with no forced smooth scrolling. An explicit anchor destination near the bottom remains selected until the reader scrolls. Supplying `activeId` instead makes the indicator controlled by the host; `null` clears it. An empty heading list omits the navigation landmark. Prism also exposes `title` (`null` omits the visible heading) and uses `{ id, text, level }` for its heading input.
|
|
61
64
|
|
|
62
65
|
## Live component examples
|
|
63
66
|
|
|
@@ -75,6 +78,8 @@ import source from './counter.tsx?raw';
|
|
|
75
78
|
|
|
76
79
|
Both the preview and source render on the server. The native source disclosure works with a keyboard and with JavaScript disabled. After hydration, `resettable` restores only the preview while keeping the source open. The frame keeps preview, source disclosure and source actions separate. Code has its own bounded scroll area; the copy icon remains inside the code frame without covering text or moving when its state changes. Controls support keyboard focus and announce copy results. Set `language` for a non-TSX module and translate the controls through `labels.source`, `labels.reset`, `labels.copy`, `labels.copied`, `labels.copyFailed` and `labels.highlightUnavailable`.
|
|
77
80
|
|
|
81
|
+
Opening the source before activation preserves its state and summary focus when the live island replaces its static content. Set distinct `disclosureKey` values for multiple example frames in one island. Custom native disclosures can use `data-lumen-disclosure` on `details`; the runtime transfers only `open` and the focused direct `summary` between unique matching keys in the same island. Missing, ambiguous or nested-island keys do not match, and focus stays elsewhere if the reader has moved away. Inputs and arbitrary DOM state are not copied.
|
|
82
|
+
|
|
78
83
|
A client-side preview render error stays inside the preview through Prism's shared error boundary. The source remains available, and Reset remounts the preview and clears its error state.
|
|
79
84
|
|
|
80
85
|
`CodeBlock` progressively adds dual-theme syntax colors through the same tokenizer used by Markdown. It loads only the requested language grammar; the TypeScript compiler and Twoslash do not enter the browser bundle. Literal source, newlines and annotation comments remain unchanged for selection and copying. Unknown languages stay plain text. A failed grammar download shows a visible status while preserving the complete source. Server HTML and JavaScript-disabled pages retain readable, escaped source.
|
|
@@ -83,7 +88,7 @@ Component source and built Markdown fences share `--lumen-code-font-size`, which
|
|
|
83
88
|
|
|
84
89
|
## Runtime boundaries
|
|
85
90
|
|
|
86
|
-
Islands mount through portals into static hosts, preserving the shell's context. They do not create independent React roots or hydrate arbitrary third-party HTML. Use one manager per document, unique island IDs and host-owned component registrations. Activation supports `load`, `visible`, `interaction` and `idle`.
|
|
91
|
+
Islands mount through portals into static hosts, preserving the shell's context. They do not create independent React roots or hydrate arbitrary third-party HTML. Use one manager per document, unique island IDs and host-owned component registrations. Activation supports `load`, `visible`, `interaction` and `idle`. The server content stays visible while a lazy component waits. Its live portal replaces that content in the same React commit; a suspended island does not block its neighbours. Ordinary counter, chart and menu updates do not trigger a full document scan.
|
|
87
92
|
|
|
88
93
|
Props use the shared Lumen AST JSON codec. Invalid metadata reports an error instead of mounting with empty props; unknown components retain their static fallback. Documents cannot register application code or grant network permissions. Live API and Netron playgrounds require explicit host capabilities and server authorization. Mermaid uses strict configuration and sanitized SVG images.
|
|
89
94
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../src/blocks/code-block.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../src/blocks/code-block.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjG;AA2BD,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,EAAE,IAAS,EAAE,QAAe,EAAE,QAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA8ChI"}
|
|
@@ -7,11 +7,13 @@ export interface ComponentExampleProps {
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
language?: string;
|
|
9
9
|
resettable?: boolean;
|
|
10
|
+
/** Stable within its island; use distinct keys when rendering several example frames. */
|
|
11
|
+
disclosureKey?: string;
|
|
10
12
|
labels?: {
|
|
11
13
|
source?: string;
|
|
12
14
|
reset?: string;
|
|
13
15
|
} & CodeBlockProps['labels'];
|
|
14
16
|
}
|
|
15
17
|
/** One preview frame with a native source disclosure; readable before hydration. */
|
|
16
|
-
export declare function ComponentExample({ title, code, children, language, resettable, labels, }: ComponentExampleProps): React.JSX.Element;
|
|
18
|
+
export declare function ComponentExample({ title, code, children, language, resettable, disclosureKey, labels, }: ComponentExampleProps): React.JSX.Element;
|
|
17
19
|
//# sourceMappingURL=component-example.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-example.d.ts","sourceRoot":"","sources":["../../src/blocks/component-example.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;CACzE;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAgB,EAAE,UAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"component-example.d.ts","sourceRoot":"","sources":["../../src/blocks/component-example.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;CACzE;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAgB,EAAE,UAAkB,EAAE,aAAwB,EAAE,MAAM,GAC9F,EAAE,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2C3C"}
|
package/dist/blocks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { BacklinksSection, CodeBlock, ComponentExample, HoverReferenceCard, MathTheoremBlock, PageAgentActions } from '../chunk-
|
|
2
|
+
export { BacklinksSection, CodeBlock, ComponentExample, HoverReferenceCard, MathTheoremBlock, PageAgentActions } from '../chunk-6GXIVXBU.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
2
|
|
|
3
3
|
// src/hydration/context.ts
|
|
4
|
+
function getIslandComponent(registry, name) {
|
|
5
|
+
return Object.hasOwn(registry, name) ? registry[name] : void 0;
|
|
6
|
+
}
|
|
4
7
|
var defaultLumenContextValue = {
|
|
5
8
|
theme: "dark",
|
|
6
9
|
locale: "en",
|
|
@@ -16,6 +19,6 @@ var defaultLumenContextValue = {
|
|
|
16
19
|
var LumenContext = createContext(defaultLumenContextValue);
|
|
17
20
|
var useLumen = () => useContext(LumenContext);
|
|
18
21
|
|
|
19
|
-
export { LumenContext, defaultLumenContextValue, useLumen };
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
export { LumenContext, defaultLumenContextValue, getIslandComponent, useLumen };
|
|
23
|
+
//# sourceMappingURL=chunk-45RUHXKF.js.map
|
|
24
|
+
//# sourceMappingURL=chunk-45RUHXKF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hydration/context.ts"],"names":[],"mappings":";;;AAMO,SAAS,kBAAA,CAAmB,UAA0B,IAAA,EAA2C;AACtG,EAAA,OAAO,OAAO,MAAA,CAAO,QAAA,EAAU,IAAI,CAAA,GAAI,QAAA,CAAS,IAAI,CAAA,GAAI,MAAA;AAC1D;AAaO,IAAM,wBAAA,GAA8C;AAAA,EACzD,KAAA,EAAO,MAAA;AAAA,EACP,MAAA,EAAQ,IAAA;AAAA,EACR,WAAA,EAAa,GAAA;AAAA,EACb,SAAS,EAAC;AAAA,EACV,gBAAgB,MAAM;AAAA,EAAC,CAAA;AAAA,EACvB,WAAW,MAAM,MAAA;AAAA,EACjB,aAAA,sBAAmB,GAAA,EAAY;AAAA,EAC/B,eAAe,MAAM;AAAA,EAAC;AACxB;AAEO,IAAM,YAAA,GAAe,cAAiC,wBAAwB;AAE9E,IAAM,QAAA,GAAW,MAAyB,UAAA,CAAW,YAAY","file":"chunk-45RUHXKF.js","sourcesContent":["import { createContext, useContext, type ComponentType } from 'react';\n\nexport type IslandComponent = ComponentType<any>;\nexport type IslandRegistry = Record<string, IslandComponent>;\n\n/** An island name selects an explicitly registered component, never a prototype member. */\nexport function getIslandComponent(registry: IslandRegistry, name: string): IslandComponent | undefined {\n return Object.hasOwn(registry, name) ? registry[name] : undefined;\n}\n\nexport interface LumenContextValue {\n theme: string;\n locale: string;\n currentPath: string;\n islands: IslandRegistry;\n registerIsland: (name: string, component: IslandComponent) => void;\n getIsland: (name: string) => IslandComponent | undefined;\n activeIslands: Set<string>;\n hydrateIsland: (islandId: string) => void;\n}\n\nexport const defaultLumenContextValue: LumenContextValue = {\n theme: 'dark',\n locale: 'en',\n currentPath: '/',\n islands: {},\n registerIsland: () => {},\n getIsland: () => undefined,\n activeIslands: new Set<string>(),\n hydrateIsland: () => {},\n};\n\nexport const LumenContext = createContext<LumenContextValue>(defaultLumenContextValue);\n\nexport const useLumen = (): LumenContextValue => useContext(LumenContext);\n"]}
|
|
@@ -4,6 +4,7 @@ import React, { useId, useState } from 'react';
|
|
|
4
4
|
import { Box, Typography, Tooltip, IconButton, Alert } from '@omnitron-dev/prism/ui';
|
|
5
5
|
import { RefreshIcon, ChevronDownIcon, CheckIcon, ErrorIcon, CopyIcon } from '@omnitron-dev/prism/icons';
|
|
6
6
|
import { useIsClient, useCopyToClipboard } from '@omnitron-dev/prism/core';
|
|
7
|
+
import { syntaxHighlightStyles } from '@omnitron-dev/prism/theme';
|
|
7
8
|
import { useIntersectionObserver } from '@omnitron-dev/prism/hooks';
|
|
8
9
|
import { ErrorBoundary } from '@omnitron-dev/prism/components/error-boundary';
|
|
9
10
|
|
|
@@ -140,12 +141,7 @@ function CodeBlock({ code = "", language = "ts", copyable = false, className, la
|
|
|
140
141
|
lineHeight: 1.65,
|
|
141
142
|
bgcolor: "transparent",
|
|
142
143
|
"& > code": { font: "inherit", background: "transparent", padding: 0, border: 0 },
|
|
143
|
-
"& > code span[style]":
|
|
144
|
-
color: `var(--shiki-${theme.palette.mode}, inherit)`,
|
|
145
|
-
fontStyle: `var(--shiki-${theme.palette.mode}-font-style, normal)`,
|
|
146
|
-
fontWeight: `var(--shiki-${theme.palette.mode}-font-weight, inherit)`,
|
|
147
|
-
textDecoration: `var(--shiki-${theme.palette.mode}-text-decoration, none)`
|
|
148
|
-
}
|
|
144
|
+
"& > code span[style]": syntaxHighlightStyles(theme)
|
|
149
145
|
}),
|
|
150
146
|
children: /* @__PURE__ */ jsx("code", { className: clsx3(highlighted && "shiki", `language-${language}`), children: source ? source.lines.map((line, lineIndex) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
151
147
|
line.tokens.map((token, tokenIndex) => /* @__PURE__ */ jsx("span", { style: token.style, children: token.content }, tokenIndex)),
|
|
@@ -162,6 +158,7 @@ function ComponentExample({
|
|
|
162
158
|
children,
|
|
163
159
|
language = "tsx",
|
|
164
160
|
resettable = false,
|
|
161
|
+
disclosureKey = "source",
|
|
165
162
|
labels
|
|
166
163
|
}) {
|
|
167
164
|
const captionId = useId();
|
|
@@ -204,7 +201,7 @@ function ComponentExample({
|
|
|
204
201
|
) }) })
|
|
205
202
|
] }),
|
|
206
203
|
/* @__PURE__ */ jsx(Box, { className: "lumen-example-preview", sx: { p: 2, minWidth: 0, overflowX: "auto" }, children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: ({ error }) => /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.message }), children }, generation) }),
|
|
207
|
-
/* @__PURE__ */ jsxs(Box, { component: "details", sx: {
|
|
204
|
+
/* @__PURE__ */ jsxs(Box, { component: "details", "data-lumen-disclosure": disclosureKey, sx: {
|
|
208
205
|
minWidth: 0,
|
|
209
206
|
borderTop: 1,
|
|
210
207
|
borderColor: "divider",
|
|
@@ -237,5 +234,5 @@ function PageAgentActions({ path, className }) {
|
|
|
237
234
|
}
|
|
238
235
|
|
|
239
236
|
export { BacklinksSection, CodeBlock, ComponentExample, HoverReferenceCard, MathTheoremBlock, PageAgentActions };
|
|
240
|
-
//# sourceMappingURL=chunk-
|
|
241
|
-
//# sourceMappingURL=chunk-
|
|
237
|
+
//# sourceMappingURL=chunk-6GXIVXBU.js.map
|
|
238
|
+
//# sourceMappingURL=chunk-6GXIVXBU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/blocks/theorem-block.tsx","../src/blocks/hover-reference-card.tsx","../src/blocks/code-block.tsx","../src/blocks/component-example.tsx","../src/blocks/backlinks.tsx","../src/blocks/page-agent-actions.tsx"],"names":["clsx","jsx","jsxs","source","Box","Too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OAAA,EAAO,CAAA;AAAA,sBAC3FA,GAAAA,CAAC,SAAA,EAAA,EAAU,MAAY,QAAA,EAAoB,QAAA,EAAU,aAAa,MAAA,EAAgB;AAAA,KAAA,EACpF;AAAA,GAAA,EACF,CAAA;AACF;ACzDO,SAAS,iBAAiB,EAAE,SAAA,GAAY,EAAC,EAAG,WAAU,EAA6C;AACxG,EAAA,OAAOM,KAAAA,CAAM,aAAA;AAAA,IACX,SAAA;AAAA,IACA,EAAE,SAAA,EAAWP,KAAAA,CAAK,iBAAA,EAAmB,SAAS,CAAA,EAAE;AAAA,IAChDO,KAAAA,CAAM,aAAA,CAAc,IAAA,EAAM,IAAA,EAAM,WAAW,CAAA;AAAA,IAC3CA,MAAM,aAAA,CAAc,IAAA,EAAM,MAAM,GAAG,SAAA,CAAU,IAAI,CAAC,IAAA,KAASA,KAAAA,CAAM,aAAA,CAAc,MAAM,EAAE,GAAA,EAAK,MAAK,EAAG,IAAI,CAAC,CAAC;AAAA,GAC5G;AACF;ACPO,SAAS,gBAAA,CAAiB,EAAE,IAAA,EAAM,SAAA,EAAU,EAA6C;AAC9F,EAAA,uBACEN,GAAAA,CAAC,KAAA,EAAA,EAAI,WAAWD,KAAAA,CAAK,0BAAA,EAA4B,SAAS,CAAA,EAAG,WAAA,EAAW,IAAA,EACtE,QAAA,kBAAAC,IAAC,GAAA,EAAA,EAAE,IAAA,EAAM,GAAG,IAAI,CAAA,GAAA,CAAA,EAAO,iCAAmB,CAAA,EAC5C,CAAA;AAEJ","file":"chunk-6GXIVXBU.js","sourcesContent":["import React, { type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type MathEnvironmentType =\n | 'axiom'\n | 'definition'\n | 'theorem'\n | 'lemma'\n | 'proposition'\n | 'corollary'\n | 'proof'\n | 'remark'\n | 'example'\n | 'hypothesis';\n\nexport interface MathTheoremBlockProps {\n id: string;\n title?: string;\n envType?: MathEnvironmentType;\n status?: string;\n number?: string;\n dependsOn?: string[];\n proves?: string[];\n children?: ReactNode;\n className?: string;\n}\n\nexport function MathTheoremBlock({\n id,\n title,\n envType = 'theorem',\n status,\n number,\n dependsOn,\n proves,\n children,\n className,\n}: MathTheoremBlockProps): React.JSX.Element {\n const upperType = envType.toUpperCase();\n const isProof = envType === 'proof';\n\n return (\n <section id={id} className={clsx('lumen-math-block', `lumen-math-${envType}`, className)} data-status={status}>\n <header className=\"lumen-math-header\">\n <span className=\"lumen-math-type\">{upperType}</span>\n {number && <span className=\"lumen-math-number\">{number}</span>}\n {title ? <span className=\"lumen-math-title\">{title}</span> : null}\n <a href={`#${id}`} className=\"lumen-math-id\">\n #{id}\n </a>\n </header>\n <div className=\"lumen-math-body\">\n {children}\n {isProof && (\n <span className=\"lumen-math-qed\" aria-label=\"End of proof\">\n ∎\n </span>\n )}\n </div>\n </section>\n );\n}\n","import React, { type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport interface HoverReferenceCardProps {\n id: string;\n targetTitle?: string;\n refKind?: 'thm' | 'def' | 'ax' | 'api' | 'doc' | string;\n excerpt?: string;\n children?: ReactNode;\n className?: string;\n}\n\nexport function HoverReferenceCard({ id, targetTitle, className }: HoverReferenceCardProps): React.JSX.Element {\n return (\n <div className={clsx('lumen-hover-reference-card', className)} data-reference-id={id}>\n {targetTitle ?? id}\n </div>\n );\n}\n","import React from 'react';\nimport clsx from 'clsx';\nimport { Box, IconButton, Tooltip } from '@omnitron-dev/prism/ui';\nimport { CheckIcon, CopyIcon, ErrorIcon } from '@omnitron-dev/prism/icons';\nimport { useCopyToClipboard } from '@omnitron-dev/prism/core';\nimport { syntaxHighlightStyles } from '@omnitron-dev/prism/theme';\nimport { useIntersectionObserver } from '@omnitron-dev/prism/hooks';\nimport type { HighlightedSource } from '@omnitron-dev/lumen-ast/highlight';\n\nexport interface CodeBlockProps {\n code?: string;\n language?: string;\n copyable?: boolean;\n className?: string;\n labels?: { copy?: string; copied?: string; copyFailed?: string; highlightUnavailable?: string };\n}\n\nconst hiddenStatus = {\n position: 'absolute', width: '1px', height: '1px', p: 0, m: '-1px',\n overflow: 'hidden', clip: 'rect(0, 0, 0, 0)', whiteSpace: 'nowrap', border: 0,\n} as const;\n\nfunction CopyCode({ code, labels }: Pick<CodeBlockProps, 'labels'> & { code: string }): React.JSX.Element {\n const { state, copy, reset } = useCopyToClipboard();\n React.useEffect(reset, [code, reset]);\n const copyLabel = labels?.copy ?? 'Copy code';\n const message = state === 'success' ? labels?.copied ?? 'Code copied'\n : state === 'error' ? labels?.copyFailed ?? 'Copy failed. Select the code and copy it manually.' : '';\n const Icon = state === 'success' ? CheckIcon : state === 'error' ? ErrorIcon : CopyIcon;\n return <Box className=\"lumen-code-copy\" sx={{ position: 'absolute', insetBlockStart: 4, insetInlineEnd: 4, zIndex: 1 }}>\n <Tooltip title={message || copyLabel}>\n <IconButton size=\"small\" aria-label={copyLabel} onClick={() => { void copy(code); }}\n color={state === 'error' ? 'error' : state === 'success' ? 'success' : 'default'}\n sx={{ width: 32, height: 32, bgcolor: 'background.paper', border: 1, borderColor: 'divider',\n '&.Mui-focusVisible': { outline: '2px solid currentColor', outlineOffset: 2 } }}>\n <Icon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n <Box component=\"span\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" sx={hiddenStatus}>{message}</Box>\n </Box>;\n}\n\n/** Literal SSR source, progressively highlighted with one lazily loaded grammar. */\nexport function CodeBlock({ code = '', language = 'ts', copyable = false, className, labels }: CodeBlockProps): React.JSX.Element {\n const { ref, isIntersecting } = useIntersectionObserver({ triggerOnce: true });\n const [result, setResult] = React.useState<{\n code: string; language: string; source?: HighlightedSource; failed?: boolean;\n }>();\n React.useEffect(() => {\n let current = true;\n if (code && isIntersecting) {\n void import('@omnitron-dev/lumen-ast/highlight')\n .then(({ highlightCode }) => highlightCode(code, language))\n .then(source => { if (current) setResult({ code, language, source }); })\n .catch(() => { if (current) setResult({ code, language, failed: true }); });\n }\n return () => { current = false; };\n }, [code, language, isIntersecting]);\n const active = result?.code === code && result.language === language ? result : undefined;\n const source = active?.source;\n const highlighted = source?.highlighted;\n return <Box className=\"lumen-code-frame\" sx={{\n position: 'relative', minWidth: 0, maxWidth: '100%', border: 1, borderColor: 'divider', borderRadius: 1, bgcolor: 'background.neutral',\n }}>\n <Box sx={{ height: 40, display: 'flex', alignItems: 'center', px: 2, color: 'text.secondary',\n fontSize: '0.75rem', fontFamily: 'var(--lumen-font-mono, ui-monospace, monospace)' }}>\n <Box component=\"span\" title={language} sx={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', mr: 5 }}>{language}</Box>\n {copyable && <CopyCode code={code} labels={labels} />}\n </Box>\n <Box component=\"pre\" ref={ref} tabIndex={code ? 0 : undefined}\n className={clsx(`lumen-code-block language-${language}`, className)}\n data-highlight={active?.failed ? 'error' : highlighted ? 'ready' : source || !code ? 'plain' : isIntersecting ? 'loading' : 'idle'}\n sx={theme => ({\n m: 0, boxSizing: 'border-box', maxWidth: '100%', overflow: 'auto',\n '&.lumen-code-block': { p: 2, border: 0, borderRadius: 'inherit' },\n fontFamily: 'var(--lumen-font-mono, ui-monospace, monospace)', fontSize: 'var(--lumen-code-font-size, 0.875rem)', lineHeight: 1.65,\n bgcolor: 'transparent',\n '& > code': { font: 'inherit', background: 'transparent', padding: 0, border: 0 },\n '& > code span[style]': syntaxHighlightStyles(theme),\n })}>\n <code className={clsx(highlighted && 'shiki', `language-${language}`)}>{source\n ? source.lines.map((line, lineIndex) => <React.Fragment key={lineIndex}>\n {line.tokens.map((token, tokenIndex) => <span key={tokenIndex} style={token.style}>{token.content}</span>)}{line.ending}\n </React.Fragment>) : code}</code>\n </Box>\n {active?.failed && <Box component=\"span\" role=\"status\" sx={{ display: 'block', fontSize: '0.75rem', color: 'text.secondary', mt: 0.5 }}>\n {labels?.highlightUnavailable ?? 'Syntax highlighting is unavailable. The complete source is still shown.'}\n </Box>}\n </Box>;\n}\n","import React, { useId, useState, type ReactNode } from 'react';\nimport { useIsClient } from '@omnitron-dev/prism/core';\nimport { Alert, Box, IconButton, Tooltip, Typography } from '@omnitron-dev/prism/ui';\nimport { ErrorBoundary } from '@omnitron-dev/prism/components/error-boundary';\nimport { ChevronDownIcon, RefreshIcon } from '@omnitron-dev/prism/icons';\nimport { CodeBlock, type CodeBlockProps } from './code-block.js';\n\nexport interface ComponentExampleProps {\n title: string;\n /** The build-time source of the trusted component supplied as children. */\n code: string;\n children: ReactNode;\n language?: string;\n resettable?: boolean;\n /** Stable within its island; use distinct keys when rendering several example frames. */\n disclosureKey?: string;\n labels?: { source?: string; reset?: string } & CodeBlockProps['labels'];\n}\n\n/** One preview frame with a native source disclosure; readable before hydration. */\nexport function ComponentExample({\n title, code, children, language = 'tsx', resettable = false, disclosureKey = 'source', labels,\n}: ComponentExampleProps): React.JSX.Element {\n const captionId = useId();\n const interactive = useIsClient();\n const [generation, setGeneration] = useState(0);\n const resetLabel = labels?.reset ?? 'Reset example';\n\n return <Box component=\"figure\" data-example=\"\" aria-labelledby={captionId} sx={{\n m: 0, my: 2, minWidth: 0, maxWidth: '100%', border: 1, borderColor: 'divider', borderRadius: 1,\n bgcolor: 'background.paper',\n }}>\n <Box component=\"figcaption\" sx={{\n display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 1, px: 2, py: 1,\n minHeight: 48, boxSizing: 'border-box', borderBottom: 1, borderColor: 'divider',\n }}>\n <Typography component=\"span\" variant=\"subtitle2\" id={captionId} sx={{ minWidth: 0, overflowWrap: 'anywhere' }}>{title}</Typography>\n {resettable && <Box sx={{ width: 32, height: 32, flexShrink: 0 }}>\n {interactive && <Tooltip title={resetLabel}>\n <IconButton type=\"button\" size=\"small\" aria-label={resetLabel} onClick={() => setGeneration(value => value + 1)}\n sx={{ width: 32, height: 32, '&.Mui-focusVisible': { outline: '2px solid currentColor', outlineOffset: 2 } }}>\n <RefreshIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>}\n </Box>}\n </Box>\n <Box className=\"lumen-example-preview\" sx={{ p: 2, minWidth: 0, overflowX: 'auto' }}>\n <ErrorBoundary key={generation} fallback={({ error }) => <Alert severity=\"error\">{error.message}</Alert>}>\n {children}\n </ErrorBoundary>\n </Box>\n <Box component=\"details\" data-lumen-disclosure={disclosureKey} sx={{\n minWidth: 0, borderTop: 1, borderColor: 'divider',\n '& > summary': { display: 'flex', alignItems: 'center', gap: 1, px: 2, py: 1.25, cursor: 'pointer', typography: 'body2', listStyle: 'none' },\n '& > summary::-webkit-details-marker': { display: 'none' },\n '& > summary:focus-visible': { outline: '2px solid currentColor', outlineOffset: -2, borderRadius: 1 },\n '& > summary:hover': { bgcolor: 'action.hover' },\n '&[open] > summary svg': { transform: 'rotate(180deg)' },\n '& .lumen-code-frame': { borderRadius: 0, border: 0, borderTop: 1, borderColor: 'divider' },\n '& .lumen-code-block': { maxHeight: '24rem' },\n }}>\n <summary><ChevronDownIcon fontSize=\"small\" /><span>{labels?.source ?? 'Source code'}</span></summary>\n <CodeBlock code={code} language={language} copyable={interactive} labels={labels} />\n </Box>\n </Box>;\n}\n","import React from 'react';\nimport clsx from 'clsx';\n\nexport interface BacklinksSectionProps {\n backlinks?: string[];\n className?: string;\n}\n\nexport function BacklinksSection({ backlinks = [], className }: BacklinksSectionProps): React.JSX.Element {\n return React.createElement(\n 'section',\n { className: clsx('lumen-backlinks', className) },\n React.createElement('h4', null, 'Backlinks'),\n React.createElement('ul', null, ...backlinks.map((link) => React.createElement('li', { key: link }, link)))\n );\n}\n","import React from 'react';\nimport clsx from 'clsx';\n\nexport interface PageAgentActionsProps {\n path: string;\n className?: string;\n}\n\nexport function PageAgentActions({ path, className }: PageAgentActionsProps): React.JSX.Element {\n return (\n <div className={clsx('lumen-page-agent-actions', className)} data-path={path}>\n <a href={`${path}.md`}>View Clean Markdown</a>\n </div>\n );\n}\n"]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import React, { useState, useRef, useMemo, useEffect
|
|
1
|
+
import React, { useState, useId, useRef, useMemo, useEffect } from 'react';
|
|
2
|
+
import { Box, Stack, TextField, IconButton, Tabs, Tab, Typography, Alert, List, ListItem, ListItemButton, ListItemText, Dialog, DialogContent } from '@omnitron-dev/prism/ui';
|
|
3
|
+
import { CloseIcon } from '@omnitron-dev/prism/icons';
|
|
4
|
+
import { Scrollbar } from '@omnitron-dev/prism/components';
|
|
2
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
6
|
|
|
4
7
|
// src/search/pagefind-adapter.ts
|
|
@@ -139,7 +142,6 @@ var NetronAdapter = class {
|
|
|
139
142
|
}));
|
|
140
143
|
}
|
|
141
144
|
};
|
|
142
|
-
var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
143
145
|
var ENTITY_MAP = {
|
|
144
146
|
"&": "&",
|
|
145
147
|
"<": "<",
|
|
@@ -171,7 +173,7 @@ function sanitizeSearchResultUrl(rawUrl) {
|
|
|
171
173
|
return "#";
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
|
-
if (trimmed.startsWith("//")) {
|
|
176
|
+
if (trimmed.startsWith("//") || trimmed.includes("\\")) {
|
|
175
177
|
return "#";
|
|
176
178
|
}
|
|
177
179
|
if (trimmed.startsWith("/") || trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("#") || trimmed.startsWith("?")) {
|
|
@@ -297,84 +299,18 @@ function LumenSearchDialogContent({
|
|
|
297
299
|
const [results, setResults] = useState([]);
|
|
298
300
|
const [isLoading, setIsLoading] = useState(false);
|
|
299
301
|
const [searchError, setSearchError] = useState(null);
|
|
300
|
-
const
|
|
301
|
-
const inputRef = useRef(null);
|
|
302
|
-
const previousFocusRef = useRef(
|
|
303
|
-
typeof document !== "undefined" && document.activeElement instanceof HTMLElement ? document.activeElement : null
|
|
304
|
-
);
|
|
302
|
+
const tabsId = useId();
|
|
305
303
|
const requestIdRef = useRef(0);
|
|
304
|
+
const inputRef = useRef(null);
|
|
305
|
+
const resultsRef = useRef(null);
|
|
306
306
|
const pagefindAdapter = useMemo(() => new PagefindAdapter(pagefindUrl), [pagefindUrl]);
|
|
307
307
|
const netronAdapter = useMemo(() => rpcClient ? new NetronAdapter(rpcClient) : null, [rpcClient]);
|
|
308
308
|
useEffect(() => {
|
|
309
309
|
if (!rpcClient) setActiveTab("local");
|
|
310
310
|
}, [rpcClient]);
|
|
311
|
-
useEffect(() => {
|
|
312
|
-
if (typeof document === "undefined") {
|
|
313
|
-
return void 0;
|
|
314
|
-
}
|
|
315
|
-
if (!previousFocusRef.current) {
|
|
316
|
-
const active = document.activeElement;
|
|
317
|
-
if (active instanceof HTMLElement && active !== inputRef.current) {
|
|
318
|
-
previousFocusRef.current = active;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
inputRef.current?.focus();
|
|
322
|
-
return () => {
|
|
323
|
-
const prev = previousFocusRef.current;
|
|
324
|
-
if (prev && typeof prev.focus === "function" && prev.isConnected) {
|
|
325
|
-
prev.focus();
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
}, []);
|
|
329
|
-
const trapTabFocus = useCallback((e) => {
|
|
330
|
-
if (typeof document === "undefined") return;
|
|
331
|
-
const container = dialogRef.current;
|
|
332
|
-
if (!container) return;
|
|
333
|
-
const focusable = Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
334
|
-
if (focusable.length === 0) {
|
|
335
|
-
e.preventDefault();
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
const activeEl = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
339
|
-
const currentIndex = activeEl ? focusable.indexOf(activeEl) : -1;
|
|
340
|
-
e.preventDefault();
|
|
341
|
-
if (e.shiftKey) {
|
|
342
|
-
const prevIndex = currentIndex <= 0 ? focusable.length - 1 : currentIndex - 1;
|
|
343
|
-
focusable[prevIndex]?.focus();
|
|
344
|
-
} else {
|
|
345
|
-
const nextIndex = currentIndex === -1 || currentIndex >= focusable.length - 1 ? 0 : currentIndex + 1;
|
|
346
|
-
focusable[nextIndex]?.focus();
|
|
347
|
-
}
|
|
348
|
-
}, []);
|
|
349
|
-
const handleDialogKeyDown = useCallback(
|
|
350
|
-
(e) => {
|
|
351
|
-
if (e.key === "Escape") {
|
|
352
|
-
e.preventDefault();
|
|
353
|
-
onClose?.();
|
|
354
|
-
} else if (e.key === "Tab") {
|
|
355
|
-
trapTabFocus(e);
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
[onClose, trapTabFocus]
|
|
359
|
-
);
|
|
360
|
-
useEffect(() => {
|
|
361
|
-
if (typeof window === "undefined") {
|
|
362
|
-
return void 0;
|
|
363
|
-
}
|
|
364
|
-
const handleWindowKeyDown = (e) => {
|
|
365
|
-
if (e.defaultPrevented) return;
|
|
366
|
-
if (e.key === "Escape") {
|
|
367
|
-
e.preventDefault();
|
|
368
|
-
onClose?.();
|
|
369
|
-
} else if (e.key === "Tab") {
|
|
370
|
-
trapTabFocus(e);
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
window.addEventListener("keydown", handleWindowKeyDown);
|
|
374
|
-
return () => window.removeEventListener("keydown", handleWindowKeyDown);
|
|
375
|
-
}, [onClose, trapTabFocus]);
|
|
376
311
|
useEffect(() => {
|
|
377
312
|
const raw = query.trim();
|
|
313
|
+
if (resultsRef.current) resultsRef.current.scrollTop = 0;
|
|
378
314
|
setSearchError(null);
|
|
379
315
|
if (!raw) {
|
|
380
316
|
requestIdRef.current += 1;
|
|
@@ -419,82 +355,128 @@ function LumenSearchDialogContent({
|
|
|
419
355
|
clearTimeout(timer);
|
|
420
356
|
};
|
|
421
357
|
}, [query, activeTab, maxResults, pagefindAdapter, netronAdapter]);
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
358
|
+
const moveResultFocus = (event, index) => {
|
|
359
|
+
if (event.nativeEvent.isComposing || event.altKey || event.ctrlKey || event.metaKey || isLoading) return;
|
|
360
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
|
|
361
|
+
const links = resultsRef.current?.querySelectorAll(".lumen-search-result-link");
|
|
362
|
+
if (!links?.length) return;
|
|
363
|
+
event.preventDefault();
|
|
364
|
+
const next = index < 0 ? event.key === "ArrowDown" ? 0 : links.length - 1 : index + (event.key === "ArrowDown" ? 1 : -1);
|
|
365
|
+
if (next < 0 || next >= links.length) inputRef.current?.focus();
|
|
366
|
+
else links[next]?.focus();
|
|
367
|
+
};
|
|
368
|
+
const status = isLoading ? "Searching\u2026" : searchError ? "Search unavailable" : !query.trim() ? "Type to search the documentation" : `${results.length} ${results.length === 1 ? "result" : "results"}`;
|
|
369
|
+
return /* @__PURE__ */ jsxs(Box, { className: "lumen-search-content", sx: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
|
|
370
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center", flexShrink: 0 }, children: [
|
|
371
|
+
/* @__PURE__ */ jsx(
|
|
372
|
+
TextField,
|
|
373
|
+
{
|
|
374
|
+
type: "search",
|
|
375
|
+
fullWidth: true,
|
|
376
|
+
autoFocus: true,
|
|
377
|
+
label: "Search query",
|
|
378
|
+
placeholder: "Search documentation...",
|
|
379
|
+
value: query,
|
|
380
|
+
inputRef,
|
|
381
|
+
slotProps: { htmlInput: { maxLength: 256, "aria-controls": `${tabsId}-results` } },
|
|
382
|
+
onKeyDown: (event) => moveResultFocus(event, -1),
|
|
383
|
+
onChange: (event) => setQuery(event.target.value)
|
|
384
|
+
}
|
|
385
|
+
),
|
|
386
|
+
onClose && /* @__PURE__ */ jsx(IconButton, { type: "button", "aria-label": "Close search", onClick: onClose, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
|
|
387
|
+
] }),
|
|
388
|
+
rpcClient && /* @__PURE__ */ jsxs(
|
|
389
|
+
Tabs,
|
|
390
|
+
{
|
|
391
|
+
value: activeTab,
|
|
392
|
+
onChange: (_, tab) => setActiveTab(tab),
|
|
393
|
+
"aria-label": "Search source",
|
|
394
|
+
sx: { mt: 1, flexShrink: 0 },
|
|
395
|
+
children: [
|
|
396
|
+
/* @__PURE__ */ jsx(Tab, { value: "local", label: "Local Docs", id: `${tabsId}-local`, "aria-controls": `${tabsId}-results` }),
|
|
397
|
+
/* @__PURE__ */ jsx(Tab, { value: "semantic", label: "Semantic AI", id: `${tabsId}-semantic`, "aria-controls": `${tabsId}-results` })
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
),
|
|
401
|
+
/* @__PURE__ */ jsx(
|
|
402
|
+
Typography,
|
|
403
|
+
{
|
|
404
|
+
role: "status",
|
|
405
|
+
"aria-live": "polite",
|
|
406
|
+
"aria-atomic": "true",
|
|
407
|
+
variant: "caption",
|
|
408
|
+
color: "text.secondary",
|
|
409
|
+
sx: { py: 1.5, flexShrink: 0 },
|
|
410
|
+
children: status
|
|
411
|
+
}
|
|
412
|
+
),
|
|
413
|
+
/* @__PURE__ */ jsxs(
|
|
414
|
+
Scrollbar,
|
|
415
|
+
{
|
|
416
|
+
ref: resultsRef,
|
|
417
|
+
id: `${tabsId}-results`,
|
|
418
|
+
role: rpcClient ? "tabpanel" : "region",
|
|
419
|
+
"aria-label": rpcClient ? void 0 : "Search matches",
|
|
420
|
+
"aria-busy": isLoading,
|
|
421
|
+
"aria-labelledby": rpcClient ? `${tabsId}-${activeTab}` : void 0,
|
|
422
|
+
sx: { flex: 1, minHeight: 0, overscrollBehavior: "contain", scrollbarGutter: "stable", overflowWrap: "anywhere" },
|
|
423
|
+
children: [
|
|
424
|
+
!isLoading && searchError && /* @__PURE__ */ jsx(Alert, { severity: "error", children: searchError }),
|
|
425
|
+
!isLoading && !searchError && query.trim() && results.length === 0 && /* @__PURE__ */ jsxs(Typography, { color: "text.secondary", sx: { py: 3 }, children: [
|
|
471
426
|
'No results found for "',
|
|
472
427
|
query.slice(0, 32),
|
|
473
|
-
'"'
|
|
428
|
+
'".'
|
|
474
429
|
] }),
|
|
475
|
-
!
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
430
|
+
!query.trim() && /* @__PURE__ */ jsx(Typography, { color: "text.secondary", variant: "body2", sx: { py: 3 }, children: "Search by topic, API name or phrase." }),
|
|
431
|
+
results.length > 0 && /* @__PURE__ */ jsx(
|
|
432
|
+
List,
|
|
433
|
+
{
|
|
434
|
+
disablePadding: true,
|
|
435
|
+
"aria-label": "Search results",
|
|
436
|
+
inert: isLoading || void 0,
|
|
437
|
+
sx: { opacity: isLoading ? 0.5 : 1, "& mark": {
|
|
438
|
+
bgcolor: "action.selected",
|
|
439
|
+
color: "text.primary",
|
|
440
|
+
borderRadius: "2px",
|
|
441
|
+
px: "1px",
|
|
442
|
+
"@media (forced-colors: active)": { bgcolor: "Highlight", color: "HighlightText" }
|
|
443
|
+
} },
|
|
444
|
+
children: results.map((result, index) => {
|
|
445
|
+
const safeUrl = sanitizeSearchResultUrl(result.url);
|
|
446
|
+
const snippetNodes = result.snippet ? parseSearchSnippet(result.snippet) : [];
|
|
447
|
+
return /* @__PURE__ */ jsx(ListItem, { disablePadding: true, className: "lumen-search-result-item", children: /* @__PURE__ */ jsx(
|
|
448
|
+
ListItemButton,
|
|
449
|
+
{
|
|
450
|
+
component: "a",
|
|
451
|
+
href: safeUrl,
|
|
452
|
+
className: "lumen-search-result-link",
|
|
453
|
+
onKeyDown: (event) => moveResultFocus(event, index),
|
|
454
|
+
sx: { borderRadius: 1, alignItems: "flex-start" },
|
|
455
|
+
onClick: () => {
|
|
456
|
+
onSelectResult?.({ url: safeUrl, title: result.title });
|
|
457
|
+
onClose?.();
|
|
458
|
+
},
|
|
459
|
+
children: /* @__PURE__ */ jsx(
|
|
460
|
+
ListItemText,
|
|
461
|
+
{
|
|
462
|
+
primary: result.title,
|
|
463
|
+
secondary: snippetNodes.length ? snippetNodes : void 0,
|
|
464
|
+
slotProps: { secondary: { sx: { display: "-webkit-box", WebkitBoxOrient: "vertical", WebkitLineClamp: 3, overflow: "hidden" } } }
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
}
|
|
468
|
+
) }, result.id);
|
|
469
|
+
})
|
|
470
|
+
}
|
|
471
|
+
)
|
|
472
|
+
]
|
|
473
|
+
}
|
|
474
|
+
),
|
|
475
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", sx: { pt: 1.5, flexShrink: 0, borderTop: 1, borderColor: "divider" }, children: [
|
|
476
|
+
"\u2191 \u2193 Navigate \xB7 Enter Open",
|
|
477
|
+
onClose ? " \xB7 Esc Close" : ""
|
|
478
|
+
] })
|
|
479
|
+
] });
|
|
498
480
|
}
|
|
499
481
|
function LumenSearchDialog({
|
|
500
482
|
open = false,
|
|
@@ -508,29 +490,44 @@ function LumenSearchDialog({
|
|
|
508
490
|
className
|
|
509
491
|
}) {
|
|
510
492
|
if (!open) return null;
|
|
511
|
-
return
|
|
512
|
-
|
|
493
|
+
return /* @__PURE__ */ jsx(
|
|
494
|
+
Dialog,
|
|
513
495
|
{
|
|
514
|
-
|
|
515
|
-
role: "dialog",
|
|
516
|
-
"aria-modal": true,
|
|
517
|
-
"aria-label": "Search documentation",
|
|
518
|
-
onClick: (e) => {
|
|
519
|
-
if (e.target === e.currentTarget) onClose?.();
|
|
520
|
-
}
|
|
521
|
-
},
|
|
522
|
-
React.createElement(LumenSearchDialogContent, {
|
|
496
|
+
open: true,
|
|
523
497
|
onClose,
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
498
|
+
maxWidth: "sm",
|
|
499
|
+
fullWidth: true,
|
|
500
|
+
className,
|
|
501
|
+
slotProps: {
|
|
502
|
+
container: { sx: { alignItems: "flex-start" } },
|
|
503
|
+
paper: {
|
|
504
|
+
"aria-label": "Search documentation",
|
|
505
|
+
sx: {
|
|
506
|
+
m: 2,
|
|
507
|
+
mt: "clamp(16px, 8dvh, 64px)",
|
|
508
|
+
width: "calc(100% - 32px)",
|
|
509
|
+
height: "38rem",
|
|
510
|
+
maxHeight: "calc(100dvh - clamp(16px, 8dvh, 64px) - 16px)",
|
|
511
|
+
overflow: "hidden"
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
children: /* @__PURE__ */ jsx(DialogContent, { sx: { p: { xs: 2, sm: 3 }, overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx(
|
|
516
|
+
LumenSearchDialogContent,
|
|
517
|
+
{
|
|
518
|
+
onClose,
|
|
519
|
+
initialQuery,
|
|
520
|
+
defaultTab,
|
|
521
|
+
pagefindUrl,
|
|
522
|
+
rpcClient,
|
|
523
|
+
maxResults,
|
|
524
|
+
onSelectResult
|
|
525
|
+
}
|
|
526
|
+
) })
|
|
527
|
+
}
|
|
531
528
|
);
|
|
532
529
|
}
|
|
533
530
|
|
|
534
531
|
export { LumenSearchDialog, LumenSearchDialogContent, NetronAdapter, PagefindAdapter, parseSearchSnippet, sanitizeSearchResultUrl };
|
|
535
|
-
//# sourceMappingURL=chunk-
|
|
536
|
-
//# sourceMappingURL=chunk-
|
|
532
|
+
//# sourceMappingURL=chunk-AJRKOSKX.js.map
|
|
533
|
+
//# sourceMappingURL=chunk-AJRKOSKX.js.map
|