@gjsify/adwaita-web 0.54.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 +8066 -3033
- 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 +1 -1
- 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/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,355 @@
|
|
|
1
|
+
// <gtk-popover-menu-bar> — a horizontal bar of items that pop up a menu when clicked.
|
|
2
|
+
// `GtkPopoverMenuBar` (gtkpopovermenubar.c:24-56) exists in exactly one form: a bar whose
|
|
3
|
+
// contents come from a `GMenuModel` of SUBMENUS, one `item` per submenu and one popover
|
|
4
|
+
// below it. There is no constructor that takes children — `tracker_insert` warns
|
|
5
|
+
// "Don't know how to handle this item" for a toplevel node that is not a submenu link
|
|
6
|
+
// (gtkpopovermenubar.c:466), which is why a non-submenu toplevel is refused HERE with that
|
|
7
|
+
// same wording rather than drawn as a label that opens nothing.
|
|
8
|
+
//
|
|
9
|
+
// What makes it a MENU BAR rather than a row of menu buttons is `set_active_item`
|
|
10
|
+
// (gtkpopovermenubar.c:126-163), and its three rules are the whole element:
|
|
11
|
+
//
|
|
12
|
+
// 1. ONE item is active at a time. Changing it UNSETS `SELECTED` on the old one and sets
|
|
13
|
+
// it on the new one WITHOUT emitting a notify — GTK's state flags are silent, and a
|
|
14
|
+
// `notify` per hover would make `aria-expanded` chatter on the wrong element.
|
|
15
|
+
// 2. CLICKING opens (the `popup` argument is TRUE); HOVERING only SELECTS. The popover
|
|
16
|
+
// then opens only if it was already mapped when the pointer moved on, which is the
|
|
17
|
+
// behaviour that lets a reader walk the bar with the arrow keys and open the bar by
|
|
18
|
+
// arriving — `if (popup || (was_popup && changed)) open_submenu (…)`.
|
|
19
|
+
// 3. THE ITEM WHOSE POPOVER IS OPEN GETS `.active`, and the bar's `leave` clears it only
|
|
20
|
+
// when that popover is not mapped (`bar_leave_cb`, gtkpopovermenubar.c:203-214): a
|
|
21
|
+
// pointer that leaves the bar INTO an open menu keeps the item lit.
|
|
22
|
+
//
|
|
23
|
+
// Arrow keys move between items and WRAP: `gtk_popover_menu_bar_focus`
|
|
24
|
+
// (gtkpopovermenubar.c:221-256) takes LEFT/RIGHT to the previous/next sibling and, past
|
|
25
|
+
// either end, to the last/first child; any other direction returns FALSE so the menu below
|
|
26
|
+
// keeps it. Up/Down is the menu's own, which is why this element does not steal it — and
|
|
27
|
+
// the bar forwards a direction into an open submenu FIRST (:224-231), so a popover that is
|
|
28
|
+
// open is the test for whether the bar or the menu owns the key.
|
|
29
|
+
//
|
|
30
|
+
// Each item's popover is a `GtkPopoverMenu`, pinned to `GTK_POS_BOTTOM` with `has-arrow`
|
|
31
|
+
// FALSE (gtkpopovermenubar.c:435-437), and its accessible relation is LABELLED_BY the item
|
|
32
|
+
// and CONTROLS the popover, with `HAS_POPUP` set and `EXPANDED` maintained by the popover's
|
|
33
|
+
// `show`/`hide` (:322-327, :399-415). This port spells that as `aria-haspopup`,
|
|
34
|
+
// `aria-expanded` and `aria-controls`.
|
|
35
|
+
//
|
|
36
|
+
// Attributes:
|
|
37
|
+
// menu-model — the portable menu model as JSON (ADR 0042), whose TOPLEVEL entries must
|
|
38
|
+
// all be submenus.
|
|
39
|
+
// Properties:
|
|
40
|
+
// menuModel — the model, normalised (get/set; a `custom` item throws here).
|
|
41
|
+
// actions — what the action group publishes about the actions the menus name.
|
|
42
|
+
// activeItem — the focused/selected item's button, or `null`. GTK's `active_item`.
|
|
43
|
+
// Methods:
|
|
44
|
+
// selectFirst() — `gtk_popover_menu_bar_select_first` (:761-767): activate the first item
|
|
45
|
+
// and open it.
|
|
46
|
+
// popup() — what the bar's `menu.popup` action does, which is the same thing.
|
|
47
|
+
// Events:
|
|
48
|
+
// `menu-item-activated` (CustomEvent, bubbles, detail = { id, label, path }) — an item in
|
|
49
|
+
// one of the popovers was chosen; `path` addresses it in the WHOLE model, so the
|
|
50
|
+
// `File ▸ New` row reports `[0, 0]`.
|
|
51
|
+
//
|
|
52
|
+
// KNOWN_GAPS — none: `menu-model` is the widget's only property and it is observed.
|
|
53
|
+
//
|
|
54
|
+
// Reference: refs/gtk/gtk/gtkpopovermenubar.c (the class docs :24-56, `set_active_item`
|
|
55
|
+
// :126-163, `…_focus` :221-256, `tracker_insert` :422-468, the `leave` handler :203-214)
|
|
56
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_menus.scss:244-269 (`menubar > item`)
|
|
57
|
+
// Copyright (c) GNOME contributors (GTK, libadwaita). LGPLv2.1+
|
|
58
|
+
// Modifications: Implemented as a Web Component for @gjsify/adwaita-web.
|
|
59
|
+
|
|
60
|
+
import {
|
|
61
|
+
ADW_MENU_SURFACE_WEB,
|
|
62
|
+
assertMenuRenderable,
|
|
63
|
+
menuItemAt,
|
|
64
|
+
menuRefusals,
|
|
65
|
+
normalizeMenuModel,
|
|
66
|
+
parseMenuModel,
|
|
67
|
+
} from '@gjsify/adwaita-core';
|
|
68
|
+
import type { AdwMenuActions, AdwMenuInput, AdwMenuModel, AdwMenuPath, AdwMenuSubmenu } from '@gjsify/adwaita-core';
|
|
69
|
+
|
|
70
|
+
// The definition has to be there before this module's own can build one in
|
|
71
|
+
// `connectedCallback`; a combined `import { GtkPopoverMenu }` would be elided, because the
|
|
72
|
+
// binding is only used in type position.
|
|
73
|
+
import './gtk-popover-menu.js';
|
|
74
|
+
|
|
75
|
+
import type { GtkPopoverMenu } from './gtk-popover-menu.js';
|
|
76
|
+
|
|
77
|
+
/** One bar item: its submenu node, the popover below it, and the DOM that draws both. */
|
|
78
|
+
interface MenuBarItem {
|
|
79
|
+
/** The submenu node this item was built from — the source of the label. */
|
|
80
|
+
node: AdwMenuSubmenu;
|
|
81
|
+
/** The item's own path in the whole model, so a row inside it reports one path. */
|
|
82
|
+
path: AdwMenuPath;
|
|
83
|
+
root: HTMLElement;
|
|
84
|
+
button: HTMLButtonElement;
|
|
85
|
+
popover: GtkPopoverMenu;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export class GtkPopoverMenuBar extends HTMLElement {
|
|
89
|
+
private _model: AdwMenuModel = [];
|
|
90
|
+
private _actions: AdwMenuActions | null = null;
|
|
91
|
+
private _items: MenuBarItem[] = [];
|
|
92
|
+
private _active: MenuBarItem | null = null;
|
|
93
|
+
private _initialized = false;
|
|
94
|
+
|
|
95
|
+
static get observedAttributes() {
|
|
96
|
+
return ['menu-model'];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** The menu model, normalised (ADR 0042). */
|
|
100
|
+
get menuModel(): AdwMenuModel {
|
|
101
|
+
return this._model;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
set menuModel(value: AdwMenuInput) {
|
|
105
|
+
this._model = normalizeMenuModel(value);
|
|
106
|
+
assertMenuRenderable(this._model, ADW_MENU_SURFACE_WEB);
|
|
107
|
+
if (this._initialized) this._rebuild();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** What the action group publishes about the actions these menus name (ADR 0042). */
|
|
111
|
+
get actions(): AdwMenuActions | null {
|
|
112
|
+
return this._actions;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
set actions(value: AdwMenuActions | null) {
|
|
116
|
+
this._actions = value ?? null;
|
|
117
|
+
if (this._initialized) this._rebuild();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** The active item's button, or `null` — GTK's `active_item`, as a widget. */
|
|
121
|
+
get activeItem(): HTMLElement | null {
|
|
122
|
+
return this._active?.button ?? null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
connectedCallback() {
|
|
126
|
+
if (this._initialized) return;
|
|
127
|
+
this._initialized = true;
|
|
128
|
+
this.classList.add('adw-popover-menu-bar');
|
|
129
|
+
// `gtk_widget_class_set_accessible_role (…, GTK_ACCESSIBLE_ROLE_MENU_BAR)`
|
|
130
|
+
// (gtkpopovermenubar.c:641).
|
|
131
|
+
this.setAttribute('role', 'menubar');
|
|
132
|
+
this.addEventListener('keydown', (event) => this._onKeyDown(event));
|
|
133
|
+
// `bar_leave_cb` is installed on the BAR, not on an item (gtkpopovermenubar.c:650-656).
|
|
134
|
+
this.addEventListener('pointerleave', () => {
|
|
135
|
+
if (this._active !== null && !this._active.popover.open) this._setActive(null, false);
|
|
136
|
+
});
|
|
137
|
+
if (this._model.length === 0) this._model = this._parseMenuAttr();
|
|
138
|
+
this._rebuild();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
attributeChangedCallback(name?: string) {
|
|
142
|
+
if (!this._initialized || name !== 'menu-model') return;
|
|
143
|
+
this._model = this._parseMenuAttr();
|
|
144
|
+
this._rebuild();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** `gtk_popover_menu_bar_select_first` — activate and OPEN the first item. */
|
|
148
|
+
selectFirst(): void {
|
|
149
|
+
this._setActive(this._items[0] ?? null, true);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** What the bar's `menu.popup` action does, which is the same thing. */
|
|
153
|
+
popup(): void {
|
|
154
|
+
this.selectFirst();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* `set_active_item` (gtkpopovermenubar.c:126-163), variable names and all.
|
|
159
|
+
*
|
|
160
|
+
* `changed` and `was_popup` decide three DIFFERENT outcomes — close the old one, open
|
|
161
|
+
* the new one, or move focus onto it — and collapsing them is how a hover would come to
|
|
162
|
+
* open menus, which is the single behaviour that separates a menubar from a row of menu
|
|
163
|
+
* buttons.
|
|
164
|
+
*/
|
|
165
|
+
private _setActive(item: MenuBarItem | null, popup: boolean): void {
|
|
166
|
+
const changed = item !== this._active;
|
|
167
|
+
// The C reads the OLD item's popover through `gtk_widget_get_mapped`; `open` is
|
|
168
|
+
// that same question, asked of the same widget in this renderer.
|
|
169
|
+
const wasPopup = this._active !== null && this._active.popover.open;
|
|
170
|
+
|
|
171
|
+
if (wasPopup && changed) this._active?.popover.popdown();
|
|
172
|
+
if (changed) {
|
|
173
|
+
this._active?.button.classList.remove('selected');
|
|
174
|
+
this._active = item;
|
|
175
|
+
// `gtk_widget_set_state_flags (…, GTK_STATE_FLAG_SELECTED, FALSE)` — the
|
|
176
|
+
// no-notify argument. A notify here would be an `aria-expanded` per pointer move.
|
|
177
|
+
item?.button.classList.add('selected');
|
|
178
|
+
}
|
|
179
|
+
if (this._active === null) return;
|
|
180
|
+
if (popup || (wasPopup && changed)) this._active.popover.open = true;
|
|
181
|
+
else if (changed && this.matches(':focus-within')) this._active.button.focus();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
private _onKeyDown(event: KeyboardEvent): void {
|
|
185
|
+
// The bar's `focus` vfunc forwards the direction into an open submenu FIRST and
|
|
186
|
+
// only then moves between items (gtkpopovermenubar.c:224-231), so an open popover
|
|
187
|
+
// is the test for who owns the key. `<gtk-popover>` and `PopoverMenuView` inside it
|
|
188
|
+
// handle Up/Down/Left/Right themselves in that state.
|
|
189
|
+
if (this._active?.popover.open === true) return;
|
|
190
|
+
if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;
|
|
191
|
+
event.preventDefault();
|
|
192
|
+
this._move(event.key === 'ArrowRight' ? 1 : -1);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The sibling in `step`'s direction, WRAPPING at either end
|
|
197
|
+
* (gtkpopovermenubar.c:232-252): with no active item there is no sibling, so the first
|
|
198
|
+
* move goes to the first child for RIGHT and to the LAST for LEFT.
|
|
199
|
+
*/
|
|
200
|
+
private _move(step: number): void {
|
|
201
|
+
const count = this._items.length;
|
|
202
|
+
if (count === 0) return;
|
|
203
|
+
const current = this._active === null ? -1 : this._items.indexOf(this._active);
|
|
204
|
+
let next = current + step;
|
|
205
|
+
if (next < 0) next = count - 1;
|
|
206
|
+
if (next >= count) next = 0;
|
|
207
|
+
this._setActive(this._items[next], false);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private _rebuild(): void {
|
|
211
|
+
this._items = [];
|
|
212
|
+
this._active = null;
|
|
213
|
+
const built: MenuBarItem[] = [];
|
|
214
|
+
this._model.forEach((node, index) => {
|
|
215
|
+
if (node.kind !== 'submenu') return;
|
|
216
|
+
built.push(this._buildItem(node, [index]));
|
|
217
|
+
});
|
|
218
|
+
this._items = built;
|
|
219
|
+
this.replaceChildren(...built.map((item) => item.root));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Focus the first row a key can reach in a menu that has just opened.
|
|
224
|
+
*
|
|
225
|
+
* This is what `autohide` does in GTK: `gtk_popover_show` calls
|
|
226
|
+
* `gtk_widget_child_focus (widget, GTK_DIR_TAB_FORWARD)` when the property holds
|
|
227
|
+
* (gtkpopover.c:1188-1192), and a browser popup takes no focus until it is told to —
|
|
228
|
+
* which is why the item whose menu opened is what does it here.
|
|
229
|
+
*/
|
|
230
|
+
private _focusFirstRow(popover: GtkPopoverMenu): void {
|
|
231
|
+
const row = popover.querySelector<HTMLButtonElement>('.adw-popover-item:not([hidden]):not([disabled])');
|
|
232
|
+
row?.focus();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* One `menubar > item > popover` (the node tree in gtkpopovermenubar.c:38-46).
|
|
237
|
+
*
|
|
238
|
+
* A toplevel node that is not a submenu is refused by `_parseMenuAttr` with GTK's own
|
|
239
|
+
* wording rather than drawn: `tracker_insert` builds nothing for it
|
|
240
|
+
* (gtkpopovermenubar.c:466), and a row that opens nothing is the same lie in another
|
|
241
|
+
* shape.
|
|
242
|
+
*/
|
|
243
|
+
private _buildItem(node: AdwMenuSubmenu, path: AdwMenuPath): MenuBarItem {
|
|
244
|
+
const root = document.createElement('div');
|
|
245
|
+
// The wrapper is GTK's `item` NODE, which carries no accessible role of its own —
|
|
246
|
+
// `menubar`'s children are the `menuitem`s (gtkpopovermenubar.c:55-57). `none` is
|
|
247
|
+
// what keeps the wrapper from being read as a second level of the bar.
|
|
248
|
+
root.className = 'adw-popover-menu-bar-item';
|
|
249
|
+
root.setAttribute('role', 'none');
|
|
250
|
+
|
|
251
|
+
const button = document.createElement('button');
|
|
252
|
+
button.type = 'button';
|
|
253
|
+
button.className = 'adw-popover-menu-bar-button';
|
|
254
|
+
// `gtk_widget_class_set_accessible_role (…, GTK_ACCESSIBLE_ROLE_MENU_ITEM)` and
|
|
255
|
+
// `set_activate_signal` (gtkpopovermenubar.c:347-349) — which is why a Space or
|
|
256
|
+
// Enter on the item opens its menu through the same click a pointer gives.
|
|
257
|
+
button.setAttribute('role', 'menuitem');
|
|
258
|
+
button.setAttribute('aria-haspopup', 'menu');
|
|
259
|
+
button.setAttribute('aria-expanded', 'false');
|
|
260
|
+
const label = document.createElement('span');
|
|
261
|
+
label.className = 'adw-popover-menu-bar-label';
|
|
262
|
+
label.textContent = node.label;
|
|
263
|
+
button.appendChild(label);
|
|
264
|
+
|
|
265
|
+
const popover = document.createElement('gtk-popover-menu') as GtkPopoverMenu;
|
|
266
|
+
// `gtk_popover_set_position (popover, GTK_POS_BOTTOM)` and `set_has_arrow (FALSE)`
|
|
267
|
+
// (gtkpopovermenubar.c:435-436).
|
|
268
|
+
popover.setAttribute('position', 'bottom');
|
|
269
|
+
popover.setAttribute('align', 'start');
|
|
270
|
+
// The submenu's OWN items, handed back as they are: `normalizeMenuModel` is
|
|
271
|
+
// idempotent and explicitly takes an already-normalised node (ADR 0042).
|
|
272
|
+
popover.menuModel = node.items;
|
|
273
|
+
popover.actions = this._actions;
|
|
274
|
+
popover.anchor = button;
|
|
275
|
+
// `gtk_accessible_update_relation (…, LABELLED_BY, item->label, CONTROLS,
|
|
276
|
+
// item->popover)` (gtkpopovermenubar.c:322-327).
|
|
277
|
+
button.setAttribute('aria-controls', 'popover');
|
|
278
|
+
|
|
279
|
+
const item: MenuBarItem = { node, path, root, button, popover };
|
|
280
|
+
popover.subscribe((open) => {
|
|
281
|
+
button.setAttribute('aria-expanded', String(open));
|
|
282
|
+
if (open) {
|
|
283
|
+
// `.active` belongs to the item whose popover is OPEN, not to the selected
|
|
284
|
+
// one (gtkpopovermenubar.c:50-51), which is why hover does not light it.
|
|
285
|
+
for (const candidate of this._items) candidate.root.classList.toggle('active', candidate === item);
|
|
286
|
+
this._focusFirstRow(popover);
|
|
287
|
+
} else {
|
|
288
|
+
item.root.classList.remove('active');
|
|
289
|
+
// `popover_unmap` clears the active item when its OWN popover unmaps
|
|
290
|
+
// (gtkpopovermenubar.c:389-396): the reader is back in the bar with nothing
|
|
291
|
+
// lit and no stale selection. The POPOVER resets its own page for the same
|
|
292
|
+
// reason — a menu that reopens three levels deep is one nobody gets out of.
|
|
293
|
+
if (this._active === item) this._active = null;
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
// The popover's OWN activation, re-addressed against the BAR's model. Listening to
|
|
297
|
+
// the element rather than driving a second view is the whole point: two views on one
|
|
298
|
+
// surface is two models to keep in step, and the second render of the pair wins —
|
|
299
|
+
// which is how the rows of every item's menu came out empty.
|
|
300
|
+
popover.addEventListener('menu-item-activated', (event) => {
|
|
301
|
+
// CONSUMED, not forwarded: the popover's path is relative to its OWN submenu,
|
|
302
|
+
// and a bar-level listener must see one address for the whole model. Left to
|
|
303
|
+
// bubble it would arrive AFTER this handler's re-dispatch with the shorter
|
|
304
|
+
// path — two activations of one choice, the second one wrong.
|
|
305
|
+
event.stopPropagation();
|
|
306
|
+
const inner = (event as CustomEvent<{ path: number[] }>).detail;
|
|
307
|
+
this._activate(item, [...path, ...inner.path]);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// CLICK opens (`clicked_cb` passes TRUE, gtkpopovermenubar.c:165-176); HOVER only
|
|
311
|
+
// selects (`item_enter_cb` passes FALSE, :178-189).
|
|
312
|
+
button.addEventListener('click', () => this._setActive(item, true));
|
|
313
|
+
root.addEventListener('pointerenter', () => this._setActive(item, false));
|
|
314
|
+
|
|
315
|
+
root.append(button, popover);
|
|
316
|
+
return item;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Activating a row inside one of the popovers closes THAT popover and hands focus back
|
|
321
|
+
* to its item, which is what `gtk_popover_menu_set_active_item` does when the active
|
|
322
|
+
* row is not the row that opened a submenu (gtkpopovermenu.c:257-259).
|
|
323
|
+
*/
|
|
324
|
+
private _activate(item: MenuBarItem, path: AdwMenuPath): void {
|
|
325
|
+
const target = menuItemAt(this._model, path);
|
|
326
|
+
item.popover.popdown();
|
|
327
|
+
item.button.focus();
|
|
328
|
+
if (target === null) return;
|
|
329
|
+
this.dispatchEvent(
|
|
330
|
+
new CustomEvent('menu-item-activated', {
|
|
331
|
+
bubbles: true,
|
|
332
|
+
detail: { id: target.id ?? target.label, label: target.label, path: [...path] },
|
|
333
|
+
}),
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
private _parseMenuAttr(): AdwMenuModel {
|
|
338
|
+
const model = normalizeMenuModel(parseMenuModel(this.getAttribute('menu-model')));
|
|
339
|
+
const refusals = menuRefusals(model, ADW_MENU_SURFACE_WEB);
|
|
340
|
+
if (refusals.length > 0) {
|
|
341
|
+
console.error(`${ADW_MENU_SURFACE_WEB.name} cannot render this menu, so it has none:`);
|
|
342
|
+
for (const refusal of refusals) console.error(` [${refusal.path.join('.')}] ${refusal.message}`);
|
|
343
|
+
return [];
|
|
344
|
+
}
|
|
345
|
+
for (const [index, node] of model.entries()) {
|
|
346
|
+
if (node.kind === 'submenu') continue;
|
|
347
|
+
// A WARNING and not an error, and the distinction is GTK's: `g_warning` is
|
|
348
|
+
// recoverable, and the submenus beside the offending entry still work.
|
|
349
|
+
console.warn(`Don't know how to handle this item: top-level entry ${index} is a ${node.kind}.`);
|
|
350
|
+
}
|
|
351
|
+
return model;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
customElements.define('gtk-popover-menu-bar', GtkPopoverMenuBar);
|