a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add ident and outdent to non text blocks

+11
+11
components/Blocks/index.tsx
··· 17 17 import { scanIndex } from "src/replicache/utils"; 18 18 import { v7 } from "uuid"; 19 19 import { useBlockMouseHandlers } from "./useBlockMouseHandlers"; 20 + import { indent, outdent } from "src/utils/list-operations"; 20 21 export type Block = { 21 22 factID: string; 22 23 parent: string; ··· 232 233 let r = rep; 233 234 let listener = async (e: KeyboardEvent) => { 234 235 if (e.defaultPrevented) return; 236 + if (e.key === "Tab") { 237 + if (textBlocks[props.type]) return; 238 + if (e.shiftKey) { 239 + e.preventDefault(); 240 + outdent(props, props.previousBlock, rep); 241 + } else { 242 + e.preventDefault(); 243 + if (props.previousBlock) indent(props, props.previousBlock, rep); 244 + } 245 + } 235 246 if (e.key === "ArrowDown") { 236 247 e.preventDefault(); 237 248 let block = props.nextBlock;