@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
@@ -0,0 +1,379 @@
1
+ import type * as Gtk from "@gtkx/gi/gtk";
2
+ import * as Adw from "@gtkx/gi/adw";
3
+ import type { AlertDialogResponse } from "./prop-types.js";
4
+ import {
5
+ addRemoveSlot,
6
+ adoptedChildrenSlot,
7
+ boxSlot,
8
+ childSetterSlot,
9
+ contentSetterSlot,
10
+ deferred,
11
+ list,
12
+ slot,
13
+ } from "../reconciler/behaviors.js";
14
+ import { type ElementConfig, registerElements } from "../reconciler/registry.js";
15
+ import { BUILTIN_ELEMENTS } from "./element-config.js";
16
+
17
+ type AdwChildSetter =
18
+ | Adw.Bin |
19
+ Adw.BreakpointBin |
20
+ Adw.Clamp |
21
+ Adw.ClampScrollable |
22
+ Adw.Dialog |
23
+ Adw.NavigationPage |
24
+ Adw.SplitButton |
25
+ Adw.StatusPage |
26
+ Adw.TabOverview |
27
+ Adw.ToastOverlay |
28
+ Adw.Toggle;
29
+
30
+ type AdwContentSetter = Adw.ApplicationWindow | Adw.BottomSheet | Adw.Flap | Adw.OverlaySplitView | Adw.Window;
31
+ type BreakpointHost = Adw.ApplicationWindow | Adw.Window | Adw.Dialog;
32
+ type PageHost = Adw.PreferencesDialog | Adw.PreferencesWindow;
33
+ type PrefixSuffixRow = Adw.ActionRow | Adw.EntryRow | Adw.ExpanderRow;
34
+
35
+ const childSetter = childSetterSlot<AdwChildSetter>();
36
+ const contentSetter = contentSetterSlot<AdwContentSetter>();
37
+
38
+ const breakpoints = slot<BreakpointHost, Adw.Breakpoint>("breakpoints", "AdwBreakpoint", {
39
+ attach: (host, breakpoint) => {
40
+ host.addBreakpoint(breakpoint);
41
+ },
42
+ });
43
+
44
+ const prefixSuffix = [
45
+ slot<PrefixSuffixRow, Gtk.Widget>("prefix", "GtkWidget", {
46
+ attach: (row, child) => {
47
+ row.addPrefix(child);
48
+ },
49
+ detach: (row, child) => {
50
+ row.remove(child);
51
+ },
52
+ }),
53
+ slot<PrefixSuffixRow, Gtk.Widget>("suffix", "GtkWidget", {
54
+ attach: (row, child) => {
55
+ row.addSuffix(child);
56
+ },
57
+ detach: (row, child) => {
58
+ row.remove(child);
59
+ },
60
+ }),
61
+ ];
62
+
63
+ const pageHostChildren = addRemoveSlot<Adw.PreferencesPage, PageHost>(
64
+ "children",
65
+ "AdwPreferencesPage",
66
+ (host, page) => {
67
+ host.add(page);
68
+ },
69
+ (host, page) => {
70
+ host.remove(page);
71
+ },
72
+ );
73
+
74
+ /** The runtime half of the built-in element configuration: the behaviors bound to each GObject type. */
75
+ const BUILTIN_BEHAVIORS: Record<string, ElementConfig<never>> = {
76
+ AdwBin: {
77
+ behaviors: [childSetter],
78
+ },
79
+ AdwClamp: {
80
+ behaviors: [childSetter],
81
+ },
82
+ AdwClampScrollable: {
83
+ behaviors: [childSetter],
84
+ },
85
+ AdwNavigationPage: {
86
+ behaviors: [childSetter],
87
+ },
88
+ AdwSplitButton: {
89
+ behaviors: [childSetter],
90
+ },
91
+ AdwStatusPage: {
92
+ behaviors: [childSetter],
93
+ },
94
+ AdwTabOverview: {
95
+ behaviors: [childSetter],
96
+ },
97
+ AdwToastOverlay: {
98
+ behaviors: [childSetter],
99
+ },
100
+ AdwToggle: {
101
+ behaviors: [childSetter],
102
+ },
103
+ AdwBottomSheet: {
104
+ behaviors: [contentSetter],
105
+ },
106
+ AdwFlap: {
107
+ behaviors: [contentSetter],
108
+ },
109
+ AdwOverlaySplitView: {
110
+ behaviors: [contentSetter],
111
+ },
112
+ AdwDialog: {
113
+ behaviors: [childSetter, breakpoints],
114
+ },
115
+ AdwApplicationWindow: {
116
+ behaviors: [contentSetter, breakpoints],
117
+ },
118
+ AdwWindow: {
119
+ behaviors: [contentSetter, breakpoints],
120
+ },
121
+ AdwBreakpointBin: {
122
+ behaviors: [
123
+ childSetter,
124
+ addRemoveSlot<Adw.Breakpoint, Adw.BreakpointBin>(
125
+ "breakpoints",
126
+ "AdwBreakpoint",
127
+ (bin, breakpoint) => {
128
+ bin.addBreakpoint(breakpoint);
129
+ },
130
+ (bin, breakpoint) => {
131
+ bin.removeBreakpoint(breakpoint);
132
+ },
133
+ ),
134
+ ],
135
+ },
136
+ AdwActionRow: {
137
+ behaviors: prefixSuffix,
138
+ },
139
+ AdwEntryRow: {
140
+ behaviors: prefixSuffix,
141
+ },
142
+ AdwExpanderRow: {
143
+ behaviors: [
144
+ ...prefixSuffix,
145
+ addRemoveSlot<Gtk.Widget, Adw.ExpanderRow>(
146
+ "rows",
147
+ "GtkWidget",
148
+ (row, child) => {
149
+ row.addRow(child);
150
+ },
151
+ (row, child) => {
152
+ row.remove(child);
153
+ },
154
+ ),
155
+ addRemoveSlot<Gtk.Widget, Adw.ExpanderRow>(
156
+ "actions",
157
+ "GtkWidget",
158
+ (row, child) => {
159
+ row.addAction(child);
160
+ },
161
+ (row, child) => {
162
+ row.remove(child);
163
+ },
164
+ ),
165
+ ],
166
+ },
167
+ AdwNavigationSplitView: {
168
+ behaviors: [contentSetterSlot<Adw.NavigationSplitView, Adw.NavigationPage>("AdwNavigationPage")],
169
+ },
170
+ AdwLeaflet: {
171
+ behaviors: [boxSlot<Adw.Leaflet | Adw.WrapBox>()],
172
+ },
173
+ AdwWrapBox: {
174
+ behaviors: [boxSlot<Adw.Leaflet | Adw.WrapBox>()],
175
+ },
176
+ AdwCarousel: {
177
+ behaviors: [
178
+ slot<Adw.Carousel, Gtk.Widget>("children", "GtkWidget", {
179
+ attach: (carousel, child, info) => {
180
+ carousel.insert(child, info.index);
181
+ },
182
+ detach: (carousel, child) => {
183
+ carousel.remove(child);
184
+ },
185
+ reorder: (carousel, child, info) => {
186
+ carousel.reorder(child, info.index);
187
+ },
188
+ }),
189
+ ],
190
+ },
191
+ AdwPreferencesPage: {
192
+ behaviors: [
193
+ slot<Adw.PreferencesPage, Adw.PreferencesGroup>("children", "AdwPreferencesGroup", {
194
+ attach: (page, group, info) => {
195
+ page.insert(group, info.index);
196
+ },
197
+ detach: (page, group) => {
198
+ page.remove(group);
199
+ },
200
+ }),
201
+ ],
202
+ },
203
+ AdwPreferencesDialog: {
204
+ behaviors: [pageHostChildren],
205
+ },
206
+ AdwPreferencesWindow: {
207
+ behaviors: [pageHostChildren],
208
+ },
209
+ AdwPreferencesGroup: {
210
+ behaviors: [
211
+ addRemoveSlot<Gtk.Widget, Adw.PreferencesGroup>(
212
+ "children",
213
+ "GtkWidget",
214
+ (group, child) => {
215
+ group.add(child);
216
+ },
217
+ (group, child) => {
218
+ group.remove(child);
219
+ },
220
+ ),
221
+ ],
222
+ },
223
+ AdwSqueezer: {
224
+ behaviors: [
225
+ addRemoveSlot<Gtk.Widget, Adw.Squeezer>(
226
+ "children",
227
+ "GtkWidget",
228
+ (squeezer, child) => {
229
+ squeezer.add(child);
230
+ },
231
+ (squeezer, child) => {
232
+ squeezer.remove(child);
233
+ },
234
+ ),
235
+ ],
236
+ },
237
+ AdwTabView: {
238
+ behaviors: [
239
+ slot<Adw.TabView, Gtk.Widget>("children", "GtkWidget", {
240
+ attach: (view, child, info) => view.insert(child, info.index),
241
+ reorder: (view, _child, info) => {
242
+ if (info.adopted instanceof Adw.TabPage) {
243
+ view.reorderPage(info.adopted, info.index);
244
+ }
245
+ },
246
+ detach: (view, _child, info) => {
247
+ if (info.adopted instanceof Adw.TabPage) {
248
+ view.closePage(info.adopted);
249
+ }
250
+ },
251
+ resolve: (view, child) => view.getPage(child),
252
+ }),
253
+ ],
254
+ },
255
+ AdwNavigationView: {
256
+ behaviors: [
257
+ addRemoveSlot<Adw.NavigationPage, Adw.NavigationView>(
258
+ "children",
259
+ "AdwNavigationPage",
260
+ (view, page) => {
261
+ view.add(page);
262
+ },
263
+ (view, page) => {
264
+ view.remove(page);
265
+ },
266
+ ),
267
+ ],
268
+ },
269
+ AdwViewStack: {
270
+ behaviors: [
271
+ adoptedChildrenSlot<Adw.ViewStack, Gtk.Widget>(
272
+ "GtkWidget",
273
+ (stack, child) => stack.add(child),
274
+ (stack, child) => {
275
+ stack.remove(child);
276
+ },
277
+ ),
278
+ deferred<Adw.ViewStack, string>("visibleChildName", (stack, name) => stack.getChildByName(name) !== null),
279
+ ],
280
+ },
281
+ AdwToolbarView: {
282
+ behaviors: [
283
+ contentSetterSlot<Adw.ToolbarView>(),
284
+ slot<Adw.ToolbarView, Gtk.Widget>("topBar", "GtkWidget", {
285
+ attach: (view, child) => {
286
+ view.addTopBar(child);
287
+ },
288
+ detach: (view, child) => {
289
+ view.remove(child);
290
+ },
291
+ }),
292
+ slot<Adw.ToolbarView, Gtk.Widget>("bottomBar", "GtkWidget", {
293
+ attach: (view, child) => {
294
+ view.addBottomBar(child);
295
+ },
296
+ detach: (view, child) => {
297
+ view.remove(child);
298
+ },
299
+ }),
300
+ ],
301
+ },
302
+ AdwHeaderBar: {
303
+ behaviors: [
304
+ slot<Adw.HeaderBar, Gtk.Widget>("start", "GtkWidget", {
305
+ attach: (bar, child) => {
306
+ bar.packStart(child);
307
+ },
308
+ detach: (bar, child) => {
309
+ bar.remove(child);
310
+ },
311
+ }),
312
+ slot<Adw.HeaderBar, Gtk.Widget>("end", "GtkWidget", {
313
+ attach: (bar, child) => {
314
+ bar.packEnd(child);
315
+ },
316
+ detach: (bar, child) => {
317
+ bar.remove(child);
318
+ },
319
+ }),
320
+ ],
321
+ },
322
+ AdwShortcutsDialog: {
323
+ behaviors: [
324
+ slot<Adw.ShortcutsDialog, Adw.ShortcutsSection>("children", "AdwShortcutsSection", {
325
+ attach: (dialog, section) => {
326
+ dialog.add(section);
327
+ },
328
+ }),
329
+ ],
330
+ },
331
+ AdwShortcutsSection: {
332
+ behaviors: [
333
+ slot<Adw.ShortcutsSection, Adw.ShortcutsItem>("children", "AdwShortcutsItem", {
334
+ attach: (section, item) => {
335
+ section.add(item);
336
+ },
337
+ }),
338
+ ],
339
+ },
340
+ AdwToggleGroup: {
341
+ behaviors: [
342
+ addRemoveSlot<Adw.Toggle, Adw.ToggleGroup>(
343
+ "children",
344
+ "AdwToggle",
345
+ (group, toggle) => {
346
+ group.add(toggle);
347
+ },
348
+ (group, toggle) => {
349
+ group.remove(toggle);
350
+ },
351
+ ),
352
+ deferred<Adw.ToggleGroup, string>("activeName", (group, name) => group.getToggleByName(name) !== null),
353
+ deferred("active"),
354
+ ],
355
+ },
356
+ AdwAlertDialog: {
357
+ behaviors: [
358
+ list<Adw.AlertDialog, AlertDialogResponse>("responses", {
359
+ add: (dialog, response) => {
360
+ dialog.addResponse(response.id, response.label);
361
+
362
+ if (response.appearance !== undefined) {
363
+ dialog.setResponseAppearance(response.id, response.appearance);
364
+ }
365
+
366
+ if (response.enabled !== undefined) {
367
+ dialog.setResponseEnabled(response.id, response.enabled);
368
+ }
369
+ },
370
+ remove: (dialog, response) => {
371
+ dialog.removeResponse(response.id);
372
+ },
373
+ }),
374
+ ],
375
+ },
376
+ };
377
+
378
+ registerElements(BUILTIN_ELEMENTS);
379
+ registerElements(BUILTIN_BEHAVIORS);
@@ -0,0 +1,140 @@
1
+ import { type ElementConfig, internal, type ModuleExport } from "../reconciler/registry.js";
2
+
3
+ const childrenProps = internal("ChildrenProps");
4
+ const breakpointsProps = adw("AdwBreakpointsProps");
5
+ const preferencesRowProps = adw("AdwPreferencesRowProps");
6
+
7
+ /**
8
+ * The static, runtime-free half of the built-in element configuration: which base props interface each
9
+ * generated element extends, which component wraps it, and whether its GObject is created lazily by its
10
+ * parent. Codegen imports this module, so it must never reach the GObject bindings.
11
+ */
12
+ const BUILTIN_ELEMENTS: Record<string, ElementConfig> = {
13
+ AdwBin: {
14
+ props: childrenProps,
15
+ },
16
+ AdwClamp: {
17
+ props: childrenProps,
18
+ },
19
+ AdwClampScrollable: {
20
+ props: childrenProps,
21
+ },
22
+ AdwNavigationPage: {
23
+ props: childrenProps,
24
+ },
25
+ AdwSplitButton: {
26
+ props: childrenProps,
27
+ },
28
+ AdwStatusPage: {
29
+ props: childrenProps,
30
+ },
31
+ AdwTabOverview: {
32
+ props: childrenProps,
33
+ },
34
+ AdwToastOverlay: {
35
+ props: childrenProps,
36
+ },
37
+ AdwToggle: {
38
+ props: childrenProps,
39
+ },
40
+ AdwBottomSheet: {
41
+ props: childrenProps,
42
+ },
43
+ AdwFlap: {
44
+ props: childrenProps,
45
+ },
46
+ AdwOverlaySplitView: {
47
+ props: childrenProps,
48
+ },
49
+ AdwViewStackPage: {
50
+ lazy: true,
51
+ },
52
+ AdwTabPage: {
53
+ lazy: true,
54
+ },
55
+ AdwPreferencesRow: {
56
+ props: preferencesRowProps,
57
+ },
58
+ AdwDialog: {
59
+ props: breakpointsProps,
60
+ component: adw("createDialogComponent"),
61
+ },
62
+ AdwApplicationWindow: {
63
+ props: breakpointsProps,
64
+ },
65
+ AdwWindow: {
66
+ props: breakpointsProps,
67
+ },
68
+ AdwBreakpointBin: {
69
+ props: breakpointsProps,
70
+ },
71
+ AdwActionRow: {
72
+ props: preferencesRowProps,
73
+ },
74
+ AdwEntryRow: {
75
+ props: preferencesRowProps,
76
+ },
77
+ AdwExpanderRow: {
78
+ props: adw("AdwExpanderRowProps"),
79
+ },
80
+ AdwNavigationSplitView: {
81
+ props: childrenProps,
82
+ },
83
+ AdwLeaflet: {
84
+ props: childrenProps,
85
+ },
86
+ AdwWrapBox: {
87
+ props: childrenProps,
88
+ },
89
+ AdwCarousel: {
90
+ props: childrenProps,
91
+ },
92
+ AdwPreferencesPage: {
93
+ props: childrenProps,
94
+ },
95
+ AdwPreferencesDialog: {
96
+ props: childrenProps,
97
+ },
98
+ AdwPreferencesWindow: {
99
+ props: childrenProps,
100
+ },
101
+ AdwPreferencesGroup: {
102
+ props: childrenProps,
103
+ },
104
+ AdwSqueezer: {
105
+ props: childrenProps,
106
+ },
107
+ AdwTabView: {
108
+ props: childrenProps,
109
+ },
110
+ AdwNavigationView: {
111
+ props: childrenProps,
112
+ },
113
+ AdwViewStack: {
114
+ props: childrenProps,
115
+ },
116
+ AdwToolbarView: {
117
+ props: adw("AdwToolbarViewProps"),
118
+ },
119
+ AdwHeaderBar: {
120
+ props: internal("GtkHeaderBarProps"),
121
+ },
122
+ AdwShortcutsDialog: {
123
+ props: childrenProps,
124
+ },
125
+ AdwShortcutsSection: {
126
+ props: childrenProps,
127
+ },
128
+ AdwToggleGroup: {
129
+ props: childrenProps,
130
+ },
131
+ AdwAlertDialog: {
132
+ props: adw("AdwAlertDialogProps"),
133
+ },
134
+ };
135
+
136
+ function adw(name: string): ModuleExport {
137
+ return { module: "@gtkx/react/adw", export: name };
138
+ }
139
+
140
+ export { BUILTIN_ELEMENTS };
@@ -0,0 +1,4 @@
1
+ import "./element-behaviors.js";
2
+
3
+ export { createDialogComponent } from "./dialog.js";
4
+ export type * from "./prop-types.js";
@@ -0,0 +1,42 @@
1
+ import type * as Adw from "@gtkx/gi/adw";
2
+ import type { ReactNode } from "react";
3
+ import type { ChildrenProps } from "../prop-types.js";
4
+
5
+ type AlertDialogResponse = {
6
+ id: string;
7
+ label: string;
8
+ appearance?: Adw.ResponseAppearance;
9
+ enabled?: boolean;
10
+ };
11
+
12
+ type AdwAlertDialogProps = {
13
+ responses?: AlertDialogResponse[] | null | undefined;
14
+ } & ChildrenProps;
15
+
16
+ type AdwPreferencesRowProps = {
17
+ prefix?: ReactNode | null | undefined;
18
+ suffix?: ReactNode | null | undefined;
19
+ };
20
+
21
+ type AdwExpanderRowProps = {
22
+ rows?: ReactNode | null | undefined;
23
+ actions?: ReactNode | null | undefined;
24
+ } & AdwPreferencesRowProps;
25
+
26
+ type AdwToolbarViewProps = {
27
+ topBar?: ReactNode | null | undefined;
28
+ bottomBar?: ReactNode | null | undefined;
29
+ } & ChildrenProps;
30
+
31
+ type AdwBreakpointsProps = {
32
+ breakpoints?: ReactNode | null | undefined;
33
+ } & ChildrenProps;
34
+
35
+ export {
36
+ type AlertDialogResponse,
37
+ type AdwAlertDialogProps,
38
+ type AdwPreferencesRowProps,
39
+ type AdwExpanderRowProps,
40
+ type AdwToolbarViewProps,
41
+ type AdwBreakpointsProps,
42
+ };
@@ -0,0 +1,5 @@
1
+ import { elements } from "virtual:gtkx-config";
2
+ import "./element-behaviors.js";
3
+ import { registerElements } from "./reconciler/registry.js";
4
+
5
+ registerElements(elements, { prepend: true });
@@ -1,11 +1,10 @@
1
- import { applicationId as defaultApplicationId } from "virtual:gtkx-config";
2
1
  import type * as Gtk from "@gtkx/gi/gtk";
3
2
  import { quitApplication, runApplication } from "@gtkx/runtime";
4
- import { type ElementType, type ReactNode, type Ref, useCallback, useState } from "react";
3
+ import { pickBy } from "@gtkx/utils";
4
+ import { type ElementType, type ReactNode, type Ref, useLayoutEffect, useState } from "react";
5
+ import { applicationId as defaultApplicationId } from "virtual:gtkx-config";
5
6
  import { ApplicationContext } from "../hooks/use-application.js";
6
- import { useMergeRefs } from "../hooks/use-merge-refs.js";
7
-
8
- const POST_ACTIVATE_PROPS = new Set(["menubar"]);
7
+ import { useMergedRef } from "../hooks/use-merged-refs.js";
9
8
 
10
9
  type ApplicationComponentProps = {
11
10
  applicationId?: string | null | undefined;
@@ -13,31 +12,51 @@ type ApplicationComponentProps = {
13
12
  ref?: Ref<Gtk.Application | null> | undefined;
14
13
  };
15
14
 
16
- export const createApplicationComponent = (
17
- Component: ElementType,
18
- ): ((props: ApplicationComponentProps) => ReactNode) => {
19
- return ({ applicationId = defaultApplicationId, children, ref, ...rest }: ApplicationComponentProps): ReactNode => {
20
- const [app, setApp] = useState<Gtk.Application | null>(null);
15
+ const POST_ACTIVATE_PROPS = new Set(["menubar"]);
21
16
 
22
- const handleMount = useCallback((instance: Gtk.Application) => {
23
- runApplication(instance);
24
- setApp(instance);
17
+ const useApplicationLifecycle = (
18
+ application: Gtk.Application | null,
19
+ setActivated: (isActivated: boolean) => void,
20
+ ): void => {
21
+ useLayoutEffect(() => {
22
+ if (!application) {
23
+ return;
24
+ }
25
25
 
26
- return () => {
27
- quitApplication(instance);
28
- setApp(null);
29
- };
30
- }, []);
26
+ runApplication(application);
27
+ setActivated(true);
31
28
 
32
- const mergedRef = useMergeRefs<Gtk.Application>(ref, handleMount);
33
- const appliedProps = app
34
- ? rest
35
- : Object.fromEntries(Object.entries(rest).filter(([key]) => !POST_ACTIVATE_PROPS.has(key)));
29
+ return () => {
30
+ quitApplication(application);
31
+ setActivated(false);
32
+ };
33
+ }, [application, setActivated]);
34
+ };
35
+
36
+ const applicationChildren = (application: Gtk.Application | null, children: ReactNode): ReactNode => {
37
+ if (!application) {
38
+ return null;
39
+ }
40
+
41
+ return <ApplicationContext.Provider value={application}>{children}</ApplicationContext.Provider>;
42
+ };
43
+
44
+ const createApplicationComponent = (
45
+ Component: ElementType,
46
+ ): ((props: ApplicationComponentProps) => ReactNode) => {
47
+ return ({ applicationId = defaultApplicationId, children, ref, ...rest }: ApplicationComponentProps): ReactNode => {
48
+ const [application, setApplication] = useState<Gtk.Application | null>(null);
49
+ const [activated, setActivated] = useState(false);
50
+ useApplicationLifecycle(application, setActivated);
51
+ const mergedRef = useMergedRef(ref, setApplication);
52
+ const appliedProps = activated ? rest : pickBy(rest, (_value, key) => !POST_ACTIVATE_PROPS.has(key));
36
53
 
37
54
  return (
38
55
  <Component ref={mergedRef} applicationId={applicationId} {...appliedProps}>
39
- {app ? <ApplicationContext.Provider value={app}>{children}</ApplicationContext.Provider> : null}
56
+ {activated ? applicationChildren(application, children) : null}
40
57
  </Component>
41
58
  );
42
59
  };
43
60
  };
61
+
62
+ export { createApplicationComponent };
@@ -0,0 +1,47 @@
1
+ import { isRecord } from "@gtkx/utils";
2
+ import { createElement, type ElementType, isValidElement, type ReactElement, type ReactNode } from "react";
3
+ import type { Props } from "../reconciler/registry.js";
4
+
5
+ /** The intrinsic element that carries an object-valued prop's element into its parent's named property. */
6
+ const Prop = "gtkx:prop";
7
+
8
+ const hasElement = (value: unknown): boolean =>
9
+ isValidElement(value) || (Array.isArray(value) && value.some((item: unknown) => hasElement(item)));
10
+
11
+ const routeProp = (key: string, value: unknown, hostProps: Props, propChildren: ReactNode[]): void => {
12
+ if (key !== "ref" && hasElement(value)) {
13
+ propChildren.push(
14
+ createElement(Prop, { propName: key, key: `${Prop}:${key}` }, value as ReactNode),
15
+ );
16
+ } else {
17
+ hostProps[key] = value;
18
+ }
19
+ };
20
+
21
+ const buildElement = (typeName: string, record: Props): ReactElement => {
22
+ const Host = typeName as ElementType;
23
+ const hostProps: Props = {};
24
+ const propChildren: ReactNode[] = [];
25
+
26
+ for (const key in record) {
27
+ if (key === "children") {
28
+ continue;
29
+ }
30
+
31
+ routeProp(key, record[key], hostProps, propChildren);
32
+ }
33
+
34
+ return (
35
+ <Host {...hostProps}>
36
+ {propChildren}
37
+ {record.children as ReactNode}
38
+ </Host>
39
+ );
40
+ };
41
+
42
+ const createElementComponent =
43
+ (typeName: string): ((props: unknown) => ReactNode) =>
44
+ (props: unknown): ReactNode =>
45
+ buildElement(typeName, isRecord(props) ? props : {});
46
+
47
+ export { Prop, createElementComponent };