Peng Xiao 3 лет назад
Родитель
Сommit
f6a70df284

+ 1 - 0
src/main/frontend/components/block.cljs

@@ -2247,6 +2247,7 @@
         block-el-id (str "ls-block-" blocks-container-id "-" uuid)
         block-el-id (str "ls-block-" blocks-container-id "-" uuid)
         config {:id (str uuid)
         config {:id (str uuid)
                 :db/id (:db/id block-entity)
                 :db/id (:db/id block-entity)
+                :block/uuid uuid
                 :block? true
                 :block? true
                 :editor-box (state/get-component :editor/box)}
                 :editor-box (state/get-component :editor/box)}
         edit-input-id (str "edit-block-" blocks-container-id "-" uuid)
         edit-input-id (str "edit-block-" blocks-container-id "-" uuid)

+ 1 - 1
tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx

@@ -792,7 +792,7 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
 
 
   ReactIndicator = observer(() => {
   ReactIndicator = observer(() => {
     const bounds = this.getBounds()
     const bounds = this.getBounds()
-    return <rect width={bounds.width} height={bounds.height} fill="transparent" />
+    return <rect width={bounds.width} height={bounds.height} fill="transparent" stroke="none" />
   })
   })
 
 
   validateProps = (props: Partial<LogseqPortalShapeProps>) => {
   validateProps = (props: Partial<LogseqPortalShapeProps>) => {

+ 10 - 2
tldraw/packages/react/src/components/ui/SelectionForeground/SelectionForeground.tsx

@@ -14,7 +14,7 @@ export const SelectionForeground = observer(function SelectionForeground<S exten
   shapes,
   shapes,
 }: TLSelectionComponentProps<S>) {
 }: TLSelectionComponentProps<S>) {
   const app = useApp()
   const app = useApp()
-  const { width, height } = bounds
+  let { width, height } = bounds
   const zoom = app.viewport.camera.zoom
   const zoom = app.viewport.camera.zoom
 
 
   const size = 8 / zoom
   const size = 8 / zoom
@@ -22,12 +22,20 @@ export const SelectionForeground = observer(function SelectionForeground<S exten
 
 
   const canResize = shapes.length === 1 ? shapes[0].canResize : [true, true]
   const canResize = shapes.length === 1 ? shapes[0].canResize : [true, true]
 
 
+  const editing = !!app.editingShape
+
+  // when editing, make the selection a bit larger
+  width = editing ? width + 2 : width
+  height = editing ? height + 2 : height
+
   return (
   return (
-    <SVGContainer>
+    <SVGContainer style={{ transform: editing ? 'translate(-1px, -1px)' : 'none' }}>
       <rect
       <rect
         className="tl-bounds-fg"
         className="tl-bounds-fg"
         width={Math.max(width, 1)}
         width={Math.max(width, 1)}
         height={Math.max(height, 1)}
         height={Math.max(height, 1)}
+        rx={editing ? 4 : 0}
+        ry={editing ? 4 : 0}
         pointerEvents="none"
         pointerEvents="none"
       />
       />
       <EdgeHandle
       <EdgeHandle