MCPcopy Create free account
hub / github.com/freecodexyz/free-code / StaticKeybindingProvider

Function StaticKeybindingProvider

src/utils/exportRenderer.tsx:17–31  ·  view source on GitHub ↗

* Minimal keybinding provider for static/headless renders. * Provides keybinding context without the ChordInterceptor (which uses useInput * and would hang in headless renders with no stdin).

({
  children
}: {
  children: React.ReactNode;
})

Source from the content-addressed store, hash-verified

15 * and would hang in headless renders with no stdin).
16 */
17function StaticKeybindingProvider({
18 children
19}: {
20 children: React.ReactNode;
21}): React.ReactNode {
22 const {
23 bindings
24 } = loadKeybindingsSyncWithWarnings();
25 const pendingChordRef = useRef(null);
26 const handlerRegistryRef = useRef(new Map());
27 const activeContexts = useRef(new Set<KeybindingContextName>()).current;
28 return <KeybindingProvider bindings={bindings} pendingChordRef={pendingChordRef} pendingChord={null} setPendingChord={() => {}} activeContexts={activeContexts} registerActiveContext={() => {}} unregisterActiveContext={() => {}} handlerRegistryRef={handlerRegistryRef}>
29 {children}
30 </KeybindingProvider>;
31}
32
33// Upper-bound how many NormalizedMessages a Message can produce.
34// normalizeMessages splits one Message with N content blocks into N

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected