@gjsify/adwaita-web 0.53.0 → 0.55.0

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 (440) hide show
  1. package/dist/adwaita-web.css +8070 -3037
  2. package/dist/adwaita-web.css.map +1 -1
  3. package/lib/types/adw-application-window.spec.d.ts +1 -0
  4. package/lib/types/adw-bin.spec.d.ts +1 -0
  5. package/lib/types/adw-breakpoint-bin.spec.d.ts +1 -0
  6. package/lib/types/adw-clamp-scrollable.spec.d.ts +1 -0
  7. package/lib/types/adw-multi-layout-view.spec.d.ts +1 -0
  8. package/lib/types/adw-preferences-row.spec.d.ts +1 -0
  9. package/lib/types/adw-shortcuts.spec.d.ts +1 -0
  10. package/lib/types/adw-tab-bar.spec.d.ts +1 -0
  11. package/lib/types/adw-tab-button.spec.d.ts +1 -0
  12. package/lib/types/adw-tab-overview.spec.d.ts +1 -0
  13. package/lib/types/adw-view-switcher-sidebar.spec.d.ts +1 -0
  14. package/lib/types/adw-window.spec.d.ts +1 -0
  15. package/lib/types/breakpoints.d.ts +14 -3
  16. package/lib/types/construct-vectors.spec.d.ts +1 -0
  17. package/lib/types/elements/adw-application-window.d.ts +27 -0
  18. package/lib/types/elements/adw-bin.d.ts +17 -0
  19. package/lib/types/elements/adw-breakpoint-bin.d.ts +67 -0
  20. package/lib/types/elements/adw-clamp-scrollable.d.ts +38 -0
  21. package/lib/types/elements/adw-dialog.d.ts +10 -0
  22. package/lib/types/elements/adw-layout-slot.d.ts +19 -0
  23. package/lib/types/elements/adw-multi-layout-view.d.ts +101 -0
  24. package/lib/types/elements/adw-preferences-row.d.ts +31 -0
  25. package/lib/types/elements/adw-shortcuts-dialog.d.ts +13 -0
  26. package/lib/types/elements/adw-shortcuts-item.d.ts +36 -0
  27. package/lib/types/elements/adw-shortcuts-section.d.ts +14 -0
  28. package/lib/types/elements/adw-sidebar.d.ts +5 -0
  29. package/lib/types/elements/adw-switch-row.d.ts +3 -0
  30. package/lib/types/elements/adw-tab-bar.d.ts +108 -0
  31. package/lib/types/elements/adw-tab-button.d.ts +32 -0
  32. package/lib/types/elements/adw-tab-overview.d.ts +199 -0
  33. package/lib/types/elements/adw-tab-view.d.ts +19 -23
  34. package/lib/types/elements/adw-view-switcher-sidebar.d.ts +84 -0
  35. package/lib/types/elements/adw-window.d.ts +40 -0
  36. package/lib/types/elements/gtk-about-dialog.d.ts +146 -0
  37. package/lib/types/elements/gtk-application-window.d.ts +34 -0
  38. package/lib/types/elements/gtk-aspect-frame.d.ts +27 -0
  39. package/lib/types/elements/gtk-button.d.ts +9 -0
  40. package/lib/types/elements/gtk-calendar.d.ts +159 -0
  41. package/lib/types/elements/gtk-center-box.d.ts +39 -0
  42. package/lib/types/elements/gtk-color-dialog-button.d.ts +69 -0
  43. package/lib/types/elements/gtk-column-view.d.ts +50 -0
  44. package/lib/types/elements/gtk-drag-icon.d.ts +78 -0
  45. package/lib/types/elements/gtk-drawing-area.d.ts +95 -0
  46. package/lib/types/elements/gtk-editable-label.d.ts +33 -0
  47. package/lib/types/elements/gtk-emoji-chooser.d.ts +84 -0
  48. package/lib/types/elements/gtk-entry.d.ts +20 -1
  49. package/lib/types/elements/gtk-expander.d.ts +49 -0
  50. package/lib/types/elements/gtk-fixed.d.ts +13 -0
  51. package/lib/types/elements/gtk-flow-box-child.d.ts +14 -0
  52. package/lib/types/elements/gtk-flow-box.d.ts +87 -0
  53. package/lib/types/elements/gtk-font-dialog-button.d.ts +83 -0
  54. package/lib/types/elements/gtk-frame.d.ts +24 -0
  55. package/lib/types/elements/gtk-gl-area.d.ts +136 -0
  56. package/lib/types/elements/gtk-graphics-offload.d.ts +24 -0
  57. package/lib/types/elements/gtk-grid-view.d.ts +39 -0
  58. package/lib/types/elements/gtk-grid.d.ts +27 -0
  59. package/lib/types/elements/gtk-header-bar.d.ts +60 -0
  60. package/lib/types/elements/gtk-inscription.d.ts +64 -0
  61. package/lib/types/elements/gtk-label.d.ts +3 -0
  62. package/lib/types/elements/gtk-level-bar.d.ts +59 -0
  63. package/lib/types/elements/gtk-link-button.d.ts +29 -0
  64. package/lib/types/elements/gtk-list-box-row.d.ts +54 -0
  65. package/lib/types/elements/gtk-list-box.d.ts +100 -0
  66. package/lib/types/elements/gtk-list-view.d.ts +73 -0
  67. package/lib/types/elements/gtk-media-controls.d.ts +142 -0
  68. package/lib/types/elements/gtk-notebook.d.ts +148 -0
  69. package/lib/types/elements/gtk-overlay.d.ts +22 -0
  70. package/lib/types/elements/gtk-page-setup-unix-dialog.d.ts +87 -0
  71. package/lib/types/elements/gtk-paned.d.ts +121 -0
  72. package/lib/types/elements/gtk-password-entry.d.ts +27 -0
  73. package/lib/types/elements/gtk-picture.d.ts +66 -0
  74. package/lib/types/elements/gtk-popover-bin.d.ts +82 -0
  75. package/lib/types/elements/gtk-popover-menu-bar.d.ts +66 -0
  76. package/lib/types/elements/gtk-popover-menu.d.ts +83 -0
  77. package/lib/types/elements/gtk-popover.d.ts +28 -3
  78. package/lib/types/elements/gtk-print-unix-dialog.d.ts +167 -0
  79. package/lib/types/elements/gtk-revealer.d.ts +55 -0
  80. package/lib/types/elements/gtk-scale-button.d.ts +59 -0
  81. package/lib/types/elements/gtk-scale.d.ts +98 -0
  82. package/lib/types/elements/gtk-scrollbar.d.ts +124 -0
  83. package/lib/types/elements/gtk-scrolled-window.d.ts +121 -0
  84. package/lib/types/elements/gtk-search-bar.d.ts +39 -0
  85. package/lib/types/elements/gtk-search-entry.d.ts +27 -0
  86. package/lib/types/elements/gtk-separator.d.ts +10 -0
  87. package/lib/types/elements/gtk-spin-button.d.ts +94 -0
  88. package/lib/types/elements/gtk-spinner.d.ts +14 -0
  89. package/lib/types/elements/gtk-stack-sidebar.d.ts +43 -0
  90. package/lib/types/elements/gtk-stack-switcher.d.ts +58 -0
  91. package/lib/types/elements/gtk-stack.d.ts +154 -0
  92. package/lib/types/elements/gtk-switch.d.ts +4 -1
  93. package/lib/types/elements/gtk-text-view.d.ts +62 -0
  94. package/lib/types/elements/gtk-text.d.ts +45 -0
  95. package/lib/types/elements/gtk-toggle-button.d.ts +45 -0
  96. package/lib/types/elements/gtk-tree-expander.d.ts +38 -0
  97. package/lib/types/elements/gtk-video.d.ts +97 -0
  98. package/lib/types/elements/gtk-viewport.d.ts +84 -0
  99. package/lib/types/elements/gtk-window-controls.d.ts +80 -0
  100. package/lib/types/elements/gtk-window-handle.d.ts +39 -0
  101. package/lib/types/elements/gtk-window.d.ts +97 -0
  102. package/lib/types/elements/justification.d.ts +2 -0
  103. package/lib/types/elements/popover-menu.d.ts +18 -0
  104. package/lib/types/elements/roving-focus.d.ts +29 -1
  105. package/lib/types/emoji-data.d.ts +38 -0
  106. package/lib/types/font-description.d.ts +96 -0
  107. package/lib/types/gtk-about-dialog.spec.d.ts +1 -0
  108. package/lib/types/gtk-action-bar.spec.d.ts +1 -0
  109. package/lib/types/gtk-application-window.spec.d.ts +1 -0
  110. package/lib/types/gtk-aspect-frame.spec.d.ts +1 -0
  111. package/lib/types/gtk-calendar.spec.d.ts +1 -0
  112. package/lib/types/gtk-center-box.spec.d.ts +1 -0
  113. package/lib/types/gtk-color-dialog-button.spec.d.ts +1 -0
  114. package/lib/types/gtk-column-view.spec.d.ts +1 -0
  115. package/lib/types/gtk-drag-icon.spec.d.ts +1 -0
  116. package/lib/types/gtk-drawing-area.spec.d.ts +1 -0
  117. package/lib/types/gtk-editable-label.spec.d.ts +1 -0
  118. package/lib/types/gtk-emoji-chooser.spec.d.ts +1 -0
  119. package/lib/types/gtk-expander.spec.d.ts +1 -0
  120. package/lib/types/gtk-fixed.spec.d.ts +1 -0
  121. package/lib/types/gtk-flow-box.spec.d.ts +1 -0
  122. package/lib/types/gtk-font-dialog-button.spec.d.ts +1 -0
  123. package/lib/types/gtk-frame.spec.d.ts +1 -0
  124. package/lib/types/gtk-gl-area.spec.d.ts +1 -0
  125. package/lib/types/gtk-graphics-offload.spec.d.ts +1 -0
  126. package/lib/types/gtk-grid-view.spec.d.ts +1 -0
  127. package/lib/types/gtk-grid.spec.d.ts +1 -0
  128. package/lib/types/gtk-header-bar.spec.d.ts +1 -0
  129. package/lib/types/gtk-inscription.spec.d.ts +1 -0
  130. package/lib/types/gtk-level-bar.spec.d.ts +1 -0
  131. package/lib/types/gtk-link-button.spec.d.ts +1 -0
  132. package/lib/types/gtk-list-box.spec.d.ts +1 -0
  133. package/lib/types/gtk-list-view.spec.d.ts +1 -0
  134. package/lib/types/gtk-media-controls.spec.d.ts +1 -0
  135. package/lib/types/gtk-notebook.spec.d.ts +1 -0
  136. package/lib/types/gtk-overlay.spec.d.ts +1 -0
  137. package/lib/types/gtk-paned.spec.d.ts +1 -0
  138. package/lib/types/gtk-password-entry.spec.d.ts +1 -0
  139. package/lib/types/gtk-picture.spec.d.ts +1 -0
  140. package/lib/types/gtk-popover-bin.spec.d.ts +1 -0
  141. package/lib/types/gtk-popover-menu-bar.spec.d.ts +1 -0
  142. package/lib/types/gtk-popover-menu.spec.d.ts +1 -0
  143. package/lib/types/gtk-popover-role.spec.d.ts +1 -0
  144. package/lib/types/gtk-popover.spec.d.ts +1 -0
  145. package/lib/types/gtk-print-dialogs.spec.d.ts +1 -0
  146. package/lib/types/gtk-revealer.spec.d.ts +1 -0
  147. package/lib/types/gtk-scale-button.spec.d.ts +1 -0
  148. package/lib/types/gtk-scale.spec.d.ts +1 -0
  149. package/lib/types/gtk-scrollbar.spec.d.ts +1 -0
  150. package/lib/types/gtk-scrolled-window.spec.d.ts +1 -0
  151. package/lib/types/gtk-search-bar.spec.d.ts +1 -0
  152. package/lib/types/gtk-search-entry.spec.d.ts +1 -0
  153. package/lib/types/gtk-separator.spec.d.ts +1 -0
  154. package/lib/types/gtk-spin-button.spec.d.ts +1 -0
  155. package/lib/types/gtk-spinner.spec.d.ts +1 -0
  156. package/lib/types/gtk-stack-sidebar.spec.d.ts +1 -0
  157. package/lib/types/gtk-stack-switcher.spec.d.ts +1 -0
  158. package/lib/types/gtk-stack.spec.d.ts +1 -0
  159. package/lib/types/gtk-text-view.spec.d.ts +1 -0
  160. package/lib/types/gtk-text.spec.d.ts +1 -0
  161. package/lib/types/gtk-toggle-button.spec.d.ts +1 -0
  162. package/lib/types/gtk-tree-expander.spec.d.ts +1 -0
  163. package/lib/types/gtk-video.spec.d.ts +1 -0
  164. package/lib/types/gtk-viewport.spec.d.ts +1 -0
  165. package/lib/types/gtk-window-controls.spec.d.ts +1 -0
  166. package/lib/types/gtk-window-handle.spec.d.ts +1 -0
  167. package/lib/types/gtk-window.spec.d.ts +1 -0
  168. package/lib/types/index.d.ts +4 -1
  169. package/lib/types/list-view-dom.d.ts +44 -0
  170. package/lib/types/namespace/adw.d.ts +12 -0
  171. package/lib/types/namespace/gtk.d.ts +61 -0
  172. package/lib/types/page-setup.d.ts +100 -0
  173. package/lib/types/scroll-shading.d.ts +15 -1
  174. package/lib/types/shared-tree-builder.d.ts +30 -2
  175. package/lib/types/signals.d.ts +4 -0
  176. package/lib/types/styles.generated.d.ts +1 -1
  177. package/lib/types/tab-chip.d.ts +73 -0
  178. package/lib/types/template-classes.d.ts +11 -0
  179. package/package.json +12 -8
  180. package/scss/_action_row.scss +2 -2
  181. package/scss/_application_window.scss +26 -0
  182. package/scss/_aspect_frame.scss +25 -0
  183. package/scss/_bin.scss +26 -0
  184. package/scss/_button.scss +45 -0
  185. package/scss/_calendar.scss +176 -0
  186. package/scss/_center_box.scss +25 -0
  187. package/scss/_checks.scss +6 -1
  188. package/scss/_clamp_scrollable.scss +28 -0
  189. package/scss/_color_button.scss +67 -0
  190. package/scss/_column_view.scss +126 -0
  191. package/scss/_drag_icon.scss +55 -0
  192. package/scss/_drawing.scss +85 -0
  193. package/scss/_emoji_chooser.scss +213 -0
  194. package/scss/_entry.scss +13 -5
  195. package/scss/_entry_row.scss +1 -1
  196. package/scss/_expander.scss +113 -0
  197. package/scss/_fixed.scss +29 -0
  198. package/scss/_flow_box.scss +94 -0
  199. package/scss/_font_button.scss +63 -0
  200. package/scss/_frame.scss +41 -0
  201. package/scss/_grid.scss +19 -0
  202. package/scss/_grid_view.scss +46 -0
  203. package/scss/_gtk_about_dialog.scss +186 -0
  204. package/scss/_headerbar.scss +132 -0
  205. package/scss/_icons.generated.scss +186 -0
  206. package/scss/_inscription.scss +125 -0
  207. package/scss/_level_bar.scss +190 -0
  208. package/scss/_link.scss +82 -0
  209. package/scss/_list_box.scss +88 -0
  210. package/scss/_list_view.scss +96 -0
  211. package/scss/_media_controls.scss +139 -0
  212. package/scss/_overlay.scss +68 -0
  213. package/scss/_paned.scss +130 -0
  214. package/scss/_password_entry.scss +83 -0
  215. package/scss/_picture.scss +80 -0
  216. package/scss/_popover_bin.scss +53 -0
  217. package/scss/_popover_menu_bar.scss +104 -0
  218. package/scss/_preferences_row.scss +51 -0
  219. package/scss/_print_dialogs.scss +328 -0
  220. package/scss/_reset.scss +21 -19
  221. package/scss/_revealer.scss +37 -0
  222. package/scss/_row.scss +20 -5
  223. package/scss/_scale.scss +298 -0
  224. package/scss/_scale_button.scss +167 -0
  225. package/scss/_scrollbar.scss +230 -0
  226. package/scss/_scrolled_window.scss +131 -0
  227. package/scss/_search_bar.scss +118 -0
  228. package/scss/_search_entry.scss +86 -0
  229. package/scss/_separator.scss +44 -0
  230. package/scss/_shortcuts_dialog.scss +100 -0
  231. package/scss/_spin_button.scss +172 -0
  232. package/scss/_spin_row.scss +56 -8
  233. package/scss/_spinner.scss +85 -4
  234. package/scss/_stack.scss +729 -0
  235. package/scss/_switch.scss +13 -5
  236. package/scss/_switch_row.scss +10 -0
  237. package/scss/_tab_bar.scss +317 -0
  238. package/scss/_tab_button.scss +98 -0
  239. package/scss/_tab_overview.scss +483 -0
  240. package/scss/_text.scss +182 -0
  241. package/scss/_theme.scss +1 -1
  242. package/scss/_tree_expander.scss +62 -0
  243. package/scss/_variables.scss +43 -21
  244. package/scss/_video.scss +146 -0
  245. package/scss/_view_switcher_sidebar.scss +112 -0
  246. package/scss/_viewport.scss +50 -0
  247. package/scss/_window.scss +118 -1
  248. package/scss/_window_handle.scss +20 -0
  249. package/scss/adwaita-skin.scss +109 -0
  250. package/src/adw-action-rows.spec.ts +76 -0
  251. package/src/adw-application-window.spec.ts +118 -0
  252. package/src/adw-bin.spec.ts +75 -0
  253. package/src/adw-breakpoint-bin.spec.ts +324 -0
  254. package/src/adw-clamp-scrollable.spec.ts +189 -0
  255. package/src/adw-multi-layout-view.spec.ts +243 -0
  256. package/src/adw-preferences-row.spec.ts +164 -0
  257. package/src/adw-row-state.spec.ts +142 -0
  258. package/src/adw-shortcuts.spec.ts +155 -0
  259. package/src/adw-tab-bar.spec.ts +287 -0
  260. package/src/adw-tab-button.spec.ts +101 -0
  261. package/src/adw-tab-overview.spec.ts +443 -0
  262. package/src/adw-view-switcher-sidebar.spec.ts +281 -0
  263. package/src/adw-window.spec.ts +129 -0
  264. package/src/breakpoints.ts +25 -8
  265. package/src/capabilities.d.mts +3 -0
  266. package/src/capabilities.mjs +18 -0
  267. package/src/connect-lifecycle.spec.ts +12 -0
  268. package/src/construct-vectors.spec.ts +175 -0
  269. package/src/elements/adw-application-window.ts +154 -0
  270. package/src/elements/adw-bin.ts +101 -0
  271. package/src/elements/adw-breakpoint-bin.ts +287 -0
  272. package/src/elements/adw-clamp-scrollable.ts +207 -0
  273. package/src/elements/adw-dialog.ts +19 -0
  274. package/src/elements/adw-layout-slot.ts +95 -0
  275. package/src/elements/adw-multi-layout-view.ts +326 -0
  276. package/src/elements/adw-preferences-row.ts +150 -0
  277. package/src/elements/adw-shortcuts-dialog.ts +52 -0
  278. package/src/elements/adw-shortcuts-item.ts +171 -0
  279. package/src/elements/adw-shortcuts-section.ts +86 -0
  280. package/src/elements/adw-sidebar.ts +42 -3
  281. package/src/elements/adw-switch-row.ts +28 -1
  282. package/src/elements/adw-tab-bar.ts +529 -0
  283. package/src/elements/adw-tab-button.ts +194 -0
  284. package/src/elements/adw-tab-overview.ts +1011 -0
  285. package/src/elements/adw-tab-view.ts +66 -145
  286. package/src/elements/adw-toggle-group.ts +20 -5
  287. package/src/elements/adw-view-stack.ts +18 -0
  288. package/src/elements/adw-view-switcher-sidebar.ts +332 -0
  289. package/src/elements/adw-window.ts +185 -11
  290. package/src/elements/checks.ts +35 -8
  291. package/src/elements/gtk-about-dialog.ts +811 -0
  292. package/src/elements/gtk-application-window.ts +108 -0
  293. package/src/elements/gtk-aspect-frame.ts +160 -0
  294. package/src/elements/gtk-button.ts +12 -0
  295. package/src/elements/gtk-calendar.ts +757 -0
  296. package/src/elements/gtk-center-box.ts +184 -0
  297. package/src/elements/gtk-color-dialog-button.ts +278 -0
  298. package/src/elements/gtk-column-view.ts +320 -0
  299. package/src/elements/gtk-drag-icon.ts +257 -0
  300. package/src/elements/gtk-drawing-area.ts +303 -0
  301. package/src/elements/gtk-editable-label.ts +204 -0
  302. package/src/elements/gtk-emoji-chooser.ts +542 -0
  303. package/src/elements/gtk-entry.ts +39 -5
  304. package/src/elements/gtk-expander.ts +301 -0
  305. package/src/elements/gtk-fixed.ts +99 -0
  306. package/src/elements/gtk-flow-box-child.ts +68 -0
  307. package/src/elements/gtk-flow-box.ts +480 -0
  308. package/src/elements/gtk-font-dialog-button.ts +432 -0
  309. package/src/elements/gtk-frame.ts +174 -0
  310. package/src/elements/gtk-gl-area.ts +476 -0
  311. package/src/elements/gtk-graphics-offload.ts +130 -0
  312. package/src/elements/gtk-grid-view.ts +168 -0
  313. package/src/elements/gtk-grid.ts +127 -0
  314. package/src/elements/gtk-header-bar.ts +273 -0
  315. package/src/elements/gtk-inscription.ts +387 -0
  316. package/src/elements/gtk-label.ts +19 -11
  317. package/src/elements/gtk-level-bar.ts +323 -0
  318. package/src/elements/gtk-link-button.ts +138 -0
  319. package/src/elements/gtk-list-box-row.ts +195 -0
  320. package/src/elements/gtk-list-box.ts +413 -0
  321. package/src/elements/gtk-list-view.ts +370 -0
  322. package/src/elements/gtk-media-controls.ts +509 -0
  323. package/src/elements/gtk-notebook.ts +664 -0
  324. package/src/elements/gtk-overlay.ts +149 -0
  325. package/src/elements/gtk-page-setup-unix-dialog.ts +420 -0
  326. package/src/elements/gtk-paned.ts +597 -0
  327. package/src/elements/gtk-password-entry.ts +170 -0
  328. package/src/elements/gtk-picture.ts +254 -0
  329. package/src/elements/gtk-popover-bin.ts +332 -0
  330. package/src/elements/gtk-popover-menu-bar.ts +355 -0
  331. package/src/elements/gtk-popover-menu.ts +339 -0
  332. package/src/elements/gtk-popover.ts +92 -10
  333. package/src/elements/gtk-print-unix-dialog.ts +989 -0
  334. package/src/elements/gtk-progress-bar.ts +24 -11
  335. package/src/elements/gtk-revealer.ts +406 -0
  336. package/src/elements/gtk-scale-button.ts +358 -0
  337. package/src/elements/gtk-scale.ts +492 -0
  338. package/src/elements/gtk-scrollbar.ts +528 -0
  339. package/src/elements/gtk-scrolled-window.ts +642 -0
  340. package/src/elements/gtk-search-bar.ts +200 -0
  341. package/src/elements/gtk-search-entry.ts +172 -0
  342. package/src/elements/gtk-separator.ts +52 -0
  343. package/src/elements/gtk-spin-button.ts +475 -0
  344. package/src/elements/gtk-spinner.ts +126 -0
  345. package/src/elements/gtk-stack-sidebar.ts +212 -0
  346. package/src/elements/gtk-stack-switcher.ts +279 -0
  347. package/src/elements/gtk-stack.ts +748 -0
  348. package/src/elements/gtk-switch.ts +52 -19
  349. package/src/elements/gtk-text-view.ts +290 -0
  350. package/src/elements/gtk-text.ts +219 -0
  351. package/src/elements/gtk-toggle-button.ts +239 -0
  352. package/src/elements/gtk-tree-expander.ts +243 -0
  353. package/src/elements/gtk-video.ts +423 -0
  354. package/src/elements/gtk-viewport.ts +277 -0
  355. package/src/elements/gtk-window-controls.ts +341 -0
  356. package/src/elements/gtk-window-handle.ts +221 -0
  357. package/src/elements/gtk-window.ts +366 -0
  358. package/src/elements/justification.ts +24 -0
  359. package/src/elements/popover-menu.ts +24 -0
  360. package/src/elements/roving-focus.ts +53 -21
  361. package/src/emoji-data.ts +577 -0
  362. package/src/entry-rows.spec.ts +31 -0
  363. package/src/font-description.ts +238 -0
  364. package/src/gtk-about-dialog.spec.ts +250 -0
  365. package/src/gtk-action-bar.spec.ts +89 -0
  366. package/src/gtk-application-window.spec.ts +107 -0
  367. package/src/gtk-aspect-frame.spec.ts +114 -0
  368. package/src/gtk-calendar.spec.ts +589 -0
  369. package/src/gtk-center-box.spec.ts +125 -0
  370. package/src/gtk-color-dialog-button.spec.ts +141 -0
  371. package/src/gtk-column-view.spec.ts +154 -0
  372. package/src/gtk-drag-icon.spec.ts +190 -0
  373. package/src/gtk-drawing-area.spec.ts +211 -0
  374. package/src/gtk-editable-label.spec.ts +190 -0
  375. package/src/gtk-emoji-chooser.spec.ts +173 -0
  376. package/src/gtk-entry.spec.ts +23 -0
  377. package/src/gtk-expander.spec.ts +170 -0
  378. package/src/gtk-fixed.spec.ts +97 -0
  379. package/src/gtk-flow-box.spec.ts +289 -0
  380. package/src/gtk-font-dialog-button.spec.ts +166 -0
  381. package/src/gtk-frame.spec.ts +119 -0
  382. package/src/gtk-gl-area.spec.ts +361 -0
  383. package/src/gtk-graphics-offload.spec.ts +119 -0
  384. package/src/gtk-grid-view.spec.ts +106 -0
  385. package/src/gtk-grid.spec.ts +122 -0
  386. package/src/gtk-header-bar.spec.ts +202 -0
  387. package/src/gtk-inscription.spec.ts +235 -0
  388. package/src/gtk-level-bar.spec.ts +199 -0
  389. package/src/gtk-link-button.spec.ts +117 -0
  390. package/src/gtk-list-box.spec.ts +422 -0
  391. package/src/gtk-list-view.spec.ts +203 -0
  392. package/src/gtk-media-controls.spec.ts +295 -0
  393. package/src/gtk-notebook.spec.ts +546 -0
  394. package/src/gtk-overlay.spec.ts +141 -0
  395. package/src/gtk-paned.spec.ts +267 -0
  396. package/src/gtk-password-entry.spec.ts +150 -0
  397. package/src/gtk-picture.spec.ts +172 -0
  398. package/src/gtk-popover-bin.spec.ts +229 -0
  399. package/src/gtk-popover-menu-bar.spec.ts +296 -0
  400. package/src/gtk-popover-menu.spec.ts +261 -0
  401. package/src/gtk-popover-role.spec.ts +138 -0
  402. package/src/gtk-popover.spec.ts +264 -0
  403. package/src/gtk-print-dialogs.spec.ts +251 -0
  404. package/src/gtk-revealer.spec.ts +164 -0
  405. package/src/gtk-scale-button.spec.ts +218 -0
  406. package/src/gtk-scale.spec.ts +213 -0
  407. package/src/gtk-scrollbar.spec.ts +244 -0
  408. package/src/gtk-scrolled-window.spec.ts +262 -0
  409. package/src/gtk-search-bar.spec.ts +179 -0
  410. package/src/gtk-search-entry.spec.ts +142 -0
  411. package/src/gtk-separator.spec.ts +74 -0
  412. package/src/gtk-spin-button.spec.ts +186 -0
  413. package/src/gtk-spinner.spec.ts +130 -0
  414. package/src/gtk-stack-sidebar.spec.ts +217 -0
  415. package/src/gtk-stack-switcher.spec.ts +249 -0
  416. package/src/gtk-stack.spec.ts +432 -0
  417. package/src/gtk-text-view.spec.ts +189 -0
  418. package/src/gtk-text.spec.ts +163 -0
  419. package/src/gtk-toggle-button.spec.ts +186 -0
  420. package/src/gtk-tree-expander.spec.ts +201 -0
  421. package/src/gtk-video.spec.ts +240 -0
  422. package/src/gtk-viewport.spec.ts +140 -0
  423. package/src/gtk-window-controls.spec.ts +232 -0
  424. package/src/gtk-window-handle.spec.ts +158 -0
  425. package/src/gtk-window.spec.ts +190 -0
  426. package/src/index.ts +9 -1
  427. package/src/keyboard-operable.spec.ts +33 -1
  428. package/src/list-view-dom.ts +121 -0
  429. package/src/namespace/adw.ts +12 -0
  430. package/src/namespace/gtk.ts +61 -0
  431. package/src/page-setup.ts +222 -0
  432. package/src/scroll-shading.ts +18 -1
  433. package/src/shared-tree-builder.ts +263 -21
  434. package/src/signals.ts +15 -0
  435. package/src/source-view/theme.ts +11 -5
  436. package/src/style-classes.spec.ts +9 -8
  437. package/src/styles.generated.ts +1 -1
  438. package/src/tab-chip.ts +200 -0
  439. package/src/template-classes.ts +45 -0
  440. package/src/test.browser.mts +152 -0
@@ -4,25 +4,38 @@
4
4
  // NO CORE STATE MACHINE: the whole behaviour is `CLAMP(fraction, 0, 1)` plus a pulsing
5
5
  // flag, and ADR 0004 is explicit that trivial behaviour gets no core class. The clamp
6
6
  // is still shared — `glibClamp` (GLib's CLAMP, high bound tested FIRST) comes from
7
- // `@gjsify/adwaita-core`.
7
+ // `@gjsify/adwaita-core` — and it is GTK's own: `gtk_progress_bar_set_fraction` stores
8
+ // `CLAMP (fraction, 0.0, 1.0)` (gtkprogressbar.c:783).
8
9
  //
9
- // `gtk_progress_bar_pulse()`'s step semantics (the `pulse-step` default, how the block
10
- // reflects at the ends, whether it resets `fraction`) are NOT reproduced: GtkProgressBar
11
- // is a GTK widget, `refs/gtk` is an uninitialized submodule here and libadwaita vendors
12
- // no `gtk-progress-bar.c`, so none of it is verifiable. What ships instead is the
13
- // vendored port's web idiom — a CSS keyframe animation that runs while `pulsing` is set
14
- // — so {@link GtkProgressBar.pulse} ENTERS that state and is idempotent afterwards. The
15
- // default `show-text` label `NN%` is likewise this port's, not GTK's format string.
10
+ // WHAT THE PULSE ACTUALLY IS, FROM THE C. `gtk_progress_bar_pulse` ENTERS "activity
11
+ // mode", and a frame-clock tick advances the block by `pulse-step` (default 0.1) per
12
+ // call, reversing at 0 and 1 and repeating until three periods pass without a pulse
13
+ // (gtkprogressbar.c:830-847, :655-692, :217-221, :473). Setting `fraction` LEAVES it
14
+ // (:791). That per-call stepping is not what ships: the indeterminate block here is the
15
+ // vendored port's CSS keyframe animation, which runs on a fixed period and is entered by
16
+ // `pulsing` — so {@link GtkProgressBar.pulse} enters that state and is idempotent
17
+ // afterwards, and `pulse-step` is a measured gap rather than a missing widget (see
18
+ // KNOWN_GAPS in `scripts/check-adwaita-element-properties.mjs`). The `:left` / `:right`
19
+ // / `:top` / `:bottom` classes GTK adds as the block touches an end
20
+ // (gtkprogressbar.c:74-89, :307-330) go with it; libadwaita never styles them.
21
+ //
22
+ // THE `NN%` LABEL IS GTK'S OWN FORMAT. `get_current_text` returns the `text` property
23
+ // when there is one and otherwise `C_("progress bar label", "%.0f %%")` of
24
+ // `fraction * 100` (gtkprogressbar.c:628-634) — so an explicit `text` wins and the
25
+ // percentage is the fallback, which is what {@link GtkProgressBar.text} returns.
16
26
  //
17
27
  // `osd` is libadwaita's `.osd` STYLE CLASS: a 2px troughless bar for under a header bar.
18
28
  //
19
29
  // A11Y: `role="progressbar"`, `aria-valuemin`/`aria-valuemax` fixed at 0/1,
20
- // `aria-valuenow` carrying the clamped fraction. While pulsing `aria-valuenow` is
21
- // REMOVED — that is how ARIA spells "indeterminate", and a stale value there would be
22
- // announced as real progress.
30
+ // `aria-valuenow` carrying the clamped fraction — the `GTK_ACCESSIBLE_PROPERTY_VALUE_*`
31
+ // trio `gtk_progress_bar_set_fraction` updates (gtkprogressbar.c:91-95, :795-799).
32
+ // While pulsing `aria-valuenow` is REMOVED — that is how ARIA spells "indeterminate",
33
+ // and a stale value there would be announced as real progress.
23
34
  //
35
+ // Reference: refs/gtk/gtk/gtkprogressbar.c:43-96,217-221,628-634,655-692,776-799,830-847
24
36
  // Reference: refs/libadwaita/src/stylesheet/widgets/_progress-bar.scss
25
37
  // Reference: refs/adwaita-web/adwaita-web/scss/_progressbar.scss (the indeterminate animation only)
38
+ // Copyright (c) The GTK Team. LGPLv2.1+.
26
39
  // Copyright (c) GNOME contributors (libadwaita). LGPLv2.1+.
27
40
  // Copyright (c) 2025 csm (adwaita-web). MIT License.
28
41
  // Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
@@ -0,0 +1,406 @@
1
+ // <gtk-revealer> — shows and hides its child with an animation.
2
+ //
3
+ // THREE attributes, two of them the animation's own vocabulary:
4
+ //
5
+ // reveal-child the direction flag. `true` animates the position to 1,
6
+ // `false` back to 0 (gtk_revealer_set_reveal_child).
7
+ // transition-type one of fourteen nicks (`slide-down` is the pspec default,
8
+ // gtkrevealer.c:120-128). Unknown leaves the default, the answer
9
+ // GtkBuilder gives an unrecognised enum nick.
10
+ // transition-duration milliseconds; `0` skips the animation altogether
11
+ // (gtk_revealer_start_animation, gtkrevealer.c:227-233).
12
+ //
13
+ // `child-revealed` is READ-ONLY and deliberately NOT the inverse of `reveal-child`:
14
+ // `gtk_revealer_get_child_revealed` (gtkrevealer.c:843-851) inverts it while an animation
15
+ // is RUNNING, so a revealer that is closing reports `true` until the position lands. That
16
+ // is the flag a caller waits on, and the one this element publishes.
17
+ //
18
+ // THE GEOMETRY IS THE C'S, AND NOT A CSS TRANSITION. `gtk_revealer_size_allocate`
19
+ // (gtkrevealer.c:449-598) does two things a `transition: transform` cannot:
20
+ //
21
+ // 1. it MEASURES the revealer at `child × scale` (gtk_revealer_measure,
22
+ // gtkrevealer.c:620-654: `ceil (minimum * scale)`) while ALLOCATING the child at its
23
+ // UNSCALED size, so the child renders at full size instead of ellipsizing — the
24
+ // comment there says why, and a scaled paint would get it exactly wrong. So the clip
25
+ // box below is sized to `ceil(natural × scale)` and the child inside it is never
26
+ // scaled, which is what `_clipEl`'s height/width is for.
27
+ // 2. it translates the child by the OVERFLOW (`width - child_width`), not by a
28
+ // percentage of the clip box. Both agree at the ends, and the pixel form is what the
29
+ // C writes.
30
+ //
31
+ // `get_child_size_scale` (gtkrevealer.c:144-186) is the whole of the axis question: a
32
+ // slide scales one axis by the position, a SWING scales it by `sin (π · pos / 2)` — the
33
+ // fold, which is why a swing's box grows like a square root and not linearly — and `none`
34
+ // / `crossfade` scale neither. Opacity comes from `get_is_fading_type`
35
+ // (gtkrevealer.c:189-210) and only WHILE the animation runs: `gtk_revealer_snapshot`
36
+ // (gtkrevealer.c:657-679) reads `animation_running = target_pos != current_pos` and turns the
37
+ // fade off the moment it stops, so a settled crossfade is opaque rather than left at
38
+ // whatever opacity it landed on.
39
+ //
40
+ // `effective_transition` (gtkrevealer.c:121-141) mirrors every left/right pair in an RTL
41
+ // row, so `slide-right` slides in from the visual right there — `:dir(rtl)` decides it,
42
+ // the same way `_widget.scss` decides which side an alignment's auto margin goes to.
43
+ //
44
+ // The revealer's own allocation is `natural × scale` on each axis, because that is what
45
+ // `gtk_revealer_size_allocate` received and passes straight on to the child
46
+ // (gtkrevealer.c:451-459); the perspective depth below is computed from those numbers
47
+ // rather than measured, which is both cheaper than a per-frame read and closer to the C.
48
+ //
49
+ // A11Y: `role="group"`, GtkRevealer's own role (gtkrevealer.c:58). The child is NEVER
50
+ // marked hidden — the doc section says it "is always available in the accessibility tree,
51
+ // regardless of the state of the revealer widget" (gtkrevealer.c:61-63), which is why the
52
+ // collapse is `overflow` clipping rather than `display: none` or `visibility: hidden`:
53
+ // both of those would take it out of the tree, and clipping does not.
54
+ //
55
+ // Reference: refs/gtk/gtk/gtkrevealer.c (every property, the transition table)
56
+ // Reference: refs/gtk/gtk/gtkprogresstracker.c (ease_out_cubic, the frame clock)
57
+ // Copyright (c) The GTK Team. LGPLv2.1+.
58
+ // Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
59
+
60
+ import { easeOutCubic } from '@gjsify/adwaita-core';
61
+
62
+ import { bindSlottedChildren } from '../slotted-children.js';
63
+
64
+ /** Every `GtkRevealerTransitionType` nick, in GIR order. */
65
+ const TRANSITION_TYPES = [
66
+ 'none',
67
+ 'crossfade',
68
+ 'slide-right',
69
+ 'slide-left',
70
+ 'slide-up',
71
+ 'slide-down',
72
+ 'swing-right',
73
+ 'swing-left',
74
+ 'swing-up',
75
+ 'swing-down',
76
+ 'fade-slide-right',
77
+ 'fade-slide-left',
78
+ 'fade-slide-up',
79
+ 'fade-slide-down',
80
+ ] as const;
81
+
82
+ export type RevealerTransitionType = (typeof TRANSITION_TYPES)[number];
83
+
84
+ /** `Gtk.Revealer:transition-type`'s pspec default — `GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN`. */
85
+ const DEFAULT_TRANSITION: RevealerTransitionType = 'slide-down';
86
+
87
+ /** `Gtk.Revealer:transition-duration`'s pspec default, in milliseconds. */
88
+ const DEFAULT_DURATION = 250;
89
+
90
+ /** `get_child_size_scale`'s two families, by the axis they scale (gtkrevealer.c:149-178). */
91
+ const HORIZONTAL_SLIDES: ReadonlySet<string> = new Set([
92
+ 'slide-right',
93
+ 'slide-left',
94
+ 'fade-slide-right',
95
+ 'fade-slide-left',
96
+ ]);
97
+ const VERTICAL_SLIDES: ReadonlySet<string> = new Set(['slide-up', 'slide-down', 'fade-slide-up', 'fade-slide-down']);
98
+ const HORIZONTAL_SWINGS: ReadonlySet<string> = new Set(['swing-right', 'swing-left']);
99
+ const VERTICAL_SWINGS: ReadonlySet<string> = new Set(['swing-up', 'swing-down']);
100
+ /** `get_is_fading_type` (gtkrevealer.c:189-210). */
101
+ const FADING: ReadonlySet<string> = new Set([
102
+ 'crossfade',
103
+ 'fade-slide-right',
104
+ 'fade-slide-left',
105
+ 'fade-slide-up',
106
+ 'fade-slide-down',
107
+ ]);
108
+
109
+ /** `effective_transition`'s RTL half (gtkrevealer.c:126-137). */
110
+ const RTL_FLIP: Partial<Record<RevealerTransitionType, RevealerTransitionType>> = {
111
+ 'slide-left': 'slide-right',
112
+ 'slide-right': 'slide-left',
113
+ 'swing-left': 'swing-right',
114
+ 'swing-right': 'swing-left',
115
+ 'fade-slide-left': 'fade-slide-right',
116
+ 'fade-slide-right': 'fade-slide-left',
117
+ };
118
+
119
+ export class GtkRevealer extends HTMLElement {
120
+ private _clipEl!: HTMLDivElement;
121
+ private _initialized = false;
122
+ /** `current_pos` — 0 hidden, 1 shown. */
123
+ private _position = 0;
124
+ /** `target_pos` — where the running animation is headed. */
125
+ private _target = 0;
126
+ private _frame = 0;
127
+ private _startedAt = 0;
128
+ /** The child's own size — `child_width` / `child_height` in the C. */
129
+ private _naturalWidth = 0;
130
+ private _naturalHeight = 0;
131
+ private _resize: ResizeObserver | null = null;
132
+
133
+ static get observedAttributes() {
134
+ return ['reveal-child', 'transition-type', 'transition-duration'];
135
+ }
136
+
137
+ /** `Gtk.Revealer:reveal-child` — whether the child should be revealed. */
138
+ get revealChild(): boolean {
139
+ return this.hasAttribute('reveal-child');
140
+ }
141
+
142
+ set revealChild(value: boolean) {
143
+ this.toggleAttribute('reveal-child', !!value);
144
+ }
145
+
146
+ /** `Gtk.Revealer:child-revealed` — read-only; the header says why it inverts. */
147
+ get childRevealed(): boolean {
148
+ return this._position === this._target ? this.revealChild : !this.revealChild;
149
+ }
150
+
151
+ /** `Gtk.Revealer:transition-type`. An unknown nick leaves `slide-down` in place. */
152
+ get transitionType(): RevealerTransitionType {
153
+ const raw = this.getAttribute('transition-type');
154
+ return (TRANSITION_TYPES as readonly unknown[]).includes(raw)
155
+ ? (raw as RevealerTransitionType)
156
+ : DEFAULT_TRANSITION;
157
+ }
158
+
159
+ set transitionType(value: RevealerTransitionType) {
160
+ this.setAttribute('transition-type', value);
161
+ }
162
+
163
+ /** `Gtk.Revealer:transition-duration`, in ms. An unparseable one is the default. */
164
+ get transitionDuration(): number {
165
+ const raw = Number.parseFloat(this.getAttribute('transition-duration') ?? '');
166
+ return Number.isFinite(raw) && raw >= 0 ? raw : DEFAULT_DURATION;
167
+ }
168
+
169
+ set transitionDuration(value: number) {
170
+ this.setAttribute('transition-duration', String(value));
171
+ }
172
+
173
+ /** `Gtk.Revealer:child` — the light-DOM node the clip box adopted. */
174
+ get child(): Element | null {
175
+ return this._clipEl?.firstElementChild ?? null;
176
+ }
177
+
178
+ connectedCallback() {
179
+ if (this._initialized) {
180
+ // The teardown below dropped the frame and the observer, so a re-parent has to
181
+ // re-arm them — see `scripts/check-adwaita-connect-rebind.mjs`.
182
+ this._observeChild();
183
+ this._render();
184
+ return;
185
+ }
186
+ this._initialized = true;
187
+
188
+ this.setAttribute('role', 'group');
189
+
190
+ this._clipEl = document.createElement('div');
191
+ this._clipEl.className = 'adw-revealer-clip';
192
+
193
+ // `Gtk.Revealer:child` is a widget PROPERTY, so an authored `child: …` names the
194
+ // slot by that name and the bare child is the default; both land in the clip box.
195
+ bindSlottedChildren(this, [{ name: 'child', into: this._clipEl }, { into: this._clipEl }], () =>
196
+ this._observeChild(),
197
+ ).install(this._clipEl);
198
+
199
+ this._observeChild();
200
+ // `reveal-child` is `G_PARAM_CONSTRUCT`, so a GtkBuilder `<property
201
+ // name="reveal-child">` reaches `gtk_revealer_set_reveal_child` at construction and
202
+ // the animation has already started by the time `connectedCallback` returns. A
203
+ // declared attribute therefore has to be applied here: `attributeChangedCallback` is
204
+ // guarded until the element is initialized, because it runs first during an upgrade.
205
+ this._animate(this.revealChild);
206
+ this._render();
207
+ }
208
+
209
+ disconnectedCallback() {
210
+ // `gtk_revealer_unmap` (gtkrevealer.c:390-405) finishes the animation and drops the
211
+ // tick callback; a widget taken out of the tree is unmapped, so this is the same
212
+ // event at the same point.
213
+ this._finish();
214
+ this._resize?.disconnect();
215
+ this._resize = null;
216
+ }
217
+
218
+ attributeChangedCallback(name: string, _old: string | null, value: string | null) {
219
+ if (!this._initialized) return;
220
+ if (name === 'reveal-child') {
221
+ // `start_animation` returns early when the TARGET is unchanged, so a rewrite of
222
+ // the same value notifies nothing — and neither does it move anything.
223
+ if (!this._animate(value !== null)) return;
224
+ this.dispatchEvent(
225
+ new CustomEvent('notify::reveal-child', {
226
+ bubbles: true,
227
+ detail: { revealChild: this.revealChild },
228
+ }),
229
+ );
230
+ return;
231
+ }
232
+ // `gtk_revealer_set_transition_type` / `_duration` take effect on the NEXT
233
+ // animation; a running one keeps the curve it started with, so only the geometry
234
+ // already on screen is recomputed.
235
+ this._render();
236
+ const detail =
237
+ name === 'transition-duration'
238
+ ? { transitionDuration: this.transitionDuration }
239
+ : { transitionType: this.transitionType };
240
+ this.dispatchEvent(new CustomEvent(`notify::${name}`, { bubbles: true, detail }));
241
+ }
242
+
243
+ /**
244
+ * Point the measurement at the CHILD, not at the clip box.
245
+ *
246
+ * The C asks the child for its requisition (gtkrevealer.c:140) and scales the result,
247
+ * so the child is the subject; observing the clip box instead would report the ALREADY
248
+ * SCALED box, and the scale would then be applied twice.
249
+ */
250
+ private _observeChild(): void {
251
+ this._resize?.disconnect();
252
+ this._resize = new ResizeObserver((entries) => {
253
+ for (const entry of entries) {
254
+ const box = entry.borderBoxSize?.[0];
255
+ this._naturalWidth = box ? box.inlineSize : entry.contentRect.width;
256
+ this._naturalHeight = box ? box.blockSize : entry.contentRect.height;
257
+ }
258
+ this._render();
259
+ });
260
+ this._resize.observe(this._clipEl);
261
+ const child = this._clipEl.firstElementChild;
262
+ if (child) this._resize.observe(child);
263
+ }
264
+
265
+ /** `gtk_revealer_start_animation` (gtkrevealer.c:275-322). `@returns` whether it moved. */
266
+ private _animate(reveal: boolean): boolean {
267
+ const next = reveal ? 1 : 0;
268
+ if (this._target === next) return false;
269
+ this._target = next;
270
+
271
+ const type = this.effectiveTransition;
272
+ // `gtk-interface-reduced-motion` and `gtk-enable-animations` are the two settings
273
+ // `start_animation` consults; a browser has the first as a media query and no
274
+ // second, so the query is read once per animation and no listener is kept.
275
+ const reduced = globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;
276
+ if (this.transitionDuration === 0 || type === 'none' || reduced || !this.isConnected) {
277
+ this._finish();
278
+ this._setPosition(next);
279
+ return true;
280
+ }
281
+
282
+ const source = this._position;
283
+ this._startedAt = performance.now();
284
+ if (this._frame === 0) this._frame = requestAnimationFrame(() => this._tick(source));
285
+ return true;
286
+ }
287
+
288
+ /** `gtk_revealer_animate_cb` (gtkrevealer.c:255-272). */
289
+ private _tick(source: number): void {
290
+ this._frame = 0;
291
+ const duration = this.transitionDuration;
292
+ const elapsed = performance.now() - this._startedAt;
293
+ // `gtk_progress_tracker_get_progress` is `iteration - iteration_cycle`, so the
294
+ // fraction runs 0…1 over the whole duration and the ease is applied to THAT.
295
+ const progress = duration <= 0 ? 1 : Math.min(1, elapsed / duration);
296
+ const ease = easeOutCubic(progress);
297
+ this._setPosition(source + ease * (this._target - source));
298
+ if (progress < 1) this._frame = requestAnimationFrame(() => this._tick(source));
299
+ }
300
+
301
+ private _finish(): void {
302
+ if (this._frame !== 0) {
303
+ cancelAnimationFrame(this._frame);
304
+ this._frame = 0;
305
+ }
306
+ }
307
+
308
+ /** `effective_transition` (gtkrevealer.c:121-141). */
309
+ private get effectiveTransition(): RevealerTransitionType {
310
+ const type = this.transitionType;
311
+ return this.matches(':dir(rtl)') ? (RTL_FLIP[type] ?? type) : type;
312
+ }
313
+
314
+ /** `get_child_size_scale` (gtkrevealer.c:144-186) for one axis. */
315
+ private _scale(axis: 'horizontal' | 'vertical'): number {
316
+ const type = this.effectiveTransition;
317
+ const slides = axis === 'horizontal' ? HORIZONTAL_SLIDES : VERTICAL_SLIDES;
318
+ const swings = axis === 'horizontal' ? HORIZONTAL_SWINGS : VERTICAL_SWINGS;
319
+ if (slides.has(type)) return this._position;
320
+ if (swings.has(type)) return Math.sin((Math.PI * this._position) / 2);
321
+ return 1;
322
+ }
323
+
324
+ /** `gtk_revealer_set_position` (gtkrevealer.c:212-251). */
325
+ private _setPosition(position: number): void {
326
+ this._position = position;
327
+ this._render();
328
+ if (this._position === this._target) {
329
+ this.dispatchEvent(
330
+ new CustomEvent('notify::child-revealed', {
331
+ bubbles: true,
332
+ detail: { childRevealed: this.childRevealed },
333
+ }),
334
+ );
335
+ }
336
+ }
337
+
338
+ private _render(): void {
339
+ const child = this._clipEl.firstElementChild as HTMLElement | null;
340
+ // The ResizeObserver delivers asynchronously, so a reveal started in the same task
341
+ // that adopted the child would measure zero. One synchronous read, and only while
342
+ // the recorded size is still the initial zero.
343
+ if (child && this._naturalHeight === 0) {
344
+ this._naturalWidth = child.offsetWidth;
345
+ this._naturalHeight = child.offsetHeight;
346
+ }
347
+ const position = this._position;
348
+ const hscale = this._scale('horizontal');
349
+ const vscale = this._scale('vertical');
350
+ const type = this.effectiveTransition;
351
+
352
+ // `gtk_revealer_measure`: `ceil (minimum * scale)`. A scale of 1 leaves the box
353
+ // `auto`, which is what makes a crossfade a pure opacity change with no layout in it.
354
+ this._clipEl.style.width = hscale < 1 ? `${Math.ceil(this._naturalWidth * hscale)}px` : '';
355
+ this._clipEl.style.height = vscale < 1 ? `${Math.ceil(this._naturalHeight * vscale)}px` : '';
356
+
357
+ if (child) {
358
+ // `gtk_widget_allocate (child, child_width, child_height, -1, transform)` — the
359
+ // transform chain of gtkrevealer.c:520-598, in the same order, in CSS, about
360
+ // the child's own origin because `transform-origin: 0 0` drops the reference-box
361
+ // offset a GskTransform chain does not have.
362
+ const childWidth = this._naturalWidth;
363
+ const childHeight = this._naturalHeight;
364
+ const width = childWidth * hscale;
365
+ const height = childHeight * vscale;
366
+ const depth = 2 * Math.max(width, height);
367
+ const turns = 90 * (1 - position);
368
+ let transform = '';
369
+ switch (type) {
370
+ case 'slide-right':
371
+ case 'fade-slide-right':
372
+ transform = `translateX(${width - childWidth}px)`;
373
+ break;
374
+ case 'slide-down':
375
+ case 'fade-slide-down':
376
+ transform = `translateY(${height - childHeight}px)`;
377
+ break;
378
+ case 'swing-right':
379
+ transform = `translate(0, ${height / 2}px) perspective(${depth}px) rotateY(${turns}deg) translate(0, ${-childHeight / 2}px)`;
380
+ break;
381
+ case 'swing-left':
382
+ transform = `translate(${width}px, ${height / 2}px) perspective(${depth}px) rotateY(${-turns}deg) translate(${-childWidth}px, ${-childHeight / 2}px)`;
383
+ break;
384
+ case 'swing-down':
385
+ transform = `translate(${width / 2}px, 0) perspective(${depth}px) rotateX(${-turns}deg) translate(${-childWidth / 2}px, 0)`;
386
+ break;
387
+ case 'swing-up':
388
+ transform = `translate(${width / 2}px, ${height}px) perspective(${depth}px) rotateX(${turns}deg) translate(${-childWidth / 2}px, ${-childHeight}px)`;
389
+ break;
390
+ default:
391
+ // `slide-left`, `slide-up` and everything without a transform of its own
392
+ // fall through the C's switch unchanged.
393
+ break;
394
+ }
395
+ child.style.transform = transform;
396
+ // `transform-origin: 0 0` is the GskTransform composition point, and only a
397
+ // chain that needs it (the swings) has one.
398
+ child.style.transformOrigin = transform === '' ? '' : '0 0';
399
+ child.style.opacity = FADING.has(type) ? String(position) : '';
400
+ }
401
+
402
+ this.classList.toggle('revealed', position > 0);
403
+ }
404
+ }
405
+
406
+ customElements.define('gtk-revealer', GtkRevealer);