@gtkx/react 0.18.0 → 0.18.2

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 (401) hide show
  1. package/dist/errors.d.ts +1 -0
  2. package/dist/errors.d.ts.map +1 -0
  3. package/dist/errors.js +1 -0
  4. package/dist/errors.js.map +1 -0
  5. package/dist/factory.d.ts +1 -0
  6. package/dist/factory.d.ts.map +1 -0
  7. package/dist/factory.js +1 -0
  8. package/dist/factory.js.map +1 -0
  9. package/dist/fiber-root.d.ts +1 -0
  10. package/dist/fiber-root.d.ts.map +1 -0
  11. package/dist/fiber-root.js +1 -0
  12. package/dist/fiber-root.js.map +1 -0
  13. package/dist/generated/internal.d.ts +1 -0
  14. package/dist/generated/internal.d.ts.map +1 -0
  15. package/dist/generated/internal.js +1 -0
  16. package/dist/generated/internal.js.map +1 -0
  17. package/dist/generated/jsx.d.ts +1 -0
  18. package/dist/generated/jsx.d.ts.map +1 -0
  19. package/dist/generated/jsx.js +1 -0
  20. package/dist/generated/jsx.js.map +1 -0
  21. package/dist/generated/registry.d.ts +1 -0
  22. package/dist/generated/registry.d.ts.map +1 -0
  23. package/dist/generated/registry.js +1 -0
  24. package/dist/generated/registry.js.map +1 -0
  25. package/dist/host-config.d.ts +1 -0
  26. package/dist/host-config.d.ts.map +1 -0
  27. package/dist/host-config.js +1 -0
  28. package/dist/host-config.js.map +1 -0
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +1 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/jsx.d.ts +1 -0
  34. package/dist/jsx.d.ts.map +1 -0
  35. package/dist/jsx.js +1 -0
  36. package/dist/jsx.js.map +1 -0
  37. package/dist/metadata.d.ts +1 -0
  38. package/dist/metadata.d.ts.map +1 -0
  39. package/dist/metadata.js +1 -0
  40. package/dist/metadata.js.map +1 -0
  41. package/dist/node.d.ts +1 -0
  42. package/dist/node.d.ts.map +1 -0
  43. package/dist/node.js +1 -0
  44. package/dist/node.js.map +1 -0
  45. package/dist/nodes/adjustable.d.ts +1 -0
  46. package/dist/nodes/adjustable.d.ts.map +1 -0
  47. package/dist/nodes/adjustable.js +1 -0
  48. package/dist/nodes/adjustable.js.map +1 -0
  49. package/dist/nodes/alert-dialog-response.d.ts +1 -0
  50. package/dist/nodes/alert-dialog-response.d.ts.map +1 -0
  51. package/dist/nodes/alert-dialog-response.js +1 -0
  52. package/dist/nodes/alert-dialog-response.js.map +1 -0
  53. package/dist/nodes/animation.d.ts +1 -0
  54. package/dist/nodes/animation.d.ts.map +1 -0
  55. package/dist/nodes/animation.js +1 -0
  56. package/dist/nodes/animation.js.map +1 -0
  57. package/dist/nodes/application.d.ts +1 -0
  58. package/dist/nodes/application.d.ts.map +1 -0
  59. package/dist/nodes/application.js +1 -0
  60. package/dist/nodes/application.js.map +1 -0
  61. package/dist/nodes/calendar.d.ts +1 -0
  62. package/dist/nodes/calendar.d.ts.map +1 -0
  63. package/dist/nodes/calendar.js +1 -0
  64. package/dist/nodes/calendar.js.map +1 -0
  65. package/dist/nodes/color-dialog-button.d.ts +1 -0
  66. package/dist/nodes/color-dialog-button.d.ts.map +1 -0
  67. package/dist/nodes/color-dialog-button.js +1 -0
  68. package/dist/nodes/color-dialog-button.js.map +1 -0
  69. package/dist/nodes/column-view-column.d.ts +1 -0
  70. package/dist/nodes/column-view-column.d.ts.map +1 -0
  71. package/dist/nodes/column-view-column.js +1 -0
  72. package/dist/nodes/column-view-column.js.map +1 -0
  73. package/dist/nodes/column-view.d.ts +1 -0
  74. package/dist/nodes/column-view.d.ts.map +1 -0
  75. package/dist/nodes/column-view.js +1 -0
  76. package/dist/nodes/column-view.js.map +1 -0
  77. package/dist/nodes/container-slot.d.ts +1 -0
  78. package/dist/nodes/container-slot.d.ts.map +1 -0
  79. package/dist/nodes/container-slot.js +1 -0
  80. package/dist/nodes/container-slot.js.map +1 -0
  81. package/dist/nodes/dialog.d.ts +1 -0
  82. package/dist/nodes/dialog.d.ts.map +1 -0
  83. package/dist/nodes/dialog.js +1 -0
  84. package/dist/nodes/dialog.js.map +1 -0
  85. package/dist/nodes/drawing-area.d.ts +1 -0
  86. package/dist/nodes/drawing-area.d.ts.map +1 -0
  87. package/dist/nodes/drawing-area.js +1 -0
  88. package/dist/nodes/drawing-area.js.map +1 -0
  89. package/dist/nodes/drop-down.d.ts +1 -0
  90. package/dist/nodes/drop-down.d.ts.map +1 -0
  91. package/dist/nodes/drop-down.js +1 -0
  92. package/dist/nodes/drop-down.js.map +1 -0
  93. package/dist/nodes/event-controller.d.ts +1 -0
  94. package/dist/nodes/event-controller.d.ts.map +1 -0
  95. package/dist/nodes/event-controller.js +1 -0
  96. package/dist/nodes/event-controller.js.map +1 -0
  97. package/dist/nodes/fixed-child.d.ts +1 -0
  98. package/dist/nodes/fixed-child.d.ts.map +1 -0
  99. package/dist/nodes/fixed-child.js +1 -0
  100. package/dist/nodes/fixed-child.js.map +1 -0
  101. package/dist/nodes/font-dialog-button.d.ts +1 -0
  102. package/dist/nodes/font-dialog-button.d.ts.map +1 -0
  103. package/dist/nodes/font-dialog-button.js +1 -0
  104. package/dist/nodes/font-dialog-button.js.map +1 -0
  105. package/dist/nodes/grid-child.d.ts +1 -0
  106. package/dist/nodes/grid-child.d.ts.map +1 -0
  107. package/dist/nodes/grid-child.js +1 -0
  108. package/dist/nodes/grid-child.js.map +1 -0
  109. package/dist/nodes/grid-view.d.ts +1 -0
  110. package/dist/nodes/grid-view.d.ts.map +1 -0
  111. package/dist/nodes/grid-view.js +1 -0
  112. package/dist/nodes/grid-view.js.map +1 -0
  113. package/dist/nodes/internal/base-item-renderer.d.ts +1 -0
  114. package/dist/nodes/internal/base-item-renderer.d.ts.map +1 -0
  115. package/dist/nodes/internal/base-item-renderer.js +1 -0
  116. package/dist/nodes/internal/base-item-renderer.js.map +1 -0
  117. package/dist/nodes/internal/grid-item-renderer.d.ts +1 -0
  118. package/dist/nodes/internal/grid-item-renderer.d.ts.map +1 -0
  119. package/dist/nodes/internal/grid-item-renderer.js +1 -0
  120. package/dist/nodes/internal/grid-item-renderer.js.map +1 -0
  121. package/dist/nodes/internal/list-item-renderer.d.ts +1 -0
  122. package/dist/nodes/internal/list-item-renderer.d.ts.map +1 -0
  123. package/dist/nodes/internal/list-item-renderer.js +1 -0
  124. package/dist/nodes/internal/list-item-renderer.js.map +1 -0
  125. package/dist/nodes/internal/list-store.d.ts +1 -0
  126. package/dist/nodes/internal/list-store.d.ts.map +1 -0
  127. package/dist/nodes/internal/list-store.js +1 -0
  128. package/dist/nodes/internal/list-store.js.map +1 -0
  129. package/dist/nodes/internal/predicates.d.ts +1 -0
  130. package/dist/nodes/internal/predicates.d.ts.map +1 -0
  131. package/dist/nodes/internal/predicates.js +1 -0
  132. package/dist/nodes/internal/predicates.js.map +1 -0
  133. package/dist/nodes/internal/props.d.ts +1 -0
  134. package/dist/nodes/internal/props.d.ts.map +1 -0
  135. package/dist/nodes/internal/props.js +1 -0
  136. package/dist/nodes/internal/props.js.map +1 -0
  137. package/dist/nodes/internal/selection-model-controller.d.ts +1 -0
  138. package/dist/nodes/internal/selection-model-controller.d.ts.map +1 -0
  139. package/dist/nodes/internal/selection-model-controller.js +1 -0
  140. package/dist/nodes/internal/selection-model-controller.js.map +1 -0
  141. package/dist/nodes/internal/signal-store.d.ts +1 -0
  142. package/dist/nodes/internal/signal-store.d.ts.map +1 -0
  143. package/dist/nodes/internal/signal-store.js +1 -0
  144. package/dist/nodes/internal/signal-store.js.map +1 -0
  145. package/dist/nodes/internal/simple-list-store.d.ts +1 -0
  146. package/dist/nodes/internal/simple-list-store.d.ts.map +1 -0
  147. package/dist/nodes/internal/simple-list-store.js +1 -0
  148. package/dist/nodes/internal/simple-list-store.js.map +1 -0
  149. package/dist/nodes/internal/text-buffer-controller.d.ts +1 -0
  150. package/dist/nodes/internal/text-buffer-controller.d.ts.map +1 -0
  151. package/dist/nodes/internal/text-buffer-controller.js +1 -0
  152. package/dist/nodes/internal/text-buffer-controller.js.map +1 -0
  153. package/dist/nodes/internal/tree-store.d.ts +1 -0
  154. package/dist/nodes/internal/tree-store.d.ts.map +1 -0
  155. package/dist/nodes/internal/tree-store.js +1 -0
  156. package/dist/nodes/internal/tree-store.js.map +1 -0
  157. package/dist/nodes/internal/widget.d.ts +1 -0
  158. package/dist/nodes/internal/widget.d.ts.map +1 -0
  159. package/dist/nodes/internal/widget.js +1 -0
  160. package/dist/nodes/internal/widget.js.map +1 -0
  161. package/dist/nodes/level-bar.d.ts +1 -0
  162. package/dist/nodes/level-bar.d.ts.map +1 -0
  163. package/dist/nodes/level-bar.js +1 -0
  164. package/dist/nodes/level-bar.js.map +1 -0
  165. package/dist/nodes/list-item.d.ts +1 -0
  166. package/dist/nodes/list-item.d.ts.map +1 -0
  167. package/dist/nodes/list-item.js +1 -0
  168. package/dist/nodes/list-item.js.map +1 -0
  169. package/dist/nodes/list-view.d.ts +1 -0
  170. package/dist/nodes/list-view.d.ts.map +1 -0
  171. package/dist/nodes/list-view.js +1 -0
  172. package/dist/nodes/list-view.js.map +1 -0
  173. package/dist/nodes/menu.d.ts +1 -0
  174. package/dist/nodes/menu.d.ts.map +1 -0
  175. package/dist/nodes/menu.js +1 -0
  176. package/dist/nodes/menu.js.map +1 -0
  177. package/dist/nodes/models/grid.d.ts +1 -0
  178. package/dist/nodes/models/grid.d.ts.map +1 -0
  179. package/dist/nodes/models/grid.js +1 -0
  180. package/dist/nodes/models/grid.js.map +1 -0
  181. package/dist/nodes/models/list.d.ts +1 -0
  182. package/dist/nodes/models/list.d.ts.map +1 -0
  183. package/dist/nodes/models/list.js +1 -0
  184. package/dist/nodes/models/list.js.map +1 -0
  185. package/dist/nodes/models/menu.d.ts +1 -0
  186. package/dist/nodes/models/menu.d.ts.map +1 -0
  187. package/dist/nodes/models/menu.js +1 -0
  188. package/dist/nodes/models/menu.js.map +1 -0
  189. package/dist/nodes/navigation-page.d.ts +1 -0
  190. package/dist/nodes/navigation-page.d.ts.map +1 -0
  191. package/dist/nodes/navigation-page.js +1 -0
  192. package/dist/nodes/navigation-page.js.map +1 -0
  193. package/dist/nodes/navigation-view.d.ts +1 -0
  194. package/dist/nodes/navigation-view.d.ts.map +1 -0
  195. package/dist/nodes/navigation-view.js +1 -0
  196. package/dist/nodes/navigation-view.js.map +1 -0
  197. package/dist/nodes/notebook-page-tab.d.ts +1 -0
  198. package/dist/nodes/notebook-page-tab.d.ts.map +1 -0
  199. package/dist/nodes/notebook-page-tab.js +1 -0
  200. package/dist/nodes/notebook-page-tab.js.map +1 -0
  201. package/dist/nodes/notebook-page.d.ts +1 -0
  202. package/dist/nodes/notebook-page.d.ts.map +1 -0
  203. package/dist/nodes/notebook-page.js +1 -0
  204. package/dist/nodes/notebook-page.js.map +1 -0
  205. package/dist/nodes/notebook.d.ts +1 -0
  206. package/dist/nodes/notebook.d.ts.map +1 -0
  207. package/dist/nodes/notebook.js +1 -0
  208. package/dist/nodes/notebook.js.map +1 -0
  209. package/dist/nodes/overlay-child.d.ts +1 -0
  210. package/dist/nodes/overlay-child.d.ts.map +1 -0
  211. package/dist/nodes/overlay-child.js +1 -0
  212. package/dist/nodes/overlay-child.js.map +1 -0
  213. package/dist/nodes/popover-menu.d.ts +1 -0
  214. package/dist/nodes/popover-menu.d.ts.map +1 -0
  215. package/dist/nodes/popover-menu.js +1 -0
  216. package/dist/nodes/popover-menu.js.map +1 -0
  217. package/dist/nodes/scale.d.ts +1 -0
  218. package/dist/nodes/scale.d.ts.map +1 -0
  219. package/dist/nodes/scale.js +1 -0
  220. package/dist/nodes/scale.js.map +1 -0
  221. package/dist/nodes/scrolled-window.d.ts +1 -0
  222. package/dist/nodes/scrolled-window.d.ts.map +1 -0
  223. package/dist/nodes/scrolled-window.js +1 -0
  224. package/dist/nodes/scrolled-window.js.map +1 -0
  225. package/dist/nodes/search-bar.d.ts +1 -0
  226. package/dist/nodes/search-bar.d.ts.map +1 -0
  227. package/dist/nodes/search-bar.js +1 -0
  228. package/dist/nodes/search-bar.js.map +1 -0
  229. package/dist/nodes/shortcut-controller.d.ts +1 -0
  230. package/dist/nodes/shortcut-controller.d.ts.map +1 -0
  231. package/dist/nodes/shortcut-controller.js +1 -0
  232. package/dist/nodes/shortcut-controller.js.map +1 -0
  233. package/dist/nodes/shortcut.d.ts +1 -0
  234. package/dist/nodes/shortcut.d.ts.map +1 -0
  235. package/dist/nodes/shortcut.js +1 -0
  236. package/dist/nodes/shortcut.js.map +1 -0
  237. package/dist/nodes/slot.d.ts +1 -0
  238. package/dist/nodes/slot.d.ts.map +1 -0
  239. package/dist/nodes/slot.js +1 -0
  240. package/dist/nodes/slot.js.map +1 -0
  241. package/dist/nodes/source-view.d.ts +1 -0
  242. package/dist/nodes/source-view.d.ts.map +1 -0
  243. package/dist/nodes/source-view.js +1 -0
  244. package/dist/nodes/source-view.js.map +1 -0
  245. package/dist/nodes/stack-page.d.ts +1 -0
  246. package/dist/nodes/stack-page.d.ts.map +1 -0
  247. package/dist/nodes/stack-page.js +1 -0
  248. package/dist/nodes/stack-page.js.map +1 -0
  249. package/dist/nodes/stack.d.ts +1 -0
  250. package/dist/nodes/stack.d.ts.map +1 -0
  251. package/dist/nodes/stack.js +1 -0
  252. package/dist/nodes/stack.js.map +1 -0
  253. package/dist/nodes/text-anchor.d.ts +1 -0
  254. package/dist/nodes/text-anchor.d.ts.map +1 -0
  255. package/dist/nodes/text-anchor.js +1 -0
  256. package/dist/nodes/text-anchor.js.map +1 -0
  257. package/dist/nodes/text-content.d.ts +1 -0
  258. package/dist/nodes/text-content.d.ts.map +1 -0
  259. package/dist/nodes/text-content.js +1 -0
  260. package/dist/nodes/text-content.js.map +1 -0
  261. package/dist/nodes/text-paintable.d.ts +1 -0
  262. package/dist/nodes/text-paintable.d.ts.map +1 -0
  263. package/dist/nodes/text-paintable.js +1 -0
  264. package/dist/nodes/text-paintable.js.map +1 -0
  265. package/dist/nodes/text-segment.d.ts +1 -0
  266. package/dist/nodes/text-segment.d.ts.map +1 -0
  267. package/dist/nodes/text-segment.js +1 -0
  268. package/dist/nodes/text-segment.js.map +1 -0
  269. package/dist/nodes/text-tag.d.ts +1 -0
  270. package/dist/nodes/text-tag.d.ts.map +1 -0
  271. package/dist/nodes/text-tag.js +1 -0
  272. package/dist/nodes/text-tag.js.map +1 -0
  273. package/dist/nodes/text-view.d.ts +1 -0
  274. package/dist/nodes/text-view.d.ts.map +1 -0
  275. package/dist/nodes/text-view.js +1 -0
  276. package/dist/nodes/text-view.js.map +1 -0
  277. package/dist/nodes/toggle-group.d.ts +1 -0
  278. package/dist/nodes/toggle-group.d.ts.map +1 -0
  279. package/dist/nodes/toggle-group.js +1 -0
  280. package/dist/nodes/toggle-group.js.map +1 -0
  281. package/dist/nodes/toggle.d.ts +1 -0
  282. package/dist/nodes/toggle.d.ts.map +1 -0
  283. package/dist/nodes/toggle.js +1 -0
  284. package/dist/nodes/toggle.js.map +1 -0
  285. package/dist/nodes/virtual.d.ts +1 -0
  286. package/dist/nodes/virtual.d.ts.map +1 -0
  287. package/dist/nodes/virtual.js +1 -0
  288. package/dist/nodes/virtual.js.map +1 -0
  289. package/dist/nodes/web-view.d.ts +1 -0
  290. package/dist/nodes/web-view.d.ts.map +1 -0
  291. package/dist/nodes/web-view.js +1 -0
  292. package/dist/nodes/web-view.js.map +1 -0
  293. package/dist/nodes/widget.d.ts +1 -0
  294. package/dist/nodes/widget.d.ts.map +1 -0
  295. package/dist/nodes/widget.js +1 -0
  296. package/dist/nodes/widget.js.map +1 -0
  297. package/dist/nodes/window.d.ts +1 -0
  298. package/dist/nodes/window.d.ts.map +1 -0
  299. package/dist/nodes/window.js +1 -0
  300. package/dist/nodes/window.js.map +1 -0
  301. package/dist/portal.d.ts +1 -0
  302. package/dist/portal.d.ts.map +1 -0
  303. package/dist/portal.js +1 -0
  304. package/dist/portal.js.map +1 -0
  305. package/dist/reconciler.d.ts +1 -0
  306. package/dist/reconciler.d.ts.map +1 -0
  307. package/dist/reconciler.js +1 -0
  308. package/dist/reconciler.js.map +1 -0
  309. package/dist/registry.d.ts +1 -0
  310. package/dist/registry.d.ts.map +1 -0
  311. package/dist/registry.js +1 -0
  312. package/dist/registry.js.map +1 -0
  313. package/dist/render.d.ts +1 -0
  314. package/dist/render.d.ts.map +1 -0
  315. package/dist/render.js +1 -0
  316. package/dist/render.js.map +1 -0
  317. package/dist/types.d.ts +1 -0
  318. package/dist/types.d.ts.map +1 -0
  319. package/dist/types.js +1 -0
  320. package/dist/types.js.map +1 -0
  321. package/package.json +6 -4
  322. package/src/errors.ts +52 -0
  323. package/src/factory.ts +62 -0
  324. package/src/fiber-root.ts +20 -0
  325. package/src/generated/internal.ts +2134 -0
  326. package/src/generated/jsx.ts +20068 -0
  327. package/src/generated/registry.ts +16 -0
  328. package/src/host-config.ts +186 -0
  329. package/src/index.ts +11 -0
  330. package/src/jsx.ts +1294 -0
  331. package/src/metadata.ts +36 -0
  332. package/src/node.ts +109 -0
  333. package/src/nodes/adjustable.ts +68 -0
  334. package/src/nodes/alert-dialog-response.ts +78 -0
  335. package/src/nodes/animation.ts +402 -0
  336. package/src/nodes/application.ts +56 -0
  337. package/src/nodes/calendar.ts +38 -0
  338. package/src/nodes/color-dialog-button.ts +69 -0
  339. package/src/nodes/column-view-column.ts +84 -0
  340. package/src/nodes/column-view.ts +192 -0
  341. package/src/nodes/container-slot.ts +87 -0
  342. package/src/nodes/dialog.ts +25 -0
  343. package/src/nodes/drawing-area.ts +51 -0
  344. package/src/nodes/drop-down.ts +92 -0
  345. package/src/nodes/event-controller.ts +100 -0
  346. package/src/nodes/fixed-child.ts +108 -0
  347. package/src/nodes/font-dialog-button.ts +97 -0
  348. package/src/nodes/grid-child.ts +103 -0
  349. package/src/nodes/grid-view.ts +96 -0
  350. package/src/nodes/internal/base-item-renderer.ts +108 -0
  351. package/src/nodes/internal/grid-item-renderer.ts +71 -0
  352. package/src/nodes/internal/list-item-renderer.ts +155 -0
  353. package/src/nodes/internal/list-store.ts +105 -0
  354. package/src/nodes/internal/predicates.ts +80 -0
  355. package/src/nodes/internal/props.ts +51 -0
  356. package/src/nodes/internal/selection-model-controller.ts +115 -0
  357. package/src/nodes/internal/signal-store.ts +141 -0
  358. package/src/nodes/internal/simple-list-store.ts +99 -0
  359. package/src/nodes/internal/text-buffer-controller.ts +374 -0
  360. package/src/nodes/internal/tree-store.ts +237 -0
  361. package/src/nodes/internal/widget.ts +78 -0
  362. package/src/nodes/level-bar.ts +36 -0
  363. package/src/nodes/list-item.ts +107 -0
  364. package/src/nodes/list-view.ts +97 -0
  365. package/src/nodes/menu.ts +27 -0
  366. package/src/nodes/models/grid.ts +105 -0
  367. package/src/nodes/models/list.ts +140 -0
  368. package/src/nodes/models/menu.ts +310 -0
  369. package/src/nodes/navigation-page.ts +154 -0
  370. package/src/nodes/navigation-view.ts +58 -0
  371. package/src/nodes/notebook-page-tab.ts +55 -0
  372. package/src/nodes/notebook-page.ts +185 -0
  373. package/src/nodes/notebook.ts +28 -0
  374. package/src/nodes/overlay-child.ts +109 -0
  375. package/src/nodes/popover-menu.ts +59 -0
  376. package/src/nodes/scale.ts +28 -0
  377. package/src/nodes/scrolled-window.ts +23 -0
  378. package/src/nodes/search-bar.ts +27 -0
  379. package/src/nodes/shortcut-controller.ts +27 -0
  380. package/src/nodes/shortcut.ts +69 -0
  381. package/src/nodes/slot.ts +138 -0
  382. package/src/nodes/source-view.ts +130 -0
  383. package/src/nodes/stack-page.ts +170 -0
  384. package/src/nodes/stack.ts +35 -0
  385. package/src/nodes/text-anchor.ts +74 -0
  386. package/src/nodes/text-content.ts +14 -0
  387. package/src/nodes/text-paintable.ts +51 -0
  388. package/src/nodes/text-segment.ts +55 -0
  389. package/src/nodes/text-tag.ts +287 -0
  390. package/src/nodes/text-view.ts +93 -0
  391. package/src/nodes/toggle-group.ts +27 -0
  392. package/src/nodes/toggle.ts +72 -0
  393. package/src/nodes/virtual.ts +16 -0
  394. package/src/nodes/web-view.ts +22 -0
  395. package/src/nodes/widget.ts +398 -0
  396. package/src/nodes/window.ts +159 -0
  397. package/src/portal.ts +37 -0
  398. package/src/reconciler.ts +52 -0
  399. package/src/registry.ts +123 -0
  400. package/src/render.tsx +192 -0
  401. package/src/types.ts +7 -0
@@ -0,0 +1,398 @@
1
+ import { getNativeObject, type NativeObject } from "@gtkx/ffi";
2
+ import type * as GObject from "@gtkx/ffi/gobject";
3
+ import {
4
+ ObjectClass,
5
+ ParamSpecString,
6
+ Type,
7
+ TypeInstance,
8
+ typeClassRef,
9
+ typeFromName,
10
+ typeFundamental,
11
+ typeNameFromInstance,
12
+ } from "@gtkx/ffi/gobject";
13
+ import * as Gtk from "@gtkx/ffi/gtk";
14
+ import { CONSTRUCTOR_PROPS } from "../generated/internal.js";
15
+ import { resolvePropMeta, resolveSignal } from "../metadata.js";
16
+ import { Node } from "../node.js";
17
+ import type { Container, Props } from "../types.js";
18
+ import {
19
+ type InsertableWidget,
20
+ isAddable,
21
+ isAppendable,
22
+ isEditable,
23
+ isInsertable,
24
+ isRemovable,
25
+ isReorderable,
26
+ isSingleChild,
27
+ type ReorderableWidget,
28
+ } from "./internal/predicates.js";
29
+ import { filterProps } from "./internal/props.js";
30
+ import type { SignalHandler } from "./internal/signal-store.js";
31
+ import { attachChild, detachChild } from "./internal/widget.js";
32
+
33
+ const EXCLUDED_PROPS = ["children", "widthRequest", "heightRequest", "grabFocus"];
34
+
35
+ function findProperty(obj: NativeObject, key: string): GObject.ParamSpec | null {
36
+ const propertyName = key.replace(/([A-Z])/g, "-$1").toLowerCase();
37
+ const typeInstance = getNativeObject(obj.handle, TypeInstance);
38
+ const typeName = typeNameFromInstance(typeInstance);
39
+ const gtype = typeFromName(typeName);
40
+ const typeClass = typeClassRef(gtype);
41
+ const objectClass = getNativeObject(typeClass.handle, ObjectClass);
42
+ return objectClass.findProperty(propertyName) ?? null;
43
+ }
44
+
45
+ export class WidgetNode<
46
+ T extends Gtk.Widget = Gtk.Widget,
47
+ P extends Props = Props,
48
+ // biome-ignore lint/suspicious/noExplicitAny: Self-referential type bounds require any
49
+ TChild extends Node = any,
50
+ TParent extends Node = Node,
51
+ > extends Node<T, P, TParent, TChild> {
52
+ public static override createContainer(
53
+ props: Props,
54
+ containerClass: typeof Gtk.Widget,
55
+ _rootContainer?: Container,
56
+ ): Container | null {
57
+ const WidgetClass = containerClass;
58
+ const typeName = WidgetClass.glibTypeName;
59
+ const args = (CONSTRUCTOR_PROPS[typeName] ?? []).map((name) => props[name]);
60
+
61
+ return new WidgetClass(...(args as ConstructorParameters<typeof Gtk.Widget>));
62
+ }
63
+
64
+ public override isValidChild(_child: Node): boolean {
65
+ return true;
66
+ }
67
+
68
+ protected shouldAttachToParent(): boolean {
69
+ return true;
70
+ }
71
+
72
+ public override appendChild(child: TChild): void {
73
+ super.appendChild(child);
74
+
75
+ if (child instanceof WidgetNode && child.shouldAttachToParent()) {
76
+ this.appendWidgetChild(child);
77
+ }
78
+ }
79
+
80
+ public override removeChild(child: TChild): void {
81
+ if (child instanceof WidgetNode && child.shouldAttachToParent()) {
82
+ if (this.isChildAutowrapped(child)) {
83
+ const wrapper = child.container.getParent();
84
+ if (wrapper && isSingleChild(wrapper)) {
85
+ wrapper.setChild(null);
86
+ if (isRemovable(this.container)) {
87
+ this.container.remove(wrapper);
88
+ }
89
+ }
90
+ } else {
91
+ detachChild(child.container, this.container);
92
+ }
93
+ }
94
+
95
+ super.removeChild(child);
96
+ }
97
+
98
+ public override insertBefore(child: TChild, before: TChild): void {
99
+ super.insertBefore(child, before);
100
+
101
+ if (!(child instanceof WidgetNode) || !child.shouldAttachToParent()) return;
102
+
103
+ if (!(before instanceof WidgetNode)) {
104
+ this.appendWidgetChild(child);
105
+ return;
106
+ }
107
+
108
+ if (this.container instanceof Gtk.ListBox || this.container instanceof Gtk.FlowBox) {
109
+ this.insertBeforeAutowrapping(child, before);
110
+ } else if (isReorderable(this.container)) {
111
+ this.insertBeforeReorderable(this.container, child, before);
112
+ } else if (isInsertable(this.container)) {
113
+ this.insertBeforeInsertable(this.container, child, before);
114
+ } else {
115
+ this.reinsertAllChildren();
116
+ }
117
+ }
118
+
119
+ public override commitUpdate(oldProps: P | null, newProps: P): void {
120
+ super.commitUpdate(oldProps, newProps);
121
+
122
+ if (!this.container) {
123
+ throw new Error(`Container is undefined for '${this.typeName}'`);
124
+ }
125
+
126
+ this.signalStore.blockAll();
127
+ try {
128
+ this.updateSizeRequest(oldProps, newProps);
129
+ this.updateGrabFocus(oldProps, newProps);
130
+
131
+ const propNames = new Set([
132
+ ...Object.keys(filterProps(oldProps ?? {}, EXCLUDED_PROPS)),
133
+ ...Object.keys(filterProps(newProps ?? {}, EXCLUDED_PROPS)),
134
+ ]);
135
+
136
+ const pendingSignals: Array<{ name: string; newValue: unknown }> = [];
137
+ const pendingProperties: Array<{ name: string; oldValue: unknown; newValue: unknown }> = [];
138
+
139
+ for (const name of propNames) {
140
+ const oldValue = oldProps?.[name];
141
+ const newValue = newProps[name];
142
+
143
+ if (oldValue === newValue) continue;
144
+
145
+ const signalName = resolveSignal(this.container, name);
146
+
147
+ if (signalName) {
148
+ pendingSignals.push({ name, newValue });
149
+ } else if (newValue !== undefined) {
150
+ pendingProperties.push({ name, oldValue, newValue });
151
+ } else if (oldValue !== undefined) {
152
+ const defaultValue = this.getPropertyDefaultValue(name);
153
+ if (defaultValue !== undefined) {
154
+ pendingProperties.push({ name, oldValue, newValue: defaultValue });
155
+ }
156
+ }
157
+ }
158
+
159
+ for (const { name, newValue } of pendingSignals) {
160
+ const signalName = resolveSignal(this.container, name);
161
+ if (!signalName) continue;
162
+ const handler = typeof newValue === "function" ? (newValue as SignalHandler) : undefined;
163
+ this.signalStore.set(this, this.container, signalName, handler);
164
+ }
165
+
166
+ for (const { name, oldValue, newValue } of pendingProperties) {
167
+ if (name === "text" && oldValue !== undefined && isEditable(this.container)) {
168
+ if (oldValue !== this.container.getText()) {
169
+ continue;
170
+ }
171
+ }
172
+
173
+ this.setProperty(name, newValue);
174
+ }
175
+ } finally {
176
+ this.signalStore.unblockAll();
177
+ }
178
+ }
179
+
180
+ private appendWidgetChild(child: WidgetNode): void {
181
+ if (isAppendable(this.container) || isAddable(this.container)) {
182
+ if (this.isChildAutowrapped(child)) {
183
+ this.detachAutowrappedChild(child);
184
+ } else {
185
+ detachChildFromParent(child);
186
+ }
187
+ }
188
+ attachChild(child.container, this.container);
189
+ }
190
+
191
+ private isChildAutowrapped(child: WidgetNode): boolean {
192
+ return (
193
+ (this.container instanceof Gtk.ListBox || this.container instanceof Gtk.FlowBox) &&
194
+ !(child.container instanceof Gtk.ListBoxRow || child.container instanceof Gtk.FlowBoxChild)
195
+ );
196
+ }
197
+
198
+ private detachAutowrappedChild(child: WidgetNode): void {
199
+ const wrapper = child.container.getParent();
200
+ if (wrapper && isSingleChild(wrapper)) {
201
+ wrapper.setChild(null);
202
+ const wrapperParent = wrapper.getParent();
203
+ if (wrapperParent && isRemovable(wrapperParent)) {
204
+ wrapperParent.remove(wrapper);
205
+ }
206
+ }
207
+ }
208
+
209
+ private insertBeforeAutowrapping(child: WidgetNode, before: WidgetNode): void {
210
+ const currentParent = child.container.getParent();
211
+
212
+ if (currentParent !== null) {
213
+ if (child.container instanceof Gtk.ListBoxRow || child.container instanceof Gtk.FlowBoxChild) {
214
+ if (isRemovable(currentParent)) {
215
+ currentParent.remove(child.container);
216
+ }
217
+ } else {
218
+ this.detachAutowrappedChild(child);
219
+ }
220
+ } else if (!(child.container instanceof Gtk.ListBoxRow || child.container instanceof Gtk.FlowBoxChild)) {
221
+ this.detachAutowrappedChild(child);
222
+ }
223
+
224
+ const container: Gtk.Widget = this.container;
225
+ if (!(container instanceof Gtk.ListBox) && !(container instanceof Gtk.FlowBox)) return;
226
+
227
+ const position = this.findAutowrappedPosition(before);
228
+
229
+ if (position !== null) {
230
+ container.insert(child.container, position);
231
+ } else {
232
+ container.append(child.container);
233
+ }
234
+ }
235
+
236
+ private findAutowrappedPosition(before: WidgetNode): number | null {
237
+ let position = 0;
238
+ let currentChild = this.container.getFirstChild();
239
+ const beforeIsRow = before.container instanceof Gtk.ListBoxRow || before.container instanceof Gtk.FlowBoxChild;
240
+
241
+ while (currentChild) {
242
+ const widgetToCompare = beforeIsRow ? currentChild : this.unwrapGtkChild(currentChild);
243
+
244
+ if (widgetToCompare && widgetToCompare === before.container) {
245
+ return position;
246
+ }
247
+
248
+ position++;
249
+ currentChild = currentChild.getNextSibling();
250
+ }
251
+
252
+ return null;
253
+ }
254
+
255
+ private unwrapGtkChild(child: Gtk.Widget): Gtk.Widget | null {
256
+ if ("getChild" in child && typeof child.getChild === "function") {
257
+ return child.getChild() as Gtk.Widget | null;
258
+ }
259
+ return child;
260
+ }
261
+
262
+ private reinsertAllChildren(): void {
263
+ const widgetChildren: WidgetNode[] = [];
264
+ for (const child of this.children) {
265
+ if (child instanceof WidgetNode && child.shouldAttachToParent()) {
266
+ widgetChildren.push(child);
267
+ }
268
+ }
269
+
270
+ for (const child of widgetChildren) {
271
+ detachChild(child.container, this.container);
272
+ }
273
+
274
+ for (const child of widgetChildren) {
275
+ attachChild(child.container, this.container);
276
+ }
277
+ }
278
+
279
+ private updateSizeRequest(oldProps: P | null, newProps: P): void {
280
+ const oldWidth = oldProps?.widthRequest as number | undefined;
281
+ const oldHeight = oldProps?.heightRequest as number | undefined;
282
+ const newWidth = newProps.widthRequest as number | undefined;
283
+ const newHeight = newProps.heightRequest as number | undefined;
284
+
285
+ if (oldWidth !== newWidth || oldHeight !== newHeight) {
286
+ this.container.setSizeRequest(newWidth ?? -1, newHeight ?? -1);
287
+ }
288
+ }
289
+
290
+ private updateGrabFocus(oldProps: P | null, newProps: P): void {
291
+ const oldGrabFocus = oldProps?.grabFocus as boolean | undefined;
292
+ const newGrabFocus = newProps.grabFocus as boolean | undefined;
293
+
294
+ if (!oldGrabFocus && newGrabFocus) {
295
+ this.container.grabFocus();
296
+ }
297
+ }
298
+
299
+ private getPropertyDefaultValue(key: string): unknown {
300
+ if (!resolvePropMeta(this.container, key)) return undefined;
301
+
302
+ const pspec = findProperty(this.container, key);
303
+ if (!pspec) return undefined;
304
+
305
+ const value = pspec.getDefaultValue();
306
+ const gtype = value.getType();
307
+ const fundamental = typeFundamental(gtype);
308
+
309
+ if (fundamental === Type.BOOLEAN) return value.getBoolean();
310
+ if (fundamental === Type.INT) return value.getInt();
311
+ if (fundamental === Type.UINT) return value.getUint();
312
+ if (fundamental === Type.LONG) return value.getLong();
313
+ if (fundamental === Type.ULONG) return value.getUlong();
314
+ if (fundamental === Type.INT64) return value.getInt64();
315
+ if (fundamental === Type.UINT64) return value.getUint64();
316
+ if (fundamental === Type.FLOAT) return value.getFloat();
317
+ if (fundamental === Type.DOUBLE) return value.getDouble();
318
+ if (fundamental === Type.STRING) return value.getString();
319
+ if (fundamental === Type.ENUM) return value.getEnum();
320
+ if (fundamental === Type.FLAGS) return value.getFlags();
321
+
322
+ return undefined;
323
+ }
324
+
325
+ private setProperty(key: string, value: unknown): void {
326
+ const propMeta = resolvePropMeta(this.container, key);
327
+ if (!propMeta) return;
328
+
329
+ const [getterName, setterName] = propMeta;
330
+ const setter = this.container[setterName as keyof typeof this.container];
331
+ if (!setter || typeof setter !== "function") return;
332
+
333
+ if (getterName && findProperty(this.container, key) instanceof ParamSpecString) {
334
+ const getter = this.container[getterName as keyof typeof this.container];
335
+
336
+ if (getter && typeof getter === "function") {
337
+ const currentValue = getter.call(this.container);
338
+ if (currentValue === value) return;
339
+ }
340
+ }
341
+
342
+ setter.call(this.container, value);
343
+ }
344
+
345
+ private insertBeforeReorderable(container: ReorderableWidget, child: WidgetNode, before: WidgetNode): void {
346
+ const previousSibling = this.findPreviousSibling(before);
347
+ const currentParent = child.container.getParent();
348
+ const isChildOfThisContainer = currentParent && currentParent === container;
349
+
350
+ if (isChildOfThisContainer) {
351
+ container.reorderChildAfter(child.container, previousSibling);
352
+ } else {
353
+ detachChildFromParent(child);
354
+ container.insertChildAfter(child.container, previousSibling);
355
+ }
356
+ }
357
+
358
+ private insertBeforeInsertable(container: InsertableWidget, child: WidgetNode, before: WidgetNode): void {
359
+ detachChildFromParent(child);
360
+ const position = this.findInsertPosition(before);
361
+ container.insert(child.container, position);
362
+ }
363
+
364
+ private findPreviousSibling(before: WidgetNode): Gtk.Widget | undefined {
365
+ let beforeChild = this.container.getFirstChild();
366
+
367
+ while (beforeChild) {
368
+ if (beforeChild === before.container) {
369
+ return beforeChild.getPrevSibling() ?? undefined;
370
+ }
371
+ beforeChild = beforeChild.getNextSibling();
372
+ }
373
+
374
+ throw new Error(`Cannot find 'before' sibling in '${this.typeName}'`);
375
+ }
376
+
377
+ private findInsertPosition(before: WidgetNode): number {
378
+ let position = 0;
379
+ let currentChild = this.container.getFirstChild();
380
+
381
+ while (currentChild) {
382
+ if (currentChild === before.container) {
383
+ return position;
384
+ }
385
+ position++;
386
+ currentChild = currentChild.getNextSibling();
387
+ }
388
+
389
+ throw new Error(`Cannot find 'before' child position in '${this.typeName}'`);
390
+ }
391
+ }
392
+
393
+ function detachChildFromParent(child: WidgetNode): void {
394
+ const currentParent = child.container.getParent();
395
+ if (currentParent !== null && isRemovable(currentParent)) {
396
+ currentParent.remove(child.container);
397
+ }
398
+ }
@@ -0,0 +1,159 @@
1
+ import * as Adw from "@gtkx/ffi/adw";
2
+ import * as Gtk from "@gtkx/ffi/gtk";
3
+ import type { GtkAboutDialogProps, GtkWindowProps } from "../jsx.js";
4
+ import type { Node } from "../node.js";
5
+ import type { Container, Props } from "../types.js";
6
+ import { AnimationNode } from "./animation.js";
7
+ import type { DialogNode } from "./dialog.js";
8
+ import { filterProps, hasChanged } from "./internal/props.js";
9
+ import { MenuNode } from "./menu.js";
10
+ import { MenuModel } from "./models/menu.js";
11
+ import { NavigationPageNode } from "./navigation-page.js";
12
+ import { SlotNode } from "./slot.js";
13
+ import { WidgetNode } from "./widget.js";
14
+
15
+ // biome-ignore lint/suspicious/noExplicitAny: Required for matching GTK class constructors with varying signatures
16
+ const isOrExtendsClass = (target: object, cls: abstract new (...args: any[]) => any): boolean =>
17
+ target === cls || Object.prototype.isPrototypeOf.call(cls, target);
18
+
19
+ const OWN_PROPS = ["onClose"] as const;
20
+
21
+ export type WindowProps = Pick<GtkWindowProps, "onClose"> & Pick<GtkAboutDialogProps, "creditSections">;
22
+
23
+ type WindowChild = WindowNode | DialogNode | MenuNode | SlotNode | AnimationNode | NavigationPageNode | WidgetNode;
24
+
25
+ export class WindowNode extends WidgetNode<Gtk.Window, WindowProps, WindowChild> {
26
+ private menu: MenuModel;
27
+
28
+ public static override createContainer(
29
+ props: Props,
30
+ containerClass: typeof Gtk.Window,
31
+ rootContainer: Container | undefined,
32
+ ): Gtk.Window {
33
+ const WindowClass = containerClass;
34
+
35
+ if (
36
+ isOrExtendsClass(WindowClass, Gtk.ApplicationWindow) ||
37
+ isOrExtendsClass(WindowClass, Adw.ApplicationWindow)
38
+ ) {
39
+ if (!(rootContainer instanceof Gtk.Application)) {
40
+ throw new Error("Expected ApplicationWindow to be created within Application");
41
+ }
42
+
43
+ if (isOrExtendsClass(WindowClass, Adw.ApplicationWindow)) {
44
+ return new Adw.ApplicationWindow(rootContainer);
45
+ }
46
+
47
+ return new Gtk.ApplicationWindow(rootContainer);
48
+ }
49
+
50
+ return WidgetNode.createContainer(props, containerClass) as Gtk.Window;
51
+ }
52
+
53
+ constructor(typeName: string, props: WindowProps, container: Gtk.Window, rootContainer: Container) {
54
+ super(typeName, props, container, rootContainer);
55
+ const application = rootContainer instanceof Gtk.Application ? rootContainer : undefined;
56
+ const actionMap = container instanceof Gtk.ApplicationWindow ? container : undefined;
57
+ this.menu = new MenuModel("root", {}, rootContainer, actionMap, application);
58
+
59
+ if (container instanceof Gtk.AboutDialog && props.creditSections) {
60
+ for (const section of props.creditSections) {
61
+ container.addCreditSection(section.name, section.people);
62
+ }
63
+ }
64
+ }
65
+
66
+ protected override shouldAttachToParent(): boolean {
67
+ return false;
68
+ }
69
+
70
+ public override isValidChild(child: Node): boolean {
71
+ return (
72
+ child instanceof WidgetNode ||
73
+ child instanceof MenuNode ||
74
+ child instanceof SlotNode ||
75
+ child instanceof AnimationNode ||
76
+ child instanceof NavigationPageNode
77
+ );
78
+ }
79
+
80
+ public override appendChild(child: WindowChild): void {
81
+ if (child instanceof WindowNode) {
82
+ child.container.setTransientFor(this.container);
83
+ super.appendChild(child);
84
+ return;
85
+ }
86
+
87
+ if (child instanceof MenuNode) {
88
+ this.menu.appendChild(child);
89
+ return;
90
+ }
91
+
92
+ super.appendChild(child);
93
+ }
94
+
95
+ public override removeChild(child: WindowChild): void {
96
+ if (child instanceof WindowNode) {
97
+ child.container.setTransientFor(null);
98
+ super.removeChild(child);
99
+ return;
100
+ }
101
+
102
+ if (child instanceof MenuNode) {
103
+ this.menu.removeChild(child);
104
+ return;
105
+ }
106
+
107
+ super.removeChild(child);
108
+ }
109
+
110
+ public override insertBefore(child: WindowChild, before: WindowChild): void {
111
+ if (child instanceof MenuNode) {
112
+ if (before instanceof MenuNode) {
113
+ this.menu.insertBefore(child, before);
114
+ } else {
115
+ this.menu.appendChild(child);
116
+ }
117
+ return;
118
+ }
119
+
120
+ if (child instanceof WindowNode) {
121
+ child.container.setTransientFor(this.container);
122
+ }
123
+
124
+ super.insertBefore(child, before);
125
+ }
126
+
127
+ public override finalizeInitialChildren(props: WindowProps): boolean {
128
+ this.commitUpdate(null, props);
129
+ return true;
130
+ }
131
+
132
+ public override commitUpdate(oldProps: WindowProps | null, newProps: WindowProps): void {
133
+ super.commitUpdate(oldProps ? filterProps(oldProps, OWN_PROPS) : null, filterProps(newProps, OWN_PROPS));
134
+ this.applyOwnProps(oldProps, newProps);
135
+ }
136
+
137
+ public override commitMount(): void {
138
+ this.container.present();
139
+ }
140
+
141
+ public override detachDeletedInstance(): void {
142
+ this.container.setVisible(false);
143
+ this.container.destroy();
144
+ super.detachDeletedInstance();
145
+ }
146
+
147
+ private applyOwnProps(oldProps: WindowProps | null, newProps: WindowProps): void {
148
+ if (hasChanged(oldProps, newProps, "onClose")) {
149
+ const userHandler = newProps.onClose;
150
+ const wrappedHandler = userHandler
151
+ ? () => {
152
+ userHandler();
153
+ return true;
154
+ }
155
+ : undefined;
156
+ this.signalStore.set(this, this.container, "close-request", wrappedHandler);
157
+ }
158
+ }
159
+ }
package/src/portal.ts ADDED
@@ -0,0 +1,37 @@
1
+ import type { ReactNode, ReactPortal } from "react";
2
+ import type { Container } from "./types.js";
3
+
4
+ /**
5
+ * Creates a React portal for rendering children into a different part of the widget tree.
6
+ *
7
+ * Portals are useful for rendering dialogs, tooltips, or other floating content
8
+ * that should visually appear outside its parent component's boundaries.
9
+ *
10
+ * @param children - The React elements to render in the portal
11
+ * @param container - The target container widget to render into
12
+ * @param key - Optional key for the portal element
13
+ * @returns A ReactPortal element
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * import { createPortal } from "@gtkx/react";
18
+ *
19
+ * const Modal = ({ container, children }) => {
20
+ * return createPortal(
21
+ * <GtkWindow modal>
22
+ * {children}
23
+ * </GtkWindow>,
24
+ * container
25
+ * );
26
+ * };
27
+ * ```
28
+ */
29
+ export const createPortal = (children: ReactNode, container: Container, key?: string | null): ReactPortal => {
30
+ return {
31
+ $$typeof: Symbol.for("react.portal"),
32
+ key: key ?? null,
33
+ children,
34
+ containerInfo: container,
35
+ implementation: null,
36
+ } as unknown as ReactPortal;
37
+ };
@@ -0,0 +1,52 @@
1
+ import ReactReconciler from "react-reconciler";
2
+ import packageJson from "../package.json" with { type: "json" };
3
+ import { createHostConfig, type ReconcilerInstance } from "./host-config.js";
4
+
5
+ /**
6
+ * Manages the React reconciler instance for GTKX.
7
+ *
8
+ * This class wraps the React Reconciler and handles initialization
9
+ * including DevTools integration for development environments.
10
+ *
11
+ * @internal
12
+ */
13
+ class Reconciler {
14
+ private instance: ReconcilerInstance;
15
+
16
+ constructor() {
17
+ this.instance = ReactReconciler(createHostConfig());
18
+ this.injectDevTools();
19
+ }
20
+
21
+ /**
22
+ * Returns the underlying React Reconciler instance.
23
+ *
24
+ * @returns The React Reconciler instance for direct reconciler operations
25
+ */
26
+ getInstance(): ReconcilerInstance {
27
+ return this.instance;
28
+ }
29
+
30
+ private injectDevTools(): void {
31
+ if (process.env.NODE_ENV === "production") return;
32
+
33
+ this.instance.injectIntoDevTools({
34
+ bundleType: 1,
35
+ version: packageJson.version,
36
+ rendererPackageName: "@gtkx/react",
37
+ });
38
+ }
39
+ }
40
+
41
+ /**
42
+ * The GTKX React reconciler instance.
43
+ *
44
+ * Provides low-level access to the React reconciler for advanced use cases.
45
+ * Most applications should use {@link render} instead.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * const instance = reconciler.getInstance();
50
+ * ```
51
+ */
52
+ export const reconciler = new Reconciler();