• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mizchi / next-editor / 1409

pending completion
1409

Pull #349

circleci

web-flow
chore(deps): update babel monorepo
Pull Request #349: chore(deps): update babel monorepo

95 of 450 branches covered (21.11%)

Branch coverage included in aggregate %.

967 of 2058 relevant lines covered (46.99%)

1.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ui/components/utils/GlobalKeyHandler.tsx
1
import React from "react"
×
2
import { HotKeys } from "react-hotkeys"
×
3
import { connect } from "react-redux"
×
4
import { defaultKeyMap, implCommandMap } from "./commandMap"
×
5

6
export const GlobalKeyHandler = connect(_state => {
×
7
  return {}
×
8
})(function GlobalKeyHandlerImpl({ children, dispatch }: any) {
9
  const keyMap = { ...defaultKeyMap }
×
10
  const handlers: {
11
    [key: string]: (dispatch: any, event: any) => void
12
  } = Object.keys(implCommandMap).reduce(
×
13
    (acc, _key: any) => {
14
      const key: string = _key
×
15
      const fn = implCommandMap[key]
×
16
      if (fn) {
17
        return {
×
18
          ...acc,
19
          [key]: (event: Event) => fn(dispatch, event)
×
20
        }
21
      }
22
      return acc
×
23
    },
24
    {} as any
25
  )
26

27
  return (
×
28
    <HotKeys
29
      focused
30
      keyMap={keyMap as any}
31
      handlers={handlers as any}
32
      style={{ width: "100%", height: "100%" }}
33
    >
34
      {children}
35
    </HotKeys>
36
  )
37
})
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc