a tool for shared writing and social publishing
0
fork

Configure Feed

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

fixed bug where placeholder wasn't showing up on new cards, adjusted spacing on placeholder and block options that was wonky due to changes in where padding is

celine 1f380575 df58789c

+21 -14
+5 -1
components/BlockOptions.tsx
··· 22 22 position: string | null; 23 23 nextPosition: string | null; 24 24 factID?: string | undefined; 25 + first?: boolean; 25 26 }; 26 27 export function BlockOptions(props: Props) { 27 28 let { rep } = useReplicache(); ··· 34 35 : focusedElement?.parent; 35 36 36 37 return ( 37 - <div className="blockOptionsWrapper absolute top-0 right-2 sm:right-3 hidden sm:group-hover/text:block group-focus-within/text:block"> 38 + <div 39 + className={`blockOptionsWrapper sm:group-hover/text:block group-focus-within/text:block hidden 40 + absolute right-2 sm:right-3 ${props.first ? "top-2 sm:top-3" : "top-1"}`} 41 + > 38 42 <div className="blockOptionsContent flex gap-1 items-center"> 39 43 <label 40 44 className="blockOptionsImage hover:cursor-pointer flex place-items-center"
+14 -12
components/Blocks.tsx
··· 72 72 /> 73 73 ); 74 74 })} 75 - {blocks.length > 1 && ( 76 - <NewBlockButton 77 - lastBlock={lastBlock || null} 78 - entityID={props.entityID} 79 - /> 80 - )} 75 + <NewBlockButton lastBlock={lastBlock || null} entityID={props.entityID} /> 81 76 <div 82 77 className="shrink-0 h-[50vh]" 83 78 onClick={() => { ··· 109 104 function NewBlockButton(props: { lastBlock: Block | null; entityID: string }) { 110 105 let { rep } = useReplicache(); 111 106 let entity_set = useEntitySetContext(); 112 - let textContent = useEntity( 113 - props.lastBlock?.type === "text" ? props.lastBlock.value : null, 114 - "block/text", 107 + let editorState = useEditorStates((s) => 108 + props.lastBlock?.type === "text" 109 + ? s.editorStates[props.lastBlock.value] 110 + : null, 115 111 ); 116 112 if (!entity_set.permissions.write) return null; 113 + console.log(editorState?.editor.doc.content.size); 117 114 if ( 118 115 props.lastBlock?.type === "text" && 119 - (!textContent || textContent.data.value === "") 116 + (!editorState?.editor || editorState.editor.doc.content.size <= 2) 120 117 ) 121 118 return null; 122 119 return ( 123 - <div className="relative group/text px-2 sm:px-3"> 120 + <div className="relative group/text px-2 sm:px-3 bg-test"> 124 121 <div 125 122 className="h-6 hover:cursor-text italic text-tertiary" 126 123 onMouseDown={async () => { ··· 141 138 }, 10); 142 139 }} 143 140 > 144 - {!props.lastBlock ? "write something..." : " "} 141 + {!props.lastBlock ? ( 142 + <div className="pt-2 sm:pt-3">write something...</div> 143 + ) : ( 144 + " " 145 + )} 145 146 </div> 146 147 <BlockOptions 147 148 parent={props.entityID} 148 149 entityID={null} 149 150 position={props.lastBlock?.position || null} 150 151 nextPosition={null} 152 + first={!props.lastBlock} 151 153 /> 152 154 </div> 153 155 );
+2 -1
components/TextBlock/index.tsx
··· 251 251 props.position === "a0" && 252 252 props.nextBlock === null && ( 253 253 <div 254 - className={`${props.type === "heading" ? HeadingStyle[headingLevel?.data.value || 1] : ""} pointer-events-none absolute top-0 left-0 px-2 sm:px-3 pb-2 italic text-tertiary `} 254 + className={`${props.type === "heading" ? HeadingStyle[headingLevel?.data.value || 1] : ""} pointer-events-none absolute top-0 left-0 px-2 sm:px-3 pt-2 sm:pt-3 pb-2 italic text-tertiary `} 255 255 > 256 256 write something... 257 257 </div> ··· 263 263 parent={props.parent} 264 264 position={props.position} 265 265 nextPosition={props.nextPosition} 266 + first={first} 266 267 /> 267 268 )} 268 269 <SyncView entityID={props.entityID} parentID={props.parent} />