@gtkx/react 0.20.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 (596) hide show
  1. package/README.md +122 -55
  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 -5
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +10 -5
  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 -12
  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/list.d.ts +0 -35
  253. package/dist/components/list.d.ts.map +0 -1
  254. package/dist/components/list.js +0 -40
  255. package/dist/components/list.js.map +0 -1
  256. package/dist/errors.d.ts +0 -9
  257. package/dist/errors.d.ts.map +0 -1
  258. package/dist/errors.js +0 -42
  259. package/dist/errors.js.map +0 -1
  260. package/dist/factory.d.ts +0 -5
  261. package/dist/factory.d.ts.map +0 -1
  262. package/dist/factory.js +0 -37
  263. package/dist/factory.js.map +0 -1
  264. package/dist/generated/internal.d.ts +0 -16
  265. package/dist/generated/internal.d.ts.map +0 -1
  266. package/dist/generated/internal.js +0 -5635
  267. package/dist/generated/internal.js.map +0 -1
  268. package/dist/generated/jsx.d.ts +0 -19624
  269. package/dist/generated/jsx.d.ts.map +0 -1
  270. package/dist/generated/jsx.js +0 -9274
  271. package/dist/generated/jsx.js.map +0 -1
  272. package/dist/generated/registry.d.ts +0 -4
  273. package/dist/generated/registry.d.ts.map +0 -1
  274. package/dist/generated/registry.js +0 -14
  275. package/dist/generated/registry.js.map +0 -1
  276. package/dist/host-config.d.ts +0 -24
  277. package/dist/host-config.d.ts.map +0 -1
  278. package/dist/host-config.js +0 -172
  279. package/dist/host-config.js.map +0 -1
  280. package/dist/jsx.d.ts +0 -1272
  281. package/dist/jsx.d.ts.map +0 -1
  282. package/dist/jsx.js +0 -331
  283. package/dist/jsx.js.map +0 -1
  284. package/dist/metadata.d.ts +0 -5
  285. package/dist/metadata.d.ts.map +0 -1
  286. package/dist/metadata.js +0 -33
  287. package/dist/metadata.js.map +0 -1
  288. package/dist/node.d.ts +0 -25
  289. package/dist/node.d.ts.map +0 -1
  290. package/dist/node.js +0 -85
  291. package/dist/node.js.map +0 -1
  292. package/dist/nodes/adjustable.d.ts +0 -11
  293. package/dist/nodes/adjustable.d.ts.map +0 -1
  294. package/dist/nodes/adjustable.js +0 -46
  295. package/dist/nodes/adjustable.js.map +0 -1
  296. package/dist/nodes/alert-dialog-response.d.ts +0 -15
  297. package/dist/nodes/alert-dialog-response.d.ts.map +0 -1
  298. package/dist/nodes/alert-dialog-response.js +0 -61
  299. package/dist/nodes/alert-dialog-response.js.map +0 -1
  300. package/dist/nodes/animation.d.ts +0 -38
  301. package/dist/nodes/animation.d.ts.map +0 -1
  302. package/dist/nodes/animation.js +0 -310
  303. package/dist/nodes/animation.js.map +0 -1
  304. package/dist/nodes/application.d.ts +0 -12
  305. package/dist/nodes/application.d.ts.map +0 -1
  306. package/dist/nodes/application.js +0 -51
  307. package/dist/nodes/application.js.map +0 -1
  308. package/dist/nodes/calendar.d.ts +0 -18
  309. package/dist/nodes/calendar.d.ts.map +0 -1
  310. package/dist/nodes/calendar.js +0 -28
  311. package/dist/nodes/calendar.js.map +0 -1
  312. package/dist/nodes/color-dialog-button.d.ts +0 -15
  313. package/dist/nodes/color-dialog-button.d.ts.map +0 -1
  314. package/dist/nodes/color-dialog-button.js +0 -43
  315. package/dist/nodes/color-dialog-button.js.map +0 -1
  316. package/dist/nodes/column-view-column.d.ts +0 -36
  317. package/dist/nodes/column-view-column.d.ts.map +0 -1
  318. package/dist/nodes/column-view-column.js +0 -168
  319. package/dist/nodes/column-view-column.js.map +0 -1
  320. package/dist/nodes/container-slot.d.ts +0 -16
  321. package/dist/nodes/container-slot.d.ts.map +0 -1
  322. package/dist/nodes/container-slot.js +0 -69
  323. package/dist/nodes/container-slot.js.map +0 -1
  324. package/dist/nodes/dialog.d.ts +0 -10
  325. package/dist/nodes/dialog.d.ts.map +0 -1
  326. package/dist/nodes/dialog.js +0 -20
  327. package/dist/nodes/dialog.js.map +0 -1
  328. package/dist/nodes/drawing-area.d.ts +0 -17
  329. package/dist/nodes/drawing-area.d.ts.map +0 -1
  330. package/dist/nodes/drawing-area.js +0 -42
  331. package/dist/nodes/drawing-area.js.map +0 -1
  332. package/dist/nodes/event-controller.d.ts +0 -15
  333. package/dist/nodes/event-controller.d.ts.map +0 -1
  334. package/dist/nodes/event-controller.js +0 -77
  335. package/dist/nodes/event-controller.js.map +0 -1
  336. package/dist/nodes/fixed-child.d.ts +0 -18
  337. package/dist/nodes/fixed-child.d.ts.map +0 -1
  338. package/dist/nodes/fixed-child.js +0 -86
  339. package/dist/nodes/fixed-child.js.map +0 -1
  340. package/dist/nodes/font-dialog-button.d.ts +0 -15
  341. package/dist/nodes/font-dialog-button.d.ts.map +0 -1
  342. package/dist/nodes/font-dialog-button.js +0 -76
  343. package/dist/nodes/font-dialog-button.js.map +0 -1
  344. package/dist/nodes/grid-child.d.ts +0 -18
  345. package/dist/nodes/grid-child.d.ts.map +0 -1
  346. package/dist/nodes/grid-child.js +0 -81
  347. package/dist/nodes/grid-child.js.map +0 -1
  348. package/dist/nodes/internal/accessible.d.ts +0 -5
  349. package/dist/nodes/internal/accessible.d.ts.map +0 -1
  350. package/dist/nodes/internal/accessible.js +0 -119
  351. package/dist/nodes/internal/accessible.js.map +0 -1
  352. package/dist/nodes/internal/bound-item.d.ts +0 -4
  353. package/dist/nodes/internal/bound-item.d.ts.map +0 -1
  354. package/dist/nodes/internal/bound-item.js +0 -2
  355. package/dist/nodes/internal/bound-item.js.map +0 -1
  356. package/dist/nodes/internal/construct.d.ts +0 -3
  357. package/dist/nodes/internal/construct.d.ts.map +0 -1
  358. package/dist/nodes/internal/construct.js +0 -44
  359. package/dist/nodes/internal/construct.js.map +0 -1
  360. package/dist/nodes/internal/predicates.d.ts +0 -51
  361. package/dist/nodes/internal/predicates.d.ts.map +0 -1
  362. package/dist/nodes/internal/predicates.js +0 -36
  363. package/dist/nodes/internal/predicates.js.map +0 -1
  364. package/dist/nodes/internal/props.d.ts +0 -6
  365. package/dist/nodes/internal/props.d.ts.map +0 -1
  366. package/dist/nodes/internal/props.js +0 -43
  367. package/dist/nodes/internal/props.js.map +0 -1
  368. package/dist/nodes/internal/signal-store.d.ts +0 -22
  369. package/dist/nodes/internal/signal-store.d.ts.map +0 -1
  370. package/dist/nodes/internal/signal-store.js +0 -98
  371. package/dist/nodes/internal/signal-store.js.map +0 -1
  372. package/dist/nodes/internal/text-buffer-controller.d.ts +0 -40
  373. package/dist/nodes/internal/text-buffer-controller.d.ts.map +0 -1
  374. package/dist/nodes/internal/text-buffer-controller.js +0 -327
  375. package/dist/nodes/internal/text-buffer-controller.js.map +0 -1
  376. package/dist/nodes/internal/widget.d.ts +0 -8
  377. package/dist/nodes/internal/widget.d.ts.map +0 -1
  378. package/dist/nodes/internal/widget.js +0 -72
  379. package/dist/nodes/internal/widget.js.map +0 -1
  380. package/dist/nodes/level-bar.d.ts +0 -12
  381. package/dist/nodes/level-bar.d.ts.map +0 -1
  382. package/dist/nodes/level-bar.js +0 -24
  383. package/dist/nodes/level-bar.js.map +0 -1
  384. package/dist/nodes/list-item-node.d.ts +0 -12
  385. package/dist/nodes/list-item-node.d.ts.map +0 -1
  386. package/dist/nodes/list-item-node.js +0 -23
  387. package/dist/nodes/list-item-node.js.map +0 -1
  388. package/dist/nodes/list.d.ts +0 -100
  389. package/dist/nodes/list.d.ts.map +0 -1
  390. package/dist/nodes/list.js +0 -950
  391. package/dist/nodes/list.js.map +0 -1
  392. package/dist/nodes/menu.d.ts +0 -7
  393. package/dist/nodes/menu.d.ts.map +0 -1
  394. package/dist/nodes/menu.js +0 -20
  395. package/dist/nodes/menu.js.map +0 -1
  396. package/dist/nodes/models/menu.d.ts +0 -47
  397. package/dist/nodes/models/menu.d.ts.map +0 -1
  398. package/dist/nodes/models/menu.js +0 -240
  399. package/dist/nodes/models/menu.js.map +0 -1
  400. package/dist/nodes/navigation-page.d.ts +0 -19
  401. package/dist/nodes/navigation-page.d.ts.map +0 -1
  402. package/dist/nodes/navigation-page.js +0 -129
  403. package/dist/nodes/navigation-page.js.map +0 -1
  404. package/dist/nodes/navigation-view.d.ts +0 -19
  405. package/dist/nodes/navigation-view.d.ts.map +0 -1
  406. package/dist/nodes/navigation-view.js +0 -51
  407. package/dist/nodes/navigation-view.js.map +0 -1
  408. package/dist/nodes/notebook-page-tab.d.ts +0 -15
  409. package/dist/nodes/notebook-page-tab.d.ts.map +0 -1
  410. package/dist/nodes/notebook-page-tab.js +0 -40
  411. package/dist/nodes/notebook-page-tab.js.map +0 -1
  412. package/dist/nodes/notebook-page.d.ts +0 -29
  413. package/dist/nodes/notebook-page.d.ts.map +0 -1
  414. package/dist/nodes/notebook-page.js +0 -151
  415. package/dist/nodes/notebook-page.js.map +0 -1
  416. package/dist/nodes/notebook.d.ts +0 -16
  417. package/dist/nodes/notebook.d.ts.map +0 -1
  418. package/dist/nodes/notebook.js +0 -31
  419. package/dist/nodes/notebook.js.map +0 -1
  420. package/dist/nodes/overlay-child.d.ts +0 -18
  421. package/dist/nodes/overlay-child.d.ts.map +0 -1
  422. package/dist/nodes/overlay-child.js +0 -88
  423. package/dist/nodes/overlay-child.js.map +0 -1
  424. package/dist/nodes/popover-menu.d.ts +0 -19
  425. package/dist/nodes/popover-menu.d.ts.map +0 -1
  426. package/dist/nodes/popover-menu.js +0 -54
  427. package/dist/nodes/popover-menu.js.map +0 -1
  428. package/dist/nodes/scale.d.ts +0 -10
  429. package/dist/nodes/scale.d.ts.map +0 -1
  430. package/dist/nodes/scale.js +0 -19
  431. package/dist/nodes/scale.js.map +0 -1
  432. package/dist/nodes/scrolled-window.d.ts +0 -11
  433. package/dist/nodes/scrolled-window.d.ts.map +0 -1
  434. package/dist/nodes/scrolled-window.js +0 -18
  435. package/dist/nodes/scrolled-window.js.map +0 -1
  436. package/dist/nodes/search-bar.d.ts +0 -11
  437. package/dist/nodes/search-bar.d.ts.map +0 -1
  438. package/dist/nodes/search-bar.js +0 -16
  439. package/dist/nodes/search-bar.js.map +0 -1
  440. package/dist/nodes/shortcut.d.ts +0 -19
  441. package/dist/nodes/shortcut.d.ts.map +0 -1
  442. package/dist/nodes/shortcut.js +0 -72
  443. package/dist/nodes/shortcut.js.map +0 -1
  444. package/dist/nodes/slot.d.ts +0 -21
  445. package/dist/nodes/slot.d.ts.map +0 -1
  446. package/dist/nodes/slot.js +0 -102
  447. package/dist/nodes/slot.js.map +0 -1
  448. package/dist/nodes/source-view.d.ts +0 -18
  449. package/dist/nodes/source-view.d.ts.map +0 -1
  450. package/dist/nodes/source-view.js +0 -94
  451. package/dist/nodes/source-view.js.map +0 -1
  452. package/dist/nodes/stack-page.d.ts +0 -22
  453. package/dist/nodes/stack-page.d.ts.map +0 -1
  454. package/dist/nodes/stack-page.js +0 -140
  455. package/dist/nodes/stack-page.js.map +0 -1
  456. package/dist/nodes/stack.d.ts +0 -13
  457. package/dist/nodes/stack.d.ts.map +0 -1
  458. package/dist/nodes/stack.js +0 -21
  459. package/dist/nodes/stack.js.map +0 -1
  460. package/dist/nodes/text-anchor.d.ts +0 -23
  461. package/dist/nodes/text-anchor.d.ts.map +0 -1
  462. package/dist/nodes/text-anchor.js +0 -64
  463. package/dist/nodes/text-anchor.js.map +0 -1
  464. package/dist/nodes/text-content.d.ts +0 -12
  465. package/dist/nodes/text-content.d.ts.map +0 -1
  466. package/dist/nodes/text-content.js +0 -2
  467. package/dist/nodes/text-content.js.map +0 -1
  468. package/dist/nodes/text-paintable.d.ts +0 -19
  469. package/dist/nodes/text-paintable.d.ts.map +0 -1
  470. package/dist/nodes/text-paintable.js +0 -42
  471. package/dist/nodes/text-paintable.js.map +0 -1
  472. package/dist/nodes/text-segment.d.ts +0 -18
  473. package/dist/nodes/text-segment.d.ts.map +0 -1
  474. package/dist/nodes/text-segment.js +0 -38
  475. package/dist/nodes/text-segment.js.map +0 -1
  476. package/dist/nodes/text-tag.d.ts +0 -38
  477. package/dist/nodes/text-tag.d.ts.map +0 -1
  478. package/dist/nodes/text-tag.js +0 -241
  479. package/dist/nodes/text-tag.js.map +0 -1
  480. package/dist/nodes/text-view.d.ts +0 -29
  481. package/dist/nodes/text-view.d.ts.map +0 -1
  482. package/dist/nodes/text-view.js +0 -80
  483. package/dist/nodes/text-view.js.map +0 -1
  484. package/dist/nodes/toggle-group.d.ts +0 -11
  485. package/dist/nodes/toggle-group.d.ts.map +0 -1
  486. package/dist/nodes/toggle-group.js +0 -16
  487. package/dist/nodes/toggle-group.js.map +0 -1
  488. package/dist/nodes/toggle.d.ts +0 -16
  489. package/dist/nodes/toggle.d.ts.map +0 -1
  490. package/dist/nodes/toggle.js +0 -61
  491. package/dist/nodes/toggle.js.map +0 -1
  492. package/dist/nodes/virtual.d.ts +0 -7
  493. package/dist/nodes/virtual.d.ts.map +0 -1
  494. package/dist/nodes/virtual.js +0 -9
  495. package/dist/nodes/virtual.js.map +0 -1
  496. package/dist/nodes/web-view.d.ts +0 -11
  497. package/dist/nodes/web-view.d.ts.map +0 -1
  498. package/dist/nodes/web-view.js +0 -16
  499. package/dist/nodes/web-view.js.map +0 -1
  500. package/dist/nodes/widget.d.ts +0 -26
  501. package/dist/nodes/widget.d.ts.map +0 -1
  502. package/dist/nodes/widget.js +0 -315
  503. package/dist/nodes/widget.js.map +0 -1
  504. package/dist/nodes/window.d.ts +0 -31
  505. package/dist/nodes/window.d.ts.map +0 -1
  506. package/dist/nodes/window.js +0 -122
  507. package/dist/nodes/window.js.map +0 -1
  508. package/dist/portal.d.ts +0 -29
  509. package/dist/portal.d.ts.map +0 -1
  510. package/dist/portal.js +0 -35
  511. package/dist/portal.js.map +0 -1
  512. package/dist/reconciler.d.ts +0 -34
  513. package/dist/reconciler.d.ts.map +0 -1
  514. package/dist/reconciler.js +0 -48
  515. package/dist/reconciler.js.map +0 -1
  516. package/dist/registry.d.ts +0 -18
  517. package/dist/registry.d.ts.map +0 -1
  518. package/dist/registry.js +0 -96
  519. package/dist/registry.js.map +0 -1
  520. package/dist/render.d.ts +0 -117
  521. package/dist/render.d.ts.map +0 -1
  522. package/dist/render.js +0 -159
  523. package/dist/render.js.map +0 -1
  524. package/dist/types.d.ts +0 -5
  525. package/dist/types.d.ts.map +0 -1
  526. package/dist/types.js.map +0 -1
  527. package/src/components/list.tsx +0 -83
  528. package/src/errors.ts +0 -52
  529. package/src/factory.ts +0 -62
  530. package/src/generated/internal.ts +0 -5644
  531. package/src/generated/jsx.ts +0 -19900
  532. package/src/generated/registry.ts +0 -16
  533. package/src/host-config.ts +0 -219
  534. package/src/jsx.ts +0 -1355
  535. package/src/metadata.ts +0 -43
  536. package/src/node.ts +0 -107
  537. package/src/nodes/adjustable.ts +0 -68
  538. package/src/nodes/alert-dialog-response.ts +0 -78
  539. package/src/nodes/animation.ts +0 -402
  540. package/src/nodes/application.ts +0 -61
  541. package/src/nodes/calendar.ts +0 -42
  542. package/src/nodes/color-dialog-button.ts +0 -69
  543. package/src/nodes/column-view-column.ts +0 -189
  544. package/src/nodes/container-slot.ts +0 -87
  545. package/src/nodes/dialog.ts +0 -25
  546. package/src/nodes/drawing-area.ts +0 -62
  547. package/src/nodes/event-controller.ts +0 -100
  548. package/src/nodes/fixed-child.ts +0 -109
  549. package/src/nodes/font-dialog-button.ts +0 -107
  550. package/src/nodes/grid-child.ts +0 -103
  551. package/src/nodes/internal/accessible.ts +0 -155
  552. package/src/nodes/internal/bound-item.ts +0 -4
  553. package/src/nodes/internal/construct.ts +0 -60
  554. package/src/nodes/internal/predicates.ts +0 -80
  555. package/src/nodes/internal/props.ts +0 -51
  556. package/src/nodes/internal/signal-store.ts +0 -141
  557. package/src/nodes/internal/text-buffer-controller.ts +0 -417
  558. package/src/nodes/internal/widget.ts +0 -80
  559. package/src/nodes/level-bar.ts +0 -36
  560. package/src/nodes/list-item-node.ts +0 -29
  561. package/src/nodes/list.ts +0 -1082
  562. package/src/nodes/menu.ts +0 -27
  563. package/src/nodes/models/menu.ts +0 -314
  564. package/src/nodes/navigation-page.ts +0 -154
  565. package/src/nodes/navigation-view.ts +0 -66
  566. package/src/nodes/notebook-page-tab.ts +0 -55
  567. package/src/nodes/notebook-page.ts +0 -189
  568. package/src/nodes/notebook.ts +0 -42
  569. package/src/nodes/overlay-child.ts +0 -109
  570. package/src/nodes/popover-menu.ts +0 -67
  571. package/src/nodes/scale.ts +0 -28
  572. package/src/nodes/scrolled-window.ts +0 -23
  573. package/src/nodes/search-bar.ts +0 -27
  574. package/src/nodes/shortcut.ts +0 -86
  575. package/src/nodes/slot.ts +0 -138
  576. package/src/nodes/source-view.ts +0 -130
  577. package/src/nodes/stack-page.ts +0 -170
  578. package/src/nodes/stack.ts +0 -35
  579. package/src/nodes/text-anchor.ts +0 -79
  580. package/src/nodes/text-content.ts +0 -14
  581. package/src/nodes/text-paintable.ts +0 -51
  582. package/src/nodes/text-segment.ts +0 -55
  583. package/src/nodes/text-tag.ts +0 -293
  584. package/src/nodes/text-view.ts +0 -100
  585. package/src/nodes/toggle-group.ts +0 -27
  586. package/src/nodes/toggle.ts +0 -72
  587. package/src/nodes/virtual.ts +0 -16
  588. package/src/nodes/web-view.ts +0 -22
  589. package/src/nodes/widget.ts +0 -376
  590. package/src/nodes/window.ts +0 -172
  591. package/src/portal.ts +0 -37
  592. package/src/reconciler.ts +0 -52
  593. package/src/registry.ts +0 -117
  594. package/src/render.tsx +0 -192
  595. package/src/types.ts +0 -12
  596. /package/dist/{types.js → reconciler/types.js} +0 -0
package/src/jsx.ts DELETED
@@ -1,1355 +0,0 @@
1
- import type * as Adw from "@gtkx/ffi/adw";
2
- import type * as cairo from "@gtkx/ffi/cairo";
3
- import type * as Gdk from "@gtkx/ffi/gdk";
4
- import type * as Gsk from "@gtkx/ffi/gsk";
5
- import type * as Gtk from "@gtkx/ffi/gtk";
6
- import type * as GtkSource from "@gtkx/ffi/gtksource";
7
- import type * as Pango from "@gtkx/ffi/pango";
8
- import type { ReactElement, ReactNode } from "react";
9
- import { createElement } from "react";
10
- import type { WidgetSlotNames } from "./generated/jsx.js";
11
-
12
- /**
13
- * CSS properties that can be animated on a widget.
14
- *
15
- * All transforms are applied via GTK CSS and rendered through the widget's style context.
16
- */
17
- export type AnimatableProperties = {
18
- /** Opacity from 0 (fully transparent) to 1 (fully opaque) */
19
- opacity?: number;
20
- /** Horizontal translation in pixels (positive moves right) */
21
- translateX?: number;
22
- /** Vertical translation in pixels (positive moves down) */
23
- translateY?: number;
24
- /** Uniform scale factor (1 = original size, 2 = double size) */
25
- scale?: number;
26
- /** Horizontal scale factor */
27
- scaleX?: number;
28
- /** Vertical scale factor */
29
- scaleY?: number;
30
- /** Rotation angle in degrees (positive rotates clockwise) */
31
- rotate?: number;
32
- /** Horizontal skew angle in degrees */
33
- skewX?: number;
34
- /** Vertical skew angle in degrees */
35
- skewY?: number;
36
- };
37
-
38
- /**
39
- * Transition configuration for timed (duration-based) animations.
40
- *
41
- * @see {@link https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.TimedAnimation.html Adw.TimedAnimation}
42
- */
43
- export type TimedTransition = {
44
- /** Discriminant: duration-based animation with easing curves */
45
- mode: "timed";
46
- /** Animation duration in milliseconds (default: 300) */
47
- duration?: number;
48
- /** Easing function for the animation curve (default: EASE_OUT_CUBIC) */
49
- easing?: Adw.Easing;
50
- /** Delay before starting the animation in milliseconds */
51
- delay?: number;
52
- /** Number of times to repeat the animation (0 = no repeat, -1 = infinite) */
53
- repeat?: number;
54
- /** Whether to play the animation in reverse */
55
- reverse?: boolean;
56
- /** Whether to alternate direction on each repeat */
57
- alternate?: boolean;
58
- };
59
-
60
- /**
61
- * Transition configuration for spring (physics-based) animations.
62
- *
63
- * Spring animations simulate a mass attached to a spring, providing natural-feeling motion.
64
- * The animation settles when the spring reaches equilibrium.
65
- *
66
- * @see {@link https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SpringAnimation.html Adw.SpringAnimation}
67
- */
68
- export type SpringTransition = {
69
- /** Discriminant: physics-based spring animation */
70
- mode: "spring";
71
- /** Damping ratio controlling oscillation decay (default: 1, critically damped) */
72
- damping?: number;
73
- /** Spring stiffness in N/m affecting animation speed (default: 100) */
74
- stiffness?: number;
75
- /** Virtual mass in kg affecting momentum (default: 1) */
76
- mass?: number;
77
- /** Initial velocity to apply at animation start */
78
- initialVelocity?: number;
79
- /** Whether to clamp the animation value to prevent overshooting */
80
- clamp?: boolean;
81
- /** Delay before starting the animation in milliseconds */
82
- delay?: number;
83
- };
84
-
85
- /**
86
- * Discriminated union of all transition configurations.
87
- *
88
- * The `mode` field determines the animation type:
89
- * - `"timed"`: Duration-based animation with easing curves (uses {@link Adw.TimedAnimation})
90
- * - `"spring"`: Physics-based spring animation (uses {@link Adw.SpringAnimation})
91
- */
92
- export type AnimationTransition = TimedTransition | SpringTransition;
93
-
94
- /**
95
- * Props for the Animation component.
96
- *
97
- * Provides a declarative API for animating widget properties using either
98
- * timed (duration-based) or spring (physics-based) animations.
99
- *
100
- * @example
101
- * ```tsx
102
- * <x.Animation
103
- * initial={{ opacity: 0, translateY: -20 }}
104
- * animate={{ opacity: 1, translateY: 0 }}
105
- * exit={{ opacity: 0, translateY: 20 }}
106
- * transition={{ mode: "spring", damping: 0.8, stiffness: 200 }}
107
- * animateOnMount
108
- * >
109
- * <GtkLabel label="Animated content" />
110
- * </x.Animation>
111
- * ```
112
- */
113
- export type AnimationProps = {
114
- /** Initial property values before animation starts, or `false` to skip initial state */
115
- initial?: AnimatableProperties | false;
116
- /** Target property values to animate towards */
117
- animate?: AnimatableProperties;
118
- /** Property values to animate to when the component unmounts */
119
- exit?: AnimatableProperties;
120
- /** Transition configuration including animation mode and parameters */
121
- transition?: AnimationTransition;
122
- /** Whether to animate from `initial` to `animate` when first mounted (default: false) */
123
- animateOnMount?: boolean;
124
- /** Callback fired when an animation begins */
125
- onAnimationStart?: () => void;
126
- /** Callback fired when an animation completes */
127
- onAnimationComplete?: () => void;
128
- /** The child widget to animate (must be a single GTK widget) */
129
- children?: ReactNode;
130
- };
131
-
132
- /**
133
- * Props for the Shortcut virtual element.
134
- *
135
- * Defines a keyboard shortcut. Must be a child of `<GtkShortcutController>`.
136
- *
137
- * @example
138
- * ```tsx
139
- * <GtkShortcutController>
140
- * <x.Shortcut trigger="<Control>s" onActivate={save} />
141
- * <x.Shortcut trigger={["F5", "<Control>r"]} onActivate={refresh} />
142
- * <x.Shortcut trigger="Escape" onActivate={cancel} disabled={!canCancel} />
143
- * </GtkShortcutController>
144
- * ```
145
- */
146
- export type ShortcutProps = {
147
- /** The trigger string(s) using GTK accelerator format (e.g., "\<Control\>s", "F1") */
148
- trigger: string | string[];
149
- /**
150
- * Called when the shortcut is activated.
151
- * Return false to indicate the shortcut was not handled; otherwise it is considered handled.
152
- */
153
- // biome-ignore lint/suspicious/noConfusingVoidType: void is intentional to allow callbacks that don't return a value
154
- onActivate: () => boolean | void;
155
- /** Whether the shortcut is disabled */
156
- disabled?: boolean;
157
- };
158
-
159
- /**
160
- * Props for the TextAnchor virtual element.
161
- *
162
- * Used to declaratively embed widgets within text content in a TextBuffer.
163
- * The anchor is placed at the current position in the text flow.
164
- *
165
- * @example
166
- * ```tsx
167
- * <GtkTextView>
168
- * <x.TextBuffer>
169
- * Click here: <x.TextAnchor>
170
- * <GtkButton label="Click me" />
171
- * </x.TextAnchor> to continue.
172
- * </x.TextBuffer>
173
- * </GtkTextView>
174
- * ```
175
- */
176
- export type TextAnchorProps = {
177
- /** Replacement character displayed when the widget is not visible (e.g. in serialized text) */
178
- replacementChar?: string;
179
- /** The widget to embed at this anchor position */
180
- children?: ReactNode;
181
- };
182
-
183
- /**
184
- * Props for the TextPaintable virtual element.
185
- *
186
- * Used to embed inline images or icons within text content in a GtkTextView.
187
- */
188
- export type TextPaintableProps = {
189
- /** The paintable (image, icon, etc.) to embed inline with the text */
190
- paintable: Gdk.Paintable;
191
- };
192
-
193
- /**
194
- * Props for the TextTag virtual element.
195
- *
196
- * Used to declaratively define and apply text formatting to content within a TextBuffer.
197
- *
198
- * @example
199
- * ```tsx
200
- * <GtkTextView>
201
- * <x.TextBuffer>
202
- * Hello <x.TextTag id="bold" weight={Pango.Weight.BOLD}>bold</x.TextTag> world
203
- * </x.TextBuffer>
204
- * </GtkTextView>
205
- * ```
206
- */
207
- export type TextTagProps = {
208
- /** Unique identifier for this tag in the tag table */
209
- id: string;
210
- /** Priority of this tag (higher wins when multiple tags affect same property) */
211
- priority?: number;
212
- /** Background color as a string (e.g., "red", "#ff0000") */
213
- background?: string;
214
- /** Whether the background fills the entire line height */
215
- backgroundFullHeight?: boolean;
216
- /** Foreground (text) color as a string */
217
- foreground?: string;
218
- /** Font family name (e.g., "Sans", "Monospace") */
219
- family?: string;
220
- /** Font description string (e.g., "Sans Italic 12") */
221
- font?: string;
222
- /** Font size in points */
223
- sizePoints?: number;
224
- /** Font size in Pango units */
225
- size?: number;
226
- /** Font size scale factor relative to default */
227
- scale?: number;
228
- /** Font weight (use Pango.Weight constants) */
229
- weight?: Pango.Weight | number;
230
- /** Font style (use Pango.Style constants) */
231
- style?: Pango.Style;
232
- /** Font stretch (use Pango.Stretch constants) */
233
- stretch?: Pango.Stretch;
234
- /** Font variant (use Pango.Variant constants) */
235
- variant?: Pango.Variant;
236
- /** Whether to strike through the text */
237
- strikethrough?: boolean;
238
- /** Underline style (use Pango.Underline constants) */
239
- underline?: Pango.Underline;
240
- /** Overline style (use Pango.Overline constants) */
241
- overline?: Pango.Overline;
242
- /** Offset of text above baseline in Pango units (negative = below) */
243
- rise?: number;
244
- /** Extra spacing between characters in Pango units */
245
- letterSpacing?: number;
246
- /** Factor to scale line height by */
247
- lineHeight?: number;
248
- /** Left margin in pixels */
249
- leftMargin?: number;
250
- /** Right margin in pixels */
251
- rightMargin?: number;
252
- /** Paragraph indent in pixels (negative = hanging) */
253
- indent?: number;
254
- /** Pixels of blank space above paragraphs */
255
- pixelsAboveLines?: number;
256
- /** Pixels of blank space below paragraphs */
257
- pixelsBelowLines?: number;
258
- /** Pixels of blank space between wrapped lines */
259
- pixelsInsideWrap?: number;
260
- /** Text justification */
261
- justification?: Gtk.Justification;
262
- /** Text direction */
263
- direction?: Gtk.TextDirection;
264
- /** Wrap mode for line breaks */
265
- wrapMode?: Gtk.WrapMode;
266
- /** Whether the text can be modified */
267
- editable?: boolean;
268
- /** Whether the text is invisible/hidden */
269
- invisible?: boolean;
270
- /** Whether breaks are allowed */
271
- allowBreaks?: boolean;
272
- /** Whether to insert hyphens at breaks */
273
- insertHyphens?: boolean;
274
- /** Whether font fallback is enabled */
275
- fallback?: boolean;
276
- /** Whether margins accumulate */
277
- accumulativeMargin?: boolean;
278
- /** Paragraph background color as a string */
279
- paragraphBackground?: string;
280
- /** How to render invisible characters */
281
- showSpaces?: Pango.ShowFlags;
282
- /** How to transform text for display */
283
- textTransform?: Pango.TextTransform;
284
- /** OpenType font features as a string */
285
- fontFeatures?: string;
286
- /** Language code (e.g., "en-US") */
287
- language?: string;
288
- /** Text content and nested TextTag children */
289
- children?: ReactNode;
290
- };
291
-
292
- /** Props for the TextSegment virtual element.
293
- *
294
- * Represents a segment of text within a TextBuffer.
295
- */
296
- export type TextSegmentProps = {
297
- /** The text content of this segment */
298
- text: string;
299
- };
300
-
301
- /**
302
- * Configuration for a mark on a GtkScale widget.
303
- *
304
- * Marks are visual indicators placed along the scale at specific values,
305
- * optionally with text labels.
306
- *
307
- * @see {@link https://docs.gtk.org/gtk4/method.Scale.add_mark.html GtkScale.add_mark}
308
- */
309
- export type ScaleMark = {
310
- /** The value at which to place the mark */
311
- value: number;
312
- /** Position of the mark relative to the scale (default: BOTTOM) */
313
- position?: Gtk.PositionType;
314
- /** Optional text label to display at the mark */
315
- label?: string | null;
316
- };
317
-
318
- /**
319
- * Configuration for an offset threshold on a GtkLevelBar widget.
320
- *
321
- * Offsets define named value thresholds that change the bar's appearance
322
- * (e.g., "low", "high", "full"). Built-in offsets include GTK_LEVEL_BAR_OFFSET_LOW,
323
- * GTK_LEVEL_BAR_OFFSET_HIGH, and GTK_LEVEL_BAR_OFFSET_FULL.
324
- *
325
- * @see {@link https://docs.gtk.org/gtk4/method.LevelBar.add_offset_value.html GtkLevelBar.add_offset_value}
326
- */
327
- export type LevelBarOffset = {
328
- /** Unique identifier for this offset (e.g., "low", "high", "full") */
329
- id: string;
330
- /** The threshold value at which this offset applies */
331
- value: number;
332
- };
333
-
334
- /**
335
- * Props for slot-based child positioning.
336
- *
337
- * @see {@link Slot} for type-safe slot usage
338
- */
339
- export type SlotProps = {
340
- /** The slot identifier */
341
- id?: string;
342
- /** Content to place in the slot */
343
- children?: ReactNode;
344
- };
345
-
346
- /**
347
- * Type mapping widgets to their valid container slot method names.
348
- *
349
- * Each key is a JSX element name and each value is a union of method names
350
- * that can be used as the `id` prop on `x.ContainerSlot`.
351
- */
352
- export type ContainerSlotNames = {
353
- AdwActionRow: "addPrefix" | "addSuffix";
354
- AdwEntryRow: "addPrefix" | "addSuffix";
355
- AdwExpanderRow: "addPrefix" | "addSuffix" | "addRow" | "addAction";
356
- AdwHeaderBar: "packStart" | "packEnd";
357
- AdwToolbarView: "addTopBar" | "addBottomBar";
358
- GtkActionBar: "packStart" | "packEnd";
359
- GtkHeaderBar: "packStart" | "packEnd";
360
- };
361
-
362
- /**
363
- * Props for method-based container slot child positioning.
364
- */
365
- export type ContainerSlotProps = {
366
- /** The method name to call on the parent widget */
367
- id: string;
368
- /** Content to place in the container slot */
369
- children?: ReactNode;
370
- };
371
-
372
- /**
373
- * A data item for list/grid/column views and dropdowns.
374
- *
375
- * Uses a discriminated union on the `section` field:
376
- * - Regular items have `value: T` and optional tree-mode properties
377
- * - Section headers have `value: S`, `section: true`, and required `children`
378
- *
379
- * Mode is detected from data shape:
380
- * - Any item has `section: true` → section mode
381
- * - Any item has non-empty `children` (without `section`) → tree mode
382
- * - Otherwise → flat mode
383
- *
384
- * @typeParam T - The type of data for regular items
385
- * @typeParam S - The type of data for section headers
386
- */
387
- export type ListItem<T = unknown, S = unknown> =
388
- | {
389
- id: string;
390
- value: T;
391
- section?: false | undefined;
392
- children?: ListItem<T, S>[];
393
- hideExpander?: boolean;
394
- indentForDepth?: boolean;
395
- indentForIcon?: boolean;
396
- }
397
- | {
398
- id: string;
399
- value: S;
400
- section: true;
401
- children: ListItem<T, S>[];
402
- };
403
-
404
- /**
405
- * Props for positioning children within a GtkGrid.
406
- *
407
- * @see {@link GridChild} for usage
408
- */
409
- export type GridChildProps = {
410
- /** Content to place in the grid cell */
411
- children?: ReactNode;
412
- /** Column index (0-based) */
413
- column?: number;
414
- /** Row index (0-based) */
415
- row?: number;
416
- /** Number of columns to span */
417
- columnSpan?: number;
418
- /** Number of rows to span */
419
- rowSpan?: number;
420
- };
421
-
422
- /**
423
- * Props for positioning children within a GtkFixed.
424
- *
425
- * @see {@link FixedChild} for usage
426
- */
427
- export type FixedChildProps = {
428
- /** Content to place in the fixed container */
429
- children?: ReactNode;
430
- /** X coordinate in pixels */
431
- x?: number;
432
- /** Y coordinate in pixels */
433
- y?: number;
434
- /** 3D transform to apply to the child (perspective, rotation, etc.) */
435
- transform?: Gsk.Transform;
436
- };
437
-
438
- /**
439
- * Props for defining a column in a ColumnView (table).
440
- *
441
- * @typeParam T - The type of data for each row
442
- *
443
- * @see {@link ColumnViewColumn} for usage
444
- */
445
- export type ColumnViewColumnProps<T = unknown> = {
446
- /** Column header text */
447
- title: string;
448
- /** Whether the column expands to fill available space */
449
- expand?: boolean;
450
- /** Whether the column can be resized by the user */
451
- resizable?: boolean;
452
- /** Fixed width in pixels */
453
- fixedWidth?: number;
454
- /** Unique identifier for this column */
455
- id: string;
456
- /** Whether clicking the header sorts by this column */
457
- sortable?: boolean;
458
- /** Whether this column is visible */
459
- visible?: boolean;
460
- /** Function to render the cell content for each row */
461
- renderCell: (item: T) => ReactNode;
462
- /** Menu items for the column header context menu */
463
- children?: ReactNode;
464
- };
465
-
466
- /**
467
- * Props for notebook (tabbed) pages.
468
- */
469
- export type NotebookPageProps = {
470
- /** Content to place in the notebook page */
471
- children?: ReactNode;
472
- /** Tab label text (optional when using Notebook.PageTab) */
473
- label?: string;
474
- /** Whether the tab should expand to fill available space */
475
- tabExpand?: boolean;
476
- /** Whether the tab should fill its allocated space */
477
- tabFill?: boolean;
478
- };
479
-
480
- /**
481
- * Props for custom notebook page tab widgets.
482
- */
483
- export type NotebookPageTabProps = {
484
- /** Content to place in the notebook page tab */
485
- children?: ReactNode;
486
- };
487
-
488
- /**
489
- * Props for pages within a Stack or ViewStack.
490
- *
491
- * @see {@link StackPage} for usage
492
- */
493
- export type StackPageProps = {
494
- /** Content to place in the stack page */
495
- children?: ReactNode;
496
- /** Unique identifier for this page (used with page prop) */
497
- id?: string;
498
- /** Display title shown in stack switchers */
499
- title?: string;
500
- /** Icon name from the icon theme */
501
- iconName?: string;
502
- /** Whether to show an attention indicator */
503
- needsAttention?: boolean;
504
- /** Whether this page is visible in switchers */
505
- visible?: boolean;
506
- /** Whether underscores in title indicate mnemonics */
507
- useUnderline?: boolean;
508
- /** Badge number shown on the page indicator */
509
- badgeNumber?: number;
510
- };
511
-
512
- /**
513
- * Props for menu items.
514
- *
515
- * @see {@link Menu} for building menus
516
- */
517
- export type MenuItemProps = {
518
- /** Unique identifier for this menu item */
519
- id: string;
520
- /** Display label */
521
- label: string;
522
- /** Callback when the item is activated */
523
- onActivate: () => void;
524
- /** Keyboard accelerator(s) (e.g., "\<Control\>q") */
525
- accels?: string | string[];
526
- };
527
-
528
- /**
529
- * Props for menu sections.
530
- *
531
- * Sections group related menu items with optional labels.
532
- */
533
- export type MenuSectionProps = {
534
- /** Optional section header label */
535
- label?: string;
536
- /** Menu items in this section */
537
- children?: ReactNode;
538
- };
539
-
540
- /**
541
- * Props for submenus.
542
- */
543
- export type MenuSubmenuProps = {
544
- /** Submenu label */
545
- label: string;
546
- /** Menu items in this submenu */
547
- children?: ReactNode;
548
- };
549
-
550
- /**
551
- * Props for children within an Overlay container.
552
- */
553
- export type OverlayChildProps = {
554
- /** Content to place in the overlay child */
555
- children?: ReactNode;
556
- /** Whether to include this child in size measurement */
557
- measure?: boolean;
558
- /** Whether to clip this overlay child to the main child bounds */
559
- clipOverlay?: boolean;
560
- };
561
-
562
- /**
563
- * Props for the Toggle virtual element.
564
- *
565
- * Used to declaratively add toggles to an AdwToggleGroup.
566
- *
567
- * @example
568
- * ```tsx
569
- * <AdwToggleGroup>
570
- * <x.Toggle id="view-list" iconName="view-list-symbolic" />
571
- * <x.Toggle id="view-grid" iconName="view-grid-symbolic" />
572
- * <x.Toggle id="view-flow" label="Flow" />
573
- * </AdwToggleGroup>
574
- * ```
575
- */
576
- export type ToggleProps = {
577
- /** Optional identifier for accessing toggle by id instead of index */
578
- id?: string | null;
579
- /** Label text to display */
580
- label?: string | null;
581
- /** Icon name to display */
582
- iconName?: string | null;
583
- /** Tooltip text (supports Pango markup) */
584
- tooltip?: string;
585
- /** Whether the toggle is enabled */
586
- enabled?: boolean;
587
- /** Whether underline in label indicates mnemonic */
588
- useUnderline?: boolean;
589
- };
590
-
591
- /**
592
- * Props for response buttons in an AdwAlertDialog.
593
- *
594
- * Each response represents a button the user can click to dismiss the dialog.
595
- *
596
- * @see {@link x.AlertDialogResponse} for usage
597
- */
598
- export type AlertDialogResponseProps = {
599
- /** Unique response ID (used in response signal and for default/close response) */
600
- id: string;
601
- /** Button label text */
602
- label: string;
603
- /** Visual appearance of the response button */
604
- appearance?: Adw.ResponseAppearance;
605
- /** Whether the response button is enabled */
606
- enabled?: boolean;
607
- };
608
-
609
- type NavigationPageBaseProps = {
610
- /** Display title for the navigation page */
611
- title?: string;
612
- /** Whether the page can be popped from the navigation stack */
613
- canPop?: boolean;
614
- /** Page content */
615
- children?: ReactNode;
616
- };
617
-
618
- /**
619
- * Props for the NavigationPage virtual element with type-safe targeting.
620
- *
621
- * The `for` prop is required and determines valid `id` values:
622
- * - `AdwNavigationView`: `id` can be any string (page tags for navigation history)
623
- * - `AdwNavigationSplitView`: `id` is narrowed to `"content" | "sidebar"` (slot positions)
624
- *
625
- * @example
626
- * ```tsx
627
- * // In NavigationView - id can be any string
628
- * <AdwNavigationView history={["home", "details"]}>
629
- * <x.NavigationPage for={AdwNavigationView} id="home" title="Home">
630
- * <HomeContent />
631
- * </x.NavigationPage>
632
- * </AdwNavigationView>
633
- *
634
- * // In NavigationSplitView - id is narrowed to "content" | "sidebar"
635
- * <AdwNavigationSplitView>
636
- * <x.NavigationPage for={AdwNavigationSplitView} id="sidebar" title="Sidebar">
637
- * <SidebarContent />
638
- * </x.NavigationPage>
639
- * <x.NavigationPage for={AdwNavigationSplitView} id="content" title="Content">
640
- * <MainContent />
641
- * </x.NavigationPage>
642
- * </AdwNavigationSplitView>
643
- * ```
644
- */
645
- export type NavigationPageProps =
646
- | (NavigationPageBaseProps & { for: "AdwNavigationView"; id: string })
647
- | (NavigationPageBaseProps & {
648
- for: "AdwNavigationSplitView";
649
- id: WidgetSlotNames["AdwNavigationSplitView"];
650
- });
651
-
652
- /**
653
- * Props shared by text buffer hosts (GtkTextView, GtkSourceView).
654
- *
655
- * Provides undo control and buffer mutation callbacks.
656
- */
657
- export type TextBufferProps = {
658
- /** Whether undo/redo is enabled on the text buffer */
659
- enableUndo?: boolean;
660
- /** Callback fired when the buffer content changes */
661
- onBufferChanged?: ((buffer: Gtk.TextBuffer) => void) | null;
662
- /** Callback fired when text is inserted into the buffer */
663
- onTextInserted?: ((buffer: Gtk.TextBuffer, offset: number, text: string) => void) | null;
664
- /** Callback fired when text is deleted from the buffer */
665
- onTextDeleted?: ((buffer: Gtk.TextBuffer, startOffset: number, endOffset: number) => void) | null;
666
- /** Callback fired when the undo availability changes */
667
- onCanUndoChanged?: ((canUndo: boolean) => void) | null;
668
- /** Callback fired when the redo availability changes */
669
- onCanRedoChanged?: ((canRedo: boolean) => void) | null;
670
- };
671
-
672
- type BaseListViewProps = {
673
- /** Estimated item height in pixels for virtualization */
674
- estimatedItemHeight?: number;
675
- /** Estimated item width in pixels for virtualization */
676
- estimatedItemWidth?: number;
677
- /** Array of selected item IDs */
678
- selected?: string[] | null;
679
- /** Callback fired when the selection changes */
680
- onSelectionChanged?: ((ids: string[]) => void) | null;
681
- /** Selection behavior (single, multiple, none, etc.) */
682
- selectionMode?: Gtk.SelectionMode | null;
683
- };
684
-
685
- export type ListViewProps<T = unknown, S = unknown> = BaseListViewProps & {
686
- /** Data items to display in the list */
687
- items?: ListItem<T, S>[];
688
- /** Function to render each list item. The `row` parameter provides tree state for hierarchical lists. */
689
- renderItem: (item: T, row?: Gtk.TreeListRow | null) => ReactNode;
690
- /** Whether to automatically expand new tree rows (default: false) */
691
- autoexpand?: boolean;
692
- /** Function to render section headers when items contain section entries */
693
- renderHeader?: ((item: S) => ReactNode) | null;
694
- };
695
-
696
- export type GridViewProps<T = unknown> = BaseListViewProps & {
697
- /** Data items to display in the grid */
698
- items?: ListItem<T>[];
699
- /** Function to render each grid item */
700
- renderItem: (item: T) => ReactNode;
701
- };
702
-
703
- /**
704
- * Props shared by single-selection dropdown widgets (GtkDropDown, AdwComboRow).
705
- */
706
- export type DropDownProps<T = unknown, S = unknown> = {
707
- /** Data items to display in the dropdown */
708
- items?: ListItem<T, S>[];
709
- /** ID of the currently selected item */
710
- selectedId?: string | null;
711
- /** Callback fired when the selected item changes */
712
- onSelectionChanged?: ((id: string) => void) | null;
713
- /** Function to render each item. Sets the primary factory, used for both button and popup list unless overridden by renderListItem. */
714
- renderItem?: ((item: T) => ReactNode) | null;
715
- /** Function to render items in the popup list only, overriding renderItem for the list. */
716
- renderListItem?: ((item: T) => ReactNode) | null;
717
- /** Function to render section headers when items contain section entries */
718
- renderHeader?: ((item: S) => ReactNode) | null;
719
- };
720
-
721
- /**
722
- * Props shared by dialog button widgets (GtkColorDialogButton, GtkFontDialogButton).
723
- */
724
- export type DialogButtonProps = {
725
- /** Title for the chooser dialog */
726
- title?: string;
727
- /** Whether the dialog is modal */
728
- modal?: boolean;
729
- };
730
-
731
- /**
732
- * Props for widgets backed by a GtkAdjustment.
733
- *
734
- * Used by GtkRange, GtkScaleButton, GtkSpinButton, and AdwSpinRow
735
- * to configure the adjustment bounds, increments, and value change callback.
736
- */
737
- export type AdjustableProps = {
738
- /** The current value of the adjustable */
739
- value?: number;
740
- /** The minimum allowed value */
741
- lower?: number;
742
- /** The maximum allowed value */
743
- upper?: number;
744
- /** The step increment for small adjustments */
745
- stepIncrement?: number;
746
- /** The page increment for larger adjustments */
747
- pageIncrement?: number;
748
- /** The size of the visible portion (for scrollbars) */
749
- pageSize?: number;
750
- /** Callback fired when the adjustable value changes */
751
- onValueChanged?: ((value: number, self: Gtk.Range | Gtk.ScaleButton | Gtk.SpinButton | Adw.SpinRow) => void) | null;
752
- };
753
-
754
- /**
755
- * GTKX-specific intrinsic elements and components.
756
- *
757
- * This namespace provides React components for GTK layout, lists, menus, and slots
758
- * that are specific to GTKX (not direct GTK widget bindings).
759
- *
760
- * @example
761
- * ```tsx
762
- * import { x, GtkHeaderBar } from "@gtkx/react";
763
- *
764
- * <GtkHeaderBar>
765
- * <x.Slot for={GtkHeaderBar} id="titleWidget">
766
- * <GtkLabel label="App Title" />
767
- * </x.Slot>
768
- * </GtkHeaderBar>
769
- * ```
770
- */
771
- export const x = {
772
- /**
773
- * Type-safe slot component for placing children in named widget slots.
774
- *
775
- * GTK widgets often have named slots for specific child positions (e.g., titleWidget,
776
- * startWidget). This component provides type-safe access to those slots.
777
- *
778
- * @example
779
- * ```tsx
780
- * <GtkHeaderBar>
781
- * <x.Slot for={GtkHeaderBar} id="titleWidget">
782
- * <GtkLabel label="App Title" />
783
- * </x.Slot>
784
- * </GtkHeaderBar>
785
- * ```
786
- */
787
- Slot<W extends keyof WidgetSlotNames>(props: {
788
- for: W;
789
- id: WidgetSlotNames[W];
790
- children?: ReactNode;
791
- }): ReactElement {
792
- return createElement("Slot", { id: props.id }, props.children);
793
- },
794
-
795
- /**
796
- * Element type for pages within a GtkStack or AdwViewStack.
797
- *
798
- * @example
799
- * ```tsx
800
- * <GtkStack page="page1">
801
- * <x.StackPage id="page1" title="First Page">
802
- * <GtkLabel label="Content 1" />
803
- * </x.StackPage>
804
- * </GtkStack>
805
- * ```
806
- */
807
- StackPage: "StackPage" as const,
808
-
809
- /**
810
- * Element type for positioning children within a GtkGrid.
811
- *
812
- * @example
813
- * ```tsx
814
- * <GtkGrid>
815
- * <x.GridChild column={0} row={0}>
816
- * <GtkLabel label="Top Left" />
817
- * </x.GridChild>
818
- * </GtkGrid>
819
- * ```
820
- */
821
- GridChild: "GridChild" as const,
822
-
823
- /**
824
- * Element type for positioning children within a GtkFixed.
825
- *
826
- * @example
827
- * ```tsx
828
- * <GtkFixed>
829
- * <x.FixedChild x={20} y={30}>
830
- * <GtkLabel label="Positioned at (20, 30)" />
831
- * </x.FixedChild>
832
- * </GtkFixed>
833
- * ```
834
- */
835
- FixedChild: "FixedChild" as const,
836
-
837
- /**
838
- * Element type for a page within a GtkNotebook (tabbed interface).
839
- *
840
- * @example
841
- * ```tsx
842
- * <GtkNotebook>
843
- * <x.NotebookPage label="Tab 1">
844
- * <GtkLabel label="Content 1" />
845
- * </x.NotebookPage>
846
- * </GtkNotebook>
847
- * ```
848
- */
849
- NotebookPage: "NotebookPage" as const,
850
-
851
- /**
852
- * Element type for a custom widget as the page tab label.
853
- */
854
- NotebookPageTab: "NotebookPageTab" as const,
855
-
856
- /**
857
- * Component for defining columns in a ColumnView (table widget).
858
- *
859
- * @example
860
- * ```tsx
861
- * <GtkColumnView>
862
- * <x.ColumnViewColumn
863
- * id="name"
864
- * title="Name"
865
- * expand
866
- * renderCell={(item) => <GtkLabel label={item?.name ?? ""} />}
867
- * />
868
- * </GtkColumnView>
869
- * ```
870
- */
871
- ColumnViewColumn<T = unknown>(props: ColumnViewColumnProps<T>): ReactElement {
872
- return createElement("ColumnViewColumn", props, props.children);
873
- },
874
-
875
- /**
876
- * Type-safe container slot for placing children via parent widget methods.
877
- *
878
- * Unlike `x.Slot` (which uses property setters for single-child slots),
879
- * `x.ContainerSlot` calls attachment methods that support multiple children
880
- * (e.g., `addPrefix()`, `packStart()`, `addTopBar()`).
881
- *
882
- * The `for` prop provides TypeScript type narrowing for the `id` prop
883
- * and is not used at runtime.
884
- *
885
- * @example
886
- * ```tsx
887
- * <AdwToolbarView>
888
- * <x.ContainerSlot for={AdwToolbarView} id="addTopBar">
889
- * <AdwHeaderBar />
890
- * </x.ContainerSlot>
891
- * </AdwToolbarView>
892
- *
893
- * <GtkHeaderBar>
894
- * <x.ContainerSlot for={GtkHeaderBar} id="packStart">
895
- * <GtkButton label="Back" />
896
- * </x.ContainerSlot>
897
- * </GtkHeaderBar>
898
- *
899
- * <AdwActionRow title="Setting">
900
- * <x.ContainerSlot for={AdwActionRow} id="addPrefix">
901
- * <GtkCheckButton />
902
- * </x.ContainerSlot>
903
- * </AdwActionRow>
904
- * ```
905
- */
906
- ContainerSlot<W extends keyof ContainerSlotNames>(props: {
907
- for: W;
908
- id: ContainerSlotNames[W];
909
- children?: ReactNode;
910
- }): ReactElement {
911
- return createElement("ContainerSlot", { id: props.id }, props.children);
912
- },
913
-
914
- /**
915
- * Element type for overlay children positioned above the main content.
916
- *
917
- * @example
918
- * ```tsx
919
- * <GtkOverlay>
920
- * <GtkImage file="background.png" />
921
- * <x.OverlayChild>
922
- * <GtkLabel label="Overlaid text" />
923
- * </x.OverlayChild>
924
- * </GtkOverlay>
925
- * ```
926
- */
927
- OverlayChild: "OverlayChild" as const,
928
-
929
- /**
930
- * A clickable menu item with action.
931
- *
932
- * @example
933
- * ```tsx
934
- * <GtkMenuButton>
935
- * <x.MenuItem id="open" label="Open" onActivate={handleOpen} />
936
- * </GtkMenuButton>
937
- * ```
938
- */
939
- MenuItem: "MenuItem" as const,
940
-
941
- /**
942
- * A section grouping related menu items.
943
- *
944
- * @example
945
- * ```tsx
946
- * <GtkMenuButton>
947
- * <x.MenuSection label="File">
948
- * <x.MenuItem id="open" label="Open" onActivate={handleOpen} />
949
- * </x.MenuSection>
950
- * </GtkMenuButton>
951
- * ```
952
- */
953
- MenuSection: "MenuSection" as const,
954
-
955
- /**
956
- * A submenu containing nested items.
957
- *
958
- * @example
959
- * ```tsx
960
- * <GtkMenuButton>
961
- * <x.MenuSubmenu label="Export">
962
- * <x.MenuItem id="pdf" label="As PDF" onActivate={exportPdf} />
963
- * </x.MenuSubmenu>
964
- * </GtkMenuButton>
965
- * ```
966
- */
967
- MenuSubmenu: "MenuSubmenu" as const,
968
-
969
- /**
970
- * Declarative text tag for styling text content.
971
- *
972
- * Wrap text content with a TextTag to apply styling. Tags can be nested.
973
- *
974
- * @example
975
- * ```tsx
976
- * <GtkTextView>
977
- * Normal <x.TextTag id="bold" weight={Pango.Weight.BOLD}>
978
- * bold <x.TextTag id="red" foreground="red">and red</x.TextTag>
979
- * </x.TextTag> text.
980
- * </GtkTextView>
981
- * ```
982
- */
983
- TextTag: "TextTag" as const,
984
-
985
- /**
986
- * Declarative anchor for embedding widgets in text flow.
987
- *
988
- * The anchor is placed at the current position in the text.
989
- *
990
- * @example
991
- * ```tsx
992
- * <GtkTextView>
993
- * Click here: <x.TextAnchor>
994
- * <GtkButton label="Click me" />
995
- * </x.TextAnchor> to continue.
996
- * </GtkTextView>
997
- * ```
998
- */
999
- TextAnchor: "TextAnchor" as const,
1000
-
1001
- /**
1002
- * Declarative inline paintable for embedding images/icons in text flow.
1003
- *
1004
- * The paintable is placed at the current position in the text.
1005
- *
1006
- * @example
1007
- * ```tsx
1008
- * <GtkTextView>
1009
- * Click the icon <x.TextPaintable paintable={iconPaintable} /> to continue.
1010
- * </GtkTextView>
1011
- * ```
1012
- */
1013
- TextPaintable: "TextPaintable" as const,
1014
-
1015
- /**
1016
- * A toggle button for an AdwToggleGroup.
1017
- *
1018
- * @example
1019
- * ```tsx
1020
- * <AdwToggleGroup>
1021
- * <x.Toggle id="list" iconName="view-list-symbolic" />
1022
- * <x.Toggle id="grid" iconName="view-grid-symbolic" />
1023
- * </AdwToggleGroup>
1024
- * ```
1025
- */
1026
- Toggle: "Toggle" as const,
1027
-
1028
- /**
1029
- * A response button for an AdwAlertDialog.
1030
- *
1031
- * @example
1032
- * ```tsx
1033
- * <AdwAlertDialog
1034
- * heading="Delete File?"
1035
- * body="This cannot be undone."
1036
- * defaultResponse="cancel"
1037
- * closeResponse="cancel"
1038
- * >
1039
- * <x.AlertDialogResponse id="cancel" label="Cancel" />
1040
- * <x.AlertDialogResponse id="delete" label="Delete" appearance={Adw.ResponseAppearance.DESTRUCTIVE} />
1041
- * </AdwAlertDialog>
1042
- * ```
1043
- */
1044
- AlertDialogResponse: "AlertDialogResponse" as const,
1045
-
1046
- /**
1047
- * Type-safe page component for AdwNavigationView or AdwNavigationSplitView.
1048
- *
1049
- * The `for` prop is required and determines valid `id` values:
1050
- * - `AdwNavigationView`: any string (page tags for navigation history)
1051
- * - `AdwNavigationSplitView`: `"content"` or `"sidebar"` (slot positions)
1052
- *
1053
- * @example
1054
- * ```tsx
1055
- * // In NavigationView - id can be any string
1056
- * <AdwNavigationView history={["home"]}>
1057
- * <x.NavigationPage for={AdwNavigationView} id="home" title="Home">
1058
- * <GtkLabel label="Welcome!" />
1059
- * </x.NavigationPage>
1060
- * </AdwNavigationView>
1061
- *
1062
- * // In NavigationSplitView - id is narrowed to "content" | "sidebar"
1063
- * <AdwNavigationSplitView>
1064
- * <x.NavigationPage for={AdwNavigationSplitView} id="sidebar" title="Sidebar">
1065
- * <GtkLabel label="Sidebar" />
1066
- * </x.NavigationPage>
1067
- * <x.NavigationPage for={AdwNavigationSplitView} id="content" title="Content">
1068
- * <GtkLabel label="Content" />
1069
- * </x.NavigationPage>
1070
- * </AdwNavigationSplitView>
1071
- * ```
1072
- */
1073
- NavigationPage: "NavigationPage" as const,
1074
-
1075
- /**
1076
- * A keyboard shortcut definition.
1077
- *
1078
- * Must be a child of `<GtkShortcutController>`.
1079
- *
1080
- * @example
1081
- * ```tsx
1082
- * <x.Shortcut trigger="<Control>s" onActivate={save} />
1083
- * <x.Shortcut trigger={["F5", "<Control>r"]} onActivate={refresh} />
1084
- * <x.Shortcut trigger="Escape" onActivate={cancel} disabled={!canCancel} />
1085
- * ```
1086
- */
1087
- Shortcut: "Shortcut" as const,
1088
-
1089
- /**
1090
- * Declarative animation wrapper using Adw.TimedAnimation or Adw.SpringAnimation.
1091
- *
1092
- * Provides framer-motion-inspired API for animating child widgets.
1093
- *
1094
- * @example
1095
- * ```tsx
1096
- * <x.Animation
1097
- * initial={{ opacity: 0, scale: 0.9 }}
1098
- * animate={{ opacity: 1, scale: 1 }}
1099
- * transition={{ mode: "spring", damping: 0.8, stiffness: 200 }}
1100
- * animateOnMount
1101
- * >
1102
- * <GtkButton label="Animated Button" />
1103
- * </x.Animation>
1104
- * ```
1105
- */
1106
- Animation: "Animation" as const,
1107
- };
1108
-
1109
- interface StackProps {
1110
- /** ID of the currently visible page */
1111
- page?: string | null;
1112
- }
1113
-
1114
- declare global {
1115
- namespace React {
1116
- namespace JSX {
1117
- interface IntrinsicElements {
1118
- AlertDialogResponse: AlertDialogResponseProps;
1119
- Animation: AnimationProps;
1120
- ContainerSlot: ContainerSlotProps;
1121
- ColumnViewColumn: ColumnViewColumnProps;
1122
- FixedChild: FixedChildProps;
1123
- GridChild: GridChildProps;
1124
- MenuItem: MenuItemProps;
1125
- MenuSection: MenuSectionProps;
1126
- MenuSubmenu: MenuSubmenuProps;
1127
- NotebookPage: NotebookPageProps;
1128
- NotebookPageTab: NotebookPageTabProps;
1129
- OverlayChild: OverlayChildProps;
1130
- TextAnchor: TextAnchorProps;
1131
- TextPaintable: TextPaintableProps;
1132
- TextTag: TextTagProps;
1133
-
1134
- StackPage: StackPageProps;
1135
- Toggle: ToggleProps;
1136
- NavigationPage: NavigationPageProps;
1137
- Shortcut: ShortcutProps;
1138
- }
1139
- }
1140
- }
1141
- }
1142
-
1143
- export type AccessibleProps = {
1144
- accessibleAutocomplete?: Gtk.AccessibleAutocomplete;
1145
- accessibleDescription?: string;
1146
- accessibleHasPopup?: boolean;
1147
- accessibleKeyShortcuts?: string;
1148
- accessibleLabel?: string;
1149
- accessibleLevel?: number;
1150
- accessibleModal?: boolean;
1151
- accessibleMultiLine?: boolean;
1152
- accessibleMultiSelectable?: boolean;
1153
- accessibleOrientation?: Gtk.Orientation;
1154
- accessiblePlaceholder?: string;
1155
- accessibleReadOnly?: boolean;
1156
- accessibleRequired?: boolean;
1157
- accessibleRoleDescription?: string;
1158
- accessibleSort?: Gtk.AccessibleSort;
1159
- accessibleValueMax?: number;
1160
- accessibleValueMin?: number;
1161
- accessibleValueNow?: number;
1162
- accessibleValueText?: string;
1163
- accessibleHelpText?: string;
1164
-
1165
- accessibleBusy?: boolean;
1166
- accessibleChecked?: Gtk.AccessibleTristate;
1167
- accessibleDisabled?: boolean;
1168
- accessibleExpanded?: boolean;
1169
- accessibleHidden?: boolean;
1170
- accessibleInvalid?: Gtk.AccessibleInvalidState;
1171
- accessiblePressed?: Gtk.AccessibleTristate;
1172
- accessibleSelected?: boolean;
1173
- accessibleVisited?: boolean;
1174
-
1175
- accessibleActiveDescendant?: Gtk.Widget;
1176
- accessibleColCount?: number;
1177
- accessibleColIndex?: number;
1178
- accessibleColIndexText?: string;
1179
- accessibleColSpan?: number;
1180
- accessibleControls?: Gtk.Widget[];
1181
- accessibleDescribedBy?: Gtk.Widget[];
1182
- accessibleDetails?: Gtk.Widget[];
1183
- accessibleErrorMessage?: Gtk.Widget[];
1184
- accessibleFlowTo?: Gtk.Widget[];
1185
- accessibleLabelledBy?: Gtk.Widget[];
1186
- accessibleOwns?: Gtk.Widget[];
1187
- accessiblePosInSet?: number;
1188
- accessibleRowCount?: number;
1189
- accessibleRowIndex?: number;
1190
- accessibleRowIndexText?: string;
1191
- accessibleRowSpan?: number;
1192
- accessibleSetSize?: number;
1193
- };
1194
-
1195
- declare module "./generated/jsx.js" {
1196
- interface WidgetProps extends AccessibleProps {}
1197
-
1198
- interface GtkRangeProps extends Omit<AdjustableProps, "onValueChanged"> {
1199
- /** Callback fired when the range value changes */
1200
- onValueChanged?: ((value: number, self: Gtk.Range) => void) | null;
1201
- }
1202
-
1203
- interface GtkScaleProps {
1204
- /** Visual marks placed along the scale at specific values */
1205
- marks?: Array<{ value: number; position?: Gtk.PositionType; label?: string | null }> | null;
1206
- }
1207
-
1208
- interface GtkScaleButtonProps extends Omit<AdjustableProps, "value" | "onValueChanged"> {
1209
- /** Callback fired when the scale button value changes */
1210
- onValueChanged?: ((value: number, self: Gtk.ScaleButton) => void) | null;
1211
- }
1212
-
1213
- interface GtkSpinButtonProps extends Omit<AdjustableProps, "value" | "onValueChanged"> {
1214
- /** Callback fired when the spin button value changes */
1215
- onValueChanged?: ((value: number, self: Gtk.SpinButton) => void) | null;
1216
- }
1217
-
1218
- interface AdwSpinRowProps extends Omit<AdjustableProps, "value" | "onValueChanged"> {
1219
- /** Callback fired when the spin row value changes */
1220
- onValueChanged?: ((value: number, self: Adw.SpinRow) => void) | null;
1221
- }
1222
-
1223
- interface GtkCalendarProps {
1224
- /** Array of day numbers (1-31) to display as marked */
1225
- markedDays?: number[] | null;
1226
- }
1227
-
1228
- interface GtkLevelBarProps {
1229
- /** Named offset thresholds that change the bar's appearance */
1230
- offsets?: Array<{ id: string; value: number }> | null;
1231
- }
1232
-
1233
- interface GtkTextViewProps extends TextBufferProps {}
1234
-
1235
- interface GtkSourceViewProps extends TextBufferProps {
1236
- /** Language for syntax highlighting (ID string or Language object) */
1237
- language?: string | GtkSource.Language;
1238
- /** Color scheme for syntax highlighting (ID string or StyleScheme object) */
1239
- styleScheme?: string | GtkSource.StyleScheme;
1240
- /** Whether syntax highlighting is enabled */
1241
- highlightSyntax?: boolean;
1242
- /** Whether matching brackets are highlighted */
1243
- highlightMatchingBrackets?: boolean;
1244
- /** Whether the buffer has an implicit trailing newline */
1245
- implicitTrailingNewline?: boolean;
1246
- /** Callback fired when the cursor position changes */
1247
- onCursorMoved?: (() => void) | null;
1248
- /** Callback fired when the highlighted region is updated */
1249
- onHighlightUpdated?: ((start: Gtk.TextIter, end: Gtk.TextIter) => void) | null;
1250
- }
1251
-
1252
- interface GtkListViewProps extends ListViewProps {}
1253
-
1254
- interface GtkGridViewProps extends GridViewProps {}
1255
-
1256
- interface GtkColumnViewProps {
1257
- /** Data items to display in the column view */
1258
- items?: ListItem[];
1259
- /** Array of selected row IDs */
1260
- selected?: string[] | null;
1261
- /** Callback fired when the selection changes */
1262
- onSelectionChanged?: ((ids: string[]) => void) | null;
1263
- /** Selection behavior (single, multiple, none, etc.) */
1264
- selectionMode?: Gtk.SelectionMode | null;
1265
- /** ID of the currently sorted column, or null for no sorting */
1266
- sortColumn?: string | null;
1267
- /** Sort direction (ascending or descending) */
1268
- sortOrder?: Gtk.SortType | null;
1269
- /** Callback fired when the sort column or order changes */
1270
- onSortChanged?: ((column: string | null, order: Gtk.SortType) => void) | null;
1271
- /** Estimated row height in pixels for virtualization */
1272
- estimatedRowHeight?: number | null;
1273
- /** Function to render section headers when items contain section entries */
1274
- renderHeader?: ((item: unknown) => ReactNode) | null;
1275
- }
1276
-
1277
- interface GtkDropDownProps extends DropDownProps {}
1278
-
1279
- interface AdwComboRowProps extends DropDownProps {}
1280
-
1281
- interface GtkStackProps extends StackProps {
1282
- /** Callback fired when the visible page changes */
1283
- onPageChanged?: ((page: string | null, self: Gtk.Stack) => void) | null;
1284
- }
1285
-
1286
- interface AdwViewStackProps extends StackProps {
1287
- /** Callback fired when the visible page changes */
1288
- onPageChanged?: ((page: string | null, self: Adw.ViewStack) => void) | null;
1289
- }
1290
-
1291
- interface AdwNavigationViewProps {
1292
- /** Ordered list of page tags representing the navigation stack */
1293
- history?: string[] | null;
1294
- /** Callback fired when the navigation history changes */
1295
- onHistoryChanged?: ((history: string[]) => void) | null;
1296
- }
1297
-
1298
- interface GtkWindowProps {
1299
- /** Callback fired when the window close button is clicked */
1300
- onClose?: (() => void) | null;
1301
- }
1302
-
1303
- interface GtkDrawingAreaProps {
1304
- /** Callback fired when the drawing area needs to be redrawn */
1305
- onDraw?: ((cr: cairo.Context, width: number, height: number, self: Gtk.DrawingArea) => void) | null;
1306
- }
1307
-
1308
- interface GtkColorDialogButtonProps extends DialogButtonProps {
1309
- /** Callback fired when the selected color changes */
1310
- onRgbaChanged?: ((rgba: Gdk.RGBA) => void) | null;
1311
- /** Whether to show an alpha (opacity) channel */
1312
- withAlpha?: boolean;
1313
- }
1314
-
1315
- interface GtkFontDialogButtonProps extends DialogButtonProps {
1316
- /** Callback fired when the selected font changes */
1317
- onFontDescChanged?: ((fontDesc: Pango.FontDescription) => void) | null;
1318
- /** Filter to restrict which fonts are shown in the dialog */
1319
- filter?: Gtk.Filter | null;
1320
- /** Custom font map to select fonts from */
1321
- fontMap?: Pango.FontMap | null;
1322
- }
1323
-
1324
- interface GtkAboutDialogProps {
1325
- /** Additional credit sections with names and lists of people */
1326
- creditSections?: Array<{ name: string; people: string[] }>;
1327
- }
1328
-
1329
- interface GtkSearchBarProps {
1330
- /** Callback fired when search mode is toggled */
1331
- onSearchModeChanged?: ((searchMode: boolean) => void) | null;
1332
- }
1333
-
1334
- interface AdwToggleGroupProps {
1335
- /** Callback fired when the active toggle changes */
1336
- onActiveChanged?: ((active: number, activeName: string | null) => void) | null;
1337
- }
1338
-
1339
- interface GtkDragSourceProps {
1340
- /** Paintable to use as the drag icon */
1341
- icon?: Gdk.Paintable | null;
1342
- /** X offset of the hotspot within the drag icon */
1343
- iconHotX?: number;
1344
- /** Y offset of the hotspot within the drag icon */
1345
- iconHotY?: number;
1346
- }
1347
-
1348
- interface GtkDropTargetProps {
1349
- /** GType values for accepted drop content types */
1350
- types?: number[];
1351
- }
1352
- }
1353
-
1354
- export { AdwComboRow, GtkColumnView, GtkDropDown, GtkGridView, GtkListView } from "./components/list.js";
1355
- export * from "./generated/jsx.js";