{"version":3,"file":"KeyboardScope.mjs","names":[],"sources":["../../../src/components/controls/KeyboardScope.tsx"],"sourcesContent":["import React from 'react';\nimport { useTimelineKeyboard, type TimelineKeyboardOptions } from '#react/hooks';\n\n/** Props for the focus-scoped timeline keyboard shortcut wrapper. */\nexport interface KeyboardScopeProps\n  extends\n    Omit<React.HTMLAttributes<HTMLDivElement>, keyof TimelineKeyboardOptions>,\n    TimelineKeyboardOptions {}\n\n/**\n * Focus-scoped keyboard shortcut container for timeline editor surfaces.\n *\n * Keyboard handling is opt-in and local to this element or its descendants.\n */\nexport const KeyboardScope = React.forwardRef<HTMLDivElement, KeyboardScopeProps>(\n  (\n    {\n      bindings,\n      commandHandlers,\n      onCommandResult,\n      onCommandError,\n      children,\n      disabled,\n      frameRate,\n      frameStepCount,\n      label,\n      onKeyDown,\n      platform,\n      preset,\n      preventDefault,\n      stopPropagation,\n      tabIndex,\n      zoomStepRatio,\n      ...props\n    },\n    ref\n  ) => {\n    const keyboard = useTimelineKeyboard({\n      bindings,\n      commandHandlers,\n      onCommandResult,\n      onCommandError,\n      disabled,\n      frameRate,\n      frameStepCount,\n      label,\n      platform,\n      preset,\n      preventDefault,\n      stopPropagation,\n      zoomStepRatio,\n    });\n\n    return (\n      <div\n        ref={ref}\n        {...keyboard.scopeProps}\n        {...props}\n        tabIndex={tabIndex ?? keyboard.scopeProps.tabIndex}\n        onKeyDown={(event) => {\n          onKeyDown?.(event);\n          keyboard.scopeProps.onKeyDown?.(event);\n        }}\n      >\n        {children}\n      </div>\n    );\n  }\n);\n\nKeyboardScope.displayName = 'Timeline.KeyboardScope';\n"],"mappings":";;;;;;;;;AAcA,MAAa,gBAAgB,MAAM,YAE/B,EACE,UACA,iBACA,iBACA,gBACA,UACA,UACA,WACA,gBACA,OACA,WACA,UACA,QACA,gBACA,iBACA,UACA,eACA,GAAG,SAEL,QACG;CACH,MAAM,WAAW,oBAAoB;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OACE,oBAAC,OAAD;EACO;EACL,GAAI,SAAS;EACb,GAAI;EACJ,UAAU,YAAY,SAAS,WAAW;EAC1C,YAAY,UAAU;GACpB,YAAY,KAAK;GACjB,SAAS,WAAW,YAAY,KAAK;EACvC;EAEC;CACE,CAAA;AAET,CACF;AAEA,cAAc,cAAc"}