@gtkx/react 1.0.0-rc.1 → 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 (381) hide show
  1. package/dist/adw/config.d.ts +2 -0
  2. package/dist/adw/config.d.ts.map +1 -0
  3. package/dist/adw/config.js +2 -0
  4. package/dist/adw/config.js.map +1 -0
  5. package/dist/{libraries/adw → adw}/dialog.d.ts +2 -2
  6. package/dist/adw/dialog.d.ts.map +1 -0
  7. package/dist/adw/dialog.js +25 -0
  8. package/dist/adw/dialog.js.map +1 -0
  9. package/dist/adw/element-behaviors.d.ts +2 -0
  10. package/dist/adw/element-behaviors.d.ts.map +1 -0
  11. package/dist/adw/element-behaviors.js +299 -0
  12. package/dist/adw/element-behaviors.js.map +1 -0
  13. package/dist/adw/element-config.d.ts +9 -0
  14. package/dist/adw/element-config.d.ts.map +1 -0
  15. package/dist/adw/element-config.js +137 -0
  16. package/dist/adw/element-config.js.map +1 -0
  17. package/dist/adw/index.d.ts +4 -0
  18. package/dist/adw/index.d.ts.map +1 -0
  19. package/dist/adw/index.js +3 -0
  20. package/dist/adw/index.js.map +1 -0
  21. package/dist/adw/prop-types.d.ts +29 -0
  22. package/dist/adw/prop-types.d.ts.map +1 -0
  23. package/dist/adw/prop-types.js +2 -0
  24. package/dist/adw/prop-types.js.map +1 -0
  25. package/dist/bootstrap.d.ts +2 -0
  26. package/dist/bootstrap.d.ts.map +1 -0
  27. package/dist/bootstrap.js +5 -0
  28. package/dist/bootstrap.js.map +1 -0
  29. package/dist/components/application.d.ts +2 -2
  30. package/dist/components/application.d.ts.map +1 -1
  31. package/dist/components/application.js +31 -18
  32. package/dist/components/application.js.map +1 -1
  33. package/dist/components/element.d.ts +6 -0
  34. package/dist/components/element.d.ts.map +1 -0
  35. package/dist/components/element.js +29 -0
  36. package/dist/components/element.js.map +1 -0
  37. package/dist/components/window.d.ts +2 -2
  38. package/dist/components/window.d.ts.map +1 -1
  39. package/dist/components/window.js +10 -11
  40. package/dist/components/window.js.map +1 -1
  41. package/dist/config.d.ts +4 -0
  42. package/dist/config.d.ts.map +1 -0
  43. package/dist/config.js +3 -0
  44. package/dist/config.js.map +1 -0
  45. package/dist/element-behaviors.d.ts +2 -0
  46. package/dist/element-behaviors.d.ts.map +1 -0
  47. package/dist/element-behaviors.js +348 -0
  48. package/dist/element-behaviors.js.map +1 -0
  49. package/dist/element-config.d.ts +10 -0
  50. package/dist/element-config.d.ts.map +1 -0
  51. package/dist/element-config.js +146 -0
  52. package/dist/element-config.js.map +1 -0
  53. package/dist/hooks/use-application.d.ts +4 -3
  54. package/dist/hooks/use-application.d.ts.map +1 -1
  55. package/dist/hooks/use-application.js +5 -4
  56. package/dist/hooks/use-application.js.map +1 -1
  57. package/dist/hooks/use-bind-setting.d.ts +21 -4
  58. package/dist/hooks/use-bind-setting.d.ts.map +1 -1
  59. package/dist/hooks/use-bind-setting.js +27 -16
  60. package/dist/hooks/use-bind-setting.js.map +1 -1
  61. package/dist/hooks/use-merged-refs.d.ts +8 -0
  62. package/dist/hooks/use-merged-refs.d.ts.map +1 -0
  63. package/dist/hooks/use-merged-refs.js +48 -0
  64. package/dist/hooks/use-merged-refs.js.map +1 -0
  65. package/dist/hooks/use-object-value.d.ts +3 -2
  66. package/dist/hooks/use-object-value.d.ts.map +1 -1
  67. package/dist/hooks/use-object-value.js +18 -21
  68. package/dist/hooks/use-object-value.js.map +1 -1
  69. package/dist/hooks/use-parent-window.d.ts +3 -2
  70. package/dist/hooks/use-parent-window.d.ts.map +1 -1
  71. package/dist/hooks/use-parent-window.js +3 -2
  72. package/dist/hooks/use-parent-window.js.map +1 -1
  73. package/dist/hooks/use-property.d.ts +5 -5
  74. package/dist/hooks/use-property.d.ts.map +1 -1
  75. package/dist/hooks/use-property.js +4 -3
  76. package/dist/hooks/use-property.js.map +1 -1
  77. package/dist/hooks/use-setting.d.ts +5 -16
  78. package/dist/hooks/use-setting.d.ts.map +1 -1
  79. package/dist/hooks/use-setting.js +16 -11
  80. package/dist/hooks/use-setting.js.map +1 -1
  81. package/dist/hooks/use-signal.d.ts +10 -7
  82. package/dist/hooks/use-signal.d.ts.map +1 -1
  83. package/dist/hooks/use-signal.js +29 -18
  84. package/dist/hooks/use-signal.js.map +1 -1
  85. package/dist/index.d.ts +7 -8
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +2 -3
  88. package/dist/index.js.map +1 -1
  89. package/dist/internal.d.ts +6 -7
  90. package/dist/internal.d.ts.map +1 -1
  91. package/dist/internal.js +5 -7
  92. package/dist/internal.js.map +1 -1
  93. package/dist/prop-types.d.ts +110 -0
  94. package/dist/prop-types.d.ts.map +1 -0
  95. package/dist/prop-types.js +2 -0
  96. package/dist/prop-types.js.map +1 -0
  97. package/dist/reconciler/apply-props.d.ts +10 -7
  98. package/dist/reconciler/apply-props.d.ts.map +1 -1
  99. package/dist/reconciler/apply-props.js +182 -84
  100. package/dist/reconciler/apply-props.js.map +1 -1
  101. package/dist/reconciler/behaviors.d.ts +59 -0
  102. package/dist/reconciler/behaviors.d.ts.map +1 -0
  103. package/dist/reconciler/behaviors.js +172 -0
  104. package/dist/reconciler/behaviors.js.map +1 -0
  105. package/dist/reconciler/child-routing.d.ts +5 -0
  106. package/dist/reconciler/child-routing.d.ts.map +1 -0
  107. package/dist/reconciler/child-routing.js +156 -0
  108. package/dist/reconciler/child-routing.js.map +1 -0
  109. package/dist/reconciler/host-config.d.ts +8 -12
  110. package/dist/reconciler/host-config.d.ts.map +1 -1
  111. package/dist/reconciler/host-config.js +175 -270
  112. package/dist/reconciler/host-config.js.map +1 -1
  113. package/dist/reconciler/instance.d.ts +4 -5
  114. package/dist/reconciler/instance.d.ts.map +1 -1
  115. package/dist/reconciler/instance.js +44 -22
  116. package/dist/reconciler/instance.js.map +1 -1
  117. package/dist/reconciler/metadata.d.ts +17 -0
  118. package/dist/reconciler/metadata.d.ts.map +1 -0
  119. package/dist/reconciler/metadata.js +82 -0
  120. package/dist/reconciler/metadata.js.map +1 -0
  121. package/dist/reconciler/node.d.ts +76 -0
  122. package/dist/reconciler/node.d.ts.map +1 -0
  123. package/dist/reconciler/node.js +53 -0
  124. package/dist/reconciler/node.js.map +1 -0
  125. package/dist/reconciler/placement.d.ts +5 -0
  126. package/dist/reconciler/placement.d.ts.map +1 -0
  127. package/dist/reconciler/placement.js +175 -0
  128. package/dist/reconciler/placement.js.map +1 -0
  129. package/dist/reconciler/registry.d.ts +92 -0
  130. package/dist/reconciler/registry.d.ts.map +1 -0
  131. package/dist/reconciler/registry.js +64 -0
  132. package/dist/reconciler/registry.js.map +1 -0
  133. package/dist/reconciler/root-element.d.ts +9 -12
  134. package/dist/reconciler/root-element.d.ts.map +1 -1
  135. package/dist/reconciler/root-element.js +6 -6
  136. package/dist/reconciler/root-element.js.map +1 -1
  137. package/dist/reconciler/root.d.ts +56 -0
  138. package/dist/reconciler/root.d.ts.map +1 -0
  139. package/dist/reconciler/root.js +109 -0
  140. package/dist/reconciler/root.js.map +1 -0
  141. package/dist/reconciler/signals.d.ts +10 -0
  142. package/dist/reconciler/signals.d.ts.map +1 -0
  143. package/dist/reconciler/signals.js +70 -0
  144. package/dist/reconciler/signals.js.map +1 -0
  145. package/dist/reconciler/text.d.ts +19 -0
  146. package/dist/reconciler/text.d.ts.map +1 -0
  147. package/dist/reconciler/text.js +276 -0
  148. package/dist/reconciler/text.js.map +1 -0
  149. package/dist/utils/accessible-metadata.d.ts +11 -4
  150. package/dist/utils/accessible-metadata.d.ts.map +1 -1
  151. package/dist/utils/accessible-metadata.js +20 -17
  152. package/dist/utils/accessible-metadata.js.map +1 -1
  153. package/dist/{reconciler/accessible.d.ts → utils/accessible-props.d.ts} +7 -6
  154. package/dist/utils/accessible-props.d.ts.map +1 -0
  155. package/dist/utils/accessible-props.js +181 -0
  156. package/dist/utils/accessible-props.js.map +1 -0
  157. package/dist/utils/ref-prop.d.ts +15 -0
  158. package/dist/utils/ref-prop.d.ts.map +1 -0
  159. package/dist/utils/ref-prop.js +18 -0
  160. package/dist/utils/ref-prop.js.map +1 -0
  161. package/dist/utils/settings.d.ts +17 -0
  162. package/dist/utils/settings.d.ts.map +1 -0
  163. package/dist/utils/settings.js +37 -0
  164. package/dist/utils/settings.js.map +1 -0
  165. package/dist/utils/variant.d.ts +57 -0
  166. package/dist/utils/variant.d.ts.map +1 -0
  167. package/dist/utils/variant.js +197 -0
  168. package/dist/utils/variant.js.map +1 -0
  169. package/env.d.ts +9 -0
  170. package/package.json +36 -11
  171. package/src/adw/config.ts +1 -0
  172. package/src/adw/dialog.tsx +35 -0
  173. package/src/adw/element-behaviors.ts +379 -0
  174. package/src/adw/element-config.ts +140 -0
  175. package/src/adw/index.ts +4 -0
  176. package/src/adw/prop-types.ts +42 -0
  177. package/src/bootstrap.ts +5 -0
  178. package/src/components/application.tsx +42 -23
  179. package/src/components/element.tsx +47 -0
  180. package/src/components/window.tsx +12 -13
  181. package/src/config.ts +3 -0
  182. package/src/element-behaviors.ts +424 -0
  183. package/src/element-config.ts +148 -0
  184. package/src/env.d.ts +1 -0
  185. package/src/hooks/use-application.ts +6 -4
  186. package/src/hooks/use-bind-setting.ts +47 -31
  187. package/src/hooks/use-merged-refs.ts +64 -0
  188. package/src/hooks/use-object-value.ts +27 -23
  189. package/src/hooks/use-parent-window.ts +4 -2
  190. package/src/hooks/use-property.ts +11 -10
  191. package/src/hooks/use-setting.ts +20 -33
  192. package/src/hooks/use-signal.ts +37 -48
  193. package/src/index.ts +7 -8
  194. package/src/internal.ts +7 -18
  195. package/src/prop-types.ts +142 -0
  196. package/src/reconciler/apply-props.ts +233 -85
  197. package/src/reconciler/behaviors.ts +324 -0
  198. package/src/reconciler/child-routing.ts +202 -0
  199. package/src/reconciler/host-config.ts +239 -366
  200. package/src/reconciler/instance.ts +76 -24
  201. package/src/reconciler/metadata.ts +119 -0
  202. package/src/reconciler/node.ts +161 -0
  203. package/src/reconciler/placement.ts +255 -0
  204. package/src/reconciler/registry.ts +161 -0
  205. package/src/reconciler/root-element.ts +9 -11
  206. package/src/reconciler/root.ts +175 -0
  207. package/src/reconciler/signals.ts +113 -0
  208. package/src/reconciler/text.ts +407 -0
  209. package/src/utils/accessible-metadata.ts +23 -18
  210. package/src/utils/accessible-props.ts +279 -0
  211. package/src/utils/ref-prop.ts +30 -0
  212. package/src/utils/settings.ts +69 -0
  213. package/src/utils/variant.ts +368 -0
  214. package/dist/hooks/use-merge-refs.d.ts +0 -3
  215. package/dist/hooks/use-merge-refs.d.ts.map +0 -1
  216. package/dist/hooks/use-merge-refs.js +0 -48
  217. package/dist/hooks/use-merge-refs.js.map +0 -1
  218. package/dist/hooks/use-object-attachment.d.ts +0 -10
  219. package/dist/hooks/use-object-attachment.d.ts.map +0 -1
  220. package/dist/hooks/use-object-attachment.js +0 -24
  221. package/dist/hooks/use-object-attachment.js.map +0 -1
  222. package/dist/libraries/adw/dialog.d.ts.map +0 -1
  223. package/dist/libraries/adw/dialog.js +0 -25
  224. package/dist/libraries/adw/dialog.js.map +0 -1
  225. package/dist/libraries/adw/index.d.ts +0 -2
  226. package/dist/libraries/adw/index.d.ts.map +0 -1
  227. package/dist/libraries/adw/index.js +0 -2
  228. package/dist/libraries/adw/index.js.map +0 -1
  229. package/dist/reconciler/accessible.d.ts.map +0 -1
  230. package/dist/reconciler/accessible.js +0 -143
  231. package/dist/reconciler/accessible.js.map +0 -1
  232. package/dist/reconciler/commit-flush.d.ts +0 -3
  233. package/dist/reconciler/commit-flush.d.ts.map +0 -1
  234. package/dist/reconciler/commit-flush.js +0 -13
  235. package/dist/reconciler/commit-flush.js.map +0 -1
  236. package/dist/reconciler/container-attach.d.ts +0 -10
  237. package/dist/reconciler/container-attach.d.ts.map +0 -1
  238. package/dist/reconciler/container-attach.js +0 -216
  239. package/dist/reconciler/container-attach.js.map +0 -1
  240. package/dist/reconciler/content-rebuild.d.ts +0 -3
  241. package/dist/reconciler/content-rebuild.d.ts.map +0 -1
  242. package/dist/reconciler/content-rebuild.js +0 -15
  243. package/dist/reconciler/content-rebuild.js.map +0 -1
  244. package/dist/reconciler/dispatch.d.ts +0 -6
  245. package/dist/reconciler/dispatch.d.ts.map +0 -1
  246. package/dist/reconciler/dispatch.js +0 -61
  247. package/dist/reconciler/dispatch.js.map +0 -1
  248. package/dist/reconciler/element-prop-appliers.d.ts +0 -5
  249. package/dist/reconciler/element-prop-appliers.d.ts.map +0 -1
  250. package/dist/reconciler/element-prop-appliers.js +0 -104
  251. package/dist/reconciler/element-prop-appliers.js.map +0 -1
  252. package/dist/reconciler/element-props.d.ts +0 -25
  253. package/dist/reconciler/element-props.d.ts.map +0 -1
  254. package/dist/reconciler/element-props.js +0 -157
  255. package/dist/reconciler/element-props.js.map +0 -1
  256. package/dist/reconciler/label-text-rebuild.d.ts +0 -3
  257. package/dist/reconciler/label-text-rebuild.d.ts.map +0 -1
  258. package/dist/reconciler/label-text-rebuild.js +0 -22
  259. package/dist/reconciler/label-text-rebuild.js.map +0 -1
  260. package/dist/reconciler/portal.d.ts +0 -11
  261. package/dist/reconciler/portal.d.ts.map +0 -1
  262. package/dist/reconciler/portal.js +0 -20
  263. package/dist/reconciler/portal.js.map +0 -1
  264. package/dist/reconciler/reconciler-error-handler.d.ts +0 -7
  265. package/dist/reconciler/reconciler-error-handler.d.ts.map +0 -1
  266. package/dist/reconciler/reconciler-error-handler.js +0 -24
  267. package/dist/reconciler/reconciler-error-handler.js.map +0 -1
  268. package/dist/reconciler/reconciler-root.d.ts +0 -19
  269. package/dist/reconciler/reconciler-root.d.ts.map +0 -1
  270. package/dist/reconciler/reconciler-root.js +0 -24
  271. package/dist/reconciler/reconciler-root.js.map +0 -1
  272. package/dist/reconciler/reconciler.d.ts +0 -3
  273. package/dist/reconciler/reconciler.d.ts.map +0 -1
  274. package/dist/reconciler/reconciler.js +0 -12
  275. package/dist/reconciler/reconciler.js.map +0 -1
  276. package/dist/reconciler/render.d.ts +0 -23
  277. package/dist/reconciler/render.d.ts.map +0 -1
  278. package/dist/reconciler/render.js +0 -46
  279. package/dist/reconciler/render.js.map +0 -1
  280. package/dist/reconciler/signal-store.d.ts +0 -22
  281. package/dist/reconciler/signal-store.d.ts.map +0 -1
  282. package/dist/reconciler/signal-store.js +0 -84
  283. package/dist/reconciler/signal-store.js.map +0 -1
  284. package/dist/reconciler/state.d.ts +0 -36
  285. package/dist/reconciler/state.d.ts.map +0 -1
  286. package/dist/reconciler/state.js +0 -38
  287. package/dist/reconciler/state.js.map +0 -1
  288. package/dist/reconciler/text-buffer-controller.d.ts +0 -17
  289. package/dist/reconciler/text-buffer-controller.d.ts.map +0 -1
  290. package/dist/reconciler/text-buffer-controller.js +0 -102
  291. package/dist/reconciler/text-buffer-controller.js.map +0 -1
  292. package/dist/reconciler/text-buffer-rebuild.d.ts +0 -3
  293. package/dist/reconciler/text-buffer-rebuild.d.ts.map +0 -1
  294. package/dist/reconciler/text-buffer-rebuild.js +0 -7
  295. package/dist/reconciler/text-buffer-rebuild.js.map +0 -1
  296. package/dist/reconciler/text-node.d.ts +0 -7
  297. package/dist/reconciler/text-node.d.ts.map +0 -1
  298. package/dist/reconciler/text-node.js +0 -8
  299. package/dist/reconciler/text-node.js.map +0 -1
  300. package/dist/reconciler/types.d.ts +0 -5
  301. package/dist/reconciler/types.d.ts.map +0 -1
  302. package/dist/reconciler/types.js +0 -2
  303. package/dist/reconciler/types.js.map +0 -1
  304. package/dist/reconciler/visibility.d.ts +0 -6
  305. package/dist/reconciler/visibility.d.ts.map +0 -1
  306. package/dist/reconciler/visibility.js +0 -57
  307. package/dist/reconciler/visibility.js.map +0 -1
  308. package/dist/reconciler/wrapper-apply.d.ts +0 -6
  309. package/dist/reconciler/wrapper-apply.d.ts.map +0 -1
  310. package/dist/reconciler/wrapper-apply.js +0 -287
  311. package/dist/reconciler/wrapper-apply.js.map +0 -1
  312. package/dist/reconciler/wrapper-content.d.ts +0 -8
  313. package/dist/reconciler/wrapper-content.d.ts.map +0 -1
  314. package/dist/reconciler/wrapper-content.js +0 -19
  315. package/dist/reconciler/wrapper-content.js.map +0 -1
  316. package/dist/reconciler/wrapper-node.d.ts +0 -8
  317. package/dist/reconciler/wrapper-node.d.ts.map +0 -1
  318. package/dist/reconciler/wrapper-node.js +0 -4
  319. package/dist/reconciler/wrapper-node.js.map +0 -1
  320. package/dist/reconciler/wrapper-protocol.d.ts +0 -13
  321. package/dist/reconciler/wrapper-protocol.d.ts.map +0 -1
  322. package/dist/reconciler/wrapper-protocol.js +0 -20
  323. package/dist/reconciler/wrapper-protocol.js.map +0 -1
  324. package/dist/utils/create-element-component.d.ts +0 -4
  325. package/dist/utils/create-element-component.d.ts.map +0 -1
  326. package/dist/utils/create-element-component.js +0 -54
  327. package/dist/utils/create-element-component.js.map +0 -1
  328. package/dist/utils/gtype.d.ts +0 -16
  329. package/dist/utils/gtype.d.ts.map +0 -1
  330. package/dist/utils/gtype.js +0 -127
  331. package/dist/utils/gtype.js.map +0 -1
  332. package/dist/utils/notify-name.d.ts +0 -5
  333. package/dist/utils/notify-name.d.ts.map +0 -1
  334. package/dist/utils/notify-name.js +0 -6
  335. package/dist/utils/notify-name.js.map +0 -1
  336. package/dist/utils/object-prop.d.ts +0 -8
  337. package/dist/utils/object-prop.d.ts.map +0 -1
  338. package/dist/utils/object-prop.js +0 -9
  339. package/dist/utils/object-prop.js.map +0 -1
  340. package/dist/utils/settings-accessor.d.ts +0 -8
  341. package/dist/utils/settings-accessor.d.ts.map +0 -1
  342. package/dist/utils/settings-accessor.js +0 -69
  343. package/dist/utils/settings-accessor.js.map +0 -1
  344. package/dist/utils/wrapper-node-jsx.d.ts +0 -32
  345. package/dist/utils/wrapper-node-jsx.d.ts.map +0 -1
  346. package/dist/utils/wrapper-node-jsx.js +0 -2
  347. package/dist/utils/wrapper-node-jsx.js.map +0 -1
  348. package/src/hooks/use-merge-refs.ts +0 -53
  349. package/src/hooks/use-object-attachment.ts +0 -35
  350. package/src/libraries/adw/dialog.tsx +0 -34
  351. package/src/libraries/adw/index.ts +0 -1
  352. package/src/reconciler/accessible.ts +0 -232
  353. package/src/reconciler/commit-flush.ts +0 -13
  354. package/src/reconciler/container-attach.ts +0 -219
  355. package/src/reconciler/content-rebuild.ts +0 -19
  356. package/src/reconciler/dispatch.ts +0 -58
  357. package/src/reconciler/element-prop-appliers.ts +0 -110
  358. package/src/reconciler/element-props.ts +0 -192
  359. package/src/reconciler/label-text-rebuild.ts +0 -26
  360. package/src/reconciler/portal.ts +0 -28
  361. package/src/reconciler/reconciler-error-handler.ts +0 -29
  362. package/src/reconciler/reconciler-root.ts +0 -57
  363. package/src/reconciler/reconciler.ts +0 -13
  364. package/src/reconciler/render.ts +0 -61
  365. package/src/reconciler/signal-store.ts +0 -103
  366. package/src/reconciler/state.ts +0 -72
  367. package/src/reconciler/text-buffer-controller.ts +0 -107
  368. package/src/reconciler/text-buffer-rebuild.ts +0 -12
  369. package/src/reconciler/text-node.ts +0 -13
  370. package/src/reconciler/types.ts +0 -6
  371. package/src/reconciler/visibility.ts +0 -52
  372. package/src/reconciler/wrapper-apply.ts +0 -308
  373. package/src/reconciler/wrapper-content.ts +0 -24
  374. package/src/reconciler/wrapper-node.ts +0 -8
  375. package/src/reconciler/wrapper-protocol.ts +0 -32
  376. package/src/utils/create-element-component.ts +0 -77
  377. package/src/utils/gtype.ts +0 -166
  378. package/src/utils/notify-name.ts +0 -10
  379. package/src/utils/object-prop.ts +0 -13
  380. package/src/utils/settings-accessor.ts +0 -89
  381. package/src/utils/wrapper-node-jsx.ts +0 -34
@@ -1 +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,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,KAAK,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAE/E,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,MAAM,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhG;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,SAAS,cAAc,CAAC,CAAC,CAAC,EAC7E,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,YAAY,EAAE,CAAC,GAChB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAElB"}
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"}
@@ -1,4 +1,4 @@
1
- import { propToNotifySignal } from "../utils/notify-name.js";
1
+ import { kebabCase } from "@gtkx/utils";
2
2
  import { useObjectValue } from "./use-object-value.js";
3
3
  /**
4
4
  * Subscribes to a GObject property and returns its current value, re-rendering when the property changes.
@@ -7,7 +7,8 @@ import { useObjectValue } from "./use-object-value.js";
7
7
  * @param propertyName The camelCase name of a readable property on the object.
8
8
  * @returns The current property value, or `undefined` when the object is not resolved.
9
9
  */
10
- export function useProperty(object, propertyName) {
11
- return useObjectValue(object, propToNotifySignal(propertyName), (obj) => (obj ? obj[propertyName] : undefined));
10
+ function useProperty(object, propertyName) {
11
+ return useObjectValue(object, `notify::${kebabCase(propertyName)}`, (obj) => obj?.[propertyName]);
12
12
  }
13
+ export { useProperty };
13
14
  //# sourceMappingURL=use-property.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-property.js","sourceRoot":"","sources":["../../src/hooks/use-property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMvD;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACvB,MAAqB,EACrB,YAAe;IAEf,OAAO,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AACpH,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport { propToNotifySignal } from \"../utils/notify-name.js\";\nimport type { ObjectProp } from \"../utils/object-prop.js\";\nimport { useObjectValue } from \"./use-object-value.js\";\n\ntype PropertiesOf<T extends GObject.Object> = NonNullable<T[\"__properties__\"]>;\n\nexport type PropertyNameOf<T extends GObject.Object> = keyof PropertiesOf<T> & keyof T & string;\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 */\nexport function useProperty<T extends GObject.Object, K extends PropertyNameOf<T>>(\n object: ObjectProp<T>,\n propertyName: K,\n): T[K] | undefined {\n return useObjectValue(object, propToNotifySignal(propertyName), (obj) => (obj ? obj[propertyName] : undefined));\n}\n"]}
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"]}
@@ -1,19 +1,7 @@
1
1
  import * as Gio from "@gtkx/gi/gio";
2
- /**
3
- * A typed reference to a GSettings schema: its id, path, and the mapping of typed keys to their setting names.
4
- */
5
- export type SchemaRef<K extends object = Record<string, unknown>> = {
6
- id: string;
7
- /** The schema's object path, or `null` to use the schema's default path. */
8
- path: string | null;
9
- /** Maps each typed key of `K` to its corresponding GSettings key name. */
10
- keys: {
11
- [P in keyof K]: string;
12
- };
13
- /** Phantom field carrying the value type `K`; never populated at runtime. */
14
- __keys__?: K;
15
- };
16
- export declare const useSettingsInstance: ({ id, path }: Pick<SchemaRef, "id" | "path">) => Gio.Settings;
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;
17
5
  /**
18
6
  * Reads and writes a single key of a GSettings schema, re-rendering when the stored value changes.
19
7
  *
@@ -21,5 +9,6 @@ export declare const useSettingsInstance: ({ id, path }: Pick<SchemaRef, "id" |
21
9
  * @param key The key within the schema to read and write.
22
10
  * @returns A tuple of the current value and a setter that persists a new value.
23
11
  */
24
- export declare function useSetting<K extends object, P extends keyof K & string>(schema: SchemaRef<K>, key: P): [K[P], (value: K[P]) => void];
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 };
25
14
  //# sourceMappingURL=use-setting.d.ts.map
@@ -1 +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;AAKpC;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,0EAA0E;IAC1E,IAAI,EA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AC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAM3D;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
@@ -1,15 +1,20 @@
1
1
  import * as Gio from "@gtkx/gi/gio";
2
- import { useCallback, useMemo } from "react";
3
- import { resolveAccessor } from "../utils/settings-accessor.js";
2
+ import { useMemo } from "react";
3
+ import { resolveSettingAccessor, } from "../utils/settings.js";
4
4
  import { useObjectValue } from "./use-object-value.js";
5
- export const useSettingsInstance = ({ id, path }) => useMemo(() => (path === null ? Gio.Settings.new(id) : new Gio.Settings({ schemaId: id, path })), [id, path]);
6
- export function useSetting(schema, key) {
7
- const accessor = resolveAccessor(schema.keys[key], key, schema.id);
8
- const settings = useSettingsInstance(schema);
9
- const value = useObjectValue(settings, `changed::${key}`, () => accessor.read(settings, key));
10
- const set = useCallback((newValue) => {
11
- accessor.write(settings, key, newValue);
12
- }, [accessor, settings, key]);
13
- return [value, set];
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];
14
18
  }
19
+ export { useSettings, useSetting };
15
20
  //# sourceMappingURL=use-setting.js.map
@@ -1 +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,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC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import { useObjectValue } from \"./use-object-value.js\";\n\n/**\n * A typed reference to a GSettings schema: its id, path, and the mapping of typed keys to their setting names.\n */\nexport type SchemaRef<K extends object = Record<string, unknown>> = {\n id: string;\n /** The schema's object path, or `null` to use the schema's default path. */\n path: string | null;\n /** Maps each typed key of `K` to its corresponding GSettings key name. */\n keys: { [P in keyof K]: string };\n /** Phantom field carrying the value type `K`; never populated at runtime. */\n __keys__?: K;\n};\n\nexport const useSettingsInstance = ({ id, path }: Pick<SchemaRef, \"id\" | \"path\">): Gio.Settings =>\n useMemo(() => (path === null ? Gio.Settings.new(id) : new Gio.Settings({ schemaId: id, path })), [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 */\nexport function useSetting<K extends object, P extends keyof K & string>(\n schema: SchemaRef<K>,\n key: P,\n): [K[P], (value: K[P]) => void];\nexport function useSetting(schema: SchemaRef, key: string): [unknown, (value: unknown) => void] {\n const accessor = resolveAccessor(schema.keys[key], key, schema.id);\n const settings = useSettingsInstance(schema);\n\n const value = useObjectValue(settings, `changed::${key}`, () => accessor.read(settings, key));\n\n const set = useCallback(\n (newValue: unknown) => {\n accessor.write(settings, key, newValue);\n },\n [accessor, settings, key],\n );\n\n return [value, set];\n}\n"]}
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"]}
@@ -1,9 +1,9 @@
1
1
  import type * as GObject from "@gtkx/gi/gobject";
2
- import type { ObjectProp } from "../utils/object-prop.js";
3
- type AnySignalHandler = (...args: unknown[]) => unknown;
4
- type SignalsOf<T extends GObject.Object> = NonNullable<T["__signals__"]>;
5
- export type SignalNameOf<T extends GObject.Object> = (keyof SignalsOf<T> & string) | `${keyof SignalsOf<T> & string}::${string}`;
6
- export type SignalHandlerFor<T extends GObject.Object, S extends string> = S extends keyof SignalsOf<T> ? SignalsOf<T>[S] : S extends `${infer TBase}::${string}` ? TBase extends keyof SignalsOf<T> ? SignalsOf<T>[TBase] : AnySignalHandler : AnySignalHandler;
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
7
  type UseSignalOptions = {
8
8
  after?: boolean;
9
9
  immediate?: boolean;
@@ -11,11 +11,14 @@ type UseSignalOptions = {
11
11
  /**
12
12
  * Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.
13
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
+ *
14
17
  * @param object The GObject (or ref to one) to connect to.
15
18
  * @param signal The signal name, optionally with a detail suffix.
16
19
  * @param handler The callback invoked when the signal is emitted.
17
20
  * @param options Connection options such as running after the default handler or invoking immediately.
18
21
  */
19
- export declare function useSignal<T extends GObject.Object, S extends SignalNameOf<T>>(object: ObjectProp<T>, signal: S, handler: SignalHandlerFor<T, S>, options?: UseSignalOptions): void;
20
- export {};
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 };
21
24
  //# sourceMappingURL=use-signal.d.ts.map
@@ -1 +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;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,KAAK,gBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAExD,KAAK,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAEzE,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,IAC3C,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAC7B,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,MAAM,EAAE,CAAC;AAElD,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,MAAM,SAAS,CAAC,CAAC,CAAC,GACjG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACf,CAAC,SAAS,GAAG,MAAM,KA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,CAAC,CAAC,CAAC,CAAC,GACb,CAAC,SAAS,GAAG,MAAM,KAAK,KAAK,MAAM,EAAE,GACjC,KAAK,SAAS,MAAM,OAAO,CAAC,CAAC,CAAC,GAC1B,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GACjB,aAAa,GACjB,aAAa,CAAC;AAExB,KAAK,gBAAgB,GAAG;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,iBAAS,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,EACzE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EACjC,EAAE,KAAa,EAAE,SAAiB,EAAE,GAAE,gBAAqB,GAC5D,IAAI,CAoBN;AAED,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,CAAC"}
@@ -1,20 +1,31 @@
1
- import { useRef } from "react";
2
- import { useObjectAttachment } from "./use-object-attachment.js";
3
- export function useSignal(object, signal, handler, options) {
4
- const handlerRef = useRef(handler);
5
- handlerRef.current = handler;
6
- const after = options?.after ?? false;
7
- const immediate = options?.immediate ?? false;
8
- useObjectAttachment(object, {
9
- attach: (obj) => {
10
- const listener = (...args) => handlerRef.current(...args);
11
- obj.on(signal, listener, after);
12
- if (immediate)
13
- handlerRef.current();
14
- return { obj, signal, after, listener };
15
- },
16
- detach: (subscription) => subscription.obj.off(subscription.signal, subscription.listener),
17
- isSame: (subscription, obj) => subscription.obj === obj && subscription.signal === signal && subscription.after === after,
18
- });
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]);
19
29
  }
30
+ export { useSignal };
20
31
  //# sourceMappingURL=use-signal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-signal.js","sourceRoot":"","sources":["../../src/hooks/use-signal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AA4CjE,MAAM,UAAU,SAAS,CACrB,MAAkC,EAClC,MAAc,EACd,OAAyB,EACzB,OAA0B;IAE1B,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAC7B,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,KAAK,CAAC;IACtC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,KAAK,CAAC;IAE9C,mBAAmB,CAAqC,MAAM,EAAE;QAC5D,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;YACZ,MAAM,QAAQ,GAAkB,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;YACzE,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;YAChC,IAAI,SAAS;gBAAE,UAAU,CAAC,OAAO,EAAE,CAAC;YACpC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAC5C,CAAC;QACD,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC;QAC1F,MAAM,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE,EAAE,CAC1B,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,YAAY,CAAC,MAAM,KAAK,MAAM,IAAI,YAAY,CAAC,KAAK,KAAK,KAAK;KACjG,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport type { SignalHandler } from \"@gtkx/runtime\";\nimport { useRef } from \"react\";\nimport type { ObjectProp } from \"../utils/object-prop.js\";\nimport { useObjectAttachment } from \"./use-object-attachment.js\";\n\ntype AnySignalHandler = (...args: unknown[]) => unknown;\n\ntype SignalsOf<T extends GObject.Object> = NonNullable<T[\"__signals__\"]>;\n\nexport type SignalNameOf<T extends GObject.Object> =\n | (keyof SignalsOf<T> & string)\n | `${keyof SignalsOf<T> & string}::${string}`;\n\nexport type SignalHandlerFor<T extends GObject.Object, S extends string> = S extends keyof SignalsOf<T>\n ? SignalsOf<T>[S]\n : S extends `${infer TBase}::${string}`\n ? TBase extends keyof SignalsOf<T>\n ? SignalsOf<T>[TBase]\n : AnySignalHandler\n : AnySignalHandler;\n\ntype UseSignalOptions = {\n after?: boolean;\n immediate?: boolean;\n};\n\ntype SignalSubscription = {\n obj: GObject.Object;\n signal: string;\n after: boolean;\n listener: SignalHandler;\n};\n\n/**\n * Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.\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 */\nexport function useSignal<T extends GObject.Object, S extends SignalNameOf<T>>(\n object: ObjectProp<T>,\n signal: S,\n handler: SignalHandlerFor<T, S>,\n options?: UseSignalOptions,\n): void;\nexport function useSignal(\n object: ObjectProp<GObject.Object>,\n signal: string,\n handler: AnySignalHandler,\n options?: UseSignalOptions,\n): void {\n const handlerRef = useRef(handler);\n handlerRef.current = handler;\n const after = options?.after ?? false;\n const immediate = options?.immediate ?? false;\n\n useObjectAttachment<GObject.Object, SignalSubscription>(object, {\n attach: (obj) => {\n const listener: SignalHandler = (...args) => handlerRef.current(...args);\n obj.on(signal, listener, after);\n if (immediate) handlerRef.current();\n return { obj, signal, after, listener };\n },\n detach: (subscription) => subscription.obj.off(subscription.signal, subscription.listener),\n isSame: (subscription, obj) =>\n subscription.obj === obj && subscription.signal === signal && subscription.after === after,\n });\n}\n"]}
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,15 +1,14 @@
1
- import "./utils/wrapper-node-jsx.js";
2
- export type { ElementProp } from "@gtkx/config";
1
+ import "./bootstrap.js";
3
2
  export { useApplication } from "./hooks/use-application.js";
4
3
  export { useBindSetting } from "./hooks/use-bind-setting.js";
5
4
  export { useParentWindow } from "./hooks/use-parent-window.js";
6
5
  export { useProperty } from "./hooks/use-property.js";
7
- export { type SchemaRef, useSetting } from "./hooks/use-setting.js";
6
+ export { useSetting } from "./hooks/use-setting.js";
8
7
  export { useSignal } from "./hooks/use-signal.js";
9
- export type { AccessibleProps } from "./reconciler/accessible.js";
10
- export { createPortal } from "./reconciler/portal.js";
11
- export { createRoot, quit, type Root } from "./reconciler/render.js";
8
+ export type { MenuItem, VflConstraints } from "./prop-types.js";
12
9
  export { type RootElement, rootElement } from "./reconciler/root-element.js";
13
- export type { ObjectProp } from "./utils/object-prop.js";
14
- export type { TextAnchorProps, TextPaintableProps } from "./utils/wrapper-node-jsx.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";
15
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AAErC,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC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AO,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -1,11 +1,10 @@
1
- import "./utils/wrapper-node-jsx.js";
1
+ import "./bootstrap.js";
2
2
  export { useApplication } from "./hooks/use-application.js";
3
3
  export { useBindSetting } from "./hooks/use-bind-setting.js";
4
4
  export { useParentWindow } from "./hooks/use-parent-window.js";
5
5
  export { useProperty } from "./hooks/use-property.js";
6
6
  export { useSetting } from "./hooks/use-setting.js";
7
7
  export { useSignal } from "./hooks/use-signal.js";
8
- export { createPortal } from "./reconciler/portal.js";
9
- export { createRoot, quit } from "./reconciler/render.js";
10
8
  export { rootElement } from "./reconciler/root-element.js";
9
+ export { createPortal, createRoot, quit } from "./reconciler/root.js";
11
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,6BAA6B,CAAC;AAGrC,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,EAAkB,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAoB,WAAW,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["import \"./utils/wrapper-node-jsx.js\";\n\nexport type { ElementProp } from \"@gtkx/config\";\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 { type SchemaRef, useSetting } from \"./hooks/use-setting.js\";\nexport { useSignal } from \"./hooks/use-signal.js\";\nexport type { AccessibleProps } from \"./reconciler/accessible.js\";\nexport { createPortal } from \"./reconciler/portal.js\";\nexport { createRoot, quit, type Root } from \"./reconciler/render.js\";\nexport { type RootElement, rootElement } from \"./reconciler/root-element.js\";\nexport type { ObjectProp } from \"./utils/object-prop.js\";\nexport type { TextAnchorProps, TextPaintableProps } from \"./utils/wrapper-node-jsx.js\";\n"]}
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"]}
@@ -1,14 +1,13 @@
1
+ import "./bootstrap.js";
1
2
  export { createApplicationComponent } from "./components/application.js";
3
+ export { createElementComponent } from "./components/element.js";
2
4
  export { createWindowComponent } from "./components/window.js";
3
5
  export { ApplicationContext } from "./hooks/use-application.js";
4
- export { useMergeRefs } from "./hooks/use-merge-refs.js";
5
- export { useObjectAttachment } from "./hooks/use-object-attachment.js";
6
+ export { useMergedRef } from "./hooks/use-merged-refs.js";
6
7
  export { useObjectValue } from "./hooks/use-object-value.js";
7
- export { setReconcilerErrorHandler } from "./reconciler/reconciler-error-handler.js";
8
- export { createReconcilerRoot, type ReconcilerRoot } from "./reconciler/reconciler-root.js";
8
+ export type * from "./prop-types.js";
9
9
  export { isRootElement } from "./reconciler/root-element.js";
10
- export { BUFFER_TEXT_KIND, CONTAINER_PROP_KIND, isWrapperKind, LABEL_TEXT_KIND, LAZY_ELEMENT_KIND, OBJECT_PROP_KIND, TEXT_ANCHOR_KIND, TEXT_PAINTABLE_KIND, WRAPPER_NODE_ELEMENT, type WrapperKind, } from "./reconciler/wrapper-protocol.js";
10
+ export { createReconcilerRoot, type ReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
11
11
  export { getAccessibleMetadata } from "./utils/accessible-metadata.js";
12
- export { createElementComponent, createLazyElementComponent } from "./utils/create-element-component.js";
13
- export { type ObjectProp, resolveObjectProp } from "./utils/object-prop.js";
12
+ export { type RefProp, resolveRefProp } from "./utils/ref-prop.js";
14
13
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EA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BAA6B,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"}
package/dist/internal.js CHANGED
@@ -1,14 +1,12 @@
1
+ import "./bootstrap.js";
1
2
  export { createApplicationComponent } from "./components/application.js";
3
+ export { createElementComponent } from "./components/element.js";
2
4
  export { createWindowComponent } from "./components/window.js";
3
5
  export { ApplicationContext } from "./hooks/use-application.js";
4
- export { useMergeRefs } from "./hooks/use-merge-refs.js";
5
- export { useObjectAttachment } from "./hooks/use-object-attachment.js";
6
+ export { useMergedRef } from "./hooks/use-merged-refs.js";
6
7
  export { useObjectValue } from "./hooks/use-object-value.js";
7
- export { setReconcilerErrorHandler } from "./reconciler/reconciler-error-handler.js";
8
- export { createReconcilerRoot } from "./reconciler/reconciler-root.js";
9
8
  export { isRootElement } from "./reconciler/root-element.js";
10
- export { BUFFER_TEXT_KIND, CONTAINER_PROP_KIND, isWrapperKind, LABEL_TEXT_KIND, LAZY_ELEMENT_KIND, OBJECT_PROP_KIND, TEXT_ANCHOR_KIND, TEXT_PAINTABLE_KIND, WRAPPER_NODE_ELEMENT, } from "./reconciler/wrapper-protocol.js";
9
+ export { createReconcilerRoot, setReconcilerErrorHandler } from "./reconciler/root.js";
11
10
  export { getAccessibleMetadata } from "./utils/accessible-metadata.js";
12
- export { createElementComponent, createLazyElementComponent } from "./utils/create-element-component.js";
13
- export { resolveObjectProp } from "./utils/object-prop.js";
11
+ export { resolveRefProp } from "./utils/ref-prop.js";
14
12
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAuB,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,GAEvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACzG,OAAO,EAAmB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["export { createApplicationComponent } from \"./components/application.js\";\nexport { createWindowComponent } from \"./components/window.js\";\nexport { ApplicationContext } from \"./hooks/use-application.js\";\nexport { useMergeRefs } from \"./hooks/use-merge-refs.js\";\nexport { useObjectAttachment } from \"./hooks/use-object-attachment.js\";\nexport { useObjectValue } from \"./hooks/use-object-value.js\";\nexport { setReconcilerErrorHandler } from \"./reconciler/reconciler-error-handler.js\";\nexport { createReconcilerRoot, type ReconcilerRoot } from \"./reconciler/reconciler-root.js\";\nexport { isRootElement } from \"./reconciler/root-element.js\";\nexport {\n BUFFER_TEXT_KIND,\n CONTAINER_PROP_KIND,\n isWrapperKind,\n LABEL_TEXT_KIND,\n LAZY_ELEMENT_KIND,\n OBJECT_PROP_KIND,\n TEXT_ANCHOR_KIND,\n TEXT_PAINTABLE_KIND,\n WRAPPER_NODE_ELEMENT,\n type WrapperKind,\n} from \"./reconciler/wrapper-protocol.js\";\nexport { getAccessibleMetadata } from \"./utils/accessible-metadata.js\";\nexport { createElementComponent, createLazyElementComponent } from \"./utils/create-element-component.js\";\nexport { type ObjectProp, resolveObjectProp } from \"./utils/object-prop.js\";\n"]}
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,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,4EAA4E;AAC5E,KAAK,cAAc,GAAG;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7C,CAAC;AAEF,iCAAiC;AACjC,KAAK,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AACxF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,GAAG,aAAa,CAAC;AAElB,KAAK,kBAAkB,GAAG;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAC,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC;CACzD,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACtB,IAAI,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,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"]}
@@ -1,8 +1,11 @@
1
- import type * as GObject from "@gtkx/gi/gobject";
2
- import type { Props } from "./types.js";
3
- type ApplyPropsOptions = {
4
- exclude?: (name: string) => boolean;
5
- };
6
- export declare function applyProps(container: GObject.Object, oldProps: Props | null, newProps: Props, options?: ApplyPropsOptions): void;
7
- export {};
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, };
8
11
  //# sourceMappingURL=apply-props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply-props.d.ts","sourceRoot":"","sources":["../../src/reconciler/apply-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAKjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AA4BxC,KAAK,iBAAiB,GAAG;IACrB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACvC,CAAC;AAkDF,wBAAgB,UAAU,CACtB,SAAS,EAAE,OAAO,CAAC,MAAM,EACzB,QAAQ,EAAE,KAAK,GAAG,IAAI,EACtB,QAAQ,EAAE,KAAK,EACf,OAAO,CAAC,EAAE,iBAAiB,GAC5B,IAAI,CA0BN"}
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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