@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.
- package/dist/adwaita-web.css +8070 -3037
- 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-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/breakpoints.d.ts +14 -3
- package/lib/types/construct-vectors.spec.d.ts +1 -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-dialog.d.ts +10 -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-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 +5 -0
- package/lib/types/elements/adw-switch-row.d.ts +3 -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-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 +121 -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 +97 -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/scroll-shading.d.ts +15 -1
- package/lib/types/shared-tree-builder.d.ts +30 -2
- 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/package.json +12 -8
- package/scss/_action_row.scss +2 -2
- 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/_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/_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 +132 -0
- 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 +51 -0
- package/scss/_print_dialogs.scss +328 -0
- package/scss/_reset.scss +21 -19
- package/scss/_revealer.scss +37 -0
- package/scss/_row.scss +20 -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/_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/_tree_expander.scss +62 -0
- package/scss/_variables.scss +43 -21
- package/scss/_video.scss +146 -0
- package/scss/_view_switcher_sidebar.scss +112 -0
- package/scss/_viewport.scss +50 -0
- package/scss/_window.scss +118 -1
- package/scss/_window_handle.scss +20 -0
- package/scss/adwaita-skin.scss +109 -0
- package/src/adw-action-rows.spec.ts +76 -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-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-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/breakpoints.ts +25 -8
- package/src/capabilities.d.mts +3 -0
- package/src/capabilities.mjs +18 -0
- package/src/connect-lifecycle.spec.ts +12 -0
- package/src/construct-vectors.spec.ts +175 -0
- 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-clamp-scrollable.ts +207 -0
- package/src/elements/adw-dialog.ts +19 -0
- package/src/elements/adw-layout-slot.ts +95 -0
- package/src/elements/adw-multi-layout-view.ts +326 -0
- package/src/elements/adw-preferences-row.ts +150 -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 +42 -3
- package/src/elements/adw-switch-row.ts +28 -1
- 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 +20 -5
- 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 +185 -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 +642 -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 +366 -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 +190 -0
- package/src/index.ts +9 -1
- package/src/keyboard-operable.spec.ts +33 -1
- 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/scroll-shading.ts +18 -1
- package/src/shared-tree-builder.ts +263 -21
- package/src/signals.ts +15 -0
- package/src/source-view/theme.ts +11 -5
- 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 +152 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
// <adw-multi-layout-view> — one set of children, several arrangements of them.
|
|
2
|
+
//
|
|
3
|
+
// Each child has an ID, each layout has slots, each slot has an ID; switching layouts
|
|
4
|
+
// re-inserts every child into the slot of the SAME ID (adw-multi-layout-view.c:16-26).
|
|
5
|
+
// That is what lets a secondary pane be a sidebar in one layout and a bottom bar in
|
|
6
|
+
// another without the application moving anything: the children are declared once and
|
|
7
|
+
// the view decides where they sit.
|
|
8
|
+
//
|
|
9
|
+
// THE MARKUP FORM, because two of the three objects have no tag. `Adw.Layout` is a
|
|
10
|
+
// GObject (`G_DEFINE_TYPE… G_TYPE_OBJECT`, adw-layout.c:37), so it is not in a table of
|
|
11
|
+
// concrete widgets and has no element of its own; `Adw.Breakpoint`-style GObjects in this
|
|
12
|
+
// package became markup children, and so does this one:
|
|
13
|
+
//
|
|
14
|
+
// * a direct child carrying `name` is a LAYOUT, and that element is its content —
|
|
15
|
+
// `AdwLayout:content` is construct-only (adw-layout.c:144), so the layout IS the
|
|
16
|
+
// tree rather than a wrapper around one;
|
|
17
|
+
// * any other direct child is a CHILD, keyed by its `slot` attribute, which is the
|
|
18
|
+
// GtkBuilder `<child type="ID">` of adw-multi-layout-view.c:88;
|
|
19
|
+
// * an `<adw-layout-slot id="…">` inside a layout is where a child with that ID lands.
|
|
20
|
+
//
|
|
21
|
+
// Attributes:
|
|
22
|
+
// layout-name (`Adw.MultiLayoutView:layout-name` — the name of the layout in use.
|
|
23
|
+
// Setting a name no layout carries logs the C's `g_critical` text
|
|
24
|
+
// (adw-multi-layout-view.c:520) and leaves the current layout alone.)
|
|
25
|
+
//
|
|
26
|
+
// Methods:
|
|
27
|
+
// `getChild(id)` — `adw_multi_layout_view_get_child` (:635).
|
|
28
|
+
// `getLayoutByName(name)` — `adw_multi_layout_view_get_layout_by_name` (:605).
|
|
29
|
+
// `registerSlot(id, slot)` — `adw_multi_layout_view_register_slot` (:682), which every
|
|
30
|
+
// `<adw-layout-slot>` calls on itself once it is rooted.
|
|
31
|
+
//
|
|
32
|
+
// THERE IS NO `addLayout()`, because in this port the MARKUP is `add_layout()`: the
|
|
33
|
+
// declared child carrying `name` is the layout, and the first declared one is made
|
|
34
|
+
// current the way `adw_multi_layout_view_add_layout` makes it (:553). An imperative list
|
|
35
|
+
// beside a declarative one would be two sources for the same table, and the derived one
|
|
36
|
+
// would silently win.
|
|
37
|
+
//
|
|
38
|
+
// Events:
|
|
39
|
+
// `notify::layout` and `notify::layout-name` (CustomEvent, bubbles,
|
|
40
|
+
// `detail = { layout }` / `{ layoutName }`) on every change — `set_layout` notifies
|
|
41
|
+
// BOTH (:263), so switching layouts is two signals even when only the name moved.
|
|
42
|
+
//
|
|
43
|
+
// A11Y: `role="group"`, the accessible role libadwaita installs on the class (:386).
|
|
44
|
+
// `visible` is bound one way, child to slot (`G_BINDING_SYNC_CREATE` alone,
|
|
45
|
+
// adw-multi-layout-view.c:151), so hiding a child hides the hole and nothing more.
|
|
46
|
+
//
|
|
47
|
+
// NOT PORTED: the focus save/restore around a rebuild (`rebuild_current_layout`, :200)
|
|
48
|
+
// and the delayed-focus queue (`delayed_focus`, :159). Both are a GTK frame-clock
|
|
49
|
+
// concern — the whole widget is snapshotted into a render node, hidden, rewritten and
|
|
50
|
+
// shown on the next tick, which is what makes focus observable in between. A browser
|
|
51
|
+
// element moves nodes synchronously, so focus is never lost across a layout change; the
|
|
52
|
+
// consequence is that this port has nothing to restore.
|
|
53
|
+
//
|
|
54
|
+
// Reference: refs/libadwaita/src/adw-multi-layout-view.c
|
|
55
|
+
// Reference: refs/libadwaita/src/adw-layout.c
|
|
56
|
+
// Copyright (c) 2023-2024 Purism SPC / GNOME Foundation Inc. (libadwaita). LGPLv2.1+.
|
|
57
|
+
// Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
|
|
58
|
+
|
|
59
|
+
import type { AdwLayoutSlot } from './adw-layout-slot.js';
|
|
60
|
+
|
|
61
|
+
/** One layout: the element itself, plus the name `AdwLayout:name` carries. */
|
|
62
|
+
interface Layout {
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly content: Element;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export class AdwMultiLayoutView extends HTMLElement {
|
|
68
|
+
/** The C's own tables: layouts in order, children by id, and the current layout. */
|
|
69
|
+
private _layouts: Layout[] = [];
|
|
70
|
+
private _children = new Map<string, Element>();
|
|
71
|
+
/** `slots` — the current layout's holes, which are cleared on every rebuild. */
|
|
72
|
+
private _slots = new Map<string, AdwLayoutSlot>();
|
|
73
|
+
private _current: Layout | null = null;
|
|
74
|
+
/** `accepting_slots` — only TRUE while a layout is being mounted (:116, :690). */
|
|
75
|
+
private _acceptingSlots = false;
|
|
76
|
+
private _observer: MutationObserver | null = null;
|
|
77
|
+
|
|
78
|
+
static get observedAttributes() {
|
|
79
|
+
return ['layout-name'];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** `adw_multi_layout_view_get_layout_name()` (:485), read under its property's name. */
|
|
83
|
+
get layoutName(): string | null {
|
|
84
|
+
return this._current?.name ?? null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* `adw_multi_layout_view_set_layout_name()` (:507) — writable, unlike `layout`.
|
|
89
|
+
*
|
|
90
|
+
* The property is written, not the layout: the C looks the name up and refuses a
|
|
91
|
+
* name no layout carries, and the lookup is what makes the ORDER of declaration
|
|
92
|
+
* irrelevant here.
|
|
93
|
+
*/
|
|
94
|
+
set layoutName(value: string | null) {
|
|
95
|
+
if (value === null) return;
|
|
96
|
+
this.setAttribute('layout-name', value);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** The element `Adw.MultiLayoutView:layout` points at, or null. */
|
|
100
|
+
get layout(): Element | null {
|
|
101
|
+
return this._current?.content ?? null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
connectedCallback() {
|
|
105
|
+
this.setAttribute('role', 'group');
|
|
106
|
+
// A GTK widget is a box and an unknown custom element is `inline`. libadwaita
|
|
107
|
+
// ships no rule for this widget — its CSS node is `multi-layout-view` and no
|
|
108
|
+
// partial names it — so the box model is set here rather than invented.
|
|
109
|
+
this.style.display = 'block';
|
|
110
|
+
this._observer?.disconnect();
|
|
111
|
+
// A layout or child appended after connect has to be picked up: the authored tree
|
|
112
|
+
// is the whole vocabulary of this widget, and a slot is read from the DOM.
|
|
113
|
+
this._observer = new MutationObserver(() => this._rebuild());
|
|
114
|
+
this._observer.observe(this, { childList: true });
|
|
115
|
+
this._rebuild();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
disconnectedCallback() {
|
|
119
|
+
this._observer?.disconnect();
|
|
120
|
+
this._observer = null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
attributeChangedCallback(name?: string) {
|
|
124
|
+
if (!this.isConnected || name !== 'layout-name') return;
|
|
125
|
+
this._setLayoutByName(this.getAttribute('layout-name'));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** `adw_multi_layout_view_get_child(id)` (:635). */
|
|
129
|
+
getChild(id: string): Element | null {
|
|
130
|
+
return this._children.get(id) ?? null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** `adw_multi_layout_view_get_layout_by_name(name)` (:605). */
|
|
134
|
+
getLayoutByName(name: string): Element | null {
|
|
135
|
+
return this._layouts.find((layout) => layout.name === name)?.content ?? null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* `adw_multi_layout_view_add_layout()` (:538), over the declared children.
|
|
140
|
+
*
|
|
141
|
+
* The rules it carries are the ones a reader of the markup would otherwise have to
|
|
142
|
+
* infer: the FIRST layout becomes current when the list is built (:553), and a
|
|
143
|
+
* duplicate name is a warning rather than a shadowed entry (:549).
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* `adw_multi_layout_view_register_slot()` (:682), called by every `<adw-layout-slot>`
|
|
148
|
+
* that becomes rooted.
|
|
149
|
+
*
|
|
150
|
+
* Refused outside a mount, which is what `accepting_slots` is for: a slot in a layout
|
|
151
|
+
* that is not current has no business in the table.
|
|
152
|
+
*
|
|
153
|
+
* A REPEAT registration by the SAME element is not a duplicate and says nothing. A DOM
|
|
154
|
+
* move fires `connectedCallback` again — and moving a slot is ordinary here, because
|
|
155
|
+
* the container it sits in re-homes its own slotted children when it builds its
|
|
156
|
+
* internals. `g_hash_table_insert` upstream would overwrite with the same pointer, so
|
|
157
|
+
* the C never notices; the warning is for two DIFFERENT slots under one ID, and
|
|
158
|
+
* reporting a re-registration would train a reader to ignore it (adw-multi-layout-view.c:693).
|
|
159
|
+
*/
|
|
160
|
+
registerSlot(id: string, slot: AdwLayoutSlot): void {
|
|
161
|
+
if (!this._acceptingSlots) return;
|
|
162
|
+
if (this._slots.get(id) === slot) return;
|
|
163
|
+
if (this._slots.has(id)) {
|
|
164
|
+
console.warn(`Duplicate slot ID in AdwLayout ${this.layoutName}: ${id}`);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this._slots.set(id, slot);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Read the authored tree and mount the layout it names.
|
|
172
|
+
*
|
|
173
|
+
* A direct child with `name` is a layout; anything else is a child, keyed by `slot`.
|
|
174
|
+
* Reading it from the DOM rather than from a list is what makes a child appended
|
|
175
|
+
* after connect work, which is the whole of `bindSlottedChildren`'s contract for the
|
|
176
|
+
* elements that use it.
|
|
177
|
+
*/
|
|
178
|
+
private _rebuild(): void {
|
|
179
|
+
if (!this.isConnected) return;
|
|
180
|
+
// THE MOUNT IS A CHILD-LIST CHANGE OF THIS ELEMENT, and re-reading it is a loop:
|
|
181
|
+
// `_rebuild` → `_mount` → `replaceChildren` → a record → `_rebuild` → … The
|
|
182
|
+
// observer is therefore OFF for the duration, which drops those records and any
|
|
183
|
+
// the previous mount already queued, and re-armed below. Without this the widget
|
|
184
|
+
// spins a microtask cycle forever and takes the page with it — measured, and the
|
|
185
|
+
// measurement is why this is a comment rather than a boolean.
|
|
186
|
+
this._observer?.disconnect();
|
|
187
|
+
try {
|
|
188
|
+
this._readAuthoredTree();
|
|
189
|
+
} finally {
|
|
190
|
+
if (this.isConnected) this._observer?.observe(this, { childList: true });
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** The C's three tables, read off the declared children. */
|
|
195
|
+
private _readAuthoredTree(): void {
|
|
196
|
+
const layouts: Layout[] = [];
|
|
197
|
+
// ACCUMULATED, not replaced: while a layout is mounted the children this view has
|
|
198
|
+
// taken into its slots are no longer children of the HOST, so a fresh map would
|
|
199
|
+
// drop every one of them and the next mount would parent nothing. `set_child`
|
|
200
|
+
// upserts by id too (adw-multi-layout-view.c:675).
|
|
201
|
+
for (const node of Array.from(this.children)) {
|
|
202
|
+
const name = node.getAttribute('name');
|
|
203
|
+
if (name !== null) {
|
|
204
|
+
layouts.push({ name, content: node });
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
const id = node.getAttribute('slot');
|
|
208
|
+
// No `slot=` is the DEFAULT child, and GtkBuilder's `<child>` with no type
|
|
209
|
+
// is a deprecation warning upstream (adw-breakpoint-bin.c:679 is the same
|
|
210
|
+
// rule for the bin); this port keeps the node where it is rather than
|
|
211
|
+
// losing it, which is the browser shape of "not our child".
|
|
212
|
+
if (id === null || id === '') continue;
|
|
213
|
+
if (this._children.has(id)) {
|
|
214
|
+
// `set_child` replaces the child of an id rather than adding a second.
|
|
215
|
+
console.warn(`While adding child: duplicate slot ${id} in AdwMultiLayoutView; kept the first`);
|
|
216
|
+
}
|
|
217
|
+
this._children.set(id, node);
|
|
218
|
+
}
|
|
219
|
+
this._layouts = layouts;
|
|
220
|
+
const wanted = this.getAttribute('layout-name');
|
|
221
|
+
// A declared `layout-name` is `set_layout_name`, which REFUSES a name no layout
|
|
222
|
+
// carries rather than falling back; an absent one takes the first, which is what
|
|
223
|
+
// `add_layout` makes current when the list is built (:553).
|
|
224
|
+
if (wanted !== null) this._setLayoutByName(wanted);
|
|
225
|
+
else this._setLayout(layouts[0] ?? null);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** `set_layout()` (:252): the same layout is not a change, and both properties notify. */
|
|
229
|
+
private _setLayout(layout: Layout | null): void {
|
|
230
|
+
if (layout === this._current) {
|
|
231
|
+
// A rebuild still has to re-mount: the content's slots are rebuilt from the
|
|
232
|
+
// DOM every time, so `_current` being unchanged says nothing about the tree.
|
|
233
|
+
if (layout !== null) this._mount(layout);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
this._current = layout;
|
|
237
|
+
if (layout === null) this._destroy();
|
|
238
|
+
else this._mount(layout);
|
|
239
|
+
this.dispatchEvent(new CustomEvent('notify::layout', { bubbles: true, detail: { layout: this.layoutName } }));
|
|
240
|
+
this.dispatchEvent(
|
|
241
|
+
new CustomEvent('notify::layout-name', { bubbles: true, detail: { layoutName: this.layoutName } }),
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* `set_layout_name()` (:507): look the name up, refuse an unknown one, then switch.
|
|
247
|
+
*
|
|
248
|
+
* The refusal is C's, in its own shape — `g_critical` and `return`, with no call to
|
|
249
|
+
* `set_layout` at all (:519), so the current layout is UNCHANGED rather than emptied.
|
|
250
|
+
* That is why the lookup is not folded into `_setLayout`: it answers the question
|
|
251
|
+
* first, and an unknown name is not a switch to nothing.
|
|
252
|
+
*/
|
|
253
|
+
private _setLayoutByName(name: string | null): void {
|
|
254
|
+
if (name === null) return;
|
|
255
|
+
const layout = this._layouts.find((candidate) => candidate.name === name);
|
|
256
|
+
if (layout === undefined) {
|
|
257
|
+
console.error(`Layout name '${name}' not found in AdwMultiLayoutView`);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
this._setLayout(layout);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* `destroy_current_layout()` (:192): forget every slot and unparent the content.
|
|
265
|
+
*
|
|
266
|
+
* The children are simply LEFT, which is what upstream does: a child whose id the
|
|
267
|
+
* OUTGOING layout had no slot for is not unparented by `unparent_child`
|
|
268
|
+
* (adw-multi-layout-view.c:175) and rides out with the content it was in. They stay
|
|
269
|
+
* alive in `_children`, which is where this port remembers the declaration.
|
|
270
|
+
*/
|
|
271
|
+
private _destroy(): void {
|
|
272
|
+
this._slots.clear();
|
|
273
|
+
this.replaceChildren();
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* `rebuild_current_layout()` (:200), minus the render-node snapshot.
|
|
278
|
+
*
|
|
279
|
+
* The do/while is C's own: parenting a child can root a slot of its own, which grows
|
|
280
|
+
* the table, which may make another child land. `slotCount` is what the loop compares
|
|
281
|
+
* against — the C's `g_hash_table_size`.
|
|
282
|
+
*/
|
|
283
|
+
private _mount(layout: Layout): void {
|
|
284
|
+
this._destroy();
|
|
285
|
+
this._acceptingSlots = true;
|
|
286
|
+
// APPENDED, not `replaceChildren`: `_destroy` has already emptied the host, and
|
|
287
|
+
// an unmatched child must not be a reason to drop the layout on the floor.
|
|
288
|
+
this.appendChild(layout.content);
|
|
289
|
+
// Re-register what is already in the mounted layout's own subtree, then let each
|
|
290
|
+
// child's mount register more. The loop is `old_size` again.
|
|
291
|
+
for (;;) {
|
|
292
|
+
const before = this._slots.size;
|
|
293
|
+
for (const slot of layout.content.querySelectorAll('adw-layout-slot')) {
|
|
294
|
+
const id = slot.getAttribute('id');
|
|
295
|
+
if (id !== null && id !== '' && !this._slots.has(id)) this.registerSlot(id, slot as AdwLayoutSlot);
|
|
296
|
+
}
|
|
297
|
+
for (const [id, child] of this._children) this._parent(id, child);
|
|
298
|
+
if (this._slots.size === before) break;
|
|
299
|
+
}
|
|
300
|
+
this._acceptingSlots = false;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** `parent_child()` (:136): bind `visible`, then insert. */
|
|
304
|
+
private _parent(id: string, child: Element): void {
|
|
305
|
+
const slot = this._slots.get(id);
|
|
306
|
+
if (slot === undefined) return;
|
|
307
|
+
if (child.parentElement === slot) return;
|
|
308
|
+
this._mirrorVisible(slot, child);
|
|
309
|
+
slot.appendChild(child);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* The one-way `visible` binding (:151), which CSS cannot express: the SLOT follows
|
|
314
|
+
* the CHILD. `hidden` is observed rather than polled so a child hidden AFTER it
|
|
315
|
+
* landed still hides the hole.
|
|
316
|
+
*/
|
|
317
|
+
private _mirrorVisible(slot: Element, child: Element): void {
|
|
318
|
+
const apply = () => {
|
|
319
|
+
slot.toggleAttribute('hidden', (child as HTMLElement).hidden === true);
|
|
320
|
+
};
|
|
321
|
+
apply();
|
|
322
|
+
new MutationObserver(apply).observe(child, { attributes: true, attributeFilter: ['hidden'] });
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
customElements.define('adw-multi-layout-view', AdwMultiLayoutView);
|
|
@@ -0,0 +1,150 @@
|
|
|
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.
|
|
9
|
+
//
|
|
10
|
+
// ONE DELIBERATE PORT DECISION, named here because C says the opposite in so many
|
|
11
|
+
// words: "It doesn't present the title in any way and lets you present the preference
|
|
12
|
+
// as you please" (adw-preferences-row.c:20). A browser element has no subclassing
|
|
13
|
+
// mechanism, so a base row that presented NOTHING would be an empty box — and three of
|
|
14
|
+
// the four properties describe a label this element would not have. It therefore
|
|
15
|
+
// presents the title the way every derived row does (`<adw-action-row>` renders the same
|
|
16
|
+
// `.adw-row-title` beside its subtitle), keeps `use-markup`/`use-underline` on it through
|
|
17
|
+
// the shared `labelDisplayText` reduction rather than an `innerHTML` sink, and lets a
|
|
18
|
+
// caller put the preference's own controls beside it through the `child` slot.
|
|
19
|
+
//
|
|
20
|
+
// MODIFICATION: `use-markup` DEFAULTS TRUE in C (adw-preferences-row.c:166-169) and an
|
|
21
|
+
// HTML boolean attribute cannot spell a TRUE default, so the attribute is opt-IN here —
|
|
22
|
+
// the arrangement `<adw-tab-view autohide>` and `<adw-navigation-page can-pop>` already
|
|
23
|
+
// carry, and for the same reason. What it decides is whether a title written as
|
|
24
|
+
// `<b>Dark</b>` Style shows the word `Dark` (markup reduced, C's default) or the literal
|
|
25
|
+
// text; either way the string is TEXT in the DOM, never markup.
|
|
26
|
+
//
|
|
27
|
+
// `activatable` is `GtkListBoxRow`'s, not this class's: the group's list box drives it,
|
|
28
|
+
// and the derived rows in this package (`<adw-action-row>`, `<adw-switch-row>`) are where
|
|
29
|
+
// it is implemented. So it is neither observed nor listed in KNOWN_GAPS — the property
|
|
30
|
+
// check reads the OWN body, and `AdwPreferencesRow` declares only the four above.
|
|
31
|
+
//
|
|
32
|
+
// A11Y: `role="listitem"`. The row IS a `GtkListBoxRow` inside the group's list, and
|
|
33
|
+
// `<adw-preferences-group>` sets `role="group"` on itself for exactly this reason.
|
|
34
|
+
//
|
|
35
|
+
// KNOWN_GAPS: none — all four scalar properties are observed.
|
|
36
|
+
//
|
|
37
|
+
// Reference: refs/libadwaita/src/adw-preferences-row.c (the four pspecs and their
|
|
38
|
+
// defaults, `adw_preferences_row_set_title`'s NULL → "" normalisation)
|
|
39
|
+
// Reference: refs/libadwaita/src/adw-preferences-dialog.c (row_has_title, make_comparable)
|
|
40
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_lists.scss (`row`, `list > row`)
|
|
41
|
+
// Copyright (c) 2019 Purism SPC / GNOME contributors (libadwaita). LGPLv2.1+.
|
|
42
|
+
// Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
|
|
43
|
+
|
|
44
|
+
import { labelDisplayText, stringIsNotEmpty } from '@gjsify/adwaita-core';
|
|
45
|
+
|
|
46
|
+
import { bindEmptySections } from '../empty-sections.js';
|
|
47
|
+
import { bindSlottedChildren } from '../slotted-children.js';
|
|
48
|
+
|
|
49
|
+
export class AdwPreferencesRow extends HTMLElement {
|
|
50
|
+
private _titleEl!: HTMLSpanElement;
|
|
51
|
+
private _contentEl!: HTMLDivElement;
|
|
52
|
+
private _initialized = false;
|
|
53
|
+
|
|
54
|
+
static get observedAttributes() {
|
|
55
|
+
return ['title', 'title-selectable', 'use-markup', 'use-underline'];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** `Adw.PreferencesRow:title` — Pango markup unless {@link useMarkup} is false. */
|
|
59
|
+
get title(): string {
|
|
60
|
+
// `adw_preferences_row_set_title` normalises NULL to the empty string
|
|
61
|
+
// (adw-preferences-row.c:235), and an absent attribute is exactly that NULL.
|
|
62
|
+
return this.getAttribute('title') ?? '';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
set title(value: string) {
|
|
66
|
+
if (value === '') this.removeAttribute('title');
|
|
67
|
+
else this.setAttribute('title', value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** `Adw.PreferencesRow:title-selectable` — the user may copy the title. Default false. */
|
|
71
|
+
get titleSelectable(): boolean {
|
|
72
|
+
return this.hasAttribute('title-selectable');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
set titleSelectable(value: boolean) {
|
|
76
|
+
this.toggleAttribute('title-selectable', value);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** `Adw.PreferencesRow:use-markup` — the title is Pango markup, reduced to its text. */
|
|
80
|
+
get useMarkup(): boolean {
|
|
81
|
+
return this.hasAttribute('use-markup');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
set useMarkup(value: boolean) {
|
|
85
|
+
this.toggleAttribute('use-markup', value);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** `Adw.PreferencesRow:use-underline` — `_` marks a mnemonic. Default false. */
|
|
89
|
+
get useUnderline(): boolean {
|
|
90
|
+
return this.hasAttribute('use-underline');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
set useUnderline(value: boolean) {
|
|
94
|
+
this.toggleAttribute('use-underline', value);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** `Adw.PreferencesRow:child` (inherited from `Gtk.ListBoxRow`) — the row's content. */
|
|
98
|
+
get child(): Element | null {
|
|
99
|
+
return this._contentEl?.firstElementChild ?? null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
set child(value: Element | null) {
|
|
103
|
+
this._contentEl?.replaceChildren(...(value === null ? [] : [value]));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
connectedCallback() {
|
|
107
|
+
if (this._initialized) return;
|
|
108
|
+
this._initialized = true;
|
|
109
|
+
|
|
110
|
+
this._titleEl = document.createElement('span');
|
|
111
|
+
this._titleEl.className = 'adw-row-title';
|
|
112
|
+
|
|
113
|
+
this._contentEl = document.createElement('div');
|
|
114
|
+
this._contentEl.className = 'adw-preferences-row-content';
|
|
115
|
+
|
|
116
|
+
// `child` is a widget property, so a `.blp`'s `child: …` authors `slot="child"`
|
|
117
|
+
// and an unnamed child is the same placement (GtkListBoxRow's own buildable).
|
|
118
|
+
bindSlottedChildren(this, [{ name: 'child', into: this._contentEl }]).install(this._titleEl, this._contentEl);
|
|
119
|
+
bindEmptySections(this._contentEl);
|
|
120
|
+
|
|
121
|
+
this.setAttribute('role', 'listitem');
|
|
122
|
+
this._render();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null) {
|
|
126
|
+
if (!this._initialized) return;
|
|
127
|
+
this._render();
|
|
128
|
+
this.dispatchEvent(new CustomEvent(`notify::${name}`, { bubbles: true, detail: { [name]: value } }));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The title label and the copy permission.
|
|
133
|
+
*
|
|
134
|
+
* `labelDisplayText` reduces Pango markup to its text and strips the mnemonic marker
|
|
135
|
+
* in C's order (markup first, `_` second) — the same reduction `<gtk-label>` uses, so
|
|
136
|
+
* a title written once reads the same in both.
|
|
137
|
+
*/
|
|
138
|
+
private _render(): void {
|
|
139
|
+
const text = labelDisplayText(this.title, this.useMarkup, this.useUnderline);
|
|
140
|
+
this._titleEl.textContent = text;
|
|
141
|
+
// `string_is_not_empty`, the rule every row's label binding uses: a row with no
|
|
142
|
+
// title shows no line, and `row_has_title` keeps it out of the search too.
|
|
143
|
+
this._titleEl.hidden = !stringIsNotEmpty(text);
|
|
144
|
+
// `Gtk.Label:selectable` puts a label in GTK_SELECTION_TEXT; the DOM's spelling
|
|
145
|
+
// of "this text may be copied" is `user-select: text`.
|
|
146
|
+
this._titleEl.style.userSelect = this.titleSelectable ? 'text' : '';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
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);
|