{"version":3,"sources":["../../lib/cjs.ts"],"sourcesContent":["// Package entry point.\n//\n// This re-exports <Draggable> as the *default* export and <DraggableCore> as a\n// named export. That is the correct shape for the ESM (`module`) build and for\n// the auto-generated TypeScript declaration.\n//\n// ──────────────────────────────────────────────────────────────────────────\n// CRITICAL CJS COMPAT CONTRACT — read before changing the build (contract #1):\n//\n// Historically (PR #254, issue #266) the *root* CJS export of this package IS\n// the Draggable class itself, not a namespace object. All three of these access\n// patterns are part of the public contract and MUST keep working in the\n// CommonJS artifact (build/cjs):\n//\n//     const Draggable = require('react-draggable');             // === Draggable class\n//     const Draggable = require('react-draggable').default;     // === Draggable class\n//     const { DraggableCore } = require('react-draggable');     // === DraggableCore class\n//\n// i.e. the built CJS file must satisfy at runtime:\n//     module.exports                === Draggable\n//     module.exports.default        === Draggable\n//     module.exports.DraggableCore  === DraggableCore\n//\n// A naive ESM `export default Draggable` compiled to CJS produces\n// `exports.default = Draggable` but does NOT make `module.exports === Draggable`,\n// which BREAKS every existing `require('react-draggable')` consumer.\n//\n// The BUILD PHASE owns the final reconciliation. tsup/tsc will likely NOT\n// reproduce `module.exports === Draggable` from the ESM re-exports below, so the\n// CJS output must be patched to the legacy shape — either via a hand-written CJS\n// interop entry equivalent to the old lib/cjs.js:\n//\n//     const { default: Draggable, DraggableCore } = require('./Draggable');\n//     module.exports = Draggable;\n//     module.exports.default = Draggable;\n//     module.exports.DraggableCore = DraggableCore;\n//\n// or a tsup footer/onSuccess step that rewrites module.exports accordingly.\n// Verify with a runtime `require()` assertion that all three identities above\n// hold before shipping.\n//\n// References:\n//   https://github.com/mzabriskie/react-draggable/pull/254\n//   https://github.com/mzabriskie/react-draggable/issues/266\n// ──────────────────────────────────────────────────────────────────────────\n\nimport Draggable, {DraggableCore} from './Draggable';\n\nexport default Draggable;\nexport {DraggableCore};\n\n// Re-export the public type surface so the auto-generated declaration is\n// API-compatible with the historical hand-written typings/index.d.ts. The old\n// typings exposed these names; consumers `import type { ... } from 'react-draggable'`.\nexport type {DraggableProps} from './Draggable';\nexport type {\n  DraggableCoreProps,\n  DraggableData,\n  DraggableEventHandler,\n  ControlPosition,\n  PositionOffsetControlPosition,\n} from './DraggableCore';\n// `DraggableBounds` was the public name for the internal `Bounds` type.\n// `DraggableEvent` is the public event union (defined in ./utils/types alongside\n// the other public types — see the note there on why it must stay a union).\nexport type {Bounds as DraggableBounds, DraggableEvent} from './utils/types';\n"],"mappings":";;;;;;AAgDA,IAAO,cAAQ;","names":[]}