@omnitron-dev/lumen-ui 0.4.10 → 0.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +10 -5
  2. package/dist/blocks/code-block.d.ts.map +1 -1
  3. package/dist/blocks/component-example.d.ts +3 -1
  4. package/dist/blocks/component-example.d.ts.map +1 -1
  5. package/dist/blocks/index.js +1 -1
  6. package/dist/{chunk-L2KGVOK3.js → chunk-45RUHXKF.js} +6 -3
  7. package/dist/chunk-45RUHXKF.js.map +1 -0
  8. package/dist/{chunk-TQNHJCU2.js → chunk-6GXIVXBU.js} +6 -9
  9. package/dist/chunk-6GXIVXBU.js.map +1 -0
  10. package/dist/{chunk-HLB7FMNG.js → chunk-7X23XUL3.js} +83 -159
  11. package/dist/chunk-7X23XUL3.js.map +1 -0
  12. package/dist/{chunk-6NFMKJAX.js → chunk-F5K4PTVB.js} +40 -15
  13. package/dist/chunk-F5K4PTVB.js.map +1 -0
  14. package/dist/chunk-VGZSUVUN.js +236 -0
  15. package/dist/chunk-VGZSUVUN.js.map +1 -0
  16. package/dist/{chunk-AQ5PPDEV.js → chunk-X3LHELH6.js} +65 -40
  17. package/dist/chunk-X3LHELH6.js.map +1 -0
  18. package/dist/hydration/context.d.ts +2 -0
  19. package/dist/hydration/context.d.ts.map +1 -1
  20. package/dist/hydration/index.js +2 -2
  21. package/dist/hydration/shell.d.ts.map +1 -1
  22. package/dist/index.js +6 -6
  23. package/dist/interactive/api-explorer.d.ts.map +1 -1
  24. package/dist/interactive/index.js +2 -2
  25. package/dist/interactive/playground.d.ts.map +1 -1
  26. package/dist/navigation/index.js +1 -1
  27. package/dist/navigation/navbar.d.ts.map +1 -1
  28. package/dist/navigation/section-nav.d.ts +1 -0
  29. package/dist/navigation/section-nav.d.ts.map +1 -1
  30. package/dist/search/index.js +1 -1
  31. package/dist/search/search-dialog.d.ts.map +1 -1
  32. package/package.json +7 -7
  33. package/dist/chunk-6NFMKJAX.js.map +0 -1
  34. package/dist/chunk-AQ5PPDEV.js.map +0 -1
  35. package/dist/chunk-HCY4QR4M.js +0 -197
  36. package/dist/chunk-HCY4QR4M.js.map +0 -1
  37. package/dist/chunk-HLB7FMNG.js.map +0 -1
  38. package/dist/chunk-L2KGVOK3.js.map +0 -1
  39. 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.
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 <button onClick={() => setCount(value => value + 1)}>{count}</button>;
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. Style `[aria-current="location"]` or `.is-active` in the host stylesheet.
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,M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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,GACpE,EAAE,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2C3C"}
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"}
@@ -1,4 +1,4 @@
1
1
  "use client";
2
- export { BacklinksSection, CodeBlock, ComponentExample, HoverReferenceCard, MathTheoremBlock, PageAgentActions } from '../chunk-TQNHJCU2.js';
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-L2KGVOK3.js.map
21
- //# sourceMappingURL=chunk-L2KGVOK3.js.map
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-TQNHJCU2.js.map
241
- //# sourceMappingURL=chunk-TQNHJCU2.js.map
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","Tooltip","IconButton","React"],"mappings":";;;;;;;;;;;AA2BO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,MAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,EAA6C;AAC3C,EAAA,MAAM,SAAA,GAAY,QAAQ,W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AA;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,6 @@
1
- import React, { useState, useRef, useMemo, useEffect, useCallback } from 'react';
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';
2
4
  import { jsxs, jsx } from 'react/jsx-runtime';
3
5
 
4
6
  // src/search/pagefind-adapter.ts
@@ -139,7 +141,6 @@ var NetronAdapter = class {
139
141
  }));
140
142
  }
141
143
  };
142
- var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
143
144
  var ENTITY_MAP = {
144
145
  "&amp;": "&",
145
146
  "&lt;": "<",
@@ -297,82 +298,13 @@ function LumenSearchDialogContent({
297
298
  const [results, setResults] = useState([]);
298
299
  const [isLoading, setIsLoading] = useState(false);
299
300
  const [searchError, setSearchError] = useState(null);
300
- const dialogRef = useRef(null);
301
- const inputRef = useRef(null);
302
- const previousFocusRef = useRef(
303
- typeof document !== "undefined" && document.activeElement instanceof HTMLElement ? document.activeElement : null
304
- );
301
+ const tabsId = useId();
305
302
  const requestIdRef = useRef(0);
306
303
  const pagefindAdapter = useMemo(() => new PagefindAdapter(pagefindUrl), [pagefindUrl]);
307
304
  const netronAdapter = useMemo(() => rpcClient ? new NetronAdapter(rpcClient) : null, [rpcClient]);
308
305
  useEffect(() => {
309
306
  if (!rpcClient) setActiveTab("local");
310
307
  }, [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
308
  useEffect(() => {
377
309
  const raw = query.trim();
378
310
  setSearchError(null);
@@ -419,82 +351,72 @@ function LumenSearchDialogContent({
419
351
  clearTimeout(timer);
420
352
  };
421
353
  }, [query, activeTab, maxResults, pagefindAdapter, netronAdapter]);
422
- return /* @__PURE__ */ jsxs(
423
- "div",
424
- {
425
- ref: dialogRef,
426
- className: "lumen-search-dialog",
427
- "aria-label": "Search documentation",
428
- onKeyDown: handleDialogKeyDown,
429
- children: [
430
- /* @__PURE__ */ jsxs("header", { className: "lumen-search-header", children: [
431
- /* @__PURE__ */ jsx("div", { className: "lumen-search-input-wrapper", children: /* @__PURE__ */ jsx(
432
- "input",
433
- {
434
- ref: inputRef,
435
- type: "search",
436
- className: "lumen-search-input",
437
- placeholder: "Search documentation...",
438
- "aria-label": "Search query",
439
- value: query,
440
- maxLength: 256,
441
- autoFocus: true,
442
- onChange: (e) => setQuery(e.target.value)
443
- }
444
- ) }),
445
- onClose && /* @__PURE__ */ jsx("button", { type: "button", onClick: onClose, children: "Close" })
446
- ] }),
447
- rpcClient && /* @__PURE__ */ jsxs("div", { className: "lumen-search-tabs", children: [
448
- /* @__PURE__ */ jsx(
449
- "button",
450
- {
451
- type: "button",
452
- className: `lumen-search-tab ${activeTab === "local" ? "active" : ""}`,
453
- onClick: () => setActiveTab("local"),
454
- children: "Local Docs"
455
- }
456
- ),
457
- /* @__PURE__ */ jsx(
458
- "button",
459
- {
460
- type: "button",
461
- className: `lumen-search-tab ${activeTab === "semantic" ? "active" : ""}`,
462
- onClick: () => setActiveTab("semantic"),
463
- children: "Semantic AI"
464
- }
465
- )
466
- ] }),
467
- /* @__PURE__ */ jsxs("div", { className: "lumen-search-results", children: [
468
- isLoading && /* @__PURE__ */ jsx("div", { className: "lumen-search-loading", children: "Searching..." }),
469
- !isLoading && searchError && /* @__PURE__ */ jsx("p", { className: "lumen-search-error", role: "alert", children: searchError }),
470
- !isLoading && !searchError && query.trim() && results.length === 0 && /* @__PURE__ */ jsxs("div", { className: "lumen-search-empty", children: [
354
+ return /* @__PURE__ */ jsxs(Box, { className: "lumen-search-content", children: [
355
+ /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, sx: { alignItems: "center" }, children: [
356
+ /* @__PURE__ */ jsx(
357
+ TextField,
358
+ {
359
+ type: "search",
360
+ fullWidth: true,
361
+ autoFocus: true,
362
+ label: "Search query",
363
+ placeholder: "Search documentation...",
364
+ value: query,
365
+ slotProps: { htmlInput: { maxLength: 256 } },
366
+ onChange: (event) => setQuery(event.target.value)
367
+ }
368
+ ),
369
+ onClose && /* @__PURE__ */ jsx(IconButton, { type: "button", "aria-label": "Close search", onClick: onClose, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
370
+ ] }),
371
+ rpcClient && /* @__PURE__ */ jsxs(
372
+ Tabs,
373
+ {
374
+ value: activeTab,
375
+ onChange: (_, tab) => setActiveTab(tab),
376
+ "aria-label": "Search source",
377
+ sx: { mt: 2 },
378
+ children: [
379
+ /* @__PURE__ */ jsx(Tab, { value: "local", label: "Local Docs", id: `${tabsId}-local`, "aria-controls": `${tabsId}-results` }),
380
+ /* @__PURE__ */ jsx(Tab, { value: "semantic", label: "Semantic AI", id: `${tabsId}-semantic`, "aria-controls": `${tabsId}-results` })
381
+ ]
382
+ }
383
+ ),
384
+ /* @__PURE__ */ jsxs(
385
+ Box,
386
+ {
387
+ id: `${tabsId}-results`,
388
+ role: rpcClient ? "tabpanel" : void 0,
389
+ "aria-labelledby": rpcClient ? `${tabsId}-${activeTab}` : void 0,
390
+ sx: { mt: 2 },
391
+ children: [
392
+ isLoading && /* @__PURE__ */ jsx(Typography, { role: "status", children: "Searching..." }),
393
+ !isLoading && searchError && /* @__PURE__ */ jsx(Alert, { severity: "error", children: searchError }),
394
+ !isLoading && !searchError && query.trim() && results.length === 0 && /* @__PURE__ */ jsxs(Typography, { role: "status", children: [
471
395
  'No results found for "',
472
396
  query.slice(0, 32),
473
397
  '"'
474
398
  ] }),
475
- !isLoading && results.length > 0 && /* @__PURE__ */ jsx("ul", { className: "lumen-search-results-list", children: results.map((r) => {
476
- const safeUrl = sanitizeSearchResultUrl(r.url);
477
- const snippetNodes = r.snippet ? parseSearchSnippet(r.snippet) : [];
478
- return /* @__PURE__ */ jsx(
479
- "li",
399
+ !isLoading && results.length > 0 && /* @__PURE__ */ jsx(List, { disablePadding: true, "aria-label": "Search results", children: results.map((result) => {
400
+ const safeUrl = sanitizeSearchResultUrl(result.url);
401
+ const snippetNodes = result.snippet ? parseSearchSnippet(result.snippet) : [];
402
+ return /* @__PURE__ */ jsx(ListItem, { disablePadding: true, className: "lumen-search-result-item", children: /* @__PURE__ */ jsx(
403
+ ListItemButton,
480
404
  {
481
- className: "lumen-search-result-item",
405
+ component: "a",
406
+ href: safeUrl,
407
+ className: "lumen-search-result-link",
482
408
  onClick: () => {
483
- onSelectResult?.({ url: safeUrl, title: r.title });
409
+ onSelectResult?.({ url: safeUrl, title: result.title });
484
410
  onClose?.();
485
411
  },
486
- children: /* @__PURE__ */ jsxs("a", { href: safeUrl, className: "lumen-search-result-link", children: [
487
- /* @__PURE__ */ jsx("span", { className: "lumen-search-result-title", children: r.title }),
488
- snippetNodes.length > 0 && /* @__PURE__ */ jsx("span", { className: "lumen-search-result-snippet", children: snippetNodes })
489
- ] })
490
- },
491
- r.id
492
- );
412
+ children: /* @__PURE__ */ jsx(ListItemText, { primary: result.title, secondary: snippetNodes.length ? snippetNodes : void 0 })
413
+ }
414
+ ) }, result.id);
493
415
  }) })
494
- ] })
495
- ]
496
- }
497
- );
416
+ ]
417
+ }
418
+ )
419
+ ] });
498
420
  }
499
421
  function LumenSearchDialog({
500
422
  open = false,
@@ -508,29 +430,31 @@ function LumenSearchDialog({
508
430
  className
509
431
  }) {
510
432
  if (!open) return null;
511
- return React.createElement(
512
- "div",
433
+ return /* @__PURE__ */ jsx(
434
+ Dialog,
513
435
  {
514
- className: className ? `lumen-search-dialog-backdrop ${className}` : "lumen-search-dialog-backdrop",
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, {
436
+ open: true,
523
437
  onClose,
524
- initialQuery,
525
- defaultTab,
526
- pagefindUrl,
527
- rpcClient,
528
- maxResults,
529
- onSelectResult
530
- })
438
+ maxWidth: "sm",
439
+ fullWidth: true,
440
+ className,
441
+ slotProps: { paper: { "aria-label": "Search documentation" } },
442
+ children: /* @__PURE__ */ jsx(DialogContent, { sx: { pt: 3 }, children: /* @__PURE__ */ jsx(
443
+ LumenSearchDialogContent,
444
+ {
445
+ onClose,
446
+ initialQuery,
447
+ defaultTab,
448
+ pagefindUrl,
449
+ rpcClient,
450
+ maxResults,
451
+ onSelectResult
452
+ }
453
+ ) })
454
+ }
531
455
  );
532
456
  }
533
457
 
534
458
  export { LumenSearchDialog, LumenSearchDialogContent, NetronAdapter, PagefindAdapter, parseSearchSnippet, sanitizeSearchResultUrl };
535
- //# sourceMappingURL=chunk-HLB7FMNG.js.map
536
- //# sourceMappingURL=chunk-HLB7FMNG.js.map
459
+ //# sourceMappingURL=chunk-7X23XUL3.js.map
460
+ //# sourceMappingURL=chunk-7X23XUL3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/search/pagefind-adapter.ts","../src/search/netron-adapter.ts","../src/search/search-dialog.tsx"],"names":[],"mappings":";;;;;;AAaA,SAAS,SAAS,KAAA,EAAkD;AAClE,EAAA,OAAO,OAAO,UAAU,QAAA,IAAY,KAAA,KAAU,QAAQ,CAAC,KAAA,CAAM,QAAQ,KAAK,CAAA;AAC5E;AAGO,IAAM,kBAAN,MAAsB;AAAA,EAK3B,WAAA,CAA6B,eAAuB,uBAAA,EAAyB;AAAhD,IAAA,IAAA,CAAA,YAAA,GAAA,YAAA;AAAA,EAAiD;AAAA,EAAjD,YAAA;AAAA,EAJrB,gBAAA,GAA0C,IAAA;AAAA,EAC1C,WAAA,GAAuC,IAAA;AAAA,EACvC,SAAA;AAAA,EAIR,IAAI,aAAA,GAAyB;AAAE,IAAA,OAAO,KAAK,SAAA,KAAc,MAAA;AAAA,EAAW;AAAA,EACpE,IAAI,OAAA,GAAmB;AAAE,IAAA,OAAO,KAAK,gBAAA,KAAqB,IAAA;AAAA,EAAM;AAAA,EAEhE,MAAM,IAAA,GAAyB;AAC7B,IAAA,IAAI,IAAA,CAAK,kBAAkB,OAAO,IAAA;AAClC,IAAA,IAAI,OAAO,WAAW,WAAA,IAAe,CAAC,KAAK,YAAA,CAAa,UAAA,CAAW,OAAO,CAAA,EAAG,OAAO,KAAA;AACpF,IAAA,IAAI,IAAA,CAAK,WAAA,EAAa,OAAO,IAAA,CAAK,WAAA;AAElC,IAAA,IAAA,CAAK,eAAe,YAAY;AAC9B,MAAA,IAAI;AACF,QAAA,MAAM,SAAkB,MAAM;AAAA;AAAA,UAA0B,IAAA,CAAK;AAAA,SAAA;AAC7D,QAAA,IAAI,CAAC,QAAA,CAAS,MAAM,CAAA,IAAK,OA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AAA,CAAkB;AAAA,EAChC,IAAA,GAAO,KAAA;AAAA,EACP,OAAA;AAAA,EACA,YAAA,GAAe,EAAA;AAAA,EACf,UAAA,GAAa,OAAA;AAAA,EACb,WAAA,GAAc,uBAAA;AAAA,EACd,SAAA;AAAA,EACA,UAAA,GAAa,EAAA;AAAA,EACb,cAAA;AAAA,EACA;AACF,CAAA,EAAqD;AACnD,EAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAElB,EAAA,uBAAO,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MAAO,IAAA,EAAI,IAAA;AAAA,MAAC,OAAA;AAAA,MAAkB,QAAA,EAAS,IAAA;AAAA,MAAK,SAAA,EAAS,IAAA;AAAA,MAAC,SAAA;AAAA,MAC5D,WAAW,EAAE,KAAA,EAAO,EAAE,YAAA,EAAc,wBAAuB,EAAE;AAAA,MAC7D,8BAAC,aAAA,EAAA,EAAc,EAAA,EAAI,EAAE,EAAA,EAAI,GAAE,EACzB,QAAA,kBAAA,GAAA;AAAA,QAAC,wBAAA;AAAA,QAAA;AAAA,UAAyB,OAAA;AAAA,UAAkB,YAAA;AAAA,UAA4B,UAAA;AAAA,UACtE,WAAA;AAAA,UAA0B,SAAA;AAAA,UAAsB,UAAA;AAAA,UAAwB;AAAA;AAAA,OAAgC,EAC5G;AAAA;AAAA,GACF;AACF","file":"chunk-7X23XUL3.js","sourcesContent":["export interface PagefindSearchResult {\n id: string;\n url: string;\n title: string;\n excerpt: string;\n score?: number;\n}\n\ninterface PagefindModule {\n init?: () => Promise<unknown>;\n search: (query: string) => Promise<unknown>;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Loads only the explicitly configured index; failures can be retried. */\nexport class PagefindAdapter {\n private pagefindInstance: PagefindModule | null = null;\n private loadPromise: Promise<boolean> | null = null;\n private loadError: unknown;\n\n constructor(private readonly pagefindPath: string = '/pagefind/pagefind.js') {}\n\n get isFailedState(): boolean { return this.loadError !== undefined; }\n get isReady(): boolean { return this.pagefindInstance !== null; }\n\n async init(): Promise<boolean> {\n if (this.pagefindInstance) return true;\n if (typeof window === 'undefined' && !this.pagefindPath.startsWith('file:')) return false;\n if (this.loadPromise) return this.loadPromise;\n\n this.loadPromise = (async () => {\n try {\n const module: unknown = await import(/* @vite-ignore */ this.pagefindPath);\n if (!isRecord(module) || typeof module.search !== 'function' ||\n (module.init !== undefined && typeof module.init !== 'function')) {\n throw new Error('The configured module does not expose the Pagefind search API');\n }\n const pagefind = module as unknown as PagefindModule;\n await pagefind.init?.();\n this.pagefindInstance = pagefind;\n this.loadError = undefined;\n return true;\n } catch (error) {\n this.loadError = error;\n return false;\n }\n })().finally(() => { this.loadPromise = null; });\n\n return this.loadPromise;\n }\n\n async search(query: string, maxResults: number = 10): Promise<PagefindSearchResult[]> {\n if (!Number.isInteger(maxResults) || maxResults < 0 || maxResults > 100) {\n throw new RangeError('Search result limit must be an integer between 0 and 100');\n }\n if (typeof query !== 'string' || new TextEncoder().encode(query).length > 4096) {\n throw new RangeError('Search query must be text of at most 4096 UTF-8 bytes');\n }\n if (!query.trim() || maxResults === 0) return [];\n if (!await this.init() || !this.pagefindInstance) {\n throw new Error('Local search index is unavailable. Try again when the connection is restored.', { cause: this.loadError });\n }\n\n try {\n const response = await this.pagefindInstance.search(query);\n if (!isRecord(response) || !Array.isArray(response.results)) {\n throw new Error('Pagefind returned an invalid search response');\n }\n return await Promise.all(response.results.slice(0, maxResults).map(async (result: unknown) => {\n if (!isRecord(result) || typeof result.data !== 'function') {\n throw new Error('Pagefind returned an invalid search result');\n }\n const data: unknown = await result.data();\n if (!isRecord(data) || typeof data.url !== 'string' ||\n (data.excerpt !== undefined && typeof data.excerpt !== 'string')) {\n throw new Error('Pagefind returned invalid result data');\n }\n return {\n id: typeof result.id === 'string' ? result.id : data.url,\n url: data.url,\n title: isRecord(data.meta) && typeof data.meta.title === 'string' ? data.meta.title : data.url,\n excerpt: typeof data.excerpt === 'string' ? data.excerpt : '',\n score: typeof result.score === 'number' && Number.isFinite(result.score) ? result.score : undefined,\n };\n }));\n } catch (cause) {\n throw new Error('Local search failed. Try the search again.', { cause });\n }\n }\n}\n","export interface NetronSearchResult {\n id: string;\n title: string;\n path: string;\n snippet: string;\n score: number;\n}\n\nfunction stripDangerousTagsLinear(snippet: string): string {\n if (!snippet) return '';\n let lower = snippet.toLowerCase();\n let current = snippet;\n\n for (const blocked of ['script', 'style']) {\n let out = '';\n let cursor = 0;\n const openToken = `<${blocked}`;\n const closeToken = `</${blocked}`;\n\n while (cursor < current.length) {\n const idx = lower.indexOf(openToken, cursor);\n if (idx === -1) {\n out += current.slice(cursor);\n break;\n }\n const nextChar = lower[idx + openToken.length] ?? '';\n if (nextChar && nextChar !== '>' && nextChar !== '/' && !/\\s/.test(nextChar)) {\n out += current.slice(cursor, idx + openToken.length);\n cursor = idx + openToken.length;\n continue;\n }\n out += current.slice(cursor, idx);\n const closeIdx = lower.indexOf(closeToken, idx + openToken.length);\n if (closeIdx === -1) {\n break;\n }\n const closeEnd = lower.indexOf('>', closeIdx + closeToken.length);\n if (closeEnd === -1) {\n break;\n }\n cursor = closeEnd + 1;\n }\n\n current = out;\n lower = current.toLowerCase();\n }\n\n return current;\n}\n\n/** Structural contract of the queried LumenService search method. */\nexport interface NetronSearchClient {\n search(query: string, options?: { limit?: number }): Promise<Array<{\n documentId: string;\n title: string;\n path: string;\n snippet: string;\n score: number;\n }>>;\n}\n\nexport class NetronAdapter {\n constructor(private readonly rpcClient: NetronSearchClient) {}\n\n async search(query: string, limit: number = 10): Promise<NetronSearchResult[]> {\n if (!query.trim()) return [];\n const results = await this.rpcClient.search(query, { limit });\n return results.map(result => ({\n id: result.documentId,\n title: result.title,\n path: result.path,\n snippet: stripDangerousTagsLinear(result.snippet),\n score: result.score,\n }));\n }\n}\n","import React, { useState, useEffect, useMemo, useRef, useId } from 'react';\nimport { Alert, Box, Dialog, DialogContent, IconButton, List, ListItem, ListItemButton, ListItemText, Stack, Tab, Tabs, TextField, Typography } from '@omnitron-dev/prism/ui';\nimport { CloseIcon } from '@omnitron-dev/prism/icons';\nimport { PagefindAdapter } from './pagefind-adapter.js';\nimport { NetronAdapter, type NetronSearchClient } from './netron-adapter.js';\n\nexport interface LumenSearchDialogProps {\n /** Controlled open state */\n open?: boolean;\n /** Callback invoked to close the dialog */\n onClose?: () => void;\n /** Initial query text */\n initialQuery?: string;\n /** Active search tab ('local' | 'semantic') */\n defaultTab?: 'local' | 'semantic';\n /** Path to Pagefind WASM bundle (default: '/pagefind/pagefind.js') */\n pagefindUrl?: string;\n /** Queried LumenService client; enables the semantic search tab when present. */\n rpcClient?: NetronSearchClient;\n /** Maximum number of search results to return */\n maxResults?: number;\n /** Callback when result is selected */\n onSelectResult?: (result: { url: string; title: string }) => void;\n className?: string;\n}\n\nconst ENTITY_MAP: Record<string, string> = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': \"'\",\n '&#x27;': \"'\",\n '&apos;': \"'\",\n '&nbsp;': ' ',\n};\n\nfunction decodeSafeEntities(text: string): string {\n if (!text || !text.includes('&')) return text;\n return text.replace(/&(?:amp|lt|gt|quot|apos|nbsp|#39|#x27);/gi, (match) => {\n const lower = match.toLowerCase();\n return ENTITY_MAP[lower] ?? match;\n });\n}\n\n/**\n * Strictly validates search result URLs, allowing only http:, https:, mailto:,\n * or safe relative URLs (/, ./, ../, #, ?). Replaces javascript:, vbscript:, data:,\n * protocol-relative //, and unknown schemes with '#'.\n */\nexport function sanitizeSearchResultUrl(rawUrl: string): string {\n if (!rawUrl || typeof rawUrl !== 'string') {\n return '#';\n }\n\n const trimmed = rawUrl.trim();\n if (!trimmed) {\n return '#';\n }\n\n // Reject any URL containing control characters (e.g. java\\tscript:, null bytes, newlines)\n for (let i = 0; i < trimmed.length; i++) {\n const code = trimmed.charCodeAt(i);\n if (code <= 0x1f || code === 0x7f) {\n return '#';\n }\n }\n\n // Reject protocol-relative URLs (//evil.example)\n if (trimmed.startsWith('//')) {\n return '#';\n }\n\n // Allow safe relative URL forms\n if (\n trimmed.startsWith('/') ||\n trimmed.startsWith('./') ||\n trimmed.startsWith('../') ||\n trimmed.startsWith('#') ||\n trimmed.startsWith('?')\n ) {\n return trimmed;\n }\n\n // Normalize whitespace to detect obfuscated schemes\n const collapsed = trimmed.replace(/\\s+/g, '');\n const colonIdx = collapsed.indexOf(':');\n if (colonIdx !== -1) {\n const scheme = collapsed.slice(0, colonIdx + 1).toLowerCase();\n if (scheme === 'http:' || scheme === 'https:' || scheme === 'mailto:') {\n return trimmed;\n }\n return '#';\n }\n\n return '#';\n}\n\n/**\n * Parses a search result snippet into safe React child nodes without raw HTML injection.\n * - Strips <script>...</script> and <style>...</style> blocks completely.\n * - Converts <mark>...</mark> segments into React <mark> elements.\n * - Strips all other tags down to plain escaped text nodes.\n */\nexport function parseSearchSnippet(snippet: string): React.ReactNode[] {\n if (!snippet || typeof snippet !== 'string') {\n return [];\n }\n\n const nodes: React.ReactNode[] = [];\n let plainBuffer = '';\n let markBuffer = '';\n let inMark = false;\n let ignoredTag: 'script' | 'style' | null = null;\n let markKey = 0;\n let index = 0;\n\n const flushPlain = () => {\n if (plainBuffer.length > 0) {\n nodes.push(decodeSafeEntities(plainBuffer));\n plainBuffer = '';\n }\n };\n\n const flushMark = () => {\n if (markBuffer.length > 0) {\n nodes.push(React.createElement('mark', { key: `mark-${markKey}` }, decodeSafeEntities(markBuffer)));\n markKey += 1;\n markBuffer = '';\n }\n };\n\n while (index < snippet.length) {\n const lt = snippet.indexOf('<', index);\n if (lt === -1) {\n if (ignoredTag === null) {\n const tail = snippet.slice(index);\n if (inMark) {\n markBuffer += tail;\n } else {\n plainBuffer += tail;\n }\n }\n break;\n }\n\n if (lt > index && ignoredTag === null) {\n const chunk = snippet.slice(index, lt);\n if (inMark) {\n markBuffer += chunk;\n } else {\n plainBuffer += chunk;\n }\n }\n\n const gt = snippet.indexOf('>', lt + 1);\n if (gt === -1) {\n // Unclosed tag at end of snippet: drop trailing fragment safely\n break;\n }\n\n const rawTag = snippet.slice(lt + 1, gt).trim();\n index = gt + 1;\n\n if (!rawTag || rawTag.startsWith('!')) {\n continue;\n }\n\n const isClosing = rawTag.startsWith('/');\n const tagBody = isClosing ? rawTag.slice(1).trim() : rawTag;\n const isSelfClosing = !isClosing && rawTag.endsWith('/');\n\n let nameEnd = 0;\n while (nameEnd < tagBody.length) {\n const ch = tagBody.charCodeAt(nameEnd);\n const isAlphaNum = (ch >= 48 && ch <= 57) || (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122) || ch === 45;\n if (!isAlphaNum) break;\n nameEnd += 1;\n }\n const tagName = tagBody.slice(0, nameEnd).toLowerCase();\n\n if (ignoredTag !== null) {\n if (isClosing && tagName === ignoredTag) {\n ignoredTag = null;\n }\n continue;\n }\n\n if (!isClosing && (tagName === 'script' || tagName === 'style')) {\n if (!isSelfClosing) {\n ignoredTag = tagName;\n }\n continue;\n }\n\n if (tagName === 'mark') {\n if (!isClosing && !isSelfClosing) {\n if (!inMark) {\n flushPlain();\n inMark = true;\n }\n } else if (isClosing && inMark) {\n flushMark();\n inMark = false;\n }\n }\n }\n\n if (inMark) {\n flushMark();\n }\n flushPlain();\n\n return nodes;\n}\n\nexport function LumenSearchDialogContent({\n onClose,\n initialQuery = '',\n defaultTab = 'local',\n pagefindUrl = '/pagefind/pagefind.js',\n rpcClient,\n maxResults = 10,\n onSelectResult,\n}: Omit<LumenSearchDialogProps, 'open' | 'className'>): React.JSX.Element {\n const [query, setQuery] = useState(initialQuery);\n const [activeTab, setActiveTab] = useState<'local' | 'semantic'>(rpcClient ? defaultTab : 'local');\n const [results, setResults] = useState<Array<{ id: string; title: string; url: string; snippet: string }>>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [searchError, setSearchError] = useState<string | null>(null);\n\n const tabsId = useId();\n const requestIdRef = useRef(0);\n\n const pagefindAdapter = useMemo(() => new PagefindAdapter(pagefindUrl), [pagefindUrl]);\n const netronAdapter = useMemo(() => rpcClient ? new NetronAdapter(rpcClient) : null, [rpcClient]);\n\n useEffect(() => { if (!rpcClient) setActiveTab('local'); }, [rpcClient]);\n\n useEffect(() => {\n const raw = query.trim();\n setSearchError(null);\n if (!raw) {\n requestIdRef.current += 1;\n setResults([]);\n setIsLoading(false);\n return undefined;\n }\n\n const currentRequestId = requestIdRef.current + 1;\n requestIdRef.current = currentRequestId;\n const truncated = raw.slice(0, 256);\n let cancelled = false;\n setIsLoading(true);\n\n async function executeSearch() {\n if (cancelled || currentRequestId !== requestIdRef.current) return;\n try {\n if (activeTab === 'local') {\n const res = await pagefindAdapter.search(truncated, maxResults);\n if (!cancelled && currentRequestId === requestIdRef.current) {\n setResults(res.map((r) => ({ id: r.id, title: r.title, url: r.url, snippet: r.excerpt })));\n }\n } else {\n if (!netronAdapter) throw new Error('Semantic search is not connected.');\n const res = await netronAdapter.search(truncated, maxResults);\n if (!cancelled && currentRequestId === requestIdRef.current) {\n setResults(res.map((r) => ({ id: r.id, title: r.title, url: r.path, snippet: r.snippet })));\n }\n }\n } catch (error) {\n if (!cancelled && currentRequestId === requestIdRef.current) {\n setResults([]);\n setSearchError(error instanceof Error ? error.message : 'Search is unavailable.');\n }\n } finally {\n if (!cancelled && currentRequestId === requestIdRef.current) {\n setIsLoading(false);\n }\n }\n }\n\n const timer = setTimeout(executeSearch, 150);\n return () => {\n cancelled = true;\n clearTimeout(timer);\n };\n }, [query, activeTab, maxResults, pagefindAdapter, netronAdapter]);\n\n return (\n <Box className=\"lumen-search-content\">\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <TextField type=\"search\" fullWidth autoFocus label=\"Search query\" placeholder=\"Search documentation...\"\n value={query} slotProps={{ htmlInput: { maxLength: 256 } }}\n onChange={event => setQuery(event.target.value)} />\n {onClose && <IconButton type=\"button\" aria-label=\"Close search\" onClick={onClose}><CloseIcon /></IconButton>}\n </Stack>\n {rpcClient && <Tabs value={activeTab} onChange={(_, tab: 'local' | 'semantic') => setActiveTab(tab)}\n aria-label=\"Search source\" sx={{ mt: 2 }}>\n <Tab value=\"local\" label=\"Local Docs\" id={`${tabsId}-local`} aria-controls={`${tabsId}-results`} />\n <Tab value=\"semantic\" label=\"Semantic AI\" id={`${tabsId}-semantic`} aria-controls={`${tabsId}-results`} />\n </Tabs>}\n <Box id={`${tabsId}-results`} role={rpcClient ? 'tabpanel' : undefined}\n aria-labelledby={rpcClient ? `${tabsId}-${activeTab}` : undefined} sx={{ mt: 2 }}>\n {isLoading && <Typography role=\"status\">Searching...</Typography>}\n {!isLoading && searchError && <Alert severity=\"error\">{searchError}</Alert>}\n {!isLoading && !searchError && query.trim() && results.length === 0 && (\n <Typography role=\"status\">No results found for &quot;{query.slice(0, 32)}&quot;</Typography>\n )}\n {!isLoading && results.length > 0 && <List disablePadding aria-label=\"Search results\">\n {results.map(result => {\n const safeUrl = sanitizeSearchResultUrl(result.url);\n const snippetNodes = result.snippet ? parseSearchSnippet(result.snippet) : [];\n return <ListItem key={result.id} disablePadding className=\"lumen-search-result-item\">\n <ListItemButton component=\"a\" href={safeUrl} className=\"lumen-search-result-link\"\n onClick={() => {\n onSelectResult?.({ url: safeUrl, title: result.title });\n onClose?.();\n }}>\n <ListItemText primary={result.title} secondary={snippetNodes.length ? snippetNodes : undefined} />\n </ListItemButton>\n </ListItem>;\n })}\n </List>}\n </Box>\n </Box>\n );\n}\n\nexport function LumenSearchDialog({\n open = false,\n onClose,\n initialQuery = '',\n defaultTab = 'local',\n pagefindUrl = '/pagefind/pagefind.js',\n rpcClient,\n maxResults = 10,\n onSelectResult,\n className,\n}: LumenSearchDialogProps): React.JSX.Element | null {\n if (!open) return null;\n\n return <Dialog open onClose={onClose} maxWidth=\"sm\" fullWidth className={className}\n slotProps={{ paper: { 'aria-label': 'Search documentation' } }}>\n <DialogContent sx={{ pt: 3 }}>\n <LumenSearchDialogContent onClose={onClose} initialQuery={initialQuery} defaultTab={defaultTab}\n pagefindUrl={pagefindUrl} rpcClient={rpcClient} maxResults={maxResults} onSelectResult={onSelectResult} />\n </DialogContent>\n </Dialog>;\n}\n"]}