@gjsify/example-gtk-adwaita-storybook 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/browser-main.js +435 -35
- package/package.json +5 -5
- package/src/browser/embed.ts +6 -15
- package/src/browser/main.ts +7 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/example-gtk-adwaita-storybook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.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.
|
|
58
|
-
"@gjsify/cli": "^0.
|
|
57
|
+
"@gjsify/adwaita-web": "^0.37.0",
|
|
58
|
+
"@gjsify/cli": "^0.37.0",
|
|
59
59
|
"@gjsify/node-gi": "file:../../../packages/node-gi/node-gi",
|
|
60
|
-
"@gjsify/storybook": "^0.
|
|
61
|
-
"@gjsify/adwaita-storybook": "^0.
|
|
60
|
+
"@gjsify/storybook": "^0.37.0",
|
|
61
|
+
"@gjsify/adwaita-storybook": "^0.37.0",
|
|
62
62
|
"@types/node": "^25.9.2",
|
|
63
63
|
"typescript": "^6.0.3"
|
|
64
64
|
},
|
package/src/browser/embed.ts
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// expose (e.g. `@gjsify/example-dom-minimalist-browser/browser`). The gjsify
|
|
4
|
-
// website uses it to embed the storybook live in its showcase pages and the
|
|
5
|
-
// home-page slideshow.
|
|
1
|
+
// `mount(container)` renders the storybook into any DOM element, the same contract the DOM showcases
|
|
2
|
+
// expose, which is how the gjsify website embeds it live.
|
|
6
3
|
//
|
|
7
|
-
// The
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// responsive (it collapses to single-pane navigation below 720px, like the
|
|
11
|
-
// native `Adw.Breakpoint`), so it adapts to both the wide doc-page embed and
|
|
12
|
-
// narrow mobile layouts.
|
|
4
|
+
// The root is an `<adw-window>`, and the website's embed CSS sizes any `adw-window` to fill its slot,
|
|
5
|
+
// so the storybook fills its container as the native window fills its toplevel. The renderer
|
|
6
|
+
// collapses to single-pane navigation below 720px, mirroring the native `Adw.Breakpoint`.
|
|
13
7
|
|
|
14
8
|
import { mountStorybook } from '@gjsify/adwaita-storybook';
|
|
15
9
|
import { stories } from './stories.js';
|
|
16
10
|
|
|
17
11
|
export interface ShowcaseHandle {
|
|
18
|
-
/**
|
|
12
|
+
/** Inert: the storybook has no rAF loop. Present only for the slideshow's handle contract. */
|
|
19
13
|
pause(): void;
|
|
20
14
|
resume(): void;
|
|
21
15
|
readonly isPaused: boolean;
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
export interface MountOptions {
|
|
25
|
-
/** Window title shown in the sidebar header (default "Adwaita Storybook"). */
|
|
26
19
|
title?: string;
|
|
27
20
|
}
|
|
28
21
|
|
|
29
22
|
export function mount(container: HTMLElement, options?: MountOptions): ShowcaseHandle {
|
|
30
23
|
mountStorybook(container, { title: options?.title ?? 'Adwaita Storybook', stories });
|
|
31
24
|
|
|
32
|
-
// The storybook is static (no rAF loop), so pause/resume are inert — they
|
|
33
|
-
// exist only to satisfy the slideshow's optional ShowcaseHandle contract.
|
|
34
25
|
let paused = false;
|
|
35
26
|
return {
|
|
36
27
|
pause(): void {
|
package/src/browser/main.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
// Browser entry
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// parity that is held is behavioural, via the @gjsify/adwaita-core/conformance
|
|
7
|
-
// vectors both renderer suites assert against.
|
|
1
|
+
// Browser entry, mounting the storybook from @gjsify/adwaita-web custom elements as a mirror of the
|
|
2
|
+
// native GTK one (`gjsify storybook`). Each *.web.ts story shares metadata with its GTK *.story.ts
|
|
3
|
+
// twin, so both targets expose identical controls. Parity is BEHAVIOURAL, asserted by both renderer
|
|
4
|
+
// suites against the @gjsify/adwaita-core/conformance vectors — there is no screenshot harness
|
|
5
|
+
// (#1052).
|
|
8
6
|
//
|
|
9
|
-
// The story list
|
|
10
|
-
//
|
|
11
|
-
// in lockstep.
|
|
7
|
+
// The story list is in ./stories.ts so this standalone entry and the embeddable `mount(container)`
|
|
8
|
+
// in ./embed.ts stay in lockstep.
|
|
12
9
|
|
|
13
10
|
import { mountStorybook } from '@gjsify/adwaita-storybook';
|
|
14
11
|
import { stories } from './stories.js';
|