Skip to content

Commit 62b9da3

Browse files
authored
Default options and the GrapesJS commands are now exposed (#6)
1 parent 48211de commit 62b9da3

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { Editor } from 'grapesjs'
22
import { KeymapsDialogManager } from './KeymapsDialogManager'
33

4-
const cmdKeymapsDialog = 'open-keymaps-dialog'
4+
export const cmdKeymapsDialog = 'open-keymaps-dialog'
5+
6+
export const defaultOptions = {
7+
longPressKey: 'shift',
8+
longPressDuration: 800,
9+
shortcut: 'shift+k',
10+
css: null
11+
}
512

613
export default (editor: Editor, opts = {}): void => {
714
const options = {
8-
...{
9-
longPressKey: 'shift',
10-
longPressDuration: 800,
11-
shortcut: 'shift+k',
12-
css: null
13-
}, ...opts
15+
...defaultOptions,
16+
...opts
1417
}
1518

1619
const manager = new KeymapsDialogManager(editor, options)

0 commit comments

Comments
 (0)