{"version":3,"file":"ore.cjs","names":[],"sources":["../../src/core/ore.ts"],"sourcesContent":["// ── Ore adapter ─────────────────────────────────────────────────────────────\n// Utilities that bridge Ore's component lifecycle with Refine's core\n// primitives' `AbortSignal`-based lifecycle contract.\n\n/**\n * Creates an `AbortSignal` tied to the component's Ore lifecycle.\n *\n * Call once at the top of a `setup()` function and pass the resulting signal\n * as the required `signal` option to any stateful core primitive\n * (`createTextField`, `createCheckable`, `createListboxDropdown`, etc.).\n *\n * When Ore disconnects the component, `onCleanup` fires, aborting the\n * signal and triggering cleanup in every primitive that received it.\n *\n * @example\n * ```ts\n * setup(props, { el }) {\n *   const signal = lifecycleSignal(onCleanup);\n *   const tf = createTextField({ ..., signal });\n * }\n * ```\n */\nexport const lifecycleSignal = (onCleanup: (fn: () => void) => void): AbortSignal => {\n  const controller = new AbortController();\n\n  onCleanup(() => controller.abort());\n\n  return controller.signal;\n};\n"],"mappings":"AAsBA,IAAa,EAAmB,GAAqD,CACnF,IAAM,EAAa,IAAI,gBAIvB,OAFA,MAAgB,EAAW,MAAM,CAAC,EAE3B,EAAW,MACpB"}