(editor: Editor)
| 31 | const EDITOR_TO_TOOLBAR_STORE = new WeakMap<Editor, UseBoundStore<StoreApi<SlashToolbarState>>>() |
| 32 | |
| 33 | export const getSlashToolbarStore = (editor: Editor) => { |
| 34 | let store = EDITOR_TO_TOOLBAR_STORE.get(editor) |
| 35 | if (!store) { |
| 36 | store = create<SlashToolbarState>(() => ({ |
| 37 | items: [], |
| 38 | open: false, |
| 39 | searchValue: '', |
| 40 | })) |
| 41 | EDITOR_TO_TOOLBAR_STORE.set(editor, store) |
| 42 | } |
| 43 | return store |
| 44 | } |
| 45 | |
| 46 | export const SlashToolbar = { |
| 47 | setOpen(editor: Editor, open: boolean) { |
no test coverage detected
searching dependent graphs…