@gtkx/react 0.21.0 → 1.0.0-rc.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 (636) hide show
  1. package/README.md +137 -34
  2. package/dist/components/application.d.ts +10 -0
  3. package/dist/components/application.d.ts.map +1 -0
  4. package/dist/components/application.js +26 -0
  5. package/dist/components/application.js.map +1 -0
  6. package/dist/components/window.d.ts +8 -0
  7. package/dist/components/window.d.ts.map +1 -0
  8. package/dist/components/window.js +23 -0
  9. package/dist/components/window.js.map +1 -0
  10. package/dist/hooks/use-application.d.ts +8 -0
  11. package/dist/hooks/use-application.d.ts.map +1 -0
  12. package/dist/hooks/use-application.js +13 -0
  13. package/dist/hooks/use-application.js.map +1 -0
  14. package/dist/hooks/use-bind-setting.d.ts +6 -0
  15. package/dist/hooks/use-bind-setting.d.ts.map +1 -0
  16. package/dist/hooks/use-bind-setting.js +19 -0
  17. package/dist/hooks/use-bind-setting.js.map +1 -0
  18. package/dist/hooks/use-merge-refs.d.ts +3 -0
  19. package/dist/hooks/use-merge-refs.d.ts.map +1 -0
  20. package/dist/hooks/use-merge-refs.js +48 -0
  21. package/dist/hooks/use-merge-refs.js.map +1 -0
  22. package/dist/hooks/use-object-attachment.d.ts +10 -0
  23. package/dist/hooks/use-object-attachment.d.ts.map +1 -0
  24. package/dist/hooks/use-object-attachment.js +24 -0
  25. package/dist/hooks/use-object-attachment.js.map +1 -0
  26. package/dist/hooks/use-object-value.d.ts +4 -0
  27. package/dist/hooks/use-object-value.d.ts.map +1 -0
  28. package/dist/hooks/use-object-value.js +32 -0
  29. package/dist/hooks/use-object-value.js.map +1 -0
  30. package/dist/hooks/use-parent-window.d.ts +8 -0
  31. package/dist/hooks/use-parent-window.d.ts.map +1 -0
  32. package/dist/hooks/use-parent-window.js +7 -0
  33. package/dist/hooks/use-parent-window.js.map +1 -0
  34. package/dist/hooks/use-property.d.ts +14 -0
  35. package/dist/hooks/use-property.d.ts.map +1 -0
  36. package/dist/hooks/use-property.js +13 -0
  37. package/dist/hooks/use-property.js.map +1 -0
  38. package/dist/hooks/use-setting.d.ts +25 -0
  39. package/dist/hooks/use-setting.d.ts.map +1 -0
  40. package/dist/hooks/use-setting.js +15 -0
  41. package/dist/hooks/use-setting.js.map +1 -0
  42. package/dist/hooks/use-signal.d.ts +21 -0
  43. package/dist/hooks/use-signal.d.ts.map +1 -0
  44. package/dist/hooks/use-signal.js +20 -0
  45. package/dist/hooks/use-signal.js.map +1 -0
  46. package/dist/index.d.ts +14 -7
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +10 -7
  49. package/dist/index.js.map +1 -1
  50. package/dist/internal.d.ts +14 -0
  51. package/dist/internal.d.ts.map +1 -0
  52. package/dist/internal.js +14 -0
  53. package/dist/internal.js.map +1 -0
  54. package/dist/libraries/adw/dialog.d.ts +8 -0
  55. package/dist/libraries/adw/dialog.d.ts.map +1 -0
  56. package/dist/libraries/adw/dialog.js +25 -0
  57. package/dist/libraries/adw/dialog.js.map +1 -0
  58. package/dist/libraries/adw/index.d.ts +2 -0
  59. package/dist/libraries/adw/index.d.ts.map +1 -0
  60. package/dist/libraries/adw/index.js +2 -0
  61. package/dist/libraries/adw/index.js.map +1 -0
  62. package/dist/reconciler/accessible.d.ts +59 -0
  63. package/dist/reconciler/accessible.d.ts.map +1 -0
  64. package/dist/reconciler/accessible.js +143 -0
  65. package/dist/reconciler/accessible.js.map +1 -0
  66. package/dist/reconciler/apply-props.d.ts +8 -0
  67. package/dist/reconciler/apply-props.d.ts.map +1 -0
  68. package/dist/reconciler/apply-props.js +92 -0
  69. package/dist/reconciler/apply-props.js.map +1 -0
  70. package/dist/reconciler/commit-flush.d.ts +3 -0
  71. package/dist/reconciler/commit-flush.d.ts.map +1 -0
  72. package/dist/reconciler/commit-flush.js +13 -0
  73. package/dist/reconciler/commit-flush.js.map +1 -0
  74. package/dist/reconciler/container-attach.d.ts +10 -0
  75. package/dist/reconciler/container-attach.d.ts.map +1 -0
  76. package/dist/reconciler/container-attach.js +216 -0
  77. package/dist/reconciler/container-attach.js.map +1 -0
  78. package/dist/reconciler/content-rebuild.d.ts +3 -0
  79. package/dist/reconciler/content-rebuild.d.ts.map +1 -0
  80. package/dist/reconciler/content-rebuild.js +15 -0
  81. package/dist/reconciler/content-rebuild.js.map +1 -0
  82. package/dist/reconciler/dispatch.d.ts +6 -0
  83. package/dist/reconciler/dispatch.d.ts.map +1 -0
  84. package/dist/reconciler/dispatch.js +61 -0
  85. package/dist/reconciler/dispatch.js.map +1 -0
  86. package/dist/reconciler/element-prop-appliers.d.ts +5 -0
  87. package/dist/reconciler/element-prop-appliers.d.ts.map +1 -0
  88. package/dist/reconciler/element-prop-appliers.js +104 -0
  89. package/dist/reconciler/element-prop-appliers.js.map +1 -0
  90. package/dist/reconciler/element-props.d.ts +25 -0
  91. package/dist/reconciler/element-props.d.ts.map +1 -0
  92. package/dist/reconciler/element-props.js +157 -0
  93. package/dist/reconciler/element-props.js.map +1 -0
  94. package/dist/reconciler/host-config.d.ts +13 -0
  95. package/dist/reconciler/host-config.d.ts.map +1 -0
  96. package/dist/reconciler/host-config.js +309 -0
  97. package/dist/reconciler/host-config.js.map +1 -0
  98. package/dist/reconciler/instance.d.ts +6 -0
  99. package/dist/reconciler/instance.d.ts.map +1 -0
  100. package/dist/reconciler/instance.js +27 -0
  101. package/dist/reconciler/instance.js.map +1 -0
  102. package/dist/reconciler/label-text-rebuild.d.ts +3 -0
  103. package/dist/reconciler/label-text-rebuild.d.ts.map +1 -0
  104. package/dist/reconciler/label-text-rebuild.js +22 -0
  105. package/dist/reconciler/label-text-rebuild.js.map +1 -0
  106. package/dist/reconciler/portal.d.ts +11 -0
  107. package/dist/reconciler/portal.d.ts.map +1 -0
  108. package/dist/reconciler/portal.js +20 -0
  109. package/dist/reconciler/portal.js.map +1 -0
  110. package/dist/reconciler/reconciler-error-handler.d.ts +7 -0
  111. package/dist/reconciler/reconciler-error-handler.d.ts.map +1 -0
  112. package/dist/reconciler/reconciler-error-handler.js +24 -0
  113. package/dist/reconciler/reconciler-error-handler.js.map +1 -0
  114. package/dist/reconciler/reconciler-root.d.ts +19 -0
  115. package/dist/reconciler/reconciler-root.d.ts.map +1 -0
  116. package/dist/reconciler/reconciler-root.js +24 -0
  117. package/dist/reconciler/reconciler-root.js.map +1 -0
  118. package/dist/reconciler/reconciler.d.ts +3 -0
  119. package/dist/reconciler/reconciler.d.ts.map +1 -0
  120. package/dist/reconciler/reconciler.js +12 -0
  121. package/dist/reconciler/reconciler.js.map +1 -0
  122. package/dist/reconciler/render.d.ts +23 -0
  123. package/dist/reconciler/render.d.ts.map +1 -0
  124. package/dist/reconciler/render.js +46 -0
  125. package/dist/reconciler/render.js.map +1 -0
  126. package/dist/reconciler/root-element.d.ts +14 -0
  127. package/dist/reconciler/root-element.d.ts.map +1 -0
  128. package/dist/reconciler/root-element.js +7 -0
  129. package/dist/reconciler/root-element.js.map +1 -0
  130. package/dist/reconciler/signal-store.d.ts +22 -0
  131. package/dist/reconciler/signal-store.d.ts.map +1 -0
  132. package/dist/reconciler/signal-store.js +84 -0
  133. package/dist/reconciler/signal-store.js.map +1 -0
  134. package/dist/reconciler/state.d.ts +36 -0
  135. package/dist/reconciler/state.d.ts.map +1 -0
  136. package/dist/reconciler/state.js +38 -0
  137. package/dist/reconciler/state.js.map +1 -0
  138. package/dist/reconciler/text-buffer-controller.d.ts +17 -0
  139. package/dist/reconciler/text-buffer-controller.d.ts.map +1 -0
  140. package/dist/reconciler/text-buffer-controller.js +102 -0
  141. package/dist/reconciler/text-buffer-controller.js.map +1 -0
  142. package/dist/reconciler/text-buffer-rebuild.d.ts +3 -0
  143. package/dist/reconciler/text-buffer-rebuild.d.ts.map +1 -0
  144. package/dist/reconciler/text-buffer-rebuild.js +7 -0
  145. package/dist/reconciler/text-buffer-rebuild.js.map +1 -0
  146. package/dist/reconciler/text-node.d.ts +7 -0
  147. package/dist/reconciler/text-node.d.ts.map +1 -0
  148. package/dist/reconciler/text-node.js +8 -0
  149. package/dist/reconciler/text-node.js.map +1 -0
  150. package/dist/reconciler/types.d.ts +5 -0
  151. package/dist/reconciler/types.d.ts.map +1 -0
  152. package/dist/reconciler/types.js.map +1 -0
  153. package/dist/reconciler/visibility.d.ts +6 -0
  154. package/dist/reconciler/visibility.d.ts.map +1 -0
  155. package/dist/reconciler/visibility.js +57 -0
  156. package/dist/reconciler/visibility.js.map +1 -0
  157. package/dist/reconciler/wrapper-apply.d.ts +6 -0
  158. package/dist/reconciler/wrapper-apply.d.ts.map +1 -0
  159. package/dist/reconciler/wrapper-apply.js +287 -0
  160. package/dist/reconciler/wrapper-apply.js.map +1 -0
  161. package/dist/reconciler/wrapper-content.d.ts +8 -0
  162. package/dist/reconciler/wrapper-content.d.ts.map +1 -0
  163. package/dist/reconciler/wrapper-content.js +19 -0
  164. package/dist/reconciler/wrapper-content.js.map +1 -0
  165. package/dist/reconciler/wrapper-node.d.ts +8 -0
  166. package/dist/reconciler/wrapper-node.d.ts.map +1 -0
  167. package/dist/reconciler/wrapper-node.js +4 -0
  168. package/dist/reconciler/wrapper-node.js.map +1 -0
  169. package/dist/reconciler/wrapper-protocol.d.ts +13 -0
  170. package/dist/reconciler/wrapper-protocol.d.ts.map +1 -0
  171. package/dist/reconciler/wrapper-protocol.js +20 -0
  172. package/dist/reconciler/wrapper-protocol.js.map +1 -0
  173. package/dist/utils/accessible-metadata.d.ts +5 -0
  174. package/dist/utils/accessible-metadata.d.ts.map +1 -0
  175. package/dist/utils/accessible-metadata.js +22 -0
  176. package/dist/utils/accessible-metadata.js.map +1 -0
  177. package/dist/utils/create-element-component.d.ts +4 -0
  178. package/dist/utils/create-element-component.d.ts.map +1 -0
  179. package/dist/utils/create-element-component.js +54 -0
  180. package/dist/utils/create-element-component.js.map +1 -0
  181. package/dist/utils/gtype.d.ts +16 -0
  182. package/dist/utils/gtype.d.ts.map +1 -0
  183. package/dist/utils/gtype.js +127 -0
  184. package/dist/utils/gtype.js.map +1 -0
  185. package/dist/utils/notify-name.d.ts +5 -0
  186. package/dist/utils/notify-name.d.ts.map +1 -0
  187. package/dist/utils/notify-name.js +6 -0
  188. package/dist/utils/notify-name.js.map +1 -0
  189. package/dist/utils/object-prop.d.ts +8 -0
  190. package/dist/utils/object-prop.d.ts.map +1 -0
  191. package/dist/utils/object-prop.js +9 -0
  192. package/dist/utils/object-prop.js.map +1 -0
  193. package/dist/utils/settings-accessor.d.ts +8 -0
  194. package/dist/utils/settings-accessor.d.ts.map +1 -0
  195. package/dist/utils/settings-accessor.js +69 -0
  196. package/dist/utils/settings-accessor.js.map +1 -0
  197. package/dist/utils/wrapper-node-jsx.d.ts +32 -0
  198. package/dist/utils/wrapper-node-jsx.d.ts.map +1 -0
  199. package/dist/utils/wrapper-node-jsx.js +2 -0
  200. package/dist/utils/wrapper-node-jsx.js.map +1 -0
  201. package/package.json +22 -8
  202. package/src/components/application.tsx +43 -0
  203. package/src/components/window.tsx +36 -0
  204. package/src/hooks/use-application.ts +17 -0
  205. package/src/hooks/use-bind-setting.ts +35 -0
  206. package/src/hooks/use-merge-refs.ts +53 -0
  207. package/src/hooks/use-object-attachment.ts +35 -0
  208. package/src/hooks/use-object-value.ts +50 -0
  209. package/src/hooks/use-parent-window.ts +9 -0
  210. package/src/hooks/use-property.ts +22 -0
  211. package/src/hooks/use-setting.ts +47 -0
  212. package/src/hooks/use-signal.ts +71 -0
  213. package/src/index.ts +15 -14
  214. package/src/internal.ts +24 -0
  215. package/src/libraries/adw/dialog.tsx +34 -0
  216. package/src/libraries/adw/index.ts +1 -0
  217. package/src/reconciler/accessible.ts +232 -0
  218. package/src/reconciler/apply-props.ts +117 -0
  219. package/src/reconciler/commit-flush.ts +13 -0
  220. package/src/reconciler/container-attach.ts +219 -0
  221. package/src/reconciler/content-rebuild.ts +19 -0
  222. package/src/reconciler/dispatch.ts +58 -0
  223. package/src/reconciler/element-prop-appliers.ts +110 -0
  224. package/src/reconciler/element-props.ts +192 -0
  225. package/src/reconciler/host-config.ts +405 -0
  226. package/src/reconciler/instance.ts +30 -0
  227. package/src/reconciler/label-text-rebuild.ts +26 -0
  228. package/src/reconciler/portal.ts +28 -0
  229. package/src/reconciler/reconciler-error-handler.ts +29 -0
  230. package/src/reconciler/reconciler-root.ts +57 -0
  231. package/src/reconciler/reconciler.ts +13 -0
  232. package/src/reconciler/render.ts +61 -0
  233. package/src/reconciler/root-element.ts +14 -0
  234. package/src/reconciler/signal-store.ts +103 -0
  235. package/src/reconciler/state.ts +72 -0
  236. package/src/reconciler/text-buffer-controller.ts +107 -0
  237. package/src/reconciler/text-buffer-rebuild.ts +12 -0
  238. package/src/reconciler/text-node.ts +13 -0
  239. package/src/reconciler/types.ts +6 -0
  240. package/src/reconciler/visibility.ts +52 -0
  241. package/src/reconciler/wrapper-apply.ts +308 -0
  242. package/src/reconciler/wrapper-content.ts +24 -0
  243. package/src/reconciler/wrapper-node.ts +8 -0
  244. package/src/reconciler/wrapper-protocol.ts +32 -0
  245. package/src/utils/accessible-metadata.ts +26 -0
  246. package/src/utils/create-element-component.ts +77 -0
  247. package/src/utils/gtype.ts +166 -0
  248. package/src/utils/notify-name.ts +10 -0
  249. package/src/utils/object-prop.ts +13 -0
  250. package/src/utils/settings-accessor.ts +89 -0
  251. package/src/utils/wrapper-node-jsx.ts +34 -0
  252. package/dist/components/compound.d.ts +0 -40
  253. package/dist/components/compound.d.ts.map +0 -1
  254. package/dist/components/compound.js +0 -46
  255. package/dist/components/compound.js.map +0 -1
  256. package/dist/components/list.d.ts +0 -75
  257. package/dist/components/list.d.ts.map +0 -1
  258. package/dist/components/list.js +0 -81
  259. package/dist/components/list.js.map +0 -1
  260. package/dist/components/slot-widget.d.ts +0 -15
  261. package/dist/components/slot-widget.d.ts.map +0 -1
  262. package/dist/components/slot-widget.js +0 -37
  263. package/dist/components/slot-widget.js.map +0 -1
  264. package/dist/errors.d.ts +0 -15
  265. package/dist/errors.d.ts.map +0 -1
  266. package/dist/errors.js +0 -44
  267. package/dist/errors.js.map +0 -1
  268. package/dist/factory.d.ts +0 -5
  269. package/dist/factory.d.ts.map +0 -1
  270. package/dist/factory.js +0 -37
  271. package/dist/factory.js.map +0 -1
  272. package/dist/generated/compounds.d.ts +0 -2672
  273. package/dist/generated/compounds.d.ts.map +0 -1
  274. package/dist/generated/compounds.js +0 -2624
  275. package/dist/generated/compounds.js.map +0 -1
  276. package/dist/generated/internal.d.ts +0 -16
  277. package/dist/generated/internal.d.ts.map +0 -1
  278. package/dist/generated/internal.js +0 -3638
  279. package/dist/generated/internal.js.map +0 -1
  280. package/dist/generated/jsx.d.ts +0 -17074
  281. package/dist/generated/jsx.d.ts.map +0 -1
  282. package/dist/generated/jsx.js +0 -6715
  283. package/dist/generated/jsx.js.map +0 -1
  284. package/dist/generated/registry.d.ts +0 -5
  285. package/dist/generated/registry.d.ts.map +0 -1
  286. package/dist/generated/registry.js +0 -13
  287. package/dist/generated/registry.js.map +0 -1
  288. package/dist/host-config.d.ts +0 -24
  289. package/dist/host-config.d.ts.map +0 -1
  290. package/dist/host-config.js +0 -172
  291. package/dist/host-config.js.map +0 -1
  292. package/dist/jsx.d.ts +0 -974
  293. package/dist/jsx.d.ts.map +0 -1
  294. package/dist/jsx.js +0 -8
  295. package/dist/jsx.js.map +0 -1
  296. package/dist/metadata.d.ts +0 -5
  297. package/dist/metadata.d.ts.map +0 -1
  298. package/dist/metadata.js +0 -33
  299. package/dist/metadata.js.map +0 -1
  300. package/dist/node.d.ts +0 -25
  301. package/dist/node.d.ts.map +0 -1
  302. package/dist/node.js +0 -85
  303. package/dist/node.js.map +0 -1
  304. package/dist/nodes/adjustable.d.ts +0 -11
  305. package/dist/nodes/adjustable.d.ts.map +0 -1
  306. package/dist/nodes/adjustable.js +0 -46
  307. package/dist/nodes/adjustable.js.map +0 -1
  308. package/dist/nodes/alert-dialog-response.d.ts +0 -15
  309. package/dist/nodes/alert-dialog-response.d.ts.map +0 -1
  310. package/dist/nodes/alert-dialog-response.js +0 -61
  311. package/dist/nodes/alert-dialog-response.js.map +0 -1
  312. package/dist/nodes/alert-dialog.d.ts +0 -14
  313. package/dist/nodes/alert-dialog.d.ts.map +0 -1
  314. package/dist/nodes/alert-dialog.js +0 -41
  315. package/dist/nodes/alert-dialog.js.map +0 -1
  316. package/dist/nodes/animation.d.ts +0 -39
  317. package/dist/nodes/animation.d.ts.map +0 -1
  318. package/dist/nodes/animation.js +0 -326
  319. package/dist/nodes/animation.js.map +0 -1
  320. package/dist/nodes/application.d.ts +0 -12
  321. package/dist/nodes/application.d.ts.map +0 -1
  322. package/dist/nodes/application.js +0 -51
  323. package/dist/nodes/application.js.map +0 -1
  324. package/dist/nodes/calendar.d.ts +0 -18
  325. package/dist/nodes/calendar.d.ts.map +0 -1
  326. package/dist/nodes/calendar.js +0 -28
  327. package/dist/nodes/calendar.js.map +0 -1
  328. package/dist/nodes/color-dialog-button.d.ts +0 -15
  329. package/dist/nodes/color-dialog-button.d.ts.map +0 -1
  330. package/dist/nodes/color-dialog-button.js +0 -43
  331. package/dist/nodes/color-dialog-button.js.map +0 -1
  332. package/dist/nodes/column-view-column.d.ts +0 -36
  333. package/dist/nodes/column-view-column.d.ts.map +0 -1
  334. package/dist/nodes/column-view-column.js +0 -168
  335. package/dist/nodes/column-view-column.js.map +0 -1
  336. package/dist/nodes/container-slot.d.ts +0 -18
  337. package/dist/nodes/container-slot.d.ts.map +0 -1
  338. package/dist/nodes/container-slot.js +0 -81
  339. package/dist/nodes/container-slot.js.map +0 -1
  340. package/dist/nodes/dialog.d.ts +0 -10
  341. package/dist/nodes/dialog.d.ts.map +0 -1
  342. package/dist/nodes/dialog.js +0 -20
  343. package/dist/nodes/dialog.js.map +0 -1
  344. package/dist/nodes/drawing-area.d.ts +0 -19
  345. package/dist/nodes/drawing-area.d.ts.map +0 -1
  346. package/dist/nodes/drawing-area.js +0 -40
  347. package/dist/nodes/drawing-area.js.map +0 -1
  348. package/dist/nodes/event-controller.d.ts +0 -15
  349. package/dist/nodes/event-controller.d.ts.map +0 -1
  350. package/dist/nodes/event-controller.js +0 -73
  351. package/dist/nodes/event-controller.js.map +0 -1
  352. package/dist/nodes/fixed-child.d.ts +0 -19
  353. package/dist/nodes/fixed-child.d.ts.map +0 -1
  354. package/dist/nodes/fixed-child.js +0 -99
  355. package/dist/nodes/fixed-child.js.map +0 -1
  356. package/dist/nodes/font-dialog-button.d.ts +0 -15
  357. package/dist/nodes/font-dialog-button.d.ts.map +0 -1
  358. package/dist/nodes/font-dialog-button.js +0 -76
  359. package/dist/nodes/font-dialog-button.js.map +0 -1
  360. package/dist/nodes/grid-child.d.ts +0 -19
  361. package/dist/nodes/grid-child.d.ts.map +0 -1
  362. package/dist/nodes/grid-child.js +0 -94
  363. package/dist/nodes/grid-child.js.map +0 -1
  364. package/dist/nodes/internal/accessible.d.ts +0 -5
  365. package/dist/nodes/internal/accessible.d.ts.map +0 -1
  366. package/dist/nodes/internal/accessible.js +0 -119
  367. package/dist/nodes/internal/accessible.js.map +0 -1
  368. package/dist/nodes/internal/bound-item.d.ts +0 -4
  369. package/dist/nodes/internal/bound-item.d.ts.map +0 -1
  370. package/dist/nodes/internal/bound-item.js +0 -2
  371. package/dist/nodes/internal/bound-item.js.map +0 -1
  372. package/dist/nodes/internal/construct.d.ts +0 -3
  373. package/dist/nodes/internal/construct.d.ts.map +0 -1
  374. package/dist/nodes/internal/construct.js +0 -44
  375. package/dist/nodes/internal/construct.js.map +0 -1
  376. package/dist/nodes/internal/predicates.d.ts +0 -51
  377. package/dist/nodes/internal/predicates.d.ts.map +0 -1
  378. package/dist/nodes/internal/predicates.js +0 -36
  379. package/dist/nodes/internal/predicates.js.map +0 -1
  380. package/dist/nodes/internal/props.d.ts +0 -6
  381. package/dist/nodes/internal/props.d.ts.map +0 -1
  382. package/dist/nodes/internal/props.js +0 -43
  383. package/dist/nodes/internal/props.js.map +0 -1
  384. package/dist/nodes/internal/signal-store.d.ts +0 -22
  385. package/dist/nodes/internal/signal-store.d.ts.map +0 -1
  386. package/dist/nodes/internal/signal-store.js +0 -98
  387. package/dist/nodes/internal/signal-store.js.map +0 -1
  388. package/dist/nodes/internal/text-buffer-controller.d.ts +0 -40
  389. package/dist/nodes/internal/text-buffer-controller.d.ts.map +0 -1
  390. package/dist/nodes/internal/text-buffer-controller.js +0 -327
  391. package/dist/nodes/internal/text-buffer-controller.js.map +0 -1
  392. package/dist/nodes/internal/widget.d.ts +0 -8
  393. package/dist/nodes/internal/widget.d.ts.map +0 -1
  394. package/dist/nodes/internal/widget.js +0 -68
  395. package/dist/nodes/internal/widget.js.map +0 -1
  396. package/dist/nodes/level-bar.d.ts +0 -12
  397. package/dist/nodes/level-bar.d.ts.map +0 -1
  398. package/dist/nodes/level-bar.js +0 -24
  399. package/dist/nodes/level-bar.js.map +0 -1
  400. package/dist/nodes/list-item-node.d.ts +0 -12
  401. package/dist/nodes/list-item-node.d.ts.map +0 -1
  402. package/dist/nodes/list-item-node.js +0 -45
  403. package/dist/nodes/list-item-node.js.map +0 -1
  404. package/dist/nodes/list.d.ts +0 -100
  405. package/dist/nodes/list.d.ts.map +0 -1
  406. package/dist/nodes/list.js +0 -950
  407. package/dist/nodes/list.js.map +0 -1
  408. package/dist/nodes/menu.d.ts +0 -7
  409. package/dist/nodes/menu.d.ts.map +0 -1
  410. package/dist/nodes/menu.js +0 -20
  411. package/dist/nodes/menu.js.map +0 -1
  412. package/dist/nodes/models/menu.d.ts +0 -47
  413. package/dist/nodes/models/menu.d.ts.map +0 -1
  414. package/dist/nodes/models/menu.js +0 -240
  415. package/dist/nodes/models/menu.js.map +0 -1
  416. package/dist/nodes/navigation-page.d.ts +0 -19
  417. package/dist/nodes/navigation-page.d.ts.map +0 -1
  418. package/dist/nodes/navigation-page.js +0 -129
  419. package/dist/nodes/navigation-page.js.map +0 -1
  420. package/dist/nodes/navigation-view.d.ts +0 -19
  421. package/dist/nodes/navigation-view.d.ts.map +0 -1
  422. package/dist/nodes/navigation-view.js +0 -51
  423. package/dist/nodes/navigation-view.js.map +0 -1
  424. package/dist/nodes/notebook-page-tab.d.ts +0 -15
  425. package/dist/nodes/notebook-page-tab.d.ts.map +0 -1
  426. package/dist/nodes/notebook-page-tab.js +0 -40
  427. package/dist/nodes/notebook-page-tab.js.map +0 -1
  428. package/dist/nodes/notebook-page.d.ts +0 -29
  429. package/dist/nodes/notebook-page.d.ts.map +0 -1
  430. package/dist/nodes/notebook-page.js +0 -151
  431. package/dist/nodes/notebook-page.js.map +0 -1
  432. package/dist/nodes/notebook.d.ts +0 -16
  433. package/dist/nodes/notebook.d.ts.map +0 -1
  434. package/dist/nodes/notebook.js +0 -31
  435. package/dist/nodes/notebook.js.map +0 -1
  436. package/dist/nodes/overlay-child.d.ts +0 -20
  437. package/dist/nodes/overlay-child.d.ts.map +0 -1
  438. package/dist/nodes/overlay-child.js +0 -109
  439. package/dist/nodes/overlay-child.js.map +0 -1
  440. package/dist/nodes/popover-menu.d.ts +0 -19
  441. package/dist/nodes/popover-menu.d.ts.map +0 -1
  442. package/dist/nodes/popover-menu.js +0 -54
  443. package/dist/nodes/popover-menu.js.map +0 -1
  444. package/dist/nodes/scale.d.ts +0 -10
  445. package/dist/nodes/scale.d.ts.map +0 -1
  446. package/dist/nodes/scale.js +0 -19
  447. package/dist/nodes/scale.js.map +0 -1
  448. package/dist/nodes/scrolled-window.d.ts +0 -11
  449. package/dist/nodes/scrolled-window.d.ts.map +0 -1
  450. package/dist/nodes/scrolled-window.js +0 -18
  451. package/dist/nodes/scrolled-window.js.map +0 -1
  452. package/dist/nodes/search-bar.d.ts +0 -11
  453. package/dist/nodes/search-bar.d.ts.map +0 -1
  454. package/dist/nodes/search-bar.js +0 -16
  455. package/dist/nodes/search-bar.js.map +0 -1
  456. package/dist/nodes/shortcut.d.ts +0 -19
  457. package/dist/nodes/shortcut.d.ts.map +0 -1
  458. package/dist/nodes/shortcut.js +0 -72
  459. package/dist/nodes/shortcut.js.map +0 -1
  460. package/dist/nodes/slot.d.ts +0 -21
  461. package/dist/nodes/slot.d.ts.map +0 -1
  462. package/dist/nodes/slot.js +0 -102
  463. package/dist/nodes/slot.js.map +0 -1
  464. package/dist/nodes/source-view.d.ts +0 -18
  465. package/dist/nodes/source-view.d.ts.map +0 -1
  466. package/dist/nodes/source-view.js +0 -94
  467. package/dist/nodes/source-view.js.map +0 -1
  468. package/dist/nodes/spin-row.d.ts +0 -14
  469. package/dist/nodes/spin-row.d.ts.map +0 -1
  470. package/dist/nodes/spin-row.js +0 -46
  471. package/dist/nodes/spin-row.js.map +0 -1
  472. package/dist/nodes/stack-page.d.ts +0 -22
  473. package/dist/nodes/stack-page.d.ts.map +0 -1
  474. package/dist/nodes/stack-page.js +0 -140
  475. package/dist/nodes/stack-page.js.map +0 -1
  476. package/dist/nodes/stack.d.ts +0 -13
  477. package/dist/nodes/stack.d.ts.map +0 -1
  478. package/dist/nodes/stack.js +0 -21
  479. package/dist/nodes/stack.js.map +0 -1
  480. package/dist/nodes/switch-row.d.ts +0 -11
  481. package/dist/nodes/switch-row.d.ts.map +0 -1
  482. package/dist/nodes/switch-row.js +0 -15
  483. package/dist/nodes/switch-row.js.map +0 -1
  484. package/dist/nodes/text-anchor.d.ts +0 -23
  485. package/dist/nodes/text-anchor.d.ts.map +0 -1
  486. package/dist/nodes/text-anchor.js +0 -74
  487. package/dist/nodes/text-anchor.js.map +0 -1
  488. package/dist/nodes/text-content.d.ts +0 -12
  489. package/dist/nodes/text-content.d.ts.map +0 -1
  490. package/dist/nodes/text-content.js +0 -2
  491. package/dist/nodes/text-content.js.map +0 -1
  492. package/dist/nodes/text-paintable.d.ts +0 -19
  493. package/dist/nodes/text-paintable.d.ts.map +0 -1
  494. package/dist/nodes/text-paintable.js +0 -42
  495. package/dist/nodes/text-paintable.js.map +0 -1
  496. package/dist/nodes/text-segment.d.ts +0 -18
  497. package/dist/nodes/text-segment.d.ts.map +0 -1
  498. package/dist/nodes/text-segment.js +0 -38
  499. package/dist/nodes/text-segment.js.map +0 -1
  500. package/dist/nodes/text-tag.d.ts +0 -38
  501. package/dist/nodes/text-tag.d.ts.map +0 -1
  502. package/dist/nodes/text-tag.js +0 -247
  503. package/dist/nodes/text-tag.js.map +0 -1
  504. package/dist/nodes/text-view.d.ts +0 -29
  505. package/dist/nodes/text-view.d.ts.map +0 -1
  506. package/dist/nodes/text-view.js +0 -80
  507. package/dist/nodes/text-view.js.map +0 -1
  508. package/dist/nodes/toggle-group.d.ts +0 -17
  509. package/dist/nodes/toggle-group.d.ts.map +0 -1
  510. package/dist/nodes/toggle-group.js +0 -65
  511. package/dist/nodes/toggle-group.js.map +0 -1
  512. package/dist/nodes/toggle.d.ts +0 -16
  513. package/dist/nodes/toggle.d.ts.map +0 -1
  514. package/dist/nodes/toggle.js +0 -61
  515. package/dist/nodes/toggle.js.map +0 -1
  516. package/dist/nodes/virtual.d.ts +0 -7
  517. package/dist/nodes/virtual.d.ts.map +0 -1
  518. package/dist/nodes/virtual.js +0 -9
  519. package/dist/nodes/virtual.js.map +0 -1
  520. package/dist/nodes/web-view.d.ts +0 -11
  521. package/dist/nodes/web-view.d.ts.map +0 -1
  522. package/dist/nodes/web-view.js +0 -16
  523. package/dist/nodes/web-view.js.map +0 -1
  524. package/dist/nodes/widget.d.ts +0 -26
  525. package/dist/nodes/widget.d.ts.map +0 -1
  526. package/dist/nodes/widget.js +0 -308
  527. package/dist/nodes/widget.js.map +0 -1
  528. package/dist/nodes/window.d.ts +0 -31
  529. package/dist/nodes/window.d.ts.map +0 -1
  530. package/dist/nodes/window.js +0 -122
  531. package/dist/nodes/window.js.map +0 -1
  532. package/dist/portal.d.ts +0 -29
  533. package/dist/portal.d.ts.map +0 -1
  534. package/dist/portal.js +0 -35
  535. package/dist/portal.js.map +0 -1
  536. package/dist/reconciler.d.ts +0 -34
  537. package/dist/reconciler.d.ts.map +0 -1
  538. package/dist/reconciler.js +0 -48
  539. package/dist/reconciler.js.map +0 -1
  540. package/dist/registry.d.ts +0 -18
  541. package/dist/registry.d.ts.map +0 -1
  542. package/dist/registry.js +0 -98
  543. package/dist/registry.js.map +0 -1
  544. package/dist/render.d.ts +0 -117
  545. package/dist/render.d.ts.map +0 -1
  546. package/dist/render.js +0 -159
  547. package/dist/render.js.map +0 -1
  548. package/dist/types.d.ts +0 -6
  549. package/dist/types.d.ts.map +0 -1
  550. package/dist/types.js.map +0 -1
  551. package/dist/use-property.d.ts +0 -29
  552. package/dist/use-property.d.ts.map +0 -1
  553. package/dist/use-property.js +0 -44
  554. package/dist/use-property.js.map +0 -1
  555. package/dist/use-setting.d.ts +0 -36
  556. package/dist/use-setting.d.ts.map +0 -1
  557. package/dist/use-setting.js +0 -68
  558. package/dist/use-setting.js.map +0 -1
  559. package/src/components/compound.tsx +0 -57
  560. package/src/components/list.tsx +0 -140
  561. package/src/components/slot-widget.tsx +0 -46
  562. package/src/errors.ts +0 -53
  563. package/src/factory.ts +0 -62
  564. package/src/generated/compounds.ts +0 -2741
  565. package/src/generated/internal.ts +0 -3642
  566. package/src/generated/jsx.ts +0 -17383
  567. package/src/generated/registry.ts +0 -17
  568. package/src/host-config.ts +0 -219
  569. package/src/jsx.ts +0 -1033
  570. package/src/metadata.ts +0 -43
  571. package/src/node.ts +0 -107
  572. package/src/nodes/adjustable.ts +0 -68
  573. package/src/nodes/alert-dialog-response.ts +0 -78
  574. package/src/nodes/alert-dialog.ts +0 -55
  575. package/src/nodes/animation.ts +0 -409
  576. package/src/nodes/application.ts +0 -61
  577. package/src/nodes/calendar.ts +0 -42
  578. package/src/nodes/color-dialog-button.ts +0 -69
  579. package/src/nodes/column-view-column.ts +0 -189
  580. package/src/nodes/container-slot.ts +0 -100
  581. package/src/nodes/dialog.ts +0 -25
  582. package/src/nodes/drawing-area.ts +0 -53
  583. package/src/nodes/event-controller.ts +0 -96
  584. package/src/nodes/fixed-child.ts +0 -122
  585. package/src/nodes/font-dialog-button.ts +0 -107
  586. package/src/nodes/grid-child.ts +0 -116
  587. package/src/nodes/internal/accessible.ts +0 -155
  588. package/src/nodes/internal/bound-item.ts +0 -4
  589. package/src/nodes/internal/construct.ts +0 -60
  590. package/src/nodes/internal/predicates.ts +0 -80
  591. package/src/nodes/internal/props.ts +0 -51
  592. package/src/nodes/internal/signal-store.ts +0 -141
  593. package/src/nodes/internal/text-buffer-controller.ts +0 -417
  594. package/src/nodes/internal/widget.ts +0 -74
  595. package/src/nodes/level-bar.ts +0 -36
  596. package/src/nodes/list-item-node.ts +0 -53
  597. package/src/nodes/list.ts +0 -1082
  598. package/src/nodes/menu.ts +0 -27
  599. package/src/nodes/models/menu.ts +0 -314
  600. package/src/nodes/navigation-page.ts +0 -154
  601. package/src/nodes/navigation-view.ts +0 -66
  602. package/src/nodes/notebook-page-tab.ts +0 -55
  603. package/src/nodes/notebook-page.ts +0 -189
  604. package/src/nodes/notebook.ts +0 -42
  605. package/src/nodes/overlay-child.ts +0 -130
  606. package/src/nodes/popover-menu.ts +0 -67
  607. package/src/nodes/scale.ts +0 -28
  608. package/src/nodes/scrolled-window.ts +0 -23
  609. package/src/nodes/search-bar.ts +0 -27
  610. package/src/nodes/shortcut.ts +0 -86
  611. package/src/nodes/slot.ts +0 -138
  612. package/src/nodes/source-view.ts +0 -130
  613. package/src/nodes/spin-row.ts +0 -72
  614. package/src/nodes/stack-page.ts +0 -170
  615. package/src/nodes/stack.ts +0 -35
  616. package/src/nodes/switch-row.ts +0 -26
  617. package/src/nodes/text-anchor.ts +0 -88
  618. package/src/nodes/text-content.ts +0 -14
  619. package/src/nodes/text-paintable.ts +0 -51
  620. package/src/nodes/text-segment.ts +0 -55
  621. package/src/nodes/text-tag.ts +0 -298
  622. package/src/nodes/text-view.ts +0 -100
  623. package/src/nodes/toggle-group.ts +0 -81
  624. package/src/nodes/toggle.ts +0 -72
  625. package/src/nodes/virtual.ts +0 -16
  626. package/src/nodes/web-view.ts +0 -22
  627. package/src/nodes/widget.ts +0 -369
  628. package/src/nodes/window.ts +0 -172
  629. package/src/portal.ts +0 -37
  630. package/src/reconciler.ts +0 -52
  631. package/src/registry.ts +0 -119
  632. package/src/render.tsx +0 -192
  633. package/src/types.ts +0 -13
  634. package/src/use-property.ts +0 -58
  635. package/src/use-setting.ts +0 -96
  636. /package/dist/{types.js → reconciler/types.js} +0 -0
@@ -1,116 +0,0 @@
1
- import * as Gtk from "@gtkx/ffi/gtk";
2
- import type { GridChildProps } from "../jsx.js";
3
- import type { Node } from "../node.js";
4
- import { isRemovable } from "./internal/predicates.js";
5
- import { hasChanged } from "./internal/props.js";
6
- import { VirtualNode } from "./virtual.js";
7
- import { WidgetNode } from "./widget.js";
8
-
9
- export class GridChildNode extends VirtualNode<GridChildProps, WidgetNode<Gtk.Grid>, WidgetNode> {
10
- public override isValidChild(child: Node): boolean {
11
- return child instanceof WidgetNode;
12
- }
13
-
14
- public override isValidParent(parent: Node): boolean {
15
- return parent instanceof WidgetNode && parent.container instanceof Gtk.Grid;
16
- }
17
-
18
- public override setParent(parent: WidgetNode<Gtk.Grid> | null): void {
19
- if (!parent && this.parent && this.children[0]) {
20
- this.detachFromParent(this.parent.container, this.children[0].container);
21
- }
22
-
23
- super.setParent(parent);
24
-
25
- if (parent && this.children[0]) {
26
- this.attachToParent(parent.container, this.children[0].container);
27
- }
28
- }
29
-
30
- public override appendChild(child: WidgetNode): void {
31
- super.appendChild(child);
32
-
33
- if (this.parent) {
34
- this.detachFromGtkParent(child.container);
35
- this.attachToParent(this.parent.container, child.container);
36
- }
37
- }
38
-
39
- public override removeChild(child: WidgetNode): void {
40
- if (this.parent) {
41
- this.detachFromParent(this.parent.container, child.container);
42
- }
43
-
44
- super.removeChild(child);
45
- }
46
-
47
- public override commitUpdate(oldProps: GridChildProps | null, newProps: GridChildProps): void {
48
- super.commitUpdate(oldProps, newProps);
49
-
50
- const positionChanged =
51
- hasChanged(oldProps, newProps, "column") ||
52
- hasChanged(oldProps, newProps, "row") ||
53
- hasChanged(oldProps, newProps, "columnSpan") ||
54
- hasChanged(oldProps, newProps, "rowSpan");
55
-
56
- if (positionChanged && this.parent && this.children[0]) {
57
- this.reattachChild();
58
- }
59
- }
60
-
61
- public override detachDeletedInstance(): void {
62
- if (this.parent && this.children[0]) {
63
- this.detachFromParent(this.parent.container, this.children[0].container);
64
- }
65
- super.detachDeletedInstance();
66
- }
67
-
68
- private attachToParent(parent: Gtk.Grid, child: Gtk.Widget): void {
69
- const column = this.props.column ?? 0;
70
- const row = this.props.row ?? 0;
71
- const columnSpan = this.props.columnSpan ?? 1;
72
- const rowSpan = this.props.rowSpan ?? 1;
73
-
74
- const existingChild = parent.getChildAt(column, row);
75
- if (existingChild && existingChild !== child) {
76
- parent.remove(existingChild);
77
- }
78
-
79
- parent.attach(child, column, row, columnSpan, rowSpan);
80
- }
81
-
82
- private detachFromParent(parent: Gtk.Grid, child: Gtk.Widget): void {
83
- const childParent = child.getParent();
84
- if (childParent && childParent === parent) {
85
- parent.remove(child);
86
- }
87
- }
88
-
89
- private detachFromGtkParent(child: Gtk.Widget): void {
90
- const currentParent = child.getParent();
91
- if (currentParent !== null) {
92
- if (isRemovable(currentParent)) {
93
- currentParent.remove(child);
94
- } else {
95
- child.unparent();
96
- }
97
- }
98
- }
99
-
100
- private reattachChild(): void {
101
- if (!this.parent || !this.children[0]) return;
102
-
103
- const column = this.props.column ?? 0;
104
- const row = this.props.row ?? 0;
105
- const columnSpan = this.props.columnSpan ?? 1;
106
- const rowSpan = this.props.rowSpan ?? 1;
107
-
108
- const existingChild = this.parent.container.getChildAt(column, row);
109
- if (existingChild && existingChild !== this.children[0].container) {
110
- this.parent.container.remove(existingChild);
111
- }
112
-
113
- this.parent.container.remove(this.children[0].container);
114
- this.parent.container.attach(this.children[0].container, column, row, columnSpan, rowSpan);
115
- }
116
- }
@@ -1,155 +0,0 @@
1
- import type * as GObject from "@gtkx/ffi/gobject";
2
- import { Value } from "@gtkx/ffi/gobject";
3
- import * as Gtk from "@gtkx/ffi/gtk";
4
- import type { Props } from "../../types.js";
5
-
6
- type CreateValue = (jsValue: unknown) => Value;
7
-
8
- type PropertyDef = {
9
- kind: "property";
10
- enumValue: Gtk.AccessibleProperty;
11
- createValue: CreateValue;
12
- };
13
-
14
- type StateDef = {
15
- kind: "state";
16
- enumValue: Gtk.AccessibleState;
17
- createValue: CreateValue;
18
- };
19
-
20
- type RelationDef = {
21
- kind: "relation";
22
- enumValue: Gtk.AccessibleRelation;
23
- createValue: CreateValue;
24
- };
25
-
26
- type AccessiblePropDef = PropertyDef | StateDef | RelationDef;
27
-
28
- const fromString: CreateValue = (val) => Value.newFromString(val as string);
29
- const fromBoolean: CreateValue = (val) => Value.newFromBoolean(val as boolean);
30
- const fromInt: CreateValue = (val) => Value.newFromInt(val as number);
31
- const fromDouble: CreateValue = (val) => Value.newFromDouble(val as number);
32
- const fromObject: CreateValue = (val) => Value.newFromObject((val as GObject.Object) ?? null);
33
-
34
- const fromRefList: CreateValue = (val) => {
35
- const widgets = val as Gtk.Accessible[];
36
- const list = Gtk.AccessibleList.newFromList(widgets);
37
- return Value.newFromBoxed(list);
38
- };
39
-
40
- const prop = (enumValue: Gtk.AccessibleProperty, createValue: CreateValue): PropertyDef => ({
41
- kind: "property",
42
- enumValue,
43
- createValue,
44
- });
45
-
46
- const state = (enumValue: Gtk.AccessibleState, createValue: CreateValue): StateDef => ({
47
- kind: "state",
48
- enumValue,
49
- createValue,
50
- });
51
-
52
- const relation = (enumValue: Gtk.AccessibleRelation, createValue: CreateValue): RelationDef => ({
53
- kind: "relation",
54
- enumValue,
55
- createValue,
56
- });
57
-
58
- const ACCESSIBLE_PROP_MAP: Record<string, AccessiblePropDef> = {
59
- accessibleAutocomplete: prop(Gtk.AccessibleProperty.AUTOCOMPLETE, fromInt),
60
- accessibleDescription: prop(Gtk.AccessibleProperty.DESCRIPTION, fromString),
61
- accessibleHasPopup: prop(Gtk.AccessibleProperty.HAS_POPUP, fromBoolean),
62
- accessibleKeyShortcuts: prop(Gtk.AccessibleProperty.KEY_SHORTCUTS, fromString),
63
- accessibleLabel: prop(Gtk.AccessibleProperty.LABEL, fromString),
64
- accessibleLevel: prop(Gtk.AccessibleProperty.LEVEL, fromInt),
65
- accessibleModal: prop(Gtk.AccessibleProperty.MODAL, fromBoolean),
66
- accessibleMultiLine: prop(Gtk.AccessibleProperty.MULTI_LINE, fromBoolean),
67
- accessibleMultiSelectable: prop(Gtk.AccessibleProperty.MULTI_SELECTABLE, fromBoolean),
68
- accessibleOrientation: prop(Gtk.AccessibleProperty.ORIENTATION, fromInt),
69
- accessiblePlaceholder: prop(Gtk.AccessibleProperty.PLACEHOLDER, fromString),
70
- accessibleReadOnly: prop(Gtk.AccessibleProperty.READ_ONLY, fromBoolean),
71
- accessibleRequired: prop(Gtk.AccessibleProperty.REQUIRED, fromBoolean),
72
- accessibleRoleDescription: prop(Gtk.AccessibleProperty.ROLE_DESCRIPTION, fromString),
73
- accessibleSort: prop(Gtk.AccessibleProperty.SORT, fromInt),
74
- accessibleValueMax: prop(Gtk.AccessibleProperty.VALUE_MAX, fromDouble),
75
- accessibleValueMin: prop(Gtk.AccessibleProperty.VALUE_MIN, fromDouble),
76
- accessibleValueNow: prop(Gtk.AccessibleProperty.VALUE_NOW, fromDouble),
77
- accessibleValueText: prop(Gtk.AccessibleProperty.VALUE_TEXT, fromString),
78
- accessibleHelpText: prop(Gtk.AccessibleProperty.HELP_TEXT, fromString),
79
-
80
- accessibleBusy: state(Gtk.AccessibleState.BUSY, fromBoolean),
81
- accessibleChecked: state(Gtk.AccessibleState.CHECKED, fromInt),
82
- accessibleDisabled: state(Gtk.AccessibleState.DISABLED, fromBoolean),
83
- accessibleExpanded: state(Gtk.AccessibleState.EXPANDED, fromInt),
84
- accessibleHidden: state(Gtk.AccessibleState.HIDDEN, fromBoolean),
85
- accessibleInvalid: state(Gtk.AccessibleState.INVALID, fromInt),
86
- accessiblePressed: state(Gtk.AccessibleState.PRESSED, fromInt),
87
- accessibleSelected: state(Gtk.AccessibleState.SELECTED, fromInt),
88
- accessibleVisited: state(Gtk.AccessibleState.VISITED, fromInt),
89
-
90
- accessibleActiveDescendant: relation(Gtk.AccessibleRelation.ACTIVE_DESCENDANT, fromObject),
91
- accessibleColCount: relation(Gtk.AccessibleRelation.COL_COUNT, fromInt),
92
- accessibleColIndex: relation(Gtk.AccessibleRelation.COL_INDEX, fromInt),
93
- accessibleColIndexText: relation(Gtk.AccessibleRelation.COL_INDEX_TEXT, fromString),
94
- accessibleColSpan: relation(Gtk.AccessibleRelation.COL_SPAN, fromInt),
95
- accessibleControls: relation(Gtk.AccessibleRelation.CONTROLS, fromRefList),
96
- accessibleDescribedBy: relation(Gtk.AccessibleRelation.DESCRIBED_BY, fromRefList),
97
- accessibleDetails: relation(Gtk.AccessibleRelation.DETAILS, fromRefList),
98
- accessibleErrorMessage: relation(Gtk.AccessibleRelation.ERROR_MESSAGE, fromRefList),
99
- accessibleFlowTo: relation(Gtk.AccessibleRelation.FLOW_TO, fromRefList),
100
- accessibleLabelledBy: relation(Gtk.AccessibleRelation.LABELLED_BY, fromRefList),
101
- accessibleOwns: relation(Gtk.AccessibleRelation.OWNS, fromRefList),
102
- accessiblePosInSet: relation(Gtk.AccessibleRelation.POS_IN_SET, fromInt),
103
- accessibleRowCount: relation(Gtk.AccessibleRelation.ROW_COUNT, fromInt),
104
- accessibleRowIndex: relation(Gtk.AccessibleRelation.ROW_INDEX, fromInt),
105
- accessibleRowIndexText: relation(Gtk.AccessibleRelation.ROW_INDEX_TEXT, fromString),
106
- accessibleRowSpan: relation(Gtk.AccessibleRelation.ROW_SPAN, fromInt),
107
- accessibleSetSize: relation(Gtk.AccessibleRelation.SET_SIZE, fromInt),
108
- };
109
-
110
- export const isAccessibleProp = (name: string): boolean => name in ACCESSIBLE_PROP_MAP;
111
-
112
- function applyDef(widget: Gtk.Widget, def: AccessiblePropDef, newValue: unknown): void {
113
- const gvalue = def.createValue(newValue);
114
-
115
- switch (def.kind) {
116
- case "property":
117
- widget.updatePropertyValue(1, [def.enumValue], [gvalue]);
118
- break;
119
- case "state":
120
- widget.updateStateValue(1, [def.enumValue], [gvalue]);
121
- break;
122
- case "relation":
123
- widget.updateRelationValue(1, [def.enumValue], [gvalue]);
124
- break;
125
- }
126
- }
127
-
128
- function resetDef(widget: Gtk.Widget, def: AccessiblePropDef): void {
129
- switch (def.kind) {
130
- case "property":
131
- widget.resetProperty(def.enumValue);
132
- break;
133
- case "state":
134
- widget.resetState(def.enumValue);
135
- break;
136
- case "relation":
137
- widget.resetRelation(def.enumValue);
138
- break;
139
- }
140
- }
141
-
142
- export const applyAccessibleProps = (widget: Gtk.Widget, oldProps: Props | null, newProps: Props): void => {
143
- for (const [name, def] of Object.entries(ACCESSIBLE_PROP_MAP)) {
144
- const oldValue = oldProps?.[name];
145
- const newValue = newProps[name];
146
-
147
- if (oldValue === newValue) continue;
148
-
149
- if (newValue === undefined) {
150
- resetDef(widget, def);
151
- } else {
152
- applyDef(widget, def, newValue);
153
- }
154
- }
155
- };
@@ -1,4 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import type { Container } from "../../types.js";
3
-
4
- export type BoundItem = [ReactNode, Container, string];
@@ -1,60 +0,0 @@
1
- import type { NativeClass, Type } from "@gtkx/ffi";
2
- import { Object as GObject, Value } from "@gtkx/ffi/gobject";
3
- import { CONSTRUCTION_META } from "../../generated/internal.js";
4
- import type { Container, ContainerClass, Props } from "../../types.js";
5
-
6
- type ConstructionPropMeta = {
7
- girName: string;
8
- ffiType: Type;
9
- constructOnly?: true;
10
- };
11
-
12
- function collectConstructionProps(
13
- containerClass: ContainerClass,
14
- props: Props,
15
- ): Array<{ girName: string; ffiType: Type; value: unknown }> {
16
- const result: Array<{ girName: string; ffiType: Type; value: unknown }> = [];
17
- const seen = new Set<string>();
18
-
19
- // biome-ignore lint/complexity/noBannedTypes: Walking prototype chain requires Function type
20
- let current: Function | null = containerClass;
21
- while (current) {
22
- const typeName = (current as NativeClass).glibTypeName;
23
- if (!typeName) break;
24
-
25
- const meta: Record<string, ConstructionPropMeta> | undefined = CONSTRUCTION_META[typeName];
26
- if (meta) {
27
- for (const [camelName, propMeta] of Object.entries(meta)) {
28
- if (seen.has(camelName)) continue;
29
- seen.add(camelName);
30
- if (props[camelName] !== undefined) {
31
- result.push({
32
- girName: propMeta.girName,
33
- ffiType: propMeta.ffiType,
34
- value: props[camelName],
35
- });
36
- }
37
- }
38
- }
39
-
40
- current = Object.getPrototypeOf(current);
41
- if (current === Object || current === Function) break;
42
- }
43
-
44
- return result;
45
- }
46
-
47
- export function createContainerWithProperties(containerClass: ContainerClass, props: Props): Container {
48
- const gtype = containerClass.getGType();
49
- const constructionProps = collectConstructionProps(containerClass, props);
50
-
51
- const names: string[] = [];
52
- const values: Value[] = [];
53
-
54
- for (const { girName, ffiType, value } of constructionProps) {
55
- names.push(girName);
56
- values.push(Value.newFrom(ffiType, value));
57
- }
58
-
59
- return GObject.newWithProperties(gtype, names, values) as unknown as Container;
60
- }
@@ -1,80 +0,0 @@
1
- /**
2
- * Runtime type predicates for GTK widget capability detection.
3
- *
4
- * These predicates check for specific APIs that widgets may or may not expose.
5
- * GTK widgets don't have a consistent interface - different widgets support
6
- * different child management APIs - so runtime checking is necessary.
7
- */
8
- import * as Gtk from "@gtkx/ffi/gtk";
9
-
10
- type AppendableWidget = Gtk.Widget & { append: (child: Gtk.Widget) => void };
11
- type AddableWidget = Gtk.Widget & { add: (child: Gtk.Widget) => void };
12
- type ContentWidget = Gtk.Widget & { setContent: (content?: Gtk.Widget | null) => void };
13
- type SingleChildWidget = Gtk.Widget & { setChild: (child: Gtk.Widget | null) => void };
14
- type RemovableWidget = Gtk.Widget & { remove: (child: Gtk.Widget) => void };
15
-
16
- export type ReorderableWidget = Gtk.Widget & {
17
- reorderChildAfter: (child: Gtk.Widget, sibling?: Gtk.Widget) => void;
18
- insertChildAfter: (child: Gtk.Widget, sibling?: Gtk.Widget) => void;
19
- };
20
-
21
- export type InsertableWidget = Gtk.Widget & {
22
- insert: (child: Gtk.Widget, position: number) => void;
23
- getFirstChild: () => Gtk.Widget | null;
24
- };
25
-
26
- type EditableWidget = Gtk.Widget & {
27
- getPosition: () => number;
28
- setPosition: (position: number) => void;
29
- getText: () => string;
30
- };
31
-
32
- type BufferedWidget = Gtk.Widget & {
33
- getBuffer: () => Gtk.TextBuffer;
34
- setBuffer: (buffer?: Gtk.TextBuffer | null) => void;
35
- };
36
-
37
- export const isAppendable = (obj: unknown): obj is AppendableWidget =>
38
- obj instanceof Gtk.Widget && "append" in obj && typeof obj.append === "function";
39
-
40
- export const isAddable = (obj: unknown): obj is AddableWidget =>
41
- obj instanceof Gtk.Widget && "add" in obj && typeof obj.add === "function";
42
-
43
- export const isContentWidget = (obj: unknown): obj is ContentWidget =>
44
- obj instanceof Gtk.Widget && "setContent" in obj && typeof obj.setContent === "function";
45
-
46
- export const isSingleChild = (obj: unknown): obj is SingleChildWidget =>
47
- obj instanceof Gtk.Widget && "setChild" in obj && typeof obj.setChild === "function";
48
-
49
- export const isRemovable = (obj: unknown): obj is RemovableWidget =>
50
- obj instanceof Gtk.Widget && "remove" in obj && typeof obj.remove === "function";
51
-
52
- export const isReorderable = (obj: unknown): obj is ReorderableWidget =>
53
- obj instanceof Gtk.Widget &&
54
- "reorderChildAfter" in obj &&
55
- typeof obj.reorderChildAfter === "function" &&
56
- "insertChildAfter" in obj &&
57
- typeof obj.insertChildAfter === "function";
58
-
59
- export const isInsertable = (obj: unknown): obj is InsertableWidget =>
60
- obj instanceof Gtk.Widget &&
61
- "insert" in obj &&
62
- typeof obj.insert === "function" &&
63
- "getFirstChild" in obj &&
64
- typeof obj.getFirstChild === "function";
65
-
66
- export const isEditable = (obj: unknown): obj is EditableWidget =>
67
- obj instanceof Gtk.Widget &&
68
- "getPosition" in obj &&
69
- typeof obj.getPosition === "function" &&
70
- "setPosition" in obj &&
71
- typeof obj.setPosition === "function" &&
72
- "getText" in obj &&
73
- typeof obj.getText === "function";
74
-
75
- export const isBuffered = (obj: unknown): obj is BufferedWidget =>
76
- obj instanceof Gtk.Widget &&
77
- "getBuffer" in obj &&
78
- typeof obj.getBuffer === "function" &&
79
- "setBuffer" in obj &&
80
- typeof obj.setBuffer === "function";
@@ -1,51 +0,0 @@
1
- import type { Props } from "../../types.js";
2
-
3
- export const filterProps = <T extends Props>(props: T, excludeKeys: readonly string[]): T => {
4
- const result: Props = {};
5
-
6
- for (const key of Object.keys(props)) {
7
- if (!excludeKeys.includes(key)) {
8
- result[key] = props[key];
9
- }
10
- }
11
-
12
- return result as T;
13
- };
14
-
15
- export const hasChanged = <T>(oldProps: T | null, newProps: T, key: keyof T): boolean =>
16
- !oldProps || oldProps[key] !== newProps[key];
17
-
18
- export const shallowArrayEqual = <T extends Record<string, unknown>>(a: T[], b: T[]): boolean => {
19
- if (a.length !== b.length) return false;
20
-
21
- for (let i = 0; i < a.length; i++) {
22
- const itemA = a[i];
23
- const itemB = b[i];
24
- if (!itemA || !itemB) return false;
25
-
26
- const keysA = Object.keys(itemA);
27
- const keysB = Object.keys(itemB);
28
- if (keysA.length !== keysB.length) return false;
29
-
30
- for (const key of keysA) {
31
- if (itemA[key] !== itemB[key]) return false;
32
- }
33
- }
34
-
35
- return true;
36
- };
37
-
38
- export const primitiveArrayEqual = <T extends string | number | boolean>(
39
- a: T[] | null | undefined,
40
- b: T[] | null | undefined,
41
- ): boolean => {
42
- if (a === b) return true;
43
- if (!a || !b) return false;
44
- if (a.length !== b.length) return false;
45
-
46
- for (let i = 0; i < a.length; i++) {
47
- if (a[i] !== b[i]) return false;
48
- }
49
-
50
- return true;
51
- };
@@ -1,141 +0,0 @@
1
- import * as GObject from "@gtkx/ffi/gobject";
2
-
3
- type SignalOwner = object;
4
-
5
- // biome-ignore lint/suspicious/noExplicitAny: Required for contravariant behavior
6
- export type SignalHandler = (...args: any[]) => any;
7
-
8
- const LIFECYCLE_SIGNALS = new Set([
9
- "realize",
10
- "unrealize",
11
- "map",
12
- "unmap",
13
- "show",
14
- "hide",
15
- "destroy",
16
- "resize",
17
- "render",
18
- "setup",
19
- "bind",
20
- "unbind",
21
- "teardown",
22
- ]);
23
-
24
- type HandlerEntry = { obj: GObject.Object; handlerId: number };
25
-
26
- type SignalKey = `${string}:${string}`;
27
-
28
- interface SignalOptions {
29
- blockable?: boolean;
30
- }
31
-
32
- const signalKeyCache = new WeakMap<GObject.Object, string>();
33
- let nextSignalObjId = 0;
34
-
35
- function getSignalKey(obj: GObject.Object, signal: string): SignalKey {
36
- let objKey = signalKeyCache.get(obj);
37
- if (!objKey) {
38
- objKey = String(nextSignalObjId++);
39
- signalKeyCache.set(obj, objKey);
40
- }
41
- return `${objKey}:${signal}`;
42
- }
43
-
44
- export class SignalStore {
45
- private ownerHandlers: Map<SignalOwner, Map<SignalKey, HandlerEntry>> = new Map();
46
- private blockDepth = 0;
47
-
48
- private getOwnerMap(owner: SignalOwner): Map<SignalKey, HandlerEntry> {
49
- let map = this.ownerHandlers.get(owner);
50
- if (!map) {
51
- map = new Map();
52
- this.ownerHandlers.set(owner, map);
53
- }
54
- return map;
55
- }
56
-
57
- private wrapHandler(handler: SignalHandler, signal: string, blockable: boolean): SignalHandler {
58
- return (...args: unknown[]) => {
59
- if (this.blockDepth > 0 && blockable && !LIFECYCLE_SIGNALS.has(signal)) {
60
- return;
61
- }
62
- const [self, ...rest] = args;
63
- return handler(...rest, self);
64
- };
65
- }
66
-
67
- private disconnect(owner: SignalOwner, obj: GObject.Object, signal: string): void {
68
- const key = getSignalKey(obj, signal);
69
- const ownerMap = this.ownerHandlers.get(owner);
70
- const existing = ownerMap?.get(key);
71
-
72
- if (existing) {
73
- GObject.signalHandlerDisconnect(existing.obj, existing.handlerId);
74
- ownerMap?.delete(key);
75
- }
76
- }
77
-
78
- private connect(
79
- owner: SignalOwner,
80
- obj: GObject.Object,
81
- signal: string,
82
- handler: SignalHandler,
83
- blockable: boolean,
84
- ): void {
85
- const key = getSignalKey(obj, signal);
86
- const wrappedHandler = this.wrapHandler(handler, signal, blockable);
87
- const handlerId = obj.connect(signal, wrappedHandler);
88
- this.getOwnerMap(owner).set(key, { obj, handlerId });
89
- }
90
-
91
- public set(
92
- owner: SignalOwner,
93
- obj: GObject.Object,
94
- signal: string,
95
- handler?: SignalHandler | null,
96
- options?: SignalOptions,
97
- ): void {
98
- this.disconnect(owner, obj, signal);
99
-
100
- if (handler) {
101
- this.connect(owner, obj, signal, handler, options?.blockable ?? true);
102
- }
103
- }
104
-
105
- public clear(owner: SignalOwner): void {
106
- const ownerMap = this.ownerHandlers.get(owner);
107
-
108
- if (ownerMap) {
109
- for (const { obj, handlerId } of ownerMap.values()) {
110
- GObject.signalHandlerDisconnect(obj, handlerId);
111
- }
112
-
113
- this.ownerHandlers.delete(owner);
114
- }
115
- }
116
-
117
- public blockAll(): void {
118
- this.blockDepth++;
119
- }
120
-
121
- public unblockAll(): void {
122
- if (this.blockDepth > 0) {
123
- this.blockDepth--;
124
- }
125
- }
126
-
127
- public forceUnblockAll(): void {
128
- this.blockDepth = 0;
129
- }
130
- }
131
-
132
- const signalStores = new WeakMap<object, SignalStore>();
133
-
134
- export function getSignalStore(rootContainer: object): SignalStore {
135
- let store = signalStores.get(rootContainer);
136
- if (!store) {
137
- store = new SignalStore();
138
- signalStores.set(rootContainer, store);
139
- }
140
- return store;
141
- }