@gtkx/react 0.14.0 → 0.15.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 +27 -27
- package/dist/generated/jsx.d.ts +235 -228
- package/dist/host-config.js +2 -2
- package/dist/jsx.d.ts +111 -2
- package/dist/jsx.js +79 -0
- package/dist/nodes/adjustment.d.ts +48 -0
- package/dist/nodes/adjustment.js +70 -0
- package/dist/nodes/calendar.js +3 -16
- package/dist/nodes/column-view-column.d.ts +1 -0
- package/dist/nodes/column-view-column.js +4 -0
- package/dist/nodes/column-view.js +6 -6
- package/dist/nodes/drawing-area.d.ts +1 -0
- package/dist/nodes/drawing-area.js +19 -0
- package/dist/nodes/expander-row.js +1 -0
- package/dist/nodes/index.d.ts +8 -0
- package/dist/nodes/index.js +8 -0
- package/dist/nodes/internal/constants.js +3 -0
- package/dist/nodes/internal/list-item-renderer.d.ts +1 -0
- package/dist/nodes/internal/list-item-renderer.js +5 -0
- package/dist/nodes/internal/predicates.d.ts +4 -0
- package/dist/nodes/internal/predicates.js +3 -0
- package/dist/nodes/internal/signal-store.d.ts +1 -0
- package/dist/nodes/internal/signal-store.js +7 -0
- package/dist/nodes/internal/tree-list-item-renderer.d.ts +1 -0
- package/dist/nodes/internal/tree-list-item-renderer.js +8 -0
- package/dist/nodes/level-bar.js +3 -16
- package/dist/nodes/list-view.js +6 -2
- package/dist/nodes/navigation-page.js +32 -23
- package/dist/nodes/notebook-page-tab.d.ts +1 -0
- package/dist/nodes/notebook-page-tab.js +15 -9
- package/dist/nodes/notebook-page.js +9 -6
- package/dist/nodes/scale.js +3 -16
- package/dist/nodes/scrolled-window.js +3 -2
- package/dist/nodes/shortcut-controller.d.ts +37 -0
- package/dist/nodes/shortcut-controller.js +74 -0
- package/dist/nodes/shortcut.d.ts +38 -0
- package/dist/nodes/shortcut.js +46 -0
- package/dist/nodes/source-buffer.d.ts +73 -0
- package/dist/nodes/source-buffer.js +149 -0
- package/dist/nodes/source-view.d.ts +1 -0
- package/dist/nodes/source-view.js +42 -0
- package/dist/nodes/stack-page.js +15 -9
- package/dist/nodes/text-buffer.d.ts +43 -0
- package/dist/nodes/text-buffer.js +81 -0
- package/dist/nodes/text-view.d.ts +1 -0
- package/dist/nodes/text-view.js +45 -0
- package/dist/nodes/tree-list-view.js +6 -2
- package/dist/nodes/widget.d.ts +4 -0
- package/dist/nodes/widget.js +85 -10
- package/dist/nodes/window.js +7 -5
- package/dist/types.d.ts +26 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -31,36 +31,36 @@ npm run dev
|
|
|
31
31
|
|
|
32
32
|
```tsx
|
|
33
33
|
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
GtkApplicationWindow,
|
|
35
|
+
GtkBox,
|
|
36
|
+
GtkButton,
|
|
37
|
+
GtkLabel,
|
|
38
|
+
quit,
|
|
39
|
+
render,
|
|
40
40
|
} from "@gtkx/react";
|
|
41
41
|
import * as Gtk from "@gtkx/ffi/gtk";
|
|
42
42
|
import { useState } from "react";
|
|
43
43
|
|
|
44
44
|
const App = () => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
const [count, setCount] = useState(0);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<GtkApplicationWindow
|
|
49
|
+
title="Counter"
|
|
50
|
+
defaultWidth={300}
|
|
51
|
+
defaultHeight={200}
|
|
52
|
+
onClose={quit}
|
|
53
|
+
>
|
|
54
|
+
<GtkBox
|
|
55
|
+
orientation={Gtk.Orientation.VERTICAL}
|
|
56
|
+
spacing={20}
|
|
57
|
+
valign={Gtk.Align.CENTER}
|
|
58
|
+
>
|
|
59
|
+
<GtkLabel label={`Count: ${count}`} cssClasses={["title-1"]} />
|
|
60
|
+
<GtkButton label="Increment" onClicked={() => setCount((c) => c + 1)} />
|
|
61
|
+
</GtkBox>
|
|
62
|
+
</GtkApplicationWindow>
|
|
63
|
+
);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
render(<App />, "com.example.counter");
|
|
@@ -80,11 +80,11 @@ render(<App />, "com.example.counter");
|
|
|
80
80
|
|
|
81
81
|
Explore complete applications in the [`examples/`](./examples) directory:
|
|
82
82
|
|
|
83
|
-
- **[browser](./examples/browser)** — Simple browser using WebKitWebView
|
|
84
83
|
- **[gtk-demo](./examples/gtk-demo)** — Full replica of the official GTK demo app
|
|
85
84
|
- **[hello-world](./examples/hello-world)** — Minimal application showing a counter
|
|
86
85
|
- **[todo](./examples/todo)** — Full-featured todo application with Adwaita styling and testing
|
|
87
|
-
- **[x-showcase](./examples/x-showcase)** — Showcase of all x
|
|
86
|
+
- **[x-showcase](./examples/x-showcase)** — Showcase of all x.\* virtual components
|
|
87
|
+
- **[browser](./examples/browser)** — Simple browser using WebKitWebView
|
|
88
88
|
- **[deploying](./examples/deploying)** — Example of packaging and distributing a GTKX app
|
|
89
89
|
|
|
90
90
|
## Documentation
|