a tool for shared writing and social publishing

closing default toolbar or hitting esc in a text block sends focus back to top leel card

+10 -1
+9 -1
components/TextBlock/keymap.ts
··· 10 10 import { schema } from "./schema"; 11 11 import { useUIState } from "src/useUIState"; 12 12 import { setEditorState, useEditorStates } from "src/state/useEditorState"; 13 + import { focusCard } from "components/Cards"; 13 14 14 15 export const TextBlockKeymap = ( 15 16 propsRef: MutableRefObject<BlockProps>, ··· 24 25 25 26 Escape: (_state, _dispatch, view) => { 26 27 view?.dom.blur(); 28 + useUIState.setState(() => ({ 29 + focusedBlock: { 30 + type: "card", 31 + entityID: propsRef.current.parent, 32 + }, 33 + selectedBlock: [], 34 + })); 27 35 28 - return true; 36 + return false; 29 37 }, 30 38 "#": (state, dispatch, view) => { 31 39 if (state.selection.content().size > 0) return false;
+1
components/Toolbar/index.tsx
··· 191 191 type: "card", 192 192 entityID: props.cardID, 193 193 }, 194 + selectedBlock: [], 194 195 })); 195 196 } else { 196 197 setToolbarState("default");