react-native-gtkx 0.2.0-alpha.2 → 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 (340) hide show
  1. package/README.md +5 -2
  2. package/dist/aliases/index.d.ts +84 -0
  3. package/dist/aliases/index.js +208 -0
  4. package/dist/aliases/index.js.map +1 -0
  5. package/dist/animated/index.d.ts +2 -0
  6. package/dist/animated/index.js +5 -0
  7. package/dist/animated/index.js.map +1 -1
  8. package/dist/animated/types.d.ts +1 -0
  9. package/dist/animated/types.js.map +1 -1
  10. package/dist/animated/value-animation.js +17 -4
  11. package/dist/animated/value-animation.js.map +1 -1
  12. package/dist/apis/host.gtkx.js +9 -12
  13. package/dist/apis/host.gtkx.js.map +1 -1
  14. package/dist/apis/index.d.ts +4 -2
  15. package/dist/apis/index.js +2 -0
  16. package/dist/apis/index.js.map +1 -1
  17. package/dist/apis/keyboard.d.ts +60 -0
  18. package/dist/apis/keyboard.js +63 -0
  19. package/dist/apis/keyboard.js.map +1 -0
  20. package/dist/apis/log-box.d.ts +15 -0
  21. package/dist/apis/log-box.js +46 -0
  22. package/dist/apis/log-box.js.map +1 -0
  23. package/dist/apis/platform.d.ts +18 -1
  24. package/dist/apis/platform.js.map +1 -1
  25. package/dist/common/index.d.ts +0 -1
  26. package/dist/common/index.js +24 -1
  27. package/dist/common/index.js.map +1 -1
  28. package/dist/components/animated.d.ts +70 -6
  29. package/dist/components/animated.js +559 -46
  30. package/dist/components/animated.js.map +1 -1
  31. package/dist/components/driven-size.d.ts +27 -0
  32. package/dist/components/driven-size.js +85 -0
  33. package/dist/components/driven-size.js.map +1 -0
  34. package/dist/components/find-node-handle.d.ts +11 -0
  35. package/dist/components/find-node-handle.js +53 -0
  36. package/dist/components/find-node-handle.js.map +1 -0
  37. package/dist/components/flat-list.d.ts +3 -2
  38. package/dist/components/flat-list.js.map +1 -1
  39. package/dist/components/frame-scheduler.d.ts +16 -0
  40. package/dist/components/frame-scheduler.js +37 -0
  41. package/dist/components/frame-scheduler.js.map +1 -0
  42. package/dist/components/image.d.ts +6 -1
  43. package/dist/components/image.js +15 -4
  44. package/dist/components/image.js.map +1 -1
  45. package/dist/components/index.d.ts +7 -5
  46. package/dist/components/index.js +5 -3
  47. package/dist/components/index.js.map +1 -1
  48. package/dist/components/measure.d.ts +51 -1
  49. package/dist/components/measure.js +101 -2
  50. package/dist/components/measure.js.map +1 -1
  51. package/dist/components/pressable.d.ts +61 -1
  52. package/dist/components/pressable.js +151 -4
  53. package/dist/components/pressable.js.map +1 -1
  54. package/dist/components/rect-store.d.ts +58 -0
  55. package/dist/components/rect-store.js +124 -3
  56. package/dist/components/rect-store.js.map +1 -1
  57. package/dist/components/root.js +6 -1
  58. package/dist/components/root.js.map +1 -1
  59. package/dist/components/scroll-phase.d.ts +35 -0
  60. package/dist/components/scroll-phase.js +26 -0
  61. package/dist/components/scroll-phase.js.map +1 -0
  62. package/dist/components/scroll-view.d.ts +39 -3
  63. package/dist/components/scroll-view.js +378 -43
  64. package/dist/components/scroll-view.js.map +1 -1
  65. package/dist/components/text-input.js +9 -25
  66. package/dist/components/text-input.js.map +1 -1
  67. package/dist/components/text.d.ts +6 -2
  68. package/dist/components/text.js +43 -8
  69. package/dist/components/text.js.map +1 -1
  70. package/dist/components/use-focus.d.ts +27 -0
  71. package/dist/components/use-focus.js +116 -0
  72. package/dist/components/use-focus.js.map +1 -0
  73. package/dist/components/use-layout-child.d.ts +13 -1
  74. package/dist/components/use-layout-child.js +188 -5
  75. package/dist/components/use-layout-child.js.map +1 -1
  76. package/dist/components/view.d.ts +5 -2
  77. package/dist/components/view.js +18 -13
  78. package/dist/components/view.js.map +1 -1
  79. package/dist/components/virtualized-list.d.ts +45 -5
  80. package/dist/components/virtualized-list.js +90 -24
  81. package/dist/components/virtualized-list.js.map +1 -1
  82. package/dist/components/wheel-scroll-session.d.ts +7 -0
  83. package/dist/components/wheel-scroll-session.js +53 -0
  84. package/dist/components/wheel-scroll-session.js.map +1 -0
  85. package/dist/components/widget-retention.d.ts +35 -0
  86. package/dist/components/widget-retention.js +169 -0
  87. package/dist/components/widget-retention.js.map +1 -0
  88. package/dist/contracts.d.ts +4 -0
  89. package/dist/contracts.js.map +1 -1
  90. package/dist/dnd/context.d.ts +69 -0
  91. package/dist/dnd/context.js +149 -0
  92. package/dist/dnd/context.js.map +1 -0
  93. package/dist/dnd/draggable.d.ts +59 -0
  94. package/dist/dnd/draggable.js +149 -0
  95. package/dist/dnd/draggable.js.map +1 -0
  96. package/dist/dnd/droppable.d.ts +24 -0
  97. package/dist/dnd/droppable.js +74 -0
  98. package/dist/dnd/droppable.js.map +1 -0
  99. package/dist/dnd/gtk-controllers.d.ts +39 -0
  100. package/dist/dnd/gtk-controllers.js +110 -0
  101. package/dist/dnd/gtk-controllers.js.map +1 -0
  102. package/dist/dnd/index.d.ts +6 -0
  103. package/dist/dnd/index.js +31 -0
  104. package/dist/dnd/index.js.map +1 -0
  105. package/dist/dnd/order.d.ts +7 -0
  106. package/dist/dnd/order.js +20 -0
  107. package/dist/dnd/order.js.map +1 -0
  108. package/dist/dnd/payload.d.ts +14 -0
  109. package/dist/dnd/payload.js +41 -0
  110. package/dist/dnd/payload.js.map +1 -0
  111. package/dist/dnd/sortable.d.ts +49 -0
  112. package/dist/dnd/sortable.js +307 -0
  113. package/dist/dnd/sortable.js.map +1 -0
  114. package/dist/dnd/types.d.ts +290 -0
  115. package/dist/dnd/types.js +25 -0
  116. package/dist/dnd/types.js.map +1 -0
  117. package/dist/gesture-handler-compat/builder.d.ts +251 -0
  118. package/dist/gesture-handler-compat/builder.js +513 -0
  119. package/dist/gesture-handler-compat/builder.js.map +1 -0
  120. package/dist/gesture-handler-compat/composition.d.ts +23 -0
  121. package/dist/gesture-handler-compat/composition.js +111 -0
  122. package/dist/gesture-handler-compat/composition.js.map +1 -0
  123. package/dist/gesture-handler-compat/deciders.d.ts +3 -0
  124. package/dist/gesture-handler-compat/deciders.js +47 -0
  125. package/dist/gesture-handler-compat/deciders.js.map +1 -0
  126. package/dist/gesture-handler-compat/detector-runtime.d.ts +44 -0
  127. package/dist/gesture-handler-compat/detector-runtime.js +374 -0
  128. package/dist/gesture-handler-compat/detector-runtime.js.map +1 -0
  129. package/dist/gesture-handler-compat/detector.d.ts +22 -0
  130. package/dist/gesture-handler-compat/detector.js +104 -0
  131. package/dist/gesture-handler-compat/detector.js.map +1 -0
  132. package/dist/gesture-handler-compat/fling.d.ts +24 -0
  133. package/dist/gesture-handler-compat/fling.js +123 -0
  134. package/dist/gesture-handler-compat/fling.js.map +1 -0
  135. package/dist/gesture-handler-compat/force-touch.d.ts +13 -0
  136. package/dist/gesture-handler-compat/force-touch.js +40 -0
  137. package/dist/gesture-handler-compat/force-touch.js.map +1 -0
  138. package/dist/gesture-handler-compat/hooks.d.ts +157 -0
  139. package/dist/gesture-handler-compat/hooks.js +268 -0
  140. package/dist/gesture-handler-compat/hooks.js.map +1 -0
  141. package/dist/gesture-handler-compat/hover.d.ts +2 -0
  142. package/dist/gesture-handler-compat/hover.js +22 -0
  143. package/dist/gesture-handler-compat/hover.js.map +1 -0
  144. package/dist/gesture-handler-compat/index.d.ts +98 -0
  145. package/dist/gesture-handler-compat/index.js +255 -0
  146. package/dist/gesture-handler-compat/index.js.map +1 -0
  147. package/dist/gesture-handler-compat/long-press.d.ts +6 -0
  148. package/dist/gesture-handler-compat/long-press.js +21 -0
  149. package/dist/gesture-handler-compat/long-press.js.map +1 -0
  150. package/dist/gesture-handler-compat/manual.d.ts +2 -0
  151. package/dist/gesture-handler-compat/manual.js +18 -0
  152. package/dist/gesture-handler-compat/manual.js.map +1 -0
  153. package/dist/gesture-handler-compat/native.d.ts +7 -0
  154. package/dist/gesture-handler-compat/native.js +34 -0
  155. package/dist/gesture-handler-compat/native.js.map +1 -0
  156. package/dist/gesture-handler-compat/orchestrator.d.ts +77 -0
  157. package/dist/gesture-handler-compat/orchestrator.js +284 -0
  158. package/dist/gesture-handler-compat/orchestrator.js.map +1 -0
  159. package/dist/gesture-handler-compat/pan.d.ts +23 -0
  160. package/dist/gesture-handler-compat/pan.js +116 -0
  161. package/dist/gesture-handler-compat/pan.js.map +1 -0
  162. package/dist/gesture-handler-compat/recognizer.d.ts +268 -0
  163. package/dist/gesture-handler-compat/recognizer.js +1056 -0
  164. package/dist/gesture-handler-compat/recognizer.js.map +1 -0
  165. package/dist/gesture-handler-compat/relations.d.ts +43 -0
  166. package/dist/gesture-handler-compat/relations.js +128 -0
  167. package/dist/gesture-handler-compat/relations.js.map +1 -0
  168. package/dist/gesture-handler-compat/tap.d.ts +6 -0
  169. package/dist/gesture-handler-compat/tap.js +29 -0
  170. package/dist/gesture-handler-compat/tap.js.map +1 -0
  171. package/dist/gesture-handler-compat/touchpad.d.ts +41 -0
  172. package/dist/gesture-handler-compat/touchpad.js +64 -0
  173. package/dist/gesture-handler-compat/touchpad.js.map +1 -0
  174. package/dist/gesture-handler-compat/types.d.ts +441 -0
  175. package/dist/gesture-handler-compat/types.js +167 -0
  176. package/dist/gesture-handler-compat/types.js.map +1 -0
  177. package/dist/gtk/controllers.d.ts +39 -0
  178. package/dist/gtk/controllers.js +92 -0
  179. package/dist/gtk/controllers.js.map +1 -0
  180. package/dist/gtk/index.d.ts +2 -1
  181. package/dist/gtk/index.js +7 -1
  182. package/dist/gtk/index.js.map +1 -1
  183. package/dist/gtkx/bridge/geometry.js +6 -4
  184. package/dist/gtkx/bridge/geometry.js.map +1 -1
  185. package/dist/gtkx/bridge/index.d.ts +5 -3
  186. package/dist/gtkx/bridge/index.js +6 -3
  187. package/dist/gtkx/bridge/index.js.map +1 -1
  188. package/dist/gtkx/bridge/slot-portal.js.map +1 -1
  189. package/dist/gtkx/bridge/use-signal.js +1 -1
  190. package/dist/gtkx/bridge/use-signal.js.map +1 -1
  191. package/dist/gtkx/bridge/view-box.d.ts +56 -0
  192. package/dist/gtkx/bridge/view-box.js +394 -9
  193. package/dist/gtkx/bridge/view-box.js.map +1 -1
  194. package/dist/gtkx/bridge/widget-css.d.ts +17 -0
  195. package/dist/gtkx/bridge/widget-css.js +72 -0
  196. package/dist/gtkx/bridge/widget-css.js.map +1 -0
  197. package/dist/index.d.ts +3 -3
  198. package/dist/index.js +2 -2
  199. package/dist/index.js.map +1 -1
  200. package/dist/layout/driven-size.d.ts +12 -0
  201. package/dist/layout/driven-size.js +70 -0
  202. package/dist/layout/driven-size.js.map +1 -0
  203. package/dist/layout/engine.d.ts +17 -1
  204. package/dist/layout/engine.js +3 -20
  205. package/dist/layout/engine.js.map +1 -1
  206. package/dist/layout/node.d.ts +13 -0
  207. package/dist/layout/node.js +14 -0
  208. package/dist/layout/node.js.map +1 -1
  209. package/dist/layout/yoga.d.ts +3 -2
  210. package/dist/layout/yoga.js +5 -2
  211. package/dist/layout/yoga.js.map +1 -1
  212. package/dist/mcp/data/generated.d.ts +257 -60
  213. package/dist/mcp/data/generated.js +306 -62
  214. package/dist/mcp/data/generated.js.map +1 -1
  215. package/dist/metro/index.d.ts +10 -0
  216. package/dist/metro/index.js +21 -12
  217. package/dist/metro/index.js.map +1 -1
  218. package/dist/navigation/sidebar.d.ts +16 -0
  219. package/dist/navigation/sidebar.js +65 -1
  220. package/dist/navigation/sidebar.js.map +1 -1
  221. package/dist/reanimated-compat/animated-ref.d.ts +32 -0
  222. package/dist/reanimated-compat/animated-ref.js +57 -0
  223. package/dist/reanimated-compat/animated-ref.js.map +1 -0
  224. package/dist/reanimated-compat/animation.d.ts +177 -0
  225. package/dist/reanimated-compat/animation.js +540 -0
  226. package/dist/reanimated-compat/animation.js.map +1 -0
  227. package/dist/reanimated-compat/color.d.ts +28 -0
  228. package/dist/reanimated-compat/color.js +249 -0
  229. package/dist/reanimated-compat/color.js.map +1 -0
  230. package/dist/reanimated-compat/decay.d.ts +39 -0
  231. package/dist/reanimated-compat/decay.js +96 -0
  232. package/dist/reanimated-compat/decay.js.map +1 -0
  233. package/dist/reanimated-compat/easing.d.ts +30 -0
  234. package/dist/reanimated-compat/easing.js +76 -0
  235. package/dist/reanimated-compat/easing.js.map +1 -0
  236. package/dist/reanimated-compat/hooks.d.ts +14 -0
  237. package/dist/reanimated-compat/hooks.js +217 -0
  238. package/dist/reanimated-compat/hooks.js.map +1 -0
  239. package/dist/reanimated-compat/index.d.ts +258 -0
  240. package/dist/reanimated-compat/index.js +464 -0
  241. package/dist/reanimated-compat/index.js.map +1 -0
  242. package/dist/reanimated-compat/interpolation.d.ts +18 -0
  243. package/dist/reanimated-compat/interpolation.js +122 -0
  244. package/dist/reanimated-compat/interpolation.js.map +1 -0
  245. package/dist/reanimated-compat/layout-animation-config.d.ts +43 -0
  246. package/dist/reanimated-compat/layout-animation-config.js +78 -0
  247. package/dist/reanimated-compat/layout-animation-config.js.map +1 -0
  248. package/dist/reanimated-compat/layout-animation-presets.d.ts +117 -0
  249. package/dist/reanimated-compat/layout-animation-presets.js +498 -0
  250. package/dist/reanimated-compat/layout-animation-presets.js.map +1 -0
  251. package/dist/reanimated-compat/layout-animation-runtime.d.ts +21 -0
  252. package/dist/reanimated-compat/layout-animation-runtime.js +311 -0
  253. package/dist/reanimated-compat/layout-animation-runtime.js.map +1 -0
  254. package/dist/reanimated-compat/layout-animation-view.d.ts +27 -0
  255. package/dist/reanimated-compat/layout-animation-view.js +266 -0
  256. package/dist/reanimated-compat/layout-animation-view.js.map +1 -0
  257. package/dist/reanimated-compat/layout-animation.d.ts +171 -0
  258. package/dist/reanimated-compat/layout-animation.js +469 -0
  259. package/dist/reanimated-compat/layout-animation.js.map +1 -0
  260. package/dist/reanimated-compat/layout-transitions.d.ts +83 -0
  261. package/dist/reanimated-compat/layout-transitions.js +350 -0
  262. package/dist/reanimated-compat/layout-transitions.js.map +1 -0
  263. package/dist/reanimated-compat/mutable.d.ts +29 -0
  264. package/dist/reanimated-compat/mutable.js +139 -0
  265. package/dist/reanimated-compat/mutable.js.map +1 -0
  266. package/dist/reanimated-compat/props.d.ts +18 -0
  267. package/dist/reanimated-compat/props.js +111 -0
  268. package/dist/reanimated-compat/props.js.map +1 -0
  269. package/dist/reanimated-compat/scroll-handler.d.ts +119 -0
  270. package/dist/reanimated-compat/scroll-handler.js +274 -0
  271. package/dist/reanimated-compat/scroll-handler.js.map +1 -0
  272. package/dist/reanimated-compat/scroll-offset.d.ts +12 -0
  273. package/dist/reanimated-compat/scroll-offset.js +104 -0
  274. package/dist/reanimated-compat/scroll-offset.js.map +1 -0
  275. package/dist/reanimated-compat/style.d.ts +90 -0
  276. package/dist/reanimated-compat/style.js +452 -0
  277. package/dist/reanimated-compat/style.js.map +1 -0
  278. package/dist/reanimated-compat/test-timers.d.ts +28 -0
  279. package/dist/reanimated-compat/test-timers.js +136 -0
  280. package/dist/reanimated-compat/test-timers.js.map +1 -0
  281. package/dist/reanimated-compat/threads.d.ts +13 -0
  282. package/dist/reanimated-compat/threads.js +41 -0
  283. package/dist/reanimated-compat/threads.js.map +1 -0
  284. package/dist/reanimated-compat/tracking.d.ts +41 -0
  285. package/dist/reanimated-compat/tracking.js +106 -0
  286. package/dist/reanimated-compat/tracking.js.map +1 -0
  287. package/dist/reanimated-compat/updater-animations.d.ts +36 -0
  288. package/dist/reanimated-compat/updater-animations.js +273 -0
  289. package/dist/reanimated-compat/updater-animations.js.map +1 -0
  290. package/dist/responder/system.d.ts +80 -7
  291. package/dist/responder/system.js +143 -23
  292. package/dist/responder/system.js.map +1 -1
  293. package/dist/responder/use-responder.d.ts +11 -0
  294. package/dist/responder/use-responder.js +225 -6
  295. package/dist/responder/use-responder.js.map +1 -1
  296. package/dist/runner/host-dev.js +1 -1
  297. package/dist/runner/host-dev.js.map +1 -1
  298. package/dist/runner/host.js +1 -1
  299. package/dist/runner/host.js.map +1 -1
  300. package/dist/runner/index.js +3 -3
  301. package/dist/runner/index.js.map +1 -1
  302. package/dist/sea/gtkx-config-module.js +1 -1
  303. package/dist/sea/gtkx-config-module.js.map +1 -1
  304. package/dist/style/absolute-insets.d.ts +26 -0
  305. package/dist/style/absolute-insets.js +113 -0
  306. package/dist/style/absolute-insets.js.map +1 -0
  307. package/dist/style/animated-size.d.ts +25 -0
  308. package/dist/style/animated-size.js +225 -0
  309. package/dist/style/animated-size.js.map +1 -0
  310. package/dist/style/colors.d.ts +17 -0
  311. package/dist/style/colors.js +25 -6
  312. package/dist/style/colors.js.map +1 -1
  313. package/dist/style/imperative-css.d.ts +21 -0
  314. package/dist/style/imperative-css.js +63 -0
  315. package/dist/style/imperative-css.js.map +1 -0
  316. package/dist/style/index.d.ts +2 -1
  317. package/dist/style/index.js +2 -1
  318. package/dist/style/index.js.map +1 -1
  319. package/dist/style/split-style.js +5 -0
  320. package/dist/style/split-style.js.map +1 -1
  321. package/dist/testing/index.js.map +1 -1
  322. package/dist/unsupported-export.d.ts +8 -0
  323. package/dist/unsupported-export.js +66 -0
  324. package/dist/unsupported-export.js.map +1 -0
  325. package/dist/vite/index.d.ts +21 -8
  326. package/dist/vite/index.js +127 -82
  327. package/dist/vite/index.js.map +1 -1
  328. package/dist/vitest/index.d.ts +2 -2
  329. package/dist/vitest/index.js.map +1 -1
  330. package/dist/worklets-compat/index.d.ts +4 -0
  331. package/dist/worklets-compat/index.js +28 -0
  332. package/dist/worklets-compat/index.js.map +1 -0
  333. package/dist/worklets-compat/surface.d.ts +110 -0
  334. package/dist/worklets-compat/surface.js +153 -0
  335. package/dist/worklets-compat/surface.js.map +1 -0
  336. package/package.json +25 -9
  337. package/types.d.ts +9 -0
  338. package/dist/common/list.d.ts +0 -82
  339. package/dist/common/list.js +0 -166
  340. package/dist/common/list.js.map +0 -1
@@ -1,14 +1,37 @@
1
- // RnGtkxViewBox — the GtkBox subclass every View renders. Its contains()
2
- // consults a per-widget flag: a "pass-through" box is never returned by
3
- // GTK's pick (RN pointerEvents="box-none" — the box is transparent while
4
- // children stay pickable, and toggling the mode never remounts the
5
- // subtree); otherwise it reproduces the default bounds check. Registered
6
- // lazily like RnGtkxLayout (registration needs GObject, class identity
7
- // must exist before the first instance).
1
+ // RnGtkxViewBox — the GtkBox subclass every View renders and the whole of
2
+ // RN's pointerEvents, which is a picking question and therefore lives here.
3
+ //
4
+ // Two of the four modes are the box's own contains(): "box-none" makes it
5
+ // invisible to GTK's pick while its children stay pickable, and hitSlop
6
+ // grows the rect the check uses. The other two are can-target on the widget
7
+ // ("none", the whole subtree) or on its children ("box-only").
8
+ //
9
+ // can-target is a single boolean per widget and TWO things want to write it
10
+ // — the widget's own pointerEvents, and a box-only ancestor masking it — so
11
+ // neither may write it directly. `setPointerTarget` records what the
12
+ // widget's own prop wants and applies the combination; the mask is derived
13
+ // from the live parent every time, so a widget that React moves elsewhere
14
+ // cannot end up stuck untargetable. Blanket-restoring children to `true` is
15
+ // what made nesting a pointerEvents inside a box-only view unsupported
16
+ // before: the restore pass could not know that a child wanted to be
17
+ // untargetable for its own reasons.
18
+ //
19
+ // `zIndex` is the other half of the same subject and lives here for the same
20
+ // reason: RN's z-order is a PAINT order and a PICK order, and this widget is
21
+ // the only thing that owns both. See the block above the zIndex section below.
22
+ //
23
+ // Registered lazily like RnGtkxLayout (registration needs GObject, class
24
+ // identity must exist before the first instance).
25
+ import * as Graphene from "@gtkx/gi/graphene";
8
26
  import * as Gtk from "@gtkx/gi/gtk";
9
27
  import { createElementComponent } from "@gtkx/react/internal";
10
28
  import { registerClass } from "@gtkx/runtime";
11
29
  const passthrough = new WeakSet();
30
+ /** Widgets whose DIRECT children are masked — RN's pointerEvents="box-only". */
31
+ const boxOnly = new WeakSet();
32
+ /** What each widget's own pointerEvents wants, before any mask. */
33
+ const ownTarget = new WeakMap();
34
+ const hitSlops = new WeakMap();
12
35
  /** box-none toggle: picking consults this live, no invalidation needed. */
13
36
  export const setBoxPassthrough = (widget, enabled) => {
14
37
  if (enabled) {
@@ -18,6 +41,329 @@ export const setBoxPassthrough = (widget, enabled) => {
18
41
  passthrough.delete(widget);
19
42
  }
20
43
  };
44
+ /**
45
+ * Grows the rect this widget's contains() accepts. Only RnGtkxViewBox
46
+ * consults it — RN's hitSlop is a picking change and nothing in JS can
47
+ * substitute for one, because a press outside the widget is never delivered
48
+ * to it in the first place.
49
+ */
50
+ export const setHitSlop = (widget, slop) => {
51
+ if (slop === null) {
52
+ hitSlops.delete(widget);
53
+ }
54
+ else {
55
+ hitSlops.set(widget, slop);
56
+ }
57
+ };
58
+ const isMasked = (widget) => {
59
+ const parent = widget.getParent();
60
+ return parent !== null && boxOnly.has(parent);
61
+ };
62
+ const applyTarget = (widget) => {
63
+ widget.setCanTarget(!isMasked(widget) && (ownTarget.get(widget) ?? true));
64
+ };
65
+ /**
66
+ * What this widget's own `pointerEvents` wants its can-target to be. A
67
+ * box-only ancestor still overrides it, and stops overriding it the moment
68
+ * the ancestor's mode changes — without either of them having to know about
69
+ * the other.
70
+ */
71
+ export const setPointerTarget = (widget, targetable) => {
72
+ ownTarget.set(widget, targetable);
73
+ applyTarget(widget);
74
+ };
75
+ /**
76
+ * Masks or unmasks a widget's direct children — RN's
77
+ * pointerEvents="box-only". Re-applied every commit rather than only on
78
+ * change, because the child set moves with the renders.
79
+ */
80
+ export const setBoxOnly = (widget, enabled) => {
81
+ if (enabled) {
82
+ boxOnly.add(widget);
83
+ }
84
+ else {
85
+ boxOnly.delete(widget);
86
+ }
87
+ for (let child = widget.getFirstChild(); child !== null; child = child.getNextSibling()) {
88
+ applyTarget(child);
89
+ }
90
+ };
91
+ // --- zIndex ---------------------------------------------------------------
92
+ //
93
+ // RN's `zIndex` reorders PAINT among siblings. GTK4 paints a container's
94
+ // children in child order and has no z-order property, so the obvious fix —
95
+ // reorder the widgets — is the wrong one: widget order is the order this
96
+ // platform keeps its shadow tree in sync with (`syncChildOrder` in
97
+ // components/use-layout-child.ts), so restacking for paint would silently
98
+ // restack the LAYOUT.
99
+ //
100
+ // Paint order and layout order do not have to be the same, though, and we own
101
+ // the widget: `allocate` stays in Yoga's order and `snapshot` walks the
102
+ // children in zIndex order instead. That is what Android does too
103
+ // (`ViewGroup.getChildDrawingOrder`) and for the same reason.
104
+ //
105
+ // The half that is easy to miss is that `gtk_widget_pick()` descends in
106
+ // REVERSE child order, so sorting the paint alone leaves a raised view drawn
107
+ // on top and still unclickable. GTK4 has no `pick` vfunc (GtkWidgetClass's
108
+ // public vtable ends at `contains`, verified against gtk 4.22's header and
109
+ // gtkx's generated registry), and the only per-point hook it offers is
110
+ // `contains()` — which is exactly the vfunc this file already overrides. So
111
+ // picking is made to agree by having a covered widget answer "not me" where a
112
+ // higher-painting sibling of one of its ancestors would answer instead.
113
+ //
114
+ // Everything below is behind `raisedCount`, which is 0 in every app that never
115
+ // writes the style: one integer comparison, and both vfuncs take the path they
116
+ // took before any of this existed.
117
+ /** Non-zero zIndex per widget. Absent means 0, which is RN's default. */
118
+ const zIndexes = new WeakMap();
119
+ /**
120
+ * How many widgets in the process currently carry a non-zero `zIndex`.
121
+ *
122
+ * The fast path's whole guard. `snapshot()` and `contains()` read this first,
123
+ * so a tree that never raises anything pays one integer comparison per call
124
+ * and no allocation, no sort, and no per-child work beyond what GTK's own
125
+ * snapshot does.
126
+ */
127
+ let raisedCount = 0;
128
+ /**
129
+ * Cached paint order per container: an array in paint order, or `null` for
130
+ * "plain child order, nothing to do". Recomputed on change (a zIndex write, a
131
+ * commit that touched the container's children) rather than per snapshot —
132
+ * `useSortable` puts `zIndex` in its style object every frame but changes its
133
+ * VALUE about twice per drag.
134
+ */
135
+ const paintOrders = new WeakMap();
136
+ /**
137
+ * The container's live children, in child order, as the LAST ALLOCATE PASS
138
+ * walked them.
139
+ *
140
+ * The snapshot vfunc has to visit every child either way, and walking the
141
+ * sibling chain from JS is what costs: each `getNextSibling()` mints a fresh
142
+ * native wrapper, measured at 1.9 µs per child against 1.0 µs for the
143
+ * `snapshotChild()` that follows it (docs/research/z-index.md). The container's
144
+ * `allocate()` hook already walks exactly this chain, so it hands the array
145
+ * over instead and the paint pass reuses it.
146
+ *
147
+ * Safe because a child cannot appear, disappear or move without queueing a
148
+ * resize on this container, and GTK runs the layout phase before the paint
149
+ * phase — so an allocate always lands between a change and the snapshot that
150
+ * would see it. A container whose allocate never ran (no RnGtkxLayout, e.g. a
151
+ * bare slot host) simply has no entry, and the vfunc walks live.
152
+ */
153
+ const childOrders = new WeakMap();
154
+ const sameChildren = (a, b) => {
155
+ if (a.length !== b.length) {
156
+ return false;
157
+ }
158
+ for (let index = 0; index < a.length; index += 1) {
159
+ if (a[index] !== b[index]) {
160
+ return false;
161
+ }
162
+ }
163
+ return true;
164
+ };
165
+ /**
166
+ * Publishes the child list the container's allocate pass just walked.
167
+ *
168
+ * Cheap on the hot path by construction: the array is one the caller built
169
+ * anyway, and the paint order is only invalidated when the children actually
170
+ * differ — an allocate for a pure move (which is most of them, one per
171
+ * animated frame) leaves the cached sort alone.
172
+ */
173
+ export const cacheChildOrder = (container, children) => {
174
+ const previous = childOrders.get(container);
175
+ childOrders.set(container, children);
176
+ if (previous === undefined || !sameChildren(previous, children)) {
177
+ paintOrders.delete(container);
178
+ }
179
+ };
180
+ /** Containers known to hold at least one raised child, for the picking walk. */
181
+ const zOrderedParents = new WeakSet();
182
+ /**
183
+ * Widgets that paint but are not touch targets of their own: the GtkLabel a
184
+ * `Text` renders and the GtkPicture an `Image` renders. Neither component has
185
+ * a press prop, so nothing is ever attached to them — but GTK targets them by
186
+ * default, and `gtk_widget_pick()` reaches a child BEFORE it asks the parent's
187
+ * `contains()`. That is the one hole in the occlusion check below: a covered
188
+ * `View` can answer "not me", a bare GtkLabel inside it cannot.
189
+ *
190
+ * So while a container has a raised child, the paint-only leaves under it are
191
+ * made untargetable and the pick lands on their nearest `View` instead — which
192
+ * is the same widget the press would have propagated to anyway, and which does
193
+ * answer the occlusion question. Restored the moment nothing is raised there,
194
+ * because it is not free of consequence: `pointerEvents: "box-none"` on a View
195
+ * whose only child is a `Text` would otherwise fall through to whatever is
196
+ * behind it. Documented in docs/api.md.
197
+ */
198
+ const paintOnlyLeaves = new WeakSet();
199
+ /**
200
+ * Marks a widget as painting-only for picking purposes — see above. Called
201
+ * once per widget by the components that own one (`Text`, `Image`).
202
+ */
203
+ export const setPaintOnlyLeaf = (widget) => {
204
+ paintOnlyLeaves.add(widget);
205
+ };
206
+ const applyLeafTargeting = (container, suppress) => {
207
+ for (let child = container.getFirstChild(); child !== null; child = child.getNextSibling()) {
208
+ if (paintOnlyLeaves.has(child)) {
209
+ setPointerTarget(child, !suppress);
210
+ }
211
+ // A nested container that is STILL raised keeps its own suppression: an
212
+ // outer container coming back down must not restore leaves an inner one
213
+ // is relying on.
214
+ if (suppress || !zOrderedParents.has(child)) {
215
+ applyLeafTargeting(child, suppress);
216
+ }
217
+ }
218
+ };
219
+ /**
220
+ * Drops a container's cached paint order and asks for a redraw.
221
+ *
222
+ * Called from the zIndex writer and from the container's per-commit effect
223
+ * (components/use-layout-child.ts), which is what covers a child mounting,
224
+ * unmounting or being MOVED by React — the three ways the order can change
225
+ * without any zIndex being written.
226
+ */
227
+ export const invalidateZOrder = (container) => {
228
+ // The child list too: a commit is the one thing that can change it, and the
229
+ // allocate the commit queues puts a fresh one back before the next paint.
230
+ childOrders.delete(container);
231
+ if (!paintOrders.delete(container)) {
232
+ return;
233
+ }
234
+ container.queueDraw();
235
+ if (zOrderedParents.has(container)) {
236
+ // Recomputed now rather than at the next snapshot, for the same reason
237
+ // setZIndex does it: a container that just lost its last raised child
238
+ // (the commit that unmounted it) would otherwise never be asked again —
239
+ // the fast path stops calling paintOrderFor once nothing is raised — and
240
+ // would keep its paint-only leaves untargetable forever.
241
+ paintOrderFor(container);
242
+ }
243
+ };
244
+ /**
245
+ * RN's `zIndex` for one child. `0` (the default, and `undefined`) clears it.
246
+ *
247
+ * RN applies `zIndex` unconditionally — unlike CSS, which ignores `z-index`
248
+ * on a `position: static` box. Nothing here looks at `position` either.
249
+ */
250
+ export const setZIndex = (widget, value) => {
251
+ const previous = zIndexes.get(widget) ?? 0;
252
+ if (previous === value) {
253
+ return;
254
+ }
255
+ if (value === 0) {
256
+ zIndexes.delete(widget);
257
+ raisedCount -= 1;
258
+ }
259
+ else {
260
+ zIndexes.set(widget, value);
261
+ if (previous === 0) {
262
+ raisedCount += 1;
263
+ }
264
+ }
265
+ const parent = widget.getParent();
266
+ if (parent === null) {
267
+ return;
268
+ }
269
+ paintOrders.delete(parent);
270
+ // Unconditional, unlike invalidateZOrder's: the container may never have
271
+ // had a cache to drop and its paint still just changed.
272
+ parent.queueDraw();
273
+ if (value === 0) {
274
+ // Recomputed eagerly on the way DOWN, never lazily: once nothing is
275
+ // raised the fast path stops calling paintOrderFor at all, so a container
276
+ // that lost its last raised child would never get the chance to undo what
277
+ // being raised did to it (paint order, leaf targeting).
278
+ paintOrderFor(parent);
279
+ }
280
+ };
281
+ /** The container's children, from the allocate pass if it has run. */
282
+ const childrenOf = (container) => {
283
+ const cached = childOrders.get(container);
284
+ if (cached !== undefined) {
285
+ return cached;
286
+ }
287
+ const children = [];
288
+ for (let child = container.getFirstChild(); child !== null; child = child.getNextSibling()) {
289
+ children.push(child);
290
+ }
291
+ return children;
292
+ };
293
+ const paintOrderFor = (container) => {
294
+ if (paintOrders.has(container)) {
295
+ return paintOrders.get(container) ?? null;
296
+ }
297
+ const children = childrenOf(container);
298
+ let raised = false;
299
+ for (const child of children) {
300
+ if (zIndexes.has(child)) {
301
+ raised = true;
302
+ break;
303
+ }
304
+ }
305
+ let order = null;
306
+ if (raised) {
307
+ zOrderedParents.add(container);
308
+ // Once per recompute, not per frame, and only for a container that
309
+ // actually has something raised: the walk is what catches a `Text` that
310
+ // mounted into an already-raised container since the last one.
311
+ applyLeafTargeting(container, true);
312
+ // Stable by construction. RN keeps document order among equal zIndexes,
313
+ // and an unstable sort would let equal siblings swap between frames —
314
+ // flicker that is miserable to attribute. `Array.prototype.sort` has been
315
+ // required to be stable since ES2019; the index tiebreak makes that
316
+ // independent of the engine rather than assumed of it.
317
+ order = children
318
+ .map((widget, index) => ({
319
+ widget,
320
+ index,
321
+ z: zIndexes.get(widget) ?? 0,
322
+ }))
323
+ .sort((a, b) => a.z - b.z || a.index - b.index)
324
+ .map((entry) => entry.widget);
325
+ }
326
+ else if (zOrderedParents.delete(container)) {
327
+ applyLeafTargeting(container, false);
328
+ }
329
+ paintOrders.set(container, order);
330
+ return order;
331
+ };
332
+ /**
333
+ * Whether a higher-painting sibling of this widget — or of any of its
334
+ * ancestors — would take the pick at this point.
335
+ *
336
+ * `pick()` on the sibling rather than a bounds test, because "would GTK have
337
+ * answered inside that subtree" IS the question, and it comes with the rest of
338
+ * RN's rules for free: a raised view with `pointerEvents: "none"` is not
339
+ * targetable, so it does not occlude either.
340
+ *
341
+ * The recursion terminates because it only ever asks about siblings STRICTLY
342
+ * higher in the same container's paint order.
343
+ */
344
+ const isOccluded = (widget, x, y) => {
345
+ let child = widget;
346
+ let parent = child.getParent();
347
+ while (parent !== null) {
348
+ if (zOrderedParents.has(parent)) {
349
+ const order = paintOrderFor(parent);
350
+ if (order !== null) {
351
+ const index = order.indexOf(child);
352
+ for (let above = index + 1; above < order.length; above += 1) {
353
+ const sibling = order[above];
354
+ const [ok, point] = widget.computePoint(sibling, new Graphene.Point({ x, y }));
355
+ if (ok &&
356
+ sibling.pick(point.x, point.y, Gtk.PickFlags.DEFAULT) !== null) {
357
+ return true;
358
+ }
359
+ }
360
+ }
361
+ }
362
+ child = parent;
363
+ parent = child.getParent();
364
+ }
365
+ return false;
366
+ };
21
367
  let component = null;
22
368
  export const getViewBoxComponent = () => {
23
369
  if (component) {
@@ -28,8 +374,47 @@ export const getViewBoxComponent = () => {
28
374
  if (passthrough.has(this)) {
29
375
  return false;
30
376
  }
31
- // The default widget behavior: inside the widget's own bounds.
32
- return x >= 0 && y >= 0 && x < this.getWidth() && y < this.getHeight();
377
+ // GTK translates the point into this widget's coordinates before
378
+ // asking, and does not pre-check the bounds, so a negative x or a y
379
+ // past the height is a legitimate question — which is what lets
380
+ // hitSlop answer yes to it.
381
+ const slop = hitSlops.get(this);
382
+ const inside = slop === undefined
383
+ ? // The default widget behavior: inside the widget's own bounds.
384
+ x >= 0 && y >= 0 && x < this.getWidth() && y < this.getHeight()
385
+ : x >= -slop.left &&
386
+ y >= -slop.top &&
387
+ x < this.getWidth() + slop.right &&
388
+ y < this.getHeight() + slop.bottom;
389
+ if (!inside || raisedCount === 0) {
390
+ return inside;
391
+ }
392
+ // Something in this process is raised: this widget only answers where
393
+ // nothing painted above it would have.
394
+ return !isOccluded(this, x, y);
395
+ }
396
+ // GTK's own container snapshot is `gtk_widget_real_snapshot`, which walks
397
+ // first-to-last calling gtk_widget_snapshot_child — the loop below with
398
+ // nothing in front of it. There is no way to chain up to it from here
399
+ // (gtkx installs the vfunc but exposes no parent-class call, and
400
+ // gtk_widget_snapshot() is not public C API either), so the fast path
401
+ // reproduces it rather than delegating to it.
402
+ //
403
+ // No `override`: `snapshot` is a real vfunc in gtkx's codegen but is
404
+ // missing from the shipped gtk.d.ts (same as in svg-node.ts).
405
+ snapshot(snapshot) {
406
+ if (raisedCount !== 0) {
407
+ const order = paintOrderFor(this);
408
+ if (order !== null) {
409
+ for (const child of order) {
410
+ this.snapshotChild(child, snapshot);
411
+ }
412
+ return;
413
+ }
414
+ }
415
+ for (const child of childrenOf(this)) {
416
+ this.snapshotChild(child, snapshot);
417
+ }
33
418
  }
34
419
  }
35
420
  // Explicit typeName: bundlers minify class names.
@@ -1 +1 @@
1
- {"version":3,"file":"view-box.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/view-box.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,yEAAyE;AACzE,mEAAmE;AACnE,yEAAyE;AACzE,uEAAuE;AACvE,yCAAyC;AACzC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,WAAW,GAAG,IAAI,OAAO,EAAU,CAAA;AAEzC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAkB,EAClB,OAAgB,EACV,EAAE;IACR,IAAI,OAAO,EAAE,CAAC;QACZ,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC;AACH,CAAC,CAAA;AAID,IAAI,SAAS,GAA4B,IAAI,CAAA;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAqB,EAAE;IACxD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,MAAM,aAAc,SAAQ,GAAG,CAAC,GAAG;QACxB,QAAQ,CAAC,CAAS,EAAE,CAAS;YACpC,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,OAAO,KAAK,CAAA;YACd,CAAC;YACD,+DAA+D;YAC/D,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA;QACxE,CAAC;KACF;IACD,kDAAkD;IAClD,aAAa,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAA;IAC3D,SAAS,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAA;IACnD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA","sourcesContent":["// RnGtkxViewBox — the GtkBox subclass every View renders. Its contains()\n// consults a per-widget flag: a \"pass-through\" box is never returned by\n// GTK's pick (RN pointerEvents=\"box-none\" — the box is transparent while\n// children stay pickable, and toggling the mode never remounts the\n// subtree); otherwise it reproduces the default bounds check. Registered\n// lazily like RnGtkxLayout (registration needs GObject, class identity\n// must exist before the first instance).\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport { createElementComponent } from \"@gtkx/react/internal\"\nimport { registerClass } from \"@gtkx/runtime\"\n\nconst passthrough = new WeakSet<object>()\n\n/** box-none toggle: picking consults this live, no invalidation needed. */\nexport const setBoxPassthrough = (\n widget: Gtk.Widget,\n enabled: boolean,\n): void => {\n if (enabled) {\n passthrough.add(widget)\n } else {\n passthrough.delete(widget)\n }\n}\n\ntype ViewBoxComponent = ReturnType<typeof createElementComponent>\n\nlet component: ViewBoxComponent | null = null\n\nexport const getViewBoxComponent = (): ViewBoxComponent => {\n if (component) {\n return component\n }\n\n class RnGtkxViewBox extends Gtk.Box {\n override contains(x: number, y: number): boolean {\n if (passthrough.has(this)) {\n return false\n }\n // The default widget behavior: inside the widget's own bounds.\n return x >= 0 && y >= 0 && x < this.getWidth() && y < this.getHeight()\n }\n }\n // Explicit typeName: bundlers minify class names.\n registerClass(RnGtkxViewBox, { typeName: \"RnGtkxViewBox\" })\n component = createElementComponent(\"RnGtkxViewBox\")\n return component\n}\n"]}
1
+ {"version":3,"file":"view-box.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/view-box.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,4EAA4E;AAC5E,+DAA+D;AAC/D,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,qEAAqE;AACrE,2EAA2E;AAC3E,0EAA0E;AAC1E,4EAA4E;AAC5E,uEAAuE;AACvE,oEAAoE;AACpE,oCAAoC;AACpC,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,EAAE;AACF,yEAAyE;AACzE,kDAAkD;AAClD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,WAAW,GAAG,IAAI,OAAO,EAAU,CAAA;AACzC,gFAAgF;AAChF,MAAM,OAAO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,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;gBACjC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;oBACnB,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;wBAC1B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;oBACrC,CAAC;oBACD,OAAM;gBACR,CAAC;YACH,CAAC;YACD,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;YACrC,CAAC;QACH,CAAC;KACF;IACD,kDAAkD;IAClD,aAAa,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAA;IAC3D,SAAS,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAA;IACnD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA","sourcesContent":["// RnGtkxViewBox — the GtkBox subclass every View renders — and the whole of\n// RN's pointerEvents, which is a picking question and therefore lives here.\n//\n// Two of the four modes are the box's own contains(): \"box-none\" makes it\n// invisible to GTK's pick while its children stay pickable, and hitSlop\n// grows the rect the check uses. The other two are can-target on the widget\n// (\"none\", the whole subtree) or on its children (\"box-only\").\n//\n// can-target is a single boolean per widget and TWO things want to write it\n// — the widget's own pointerEvents, and a box-only ancestor masking it — so\n// neither may write it directly. `setPointerTarget` records what the\n// widget's own prop wants and applies the combination; the mask is derived\n// from the live parent every time, so a widget that React moves elsewhere\n// cannot end up stuck untargetable. Blanket-restoring children to `true` is\n// what made nesting a pointerEvents inside a box-only view unsupported\n// before: the restore pass could not know that a child wanted to be\n// untargetable for its own reasons.\n//\n// `zIndex` is the other half of the same subject and lives here for the same\n// reason: RN's z-order is a PAINT order and a PICK order, and this widget is\n// the only thing that owns both. See the block above the zIndex section below.\n//\n// Registered lazily like RnGtkxLayout (registration needs GObject, class\n// identity must exist before the first instance).\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport { createElementComponent } from \"@gtkx/react/internal\"\nimport { registerClass } from \"@gtkx/runtime\"\n\nconst passthrough = new WeakSet<object>()\n/** Widgets whose DIRECT children are masked — RN's pointerEvents=\"box-only\". */\nconst boxOnly = new WeakSet<object>()\n/** What each widget's own pointerEvents wants, before any mask. */\nconst ownTarget = new WeakMap<object, boolean>()\n\nexport type HitSlop = {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nconst hitSlops = new WeakMap<object, HitSlop>()\n\n/** box-none toggle: picking consults this live, no invalidation needed. */\nexport const setBoxPassthrough = (\n widget: Gtk.Widget,\n enabled: boolean,\n): void => {\n if (enabled) {\n passthrough.add(widget)\n } else {\n passthrough.delete(widget)\n }\n}\n\n/**\n * Grows the rect this widget's contains() accepts. Only RnGtkxViewBox\n * consults it — RN's hitSlop is a picking change and nothing in JS can\n * substitute for one, because a press outside the widget is never delivered\n * to it in the first place.\n */\nexport const setHitSlop = (widget: Gtk.Widget, slop: HitSlop | null): void => {\n if (slop === null) {\n hitSlops.delete(widget)\n } else {\n hitSlops.set(widget, slop)\n }\n}\n\nconst isMasked = (widget: Gtk.Widget): boolean => {\n const parent = widget.getParent()\n return parent !== null && boxOnly.has(parent)\n}\n\nconst applyTarget = (widget: Gtk.Widget): void => {\n widget.setCanTarget(!isMasked(widget) && (ownTarget.get(widget) ?? true))\n}\n\n/**\n * What this widget's own `pointerEvents` wants its can-target to be. A\n * box-only ancestor still overrides it, and stops overriding it the moment\n * the ancestor's mode changes — without either of them having to know about\n * the other.\n */\nexport const setPointerTarget = (\n widget: Gtk.Widget,\n targetable: boolean,\n): void => {\n ownTarget.set(widget, targetable)\n applyTarget(widget)\n}\n\n/**\n * Masks or unmasks a widget's direct children — RN's\n * pointerEvents=\"box-only\". Re-applied every commit rather than only on\n * change, because the child set moves with the renders.\n */\nexport const setBoxOnly = (widget: Gtk.Widget, enabled: boolean): void => {\n if (enabled) {\n boxOnly.add(widget)\n } else {\n boxOnly.delete(widget)\n }\n for (\n let child = widget.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n applyTarget(child)\n }\n}\n\n// --- zIndex ---------------------------------------------------------------\n//\n// RN's `zIndex` reorders PAINT among siblings. GTK4 paints a container's\n// children in child order and has no z-order property, so the obvious fix —\n// reorder the widgets — is the wrong one: widget order is the order this\n// platform keeps its shadow tree in sync with (`syncChildOrder` in\n// components/use-layout-child.ts), so restacking for paint would silently\n// restack the LAYOUT.\n//\n// Paint order and layout order do not have to be the same, though, and we own\n// the widget: `allocate` stays in Yoga's order and `snapshot` walks the\n// children in zIndex order instead. That is what Android does too\n// (`ViewGroup.getChildDrawingOrder`) and for the same reason.\n//\n// The half that is easy to miss is that `gtk_widget_pick()` descends in\n// REVERSE child order, so sorting the paint alone leaves a raised view drawn\n// on top and still unclickable. GTK4 has no `pick` vfunc (GtkWidgetClass's\n// public vtable ends at `contains`, verified against gtk 4.22's header and\n// gtkx's generated registry), and the only per-point hook it offers is\n// `contains()` — which is exactly the vfunc this file already overrides. So\n// picking is made to agree by having a covered widget answer \"not me\" where a\n// higher-painting sibling of one of its ancestors would answer instead.\n//\n// Everything below is behind `raisedCount`, which is 0 in every app that never\n// writes the style: one integer comparison, and both vfuncs take the path they\n// took before any of this existed.\n\n/** Non-zero zIndex per widget. Absent means 0, which is RN's default. */\nconst zIndexes = new WeakMap<Gtk.Widget, number>()\n\n/**\n * How many widgets in the process currently carry a non-zero `zIndex`.\n *\n * The fast path's whole guard. `snapshot()` and `contains()` read this first,\n * so a tree that never raises anything pays one integer comparison per call\n * and no allocation, no sort, and no per-child work beyond what GTK's own\n * snapshot does.\n */\nlet raisedCount = 0\n\n/**\n * Cached paint order per container: an array in paint order, or `null` for\n * \"plain child order, nothing to do\". Recomputed on change (a zIndex write, a\n * commit that touched the container's children) rather than per snapshot —\n * `useSortable` puts `zIndex` in its style object every frame but changes its\n * VALUE about twice per drag.\n */\nconst paintOrders = new WeakMap<Gtk.Widget, Gtk.Widget[] | null>()\n\n/**\n * The container's live children, in child order, as the LAST ALLOCATE PASS\n * walked them.\n *\n * The snapshot vfunc has to visit every child either way, and walking the\n * sibling chain from JS is what costs: each `getNextSibling()` mints a fresh\n * native wrapper, measured at 1.9 µs per child against 1.0 µs for the\n * `snapshotChild()` that follows it (docs/research/z-index.md). The container's\n * `allocate()` hook already walks exactly this chain, so it hands the array\n * over instead and the paint pass reuses it.\n *\n * Safe because a child cannot appear, disappear or move without queueing a\n * resize on this container, and GTK runs the layout phase before the paint\n * phase — so an allocate always lands between a change and the snapshot that\n * would see it. A container whose allocate never ran (no RnGtkxLayout, e.g. a\n * bare slot host) simply has no entry, and the vfunc walks live.\n */\nconst childOrders = new WeakMap<Gtk.Widget, Gtk.Widget[]>()\n\nconst sameChildren = (a: Gtk.Widget[], b: Gtk.Widget[]): boolean => {\n if (a.length !== b.length) {\n return false\n }\n for (let index = 0; index < a.length; index += 1) {\n if (a[index] !== b[index]) {\n return false\n }\n }\n return true\n}\n\n/**\n * Publishes the child list the container's allocate pass just walked.\n *\n * Cheap on the hot path by construction: the array is one the caller built\n * anyway, and the paint order is only invalidated when the children actually\n * differ — an allocate for a pure move (which is most of them, one per\n * animated frame) leaves the cached sort alone.\n */\nexport const cacheChildOrder = (\n container: Gtk.Widget,\n children: Gtk.Widget[],\n): void => {\n const previous = childOrders.get(container)\n childOrders.set(container, children)\n if (previous === undefined || !sameChildren(previous, children)) {\n paintOrders.delete(container)\n }\n}\n\n/** Containers known to hold at least one raised child, for the picking walk. */\nconst zOrderedParents = new WeakSet<Gtk.Widget>()\n\n/**\n * Widgets that paint but are not touch targets of their own: the GtkLabel a\n * `Text` renders and the GtkPicture an `Image` renders. Neither component has\n * a press prop, so nothing is ever attached to them — but GTK targets them by\n * default, and `gtk_widget_pick()` reaches a child BEFORE it asks the parent's\n * `contains()`. That is the one hole in the occlusion check below: a covered\n * `View` can answer \"not me\", a bare GtkLabel inside it cannot.\n *\n * So while a container has a raised child, the paint-only leaves under it are\n * made untargetable and the pick lands on their nearest `View` instead — which\n * is the same widget the press would have propagated to anyway, and which does\n * answer the occlusion question. Restored the moment nothing is raised there,\n * because it is not free of consequence: `pointerEvents: \"box-none\"` on a View\n * whose only child is a `Text` would otherwise fall through to whatever is\n * behind it. Documented in docs/api.md.\n */\nconst paintOnlyLeaves = new WeakSet<Gtk.Widget>()\n\n/**\n * Marks a widget as painting-only for picking purposes — see above. Called\n * once per widget by the components that own one (`Text`, `Image`).\n */\nexport const setPaintOnlyLeaf = (widget: Gtk.Widget): void => {\n paintOnlyLeaves.add(widget)\n}\n\nconst applyLeafTargeting = (container: Gtk.Widget, suppress: boolean): void => {\n for (\n let child = container.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n if (paintOnlyLeaves.has(child)) {\n setPointerTarget(child, !suppress)\n }\n // A nested container that is STILL raised keeps its own suppression: an\n // outer container coming back down must not restore leaves an inner one\n // is relying on.\n if (suppress || !zOrderedParents.has(child)) {\n applyLeafTargeting(child, suppress)\n }\n }\n}\n\n/**\n * Drops a container's cached paint order and asks for a redraw.\n *\n * Called from the zIndex writer and from the container's per-commit effect\n * (components/use-layout-child.ts), which is what covers a child mounting,\n * unmounting or being MOVED by React — the three ways the order can change\n * without any zIndex being written.\n */\nexport const invalidateZOrder = (container: Gtk.Widget): void => {\n // The child list too: a commit is the one thing that can change it, and the\n // allocate the commit queues puts a fresh one back before the next paint.\n childOrders.delete(container)\n if (!paintOrders.delete(container)) {\n return\n }\n container.queueDraw()\n if (zOrderedParents.has(container)) {\n // Recomputed now rather than at the next snapshot, for the same reason\n // setZIndex does it: a container that just lost its last raised child\n // (the commit that unmounted it) would otherwise never be asked again —\n // the fast path stops calling paintOrderFor once nothing is raised — and\n // would keep its paint-only leaves untargetable forever.\n paintOrderFor(container)\n }\n}\n\n/**\n * RN's `zIndex` for one child. `0` (the default, and `undefined`) clears it.\n *\n * RN applies `zIndex` unconditionally — unlike CSS, which ignores `z-index`\n * on a `position: static` box. Nothing here looks at `position` either.\n */\nexport const setZIndex = (widget: Gtk.Widget, value: number): void => {\n const previous = zIndexes.get(widget) ?? 0\n if (previous === value) {\n return\n }\n if (value === 0) {\n zIndexes.delete(widget)\n raisedCount -= 1\n } else {\n zIndexes.set(widget, value)\n if (previous === 0) {\n raisedCount += 1\n }\n }\n const parent = widget.getParent()\n if (parent === null) {\n return\n }\n paintOrders.delete(parent)\n // Unconditional, unlike invalidateZOrder's: the container may never have\n // had a cache to drop and its paint still just changed.\n parent.queueDraw()\n if (value === 0) {\n // Recomputed eagerly on the way DOWN, never lazily: once nothing is\n // raised the fast path stops calling paintOrderFor at all, so a container\n // that lost its last raised child would never get the chance to undo what\n // being raised did to it (paint order, leaf targeting).\n paintOrderFor(parent)\n }\n}\n\n/** The container's children, from the allocate pass if it has run. */\nconst childrenOf = (container: Gtk.Widget): Gtk.Widget[] => {\n const cached = childOrders.get(container)\n if (cached !== undefined) {\n return cached\n }\n const children: Gtk.Widget[] = []\n for (\n let child = container.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n children.push(child)\n }\n return children\n}\n\nconst paintOrderFor = (container: Gtk.Widget): Gtk.Widget[] | null => {\n if (paintOrders.has(container)) {\n return paintOrders.get(container) ?? null\n }\n const children = childrenOf(container)\n let raised = false\n for (const child of children) {\n if (zIndexes.has(child)) {\n raised = true\n break\n }\n }\n let order: Gtk.Widget[] | null = null\n if (raised) {\n zOrderedParents.add(container)\n // Once per recompute, not per frame, and only for a container that\n // actually has something raised: the walk is what catches a `Text` that\n // mounted into an already-raised container since the last one.\n applyLeafTargeting(container, true)\n // Stable by construction. RN keeps document order among equal zIndexes,\n // and an unstable sort would let equal siblings swap between frames —\n // flicker that is miserable to attribute. `Array.prototype.sort` has been\n // required to be stable since ES2019; the index tiebreak makes that\n // independent of the engine rather than assumed of it.\n order = children\n .map((widget, index) => ({\n widget,\n index,\n z: zIndexes.get(widget) ?? 0,\n }))\n .sort((a, b) => a.z - b.z || a.index - b.index)\n .map((entry) => entry.widget)\n } else if (zOrderedParents.delete(container)) {\n applyLeafTargeting(container, false)\n }\n paintOrders.set(container, order)\n return order\n}\n\n/**\n * Whether a higher-painting sibling of this widget — or of any of its\n * ancestors — would take the pick at this point.\n *\n * `pick()` on the sibling rather than a bounds test, because \"would GTK have\n * answered inside that subtree\" IS the question, and it comes with the rest of\n * RN's rules for free: a raised view with `pointerEvents: \"none\"` is not\n * targetable, so it does not occlude either.\n *\n * The recursion terminates because it only ever asks about siblings STRICTLY\n * higher in the same container's paint order.\n */\nconst isOccluded = (widget: Gtk.Widget, x: number, y: number): boolean => {\n let child = widget\n let parent = child.getParent()\n while (parent !== null) {\n if (zOrderedParents.has(parent)) {\n const order = paintOrderFor(parent)\n if (order !== null) {\n const index = order.indexOf(child)\n for (let above = index + 1; above < order.length; above += 1) {\n const sibling = order[above]!\n const [ok, point] = widget.computePoint(\n sibling,\n new Graphene.Point({ x, y }),\n )\n if (\n ok &&\n sibling.pick(point.x, point.y, Gtk.PickFlags.DEFAULT) !== null\n ) {\n return true\n }\n }\n }\n }\n child = parent\n parent = child.getParent()\n }\n return false\n}\n\ntype ViewBoxComponent = ReturnType<typeof createElementComponent>\n\nlet component: ViewBoxComponent | null = null\n\nexport const getViewBoxComponent = (): ViewBoxComponent => {\n if (component) {\n return component\n }\n\n class RnGtkxViewBox extends Gtk.Box {\n override contains(x: number, y: number): boolean {\n if (passthrough.has(this)) {\n return false\n }\n // GTK translates the point into this widget's coordinates before\n // asking, and does not pre-check the bounds, so a negative x or a y\n // past the height is a legitimate question — which is what lets\n // hitSlop answer yes to it.\n const slop = hitSlops.get(this)\n const inside =\n slop === undefined\n ? // The default widget behavior: inside the widget's own bounds.\n x >= 0 && y >= 0 && x < this.getWidth() && y < this.getHeight()\n : x >= -slop.left &&\n y >= -slop.top &&\n x < this.getWidth() + slop.right &&\n y < this.getHeight() + slop.bottom\n if (!inside || raisedCount === 0) {\n return inside\n }\n // Something in this process is raised: this widget only answers where\n // nothing painted above it would have.\n return !isOccluded(this, x, y)\n }\n\n // GTK's own container snapshot is `gtk_widget_real_snapshot`, which walks\n // first-to-last calling gtk_widget_snapshot_child — the loop below with\n // nothing in front of it. There is no way to chain up to it from here\n // (gtkx installs the vfunc but exposes no parent-class call, and\n // gtk_widget_snapshot() is not public C API either), so the fast path\n // reproduces it rather than delegating to it.\n //\n // No `override`: `snapshot` is a real vfunc in gtkx's codegen but is\n // missing from the shipped gtk.d.ts (same as in svg-node.ts).\n snapshot(snapshot: Gtk.Snapshot): void {\n if (raisedCount !== 0) {\n const order = paintOrderFor(this)\n if (order !== null) {\n for (const child of order) {\n this.snapshotChild(child, snapshot)\n }\n return\n }\n }\n for (const child of childrenOf(this)) {\n this.snapshotChild(child, snapshot)\n }\n }\n }\n // Explicit typeName: bundlers minify class names.\n registerClass(RnGtkxViewBox, { typeName: \"RnGtkxViewBox\" })\n component = createElementComponent(\"RnGtkxViewBox\")\n return component\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import { type Widget } from "@gtkx/gi/gtk";
2
+ export type WidgetCss = {
3
+ /**
4
+ * Replaces the widget's imperative declarations. `body` is a GTK CSS
5
+ * declaration list without a selector or braces (`background-color: rgb(1,
6
+ * 2, 3);`); an empty string removes everything this provider contributes.
7
+ */
8
+ set(body: string): void;
9
+ /** Detaches the provider. Safe to call more than once. */
10
+ dispose(): void;
11
+ };
12
+ /**
13
+ * Attaches a private CSS provider to `widget`. Writes are O(1) in the size of
14
+ * the widget tree and do not touch the shared stylesheet, so nothing about
15
+ * the static style path — including its memoisation — changes.
16
+ */
17
+ export declare const createWidgetCss: (widget: Widget) => WidgetCss;
@@ -0,0 +1,72 @@
1
+ // One GtkCssProvider per animated widget: the imperative escape hatch that
2
+ // lets a colour reach a MOUNTED widget without a React render.
3
+ //
4
+ // The ordinary path is a memoised class in one global stylesheet
5
+ // (../../style/registry.ts + @gtkx/css), and it is the wrong shape for an
6
+ // animation by construction — its cache key IS the CSS text, so a value that
7
+ // changes every frame mints a class per frame, appends a rule to a document
8
+ // that is never pruned, and makes GTK re-parse the whole thing. Measured on
9
+ // the VM: 0.8 ms for the first frame, 6.8 ms by frame 600, still climbing,
10
+ // plus 600 permanently-live classes for one second of animation.
11
+ //
12
+ // WHY THE WIDGET'S OWN STYLE CONTEXT AND NOT THE DISPLAY. Both were measured
13
+ // (docs/research/animated-colors.md). `Gtk.StyleContext.addProviderForDisplay`
14
+ // is the non-deprecated API, but a display-level provider invalidates every
15
+ // CSS node on the display each time it is reloaded, so the cost of one
16
+ // animated colour is proportional to how many widgets are on screen: +527 µs
17
+ // per frame in a 60-widget tree, +1634 µs at 300. A provider on the widget's
18
+ // own style context invalidates that widget alone — +79 µs at 60 widgets,
19
+ // +24 µs at 300, i.e. flat, and inside the noise of the paint it triggers
20
+ // anyway.
21
+ //
22
+ // `gtk_widget_get_style_context()` and `gtk_style_context_add_provider()` are
23
+ // deprecated (GTK 4.10), and GTK's own migration note points at exactly the
24
+ // display-wide replacement measured above. This file is where that trade is
25
+ // made and where it will be re-made: if GTK5 removes the per-widget cascade,
26
+ // the fallback is a display-wide provider plus a unique class per widget, at
27
+ // the measured cost — the surface here does not change.
28
+ //
29
+ // The selector is `*`, not a class. Verified against GTK 4.22: a provider on
30
+ // a widget's style context matches THAT widget's CSS node and not its
31
+ // children (a `min-width` written through it moved the widget and left its
32
+ // child alone), and unlike a class it cannot be destroyed by React writing
33
+ // the `cssClasses` prop — which it would be, since gtkx sets the whole list.
34
+ import { CssProvider, STYLE_PROVIDER_PRIORITY_APPLICATION, } from "@gtkx/gi/gtk";
35
+ // One above APPLICATION, which is where both @gtkx/css's stylesheet and any
36
+ // app-level CSS land. A driven value has to win over the static class it is
37
+ // replacing for the duration of the animation; it stays below USER (800) so
38
+ // a user stylesheet still overrides everything, as GTK intends.
39
+ const PRIORITY = STYLE_PROVIDER_PRIORITY_APPLICATION + 1;
40
+ /**
41
+ * Attaches a private CSS provider to `widget`. Writes are O(1) in the size of
42
+ * the widget tree and do not touch the shared stylesheet, so nothing about
43
+ * the static style path — including its memoisation — changes.
44
+ */
45
+ export const createWidgetCss = (widget) => {
46
+ const provider = new CssProvider();
47
+ // Held rather than re-fetched: getStyleContext() is a call into GTK, and
48
+ // removeProvider must be given the same context addProvider was.
49
+ const context = widget.getStyleContext();
50
+ context.addProvider(provider, PRIORITY);
51
+ let current = null;
52
+ let disposed = false;
53
+ return {
54
+ set(body) {
55
+ if (disposed || body === current) {
56
+ return;
57
+ }
58
+ current = body;
59
+ // An empty rule is still a rule GTK has to parse and match, so an
60
+ // empty body loads an empty document instead.
61
+ provider.loadFromString(body === "" ? "" : `* { ${body} }`);
62
+ },
63
+ dispose() {
64
+ if (disposed) {
65
+ return;
66
+ }
67
+ disposed = true;
68
+ context.removeProvider(provider);
69
+ },
70
+ };
71
+ };
72
+ //# sourceMappingURL=widget-css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget-css.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/widget-css.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+DAA+D;AAC/D,EAAE;AACF,iEAAiE;AACjE,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,iEAAiE;AACjE,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,4EAA4E;AAC5E,uEAAuE;AACvE,6EAA6E;AAC7E,6EAA6E;AAC7E,0EAA0E;AAC1E,0EAA0E;AAC1E,UAAU;AACV,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,wDAAwD;AACxD,EAAE;AACF,6EAA6E;AAC7E,sEAAsE;AACtE,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,OAAO,EACL,WAAW,EACX,mCAAmC,GAGpC,MAAM,cAAc,CAAA;AAarB,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAC5E,gEAAgE;AAChE,MAAM,QAAQ,GAAG,mCAAmC,GAAG,CAAC,CAAA;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAc,EAAa,EAAE;IAC3D,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAA;IAClC,yEAAyE;IACzE,iEAAiE;IACjE,MAAM,OAAO,GAAiB,MAAM,CAAC,eAAe,EAAE,CAAA;IACtD,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAEvC,IAAI,OAAO,GAAkB,IAAI,CAAA;IACjC,IAAI,QAAQ,GAAG,KAAK,CAAA;IAEpB,OAAO;QACL,GAAG,CAAC,IAAI;YACN,IAAI,QAAQ,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;gBACjC,OAAM;YACR,CAAC;YACD,OAAO,GAAG,IAAI,CAAA;YACd,kEAAkE;YAClE,8CAA8C;YAC9C,QAAQ,CAAC,cAAc,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,CAAA;QAC7D,CAAC;QACD,OAAO;YACL,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAM;YACR,CAAC;YACD,QAAQ,GAAG,IAAI,CAAA;YACf,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;QAClC,CAAC;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["// One GtkCssProvider per animated widget: the imperative escape hatch that\n// lets a colour reach a MOUNTED widget without a React render.\n//\n// The ordinary path is a memoised class in one global stylesheet\n// (../../style/registry.ts + @gtkx/css), and it is the wrong shape for an\n// animation by construction — its cache key IS the CSS text, so a value that\n// changes every frame mints a class per frame, appends a rule to a document\n// that is never pruned, and makes GTK re-parse the whole thing. Measured on\n// the VM: 0.8 ms for the first frame, 6.8 ms by frame 600, still climbing,\n// plus 600 permanently-live classes for one second of animation.\n//\n// WHY THE WIDGET'S OWN STYLE CONTEXT AND NOT THE DISPLAY. Both were measured\n// (docs/research/animated-colors.md). `Gtk.StyleContext.addProviderForDisplay`\n// is the non-deprecated API, but a display-level provider invalidates every\n// CSS node on the display each time it is reloaded, so the cost of one\n// animated colour is proportional to how many widgets are on screen: +527 µs\n// per frame in a 60-widget tree, +1634 µs at 300. A provider on the widget's\n// own style context invalidates that widget alone — +79 µs at 60 widgets,\n// +24 µs at 300, i.e. flat, and inside the noise of the paint it triggers\n// anyway.\n//\n// `gtk_widget_get_style_context()` and `gtk_style_context_add_provider()` are\n// deprecated (GTK 4.10), and GTK's own migration note points at exactly the\n// display-wide replacement measured above. This file is where that trade is\n// made and where it will be re-made: if GTK5 removes the per-widget cascade,\n// the fallback is a display-wide provider plus a unique class per widget, at\n// the measured cost — the surface here does not change.\n//\n// The selector is `*`, not a class. Verified against GTK 4.22: a provider on\n// a widget's style context matches THAT widget's CSS node and not its\n// children (a `min-width` written through it moved the widget and left its\n// child alone), and unlike a class it cannot be destroyed by React writing\n// the `cssClasses` prop — which it would be, since gtkx sets the whole list.\nimport {\n CssProvider,\n STYLE_PROVIDER_PRIORITY_APPLICATION,\n StyleContext,\n type Widget,\n} from \"@gtkx/gi/gtk\"\n\nexport type WidgetCss = {\n /**\n * Replaces the widget's imperative declarations. `body` is a GTK CSS\n * declaration list without a selector or braces (`background-color: rgb(1,\n * 2, 3);`); an empty string removes everything this provider contributes.\n */\n set(body: string): void\n /** Detaches the provider. Safe to call more than once. */\n dispose(): void\n}\n\n// One above APPLICATION, which is where both @gtkx/css's stylesheet and any\n// app-level CSS land. A driven value has to win over the static class it is\n// replacing for the duration of the animation; it stays below USER (800) so\n// a user stylesheet still overrides everything, as GTK intends.\nconst PRIORITY = STYLE_PROVIDER_PRIORITY_APPLICATION + 1\n\n/**\n * Attaches a private CSS provider to `widget`. Writes are O(1) in the size of\n * the widget tree and do not touch the shared stylesheet, so nothing about\n * the static style path — including its memoisation — changes.\n */\nexport const createWidgetCss = (widget: Widget): WidgetCss => {\n const provider = new CssProvider()\n // Held rather than re-fetched: getStyleContext() is a call into GTK, and\n // removeProvider must be given the same context addProvider was.\n const context: StyleContext = widget.getStyleContext()\n context.addProvider(provider, PRIORITY)\n\n let current: string | null = null\n let disposed = false\n\n return {\n set(body) {\n if (disposed || body === current) {\n return\n }\n current = body\n // An empty rule is still a rule GTK has to parse and match, so an\n // empty body loads an empty document instead.\n provider.loadFromString(body === \"\" ? \"\" : `* { ${body} }`)\n },\n dispose() {\n if (disposed) {\n return\n }\n disposed = true\n context.removeProvider(provider)\n },\n }\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { ActivityIndicator, Animated, AppRegistry, Easing, FlatList, Image, Modal, IntrinsicRoot, PanResponder, NestedRoot, Pressable, Root, SafeAreaView, ScrollView, SectionList, StatusBar, Switch, Text, TextInput, TouchableOpacity, View, type ActivityIndicatorProps, type FlatListProps, type GestureResponderEvent, type ImageProps, type ImageSource, type LayoutEvent, type ListRenderItemInfo, type MeasureHandle, type MeasureInWindowOnSuccessCallback, type MeasureLayoutOnSuccessCallback, type MeasureOnSuccessCallback, type ModalProps, type NativeTouch, type PanResponderCallbacks, type PanResponderGestureState, type PanResponderInstance, type PressableProps, type PressableStateCallbackType, type IntrinsicRootProps, type NestedRootProps, type PressEvent, type ResponderProps, type RootProps, type RunApplicationParams, type ScrollEvent, type ScrollViewHandle, type ScrollViewProps, type SectionListProps, type SwitchProps, type TextInputProps, type TextProps, type TouchHistory, type TouchRecord, type TouchableOpacityProps, type ViewabilityConfig, type ViewHandle, type ViewProps, type ViewToken, } from "./components/index";
1
+ export { ActivityIndicator, Animated, AppRegistry, Easing, findNodeHandle, FlatList, Image, Modal, IntrinsicRoot, PanResponder, NestedRoot, Pressable, Root, SafeAreaView, ScrollView, SectionList, StatusBar, Switch, Text, TextInput, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, View, VirtualizedList, type ActivityIndicatorProps, type FlatListProps, type GestureResponderEvent, type ImageHandle, type ImageProps, type ImageSource, type LayoutEvent, type ListRenderItemInfo, type MeasureHandle, type MeasureInWindowOnSuccessCallback, type MeasureLayoutOnSuccessCallback, type MeasureOnSuccessCallback, type ItemLayout, type ModalProps, type NativeTouch, type NodeHandle, type PanResponderCallbacks, type PanResponderGestureState, type PanResponderInstance, type PressableProps, type PressableStateCallbackType, type IntrinsicRootProps, type NestedRootProps, type PressEvent, type ResponderProps, type RootProps, type RunApplicationParams, type ScrollEvent, type ScrollViewHandle, type ScrollViewProps, type SectionListProps, type SwitchProps, type TextHandle, type TextInputProps, type TextProps, type TouchHistory, type TouchRecord, type TouchableHighlightProps, type TouchableOpacityProps, type TouchableWithoutFeedbackProps, type ViewabilityConfig, type ViewHandle, type ViewProps, type ViewToken, } from "./components/index";
2
2
  export type { FlatListHandle } from "./components/flat-list";
3
- export { Alert, Appearance, AppState, BackHandler, DevSettings, Dimensions, I18nManager, InteractionManager, Linking, Platform, useColorScheme, useWindowDimensions, type AlertButton, type AlertButtonStyle, type AlertOptions, type AppearancePreferences, type AppStateEvent, type AppStateStatus, type ColorSchemeName, type DimensionKey, type DimensionsPayload, type InteractionPromise, type PlatformSelectSpec, type ScaledSize, } from "./apis/index";
3
+ export { Alert, Appearance, AppState, BackHandler, DevSettings, Dimensions, I18nManager, InteractionManager, Keyboard, Linking, LogBox, Platform, useColorScheme, useWindowDimensions, type AlertButton, type AlertButtonStyle, type AlertOptions, type AppearancePreferences, type AppStateEvent, type AppStateStatus, type ColorSchemeName, type DimensionKey, type DimensionsPayload, type InteractionPromise, type KeyboardEvent, type KeyboardEventName, type LogBoxIgnorePattern, type PlatformOSType, type PlatformSelectSpec, type ScaledSize, } from "./apis/index";
4
4
  export { PlatformColor, StyleSheet } from "./style/index";
5
- export type { BoxShadowValue, DimensionValue, FlatStyle, LayoutStyle, PointerEventsValue, StyleProp, TextDecorationLine, TransformPart, VisualStyle, } from "./contracts";
5
+ export type { BoxShadowValue, DimensionValue, FlatStyle, ImageStyle, LayoutStyle, PointerEventsValue, StyleProp, TextDecorationLine, TextStyle, TransformPart, ViewStyle, VisualStyle, } from "./contracts";
6
6
  export declare const version = "0.1.0";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Public surface of react-native-gtkx, mirroring the `react-native` module.
2
2
  // Components · APIs · StyleSheet, with the Yoga layout engine underneath.
3
- export { ActivityIndicator, Animated, AppRegistry, Easing, FlatList, Image, Modal, IntrinsicRoot, PanResponder, NestedRoot, Pressable, Root, SafeAreaView, ScrollView, SectionList, StatusBar, Switch, Text, TextInput, TouchableOpacity, View, } from "./components/index";
4
- export { Alert, Appearance, AppState, BackHandler, DevSettings, Dimensions, I18nManager, InteractionManager, Linking, Platform, useColorScheme, useWindowDimensions, } from "./apis/index";
3
+ export { ActivityIndicator, Animated, AppRegistry, Easing, findNodeHandle, FlatList, Image, Modal, IntrinsicRoot, PanResponder, NestedRoot, Pressable, Root, SafeAreaView, ScrollView, SectionList, StatusBar, Switch, Text, TextInput, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, View, VirtualizedList, } from "./components/index";
4
+ export { Alert, Appearance, AppState, BackHandler, DevSettings, Dimensions, I18nManager, InteractionManager, Keyboard, Linking, LogBox, Platform, useColorScheme, useWindowDimensions, } from "./apis/index";
5
5
  export { PlatformColor, StyleSheet } from "./style/index";
6
6
  export const version = "0.1.0";
7
7
  //# sourceMappingURL=index.js.map