{ "version": 3, "sources": ["../../../../../src/lib/tools/ZoomTool/children/Pointing.ts"], "sourcesContent": ["import { StateNode, TLEventHandlers, TLPointerEventInfo } from '@tldraw/editor'\n\nexport class Pointing extends StateNode {\n\tstatic override id = 'pointing'\n\n\tinfo = {} as TLPointerEventInfo & { onInteractionEnd?: string }\n\n\toverride onEnter = (info: TLPointerEventInfo & { onInteractionEnd: string }) => {\n\t\tthis.info = info\n\t}\n\n\toverride onPointerUp: TLEventHandlers['onPointerUp'] = () => {\n\t\tthis.complete()\n\t}\n\n\toverride onPointerMove: TLEventHandlers['onPointerUp'] = () => {\n\t\tif (this.editor.inputs.isDragging) {\n\t\t\tthis.parent.transition('zoom_brushing', this.info)\n\t\t}\n\t}\n\n\toverride onCancel: TLEventHandlers['onCancel'] = () => {\n\t\tthis.cancel()\n\t}\n\n\tprivate complete() {\n\t\tconst { currentScreenPoint } = this.editor.inputs\n\t\tif (this.editor.inputs.altKey) {\n\t\t\tthis.editor.zoomOut(currentScreenPoint, { duration: 220 })\n\t\t} else {\n\t\t\tthis.editor.zoomIn(currentScreenPoint, { duration: 220 })\n\t\t}\n\t\tthis.parent.transition('idle', this.info)\n\t}\n\n\tprivate cancel() {\n\t\tthis.parent.transition('idle', this.info)\n\t}\n}\n"], "mappings": "AAAA,SAAS,iBAAsD;AAExD,MAAM,iBAAiB,UAAU;AAAA,EACvC,OAAgB,KAAK;AAAA,EAErB,OAAO,CAAC;AAAA,EAEC,UAAU,CAAC,SAA4D;AAC/E,SAAK,OAAO;AAAA,EACb;AAAA,EAES,cAA8C,MAAM;AAC5D,SAAK,SAAS;AAAA,EACf;AAAA,EAES,gBAAgD,MAAM;AAC9D,QAAI,KAAK,OAAO,OAAO,YAAY;AAClC,WAAK,OAAO,WAAW,iBAAiB,KAAK,IAAI;AAAA,IAClD;AAAA,EACD;AAAA,EAES,WAAwC,MAAM;AACtD,SAAK,OAAO;AAAA,EACb;AAAA,EAEQ,WAAW;AAClB,UAAM,EAAE,mBAAmB,IAAI,KAAK,OAAO;AAC3C,QAAI,KAAK,OAAO,OAAO,QAAQ;AAC9B,WAAK,OAAO,QAAQ,oBAAoB,EAAE,UAAU,IAAI,CAAC;AAAA,IAC1D,OAAO;AACN,WAAK,OAAO,OAAO,oBAAoB,EAAE,UAAU,IAAI,CAAC;AAAA,IACzD;AACA,SAAK,OAAO,WAAW,QAAQ,KAAK,IAAI;AAAA,EACzC;AAAA,EAEQ,SAAS;AAChB,SAAK,OAAO,WAAW,QAAQ,KAAK,IAAI;AAAA,EACzC;AACD;", "names": [] }