@gtkx/react 0.21.0 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (599) hide show
  1. package/README.md +137 -34
  2. package/dist/adw/config.d.ts +2 -0
  3. package/dist/adw/config.d.ts.map +1 -0
  4. package/dist/adw/config.js +2 -0
  5. package/dist/adw/config.js.map +1 -0
  6. package/dist/adw/dialog.d.ts +8 -0
  7. package/dist/adw/dialog.d.ts.map +1 -0
  8. package/dist/adw/dialog.js +25 -0
  9. package/dist/adw/dialog.js.map +1 -0
  10. package/dist/adw/element-behaviors.d.ts +2 -0
  11. package/dist/adw/element-behaviors.d.ts.map +1 -0
  12. package/dist/adw/element-behaviors.js +299 -0
  13. package/dist/adw/element-behaviors.js.map +1 -0
  14. package/dist/adw/element-config.d.ts +9 -0
  15. package/dist/adw/element-config.d.ts.map +1 -0
  16. package/dist/adw/element-config.js +137 -0
  17. package/dist/adw/element-config.js.map +1 -0
  18. package/dist/adw/index.d.ts +4 -0
  19. package/dist/adw/index.d.ts.map +1 -0
  20. package/dist/adw/index.js +3 -0
  21. package/dist/adw/index.js.map +1 -0
  22. package/dist/adw/prop-types.d.ts +29 -0
  23. package/dist/adw/prop-types.d.ts.map +1 -0
  24. package/dist/adw/prop-types.js +2 -0
  25. package/dist/adw/prop-types.js.map +1 -0
  26. package/dist/bootstrap.d.ts +2 -0
  27. package/dist/bootstrap.d.ts.map +1 -0
  28. package/dist/bootstrap.js +5 -0
  29. package/dist/bootstrap.js.map +1 -0
  30. package/dist/components/application.d.ts +10 -0
  31. package/dist/components/application.d.ts.map +1 -0
  32. package/dist/components/application.js +39 -0
  33. package/dist/components/application.js.map +1 -0
  34. package/dist/components/element.d.ts +6 -0
  35. package/dist/components/element.d.ts.map +1 -0
  36. package/dist/components/element.js +29 -0
  37. package/dist/components/element.js.map +1 -0
  38. package/dist/components/window.d.ts +8 -0
  39. package/dist/components/window.d.ts.map +1 -0
  40. package/dist/components/window.js +22 -0
  41. package/dist/components/window.js.map +1 -0
  42. package/dist/config.d.ts +4 -0
  43. package/dist/config.d.ts.map +1 -0
  44. package/dist/config.js +3 -0
  45. package/dist/config.js.map +1 -0
  46. package/dist/element-behaviors.d.ts +2 -0
  47. package/dist/element-behaviors.d.ts.map +1 -0
  48. package/dist/element-behaviors.js +348 -0
  49. package/dist/element-behaviors.js.map +1 -0
  50. package/dist/element-config.d.ts +10 -0
  51. package/dist/element-config.d.ts.map +1 -0
  52. package/dist/element-config.js +146 -0
  53. package/dist/element-config.js.map +1 -0
  54. package/dist/hooks/use-application.d.ts +9 -0
  55. package/dist/hooks/use-application.d.ts.map +1 -0
  56. package/dist/hooks/use-application.js +14 -0
  57. package/dist/hooks/use-application.js.map +1 -0
  58. package/dist/hooks/use-bind-setting.d.ts +23 -0
  59. package/dist/hooks/use-bind-setting.d.ts.map +1 -0
  60. package/dist/hooks/use-bind-setting.js +30 -0
  61. package/dist/hooks/use-bind-setting.js.map +1 -0
  62. package/dist/hooks/use-merged-refs.d.ts +8 -0
  63. package/dist/hooks/use-merged-refs.d.ts.map +1 -0
  64. package/dist/hooks/use-merged-refs.js +48 -0
  65. package/dist/hooks/use-merged-refs.js.map +1 -0
  66. package/dist/hooks/use-object-value.d.ts +5 -0
  67. package/dist/hooks/use-object-value.d.ts.map +1 -0
  68. package/dist/hooks/use-object-value.js +29 -0
  69. package/dist/hooks/use-object-value.js.map +1 -0
  70. package/dist/hooks/use-parent-window.d.ts +9 -0
  71. package/dist/hooks/use-parent-window.d.ts.map +1 -0
  72. package/dist/hooks/use-parent-window.js +8 -0
  73. package/dist/hooks/use-parent-window.js.map +1 -0
  74. package/dist/hooks/use-property.d.ts +14 -0
  75. package/dist/hooks/use-property.d.ts.map +1 -0
  76. package/dist/hooks/use-property.js +14 -0
  77. package/dist/hooks/use-property.js.map +1 -0
  78. package/dist/hooks/use-setting.d.ts +14 -0
  79. package/dist/hooks/use-setting.d.ts.map +1 -0
  80. package/dist/hooks/use-setting.js +20 -0
  81. package/dist/hooks/use-setting.js.map +1 -0
  82. package/dist/hooks/use-signal.d.ts +24 -0
  83. package/dist/hooks/use-signal.d.ts.map +1 -0
  84. package/dist/hooks/use-signal.js +31 -0
  85. package/dist/hooks/use-signal.js.map +1 -0
  86. package/dist/index.d.ts +13 -7
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +9 -7
  89. package/dist/index.js.map +1 -1
  90. package/dist/internal.d.ts +13 -0
  91. package/dist/internal.d.ts.map +1 -0
  92. package/dist/internal.js +12 -0
  93. package/dist/internal.js.map +1 -0
  94. package/dist/prop-types.d.ts +110 -0
  95. package/dist/prop-types.d.ts.map +1 -0
  96. package/dist/prop-types.js +2 -0
  97. package/dist/prop-types.js.map +1 -0
  98. package/dist/reconciler/apply-props.d.ts +11 -0
  99. package/dist/reconciler/apply-props.d.ts.map +1 -0
  100. package/dist/reconciler/apply-props.js +190 -0
  101. package/dist/reconciler/apply-props.js.map +1 -0
  102. package/dist/reconciler/behaviors.d.ts +59 -0
  103. package/dist/reconciler/behaviors.d.ts.map +1 -0
  104. package/dist/reconciler/behaviors.js +172 -0
  105. package/dist/reconciler/behaviors.js.map +1 -0
  106. package/dist/reconciler/child-routing.d.ts +5 -0
  107. package/dist/reconciler/child-routing.d.ts.map +1 -0
  108. package/dist/reconciler/child-routing.js +156 -0
  109. package/dist/reconciler/child-routing.js.map +1 -0
  110. package/dist/reconciler/host-config.d.ts +9 -0
  111. package/dist/reconciler/host-config.d.ts.map +1 -0
  112. package/dist/reconciler/host-config.js +214 -0
  113. package/dist/reconciler/host-config.js.map +1 -0
  114. package/dist/reconciler/instance.d.ts +5 -0
  115. package/dist/reconciler/instance.d.ts.map +1 -0
  116. package/dist/reconciler/instance.js +49 -0
  117. package/dist/reconciler/instance.js.map +1 -0
  118. package/dist/reconciler/metadata.d.ts +17 -0
  119. package/dist/reconciler/metadata.d.ts.map +1 -0
  120. package/dist/reconciler/metadata.js +82 -0
  121. package/dist/reconciler/metadata.js.map +1 -0
  122. package/dist/reconciler/node.d.ts +76 -0
  123. package/dist/reconciler/node.d.ts.map +1 -0
  124. package/dist/reconciler/node.js +53 -0
  125. package/dist/reconciler/node.js.map +1 -0
  126. package/dist/reconciler/placement.d.ts +5 -0
  127. package/dist/reconciler/placement.d.ts.map +1 -0
  128. package/dist/reconciler/placement.js +175 -0
  129. package/dist/reconciler/placement.js.map +1 -0
  130. package/dist/reconciler/registry.d.ts +92 -0
  131. package/dist/reconciler/registry.d.ts.map +1 -0
  132. package/dist/reconciler/registry.js +64 -0
  133. package/dist/reconciler/registry.js.map +1 -0
  134. package/dist/reconciler/root-element.d.ts +11 -0
  135. package/dist/reconciler/root-element.d.ts.map +1 -0
  136. package/dist/reconciler/root-element.js +7 -0
  137. package/dist/reconciler/root-element.js.map +1 -0
  138. package/dist/reconciler/root.d.ts +56 -0
  139. package/dist/reconciler/root.d.ts.map +1 -0
  140. package/dist/reconciler/root.js +109 -0
  141. package/dist/reconciler/root.js.map +1 -0
  142. package/dist/reconciler/signals.d.ts +10 -0
  143. package/dist/reconciler/signals.d.ts.map +1 -0
  144. package/dist/reconciler/signals.js +70 -0
  145. package/dist/reconciler/signals.js.map +1 -0
  146. package/dist/reconciler/text.d.ts +19 -0
  147. package/dist/reconciler/text.d.ts.map +1 -0
  148. package/dist/reconciler/text.js +276 -0
  149. package/dist/reconciler/text.js.map +1 -0
  150. package/dist/utils/accessible-metadata.d.ts +12 -0
  151. package/dist/utils/accessible-metadata.d.ts.map +1 -0
  152. package/dist/utils/accessible-metadata.js +25 -0
  153. package/dist/utils/accessible-metadata.js.map +1 -0
  154. package/dist/utils/accessible-props.d.ts +60 -0
  155. package/dist/utils/accessible-props.d.ts.map +1 -0
  156. package/dist/utils/accessible-props.js +181 -0
  157. package/dist/utils/accessible-props.js.map +1 -0
  158. package/dist/utils/ref-prop.d.ts +15 -0
  159. package/dist/utils/ref-prop.d.ts.map +1 -0
  160. package/dist/utils/ref-prop.js +18 -0
  161. package/dist/utils/ref-prop.js.map +1 -0
  162. package/dist/utils/settings.d.ts +17 -0
  163. package/dist/utils/settings.d.ts.map +1 -0
  164. package/dist/utils/settings.js +37 -0
  165. package/dist/utils/settings.js.map +1 -0
  166. package/dist/utils/variant.d.ts +57 -0
  167. package/dist/utils/variant.d.ts.map +1 -0
  168. package/dist/utils/variant.js +197 -0
  169. package/dist/utils/variant.js.map +1 -0
  170. package/env.d.ts +9 -0
  171. package/package.json +49 -10
  172. package/src/adw/config.ts +1 -0
  173. package/src/adw/dialog.tsx +35 -0
  174. package/src/adw/element-behaviors.ts +379 -0
  175. package/src/adw/element-config.ts +140 -0
  176. package/src/adw/index.ts +4 -0
  177. package/src/adw/prop-types.ts +42 -0
  178. package/src/bootstrap.ts +5 -0
  179. package/src/components/application.tsx +62 -0
  180. package/src/components/element.tsx +47 -0
  181. package/src/components/window.tsx +35 -0
  182. package/src/config.ts +3 -0
  183. package/src/element-behaviors.ts +424 -0
  184. package/src/element-config.ts +148 -0
  185. package/src/env.d.ts +1 -0
  186. package/src/hooks/use-application.ts +19 -0
  187. package/src/hooks/use-bind-setting.ts +51 -0
  188. package/src/hooks/use-merged-refs.ts +64 -0
  189. package/src/hooks/use-object-value.ts +54 -0
  190. package/src/hooks/use-parent-window.ts +11 -0
  191. package/src/hooks/use-property.ts +23 -0
  192. package/src/hooks/use-setting.ts +34 -0
  193. package/src/hooks/use-signal.ts +60 -0
  194. package/src/index.ts +14 -14
  195. package/src/internal.ts +13 -0
  196. package/src/prop-types.ts +142 -0
  197. package/src/reconciler/apply-props.ts +265 -0
  198. package/src/reconciler/behaviors.ts +324 -0
  199. package/src/reconciler/child-routing.ts +202 -0
  200. package/src/reconciler/host-config.ts +278 -0
  201. package/src/reconciler/instance.ts +82 -0
  202. package/src/reconciler/metadata.ts +119 -0
  203. package/src/reconciler/node.ts +161 -0
  204. package/src/reconciler/placement.ts +255 -0
  205. package/src/reconciler/registry.ts +161 -0
  206. package/src/reconciler/root-element.ts +12 -0
  207. package/src/reconciler/root.ts +175 -0
  208. package/src/reconciler/signals.ts +113 -0
  209. package/src/reconciler/text.ts +407 -0
  210. package/src/utils/accessible-metadata.ts +31 -0
  211. package/src/utils/accessible-props.ts +279 -0
  212. package/src/utils/ref-prop.ts +30 -0
  213. package/src/utils/settings.ts +69 -0
  214. package/src/utils/variant.ts +368 -0
  215. package/dist/components/compound.d.ts +0 -40
  216. package/dist/components/compound.d.ts.map +0 -1
  217. package/dist/components/compound.js +0 -46
  218. package/dist/components/compound.js.map +0 -1
  219. package/dist/components/list.d.ts +0 -75
  220. package/dist/components/list.d.ts.map +0 -1
  221. package/dist/components/list.js +0 -81
  222. package/dist/components/list.js.map +0 -1
  223. package/dist/components/slot-widget.d.ts +0 -15
  224. package/dist/components/slot-widget.d.ts.map +0 -1
  225. package/dist/components/slot-widget.js +0 -37
  226. package/dist/components/slot-widget.js.map +0 -1
  227. package/dist/errors.d.ts +0 -15
  228. package/dist/errors.d.ts.map +0 -1
  229. package/dist/errors.js +0 -44
  230. package/dist/errors.js.map +0 -1
  231. package/dist/factory.d.ts +0 -5
  232. package/dist/factory.d.ts.map +0 -1
  233. package/dist/factory.js +0 -37
  234. package/dist/factory.js.map +0 -1
  235. package/dist/generated/compounds.d.ts +0 -2672
  236. package/dist/generated/compounds.d.ts.map +0 -1
  237. package/dist/generated/compounds.js +0 -2624
  238. package/dist/generated/compounds.js.map +0 -1
  239. package/dist/generated/internal.d.ts +0 -16
  240. package/dist/generated/internal.d.ts.map +0 -1
  241. package/dist/generated/internal.js +0 -3638
  242. package/dist/generated/internal.js.map +0 -1
  243. package/dist/generated/jsx.d.ts +0 -17074
  244. package/dist/generated/jsx.d.ts.map +0 -1
  245. package/dist/generated/jsx.js +0 -6715
  246. package/dist/generated/jsx.js.map +0 -1
  247. package/dist/generated/registry.d.ts +0 -5
  248. package/dist/generated/registry.d.ts.map +0 -1
  249. package/dist/generated/registry.js +0 -13
  250. package/dist/generated/registry.js.map +0 -1
  251. package/dist/host-config.d.ts +0 -24
  252. package/dist/host-config.d.ts.map +0 -1
  253. package/dist/host-config.js +0 -172
  254. package/dist/host-config.js.map +0 -1
  255. package/dist/jsx.d.ts +0 -974
  256. package/dist/jsx.d.ts.map +0 -1
  257. package/dist/jsx.js +0 -8
  258. package/dist/jsx.js.map +0 -1
  259. package/dist/metadata.d.ts +0 -5
  260. package/dist/metadata.d.ts.map +0 -1
  261. package/dist/metadata.js +0 -33
  262. package/dist/metadata.js.map +0 -1
  263. package/dist/node.d.ts +0 -25
  264. package/dist/node.d.ts.map +0 -1
  265. package/dist/node.js +0 -85
  266. package/dist/node.js.map +0 -1
  267. package/dist/nodes/adjustable.d.ts +0 -11
  268. package/dist/nodes/adjustable.d.ts.map +0 -1
  269. package/dist/nodes/adjustable.js +0 -46
  270. package/dist/nodes/adjustable.js.map +0 -1
  271. package/dist/nodes/alert-dialog-response.d.ts +0 -15
  272. package/dist/nodes/alert-dialog-response.d.ts.map +0 -1
  273. package/dist/nodes/alert-dialog-response.js +0 -61
  274. package/dist/nodes/alert-dialog-response.js.map +0 -1
  275. package/dist/nodes/alert-dialog.d.ts +0 -14
  276. package/dist/nodes/alert-dialog.d.ts.map +0 -1
  277. package/dist/nodes/alert-dialog.js +0 -41
  278. package/dist/nodes/alert-dialog.js.map +0 -1
  279. package/dist/nodes/animation.d.ts +0 -39
  280. package/dist/nodes/animation.d.ts.map +0 -1
  281. package/dist/nodes/animation.js +0 -326
  282. package/dist/nodes/animation.js.map +0 -1
  283. package/dist/nodes/application.d.ts +0 -12
  284. package/dist/nodes/application.d.ts.map +0 -1
  285. package/dist/nodes/application.js +0 -51
  286. package/dist/nodes/application.js.map +0 -1
  287. package/dist/nodes/calendar.d.ts +0 -18
  288. package/dist/nodes/calendar.d.ts.map +0 -1
  289. package/dist/nodes/calendar.js +0 -28
  290. package/dist/nodes/calendar.js.map +0 -1
  291. package/dist/nodes/color-dialog-button.d.ts +0 -15
  292. package/dist/nodes/color-dialog-button.d.ts.map +0 -1
  293. package/dist/nodes/color-dialog-button.js +0 -43
  294. package/dist/nodes/color-dialog-button.js.map +0 -1
  295. package/dist/nodes/column-view-column.d.ts +0 -36
  296. package/dist/nodes/column-view-column.d.ts.map +0 -1
  297. package/dist/nodes/column-view-column.js +0 -168
  298. package/dist/nodes/column-view-column.js.map +0 -1
  299. package/dist/nodes/container-slot.d.ts +0 -18
  300. package/dist/nodes/container-slot.d.ts.map +0 -1
  301. package/dist/nodes/container-slot.js +0 -81
  302. package/dist/nodes/container-slot.js.map +0 -1
  303. package/dist/nodes/dialog.d.ts +0 -10
  304. package/dist/nodes/dialog.d.ts.map +0 -1
  305. package/dist/nodes/dialog.js +0 -20
  306. package/dist/nodes/dialog.js.map +0 -1
  307. package/dist/nodes/drawing-area.d.ts +0 -19
  308. package/dist/nodes/drawing-area.d.ts.map +0 -1
  309. package/dist/nodes/drawing-area.js +0 -40
  310. package/dist/nodes/drawing-area.js.map +0 -1
  311. package/dist/nodes/event-controller.d.ts +0 -15
  312. package/dist/nodes/event-controller.d.ts.map +0 -1
  313. package/dist/nodes/event-controller.js +0 -73
  314. package/dist/nodes/event-controller.js.map +0 -1
  315. package/dist/nodes/fixed-child.d.ts +0 -19
  316. package/dist/nodes/fixed-child.d.ts.map +0 -1
  317. package/dist/nodes/fixed-child.js +0 -99
  318. package/dist/nodes/fixed-child.js.map +0 -1
  319. package/dist/nodes/font-dialog-button.d.ts +0 -15
  320. package/dist/nodes/font-dialog-button.d.ts.map +0 -1
  321. package/dist/nodes/font-dialog-button.js +0 -76
  322. package/dist/nodes/font-dialog-button.js.map +0 -1
  323. package/dist/nodes/grid-child.d.ts +0 -19
  324. package/dist/nodes/grid-child.d.ts.map +0 -1
  325. package/dist/nodes/grid-child.js +0 -94
  326. package/dist/nodes/grid-child.js.map +0 -1
  327. package/dist/nodes/internal/accessible.d.ts +0 -5
  328. package/dist/nodes/internal/accessible.d.ts.map +0 -1
  329. package/dist/nodes/internal/accessible.js +0 -119
  330. package/dist/nodes/internal/accessible.js.map +0 -1
  331. package/dist/nodes/internal/bound-item.d.ts +0 -4
  332. package/dist/nodes/internal/bound-item.d.ts.map +0 -1
  333. package/dist/nodes/internal/bound-item.js +0 -2
  334. package/dist/nodes/internal/bound-item.js.map +0 -1
  335. package/dist/nodes/internal/construct.d.ts +0 -3
  336. package/dist/nodes/internal/construct.d.ts.map +0 -1
  337. package/dist/nodes/internal/construct.js +0 -44
  338. package/dist/nodes/internal/construct.js.map +0 -1
  339. package/dist/nodes/internal/predicates.d.ts +0 -51
  340. package/dist/nodes/internal/predicates.d.ts.map +0 -1
  341. package/dist/nodes/internal/predicates.js +0 -36
  342. package/dist/nodes/internal/predicates.js.map +0 -1
  343. package/dist/nodes/internal/props.d.ts +0 -6
  344. package/dist/nodes/internal/props.d.ts.map +0 -1
  345. package/dist/nodes/internal/props.js +0 -43
  346. package/dist/nodes/internal/props.js.map +0 -1
  347. package/dist/nodes/internal/signal-store.d.ts +0 -22
  348. package/dist/nodes/internal/signal-store.d.ts.map +0 -1
  349. package/dist/nodes/internal/signal-store.js +0 -98
  350. package/dist/nodes/internal/signal-store.js.map +0 -1
  351. package/dist/nodes/internal/text-buffer-controller.d.ts +0 -40
  352. package/dist/nodes/internal/text-buffer-controller.d.ts.map +0 -1
  353. package/dist/nodes/internal/text-buffer-controller.js +0 -327
  354. package/dist/nodes/internal/text-buffer-controller.js.map +0 -1
  355. package/dist/nodes/internal/widget.d.ts +0 -8
  356. package/dist/nodes/internal/widget.d.ts.map +0 -1
  357. package/dist/nodes/internal/widget.js +0 -68
  358. package/dist/nodes/internal/widget.js.map +0 -1
  359. package/dist/nodes/level-bar.d.ts +0 -12
  360. package/dist/nodes/level-bar.d.ts.map +0 -1
  361. package/dist/nodes/level-bar.js +0 -24
  362. package/dist/nodes/level-bar.js.map +0 -1
  363. package/dist/nodes/list-item-node.d.ts +0 -12
  364. package/dist/nodes/list-item-node.d.ts.map +0 -1
  365. package/dist/nodes/list-item-node.js +0 -45
  366. package/dist/nodes/list-item-node.js.map +0 -1
  367. package/dist/nodes/list.d.ts +0 -100
  368. package/dist/nodes/list.d.ts.map +0 -1
  369. package/dist/nodes/list.js +0 -950
  370. package/dist/nodes/list.js.map +0 -1
  371. package/dist/nodes/menu.d.ts +0 -7
  372. package/dist/nodes/menu.d.ts.map +0 -1
  373. package/dist/nodes/menu.js +0 -20
  374. package/dist/nodes/menu.js.map +0 -1
  375. package/dist/nodes/models/menu.d.ts +0 -47
  376. package/dist/nodes/models/menu.d.ts.map +0 -1
  377. package/dist/nodes/models/menu.js +0 -240
  378. package/dist/nodes/models/menu.js.map +0 -1
  379. package/dist/nodes/navigation-page.d.ts +0 -19
  380. package/dist/nodes/navigation-page.d.ts.map +0 -1
  381. package/dist/nodes/navigation-page.js +0 -129
  382. package/dist/nodes/navigation-page.js.map +0 -1
  383. package/dist/nodes/navigation-view.d.ts +0 -19
  384. package/dist/nodes/navigation-view.d.ts.map +0 -1
  385. package/dist/nodes/navigation-view.js +0 -51
  386. package/dist/nodes/navigation-view.js.map +0 -1
  387. package/dist/nodes/notebook-page-tab.d.ts +0 -15
  388. package/dist/nodes/notebook-page-tab.d.ts.map +0 -1
  389. package/dist/nodes/notebook-page-tab.js +0 -40
  390. package/dist/nodes/notebook-page-tab.js.map +0 -1
  391. package/dist/nodes/notebook-page.d.ts +0 -29
  392. package/dist/nodes/notebook-page.d.ts.map +0 -1
  393. package/dist/nodes/notebook-page.js +0 -151
  394. package/dist/nodes/notebook-page.js.map +0 -1
  395. package/dist/nodes/notebook.d.ts +0 -16
  396. package/dist/nodes/notebook.d.ts.map +0 -1
  397. package/dist/nodes/notebook.js +0 -31
  398. package/dist/nodes/notebook.js.map +0 -1
  399. package/dist/nodes/overlay-child.d.ts +0 -20
  400. package/dist/nodes/overlay-child.d.ts.map +0 -1
  401. package/dist/nodes/overlay-child.js +0 -109
  402. package/dist/nodes/overlay-child.js.map +0 -1
  403. package/dist/nodes/popover-menu.d.ts +0 -19
  404. package/dist/nodes/popover-menu.d.ts.map +0 -1
  405. package/dist/nodes/popover-menu.js +0 -54
  406. package/dist/nodes/popover-menu.js.map +0 -1
  407. package/dist/nodes/scale.d.ts +0 -10
  408. package/dist/nodes/scale.d.ts.map +0 -1
  409. package/dist/nodes/scale.js +0 -19
  410. package/dist/nodes/scale.js.map +0 -1
  411. package/dist/nodes/scrolled-window.d.ts +0 -11
  412. package/dist/nodes/scrolled-window.d.ts.map +0 -1
  413. package/dist/nodes/scrolled-window.js +0 -18
  414. package/dist/nodes/scrolled-window.js.map +0 -1
  415. package/dist/nodes/search-bar.d.ts +0 -11
  416. package/dist/nodes/search-bar.d.ts.map +0 -1
  417. package/dist/nodes/search-bar.js +0 -16
  418. package/dist/nodes/search-bar.js.map +0 -1
  419. package/dist/nodes/shortcut.d.ts +0 -19
  420. package/dist/nodes/shortcut.d.ts.map +0 -1
  421. package/dist/nodes/shortcut.js +0 -72
  422. package/dist/nodes/shortcut.js.map +0 -1
  423. package/dist/nodes/slot.d.ts +0 -21
  424. package/dist/nodes/slot.d.ts.map +0 -1
  425. package/dist/nodes/slot.js +0 -102
  426. package/dist/nodes/slot.js.map +0 -1
  427. package/dist/nodes/source-view.d.ts +0 -18
  428. package/dist/nodes/source-view.d.ts.map +0 -1
  429. package/dist/nodes/source-view.js +0 -94
  430. package/dist/nodes/source-view.js.map +0 -1
  431. package/dist/nodes/spin-row.d.ts +0 -14
  432. package/dist/nodes/spin-row.d.ts.map +0 -1
  433. package/dist/nodes/spin-row.js +0 -46
  434. package/dist/nodes/spin-row.js.map +0 -1
  435. package/dist/nodes/stack-page.d.ts +0 -22
  436. package/dist/nodes/stack-page.d.ts.map +0 -1
  437. package/dist/nodes/stack-page.js +0 -140
  438. package/dist/nodes/stack-page.js.map +0 -1
  439. package/dist/nodes/stack.d.ts +0 -13
  440. package/dist/nodes/stack.d.ts.map +0 -1
  441. package/dist/nodes/stack.js +0 -21
  442. package/dist/nodes/stack.js.map +0 -1
  443. package/dist/nodes/switch-row.d.ts +0 -11
  444. package/dist/nodes/switch-row.d.ts.map +0 -1
  445. package/dist/nodes/switch-row.js +0 -15
  446. package/dist/nodes/switch-row.js.map +0 -1
  447. package/dist/nodes/text-anchor.d.ts +0 -23
  448. package/dist/nodes/text-anchor.d.ts.map +0 -1
  449. package/dist/nodes/text-anchor.js +0 -74
  450. package/dist/nodes/text-anchor.js.map +0 -1
  451. package/dist/nodes/text-content.d.ts +0 -12
  452. package/dist/nodes/text-content.d.ts.map +0 -1
  453. package/dist/nodes/text-content.js +0 -2
  454. package/dist/nodes/text-content.js.map +0 -1
  455. package/dist/nodes/text-paintable.d.ts +0 -19
  456. package/dist/nodes/text-paintable.d.ts.map +0 -1
  457. package/dist/nodes/text-paintable.js +0 -42
  458. package/dist/nodes/text-paintable.js.map +0 -1
  459. package/dist/nodes/text-segment.d.ts +0 -18
  460. package/dist/nodes/text-segment.d.ts.map +0 -1
  461. package/dist/nodes/text-segment.js +0 -38
  462. package/dist/nodes/text-segment.js.map +0 -1
  463. package/dist/nodes/text-tag.d.ts +0 -38
  464. package/dist/nodes/text-tag.d.ts.map +0 -1
  465. package/dist/nodes/text-tag.js +0 -247
  466. package/dist/nodes/text-tag.js.map +0 -1
  467. package/dist/nodes/text-view.d.ts +0 -29
  468. package/dist/nodes/text-view.d.ts.map +0 -1
  469. package/dist/nodes/text-view.js +0 -80
  470. package/dist/nodes/text-view.js.map +0 -1
  471. package/dist/nodes/toggle-group.d.ts +0 -17
  472. package/dist/nodes/toggle-group.d.ts.map +0 -1
  473. package/dist/nodes/toggle-group.js +0 -65
  474. package/dist/nodes/toggle-group.js.map +0 -1
  475. package/dist/nodes/toggle.d.ts +0 -16
  476. package/dist/nodes/toggle.d.ts.map +0 -1
  477. package/dist/nodes/toggle.js +0 -61
  478. package/dist/nodes/toggle.js.map +0 -1
  479. package/dist/nodes/virtual.d.ts +0 -7
  480. package/dist/nodes/virtual.d.ts.map +0 -1
  481. package/dist/nodes/virtual.js +0 -9
  482. package/dist/nodes/virtual.js.map +0 -1
  483. package/dist/nodes/web-view.d.ts +0 -11
  484. package/dist/nodes/web-view.d.ts.map +0 -1
  485. package/dist/nodes/web-view.js +0 -16
  486. package/dist/nodes/web-view.js.map +0 -1
  487. package/dist/nodes/widget.d.ts +0 -26
  488. package/dist/nodes/widget.d.ts.map +0 -1
  489. package/dist/nodes/widget.js +0 -308
  490. package/dist/nodes/widget.js.map +0 -1
  491. package/dist/nodes/window.d.ts +0 -31
  492. package/dist/nodes/window.d.ts.map +0 -1
  493. package/dist/nodes/window.js +0 -122
  494. package/dist/nodes/window.js.map +0 -1
  495. package/dist/portal.d.ts +0 -29
  496. package/dist/portal.d.ts.map +0 -1
  497. package/dist/portal.js +0 -35
  498. package/dist/portal.js.map +0 -1
  499. package/dist/reconciler.d.ts +0 -34
  500. package/dist/reconciler.d.ts.map +0 -1
  501. package/dist/reconciler.js +0 -48
  502. package/dist/reconciler.js.map +0 -1
  503. package/dist/registry.d.ts +0 -18
  504. package/dist/registry.d.ts.map +0 -1
  505. package/dist/registry.js +0 -98
  506. package/dist/registry.js.map +0 -1
  507. package/dist/render.d.ts +0 -117
  508. package/dist/render.d.ts.map +0 -1
  509. package/dist/render.js +0 -159
  510. package/dist/render.js.map +0 -1
  511. package/dist/types.d.ts +0 -6
  512. package/dist/types.d.ts.map +0 -1
  513. package/dist/types.js +0 -2
  514. package/dist/types.js.map +0 -1
  515. package/dist/use-property.d.ts +0 -29
  516. package/dist/use-property.d.ts.map +0 -1
  517. package/dist/use-property.js +0 -44
  518. package/dist/use-property.js.map +0 -1
  519. package/dist/use-setting.d.ts +0 -36
  520. package/dist/use-setting.d.ts.map +0 -1
  521. package/dist/use-setting.js +0 -68
  522. package/dist/use-setting.js.map +0 -1
  523. package/src/components/compound.tsx +0 -57
  524. package/src/components/list.tsx +0 -140
  525. package/src/components/slot-widget.tsx +0 -46
  526. package/src/errors.ts +0 -53
  527. package/src/factory.ts +0 -62
  528. package/src/generated/compounds.ts +0 -2741
  529. package/src/generated/internal.ts +0 -3642
  530. package/src/generated/jsx.ts +0 -17383
  531. package/src/generated/registry.ts +0 -17
  532. package/src/host-config.ts +0 -219
  533. package/src/jsx.ts +0 -1033
  534. package/src/metadata.ts +0 -43
  535. package/src/node.ts +0 -107
  536. package/src/nodes/adjustable.ts +0 -68
  537. package/src/nodes/alert-dialog-response.ts +0 -78
  538. package/src/nodes/alert-dialog.ts +0 -55
  539. package/src/nodes/animation.ts +0 -409
  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 -100
  545. package/src/nodes/dialog.ts +0 -25
  546. package/src/nodes/drawing-area.ts +0 -53
  547. package/src/nodes/event-controller.ts +0 -96
  548. package/src/nodes/fixed-child.ts +0 -122
  549. package/src/nodes/font-dialog-button.ts +0 -107
  550. package/src/nodes/grid-child.ts +0 -116
  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 -74
  559. package/src/nodes/level-bar.ts +0 -36
  560. package/src/nodes/list-item-node.ts +0 -53
  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 -130
  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/spin-row.ts +0 -72
  578. package/src/nodes/stack-page.ts +0 -170
  579. package/src/nodes/stack.ts +0 -35
  580. package/src/nodes/switch-row.ts +0 -26
  581. package/src/nodes/text-anchor.ts +0 -88
  582. package/src/nodes/text-content.ts +0 -14
  583. package/src/nodes/text-paintable.ts +0 -51
  584. package/src/nodes/text-segment.ts +0 -55
  585. package/src/nodes/text-tag.ts +0 -298
  586. package/src/nodes/text-view.ts +0 -100
  587. package/src/nodes/toggle-group.ts +0 -81
  588. package/src/nodes/toggle.ts +0 -72
  589. package/src/nodes/virtual.ts +0 -16
  590. package/src/nodes/web-view.ts +0 -22
  591. package/src/nodes/widget.ts +0 -369
  592. package/src/nodes/window.ts +0 -172
  593. package/src/portal.ts +0 -37
  594. package/src/reconciler.ts +0 -52
  595. package/src/registry.ts +0 -119
  596. package/src/render.tsx +0 -192
  597. package/src/types.ts +0 -13
  598. package/src/use-property.ts +0 -58
  599. package/src/use-setting.ts +0 -96
@@ -0,0 +1,30 @@
1
+ import * as Gio from "@gtkx/gi/gio";
2
+ import { kebabCase } from "@gtkx/utils";
3
+ import { useLayoutEffect } from "react";
4
+ import { resolveRefProp } from "../utils/ref-prop.js";
5
+ import { useSettings } from "./use-setting.js";
6
+ /**
7
+ * Binds a GSettings key to a property of a GObject, keeping the two in sync for the object's lifetime.
8
+ *
9
+ * @param options.schema The schema reference identifying the settings backend.
10
+ * @param options.key The key within the schema to bind.
11
+ * @param options.object The GObject whose property is bound to the setting.
12
+ * @param options.property The name of the object property to bind.
13
+ * @param options.flags Flags controlling the binding's direction and behaviour.
14
+ */
15
+ function useBindSetting({ schema, key, object, property, flags = Gio.SettingsBindFlags.DEFAULT, }) {
16
+ const settings = useSettings(schema);
17
+ const propertyName = kebabCase(property);
18
+ useLayoutEffect(() => {
19
+ const resolved = resolveRefProp(object);
20
+ if (!resolved) {
21
+ return;
22
+ }
23
+ settings.bind(key, resolved, propertyName, flags);
24
+ return () => {
25
+ Gio.Settings.unbind(resolved, propertyName);
26
+ };
27
+ }, [settings, key, object, propertyName, flags]);
28
+ }
29
+ export { useBindSetting };
30
+ //# sourceMappingURL=use-bind-setting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-bind-setting.js","sourceRoot":"","sources":["../../src/hooks/use-bind-setting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAU/C;;;;;;;;GAQG;AACH,SAAS,cAAc,CAA+B,EAClD,MAAM,EACN,GAAG,EACH,MAAM,EACN,QAAQ,EACR,KAAK,GAAG,GAAG,CAAC,iBAAiB,CAAC,OAAO,GACd;IACvB,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IAEzC,eAAe,CAAC,GAAG,EAAE;QACjB,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO;QACX,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;QAElD,OAAO,GAAG,EAAE;YACR,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAChD,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport * as Gio from \"@gtkx/gi/gio\";\nimport { kebabCase } from \"@gtkx/utils\";\nimport { useLayoutEffect } from \"react\";\nimport type { SettingsSchema, SettingsSchemaKeys } from \"../utils/settings.js\";\nimport { type RefProp, resolveRefProp } from \"../utils/ref-prop.js\";\nimport { useSettings } from \"./use-setting.js\";\n\ntype UseBindSettingOptions<K extends SettingsSchemaKeys> = {\n schema: SettingsSchema<K>;\n key: keyof K & string;\n object: RefProp<GObject.Object>;\n property: string;\n flags?: Gio.SettingsBindFlags;\n};\n\n/**\n * Binds a GSettings key to a property of a GObject, keeping the two in sync for the object's lifetime.\n *\n * @param options.schema The schema reference identifying the settings backend.\n * @param options.key The key within the schema to bind.\n * @param options.object The GObject whose property is bound to the setting.\n * @param options.property The name of the object property to bind.\n * @param options.flags Flags controlling the binding's direction and behaviour.\n */\nfunction useBindSetting<K extends SettingsSchemaKeys>({\n schema,\n key,\n object,\n property,\n flags = Gio.SettingsBindFlags.DEFAULT,\n}: UseBindSettingOptions<K>): void {\n const settings = useSettings(schema);\n const propertyName = kebabCase(property);\n\n useLayoutEffect(() => {\n const resolved = resolveRefProp(object);\n\n if (!resolved) {\n return;\n }\n\n settings.bind(key, resolved, propertyName, flags);\n\n return () => {\n Gio.Settings.unbind(resolved, propertyName);\n };\n }, [settings, key, object, propertyName, flags]);\n}\n\nexport { useBindSetting };\n"]}
@@ -0,0 +1,8 @@
1
+ import { type Ref, type RefCallback } from "react";
2
+ type PossibleRef<T> = Ref<T> | undefined;
3
+ type RefCleanup<T> = ReturnType<RefCallback<T>>;
4
+ declare function assignRef<T>(ref: PossibleRef<T>, value: T): RefCleanup<T>;
5
+ declare function mergeRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T>;
6
+ declare function useMergedRef<T>(first: PossibleRef<T>, second: PossibleRef<T>): RefCallback<T>;
7
+ export { assignRef, mergeRefs, useMergedRef };
8
+ //# sourceMappingURL=use-merged-refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-merged-refs.d.ts","sourceRoot":"","sources":["../../src/hooks/use-merged-refs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,WAAW,EAAW,MAAM,OAAO,CAAC;AAE5D,KAAK,WAAW,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AACzC,KAAK,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAGhD,iBAAS,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAQlE;AAsCD,iBAAS,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAI/D;AAED,iBAAS,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAEtF;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { isRecord } from "@gtkx/utils";
2
+ import { useMemo } from "react";
3
+ function assignRef(ref, value) {
4
+ if (typeof ref === "function") {
5
+ return ref(value);
6
+ }
7
+ if (isRecord(ref) && "current" in ref) {
8
+ ref.current = value;
9
+ }
10
+ }
11
+ function collectCleanup(cleanupMap, ref, node) {
12
+ const cleanup = assignRef(ref, node);
13
+ if (cleanup) {
14
+ cleanupMap.set(ref, cleanup);
15
+ }
16
+ }
17
+ function cleanupRef(cleanupMap, ref) {
18
+ const cleanup = cleanupMap.get(ref);
19
+ if (cleanup && typeof cleanup === "function") {
20
+ cleanup();
21
+ }
22
+ else {
23
+ assignRef(ref, null);
24
+ }
25
+ }
26
+ function applyRefs(cleanupMap, refs, node) {
27
+ for (const ref of refs) {
28
+ collectCleanup(cleanupMap, ref, node);
29
+ }
30
+ if (cleanupMap.size === 0) {
31
+ return;
32
+ }
33
+ return () => {
34
+ for (const ref of refs) {
35
+ cleanupRef(cleanupMap, ref);
36
+ }
37
+ cleanupMap.clear();
38
+ };
39
+ }
40
+ function mergeRefs(...refs) {
41
+ const cleanupMap = new Map();
42
+ return (node) => applyRefs(cleanupMap, refs, node);
43
+ }
44
+ function useMergedRef(first, second) {
45
+ return useMemo(() => mergeRefs(first, second), [first, second]);
46
+ }
47
+ export { assignRef, mergeRefs, useMergedRef };
48
+ //# sourceMappingURL=use-merged-refs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-merged-refs.js","sourceRoot":"","sources":["../../src/hooks/use-merged-refs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAA8B,OAAO,EAAE,MAAM,OAAO,CAAC;AAM5D,SAAS,SAAS,CAAI,GAAmB,EAAE,KAAQ;IAC/C,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,IAAI,GAAG,EAAE,CAAC;QACpC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IACxB,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CAAI,UAAyB,EAAE,GAAmB,EAAE,IAAc;IACrF,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAErC,IAAI,OAAO,EAAE,CAAC;QACV,UAAU,CAAC,GAAG,CAAC,GA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":["import { isRecord } from \"@gtkx/utils\";\nimport { type Ref, type RefCallback, useMemo } from \"react\";\n\ntype PossibleRef<T> = Ref<T> | undefined;\ntype RefCleanup<T> = ReturnType<RefCallback<T>>;\ntype CleanupMap<T> = Map<PossibleRef<T>, Exclude<RefCleanup<T>, void>>;\n\nfunction assignRef<T>(ref: PossibleRef<T>, value: T): RefCleanup<T> {\n if (typeof ref === \"function\") {\n return ref(value);\n }\n\n if (isRecord(ref) && \"current\" in ref) {\n ref.current = value;\n }\n}\n\nfunction collectCleanup<T>(cleanupMap: CleanupMap<T>, ref: PossibleRef<T>, node: T | null): void {\n const cleanup = assignRef(ref, node);\n\n if (cleanup) {\n cleanupMap.set(ref, cleanup);\n }\n}\n\nfunction cleanupRef<T>(cleanupMap: CleanupMap<T>, ref: PossibleRef<T>): void {\n const cleanup = cleanupMap.get(ref);\n\n if (cleanup && typeof cleanup === \"function\") {\n cleanup();\n } else {\n assignRef(ref, null);\n }\n}\n\nfunction applyRefs<T>(cleanupMap: CleanupMap<T>, refs: PossibleRef<T>[], node: T | null): RefCleanup<T> {\n for (const ref of refs) {\n collectCleanup(cleanupMap, ref, node);\n }\n\n if (cleanupMap.size === 0) {\n return;\n }\n\n return () => {\n for (const ref of refs) {\n cleanupRef(cleanupMap, ref);\n }\n\n cleanupMap.clear();\n };\n}\n\nfunction mergeRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T> {\n const cleanupMap: CleanupMap<T> = new Map();\n\n return (node: T | null): RefCleanup<T> => applyRefs(cleanupMap, refs, node);\n}\n\nfunction useMergedRef<T>(first: PossibleRef<T>, second: PossibleRef<T>): RefCallback<T> {\n return useMemo(() => mergeRefs(first, second), [first, second]);\n}\n\nexport { assignRef, mergeRefs, useMergedRef };\n"]}
@@ -0,0 +1,5 @@
1
+ import type * as GObject from "@gtkx/gi/gobject";
2
+ import { type RefProp } from "../utils/ref-prop.js";
3
+ declare function useObjectValue<T extends GObject.Object, V>(object: RefProp<T>, signal: string, read: (object: T | null) => V): V;
4
+ export { useObjectValue };
5
+ //# sourceMappingURL=use-object-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-object-value.d.ts","sourceRoot":"","sources":["../../src/hooks/use-object-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,KAAK,OAAO,EAAkB,MAAM,sBAAsB,CAAC;AAQpE,iBAAS,cAAc,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,EAC/C,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,GAC9B,CAAC,CAoCH;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { useCallback, useRef, useSyncExternalStore } from "react";
2
+ import { resolveRefProp } from "../utils/ref-prop.js";
3
+ function useObjectValue(object, signal, read) {
4
+ const resolved = resolveRefProp(object);
5
+ const cacheRef = useRef(null);
6
+ const subscribe = useCallback((onStoreChange) => {
7
+ if (resolved === null) {
8
+ return () => undefined;
9
+ }
10
+ const handler = () => {
11
+ cacheRef.current = null;
12
+ onStoreChange();
13
+ };
14
+ resolved.on(signal, handler);
15
+ return () => resolved.off(signal, handler);
16
+ }, [resolved, signal]);
17
+ const getSnapshot = () => {
18
+ const cache = cacheRef.current;
19
+ if (cache !== null && cache.object === resolved && cache.signal === signal) {
20
+ return cache.value;
21
+ }
22
+ const value = read(resolved);
23
+ cacheRef.current = { object: resolved, signal, value };
24
+ return value;
25
+ };
26
+ return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
27
+ }
28
+ export { useObjectValue };
29
+ //# sourceMappingURL=use-object-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-object-value.js","sourceRoot":"","sources":["../../src/hooks/use-object-value.ts"],"names":[],"mappings":"AAEA,O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O,oBAAoB,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACrE,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport type { SignalHandler } from \"@gtkx/runtime\";\nimport { useCallback, useRef, useSyncExternalStore } from \"react\";\nimport { type RefProp, resolveRefProp } from \"../utils/ref-prop.js\";\n\ntype ObjectValueCache<T extends GObject.Object, V> = {\n object: T | null;\n signal: string;\n value: V;\n};\n\nfunction useObjectValue<T extends GObject.Object, V>(\n object: RefProp<T>,\n signal: string,\n read: (object: T | null) => V,\n): V {\n const resolved = resolveRefProp(object);\n const cacheRef = useRef<ObjectValueCache<T, V> | null>(null);\n\n const subscribe = useCallback(\n (onStoreChange: () => void): (() => void) => {\n if (resolved === null) {\n return (): void => undefined;\n }\n\n const handler: SignalHandler = () => {\n cacheRef.current = null;\n onStoreChange();\n };\n\n resolved.on(signal, handler);\n\n return () => resolved.off(signal, handler);\n },\n [resolved, signal],\n );\n\n const getSnapshot = (): V => {\n const cache = cacheRef.current;\n\n if (cache !== null && cache.object === resolved && cache.signal === signal) {\n return cache.value;\n }\n\n const value = read(resolved);\n cacheRef.current = { object: resolved, signal, value };\n\n return value;\n };\n\n return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n}\n\nexport { useObjectValue };\n"]}
@@ -0,0 +1,9 @@
1
+ import type * as Gtk from "@gtkx/gi/gtk";
2
+ import { type Context } from "react";
3
+ declare const ParentWindowContext: Context<Gtk.Window | null>;
4
+ /**
5
+ * Returns the `Gtk.Window` provided by the nearest window ancestor, or `null` when there is none.
6
+ */
7
+ declare const useParentWindow: () => Gtk.Window | null;
8
+ export { ParentWindowContext, useParentWindow };
9
+ //# sourceMappingURL=use-parent-window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-parent-window.d.ts","sourceRoot":"","sources":["../../src/hooks/use-parent-window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,OAAO,CAAC;AAEzD,QAAA,MAAM,mBAAmB,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAA0C,CAAC;AAE/F;;GAEG;AACH,QAAA,MAAM,eAAe,QAAO,GAAG,CAAC,MAAM,GAAG,IAAgC,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { createContext, use } from "react";
2
+ const ParentWindowContext = createContext(null);
3
+ /**
4
+ * Returns the `Gtk.Window` provided by the nearest window ancestor, or `null` when there is none.
5
+ */
6
+ const useParentWindow = () => use(ParentWindowContext);
7
+ export { ParentWindowContext, useParentWindow };
8
+ //# sourceMappingURL=use-parent-window.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-parent-window.js","sourceRoot":"","sources":["../../src/hooks/use-parent-window.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,mBAAmB,GAA+B,aAAa,CAAoB,IAAI,CAAC,CAAC;AAE/F;;GAEG;AACH,MAAM,eAAe,GAAG,GAAsB,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport { type Context, createContext, use } from \"react\";\n\nconst ParentWindowContext: Context<Gtk.Window | null> = createContext<Gtk.Window | null>(null);\n\n/**\n * Returns the `Gtk.Window` provided by the nearest window ancestor, or `null` when there is none.\n */\nconst useParentWindow = (): Gtk.Window | null => use(ParentWindowContext);\n\nexport { ParentWindowContext, useParentWindow };\n"]}
@@ -0,0 +1,14 @@
1
+ import type * as GObject from "@gtkx/gi/gobject";
2
+ import type { RefProp } from "../utils/ref-prop.js";
3
+ type Properties<T extends GObject.Object> = NonNullable<T["__properties__"]>;
4
+ type PropertyName<T extends GObject.Object> = keyof Properties<T> & keyof T;
5
+ /**
6
+ * Subscribes to a GObject property and returns its current value, re-rendering when the property changes.
7
+ *
8
+ * @param object The GObject (or ref to one) whose property to observe.
9
+ * @param propertyName The camelCase name of a readable property on the object.
10
+ * @returns The current property value, or `undefined` when the object is not resolved.
11
+ */
12
+ declare function useProperty<T extends GObject.Object, P extends PropertyName<T>>(object: RefProp<T>, propertyName: P & string): T[P] | undefined;
13
+ export { useProperty, type PropertyName };
14
+ //# sourceMappingURL=use-property.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-property.d.ts","sourceRoot":"","sources":["../../src/hooks/use-property.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD,KAAK,UAAU,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAC7E,KAAK,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAE5E;;;;;;GAMG;AACH,iBAAS,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,EACpE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,YAAY,EAAE,CAAC,GAAG,MAAM,GACzB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAElB;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { kebabCase } from "@gtkx/utils";
2
+ import { useObjectValue } from "./use-object-value.js";
3
+ /**
4
+ * Subscribes to a GObject property and returns its current value, re-rendering when the property changes.
5
+ *
6
+ * @param object The GObject (or ref to one) whose property to observe.
7
+ * @param propertyName The camelCase name of a readable property on the object.
8
+ * @returns The current property value, or `undefined` when the object is not resolved.
9
+ */
10
+ function useProperty(object, propertyName) {
11
+ return useObjectValue(object, `notify::${kebabCase(propertyName)}`, (obj) => obj?.[propertyName]);
12
+ }
13
+ export { useProperty };
14
+ //# sourceMappingURL=use-property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-property.js","sourceRoot":"","sources":["../../src/hooks/use-property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKvD;;;;;;GAMG;AACH,SAAS,WAAW,CAChB,MAAkB,EAClB,YAAwB;IAExB,OAAO,cAAc,CAAC,MAAM,EAAE,WAAW,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACtG,CAAC;AAED,OAAO,EAAE,WAAW,EAAqB,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport { kebabCase } from \"@gtkx/utils\";\nimport type { RefProp } from \"../utils/ref-prop.js\";\nimport { useObjectValue } from \"./use-object-value.js\";\n\ntype Properties<T extends GObject.Object> = NonNullable<T[\"__properties__\"]>;\ntype PropertyName<T extends GObject.Object> = keyof Properties<T> & keyof T;\n\n/**\n * Subscribes to a GObject property and returns its current value, re-rendering when the property changes.\n *\n * @param object The GObject (or ref to one) whose property to observe.\n * @param propertyName The camelCase name of a readable property on the object.\n * @returns The current property value, or `undefined` when the object is not resolved.\n */\nfunction useProperty<T extends GObject.Object, P extends PropertyName<T>>(\n object: RefProp<T>,\n propertyName: P & string,\n): T[P] | undefined {\n return useObjectValue(object, `notify::${kebabCase(propertyName)}`, (obj) => obj?.[propertyName]);\n}\n\nexport { useProperty, type PropertyName };\n"]}
@@ -0,0 +1,14 @@
1
+ import * as Gio from "@gtkx/gi/gio";
2
+ import { type SettingsSchema, type SettingsSchemaKeys, type SettingValue } from "../utils/settings.js";
3
+ type UseSettingsProps<K extends SettingsSchemaKeys> = Pick<SettingsSchema<K>, "id" | "path">;
4
+ declare const useSettings: <K extends SettingsSchemaKeys>({ id, path }: UseSettingsProps<K>) => Gio.Settings;
5
+ /**
6
+ * Reads and writes a single key of a GSettings schema, re-rendering when the stored value changes.
7
+ *
8
+ * @param schema The schema reference identifying the settings backend.
9
+ * @param key The key within the schema to read and write.
10
+ * @returns A tuple of the current value and a setter that persists a new value.
11
+ */
12
+ declare function useSetting<K extends SettingsSchemaKeys, P extends keyof K>(schema: SettingsSchema<K>, key: P & string): [SettingValue<K, P>, (value: SettingValue<K, P>) => void];
13
+ export { useSettings, useSetting };
14
+ //# sourceMappingURL=use-setting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-setting.d.ts","sourceRoot":"","sources":["../../src/hooks/use-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,EAEH,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACpB,MAAM,sBAAsB,CAAC;AAG9B,KAAK,gBAAgB,CAAC,CAAC,SAAS,kBAAkB,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;AAE7F,QAAA,MAAM,WAAW,GAAI,CAAC,SAAS,kBAAkB,EAAE,cAAc,gBAAgB,CAAC,CAAC,CAAC,KAAG,GAAG,CAAC,QACU,CAAC;AAEtG;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,CAAC,SAAS,kBAAkB,EAAE,CAAC,SAAS,MAAM,CAAC,EAC/D,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EACzB,GAAG,EAAE,CAAC,GAAG,MAAM,GAChB,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAM3D;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import * as Gio from "@gtkx/gi/gio";
2
+ import { useMemo } from "react";
3
+ import { resolveSettingAccessor, } from "../utils/settings.js";
4
+ import { useObjectValue } from "./use-object-value.js";
5
+ const useSettings = ({ id, path }) => useMemo(() => (path ? new Gio.Settings({ schema: id, path }) : Gio.Settings.new(id)), [id, path]);
6
+ /**
7
+ * Reads and writes a single key of a GSettings schema, re-rendering when the stored value changes.
8
+ *
9
+ * @param schema The schema reference identifying the settings backend.
10
+ * @param key The key within the schema to read and write.
11
+ * @returns A tuple of the current value and a setter that persists a new value.
12
+ */
13
+ function useSetting(schema, key) {
14
+ const settings = useSettings({ id: schema.id, path: schema.path });
15
+ const accessor = resolveSettingAccessor(settings, schema, key);
16
+ const value = useObjectValue(settings, `changed::${key}`, () => accessor.get());
17
+ return [value, accessor.set];
18
+ }
19
+ export { useSettings, useSetting };
20
+ //# sourceMappingURL=use-setting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-setting.js","sourceRoot":"","sources":["../../src/hooks/use-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACH,sBAAsB,GAIzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,WAAW,GAAG,CAA+B,EAAE,EAAE,EAAE,IAAI,EAAuB,EAAgB,EAAE,CAClG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtG;;;;;;GAMG;AACH,SAAS,UAAU,CACf,MAAyB,EACzB,GAAe;IAEf,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;IAEhF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import * as Gio from \"@gtkx/gi/gio\";\nimport { useMemo } from \"react\";\nimport {\n resolveSettingAccessor,\n type SettingsSchema,\n type SettingsSchemaKeys,\n type SettingValue,\n} from \"../utils/settings.js\";\nimport { useObjectValue } from \"./use-object-value.js\";\n\ntype UseSettingsProps<K extends SettingsSchemaKeys> = Pick<SettingsSchema<K>, \"id\" | \"path\">;\n\nconst useSettings = <K extends SettingsSchemaKeys>({ id, path }: UseSettingsProps<K>): Gio.Settings =>\n useMemo(() => (path ? new Gio.Settings({ schema: id, path }) : Gio.Settings.new(id)), [id, path]);\n\n/**\n * Reads and writes a single key of a GSettings schema, re-rendering when the stored value changes.\n *\n * @param schema The schema reference identifying the settings backend.\n * @param key The key within the schema to read and write.\n * @returns A tuple of the current value and a setter that persists a new value.\n */\nfunction useSetting<K extends SettingsSchemaKeys, P extends keyof K>(\n schema: SettingsSchema<K>,\n key: P & string,\n): [SettingValue<K, P>, (value: SettingValue<K, P>) => void] {\n const settings = useSettings({ id: schema.id, path: schema.path });\n const accessor = resolveSettingAccessor(settings, schema, key);\n const value = useObjectValue(settings, `changed::${key}`, () => accessor.get());\n\n return [value, accessor.set];\n}\n\nexport { useSettings, useSetting };\n"]}
@@ -0,0 +1,24 @@
1
+ import type * as GObject from "@gtkx/gi/gobject";
2
+ import type { SignalHandler } from "@gtkx/runtime";
3
+ import { type RefProp } from "../utils/ref-prop.js";
4
+ type Signals<T extends GObject.Object> = NonNullable<T["__signals__"]>;
5
+ type SignalName<T extends GObject.Object> = keyof Signals<T> | `${keyof Signals<T> & string}::${string}`;
6
+ type TypedSignalHandler<T extends GObject.Object, S extends string> = S extends keyof Signals<T> ? Signals<T>[S] : S extends `${infer TBase}::${string}` ? TBase extends keyof Signals<T> ? Signals<T>[TBase] : SignalHandler : SignalHandler;
7
+ type UseSignalOptions = {
8
+ after?: boolean;
9
+ immediate?: boolean;
10
+ };
11
+ /**
12
+ * Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.
13
+ *
14
+ * Each emission runs the handler from the latest render, so it does not have to be stable and a
15
+ * changing handler never reconnects the signal.
16
+ *
17
+ * @param object The GObject (or ref to one) to connect to.
18
+ * @param signal The signal name, optionally with a detail suffix.
19
+ * @param handler The callback invoked when the signal is emitted.
20
+ * @param options Connection options such as running after the default handler or invoking immediately.
21
+ */
22
+ declare function useSignal<T extends GObject.Object, S extends SignalName<T> & string>(object: RefProp<T>, signal: S, handler: TypedSignalHandler<T, S>, { after, immediate }?: UseSignalOptions): void;
23
+ export { useSignal, type SignalName, type TypedSignalHandler };
24
+ //# sourceMappingURL=use-signal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-signal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eA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 @@
1
+ import { useEffectEvent, useLayoutEffect } from "react";
2
+ import { resolveRefProp } from "../utils/ref-prop.js";
3
+ /**
4
+ * Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.
5
+ *
6
+ * Each emission runs the handler from the latest render, so it does not have to be stable and a
7
+ * changing handler never reconnects the signal.
8
+ *
9
+ * @param object The GObject (or ref to one) to connect to.
10
+ * @param signal The signal name, optionally with a detail suffix.
11
+ * @param handler The callback invoked when the signal is emitted.
12
+ * @param options Connection options such as running after the default handler or invoking immediately.
13
+ */
14
+ function useSignal(object, signal, handler, { after = false, immediate = false } = {}) {
15
+ const emit = useEffectEvent(handler);
16
+ useLayoutEffect(() => {
17
+ const resolved = resolveRefProp(object);
18
+ if (!resolved) {
19
+ return;
20
+ }
21
+ resolved.on(signal, emit, after);
22
+ if (immediate) {
23
+ emit();
24
+ }
25
+ return () => {
26
+ resolved.off(signal, emit);
27
+ };
28
+ }, [object, signal, after, immediate]);
29
+ }
30
+ export { useSignal };
31
+ //# sourceMappingURL=use-signal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-signal.js","sourceRoot":"","sources":["../../src/hooks/use-signal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAkBpE;;;;;;;;;;GAUG;AACH,SAAS,SAAS,CACd,MAAkB,EAClB,MAAS,EACT,OAAiC,EACjC,EAAE,KAAK,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,KAAuB,EAAE;IAE3D,MAAM,IAAI,GAAG,cAAc,CAAC,OAAwB,CAAC,CAAC;IAEtD,eAAe,CAAC,GAAG,EAAE;QACjB,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO;QACX,CAAC;QAED,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAEjC,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,EAAE,CAAC;QACX,CAAC;QAED,OAAO,GAAG,EAAE;YACR,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,OAAO,EAAE,SAAS,EAA4C,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport type { SignalHandler } from \"@gtkx/runtime\";\nimport { useEffectEvent, useLayoutEffect } from \"react\";\nimport { type RefProp, resolveRefProp } from \"../utils/ref-prop.js\";\n\ntype Signals<T extends GObject.Object> = NonNullable<T[\"__signals__\"]>;\ntype SignalName<T extends GObject.Object> = keyof Signals<T> | `${keyof Signals<T> & string}::${string}`;\n\ntype TypedSignalHandler<T extends GObject.Object, S extends string> = S extends keyof Signals<T>\n ? Signals<T>[S]\n : S extends `${infer TBase}::${string}`\n ? TBase extends keyof Signals<T>\n ? Signals<T>[TBase]\n : SignalHandler\n : SignalHandler;\n\ntype UseSignalOptions = {\n after?: boolean;\n immediate?: boolean;\n};\n\n/**\n * Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.\n *\n * Each emission runs the handler from the latest render, so it does not have to be stable and a\n * changing handler never reconnects the signal.\n *\n * @param object The GObject (or ref to one) to connect to.\n * @param signal The signal name, optionally with a detail suffix.\n * @param handler The callback invoked when the signal is emitted.\n * @param options Connection options such as running after the default handler or invoking immediately.\n */\nfunction useSignal<T extends GObject.Object, S extends SignalName<T> & string>(\n object: RefProp<T>,\n signal: S,\n handler: TypedSignalHandler<T, S>,\n { after = false, immediate = false }: UseSignalOptions = {},\n): void {\n const emit = useEffectEvent(handler as SignalHandler);\n\n useLayoutEffect(() => {\n const resolved = resolveRefProp(object);\n\n if (!resolved) {\n return;\n }\n\n resolved.on(signal, emit, after);\n\n if (immediate) {\n emit();\n }\n\n return () => {\n resolved.off(signal, emit);\n };\n }, [object, signal, after, immediate]);\n}\n\nexport { useSignal, type SignalName, type TypedSignalHandler };\n"]}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,14 @@
1
- export { GtkxError } from "./errors.js";
2
- export * from "./jsx.js";
3
- export { createPortal } from "./portal.js";
4
- export { reconciler } from "./reconciler.js";
5
- export { ApplicationContext, quit, render, setHotReloading, update, useApplication, } from "./render.js";
6
- export { useProperty } from "./use-property.js";
7
- export { useSetting } from "./use-setting.js";
1
+ import "./bootstrap.js";
2
+ export { useApplication } from "./hooks/use-application.js";
3
+ export { useBindSetting } from "./hooks/use-bind-setting.js";
4
+ export { useParentWindow } from "./hooks/use-parent-window.js";
5
+ export { useProperty } from "./hooks/use-property.js";
6
+ export { useSetting } from "./hooks/use-setting.js";
7
+ export { useSignal } from "./hooks/use-signal.js";
8
+ export type { MenuItem, VflConstraints } from "./prop-types.js";
9
+ export { type RootElement, rootElement } from "./reconciler/root-element.js";
10
+ export { createPortal, createRoot, quit, type Root } from "./reconciler/root.js";
11
+ export type { AccessibleProps } from "./utils/accessible-props.js";
12
+ export type { RefProp } from "./utils/ref-prop.js";
13
+ export type { SettingsSchema, SettingsSchemaKeys, SettingValue } from "./utils/settings.js";
8
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACH,kBAAkB,EAClB,IAAI,EACJ,MAAM,EACN,eAAe,EACf,MAAM,EACN,cAAc,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,KAAK,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjF,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,10 @@
1
- export { GtkxError } from "./errors.js";
2
- export * from "./jsx.js";
3
- export { createPortal } from "./portal.js";
4
- export { reconciler } from "./reconciler.js";
5
- export { ApplicationContext, quit, render, setHotReloading, update, useApplication, } from "./render.js";
6
- export { useProperty } from "./use-property.js";
7
- export { useSetting } from "./use-setting.js";
1
+ import "./bootstrap.js";
2
+ export { useApplication } from "./hooks/use-application.js";
3
+ export { useBindSetting } from "./hooks/use-bind-setting.js";
4
+ export { useParentWindow } from "./hooks/use-parent-window.js";
5
+ export { useProperty } from "./hooks/use-property.js";
6
+ export { useSetting } from "./hooks/use-setting.js";
7
+ export { useSignal } from "./hooks/use-signal.js";
8
+ export { rootElement } from "./reconciler/root-element.js";
9
+ export { createPortal, createRoot, quit } from "./reconciler/root.js";
8
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACH,kBAAkB,EAClB,IAAI,EACJ,MAAM,EACN,eAAe,EACf,MAAM,EACN,cAAc,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAoB,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,sBAAsB,CAAC","sourcesContent":["import \"./bootstrap.js\";\n\nexport { useApplication } from \"./hooks/use-application.js\";\nexport { useBindSetting } from \"./hooks/use-bind-setting.js\";\nexport { useParentWindow } from \"./hooks/use-parent-window.js\";\nexport { useProperty } from \"./hooks/use-property.js\";\nexport { useSetting } from \"./hooks/use-setting.js\";\nexport { useSignal } from \"./hooks/use-signal.js\";\nexport type { MenuItem, VflConstraints } from \"./prop-types.js\";\nexport { type RootElement, rootElement } from \"./reconciler/root-element.js\";\nexport { createPortal, createRoot, quit, type Root } from \"./reconciler/root.js\";\nexport type { AccessibleProps } from \"./utils/accessible-props.js\";\nexport type { RefProp } from \"./utils/ref-prop.js\";\nexport type { SettingsSchema, SettingsSchemaKeys, SettingValue } from \"./utils/settings.js\";\n"]}
@@ -0,0 +1,13 @@
1
+ import "./bootstrap.js";
2
+ export { createApplicationComponent } from "./components/application.js";
3
+ export { createElementComponent } from "./components/element.js";
4
+ export { createWindowComponent } from "./components/window.js";
5
+ export { ApplicationContext } from "./hooks/use-application.js";
6
+ export { useMergedRef } from "./hooks/use-merged-refs.js";
7
+ export { useObjectValue } from "./hooks/use-object-value.js";
8
+ export type * from "./prop-types.js";
9
+ export { isRootElement } from "./reconciler/root-element.js";
10
+ export { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
11
+ export { getAccessibleMetadata } from "./utils/accessible-metadata.js";
12
+ export { type RefProp, resolveRefProp } from "./utils/ref-prop.js";
13
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,KAAK,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import "./bootstrap.js";
2
+ export { createApplicationComponent } from "./components/application.js";
3
+ export { createElementComponent } from "./components/element.js";
4
+ export { createWindowComponent } from "./components/window.js";
5
+ export { ApplicationContext } from "./hooks/use-application.js";
6
+ export { useMergedRef } from "./hooks/use-merged-refs.js";
7
+ export { useObjectValue } from "./hooks/use-object-value.js";
8
+ export { isRootElement } from "./reconciler/root-element.js";
9
+ export { createReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
10
+ export { getAccessibleMetadata } from "./utils/accessible-metadata.js";
11
+ export { resolveRefProp } from "./utils/ref-prop.js";
12
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAuB,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAgB,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["import \"./bootstrap.js\";\n\nexport { createApplicationComponent } from \"./components/application.js\";\nexport { createElementComponent } from \"./components/element.js\";\nexport { createWindowComponent } from \"./components/window.js\";\nexport { ApplicationContext } from \"./hooks/use-application.js\";\nexport { useMergedRef } from \"./hooks/use-merged-refs.js\";\nexport { useObjectValue } from \"./hooks/use-object-value.js\";\nexport type * from \"./prop-types.js\";\nexport { isRootElement } from \"./reconciler/root-element.js\";\nexport { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from \"./reconciler/root.js\";\nexport { getAccessibleMetadata } from \"./utils/accessible-metadata.js\";\nexport { type RefProp, resolveRefProp } from \"./utils/ref-prop.js\";\n"]}
@@ -0,0 +1,110 @@
1
+ import type * as Gdk from "@gtkx/gi/gdk";
2
+ import type * as GObject from "@gtkx/gi/gobject";
3
+ import type * as Gtk from "@gtkx/gi/gtk";
4
+ import type { ReactNode } from "react";
5
+ /** One entry of a `GMenu`'s `items` prop; `submenu` and `section` nest further menus. */
6
+ type MenuItem = {
7
+ label?: string | null;
8
+ action?: string | null;
9
+ submenu?: MenuItem[];
10
+ section?: MenuItem[];
11
+ };
12
+ /** One Visual Format Language block applied to a `Gtk.ConstraintLayout`. */
13
+ type VflConstraints = {
14
+ lines: string[];
15
+ hspacing?: number;
16
+ vspacing?: number;
17
+ views?: Map<string, Gtk.ConstraintTarget>;
18
+ };
19
+ /** One mark on a `Gtk.Scale`. */
20
+ type ScaleMark = {
21
+ value?: number;
22
+ position: Gtk.PositionType;
23
+ markup?: string | null;
24
+ };
25
+ /** One labelled offset on a `Gtk.LevelBar`. */
26
+ type LevelBarOffset = {
27
+ name: string;
28
+ value?: number;
29
+ };
30
+ /** One credit section on a `Gtk.AboutDialog`. */
31
+ type CreditSection = {
32
+ sectionName: string;
33
+ people: string[];
34
+ };
35
+ /** One accelerator binding on a `Gtk.Application`. */
36
+ type ActionAccel = {
37
+ detailedActionName: string;
38
+ accels: string[];
39
+ };
40
+ /** The drag icon of a `Gtk.DragSource`, with its hotspot. */
41
+ type DragSourceIcon = {
42
+ paintable?: Gdk.Paintable | null;
43
+ hotX?: number;
44
+ hotY?: number;
45
+ };
46
+ /** Props of an element that accepts children. */
47
+ type ChildrenProps = {
48
+ children?: ReactNode;
49
+ };
50
+ type GtkWidgetProps = {
51
+ controllers?: ReactNode | null | undefined;
52
+ actionGroups?: ReactNode | null | undefined;
53
+ } & ChildrenProps;
54
+ type GActionGroupProps = {
55
+ prefix?: string | null | undefined;
56
+ };
57
+ type GActionMapProps = {
58
+ actions?: ReactNode | null | undefined;
59
+ };
60
+ type GMenuProps = {
61
+ items?: MenuItem[] | null | undefined;
62
+ };
63
+ type GtkShortcutControllerProps = {
64
+ shortcuts?: ReactNode | null | undefined;
65
+ };
66
+ type GtkOverlayProps = {
67
+ overlays?: ReactNode | null | undefined;
68
+ } & ChildrenProps;
69
+ type GtkConstraintLayoutProps = {
70
+ constraints?: ReactNode | null | undefined;
71
+ guides?: ReactNode | null | undefined;
72
+ vfl?: VflConstraints[] | null | undefined;
73
+ };
74
+ /** Props of `GtkTextChildAnchor`, which embeds either a child widget or a paintable in a text buffer. */
75
+ type GtkTextChildAnchorProps = {
76
+ paintable?: Gdk.Paintable | null | undefined;
77
+ } & ChildrenProps;
78
+ type GtkHeaderBarProps = {
79
+ start?: ReactNode | null | undefined;
80
+ end?: ReactNode | null | undefined;
81
+ };
82
+ type GtkScaleProps = {
83
+ marks?: ScaleMark[] | null | undefined;
84
+ };
85
+ type GtkCalendarProps = {
86
+ markedDays?: number[] | null | undefined;
87
+ };
88
+ type GtkLevelBarProps = {
89
+ offsets?: LevelBarOffset[] | null | undefined;
90
+ };
91
+ type GtkSizeGroupProps = {
92
+ widgets?: Gtk.Widget[] | null | undefined;
93
+ };
94
+ type GtkAboutDialogProps = {
95
+ creditSections?: CreditSection[] | null | undefined;
96
+ };
97
+ type GtkApplicationProps = {
98
+ actionAccels?: ActionAccel[] | null | undefined;
99
+ } & ChildrenProps;
100
+ type GtkDropTargetProps = {
101
+ types?: GObject.Type[] | null | undefined;
102
+ };
103
+ type GtkDrawingAreaProps = {
104
+ drawFunc?: Gtk.DrawingAreaDrawFunc | null | undefined;
105
+ };
106
+ type GtkDragSourceProps = {
107
+ icon?: DragSourceIcon | null | undefined;
108
+ };
109
+ export { type MenuItem, type VflConstraints, type ScaleMark, type LevelBarOffset, type CreditSection, type ActionAccel, type DragSourceIcon, type ChildrenProps, type GtkWidgetProps, type GActionGroupProps, type GActionMapProps, type GMenuProps, type GtkShortcutControllerProps, type GtkOverlayProps, type GtkTextChildAnchorProps, type GtkConstraintLayoutProps, type GtkHeaderBarProps, type GtkScaleProps, type GtkCalendarProps, type GtkLevelBarProps, type GtkSizeGroupProps, type GtkAboutDialogProps, type GtkApplicationProps, type GtkDropTargetProps, type GtkDrawingAreaProps, type GtkDragSourceProps, };
110
+ //# sourceMappingURL=prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../src/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,yFAAyF;AACzF,KAAK,QAAQ,GAAG;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,E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,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GAC1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.js","sourceRoot":"","sources":["../src/prop-types.ts"],"names":[],"mappings":"AAkHA,OAAO,EA2BN,CAAC","sourcesContent":["import type * as Gdk from \"@gtkx/gi/gdk\";\nimport type * as GObject from \"@gtkx/gi/gobject\";\nimport type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ReactNode } from \"react\";\n\n/** One entry of a `GMenu`'s `items` prop; `submenu` and `section` nest further menus. */\ntype MenuItem = {\n label?: string | null;\n action?: string | null;\n submenu?: MenuItem[];\n section?: MenuItem[];\n};\n\n/** One Visual Format Language block applied to a `Gtk.ConstraintLayout`. */\ntype VflConstraints = {\n lines: string[];\n hspacing?: number;\n vspacing?: number;\n views?: Map<string, Gtk.ConstraintTarget>;\n};\n\n/** One mark on a `Gtk.Scale`. */\ntype ScaleMark = { value?: number; position: Gtk.PositionType; markup?: string | null };\n/** One labelled offset on a `Gtk.LevelBar`. */\ntype LevelBarOffset = { name: string; value?: number };\n/** One credit section on a `Gtk.AboutDialog`. */\ntype CreditSection = { sectionName: string; people: string[] };\n/** One accelerator binding on a `Gtk.Application`. */\ntype ActionAccel = { detailedActionName: string; accels: string[] };\n/** The drag icon of a `Gtk.DragSource`, with its hotspot. */\ntype DragSourceIcon = { paintable?: Gdk.Paintable | null; hotX?: number; hotY?: number };\n\n/** Props of an element that accepts children. */\ntype ChildrenProps = {\n children?: ReactNode;\n};\n\ntype GtkWidgetProps = {\n controllers?: ReactNode | null | undefined;\n actionGroups?: ReactNode | null | undefined;\n} & ChildrenProps;\n\ntype GActionGroupProps = {\n prefix?: string | null | undefined;\n};\n\ntype GActionMapProps = {\n actions?: ReactNode | null | undefined;\n};\n\ntype GMenuProps = {\n items?: MenuItem[] | null | undefined;\n};\n\ntype GtkShortcutControllerProps = {\n shortcuts?: ReactNode | null | undefined;\n};\n\ntype GtkOverlayProps = {\n overlays?: ReactNode | null | undefined;\n} & ChildrenProps;\n\ntype GtkConstraintLayoutProps = {\n constraints?: ReactNode | null | undefined;\n guides?: ReactNode | null | undefined;\n vfl?: VflConstraints[] | null | undefined;\n};\n\n/** Props of `GtkTextChildAnchor`, which embeds either a child widget or a paintable in a text buffer. */\ntype GtkTextChildAnchorProps = {\n paintable?: Gdk.Paintable | null | undefined;\n} & ChildrenProps;\n\ntype GtkHeaderBarProps = {\n start?: ReactNode | null | undefined;\n end?: ReactNode | null | undefined;\n};\n\ntype GtkScaleProps = {\n marks?: ScaleMark[] | null | undefined;\n};\n\ntype GtkCalendarProps = {\n markedDays?: number[] | null | undefined;\n};\n\ntype GtkLevelBarProps = {\n offsets?: LevelBarOffset[] | null | undefined;\n};\n\ntype GtkSizeGroupProps = {\n widgets?: Gtk.Widget[] | null | undefined;\n};\n\ntype GtkAboutDialogProps = {\n creditSections?: CreditSection[] | null | undefined;\n};\n\ntype GtkApplicationProps = {\n actionAccels?: ActionAccel[] | null | undefined;\n} & ChildrenProps;\n\ntype GtkDropTargetProps = {\n types?: GObject.Type[] | null | undefined;\n};\n\ntype GtkDrawingAreaProps = {\n drawFunc?: Gtk.DrawingAreaDrawFunc | null | undefined;\n};\n\ntype GtkDragSourceProps = {\n icon?: DragSourceIcon | null | undefined;\n};\n\nexport {\n type MenuItem,\n type VflConstraints,\n type ScaleMark,\n type LevelBarOffset,\n type CreditSection,\n type ActionAccel,\n type DragSourceIcon,\n type ChildrenProps,\n type GtkWidgetProps,\n type GActionGroupProps,\n type GActionMapProps,\n type GMenuProps,\n type GtkShortcutControllerProps,\n type GtkOverlayProps,\n type GtkTextChildAnchorProps,\n type GtkConstraintLayoutProps,\n type GtkHeaderBarProps,\n type GtkScaleProps,\n type GtkCalendarProps,\n type GtkLevelBarProps,\n type GtkSizeGroupProps,\n type GtkAboutDialogProps,\n type GtkApplicationProps,\n type GtkDropTargetProps,\n type GtkDrawingAreaProps,\n type GtkDragSourceProps,\n};\n"]}
@@ -0,0 +1,11 @@
1
+ import type { Props } from "./registry.js";
2
+ import { type ElementNode, type SignalTarget } from "./node.js";
3
+ declare const assertConstructOnlyUnchanged: (typeName: string, prev: Props, next: Props) => void;
4
+ declare const markFlush: (node: ElementNode) => void;
5
+ declare const flushBehaviors: () => void;
6
+ declare const mountBehaviors: (node: ElementNode) => void;
7
+ declare const unmountBehaviors: (node: ElementNode) => void;
8
+ declare const applyElementProps: (node: ElementNode, prev: Props, next: Props) => void;
9
+ declare const applyAdoptedProps: (target: SignalTarget, prev: Props, next: Props) => void;
10
+ export { markFlush, flushBehaviors, mountBehaviors, unmountBehaviors, applyElementProps, applyAdoptedProps, assertConstructOnlyUnchanged, };
11
+ //# sourceMappingURL=apply-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-props.d.ts","sourceRoot":"","sources":["../../src/reconciler/apply-props.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,KAAK,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,KAAK,WAAW,EAAsB,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AA2GpF,QAAA,MAAM,4BAA4B,GAAI,UAAU,MAAM,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IAUlF,CAAC;AAmEF,QAAA,MAAM,SAAS,GAAI,MAAM,WAAW,KAAG,IAItC,CAAC;AAQF,QAAA,MAAM,cAAc,QAAO,IAI1B,CAAC;AAEF,QAAA,MAAM,cAAc,GAAI,MAAM,WAAW,KAAG,IAM3C,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAI,MAAM,WAAW,KAAG,IAE7C,CAAC;AAQF,QAAA,MAAM,iBAAiB,GAAI,MAAM,WAAW,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IASxE,CAAC;AAIF,QAAA,MAAM,iBAAiB,GAAI,QAAQ,YAAY,EAAE,MAAM,KAAK,EAAE,MAAM,KAAK,KAAG,IAc3E,CAAC;AAEF,OAAO,EACH,SAAS,EACT,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,GAC/B,CAAC"}