···22- it looks good on both mobile and desktop
33- it undo's like it ought to
44- it handles keyboard interactions reasonably well
55-- it behaves as you would expect if you lock it
65- no build errors!!!
+2-31
components/Blocks/Block.tsx
···334334 let isSelected = useUIState((s) =>
335335 s.selectedBlocks.find((b) => b.value === props.entityID),
336336 );
337337- let isLocked = useEntity(props.value, "block/is-locked");
338337339338 let nextBlockSelected = useUIState((s) =>
340339 s.selectedBlocks.find((b) => b.value === props.nextBlock?.value),
···343342 s.selectedBlocks.find((b) => b.value === props.previousBlock?.value),
344343 );
345344346346- if (isMultiselected || (isLocked?.data.value && isSelected))
347347- // not sure what multiselected and selected classes are doing (?)
348348- // use a hashed pattern for locked things. show this pattern if the block is selected, even if it isn't multiselected
349349-345345+ if (isMultiselected)
350346 return (
351347 <>
352348 <div
···359355 ${!prevBlockSelected && "rounded-t-md"}
360356 ${!nextBlockSelected && "rounded-b-md"}
361357 `}
362362- style={
363363- isLocked?.data.value
364364- ? {
365365- maskImage: "var(--hatchSVG)",
366366- maskRepeat: "repeat repeat",
367367- }
368368- : {}
369369- }
370370- ></div>
371371- {isLocked?.data.value && (
372372- <div
373373- className={`
374374- blockSelectionLockIndicator z-10
375375- flex items-center
376376- text-border rounded-full
377377- absolute right-3
378378-379379- ${
380380- props.type === "heading" || props.type === "text"
381381- ? "top-[6px]"
382382- : "top-0"
383383- }`}
384384- >
385385- <LockTiny className="bg-bg-page p-0.5 rounded-full w-5 h-5" />
386386- </div>
387387- )}
358358+ />
388359 </>
389360 );
390361};