@hyperfixi/behaviors 3.3.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/CHANGELOG.md +199 -1
  2. package/README.md +29 -9
  3. package/dist/all.browser.global.js +45 -100
  4. package/dist/all.browser.global.js.map +1 -1
  5. package/dist/autodismiss.browser.global.js +5 -11
  6. package/dist/autodismiss.browser.global.js.map +1 -1
  7. package/dist/behaviors/autodismiss.cjs +19 -22
  8. package/dist/behaviors/autodismiss.cjs.map +1 -1
  9. package/dist/behaviors/autodismiss.d.cts +4 -4
  10. package/dist/behaviors/autodismiss.d.ts +4 -4
  11. package/dist/behaviors/autodismiss.js +3 -3
  12. package/dist/behaviors/clickoutside.cjs +19 -18
  13. package/dist/behaviors/clickoutside.cjs.map +1 -1
  14. package/dist/behaviors/clickoutside.d.cts +4 -4
  15. package/dist/behaviors/clickoutside.d.ts +4 -4
  16. package/dist/behaviors/clickoutside.js +3 -3
  17. package/dist/behaviors/clipboard.cjs +18 -19
  18. package/dist/behaviors/clipboard.cjs.map +1 -1
  19. package/dist/behaviors/clipboard.d.cts +4 -4
  20. package/dist/behaviors/clipboard.d.ts +4 -4
  21. package/dist/behaviors/clipboard.js +3 -3
  22. package/dist/behaviors/draggable.cjs +20 -25
  23. package/dist/behaviors/draggable.cjs.map +1 -1
  24. package/dist/behaviors/draggable.d.cts +4 -4
  25. package/dist/behaviors/draggable.d.ts +4 -4
  26. package/dist/behaviors/draggable.js +3 -3
  27. package/dist/behaviors/focustrap.cjs +18 -19
  28. package/dist/behaviors/focustrap.cjs.map +1 -1
  29. package/dist/behaviors/focustrap.d.cts +4 -4
  30. package/dist/behaviors/focustrap.d.ts +4 -4
  31. package/dist/behaviors/focustrap.js +3 -3
  32. package/dist/behaviors/removable.cjs +18 -21
  33. package/dist/behaviors/removable.cjs.map +1 -1
  34. package/dist/behaviors/removable.d.cts +4 -3
  35. package/dist/behaviors/removable.d.ts +4 -3
  36. package/dist/behaviors/removable.js +3 -3
  37. package/dist/behaviors/resizable.cjs +19 -19
  38. package/dist/behaviors/resizable.cjs.map +1 -1
  39. package/dist/behaviors/resizable.d.cts +4 -4
  40. package/dist/behaviors/resizable.d.ts +4 -4
  41. package/dist/behaviors/resizable.js +3 -3
  42. package/dist/behaviors/scrollreveal.cjs +19 -22
  43. package/dist/behaviors/scrollreveal.cjs.map +1 -1
  44. package/dist/behaviors/scrollreveal.d.cts +4 -4
  45. package/dist/behaviors/scrollreveal.d.ts +4 -4
  46. package/dist/behaviors/scrollreveal.js +3 -3
  47. package/dist/behaviors/sortable.cjs +19 -20
  48. package/dist/behaviors/sortable.cjs.map +1 -1
  49. package/dist/behaviors/sortable.d.cts +4 -4
  50. package/dist/behaviors/sortable.d.ts +4 -4
  51. package/dist/behaviors/sortable.js +3 -3
  52. package/dist/behaviors/tabs.cjs +20 -25
  53. package/dist/behaviors/tabs.cjs.map +1 -1
  54. package/dist/behaviors/tabs.d.cts +4 -4
  55. package/dist/behaviors/tabs.d.ts +4 -4
  56. package/dist/behaviors/tabs.js +3 -3
  57. package/dist/behaviors/toggleable.cjs +25 -26
  58. package/dist/behaviors/toggleable.cjs.map +1 -1
  59. package/dist/behaviors/toggleable.d.cts +4 -4
  60. package/dist/behaviors/toggleable.d.ts +4 -4
  61. package/dist/behaviors/toggleable.js +3 -3
  62. package/dist/chunk-2GIS4DCY.js +30 -0
  63. package/dist/chunk-2GIS4DCY.js.map +1 -0
  64. package/dist/chunk-3BCBZR6R.js +30 -0
  65. package/dist/chunk-3BCBZR6R.js.map +1 -0
  66. package/dist/chunk-4YUIDZAO.js +30 -0
  67. package/dist/chunk-4YUIDZAO.js.map +1 -0
  68. package/dist/{chunk-XYZ7FOXJ.js → chunk-AQCOK5J5.js} +10 -14
  69. package/dist/chunk-AQCOK5J5.js.map +1 -0
  70. package/dist/chunk-ATGHQQC7.js +30 -0
  71. package/dist/chunk-ATGHQQC7.js.map +1 -0
  72. package/dist/{chunk-HQDYH45I.js → chunk-CWLAXLWR.js} +5 -13
  73. package/dist/chunk-CWLAXLWR.js.map +1 -0
  74. package/dist/chunk-DMWN52SV.js +30 -0
  75. package/dist/chunk-DMWN52SV.js.map +1 -0
  76. package/dist/{chunk-PDMOOWFW.js → chunk-EIVPVTUI.js} +4 -8
  77. package/dist/{chunk-PDMOOWFW.js.map → chunk-EIVPVTUI.js.map} +1 -1
  78. package/dist/chunk-HHTEMPIT.js +30 -0
  79. package/dist/chunk-HHTEMPIT.js.map +1 -0
  80. package/dist/{chunk-26IX7QU7.js → chunk-HJESSMKB.js} +4 -6
  81. package/dist/{chunk-26IX7QU7.js.map → chunk-HJESSMKB.js.map} +1 -1
  82. package/dist/{chunk-5S7WN3ZQ.js → chunk-IFAH652L.js} +4 -7
  83. package/dist/chunk-IFAH652L.js.map +1 -0
  84. package/dist/chunk-IUGJG4RA.js +30 -0
  85. package/dist/chunk-IUGJG4RA.js.map +1 -0
  86. package/dist/{chunk-ZR66E3T6.js → chunk-JNLVXPHR.js} +13 -13
  87. package/dist/chunk-KEZEGPEX.js +30 -0
  88. package/dist/chunk-KEZEGPEX.js.map +1 -0
  89. package/dist/{chunk-66U2RSYJ.js → chunk-KP4GNXYS.js} +4 -10
  90. package/dist/chunk-KP4GNXYS.js.map +1 -0
  91. package/dist/chunk-KXQMCN4O.js +30 -0
  92. package/dist/chunk-KXQMCN4O.js.map +1 -0
  93. package/dist/{chunk-YXS27XM6.js → chunk-KYBOZ7C4.js} +3 -7
  94. package/dist/chunk-KYBOZ7C4.js.map +1 -0
  95. package/dist/chunk-LBWM6TTU.js +30 -0
  96. package/dist/chunk-LBWM6TTU.js.map +1 -0
  97. package/dist/{chunk-3DVDS7CT.js → chunk-LCDONZBX.js} +5 -5
  98. package/dist/chunk-LCDONZBX.js.map +1 -0
  99. package/dist/{chunk-OJ3YWO3W.js → chunk-NE76IBV2.js} +3 -7
  100. package/dist/chunk-NE76IBV2.js.map +1 -0
  101. package/dist/{chunk-HMU342XE.js → chunk-PVO6TZCZ.js} +3 -9
  102. package/dist/{chunk-HMU342XE.js.map → chunk-PVO6TZCZ.js.map} +1 -1
  103. package/dist/{chunk-URZGNPTQ.js → chunk-RILYRQ72.js} +4 -10
  104. package/dist/chunk-RILYRQ72.js.map +1 -0
  105. package/dist/{chunk-FBQ3X3UY.js → chunk-U4QMFVAM.js} +5 -13
  106. package/dist/chunk-U4QMFVAM.js.map +1 -0
  107. package/dist/chunk-VWDTOSE3.js +26 -0
  108. package/dist/chunk-VWDTOSE3.js.map +1 -0
  109. package/dist/chunk-YRQBU2OW.js +30 -0
  110. package/dist/chunk-YRQBU2OW.js.map +1 -0
  111. package/dist/clickoutside.browser.global.js +5 -7
  112. package/dist/clickoutside.browser.global.js.map +1 -1
  113. package/dist/clipboard.browser.global.js +4 -8
  114. package/dist/clipboard.browser.global.js.map +1 -1
  115. package/dist/core.browser.global.js +13 -25
  116. package/dist/core.browser.global.js.map +1 -1
  117. package/dist/draggable.browser.global.js +5 -13
  118. package/dist/draggable.browser.global.js.map +1 -1
  119. package/dist/focustrap.browser.global.js +4 -8
  120. package/dist/focustrap.browser.global.js.map +1 -1
  121. package/dist/index.cjs +96 -271
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.d.cts +10 -10
  124. package/dist/index.d.ts +10 -10
  125. package/dist/index.js +42 -55
  126. package/dist/index.js.map +1 -1
  127. package/dist/loaders.cjs +75 -237
  128. package/dist/loaders.cjs.map +1 -1
  129. package/dist/loaders.js +13 -13
  130. package/dist/registry.cjs +4 -4
  131. package/dist/registry.cjs.map +1 -1
  132. package/dist/registry.d.cts +5 -6
  133. package/dist/registry.d.ts +5 -6
  134. package/dist/registry.js +1 -1
  135. package/dist/removable.browser.global.js +3 -9
  136. package/dist/removable.browser.global.js.map +1 -1
  137. package/dist/resizable.browser.global.js +4 -7
  138. package/dist/resizable.browser.global.js.map +1 -1
  139. package/dist/resolver.browser.global.js +45 -100
  140. package/dist/resolver.browser.global.js.map +1 -1
  141. package/dist/schemas/index.cjs +38 -93
  142. package/dist/schemas/index.cjs.map +1 -1
  143. package/dist/schemas/index.d.cts +2 -2
  144. package/dist/schemas/index.d.ts +2 -2
  145. package/dist/schemas/index.js +11 -11
  146. package/dist/schemas/index.js.map +1 -1
  147. package/dist/scrollreveal.browser.global.js +5 -11
  148. package/dist/scrollreveal.browser.global.js.map +1 -1
  149. package/dist/sortable.browser.global.js +5 -9
  150. package/dist/sortable.browser.global.js.map +1 -1
  151. package/dist/tabs.browser.global.js +6 -14
  152. package/dist/tabs.browser.global.js.map +1 -1
  153. package/dist/toggleable.browser.global.js +9 -13
  154. package/dist/toggleable.browser.global.js.map +1 -1
  155. package/dist/{types-DCCtVQS5.d.cts → types-CbA4L8XJ.d.cts} +16 -23
  156. package/dist/{types-DCCtVQS5.d.ts → types-CbA4L8XJ.d.ts} +16 -23
  157. package/package.json +5 -5
  158. package/src/behavior-resolver.ts +24 -56
  159. package/src/behaviors/autodismiss.test.ts +12 -20
  160. package/src/behaviors/autodismiss.ts +8 -23
  161. package/src/behaviors/clickoutside.test.ts +13 -21
  162. package/src/behaviors/clickoutside.ts +8 -23
  163. package/src/behaviors/clipboard.test.ts +12 -34
  164. package/src/behaviors/clipboard.ts +8 -23
  165. package/src/behaviors/curated-runtime.test.ts +22 -24
  166. package/src/behaviors/draggable.ts +10 -24
  167. package/src/behaviors/experimental-runtime.test.ts +19 -18
  168. package/src/behaviors/focustrap.test.ts +12 -20
  169. package/src/behaviors/focustrap.ts +8 -23
  170. package/src/behaviors/integration.test.ts +19 -54
  171. package/src/behaviors/optional-runtime.test.ts +17 -22
  172. package/src/behaviors/removable.ts +6 -20
  173. package/src/behaviors/resizable.ts +9 -24
  174. package/src/behaviors/scrollreveal.test.ts +13 -21
  175. package/src/behaviors/scrollreveal.ts +8 -23
  176. package/src/behaviors/sortable.ts +7 -22
  177. package/src/behaviors/tabs.test.ts +12 -34
  178. package/src/behaviors/tabs.ts +8 -23
  179. package/src/behaviors/toggleable.ts +10 -26
  180. package/src/browser-resolver-bundle.ts +20 -30
  181. package/src/core-bundle.ts +11 -11
  182. package/src/index.test.ts +2 -2
  183. package/src/index.ts +30 -47
  184. package/src/registry.test.ts +9 -34
  185. package/src/registry.ts +7 -11
  186. package/src/schemas/autodismiss.schema.ts +3 -9
  187. package/src/schemas/clickoutside.schema.ts +3 -5
  188. package/src/schemas/clipboard.schema.ts +2 -6
  189. package/src/schemas/draggable.schema.ts +4 -12
  190. package/src/schemas/focustrap.schema.ts +2 -6
  191. package/src/schemas/index.ts +2 -1
  192. package/src/schemas/removable.schema.ts +2 -8
  193. package/src/schemas/resizable.schema.ts +3 -6
  194. package/src/schemas/scrollreveal.schema.ts +3 -9
  195. package/src/schemas/sortable.schema.ts +3 -7
  196. package/src/schemas/tabs.schema.ts +4 -12
  197. package/src/schemas/toggleable.schema.ts +10 -13
  198. package/src/schemas/types.ts +37 -30
  199. package/dist/chunk-2HUF6RMI.js +0 -40
  200. package/dist/chunk-2HUF6RMI.js.map +0 -1
  201. package/dist/chunk-3DVDS7CT.js.map +0 -1
  202. package/dist/chunk-5S7WN3ZQ.js.map +0 -1
  203. package/dist/chunk-66U2RSYJ.js.map +0 -1
  204. package/dist/chunk-6TJXDCAQ.js +0 -11
  205. package/dist/chunk-6TJXDCAQ.js.map +0 -1
  206. package/dist/chunk-7TPDLB7W.js +0 -40
  207. package/dist/chunk-7TPDLB7W.js.map +0 -1
  208. package/dist/chunk-CR3J7VV6.js +0 -40
  209. package/dist/chunk-CR3J7VV6.js.map +0 -1
  210. package/dist/chunk-EDBG2F57.js +0 -40
  211. package/dist/chunk-EDBG2F57.js.map +0 -1
  212. package/dist/chunk-FBQ3X3UY.js.map +0 -1
  213. package/dist/chunk-HQDYH45I.js.map +0 -1
  214. package/dist/chunk-HX663BJ4.js +0 -40
  215. package/dist/chunk-HX663BJ4.js.map +0 -1
  216. package/dist/chunk-KROW43CG.js +0 -40
  217. package/dist/chunk-KROW43CG.js.map +0 -1
  218. package/dist/chunk-L52AGCMP.js +0 -40
  219. package/dist/chunk-L52AGCMP.js.map +0 -1
  220. package/dist/chunk-MTI5PSRH.js +0 -40
  221. package/dist/chunk-MTI5PSRH.js.map +0 -1
  222. package/dist/chunk-OJ3YWO3W.js.map +0 -1
  223. package/dist/chunk-ORBJ7MRW.js +0 -40
  224. package/dist/chunk-ORBJ7MRW.js.map +0 -1
  225. package/dist/chunk-SLSCZV4A.js +0 -40
  226. package/dist/chunk-SLSCZV4A.js.map +0 -1
  227. package/dist/chunk-URZGNPTQ.js.map +0 -1
  228. package/dist/chunk-WKBRZGGL.js +0 -40
  229. package/dist/chunk-WKBRZGGL.js.map +0 -1
  230. package/dist/chunk-XYZ7FOXJ.js.map +0 -1
  231. package/dist/chunk-YXS27XM6.js.map +0 -1
  232. /package/dist/{chunk-ZR66E3T6.js.map → chunk-JNLVXPHR.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/draggable.schema.ts","../src/schemas/types.ts","../src/behaviors/draggable.ts","../src/schemas/removable.schema.ts","../src/behaviors/removable.ts","../src/schemas/toggleable.schema.ts","../src/behaviors/toggleable.ts","../src/schemas/sortable.schema.ts","../src/behaviors/sortable.ts","../src/schemas/resizable.schema.ts","../src/behaviors/resizable.ts","../src/schemas/clipboard.schema.ts","../src/behaviors/clipboard.ts","../src/schemas/autodismiss.schema.ts","../src/behaviors/autodismiss.ts","../src/schemas/clickoutside.schema.ts","../src/behaviors/clickoutside.ts","../src/schemas/focustrap.schema.ts","../src/behaviors/focustrap.ts","../src/schemas/scrollreveal.schema.ts","../src/behaviors/scrollreveal.ts","../src/schemas/tabs.schema.ts","../src/behaviors/tabs.ts","../src/index.ts","../src/registry.ts","../src/loaders.ts","../src/generated/metadata.ts","../src/curation.ts"],"sourcesContent":["import type { BehaviorSchema } from './types';\n\n/**\n * Draggable Behavior Schema\n *\n * Makes elements draggable with pointer events.\n * Supports custom drag handles and lifecycle events.\n */\nexport const draggableSchema: BehaviorSchema = {\n name: 'Draggable',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description:\n 'Makes elements draggable with pointer events (EXPERIMENTAL — stateful async component, beyond the inline-scripting boundary; not part of the curated set)',\n parameters: [\n {\n name: 'dragHandle',\n type: 'selector',\n optional: true,\n default: 'me',\n description: 'CSS selector for the drag handle element',\n },\n ],\n events: [\n { name: 'draggable:start', description: 'Fired when drag begins' },\n { name: 'draggable:move', description: 'Fired during each movement' },\n { name: 'draggable:end', description: 'Fired when drag completes' },\n ],\n requirements: ['position: absolute or position: fixed on the element'],\n source: `\nbehavior Draggable(dragHandle)\n init\n if no dragHandle set dragHandle to me\n end\n on pointerdown(clientX, clientY) from dragHandle\n halt the event\n trigger draggable:start\n measure x\n set startX to it\n measure y\n set startY to it\n set xoff to clientX - startX\n set yoff to clientY - startY\n repeat until event pointerup from document\n wait for pointermove(clientX, clientY) or\n pointerup(clientX, clientY) from document\n add { left: \\${clientX - xoff}px; top: \\${clientY - yoff}px; }\n trigger draggable:move\n end\n trigger draggable:end\n end\nend\n`.trim(),\n};\n","/**\n * Behavior Schema Types\n *\n * Defines the structure for behavior metadata used for:\n * - Code generation (TypeScript types, documentation)\n * - Runtime categorization and lazy loading\n * - Tooling and IDE integration\n */\n\n/**\n * Behavior categories for organization.\n * - ui: Visual interaction behaviors (drag, resize, sort)\n * - data: Data manipulation behaviors (remove, transform)\n * - animation: Animation and transition behaviors\n * - form: Form-related behaviors (validation, toggle states)\n * - layout: Layout behaviors (sticky, scrollspy)\n */\nexport type BehaviorCategory = 'ui' | 'data' | 'animation' | 'form' | 'layout';\n\n/**\n * Loading tiers for lazy loading optimization.\n * - core: Always loaded (essential behaviors)\n * - common: High usage (loaded for typical apps)\n * - optional: Low usage (loaded on demand)\n */\nexport type BehaviorTier = 'core' | 'common' | 'optional';\n\n/**\n * Schema for a behavior parameter.\n */\nexport interface ParameterSchema {\n name: string;\n type: 'string' | 'number' | 'boolean' | 'selector' | 'element';\n optional?: boolean;\n default?: string | number | boolean;\n /** Allowed values for constrained parameters */\n enum?: string[];\n description: string;\n}\n\n/**\n * Schema for a behavior event.\n */\nexport interface EventSchema {\n name: string;\n description: string;\n}\n\n/**\n * Complete schema for a behavior.\n * This is the source of truth for all behavior metadata.\n */\nexport interface BehaviorSchema {\n /** Behavior name (PascalCase) */\n name: string;\n /** Category for organization */\n category: BehaviorCategory;\n /** Loading tier for lazy loading */\n tier: BehaviorTier;\n /** Semantic version */\n version: string;\n /** Human-readable description */\n description: string;\n /** Parameter definitions */\n parameters: ParameterSchema[];\n /** Event definitions */\n events: EventSchema[];\n /** The hyperscript behavior source code */\n source: string;\n /** Optional requirements or notes */\n requirements?: string[];\n}\n\n/**\n * Runtime behavior module interface.\n * This is what gets registered with the hyperfixi runtime.\n */\nexport interface BehaviorModule {\n source: string;\n metadata: BehaviorSchema;\n register: (hyperfixi?: LokaScriptInstance) => Promise<void>;\n}\n\n/**\n * Minimal LokaScript instance interface for behavior registration.\n */\nexport interface LokaScriptInstance {\n compileSync: (\n code: string,\n options?: { traditional?: boolean; language?: string }\n ) => {\n ok: boolean;\n ast?: unknown;\n errors?: Array<{ message: string; line?: number; column?: number }>;\n };\n execute: (ast: unknown, ctx: unknown) => Promise<unknown>;\n createContext?: () => { locals: Map<string, unknown>; globals: Map<string, unknown> };\n}\n\n/**\n * Typed window interface for behavior auto-registration.\n * Avoids `(window as any)` casts throughout the codebase.\n * Checks both `window.lokascript` and `window.hyperfixi` for the runtime instance.\n */\nexport interface LokaScriptWindow {\n lokascript?: LokaScriptInstance;\n hyperfixi?: LokaScriptInstance;\n __hyperfixi_behaviors_ready?: Promise<void> | undefined;\n}\n\n/**\n * Resolve the LokaScript runtime from window globals.\n * Checks both `window.lokascript` and `window.hyperfixi`.\n */\nexport function resolveRuntime(): LokaScriptInstance | null {\n if (typeof window === 'undefined') return null;\n const win = window as unknown as LokaScriptWindow;\n return win.lokascript || win.hyperfixi || null;\n}\n","/**\n * Draggable Behavior\n *\n * Makes elements draggable with pointer events. Compiled from its hyperscript\n * `source` (the single source of truth shared with the CDN resolver bundle and\n * patterns-reference) — no imperative installer. The source uses\n * `repeat until event pointerup` + `wait for pointermove or pointerup` to run the\n * drag loop, `measure` for the start offset, and `add { left: ${…}px }` to move.\n *\n * @example\n * ```html\n * <!-- Basic usage -->\n * <div _=\"install Draggable\">Drag me!</div>\n *\n * <!-- With custom drag handle -->\n * <div _=\"install Draggable(dragHandle: .titlebar)\">\n * <div class=\"titlebar\">Drag here</div>\n * <div class=\"content\">Content</div>\n * </div>\n * ```\n */\n\nimport { draggableSchema } from '../schemas/draggable.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const draggableSource = draggableSchema.source;\nexport const draggableMetadata = draggableSchema;\n\n/**\n * Register the Draggable behavior with LokaScript by compiling its hyperscript\n * source and executing the resulting behavior definition.\n */\nexport async function registerDraggable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(draggableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Draggable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerDraggable().catch(console.error);\n}\n\nexport default {\n source: draggableSchema.source,\n metadata: draggableSchema,\n register: registerDraggable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Removable Behavior Schema\n *\n * Removes an element when a trigger is clicked.\n * Supports optional confirmation and transition effects.\n *\n * @since 1.2.0 — `trigger` parameter renamed to `triggerEl` to avoid\n * shadowing the hyperscript `trigger` command keyword. Users migrating\n * from v1.x should update: `install Removable(triggerEl: .close-btn)`.\n */\nexport const removableSchema: BehaviorSchema = {\n name: 'Removable',\n category: 'data',\n tier: 'common',\n version: '1.2.0',\n description: 'Makes elements removable on click',\n parameters: [\n {\n name: 'triggerEl',\n type: 'selector',\n optional: true,\n default: 'me',\n description: 'Element that triggers removal (e.g., a close button)',\n },\n {\n name: 'confirmRemoval',\n type: 'boolean',\n optional: true,\n default: false,\n description: 'Show confirmation dialog before removal',\n },\n {\n name: 'effect',\n type: 'string',\n optional: true,\n default: 'none',\n enum: ['fade', 'none'],\n description: 'Transition effect: \"fade\" or \"none\"',\n },\n ],\n events: [\n { name: 'removable:before', description: 'Fired before removal (cancelable)' },\n { name: 'removable:removed', description: 'Fired after removal' },\n ],\n source: `\nbehavior Removable(triggerEl, confirmRemoval, effect)\n init\n if triggerEl is undefined\n set triggerEl to me\n end\n end\n on click from triggerEl\n if confirmRemoval\n js(me)\n if (!window.confirm(\"Are you sure?\")) return \"cancel\";\n end\n if it is \"cancel\"\n halt\n end\n end\n trigger removable:before\n if effect is \"fade\"\n transition opacity to 0 over 300ms\n end\n trigger removable:removed\n remove me\n end\nend\n`.trim(),\n};\n","/**\n * Removable Behavior\n *\n * A behavior that removes an element when a trigger is clicked.\n * Supports optional confirmation and transition effects.\n *\n * @example\n * ```html\n * <div _=\"install Removable\">Click to remove</div>\n *\n * <div _=\"install Removable(confirm: true)\">With confirmation</div>\n * ```\n */\n\nimport { removableSchema } from '../schemas/removable.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const removableSource = removableSchema.source;\nexport const removableMetadata = removableSchema;\n\n/**\n * Register the Removable behavior with LokaScript.\n */\nexport async function registerRemovable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(removableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Removable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerRemovable().catch(console.error);\n}\n\nexport default {\n source: removableSchema.source,\n metadata: removableSchema,\n register: registerRemovable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Toggleable Behavior Schema\n *\n * Toggles a CSS class on click.\n * Useful for accordions, dropdowns, and toggle buttons.\n */\nexport const toggleableSchema: BehaviorSchema = {\n name: 'Toggleable',\n category: 'form',\n tier: 'core',\n version: '1.0.0',\n description: 'Toggles a CSS class on click',\n parameters: [\n {\n name: 'cls',\n type: 'string',\n optional: true,\n default: 'active',\n description: 'CSS class to toggle',\n },\n {\n name: 'target',\n type: 'selector',\n optional: true,\n default: 'me',\n description: 'Element to toggle the class on',\n },\n ],\n events: [\n { name: 'toggleable:on', description: 'Fired when class is added' },\n { name: 'toggleable:off', description: 'Fired when class is removed' },\n ],\n source: `\nbehavior Toggleable(cls, target)\n init\n if cls is undefined\n set cls to \"active\"\n end\n if target is undefined\n set target to me\n end\n end\n on click\n toggle .{cls} on target\n js(target, cls)\n var eventName = target.classList.contains(cls) ? 'toggleable:on' : 'toggleable:off';\n target.dispatchEvent(new CustomEvent(eventName, { bubbles: true }));\n end\n end\nend`.trim(),\n};\n","/**\n * Toggleable Behavior\n *\n * A behavior that toggles a CSS class on click.\n * Useful for accordions, dropdowns, and toggle buttons.\n *\n * Compiled from its hyperscript `source` (the single source of truth shared with\n * the CDN resolver bundle and patterns-reference). The `.{cls}` dynamic class\n * selector resolves the behavior's `cls` parameter at runtime — see\n * `packages/core/src/commands/behaviors/__tests__/template-interpolation.test.ts`.\n *\n * @example\n * ```html\n * <button _=\"install Toggleable\">Toggle</button>\n *\n * <button _=\"install Toggleable(cls: expanded, target: #menu)\">Menu</button>\n * ```\n */\n\nimport { toggleableSchema } from '../schemas/toggleable.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const toggleableSource = toggleableSchema.source;\nexport const toggleableMetadata = toggleableSchema;\n\n/**\n * Register the Toggleable behavior with LokaScript by compiling its\n * hyperscript source and executing the resulting behavior definition.\n */\nexport async function registerToggleable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(toggleableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Toggleable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerToggleable().catch(console.error);\n}\n\nexport default {\n source: toggleableSchema.source,\n metadata: toggleableSchema,\n register: registerToggleable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Sortable Behavior Schema\n *\n * Drag-and-drop reordering of list items.\n * Apply to a container element; children become sortable.\n *\n * Note: This behavior fires lifecycle events but does NOT automatically\n * reorder DOM elements. Users must handle actual reordering in their\n * `sortable:move` event handlers.\n */\nexport const sortableSchema: BehaviorSchema = {\n name: 'Sortable',\n category: 'ui',\n tier: 'common',\n version: '1.0.0',\n description:\n 'Makes child elements reorderable via drag-and-drop (EXPERIMENTAL — stateful async component, beyond the inline-scripting boundary; not part of the curated set)',\n parameters: [\n {\n name: 'dragClass',\n type: 'string',\n optional: true,\n default: 'sorting',\n description: 'CSS class added to item during drag',\n },\n ],\n events: [\n { name: 'sortable:start', description: 'Fired when drag begins' },\n {\n name: 'sortable:move',\n description: 'Fired during drag — handle this event to reorder DOM elements',\n },\n { name: 'sortable:end', description: 'Fired when drag completes' },\n ],\n requirements: ['Users must handle DOM reordering in sortable:move event handlers'],\n source: `\nbehavior Sortable(dragClass)\n init\n if dragClass is undefined\n set dragClass to \"sorting\"\n end\n end\n on pointerdown(clientY) from me\n set item to the target.closest(\"li\")\n if item is null\n exit\n end\n halt the event\n add .{dragClass} to item\n trigger sortable:start on me\n repeat until event pointerup from document\n wait for pointermove(clientY) or pointerup(clientY) from document\n trigger sortable:move on me\n end\n remove .{dragClass} from item\n trigger sortable:end on me\n end\nend`.trim(),\n};\n","/**\n * Sortable Behavior\n *\n * Drag-and-drop reordering of list items. Apply to a container element; its\n * `<li>` children become sortable. Compiled from its hyperscript `source` (single\n * source of truth) — no imperative installer.\n *\n * Note: This behavior fires lifecycle events but does NOT automatically reorder\n * DOM elements. Users handle actual reordering in their `sortable:move` handlers.\n *\n * @example\n * ```html\n * <ul _=\"install Sortable\">\n * <li>Item 1</li>\n * <li>Item 2</li>\n * </ul>\n * ```\n */\n\nimport { sortableSchema } from '../schemas/sortable.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const sortableSource = sortableSchema.source;\nexport const sortableMetadata = sortableSchema;\n\n/**\n * Register the Sortable behavior with LokaScript by compiling its hyperscript\n * source and executing the resulting behavior definition.\n */\nexport async function registerSortable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(sortableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Sortable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerSortable().catch(console.error);\n}\n\nexport default {\n source: sortableSchema.source,\n metadata: sortableSchema,\n register: registerSortable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Resizable Behavior Schema\n *\n * Makes elements resizable by dragging edges or corners.\n * Supports minimum/maximum dimensions and resize handles.\n */\nexport const resizableSchema: BehaviorSchema = {\n name: 'Resizable',\n category: 'ui',\n tier: 'optional',\n version: '1.0.0',\n description:\n 'Makes elements resizable by dragging (EXPERIMENTAL — stateful async component, beyond the inline-scripting boundary; not part of the curated set)',\n parameters: [\n {\n name: 'minWidth',\n type: 'number',\n optional: true,\n default: 50,\n description: 'Minimum width in pixels',\n },\n {\n name: 'minHeight',\n type: 'number',\n optional: true,\n default: 50,\n description: 'Minimum height in pixels',\n },\n {\n name: 'maxWidth',\n type: 'number',\n optional: true,\n default: 9999,\n description: 'Maximum width in pixels',\n },\n {\n name: 'maxHeight',\n type: 'number',\n optional: true,\n default: 9999,\n description: 'Maximum height in pixels',\n },\n ],\n events: [\n { name: 'resizable:start', description: 'Fired when resize begins' },\n { name: 'resizable:resize', description: 'Fired during resize' },\n { name: 'resizable:end', description: 'Fired when resize completes' },\n ],\n source: `\nbehavior Resizable(minWidth, minHeight, maxWidth, maxHeight)\n on pointerdown(clientX, clientY) from me\n halt the event\n trigger resizable:start\n measure width\n set startWidth to it\n measure height\n set startHeight to it\n set startX to clientX\n set startY to clientY\n repeat until event pointerup from document\n wait for pointermove(clientX, clientY) or pointerup(clientX, clientY) from document\n set newWidth to (startWidth + clientX) - startX\n set newHeight to (startHeight + clientY) - startY\n if newWidth < minWidth then set newWidth to minWidth end\n if newWidth > maxWidth then set newWidth to maxWidth end\n if newHeight < minHeight then set newHeight to minHeight end\n if newHeight > maxHeight then set newHeight to maxHeight end\n set my *width to newWidth + \"px\"\n set my *height to newHeight + \"px\"\n trigger resizable:resize\n end\n trigger resizable:end\n end\nend\n`.trim(),\n};\n","/**\n * Resizable Behavior\n *\n * Makes elements resizable by dragging. Compiled from its hyperscript `source`\n * (single source of truth) — no imperative installer. The source measures the\n * start size, runs a `repeat until event pointerup` loop, clamps to\n * min/max dimensions, and writes `*width` / `*height` inline styles.\n *\n * @example\n * ```html\n * <div _=\"install Resizable\" style=\"width: 200px; height: 150px;\">\n * Resize me!\n * </div>\n * ```\n */\n\nimport { resizableSchema } from '../schemas/resizable.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const resizableSource = resizableSchema.source;\nexport const resizableMetadata = resizableSchema;\n\n/**\n * Register the Resizable behavior with LokaScript by compiling its hyperscript\n * source and executing the resulting behavior definition.\n */\nexport async function registerResizable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(resizableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Resizable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerResizable().catch(console.error);\n}\n\nexport default {\n source: resizableSchema.source,\n metadata: resizableSchema,\n register: registerResizable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Clipboard Behavior Schema\n *\n * Copies text to clipboard on click with visual feedback.\n * Uses the Clipboard API with execCommand fallback.\n */\nexport const clipboardSchema: BehaviorSchema = {\n name: 'Clipboard',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description: 'Copies text to clipboard on click with visual feedback',\n parameters: [\n {\n name: 'text',\n type: 'string',\n optional: true,\n description: 'Literal text to copy (takes priority over source)',\n },\n {\n name: 'source',\n type: 'selector',\n optional: true,\n default: 'me',\n description: 'Element whose textContent or value is copied',\n },\n {\n name: 'feedback',\n type: 'selector',\n optional: true,\n description: 'Element to show .copied feedback on (defaults to the installed element)',\n },\n {\n name: 'feedbackDuration',\n type: 'number',\n optional: true,\n default: 2000,\n description: 'Duration in ms to show .copied class feedback',\n },\n ],\n events: [\n { name: 'clipboard:copied', description: 'Fired after text is copied successfully' },\n { name: 'clipboard:error', description: 'Fired when clipboard write fails' },\n ],\n requirements: [\n 'navigator.clipboard.writeText() requires HTTPS or localhost',\n 'Falls back to document.execCommand(\"copy\") for older browsers',\n ],\n source: `\nbehavior Clipboard(text, source, feedback, feedbackDuration)\n init\n if feedbackDuration is undefined\n set feedbackDuration to 2000\n end\n if source is undefined\n set source to me\n end\n end\n on click\n if text is not undefined\n set copyText to text\n else\n set copyText to source's textContent\n end\n js(me, copyText, feedback, feedbackDuration)\n // Wrapped in an async IIFE: hyperscript's js() block has no top-level await.\n (async function() {\n async function copyToClipboard(t) {\n if (navigator.clipboard && navigator.clipboard.writeText) {\n await navigator.clipboard.writeText(t);\n return;\n }\n var ta = document.createElement('textarea');\n ta.value = t;\n ta.style.position = 'fixed';\n ta.style.opacity = '0';\n document.body.appendChild(ta);\n ta.select();\n try { document.execCommand('copy'); } finally { document.body.removeChild(ta); }\n }\n try {\n await copyToClipboard(copyText);\n var feedbackEl = feedback ? (typeof feedback === 'string' ? document.querySelector(feedback) : feedback) : me;\n if (!feedbackEl) feedbackEl = me;\n feedbackEl.classList.add('copied');\n me.dispatchEvent(new CustomEvent('clipboard:copied', { bubbles: true, detail: { text: copyText } }));\n setTimeout(function() { feedbackEl.classList.remove('copied'); }, feedbackDuration);\n } catch(err) {\n me.dispatchEvent(new CustomEvent('clipboard:error', { bubbles: true, detail: { error: err } }));\n }\n })();\n end\n end\nend`.trim(),\n};\n","/**\n * Clipboard Behavior\n *\n * Copies text to clipboard on click with visual feedback.\n * Uses navigator.clipboard.writeText() with execCommand fallback (in its\n * hyperscript `source`'s js() body).\n *\n * Compiled from its hyperscript `source` (the single source of truth shared with\n * the CDN resolver bundle and patterns-reference).\n */\n\nimport { clipboardSchema } from '../schemas/clipboard.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const clipboardSource = clipboardSchema.source;\nexport const clipboardMetadata = clipboardSchema;\n\n/**\n * Register the Clipboard behavior with LokaScript by compiling its\n * hyperscript source and executing the resulting behavior definition.\n */\nexport async function registerClipboard(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(clipboardSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Clipboard behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerClipboard().catch(console.error);\n}\n\nexport default {\n source: clipboardSchema.source,\n metadata: clipboardSchema,\n register: registerClipboard,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * AutoDismiss Behavior Schema\n *\n * Auto-removes flash messages and toasts after a configurable delay.\n * Supports pause-on-hover and fade effect.\n */\nexport const autoDismissSchema: BehaviorSchema = {\n name: 'AutoDismiss',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description: 'Auto-removes elements after a delay with optional pause-on-hover',\n parameters: [\n {\n name: 'delay',\n type: 'number',\n optional: true,\n default: 5000,\n description: 'Time in ms before the element is removed',\n },\n {\n name: 'pauseOnHover',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Pause the countdown when the mouse hovers over the element',\n },\n {\n name: 'effect',\n type: 'string',\n optional: true,\n default: 'none',\n enum: ['fade', 'none'],\n description: 'Transition effect before removal: \"fade\" or \"none\"',\n },\n ],\n events: [\n { name: 'autodismiss:start', description: 'Fired when the countdown timer starts' },\n {\n name: 'autodismiss:dismissed',\n description: 'Fired before removal (cancelable via preventDefault)',\n },\n { name: 'autodismiss:paused', description: 'Fired when the timer is paused on hover' },\n { name: 'autodismiss:resumed', description: 'Fired when the timer resumes on mouseleave' },\n ],\n source: `\nbehavior AutoDismiss(delay, pauseOnHover, effect)\n init\n if delay is undefined\n set delay to 5000\n end\n if pauseOnHover is undefined\n set pauseOnHover to true\n end\n if effect is undefined\n set effect to \"none\"\n end\n js(me, delay, effect, pauseOnHover)\n me.dispatchEvent(new CustomEvent('autodismiss:start', { bubbles: true }));\n var remaining = delay;\n var startedAt = Date.now();\n var timerId = null;\n function dismiss() {\n var ev = new CustomEvent('autodismiss:dismissed', { bubbles: true, cancelable: true });\n me.dispatchEvent(ev);\n if (ev.defaultPrevented) return;\n if (effect === 'fade') {\n me.style.transition = 'opacity 300ms';\n me.style.opacity = '0';\n setTimeout(function() { me.remove(); }, 300);\n } else {\n me.remove();\n }\n }\n function start() {\n startedAt = Date.now();\n timerId = setTimeout(dismiss, remaining);\n }\n start();\n if (pauseOnHover) {\n me.addEventListener('mouseenter', function() {\n if (timerId != null) {\n clearTimeout(timerId);\n timerId = null;\n remaining -= Date.now() - startedAt;\n if (remaining < 0) remaining = 0;\n me.dispatchEvent(new CustomEvent('autodismiss:paused', { bubbles: true }));\n }\n });\n me.addEventListener('mouseleave', function() {\n if (timerId == null && me.isConnected) {\n me.dispatchEvent(new CustomEvent('autodismiss:resumed', { bubbles: true }));\n start();\n }\n });\n }\n end\n end\nend`.trim(),\n};\n","/**\n * AutoDismiss Behavior\n *\n * Auto-removes elements after a configurable delay.\n * Supports pause-on-hover and fade effect using standard setTimeout/clearTimeout\n * (in its hyperscript `source`'s js() body).\n *\n * Compiled from its hyperscript `source` (the single source of truth shared with\n * the CDN resolver bundle and patterns-reference).\n */\n\nimport { autoDismissSchema } from '../schemas/autodismiss.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const autoDismissSource = autoDismissSchema.source;\nexport const autoDismissMetadata = autoDismissSchema;\n\n/**\n * Register the AutoDismiss behavior with LokaScript by compiling its\n * hyperscript source and executing the resulting behavior definition.\n */\nexport async function registerAutoDismiss(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(autoDismissSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile AutoDismiss behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerAutoDismiss().catch(console.error);\n}\n\nexport default {\n source: autoDismissSchema.source,\n metadata: autoDismissSchema,\n register: registerAutoDismiss,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * ClickOutside Behavior Schema\n *\n * Fires an event when the user clicks outside the element.\n * Uses pointerdown instead of click to avoid timing issues.\n */\nexport const clickOutsideSchema: BehaviorSchema = {\n name: 'ClickOutside',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description: 'Fires an event when the user clicks outside the element',\n parameters: [\n {\n name: 'active',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Whether the listener is active (can be toggled programmatically)',\n },\n ],\n events: [\n { name: 'clickoutside', description: 'Fired when a pointer press occurs outside the element' },\n {\n name: 'clickoutside:activate',\n description: 'Listen for this event to programmatically activate detection',\n },\n {\n name: 'clickoutside:deactivate',\n description: 'Listen for this event to programmatically deactivate detection',\n },\n ],\n requirements: ['Uses pointerdown instead of click to avoid timing issues with removed elements'],\n source: `\nbehavior ClickOutside(active)\n init\n if active is undefined\n set active to true\n end\n end\n on pointerdown from document\n js(me, active, event)\n if (!me.isConnected) return;\n if (active && !me.contains(event.target)) {\n me.dispatchEvent(new CustomEvent('clickoutside', { bubbles: true }));\n }\n end\n end\n on clickoutside:activate\n set active to true\n end\n on clickoutside:deactivate\n set active to false\n end\nend`.trim(),\n};\n","/**\n * ClickOutside Behavior\n *\n * Fires a clickoutside event when the user clicks outside the element.\n * Uses pointerdown instead of click to avoid timing issues.\n *\n * Compiled from its hyperscript `source` (the single source of truth shared with\n * the CDN resolver bundle and patterns-reference).\n */\n\nimport { clickOutsideSchema } from '../schemas/clickoutside.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const clickOutsideSource = clickOutsideSchema.source;\nexport const clickOutsideMetadata = clickOutsideSchema;\n\n/**\n * Register the ClickOutside behavior with LokaScript by compiling its\n * hyperscript source and executing the resulting behavior definition.\n */\nexport async function registerClickOutside(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(clickOutsideSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile ClickOutside behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerClickOutside().catch(console.error);\n}\n\nexport default {\n source: clickOutsideSchema.source,\n metadata: clickOutsideSchema,\n register: registerClickOutside,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * FocusTrap Behavior Schema\n *\n * Confines Tab navigation inside an element and restores focus on release.\n * Manages aria-modal for accessibility compliance.\n */\nexport const focusTrapSchema: BehaviorSchema = {\n name: 'FocusTrap',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description: 'Confines Tab navigation inside an element with ARIA support',\n parameters: [\n {\n name: 'active',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Whether the trap is active on install',\n },\n {\n name: 'initialFocus',\n type: 'selector',\n optional: true,\n description: 'Element to focus when the trap activates',\n },\n {\n name: 'returnFocus',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Restore focus to the previously focused element on deactivation',\n },\n ],\n events: [\n { name: 'focustrap:activated', description: 'Fired when the trap is activated' },\n { name: 'focustrap:deactivated', description: 'Fired when the trap is deactivated' },\n ],\n requirements: [\n 'Sets aria-modal=\"true\" on the element when active',\n 'Listens for focustrap:activate and focustrap:deactivate custom events for programmatic control',\n ],\n source: `\nbehavior FocusTrap(active, initialFocus, returnFocus)\n init\n if active is undefined\n set active to true\n end\n if returnFocus is undefined\n set returnFocus to true\n end\n js(me, active, initialFocus, returnFocus)\n var FOCUSABLE = 'a[href],button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),[tabindex]:not([tabindex=\"-1\"])';\n var isActive = false;\n var previouslyFocused = null;\n function getFocusable() { return Array.from(me.querySelectorAll(FOCUSABLE)); }\n function activate() {\n if (isActive) return;\n isActive = true;\n previouslyFocused = document.activeElement;\n me.setAttribute('aria-modal', 'true');\n var initEl = initialFocus ? (typeof initialFocus === 'string' ? me.querySelector(initialFocus) : initialFocus) : null;\n if (initEl) { initEl.focus(); } else { var f = getFocusable(); if (f.length) f[0].focus(); }\n me.dispatchEvent(new CustomEvent('focustrap:activated', { bubbles: true }));\n }\n function deactivate() {\n if (!isActive) return;\n isActive = false;\n me.removeAttribute('aria-modal');\n if (returnFocus && previouslyFocused instanceof HTMLElement) previouslyFocused.focus();\n previouslyFocused = null;\n me.dispatchEvent(new CustomEvent('focustrap:deactivated', { bubbles: true }));\n }\n me.addEventListener('keydown', function(e) {\n if (!isActive || e.key !== 'Tab') return;\n var focusable = getFocusable();\n if (focusable.length === 0) { e.preventDefault(); return; }\n e.preventDefault();\n var idx = focusable.indexOf(document.activeElement);\n if (e.shiftKey) {\n focusable[idx <= 0 ? focusable.length - 1 : idx - 1].focus();\n } else {\n focusable[idx >= focusable.length - 1 ? 0 : idx + 1].focus();\n }\n });\n me.addEventListener('focustrap:activate', function() { activate(); });\n me.addEventListener('focustrap:deactivate', function() { deactivate(); });\n if (active) activate();\n end\n end\nend`.trim(),\n};\n","/**\n * FocusTrap Behavior\n *\n * Confines Tab navigation inside an element, manages aria-modal,\n * and restores focus on deactivation. The Tab-trapping / focus-model logic\n * lives in the schema's hyperscript `source` (an `init`-block `js()` body).\n *\n * Compiled from its hyperscript `source` — the single source of truth shared with\n * the CDN resolver bundle and patterns-reference. This collapses FocusTrap onto\n * the one runtime path (no more imperative-installer fork between CDN and npm);\n * see docs-internal/BEHAVIORS_CONSOLIDATION_PLAN.md §3d.\n */\n\nimport { focusTrapSchema } from '../schemas/focustrap.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const focusTrapSource = focusTrapSchema.source;\nexport const focusTrapMetadata = focusTrapSchema;\n\n/**\n * Register the FocusTrap behavior with LokaScript by compiling its\n * hyperscript source and executing the resulting behavior definition.\n */\nexport async function registerFocusTrap(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(focusTrapSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile FocusTrap behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerFocusTrap().catch(console.error);\n}\n\nexport default {\n source: focusTrapSchema.source,\n metadata: focusTrapSchema,\n register: registerFocusTrap,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * ScrollReveal Behavior Schema\n *\n * Adds a class or fires events when the element enters or exits the viewport.\n * Uses the IntersectionObserver web standard API.\n */\nexport const scrollRevealSchema: BehaviorSchema = {\n name: 'ScrollReveal',\n category: 'layout',\n tier: 'common',\n version: '1.0.0',\n description: 'Adds a class when the element enters the viewport via IntersectionObserver',\n parameters: [\n {\n name: 'cls',\n type: 'string',\n optional: true,\n default: 'revealed',\n description: 'CSS class added when element enters viewport',\n },\n {\n name: 'threshold',\n type: 'number',\n optional: true,\n default: 0.1,\n description: 'Intersection ratio threshold (0-1) for triggering',\n },\n {\n name: 'once',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'If true, disconnect observer after first intersection',\n },\n ],\n events: [\n { name: 'scrollreveal:enter', description: 'Fired when the element enters the viewport' },\n { name: 'scrollreveal:exit', description: 'Fired when the element exits the viewport' },\n ],\n requirements: ['Uses IntersectionObserver API (supported in all modern browsers)'],\n source: `\nbehavior ScrollReveal(cls, threshold, once)\n init\n if cls is undefined\n set cls to \"revealed\"\n end\n if threshold is undefined\n set threshold to 0.1\n end\n if once is undefined\n set once to true\n end\n js(me, cls, threshold, once)\n var obs = new IntersectionObserver(function(entries) {\n for (var i = 0; i < entries.length; i++) {\n if (entries[i].isIntersecting) {\n me.classList.add(cls);\n me.dispatchEvent(new CustomEvent('scrollreveal:enter', { bubbles: true }));\n if (once) obs.disconnect();\n } else if (!once) {\n me.classList.remove(cls);\n me.dispatchEvent(new CustomEvent('scrollreveal:exit', { bubbles: true }));\n }\n }\n }, { threshold: threshold });\n obs.observe(me);\n end\n end\nend`.trim(),\n};\n","/**\n * ScrollReveal Behavior\n *\n * Adds a class or fires events when the element enters or exits the viewport.\n * Uses the IntersectionObserver web standard API (in its hyperscript `source`'s\n * `init`-block `js()` body).\n *\n * Compiled from its hyperscript `source` — the single source of truth shared with\n * the CDN resolver bundle and patterns-reference. This collapses ScrollReveal onto\n * the one runtime path (no more imperative-installer fork between CDN and npm);\n * see docs-internal/BEHAVIORS_CONSOLIDATION_PLAN.md §3d.\n */\n\nimport { scrollRevealSchema } from '../schemas/scrollreveal.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const scrollRevealSource = scrollRevealSchema.source;\nexport const scrollRevealMetadata = scrollRevealSchema;\n\n/**\n * Register the ScrollReveal behavior with LokaScript by compiling its\n * hyperscript source and executing the resulting behavior definition.\n */\nexport async function registerScrollReveal(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(scrollRevealSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile ScrollReveal behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerScrollReveal().catch(console.error);\n}\n\nexport default {\n source: scrollRevealSchema.source,\n metadata: scrollRevealSchema,\n register: registerScrollReveal,\n};\n","import type { BehaviorSchema } from './types';\n\nexport const tabsSchema: BehaviorSchema = {\n name: 'Tabs',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description:\n 'WAI-ARIA compliant tabs with roving tabindex keyboard navigation. ' +\n 'Auto-wires role, aria-selected, aria-controls, and aria-labelledby attributes.',\n parameters: [\n {\n name: 'orientation',\n type: 'string',\n optional: true,\n default: 'horizontal',\n enum: ['horizontal', 'vertical'],\n description: 'Arrow key direction: horizontal (Left/Right) or vertical (Up/Down)',\n },\n {\n name: 'activeTab',\n type: 'number',\n optional: true,\n default: 0,\n description: 'Initial active tab index (zero-based)',\n },\n {\n name: 'wrap',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Wrap to first/last tab when navigating past the end',\n },\n {\n name: 'activeClass',\n type: 'string',\n optional: true,\n default: 'active',\n description: 'CSS class applied to the active tab and its panel',\n },\n ],\n events: [\n {\n name: 'tabs:change',\n description: 'Fired before tab selection changes (cancelable via preventDefault)',\n },\n { name: 'tabs:changed', description: 'Fired after tab selection has changed' },\n ],\n requirements: [\n 'Sets role=\"tablist\" on the tab container',\n 'Sets role=\"tab\" on tab buttons and role=\"tabpanel\" on content panels',\n 'Manages aria-selected, aria-controls, aria-labelledby, and tabindex',\n 'Keyboard: Arrow keys navigate, Home/End jump to first/last, Tab exits tablist',\n ],\n source: `\nbehavior Tabs(orientation, activeTab, wrap, activeClass)\n init\n if orientation is undefined\n set orientation to \"horizontal\"\n end\n if activeTab is undefined\n set activeTab to 0\n end\n if wrap is undefined\n set wrap to true\n end\n if activeClass is undefined\n set activeClass to \"active\"\n end\n js(me, orientation, activeTab, wrap, activeClass)\n var tabs = Array.from(me.querySelectorAll('[role=\"tab\"]'));\n var panels = Array.from(me.querySelectorAll('[role=\"tabpanel\"]'));\n if (tabs.length === 0 || panels.length === 0) return;\n var tablist = me.querySelector('[role=\"tablist\"]') || tabs[0].parentElement;\n if (tablist) tablist.setAttribute('aria-orientation', orientation);\n var count = Math.min(tabs.length, panels.length);\n var idN = 0;\n for (var i = 0; i < count; i++) {\n if (!tabs[i].id) tabs[i].id = 'tab-' + (++idN);\n if (!panels[i].id) panels[i].id = 'tabpanel-' + idN;\n tabs[i].setAttribute('aria-controls', panels[i].id);\n panels[i].setAttribute('aria-labelledby', tabs[i].id);\n }\n var cur = Math.max(0, Math.min(activeTab, count - 1));\n function activate(idx, prev) {\n if (idx === prev || idx < 0 || idx >= count) return false;\n var ev = new CustomEvent('tabs:change', { bubbles: true, cancelable: true, detail: { index: idx, previousIndex: prev } });\n me.dispatchEvent(ev);\n if (ev.defaultPrevented) return false;\n if (prev >= 0 && prev < count) {\n tabs[prev].setAttribute('aria-selected', 'false');\n tabs[prev].setAttribute('tabindex', '-1');\n tabs[prev].classList.remove(activeClass);\n panels[prev].setAttribute('aria-hidden', 'true');\n panels[prev].classList.remove(activeClass);\n }\n tabs[idx].setAttribute('aria-selected', 'true');\n tabs[idx].setAttribute('tabindex', '0');\n tabs[idx].classList.add(activeClass);\n panels[idx].setAttribute('aria-hidden', 'false');\n panels[idx].classList.add(activeClass);\n cur = idx;\n me.dispatchEvent(new CustomEvent('tabs:changed', { bubbles: true, detail: { index: idx } }));\n return true;\n }\n for (var j = 0; j < count; j++) {\n tabs[j].setAttribute('aria-selected', 'false');\n tabs[j].setAttribute('tabindex', '-1');\n panels[j].setAttribute('aria-hidden', 'true');\n panels[j].classList.remove(activeClass);\n }\n tabs[cur].setAttribute('aria-selected', 'true');\n tabs[cur].setAttribute('tabindex', '0');\n tabs[cur].classList.add(activeClass);\n panels[cur].setAttribute('aria-hidden', 'false');\n panels[cur].classList.add(activeClass);\n for (var k = 0; k < count; k++) {\n (function(idx) {\n tabs[idx].addEventListener('click', function() { if (activate(idx, cur)) tabs[idx].focus(); });\n })(k);\n }\n (tablist || me).addEventListener('keydown', function(e) {\n var nk = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';\n var pk = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';\n var next = null;\n if (e.key === nk) { next = cur + 1; if (next >= count) next = wrap ? 0 : null; }\n else if (e.key === pk) { next = cur - 1; if (next < 0) next = wrap ? count - 1 : null; }\n else if (e.key === 'Home') next = 0;\n else if (e.key === 'End') next = count - 1;\n if (next !== null) { e.preventDefault(); if (activate(next, cur)) tabs[next].focus(); }\n });\n end\n end\nend`.trim(),\n};\n","/**\n * Tabs Behavior\n *\n * WAI-ARIA compliant tabs with roving tabindex keyboard navigation.\n * Auto-wires role, aria-selected, aria-controls, and aria-labelledby. The ARIA\n * wiring / keyboard-navigation logic lives in the schema's hyperscript `source`\n * (an `init`-block `js()` body).\n *\n * Compiled from its hyperscript `source` — the single source of truth shared with\n * the CDN resolver bundle and patterns-reference. This collapses Tabs onto the one\n * runtime path (no more imperative-installer fork between CDN and npm);\n * see docs-internal/BEHAVIORS_CONSOLIDATION_PLAN.md §3d.\n */\n\nimport { tabsSchema } from '../schemas/tabs.schema';\nimport type { LokaScriptInstance } from '../schemas/types';\nimport { resolveRuntime } from '../schemas/types';\n\nexport const tabsSource = tabsSchema.source;\nexport const tabsMetadata = tabsSchema;\n\n/**\n * Register the Tabs behavior with LokaScript by compiling its\n * hyperscript source and executing the resulting behavior definition.\n */\nexport async function registerTabs(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf = hyperfixi || resolveRuntime();\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(tabsSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Tabs behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerTabs().catch(console.error);\n}\n\nexport default {\n source: tabsSchema.source,\n metadata: tabsSchema,\n register: registerTabs,\n};\n","/**\n * @hyperfixi/behaviors\n *\n * Reusable hyperscript behaviors for LokaScript.\n * Each behavior can be imported individually for tree-shaking,\n * or all behaviors can be registered at once.\n *\n * @example Individual import (tree-shakeable)\n * ```javascript\n * import { registerDraggable } from '@hyperfixi/behaviors/draggable';\n * await registerDraggable();\n * ```\n *\n * @example Import all\n * ```javascript\n * import { registerAll } from '@hyperfixi/behaviors';\n * await registerAll();\n * ```\n *\n * @example Registry-based lazy loading\n * ```javascript\n * import { loadBehavior, getBehaviorsByCategory } from '@hyperfixi/behaviors';\n * await loadBehavior('Draggable');\n * const uiBehaviors = getBehaviorsByCategory('ui');\n * ```\n *\n * @example CDN usage\n * ```html\n * <script src=\"lokascript-browser.js\"></script>\n * <script src=\"@hyperfixi/behaviors/draggable.browser.js\"></script>\n * <!-- Draggable is auto-registered -->\n * ```\n */\n\n// =============================================================================\n// Re-export individual behaviors\n// =============================================================================\n\nexport {\n draggableSource,\n draggableMetadata,\n registerDraggable,\n default as Draggable,\n} from './behaviors/draggable';\n\nexport {\n removableSource,\n removableMetadata,\n registerRemovable,\n default as Removable,\n} from './behaviors/removable';\n\nexport {\n toggleableSource,\n toggleableMetadata,\n registerToggleable,\n default as Toggleable,\n} from './behaviors/toggleable';\n\nexport {\n sortableSource,\n sortableMetadata,\n registerSortable,\n default as Sortable,\n} from './behaviors/sortable';\n\nexport {\n resizableSource,\n resizableMetadata,\n registerResizable,\n default as Resizable,\n} from './behaviors/resizable';\n\nexport {\n clipboardSource,\n clipboardMetadata,\n registerClipboard,\n default as Clipboard,\n} from './behaviors/clipboard';\n\nexport {\n autoDismissSource,\n autoDismissMetadata,\n registerAutoDismiss,\n default as AutoDismiss,\n} from './behaviors/autodismiss';\n\nexport {\n clickOutsideSource,\n clickOutsideMetadata,\n registerClickOutside,\n default as ClickOutside,\n} from './behaviors/clickoutside';\n\nexport {\n focusTrapSource,\n focusTrapMetadata,\n registerFocusTrap,\n default as FocusTrap,\n} from './behaviors/focustrap';\n\nexport {\n scrollRevealSource,\n scrollRevealMetadata,\n registerScrollReveal,\n default as ScrollReveal,\n} from './behaviors/scrollreveal';\n\nexport { tabsSource, tabsMetadata, registerTabs, default as Tabs } from './behaviors/tabs';\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport type {\n BehaviorSchema,\n BehaviorCategory,\n BehaviorTier,\n ParameterSchema,\n EventSchema,\n BehaviorModule,\n LokaScriptInstance,\n} from './schemas/types';\n\n// =============================================================================\n// Initialize registry with loaders (populates schemas and loaders)\n// =============================================================================\n\nimport './loaders';\n\n// =============================================================================\n// Registry exports\n// =============================================================================\n\nexport {\n // Registration\n registerBehavior,\n registerSchema,\n registerLoader,\n // Query (sync)\n getBehavior,\n tryGetBehavior,\n getSchema,\n tryGetSchema,\n isRegistered,\n hasLoader,\n getRegisteredBehaviors,\n getAvailableBehaviors,\n // Query by metadata\n getBehaviorsByCategory,\n getBehaviorsByTier,\n getAllSchemas,\n getAllSchemasRecord,\n // Lazy loading (async)\n loadBehavior,\n preloadTier,\n preloadCategory,\n loadAll,\n // Runtime registration\n registerWithRuntime,\n registerAllWithRuntime,\n} from './registry';\n\n// =============================================================================\n// Generated types and metadata\n// =============================================================================\n\nexport type {\n BehaviorName,\n UIBehavior,\n DataBehavior,\n AnimationBehavior,\n FormBehavior,\n LayoutBehavior,\n CoreBehavior,\n CommonBehavior,\n OptionalBehavior,\n} from './generated/types';\n\nexport {\n ALL_BEHAVIOR_NAMES,\n BEHAVIORS_BY_CATEGORY,\n BEHAVIORS_BY_TIER,\n BEHAVIOR_CATEGORIES,\n BEHAVIOR_TIERS,\n} from './generated/metadata';\n\n// =============================================================================\n// Curation status (curated / optional / experimental) — see curation.ts\n// =============================================================================\n\nexport type { CurationStatus } from './curation';\nexport {\n CURATED_BEHAVIORS,\n OPTIONAL_BEHAVIORS,\n EXPERIMENTAL_BEHAVIORS,\n CURATION_STATUS,\n curationStatusOf,\n isCurated,\n} from './curation';\n\n// =============================================================================\n// Convenience functions\n// =============================================================================\n\nimport { registerDraggable } from './behaviors/draggable';\nimport { registerRemovable } from './behaviors/removable';\nimport { registerToggleable } from './behaviors/toggleable';\nimport { registerSortable } from './behaviors/sortable';\nimport { registerResizable } from './behaviors/resizable';\nimport { registerClipboard } from './behaviors/clipboard';\nimport { registerAutoDismiss } from './behaviors/autodismiss';\nimport { registerClickOutside } from './behaviors/clickoutside';\nimport { registerFocusTrap } from './behaviors/focustrap';\nimport { registerScrollReveal } from './behaviors/scrollreveal';\nimport { registerTabs } from './behaviors/tabs';\nimport type { LokaScriptInstance } from './schemas/types';\nimport { resolveRuntime } from './schemas/types';\nimport type { LokaScriptWindow } from './schemas/types';\n\n/**\n * Register all behaviors with HyperFixi.\n *\n * @param hyperfixi - The hyperfixi instance (defaults to window.hyperfixi)\n * @returns Promise that resolves when all behaviors are registered\n *\n * @example\n * ```javascript\n * import { registerAll } from '@hyperfixi/behaviors';\n * await registerAll();\n * ```\n */\nexport async function registerAll(hyperfixi?: LokaScriptInstance): Promise<void> {\n await Promise.all([\n registerDraggable(hyperfixi),\n registerRemovable(hyperfixi),\n registerToggleable(hyperfixi),\n registerSortable(hyperfixi),\n registerResizable(hyperfixi),\n registerClipboard(hyperfixi),\n registerAutoDismiss(hyperfixi),\n registerClickOutside(hyperfixi),\n registerFocusTrap(hyperfixi),\n registerScrollReveal(hyperfixi),\n registerTabs(hyperfixi),\n ]);\n}\n\n// =============================================================================\n// Auto-registration for browser\n// =============================================================================\n\n/**\n * Promise that resolves when all behaviors are registered.\n * This is set when the package auto-registers in browser environments.\n */\nexport let ready: Promise<void> | null = null;\n\n// Auto-register all behaviors when loaded in browser with hyperfixi available\nconst _runtime = resolveRuntime();\nif (_runtime) {\n const lsWin = window as unknown as LokaScriptWindow;\n ready = registerAll(_runtime);\n\n lsWin.__hyperfixi_behaviors_ready = ready;\n\n ready\n .then(() => {\n const hf = _runtime as LokaScriptInstance & {\n attributeProcessor?: { scanAndProcessAll: () => Promise<void> };\n processNode?: (node: Document) => void;\n };\n const savedPromise = lsWin.__hyperfixi_behaviors_ready;\n delete lsWin.__hyperfixi_behaviors_ready;\n\n if (hf.attributeProcessor?.scanAndProcessAll) {\n hf.attributeProcessor.scanAndProcessAll().finally(() => {\n lsWin.__hyperfixi_behaviors_ready = savedPromise;\n });\n } else if (hf.processNode) {\n hf.processNode(document);\n lsWin.__hyperfixi_behaviors_ready = savedPromise;\n }\n })\n .catch(err => {\n console.error('[behaviors] Auto-registration failed:', err);\n });\n}\n","/**\n * Behavior Registry\n *\n * Central registration point for behaviors. Modeled on semantic/registry.ts.\n * Supports lazy loading, category/tier queries, and tree-shaking.\n *\n * @example\n * ```typescript\n * // Register a behavior\n * registerBehavior('Draggable', DraggableModule);\n *\n * // Query behaviors\n * const uiBehaviors = getBehaviorsByCategory('ui');\n * const coreBehaviors = getBehaviorsByTier('core');\n *\n * // Lazy load on demand\n * const module = await loadBehavior('Resizable');\n * ```\n */\n\nimport type {\n BehaviorModule,\n BehaviorSchema,\n BehaviorCategory,\n BehaviorTier,\n LokaScriptInstance,\n} from './schemas/types';\n\n// =============================================================================\n// Registry State\n// =============================================================================\n\nconst behaviors = new Map<string, BehaviorModule>();\nconst schemas = new Map<string, BehaviorSchema>();\nconst loaders = new Map<string, () => Promise<{ default: BehaviorModule }>>();\nconst loadingPromises = new Map<string, Promise<BehaviorModule>>();\n\n// =============================================================================\n// Registration Functions\n// =============================================================================\n\n/**\n * Register a behavior module.\n */\nexport function registerBehavior(name: string, module: BehaviorModule): void {\n behaviors.set(name, module);\n if (module.metadata) {\n schemas.set(name, module.metadata);\n }\n}\n\n/**\n * Register a behavior schema (without the module).\n */\nexport function registerSchema(schema: BehaviorSchema): void {\n schemas.set(schema.name, schema);\n}\n\n/**\n * Register a lazy loader for a behavior.\n * The loader should return a module with a default export.\n */\nexport function registerLoader(\n name: string,\n loader: () => Promise<{ default: BehaviorModule }>\n): void {\n loaders.set(name, loader);\n}\n\n// =============================================================================\n// Query Functions (Sync)\n// =============================================================================\n\n/**\n * Get a behavior module by name.\n * @throws Error if behavior is not registered\n */\nexport function getBehavior(name: string): BehaviorModule {\n const behavior = behaviors.get(name);\n if (!behavior) {\n const registered = Array.from(behaviors.keys()).join(', ');\n throw new Error(\n `Behavior '${name}' is not registered. ` +\n `Registered behaviors: ${registered || 'none'}. ` +\n `Use loadBehavior('${name}') to lazy load it.`\n );\n }\n return behavior;\n}\n\n/**\n * Try to get a behavior, returning undefined if not registered.\n */\nexport function tryGetBehavior(name: string): BehaviorModule | undefined {\n return behaviors.get(name);\n}\n\n/**\n * Get a behavior schema by name.\n * @throws Error if schema is not registered\n */\nexport function getSchema(name: string): BehaviorSchema {\n const schema = schemas.get(name);\n if (!schema) {\n throw new Error(\n `Schema for behavior '${name}' is not registered. ` +\n `Use tryGetSchema('${name}') for a non-throwing alternative.`\n );\n }\n return schema;\n}\n\n/**\n * Try to get a schema, returning undefined if not registered.\n */\nexport function tryGetSchema(name: string): BehaviorSchema | undefined {\n return schemas.get(name);\n}\n\n/**\n * Check if a behavior is registered.\n */\nexport function isRegistered(name: string): boolean {\n return behaviors.has(name);\n}\n\n/**\n * Check if a loader is registered for a behavior.\n */\nexport function hasLoader(name: string): boolean {\n return loaders.has(name);\n}\n\n/**\n * Get all registered behavior names.\n */\nexport function getRegisteredBehaviors(): string[] {\n return Array.from(behaviors.keys());\n}\n\n/**\n * Get all behavior names that have loaders (including unloaded).\n */\nexport function getAvailableBehaviors(): string[] {\n const names = new Set([...behaviors.keys(), ...loaders.keys()]);\n return Array.from(names);\n}\n\n// =============================================================================\n// Query by Metadata\n// =============================================================================\n\n/**\n * Get behavior names by category.\n */\nexport function getBehaviorsByCategory(category: BehaviorCategory): string[] {\n const result: string[] = [];\n for (const [name, schema] of schemas) {\n if (schema.category === category) {\n result.push(name);\n }\n }\n return result;\n}\n\n/**\n * Get behavior names by tier.\n */\nexport function getBehaviorsByTier(tier: BehaviorTier): string[] {\n const result: string[] = [];\n for (const [name, schema] of schemas) {\n if (schema.tier === tier) {\n result.push(name);\n }\n }\n return result;\n}\n\n/**\n * Get all schemas.\n */\nexport function getAllSchemas(): BehaviorSchema[] {\n return Array.from(schemas.values());\n}\n\n/**\n * Get all schemas as a record.\n */\nexport function getAllSchemasRecord(): Record<string, BehaviorSchema> {\n const result: Record<string, BehaviorSchema> = {};\n for (const [name, schema] of schemas) {\n result[name] = schema;\n }\n return result;\n}\n\n// =============================================================================\n// Lazy Loading (Async)\n// =============================================================================\n\n/**\n * Load a behavior by name.\n * If already loaded, returns the cached module.\n * If a loader is registered, loads and caches the module.\n */\nexport async function loadBehavior(name: string): Promise<BehaviorModule> {\n // Return cached if available\n const cached = behaviors.get(name);\n if (cached) {\n return cached;\n }\n\n // Check for in-flight load\n const inFlight = loadingPromises.get(name);\n if (inFlight) {\n return inFlight;\n }\n\n // Check for loader\n const loader = loaders.get(name);\n if (!loader) {\n throw new Error(\n `No loader registered for behavior '${name}'. ` +\n `Available loaders: ${Array.from(loaders.keys()).join(', ') || 'none'}`\n );\n }\n\n // Load and cache\n const promise = loader().then(mod => {\n const module = mod.default;\n registerBehavior(name, module);\n loadingPromises.delete(name);\n return module;\n });\n\n loadingPromises.set(name, promise);\n return promise;\n}\n\n/**\n * Preload all behaviors in a tier.\n */\nexport async function preloadTier(tier: BehaviorTier): Promise<void> {\n const names = getBehaviorsByTier(tier);\n await Promise.all(\n names.map(name =>\n loadBehavior(name).catch(err => {\n console.warn(`[behaviors] Failed to preload '${name}' (tier: ${tier}):`, err);\n })\n )\n );\n}\n\n/**\n * Preload all behaviors in a category.\n */\nexport async function preloadCategory(category: BehaviorCategory): Promise<void> {\n const names = getBehaviorsByCategory(category);\n await Promise.all(\n names.map(name =>\n loadBehavior(name).catch(err => {\n console.warn(`[behaviors] Failed to preload '${name}' (category: ${category}):`, err);\n })\n )\n );\n}\n\n/**\n * Load and register all available behaviors.\n */\nexport async function loadAll(): Promise<void> {\n const names = getAvailableBehaviors();\n await Promise.all(\n names.map(name =>\n loadBehavior(name).catch(err => {\n console.warn(`[behaviors] Failed to load '${name}':`, err);\n })\n )\n );\n}\n\n// =============================================================================\n// Runtime Registration\n// =============================================================================\n\n/**\n * Register a behavior with HyperFixi runtime.\n * Compiles and executes the behavior source.\n */\nexport async function registerWithRuntime(\n name: string,\n hyperfixi?: LokaScriptInstance\n): Promise<void> {\n const module = await loadBehavior(name);\n await module.register(hyperfixi);\n}\n\n/**\n * Register all loaded behaviors with HyperFixi runtime.\n */\nexport async function registerAllWithRuntime(hyperfixi?: LokaScriptInstance): Promise<void> {\n const registrations = Array.from(behaviors.values()).map(module => module.register(hyperfixi));\n await Promise.all(registrations);\n}\n","/**\n * Behavior Loaders\n *\n * Registers lazy loaders for all behaviors.\n * Import this module to enable on-demand loading without bundling all behaviors.\n *\n * @example\n * ```typescript\n * // Enable lazy loading\n * import '@hyperfixi/behaviors/loaders';\n *\n * // Now load behaviors on demand\n * import { loadBehavior } from '@hyperfixi/behaviors/registry';\n * await loadBehavior('Draggable');\n * ```\n */\n\nimport { registerLoader, registerSchema } from './registry';\n\n// Register schemas for metadata queries before loading\nimport { draggableSchema } from './schemas/draggable.schema';\nimport { sortableSchema } from './schemas/sortable.schema';\nimport { resizableSchema } from './schemas/resizable.schema';\nimport { removableSchema } from './schemas/removable.schema';\nimport { toggleableSchema } from './schemas/toggleable.schema';\nimport { clipboardSchema } from './schemas/clipboard.schema';\nimport { autoDismissSchema } from './schemas/autodismiss.schema';\nimport { clickOutsideSchema } from './schemas/clickoutside.schema';\nimport { focusTrapSchema } from './schemas/focustrap.schema';\nimport { scrollRevealSchema } from './schemas/scrollreveal.schema';\nimport { tabsSchema } from './schemas/tabs.schema';\n\n// Register all schemas\nregisterSchema(draggableSchema);\nregisterSchema(sortableSchema);\nregisterSchema(resizableSchema);\nregisterSchema(removableSchema);\nregisterSchema(toggleableSchema);\nregisterSchema(clipboardSchema);\nregisterSchema(autoDismissSchema);\nregisterSchema(clickOutsideSchema);\nregisterSchema(focusTrapSchema);\nregisterSchema(scrollRevealSchema);\nregisterSchema(tabsSchema);\n\n// Register lazy loaders - behaviors are only loaded when requested\nregisterLoader('Draggable', () => import('./behaviors/draggable'));\nregisterLoader('Sortable', () => import('./behaviors/sortable'));\nregisterLoader('Resizable', () => import('./behaviors/resizable'));\nregisterLoader('Removable', () => import('./behaviors/removable'));\nregisterLoader('Toggleable', () => import('./behaviors/toggleable'));\nregisterLoader('Clipboard', () => import('./behaviors/clipboard'));\nregisterLoader('AutoDismiss', () => import('./behaviors/autodismiss'));\nregisterLoader('ClickOutside', () => import('./behaviors/clickoutside'));\nregisterLoader('FocusTrap', () => import('./behaviors/focustrap'));\nregisterLoader('ScrollReveal', () => import('./behaviors/scrollreveal'));\nregisterLoader('Tabs', () => import('./behaviors/tabs'));\n","/**\n * Generated Metadata\n *\n * DO NOT EDIT - Generated by scripts/generate.ts\n * Run `npm run generate` to regenerate.\n */\n\nimport type { BehaviorCategory, BehaviorTier } from '../schemas/types';\nimport type { BehaviorName } from './types';\n\n/**\n * All behavior names.\n */\nexport const ALL_BEHAVIOR_NAMES: BehaviorName[] = [\n \"Draggable\",\n \"Sortable\",\n \"Resizable\",\n \"Removable\",\n \"Toggleable\",\n \"Clipboard\",\n \"AutoDismiss\",\n \"ClickOutside\",\n \"FocusTrap\",\n \"ScrollReveal\",\n \"Tabs\"\n];\n\n/**\n * Behaviors grouped by category.\n */\nexport const BEHAVIORS_BY_CATEGORY: Record<BehaviorCategory, BehaviorName[]> = {\n \"ui\": [\n \"Draggable\",\n \"Sortable\",\n \"Resizable\",\n \"Clipboard\",\n \"AutoDismiss\",\n \"ClickOutside\",\n \"FocusTrap\",\n \"Tabs\"\n ],\n \"data\": [\n \"Removable\"\n ],\n \"animation\": [],\n \"form\": [\n \"Toggleable\"\n ],\n \"layout\": [\n \"ScrollReveal\"\n ]\n};\n\n/**\n * Behaviors grouped by tier.\n */\nexport const BEHAVIORS_BY_TIER: Record<BehaviorTier, BehaviorName[]> = {\n \"core\": [\n \"Draggable\",\n \"Toggleable\",\n \"Clipboard\",\n \"AutoDismiss\",\n \"ClickOutside\",\n \"FocusTrap\",\n \"Tabs\"\n ],\n \"common\": [\n \"Sortable\",\n \"Removable\",\n \"ScrollReveal\"\n ],\n \"optional\": [\n \"Resizable\"\n ]\n};\n\n/**\n * Category for each behavior.\n */\nexport const BEHAVIOR_CATEGORIES: Record<BehaviorName, BehaviorCategory> = {\n \"Draggable\": \"ui\",\n \"Sortable\": \"ui\",\n \"Resizable\": \"ui\",\n \"Removable\": \"data\",\n \"Toggleable\": \"form\",\n \"Clipboard\": \"ui\",\n \"AutoDismiss\": \"ui\",\n \"ClickOutside\": \"ui\",\n \"FocusTrap\": \"ui\",\n \"ScrollReveal\": \"layout\",\n \"Tabs\": \"ui\"\n};\n\n/**\n * Tier for each behavior.\n */\nexport const BEHAVIOR_TIERS: Record<BehaviorName, BehaviorTier> = {\n \"Draggable\": \"core\",\n \"Sortable\": \"common\",\n \"Resizable\": \"optional\",\n \"Removable\": \"common\",\n \"Toggleable\": \"core\",\n \"Clipboard\": \"core\",\n \"AutoDismiss\": \"core\",\n \"ClickOutside\": \"core\",\n \"FocusTrap\": \"core\",\n \"ScrollReveal\": \"common\",\n \"Tabs\": \"core\"\n};\n","/**\n * Curation status — the product decision about which behaviors are first-class.\n *\n * This is ORTHOGONAL to {@link BehaviorTier} (core/common/optional), which is about\n * lazy-loading priority. Curation is about support level and the boundary rule:\n *\n * A behavior is a named, parameterized, *reusable inline script* — `on event →\n * DOM action`. Not a component. When it needs an observer, a focus model, or an\n * async pointer loop, it has left hyperfixi's lane.\n *\n * See docs-internal/BEHAVIORS_CONSOLIDATION_PLAN.md for the full rationale.\n */\n\nexport type CurationStatus = 'curated' | 'optional' | 'experimental';\n\n/**\n * Curated set — reliable, runtime-tested, multilingual. The supported story.\n * Real `on event → DOM action` behaviors (Tier A) plus two honestly-labeled\n * JS-backed conveniences (Clipboard, AutoDismiss).\n */\nexport const CURATED_BEHAVIORS = [\n 'Toggleable',\n 'Removable',\n 'ClickOutside',\n 'Clipboard',\n 'AutoDismiss',\n] as const;\n\n/**\n * Optional — useful, kept, documented as primitives / nice-to-haves.\n * FocusTrap + ClickOutside are the primitives a Modal composes from; ScrollReveal\n * is a nice-to-have; Tabs is high-value but heavy.\n */\nexport const OPTIONAL_BEHAVIORS = ['FocusTrap', 'ScrollReveal', 'Tabs'] as const;\n\n/**\n * Experimental — stateful async components (drag/sort/resize). These sit *beyond*\n * the inline-scripting boundary; kept working but explicitly outside the curated,\n * supported, marketed story.\n */\nexport const EXPERIMENTAL_BEHAVIORS = ['Draggable', 'Sortable', 'Resizable'] as const;\n\n/** Curation status for every behavior, keyed by name. */\nexport const CURATION_STATUS: Record<string, CurationStatus> = {\n ...Object.fromEntries(CURATED_BEHAVIORS.map(n => [n, 'curated' as const])),\n ...Object.fromEntries(OPTIONAL_BEHAVIORS.map(n => [n, 'optional' as const])),\n ...Object.fromEntries(EXPERIMENTAL_BEHAVIORS.map(n => [n, 'experimental' as const])),\n};\n\n/** Curation status for a behavior name, or undefined if unknown. */\nexport function curationStatusOf(name: string): CurationStatus | undefined {\n return CURATION_STATUS[name];\n}\n\n/** True for the curated, supported set. */\nexport function isCurated(name: string): boolean {\n return CURATION_STATUS[name] === 'curated';\n}\n"],"mappings":"kfAAA,IAQaA,EARbC,EAAAC,EAAA,kBAQaF,EAAkC,CAC7C,KAAM,YACN,SAAU,KACV,KAAM,OACN,QAAS,QACT,YACE,iKACF,WAAY,CACV,CACE,KAAM,aACN,KAAM,WACN,SAAU,GACV,QAAS,KACT,YAAa,0CACf,CACF,EACA,OAAQ,CACN,CAAE,KAAM,kBAAmB,YAAa,wBAAyB,EACjE,CAAE,KAAM,iBAAkB,YAAa,4BAA6B,EACpE,CAAE,KAAM,gBAAiB,YAAa,2BAA4B,CACpE,EACA,aAAc,CAAC,sDAAsD,EACrE,OAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBR,KAAK,CACP,IC4DO,SAASG,GAA4C,CAC1D,GAAI,OAAO,OAAW,IAAa,OAAO,KAC1C,IAAMC,EAAM,OACZ,OAAOA,EAAI,YAAcA,EAAI,WAAa,IAC5C,CAtHA,IAAAC,EAAAC,EAAA,oBCAA,IAAAC,GAAA,GAAAC,EAAAD,GAAA,aAAAE,GAAA,sBAAAC,EAAA,oBAAAC,EAAA,sBAAAC,IAkCA,eAAsBA,EAAkBC,EAA+C,CACrF,IAAMC,EAAKD,GAAaE,EAAe,EAEvC,GAAI,CAACD,EACH,MAAM,IAAI,MACR,yFACF,EAGF,IAAME,EAASF,EAAG,YAAYG,EAAgB,OAAQ,CAAE,YAAa,EAAK,CAAC,EAE3E,GAAI,CAACD,EAAO,GACV,MAAM,IAAI,MAAM,yCAAyC,KAAK,UAAUA,EAAO,MAAM,CAAC,EAAE,EAG1F,IAAME,EAAMJ,EAAG,cAAgBA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YF,GAAuB,IAAIE,GAAK,CAACA,EAAG,cAAuB,CAAC,CAAC,CACrF,EAGO,SAASC,GAAiBC,EAA0C,CACzE,OAAOH,EAAgBG,CAAI,CAC7B,CAGO,SAASC,GAAUD,EAAuB,CAC/C,OAAOH,EAAgBG,CAAI,IAAM,SACnC,CJoJAE,IACAC,IACAC,IACAC,IACAC,IACAC,IACAC,IACAC,IACAC,IACAC,IACAC,IAEAC,IAeA,eAAsBC,GAAYC,EAA+C,CAC/E,MAAM,QAAQ,IAAI,CAChBC,EAAkBD,CAAS,EAC3BE,EAAkBF,CAAS,EAC3BG,EAAmBH,CAAS,EAC5BI,EAAiBJ,CAAS,EAC1BK,EAAkBL,CAAS,EAC3BM,EAAkBN,CAAS,EAC3BO,EAAoBP,CAAS,EAC7BQ,EAAqBR,CAAS,EAC9BS,EAAkBT,CAAS,EAC3BU,EAAqBV,CAAS,EAC9BW,EAAaX,CAAS,CACxB,CAAC,CACH,CAUO,IAAIY,EAA8B,KAGnCC,GAAWC,EAAe,EAChC,GAAID,GAAU,CACZ,IAAME,EAAQ,OACdH,EAAQb,GAAYc,EAAQ,EAE5BE,EAAM,4BAA8BH,EAEpCA,EACG,KAAK,IAAM,CACV,IAAMI,EAAKH,GAILI,EAAeF,EAAM,4BAC3B,OAAOA,EAAM,4BAETC,EAAG,oBAAoB,kBACzBA,EAAG,mBAAmB,kBAAkB,EAAE,QAAQ,IAAM,CACtDD,EAAM,4BAA8BE,CACtC,CAAC,EACQD,EAAG,cACZA,EAAG,YAAY,QAAQ,EACvBD,EAAM,4BAA8BE,EAExC,CAAC,EACA,MAAMC,GAAO,CACZ,QAAQ,MAAM,wCAAyCA,CAAG,CAC5D,CAAC,CACL","names":["draggableSchema","init_draggable_schema","__esmMin","resolveRuntime","win","init_types","__esmMin","draggable_exports","__export","draggable_default","draggableMetadata","draggableSource","registerDraggable","hyperfixi","hf","resolveRuntime","result","draggableSchema","ctx","init_draggable","__esmMin","init_draggable_schema","init_types","removableSchema","init_removable_schema","__esmMin","removable_exports","__export","removable_default","registerRemovable","removableMetadata","removableSource","hyperfixi","hf","resolveRuntime","result","removableSchema","ctx","init_removable","__esmMin","init_removable_schema","init_types","toggleableSchema","init_toggleable_schema","__esmMin","toggleable_exports","__export","toggleable_default","registerToggleable","toggleableMetadata","toggleableSource","hyperfixi","hf","resolveRuntime","result","toggleableSchema","ctx","init_toggleable","__esmMin","init_toggleable_schema","init_types","sortableSchema","init_sortable_schema","__esmMin","sortable_exports","__export","sortable_default","registerSortable","sortableMetadata","sortableSource","hyperfixi","hf","resolveRuntime","result","sortableSchema","ctx","init_sortable","__esmMin","init_sortable_schema","init_types","resizableSchema","init_resizable_schema","__esmMin","resizable_exports","__export","resizable_default","registerResizable","resizableMetadata","resizableSource","hyperfixi","hf","resolveRuntime","result","resizableSchema","ctx","init_resizable","__esmMin","init_resizable_schema","init_types","clipboardSchema","init_clipboard_schema","__esmMin","clipboard_exports","__export","clipboardMetadata","clipboardSource","clipboard_default","registerClipboard","hyperfixi","hf","resolveRuntime","result","clipboardSchema","ctx","init_clipboard","__esmMin","init_clipboard_schema","init_types","autoDismissSchema","init_autodismiss_schema","__esmMin","autodismiss_exports","__export","autoDismissMetadata","autoDismissSource","autodismiss_default","registerAutoDismiss","hyperfixi","hf","resolveRuntime","result","autoDismissSchema","ctx","init_autodismiss","__esmMin","init_autodismiss_schema","init_types","clickOutsideSchema","init_clickoutside_schema","__esmMin","clickoutside_exports","__export","clickOutsideMetadata","clickOutsideSource","clickoutside_default","registerClickOutside","hyperfixi","hf","resolveRuntime","result","clickOutsideSchema","ctx","init_clickoutside","__esmMin","init_clickoutside_schema","init_types","focusTrapSchema","init_focustrap_schema","__esmMin","focustrap_exports","__export","focustrap_default","focusTrapMetadata","focusTrapSource","registerFocusTrap","hyperfixi","hf","resolveRuntime","result","focusTrapSchema","ctx","init_focustrap","__esmMin","init_focustrap_schema","init_types","scrollRevealSchema","init_scrollreveal_schema","__esmMin","scrollreveal_exports","__export","scrollreveal_default","registerScrollReveal","scrollRevealMetadata","scrollRevealSource","hyperfixi","hf","resolveRuntime","result","scrollRevealSchema","ctx","init_scrollreveal","__esmMin","init_scrollreveal_schema","init_types","tabsSchema","init_tabs_schema","__esmMin","tabs_exports","__export","tabs_default","registerTabs","tabsMetadata","tabsSource","hyperfixi","hf","resolveRuntime","result","tabsSchema","ctx","init_tabs","__esmMin","init_tabs_schema","init_types","src_exports","__export","ALL_BEHAVIOR_NAMES","autodismiss_default","BEHAVIORS_BY_CATEGORY","BEHAVIORS_BY_TIER","BEHAVIOR_CATEGORIES","BEHAVIOR_TIERS","CURATED_BEHAVIORS","CURATION_STATUS","clickoutside_default","clipboard_default","draggable_default","EXPERIMENTAL_BEHAVIORS","focustrap_default","OPTIONAL_BEHAVIORS","removable_default","resizable_default","scrollreveal_default","sortable_default","tabs_default","toggleable_default","autoDismissMetadata","autoDismissSource","clickOutsideMetadata","clickOutsideSource","clipboardMetadata","clipboardSource","curationStatusOf","draggableMetadata","draggableSource","focusTrapMetadata","focusTrapSource","getAllSchemas","getAllSchemasRecord","getAvailableBehaviors","getBehavior","getBehaviorsByCategory","getBehaviorsByTier","getRegisteredBehaviors","getSchema","hasLoader","isCurated","isRegistered","loadAll","loadBehavior","preloadCategory","preloadTier","ready","registerAll","registerAllWithRuntime","registerAutoDismiss","registerBehavior","registerClickOutside","registerClipboard","registerDraggable","registerFocusTrap","registerLoader","registerRemovable","registerResizable","registerSchema","registerScrollReveal","registerSortable","registerTabs","registerToggleable","registerWithRuntime","removableMetadata","removableSource","resizableMetadata","resizableSource","scrollRevealMetadata","scrollRevealSource","sortableMetadata","sortableSource","tabsMetadata","tabsSource","toggleableMetadata","toggleableSource","tryGetBehavior","tryGetSchema","init_draggable","init_removable","init_toggleable","init_sortable","init_resizable","init_clipboard","init_autodismiss","init_clickoutside","init_focustrap","init_scrollreveal","init_tabs","behaviors","schemas","loaders","loadingPromises","registerBehavior","name","module","registerSchema","schema","registerLoader","loader","getBehavior","behavior","registered","tryGetBehavior","getSchema","tryGetSchema","isRegistered","hasLoader","getRegisteredBehaviors","getAvailableBehaviors","names","getBehaviorsByCategory","category","result","getBehaviorsByTier","tier","getAllSchemas","getAllSchemasRecord","loadBehavior","cached","inFlight","promise","mod","preloadTier","err","preloadCategory","loadAll","registerWithRuntime","hyperfixi","registerAllWithRuntime","registrations","init_draggable_schema","init_sortable_schema","init_resizable_schema","init_removable_schema","init_toggleable_schema","init_clipboard_schema","init_autodismiss_schema","init_clickoutside_schema","init_focustrap_schema","init_scrollreveal_schema","init_tabs_schema","registerSchema","draggableSchema","sortableSchema","resizableSchema","removableSchema","toggleableSchema","clipboardSchema","autoDismissSchema","clickOutsideSchema","focusTrapSchema","scrollRevealSchema","tabsSchema","registerLoader","ALL_BEHAVIOR_NAMES","BEHAVIORS_BY_CATEGORY","BEHAVIORS_BY_TIER","BEHAVIOR_CATEGORIES","BEHAVIOR_TIERS","CURATED_BEHAVIORS","OPTIONAL_BEHAVIORS","EXPERIMENTAL_BEHAVIORS","CURATION_STATUS","n","curationStatusOf","name","isCurated","init_draggable","init_removable","init_toggleable","init_sortable","init_resizable","init_clipboard","init_autodismiss","init_clickoutside","init_focustrap","init_scrollreveal","init_tabs","init_types","registerAll","hyperfixi","registerDraggable","registerRemovable","registerToggleable","registerSortable","registerResizable","registerClipboard","registerAutoDismiss","registerClickOutside","registerFocusTrap","registerScrollReveal","registerTabs","ready","_runtime","resolveRuntime","lsWin","hf","savedPromise","err"]}
1
+ {"version":3,"sources":["../src/schemas/draggable.schema.ts","../src/schemas/types.ts","../src/behaviors/draggable.ts","../src/schemas/removable.schema.ts","../src/behaviors/removable.ts","../src/schemas/toggleable.schema.ts","../src/behaviors/toggleable.ts","../src/schemas/sortable.schema.ts","../src/behaviors/sortable.ts","../src/schemas/resizable.schema.ts","../src/behaviors/resizable.ts","../src/schemas/clipboard.schema.ts","../src/behaviors/clipboard.ts","../src/schemas/autodismiss.schema.ts","../src/behaviors/autodismiss.ts","../src/schemas/clickoutside.schema.ts","../src/behaviors/clickoutside.ts","../src/schemas/focustrap.schema.ts","../src/behaviors/focustrap.ts","../src/schemas/scrollreveal.schema.ts","../src/behaviors/scrollreveal.ts","../src/schemas/tabs.schema.ts","../src/behaviors/tabs.ts","../src/index.ts","../src/registry.ts","../src/loaders.ts","../src/generated/metadata.ts","../src/curation.ts"],"sourcesContent":["import type { BehaviorSchema } from './types';\n\n/**\n * Draggable Behavior Schema\n *\n * Makes elements draggable with pointer events.\n * Supports custom drag handles and lifecycle events.\n */\nexport const draggableSchema: BehaviorSchema = {\n name: 'Draggable',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description:\n 'Makes elements draggable with pointer events (EXPERIMENTAL — stateful async component, beyond the inline-scripting boundary; not part of the curated set)',\n parameters: [\n {\n name: 'dragHandle',\n type: 'selector',\n optional: true,\n default: 'me',\n description: 'CSS selector for the drag handle element',\n },\n ],\n events: [\n { name: 'draggable:start', description: 'Fired when drag begins' },\n { name: 'draggable:move', description: 'Fired during each movement' },\n { name: 'draggable:end', description: 'Fired when drag completes' },\n ],\n requirements: ['position: absolute or position: fixed on the element'],\n source: `\nbehavior Draggable(dragHandle)\n on pointerdown(clientX, clientY) from (dragHandle or me)\n halt the event\n trigger draggable:start\n set xoff to clientX - my offsetLeft\n set yoff to clientY - my offsetTop\n repeat until event pointerup from document\n wait for pointermove(clientX, clientY) or\n pointerup(clientX, clientY) from document\n add { left: \\${clientX - xoff}px; top: \\${clientY - yoff}px; }\n trigger draggable:move\n end\n trigger draggable:end\n end\nend`.trim(),\n};\n","/**\n * Behavior Schema Types\n *\n * Defines the structure for behavior metadata used for:\n * - Code generation (TypeScript types, documentation)\n * - Runtime categorization and lazy loading\n * - Tooling and IDE integration\n */\n\n/**\n * Behavior categories for organization.\n * - ui: Visual interaction behaviors (drag, resize, sort)\n * - data: Data manipulation behaviors (remove, transform)\n * - animation: Animation and transition behaviors\n * - form: Form-related behaviors (validation, toggle states)\n * - layout: Layout behaviors (sticky, scrollspy)\n */\nexport type BehaviorCategory = 'ui' | 'data' | 'animation' | 'form' | 'layout';\n\n/**\n * Loading tiers for lazy loading optimization.\n * - core: Always loaded (essential behaviors)\n * - common: High usage (loaded for typical apps)\n * - optional: Low usage (loaded on demand)\n */\nexport type BehaviorTier = 'core' | 'common' | 'optional';\n\n/**\n * Schema for a behavior parameter.\n */\nexport interface ParameterSchema {\n name: string;\n type: 'string' | 'number' | 'boolean' | 'selector' | 'element';\n optional?: boolean;\n default?: string | number | boolean;\n /** Allowed values for constrained parameters */\n enum?: string[];\n description: string;\n}\n\n/**\n * Schema for a behavior event.\n */\nexport interface EventSchema {\n name: string;\n description: string;\n}\n\n/**\n * Complete schema for a behavior.\n * This is the source of truth for all behavior metadata.\n */\nexport interface BehaviorSchema {\n /** Behavior name (PascalCase) */\n name: string;\n /** Category for organization */\n category: BehaviorCategory;\n /** Loading tier for lazy loading */\n tier: BehaviorTier;\n /** Semantic version */\n version: string;\n /** Human-readable description */\n description: string;\n /** Parameter definitions */\n parameters: ParameterSchema[];\n /** Event definitions */\n events: EventSchema[];\n /** The hyperscript behavior source code */\n source: string;\n /** Optional requirements or notes */\n requirements?: string[];\n}\n\n/**\n * Runtime behavior module interface: a behavior's source, its schema, and the function that\n * defines it on a hyperscript host.\n */\nexport interface BehaviorModule {\n source: string;\n metadata: BehaviorSchema;\n register: (host?: HyperscriptHost) => Promise<void>;\n}\n\n/**\n * A hyperscript host, in upstream `_hyperscript`'s shape: `@hyperfixi/engine` (the\n * `hyperfixi-hs.js` bundle, `window.hyperfixi` / `window._hyperscript`) or upstream itself.\n * `evaluate(source)` of a `behavior … end` program defines the behavior; `processNode`\n * initialises the scripted elements under a node.\n */\nexport interface HyperscriptHost {\n evaluate: (source: string) => unknown;\n processNode?: (node: Node) => void;\n}\n\n/** The window globals a host installs itself as. */\nexport interface HyperscriptWindow {\n hyperfixi?: HyperscriptHost;\n _hyperscript?: HyperscriptHost;\n}\n\n/** The host on `window`: `hyperfixi` (the engine's bundle) or `_hyperscript` (upstream's name). */\nexport function resolveRuntime(): HyperscriptHost | null {\n if (typeof window === 'undefined') return null;\n const win = window as unknown as HyperscriptWindow;\n const host = win.hyperfixi ?? win._hyperscript;\n return host && typeof host.evaluate === 'function' ? host : null;\n}\n\n/**\n * Define a behavior on a host from its schema's source, as a page's\n * `<script type=\"text/hyperscript\">` would. Throws when there is no host or the source\n * does not parse.\n */\nexport function defineBehavior(schema: BehaviorSchema, host?: HyperscriptHost): void {\n const hf = host ?? resolveRuntime();\n if (!hf) {\n throw new Error(\n `No hyperscript host found: load @hyperfixi/engine (hyperfixi-hs.js) before defining ${schema.name}.`\n );\n }\n try {\n hf.evaluate(schema.source);\n } catch (e) {\n throw new Error(`Failed to define ${schema.name} behavior: ${(e as Error).message}`);\n }\n}\n","/**\n * Draggable Behavior\n *\n * Makes elements draggable with pointer events. Defined from its hyperscript\n * `source` (the single source of truth shared with the browser bundle and\n * patterns-reference) — no imperative installer. The source uses\n * `repeat until event pointerup` + `wait for pointermove or pointerup` to run the\n * drag loop, `my offsetLeft` / `my offsetTop` for the start offset, and\n * `add { left: ${…}px }` to move.\n *\n * @example\n * ```html\n * <!-- Basic usage -->\n * <div _=\"install Draggable\">Drag me!</div>\n *\n * <!-- With custom drag handle -->\n * <div _=\"install Draggable(dragHandle: .titlebar)\">\n * <div class=\"titlebar\">Drag here</div>\n * <div class=\"content\">Content</div>\n * </div>\n * ```\n */\n\nimport { draggableSchema } from '../schemas/draggable.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const draggableSource = draggableSchema.source;\nexport const draggableMetadata = draggableSchema;\n\n/**\n * Define the Draggable behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerDraggable(host?: HyperscriptHost): Promise<void> {\n defineBehavior(draggableSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerDraggable().catch(console.error);\n}\n\nexport default {\n source: draggableSchema.source,\n metadata: draggableSchema,\n register: registerDraggable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Removable Behavior Schema\n *\n * Removes an element when a trigger is clicked.\n * Supports optional confirmation and transition effects.\n *\n * @since 1.2.0 — `trigger` parameter renamed to `triggerEl` to avoid\n * shadowing the hyperscript `trigger` command keyword. Users migrating\n * from v1.x should update: `install Removable(triggerEl: .close-btn)`.\n */\nexport const removableSchema: BehaviorSchema = {\n name: 'Removable',\n category: 'data',\n tier: 'common',\n version: '1.2.0',\n description: 'Makes elements removable on click',\n parameters: [\n {\n name: 'triggerEl',\n type: 'selector',\n optional: true,\n default: 'me',\n description: 'Element that triggers removal (e.g., a close button)',\n },\n {\n name: 'confirmRemoval',\n type: 'boolean',\n optional: true,\n default: false,\n description: 'Show confirmation dialog before removal',\n },\n {\n name: 'effect',\n type: 'string',\n optional: true,\n default: 'none',\n enum: ['fade', 'none'],\n description: 'Transition effect: \"fade\" or \"none\"',\n },\n ],\n events: [\n { name: 'removable:before', description: 'Fired before removal (cancelable)' },\n { name: 'removable:removed', description: 'Fired after removal' },\n ],\n source: `\nbehavior Removable(triggerEl, confirmRemoval, effect)\n on click from (triggerEl or me)\n if confirmRemoval\n js(me)\n if (!window.confirm(\"Are you sure?\")) return \"cancel\";\n end\n if it is \"cancel\"\n halt\n end\n end\n trigger removable:before\n if effect is \"fade\"\n transition opacity to 0 over 300ms\n end\n trigger removable:removed\n remove me\n end\nend`.trim(),\n};\n","/**\n * Removable Behavior\n *\n * A behavior that removes an element when a trigger is clicked.\n * Supports optional confirmation and transition effects.\n *\n * @example\n * ```html\n * <div _=\"install Removable\">Click to remove</div>\n *\n * <div _=\"install Removable(confirm: true)\">With confirmation</div>\n * ```\n */\n\nimport { removableSchema } from '../schemas/removable.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const removableSource = removableSchema.source;\nexport const removableMetadata = removableSchema;\n\n/**\n * Define the Removable behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerRemovable(host?: HyperscriptHost): Promise<void> {\n defineBehavior(removableSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerRemovable().catch(console.error);\n}\n\nexport default {\n source: removableSchema.source,\n metadata: removableSchema,\n register: registerRemovable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Toggleable Behavior Schema\n *\n * Toggles a CSS class on click.\n * Useful for accordions, dropdowns, and toggle buttons.\n */\nexport const toggleableSchema: BehaviorSchema = {\n name: 'Toggleable',\n category: 'form',\n tier: 'core',\n version: '1.0.0',\n description: 'Toggles a CSS class on click',\n parameters: [\n {\n name: 'cls',\n type: 'string',\n optional: true,\n default: 'active',\n description: 'CSS class to toggle',\n },\n {\n name: 'targetEl',\n type: 'selector',\n optional: true,\n default: 'me',\n description:\n \"Element to toggle the class on (not `target`: that is hyperscript's name for the event target)\",\n },\n ],\n events: [\n { name: 'toggleable:on', description: 'Fired when class is added' },\n { name: 'toggleable:off', description: 'Fired when class is removed' },\n ],\n source: `\nbehavior Toggleable(cls, targetEl)\n init\n if cls is undefined set element's cls to \"active\" end\n if targetEl is undefined set element's targetEl to me end\n end\n on click\n toggle .{cls} on targetEl\n js(targetEl, cls)\n var eventName = targetEl.classList.contains(cls) ? 'toggleable:on' : 'toggleable:off';\n targetEl.dispatchEvent(new CustomEvent(eventName, { bubbles: true }));\n end\n end\nend`.trim(),\n};\n","/**\n * Toggleable Behavior\n *\n * A behavior that toggles a CSS class on click.\n * Useful for accordions, dropdowns, and toggle buttons.\n *\n * Defined from its hyperscript `source` (the single source of truth shared with\n * the browser bundle and patterns-reference). The `.{cls}` dynamic class\n * selector resolves the behavior's `cls` parameter at runtime.\n *\n * @example\n * ```html\n * <button _=\"install Toggleable\">Toggle</button>\n *\n * <button _=\"install Toggleable(cls: 'expanded', targetEl: #menu)\">Menu</button>\n * ```\n */\n\nimport { toggleableSchema } from '../schemas/toggleable.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const toggleableSource = toggleableSchema.source;\nexport const toggleableMetadata = toggleableSchema;\n\n/**\n * Define the Toggleable behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerToggleable(host?: HyperscriptHost): Promise<void> {\n defineBehavior(toggleableSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerToggleable().catch(console.error);\n}\n\nexport default {\n source: toggleableSchema.source,\n metadata: toggleableSchema,\n register: registerToggleable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Sortable Behavior Schema\n *\n * Drag-and-drop reordering of list items.\n * Apply to a container element; children become sortable.\n *\n * Note: This behavior fires lifecycle events but does NOT automatically\n * reorder DOM elements. Users must handle actual reordering in their\n * `sortable:move` event handlers.\n */\nexport const sortableSchema: BehaviorSchema = {\n name: 'Sortable',\n category: 'ui',\n tier: 'common',\n version: '1.0.0',\n description:\n 'Makes child elements reorderable via drag-and-drop (EXPERIMENTAL — stateful async component, beyond the inline-scripting boundary; not part of the curated set)',\n parameters: [\n {\n name: 'dragClass',\n type: 'string',\n optional: true,\n default: 'sorting',\n description: 'CSS class added to item during drag',\n },\n ],\n events: [\n { name: 'sortable:start', description: 'Fired when drag begins' },\n {\n name: 'sortable:move',\n description: 'Fired during drag — handle this event to reorder DOM elements',\n },\n { name: 'sortable:end', description: 'Fired when drag completes' },\n ],\n requirements: ['Users must handle DOM reordering in sortable:move event handlers'],\n source: `\nbehavior Sortable(dragClass)\n on pointerdown(clientY) from me\n set item to the target.closest(\"li\")\n if item is null\n exit\n end\n halt the event\n set cls to dragClass or \"sorting\"\n add .{cls} to item\n trigger sortable:start on me\n repeat until event pointerup from document\n wait for pointermove(clientY) or pointerup(clientY) from document\n trigger sortable:move on me\n end\n remove .{cls} from item\n trigger sortable:end on me\n end\nend`.trim(),\n};\n","/**\n * Sortable Behavior\n *\n * Drag-and-drop reordering of list items. Apply to a container element; its\n * `<li>` children become sortable. Defined from its hyperscript `source` (single\n * source of truth) — no imperative installer.\n *\n * Note: This behavior fires lifecycle events but does NOT automatically reorder\n * DOM elements. Users handle actual reordering in their `sortable:move` handlers.\n *\n * @example\n * ```html\n * <ul _=\"install Sortable\">\n * <li>Item 1</li>\n * <li>Item 2</li>\n * </ul>\n * ```\n */\n\nimport { sortableSchema } from '../schemas/sortable.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const sortableSource = sortableSchema.source;\nexport const sortableMetadata = sortableSchema;\n\n/**\n * Define the Sortable behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerSortable(host?: HyperscriptHost): Promise<void> {\n defineBehavior(sortableSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerSortable().catch(console.error);\n}\n\nexport default {\n source: sortableSchema.source,\n metadata: sortableSchema,\n register: registerSortable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Resizable Behavior Schema\n *\n * Makes elements resizable by dragging edges or corners.\n * Supports minimum/maximum dimensions and resize handles.\n */\nexport const resizableSchema: BehaviorSchema = {\n name: 'Resizable',\n category: 'ui',\n tier: 'optional',\n version: '1.0.0',\n description:\n 'Makes elements resizable by dragging (EXPERIMENTAL — stateful async component, beyond the inline-scripting boundary; not part of the curated set)',\n parameters: [\n {\n name: 'minWidth',\n type: 'number',\n optional: true,\n default: 50,\n description: 'Minimum width in pixels',\n },\n {\n name: 'minHeight',\n type: 'number',\n optional: true,\n default: 50,\n description: 'Minimum height in pixels',\n },\n {\n name: 'maxWidth',\n type: 'number',\n optional: true,\n default: 9999,\n description: 'Maximum width in pixels',\n },\n {\n name: 'maxHeight',\n type: 'number',\n optional: true,\n default: 9999,\n description: 'Maximum height in pixels',\n },\n ],\n events: [\n { name: 'resizable:start', description: 'Fired when resize begins' },\n { name: 'resizable:resize', description: 'Fired during resize' },\n { name: 'resizable:end', description: 'Fired when resize completes' },\n ],\n source: `\nbehavior Resizable(minWidth, minHeight, maxWidth, maxHeight)\n on pointerdown(clientX, clientY) from me\n halt the event\n trigger resizable:start\n set startWidth to my offsetWidth\n set startHeight to my offsetHeight\n set startX to clientX\n set startY to clientY\n repeat until event pointerup from document\n wait for pointermove(clientX, clientY) or pointerup(clientX, clientY) from document\n set newWidth to (startWidth + clientX) - startX\n set newHeight to (startHeight + clientY) - startY\n if newWidth < minWidth then set newWidth to minWidth end\n if newWidth > maxWidth then set newWidth to maxWidth end\n if newHeight < minHeight then set newHeight to minHeight end\n if newHeight > maxHeight then set newHeight to maxHeight end\n set my *width to newWidth + \"px\"\n set my *height to newHeight + \"px\"\n trigger resizable:resize\n end\n trigger resizable:end\n end\nend`.trim(),\n};\n","/**\n * Resizable Behavior\n *\n * Makes elements resizable by dragging. Defined from its hyperscript `source`\n * (single source of truth) — no imperative installer. The source reads the start\n * size from `my offsetWidth` / `my offsetHeight`, runs a `repeat until event pointerup` loop, clamps to\n * min/max dimensions, and writes `*width` / `*height` inline styles.\n *\n * @example\n * ```html\n * <div _=\"install Resizable\" style=\"width: 200px; height: 150px;\">\n * Resize me!\n * </div>\n * ```\n */\n\nimport { resizableSchema } from '../schemas/resizable.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const resizableSource = resizableSchema.source;\nexport const resizableMetadata = resizableSchema;\n\n/**\n * Define the Resizable behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerResizable(host?: HyperscriptHost): Promise<void> {\n defineBehavior(resizableSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerResizable().catch(console.error);\n}\n\nexport default {\n source: resizableSchema.source,\n metadata: resizableSchema,\n register: registerResizable,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * Clipboard Behavior Schema\n *\n * Copies text to clipboard on click with visual feedback.\n * Uses the Clipboard API with execCommand fallback.\n */\nexport const clipboardSchema: BehaviorSchema = {\n name: 'Clipboard',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description: 'Copies text to clipboard on click with visual feedback',\n parameters: [\n {\n name: 'text',\n type: 'string',\n optional: true,\n description: 'Literal text to copy (takes priority over source)',\n },\n {\n name: 'source',\n type: 'selector',\n optional: true,\n default: 'me',\n description: 'Element whose textContent or value is copied',\n },\n {\n name: 'feedback',\n type: 'selector',\n optional: true,\n description: 'Element to show .copied feedback on (defaults to the installed element)',\n },\n {\n name: 'feedbackDuration',\n type: 'number',\n optional: true,\n default: 2000,\n description: 'Duration in ms to show .copied class feedback',\n },\n ],\n events: [\n { name: 'clipboard:copied', description: 'Fired after text is copied successfully' },\n { name: 'clipboard:error', description: 'Fired when clipboard write fails' },\n ],\n requirements: [\n 'navigator.clipboard.writeText() requires HTTPS or localhost',\n 'Falls back to document.execCommand(\"copy\") for older browsers',\n ],\n source: `\nbehavior Clipboard(text, source, feedback, feedbackDuration)\n init\n if feedbackDuration is undefined set element's feedbackDuration to 2000 end\n if source is undefined set element's source to me end\n end\n on click\n if text is not undefined\n set copyText to text\n else\n set copyText to source's textContent\n end\n js(me, copyText, feedback, feedbackDuration)\n // Wrapped in an async IIFE: hyperscript's js() block has no top-level await.\n (async function() {\n async function copyToClipboard(t) {\n if (navigator.clipboard && navigator.clipboard.writeText) {\n await navigator.clipboard.writeText(t);\n return;\n }\n var ta = document.createElement('textarea');\n ta.value = t;\n ta.style.position = 'fixed';\n ta.style.opacity = '0';\n document.body.appendChild(ta);\n ta.select();\n try { document.execCommand('copy'); } finally { document.body.removeChild(ta); }\n }\n try {\n await copyToClipboard(copyText);\n var feedbackEl = feedback ? (typeof feedback === 'string' ? document.querySelector(feedback) : feedback) : me;\n if (!feedbackEl) feedbackEl = me;\n feedbackEl.classList.add('copied');\n me.dispatchEvent(new CustomEvent('clipboard:copied', { bubbles: true, detail: { text: copyText } }));\n setTimeout(function() { feedbackEl.classList.remove('copied'); }, feedbackDuration);\n } catch(err) {\n me.dispatchEvent(new CustomEvent('clipboard:error', { bubbles: true, detail: { error: err } }));\n }\n })();\n end\n end\nend`.trim(),\n};\n","/**\n * Clipboard Behavior\n *\n * Copies text to clipboard on click with visual feedback.\n * Uses navigator.clipboard.writeText() with execCommand fallback (in its\n * hyperscript `source`'s js() body).\n *\n * Defined from its hyperscript `source` (the single source of truth shared with\n * the browser bundle and patterns-reference).\n */\n\nimport { clipboardSchema } from '../schemas/clipboard.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const clipboardSource = clipboardSchema.source;\nexport const clipboardMetadata = clipboardSchema;\n\n/**\n * Define the Clipboard behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerClipboard(host?: HyperscriptHost): Promise<void> {\n defineBehavior(clipboardSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerClipboard().catch(console.error);\n}\n\nexport default {\n source: clipboardSchema.source,\n metadata: clipboardSchema,\n register: registerClipboard,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * AutoDismiss Behavior Schema\n *\n * Auto-removes flash messages and toasts after a configurable delay.\n * Supports pause-on-hover and fade effect.\n */\nexport const autoDismissSchema: BehaviorSchema = {\n name: 'AutoDismiss',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description: 'Auto-removes elements after a delay with optional pause-on-hover',\n parameters: [\n {\n name: 'delay',\n type: 'number',\n optional: true,\n default: 5000,\n description: 'Time in ms before the element is removed',\n },\n {\n name: 'pauseOnHover',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Pause the countdown when the mouse hovers over the element',\n },\n {\n name: 'effect',\n type: 'string',\n optional: true,\n default: 'none',\n enum: ['fade', 'none'],\n description: 'Transition effect before removal: \"fade\" or \"none\"',\n },\n ],\n events: [\n { name: 'autodismiss:start', description: 'Fired when the countdown timer starts' },\n {\n name: 'autodismiss:dismissed',\n description: 'Fired before removal (cancelable via preventDefault)',\n },\n { name: 'autodismiss:paused', description: 'Fired when the timer is paused on hover' },\n { name: 'autodismiss:resumed', description: 'Fired when the timer resumes on mouseleave' },\n ],\n source: `\nbehavior AutoDismiss(delay, pauseOnHover, effect)\n init\n if delay is undefined set element's delay to 5000 end\n if pauseOnHover is undefined set element's pauseOnHover to true end\n if effect is undefined set element's effect to \"none\" end\n js(me, delay, effect, pauseOnHover)\n me.dispatchEvent(new CustomEvent('autodismiss:start', { bubbles: true }));\n var remaining = delay;\n var startedAt = Date.now();\n var timerId = null;\n function dismiss() {\n var ev = new CustomEvent('autodismiss:dismissed', { bubbles: true, cancelable: true });\n me.dispatchEvent(ev);\n if (ev.defaultPrevented) return;\n if (effect === 'fade') {\n me.style.transition = 'opacity 300ms';\n me.style.opacity = '0';\n setTimeout(function() { me.remove(); }, 300);\n } else {\n me.remove();\n }\n }\n function start() {\n startedAt = Date.now();\n timerId = setTimeout(dismiss, remaining);\n }\n start();\n if (pauseOnHover) {\n me.addEventListener('mouseenter', function() {\n if (timerId != null) {\n clearTimeout(timerId);\n timerId = null;\n remaining -= Date.now() - startedAt;\n if (remaining < 0) remaining = 0;\n me.dispatchEvent(new CustomEvent('autodismiss:paused', { bubbles: true }));\n }\n });\n me.addEventListener('mouseleave', function() {\n if (timerId == null && me.isConnected) {\n me.dispatchEvent(new CustomEvent('autodismiss:resumed', { bubbles: true }));\n start();\n }\n });\n }\n end\n end\nend`.trim(),\n};\n","/**\n * AutoDismiss Behavior\n *\n * Auto-removes elements after a configurable delay.\n * Supports pause-on-hover and fade effect using standard setTimeout/clearTimeout\n * (in its hyperscript `source`'s js() body).\n *\n * Defined from its hyperscript `source` (the single source of truth shared with\n * the browser bundle and patterns-reference).\n */\n\nimport { autoDismissSchema } from '../schemas/autodismiss.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const autoDismissSource = autoDismissSchema.source;\nexport const autoDismissMetadata = autoDismissSchema;\n\n/**\n * Define the AutoDismiss behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerAutoDismiss(host?: HyperscriptHost): Promise<void> {\n defineBehavior(autoDismissSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerAutoDismiss().catch(console.error);\n}\n\nexport default {\n source: autoDismissSchema.source,\n metadata: autoDismissSchema,\n register: registerAutoDismiss,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * ClickOutside Behavior Schema\n *\n * Fires an event when the user clicks outside the element.\n * Uses pointerdown instead of click to avoid timing issues.\n */\nexport const clickOutsideSchema: BehaviorSchema = {\n name: 'ClickOutside',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description: 'Fires an event when the user clicks outside the element',\n parameters: [\n {\n name: 'active',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Whether the listener is active (can be toggled programmatically)',\n },\n ],\n events: [\n { name: 'clickoutside', description: 'Fired when a pointer press occurs outside the element' },\n {\n name: 'clickoutside:activate',\n description: 'Listen for this event to programmatically activate detection',\n },\n {\n name: 'clickoutside:deactivate',\n description: 'Listen for this event to programmatically deactivate detection',\n },\n ],\n requirements: ['Uses pointerdown instead of click to avoid timing issues with removed elements'],\n source: `\nbehavior ClickOutside(active)\n init\n if active is undefined set element's active to true end\n end\n on pointerdown from document\n js(me, active, event)\n if (!me.isConnected) return;\n if (active && !me.contains(event.target)) {\n me.dispatchEvent(new CustomEvent('clickoutside', { bubbles: true }));\n }\n end\n end\n on clickoutside:activate\n set element's active to true\n end\n on clickoutside:deactivate\n set element's active to false\n end\nend`.trim(),\n};\n","/**\n * ClickOutside Behavior\n *\n * Fires a clickoutside event when the user clicks outside the element.\n * Uses pointerdown instead of click to avoid timing issues.\n *\n * Defined from its hyperscript `source` (the single source of truth shared with\n * the browser bundle and patterns-reference).\n */\n\nimport { clickOutsideSchema } from '../schemas/clickoutside.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const clickOutsideSource = clickOutsideSchema.source;\nexport const clickOutsideMetadata = clickOutsideSchema;\n\n/**\n * Define the ClickOutside behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerClickOutside(host?: HyperscriptHost): Promise<void> {\n defineBehavior(clickOutsideSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerClickOutside().catch(console.error);\n}\n\nexport default {\n source: clickOutsideSchema.source,\n metadata: clickOutsideSchema,\n register: registerClickOutside,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * FocusTrap Behavior Schema\n *\n * Confines Tab navigation inside an element and restores focus on release.\n * Manages aria-modal for accessibility compliance.\n */\nexport const focusTrapSchema: BehaviorSchema = {\n name: 'FocusTrap',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description: 'Confines Tab navigation inside an element with ARIA support',\n parameters: [\n {\n name: 'active',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Whether the trap is active on install',\n },\n {\n name: 'initialFocus',\n type: 'selector',\n optional: true,\n description: 'Element to focus when the trap activates',\n },\n {\n name: 'returnFocus',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Restore focus to the previously focused element on deactivation',\n },\n ],\n events: [\n { name: 'focustrap:activated', description: 'Fired when the trap is activated' },\n { name: 'focustrap:deactivated', description: 'Fired when the trap is deactivated' },\n ],\n requirements: [\n 'Sets aria-modal=\"true\" on the element when active',\n 'Listens for focustrap:activate and focustrap:deactivate custom events for programmatic control',\n ],\n source: `\nbehavior FocusTrap(active, initialFocus, returnFocus)\n init\n if active is undefined set element's active to true end\n if returnFocus is undefined set element's returnFocus to true end\n js(me, active, initialFocus, returnFocus)\n var FOCUSABLE = 'a[href],button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),[tabindex]:not([tabindex=\"-1\"])';\n var isActive = false;\n var previouslyFocused = null;\n function getFocusable() { return Array.from(me.querySelectorAll(FOCUSABLE)); }\n function activate() {\n if (isActive) return;\n isActive = true;\n previouslyFocused = document.activeElement;\n me.setAttribute('aria-modal', 'true');\n var initEl = initialFocus ? (typeof initialFocus === 'string' ? me.querySelector(initialFocus) : initialFocus) : null;\n if (initEl) { initEl.focus(); } else { var f = getFocusable(); if (f.length) f[0].focus(); }\n me.dispatchEvent(new CustomEvent('focustrap:activated', { bubbles: true }));\n }\n function deactivate() {\n if (!isActive) return;\n isActive = false;\n me.removeAttribute('aria-modal');\n if (returnFocus && previouslyFocused instanceof HTMLElement) previouslyFocused.focus();\n previouslyFocused = null;\n me.dispatchEvent(new CustomEvent('focustrap:deactivated', { bubbles: true }));\n }\n me.addEventListener('keydown', function(e) {\n if (!isActive || e.key !== 'Tab') return;\n var focusable = getFocusable();\n if (focusable.length === 0) { e.preventDefault(); return; }\n e.preventDefault();\n var idx = focusable.indexOf(document.activeElement);\n if (e.shiftKey) {\n focusable[idx <= 0 ? focusable.length - 1 : idx - 1].focus();\n } else {\n focusable[idx >= focusable.length - 1 ? 0 : idx + 1].focus();\n }\n });\n me.addEventListener('focustrap:activate', function() { activate(); });\n me.addEventListener('focustrap:deactivate', function() { deactivate(); });\n if (active) activate();\n end\n end\nend`.trim(),\n};\n","/**\n * FocusTrap Behavior\n *\n * Confines Tab navigation inside an element, manages aria-modal,\n * and restores focus on deactivation. The Tab-trapping / focus-model logic\n * lives in the schema's hyperscript `source` (an `init`-block `js()` body).\n *\n * Defined from its hyperscript `source` — the single source of truth shared with\n * the browser bundle and patterns-reference. This collapses FocusTrap onto\n * the one runtime path (no more imperative-installer fork between CDN and npm);\n * see docs-internal/BEHAVIORS_CONSOLIDATION_PLAN.md §3d.\n */\n\nimport { focusTrapSchema } from '../schemas/focustrap.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const focusTrapSource = focusTrapSchema.source;\nexport const focusTrapMetadata = focusTrapSchema;\n\n/**\n * Define the FocusTrap behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerFocusTrap(host?: HyperscriptHost): Promise<void> {\n defineBehavior(focusTrapSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerFocusTrap().catch(console.error);\n}\n\nexport default {\n source: focusTrapSchema.source,\n metadata: focusTrapSchema,\n register: registerFocusTrap,\n};\n","import type { BehaviorSchema } from './types';\n\n/**\n * ScrollReveal Behavior Schema\n *\n * Adds a class or fires events when the element enters or exits the viewport.\n * Uses the IntersectionObserver web standard API.\n */\nexport const scrollRevealSchema: BehaviorSchema = {\n name: 'ScrollReveal',\n category: 'layout',\n tier: 'common',\n version: '1.0.0',\n description: 'Adds a class when the element enters the viewport via IntersectionObserver',\n parameters: [\n {\n name: 'cls',\n type: 'string',\n optional: true,\n default: 'revealed',\n description: 'CSS class added when element enters viewport',\n },\n {\n name: 'threshold',\n type: 'number',\n optional: true,\n default: 0.1,\n description: 'Intersection ratio threshold (0-1) for triggering',\n },\n {\n name: 'once',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'If true, disconnect observer after first intersection',\n },\n ],\n events: [\n { name: 'scrollreveal:enter', description: 'Fired when the element enters the viewport' },\n { name: 'scrollreveal:exit', description: 'Fired when the element exits the viewport' },\n ],\n requirements: ['Uses IntersectionObserver API (supported in all modern browsers)'],\n source: `\nbehavior ScrollReveal(cls, threshold, once)\n init\n if cls is undefined set element's cls to \"revealed\" end\n if threshold is undefined set element's threshold to 0.1 end\n if once is undefined set element's once to true end\n js(me, cls, threshold, once)\n var obs = new IntersectionObserver(function(entries) {\n for (var i = 0; i < entries.length; i++) {\n if (entries[i].isIntersecting) {\n me.classList.add(cls);\n me.dispatchEvent(new CustomEvent('scrollreveal:enter', { bubbles: true }));\n if (once) obs.disconnect();\n } else if (!once) {\n me.classList.remove(cls);\n me.dispatchEvent(new CustomEvent('scrollreveal:exit', { bubbles: true }));\n }\n }\n }, { threshold: threshold });\n obs.observe(me);\n end\n end\nend`.trim(),\n};\n","/**\n * ScrollReveal Behavior\n *\n * Adds a class or fires events when the element enters or exits the viewport.\n * Uses the IntersectionObserver web standard API (in its hyperscript `source`'s\n * `init`-block `js()` body).\n *\n * Defined from its hyperscript `source` — the single source of truth shared with\n * the browser bundle and patterns-reference. This collapses ScrollReveal onto\n * the one runtime path (no more imperative-installer fork between CDN and npm);\n * see docs-internal/BEHAVIORS_CONSOLIDATION_PLAN.md §3d.\n */\n\nimport { scrollRevealSchema } from '../schemas/scrollreveal.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\n// Re-export schema-derived values\nexport const scrollRevealSource = scrollRevealSchema.source;\nexport const scrollRevealMetadata = scrollRevealSchema;\n\n/**\n * Define the ScrollReveal behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerScrollReveal(host?: HyperscriptHost): Promise<void> {\n defineBehavior(scrollRevealSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerScrollReveal().catch(console.error);\n}\n\nexport default {\n source: scrollRevealSchema.source,\n metadata: scrollRevealSchema,\n register: registerScrollReveal,\n};\n","import type { BehaviorSchema } from './types';\n\nexport const tabsSchema: BehaviorSchema = {\n name: 'Tabs',\n category: 'ui',\n tier: 'core',\n version: '1.0.0',\n description:\n 'WAI-ARIA compliant tabs with roving tabindex keyboard navigation. ' +\n 'Auto-wires role, aria-selected, aria-controls, and aria-labelledby attributes.',\n parameters: [\n {\n name: 'orientation',\n type: 'string',\n optional: true,\n default: 'horizontal',\n enum: ['horizontal', 'vertical'],\n description: 'Arrow key direction: horizontal (Left/Right) or vertical (Up/Down)',\n },\n {\n name: 'activeTab',\n type: 'number',\n optional: true,\n default: 0,\n description: 'Initial active tab index (zero-based)',\n },\n {\n name: 'wrap',\n type: 'boolean',\n optional: true,\n default: true,\n description: 'Wrap to first/last tab when navigating past the end',\n },\n {\n name: 'activeClass',\n type: 'string',\n optional: true,\n default: 'active',\n description: 'CSS class applied to the active tab and its panel',\n },\n ],\n events: [\n {\n name: 'tabs:change',\n description: 'Fired before tab selection changes (cancelable via preventDefault)',\n },\n { name: 'tabs:changed', description: 'Fired after tab selection has changed' },\n ],\n requirements: [\n 'Sets role=\"tablist\" on the tab container',\n 'Sets role=\"tab\" on tab buttons and role=\"tabpanel\" on content panels',\n 'Manages aria-selected, aria-controls, aria-labelledby, and tabindex',\n 'Keyboard: Arrow keys navigate, Home/End jump to first/last, Tab exits tablist',\n ],\n source: `\nbehavior Tabs(orientation, activeTab, wrap, activeClass)\n init\n if orientation is undefined set element's orientation to \"horizontal\" end\n if activeTab is undefined set element's activeTab to 0 end\n if wrap is undefined set element's wrap to true end\n if activeClass is undefined set element's activeClass to \"active\" end\n js(me, orientation, activeTab, wrap, activeClass)\n var tabs = Array.from(me.querySelectorAll('[role=\"tab\"]'));\n var panels = Array.from(me.querySelectorAll('[role=\"tabpanel\"]'));\n if (tabs.length === 0 || panels.length === 0) return;\n var tablist = me.querySelector('[role=\"tablist\"]') || tabs[0].parentElement;\n if (tablist) tablist.setAttribute('aria-orientation', orientation);\n var count = Math.min(tabs.length, panels.length);\n var idN = 0;\n for (var i = 0; i < count; i++) {\n if (!tabs[i].id) tabs[i].id = 'tab-' + (++idN);\n if (!panels[i].id) panels[i].id = 'tabpanel-' + idN;\n tabs[i].setAttribute('aria-controls', panels[i].id);\n panels[i].setAttribute('aria-labelledby', tabs[i].id);\n }\n var cur = Math.max(0, Math.min(activeTab, count - 1));\n function activate(idx, prev) {\n if (idx === prev || idx < 0 || idx >= count) return false;\n var ev = new CustomEvent('tabs:change', { bubbles: true, cancelable: true, detail: { index: idx, previousIndex: prev } });\n me.dispatchEvent(ev);\n if (ev.defaultPrevented) return false;\n if (prev >= 0 && prev < count) {\n tabs[prev].setAttribute('aria-selected', 'false');\n tabs[prev].setAttribute('tabindex', '-1');\n tabs[prev].classList.remove(activeClass);\n panels[prev].setAttribute('aria-hidden', 'true');\n panels[prev].classList.remove(activeClass);\n }\n tabs[idx].setAttribute('aria-selected', 'true');\n tabs[idx].setAttribute('tabindex', '0');\n tabs[idx].classList.add(activeClass);\n panels[idx].setAttribute('aria-hidden', 'false');\n panels[idx].classList.add(activeClass);\n cur = idx;\n me.dispatchEvent(new CustomEvent('tabs:changed', { bubbles: true, detail: { index: idx } }));\n return true;\n }\n for (var j = 0; j < count; j++) {\n tabs[j].setAttribute('aria-selected', 'false');\n tabs[j].setAttribute('tabindex', '-1');\n panels[j].setAttribute('aria-hidden', 'true');\n panels[j].classList.remove(activeClass);\n }\n tabs[cur].setAttribute('aria-selected', 'true');\n tabs[cur].setAttribute('tabindex', '0');\n tabs[cur].classList.add(activeClass);\n panels[cur].setAttribute('aria-hidden', 'false');\n panels[cur].classList.add(activeClass);\n for (var k = 0; k < count; k++) {\n (function(idx) {\n tabs[idx].addEventListener('click', function() { if (activate(idx, cur)) tabs[idx].focus(); });\n })(k);\n }\n (tablist || me).addEventListener('keydown', function(e) {\n var nk = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';\n var pk = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';\n var next = null;\n if (e.key === nk) { next = cur + 1; if (next >= count) next = wrap ? 0 : null; }\n else if (e.key === pk) { next = cur - 1; if (next < 0) next = wrap ? count - 1 : null; }\n else if (e.key === 'Home') next = 0;\n else if (e.key === 'End') next = count - 1;\n if (next !== null) { e.preventDefault(); if (activate(next, cur)) tabs[next].focus(); }\n });\n end\n end\nend`.trim(),\n};\n","/**\n * Tabs Behavior\n *\n * WAI-ARIA compliant tabs with roving tabindex keyboard navigation.\n * Auto-wires role, aria-selected, aria-controls, and aria-labelledby. The ARIA\n * wiring / keyboard-navigation logic lives in the schema's hyperscript `source`\n * (an `init`-block `js()` body).\n *\n * Defined from its hyperscript `source` — the single source of truth shared with\n * the browser bundle and patterns-reference. This collapses Tabs onto the one\n * runtime path (no more imperative-installer fork between CDN and npm);\n * see docs-internal/BEHAVIORS_CONSOLIDATION_PLAN.md §3d.\n */\n\nimport { tabsSchema } from '../schemas/tabs.schema';\nimport { defineBehavior, resolveRuntime } from '../schemas/types';\nimport type { HyperscriptHost } from '../schemas/types';\n\nexport const tabsSource = tabsSchema.source;\nexport const tabsMetadata = tabsSchema;\n\n/**\n * Define the Tabs behavior on a hyperscript host (`window.hyperfixi` when none is given)\n * from its source, as a `<script type=\"text/hyperscript\">` would.\n */\nexport async function registerTabs(host?: HyperscriptHost): Promise<void> {\n defineBehavior(tabsSchema, host);\n}\n\n// Auto-register when loaded as a script tag\nif (resolveRuntime()) {\n registerTabs().catch(console.error);\n}\n\nexport default {\n source: tabsSchema.source,\n metadata: tabsSchema,\n register: registerTabs,\n};\n","/**\n * @hyperfixi/behaviors\n *\n * Reusable hyperscript behaviors for LokaScript.\n * Each behavior can be imported individually for tree-shaking,\n * or all behaviors can be registered at once.\n *\n * @example Individual import (tree-shakeable)\n * ```javascript\n * import { registerDraggable } from '@hyperfixi/behaviors/draggable';\n * await registerDraggable();\n * ```\n *\n * @example Import all\n * ```javascript\n * import { registerAll } from '@hyperfixi/behaviors';\n * await registerAll();\n * ```\n *\n * @example Registry-based lazy loading\n * ```javascript\n * import { loadBehavior, getBehaviorsByCategory } from '@hyperfixi/behaviors';\n * await loadBehavior('Draggable');\n * const uiBehaviors = getBehaviorsByCategory('ui');\n * ```\n *\n * @example CDN usage\n * ```html\n * <script src=\"hyperfixi-hs.js\"></script>\n * <script src=\"@hyperfixi/behaviors/draggable.browser.js\"></script>\n * <!-- Draggable is auto-registered -->\n * ```\n */\n\n// =============================================================================\n// Re-export individual behaviors\n// =============================================================================\n\nexport {\n draggableSource,\n draggableMetadata,\n registerDraggable,\n default as Draggable,\n} from './behaviors/draggable';\n\nexport {\n removableSource,\n removableMetadata,\n registerRemovable,\n default as Removable,\n} from './behaviors/removable';\n\nexport {\n toggleableSource,\n toggleableMetadata,\n registerToggleable,\n default as Toggleable,\n} from './behaviors/toggleable';\n\nexport {\n sortableSource,\n sortableMetadata,\n registerSortable,\n default as Sortable,\n} from './behaviors/sortable';\n\nexport {\n resizableSource,\n resizableMetadata,\n registerResizable,\n default as Resizable,\n} from './behaviors/resizable';\n\nexport {\n clipboardSource,\n clipboardMetadata,\n registerClipboard,\n default as Clipboard,\n} from './behaviors/clipboard';\n\nexport {\n autoDismissSource,\n autoDismissMetadata,\n registerAutoDismiss,\n default as AutoDismiss,\n} from './behaviors/autodismiss';\n\nexport {\n clickOutsideSource,\n clickOutsideMetadata,\n registerClickOutside,\n default as ClickOutside,\n} from './behaviors/clickoutside';\n\nexport {\n focusTrapSource,\n focusTrapMetadata,\n registerFocusTrap,\n default as FocusTrap,\n} from './behaviors/focustrap';\n\nexport {\n scrollRevealSource,\n scrollRevealMetadata,\n registerScrollReveal,\n default as ScrollReveal,\n} from './behaviors/scrollreveal';\n\nexport { tabsSource, tabsMetadata, registerTabs, default as Tabs } from './behaviors/tabs';\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport type {\n BehaviorSchema,\n BehaviorCategory,\n BehaviorTier,\n ParameterSchema,\n EventSchema,\n BehaviorModule,\n HyperscriptHost,\n HyperscriptWindow,\n} from './schemas/types';\n\n// =============================================================================\n// Initialize registry with loaders (populates schemas and loaders)\n// =============================================================================\n\nimport './loaders';\n\n// =============================================================================\n// Registry exports\n// =============================================================================\n\nexport {\n // Registration\n registerBehavior,\n registerSchema,\n registerLoader,\n // Query (sync)\n getBehavior,\n tryGetBehavior,\n getSchema,\n tryGetSchema,\n isRegistered,\n hasLoader,\n getRegisteredBehaviors,\n getAvailableBehaviors,\n // Query by metadata\n getBehaviorsByCategory,\n getBehaviorsByTier,\n getAllSchemas,\n getAllSchemasRecord,\n // Lazy loading (async)\n loadBehavior,\n preloadTier,\n preloadCategory,\n loadAll,\n // Runtime registration\n registerWithRuntime,\n registerAllWithRuntime,\n} from './registry';\n\n// =============================================================================\n// Generated types and metadata\n// =============================================================================\n\nexport type {\n BehaviorName,\n UIBehavior,\n DataBehavior,\n AnimationBehavior,\n FormBehavior,\n LayoutBehavior,\n CoreBehavior,\n CommonBehavior,\n OptionalBehavior,\n} from './generated/types';\n\nexport {\n ALL_BEHAVIOR_NAMES,\n BEHAVIORS_BY_CATEGORY,\n BEHAVIORS_BY_TIER,\n BEHAVIOR_CATEGORIES,\n BEHAVIOR_TIERS,\n} from './generated/metadata';\n\n// =============================================================================\n// Curation status (curated / optional / experimental) — see curation.ts\n// =============================================================================\n\nexport type { CurationStatus } from './curation';\nexport {\n CURATED_BEHAVIORS,\n OPTIONAL_BEHAVIORS,\n EXPERIMENTAL_BEHAVIORS,\n CURATION_STATUS,\n curationStatusOf,\n isCurated,\n} from './curation';\n\n// =============================================================================\n// Convenience functions\n// =============================================================================\n\nimport { registerDraggable } from './behaviors/draggable';\nimport { registerRemovable } from './behaviors/removable';\nimport { registerToggleable } from './behaviors/toggleable';\nimport { registerSortable } from './behaviors/sortable';\nimport { registerResizable } from './behaviors/resizable';\nimport { registerClipboard } from './behaviors/clipboard';\nimport { registerAutoDismiss } from './behaviors/autodismiss';\nimport { registerClickOutside } from './behaviors/clickoutside';\nimport { registerFocusTrap } from './behaviors/focustrap';\nimport { registerScrollReveal } from './behaviors/scrollreveal';\nimport { registerTabs } from './behaviors/tabs';\nimport type { HyperscriptHost } from './schemas/types';\nimport { resolveRuntime } from './schemas/types';\n\n/**\n * Define every behavior on a hyperscript host.\n *\n * @param host - The host (`@hyperfixi/engine`'s `window.hyperfixi`, or upstream's\n * `window._hyperscript`); defaults to the one on `window`\n *\n * @example\n * ```javascript\n * import { registerAll } from '@hyperfixi/behaviors';\n * await registerAll();\n * ```\n */\nexport async function registerAll(host?: HyperscriptHost): Promise<void> {\n await Promise.all([\n registerDraggable(host),\n registerRemovable(host),\n registerToggleable(host),\n registerSortable(host),\n registerResizable(host),\n registerClipboard(host),\n registerAutoDismiss(host),\n registerClickOutside(host),\n registerFocusTrap(host),\n registerScrollReveal(host),\n registerTabs(host),\n ]);\n}\n\n// =============================================================================\n// Auto-definition for the browser bundles\n// =============================================================================\n\n/**\n * Resolves when every behavior is defined, when the package was loaded as a script tag after\n * the host; `null` otherwise.\n */\nexport let ready: Promise<void> | null = null;\n\n// Loaded as a script tag after the host, before the document is ready, this runs before the\n// host reads the page, so every `install` finds its behavior. Loaded later, the elements the\n// host has already seen are processed again, so their installs can succeed now.\nconst _host = resolveRuntime();\nif (_host) {\n ready = registerAll(_host)\n .then(() => {\n if (document.readyState !== 'loading') _host.processNode?.(document.body);\n })\n .catch(err => {\n console.error('[behaviors] Auto-definition failed:', err);\n });\n}\n","/**\n * Behavior Registry\n *\n * Central registration point for behaviors. Modeled on semantic/registry.ts.\n * Supports lazy loading, category/tier queries, and tree-shaking.\n *\n * @example\n * ```typescript\n * // Register a behavior\n * registerBehavior('Draggable', DraggableModule);\n *\n * // Query behaviors\n * const uiBehaviors = getBehaviorsByCategory('ui');\n * const coreBehaviors = getBehaviorsByTier('core');\n *\n * // Lazy load on demand\n * const module = await loadBehavior('Resizable');\n * ```\n */\n\nimport type {\n BehaviorModule,\n BehaviorSchema,\n BehaviorCategory,\n BehaviorTier,\n HyperscriptHost,\n} from './schemas/types';\n\n// =============================================================================\n// Registry State\n// =============================================================================\n\nconst behaviors = new Map<string, BehaviorModule>();\nconst schemas = new Map<string, BehaviorSchema>();\nconst loaders = new Map<string, () => Promise<{ default: BehaviorModule }>>();\nconst loadingPromises = new Map<string, Promise<BehaviorModule>>();\n\n// =============================================================================\n// Registration Functions\n// =============================================================================\n\n/**\n * Register a behavior module.\n */\nexport function registerBehavior(name: string, module: BehaviorModule): void {\n behaviors.set(name, module);\n if (module.metadata) {\n schemas.set(name, module.metadata);\n }\n}\n\n/**\n * Register a behavior schema (without the module).\n */\nexport function registerSchema(schema: BehaviorSchema): void {\n schemas.set(schema.name, schema);\n}\n\n/**\n * Register a lazy loader for a behavior.\n * The loader should return a module with a default export.\n */\nexport function registerLoader(\n name: string,\n loader: () => Promise<{ default: BehaviorModule }>\n): void {\n loaders.set(name, loader);\n}\n\n// =============================================================================\n// Query Functions (Sync)\n// =============================================================================\n\n/**\n * Get a behavior module by name.\n * @throws Error if behavior is not registered\n */\nexport function getBehavior(name: string): BehaviorModule {\n const behavior = behaviors.get(name);\n if (!behavior) {\n const registered = Array.from(behaviors.keys()).join(', ');\n throw new Error(\n `Behavior '${name}' is not registered. ` +\n `Registered behaviors: ${registered || 'none'}. ` +\n `Use loadBehavior('${name}') to lazy load it.`\n );\n }\n return behavior;\n}\n\n/**\n * Try to get a behavior, returning undefined if not registered.\n */\nexport function tryGetBehavior(name: string): BehaviorModule | undefined {\n return behaviors.get(name);\n}\n\n/**\n * Get a behavior schema by name.\n * @throws Error if schema is not registered\n */\nexport function getSchema(name: string): BehaviorSchema {\n const schema = schemas.get(name);\n if (!schema) {\n throw new Error(\n `Schema for behavior '${name}' is not registered. ` +\n `Use tryGetSchema('${name}') for a non-throwing alternative.`\n );\n }\n return schema;\n}\n\n/**\n * Try to get a schema, returning undefined if not registered.\n */\nexport function tryGetSchema(name: string): BehaviorSchema | undefined {\n return schemas.get(name);\n}\n\n/**\n * Check if a behavior is registered.\n */\nexport function isRegistered(name: string): boolean {\n return behaviors.has(name);\n}\n\n/**\n * Check if a loader is registered for a behavior.\n */\nexport function hasLoader(name: string): boolean {\n return loaders.has(name);\n}\n\n/**\n * Get all registered behavior names.\n */\nexport function getRegisteredBehaviors(): string[] {\n return Array.from(behaviors.keys());\n}\n\n/**\n * Get all behavior names that have loaders (including unloaded).\n */\nexport function getAvailableBehaviors(): string[] {\n const names = new Set([...behaviors.keys(), ...loaders.keys()]);\n return Array.from(names);\n}\n\n// =============================================================================\n// Query by Metadata\n// =============================================================================\n\n/**\n * Get behavior names by category.\n */\nexport function getBehaviorsByCategory(category: BehaviorCategory): string[] {\n const result: string[] = [];\n for (const [name, schema] of schemas) {\n if (schema.category === category) {\n result.push(name);\n }\n }\n return result;\n}\n\n/**\n * Get behavior names by tier.\n */\nexport function getBehaviorsByTier(tier: BehaviorTier): string[] {\n const result: string[] = [];\n for (const [name, schema] of schemas) {\n if (schema.tier === tier) {\n result.push(name);\n }\n }\n return result;\n}\n\n/**\n * Get all schemas.\n */\nexport function getAllSchemas(): BehaviorSchema[] {\n return Array.from(schemas.values());\n}\n\n/**\n * Get all schemas as a record.\n */\nexport function getAllSchemasRecord(): Record<string, BehaviorSchema> {\n const result: Record<string, BehaviorSchema> = {};\n for (const [name, schema] of schemas) {\n result[name] = schema;\n }\n return result;\n}\n\n// =============================================================================\n// Lazy Loading (Async)\n// =============================================================================\n\n/**\n * Load a behavior by name.\n * If already loaded, returns the cached module.\n * If a loader is registered, loads and caches the module.\n */\nexport async function loadBehavior(name: string): Promise<BehaviorModule> {\n // Return cached if available\n const cached = behaviors.get(name);\n if (cached) {\n return cached;\n }\n\n // Check for in-flight load\n const inFlight = loadingPromises.get(name);\n if (inFlight) {\n return inFlight;\n }\n\n // Check for loader\n const loader = loaders.get(name);\n if (!loader) {\n throw new Error(\n `No loader registered for behavior '${name}'. ` +\n `Available loaders: ${Array.from(loaders.keys()).join(', ') || 'none'}`\n );\n }\n\n // Load and cache\n const promise = loader().then(mod => {\n const module = mod.default;\n registerBehavior(name, module);\n loadingPromises.delete(name);\n return module;\n });\n\n loadingPromises.set(name, promise);\n return promise;\n}\n\n/**\n * Preload all behaviors in a tier.\n */\nexport async function preloadTier(tier: BehaviorTier): Promise<void> {\n const names = getBehaviorsByTier(tier);\n await Promise.all(\n names.map(name =>\n loadBehavior(name).catch(err => {\n console.warn(`[behaviors] Failed to preload '${name}' (tier: ${tier}):`, err);\n })\n )\n );\n}\n\n/**\n * Preload all behaviors in a category.\n */\nexport async function preloadCategory(category: BehaviorCategory): Promise<void> {\n const names = getBehaviorsByCategory(category);\n await Promise.all(\n names.map(name =>\n loadBehavior(name).catch(err => {\n console.warn(`[behaviors] Failed to preload '${name}' (category: ${category}):`, err);\n })\n )\n );\n}\n\n/**\n * Load and register all available behaviors.\n */\nexport async function loadAll(): Promise<void> {\n const names = getAvailableBehaviors();\n await Promise.all(\n names.map(name =>\n loadBehavior(name).catch(err => {\n console.warn(`[behaviors] Failed to load '${name}':`, err);\n })\n )\n );\n}\n\n// =============================================================================\n// Runtime Registration\n// =============================================================================\n\n/**\n * Load a behavior and define it on a hyperscript host (`window.hyperfixi` when none is given).\n */\nexport async function registerWithRuntime(name: string, host?: HyperscriptHost): Promise<void> {\n const module = await loadBehavior(name);\n await module.register(host);\n}\n\n/**\n * Define every loaded behavior on a hyperscript host.\n */\nexport async function registerAllWithRuntime(host?: HyperscriptHost): Promise<void> {\n const registrations = Array.from(behaviors.values()).map(module => module.register(host));\n await Promise.all(registrations);\n}\n","/**\n * Behavior Loaders\n *\n * Registers lazy loaders for all behaviors.\n * Import this module to enable on-demand loading without bundling all behaviors.\n *\n * @example\n * ```typescript\n * // Enable lazy loading\n * import '@hyperfixi/behaviors/loaders';\n *\n * // Now load behaviors on demand\n * import { loadBehavior } from '@hyperfixi/behaviors/registry';\n * await loadBehavior('Draggable');\n * ```\n */\n\nimport { registerLoader, registerSchema } from './registry';\n\n// Register schemas for metadata queries before loading\nimport { draggableSchema } from './schemas/draggable.schema';\nimport { sortableSchema } from './schemas/sortable.schema';\nimport { resizableSchema } from './schemas/resizable.schema';\nimport { removableSchema } from './schemas/removable.schema';\nimport { toggleableSchema } from './schemas/toggleable.schema';\nimport { clipboardSchema } from './schemas/clipboard.schema';\nimport { autoDismissSchema } from './schemas/autodismiss.schema';\nimport { clickOutsideSchema } from './schemas/clickoutside.schema';\nimport { focusTrapSchema } from './schemas/focustrap.schema';\nimport { scrollRevealSchema } from './schemas/scrollreveal.schema';\nimport { tabsSchema } from './schemas/tabs.schema';\n\n// Register all schemas\nregisterSchema(draggableSchema);\nregisterSchema(sortableSchema);\nregisterSchema(resizableSchema);\nregisterSchema(removableSchema);\nregisterSchema(toggleableSchema);\nregisterSchema(clipboardSchema);\nregisterSchema(autoDismissSchema);\nregisterSchema(clickOutsideSchema);\nregisterSchema(focusTrapSchema);\nregisterSchema(scrollRevealSchema);\nregisterSchema(tabsSchema);\n\n// Register lazy loaders - behaviors are only loaded when requested\nregisterLoader('Draggable', () => import('./behaviors/draggable'));\nregisterLoader('Sortable', () => import('./behaviors/sortable'));\nregisterLoader('Resizable', () => import('./behaviors/resizable'));\nregisterLoader('Removable', () => import('./behaviors/removable'));\nregisterLoader('Toggleable', () => import('./behaviors/toggleable'));\nregisterLoader('Clipboard', () => import('./behaviors/clipboard'));\nregisterLoader('AutoDismiss', () => import('./behaviors/autodismiss'));\nregisterLoader('ClickOutside', () => import('./behaviors/clickoutside'));\nregisterLoader('FocusTrap', () => import('./behaviors/focustrap'));\nregisterLoader('ScrollReveal', () => import('./behaviors/scrollreveal'));\nregisterLoader('Tabs', () => import('./behaviors/tabs'));\n","/**\n * Generated Metadata\n *\n * DO NOT EDIT - Generated by scripts/generate.ts\n * Run `npm run generate` to regenerate.\n */\n\nimport type { BehaviorCategory, BehaviorTier } from '../schemas/types';\nimport type { BehaviorName } from './types';\n\n/**\n * All behavior names.\n */\nexport const ALL_BEHAVIOR_NAMES: BehaviorName[] = [\n \"Draggable\",\n \"Sortable\",\n \"Resizable\",\n \"Removable\",\n \"Toggleable\",\n \"Clipboard\",\n \"AutoDismiss\",\n \"ClickOutside\",\n \"FocusTrap\",\n \"ScrollReveal\",\n \"Tabs\"\n];\n\n/**\n * Behaviors grouped by category.\n */\nexport const BEHAVIORS_BY_CATEGORY: Record<BehaviorCategory, BehaviorName[]> = {\n \"ui\": [\n \"Draggable\",\n \"Sortable\",\n \"Resizable\",\n \"Clipboard\",\n \"AutoDismiss\",\n \"ClickOutside\",\n \"FocusTrap\",\n \"Tabs\"\n ],\n \"data\": [\n \"Removable\"\n ],\n \"animation\": [],\n \"form\": [\n \"Toggleable\"\n ],\n \"layout\": [\n \"ScrollReveal\"\n ]\n};\n\n/**\n * Behaviors grouped by tier.\n */\nexport const BEHAVIORS_BY_TIER: Record<BehaviorTier, BehaviorName[]> = {\n \"core\": [\n \"Draggable\",\n \"Toggleable\",\n \"Clipboard\",\n \"AutoDismiss\",\n \"ClickOutside\",\n \"FocusTrap\",\n \"Tabs\"\n ],\n \"common\": [\n \"Sortable\",\n \"Removable\",\n \"ScrollReveal\"\n ],\n \"optional\": [\n \"Resizable\"\n ]\n};\n\n/**\n * Category for each behavior.\n */\nexport const BEHAVIOR_CATEGORIES: Record<BehaviorName, BehaviorCategory> = {\n \"Draggable\": \"ui\",\n \"Sortable\": \"ui\",\n \"Resizable\": \"ui\",\n \"Removable\": \"data\",\n \"Toggleable\": \"form\",\n \"Clipboard\": \"ui\",\n \"AutoDismiss\": \"ui\",\n \"ClickOutside\": \"ui\",\n \"FocusTrap\": \"ui\",\n \"ScrollReveal\": \"layout\",\n \"Tabs\": \"ui\"\n};\n\n/**\n * Tier for each behavior.\n */\nexport const BEHAVIOR_TIERS: Record<BehaviorName, BehaviorTier> = {\n \"Draggable\": \"core\",\n \"Sortable\": \"common\",\n \"Resizable\": \"optional\",\n \"Removable\": \"common\",\n \"Toggleable\": \"core\",\n \"Clipboard\": \"core\",\n \"AutoDismiss\": \"core\",\n \"ClickOutside\": \"core\",\n \"FocusTrap\": \"core\",\n \"ScrollReveal\": \"common\",\n \"Tabs\": \"core\"\n};\n","/**\n * Curation status — the product decision about which behaviors are first-class.\n *\n * This is ORTHOGONAL to {@link BehaviorTier} (core/common/optional), which is about\n * lazy-loading priority. Curation is about support level and the boundary rule:\n *\n * A behavior is a named, parameterized, *reusable inline script* — `on event →\n * DOM action`. Not a component. When it needs an observer, a focus model, or an\n * async pointer loop, it has left hyperfixi's lane.\n *\n * See docs-internal/BEHAVIORS_CONSOLIDATION_PLAN.md for the full rationale.\n */\n\nexport type CurationStatus = 'curated' | 'optional' | 'experimental';\n\n/**\n * Curated set — reliable, runtime-tested, multilingual. The supported story.\n * Real `on event → DOM action` behaviors (Tier A) plus two honestly-labeled\n * JS-backed conveniences (Clipboard, AutoDismiss).\n */\nexport const CURATED_BEHAVIORS = [\n 'Toggleable',\n 'Removable',\n 'ClickOutside',\n 'Clipboard',\n 'AutoDismiss',\n] as const;\n\n/**\n * Optional — useful, kept, documented as primitives / nice-to-haves.\n * FocusTrap + ClickOutside are the primitives a Modal composes from; ScrollReveal\n * is a nice-to-have; Tabs is high-value but heavy.\n */\nexport const OPTIONAL_BEHAVIORS = ['FocusTrap', 'ScrollReveal', 'Tabs'] as const;\n\n/**\n * Experimental — stateful async components (drag/sort/resize). These sit *beyond*\n * the inline-scripting boundary; kept working but explicitly outside the curated,\n * supported, marketed story.\n */\nexport const EXPERIMENTAL_BEHAVIORS = ['Draggable', 'Sortable', 'Resizable'] as const;\n\n/** Curation status for every behavior, keyed by name. */\nexport const CURATION_STATUS: Record<string, CurationStatus> = {\n ...Object.fromEntries(CURATED_BEHAVIORS.map(n => [n, 'curated' as const])),\n ...Object.fromEntries(OPTIONAL_BEHAVIORS.map(n => [n, 'optional' as const])),\n ...Object.fromEntries(EXPERIMENTAL_BEHAVIORS.map(n => [n, 'experimental' as const])),\n};\n\n/** Curation status for a behavior name, or undefined if unknown. */\nexport function curationStatusOf(name: string): CurationStatus | undefined {\n return CURATION_STATUS[name];\n}\n\n/** True for the curated, supported set. */\nexport function isCurated(name: string): boolean {\n return CURATION_STATUS[name] === 'curated';\n}\n"],"mappings":"kfAAA,IAQaA,EARbC,EAAAC,EAAA,kBAQaF,EAAkC,CAC7C,KAAM,YACN,SAAU,KACV,KAAM,OACN,QAAS,QACT,YACE,iKACF,WAAY,CACV,CACE,KAAM,aACN,KAAM,WACN,SAAU,GACV,QAAS,KACT,YAAa,0CACf,CACF,EACA,OAAQ,CACN,CAAE,KAAM,kBAAmB,YAAa,wBAAyB,EACjE,CAAE,KAAM,iBAAkB,YAAa,4BAA6B,EACpE,CAAE,KAAM,gBAAiB,YAAa,2BAA4B,CACpE,EACA,aAAc,CAAC,sDAAsD,EACrE,OAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAeL,KAAK,CACV,ICuDO,SAASG,GAAyC,CACvD,GAAI,OAAO,OAAW,IAAa,OAAO,KAC1C,IAAMC,EAAM,OACNC,EAAOD,EAAI,WAAaA,EAAI,aAClC,OAAOC,GAAQ,OAAOA,EAAK,UAAa,WAAaA,EAAO,IAC9D,CAOO,SAASC,EAAeC,EAAwBF,EAA8B,CACnF,IAAMG,EAAKH,GAAQF,EAAe,EAClC,GAAI,CAACK,EACH,MAAM,IAAI,MACR,uFAAuFD,EAAO,IAAI,GACpG,EAEF,GAAI,CACFC,EAAG,SAASD,EAAO,MAAM,CAC3B,OAASE,EAAG,CACV,MAAM,IAAI,MAAM,oBAAoBF,EAAO,IAAI,cAAeE,EAAY,OAAO,EAAE,CACrF,CACF,CA7HA,IAAAC,EAAAC,EAAA,oBCAA,IAAAC,GAAA,GAAAC,EAAAD,GAAA,aAAAE,GAAA,sBAAAC,EAAA,oBAAAC,EAAA,sBAAAC,IAmCA,eAAsBA,EAAkBC,EAAuC,CAC7EC,EAAeC,EAAiBF,CAAI,CACtC,CArCA,IA4BaF,EACAD,EAeND,GA5CPO,EAAAC,EAA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ACvBI,EAAiBJ,CAAI,EACrBK,EAAkBL,CAAI,EACtBM,EAAkBN,CAAI,EACtBO,EAAoBP,CAAI,EACxBQ,EAAqBR,CAAI,EACzBS,EAAkBT,CAAI,EACtBU,EAAqBV,CAAI,EACzBW,EAAaX,CAAI,CACnB,CAAC,CACH,CAUO,IAAIY,GAA8B,KAKnCC,GAAQC,EAAe,EACzBD,KACFD,GAAQb,GAAYc,EAAK,EACtB,KAAK,IAAM,CACN,SAAS,aAAe,WAAWA,GAAM,cAAc,SAAS,IAAI,CAC1E,CAAC,EACA,MAAME,GAAO,CACZ,QAAQ,MAAM,sCAAuCA,CAAG,CAC1D,CAAC","names":["draggableSchema","init_draggable_schema","__esmMin","resolveRuntime","win","host","defineBehavior","schema","hf","e","init_types","__esmMin","draggable_exports","__export","draggable_default","draggableMetadata","draggableSource","registerDraggable","host","defineBehavior","draggableSchema","init_draggable","__esmMin","init_draggable_schema","init_types","resolveRuntime","removableSchema","init_removable_schema","__esmMin","removable_exports","__export","removable_default","registerRemovable","removableMetadata","removableSource","host","defineBehavior","removableSchema","init_removable","__esmMin","init_removable_schema","init_types","resolveRuntime","toggleableSchema","init_toggleable_schema","__esmMin","toggleable_exports","__export","toggleable_default","registerToggleable","toggleableMetadata","toggleableSource","host","defineBehavior","toggleableSchema","init_toggleable","__esmMin","init_toggleable_schema","init_types","resolveRuntime","sortableSchema","init_sortable_schema","__esmMin","sortable_exports","__export","sortable_default","registerSortable","sortableMetadata","sortableSource","host","defineBehavior","sortableSchema","init_sortable","__esmMin","init_sortable_schema","init_types","resolveRuntime","resizableSchema","init_resizable_schema","__esmMin","resizable_exports","__export","resizable_default","registerResizable","resizableMetadata","resizableSource","host","defineBehavior","resizableSchema","init_resizable","__esmMin","init_resizable_schema","init_types","resolveRuntime","clipboardSchema","init_clipboard_schema","__esmMin","clipboard_exports","__export","clipboardMetadata","clipboardSource","clipboard_default","registerClipboard","host","defineBehavior","clipboardSchema","init_clipboard","__esmMin","init_clipboard_schema","init_types","resolveRuntime","autoDismissSchema","init_autodismiss_schema","__esmMin","autodismiss_exports","__export","autoDismissMetadata","autoDismissSource","autodismiss_default","registerAutoDismiss","host","defineBehavior","autoDismissSchema","init_autodismiss","__esmMin","init_autodismiss_schema","init_types","resolveRuntime","clickOutsideSchema","init_clickoutside_schema","__esmMin","clickoutside_exports","__export","clickOutsideMetadata","clickOutsideSource","clickoutside_default","registerClickOutside","host","defineBehavior","clickOutsideSchema","init_clickoutside","__esmMin","init_clickoutside_schema","init_types","resolveRuntime","focusTrapSchema","init_focustrap_schema","__esmMin","focustrap_exports","__export","focustrap_default","focusTrapMetadata","focusTrapSource","registerFocusTrap","host","defineBehavior","focusTrapSchema","init_focustrap","__esmMin","init_focustrap_schema","init_types","resolveRuntime","scrollRevealSchema","init_scrollreveal_schema","__esmMin","scrollreveal_exports","__export","scrollreveal_default","registerScrollReveal","scrollRevealMetadata","scrollRevealSource","host","defineBehavior","scrollRevealSchema","init_scrollreveal","__esmMin","init_scrollreveal_schema","init_types","resolveRuntime","tabsSchema","init_tabs_schema","__esmMin","tabs_exports","__export","tabs_default","registerTabs","tabsMetadata","tabsSource","host","defineBehavior","tabsSchema","init_tabs","__esmMin","init_tabs_schema","init_types","resolveRuntime","src_exports","__export","ALL_BEHAVIOR_NAMES","autodismiss_default","BEHAVIORS_BY_CATEGORY","BEHAVIORS_BY_TIER","BEHAVIOR_CATEGORIES","BEHAVIOR_TIERS","CURATED_BEHAVIORS","CURATION_STATUS","clickoutside_default","clipboard_default","draggable_default","EXPERIMENTAL_BEHAVIORS","focustrap_default","OPTIONAL_BEHAVIORS","removable_default","resizable_default","scrollreveal_default","sortable_default","tabs_default","toggleable_default","autoDismissMetadata","autoDismissSource","clickOutsideMetadata","clickOutsideSource","clipboardMetadata","clipboardSource","curationStatusOf","draggableMetadata","draggableSource","focusTrapMetadata","focusTrapSource","getAllSchemas","getAllSchemasRecord","getAvailableBehaviors","getBehavior","getBehaviorsByCategory","getBehaviorsByTier","getRegisteredBehaviors","getSchema","hasLoader","isCurated","isRegistered","loadAll","loadBehavior","preloadCategory","preloadTier","ready","registerAll","registerAllWithRuntime","registerAutoDismiss","registerBehavior","registerClickOutside","registerClipboard","registerDraggable","registerFocusTrap","registerLoader","registerRemovable","registerResizable","registerSchema","registerScrollReveal","registerSortable","registerTabs","registerToggleable","registerWithRuntime","removableMetadata","removableSource","resizableMetadata","resizableSource","scrollRevealMetadata","scrollRevealSource","sortableMetadata","sortableSource","tabsMetadata","tabsSource","toggleableMetadata","toggleableSource","tryGetBehavior","tryGetSchema","init_draggable","init_removable","init_toggleable","init_sortable","init_resizable","init_clipboard","init_autodismiss","init_clickoutside","init_focustrap","init_scrollreveal","init_tabs","behaviors","schemas","loaders","loadingPromises","registerBehavior","name","module","registerSchema","schema","registerLoader","loader","getBehavior","behavior","registered","tryGetBehavior","getSchema","tryGetSchema","isRegistered","hasLoader","getRegisteredBehaviors","getAvailableBehaviors","names","getBehaviorsByCategory","category","result","getBehaviorsByTier","tier","getAllSchemas","getAllSchemasRecord","loadBehavior","cached","inFlight","promise","mod","preloadTier","err","preloadCategory","loadAll","registerWithRuntime","host","registerAllWithRuntime","registrations","init_draggable_schema","init_sortable_schema","init_resizable_schema","init_removable_schema","init_toggleable_schema","init_clipboard_schema","init_autodismiss_schema","init_clickoutside_schema","init_focustrap_schema","init_scrollreveal_schema","init_tabs_schema","registerSchema","draggableSchema","sortableSchema","resizableSchema","removableSchema","toggleableSchema","clipboardSchema","autoDismissSchema","clickOutsideSchema","focusTrapSchema","scrollRevealSchema","tabsSchema","registerLoader","ALL_BEHAVIOR_NAMES","BEHAVIORS_BY_CATEGORY","BEHAVIORS_BY_TIER","BEHAVIOR_CATEGORIES","BEHAVIOR_TIERS","CURATED_BEHAVIORS","OPTIONAL_BEHAVIORS","EXPERIMENTAL_BEHAVIORS","CURATION_STATUS","n","curationStatusOf","name","isCurated","init_draggable","init_removable","init_toggleable","init_sortable","init_resizable","init_clipboard","init_autodismiss","init_clickoutside","init_focustrap","init_scrollreveal","init_tabs","init_types","registerAll","host","registerDraggable","registerRemovable","registerToggleable","registerSortable","registerResizable","registerClipboard","registerAutoDismiss","registerClickOutside","registerFocusTrap","registerScrollReveal","registerTabs","ready","_host","resolveRuntime","err"]}
@@ -1,15 +1,9 @@
1
- "use strict";var HyperFixiBehaviors=(()=>{var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var n in e)s(t,n,{get:e[n],enumerable:!0})},l=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!d.call(t,r)&&r!==n&&s(t,r,{get:()=>e[r],enumerable:!(o=u(e,r))||o.enumerable});return t};var f=t=>l(s({},"__esModule",{value:!0}),t);var y={};p(y,{autoDismissMetadata:()=>h,autoDismissSource:()=>v,default:()=>g,registerAutoDismiss:()=>m});var i={name:"AutoDismiss",category:"ui",tier:"core",version:"1.0.0",description:"Auto-removes elements after a delay with optional pause-on-hover",parameters:[{name:"delay",type:"number",optional:!0,default:5e3,description:"Time in ms before the element is removed"},{name:"pauseOnHover",type:"boolean",optional:!0,default:!0,description:"Pause the countdown when the mouse hovers over the element"},{name:"effect",type:"string",optional:!0,default:"none",enum:["fade","none"],description:'Transition effect before removal: "fade" or "none"'}],events:[{name:"autodismiss:start",description:"Fired when the countdown timer starts"},{name:"autodismiss:dismissed",description:"Fired before removal (cancelable via preventDefault)"},{name:"autodismiss:paused",description:"Fired when the timer is paused on hover"},{name:"autodismiss:resumed",description:"Fired when the timer resumes on mouseleave"}],source:`
1
+ "use strict";var HyperFixiBehaviors=(()=>{var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},l=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of c(t))!p.call(e,o)&&o!==r&&s(e,o,{get:()=>t[o],enumerable:!(n=d(t,o))||n.enumerable});return e};var v=e=>l(s({},"__esModule",{value:!0}),e);var b={};f(b,{autoDismissMetadata:()=>y,autoDismissSource:()=>h,default:()=>g,registerAutoDismiss:()=>m});var i={name:"AutoDismiss",category:"ui",tier:"core",version:"1.0.0",description:"Auto-removes elements after a delay with optional pause-on-hover",parameters:[{name:"delay",type:"number",optional:!0,default:5e3,description:"Time in ms before the element is removed"},{name:"pauseOnHover",type:"boolean",optional:!0,default:!0,description:"Pause the countdown when the mouse hovers over the element"},{name:"effect",type:"string",optional:!0,default:"none",enum:["fade","none"],description:'Transition effect before removal: "fade" or "none"'}],events:[{name:"autodismiss:start",description:"Fired when the countdown timer starts"},{name:"autodismiss:dismissed",description:"Fired before removal (cancelable via preventDefault)"},{name:"autodismiss:paused",description:"Fired when the timer is paused on hover"},{name:"autodismiss:resumed",description:"Fired when the timer resumes on mouseleave"}],source:`
2
2
  behavior AutoDismiss(delay, pauseOnHover, effect)
3
3
  init
4
- if delay is undefined
5
- set delay to 5000
6
- end
7
- if pauseOnHover is undefined
8
- set pauseOnHover to true
9
- end
10
- if effect is undefined
11
- set effect to "none"
12
- end
4
+ if delay is undefined set element's delay to 5000 end
5
+ if pauseOnHover is undefined set element's pauseOnHover to true end
6
+ if effect is undefined set element's effect to "none" end
13
7
  js(me, delay, effect, pauseOnHover)
14
8
  me.dispatchEvent(new CustomEvent('autodismiss:start', { bubbles: true }));
15
9
  var remaining = delay;
@@ -51,5 +45,5 @@ behavior AutoDismiss(delay, pauseOnHover, effect)
51
45
  }
52
46
  end
53
47
  end
54
- end`.trim()};function a(){if(typeof window>"u")return null;let t=window;return t.lokascript||t.hyperfixi||null}var v=i.source,h=i;async function m(t){let e=t||a();if(!e)throw new Error("LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.");let n=e.compileSync(i.source,{traditional:!0});if(!n.ok)throw new Error(`Failed to compile AutoDismiss behavior: ${JSON.stringify(n.errors)}`);let o=e.createContext?e.createContext():{locals:new Map,globals:new Map};await e.execute(n.ast,o)}a()&&m().catch(console.error);var g={source:i.source,metadata:i,register:m};return f(y);})();
48
+ end`.trim()};function a(){if(typeof window>"u")return null;let e=window,t=e.hyperfixi??e._hyperscript;return t&&typeof t.evaluate=="function"?t:null}function u(e,t){let r=t??a();if(!r)throw new Error(`No hyperscript host found: load @hyperfixi/engine (hyperfixi-hs.js) before defining ${e.name}.`);try{r.evaluate(e.source)}catch(n){throw new Error(`Failed to define ${e.name} behavior: ${n.message}`)}}var h=i.source,y=i;async function m(e){u(i,e)}a()&&m().catch(console.error);var g={source:i.source,metadata:i,register:m};return v(b);})();
55
49
  //# sourceMappingURL=autodismiss.browser.global.js.map