@wardic/solid 2.1.2 → 3.0.0-next.0

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 (530) hide show
  1. package/README.md +22 -18
  2. package/dist/browser/batch-reorder-places.js +3 -3
  3. package/dist/browser/batch-reorder.js +8 -5
  4. package/dist/browser/batch-reorder.js.map +1 -1
  5. package/dist/browser/config-view.js +33 -5
  6. package/dist/browser/config-view.js.map +1 -1
  7. package/dist/browser/create-animation-controls.js +22 -0
  8. package/dist/browser/create-animation-controls.js.map +1 -0
  9. package/dist/browser/create-batch.js +1 -1
  10. package/dist/browser/element-style.js +61 -7
  11. package/dist/browser/element-style.js.map +1 -1
  12. package/dist/browser/element.js +19 -2
  13. package/dist/browser/element.js.map +1 -1
  14. package/dist/browser/feature-section.js +5 -13
  15. package/dist/browser/feature-section.js.map +1 -1
  16. package/dist/browser/gesture-callbacks.js +3 -1
  17. package/dist/browser/gesture-callbacks.js.map +1 -1
  18. package/dist/browser/hooks/auto.js +270 -0
  19. package/dist/browser/hooks/auto.js.map +1 -0
  20. package/dist/browser/hooks/config-scope.js +120 -0
  21. package/dist/browser/hooks/config-scope.js.map +1 -0
  22. package/dist/browser/hooks/config.js +37 -0
  23. package/dist/browser/hooks/config.js.map +1 -0
  24. package/dist/browser/hooks/drag.js +632 -0
  25. package/dist/browser/hooks/drag.js.map +1 -0
  26. package/dist/browser/hooks/elements.js +183 -0
  27. package/dist/browser/hooks/elements.js.map +1 -0
  28. package/dist/browser/hooks/group.js +28 -0
  29. package/dist/browser/hooks/group.js.map +1 -0
  30. package/dist/browser/hooks/index.js +10 -0
  31. package/dist/browser/hooks/index.js.map +1 -0
  32. package/dist/browser/hooks/kept.js +32 -0
  33. package/dist/browser/hooks/kept.js.map +1 -0
  34. package/dist/browser/hooks/layout-group-of.js +39 -0
  35. package/dist/browser/hooks/layout-group-of.js.map +1 -0
  36. package/dist/browser/hooks/layout-group.js +92 -0
  37. package/dist/browser/hooks/layout-group.js.map +1 -0
  38. package/dist/browser/hooks/make-ward.js +157 -0
  39. package/dist/browser/hooks/make-ward.js.map +1 -0
  40. package/dist/browser/hooks/presence-scope.js +87 -0
  41. package/dist/browser/hooks/presence-scope.js.map +1 -0
  42. package/dist/browser/hooks/presence.js +24 -0
  43. package/dist/browser/hooks/presence.js.map +1 -0
  44. package/dist/browser/hooks/props.js +148 -0
  45. package/dist/browser/hooks/props.js.map +1 -0
  46. package/dist/browser/hooks/reads.js +241 -0
  47. package/dist/browser/hooks/reads.js.map +1 -0
  48. package/dist/browser/hooks/refs.js +87 -0
  49. package/dist/browser/hooks/refs.js.map +1 -0
  50. package/dist/browser/hooks/reorder-elements.js +268 -0
  51. package/dist/browser/hooks/reorder-elements.js.map +1 -0
  52. package/dist/browser/hooks/reorder.js +176 -0
  53. package/dist/browser/hooks/reorder.js.map +1 -0
  54. package/dist/browser/hooks/rune.js +799 -0
  55. package/dist/browser/hooks/rune.js.map +1 -0
  56. package/dist/browser/hooks/server-features.client.js +2 -0
  57. package/dist/browser/hooks/server-features.client.js.map +1 -0
  58. package/dist/browser/hooks/server-features.js +13 -0
  59. package/dist/browser/hooks/server-features.js.map +1 -0
  60. package/dist/browser/hooks/settings.js +29 -0
  61. package/dist/browser/hooks/settings.js.map +1 -0
  62. package/dist/browser/hooks/setup.js +154 -0
  63. package/dist/browser/hooks/setup.js.map +1 -0
  64. package/dist/browser/hooks/stage.js +117 -0
  65. package/dist/browser/hooks/stage.js.map +1 -0
  66. package/dist/browser/hooks/ward.js +2193 -0
  67. package/dist/browser/hooks/ward.js.map +1 -0
  68. package/dist/browser/hooks/wardic-provider.js +29 -0
  69. package/dist/browser/hooks/wardic-provider.js.map +1 -0
  70. package/dist/browser/hooks/wardic-scope.js +68 -0
  71. package/dist/browser/hooks/wardic-scope.js.map +1 -0
  72. package/dist/browser/hooks/wards.js +562 -0
  73. package/dist/browser/hooks/wards.js.map +1 -0
  74. package/dist/browser/index.js +24 -12
  75. package/dist/browser/index.js.map +1 -1
  76. package/dist/browser/layout.js +7 -58
  77. package/dist/browser/layout.js.map +1 -1
  78. package/dist/browser/lazy-batch-gestures.js +1 -1
  79. package/dist/browser/lifecycle.js +59 -13
  80. package/dist/browser/lifecycle.js.map +1 -1
  81. package/dist/browser/motion-props.js +1 -1
  82. package/dist/browser/presence-handle.js +28 -12
  83. package/dist/browser/presence-handle.js.map +1 -1
  84. package/dist/browser/presence.js +3 -1
  85. package/dist/browser/presence.js.map +1 -1
  86. package/dist/browser/provider.js +85 -70
  87. package/dist/browser/provider.js.map +1 -1
  88. package/dist/browser/reorder-components.js +50 -0
  89. package/dist/browser/reorder-components.js.map +1 -0
  90. package/dist/browser/reorder.js +46 -274
  91. package/dist/browser/reorder.js.map +1 -1
  92. package/dist/browser/stage-ward.js +2 -2
  93. package/dist/browser/stage-ward.js.map +1 -1
  94. package/dist/browser/stage.js.map +1 -1
  95. package/dist/browser/unstable/v2/index.js +0 -8
  96. package/dist/browser/unstable/v2/index.js.map +1 -1
  97. package/dist/browser/v1/batch-reorder-group.js +4 -4
  98. package/dist/browser/v1/create-ward.js +3 -3
  99. package/dist/browser/v1/create-ward.js.map +1 -1
  100. package/dist/browser/v1/index.js +1 -1
  101. package/dist/browser/v1/index.js.map +1 -1
  102. package/dist/browser/v1/presence.js +1 -1
  103. package/dist/browser/v1/presence.js.map +1 -1
  104. package/dist/browser/variant-node.js +4 -2
  105. package/dist/browser/variant-node.js.map +1 -1
  106. package/dist/browser/w.js +33 -3
  107. package/dist/browser/w.js.map +1 -1
  108. package/dist/browser/ward.js +579 -52
  109. package/dist/browser/ward.js.map +1 -1
  110. package/dist/browser/wardic-config.js +62 -29
  111. package/dist/browser/wardic-config.js.map +1 -1
  112. package/dist/browser/wardic-context.js +23 -0
  113. package/dist/browser/wardic-context.js.map +1 -0
  114. package/dist/browser/wardic.js +3 -0
  115. package/dist/browser/wardic.js.map +1 -1
  116. package/dist/server/batch-reorder-places.js +3 -3
  117. package/dist/server/batch-reorder.js +8 -5
  118. package/dist/server/batch-reorder.js.map +1 -1
  119. package/dist/server/config-view.js +33 -5
  120. package/dist/server/config-view.js.map +1 -1
  121. package/dist/server/create-animation-controls.js +22 -0
  122. package/dist/server/create-animation-controls.js.map +1 -0
  123. package/dist/server/create-batch.js +1 -1
  124. package/dist/server/element-style.js +61 -7
  125. package/dist/server/element-style.js.map +1 -1
  126. package/dist/server/element.js +19 -2
  127. package/dist/server/element.js.map +1 -1
  128. package/dist/server/feature-section.js +5 -13
  129. package/dist/server/feature-section.js.map +1 -1
  130. package/dist/server/gesture-callbacks.js +3 -1
  131. package/dist/server/gesture-callbacks.js.map +1 -1
  132. package/dist/server/hooks/auto.js +270 -0
  133. package/dist/server/hooks/auto.js.map +1 -0
  134. package/dist/server/hooks/config-scope.js +120 -0
  135. package/dist/server/hooks/config-scope.js.map +1 -0
  136. package/dist/server/hooks/config.js +37 -0
  137. package/dist/server/hooks/config.js.map +1 -0
  138. package/dist/server/hooks/drag.js +632 -0
  139. package/dist/server/hooks/drag.js.map +1 -0
  140. package/dist/server/hooks/elements.js +192 -0
  141. package/dist/server/hooks/elements.js.map +1 -0
  142. package/dist/server/hooks/group.js +28 -0
  143. package/dist/server/hooks/group.js.map +1 -0
  144. package/dist/server/hooks/index.js +10 -0
  145. package/dist/server/hooks/index.js.map +1 -0
  146. package/dist/server/hooks/kept.js +32 -0
  147. package/dist/server/hooks/kept.js.map +1 -0
  148. package/dist/server/hooks/layout-group-of.js +39 -0
  149. package/dist/server/hooks/layout-group-of.js.map +1 -0
  150. package/dist/server/hooks/layout-group.js +109 -0
  151. package/dist/server/hooks/layout-group.js.map +1 -0
  152. package/dist/server/hooks/make-ward.js +157 -0
  153. package/dist/server/hooks/make-ward.js.map +1 -0
  154. package/dist/server/hooks/presence-scope.js +86 -0
  155. package/dist/server/hooks/presence-scope.js.map +1 -0
  156. package/dist/server/hooks/presence.js +24 -0
  157. package/dist/server/hooks/presence.js.map +1 -0
  158. package/dist/server/hooks/props.js +148 -0
  159. package/dist/server/hooks/props.js.map +1 -0
  160. package/dist/server/hooks/reads.js +241 -0
  161. package/dist/server/hooks/reads.js.map +1 -0
  162. package/dist/server/hooks/refs.js +87 -0
  163. package/dist/server/hooks/refs.js.map +1 -0
  164. package/dist/server/hooks/reorder-elements.js +308 -0
  165. package/dist/server/hooks/reorder-elements.js.map +1 -0
  166. package/dist/server/hooks/reorder.js +176 -0
  167. package/dist/server/hooks/reorder.js.map +1 -0
  168. package/dist/server/hooks/rune.js +799 -0
  169. package/dist/server/hooks/rune.js.map +1 -0
  170. package/dist/server/hooks/server-features.client.js +2 -0
  171. package/dist/server/hooks/server-features.client.js.map +1 -0
  172. package/dist/server/hooks/server-features.js +13 -0
  173. package/dist/server/hooks/server-features.js.map +1 -0
  174. package/dist/server/hooks/settings.js +29 -0
  175. package/dist/server/hooks/settings.js.map +1 -0
  176. package/dist/server/hooks/setup.js +154 -0
  177. package/dist/server/hooks/setup.js.map +1 -0
  178. package/dist/server/hooks/stage.js +117 -0
  179. package/dist/server/hooks/stage.js.map +1 -0
  180. package/dist/server/hooks/ward.js +2193 -0
  181. package/dist/server/hooks/ward.js.map +1 -0
  182. package/dist/server/hooks/wardic-provider.js +29 -0
  183. package/dist/server/hooks/wardic-provider.js.map +1 -0
  184. package/dist/server/hooks/wardic-scope.js +68 -0
  185. package/dist/server/hooks/wardic-scope.js.map +1 -0
  186. package/dist/server/hooks/wards.js +562 -0
  187. package/dist/server/hooks/wards.js.map +1 -0
  188. package/dist/server/index.js +24 -12
  189. package/dist/server/index.js.map +1 -1
  190. package/dist/server/layout.js +7 -75
  191. package/dist/server/layout.js.map +1 -1
  192. package/dist/server/lazy-batch-gestures.js +1 -1
  193. package/dist/server/lifecycle.js +59 -13
  194. package/dist/server/lifecycle.js.map +1 -1
  195. package/dist/server/motion-props.js +1 -1
  196. package/dist/server/presence-handle.js +28 -12
  197. package/dist/server/presence-handle.js.map +1 -1
  198. package/dist/server/presence.js +3 -1
  199. package/dist/server/presence.js.map +1 -1
  200. package/dist/server/provider.js +86 -80
  201. package/dist/server/provider.js.map +1 -1
  202. package/dist/server/reorder-components.js +50 -0
  203. package/dist/server/reorder-components.js.map +1 -0
  204. package/dist/server/reorder.js +46 -344
  205. package/dist/server/reorder.js.map +1 -1
  206. package/dist/server/stage-ward.js +2 -2
  207. package/dist/server/stage-ward.js.map +1 -1
  208. package/dist/server/stage.js.map +1 -1
  209. package/dist/server/unstable/v2/index.js +0 -8
  210. package/dist/server/unstable/v2/index.js.map +1 -1
  211. package/dist/server/v1/batch-reorder-group.js +4 -4
  212. package/dist/server/v1/create-ward.js +3 -3
  213. package/dist/server/v1/create-ward.js.map +1 -1
  214. package/dist/server/v1/index.js +1 -1
  215. package/dist/server/v1/index.js.map +1 -1
  216. package/dist/server/v1/presence.js +1 -1
  217. package/dist/server/v1/presence.js.map +1 -1
  218. package/dist/server/variant-node.js +4 -2
  219. package/dist/server/variant-node.js.map +1 -1
  220. package/dist/server/w.js +33 -3
  221. package/dist/server/w.js.map +1 -1
  222. package/dist/server/ward.js +579 -52
  223. package/dist/server/ward.js.map +1 -1
  224. package/dist/server/wardic-config.js +63 -30
  225. package/dist/server/wardic-config.js.map +1 -1
  226. package/dist/server/wardic-context.js +23 -0
  227. package/dist/server/wardic-context.js.map +1 -0
  228. package/dist/server/wardic.js +3 -0
  229. package/dist/server/wardic.js.map +1 -1
  230. package/dist/solid/batch-reorder-group.d.ts +1 -1
  231. package/dist/solid/batch-reorder-places.js +3 -3
  232. package/dist/solid/batch-reorder.d.ts +1 -1
  233. package/dist/solid/batch-reorder.d.ts.map +1 -1
  234. package/dist/solid/batch-reorder.js +8 -5
  235. package/dist/solid/batch-reorder.js.map +1 -1
  236. package/dist/solid/config-view.d.ts +11 -0
  237. package/dist/solid/config-view.d.ts.map +1 -1
  238. package/dist/solid/config-view.js +29 -6
  239. package/dist/solid/config-view.js.map +1 -1
  240. package/dist/solid/create-animation-controls.d.ts +20 -0
  241. package/dist/solid/create-animation-controls.d.ts.map +1 -0
  242. package/dist/solid/create-animation-controls.js +22 -0
  243. package/dist/solid/create-animation-controls.js.map +1 -0
  244. package/dist/solid/create-batch.jsx +1 -1
  245. package/dist/solid/element-style.d.ts +16 -2
  246. package/dist/solid/element-style.d.ts.map +1 -1
  247. package/dist/solid/element-style.js +61 -7
  248. package/dist/solid/element-style.js.map +1 -1
  249. package/dist/solid/element.d.ts +3 -1
  250. package/dist/solid/element.d.ts.map +1 -1
  251. package/dist/solid/element.jsx +21 -2
  252. package/dist/solid/element.jsx.map +1 -1
  253. package/dist/solid/feature-section.d.ts +0 -7
  254. package/dist/solid/feature-section.d.ts.map +1 -1
  255. package/dist/solid/feature-section.js +5 -13
  256. package/dist/solid/feature-section.js.map +1 -1
  257. package/dist/solid/gesture-callbacks.d.ts.map +1 -1
  258. package/dist/solid/gesture-callbacks.js +2 -0
  259. package/dist/solid/gesture-callbacks.js.map +1 -1
  260. package/dist/solid/hooks/auto.d.ts +44 -0
  261. package/dist/solid/hooks/auto.d.ts.map +1 -0
  262. package/dist/solid/hooks/auto.js +269 -0
  263. package/dist/solid/hooks/auto.js.map +1 -0
  264. package/dist/solid/hooks/config-scope.d.ts +84 -0
  265. package/dist/solid/hooks/config-scope.d.ts.map +1 -0
  266. package/dist/solid/hooks/config-scope.jsx +128 -0
  267. package/dist/solid/hooks/config-scope.jsx.map +1 -0
  268. package/dist/solid/hooks/config.d.ts +28 -0
  269. package/dist/solid/hooks/config.d.ts.map +1 -0
  270. package/dist/solid/hooks/config.jsx +37 -0
  271. package/dist/solid/hooks/config.jsx.map +1 -0
  272. package/dist/solid/hooks/drag.d.ts +220 -0
  273. package/dist/solid/hooks/drag.d.ts.map +1 -0
  274. package/dist/solid/hooks/drag.js +585 -0
  275. package/dist/solid/hooks/drag.js.map +1 -0
  276. package/dist/solid/hooks/elements.d.ts +11 -0
  277. package/dist/solid/hooks/elements.d.ts.map +1 -0
  278. package/dist/solid/hooks/elements.jsx +218 -0
  279. package/dist/solid/hooks/elements.jsx.map +1 -0
  280. package/dist/solid/hooks/group.d.ts +46 -0
  281. package/dist/solid/hooks/group.d.ts.map +1 -0
  282. package/dist/solid/hooks/group.jsx +25 -0
  283. package/dist/solid/hooks/group.jsx.map +1 -0
  284. package/dist/solid/hooks/index.d.ts +28 -0
  285. package/dist/solid/hooks/index.d.ts.map +1 -0
  286. package/dist/solid/hooks/index.js +10 -0
  287. package/dist/solid/hooks/index.js.map +1 -0
  288. package/dist/solid/hooks/kept.d.ts +60 -0
  289. package/dist/solid/hooks/kept.d.ts.map +1 -0
  290. package/dist/solid/hooks/kept.js +33 -0
  291. package/dist/solid/hooks/kept.js.map +1 -0
  292. package/dist/solid/hooks/layout-group-of.d.ts +27 -0
  293. package/dist/solid/hooks/layout-group-of.d.ts.map +1 -0
  294. package/dist/solid/hooks/layout-group-of.js +39 -0
  295. package/dist/solid/hooks/layout-group-of.js.map +1 -0
  296. package/dist/solid/hooks/layout-group.d.ts +60 -0
  297. package/dist/solid/hooks/layout-group.d.ts.map +1 -0
  298. package/dist/solid/hooks/layout-group.jsx +80 -0
  299. package/dist/solid/hooks/layout-group.jsx.map +1 -0
  300. package/dist/solid/hooks/make-ward.d.ts +123 -0
  301. package/dist/solid/hooks/make-ward.d.ts.map +1 -0
  302. package/dist/solid/hooks/make-ward.js +147 -0
  303. package/dist/solid/hooks/make-ward.js.map +1 -0
  304. package/dist/solid/hooks/presence-scope.d.ts +84 -0
  305. package/dist/solid/hooks/presence-scope.d.ts.map +1 -0
  306. package/dist/solid/hooks/presence-scope.jsx +62 -0
  307. package/dist/solid/hooks/presence-scope.jsx.map +1 -0
  308. package/dist/solid/hooks/presence.d.ts +51 -0
  309. package/dist/solid/hooks/presence.d.ts.map +1 -0
  310. package/dist/solid/hooks/presence.jsx +26 -0
  311. package/dist/solid/hooks/presence.jsx.map +1 -0
  312. package/dist/solid/hooks/props.d.ts +52 -0
  313. package/dist/solid/hooks/props.d.ts.map +1 -0
  314. package/dist/solid/hooks/props.js +140 -0
  315. package/dist/solid/hooks/props.js.map +1 -0
  316. package/dist/solid/hooks/reads.d.ts +38 -0
  317. package/dist/solid/hooks/reads.d.ts.map +1 -0
  318. package/dist/solid/hooks/reads.js +218 -0
  319. package/dist/solid/hooks/reads.js.map +1 -0
  320. package/dist/solid/hooks/refs.d.ts +25 -0
  321. package/dist/solid/hooks/refs.d.ts.map +1 -0
  322. package/dist/solid/hooks/refs.js +89 -0
  323. package/dist/solid/hooks/refs.js.map +1 -0
  324. package/dist/solid/hooks/reorder-elements.d.ts +23 -0
  325. package/dist/solid/hooks/reorder-elements.d.ts.map +1 -0
  326. package/dist/solid/hooks/reorder-elements.jsx +273 -0
  327. package/dist/solid/hooks/reorder-elements.jsx.map +1 -0
  328. package/dist/solid/hooks/reorder.d.ts +55 -0
  329. package/dist/solid/hooks/reorder.d.ts.map +1 -0
  330. package/dist/solid/hooks/reorder.js +152 -0
  331. package/dist/solid/hooks/reorder.js.map +1 -0
  332. package/dist/solid/hooks/rune.d.ts +885 -0
  333. package/dist/solid/hooks/rune.d.ts.map +1 -0
  334. package/dist/solid/hooks/rune.js +816 -0
  335. package/dist/solid/hooks/rune.js.map +1 -0
  336. package/dist/solid/hooks/server-features.client.d.ts +10 -0
  337. package/dist/solid/hooks/server-features.client.d.ts.map +1 -0
  338. package/dist/solid/hooks/server-features.client.js +2 -0
  339. package/dist/solid/hooks/server-features.client.js.map +1 -0
  340. package/dist/solid/hooks/server-features.d.ts +10 -0
  341. package/dist/solid/hooks/server-features.d.ts.map +1 -0
  342. package/dist/solid/hooks/server-features.js +13 -0
  343. package/dist/solid/hooks/server-features.js.map +1 -0
  344. package/dist/solid/hooks/settings.d.ts +11 -0
  345. package/dist/solid/hooks/settings.d.ts.map +1 -0
  346. package/dist/solid/hooks/settings.js +31 -0
  347. package/dist/solid/hooks/settings.js.map +1 -0
  348. package/dist/solid/hooks/setup.d.ts +31 -0
  349. package/dist/solid/hooks/setup.d.ts.map +1 -0
  350. package/dist/solid/hooks/setup.js +155 -0
  351. package/dist/solid/hooks/setup.js.map +1 -0
  352. package/dist/solid/hooks/stage.d.ts +187 -0
  353. package/dist/solid/hooks/stage.d.ts.map +1 -0
  354. package/dist/solid/hooks/stage.js +117 -0
  355. package/dist/solid/hooks/stage.js.map +1 -0
  356. package/dist/solid/hooks/ward.d.ts +394 -0
  357. package/dist/solid/hooks/ward.d.ts.map +1 -0
  358. package/dist/solid/hooks/ward.js +2237 -0
  359. package/dist/solid/hooks/ward.js.map +1 -0
  360. package/dist/solid/hooks/wardic-provider.d.ts +32 -0
  361. package/dist/solid/hooks/wardic-provider.d.ts.map +1 -0
  362. package/dist/solid/hooks/wardic-provider.jsx +29 -0
  363. package/dist/solid/hooks/wardic-provider.jsx.map +1 -0
  364. package/dist/solid/hooks/wardic-scope.d.ts +49 -0
  365. package/dist/solid/hooks/wardic-scope.d.ts.map +1 -0
  366. package/dist/solid/hooks/wardic-scope.jsx +63 -0
  367. package/dist/solid/hooks/wardic-scope.jsx.map +1 -0
  368. package/dist/solid/hooks/wards.d.ts +157 -0
  369. package/dist/solid/hooks/wards.d.ts.map +1 -0
  370. package/dist/solid/hooks/wards.js +522 -0
  371. package/dist/solid/hooks/wards.js.map +1 -0
  372. package/dist/solid/index.d.ts +25 -17
  373. package/dist/solid/index.d.ts.map +1 -1
  374. package/dist/solid/index.jsx +24 -12
  375. package/dist/solid/index.jsx.map +1 -1
  376. package/dist/solid/layout.d.ts +2 -44
  377. package/dist/solid/layout.d.ts.map +1 -1
  378. package/dist/solid/layout.jsx +7 -49
  379. package/dist/solid/layout.jsx.map +1 -1
  380. package/dist/solid/lazy-batch-gestures.js +1 -1
  381. package/dist/solid/lazy-batch-gestures.js.map +1 -1
  382. package/dist/solid/lifecycle.d.ts +32 -5
  383. package/dist/solid/lifecycle.d.ts.map +1 -1
  384. package/dist/solid/lifecycle.js +60 -21
  385. package/dist/solid/lifecycle.js.map +1 -1
  386. package/dist/solid/motion-props.js +1 -1
  387. package/dist/solid/presence-handle.d.ts +13 -6
  388. package/dist/solid/presence-handle.d.ts.map +1 -1
  389. package/dist/solid/presence-handle.js +30 -12
  390. package/dist/solid/presence-handle.js.map +1 -1
  391. package/dist/solid/presence.d.ts +3 -1
  392. package/dist/solid/presence.d.ts.map +1 -1
  393. package/dist/solid/presence.jsx +3 -1
  394. package/dist/solid/presence.jsx.map +1 -1
  395. package/dist/solid/provider.d.ts +25 -32
  396. package/dist/solid/provider.d.ts.map +1 -1
  397. package/dist/solid/provider.jsx +86 -62
  398. package/dist/solid/provider.jsx.map +1 -1
  399. package/dist/solid/reorder-components.d.ts +32 -0
  400. package/dist/solid/reorder-components.d.ts.map +1 -0
  401. package/dist/solid/reorder-components.jsx +49 -0
  402. package/dist/solid/reorder-components.jsx.map +1 -0
  403. package/dist/solid/reorder.d.ts +50 -76
  404. package/dist/solid/reorder.d.ts.map +1 -1
  405. package/dist/solid/reorder.jsx +40 -202
  406. package/dist/solid/reorder.jsx.map +1 -1
  407. package/dist/solid/stage-ward.jsx +2 -2
  408. package/dist/solid/stage-ward.jsx.map +1 -1
  409. package/dist/solid/stage.d.ts +14 -0
  410. package/dist/solid/stage.d.ts.map +1 -1
  411. package/dist/solid/stage.js.map +1 -1
  412. package/dist/solid/unstable/v2/index.d.ts +6 -26
  413. package/dist/solid/unstable/v2/index.d.ts.map +1 -1
  414. package/dist/solid/unstable/v2/index.jsx +0 -16
  415. package/dist/solid/unstable/v2/index.jsx.map +1 -1
  416. package/dist/solid/v1/batch-reorder-group.jsx +4 -4
  417. package/dist/solid/v1/create-ward.jsx +3 -3
  418. package/dist/solid/v1/create-ward.jsx.map +1 -1
  419. package/dist/solid/v1/index.d.ts +3 -1
  420. package/dist/solid/v1/index.d.ts.map +1 -1
  421. package/dist/solid/v1/index.jsx +1 -1
  422. package/dist/solid/v1/index.jsx.map +1 -1
  423. package/dist/solid/v1/presence.jsx +1 -1
  424. package/dist/solid/variant-node.d.ts +6 -0
  425. package/dist/solid/variant-node.d.ts.map +1 -1
  426. package/dist/solid/variant-node.js +2 -0
  427. package/dist/solid/variant-node.js.map +1 -1
  428. package/dist/solid/w.d.ts +9 -3
  429. package/dist/solid/w.d.ts.map +1 -1
  430. package/dist/solid/w.jsx +36 -3
  431. package/dist/solid/w.jsx.map +1 -1
  432. package/dist/solid/ward.d.ts +134 -7
  433. package/dist/solid/ward.d.ts.map +1 -1
  434. package/dist/solid/ward.jsx +549 -51
  435. package/dist/solid/ward.jsx.map +1 -1
  436. package/dist/solid/wardic-config.d.ts +17 -12
  437. package/dist/solid/wardic-config.d.ts.map +1 -1
  438. package/dist/solid/wardic-config.jsx +68 -22
  439. package/dist/solid/wardic-config.jsx.map +1 -1
  440. package/dist/solid/wardic-context.d.ts +15 -0
  441. package/dist/solid/wardic-context.d.ts.map +1 -0
  442. package/dist/solid/wardic-context.js +23 -0
  443. package/dist/solid/wardic-context.js.map +1 -0
  444. package/dist/solid/wardic-instance.d.ts +6 -4
  445. package/dist/solid/wardic-instance.d.ts.map +1 -1
  446. package/dist/solid/wardic.d.ts +3 -0
  447. package/dist/solid/wardic.d.ts.map +1 -1
  448. package/dist/solid/wardic.jsx +3 -0
  449. package/dist/solid/wardic.jsx.map +1 -1
  450. package/package.json +26 -6
  451. package/src/batch-reorder-group.tsx +1 -1
  452. package/src/batch-reorder-places.ts +3 -3
  453. package/src/batch-reorder.ts +9 -6
  454. package/src/config-view.ts +30 -6
  455. package/src/create-animation-controls.ts +22 -0
  456. package/src/create-batch.tsx +1 -1
  457. package/src/element-style.ts +77 -9
  458. package/src/element.tsx +25 -4
  459. package/src/feature-section.ts +5 -15
  460. package/src/gesture-callbacks.ts +2 -0
  461. package/src/hooks/auto.ts +303 -0
  462. package/src/hooks/config-scope.tsx +215 -0
  463. package/src/hooks/config.tsx +54 -0
  464. package/src/hooks/drag.ts +740 -0
  465. package/src/hooks/elements.tsx +234 -0
  466. package/src/hooks/group.tsx +55 -0
  467. package/src/hooks/index.ts +41 -0
  468. package/src/hooks/kept.ts +89 -0
  469. package/src/hooks/layout-group-of.ts +46 -0
  470. package/src/hooks/layout-group.tsx +111 -0
  471. package/src/hooks/make-ward.ts +218 -0
  472. package/src/hooks/presence-scope.tsx +155 -0
  473. package/src/hooks/presence.tsx +67 -0
  474. package/src/hooks/props.ts +190 -0
  475. package/src/hooks/reads.ts +258 -0
  476. package/src/hooks/refs.ts +114 -0
  477. package/src/hooks/reorder-elements.tsx +321 -0
  478. package/src/hooks/reorder.ts +205 -0
  479. package/src/hooks/rune.ts +1755 -0
  480. package/src/hooks/server-features.client.ts +10 -0
  481. package/src/hooks/server-features.ts +12 -0
  482. package/src/hooks/settings.ts +44 -0
  483. package/src/hooks/setup.ts +184 -0
  484. package/src/hooks/stage.ts +359 -0
  485. package/src/hooks/ward.ts +2563 -0
  486. package/src/hooks/wardic-provider.tsx +51 -0
  487. package/src/hooks/wardic-scope.tsx +112 -0
  488. package/src/hooks/wards.ts +679 -0
  489. package/src/index.tsx +31 -17
  490. package/src/layout.tsx +7 -74
  491. package/src/lazy-batch-gestures.ts +1 -1
  492. package/src/lifecycle.ts +72 -24
  493. package/src/motion-props.ts +1 -1
  494. package/src/presence-handle.ts +39 -20
  495. package/src/presence.tsx +3 -1
  496. package/src/provider.tsx +96 -71
  497. package/src/reorder-components.tsx +61 -0
  498. package/src/reorder.tsx +84 -303
  499. package/src/stage-ward.tsx +3 -3
  500. package/src/stage.ts +15 -0
  501. package/src/unstable/v2/index.tsx +6 -26
  502. package/src/v1/batch-reorder-group.tsx +4 -4
  503. package/src/v1/create-ward.tsx +4 -4
  504. package/src/v1/index.tsx +3 -1
  505. package/src/v1/presence.tsx +1 -1
  506. package/src/variant-node.ts +8 -0
  507. package/src/w.tsx +38 -5
  508. package/src/ward.tsx +679 -53
  509. package/src/wardic-config.tsx +68 -21
  510. package/src/wardic-context.ts +26 -0
  511. package/src/wardic-instance.ts +6 -4
  512. package/src/wardic.tsx +3 -0
  513. package/dist/browser/create-wardic.js +0 -36
  514. package/dist/browser/create-wardic.js.map +0 -1
  515. package/dist/browser/presence-hooks.js +0 -144
  516. package/dist/browser/presence-hooks.js.map +0 -1
  517. package/dist/server/create-wardic.js +0 -36
  518. package/dist/server/create-wardic.js.map +0 -1
  519. package/dist/server/presence-hooks.js +0 -144
  520. package/dist/server/presence-hooks.js.map +0 -1
  521. package/dist/solid/create-wardic.d.ts +0 -25
  522. package/dist/solid/create-wardic.d.ts.map +0 -1
  523. package/dist/solid/create-wardic.jsx +0 -34
  524. package/dist/solid/create-wardic.jsx.map +0 -1
  525. package/dist/solid/presence-hooks.d.ts +0 -53
  526. package/dist/solid/presence-hooks.d.ts.map +0 -1
  527. package/dist/solid/presence-hooks.jsx +0 -117
  528. package/dist/solid/presence-hooks.jsx.map +0 -1
  529. package/src/create-wardic.tsx +0 -46
  530. package/src/presence-hooks.tsx +0 -159
@@ -0,0 +1,885 @@
1
+ /**
2
+ * Runes (probe: hooks-first): the pieces `createWard(...runes)` is made of, and how they join into the one
3
+ * config a ward reads.
4
+ *
5
+ * - **A rune** is a config object, or `createRune((ward) => config)` for one that listens to the ward
6
+ * it's part of. A bare function isn't a rune: the ward's own error for a whole config given as an
7
+ * accessor still catches it (ADR-0045 *Amendment (#259)*). `createRune(config)` is the config itself,
8
+ * checked where it's written.
9
+ * - **Its keys are Wardic's, and its Environment's.** Wardic's own say motion, whatever is moved
10
+ * ({@link WardicKeys}); each Environment takes those its ward carries and adds its own, the page
11
+ * here ({@link PageKeys}) and a Stage in `stage.ts`. A rune's type is the keys it has and no
12
+ * others ({@link MadeRune}), so one of Wardic's keys alone fits both, and a key a ward doesn't take
13
+ * is an error at the `createWard` that's given it, which names the key ({@link GivenRune}).
14
+ * - **They join key by key**, a later rune winning: `initial`, `animate`, `exit` and the `while*`
15
+ * targets, `transition` and `style` merge their keys when both are objects; `variants` merge by
16
+ * name, then key by key; anything else is the later rune's. But a `ref`: every rune's runs, and
17
+ * none wins ({@link RuneRef}). And its `props` join name by name, a later rune's winning a name
18
+ * and a list of ids joining, onto the ward's own spread ({@link RuneProps}, `props.ts`).
19
+ * - **`followers`** (`{ stagger, delay, from, order }`), on a ward or inside one variant, is its
20
+ * followers' timing: read into `transition`'s `staggerChildren`, `delayChildren`,
21
+ * `staggerDirection` and `when`.
22
+ * - **A follower's own names are resolved here** (`follow` given): `animate: "open"` becomes its
23
+ * `variants.open`, so it stays a Variant child, following its leader for every prop it doesn't set
24
+ * itself and keeping its stagger slot. A gesture's name is kept, `whileTap: "pressed"` as it is, and
25
+ * the follower is a Variant child by its own word (core's `variantChild`, through its ward's
26
+ * internals; the gap grill's Q26): it joins its leader all the same, and hands the name down to
27
+ * followers of its own, as a `w.*` child does.
28
+ *
29
+ * Throwaway code: quick where it isn't on a frame's path. Nothing here runs per frame.
30
+ *
31
+ * @module
32
+ */
33
+ import type { JSX } from "@solidjs/web";
34
+ import type * as Config from "@wardic/core/unstable/Config";
35
+ import type * as ReducedMotion from "@wardic/core/ReducedMotion";
36
+ import type { Accessor } from "solid-js";
37
+ import type { AnyWard, WardConfig } from "../ward.tsx";
38
+ import type { HookWard } from "./ward.ts";
39
+ import type { Drags, WardDrag } from "./drag.ts";
40
+ /** How a leader times its followers: `followers` on a ward, or inside one of its variants. */
41
+ export interface Followers {
42
+ /** Seconds between one follower's start and the next's (`staggerChildren`). */
43
+ readonly stagger?: number | undefined;
44
+ /** Seconds before the first follower starts, or a `stagger()` function for each one's whole delay (`delayChildren`). */
45
+ readonly delay?: Config.WardicVariantTransition["delayChildren"] | undefined;
46
+ /** Which follower starts first: `"last"` runs them back to front (`staggerDirection: -1`). */
47
+ readonly from?: "first" | "last" | undefined;
48
+ /** Who goes first (`when`): the leader, its followers, or all together (the default). */
49
+ readonly order?: "together" | "leader-first" | "followers-first" | undefined;
50
+ }
51
+ /** The corner a popped ward is pinned by. */
52
+ export type PopCorner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
53
+ /**
54
+ * A rune's `ref` (probe: hooks-first): a function handed its ward's Subject, for what a rune does to
55
+ * it that isn't motion. Listening to it, giving it the focus, measuring it.
56
+ *
57
+ * - **Handed its Subject, and nothing else,** once it's on the page: there to be measured and
58
+ * focused, where Solid's own `ref` has it before it's in the page. On the page a ward's `ref`s
59
+ * begin once it has settled, where Solid has such work begin (`onSettled`).
60
+ * - **Its life is the time its Subject is on show** (the ward's `mounted()`). What it returns undoes
61
+ * it: called once a `show` ward's or a row's exit has landed, hidden or taken away alike, when the
62
+ * ward moves to another Subject, and when the ward ends. Shown again, it runs again.
63
+ * - **Every rune's runs,** in the order the runes were given, and each one's undoing in the reverse.
64
+ * None replaces another, nor a `ref` written on the element itself.
65
+ * - **It isn't tracked and owns nothing,** as Solid's isn't. A signal read as it runs is read once
66
+ * and never followed, and Solid reports the read, as it reports one in a `ref` of its own: what's
67
+ * to follow a signal is an effect, made in a function rune's body, once for its ward. A value
68
+ * meant to be read once is read outside the `ref`: a row's `item` in the row's function, which a
69
+ * list calls untracked. And a signal it writes is best written from a listener it adds: written
70
+ * as the `ref` itself runs, it costs its ward's own effect a second run, which Solid reports too.
71
+ *
72
+ * **A listener it adds** with `addEventListener` hears a click, a key or a pointer's event before
73
+ * any handler written in the page's markup does, the Subject's own and those inside it: Solid hears
74
+ * those, the twenty-two events it delegates, from the root, once they've passed every element. So:
75
+ *
76
+ * - it takes an event with `preventDefault()`, which those handlers then see;
77
+ * - never with `stopPropagation()`, which would keep the event from every one of them;
78
+ * - and it leaves alone an event that began in a child which should keep it, a field's key say
79
+ * (`event.target !== subject`).
80
+ *
81
+ * A handler for an event Solid doesn't delegate (`onScroll`, `onFocus`, `onPointerEnter`) is on its
82
+ * element from the start, and hears it first there.
83
+ *
84
+ * **Where its ward's life isn't a `show`'s,** it's told less:
85
+ *
86
+ * - A ward with no `show`, whose Subject a `<Show>` of the app's own takes away, isn't told: Solid
87
+ * tells a `ref` nothing of a removal. Its undoing waits for the ward's next Subject, or its end.
88
+ * - A ward made inside what a `<Presence>` takes away ends as its exit starts, as a framework ends
89
+ * it, so its `ref` is undone then, its Subject still leaving.
90
+ * - Under `<Presence wait>` the next child is built while the last one leaves, and its `ref` runs
91
+ * then, before the boundary has put its Subject on the page.
92
+ */
93
+ export type RuneRef<Subject> = (subject: Subject) => void | (() => void);
94
+ /** What every element takes in its markup, as Solid's own types say it: an app adds a new attribute there, once. */
95
+ type ElementAttributes = JSX.HTMLAttributes<HTMLElement>;
96
+ /**
97
+ * What an element takes in its markup that's no prop of a rune's: its handlers, a rune's own `ref`
98
+ * and `style`, a `class`, its content, a property set past its attribute, and Solid's own two.
99
+ */
100
+ type NotAnAttribute = `on${string}` | "ref" | "style" | "class" | "children" | "innerHTML" | "innerText" | "textContent" | `prop:${string}` | "$ServerOnly" | "$key";
101
+ /** What a prop is given: its value, or an accessor of it, read where its element reads it. */
102
+ export type PropValue<V> = V | Accessor<V>;
103
+ /**
104
+ * A rune's `props` (probe: hooks-first): what it sets on its ward's Subject beside moving it. On the
105
+ * page, an element's attributes: its `role`, its `tabindex`, an `aria-` state, a `data-` mark of the
106
+ * rune's own.
107
+ *
108
+ * - **Every element's attributes, and no others,** each typed as Solid types it, with any `data-*`.
109
+ * One only some elements have (`disabled`, `href`) says what an element is, which its markup says.
110
+ * An attribute Solid's types don't know yet is declared once, where an app's own markup learns it
111
+ * (`JSX.HTMLAttributes`), and read here too.
112
+ * - **Set through the ward's spread,** beside its `ref` and `style`: so they're in a server's markup,
113
+ * and a component the ward is spread on takes them as props of its own. A ward given its Subject
114
+ * (`subject`) is never spread by its author: the hooks write them on that element themselves, and
115
+ * put back what was there as the ward lets go.
116
+ * - **A value may follow a signal:** an accessor of it, read where the element reads it. `false` and
117
+ * `undefined` leave the attribute off, as Solid does. `props` itself is a plain object, so what a
118
+ * ward sets is known as it's made.
119
+ * - **On the element for as long as it's rendered,** leaving included, where a `ref` is undone once
120
+ * an exit has landed. One that should come off as it leaves says so in its value.
121
+ * - **Across a ward's runes a later one wins,** but a list of ids (`aria-describedby` and its five
122
+ * fellows) joins, in the runes' order: one rune describing its Subject doesn't take another's away.
123
+ * Beside what the element's own markup says, Solid's rule holds: what's written after the spread
124
+ * wins, and what's written before it is replaced.
125
+ *
126
+ * **What's no prop,** each an error where it's written, told the way out ({@link NotAProp}):
127
+ *
128
+ * - A handler (`onClick`). In a spread, the element's own of the same name would replace it, or be
129
+ * replaced, with nothing said. A rune listens in its `ref`.
130
+ * - `style` and `ref`, a rune's own keys beside `props`: the ward animates the one and runs the other.
131
+ * - `class`. A spread's replaces the element's own, or is replaced by it. A rune marks a state with a
132
+ * `data-` attribute, which a stylesheet reads as it is.
133
+ */
134
+ export type RuneProps = RunePropsOf<undefined>;
135
+ /** An element's tag, HTML's or SVG's: what a rune's `tag` names. */
136
+ export type ElementTag = keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap;
137
+ /** The element `Tag` names, HTML's where both name one (`a`): any HTML element where there's no tag. */
138
+ export type ElementOf<Tag> = Tag extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[Tag] : Tag extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[Tag] : HTMLElement;
139
+ /** What the element `Tag` names takes in its markup, as Solid types it: what every element takes, where there's no tag. */
140
+ type AttributesOf<Tag> = Tag extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[Tag] : ElementAttributes;
141
+ /** A rune's `props` ({@link RuneProps}) on the element `Tag` names: that element's attributes, a circle's `fill`, a link's `href`. */
142
+ export type RunePropsOf<Tag> = {
143
+ readonly [K in Exclude<keyof AttributesOf<Tag>, NotAnAttribute>]?: PropValue<AttributesOf<Tag>[K]>;
144
+ };
145
+ /** One variant of a rune: a target that may carry its followers' timing, or a function of `custom`. */
146
+ export type RuneVariant = (Config.WardicVariant & {
147
+ readonly followers?: Followers | undefined;
148
+ }) | Config.WardicVariantResolver;
149
+ /** Wardic's keys a ward's config already has. */
150
+ type WardicConfigKey = "initial" | "animate" | "exit" | "transition" | "custom" | "inherit" | "whileHover" | "whileTap" | "whileFocus" | "whileInView" | "whileDrag";
151
+ /**
152
+ * Wardic's keys (probe: hooks-first): what a rune says of motion, whatever it moves. Every
153
+ * Environment's rune is some of these with its own beside them: the page's takes them all
154
+ * ({@link RuneConfig}), a Stage's those its ward carries (`StageRune`, `stage.ts`). So a rune of these
155
+ * alone fits any ward that takes each key it has.
156
+ *
157
+ * A target's values are its Environment's too, by their names: an element's here, and on a Stage
158
+ * what its Subject takes (`StageRuneWith`, `stage.ts`). So one of these keys fits both when every
159
+ * value it names is one both animate ({@link CheckedTarget}), each as the other takes it: `x`,
160
+ * `opacity`, `scale`. What a value means is its author's to know: a page's `y` is in pixels, a
161
+ * scene's in its own units.
162
+ */
163
+ export interface WardicKeys extends Pick<WardConfig, WardicConfigKey> {
164
+ readonly variants?: Readonly<Record<string, RuneVariant>> | undefined;
165
+ /**
166
+ * The ward this one follows: it takes that ward's variant names for every prop it doesn't set itself.
167
+ * The ward it follows may name its states in place (`animate: "open"`), through a function (a signal
168
+ * of the names, `animate: state`, or `() => …`, one name or several), or by a function rune's: a hook
169
+ * ward carries its variants whatever it sets. Following one that names no state at all, a ward with
170
+ * variants of its own can never be given one, which development says once for that leader; a ward with
171
+ * none may follow it only to leave with it.
172
+ *
173
+ * @example
174
+ * const turns = createRune({ variants: { open: { rotate: 180 }, closed: { rotate: 0 } } })
175
+ *
176
+ * // In the component: `setState("open")` opens the panel, and turns the chevron with it.
177
+ * const [state, setState] = createSignal<"open" | "closed">("closed")
178
+ * const panel = createWard({ initial: "closed", animate: state })
179
+ * const chevron = createWard({ follow: panel }, turns)
180
+ */
181
+ readonly follow?: AnyWard | undefined;
182
+ /** Whether it's shown: it enters from `initial` when true; when false it leaves by `exit`, then hides. */
183
+ readonly show?: Accessor<boolean> | undefined;
184
+ /** Its followers' timing, for every variant that sets none of its own. */
185
+ readonly followers?: Followers | undefined;
186
+ /**
187
+ * `false` starts it at its `animate`, with no entrance, while its `initial` is still where it enters
188
+ * from later and where it leaves to. What `createWards` gives the rows of its first list, with `initial: false`.
189
+ */
190
+ readonly enter?: false | undefined;
191
+ }
192
+ /**
193
+ * The page's own keys, beside Wardic's: the rest of a ward's config on an element. Its `style`, its
194
+ * layout and `layoutId`, its `viewport`, `appear`, and an element's drag and how that's set. A Stage
195
+ * has a drag and a `subject` by the same names, typed as its own (`StageKeys`, `stage.ts`).
196
+ */
197
+ export interface PageKeys extends Omit<WardConfig, keyof WardicKeys | "dragListener" | "dragControls"> {
198
+ /**
199
+ * A `show` ward popped as it leaves: taken out of the flow where it is as it starts to go
200
+ * (`position: absolute`, its size kept), so what's after it takes its place at once. `true` pins it
201
+ * by its top left; a corner's name pins it by that corner, for a container that resizes as it goes
202
+ * and keeps another corner still, as a stack in the bottom right does.
203
+ */
204
+ readonly pop?: boolean | PopCorner | undefined;
205
+ /**
206
+ * Whether it's lifted (probe: behaviour-runes, Q9): a behaviour's word, as a keyboard lift is. A
207
+ * `layout` ward is raised over the rest while it's lifted, and from then until it lands, and its
208
+ * `whileDrag` is on.
209
+ */
210
+ readonly lifted?: Accessor<boolean> | boolean | undefined;
211
+ /**
212
+ * The Subject it moves, or an accessor of it: an element another renders, a router's page for its
213
+ * layout, in place of a spread. With none, its element comes by its `ref`, as a spread gives it.
214
+ */
215
+ readonly subject?: unknown;
216
+ /** What this rune does to its Subject beside moving it ({@link RuneRef}): on the page, an element. */
217
+ readonly ref?: RuneRef<HTMLElement> | undefined;
218
+ /** What this rune sets on its Subject beside moving it ({@link RuneProps}): on the page, an element's attributes. */
219
+ readonly props?: RuneProps | undefined;
220
+ /**
221
+ * The tag of its Subject on the page (the gap grill's Q22). An SVG element's (`"circle"`, `"path"`)
222
+ * has its attribute keys (`cx`, `d`, `pathLength`) render as attributes, on a server and in its first
223
+ * frame, as a `wardic.*` component's own tag has them. Any tag types this rune's `ref` and `props` for
224
+ * that element, and the ward's spread: a ward whose runes name none is an HTML element's. Not the
225
+ * other runes of the call, which TypeScript can't type by it. The last rune to give one wins.
226
+ */
227
+ readonly tag?: ElementTag | undefined;
228
+ /**
229
+ * How it honours the visitor's reduced-motion setting (probe: behaviour-runes, the scopes round's Q10):
230
+ * `"user"` follows it, `"always"` reduces its motion, `"never"` animates whatever it is. Over the
231
+ * config around it, read as each of its animations starts. A config scope given to a ward gives it.
232
+ */
233
+ readonly reducedMotion?: ReducedMotion.Config | Accessor<ReducedMotion.Config | undefined> | undefined;
234
+ /**
235
+ * Its animations land at their ends on the next frame (the scopes round's Q10): for end-to-end and
236
+ * visual-regression tests. Over the config around it, read as each of its animations starts.
237
+ */
238
+ readonly skipAnimations?: boolean | Accessor<boolean | undefined> | undefined;
239
+ /**
240
+ * Where the points its drag or pan uses are (the scopes round's Q10, the gap grill's Q42): handed each
241
+ * in the viewport's coordinates, it gives the one the gesture uses. The function itself, called at each
242
+ * drag or pan start, so it follows what it reads. Over the config around it.
243
+ */
244
+ readonly transformPagePoint?: Config.WardicTransformPoint | undefined;
245
+ }
246
+ /**
247
+ * A rune's config on the page where its Subject is the element `Tag` names: its `ref` handed that
248
+ * Subject, and its `props` its attributes. Every other key a {@link RuneConfig}'s.
249
+ */
250
+ export interface RuneConfigOn<Tag> extends WardicKeys, Omit<PageKeys, "ref" | "props"> {
251
+ readonly ref?: RuneRef<ElementOf<Tag>> | undefined;
252
+ readonly props?: RunePropsOf<Tag> | undefined;
253
+ }
254
+ /**
255
+ * A rune's config on the page: Wardic's keys, and the page's own. `popBox` is left out of the type:
256
+ * where a popped ward was before the change that made it leave, which `createWards` gives each of its
257
+ * rows as a rune of its own and the hooks read by its name, so it's no key for an app to write.
258
+ */
259
+ export interface RuneConfig extends WardicKeys, PageKeys {
260
+ }
261
+ /**
262
+ * The ward a function rune is handed: its ward, by its type too (`HookWard`, `ward.ts`). What it
263
+ * listens to and reads is the finished ward's own, the two sharing one lifecycle: its gestures and
264
+ * its motion (`ward.hovering()`, `reads.ts`); whether it's shown, on the page and leaving
265
+ * (`ward.shown()`, `ward.mounted()`, `ward.exiting()`); and its exits and its readiness
266
+ * (`ward.when("exitComplete")`, `ward.next("ready")`).
267
+ *
268
+ * - **Read where it's followed:** in a value (a `props`', a target's accessor), a memo, an effect.
269
+ * One made in the rune's own body runs at once, before the ward is finished, and is still right:
270
+ * from its first read where the ward's `show` is a plain rune's, and once the page has settled
271
+ * where a presence takes the ward later, or its `show` is a function rune's, whichever comes first
272
+ * among its runes. On a server nothing settles: there, a memo made in the body is right for a
273
+ * plain rune's `show` alone, and a value read as it's rendered is right for any.
274
+ * - **Read bare in the body,** it's read once, and Solid says so, as it does of a signal read at the
275
+ * top of a component's body. Its `ref` is handed its Subject: the ward has no read of that.
276
+ */
277
+ export type RuneWard = HookWard & {
278
+ /** What it hears of its ward's drag (probe: behaviour-runes): a function rune's ward's alone (Q34). */
279
+ readonly drag: WardDrag;
280
+ };
281
+ declare const RUNE: unique symbol;
282
+ /** A rune made of a function of its ward. */
283
+ export interface FunctionRune {
284
+ readonly [RUNE]: (ward: RuneWard) => RuneConfig;
285
+ }
286
+ /** A rune of a ward: a config, or `createRune(fn)`. */
287
+ export type Rune = RuneConfig | FunctionRune;
288
+ declare const CARRIED: unique symbol;
289
+ /**
290
+ * A value that's a rune as it is, beside what else it is: a Reorder list (`createReorder`), whose
291
+ * group gives the ward it's given to its `ref` and its style, the keys a spread of it gives, and keeps
292
+ * its reads to itself. A ward takes it as it is: its keys are its maker's to check, where a config's
293
+ * are the ward's. Not enumerable, so a spread never sees the mark.
294
+ */
295
+ export interface CarriedRune {
296
+ readonly [CARRIED]: true;
297
+ }
298
+ /** The mark of a carried rune that's the page's ({@link PageOnly}): in a type alone, never on a value. */
299
+ declare const PAGE_ONLY: unique symbol;
300
+ /**
301
+ * A carried rune that's the page's alone (probe: behaviour-runes, the scopes round's Q23): a config scope,
302
+ * a layout group. A mark in its type alone, which a Stage's ward refuses ({@link NotOnAStage}): a carried
303
+ * rune is taken as it is, its keys its maker's to check, and these give what only the page has.
304
+ */
305
+ export interface PageOnly {
306
+ readonly [PAGE_ONLY]: true;
307
+ }
308
+ /** What a page-only carried rune ({@link PageOnly}) is told where a ward on a Stage is given it. */
309
+ export type NotOnAStage = "a config scope or a layout group is the page's: a ward on a Stage takes none";
310
+ /** A carried rune `X` where `Taken` is: as it is, unless it's the page's alone and `Taken` isn't the page. */
311
+ type FitCarried<X, Taken extends RunesTaken> = [X, Taken["whose"]] extends [PageOnly, "a ward on a Stage"] ? NotOnAStage : X;
312
+ /** `value` marked a {@link CarriedRune}: a rune as it is wherever a ward is given it. */
313
+ export declare const carriedRune: <A extends object>(value: A) => A & CarriedRune;
314
+ /** What `createRuneWith(rune, api)` gives back: the rune, and its API beside it. */
315
+ export type RuneWith<R, Api> = R & Readonly<Api>;
316
+ /** What an API member named like a rune's key is told, where `createRuneWith` is given one (the rune-with grill's Q10). */
317
+ export type ApiClash<K> = `"${K & string}" is a rune's key: an API member can't share its name`;
318
+ /**
319
+ * An API as `createRuneWith` takes it where `Taken` is: its members as they are, one named like a key of
320
+ * `Taken`'s runes told {@link ApiClash}, which the API's own would hide from the ward. `& A` is what `A` is
321
+ * inferred from.
322
+ */
323
+ export type ApiFor<A, Taken extends RunesTaken> = A & {
324
+ readonly [K in keyof A & keyof Taken["config"]]: ApiClash<K>;
325
+ };
326
+ /**
327
+ * `rune` carrying `api` (probe: behaviour-runes, the rune-with grill): one value that's a rune where a ward
328
+ * is given it, and an API where an app calls it, as a utility of an app's own hands one back. The rune is
329
+ * a config, checked where it's written as `createRune(config)`'s is, or a behaviour (`createRune(fn)`). A
330
+ * config's keys are the ones it has as `createRuneWith` is called, and a ward reads each one live. The API's
331
+ * members are invisible to a ward and to a spread, and read-only; one named like a rune's key is refused. A
332
+ * rune given to it is never changed.
333
+ *
334
+ * ```tsx
335
+ * const createCarousel = (count: number) => {
336
+ * const [index, setIndex] = createSignal(0)
337
+ * return createRuneWith(
338
+ * { get animate() { return { x: `${-index() * 100}%` } }, transition: { type: "spring", bounce: 0 } },
339
+ * { index, next: () => setIndex((i) => Math.min(i + 1, count - 1)), prev: () => setIndex((i) => Math.max(i - 1, 0)) },
340
+ * )
341
+ * }
342
+ *
343
+ * const carousel = createCarousel(slides.length)
344
+ * const track = createWard({ drag: "x" }, carousel) // a rune, beside the app's own
345
+ * <div {...track}>…</div>
346
+ * <button onClick={carousel.next}>Next</button> // and its API
347
+ * ```
348
+ */
349
+ export declare function createRuneWith<F extends FunctionRune, A extends object>(behaviour: F, api: ApiFor<A, OnThePage>): RuneWith<F, A>;
350
+ /**
351
+ * A function that's a ref carrying its props, its keys its maker's to check (a Reorder group): given its API as
352
+ * it is, so it's still a ref. One with no `ref` of its own isn't one: a behaviour is `createRune(fn)`.
353
+ */
354
+ export declare function createRuneWith<F extends ((...args: never) => unknown) & {
355
+ readonly ref: unknown;
356
+ }, A extends object>(ref: F, api: ApiFor<A, OnThePage>): RuneWith<F, A> & CarriedRune;
357
+ export declare function createRuneWith<P extends {
358
+ readonly tag: ElementTag;
359
+ }, A extends object>(rune: GivenRune<P, PageTaken<P["tag"]>>, api: ApiFor<A, OnThePage>): RuneWith<MadeRune<P, PageTaken<P["tag"]>>, A> & CarriedRune;
360
+ export declare function createRuneWith<P extends object, A extends object>(rune: GivenRune<P, OnThePage>, api: ApiFor<A, OnThePage>): RuneWith<MadeRune<P, OnThePage>, A> & CarriedRune;
361
+ /**
362
+ * What a ward takes where it is, which the hooks' types check its runes by: the page's here
363
+ * ({@link OnThePage}), a Stage's in `stage.ts`. One for each place a ward can be, so a check is
364
+ * written once and holds in both: a ward's runes ({@link RunesGiven}) and a list's rows'
365
+ * (`RowRunesGiven`, `wards.ts`).
366
+ */
367
+ export interface RunesTaken {
368
+ /** A rune's config there: the keys of Wardic's its ward carries, and its own. */
369
+ readonly config: object;
370
+ /** Whose ward it is, as an error names it: "a ward on the page". */
371
+ readonly whose: string;
372
+ /** `true` where its ward carries a function rune (`createRune(fn)`); else what one is told where it's given. */
373
+ readonly functionRune: true | string;
374
+ /**
375
+ * What each value takes in a target there, by its name: what a ward there animates. Any name at
376
+ * all (a string index) where nothing says what its Subject takes.
377
+ */
378
+ readonly values: object;
379
+ /**
380
+ * Every name some Subject there takes, where a ward's own Subject takes only some of them: a name
381
+ * among these and not in `values` is another Subject's. None where every ward takes the same.
382
+ */
383
+ readonly everyName: PropertyKey;
384
+ }
385
+ /** What a ward on the page takes: every key of a rune's, a function rune, and an element's values. */
386
+ export interface OnThePage extends RunesTaken {
387
+ readonly config: RuneConfig;
388
+ readonly whose: "a ward on the page";
389
+ readonly functionRune: true;
390
+ readonly values: Config.ValueKeys;
391
+ readonly everyName: never;
392
+ }
393
+ /** What a ward on the page takes where its Subject is the element `Tag` names ({@link RuneConfigOn}). */
394
+ export interface OnThePageOf<Tag> extends RunesTaken {
395
+ readonly config: RuneConfigOn<Tag>;
396
+ readonly whose: "a ward on the page";
397
+ readonly functionRune: true;
398
+ readonly values: Config.ValueKeys;
399
+ readonly everyName: never;
400
+ }
401
+ /** What a ward on the page takes, given the tag its runes name: any HTML element's where they name none. */
402
+ export type PageTaken<Tag> = [Tag] extends [undefined] ? OnThePage : OnThePageOf<Tag>;
403
+ /** `Taken` given the tag its runes name: the page's for a Subject that element; a Stage's as it is, which takes no tag. */
404
+ export type TakenWithTag<Taken extends RunesTaken, Tag> = [Tag] extends [undefined] ? Taken : Taken extends OnThePage ? OnThePageOf<Tag> : Taken;
405
+ declare const GIVES: unique symbol;
406
+ /** A function rune, with the config its function gives in its type alone: so a ward knows the tag it names. */
407
+ export interface FunctionRuneOf<G> extends FunctionRune {
408
+ readonly [GIVES]?: G;
409
+ }
410
+ /**
411
+ * The tag rune `X` names: its `tag`, or a function rune's as its function gives it. None where it
412
+ * names none, or where its type is as wide as any tag's (a rune passed on as a `Rune`). A rune with
413
+ * no `tag` is told apart by its keys first: inferring an optional `tag` out of every rune cost a ward
414
+ * a fifth again of what its runes' check costs the checker.
415
+ */
416
+ export type TagIn<X> = X extends FunctionRune ? X extends FunctionRuneOf<infer G> ? TagIn<G> : never : "tag" extends keyof X ? X extends {
417
+ readonly tag: infer T;
418
+ } ? ElementTag extends T ? never : Extract<T, ElementTag> : never : never;
419
+ /**
420
+ * The tag the runes `A` name, which their ward's spread is typed for: none where none does. Read
421
+ * over the runes as one union, not rune by rune from the last: where two name different tags, the
422
+ * spread is either element's, where the ward itself takes the last one's.
423
+ */
424
+ export type TagGiven<A extends ReadonlyArray<unknown>> = [TagIn<A[number]>] extends [never] ? undefined : TagIn<A[number]>;
425
+ /**
426
+ * Whether rune `X` gives a `drag` (probe: behaviour-runes, Q20): a function rune's as its function
427
+ * gives it. The key, given at all: whether it's on now is the drag's to say.
428
+ */
429
+ export type DragIn<X> = X extends FunctionRune ? (X extends FunctionRuneOf<infer G> ? DragIn<G> : never) : "drag" extends keyof X ? true : never;
430
+ /** The mark of a ward that drags where one of `A`'s runes gives a `drag`, and nothing where none does (Q20). */
431
+ export type DragsGiven<A extends ReadonlyArray<unknown>> = [DragIn<A[number]>] extends [never] ? unknown : Drags;
432
+ /** What a key is told where a ward that doesn't take it is given it: the key, and `Whose` ward that is. Where the key's value was. */
433
+ export type NotAKey<Key, Whose extends string> = `"${Key & string}" isn't a key ${Whose} takes`;
434
+ /** A rune's keys that take a target: its values, each under its name. */
435
+ type TargetKey = "initial" | "animate" | "exit" | "whileHover" | "whileTap" | "whileFocus" | "whileInView" | "whileDrag";
436
+ /** A rune's keys that name values: a target, each variant, and a transition's entry for one value. */
437
+ type ValuedKey = TargetKey | "variants" | "transition";
438
+ /**
439
+ * What a value's name is told where a ward that doesn't animate it is given it: the name, and whose
440
+ * ward that is, or that its own Subject hasn't it where another there has. Where the value was.
441
+ */
442
+ export type NotAValue<Name, Taken extends RunesTaken> = Name extends Taken["everyName"] ? `"${Name & string}" isn't a value this Subject animates` : `"${Name & string}" isn't a value ${Taken["whose"]} animates`;
443
+ /** What a name in a transition is told that's neither one of its own keys nor a value's, for that value's entry: as {@link NotAValue} tells a value. */
444
+ export type NotInATransition<Name, Taken extends RunesTaken> = Name extends Taken["everyName"] ? `"${Name & string}" isn't a transition's key, nor a value this Subject animates` : `"${Name & string}" isn't a transition's key, nor a value ${Taken["whose"]} animates`;
445
+ /** Whether `T`'s names aren't known: a map built as the page runs, typed by a string index. Left as it is. */
446
+ type IsWide<T> = string extends keyof T ? true : false;
447
+ /** Each key of each member of a union. */
448
+ type KeyOfEach<U> = U extends unknown ? keyof U : never;
449
+ /**
450
+ * A transition's own keys: a spring's, a tween's and an inertia's, and what every one of them takes.
451
+ * A value of the same name as one of them (a spring's `mass`, an inertia's `power`) has no entry in
452
+ * a transition: the name is the transition's there.
453
+ */
454
+ export type TransitionKey = KeyOfEach<Config.WardicTransitionWith<Config.WardicInherit>> | "default" | "layout";
455
+ /** What a value takes in a target: itself, or its Keyframes. */
456
+ type OrKeyframes<V> = V | Config.WardicKeyframes<Exclude<V, undefined>>;
457
+ /** A variant's `followers` where `Taken`'s ward times followers, and the key's own error where it takes none. */
458
+ type FollowersIn<T, Taken extends RunesTaken> = "followers" extends keyof Taken["config"] ? T : NotAKey<"followers", Taken["whose"]>;
459
+ /** What has no names to check: a variant's name, `false`, a CSS value written whole. `string & {}` is an object to the checker. */
460
+ type Nameless = string | number | boolean | null | undefined;
461
+ /** A Transition end as it's written, each of its names one of `Taken`'s values. */
462
+ type CheckedEnd<T, Taken extends RunesTaken> = T extends Nameless ? T : T extends object ? IsWide<T> extends true ? T : {
463
+ readonly [N in keyof T]: N extends keyof Taken["values"] ? Taken["values"][N] : NotAValue<N, Taken>;
464
+ } : T;
465
+ /** A transition as it's written, each of its keys its own or the entry of one of `Taken`'s values. */
466
+ type CheckedTransition<T, Taken extends RunesTaken> = T extends Nameless ? T : T extends (...args: infer Args) => infer Gives ? (...args: Args) => CheckedTransition<Gives, Taken> : T extends object ? IsWide<T> extends true ? T : {
467
+ readonly [F in keyof T]: F extends TransitionKey ? T[F] : F extends keyof Taken["values"] ? Config.WardicValueTransition | undefined : NotInATransition<F, Taken>;
468
+ } : T;
469
+ /**
470
+ * A target as it's written, each of its names one of `Taken`'s values: what a ward there animates. A
471
+ * name that isn't is the error's text ({@link NotAValue}), where its value was. Read through a
472
+ * function, an accessor's or a dynamic variant's, into what that gives; a variant's name, a list of
473
+ * them, `false` and Animation controls are left as they are, having no names.
474
+ */
475
+ type CheckedTarget<T, Taken extends RunesTaken> = T extends Nameless ? T : T extends (...args: infer Args) => infer Gives ? (...args: Args) => CheckedTarget<Gives, Taken> : T extends object ? T extends ReadonlyArray<unknown> | Config.WardicAnimationControls ? T : IsWide<T> extends true ? T : {
476
+ readonly [N in keyof T]: N extends "transition" ? CheckedTransition<T[N], Taken> : N extends "transitionEnd" ? CheckedEnd<T[N], Taken> : N extends "followers" ? FollowersIn<T[N], Taken> : N extends keyof Taken["values"] ? OrKeyframes<Taken["values"][N]> : NotAValue<N, Taken>;
477
+ } : T;
478
+ /** A variants map as it's written, each variant checked as a target is. */
479
+ type CheckedVariants<T, Taken extends RunesTaken> = T extends object ? (IsWide<T> extends true ? T : {
480
+ readonly [Name in keyof T]: CheckedTarget<T[Name], Taken>;
481
+ }) : T;
482
+ /**
483
+ * A target's keys that aren't a value's name where `Taken` is: its own transition, its Transition
484
+ * end, and a variant's `followers` where its ward times followers.
485
+ */
486
+ type TargetOwnKey<Taken extends RunesTaken> = "transition" | "transitionEnd" | ("followers" extends keyof Taken["config"] ? "followers" : never);
487
+ /** The names in a map of values `T` that aren't among `Allowed`: none for what has no names, or whose names aren't known. */
488
+ type StrayIn<T, Allowed> = T extends Nameless ? never : T extends object ? (IsWide<T> extends true ? never : Exclude<keyof T, Allowed>) : never;
489
+ /** The keys of a transition `T` that are neither its own nor the entry of one of `Taken`'s values. */
490
+ type StrayInTransition<T, Taken extends RunesTaken> = T extends Nameless ? never : T extends (...args: never) => infer Gives ? StrayInTransition<Gives, Taken> : StrayIn<T, TransitionKey | keyof Taken["values"]>;
491
+ /**
492
+ * The names a target `T` has that `Taken`'s ward doesn't animate: among its values, in its
493
+ * Transition end, and among its own transition's entries. Read through a function into what it
494
+ * gives, and each member of a union on its own.
495
+ */
496
+ type StrayInTarget<T, Taken extends RunesTaken> = T extends Nameless ? never : T extends (...args: never) => infer Gives ? StrayInTarget<Gives, Taken> : T extends ReadonlyArray<unknown> | Config.WardicAnimationControls ? never : StrayIn<T, keyof Taken["values"] | TargetOwnKey<Taken>> | (T extends {
497
+ readonly transitionEnd?: infer End;
498
+ } ? StrayIn<End, keyof Taken["values"]> : never) | (T extends {
499
+ readonly transition?: infer Own;
500
+ } ? StrayInTransition<Own, Taken> : never);
501
+ /** The same of each variant in a variants map. */
502
+ type StrayInVariants<T, Taken extends RunesTaken> = T extends object ? (string extends keyof T ? never : {
503
+ readonly [Name in keyof T]: StrayInTarget<T[Name], Taken>;
504
+ }[keyof T]) : never;
505
+ /** The names one of a rune's keys that name values has that `Taken`'s ward doesn't animate. None where it fits. */
506
+ type Stray<K, T, Taken extends RunesTaken> = K extends TargetKey ? StrayInTarget<T, Taken> : K extends "variants" ? StrayInVariants<T, Taken> : StrayInTransition<T, Taken>;
507
+ /** One of a rune's keys that name values, written out again with each name checked, the error where a wrong one's value was. */
508
+ type Rewritten<K, T, Taken extends RunesTaken> = K extends TargetKey ? CheckedTarget<T, Taken> : K extends "variants" ? CheckedVariants<T, Taken> : CheckedTransition<T, Taken>;
509
+ /**
510
+ * One of a rune's keys that name values, as it's written, checked by the values `Taken`'s ward
511
+ * animates; `Own` is the key's own type there.
512
+ *
513
+ * - **Where every name fits,** nothing more than `Own` asks: looking the names up is all it costs.
514
+ * Laid over every key of every rune, written out again, the check cost the checker four times
515
+ * the work for each ward, and a file of them four times as long.
516
+ * - **Where one doesn't,** the key is written out again with the error where that name's value was
517
+ * ({@link CheckedTarget}). Unless it's typed as wide as `Own` itself: a rune passed on as a
518
+ * `Rune`, or a target as a Stage's own type, with no literal behind it, says nothing of which
519
+ * values it names, and fits by its types alone.
520
+ * - **Where any name goes,** a Subject nothing says anything of, there's no name to look up, and
521
+ * the key is written out again all the same: it's what tells a transition's entry for a value
522
+ * from one of its own keys misspelt.
523
+ */
524
+ type CheckedValues<K, T, Taken extends RunesTaken, Own> = string extends keyof Taken["values"] ? Rewritten<K, T, Taken> : [Stray<K, T, Taken>] extends [never] ? unknown : [Own] extends [T] ? unknown : Rewritten<K, T, Taken>;
525
+ /**
526
+ * What a name in a rune's `props` is told that's no prop: where its value was. Three have a way out,
527
+ * and are told it: a handler, a rune's own key, and a class. Anything else is a name no element
528
+ * takes: a misspelling, its content, an attribute only some elements have.
529
+ */
530
+ export type NotAProp<Name, Whose extends string> = Name extends `on${string}` ? `"${Name}" isn't a prop a rune sets: a rune listens in its ref` : Name extends "style" | "ref" ? `"${Name}" isn't a prop a rune sets: it's the rune's own key, beside props` : Name extends "class" ? `"class" isn't a prop a rune sets: mark a state with a data- attribute` : `"${Name & string}" isn't a prop ${Whose} sets`;
531
+ /** What a rune's `props` is told given as an accessor: its values follow a signal, not the object. */
532
+ export type PropsNotAnAccessor = "a rune's props is an object as it's written: an accessor goes on a value in it";
533
+ /** The names in a `props` `T` that `Own`, the key's own type, doesn't have. None where it has no names. */
534
+ type StrayProps<T, Own> = T extends object ? Exclude<keyof T, keyof NonNullable<Own>> : never;
535
+ /** A `props` as it's written, each of its names one of `Own`'s, or the error's text where its value was. */
536
+ type RewrittenProps<T, Own, Whose extends string> = T extends object ? {
537
+ readonly [N in keyof T]: N extends keyof NonNullable<Own> ? NonNullable<Own>[N] : NotAProp<N, Whose>;
538
+ } : T;
539
+ /**
540
+ * A rune's `props` as it's written, checked by the names its Environment's `props` has, `Own`: as
541
+ * a target's values are ({@link CheckedValues}), and for its reason. Where every name fits, nothing
542
+ * more than `Own` asks. Where one doesn't, `props` is written out again with the error where that
543
+ * name's value was ({@link NotAProp}): so it's told wherever `props` was written, a constant and what
544
+ * a function gives among them, where the checker's own rule for a name that's extra looks only at an
545
+ * object written in place. An accessor is told apart first: with no names, it passed.
546
+ */
547
+ type CheckedProps<T, Own, Whose extends string> = T extends (...args: never) => unknown ? PropsNotAnAccessor : [StrayProps<T, Own>] extends [never] ? unknown : RewrittenProps<T, Own, Whose>;
548
+ /**
549
+ * A rune as a `createRune` gives it back: the keys it was given, those of `P`'s that are a rune's
550
+ * where `Taken` is, and no others. Its keys are in its type, so a ward can check them
551
+ * ({@link GivenRune}). A key that names values (a target, `variants`, `transition`) keeps what was
552
+ * written, so the ward a rune is later given to knows each value it names: one written for the page
553
+ * fits a Stage's ward when that Subject animates each of them. So does its `subject`, by which that
554
+ * ward knows whose values they are. Every other key is typed as a rune there types it, not as its
555
+ * literal.
556
+ *
557
+ * Two other shapes were tried, and each lost one of the two things a rune written in a constant is
558
+ * for. The literal's own type lost the check inside a key's value: a key a transition doesn't have
559
+ * (`stiffnes`) was part of the type being inferred, so nothing called it extra. The keys alone,
560
+ * inferred as a union, lost an editor's completions: with a rune's keys taken from those written so
561
+ * far, there were no others to offer.
562
+ */
563
+ export type MadeRune<P, Taken extends RunesTaken> = {
564
+ readonly [K in keyof P & keyof Taken["config"]]: K extends ValuedKey | "subject" | "tag" ? P[K] : Exclude<Taken["config"][K], undefined>;
565
+ };
566
+ /**
567
+ * A config as a `createWard` takes it given, and a `createRune` written: a rune's where `Taken` is,
568
+ * each key `P` has typed by it, and a key that isn't one of its keys the error's text. A rune is
569
+ * checked by the ward that takes it, since a rune's own type holds only the keys it has: one written
570
+ * for another place fits wherever every key it has is taken. A function has no keys, so it's told
571
+ * apart first ({@link NotAConfig}): with none to check, it passed. `& P` there is what `P` is
572
+ * inferred from: by its keys alone, a function was inferred as an empty rune.
573
+ *
574
+ * The values it names are checked the same way, a level down ({@link CheckedTarget}): each name in
575
+ * a target, a variant, a Transition end and a transition's entries is one `Taken`'s ward animates,
576
+ * or the error's text where its value was.
577
+ */
578
+ export type GivenRune<P, Taken extends RunesTaken> = P extends (...args: never) => unknown ? NotAConfig & P : Taken["config"] & {
579
+ readonly [K in keyof P]: K extends keyof Taken["config"] ? K extends ValuedKey ? CheckedValues<K, P[K], Taken, Taken["config"][K]> : K extends "props" ? Taken["config"][K] & CheckedProps<P[K], Taken["config"][K], Taken["whose"]> : Taken["config"][K] : NotAKey<K, Taken["whose"]>;
580
+ };
581
+ /**
582
+ * What a bare function is told where a config is taken: by a ward, whose rune is a config or
583
+ * `createRune(fn)`, and by `createRune(config)`, where it's what a function rune reads as once its own
584
+ * config has an error.
585
+ */
586
+ export type NotAConfig = "a function isn't a config";
587
+ /**
588
+ * One rune as a ward is given it: a config, checked key by key ({@link GivenRune}); a function rune
589
+ * as it is where `Taken`'s ward carries one, and what it's told there where it doesn't; a carried one
590
+ * as it is ({@link CarriedRune}), unless it's the page's alone ({@link PageOnly}) and `Taken` isn't the
591
+ * page. Anything that's no object is no rune: it's told the rune it should have been.
592
+ */
593
+ export type FitRune<X, Taken extends RunesTaken> = X extends CarriedRune ? FitCarried<X, Taken> : X extends FunctionRune ? Taken["functionRune"] extends true ? X : Taken["functionRune"] : X extends object ? GivenRune<X, Taken> : RuneIn<Taken>;
594
+ /**
595
+ * The runes a ward is given, each checked as {@link FitRune}. A rune's type is the keys it has, so
596
+ * one written for another place with a key that's only that place's is an error here that names it.
597
+ */
598
+ export type RunesGiven<A extends ReadonlyArray<unknown>, Taken extends RunesTaken> = {
599
+ readonly [I in keyof A]: FitRune<A[I], Taken>;
600
+ };
601
+ /**
602
+ * The runes a ward on the page is given, each checked for the element its own `tag` names (the gap
603
+ * grill's Q22): a tag types the rune it's in. Not one rune by another's, which TypeScript can't do
604
+ * for a `ref` written in place: the list's tag isn't known until each rune is, that `ref` among them,
605
+ * and the `ref` lost its type. While a rune is still being worked out it's any HTML element's, as before.
606
+ */
607
+ export type PageRunesGiven<A extends ReadonlyArray<unknown>> = {
608
+ readonly [I in keyof A]: FitTaggedRune<A[I], OnThePage>;
609
+ };
610
+ /**
611
+ * One rune as {@link FitRune} has it, a config checked for the element its own `tag` names where
612
+ * `Taken` is the page ({@link TakenWithTag}), a carried one as it is. What's no rune is told `Taken`'s plain rune: that branch
613
+ * is also what a rune still being worked out, a `ref` alone in it, is typed by, so it names no tag.
614
+ */
615
+ export type FitTaggedRune<X, Taken extends RunesTaken> = X extends CarriedRune ? FitCarried<X, Taken> : X extends FunctionRune ? Taken["functionRune"] extends true ? X : Taken["functionRune"] : X extends object ? GivenRune<X, TakenWithTag<Taken, TagIn<X>>> : RuneIn<Taken>;
616
+ /** A rune where `Taken` is, before any check: its config, or a function rune where its ward carries one. */
617
+ export type RuneIn<Taken extends RunesTaken> = Taken["config"] | (Taken["functionRune"] extends true ? FunctionRune : never);
618
+ /**
619
+ * A rune, written apart from the wards that take it.
620
+ *
621
+ * **A rune is made once, for what it describes:** in a module if it depends on nothing, once in a hook
622
+ * if it depends on that hook's state, and by a function, once for each element, if it depends on
623
+ * which element it's on. Never in JSX or in a spread. Runes are what a hook of an app's gives, where
624
+ * the ward is the component's ({@link createWard}): a hook that reads or listens to its own ward gives
625
+ * a function rune, as `dragToClose` below does, rather than making the ward itself.
626
+ *
627
+ * **Given a function of its ward,** it's a rune that listens to the ward it's part of. `make` is a
628
+ * hook's body: it's called once for each ward the rune is given to, as that ward is made and under its
629
+ * owner, with a ward whose events and reads are the finished ward's. So the rune is written once and
630
+ * every ward that takes it has its own run.
631
+ *
632
+ * const dragToClose = (close: () => void) =>
633
+ * createRune((sheet) => {
634
+ * createEffect(sheet.when("dragEnd"), (release) => {
635
+ * if (release.offset.y > 120) close()
636
+ * })
637
+ * return { drag: "y", dragSnapToOrigin: true }
638
+ * })
639
+ *
640
+ * **Given a config,** it's that config and nothing more, checked where it's written: its keys complete
641
+ * there, a misspelt one is an error there, and a literal needs no `as const`. Its type is the keys it
642
+ * has and no others ({@link MadeRune}). It's how a rune kept in a constant is written, since nothing
643
+ * else checks one there. A rune written in a ward's own call is checked by that call, and a plain
644
+ * object is still a rune.
645
+ *
646
+ * const lift = createRune({ whileHover: { y: -4 } })
647
+ * const spring = (stiffness: number) => createRune({ transition: { type: "spring", stiffness, damping: 28 } })
648
+ *
649
+ * **A rune is fixed once made.** Its keys are the ones it has as it's made, and a plain value in it
650
+ * (a target, a transition, its variants) can't change: the object given is frozen, and setting,
651
+ * adding or deleting a key throws. In development the data inside it is frozen too, so changing a
652
+ * value inside a target throws there; a build doesn't ship that walk. What changes is an accessor, a function or a
653
+ * getter, read where the ward reads it (`animate: () => ({ x: x() })`), or a store, whose keys are
654
+ * the ones it has as the rune is made, each read through the store. What depends on the ward itself
655
+ * is a function rune. What's under `custom`, `layoutDependency`, `dragControls` and `subject` is the
656
+ * app's own: the key is fixed, and what's inside it isn't touched.
657
+ *
658
+ * So what every ward that takes it would work out of it is worked out once, here ({@link factsOf}),
659
+ * and a ward of runes made this way reads none of them: a list's rows, a component used many times.
660
+ *
661
+ * **A key is best given by one rune.** A key several of a ward's runes give is merged across them
662
+ * (a target's values joined, a later rune's winning) each time it changes: both its accessors called
663
+ * and their objects merged, where one rune's is read as it is. A ward whose `animate` two runes give
664
+ * retargets several per cent slower for it.
665
+ */
666
+ export declare function createRune<G extends object>(make: (ward: RuneWard) => GivenRune<G, OnThePage>): FunctionRuneOf<G>;
667
+ export declare function createRune<G extends {
668
+ readonly tag: ElementTag;
669
+ }>(make: (ward: RuneWard) => GivenRune<G, PageTaken<G["tag"]>>): FunctionRuneOf<G>;
670
+ export declare function createRune<P extends {
671
+ readonly tag: ElementTag;
672
+ }>(config: GivenRune<P, PageTaken<P["tag"]>>): MadeRune<P, PageTaken<P["tag"]>>;
673
+ export declare function createRune<P extends object>(config: GivenRune<P, OnThePage>): MadeRune<P, OnThePage>;
674
+ /**
675
+ * `config` made a rune ({@link createRune}): fixed, the data inside it too, and what a ward works out
676
+ * of it worked out now and kept with it. Read untracked, as it may be made in a component's body: its
677
+ * getters, and a store's keys, are read for what they are, not followed. A Stage's `createRune` too.
678
+ */
679
+ export declare const madeRune: (config: object) => object;
680
+ /**
681
+ * Each of `runes` fixed as a ward is made of them ({@link fixedRune}), one `createRune` made as it is:
682
+ * an object given straight to `createWard`, a function rune's config, a list's row's own. Frozen, the
683
+ * plain data inside it too, in development alone: a write to one throws there, where an app is made,
684
+ * and a build doesn't pay to freeze a literal for every ward. A rune `createRune` made is frozen in
685
+ * a build too, once. The runes themselves, but for a store or Solid's merged props, which are read
686
+ * through an object of their keys as they are now, in a build as in development.
687
+ */
688
+ export declare const fixedRunes: <R extends ReadonlyArray<unknown>>(runes: R) => R;
689
+ /**
690
+ * What a ward works out of one rune of its own, the same for every ward that takes it: worked out
691
+ * once for a rune `createRune` made, and kept with it ({@link FACTS}), and for any other as a ward is
692
+ * made of it.
693
+ */
694
+ export interface RuneFacts {
695
+ /** Whether it can be a ward's config as it is, alone ({@link isPlainConfig}): worked out for a rune kept, and `false` for any other, which is asked where it's alone. */
696
+ readonly plain: boolean;
697
+ /** Whether it gives the ward a key: one of the ward config's, and not the hooks' own. */
698
+ readonly givesTheWard: boolean;
699
+ /**
700
+ * Whether it has to be joined, key by key ({@link joined}): it follows, or times its followers; or
701
+ * its `variants` carry timing, or are an accessor's or a getter's ({@link variantsNeedJoining}).
702
+ */
703
+ readonly joins: boolean;
704
+ /** Whether it gives a callback, which the ward calls with what it tells: joined where it's beside another rune. */
705
+ readonly callback: boolean;
706
+ /** Which of {@link SEEN}'s keys it gives, a bit for each. */
707
+ readonly seen: number;
708
+ /** Its own keys, in the order it has them: the hooks' own among them, which give the ward nothing. */
709
+ readonly keys: ReadonlyArray<string>;
710
+ /**
711
+ * What each of {@link keys} is fixed as over another rune's, where this one gives it alone: its
712
+ * value, or its accessor, or {@link ACROSS} for a getter's, read across the runes. Kept for a rune
713
+ * `createRune` made; for any other it's looked up as it's needed ({@link besideOf}).
714
+ */
715
+ readonly fixes: Readonly<Record<string, unknown>> | undefined;
716
+ }
717
+ /** Whether one rune can be a ward's config as it is ({@link isPlainConfig}): kept, for one `createRune` made, or worked out now, untracked. */
718
+ export declare const isPlainRune: (rune: RuneConfig) => boolean;
719
+ /** Whether `value` is a `createRune(fn)`. */
720
+ export declare const isFunctionRune: (value: unknown) => value is FunctionRune;
721
+ /** `value`'s function: what `createRune(fn)` holds. */
722
+ export declare const functionOf: (value: FunctionRune) => ((ward: RuneWard) => RuneConfig);
723
+ /**
724
+ * Whether a ward of `runes` names no state at all, as they're written (the follow grill's Q2): what a ward
725
+ * that follows it is warned of in development. Nothing is read to say so: a function, a getter or a
726
+ * function rune may name one, and isn't called.
727
+ */
728
+ export declare const namesNothing: (runes: ReadonlyArray<Rune>) => boolean;
729
+ /**
730
+ * Whether a ward of `runes` has `variants` of its own, as they're written (the follow grill's Q12): one a
731
+ * follower is warned for, where the ward it follows names no state, since none of its variants can ever be
732
+ * chosen. One with none follows only to leave with its leader (Q12, Q20), and isn't.
733
+ */
734
+ export declare const hasOwnVariants: (runes: ReadonlyArray<Rune>) => boolean;
735
+ /** Whether one config alone needs none of the hooks' own work: it can be the ward's config as it is. */
736
+ export declare const isPlainConfig: (config: RuneConfig) => boolean;
737
+ /** A config read by its keys alone, each as it reads now: no `in` and no list of its keys is answered by one that's a view. */
738
+ export type ReadByKey = Readonly<Record<string, unknown>>;
739
+ /** What {@link joined} and {@link joinedOver} give: the ward's config, and what the hooks read of the runes themselves. */
740
+ export interface Joined {
741
+ /**
742
+ * The ward's config, read where the ward reads it: joined, each key a getter over the runes'; read
743
+ * through ({@link joinedOver}), one of the runes itself, with its `wired` keys to fix over it.
744
+ */
745
+ readonly config: WardConfig;
746
+ /** Its `follow`, read once. */
747
+ readonly follow: AnyWard | undefined;
748
+ /** Its `show`, read once. */
749
+ readonly show: Accessor<boolean> | undefined;
750
+ /** A key's joined value, as the ward would read it now. */
751
+ readonly value: (key: string) => unknown;
752
+ /** One of the hooks' own keys (`pop`, `popBox`, `subject`), read once. */
753
+ readonly own: (key: "pop" | "popBox" | "subject" | "lifted") => unknown;
754
+ /** Whether any rune gives `key`. */
755
+ readonly has: (key: string) => boolean;
756
+ /** Whether it has no entrance (`enter: false`): its `initial` is then one of its wired keys ({@link wiredOf}). */
757
+ readonly unentered: boolean;
758
+ /**
759
+ * Whether it's a **Variant child** by its own word: a follower that names a gesture of its own,
760
+ * which keeps the name (the gap grill's Q26). Its ward's internals tell core so (`variantChild`).
761
+ */
762
+ readonly variantChild: boolean;
763
+ /**
764
+ * The keys to be read from somewhere other than `config`, for the ward to fix over it (its
765
+ * internals' `fixed`): where `config` is a rune read through as it's written, which gets no getter
766
+ * of its own. What the runes beside it give, and what the ward's wiring reads ({@link wiredOf}).
767
+ * None where the runes were joined, whose config's getters read both ways.
768
+ */
769
+ readonly wired?: Wired | undefined;
770
+ /**
771
+ * Its config as its keys read now, an accessor's called: what a ward's Features are found by
772
+ * (`auto.ts`). A joined config, whose getters read that way; a rune read through, read key by key.
773
+ */
774
+ readonly asRead: () => ReadByKey;
775
+ }
776
+ /**
777
+ * A ward's wired keys, each as it's fixed over the ward's config: a function the ward calls for the
778
+ * key's value (how it's read through its wiring, or across its runes), or a rune's own value for it.
779
+ */
780
+ export type Wired = Readonly<Record<string, unknown>>;
781
+ /** What a `show` ward's `animate` and `style` are read through. */
782
+ export interface Shown {
783
+ /** `animate`, given what the runes say it is while shown. */
784
+ readonly animate: (shown: unknown) => unknown;
785
+ /** `style`, given the runes': how the page hides it. None where there's no style to hide by, on a Stage. */
786
+ readonly style?: ((style: unknown) => unknown) | undefined;
787
+ /**
788
+ * Whether an element it's given now enters from its `initial`, whatever `enter: false` said of its
789
+ * first: a presence's ward, once its value came after the page opened or after another. Read where
790
+ * the ward reads its `initial`, as it's made and as an element enters afresh (#414).
791
+ */
792
+ readonly reenters?: (() => boolean) | undefined;
793
+ /**
794
+ * `exit` as the ward's own config gives it, given the runes': none, for a ward that comes and goes
795
+ * by a hook. Its exit is that hook's to run; left in its config, a component presence above it ran
796
+ * it too as what's around it left, as a nested presence's child doesn't unless it's told to.
797
+ */
798
+ readonly exit?: ((exit: unknown) => unknown) | undefined;
799
+ /**
800
+ * `custom` as the ward reads it, given the runes' own, read when it's called: the one it started to
801
+ * leave with, while it leaves. A presence reads its `custom` as each child leaves (Motion's); a ward
802
+ * that's still there as it leaves would go on reading it, and turn round when the page's changed.
803
+ */
804
+ readonly custom?: ((own: () => unknown) => unknown) | undefined;
805
+ }
806
+ /** Runes that need no joining: `source`, the first that gives the ward a key, and all of them, which the rest of what they give is read across. */
807
+ export interface ReadThrough {
808
+ readonly source: RuneConfig;
809
+ readonly configs: ReadonlyArray<RuneConfig>;
810
+ /**
811
+ * What the runes beside the source give the ward, to fix over the source's own ({@link besideOf}):
812
+ * a key's value, an accessor of it, or a function that reads it across the runes. None where they
813
+ * give it nothing: a list's row, a ward with a `show` and one rune more.
814
+ */
815
+ readonly beside: Record<string, unknown> | undefined;
816
+ /** Which of {@link SEEN}'s keys any of the runes gives, a bit for each. */
817
+ readonly seen: number;
818
+ }
819
+ /**
820
+ * Keys only some wards' runes give, each with work of the hooks' own behind it: a rune's `props`
821
+ * and `ref`, a ward's `subject`, a twin's `layoutId`, the `animate` a presence takes a ward by, a
822
+ * ward's `show` and `enter`, and its Subject's `tag`. The pass that reads a ward's runes notes which it saw ({@link ReadThrough.seen}), so each needn't
823
+ * be looked for across the runes again: a pass apiece, for every ward, most with none of them.
824
+ */
825
+ export declare const SEEN: {
826
+ readonly props: 1;
827
+ readonly ref: 2;
828
+ readonly subject: 4;
829
+ readonly layoutId: 8;
830
+ readonly animate: 16;
831
+ readonly show: 32;
832
+ readonly enter: 64;
833
+ readonly exit: 128;
834
+ readonly tag: 256;
835
+ };
836
+ /**
837
+ * `configs` as runes read through as they're written ({@link joinedOver}), when they can be: one
838
+ * gives the ward a key, and none has to be joined key by key ({@link joined}). A list's row
839
+ * (`{ show }`, the row's own runes, and where it popped), a ward of one rune, a ward of several.
840
+ *
841
+ * A rune has to be joined that follows, or times its followers, whose names and timing are
842
+ * resolved as each key is read; whose `variants` carry timing, or are an accessor's or a getter's
843
+ * ({@link variantsNeedJoining}); or that gives a
844
+ * callback beside the source. What's fixed over a config is a function the ward calls for a key's
845
+ * value, and a callback's value is the function itself, which the ward calls with what it tells:
846
+ * fixed that way, `onUpdate` was asked for and never told (HY5). A callback of the source's own is
847
+ * the ward's as it's written.
848
+ *
849
+ * In one pass over the runes, each one's facts read once ({@link readRune}): kept with a rune
850
+ * `createRune` made, and worked out for any other. Where every rune is one `createRune` made, the
851
+ * answer is the same each time they're given together in that order, and kept too ({@link COMBINED}):
852
+ * a component that makes its ward of runes kept in constants works none of it out again.
853
+ */
854
+ export declare const readThroughOf: (configs: ReadonlyArray<RuneConfig>) => ReadThrough | undefined;
855
+ /**
856
+ * One plain rune's keys as its ward reads them, an accessor's as its result: what {@link Joined.asRead}
857
+ * is for runes that are joined, for a rune that's its ward's config as it is.
858
+ */
859
+ export declare const asReadOf: (config: RuneConfig) => ReadByKey;
860
+ /**
861
+ * The keys a ward's wiring reads, each as how it's read through that wiring: `initial` where the
862
+ * ward has no entrance, `animate`, and `exit`, `custom` and `style` where the wiring has one for it
863
+ * and, for the first two, a rune gives the key (`has`). The one set, for a joined config's getters
864
+ * and for a rune read through.
865
+ */
866
+ export declare const wiredOf: (wiring: Shown | undefined, unentered: boolean, value: (key: string) => unknown, has: (key: string) => boolean) => Wired;
867
+ /**
868
+ * Runes as a ward's config with no key joined: what {@link joined} gives for them, where none of
869
+ * them needs it ({@link readThroughOf}). The config is one of the runes itself, the first that
870
+ * gives the ward a key, read as a ward reads any config. Whatever else is to be read from somewhere
871
+ * other than that rune is handed back (`wired`) for the ward to fix over it, its own way to read a
872
+ * key from elsewhere: a key another rune gives, read across them all as joined; a key the ward's
873
+ * wiring reads. So nothing is copied, no getter is made, and no rune is an object's prototype: one
874
+ * over each rune was tried first, and a ward's reads of its config cost more through it than the
875
+ * join had (`docs/research/hooks-first-probe.md`, *The trims*).
876
+ */
877
+ export declare const joinedOver: ({ source, configs, beside, seen }: ReadThrough, shown: (runes: Joined) => Shown | undefined) => Joined;
878
+ /**
879
+ * `configs` as one ward's config. Each key is a getter that reads the runes' as the ward reads it, so
880
+ * a rune's accessor or getter is tracked there, and nothing is read before the ward asks. `omitted`
881
+ * are keys its ward doesn't take, though the hooks still read them: a Stage ward's `exit`.
882
+ */
883
+ export declare const joined: (configs: ReadonlyArray<RuneConfig>, shown: (runes: Joined) => Shown | undefined, omitted?: ReadonlySet<string>) => Joined;
884
+ export {};
885
+ //# sourceMappingURL=rune.d.ts.map