@gjsify/adwaita-web 0.54.0 → 0.56.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.
- package/README.md +8 -0
- package/dist/adwaita-web.css +8146 -3011
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/adw-application-window.spec.d.ts +1 -0
- package/lib/types/adw-bin.spec.d.ts +1 -0
- package/lib/types/adw-breakpoint-bin.spec.d.ts +1 -0
- package/lib/types/adw-clamp-scrollable.spec.d.ts +1 -0
- package/lib/types/adw-multi-layout-view.spec.d.ts +1 -0
- package/lib/types/adw-preferences-row.spec.d.ts +1 -0
- package/lib/types/adw-shortcuts.spec.d.ts +1 -0
- package/lib/types/adw-status-page.spec.d.ts +1 -0
- package/lib/types/adw-tab-bar.spec.d.ts +1 -0
- package/lib/types/adw-tab-button.spec.d.ts +1 -0
- package/lib/types/adw-tab-overview.spec.d.ts +1 -0
- package/lib/types/adw-view-switcher-sidebar.spec.d.ts +1 -0
- package/lib/types/adw-window.spec.d.ts +1 -0
- package/lib/types/attributes.d.ts +19 -0
- package/lib/types/breakpoints.d.ts +14 -3
- package/lib/types/construct-vectors.spec.d.ts +1 -0
- package/lib/types/elements/adw-action-row.d.ts +4 -0
- package/lib/types/elements/adw-application-window.d.ts +27 -0
- package/lib/types/elements/adw-bin.d.ts +17 -0
- package/lib/types/elements/adw-breakpoint-bin.d.ts +67 -0
- package/lib/types/elements/adw-clamp-scrollable.d.ts +38 -0
- package/lib/types/elements/adw-combo-row.d.ts +4 -0
- package/lib/types/elements/adw-dialog.d.ts +10 -0
- package/lib/types/elements/adw-entry-row.d.ts +6 -0
- package/lib/types/elements/adw-expander-row.d.ts +2 -0
- package/lib/types/elements/adw-header-bar.d.ts +6 -0
- package/lib/types/elements/adw-layout-slot.d.ts +19 -0
- package/lib/types/elements/adw-multi-layout-view.d.ts +101 -0
- package/lib/types/elements/adw-overlay-split-view.d.ts +13 -0
- package/lib/types/elements/adw-preferences-row.d.ts +31 -0
- package/lib/types/elements/adw-shortcuts-dialog.d.ts +13 -0
- package/lib/types/elements/adw-shortcuts-item.d.ts +36 -0
- package/lib/types/elements/adw-shortcuts-section.d.ts +14 -0
- package/lib/types/elements/adw-sidebar.d.ts +8 -2
- package/lib/types/elements/adw-spin-row.d.ts +6 -0
- package/lib/types/elements/adw-switch-row.d.ts +7 -0
- package/lib/types/elements/adw-tab-bar.d.ts +108 -0
- package/lib/types/elements/adw-tab-button.d.ts +32 -0
- package/lib/types/elements/adw-tab-overview.d.ts +199 -0
- package/lib/types/elements/adw-tab-view.d.ts +19 -23
- package/lib/types/elements/adw-toggle-group.d.ts +17 -0
- package/lib/types/elements/adw-view-switcher-sidebar.d.ts +84 -0
- package/lib/types/elements/adw-window.d.ts +40 -0
- package/lib/types/elements/gtk-about-dialog.d.ts +146 -0
- package/lib/types/elements/gtk-application-window.d.ts +34 -0
- package/lib/types/elements/gtk-aspect-frame.d.ts +27 -0
- package/lib/types/elements/gtk-button.d.ts +9 -0
- package/lib/types/elements/gtk-calendar.d.ts +159 -0
- package/lib/types/elements/gtk-center-box.d.ts +39 -0
- package/lib/types/elements/gtk-color-dialog-button.d.ts +69 -0
- package/lib/types/elements/gtk-column-view.d.ts +50 -0
- package/lib/types/elements/gtk-drag-icon.d.ts +78 -0
- package/lib/types/elements/gtk-drawing-area.d.ts +95 -0
- package/lib/types/elements/gtk-editable-label.d.ts +33 -0
- package/lib/types/elements/gtk-emoji-chooser.d.ts +84 -0
- package/lib/types/elements/gtk-entry.d.ts +20 -1
- package/lib/types/elements/gtk-expander.d.ts +49 -0
- package/lib/types/elements/gtk-fixed.d.ts +13 -0
- package/lib/types/elements/gtk-flow-box-child.d.ts +14 -0
- package/lib/types/elements/gtk-flow-box.d.ts +87 -0
- package/lib/types/elements/gtk-font-dialog-button.d.ts +83 -0
- package/lib/types/elements/gtk-frame.d.ts +24 -0
- package/lib/types/elements/gtk-gl-area.d.ts +136 -0
- package/lib/types/elements/gtk-graphics-offload.d.ts +24 -0
- package/lib/types/elements/gtk-grid-view.d.ts +39 -0
- package/lib/types/elements/gtk-grid.d.ts +27 -0
- package/lib/types/elements/gtk-header-bar.d.ts +60 -0
- package/lib/types/elements/gtk-inscription.d.ts +64 -0
- package/lib/types/elements/gtk-label.d.ts +3 -0
- package/lib/types/elements/gtk-level-bar.d.ts +59 -0
- package/lib/types/elements/gtk-link-button.d.ts +29 -0
- package/lib/types/elements/gtk-list-box-row.d.ts +54 -0
- package/lib/types/elements/gtk-list-box.d.ts +100 -0
- package/lib/types/elements/gtk-list-view.d.ts +73 -0
- package/lib/types/elements/gtk-media-controls.d.ts +142 -0
- package/lib/types/elements/gtk-notebook.d.ts +148 -0
- package/lib/types/elements/gtk-overlay.d.ts +22 -0
- package/lib/types/elements/gtk-page-setup-unix-dialog.d.ts +87 -0
- package/lib/types/elements/gtk-paned.d.ts +121 -0
- package/lib/types/elements/gtk-password-entry.d.ts +27 -0
- package/lib/types/elements/gtk-picture.d.ts +66 -0
- package/lib/types/elements/gtk-popover-bin.d.ts +82 -0
- package/lib/types/elements/gtk-popover-menu-bar.d.ts +66 -0
- package/lib/types/elements/gtk-popover-menu.d.ts +83 -0
- package/lib/types/elements/gtk-popover.d.ts +28 -3
- package/lib/types/elements/gtk-print-unix-dialog.d.ts +167 -0
- package/lib/types/elements/gtk-revealer.d.ts +55 -0
- package/lib/types/elements/gtk-scale-button.d.ts +59 -0
- package/lib/types/elements/gtk-scale.d.ts +98 -0
- package/lib/types/elements/gtk-scrollbar.d.ts +124 -0
- package/lib/types/elements/gtk-scrolled-window.d.ts +129 -0
- package/lib/types/elements/gtk-search-bar.d.ts +39 -0
- package/lib/types/elements/gtk-search-entry.d.ts +27 -0
- package/lib/types/elements/gtk-separator.d.ts +10 -0
- package/lib/types/elements/gtk-spin-button.d.ts +94 -0
- package/lib/types/elements/gtk-spinner.d.ts +14 -0
- package/lib/types/elements/gtk-stack-sidebar.d.ts +43 -0
- package/lib/types/elements/gtk-stack-switcher.d.ts +58 -0
- package/lib/types/elements/gtk-stack.d.ts +154 -0
- package/lib/types/elements/gtk-switch.d.ts +4 -1
- package/lib/types/elements/gtk-text-view.d.ts +62 -0
- package/lib/types/elements/gtk-text.d.ts +45 -0
- package/lib/types/elements/gtk-toggle-button.d.ts +45 -0
- package/lib/types/elements/gtk-tree-expander.d.ts +38 -0
- package/lib/types/elements/gtk-video.d.ts +97 -0
- package/lib/types/elements/gtk-viewport.d.ts +84 -0
- package/lib/types/elements/gtk-window-controls.d.ts +80 -0
- package/lib/types/elements/gtk-window-handle.d.ts +39 -0
- package/lib/types/elements/gtk-window.d.ts +103 -0
- package/lib/types/elements/justification.d.ts +2 -0
- package/lib/types/elements/popover-menu.d.ts +18 -0
- package/lib/types/elements/roving-focus.d.ts +29 -1
- package/lib/types/emoji-data.d.ts +38 -0
- package/lib/types/font-description.d.ts +96 -0
- package/lib/types/gtk-about-dialog.spec.d.ts +1 -0
- package/lib/types/gtk-action-bar.spec.d.ts +1 -0
- package/lib/types/gtk-application-window.spec.d.ts +1 -0
- package/lib/types/gtk-aspect-frame.spec.d.ts +1 -0
- package/lib/types/gtk-calendar.spec.d.ts +1 -0
- package/lib/types/gtk-center-box.spec.d.ts +1 -0
- package/lib/types/gtk-color-dialog-button.spec.d.ts +1 -0
- package/lib/types/gtk-column-view.spec.d.ts +1 -0
- package/lib/types/gtk-drag-icon.spec.d.ts +1 -0
- package/lib/types/gtk-drawing-area.spec.d.ts +1 -0
- package/lib/types/gtk-editable-label.spec.d.ts +1 -0
- package/lib/types/gtk-emoji-chooser.spec.d.ts +1 -0
- package/lib/types/gtk-expander.spec.d.ts +1 -0
- package/lib/types/gtk-fixed.spec.d.ts +1 -0
- package/lib/types/gtk-flow-box.spec.d.ts +1 -0
- package/lib/types/gtk-font-dialog-button.spec.d.ts +1 -0
- package/lib/types/gtk-frame.spec.d.ts +1 -0
- package/lib/types/gtk-gl-area.spec.d.ts +1 -0
- package/lib/types/gtk-graphics-offload.spec.d.ts +1 -0
- package/lib/types/gtk-grid-view.spec.d.ts +1 -0
- package/lib/types/gtk-grid.spec.d.ts +1 -0
- package/lib/types/gtk-header-bar.spec.d.ts +1 -0
- package/lib/types/gtk-inscription.spec.d.ts +1 -0
- package/lib/types/gtk-level-bar.spec.d.ts +1 -0
- package/lib/types/gtk-link-button.spec.d.ts +1 -0
- package/lib/types/gtk-list-box.spec.d.ts +1 -0
- package/lib/types/gtk-list-view.spec.d.ts +1 -0
- package/lib/types/gtk-media-controls.spec.d.ts +1 -0
- package/lib/types/gtk-notebook.spec.d.ts +1 -0
- package/lib/types/gtk-overlay.spec.d.ts +1 -0
- package/lib/types/gtk-paned.spec.d.ts +1 -0
- package/lib/types/gtk-password-entry.spec.d.ts +1 -0
- package/lib/types/gtk-picture.spec.d.ts +1 -0
- package/lib/types/gtk-popover-bin.spec.d.ts +1 -0
- package/lib/types/gtk-popover-menu-bar.spec.d.ts +1 -0
- package/lib/types/gtk-popover-menu.spec.d.ts +1 -0
- package/lib/types/gtk-popover-role.spec.d.ts +1 -0
- package/lib/types/gtk-popover.spec.d.ts +1 -0
- package/lib/types/gtk-print-dialogs.spec.d.ts +1 -0
- package/lib/types/gtk-revealer.spec.d.ts +1 -0
- package/lib/types/gtk-scale-button.spec.d.ts +1 -0
- package/lib/types/gtk-scale.spec.d.ts +1 -0
- package/lib/types/gtk-scrollbar.spec.d.ts +1 -0
- package/lib/types/gtk-scrolled-window.spec.d.ts +1 -0
- package/lib/types/gtk-search-bar.spec.d.ts +1 -0
- package/lib/types/gtk-search-entry.spec.d.ts +1 -0
- package/lib/types/gtk-separator.spec.d.ts +1 -0
- package/lib/types/gtk-spin-button.spec.d.ts +1 -0
- package/lib/types/gtk-spinner.spec.d.ts +1 -0
- package/lib/types/gtk-stack-sidebar.spec.d.ts +1 -0
- package/lib/types/gtk-stack-switcher.spec.d.ts +1 -0
- package/lib/types/gtk-stack.spec.d.ts +1 -0
- package/lib/types/gtk-text-view.spec.d.ts +1 -0
- package/lib/types/gtk-text.spec.d.ts +1 -0
- package/lib/types/gtk-toggle-button.spec.d.ts +1 -0
- package/lib/types/gtk-tree-expander.spec.d.ts +1 -0
- package/lib/types/gtk-video.spec.d.ts +1 -0
- package/lib/types/gtk-viewport.spec.d.ts +1 -0
- package/lib/types/gtk-window-controls.spec.d.ts +1 -0
- package/lib/types/gtk-window-handle.spec.d.ts +1 -0
- package/lib/types/gtk-window.spec.d.ts +1 -0
- package/lib/types/index.d.ts +4 -1
- package/lib/types/list-view-dom.d.ts +44 -0
- package/lib/types/namespace/adw.d.ts +12 -0
- package/lib/types/namespace/gtk.d.ts +61 -0
- package/lib/types/page-setup.d.ts +100 -0
- package/lib/types/row-line-clamp.d.ts +20 -0
- package/lib/types/row-tooltip.d.ts +8 -0
- package/lib/types/row-tooltip.spec.d.ts +1 -0
- package/lib/types/scroll-shading.d.ts +15 -1
- package/lib/types/shared-tree-builder.d.ts +75 -17
- package/lib/types/shared-tree-mount.spec.d.ts +1 -0
- package/lib/types/signals.d.ts +4 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/lib/types/tab-chip.d.ts +73 -0
- package/lib/types/template-classes.d.ts +11 -0
- package/lib/types/widget-size.spec.d.ts +1 -0
- package/package.json +12 -8
- package/scss/_action_row.scss +41 -17
- package/scss/_application_window.scss +26 -0
- package/scss/_aspect_frame.scss +25 -0
- package/scss/_bin.scss +26 -0
- package/scss/_button.scss +45 -0
- package/scss/_button_row.scss +5 -0
- package/scss/_calendar.scss +176 -0
- package/scss/_center_box.scss +25 -0
- package/scss/_checks.scss +6 -1
- package/scss/_clamp_scrollable.scss +28 -0
- package/scss/_color_button.scss +67 -0
- package/scss/_column_view.scss +126 -0
- package/scss/_drag_icon.scss +55 -0
- package/scss/_drawing.scss +85 -0
- package/scss/_emoji_chooser.scss +213 -0
- package/scss/_entry.scss +13 -5
- package/scss/_entry_row.scss +1 -1
- package/scss/_expander.scss +113 -0
- package/scss/_expander_row.scss +36 -3
- package/scss/_fixed.scss +29 -0
- package/scss/_flow_box.scss +94 -0
- package/scss/_font_button.scss +63 -0
- package/scss/_frame.scss +41 -0
- package/scss/_grid.scss +19 -0
- package/scss/_grid_view.scss +46 -0
- package/scss/_gtk_about_dialog.scss +186 -0
- package/scss/_headerbar.scss +134 -1
- package/scss/_icons.generated.scss +186 -0
- package/scss/_inscription.scss +125 -0
- package/scss/_level_bar.scss +190 -0
- package/scss/_link.scss +82 -0
- package/scss/_list_box.scss +88 -0
- package/scss/_list_view.scss +96 -0
- package/scss/_media_controls.scss +139 -0
- package/scss/_overlay.scss +68 -0
- package/scss/_paned.scss +130 -0
- package/scss/_password_entry.scss +83 -0
- package/scss/_picture.scss +80 -0
- package/scss/_popover_bin.scss +53 -0
- package/scss/_popover_menu_bar.scss +104 -0
- package/scss/_preferences_row.scss +60 -0
- package/scss/_print_dialogs.scss +328 -0
- package/scss/_reset.scss +21 -19
- package/scss/_revealer.scss +37 -0
- package/scss/_row.scss +36 -5
- package/scss/_scale.scss +298 -0
- package/scss/_scale_button.scss +167 -0
- package/scss/_scrollbar.scss +230 -0
- package/scss/_scrolled_window.scss +131 -0
- package/scss/_search_bar.scss +118 -0
- package/scss/_search_entry.scss +86 -0
- package/scss/_separator.scss +44 -0
- package/scss/_shortcuts_dialog.scss +100 -0
- package/scss/_spin_button.scss +172 -0
- package/scss/_spin_row.scss +56 -8
- package/scss/_spinner.scss +85 -4
- package/scss/_stack.scss +729 -0
- package/scss/_status_page.scss +1 -1
- package/scss/_switch.scss +13 -5
- package/scss/_switch_row.scss +10 -0
- package/scss/_tab_bar.scss +317 -0
- package/scss/_tab_button.scss +98 -0
- package/scss/_tab_overview.scss +483 -0
- package/scss/_text.scss +182 -0
- package/scss/_theme.scss +1 -1
- package/scss/_toggle_group.scss +28 -0
- package/scss/_tree_expander.scss +62 -0
- package/scss/_variables.scss +1 -1
- package/scss/_video.scss +146 -0
- package/scss/_view_switcher_sidebar.scss +112 -0
- package/scss/_viewport.scss +50 -0
- package/scss/_widget.scss +14 -3
- package/scss/_window.scss +131 -2
- package/scss/_window_handle.scss +20 -0
- package/scss/adwaita-skin.scss +109 -0
- package/src/adw-action-rows.spec.ts +331 -0
- package/src/adw-application-window.spec.ts +118 -0
- package/src/adw-bin.spec.ts +75 -0
- package/src/adw-breakpoint-bin.spec.ts +324 -0
- package/src/adw-clamp-scrollable.spec.ts +189 -0
- package/src/adw-header-bar.spec.ts +18 -0
- package/src/adw-multi-layout-view.spec.ts +243 -0
- package/src/adw-preferences-row.spec.ts +164 -0
- package/src/adw-row-state.spec.ts +142 -0
- package/src/adw-shortcuts.spec.ts +155 -0
- package/src/adw-status-page.spec.ts +124 -0
- package/src/adw-tab-bar.spec.ts +287 -0
- package/src/adw-tab-button.spec.ts +101 -0
- package/src/adw-tab-overview.spec.ts +443 -0
- package/src/adw-view-switcher-sidebar.spec.ts +281 -0
- package/src/adw-window.spec.ts +129 -0
- package/src/attributes.ts +52 -0
- package/src/breakpoints.ts +25 -8
- package/src/capabilities.d.mts +3 -0
- package/src/capabilities.mjs +21 -0
- package/src/connect-lifecycle.spec.ts +12 -0
- package/src/construct-vectors.spec.ts +175 -0
- package/src/elements/adw-action-row.ts +31 -2
- package/src/elements/adw-alert-dialog.ts +4 -1
- package/src/elements/adw-application-window.ts +154 -0
- package/src/elements/adw-bin.ts +101 -0
- package/src/elements/adw-breakpoint-bin.ts +287 -0
- package/src/elements/adw-button-row.ts +7 -1
- package/src/elements/adw-clamp-scrollable.ts +207 -0
- package/src/elements/adw-combo-row.ts +26 -1
- package/src/elements/adw-dialog.ts +19 -0
- package/src/elements/adw-entry-row.ts +22 -12
- package/src/elements/adw-expander-row.ts +34 -1
- package/src/elements/adw-header-bar.ts +18 -4
- package/src/elements/adw-layout-slot.ts +95 -0
- package/src/elements/adw-multi-layout-view.ts +326 -0
- package/src/elements/adw-overlay-split-view.ts +29 -6
- package/src/elements/adw-preferences-row.ts +153 -0
- package/src/elements/adw-shortcuts-dialog.ts +52 -0
- package/src/elements/adw-shortcuts-item.ts +171 -0
- package/src/elements/adw-shortcuts-section.ts +86 -0
- package/src/elements/adw-sidebar.ts +74 -7
- package/src/elements/adw-spin-row.ts +37 -2
- package/src/elements/adw-status-page.ts +10 -2
- package/src/elements/adw-switch-row.ts +53 -2
- package/src/elements/adw-tab-bar.ts +529 -0
- package/src/elements/adw-tab-button.ts +194 -0
- package/src/elements/adw-tab-overview.ts +1011 -0
- package/src/elements/adw-tab-view.ts +66 -145
- package/src/elements/adw-toggle-group.ts +138 -14
- package/src/elements/adw-view-stack.ts +18 -0
- package/src/elements/adw-view-switcher-sidebar.ts +332 -0
- package/src/elements/adw-window.ts +190 -11
- package/src/elements/checks.ts +35 -8
- package/src/elements/gtk-about-dialog.ts +811 -0
- package/src/elements/gtk-application-window.ts +108 -0
- package/src/elements/gtk-aspect-frame.ts +160 -0
- package/src/elements/gtk-button.ts +12 -0
- package/src/elements/gtk-calendar.ts +757 -0
- package/src/elements/gtk-center-box.ts +184 -0
- package/src/elements/gtk-color-dialog-button.ts +278 -0
- package/src/elements/gtk-column-view.ts +320 -0
- package/src/elements/gtk-drag-icon.ts +257 -0
- package/src/elements/gtk-drawing-area.ts +303 -0
- package/src/elements/gtk-editable-label.ts +204 -0
- package/src/elements/gtk-emoji-chooser.ts +542 -0
- package/src/elements/gtk-entry.ts +39 -5
- package/src/elements/gtk-expander.ts +301 -0
- package/src/elements/gtk-fixed.ts +99 -0
- package/src/elements/gtk-flow-box-child.ts +68 -0
- package/src/elements/gtk-flow-box.ts +480 -0
- package/src/elements/gtk-font-dialog-button.ts +432 -0
- package/src/elements/gtk-frame.ts +174 -0
- package/src/elements/gtk-gl-area.ts +476 -0
- package/src/elements/gtk-graphics-offload.ts +130 -0
- package/src/elements/gtk-grid-view.ts +168 -0
- package/src/elements/gtk-grid.ts +127 -0
- package/src/elements/gtk-header-bar.ts +273 -0
- package/src/elements/gtk-inscription.ts +387 -0
- package/src/elements/gtk-label.ts +19 -11
- package/src/elements/gtk-level-bar.ts +323 -0
- package/src/elements/gtk-link-button.ts +138 -0
- package/src/elements/gtk-list-box-row.ts +195 -0
- package/src/elements/gtk-list-box.ts +413 -0
- package/src/elements/gtk-list-view.ts +370 -0
- package/src/elements/gtk-media-controls.ts +509 -0
- package/src/elements/gtk-notebook.ts +664 -0
- package/src/elements/gtk-overlay.ts +149 -0
- package/src/elements/gtk-page-setup-unix-dialog.ts +420 -0
- package/src/elements/gtk-paned.ts +597 -0
- package/src/elements/gtk-password-entry.ts +170 -0
- package/src/elements/gtk-picture.ts +254 -0
- package/src/elements/gtk-popover-bin.ts +332 -0
- package/src/elements/gtk-popover-menu-bar.ts +355 -0
- package/src/elements/gtk-popover-menu.ts +339 -0
- package/src/elements/gtk-popover.ts +92 -10
- package/src/elements/gtk-print-unix-dialog.ts +989 -0
- package/src/elements/gtk-progress-bar.ts +24 -11
- package/src/elements/gtk-revealer.ts +406 -0
- package/src/elements/gtk-scale-button.ts +358 -0
- package/src/elements/gtk-scale.ts +492 -0
- package/src/elements/gtk-scrollbar.ts +528 -0
- package/src/elements/gtk-scrolled-window.ts +653 -0
- package/src/elements/gtk-search-bar.ts +200 -0
- package/src/elements/gtk-search-entry.ts +172 -0
- package/src/elements/gtk-separator.ts +52 -0
- package/src/elements/gtk-spin-button.ts +475 -0
- package/src/elements/gtk-spinner.ts +126 -0
- package/src/elements/gtk-stack-sidebar.ts +212 -0
- package/src/elements/gtk-stack-switcher.ts +279 -0
- package/src/elements/gtk-stack.ts +748 -0
- package/src/elements/gtk-switch.ts +52 -19
- package/src/elements/gtk-text-view.ts +290 -0
- package/src/elements/gtk-text.ts +219 -0
- package/src/elements/gtk-toggle-button.ts +239 -0
- package/src/elements/gtk-tree-expander.ts +243 -0
- package/src/elements/gtk-video.ts +423 -0
- package/src/elements/gtk-viewport.ts +277 -0
- package/src/elements/gtk-window-controls.ts +341 -0
- package/src/elements/gtk-window-handle.ts +221 -0
- package/src/elements/gtk-window.ts +372 -0
- package/src/elements/justification.ts +24 -0
- package/src/elements/popover-menu.ts +24 -0
- package/src/elements/roving-focus.ts +53 -21
- package/src/emoji-data.ts +577 -0
- package/src/entry-rows.spec.ts +31 -0
- package/src/font-description.ts +238 -0
- package/src/gtk-about-dialog.spec.ts +250 -0
- package/src/gtk-action-bar.spec.ts +89 -0
- package/src/gtk-application-window.spec.ts +107 -0
- package/src/gtk-aspect-frame.spec.ts +114 -0
- package/src/gtk-calendar.spec.ts +589 -0
- package/src/gtk-center-box.spec.ts +125 -0
- package/src/gtk-color-dialog-button.spec.ts +141 -0
- package/src/gtk-column-view.spec.ts +154 -0
- package/src/gtk-drag-icon.spec.ts +190 -0
- package/src/gtk-drawing-area.spec.ts +211 -0
- package/src/gtk-editable-label.spec.ts +190 -0
- package/src/gtk-emoji-chooser.spec.ts +173 -0
- package/src/gtk-entry.spec.ts +23 -0
- package/src/gtk-expander.spec.ts +170 -0
- package/src/gtk-fixed.spec.ts +97 -0
- package/src/gtk-flow-box.spec.ts +289 -0
- package/src/gtk-font-dialog-button.spec.ts +166 -0
- package/src/gtk-frame.spec.ts +119 -0
- package/src/gtk-gl-area.spec.ts +361 -0
- package/src/gtk-graphics-offload.spec.ts +119 -0
- package/src/gtk-grid-view.spec.ts +106 -0
- package/src/gtk-grid.spec.ts +122 -0
- package/src/gtk-header-bar.spec.ts +202 -0
- package/src/gtk-inscription.spec.ts +235 -0
- package/src/gtk-level-bar.spec.ts +199 -0
- package/src/gtk-link-button.spec.ts +117 -0
- package/src/gtk-list-box.spec.ts +422 -0
- package/src/gtk-list-view.spec.ts +203 -0
- package/src/gtk-media-controls.spec.ts +295 -0
- package/src/gtk-notebook.spec.ts +546 -0
- package/src/gtk-overlay.spec.ts +141 -0
- package/src/gtk-paned.spec.ts +267 -0
- package/src/gtk-password-entry.spec.ts +150 -0
- package/src/gtk-picture.spec.ts +172 -0
- package/src/gtk-popover-bin.spec.ts +229 -0
- package/src/gtk-popover-menu-bar.spec.ts +296 -0
- package/src/gtk-popover-menu.spec.ts +261 -0
- package/src/gtk-popover-role.spec.ts +138 -0
- package/src/gtk-popover.spec.ts +264 -0
- package/src/gtk-print-dialogs.spec.ts +251 -0
- package/src/gtk-revealer.spec.ts +164 -0
- package/src/gtk-scale-button.spec.ts +218 -0
- package/src/gtk-scale.spec.ts +213 -0
- package/src/gtk-scrollbar.spec.ts +244 -0
- package/src/gtk-scrolled-window.spec.ts +262 -0
- package/src/gtk-search-bar.spec.ts +179 -0
- package/src/gtk-search-entry.spec.ts +142 -0
- package/src/gtk-separator.spec.ts +74 -0
- package/src/gtk-spin-button.spec.ts +186 -0
- package/src/gtk-spinner.spec.ts +130 -0
- package/src/gtk-stack-sidebar.spec.ts +217 -0
- package/src/gtk-stack-switcher.spec.ts +249 -0
- package/src/gtk-stack.spec.ts +432 -0
- package/src/gtk-text-view.spec.ts +189 -0
- package/src/gtk-text.spec.ts +163 -0
- package/src/gtk-toggle-button.spec.ts +186 -0
- package/src/gtk-tree-expander.spec.ts +201 -0
- package/src/gtk-video.spec.ts +240 -0
- package/src/gtk-viewport.spec.ts +140 -0
- package/src/gtk-window-controls.spec.ts +232 -0
- package/src/gtk-window-handle.spec.ts +158 -0
- package/src/gtk-window.spec.ts +202 -0
- package/src/index.ts +9 -1
- package/src/keyboard-operable.spec.ts +77 -9
- package/src/list-view-dom.ts +121 -0
- package/src/namespace/adw.ts +12 -0
- package/src/namespace/gtk.ts +61 -0
- package/src/page-setup.ts +222 -0
- package/src/row-line-clamp.ts +74 -0
- package/src/row-tooltip.spec.ts +313 -0
- package/src/row-tooltip.ts +52 -0
- package/src/scroll-shading.ts +18 -1
- package/src/shared-tree-builder.ts +336 -41
- package/src/shared-tree-mount.spec.ts +130 -0
- package/src/shared-trees.spec.ts +15 -0
- package/src/signals.ts +15 -0
- package/src/style-classes.spec.ts +9 -8
- package/src/styles.generated.ts +1 -1
- package/src/tab-chip.ts +200 -0
- package/src/template-classes.ts +45 -0
- package/src/test.browser.mts +160 -0
- package/src/widget-size.spec.ts +117 -0
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
} from '@gjsify/adwaita-core';
|
|
27
27
|
|
|
28
28
|
import { bindBreakpointSetter } from '../breakpoints.js';
|
|
29
|
+
import type { DispatchedSignals } from '../signals.js';
|
|
29
30
|
import { bindSlottedChildren } from '../slotted-children.js';
|
|
30
31
|
|
|
31
32
|
/**
|
|
@@ -80,6 +81,9 @@ function readTriStateAttr(element: Element, name: string, fallback: boolean): bo
|
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
export class AdwOverlaySplitView extends HTMLElement {
|
|
84
|
+
/** The GTK signals this element dispatches, which is what a `.blp` `bind` of `show-sidebar` follows. */
|
|
85
|
+
static readonly signals: DispatchedSignals = { 'notify::show-sidebar': 'notify::show-sidebar' };
|
|
86
|
+
|
|
83
87
|
private _initialized = false;
|
|
84
88
|
private _sidebarEl!: HTMLDivElement;
|
|
85
89
|
private _contentEl!: HTMLDivElement;
|
|
@@ -97,6 +101,8 @@ export class AdwOverlaySplitView extends HTMLElement {
|
|
|
97
101
|
* `show-sidebar` + `pin-sidebar` mean together, held to `OVERLAY_COLLAPSE_VECTORS`.
|
|
98
102
|
*/
|
|
99
103
|
private _state = new OverlaySplitViewState();
|
|
104
|
+
/** The `show-sidebar` the last `notify::show-sidebar` (or the first read) settled on. */
|
|
105
|
+
private _notifiedShowSidebar: boolean | null = null;
|
|
100
106
|
/** Re-entrancy guard for {@link _reflectShowSidebar}. */
|
|
101
107
|
private _reflecting = false;
|
|
102
108
|
/** The view's own width in CSS px — the size the sidebar fraction is OF. */
|
|
@@ -329,13 +335,30 @@ export class AdwOverlaySplitView extends HTMLElement {
|
|
|
329
335
|
private _reflectShowSidebar() {
|
|
330
336
|
if (this._reflecting) return;
|
|
331
337
|
const wanted = this._state.showSidebar ? '' : 'false';
|
|
332
|
-
if (this.getAttribute('show-sidebar')
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
+
if (this.getAttribute('show-sidebar') !== wanted) {
|
|
339
|
+
this._reflecting = true;
|
|
340
|
+
try {
|
|
341
|
+
this.setAttribute('show-sidebar', wanted);
|
|
342
|
+
} finally {
|
|
343
|
+
this._reflecting = false;
|
|
344
|
+
}
|
|
338
345
|
}
|
|
346
|
+
this._notifyShowSidebar();
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* `notify::show-sidebar`, raised on the EFFECTIVE value — the state's, after an auto-hide on
|
|
351
|
+
* collapse — and only when it changed, the way GObject notifies. Every path that moves it
|
|
352
|
+
* (the attribute, the property, a breakpoint, a gesture) ends in {@link _reflectShowSidebar},
|
|
353
|
+
* so this is the one place it is raised. The first read only records the baseline: a bind
|
|
354
|
+
* reads the current value itself.
|
|
355
|
+
*/
|
|
356
|
+
private _notifyShowSidebar() {
|
|
357
|
+
const shown = this._state.showSidebar;
|
|
358
|
+
const previous = this._notifiedShowSidebar;
|
|
359
|
+
this._notifiedShowSidebar = shown;
|
|
360
|
+
if (previous === null || previous === shown) return;
|
|
361
|
+
this.dispatchEvent(new CustomEvent('notify::show-sidebar', { bubbles: true, detail: { showSidebar: shown } }));
|
|
339
362
|
}
|
|
340
363
|
|
|
341
364
|
private _syncBreakpoint() {
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// <adw-preferences-row> — the row every boxed-list row derives from: a
|
|
2
|
+
// `Gtk.ListBoxRow` carrying a `title` that `Adw.PreferencesDialog` searches for
|
|
3
|
+
// (adw-preferences-row.c:12-23).
|
|
4
|
+
//
|
|
5
|
+
// FOUR PROPERTIES, AND EVERY ONE OF THEM IS ABOUT THE TITLE LABEL:
|
|
6
|
+
// `title` (Pango markup unless `use-markup` is FALSE), `use-markup`, `use-underline`
|
|
7
|
+
// (an embedded `_` marks a mnemonic) and `title-selectable` (the user may copy it) —
|
|
8
|
+
// the property docs are at adw-preferences-row.c:118-170. Inherited from `GtkWidget`,
|
|
9
|
+
// every row also takes `tooltip-text` (`src/row-tooltip.ts`).
|
|
10
|
+
//
|
|
11
|
+
// ONE DELIBERATE PORT DECISION, named here because C says the opposite in so many
|
|
12
|
+
// words: "It doesn't present the title in any way and lets you present the preference
|
|
13
|
+
// as you please" (adw-preferences-row.c:20). A browser element has no subclassing
|
|
14
|
+
// mechanism, so a base row that presented NOTHING would be an empty box — and three of
|
|
15
|
+
// the four properties describe a label this element would not have. It therefore
|
|
16
|
+
// presents the title the way every derived row does (`<adw-action-row>` renders the same
|
|
17
|
+
// `.adw-row-title` beside its subtitle), keeps `use-markup`/`use-underline` on it through
|
|
18
|
+
// the shared `labelDisplayText` reduction rather than an `innerHTML` sink, and lets a
|
|
19
|
+
// caller put the preference's own controls beside it through the `child` slot.
|
|
20
|
+
//
|
|
21
|
+
// MODIFICATION: `use-markup` DEFAULTS TRUE in C (adw-preferences-row.c:166-169) and an
|
|
22
|
+
// HTML boolean attribute cannot spell a TRUE default, so the attribute is opt-IN here —
|
|
23
|
+
// the arrangement `<adw-tab-view autohide>` and `<adw-navigation-page can-pop>` already
|
|
24
|
+
// carry, and for the same reason. What it decides is whether a title written as
|
|
25
|
+
// `<b>Dark</b>` Style shows the word `Dark` (markup reduced, C's default) or the literal
|
|
26
|
+
// text; either way the string is TEXT in the DOM, never markup.
|
|
27
|
+
//
|
|
28
|
+
// `activatable` is `GtkListBoxRow`'s, not this class's: the group's list box drives it,
|
|
29
|
+
// and the derived rows in this package (`<adw-action-row>`, `<adw-switch-row>`) are where
|
|
30
|
+
// it is implemented. So it is neither observed nor listed in KNOWN_GAPS — the property
|
|
31
|
+
// check reads the OWN body, and `AdwPreferencesRow` declares only the four above.
|
|
32
|
+
//
|
|
33
|
+
// A11Y: `role="listitem"`. The row IS a `GtkListBoxRow` inside the group's list, and
|
|
34
|
+
// `<adw-preferences-group>` sets `role="group"` on itself for exactly this reason.
|
|
35
|
+
//
|
|
36
|
+
// KNOWN_GAPS: none — all four scalar properties are observed.
|
|
37
|
+
//
|
|
38
|
+
// Reference: refs/libadwaita/src/adw-preferences-row.c (the four pspecs and their
|
|
39
|
+
// defaults, `adw_preferences_row_set_title`'s NULL → "" normalisation)
|
|
40
|
+
// Reference: refs/libadwaita/src/adw-preferences-dialog.c (row_has_title, make_comparable)
|
|
41
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_lists.scss (`row`, `list > row`)
|
|
42
|
+
// Copyright (c) 2019 Purism SPC / GNOME contributors (libadwaita). LGPLv2.1+.
|
|
43
|
+
// Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
|
|
44
|
+
|
|
45
|
+
import { labelDisplayText, stringIsNotEmpty } from '@gjsify/adwaita-core';
|
|
46
|
+
|
|
47
|
+
import { applyRowTooltip } from '../row-tooltip.js';
|
|
48
|
+
import { bindEmptySections } from '../empty-sections.js';
|
|
49
|
+
import { bindSlottedChildren } from '../slotted-children.js';
|
|
50
|
+
|
|
51
|
+
export class AdwPreferencesRow extends HTMLElement {
|
|
52
|
+
private _titleEl!: HTMLSpanElement;
|
|
53
|
+
private _contentEl!: HTMLDivElement;
|
|
54
|
+
private _initialized = false;
|
|
55
|
+
|
|
56
|
+
static get observedAttributes() {
|
|
57
|
+
return ['title', 'title-selectable', 'use-markup', 'use-underline', 'tooltip-text'];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** `Adw.PreferencesRow:title` — Pango markup unless {@link useMarkup} is false. */
|
|
61
|
+
get title(): string {
|
|
62
|
+
// `adw_preferences_row_set_title` normalises NULL to the empty string
|
|
63
|
+
// (adw-preferences-row.c:235), and an absent attribute is exactly that NULL.
|
|
64
|
+
return this.getAttribute('title') ?? '';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
set title(value: string) {
|
|
68
|
+
if (value === '') this.removeAttribute('title');
|
|
69
|
+
else this.setAttribute('title', value);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** `Adw.PreferencesRow:title-selectable` — the user may copy the title. Default false. */
|
|
73
|
+
get titleSelectable(): boolean {
|
|
74
|
+
return this.hasAttribute('title-selectable');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
set titleSelectable(value: boolean) {
|
|
78
|
+
this.toggleAttribute('title-selectable', value);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** `Adw.PreferencesRow:use-markup` — the title is Pango markup, reduced to its text. */
|
|
82
|
+
get useMarkup(): boolean {
|
|
83
|
+
return this.hasAttribute('use-markup');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
set useMarkup(value: boolean) {
|
|
87
|
+
this.toggleAttribute('use-markup', value);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** `Adw.PreferencesRow:use-underline` — `_` marks a mnemonic. Default false. */
|
|
91
|
+
get useUnderline(): boolean {
|
|
92
|
+
return this.hasAttribute('use-underline');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
set useUnderline(value: boolean) {
|
|
96
|
+
this.toggleAttribute('use-underline', value);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** `Adw.PreferencesRow:child` (inherited from `Gtk.ListBoxRow`) — the row's content. */
|
|
100
|
+
get child(): Element | null {
|
|
101
|
+
return this._contentEl?.firstElementChild ?? null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
set child(value: Element | null) {
|
|
105
|
+
this._contentEl?.replaceChildren(...(value === null ? [] : [value]));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
connectedCallback() {
|
|
109
|
+
if (this._initialized) return;
|
|
110
|
+
this._initialized = true;
|
|
111
|
+
|
|
112
|
+
this._titleEl = document.createElement('span');
|
|
113
|
+
this._titleEl.className = 'adw-row-title';
|
|
114
|
+
|
|
115
|
+
this._contentEl = document.createElement('div');
|
|
116
|
+
this._contentEl.className = 'adw-preferences-row-content';
|
|
117
|
+
|
|
118
|
+
// `child` is a widget property, so a `.blp`'s `child: …` authors `slot="child"`
|
|
119
|
+
// and an unnamed child is the same placement (GtkListBoxRow's own buildable).
|
|
120
|
+
bindSlottedChildren(this, [{ name: 'child', into: this._contentEl }]).install(this._titleEl, this._contentEl);
|
|
121
|
+
bindEmptySections(this._contentEl);
|
|
122
|
+
|
|
123
|
+
this.setAttribute('role', 'listitem');
|
|
124
|
+
this._render();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null) {
|
|
128
|
+
if (!this._initialized) return;
|
|
129
|
+
this._render();
|
|
130
|
+
this.dispatchEvent(new CustomEvent(`notify::${name}`, { bubbles: true, detail: { [name]: value } }));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The title label and the copy permission.
|
|
135
|
+
*
|
|
136
|
+
* `labelDisplayText` reduces Pango markup to its text and strips the mnemonic marker
|
|
137
|
+
* in C's order (markup first, `_` second) — the same reduction `<gtk-label>` uses, so
|
|
138
|
+
* a title written once reads the same in both.
|
|
139
|
+
*/
|
|
140
|
+
private _render(): void {
|
|
141
|
+
const text = labelDisplayText(this.title, this.useMarkup, this.useUnderline);
|
|
142
|
+
this._titleEl.textContent = text;
|
|
143
|
+
// `string_is_not_empty`, the rule every row's label binding uses: a row with no
|
|
144
|
+
// title shows no line, and `row_has_title` keeps it out of the search too.
|
|
145
|
+
this._titleEl.hidden = !stringIsNotEmpty(text);
|
|
146
|
+
// `Gtk.Label:selectable` puts a label in GTK_SELECTION_TEXT; the DOM's spelling
|
|
147
|
+
// of "this text may be copied" is `user-select: text`.
|
|
148
|
+
this._titleEl.style.userSelect = this.titleSelectable ? 'text' : '';
|
|
149
|
+
applyRowTooltip(this, [this._titleEl, this._contentEl]);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
customElements.define('adw-preferences-row', AdwPreferencesRow);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// <adw-shortcuts-dialog> — the window that shows an application's keyboard
|
|
2
|
+
// shortcuts, as `AdwShortcutsDialog` since libadwaita 1.8.
|
|
3
|
+
//
|
|
4
|
+
// IT IS THE GENERIC DIALOG plus a content model: the class is `final` and its parent
|
|
5
|
+
// is `Adw.Dialog` (Adw-1.gir), and upstream it declares no property and one method —
|
|
6
|
+
// `add(section)`. So this element EXTENDS <adw-dialog> and inherits the whole chrome
|
|
7
|
+
// (the scrim, the flat header with its close button, the focus trap, the bottom-sheet
|
|
8
|
+
// switch), and the only thing it adds is the sections.
|
|
9
|
+
//
|
|
10
|
+
// A browser document cannot call `add()`, so the sections are CHILDREN: one
|
|
11
|
+
// `<adw-shortcuts-section>` per group, each holding `<adw-shortcuts-item>` rows. That
|
|
12
|
+
// is `AdwShortcutsDialog`'s GtkBuildable form — the GIR documents "add it as a child
|
|
13
|
+
// when using UI files" — and it is the same mark-up-only-objection `GtkBuildable`
|
|
14
|
+
// answers for `<adw-sidebar-item>` and `<adw-toggle>`.
|
|
15
|
+
//
|
|
16
|
+
// The title is the DIALOG's, so it inherits from the base and is not re-observed.
|
|
17
|
+
// libadwaita spells the dialog's own class list `dialog.shortcuts`, and the stylesheet
|
|
18
|
+
// gives the rows their padding and the shortcut labels their keycaps
|
|
19
|
+
// (_shortcuts-dialog.scss:16-58) — the labels themselves are `<adw-shortcut-label>`,
|
|
20
|
+
// which already ports those rules.
|
|
21
|
+
//
|
|
22
|
+
// Reference: refs/libadwaita/src/adw-shortcuts-dialog.c (a final Adw.Dialog with `add`)
|
|
23
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_shortcuts-dialog.scss
|
|
24
|
+
// Copyright (c) 2025 GNOME Foundation Inc. (libadwaita). LGPLv2.1+
|
|
25
|
+
// Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
|
|
26
|
+
|
|
27
|
+
import { AdwDialog } from './adw-dialog.js';
|
|
28
|
+
|
|
29
|
+
export class AdwShortcutsDialog extends AdwDialog {
|
|
30
|
+
/**
|
|
31
|
+
* The sections in this dialog, in document order (AdwShortcutsDialog:add, in markup).
|
|
32
|
+
*
|
|
33
|
+
* READ OFF THE CONTENT AREA rather than off a wrapper this class builds, because the
|
|
34
|
+
* base routes every child there through its own LIVE `bindSlottedChildren` and a
|
|
35
|
+
* wrapper of our own would be a second destination the routing knows nothing about:
|
|
36
|
+
* a section appended after connect would land beside the wrapper, not inside it.
|
|
37
|
+
*/
|
|
38
|
+
get sections(): readonly HTMLElement[] {
|
|
39
|
+
return [...this.contentArea.children].filter((el) => el.localName === 'adw-shortcuts-section') as HTMLElement[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
// FIRST: the base builds its subtree here, and `contentArea` is one of the things
|
|
44
|
+
// it builds — this class reads it on the line after.
|
|
45
|
+
super.connectedCallback();
|
|
46
|
+
// Once, and a re-attach must not throw the sections away: the base's
|
|
47
|
+
// `_initialized` guard is what makes its subtree survive the move.
|
|
48
|
+
this.classList.add('adw-shortcuts-dialog');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
customElements.define('adw-shortcuts-dialog', AdwShortcutsDialog);
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// <adw-shortcuts-item> — one shortcut row: a title, an optional subtitle and an
|
|
2
|
+
// accelerator, drawn as keycaps. The browser counterpart of `AdwShortcutsItem`,
|
|
3
|
+
// which upstream is a plain `GObject` (adw-shortcuts-item.c:39) holding four
|
|
4
|
+
// strings and a text direction, and is a row rather than a widget — hence a tag
|
|
5
|
+
// here, the same shape `<adw-sidebar-item>` and `<adw-toggle>` are.
|
|
6
|
+
//
|
|
7
|
+
// THE ACCELERATOR IS `<adw-shortcut-label>`'s to draw. The C validates the string
|
|
8
|
+
// against `AdwShortcutLabel`'s own grammar (adw-shortcuts-item.c:19-24) and this
|
|
9
|
+
// element hands the very same attribute to the very same element, so the parse is
|
|
10
|
+
// core's `parseShortcutLabel` once rather than a second grammar that drifts from it.
|
|
11
|
+
//
|
|
12
|
+
// `action-name` is the OTHER half and the port has nothing to resolve it with: an
|
|
13
|
+
// accelerator for an action comes from `Gtk.Application.set_accels_for_action`, and a
|
|
14
|
+
// document has no application to ask. So it is kept as an attribute — a reader can
|
|
15
|
+
// still see which action a row stands for — and the accelerator beside it is what is
|
|
16
|
+
// DRAWN. That is the fallback the class itself documents ("If both are specified, the
|
|
17
|
+
// accelerator will be used if the action couldn't be found", adw-shortcuts-item.c:19-23).
|
|
18
|
+
//
|
|
19
|
+
// `direction` is honoured the way the class means it: a row for a direction the
|
|
20
|
+
// document is not in is hidden, which is how one dialog lists both an LTR and an RTL
|
|
21
|
+
// accelerator for the same action (adw-shortcuts-item.c:25-28).
|
|
22
|
+
//
|
|
23
|
+
// Attributes:
|
|
24
|
+
// title (AdwShortcutsItem:title — the row's name)
|
|
25
|
+
// subtitle (AdwShortcutsItem:subtitle — the line under it, drawn dimmed and
|
|
26
|
+
// caption-sized, the `.title-box > .subtitle` rule at _shortcuts-dialog.scss:23-26)
|
|
27
|
+
// accelerator (AdwShortcutsItem:accelerator — `<Control>C`, `<Shift>A Home`; the
|
|
28
|
+
// `<adw-shortcut-label>` grammar)
|
|
29
|
+
// action-name (AdwShortcutsItem:action-name — resolved on GTK, kept here)
|
|
30
|
+
// direction (AdwShortcutsItem:direction — `ltr` | `rtl` | `none`; a row for the
|
|
31
|
+
// other direction is hidden)
|
|
32
|
+
//
|
|
33
|
+
// Properties: `itemType` — whether an accelerator was given, `hasAccelerator`.
|
|
34
|
+
//
|
|
35
|
+
// Reference: refs/libadwaita/src/adw-shortcuts-item.c
|
|
36
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_shortcuts-dialog.scss:16-27
|
|
37
|
+
// Copyright (c) 2025 GNOME Foundation Inc. (libadwaita). LGPLv2.1+
|
|
38
|
+
// Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* `AdwShortcutsItem:direction` is a `GtkTextDirection`, so it carries `none` beside the
|
|
42
|
+
* two directions — and `none` is the default, meaning "show this row either way".
|
|
43
|
+
*
|
|
44
|
+
* NOT `AdwTextDirection` from core: that one is the split views' pair (`'ltr' | 'rtl'`,
|
|
45
|
+
* split-view.ts:41), which cannot hold the value the C defaults this property to.
|
|
46
|
+
*/
|
|
47
|
+
export type AdwShortcutsItemDirection = 'ltr' | 'rtl' | 'none';
|
|
48
|
+
|
|
49
|
+
const DIRECTIONS: readonly AdwShortcutsItemDirection[] = ['ltr', 'rtl', 'none'];
|
|
50
|
+
|
|
51
|
+
export class AdwShortcutsItem extends HTMLElement {
|
|
52
|
+
private _initialized = false;
|
|
53
|
+
private _titleEl!: HTMLSpanElement;
|
|
54
|
+
private _subtitleEl!: HTMLSpanElement;
|
|
55
|
+
private _labelEl!: HTMLElement;
|
|
56
|
+
|
|
57
|
+
static get observedAttributes() {
|
|
58
|
+
return ['title', 'subtitle', 'accelerator', 'action-name', 'direction'];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** The row's title (AdwShortcutsItem:title). */
|
|
62
|
+
get title(): string {
|
|
63
|
+
return this.getAttribute('title') ?? '';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set title(value: string) {
|
|
67
|
+
this.setAttribute('title', value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The row's subtitle (AdwShortcutsItem:subtitle). */
|
|
71
|
+
get subtitle(): string {
|
|
72
|
+
return this.getAttribute('subtitle') ?? '';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
set subtitle(value: string) {
|
|
76
|
+
this.setAttribute('subtitle', value);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The accelerator, in `<adw-shortcut-label>`'s grammar (AdwShortcutsItem:accelerator). */
|
|
80
|
+
get accelerator(): string {
|
|
81
|
+
return this.getAttribute('accelerator') ?? '';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
set accelerator(value: string) {
|
|
85
|
+
if (value) this.setAttribute('accelerator', value);
|
|
86
|
+
else this.removeAttribute('accelerator');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** The action this row stands for; resolved by a GtkApplication on GTK. */
|
|
90
|
+
get actionName(): string {
|
|
91
|
+
return this.getAttribute('action-name') ?? '';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
set actionName(value: string) {
|
|
95
|
+
if (value) this.setAttribute('action-name', value);
|
|
96
|
+
else this.removeAttribute('action-name');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** The text direction this row belongs to (AdwShortcutsItem:direction). */
|
|
100
|
+
get direction(): AdwShortcutsItemDirection {
|
|
101
|
+
const value = this.getAttribute('direction') as AdwShortcutsItemDirection | null;
|
|
102
|
+
return value && DIRECTIONS.includes(value) ? value : 'none';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
set direction(value: AdwShortcutsItemDirection) {
|
|
106
|
+
this.setAttribute('direction', value);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Whether a row carries an accelerator or stands for an action alone. */
|
|
110
|
+
get hasAccelerator(): boolean {
|
|
111
|
+
return this.accelerator.length > 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
connectedCallback() {
|
|
115
|
+
if (this._initialized) return;
|
|
116
|
+
this._initialized = true;
|
|
117
|
+
|
|
118
|
+
// `GTK_ACCESSIBLE_ROLE_LIST_ITEM` in spirit: a row in a list of shortcuts, and
|
|
119
|
+
// the accelerator beside it is already `role="img"` with its own name.
|
|
120
|
+
this.setAttribute('role', 'listitem');
|
|
121
|
+
|
|
122
|
+
this._titleEl = document.createElement('span');
|
|
123
|
+
this._titleEl.className = 'adw-shortcuts-item-title';
|
|
124
|
+
|
|
125
|
+
this._subtitleEl = document.createElement('span');
|
|
126
|
+
this._subtitleEl.className = 'adw-shortcuts-item-subtitle';
|
|
127
|
+
|
|
128
|
+
// The keycaps: the one element that owns the accelerator grammar.
|
|
129
|
+
this._labelEl = document.createElement('adw-shortcut-label');
|
|
130
|
+
this._labelEl.className = 'adw-shortcuts-item-label';
|
|
131
|
+
|
|
132
|
+
this.replaceChildren(this._titleEl, this._subtitleEl, this._labelEl);
|
|
133
|
+
this._render();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
attributeChangedCallback(name: string) {
|
|
137
|
+
if (!this._initialized) return;
|
|
138
|
+
if (name === 'direction' || name === 'accelerator' || name === 'action-name') this._render();
|
|
139
|
+
else if (name === 'title') this._titleEl.textContent = this.title;
|
|
140
|
+
else if (name === 'subtitle') this._renderSubtitle();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
private _render(): void {
|
|
144
|
+
this._titleEl.textContent = this.title;
|
|
145
|
+
this._renderSubtitle();
|
|
146
|
+
this._labelEl.setAttribute('accelerator', this.accelerator);
|
|
147
|
+
|
|
148
|
+
// A row that stands for an action alone has nothing to draw on the trailing
|
|
149
|
+
// side — `AdwShortcutLabel` shows its `disabled-text` placeholder for an empty
|
|
150
|
+
// accelerator, which is the wrong picture for a row that never had one.
|
|
151
|
+
this._labelEl.hidden = !this.hasAccelerator;
|
|
152
|
+
|
|
153
|
+
// The class's own rule (adw-shortcuts-item.c:25-28): a direction-specific row
|
|
154
|
+
// is shown only in that direction, so one dialog can carry both.
|
|
155
|
+
const direction = this.direction;
|
|
156
|
+
if (direction !== 'none') {
|
|
157
|
+
const ours = getComputedStyle(this).direction;
|
|
158
|
+
this.hidden = ours !== direction;
|
|
159
|
+
} else {
|
|
160
|
+
this.hidden = false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
private _renderSubtitle(): void {
|
|
165
|
+
const subtitle = this.subtitle;
|
|
166
|
+
this._subtitleEl.textContent = subtitle;
|
|
167
|
+
this._subtitleEl.hidden = subtitle.length === 0;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
customElements.define('adw-shortcuts-item', AdwShortcutsItem);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// <adw-shortcuts-section> — one titled group of shortcuts inside an
|
|
2
|
+
// <adw-shortcuts-dialog>: the browser counterpart of `AdwShortcutsSection`, which
|
|
3
|
+
// upstream is a plain `GObject` (`G_DEFINE_FINAL_TYPE_WITH_CODE (…, G_TYPE_OBJECT)`
|
|
4
|
+
// in adw-shortcuts-section.c:44) implementing `GtkBuildable` and `Gio.ListModel`.
|
|
5
|
+
// It has no look of its own — libadwaita draws it as a preferences GROUP inside the
|
|
6
|
+
// dialog's page, and every row is a `AdwShortcutsItem` (`.shortcut-row`, styled at
|
|
7
|
+
// _shortcuts-dialog.scss:16-27).
|
|
8
|
+
//
|
|
9
|
+
// A tag anyway, and that is the same shape `<adw-sidebar-item>` and `<adw-toggle>`
|
|
10
|
+
// are: a GObject that is not a GtkWidget has no tag in a table of concrete widgets,
|
|
11
|
+
// and the mark-up form of `GtkBuildable`'s add-child is the only way a document can
|
|
12
|
+
// declare one. `scripts/check-vocabulary-alignment.mjs` records that in
|
|
13
|
+
// `WEB_ELEMENT_ALIGNMENT`.
|
|
14
|
+
//
|
|
15
|
+
// Children are `<adw-shortcuts-item>` elements, and they stay LIVE: a shortcut added
|
|
16
|
+
// after connect lands in the section (`bindSlottedChildren`).
|
|
17
|
+
//
|
|
18
|
+
// Attributes:
|
|
19
|
+
// title (AdwShortcutsSection:title — the heading; an untitled section is the
|
|
20
|
+
// "subdivide a section into groups" case the class documents)
|
|
21
|
+
//
|
|
22
|
+
// Properties: `items` (the section's shortcuts, in document order).
|
|
23
|
+
//
|
|
24
|
+
// Reference: refs/libadwaita/src/adw-shortcuts-section.c
|
|
25
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_shortcuts-dialog.scss:1-14
|
|
26
|
+
// Copyright (c) 2025 GNOME Foundation Inc. (libadwaita). LGPLv2.1+
|
|
27
|
+
// Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
|
|
28
|
+
|
|
29
|
+
import { bindSlottedChildren } from '../slotted-children.js';
|
|
30
|
+
|
|
31
|
+
export class AdwShortcutsSection extends HTMLElement {
|
|
32
|
+
private _initialized = false;
|
|
33
|
+
private _bodyEl!: HTMLDivElement;
|
|
34
|
+
private _titleEl!: HTMLElement;
|
|
35
|
+
|
|
36
|
+
static get observedAttributes() {
|
|
37
|
+
return ['title'];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The section title (AdwShortcutsSection:title). */
|
|
41
|
+
get title(): string {
|
|
42
|
+
return this.getAttribute('title') ?? '';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
set title(value: string) {
|
|
46
|
+
this.setAttribute('title', value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The shortcuts in this section, in document order (AdwShortcutsSection:n-items' list). */
|
|
50
|
+
get items(): readonly HTMLElement[] {
|
|
51
|
+
return [...this._bodyEl.children] as HTMLElement[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
connectedCallback() {
|
|
55
|
+
if (this._initialized) return;
|
|
56
|
+
this._initialized = true;
|
|
57
|
+
|
|
58
|
+
this._titleEl = document.createElement('div');
|
|
59
|
+
this._titleEl.className = 'adw-shortcuts-section-title';
|
|
60
|
+
|
|
61
|
+
this._bodyEl = document.createElement('div');
|
|
62
|
+
this._bodyEl.className = 'adw-shortcuts-section-body';
|
|
63
|
+
|
|
64
|
+
// A `Gio.ListModel` the section can also be read as, so the row list is a
|
|
65
|
+
// container with a name rather than bare children.
|
|
66
|
+
this.setAttribute('role', 'group');
|
|
67
|
+
bindSlottedChildren(this, [{ into: this._bodyEl }]).install(this._titleEl, this._bodyEl);
|
|
68
|
+
|
|
69
|
+
this._render();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
attributeChangedCallback(name: string) {
|
|
73
|
+
if (!this._initialized) return;
|
|
74
|
+
if (name === 'title') this._render();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private _render(): void {
|
|
78
|
+
const title = this.title;
|
|
79
|
+
// An untitled section is a legal thing to write: the class documents it as the
|
|
80
|
+
// way to subdivide a section into groups, and libadwaita draws no heading for it.
|
|
81
|
+
this._titleEl.textContent = title;
|
|
82
|
+
this._titleEl.hidden = title.length === 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
customElements.define('adw-shortcuts-section', AdwShortcutsSection);
|