@gjsify/example-gtk-adwaita-storybook 0.40.0 → 0.41.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/example-gtk-adwaita-storybook",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "description": "Interactive component browser for Libadwaita widgets — a native Adwaita storybook built on @gjsify/storybook, debuggable over DBus/MCP via @gjsify/devtools",
5
5
  "type": "module",
6
6
  "main": "dist/gjs.js",
@@ -54,11 +54,11 @@
54
54
  "@girs/glib-2.0": "^4.1.0",
55
55
  "@girs/gobject-2.0": "^4.1.0",
56
56
  "@girs/gtk-4.0": "^4.1.0",
57
- "@gjsify/adwaita-web": "^0.40.0",
58
- "@gjsify/cli": "^0.40.0",
57
+ "@gjsify/adwaita-web": "^0.41.0",
58
+ "@gjsify/cli": "^0.41.0",
59
59
  "@gjsify/node-gi": "file:../../../packages/node-gi/node-gi",
60
- "@gjsify/storybook": "^0.40.0",
61
- "@gjsify/adwaita-storybook": "^0.40.0",
60
+ "@gjsify/storybook": "^0.41.0",
61
+ "@gjsify/adwaita-storybook": "^0.41.0",
62
62
  "@types/node": "^25.9.2",
63
63
  "typescript": "^6.0.3"
64
64
  },
@@ -60,17 +60,27 @@ export class NavigationViewWebStory extends StoryElement {
60
60
  openButton.setAttribute('label', 'Open contact');
61
61
  openButton.setAttribute('pill', '');
62
62
  openButton.setAttribute('suggested', '');
63
- openButton.classList.add('adw-navigation-view-root-action');
64
63
  openButton.addEventListener('click', () => {
65
64
  this._view?.push('detail');
66
65
  });
67
66
 
67
+ // The GJS story builds this button with `halign: CENTER, valign: CENTER`,
68
+ // because Adw.ToolbarView hands its content widget the whole rect and a
69
+ // widget that wants less says so through its alignment. This is that
70
+ // sentence in the web port: a centring box around the button. It used to be
71
+ // a bare `adw-navigation-view-root-action` class, which matched no rule in
72
+ // any stylesheet, so the button was laid out wherever it happened to land.
73
+ const rootAction = document.createElement('div');
74
+ rootAction.style.cssText =
75
+ 'display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;';
76
+ rootAction.appendChild(openButton);
77
+
68
78
  const rootHeader = document.createElement('adw-header-bar');
69
79
  rootHeader.setAttribute('slot', 'top');
70
80
  rootHeader.appendChild(this._rootTitle);
71
81
 
72
82
  const rootToolbar = document.createElement('adw-toolbar-view');
73
- rootToolbar.append(rootHeader, openButton);
83
+ rootToolbar.append(rootHeader, rootAction);
74
84
 
75
85
  const rootPage = document.createElement('adw-navigation-page');
76
86
  rootPage.setAttribute('tag', 'root');