{ "version": 3, "sources": ["../../../../src/lib/tools/selection-logic/updateHoveredId.ts"], "sourcesContent": ["import { Editor, HIT_TEST_MARGIN, TLShape } from '@tldraw/editor'\n\nexport function updateHoveredId(editor: Editor) {\n\t// todo: consider replacing `get hoveredShapeId` with this; it would mean keeping hoveredShapeId in memory rather than in the store and possibly re-computing it more often than necessary\n\tconst hitShape = editor.getShapeAtPoint(editor.inputs.currentPagePoint, {\n\t\thitInside: false,\n\t\thitLabels: false,\n\t\tmargin: HIT_TEST_MARGIN / editor.zoomLevel,\n\t\trenderingOnly: true,\n\t})\n\n\tif (!hitShape) return editor.setHoveredShape(null)\n\n\tlet shapeToHover: TLShape | undefined = undefined\n\n\tconst outermostShape = editor.getOutermostSelectableShape(hitShape)\n\n\tif (outermostShape === hitShape) {\n\t\tshapeToHover = hitShape\n\t} else {\n\t\tif (\n\t\t\toutermostShape.id === editor.focusedGroupId ||\n\t\t\teditor.selectedShapeIds.includes(outermostShape.id)\n\t\t) {\n\t\t\tshapeToHover = hitShape\n\t\t} else {\n\t\t\tshapeToHover = outermostShape\n\t\t}\n\t}\n\n\treturn editor.setHoveredShape(shapeToHover.id)\n}\n"], "mappings": "AAAA,SAAiB,uBAAgC;AAE1C,SAAS,gBAAgB,QAAgB;AAE/C,QAAM,WAAW,OAAO,gBAAgB,OAAO,OAAO,kBAAkB;AAAA,IACvE,WAAW;AAAA,IACX,WAAW;AAAA,IACX,QAAQ,kBAAkB,OAAO;AAAA,IACjC,eAAe;AAAA,EAChB,CAAC;AAED,MAAI,CAAC;AAAU,WAAO,OAAO,gBAAgB,IAAI;AAEjD,MAAI,eAAoC;AAExC,QAAM,iBAAiB,OAAO,4BAA4B,QAAQ;AAElE,MAAI,mBAAmB,UAAU;AAChC,mBAAe;AAAA,EAChB,OAAO;AACN,QACC,eAAe,OAAO,OAAO,kBAC7B,OAAO,iBAAiB,SAAS,eAAe,EAAE,GACjD;AACD,qBAAe;AAAA,IAChB,OAAO;AACN,qBAAe;AAAA,IAChB;AAAA,EACD;AAEA,SAAO,OAAO,gBAAgB,aAAa,EAAE;AAC9C;", "names": [] }