react-native-gtkx 0.2.0-alpha.1 → 0.3.0-alpha.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 (400) hide show
  1. package/README.md +14 -2
  2. package/dist/adw/widgets.generated.d.ts +4 -4
  3. package/dist/adw/widgets.generated.js +51 -51
  4. package/dist/adw/widgets.generated.js.map +1 -1
  5. package/dist/aliases/index.d.ts +84 -0
  6. package/dist/aliases/index.js +208 -0
  7. package/dist/aliases/index.js.map +1 -0
  8. package/dist/animated/create-animated.d.ts +2 -0
  9. package/dist/animated/create-animated.js +2 -0
  10. package/dist/animated/create-animated.js.map +1 -1
  11. package/dist/animated/index.d.ts +4 -0
  12. package/dist/animated/index.js +6 -0
  13. package/dist/animated/index.js.map +1 -1
  14. package/dist/animated/types.d.ts +1 -0
  15. package/dist/animated/types.js.map +1 -1
  16. package/dist/animated/value-animation.js +17 -4
  17. package/dist/animated/value-animation.js.map +1 -1
  18. package/dist/animated/value-xy.d.ts +41 -0
  19. package/dist/animated/value-xy.js +90 -0
  20. package/dist/animated/value-xy.js.map +1 -0
  21. package/dist/animated/value.d.ts +9 -0
  22. package/dist/animated/value.js +30 -2
  23. package/dist/animated/value.js.map +1 -1
  24. package/dist/apis/host.gtkx.js +9 -12
  25. package/dist/apis/host.gtkx.js.map +1 -1
  26. package/dist/apis/index.d.ts +4 -2
  27. package/dist/apis/index.js +2 -0
  28. package/dist/apis/index.js.map +1 -1
  29. package/dist/apis/keyboard.d.ts +60 -0
  30. package/dist/apis/keyboard.js +63 -0
  31. package/dist/apis/keyboard.js.map +1 -0
  32. package/dist/apis/log-box.d.ts +15 -0
  33. package/dist/apis/log-box.js +46 -0
  34. package/dist/apis/log-box.js.map +1 -0
  35. package/dist/apis/platform.d.ts +18 -1
  36. package/dist/apis/platform.js.map +1 -1
  37. package/dist/common/icon.d.ts +23 -0
  38. package/dist/common/icon.js +14 -0
  39. package/dist/common/icon.js.map +1 -0
  40. package/dist/common/index.d.ts +1 -0
  41. package/dist/common/index.js +25 -0
  42. package/dist/common/index.js.map +1 -1
  43. package/dist/common/widget.d.ts +1 -22
  44. package/dist/common/widget.js +75 -8
  45. package/dist/common/widget.js.map +1 -1
  46. package/dist/components/animated.d.ts +73 -7
  47. package/dist/components/animated.js +560 -45
  48. package/dist/components/animated.js.map +1 -1
  49. package/dist/components/app-registry.d.ts +26 -0
  50. package/dist/components/app-registry.js.map +1 -1
  51. package/dist/components/driven-size.d.ts +27 -0
  52. package/dist/components/driven-size.js +85 -0
  53. package/dist/components/driven-size.js.map +1 -0
  54. package/dist/components/find-node-handle.d.ts +11 -0
  55. package/dist/components/find-node-handle.js +53 -0
  56. package/dist/components/find-node-handle.js.map +1 -0
  57. package/dist/components/flat-list.d.ts +3 -2
  58. package/dist/components/flat-list.js.map +1 -1
  59. package/dist/components/frame-scheduler.d.ts +16 -0
  60. package/dist/components/frame-scheduler.js +37 -0
  61. package/dist/components/frame-scheduler.js.map +1 -0
  62. package/dist/components/host-node.d.ts +7 -0
  63. package/dist/components/host-node.js +26 -1
  64. package/dist/components/host-node.js.map +1 -1
  65. package/dist/components/image.d.ts +6 -1
  66. package/dist/components/image.js +15 -4
  67. package/dist/components/image.js.map +1 -1
  68. package/dist/components/index.d.ts +11 -5
  69. package/dist/components/index.js +7 -4
  70. package/dist/components/index.js.map +1 -1
  71. package/dist/components/measure.d.ts +63 -0
  72. package/dist/components/measure.js +150 -0
  73. package/dist/components/measure.js.map +1 -0
  74. package/dist/components/modal.d.ts +1 -1
  75. package/dist/components/press-event.d.ts +28 -0
  76. package/dist/components/press-event.js +46 -0
  77. package/dist/components/press-event.js.map +1 -0
  78. package/dist/components/pressable.d.ts +63 -7
  79. package/dist/components/pressable.js +165 -12
  80. package/dist/components/pressable.js.map +1 -1
  81. package/dist/components/rect-store.d.ts +58 -0
  82. package/dist/components/rect-store.js +124 -3
  83. package/dist/components/rect-store.js.map +1 -1
  84. package/dist/components/root.js +6 -1
  85. package/dist/components/root.js.map +1 -1
  86. package/dist/components/scroll-phase.d.ts +35 -0
  87. package/dist/components/scroll-phase.js +26 -0
  88. package/dist/components/scroll-phase.js.map +1 -0
  89. package/dist/components/scroll-view.d.ts +43 -3
  90. package/dist/components/scroll-view.js +386 -45
  91. package/dist/components/scroll-view.js.map +1 -1
  92. package/dist/components/text-input.js +9 -25
  93. package/dist/components/text-input.js.map +1 -1
  94. package/dist/components/text.d.ts +6 -2
  95. package/dist/components/text.js +68 -9
  96. package/dist/components/text.js.map +1 -1
  97. package/dist/components/use-focus.d.ts +27 -0
  98. package/dist/components/use-focus.js +116 -0
  99. package/dist/components/use-focus.js.map +1 -0
  100. package/dist/components/use-layout-child.d.ts +13 -1
  101. package/dist/components/use-layout-child.js +205 -19
  102. package/dist/components/use-layout-child.js.map +1 -1
  103. package/dist/components/view.d.ts +12 -4
  104. package/dist/components/view.js +25 -14
  105. package/dist/components/view.js.map +1 -1
  106. package/dist/components/virtualized-list.d.ts +45 -5
  107. package/dist/components/virtualized-list.js +90 -24
  108. package/dist/components/virtualized-list.js.map +1 -1
  109. package/dist/components/wheel-scroll-session.d.ts +7 -0
  110. package/dist/components/wheel-scroll-session.js +53 -0
  111. package/dist/components/wheel-scroll-session.js.map +1 -0
  112. package/dist/components/widget-retention.d.ts +35 -0
  113. package/dist/components/widget-retention.js +169 -0
  114. package/dist/components/widget-retention.js.map +1 -0
  115. package/dist/contracts.d.ts +23 -3
  116. package/dist/contracts.js.map +1 -1
  117. package/dist/dnd/context.d.ts +69 -0
  118. package/dist/dnd/context.js +149 -0
  119. package/dist/dnd/context.js.map +1 -0
  120. package/dist/dnd/draggable.d.ts +59 -0
  121. package/dist/dnd/draggable.js +149 -0
  122. package/dist/dnd/draggable.js.map +1 -0
  123. package/dist/dnd/droppable.d.ts +24 -0
  124. package/dist/dnd/droppable.js +74 -0
  125. package/dist/dnd/droppable.js.map +1 -0
  126. package/dist/dnd/gtk-controllers.d.ts +39 -0
  127. package/dist/dnd/gtk-controllers.js +110 -0
  128. package/dist/dnd/gtk-controllers.js.map +1 -0
  129. package/dist/dnd/index.d.ts +6 -0
  130. package/dist/dnd/index.js +31 -0
  131. package/dist/dnd/index.js.map +1 -0
  132. package/dist/dnd/order.d.ts +7 -0
  133. package/dist/dnd/order.js +20 -0
  134. package/dist/dnd/order.js.map +1 -0
  135. package/dist/dnd/payload.d.ts +14 -0
  136. package/dist/dnd/payload.js +41 -0
  137. package/dist/dnd/payload.js.map +1 -0
  138. package/dist/dnd/sortable.d.ts +49 -0
  139. package/dist/dnd/sortable.js +307 -0
  140. package/dist/dnd/sortable.js.map +1 -0
  141. package/dist/dnd/types.d.ts +290 -0
  142. package/dist/dnd/types.js +25 -0
  143. package/dist/dnd/types.js.map +1 -0
  144. package/dist/gesture-handler-compat/builder.d.ts +251 -0
  145. package/dist/gesture-handler-compat/builder.js +513 -0
  146. package/dist/gesture-handler-compat/builder.js.map +1 -0
  147. package/dist/gesture-handler-compat/composition.d.ts +23 -0
  148. package/dist/gesture-handler-compat/composition.js +111 -0
  149. package/dist/gesture-handler-compat/composition.js.map +1 -0
  150. package/dist/gesture-handler-compat/deciders.d.ts +3 -0
  151. package/dist/gesture-handler-compat/deciders.js +47 -0
  152. package/dist/gesture-handler-compat/deciders.js.map +1 -0
  153. package/dist/gesture-handler-compat/detector-runtime.d.ts +44 -0
  154. package/dist/gesture-handler-compat/detector-runtime.js +374 -0
  155. package/dist/gesture-handler-compat/detector-runtime.js.map +1 -0
  156. package/dist/gesture-handler-compat/detector.d.ts +22 -0
  157. package/dist/gesture-handler-compat/detector.js +104 -0
  158. package/dist/gesture-handler-compat/detector.js.map +1 -0
  159. package/dist/gesture-handler-compat/fling.d.ts +24 -0
  160. package/dist/gesture-handler-compat/fling.js +123 -0
  161. package/dist/gesture-handler-compat/fling.js.map +1 -0
  162. package/dist/gesture-handler-compat/force-touch.d.ts +13 -0
  163. package/dist/gesture-handler-compat/force-touch.js +40 -0
  164. package/dist/gesture-handler-compat/force-touch.js.map +1 -0
  165. package/dist/gesture-handler-compat/hooks.d.ts +157 -0
  166. package/dist/gesture-handler-compat/hooks.js +268 -0
  167. package/dist/gesture-handler-compat/hooks.js.map +1 -0
  168. package/dist/gesture-handler-compat/hover.d.ts +2 -0
  169. package/dist/gesture-handler-compat/hover.js +22 -0
  170. package/dist/gesture-handler-compat/hover.js.map +1 -0
  171. package/dist/gesture-handler-compat/index.d.ts +98 -0
  172. package/dist/gesture-handler-compat/index.js +255 -0
  173. package/dist/gesture-handler-compat/index.js.map +1 -0
  174. package/dist/gesture-handler-compat/long-press.d.ts +6 -0
  175. package/dist/gesture-handler-compat/long-press.js +21 -0
  176. package/dist/gesture-handler-compat/long-press.js.map +1 -0
  177. package/dist/gesture-handler-compat/manual.d.ts +2 -0
  178. package/dist/gesture-handler-compat/manual.js +18 -0
  179. package/dist/gesture-handler-compat/manual.js.map +1 -0
  180. package/dist/gesture-handler-compat/native.d.ts +7 -0
  181. package/dist/gesture-handler-compat/native.js +34 -0
  182. package/dist/gesture-handler-compat/native.js.map +1 -0
  183. package/dist/gesture-handler-compat/orchestrator.d.ts +77 -0
  184. package/dist/gesture-handler-compat/orchestrator.js +284 -0
  185. package/dist/gesture-handler-compat/orchestrator.js.map +1 -0
  186. package/dist/gesture-handler-compat/pan.d.ts +23 -0
  187. package/dist/gesture-handler-compat/pan.js +116 -0
  188. package/dist/gesture-handler-compat/pan.js.map +1 -0
  189. package/dist/gesture-handler-compat/recognizer.d.ts +268 -0
  190. package/dist/gesture-handler-compat/recognizer.js +1056 -0
  191. package/dist/gesture-handler-compat/recognizer.js.map +1 -0
  192. package/dist/gesture-handler-compat/relations.d.ts +43 -0
  193. package/dist/gesture-handler-compat/relations.js +128 -0
  194. package/dist/gesture-handler-compat/relations.js.map +1 -0
  195. package/dist/gesture-handler-compat/tap.d.ts +6 -0
  196. package/dist/gesture-handler-compat/tap.js +29 -0
  197. package/dist/gesture-handler-compat/tap.js.map +1 -0
  198. package/dist/gesture-handler-compat/touchpad.d.ts +41 -0
  199. package/dist/gesture-handler-compat/touchpad.js +64 -0
  200. package/dist/gesture-handler-compat/touchpad.js.map +1 -0
  201. package/dist/gesture-handler-compat/types.d.ts +441 -0
  202. package/dist/gesture-handler-compat/types.js +167 -0
  203. package/dist/gesture-handler-compat/types.js.map +1 -0
  204. package/dist/gtk/controllers.d.ts +39 -0
  205. package/dist/gtk/controllers.js +92 -0
  206. package/dist/gtk/controllers.js.map +1 -0
  207. package/dist/gtk/index.d.ts +3 -1
  208. package/dist/gtk/index.js +14 -1
  209. package/dist/gtk/index.js.map +1 -1
  210. package/dist/gtk/widgets.generated.d.ts +14 -14
  211. package/dist/gtk/widgets.generated.js +101 -102
  212. package/dist/gtk/widgets.generated.js.map +1 -1
  213. package/dist/gtk/window-actions.d.ts +77 -0
  214. package/dist/gtk/window-actions.js +193 -0
  215. package/dist/gtk/window-actions.js.map +1 -0
  216. package/dist/gtkx/bridge/geometry.d.ts +15 -0
  217. package/dist/gtkx/bridge/geometry.js +40 -0
  218. package/dist/gtkx/bridge/geometry.js.map +1 -0
  219. package/dist/gtkx/bridge/index.d.ts +7 -3
  220. package/dist/gtkx/bridge/index.js +12 -4
  221. package/dist/gtkx/bridge/index.js.map +1 -1
  222. package/dist/gtkx/bridge/slot-portal.d.ts +12 -0
  223. package/dist/gtkx/bridge/slot-portal.js +17 -0
  224. package/dist/gtkx/bridge/slot-portal.js.map +1 -0
  225. package/dist/gtkx/bridge/svg-node.js +10 -54
  226. package/dist/gtkx/bridge/svg-node.js.map +1 -1
  227. package/dist/gtkx/bridge/use-signal.js +2 -2
  228. package/dist/gtkx/bridge/use-signal.js.map +1 -1
  229. package/dist/gtkx/bridge/view-box.d.ts +56 -0
  230. package/dist/gtkx/bridge/view-box.js +394 -9
  231. package/dist/gtkx/bridge/view-box.js.map +1 -1
  232. package/dist/gtkx/bridge/widget-css.d.ts +17 -0
  233. package/dist/gtkx/bridge/widget-css.js +72 -0
  234. package/dist/gtkx/bridge/widget-css.js.map +1 -0
  235. package/dist/index.d.ts +3 -3
  236. package/dist/index.js +2 -2
  237. package/dist/index.js.map +1 -1
  238. package/dist/layout/driven-size.d.ts +12 -0
  239. package/dist/layout/driven-size.js +70 -0
  240. package/dist/layout/driven-size.js.map +1 -0
  241. package/dist/layout/engine.d.ts +17 -1
  242. package/dist/layout/engine.js +3 -20
  243. package/dist/layout/engine.js.map +1 -1
  244. package/dist/layout/node.d.ts +13 -0
  245. package/dist/layout/node.js +14 -0
  246. package/dist/layout/node.js.map +1 -1
  247. package/dist/layout/yoga.d.ts +3 -2
  248. package/dist/layout/yoga.js +5 -2
  249. package/dist/layout/yoga.js.map +1 -1
  250. package/dist/mcp/data/generated.d.ts +310 -91
  251. package/dist/mcp/data/generated.js +365 -90
  252. package/dist/mcp/data/generated.js.map +1 -1
  253. package/dist/mcp/server.js +1 -1
  254. package/dist/mcp/server.js.map +1 -1
  255. package/dist/metro/index.d.ts +10 -0
  256. package/dist/metro/index.js +21 -12
  257. package/dist/metro/index.js.map +1 -1
  258. package/dist/navigation/sidebar.d.ts +47 -1
  259. package/dist/navigation/sidebar.js +77 -3
  260. package/dist/navigation/sidebar.js.map +1 -1
  261. package/dist/reanimated-compat/animated-ref.d.ts +32 -0
  262. package/dist/reanimated-compat/animated-ref.js +57 -0
  263. package/dist/reanimated-compat/animated-ref.js.map +1 -0
  264. package/dist/reanimated-compat/animation.d.ts +177 -0
  265. package/dist/reanimated-compat/animation.js +540 -0
  266. package/dist/reanimated-compat/animation.js.map +1 -0
  267. package/dist/reanimated-compat/color.d.ts +28 -0
  268. package/dist/reanimated-compat/color.js +249 -0
  269. package/dist/reanimated-compat/color.js.map +1 -0
  270. package/dist/reanimated-compat/decay.d.ts +39 -0
  271. package/dist/reanimated-compat/decay.js +96 -0
  272. package/dist/reanimated-compat/decay.js.map +1 -0
  273. package/dist/reanimated-compat/easing.d.ts +30 -0
  274. package/dist/reanimated-compat/easing.js +76 -0
  275. package/dist/reanimated-compat/easing.js.map +1 -0
  276. package/dist/reanimated-compat/hooks.d.ts +14 -0
  277. package/dist/reanimated-compat/hooks.js +217 -0
  278. package/dist/reanimated-compat/hooks.js.map +1 -0
  279. package/dist/reanimated-compat/index.d.ts +258 -0
  280. package/dist/reanimated-compat/index.js +464 -0
  281. package/dist/reanimated-compat/index.js.map +1 -0
  282. package/dist/reanimated-compat/interpolation.d.ts +18 -0
  283. package/dist/reanimated-compat/interpolation.js +122 -0
  284. package/dist/reanimated-compat/interpolation.js.map +1 -0
  285. package/dist/reanimated-compat/layout-animation-config.d.ts +43 -0
  286. package/dist/reanimated-compat/layout-animation-config.js +78 -0
  287. package/dist/reanimated-compat/layout-animation-config.js.map +1 -0
  288. package/dist/reanimated-compat/layout-animation-presets.d.ts +117 -0
  289. package/dist/reanimated-compat/layout-animation-presets.js +498 -0
  290. package/dist/reanimated-compat/layout-animation-presets.js.map +1 -0
  291. package/dist/reanimated-compat/layout-animation-runtime.d.ts +21 -0
  292. package/dist/reanimated-compat/layout-animation-runtime.js +311 -0
  293. package/dist/reanimated-compat/layout-animation-runtime.js.map +1 -0
  294. package/dist/reanimated-compat/layout-animation-view.d.ts +27 -0
  295. package/dist/reanimated-compat/layout-animation-view.js +266 -0
  296. package/dist/reanimated-compat/layout-animation-view.js.map +1 -0
  297. package/dist/reanimated-compat/layout-animation.d.ts +171 -0
  298. package/dist/reanimated-compat/layout-animation.js +469 -0
  299. package/dist/reanimated-compat/layout-animation.js.map +1 -0
  300. package/dist/reanimated-compat/layout-transitions.d.ts +83 -0
  301. package/dist/reanimated-compat/layout-transitions.js +350 -0
  302. package/dist/reanimated-compat/layout-transitions.js.map +1 -0
  303. package/dist/reanimated-compat/mutable.d.ts +29 -0
  304. package/dist/reanimated-compat/mutable.js +139 -0
  305. package/dist/reanimated-compat/mutable.js.map +1 -0
  306. package/dist/reanimated-compat/props.d.ts +18 -0
  307. package/dist/reanimated-compat/props.js +111 -0
  308. package/dist/reanimated-compat/props.js.map +1 -0
  309. package/dist/reanimated-compat/scroll-handler.d.ts +119 -0
  310. package/dist/reanimated-compat/scroll-handler.js +274 -0
  311. package/dist/reanimated-compat/scroll-handler.js.map +1 -0
  312. package/dist/reanimated-compat/scroll-offset.d.ts +12 -0
  313. package/dist/reanimated-compat/scroll-offset.js +104 -0
  314. package/dist/reanimated-compat/scroll-offset.js.map +1 -0
  315. package/dist/reanimated-compat/style.d.ts +90 -0
  316. package/dist/reanimated-compat/style.js +452 -0
  317. package/dist/reanimated-compat/style.js.map +1 -0
  318. package/dist/reanimated-compat/test-timers.d.ts +28 -0
  319. package/dist/reanimated-compat/test-timers.js +136 -0
  320. package/dist/reanimated-compat/test-timers.js.map +1 -0
  321. package/dist/reanimated-compat/threads.d.ts +13 -0
  322. package/dist/reanimated-compat/threads.js +41 -0
  323. package/dist/reanimated-compat/threads.js.map +1 -0
  324. package/dist/reanimated-compat/tracking.d.ts +41 -0
  325. package/dist/reanimated-compat/tracking.js +106 -0
  326. package/dist/reanimated-compat/tracking.js.map +1 -0
  327. package/dist/reanimated-compat/updater-animations.d.ts +36 -0
  328. package/dist/reanimated-compat/updater-animations.js +273 -0
  329. package/dist/reanimated-compat/updater-animations.js.map +1 -0
  330. package/dist/responder/system.d.ts +100 -0
  331. package/dist/responder/system.js +304 -0
  332. package/dist/responder/system.js.map +1 -0
  333. package/dist/responder/touch-history.d.ts +10 -0
  334. package/dist/responder/touch-history.js +78 -0
  335. package/dist/responder/touch-history.js.map +1 -0
  336. package/dist/responder/types.d.ts +63 -0
  337. package/dist/responder/types.js +29 -0
  338. package/dist/responder/types.js.map +1 -0
  339. package/dist/responder/use-responder.d.ts +23 -0
  340. package/dist/responder/use-responder.js +317 -0
  341. package/dist/responder/use-responder.js.map +1 -0
  342. package/dist/runner/host-dev.js +4 -2
  343. package/dist/runner/host-dev.js.map +1 -1
  344. package/dist/runner/host.js +6 -2
  345. package/dist/runner/host.js.map +1 -1
  346. package/dist/runner/index.js +3 -3
  347. package/dist/runner/index.js.map +1 -1
  348. package/dist/sea/gtkx-config-module.js +2 -2
  349. package/dist/sea/gtkx-config-module.js.map +1 -1
  350. package/dist/style/absolute-insets.d.ts +26 -0
  351. package/dist/style/absolute-insets.js +113 -0
  352. package/dist/style/absolute-insets.js.map +1 -0
  353. package/dist/style/animated-size.d.ts +25 -0
  354. package/dist/style/animated-size.js +225 -0
  355. package/dist/style/animated-size.js.map +1 -0
  356. package/dist/style/box-shadow.d.ts +7 -0
  357. package/dist/style/box-shadow.js +197 -0
  358. package/dist/style/box-shadow.js.map +1 -0
  359. package/dist/style/colors.d.ts +17 -0
  360. package/dist/style/colors.js +25 -6
  361. package/dist/style/colors.js.map +1 -1
  362. package/dist/style/imperative-css.d.ts +21 -0
  363. package/dist/style/imperative-css.js +63 -0
  364. package/dist/style/imperative-css.js.map +1 -0
  365. package/dist/style/index.d.ts +4 -1
  366. package/dist/style/index.js +4 -1
  367. package/dist/style/index.js.map +1 -1
  368. package/dist/style/split-style.d.ts +5 -2
  369. package/dist/style/split-style.js +36 -3
  370. package/dist/style/split-style.js.map +1 -1
  371. package/dist/style/text-decoration.d.ts +15 -0
  372. package/dist/style/text-decoration.js +26 -0
  373. package/dist/style/text-decoration.js.map +1 -0
  374. package/dist/style/visual-css.js +37 -1
  375. package/dist/style/visual-css.js.map +1 -1
  376. package/dist/svg/gradient-geometry.js +2 -5
  377. package/dist/svg/gradient-geometry.js.map +1 -1
  378. package/dist/testing/index.js.map +1 -1
  379. package/dist/unsupported-export.d.ts +8 -0
  380. package/dist/unsupported-export.js +66 -0
  381. package/dist/unsupported-export.js.map +1 -0
  382. package/dist/vendor/react-native/pan-responder.d.ts +102 -0
  383. package/dist/vendor/react-native/pan-responder.js +196 -0
  384. package/dist/vendor/react-native/pan-responder.js.map +1 -0
  385. package/dist/vendor/react-native/touch-history-math.d.ts +18 -0
  386. package/dist/vendor/react-native/touch-history-math.js +102 -0
  387. package/dist/vendor/react-native/touch-history-math.js.map +1 -0
  388. package/dist/vite/index.d.ts +21 -8
  389. package/dist/vite/index.js +127 -82
  390. package/dist/vite/index.js.map +1 -1
  391. package/dist/vitest/index.d.ts +2 -2
  392. package/dist/vitest/index.js.map +1 -1
  393. package/dist/worklets-compat/index.d.ts +4 -0
  394. package/dist/worklets-compat/index.js +28 -0
  395. package/dist/worklets-compat/index.js.map +1 -0
  396. package/dist/worklets-compat/surface.d.ts +110 -0
  397. package/dist/worklets-compat/surface.js +153 -0
  398. package/dist/worklets-compat/surface.js.map +1 -0
  399. package/package.json +25 -9
  400. package/types.d.ts +9 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runner/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,2EAA2E;AAC3E,yEAAyE;AACzE,uEAAuE;AACvE,oEAAoE;AACpE,uEAAuE;AACvE,4CAA4C;AAC5C,EAAE;AACF,kEAAkE;AAClE,qCAAqC;AACrC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAqB,MAAM,oBAAoB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAkBxC,kEAAkE;AAClE,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAEjC,MAAM,GAAG,GAAG,CAAC,OAAe,EAAE,IAAc,EAAE,GAAW,EAAU,EAAE;IACnE,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;IAClE,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAA;AAC3B,CAAC,CAAA;AAED,wEAAwE;AACxE,MAAM,KAAK,GAAG,CACZ,WAA2B,EAC3B,WAAmB,EACnB,OAA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,sDAAsD,SAAS,GAAG;YAChE,IAAI,SAAS,kCAAkC;QACnD,CAAC,CAAC,sDAAsD,SAAS,GAAG;YAChE,IAAI,SAAS,4BAA4B,SAAS,KAAK,CAC9D,CAAA;AACH,CAAC,CAAA;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EACT,kFAAkF;QACpF,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,4BAA4B;gBACzC,OAAO,EAAE,UAAU;aACpB;YACD;gBACE,IAAI,EAAE,wBAAwB;gBAC9B,WAAW,EACT,sFAAsF;aACzF;YACD;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE,8CAA8C;aAC5D;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,oFAAoF;aACvF;YACD;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE,iDAAiD;aAC/D;SACF;QACD,IAAI,EAAE,QAAQ;KACf;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,uFAAuF;QACzF,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,4BAA4B;gBACzC,OAAO,EAAE,UAAU;aACpB;YACD;gBACE,IAAI,EAAE,wBAAwB;gBAC9B,WAAW,EACT,mEAAmE;aACtE;YACD;gBACE,IAAI,EAAE,cAAc;gBACpB,WAAW,EACT,iEAAiE;oBACjE,8CAA8C;aACjD;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,kEAAkE;oBAClE,2DAA2D;oBAC3D,wCAAwC;aAC3C;YACD;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EACT,mDAAmD;oBACnD,sCAAsC;aACzC;SACF;QACD,IAAI,EAAE,UAAU;KACjB;CACF,CAAA","sourcesContent":["// The `run-linux` CLI command (registered through the package's\n// react-native.config.js, the react-native-windows model): ensure the gtkx\n// codegen store, then either build a release jsbundle with Metro and run\n// it in the Node+GTK host (./host.ts), or — with --dev — start/reuse a\n// Metro dev server and supervise the DEV host (./host-dev.ts): Fast\n// Refresh applies edits to the live window, and a full-refresh request\n// (exit code 65) restarts the host process.\n//\n// Like the hosts, this module must stay runnable under bare Node:\n// builtins and bare specifiers only.\nimport { spawn, spawnSync, type ChildProcess } from \"node:child_process\"\nimport { mkdirSync } from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport { basename, dirname, extname, join } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\n\ntype CliConfig = { root: string }\ntype RunLinuxArgs = {\n entryFile: string\n bundleOutput?: string\n skipBundling?: boolean\n dev?: boolean\n port?: string\n}\ntype BuildLinuxArgs = {\n entryFile: string\n bundleOutput?: string\n standalone?: boolean\n sea?: boolean\n seaOutput?: string\n}\n\n/** Exit code host-dev.ts uses to request a supervisor restart. */\nconst FULL_REFRESH_EXIT_CODE = 65\n\nconst run = (command: string, args: string[], cwd: string): number => {\n const result = spawnSync(command, args, { cwd, stdio: \"inherit\" })\n return result.status ?? 1\n}\n\n/** Resolve an executable script shipped by a dependency's bin field. */\nconst binOf = (\n requireFrom: NodeJS.Require,\n packageName: string,\n binName: string,\n): string => {\n const packageJsonPath = requireFrom.resolve(`${packageName}/package.json`)\n const manifest = requireFrom(`${packageName}/package.json`) as {\n bin?: string | Record<string, string>\n }\n const bin =\n typeof manifest.bin === \"string\" ? manifest.bin : manifest.bin?.[binName]\n if (!bin) {\n throw new Error(`${packageName} does not expose a \"${binName}\" binary`)\n }\n return join(dirname(packageJsonPath), bin)\n}\n\ntype PackageManifest = { version: string; exports?: Record<string, unknown> }\n\n/** The `@gtkx/react` subpath exports (its own `exports` map, minus `.` and `./package.json`). */\nconst reactSubexportsOf = (manifest: PackageManifest): string[] =>\n Object.keys(manifest.exports ?? {})\n .filter((key) => key.startsWith(\"./\") && key !== \"./package.json\")\n .map((key) => key.slice(2))\n\n// @gtkx/cli is meant for apps: its `codegen` command resolves gtkx.config.ts\n// from a cwd and trusts a freshness stamp, which is what the RC2-WORKAROUND\n// this replaced was dodging (running from a reconstructed \"project that owns\n// the hosting node_modules\" purely to keep that cwd resolution honest — see\n// gtkx-org/gtkx#468, #470). A library generating bindings on a consumer's\n// behalf should use the programmatic @gtkx/codegen API instead: it takes the\n// GIR libraries and store paths directly, so there is no cwd to get wrong and\n// no stamp to misread — and it runs its own fingerprint-based freshness\n// check in-process, so a missing/pruned store is regenerated rather than\n// misreported as \"up to date\".\n//\n// `root` (the app's real project root, resolved by the react-native CLI, not\n// us) is the right place to resolve gtkx.config.ts from, but NOT necessarily\n// where @gtkx/* actually lives on disk: in a workspace, npm hoists them to an\n// ancestor's node_modules, so `root/node_modules` can be a directory with no\n// @gtkx/* in it at all (confirmed against this repo's own examples/, which\n// are workspace members with nothing hoisted locally). The store — and the\n// @gtkx/gi and @gtkx/jsx links every other @gtkx/* package resolves through\n// its OWN up-the-tree lookup — must live in whichever node_modules actually\n// hosts @gtkx/runtime, so that's resolved rather than assumed.\nconst ensureCodegenStore = async (root: string): Promise<void> => {\n console.warn(\"[react-native-gtkx] ensuring gtkx codegen store…\")\n try {\n const [{ runCodegen, resolveGirPath, resolveLibraries }, { loadConfig }] =\n await Promise.all([import(\"@gtkx/codegen\"), import(\"@gtkx/config\")])\n const { config } = await loadConfig(root)\n if (config.codegen === false) {\n console.warn(\n \"[react-native-gtkx] codegen: disabled for this project (gtkx.config.ts)\",\n )\n return\n }\n const girPath = resolveGirPath(config.girPath)\n const libraries = resolveLibraries(config.libraries, girPath)\n const appRequire = createRequire(join(root, \"package.json\"))\n const runtimePackageJsonPath = appRequire.resolve(\n \"@gtkx/runtime/package.json\",\n )\n const nodeModules = dirname(dirname(dirname(runtimePackageJsonPath)))\n const runtime = appRequire(runtimePackageJsonPath) as PackageManifest\n const react = appRequire(\"@gtkx/react/package.json\") as PackageManifest\n const result = await runCodegen({\n libraries,\n girPath,\n gi: {\n storeDir: join(nodeModules, \".gtkx\", \"gi\"),\n linkDir: join(nodeModules, \"@gtkx\", \"gi\"),\n version: runtime.version,\n },\n jsx: {\n storeDir: join(nodeModules, \".gtkx\", \"jsx\"),\n linkDir: join(nodeModules, \"@gtkx\", \"jsx\"),\n version: react.version,\n },\n reactSubexports: reactSubexportsOf(react),\n })\n console.warn(\n result.regenerated\n ? \"[react-native-gtkx] codegen: regenerated stale bindings\"\n : \"[react-native-gtkx] codegen: bindings up to date\",\n )\n } catch (error) {\n console.error(\n \"[react-native-gtkx] gtkx codegen failed — are GTK4/libadwaita \" +\n \"development files installed?\",\n )\n console.error(error)\n process.exit(1)\n }\n}\n\nconst bundle = (root: string, entryFile: string, output: string): void => {\n const appRequire = createRequire(join(root, \"package.json\"))\n const status = run(\n process.execPath,\n [\n binOf(appRequire, \"react-native\", \"react-native\"),\n \"bundle\",\n \"--platform\",\n \"linux\",\n \"--dev\",\n \"false\",\n \"--entry-file\",\n entryFile,\n \"--bundle-output\",\n output,\n ],\n root,\n )\n if (status !== 0) {\n process.exit(status)\n }\n}\n\nconst isMetroRunning = async (server: string): Promise<boolean> => {\n try {\n const response = await fetch(`${server}/status`)\n return (await response.text()).includes(\"packager-status:running\")\n } catch {\n return false\n }\n}\n\nconst waitForMetro = async (server: string): Promise<void> => {\n for (let attempt = 0; attempt < 120; attempt += 1) {\n if (await isMetroRunning(server)) {\n return\n }\n await new Promise((resolve) => setTimeout(resolve, 500))\n }\n console.error(\n `[react-native-gtkx] Metro dev server never came up (${server}).`,\n )\n process.exit(1)\n}\n\nlet activeHost: ChildProcess | null = null\n\nconst spawnHost = (\n script: string,\n argument: string,\n cwd: string,\n): Promise<number> =>\n new Promise((resolve) => {\n // join over `new URL(script, import.meta.url)`: the global URL and the\n // node:url URL come from different type copies when the dependency tree\n // splits @types/node, and the two structurally diverge.\n const hostPath = join(dirname(fileURLToPath(import.meta.url)), script)\n const child = spawn(process.execPath, [hostPath, argument], {\n cwd,\n stdio: \"inherit\",\n })\n activeHost = child\n child.on(\"exit\", (code) => {\n activeHost = null\n resolve(code ?? 1)\n })\n })\n\nconst runLinuxDev = async (\n config: CliConfig,\n args: RunLinuxArgs,\n): Promise<never> => {\n const port = args.port ?? \"8081\"\n const server = `http://localhost:${port}`\n let metro: ChildProcess | null = null\n if (await isMetroRunning(server)) {\n console.warn(\n `[react-native-gtkx] reusing the Metro dev server at ${server}`,\n )\n } else {\n console.warn(\n `[react-native-gtkx] starting the Metro dev server at ${server}…`,\n )\n const appRequire = createRequire(join(config.root, \"package.json\"))\n metro = spawn(\n process.execPath,\n [\n binOf(appRequire, \"react-native\", \"react-native\"),\n \"start\",\n \"--port\",\n port,\n ],\n { cwd: config.root, stdio: \"inherit\" },\n )\n await waitForMetro(server)\n }\n const entry = basename(args.entryFile, extname(args.entryFile))\n const bundleUrl = `${server}/${entry}.bundle?platform=linux&dev=true&minify=false`\n const shutdown = (code: number): never => {\n activeHost?.kill()\n metro?.kill()\n process.exit(code)\n }\n process.on(\"SIGINT\", () => shutdown(0))\n process.on(\"SIGTERM\", () => shutdown(0))\n // Supervisor: a full-refresh request restarts the host with the window\n // reopening on the fresh bundle; any other exit ends the session.\n for (;;) {\n const code = await spawnHost(\"./host-dev.js\", bundleUrl, config.root)\n if (code !== FULL_REFRESH_EXIT_CODE) {\n shutdown(code)\n }\n console.warn(\"[react-native-gtkx] restarting the app after a full refresh…\")\n }\n}\n\nconst runLinux = async (\n _argv: string[],\n config: CliConfig,\n args: RunLinuxArgs,\n): Promise<void> => {\n await ensureCodegenStore(config.root)\n if (args.dev) {\n await runLinuxDev(config, args)\n return\n }\n const output =\n args.bundleOutput ??\n join(config.root, \"node_modules\", \".react-native-gtkx\", \"main.jsbundle\")\n if (!args.skipBundling) {\n mkdirSync(dirname(output), { recursive: true })\n bundle(config.root, args.entryFile, output)\n }\n const status = await spawnHost(\"./host.js\", output, config.root)\n process.exit(status)\n}\n\n/**\n * The executable name a `--sea` build defaults to: the app's package name\n * without its scope, so the artifact is `dist/hn-app`, not `dist/app`.\n */\nconst appBinaryName = (root: string): string => {\n try {\n const manifest = createRequire(join(root, \"package.json\"))(\n \"./package.json\",\n ) as { name?: string }\n const name = manifest.name?.split(\"/\").pop()\n return name && /^[\\w.-]+$/.test(name) ? name : \"app\"\n } catch {\n return \"app\"\n }\n}\n\n// The android/ios counterpart to run-linux's dev-only bundling: bundle for\n// distribution and stop, the way a release APK/IPA build does not launch\n// the app it produces. Deliberately skips ensureCodegenStore() — codegen\n// generates the @gtkx/gi bindings host.js imports to talk to GTK at RUN\n// time; bundling never touches them (Metro only reads/transforms JS, and\n// the GTK/react/yoga modules are proxied rather than imported — see\n// ../metro's HOST_MODULE_EXTERNALS). A machine that only builds never needs\n// GTK dev headers installed.\n//\n// --standalone and --sea are the exception: both inline\n// \"virtual:gtkx-config\", which re-exports @gtkx/jsx/metadata — a codegen\n// product — so they DO need the store, and therefore GTK dev headers.\n// Only those paths ensure it.\n//\n// The three artifacts, cheapest to heaviest, are deliberately one command\n// with flags rather than three commands: they share the Metro bundle step,\n// and the choice between them is a distribution question, not a different\n// build.\n// (default) main.jsbundle + a runtime node_modules + a system node\n// --standalone one .cjs file, no node_modules, + a system node\n// --sea one executable, nothing preinstalled at all\nconst buildLinux = async (\n _argv: string[],\n config: CliConfig,\n args: BuildLinuxArgs,\n): Promise<void> => {\n if (args.sea || args.standalone) {\n await ensureCodegenStore(config.root)\n }\n const output = args.bundleOutput ?? join(config.root, \"dist\", \"main.jsbundle\")\n mkdirSync(dirname(output), { recursive: true })\n bundle(config.root, args.entryFile, output)\n console.warn(`[react-native-gtkx] wrote the release bundle to ${output}`)\n if (!args.sea && !args.standalone) {\n return\n }\n const name = appBinaryName(config.root)\n const seaOutput =\n args.seaOutput ?? join(config.root, \"dist\", args.sea ? name : `${name}.cjs`)\n // Dynamically imported so the bundler is never loaded on the ordinary\n // jsbundle path.\n const { assembleSea, bundleStandalone } = await import(\"../sea/assemble.js\")\n const bytes = args.sea\n ? await assembleSea({\n appRoot: config.root,\n jsbundlePath: output,\n outFile: seaOutput,\n })\n : await bundleStandalone({\n appRoot: config.root,\n jsbundlePath: output,\n outFile: seaOutput,\n })\n const megabytes = (bytes / 1024 / 1024).toFixed(0)\n console.warn(\n args.sea\n ? `[react-native-gtkx] wrote the single executable to ${seaOutput} ` +\n `(${megabytes} MB — Node itself is most of it)`\n : `[react-native-gtkx] wrote the standalone script to ${seaOutput} ` +\n `(${megabytes} MB — run it with \\`node ${seaOutput}\\`)`,\n )\n}\n\n/** Commands contributed to the RN CLI by the package's react-native.config.js. */\nexport const commands = [\n {\n name: \"run-linux\",\n description:\n \"Bundle the app with Metro for the linux platform and run it in the Node+GTK host\",\n options: [\n {\n name: \"--entry-file <path>\",\n description: \"Path to the app entry file\",\n default: \"index.js\",\n },\n {\n name: \"--bundle-output <path>\",\n description:\n \"Where to write the jsbundle (default: node_modules/.react-native-gtkx/main.jsbundle)\",\n },\n {\n name: \"--skip-bundling\",\n description: \"Reuse the existing bundle at --bundle-output\",\n },\n {\n name: \"--dev\",\n description:\n \"Development mode: Metro dev server + Fast Refresh (edits apply to the live window)\",\n },\n {\n name: \"--port <number>\",\n description: \"Metro dev server port for --dev (default: 8081)\",\n },\n ],\n func: runLinux,\n },\n {\n name: \"build-linux\",\n description:\n \"Bundle the app with Metro for the linux platform for distribution, without running it\",\n options: [\n {\n name: \"--entry-file <path>\",\n description: \"Path to the app entry file\",\n default: \"index.js\",\n },\n {\n name: \"--bundle-output <path>\",\n description:\n \"Where to write the release jsbundle (default: dist/main.jsbundle)\",\n },\n {\n name: \"--standalone\",\n description:\n \"Also produce one self-contained .cjs — no node_modules, run it \" +\n \"with a system node (dist/<package name>.cjs)\",\n },\n {\n name: \"--sea\",\n description:\n \"Also produce a single executable (Node SEA): one file that runs \" +\n \"with no node_modules and no system Node — at the cost of \" +\n \"carrying a whole Node binary (~120 MB)\",\n },\n {\n name: \"--sea-output <path>\",\n description:\n \"Where to write the --sea / --standalone artifact \" +\n \"(default: d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AI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,4BAA4B;gBACzC,OAAO,EAAE,UAAU;aACpB;YACD;gBACE,IAAI,EAAE,wBAAwB;gBAC9B,WAAW,EACT,sFAAsF;aACzF;YACD;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE,8CAA8C;aAC5D;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,oFAAoF;aACvF;YACD;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE,iDAAiD;aAC/D;SACF;QACD,IAAI,EAAE,QAAQ;KACf;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,uFAAuF;QACzF,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,4BAA4B;gBACzC,OAAO,EAAE,UAAU;aACpB;YACD;gBACE,IAAI,EAAE,wBAAwB;gBAC9B,WAAW,EACT,mEAAmE;aACtE;YACD;gBACE,IAAI,EAAE,cAAc;gBACpB,WAAW,EACT,iEAAiE;oBACjE,8CAA8C;aACjD;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,kEAAkE;oBAClE,2DAA2D;oBAC3D,wCAAwC;aAC3C;YACD;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EACT,mDAAmD;oBACnD,sCAAsC;aACzC;SACF;QACD,IAAI,EAAE,UAAU;KACjB;CACF,CAAA","sourcesContent":["// The `run-linux` CLI command (registered through the package's\n// react-native.config.js, the react-native-windows model): ensure the gtkx\n// codegen store, then either build a release jsbundle with Metro and run\n// it in the Node+GTK host (./host.ts), or — with --dev — start/reuse a\n// Metro dev server and supervise the DEV host (./host-dev.ts): Fast\n// Refresh applies edits to the live window, and a full-refresh request\n// (exit code 65) restarts the host process.\n//\n// Like the hosts, this module must stay runnable under bare Node:\n// builtins and bare specifiers only.\nimport { spawn, spawnSync, type ChildProcess } from \"node:child_process\"\nimport { mkdirSync } from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport { basename, dirname, extname, join } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\n\ntype CliConfig = { root: string }\ntype RunLinuxArgs = {\n entryFile: string\n bundleOutput?: string\n skipBundling?: boolean\n dev?: boolean\n port?: string\n}\ntype BuildLinuxArgs = {\n entryFile: string\n bundleOutput?: string\n standalone?: boolean\n sea?: boolean\n seaOutput?: string\n}\n\n/** Exit code host-dev.ts uses to request a supervisor restart. */\nconst FULL_REFRESH_EXIT_CODE = 65\n\nconst run = (command: string, args: string[], cwd: string): number => {\n const result = spawnSync(command, args, { cwd, stdio: \"inherit\" })\n return result.status ?? 1\n}\n\n/** Resolve an executable script shipped by a dependency's bin field. */\nconst binOf = (\n requireFrom: NodeJS.Require,\n packageName: string,\n binName: string,\n): string => {\n const packageJsonPath = requireFrom.resolve(`${packageName}/package.json`)\n const manifest = requireFrom(`${packageName}/package.json`) as {\n bin?: string | Record<string, string>\n }\n const bin =\n typeof manifest.bin === \"string\" ? manifest.bin : manifest.bin?.[binName]\n if (!bin) {\n throw new Error(`${packageName} does not expose a \"${binName}\" binary`)\n }\n return join(dirname(packageJsonPath), bin)\n}\n\ntype PackageManifest = { version: string; exports?: Record<string, unknown> }\n\n/** The `@gtkx/react` subpath exports (its own `exports` map, minus `.` and `./package.json`). */\nconst reactSubexportsOf = (manifest: PackageManifest): string[] =>\n Object.keys(manifest.exports ?? {})\n .filter((key) => key.startsWith(\"./\") && key !== \"./package.json\")\n .map((key) => key.slice(2))\n\n// @gtkx/cli is meant for apps: its `codegen` command resolves gtkx.config.ts\n// from a cwd and trusts a freshness stamp, which is what the retired rc.2-era\n// workaround this replaced was dodging (running from a reconstructed \"project that owns\n// the hosting node_modules\" purely to keep that cwd resolution honest — see\n// gtkx-org/gtkx#468, #470). A library generating bindings on a consumer's\n// behalf should use the programmatic @gtkx/codegen API instead: it takes the\n// GIR libraries and store paths directly, so there is no cwd to get wrong and\n// no stamp to misread — and it runs its own fingerprint-based freshness\n// check in-process, so a missing/pruned store is regenerated rather than\n// misreported as \"up to date\".\n//\n// `root` (the app's real project root, resolved by the react-native CLI, not\n// us) is the right place to resolve gtkx.config.ts from, but NOT necessarily\n// where @gtkx/* actually lives on disk: in a workspace, npm hoists them to an\n// ancestor's node_modules, so `root/node_modules` can be a directory with no\n// @gtkx/* in it at all (confirmed against this repo's own examples/, which\n// are workspace members with nothing hoisted locally). The store — and the\n// @gtkx/gi and @gtkx/jsx links every other @gtkx/* package resolves through\n// its OWN up-the-tree lookup — must live in whichever node_modules actually\n// hosts @gtkx/runtime, so that's resolved rather than assumed.\nconst ensureCodegenStore = async (root: string): Promise<void> => {\n console.warn(\"[react-native-gtkx] ensuring gtkx codegen store…\")\n try {\n const [{ runCodegen, resolveGirPath, resolveLibraries }, { loadConfig }] =\n await Promise.all([import(\"@gtkx/codegen\"), import(\"@gtkx/config\")])\n const { config } = await loadConfig(root)\n if (config.codegen === false) {\n console.warn(\n \"[react-native-gtkx] codegen: disabled for this project (gtkx.config.ts)\",\n )\n return\n }\n const girPath = resolveGirPath(config.girPath)\n const libraries = resolveLibraries(config.libraries, girPath)\n const appRequire = createRequire(join(root, \"package.json\"))\n const runtimePackageJsonPath = appRequire.resolve(\n \"@gtkx/runtime/package.json\",\n )\n const nodeModules = dirname(dirname(dirname(runtimePackageJsonPath)))\n const runtime = appRequire(runtimePackageJsonPath) as PackageManifest\n const react = appRequire(\"@gtkx/react/package.json\") as PackageManifest\n const result = await runCodegen({\n libraries,\n girPath,\n gi: {\n storeDir: join(nodeModules, \".gtkx\", \"gi\"),\n linkDir: join(nodeModules, \"@gtkx\", \"gi\"),\n version: runtime.version,\n },\n jsx: {\n storeDir: join(nodeModules, \".gtkx\", \"jsx\"),\n linkDir: join(nodeModules, \"@gtkx\", \"jsx\"),\n version: react.version,\n },\n reactSubexports: reactSubexportsOf(react),\n })\n console.warn(\n result.isRegenerated\n ? \"[react-native-gtkx] codegen: regenerated stale bindings\"\n : \"[react-native-gtkx] codegen: bindings up to date\",\n )\n } catch (error) {\n console.error(\n \"[react-native-gtkx] gtkx codegen failed — are GTK4/libadwaita \" +\n \"development files installed?\",\n )\n console.error(error)\n process.exit(1)\n }\n}\n\nconst bundle = (root: string, entryFile: string, output: string): void => {\n const appRequire = createRequire(join(root, \"package.json\"))\n const status = run(\n process.execPath,\n [\n binOf(appRequire, \"react-native\", \"react-native\"),\n \"bundle\",\n \"--platform\",\n \"linux\",\n \"--dev\",\n \"false\",\n \"--entry-file\",\n entryFile,\n \"--bundle-output\",\n output,\n ],\n root,\n )\n if (status !== 0) {\n process.exit(status)\n }\n}\n\nconst isMetroRunning = async (server: string): Promise<boolean> => {\n try {\n const response = await fetch(`${server}/status`)\n return (await response.text()).includes(\"packager-status:running\")\n } catch {\n return false\n }\n}\n\nconst waitForMetro = async (server: string): Promise<void> => {\n for (let attempt = 0; attempt < 120; attempt += 1) {\n if (await isMetroRunning(server)) {\n return\n }\n await new Promise((resolve) => setTimeout(resolve, 500))\n }\n console.error(\n `[react-native-gtkx] Metro dev server never came up (${server}).`,\n )\n process.exit(1)\n}\n\nlet activeHost: ChildProcess | null = null\n\nconst spawnHost = (\n script: string,\n argument: string,\n cwd: string,\n): Promise<number> =>\n new Promise((resolve) => {\n // join over `new URL(script, import.meta.url)`: the global URL and the\n // node:url URL come from different type copies when the dependency tree\n // splits @types/node, and the two structurally diverge.\n const hostPath = join(dirname(fileURLToPath(import.meta.url)), script)\n const child = spawn(process.execPath, [hostPath, argument], {\n cwd,\n stdio: \"inherit\",\n })\n activeHost = child\n child.on(\"exit\", (code) => {\n activeHost = null\n resolve(code ?? 1)\n })\n })\n\nconst runLinuxDev = async (\n config: CliConfig,\n args: RunLinuxArgs,\n): Promise<never> => {\n const port = args.port ?? \"8081\"\n const server = `http://localhost:${port}`\n let metro: ChildProcess | null = null\n if (await isMetroRunning(server)) {\n console.warn(\n `[react-native-gtkx] reusing the Metro dev server at ${server}`,\n )\n } else {\n console.warn(\n `[react-native-gtkx] starting the Metro dev server at ${server}…`,\n )\n const appRequire = createRequire(join(config.root, \"package.json\"))\n metro = spawn(\n process.execPath,\n [\n binOf(appRequire, \"react-native\", \"react-native\"),\n \"start\",\n \"--port\",\n port,\n ],\n { cwd: config.root, stdio: \"inherit\" },\n )\n await waitForMetro(server)\n }\n const entry = basename(args.entryFile, extname(args.entryFile))\n const bundleUrl = `${server}/${entry}.bundle?platform=linux&dev=true&minify=false`\n const shutdown = (code: number): never => {\n activeHost?.kill()\n metro?.kill()\n process.exit(code)\n }\n process.on(\"SIGINT\", () => shutdown(0))\n process.on(\"SIGTERM\", () => shutdown(0))\n // Supervisor: a full-refresh request restarts the host with the window\n // reopening on the fresh bundle; any other exit ends the session.\n for (;;) {\n const code = await spawnHost(\"./host-dev.js\", bundleUrl, config.root)\n if (code !== FULL_REFRESH_EXIT_CODE) {\n shutdown(code)\n }\n console.warn(\"[react-native-gtkx] restarting the app after a full refresh…\")\n }\n}\n\nconst runLinux = async (\n _argv: string[],\n config: CliConfig,\n args: RunLinuxArgs,\n): Promise<void> => {\n await ensureCodegenStore(config.root)\n if (args.dev) {\n await runLinuxDev(config, args)\n return\n }\n const output =\n args.bundleOutput ??\n join(config.root, \"node_modules\", \".react-native-gtkx\", \"main.jsbundle\")\n if (!args.skipBundling) {\n mkdirSync(dirname(output), { recursive: true })\n bundle(config.root, args.entryFile, output)\n }\n const status = await spawnHost(\"./host.js\", output, config.root)\n process.exit(status)\n}\n\n/**\n * The executable name a `--sea` build defaults to: the app's package name\n * without its scope, so the artifact is `dist/hn-app`, not `dist/app`.\n */\nconst appBinaryName = (root: string): string => {\n try {\n const manifest = createRequire(join(root, \"package.json\"))(\n \"./package.json\",\n ) as { name?: string }\n const name = manifest.name?.split(\"/\").pop()\n return name && /^[\\w.-]+$/.test(name) ? name : \"app\"\n } catch {\n return \"app\"\n }\n}\n\n// The android/ios counterpart to run-linux's dev-only bundling: bundle for\n// distribution and stop, the way a release APK/IPA build does not launch\n// the app it produces. Deliberately skips ensureCodegenStore() — codegen\n// generates the @gtkx/gi bindings host.js imports to talk to GTK at RUN\n// time; bundling never touches them (Metro only reads/transforms JS, and\n// the GTK/react/yoga modules are proxied rather than imported — see\n// ../metro's HOST_MODULE_EXTERNALS). A machine that only builds never needs\n// GTK dev headers installed.\n//\n// --standalone and --sea are the exception: both inline\n// \"virtual:gtkx-config\", which re-exports @gtkx/jsx/metadata — a codegen\n// product — so they DO need the store, and therefore GTK dev headers.\n// Only those paths ensure it.\n//\n// The three artifacts, cheapest to heaviest, are deliberately one command\n// with flags rather than three commands: they share the Metro bundle step,\n// and the choice between them is a distribution question, not a different\n// build.\n// (default) main.jsbundle + a runtime node_modules + a system node\n// --standalone one .cjs file, no node_modules, + a system node\n// --sea one executable, nothing preinstalled at all\nconst buildLinux = async (\n _argv: string[],\n config: CliConfig,\n args: BuildLinuxArgs,\n): Promise<void> => {\n if (args.sea || args.standalone) {\n await ensureCodegenStore(config.root)\n }\n const output = args.bundleOutput ?? join(config.root, \"dist\", \"main.jsbundle\")\n mkdirSync(dirname(output), { recursive: true })\n bundle(config.root, args.entryFile, output)\n console.warn(`[react-native-gtkx] wrote the release bundle to ${output}`)\n if (!args.sea && !args.standalone) {\n return\n }\n const name = appBinaryName(config.root)\n const seaOutput =\n args.seaOutput ?? join(config.root, \"dist\", args.sea ? name : `${name}.cjs`)\n // Dynamically imported so the bundler is never loaded on the ordinary\n // jsbundle path.\n const { assembleSea, bundleStandalone } = await import(\"../sea/assemble.js\")\n const bytes = args.sea\n ? await assembleSea({\n appRoot: config.root,\n jsbundlePath: output,\n outFile: seaOutput,\n })\n : await bundleStandalone({\n appRoot: config.root,\n jsbundlePath: output,\n outFile: seaOutput,\n })\n const megabytes = (bytes / 1024 / 1024).toFixed(0)\n console.warn(\n args.sea\n ? `[react-native-gtkx] wrote the single executable to ${seaOutput} ` +\n `(${megabytes} MB — Node itself is most of it)`\n : `[react-native-gtkx] wrote the standalone script to ${seaOutput} ` +\n `(${megabytes} MB — run it with \\`node ${seaOutput}\\`)`,\n )\n}\n\n/** Commands contributed to the RN CLI by the package's react-native.config.js. */\nexport const commands = [\n {\n name: \"run-linux\",\n description:\n \"Bundle the app with Metro for the linux platform and run it in the Node+GTK host\",\n options: [\n {\n name: \"--entry-file <path>\",\n description: \"Path to the app entry file\",\n default: \"index.js\",\n },\n {\n name: \"--bundle-output <path>\",\n description:\n \"Where to write the jsbundle (default: node_modules/.react-native-gtkx/main.jsbundle)\",\n },\n {\n name: \"--skip-bundling\",\n description: \"Reuse the existing bundle at --bundle-output\",\n },\n {\n name: \"--dev\",\n description:\n \"Development mode: Metro dev server + Fast Refresh (edits apply to the live window)\",\n },\n {\n name: \"--port <number>\",\n description: \"Metro dev server port for --dev (default: 8081)\",\n },\n ],\n func: runLinux,\n },\n {\n name: \"build-linux\",\n description:\n \"Bundle the app with Metro for the linux platform for distribution, without running it\",\n options: [\n {\n name: \"--entry-file <path>\",\n description: \"Path to the app entry file\",\n default: \"index.js\",\n },\n {\n name: \"--bundle-output <path>\",\n description:\n \"Where to write the release jsbundle (default: dist/main.jsbundle)\",\n },\n {\n name: \"--standalone\",\n description:\n \"Also produce one self-contained .cjs — no node_modules, run it \" +\n \"with a system node (dist/<package name>.cjs)\",\n },\n {\n name: \"--sea\",\n description:\n \"Also produce a single executable (Node SEA): one file that runs \" +\n \"with no node_modules and no system Node — at the cost of \" +\n \"carrying a whole Node binary (~120 MB)\",\n },\n {\n name: \"--sea-output <path>\",\n description:\n \"Where to write the --sea / --standalone artifact \" +\n \"(default: dist/<package name>[.cjs])\",\n },\n ],\n func: buildLinux,\n },\n]\n"]}
@@ -24,7 +24,7 @@ export const CONFIG_REQUIRED = "gtkx.config.ts with an applicationId is required
24
24
  */
25
25
  export const buildGtkxConfigModule = async (appRoot) => {
26
26
  const loader = createConfigLoader();
27
- const config = await loader(appRoot).catch((error) => {
27
+ const config = await loader.resolve(appRoot).catch((error) => {
28
28
  throw new Error(`${CONFIG_REQUIRED}\n${String(error)}`);
29
29
  });
30
30
  if (!config.applicationId) {
@@ -38,7 +38,7 @@ export const buildGtkxConfigModule = async (appRoot) => {
38
38
  throw new Error("gtkx.config.ts `elements.behaviors` is not supported on the linux " +
39
39
  "platform — react-native-gtkx owns element behaviors.");
40
40
  }
41
- const lazyElements = Object.fromEntries(config.lazyElements.map((type) => [type, { lazy: true }]));
41
+ const lazyElements = Object.fromEntries(config.lazyElements.map((type) => [type, { isLazy: true }]));
42
42
  return [
43
43
  `export * from "@gtkx/jsx/metadata";`,
44
44
  `export const applicationId = ${JSON.stringify(config.applicationId)};`,
@@ -1 +1 @@
1
- {"version":3,"file":"gtkx-config-module.js","sourceRoot":"","sources":["../../src/sea/gtkx-config-module.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,0EAA0E;AAC1E,mEAAmE;AACnE,mEAAmE;AACnE,qEAAqE;AACrE,mEAAmE;AACnE,0EAA0E;AAC1E,yEAAyE;AACzE,EAAE;AACF,mEAAmE;AACnE,sEAAsE;AACtE,0EAA0E;AAC1E,yEAAyE;AACzE,yEAAyE;AACzE,oEAAoE;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAG1D,MAAM,CAAC,MAAM,eAAe,GAC1B,mEAAmE;IACnE,4EAA4E,CAAA;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EACxC,OAAe,EACE,EAAE;IACnB,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC5D,MAAM,IAAI,KAAK,CAAC,GAAG,eAAe,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;IACF,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAA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are specifier \"virtual:gtkx-config\" for JSX\n// metadata plus the app's applicationId/userEventSignals/lazy elements.\n// runner/host.ts resolves it at every process start through a loader hook\n// (registerHooks), reading gtkx.config.ts from the current working\n// directory. A SEA has no \"app root\" to read a config file from at\n// runtime — there is no cwd convention once the app is a single file\n// copied anywhere — so this bakes the same values in at BUILD time\n// instead, the same way the vite path already does (its CLI plugin serves\n// virtual:gtkx-config from the build-time config, never a runtime read).\n//\n// Deliberately duplicated validation logic rather than shared with\n// host.ts: see host-dev.ts's header comment for why the hosts in this\n// package are self-contained twins rather than sharing relative imports —\n// this is a third twin, for the same reason (host.ts must keep resolving\n// its config at runtime for ordinary `run-linux`/installed-app use; this\n// one resolves it once, at bundle time, for the SEA artifact only).\nimport { join } from \"node:path\"\nimport { createConfigLoader } from \"@gtkx/config/internal\"\nimport type { Plugin } from \"rolldown\"\n\nexport const CONFIG_REQUIRED =\n \"gtkx.config.ts with an applicationId is required in the app root \" +\n '(export default defineConfig({ applicationId: \"...\", libraries: [...] })).'\n\n/**\n * Loads and validates the app's gtkx.config.ts, returning the source of a\n * virtual:gtkx-config module with the resolved values baked in as literals.\n */\nexport const buildGtkxConfigModule = async (\n appRoot: string,\n): Promise<string> => {\n const loader = createConfigLoader()\n const config = await loader(appRoot).catch((error: unknown) => {\n throw new Error(`${CONFIG_REQUIRED}\\n${String(error)}`)\n })\n if (!config.applicationId) {\n throw new Error(CONFIG_REQUIRED)\n }\n // A behaviors module would have to be bundled and merged through\n // @gtkx/react/config; the react-native surface owns element behaviors,\n // so no app declares one — refuse rather than silently drop it (mirrors\n // host.ts's runtime check).\n if (config.elements !== null) {\n throw new Error(\n \"gtkx.config.ts `elements.behaviors` is not supported on the linux \" +\n \"platform — react-native-gtkx owns element behaviors.\",\n )\n }\n const lazyElements = Object.fromEntries(\n config.lazyElements.map((type) => [type, { lazy: true }]),\n )\n return [\n `export * from \"@gtkx/jsx/metadata\";`,\n `export const applicationId = ${JSON.stringify(config.applicationId)};`,\n `export const userEventSignals = ${JSON.stringify(config.userEventSignals)};`,\n `export const elements = ${JSON.stringify(lazyElements)};`,\n ].join(\"\\n\")\n}\n\n/**\n * Resolves the bare \"virtual:gtkx-config\" specifier @gtkx/react imports to\n * the module source built by {@link buildGtkxConfigModule}, so the bundler\n * can inline it like any other static import — no runtime loader hook\n * needed.\n *\n * The module is given an id inside `appRoot` rather than a `\\0`-prefixed\n * virtual one because it re-exports \"@gtkx/jsx/metadata\": that bare\n * specifier needs a real directory to resolve from.\n */\nexport const virtualConfigModulePlugin = (\n moduleSource: string,\n appRoot: string,\n): Plugin => {\n const configId = join(appRoot, \"__gtkx-sea-config.js\")\n return {\n name: \"gtkx-virtual-config\",\n resolveId: (source) => (source === \"virtual:gtkx-config\" ? configId : null),\n load: (id) => (id === configId ? moduleSource : null),\n }\n}\n"]}
1
+ {"version":3,"file":"gtkx-config-module.js","sourceRoot":"","sources":["../../src/sea/gtkx-config-module.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,0EAA0E;AAC1E,mEAAmE;AACnE,mEAAmE;AACnE,qEAAqE;AACrE,mEAAmE;AACnE,0EAA0E;AAC1E,yEAAyE;AACzE,EAAE;AACF,mEAAmE;AACnE,sEAAsE;AACtE,0EAA0E;AAC1E,yEAAyE;AACzE,yEAAyE;AACzE,oEAAoE;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAG1D,MAAM,CAAC,MAAM,eAAe,GAC1B,mEAAmE;IACnE,4EAA4E,CAAA;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EACxC,OAAe,EACE,EAAE;IACnB,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACp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AAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;KACtD,CAAA;AACH,CAAC,CAAA","sourcesContent":["// @gtkx/react imports the bare specifier \"virtual:gtkx-config\" for JSX\n// metadata plus the app's applicationId/userEventSignals/lazy elements.\n// runner/host.ts resolves it at every process start through a loader hook\n// (registerHooks), reading gtkx.config.ts from the current working\n// directory. A SEA has no \"app root\" to read a config file from at\n// runtime — there is no cwd convention once the app is a single file\n// copied anywhere — so this bakes the same values in at BUILD time\n// instead, the same way the vite path already does (its CLI plugin serves\n// virtual:gtkx-config from the build-time config, never a runtime read).\n//\n// Deliberately duplicated validation logic rather than shared with\n// host.ts: see host-dev.ts's header comment for why the hosts in this\n// package are self-contained twins rather than sharing relative imports —\n// this is a third twin, for the same reason (host.ts must keep resolving\n// its config at runtime for ordinary `run-linux`/installed-app use; this\n// one resolves it once, at bundle time, for the SEA artifact only).\nimport { join } from \"node:path\"\nimport { createConfigLoader } from \"@gtkx/config/internal\"\nimport type { Plugin } from \"rolldown\"\n\nexport const CONFIG_REQUIRED =\n \"gtkx.config.ts with an applicationId is required in the app root \" +\n '(export default defineConfig({ applicationId: \"...\", libraries: [...] })).'\n\n/**\n * Loads and validates the app's gtkx.config.ts, returning the source of a\n * virtual:gtkx-config module with the resolved values baked in as literals.\n */\nexport const buildGtkxConfigModule = async (\n appRoot: string,\n): Promise<string> => {\n const loader = createConfigLoader()\n const config = await loader.resolve(appRoot).catch((error: unknown) => {\n throw new Error(`${CONFIG_REQUIRED}\\n${String(error)}`)\n })\n if (!config.applicationId) {\n throw new Error(CONFIG_REQUIRED)\n }\n // A behaviors module would have to be bundled and merged through\n // @gtkx/react/config; the react-native surface owns element behaviors,\n // so no app declares one — refuse rather than silently drop it (mirrors\n // host.ts's runtime check).\n if (config.elements !== null) {\n throw new Error(\n \"gtkx.config.ts `elements.behaviors` is not supported on the linux \" +\n \"platform — react-native-gtkx owns element behaviors.\",\n )\n }\n const lazyElements = Object.fromEntries(\n config.lazyElements.map((type) => [type, { isLazy: true }]),\n )\n return [\n `export * from \"@gtkx/jsx/metadata\";`,\n `export const applicationId = ${JSON.stringify(config.applicationId)};`,\n `export const userEventSignals = ${JSON.stringify(config.userEventSignals)};`,\n `export const elements = ${JSON.stringify(lazyElements)};`,\n ].join(\"\\n\")\n}\n\n/**\n * Resolves the bare \"virtual:gtkx-config\" specifier @gtkx/react imports to\n * the module source built by {@link buildGtkxConfigModule}, so the bundler\n * can inline it like any other static import — no runtime loader hook\n * needed.\n *\n * The module is given an id inside `appRoot` rather than a `\\0`-prefixed\n * virtual one because it re-exports \"@gtkx/jsx/metadata\": that bare\n * specifier needs a real directory to resolve from.\n */\nexport const virtualConfigModulePlugin = (\n moduleSource: string,\n appRoot: string,\n): Plugin => {\n const configId = join(appRoot, \"__gtkx-sea-config.js\")\n return {\n name: \"gtkx-virtual-config\",\n resolveId: (source) => (source === \"virtual:gtkx-config\" ? configId : null),\n load: (id) => (id === configId ? moduleSource : null),\n }\n}\n"]}
@@ -0,0 +1,26 @@
1
+ export type InsetProperty = "top" | "bottom" | "left" | "right";
2
+ export declare const INSET_PROPERTIES: readonly InsetProperty[];
3
+ export type InsetTranslation = {
4
+ /** The transform slot this inset is expressed as. */
5
+ transform: "translateX" | "translateY";
6
+ /**
7
+ * How the inset's delta maps onto that slot. `right` and `bottom` measure
8
+ * INWARD from the opposite edge, so a larger value moves the node the other
9
+ * way.
10
+ */
11
+ sign: 1 | -1;
12
+ };
13
+ /**
14
+ * Whether animating `property` on `style` is exactly a translation, and which
15
+ * one. Returns null when it is not — the caller must then keep slice 2's
16
+ * refusal, unweakened.
17
+ *
18
+ * `style` is the FLATTENED style of the node itself: `position` is the node's
19
+ * own resolved value, never an ancestor's.
20
+ */
21
+ export declare const insetTranslation: (style: Readonly<Record<string, unknown>>, property: InsetProperty) => InsetTranslation | null;
22
+ /**
23
+ * Why an inset on an ALREADY absolutely-positioned node still could not be
24
+ * translated — the sentence a warning needs, or null when it can be.
25
+ */
26
+ export declare const insetRefusalReason: (style: Readonly<Record<string, unknown>>, property: InsetProperty) => string | null;
@@ -0,0 +1,113 @@
1
+ // The one layout case that has an exact transform equivalent.
2
+ //
3
+ // `width`, `flex`, `margin` and `padding` change what the SIBLINGS get, so
4
+ // animating them needs a Yoga pass and is refused by measurement
5
+ // (docs/research/animated-colors.md §4). An inset on a node whose own
6
+ // `position` is `"absolute"` is different in kind: the node is out of flow, so
7
+ // moving it changes nothing but where it is drawn — and "draw it somewhere
8
+ // else" is exactly what the transform path already does, at 0.12 µs instead
9
+ // of 63.9–496.3 µs.
10
+ //
11
+ // The equivalence is NOT universal across the four insets, and the shape of
12
+ // the exception was measured rather than assumed (Yoga 3, our own tree, the
13
+ // table in docs/research/absolute-insets.md):
14
+ //
15
+ // top only, +40 → moved (0, +40), size unchanged
16
+ // left only, +40 → moved (+40, 0), size unchanged
17
+ // right only, +40 → moved (-40, 0), size unchanged
18
+ // bottom only, +40 → moved (0, -40), size unchanged
19
+ // left+right, no width, left +40 → moved (+40, 0), width -40 ← a RESIZE
20
+ // top+bottom, no height, top +40 → moved (0, +40), height -40 ← a RESIZE
21
+ // left+right, width 80, left +40 → moved (+40, 0), size unchanged
22
+ // left+right, width 80, right+40 → did not move at all ← IGNORED
23
+ //
24
+ // So: an inset is a pure translation when its axis is anchored by ONE edge.
25
+ // When both edges are set the axis has two anchors, and Yoga either stretches
26
+ // between them (no explicit size) or honours the start edge and drops the end
27
+ // one (explicit size). Neither is a translation, and translating anyway would
28
+ // produce motion a real layout pass would not — the failure this module
29
+ // exists to refuse.
30
+ //
31
+ // The engine lays out `Direction.LTR` unconditionally (layout/engine.ts), so
32
+ // `left` is always the start edge and there is no RTL case to fold in here.
33
+ export const INSET_PROPERTIES = [
34
+ "top",
35
+ "bottom",
36
+ "left",
37
+ "right",
38
+ ];
39
+ const AXIS = {
40
+ top: {
41
+ transform: "translateY",
42
+ sign: 1,
43
+ opposite: "bottom",
44
+ size: "height",
45
+ start: true,
46
+ },
47
+ bottom: {
48
+ transform: "translateY",
49
+ sign: -1,
50
+ opposite: "top",
51
+ size: "height",
52
+ start: false,
53
+ },
54
+ left: {
55
+ transform: "translateX",
56
+ sign: 1,
57
+ opposite: "right",
58
+ size: "width",
59
+ start: true,
60
+ },
61
+ right: {
62
+ transform: "translateX",
63
+ sign: -1,
64
+ opposite: "left",
65
+ size: "width",
66
+ start: false,
67
+ },
68
+ };
69
+ const isDefinite = (value) => value !== undefined && value !== null && value !== "auto";
70
+ /**
71
+ * Whether animating `property` on `style` is exactly a translation, and which
72
+ * one. Returns null when it is not — the caller must then keep slice 2's
73
+ * refusal, unweakened.
74
+ *
75
+ * `style` is the FLATTENED style of the node itself: `position` is the node's
76
+ * own resolved value, never an ancestor's.
77
+ */
78
+ export const insetTranslation = (style, property) => {
79
+ if (style.position !== "absolute") {
80
+ return null;
81
+ }
82
+ const axis = AXIS[property];
83
+ if (!isDefinite(style[axis.opposite])) {
84
+ return { transform: axis.transform, sign: axis.sign };
85
+ }
86
+ // Both edges are set. Without an explicit size the node stretches between
87
+ // them, so the inset resizes it; with one, Yoga honours the start edge and
88
+ // ignores the end edge entirely.
89
+ if (!axis.start || !isDefinite(style[axis.size])) {
90
+ return null;
91
+ }
92
+ return { transform: axis.transform, sign: axis.sign };
93
+ };
94
+ /**
95
+ * Why an inset on an ALREADY absolutely-positioned node still could not be
96
+ * translated — the sentence a warning needs, or null when it can be.
97
+ */
98
+ export const insetRefusalReason = (style, property) => {
99
+ if (style.position !== "absolute") {
100
+ return null;
101
+ }
102
+ if (insetTranslation(style, property) !== null) {
103
+ return null;
104
+ }
105
+ const axis = AXIS[property];
106
+ if (axis.start) {
107
+ return (`both \`${property}\` and \`${axis.opposite}\` are set with no \`${axis.size}\`, so the node is ` +
108
+ `stretched between the two edges and changing one RESIZES it rather than moving it`);
109
+ }
110
+ return (`\`${axis.opposite}\` is set as well, and with a definite \`${axis.size}\` Yoga honours the start ` +
111
+ `edge and ignores \`${property}\` — so there is no movement to reproduce`);
112
+ };
113
+ //# sourceMappingURL=absolute-insets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"absolute-insets.js","sourceRoot":"","sources":["../../src/style/absolute-insets.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,2EAA2E;AAC3E,iEAAiE;AACjE,sEAAsE;AACtE,+EAA+E;AAC/E,2EAA2E;AAC3E,4EAA4E;AAC5E,oBAAoB;AACpB,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,8CAA8C;AAC9C,EAAE;AACF,oEAAoE;AACpE,oEAAoE;AACpE,oEAAoE;AACpE,oEAAoE;AACpE,4EAA4E;AAC5E,4EAA4E;AAC5E,oEAAoE;AACpE,2EAA2E;AAC3E,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,wEAAwE;AACxE,oBAAoB;AACpB,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAI5E,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;CACR,CAAA;AAsBD,MAAM,IAAI,GAAoC;IAC5C,GAAG,EAAE;QACH,SAAS,EAAE,YAAY;QACvB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;KACZ;IACD,MAAM,EAAE;QACN,SAAS,EAAE,YAAY;QACvB,IAAI,EAAE,CAAC,CAAC;QACR,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,KAAK;KACb;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,YAAY;QACvB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,IAAI;KACZ;IACD,KAAK,EAAE;QACL,SAA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AK,IAAI,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC3B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,OAAO,CACL,UAAU,QAAQ,YAAY,IAAI,CAAC,QAAQ,wBAAwB,IAAI,CAAC,IAAI,qBAAqB;YACjG,mFAAmF,CACpF,CAAA;IACH,CAAC;IACD,OAAO,CACL,KAAK,IAAI,CAAC,QAAQ,4CAA4C,IAAI,CAAC,IAAI,4BAA4B;QACnG,sBAAsB,QAAQ,2CAA2C,CAC1E,CAAA;AACH,CAAC,CAAA","sourcesContent":["// The one layout case that has an exact transform equivalent.\n//\n// `width`, `flex`, `margin` and `padding` change what the SIBLINGS get, so\n// animating them needs a Yoga pass and is refused by measurement\n// (docs/research/animated-colors.md §4). An inset on a node whose own\n// `position` is `\"absolute\"` is different in kind: the node is out of flow, so\n// moving it changes nothing but where it is drawn — and \"draw it somewhere\n// else\" is exactly what the transform path already does, at 0.12 µs instead\n// of 63.9–496.3 µs.\n//\n// The equivalence is NOT universal across the four insets, and the shape of\n// the exception was measured rather than assumed (Yoga 3, our own tree, the\n// table in docs/research/absolute-insets.md):\n//\n// top only, +40 → moved (0, +40), size unchanged\n// left only, +40 → moved (+40, 0), size unchanged\n// right only, +40 → moved (-40, 0), size unchanged\n// bottom only, +40 → moved (0, -40), size unchanged\n// left+right, no width, left +40 → moved (+40, 0), width -40 ← a RESIZE\n// top+bottom, no height, top +40 → moved (0, +40), height -40 ← a RESIZE\n// left+right, width 80, left +40 → moved (+40, 0), size unchanged\n// left+right, width 80, right+40 → did not move at all ← IGNORED\n//\n// So: an inset is a pure translation when its axis is anchored by ONE edge.\n// When both edges are set the axis has two anchors, and Yoga either stretches\n// between them (no explicit size) or honours the start edge and drops the end\n// one (explicit size). Neither is a translation, and translating anyway would\n// produce motion a real layout pass would not — the failure this module\n// exists to refuse.\n//\n// The engine lays out `Direction.LTR` unconditionally (layout/engine.ts), so\n// `left` is always the start edge and there is no RTL case to fold in here.\n\nexport type InsetProperty = \"top\" | \"bottom\" | \"left\" | \"right\"\n\nexport const INSET_PROPERTIES: readonly InsetProperty[] = [\n \"top\",\n \"bottom\",\n \"left\",\n \"right\",\n]\n\nexport type InsetTranslation = {\n /** The transform slot this inset is expressed as. */\n transform: \"translateX\" | \"translateY\"\n /**\n * How the inset's delta maps onto that slot. `right` and `bottom` measure\n * INWARD from the opposite edge, so a larger value moves the node the other\n * way.\n */\n sign: 1 | -1\n}\n\ntype AxisSpec = InsetTranslation & {\n /** The other inset on the same axis. */\n opposite: InsetProperty\n /** The size property that decides the axis when both edges are set. */\n size: \"width\" | \"height\"\n /** Whether this is the edge Yoga honours when both are set with a size. */\n start: boolean\n}\n\nconst AXIS: Record<InsetProperty, AxisSpec> = {\n top: {\n transform: \"translateY\",\n sign: 1,\n opposite: \"bottom\",\n size: \"height\",\n start: true,\n },\n bottom: {\n transform: \"translateY\",\n sign: -1,\n opposite: \"top\",\n size: \"height\",\n start: false,\n },\n left: {\n transform: \"translateX\",\n sign: 1,\n opposite: \"right\",\n size: \"width\",\n start: true,\n },\n right: {\n transform: \"translateX\",\n sign: -1,\n opposite: \"left\",\n size: \"width\",\n start: false,\n },\n}\n\nconst isDefinite = (value: unknown): boolean =>\n value !== undefined && value !== null && value !== \"auto\"\n\n/**\n * Whether animating `property` on `style` is exactly a translation, and which\n * one. Returns null when it is not — the caller must then keep slice 2's\n * refusal, unweakened.\n *\n * `style` is the FLATTENED style of the node itself: `position` is the node's\n * own resolved value, never an ancestor's.\n */\nexport const insetTranslation = (\n style: Readonly<Record<string, unknown>>,\n property: InsetProperty,\n): InsetTranslation | null => {\n if (style.position !== \"absolute\") {\n return null\n }\n const axis = AXIS[property]\n if (!isDefinite(style[axis.opposite])) {\n return { transform: axis.transform, sign: axis.sign }\n }\n // Both edges are set. Without an explicit size the node stretches between\n // them, so the inset resizes it; with one, Yoga honours the start edge and\n // ignores the end edge entirely.\n if (!axis.start || !isDefinite(style[axis.size])) {\n return null\n }\n return { transform: axis.transform, sign: axis.sign }\n}\n\n/**\n * Why an inset on an ALREADY absolutely-positioned node still could not be\n * translated — the sentence a warning needs, or null when it can be.\n */\nexport const insetRefusalReason = (\n style: Readonly<Record<string, unknown>>,\n property: InsetProperty,\n): string | null => {\n if (style.position !== \"absolute\") {\n return null\n }\n if (insetTranslation(style, property) !== null) {\n return null\n }\n const axis = AXIS[property]\n if (axis.start) {\n return (\n `both \\`${property}\\` and \\`${axis.opposite}\\` are set with no \\`${axis.size}\\`, so the node is ` +\n `stretched between the two edges and changing one RESIZES it rather than moving it`\n )\n }\n return (\n `\\`${axis.opposite}\\` is set as well, and with a definite \\`${axis.size}\\` Yoga honours the start ` +\n `edge and ignores \\`${property}\\` — so there is no movement to reproduce`\n )\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import type { LayoutNode } from "../layout/node";
2
+ export type SizeProperty = "width" | "height";
3
+ export declare const SIZE_PROPERTIES: readonly SizeProperty[];
4
+ /** Where the driven size is asked about: the node, and the root it lives under. */
5
+ export type DrivenSizeContext = {
6
+ /** The animated node's own shadow-tree node. */
7
+ node: LayoutNode;
8
+ /**
9
+ * Whether the LAYOUT ROOT reports its own Yoga content size to GTK — an
10
+ * `IntrinsicRoot`, i.e. React Native content mounted directly in a GTK
11
+ * chrome slot. That is the one root shape where a size below really does
12
+ * reach the toplevel's size request (docs/research/animated-size.md §4), so
13
+ * under it the climb never ends in a rectangle somebody else decided and
14
+ * nothing qualifies.
15
+ */
16
+ rootIsContentSized: boolean;
17
+ };
18
+ /**
19
+ * Why `property` cannot be driven on this node — the sentence a warning needs
20
+ * — or null when it CAN be, in which case the driven size goes into the rect
21
+ * store as an override and the node's own subtree is re-laid-out pinned to it.
22
+ */
23
+ export declare const drivenSizeRefusal: ({ node, rootIsContentSized }: DrivenSizeContext, property: SizeProperty) => string | null;
24
+ /** Whether `property` can be driven at frame rate on this node. */
25
+ export declare const canDriveSize: (context: DrivenSizeContext, property: SizeProperty) => boolean;
@@ -0,0 +1,225 @@
1
+ // The second carve-out in the layout refusal: a size change that is CONFINED
2
+ // to the node that owns it.
3
+ //
4
+ // The refusal itself is a cost argument and stays one — a naive `width` write
5
+ // is a Yoga pass over the container plus its commit walk, 52 / 133 / 496 µs at
6
+ // 5 / 60 / 300 children against a transform's 1.5 µs, and it grows with the
7
+ // CONTAINER rather than with the animated value
8
+ // (docs/research/animated-size.md §3). What that measurement also found is
9
+ // that the growth is entirely in work the change does not need: re-running
10
+ // Yoga rooted at the ANIMATED NODE instead of at the root is 6.6 µs for a leaf
11
+ // and 23 µs with wrapped text, IDENTICAL at 5, 60 and 300 siblings, and
12
+ // reproduces a full pass exactly — as long as the change genuinely stops at
13
+ // the node.
14
+ //
15
+ // This module decides that "as long as". It is the same shape as
16
+ // ./absolute-insets.ts and exists for the same reason: a rule that drifted
17
+ // away from what Yoga actually does is the bug this design is most likely to
18
+ // ship, so it lives in one place and tests/unit/style/animated-size.test.ts
19
+ // runs it against the real `LayoutEngine` — every configuration is laid out
20
+ // twice, once by a full pass and once by the subtree pass, and the rule is
21
+ // required to say yes exactly where the two agree, on every rect.
22
+ //
23
+ // THE AUTHORITY IS THE LAYOUT TREE, not the updater's style object.
24
+ // `position`, the container's `flexDirection` and its `alignItems` are almost
25
+ // always in a sibling style entry that `useAnimatedStyle` never mentions
26
+ // (`style={[styles.bar, useAnimatedStyle(() => ({ width: w.value }))]}`), and
27
+ // the container's style is not in the animated component's props at all. So
28
+ // the questions are asked of the shadow tree, of the style each node was
29
+ // actually laid out with (layout/node.ts, `LayoutNode.style`).
30
+ //
31
+ // WHAT THE RULE COMES DOWN TO, per driven axis A:
32
+ //
33
+ // 1. the node has no `aspectRatio` (it ties A to the other axis) and no
34
+ // `min`/`max` on A (both clamp the driven value — measured);
35
+ // 2. the node's size on the OTHER axis does not come from its content, or
36
+ // re-laying the subtree out at the new A would change it too and every
37
+ // following sibling would shift;
38
+ // 3. the container's size on A does not depend on its children, or the
39
+ // container grows with the node and everything around it moves;
40
+ // 4. for an in-flow node, A is the container's CROSS axis (a main-axis
41
+ // change shifts every following sibling), the container does not wrap
42
+ // (a cross-size change re-sizes the node's LINE and moves the lines
43
+ // after it), and the node's resolved cross-axis alignment is
44
+ // `flex-start` or `stretch` — `center` and `flex-end` move the node's
45
+ // own origin as it grows;
46
+ // 5. for an out-of-flow node, A's START edge is anchored, so the node grows
47
+ // from an origin that does not move.
48
+ //
49
+ // Everything else keeps the refusal, re-argued on cost alone.
50
+ export const SIZE_PROPERTIES = ["width", "height"];
51
+ const AXIS_OF = {
52
+ width: "horizontal",
53
+ height: "vertical",
54
+ };
55
+ const SIZE_ON = {
56
+ horizontal: "width",
57
+ vertical: "height",
58
+ };
59
+ const OTHER_AXIS = {
60
+ horizontal: "vertical",
61
+ vertical: "horizontal",
62
+ };
63
+ const START_EDGE = {
64
+ horizontal: "left",
65
+ vertical: "top",
66
+ };
67
+ const END_EDGE = {
68
+ horizontal: "right",
69
+ vertical: "bottom",
70
+ };
71
+ const MIN_ON = {
72
+ horizontal: "minWidth",
73
+ vertical: "minHeight",
74
+ };
75
+ const MAX_ON = {
76
+ horizontal: "maxWidth",
77
+ vertical: "maxHeight",
78
+ };
79
+ // --- reading a style --------------------------------------------------------
80
+ const EMPTY = {};
81
+ const styleOf = (node) => node.style ?? EMPTY;
82
+ /** Definite in Yoga's sense: a point or a percentage, not `auto` and not absent. */
83
+ const isDefinite = (value) => typeof value === "number" ||
84
+ (typeof value === "string" && value !== "auto" && value.endsWith("%"));
85
+ const mainAxisOf = (style) => {
86
+ const direction = style.flexDirection ?? "column";
87
+ return direction === "row" || direction === "row-reverse"
88
+ ? "horizontal"
89
+ : "vertical";
90
+ };
91
+ const isAbsolute = (style) => style.position === "absolute";
92
+ // `flex: N` is Yoga's shorthand and it resolves flexBasis to zero, which is
93
+ // what makes `flex: 1` a size that comes from the container rather than from
94
+ // the content. A bare `flexGrow` leaves flexBasis `auto`, so the final size is
95
+ // content PLUS a share of the free space — and the content half is exactly
96
+ // what disqualifies it.
97
+ const growsFromContainer = (style) => {
98
+ const flex = style.flex ?? 0;
99
+ if (flex > 0) {
100
+ return true;
101
+ }
102
+ return (style.flexGrow ?? 0) > 0 && isDefinite(style.flexBasis);
103
+ };
104
+ /** The cross-axis alignment this node resolves to inside `container`. */
105
+ const resolvedAlign = (style, container) => {
106
+ const own = style.alignSelf ?? "auto";
107
+ return own === "auto" ? (container.alignItems ?? "stretch") : own;
108
+ };
109
+ // --- the question the rule is made of ---------------------------------------
110
+ // A climb, so it terminates; nothing in a real tree comes close, and a
111
+ // malformed one must not hang a frame.
112
+ const MAX_CLIMB = 64;
113
+ /**
114
+ * Whether `node`'s own size on `axis` can be changed by its CHILDREN.
115
+ *
116
+ * Asked of the container (can the animated node push it around?) and, on the
117
+ * other axis, of the animated node itself (can its own re-laid-out subtree
118
+ * push it around?). The answers are the same list: a definite size from its
119
+ * own style, a size stretched or grown from its container, or an out-of-flow
120
+ * box anchored on both edges — and the climb only continues where the size is
121
+ * inherited from above.
122
+ */
123
+ const sizeIsIndependentOfContent = (node, axis, rootIsContentSized, depth = 0) => {
124
+ if (node === null) {
125
+ // Past the engine root. `Root` is laid out against a viewport — a definite
126
+ // rectangle it adopts whole — and an `IntrinsicRoot` measures its content
127
+ // instead, which is the one case where the climb ends in a no.
128
+ return !rootIsContentSized;
129
+ }
130
+ if (depth >= MAX_CLIMB) {
131
+ return false;
132
+ }
133
+ const style = styleOf(node);
134
+ if (isDefinite(style[SIZE_ON[axis]])) {
135
+ return true;
136
+ }
137
+ if (isAbsolute(style)) {
138
+ // Anchored on both edges: the size is the distance between them, which is
139
+ // the container's business and not its children's.
140
+ return (isDefinite(style[START_EDGE[axis]]) && isDefinite(style[END_EDGE[axis]]));
141
+ }
142
+ const parent = node.parent;
143
+ if (parent === null) {
144
+ // The engine root itself: `calculateLayout` is given the viewport as
145
+ // available space, and it fills it — unless the root is the one that
146
+ // measures its content instead.
147
+ return !rootIsContentSized;
148
+ }
149
+ const container = styleOf(parent);
150
+ if (axis === mainAxisOf(container)) {
151
+ return (growsFromContainer(style) &&
152
+ sizeIsIndependentOfContent(parent, axis, rootIsContentSized, depth + 1));
153
+ }
154
+ // The container's cross axis: `stretch` hands the node the container's own
155
+ // content box, so the question simply moves up one level. A wrapping
156
+ // container stretches to the LINE instead, which its siblings decide, so it
157
+ // stops here.
158
+ if ((container.flexWrap ?? "nowrap") !== "nowrap" ||
159
+ resolvedAlign(style, container) !== "stretch") {
160
+ return false;
161
+ }
162
+ return sizeIsIndependentOfContent(parent, axis, rootIsContentSized, depth + 1);
163
+ };
164
+ // --- the rule ---------------------------------------------------------------
165
+ /**
166
+ * Why `property` cannot be driven on this node — the sentence a warning needs
167
+ * — or null when it CAN be, in which case the driven size goes into the rect
168
+ * store as an override and the node's own subtree is re-laid-out pinned to it.
169
+ */
170
+ export const drivenSizeRefusal = ({ node, rootIsContentSized }, property) => {
171
+ const axis = AXIS_OF[property];
172
+ const other = OTHER_AXIS[axis];
173
+ const style = styleOf(node);
174
+ if (style.aspectRatio !== undefined) {
175
+ return ("the node has an `aspectRatio`, which derives its " +
176
+ `\`${SIZE_ON[other]}\` from its \`${property}\` — so the change is not confined to one axis`);
177
+ }
178
+ if (isDefinite(style[MIN_ON[axis]]) || isDefinite(style[MAX_ON[axis]])) {
179
+ return (`the node has a \`${MIN_ON[axis]}\`/\`${MAX_ON[axis]}\`, which clamps the driven value — what is on ` +
180
+ "screen would stop following the animation");
181
+ }
182
+ if (!sizeIsIndependentOfContent(node, other, rootIsContentSized)) {
183
+ return (`the node's \`${SIZE_ON[other]}\` comes from its own content, so re-laying its subtree out at a new ` +
184
+ `\`${property}\` would change the \`${SIZE_ON[other]}\` too and move every sibling after it`);
185
+ }
186
+ const parent = node.parent;
187
+ if (parent === null) {
188
+ return "the node is a layout root, whose size is the rectangle GTK hands it rather than a style";
189
+ }
190
+ if (!sizeIsIndependentOfContent(parent, axis, rootIsContentSized)) {
191
+ return rootIsContentSized
192
+ ? `the container's \`${property}\` is derived from its children, up to an \`IntrinsicRoot\` that reports ` +
193
+ "its content size to GTK — so a size change here really does reach the window's own size request"
194
+ : `the container's \`${property}\` is derived from its children, so the node growing would grow the ` +
195
+ "container and move everything around it";
196
+ }
197
+ if (isAbsolute(style)) {
198
+ // Out of flow: no sibling can be shifted and the container's content size
199
+ // does not include it, so the only question left is whether the node grows
200
+ // from an origin that stays put.
201
+ if (!isDefinite(style[START_EDGE[axis]])) {
202
+ return (`the node is absolutely positioned with no \`${START_EDGE[axis]}\`, so it is anchored by its ` +
203
+ `\`${END_EDGE[axis]}\` edge or by its static position and growing it MOVES it`);
204
+ }
205
+ return null;
206
+ }
207
+ const container = styleOf(parent);
208
+ if (axis === mainAxisOf(container)) {
209
+ return (`\`${property}\` is the container's MAIN axis, so growing the node pushes every following sibling ` +
210
+ "along — that is a layout pass over the container, which is what costs 52–496 µs");
211
+ }
212
+ if ((container.flexWrap ?? "nowrap") !== "nowrap") {
213
+ return ("the container wraps, so a change on its cross axis re-sizes the node's LINE and moves every line " +
214
+ "after it");
215
+ }
216
+ const align = resolvedAlign(style, container);
217
+ if (align !== "flex-start" && align !== "stretch") {
218
+ return (`the node's resolved cross-axis alignment is \`${align}\`, not \`flex-start\` or \`stretch\`, so it ` +
219
+ "grows about its centre or its far edge and its own position moves with its size");
220
+ }
221
+ return null;
222
+ };
223
+ /** Whether `property` can be driven at frame rate on this node. */
224
+ export const canDriveSize = (context, property) => drivenSizeRefusal(context, property) === null;
225
+ //# sourceMappingURL=animated-size.js.map