{ "version": 3, "sources": ["../../../../src/lib/tools/HandTool/HandTool.ts"], "sourcesContent": ["import { EASINGS, StateNode, TLClickEvent } from '@tldraw/editor'\nimport { Dragging } from './children/Dragging'\nimport { Idle } from './children/Idle'\nimport { Pointing } from './children/Pointing'\n\n/** @public */\nexport class HandTool extends StateNode {\n\tstatic override id = 'hand'\n\tstatic override initial = 'idle'\n\tstatic override children = () => [Idle, Pointing, Dragging]\n\n\toverride onDoubleClick: TLClickEvent = (info) => {\n\t\tif (info.phase === 'settle') {\n\t\t\tconst { currentScreenPoint } = this.editor.inputs\n\t\t\tthis.editor.zoomIn(currentScreenPoint, { duration: 220, easing: EASINGS.easeOutQuint })\n\t\t}\n\t}\n\n\toverride onTripleClick: TLClickEvent = (info) => {\n\t\tif (info.phase === 'settle') {\n\t\t\tconst { currentScreenPoint } = this.editor.inputs\n\t\t\tthis.editor.zoomOut(currentScreenPoint, { duration: 320, easing: EASINGS.easeOutQuint })\n\t\t}\n\t}\n\n\toverride onQuadrupleClick: TLClickEvent = (info) => {\n\t\tif (info.phase === 'settle') {\n\t\t\tconst {\n\t\t\t\tzoomLevel,\n\t\t\t\tinputs: { currentScreenPoint },\n\t\t\t} = this.editor\n\n\t\t\tif (zoomLevel === 1) {\n\t\t\t\tthis.editor.zoomToFit({ duration: 400, easing: EASINGS.easeOutQuint })\n\t\t\t} else {\n\t\t\t\tthis.editor.resetZoom(currentScreenPoint, { duration: 320, easing: EASINGS.easeOutQuint })\n\t\t\t}\n\t\t}\n\t}\n}\n"], "mappings": "AAAA,SAAS,SAAS,iBAA+B;AACjD,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAGlB,MAAM,iBAAiB,UAAU;AAAA,EACvC,OAAgB,KAAK;AAAA,EACrB,OAAgB,UAAU;AAAA,EAC1B,OAAgB,WAAW,MAAM,CAAC,MAAM,UAAU,QAAQ;AAAA,EAEjD,gBAA8B,CAAC,SAAS;AAChD,QAAI,KAAK,UAAU,UAAU;AAC5B,YAAM,EAAE,mBAAmB,IAAI,KAAK,OAAO;AAC3C,WAAK,OAAO,OAAO,oBAAoB,EAAE,UAAU,KAAK,QAAQ,QAAQ,aAAa,CAAC;AAAA,IACvF;AAAA,EACD;AAAA,EAES,gBAA8B,CAAC,SAAS;AAChD,QAAI,KAAK,UAAU,UAAU;AAC5B,YAAM,EAAE,mBAAmB,IAAI,KAAK,OAAO;AAC3C,WAAK,OAAO,QAAQ,oBAAoB,EAAE,UAAU,KAAK,QAAQ,QAAQ,aAAa,CAAC;AAAA,IACxF;AAAA,EACD;AAAA,EAES,mBAAiC,CAAC,SAAS;AACnD,QAAI,KAAK,UAAU,UAAU;AAC5B,YAAM;AAAA,QACL;AAAA,QACA,QAAQ,EAAE,mBAAmB;AAAA,MAC9B,IAAI,KAAK;AAET,UAAI,cAAc,GAAG;AACpB,aAAK,OAAO,UAAU,EAAE,UAAU,KAAK,QAAQ,QAAQ,aAAa,CAAC;AAAA,MACtE,OAAO;AACN,aAAK,OAAO,UAAU,oBAAoB,EAAE,UAAU,KAAK,QAAQ,QAAQ,aAAa,CAAC;AAAA,MAC1F;AAAA,IACD;AAAA,EACD;AACD;", "names": [] }