heartbeat-monitor/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map

1 line
3.1 KiB
Plaintext

{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/drag/index.ts"],"sourcesContent":["import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature<HTMLElement> {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement<HTMLElement>) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n"],"names":[],"mappings":";;;;AAIM,MAAO,WAAY,SAAQ,OAAoB,CAAA;AAMjD,IAAA,WAAA,CAAY,IAAgC,EAAA;QACxC,KAAK,CAAC,IAAI,CAAC,CAAA;QAJf,IAAmB,CAAA,mBAAA,GAAa,IAAI,CAAA;QACpC,IAAe,CAAA,eAAA,GAAa,IAAI,CAAA;QAI5B,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAyB,CAA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