@gtkx/react 0.9.3 → 0.10.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 +55 -67
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +8 -8
- package/dist/factory.d.ts +3 -5
- package/dist/factory.js +18 -71
- package/dist/fiber-root.d.ts +1 -1
- package/dist/fiber-root.js +1 -2
- package/dist/generated/internal.d.ts +3 -6
- package/dist/generated/internal.js +10386 -13577
- package/dist/generated/jsx.d.ts +2325 -2219
- package/dist/generated/jsx.js +1339 -1574
- package/dist/generated/registry.d.ts +4 -0
- package/dist/generated/registry.js +13 -0
- package/dist/host-config.d.ts +7 -4
- package/dist/host-config.js +53 -18
- package/dist/index.d.ts +2 -22
- package/dist/index.js +2 -40
- package/dist/jsx.d.ts +719 -0
- package/dist/jsx.js +392 -0
- package/dist/node.d.ts +15 -32
- package/dist/node.js +20 -240
- package/dist/nodes/action-row-child.d.ts +21 -0
- package/dist/nodes/action-row-child.js +69 -0
- package/dist/nodes/action-row.js +33 -0
- package/dist/nodes/application.d.ts +1 -0
- package/dist/nodes/application.js +38 -0
- package/dist/nodes/autowrapped.d.ts +1 -0
- package/dist/nodes/autowrapped.js +109 -0
- package/dist/nodes/column-view-column.d.ts +16 -0
- package/dist/nodes/column-view-column.js +54 -0
- package/dist/nodes/column-view.d.ts +0 -59
- package/dist/nodes/column-view.js +107 -226
- package/dist/nodes/fixed-child.d.ts +1 -0
- package/dist/nodes/fixed-child.js +45 -0
- package/dist/nodes/grid-child.d.ts +1 -0
- package/dist/nodes/grid-child.js +54 -0
- package/dist/nodes/index.d.ts +34 -0
- package/dist/nodes/index.js +34 -0
- package/dist/nodes/internal/list-item-renderer.d.ts +18 -0
- package/dist/nodes/internal/list-item-renderer.js +67 -0
- package/dist/nodes/internal/list-store.d.ts +16 -0
- package/dist/nodes/internal/list-store.js +69 -0
- package/dist/nodes/internal/predicates.d.ts +26 -0
- package/dist/nodes/internal/predicates.js +36 -0
- package/dist/nodes/internal/signal-store.d.ts +9 -0
- package/dist/nodes/internal/signal-store.js +54 -0
- package/dist/nodes/internal/simple-list-store.d.ts +14 -0
- package/dist/nodes/internal/simple-list-store.js +60 -0
- package/dist/nodes/internal/tree-list-item-renderer.d.ts +18 -0
- package/dist/nodes/internal/tree-list-item-renderer.js +90 -0
- package/dist/nodes/internal/tree-store.d.ts +28 -0
- package/dist/nodes/internal/tree-store.js +153 -0
- package/dist/nodes/internal/utils.d.ts +3 -0
- package/dist/nodes/internal/utils.js +20 -0
- package/dist/nodes/list-item.d.ts +12 -0
- package/dist/nodes/list-item.js +24 -0
- package/dist/nodes/list-view.d.ts +0 -22
- package/dist/nodes/list-view.js +45 -38
- package/dist/nodes/menu.d.ts +6 -106
- package/dist/nodes/menu.js +16 -268
- package/dist/nodes/models/list.d.ts +24 -0
- package/dist/nodes/models/list.js +102 -0
- package/dist/nodes/models/menu.d.ts +45 -0
- package/dist/nodes/models/menu.js +265 -0
- package/dist/nodes/models/tree-list.d.ts +28 -0
- package/dist/nodes/models/tree-list.js +141 -0
- package/dist/nodes/navigation-page.d.ts +21 -0
- package/dist/nodes/navigation-page.js +95 -0
- package/dist/nodes/navigation-view.d.ts +1 -0
- package/dist/nodes/navigation-view.js +29 -0
- package/dist/nodes/notebook-page-tab.d.ts +15 -0
- package/dist/nodes/notebook-page-tab.js +42 -0
- package/dist/nodes/notebook-page.d.ts +23 -0
- package/dist/nodes/notebook-page.js +106 -0
- package/dist/nodes/notebook.d.ts +0 -32
- package/dist/nodes/notebook.js +20 -113
- package/dist/nodes/overlay-child.d.ts +1 -0
- package/dist/nodes/overlay-child.js +30 -0
- package/dist/nodes/pack-child.d.ts +21 -0
- package/dist/nodes/pack-child.js +68 -0
- package/dist/nodes/pack.d.ts +1 -0
- package/dist/nodes/pack.js +33 -0
- package/dist/nodes/popover-menu.d.ts +1 -0
- package/dist/nodes/popover-menu.js +58 -0
- package/dist/nodes/simple-list-item.d.ts +9 -0
- package/dist/nodes/simple-list-item.js +9 -0
- package/dist/nodes/simple-list-view.d.ts +1 -0
- package/dist/nodes/simple-list-view.js +75 -0
- package/dist/nodes/slot.d.ts +18 -10
- package/dist/nodes/slot.js +83 -51
- package/dist/nodes/stack-page.d.ts +1 -0
- package/dist/nodes/stack-page.js +80 -0
- package/dist/nodes/stack.d.ts +1 -22
- package/dist/nodes/stack.js +21 -60
- package/dist/nodes/toast-overlay.d.ts +1 -0
- package/dist/nodes/toast-overlay.js +35 -0
- package/dist/nodes/toast.d.ts +17 -0
- package/dist/nodes/toast.js +77 -0
- package/dist/nodes/toolbar-child.d.ts +9 -0
- package/dist/nodes/toolbar-child.js +33 -0
- package/dist/nodes/toolbar.d.ts +1 -0
- package/dist/nodes/toolbar.js +42 -0
- package/dist/nodes/tree-list-item.d.ts +20 -0
- package/dist/nodes/tree-list-item.js +102 -0
- package/dist/nodes/tree-list-view.d.ts +1 -0
- package/dist/nodes/tree-list-view.js +57 -0
- package/dist/nodes/virtual.d.ts +13 -0
- package/dist/nodes/virtual.js +21 -0
- package/dist/nodes/widget.d.ts +17 -3
- package/dist/nodes/widget.js +258 -2
- package/dist/nodes/window.d.ts +1 -12
- package/dist/nodes/window.js +66 -27
- package/dist/portal.d.ts +18 -13
- package/dist/portal.js +17 -14
- package/dist/reconciler.d.ts +0 -4
- package/dist/reconciler.js +1 -9
- package/dist/registry.d.ts +8 -0
- package/dist/registry.js +5 -0
- package/dist/render.d.ts +108 -12
- package/dist/render.js +140 -16
- package/dist/scheduler.d.ts +4 -0
- package/dist/scheduler.js +10 -0
- package/dist/types.d.ts +3 -136
- package/package.json +6 -6
- package/dist/batch.d.ts +0 -5
- package/dist/batch.js +0 -31
- package/dist/codegen/jsx-generator.d.ts +0 -56
- package/dist/codegen/jsx-generator.js +0 -959
- package/dist/containers.d.ts +0 -58
- package/dist/nodes/about-dialog.d.ts +0 -8
- package/dist/nodes/about-dialog.js +0 -16
- package/dist/nodes/action-bar.d.ts +0 -5
- package/dist/nodes/action-bar.js +0 -6
- package/dist/nodes/combo-row.d.ts +0 -5
- package/dist/nodes/combo-row.js +0 -6
- package/dist/nodes/drop-down.d.ts +0 -9
- package/dist/nodes/drop-down.js +0 -12
- package/dist/nodes/flow-box.d.ts +0 -10
- package/dist/nodes/flow-box.js +0 -41
- package/dist/nodes/grid.d.ts +0 -30
- package/dist/nodes/grid.js +0 -84
- package/dist/nodes/header-bar.d.ts +0 -43
- package/dist/nodes/header-bar.js +0 -116
- package/dist/nodes/indexed-child-container.d.ts +0 -16
- package/dist/nodes/indexed-child-container.js +0 -22
- package/dist/nodes/list-box.d.ts +0 -10
- package/dist/nodes/list-box.js +0 -48
- package/dist/nodes/list-item-factory.d.ts +0 -19
- package/dist/nodes/list-item-factory.js +0 -58
- package/dist/nodes/overlay.d.ts +0 -11
- package/dist/nodes/overlay.js +0 -50
- package/dist/nodes/paged-stack.d.ts +0 -31
- package/dist/nodes/paged-stack.js +0 -95
- package/dist/nodes/root.d.ts +0 -8
- package/dist/nodes/root.js +0 -13
- package/dist/nodes/selectable-list.d.ts +0 -45
- package/dist/nodes/selectable-list.js +0 -260
- package/dist/nodes/stack-page-props.d.ts +0 -11
- package/dist/nodes/stack-page-props.js +0 -23
- package/dist/nodes/string-list-container.d.ts +0 -34
- package/dist/nodes/string-list-container.js +0 -118
- package/dist/nodes/string-list-item.d.ts +0 -19
- package/dist/nodes/string-list-item.js +0 -50
- package/dist/nodes/string-list-store.d.ts +0 -13
- package/dist/nodes/string-list-store.js +0 -44
- package/dist/nodes/text-view.d.ts +0 -8
- package/dist/nodes/text-view.js +0 -16
- package/dist/nodes/toggle-button.d.ts +0 -14
- package/dist/nodes/toggle-button.js +0 -39
- package/dist/nodes/toolbar-view.d.ts +0 -14
- package/dist/nodes/toolbar-view.js +0 -78
- package/dist/nodes/view-stack.d.ts +0 -9
- package/dist/nodes/view-stack.js +0 -28
- package/dist/nodes/virtual-item.d.ts +0 -19
- package/dist/nodes/virtual-item.js +0 -48
- package/dist/nodes/virtual-slot.d.ts +0 -25
- package/dist/nodes/virtual-slot.js +0 -57
- package/dist/predicates.d.ts +0 -29
- package/dist/predicates.js +0 -37
- package/dist/props.d.ts +0 -7
- package/dist/props.js +0 -12
- /package/dist/{containers.js → nodes/action-row.d.ts} +0 -0
package/dist/jsx.js
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Type-safe slot component for placing children in named widget slots.
|
|
4
|
+
*
|
|
5
|
+
* GTK widgets often have named slots for specific child positions (e.g., titleWidget,
|
|
6
|
+
* startWidget). This component provides type-safe access to those slots.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam W - The widget type containing the slot
|
|
9
|
+
*
|
|
10
|
+
* @param props.for - The widget component type (used for type inference)
|
|
11
|
+
* @param props.id - The slot identifier (type-checked against available slots)
|
|
12
|
+
* @param props.children - Content to place in the slot
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <GtkHeaderBar>
|
|
17
|
+
* <Slot for={GtkHeaderBar} id="titleWidget">
|
|
18
|
+
* <GtkLabel label="App Title" />
|
|
19
|
+
* </Slot>
|
|
20
|
+
* </GtkHeaderBar>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export function Slot(props) {
|
|
26
|
+
return createElement("Slot", { id: props.id }, props.children);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Element type for pages within a GtkStack or AdwViewStack.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <GtkStack>
|
|
34
|
+
* <StackPage name="page1" title="First Page">
|
|
35
|
+
* <GtkLabel label="Content 1" />
|
|
36
|
+
* </StackPage>
|
|
37
|
+
* <StackPage name="page2" title="Second Page">
|
|
38
|
+
* <GtkLabel label="Content 2" />
|
|
39
|
+
* </StackPage>
|
|
40
|
+
* </GtkStack>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export const StackPage = "StackPage";
|
|
44
|
+
/**
|
|
45
|
+
* Element type for positioning children within a GtkGrid.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <GtkGrid>
|
|
50
|
+
* <GridChild column={0} row={0}>
|
|
51
|
+
* <GtkLabel label="Top Left" />
|
|
52
|
+
* </GridChild>
|
|
53
|
+
* <GridChild column={1} row={0} columnSpan={2}>
|
|
54
|
+
* <GtkLabel label="Spans 2 columns" />
|
|
55
|
+
* </GridChild>
|
|
56
|
+
* </GtkGrid>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export const GridChild = "GridChild";
|
|
60
|
+
/**
|
|
61
|
+
* Element type for positioning children within a GtkFixed.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <GtkFixed>
|
|
66
|
+
* <FixedChild x={20} y={30}>
|
|
67
|
+
* <GtkLabel label="Positioned at (20, 30)" />
|
|
68
|
+
* </FixedChild>
|
|
69
|
+
* <FixedChild x={100} y={50}>
|
|
70
|
+
* <GtkButton label="At (100, 50)" />
|
|
71
|
+
* </FixedChild>
|
|
72
|
+
* </GtkFixed>
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export const FixedChild = "FixedChild";
|
|
76
|
+
/**
|
|
77
|
+
* Element type for declarative toast notifications within an AdwToastOverlay.
|
|
78
|
+
*
|
|
79
|
+
* When mounted, shows the toast. When unmounted, the toast auto-dismisses.
|
|
80
|
+
* Toasts can have an optional action button and callbacks.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <AdwToastOverlay>
|
|
85
|
+
* <MyContent />
|
|
86
|
+
* {showToast && (
|
|
87
|
+
* <Toast
|
|
88
|
+
* title="File saved"
|
|
89
|
+
* timeout={3}
|
|
90
|
+
* buttonLabel="Undo"
|
|
91
|
+
* onButtonClicked={handleUndo}
|
|
92
|
+
* onDismissed={() => setShowToast(false)}
|
|
93
|
+
* />
|
|
94
|
+
* )}
|
|
95
|
+
* </AdwToastOverlay>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export const Toast = "Toast";
|
|
99
|
+
/**
|
|
100
|
+
* Element types for pages within a GtkNotebook (tabbed interface).
|
|
101
|
+
*
|
|
102
|
+
* @example Simple text tabs
|
|
103
|
+
* ```tsx
|
|
104
|
+
* <GtkNotebook>
|
|
105
|
+
* <Notebook.Page label="Tab 1">
|
|
106
|
+
* <GtkLabel label="Content 1" />
|
|
107
|
+
* </Notebook.Page>
|
|
108
|
+
* <Notebook.Page label="Tab 2">
|
|
109
|
+
* <GtkLabel label="Content 2" />
|
|
110
|
+
* </Notebook.Page>
|
|
111
|
+
* </GtkNotebook>
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @example Custom tab widgets
|
|
115
|
+
* ```tsx
|
|
116
|
+
* <GtkNotebook>
|
|
117
|
+
* <Notebook.Page>
|
|
118
|
+
* <Notebook.PageTab>
|
|
119
|
+
* <GtkBox orientation={Gtk.Orientation.HORIZONTAL}>
|
|
120
|
+
* <GtkImage iconName="folder-symbolic" />
|
|
121
|
+
* <GtkLabel label="Files" />
|
|
122
|
+
* </GtkBox>
|
|
123
|
+
* </Notebook.PageTab>
|
|
124
|
+
* <GtkLabel label="Content" />
|
|
125
|
+
* </Notebook.Page>
|
|
126
|
+
* </GtkNotebook>
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export const Notebook = {
|
|
130
|
+
/** A page within the notebook */
|
|
131
|
+
Page: "Notebook.Page",
|
|
132
|
+
/** Custom widget for the page tab label */
|
|
133
|
+
PageTab: "Notebook.PageTab",
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Element type for items in a ListView or GridView.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```tsx
|
|
140
|
+
* <ListView renderItem={(item) => <GtkLabel label={item.name} />}>
|
|
141
|
+
* <ListItem id="1" value={{ name: "Item 1" }} />
|
|
142
|
+
* <ListItem id="2" value={{ name: "Item 2" }} />
|
|
143
|
+
* </ListView>
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
export const ListItem = "ListItem";
|
|
147
|
+
/**
|
|
148
|
+
* Component for defining columns in a ColumnView (table widget).
|
|
149
|
+
*
|
|
150
|
+
* @typeParam T - The type of row data
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```tsx
|
|
154
|
+
* <GtkColumnView>
|
|
155
|
+
* <ColumnViewColumn
|
|
156
|
+
* id="name"
|
|
157
|
+
* title="Name"
|
|
158
|
+
* expand
|
|
159
|
+
* renderCell={(item) => <GtkLabel label={item?.name ?? ""} />}
|
|
160
|
+
* />
|
|
161
|
+
* <ColumnViewColumn
|
|
162
|
+
* id="status"
|
|
163
|
+
* title="Status"
|
|
164
|
+
* renderCell={(item) => <GtkLabel label={item?.status ?? ""} />}
|
|
165
|
+
* />
|
|
166
|
+
* </GtkColumnView>
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
export function ColumnViewColumn(props) {
|
|
172
|
+
return createElement("ColumnViewColumn", props);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Virtualized list component with custom item rendering.
|
|
176
|
+
*
|
|
177
|
+
* Efficiently renders large lists by only creating widgets for visible items.
|
|
178
|
+
*
|
|
179
|
+
* @typeParam T - The type of items in the list
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```tsx
|
|
183
|
+
* const items = [{ id: "1", name: "Apple" }, { id: "2", name: "Banana" }];
|
|
184
|
+
*
|
|
185
|
+
* <ListView renderItem={(item) => <GtkLabel label={item?.name ?? ""} />}>
|
|
186
|
+
* {items.map((item) => (
|
|
187
|
+
* <ListItem key={item.id} id={item.id} value={item} />
|
|
188
|
+
* ))}
|
|
189
|
+
* </ListView>
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
export function ListView(props) {
|
|
195
|
+
return createElement("GtkListView", props);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Virtualized grid component with custom item rendering.
|
|
199
|
+
*
|
|
200
|
+
* Efficiently renders large grids by only creating widgets for visible items.
|
|
201
|
+
*
|
|
202
|
+
* @typeParam T - The type of items in the grid
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```tsx
|
|
206
|
+
* <GridView renderItem={(item) => <GtkImage iconName={item?.icon ?? ""} />}>
|
|
207
|
+
* {icons.map((icon) => (
|
|
208
|
+
* <ListItem key={icon.id} id={icon.id} value={icon} />
|
|
209
|
+
* ))}
|
|
210
|
+
* </GridView>
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* @internal
|
|
214
|
+
*/
|
|
215
|
+
export function GridView(props) {
|
|
216
|
+
return createElement("GtkGridView", props);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Tree list component with hierarchical data and expand/collapse support.
|
|
220
|
+
*
|
|
221
|
+
* Renders a tree structure with expandable/collapsible rows using GTK's TreeListModel.
|
|
222
|
+
* Items are defined declaratively by nesting TreeListItem components.
|
|
223
|
+
*
|
|
224
|
+
* @typeParam T - The type of items in the tree
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```tsx
|
|
228
|
+
* interface Category { name: string; }
|
|
229
|
+
* interface Setting { key: string; value: string; }
|
|
230
|
+
*
|
|
231
|
+
* <TreeListView<Category | Setting>
|
|
232
|
+
* renderItem={(item, row) => (
|
|
233
|
+
* <GtkLabel label={'name' in item ? item.name : item.key} />
|
|
234
|
+
* )}
|
|
235
|
+
* >
|
|
236
|
+
* {categories.map(cat => (
|
|
237
|
+
* <TreeListItem key={cat.name} id={cat.name} value={cat}>
|
|
238
|
+
* {cat.settings?.map(setting => (
|
|
239
|
+
* <TreeListItem key={setting.key} id={setting.key} value={setting} />
|
|
240
|
+
* ))}
|
|
241
|
+
* </TreeListItem>
|
|
242
|
+
* ))}
|
|
243
|
+
* </TreeListView>
|
|
244
|
+
* ```
|
|
245
|
+
*
|
|
246
|
+
* @internal
|
|
247
|
+
*/
|
|
248
|
+
export function TreeListView(props) {
|
|
249
|
+
return createElement("TreeListView", props);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Element type for items in a TreeListView.
|
|
253
|
+
*
|
|
254
|
+
* Nesting TreeListItem components defines the tree hierarchy.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```tsx
|
|
258
|
+
* <TreeListView renderItem={(item) => <GtkLabel label={item.name} />}>
|
|
259
|
+
* <TreeListItem id="parent" value={{ name: "Parent" }}>
|
|
260
|
+
* <TreeListItem id="child1" value={{ name: "Child 1" }} />
|
|
261
|
+
* <TreeListItem id="child2" value={{ name: "Child 2" }} />
|
|
262
|
+
* </TreeListItem>
|
|
263
|
+
* </TreeListView>
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
export const TreeListItem = "TreeListItem";
|
|
267
|
+
/**
|
|
268
|
+
* Element type for simple string-based list items.
|
|
269
|
+
*
|
|
270
|
+
* Use when list items only need string values without complex data.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```tsx
|
|
274
|
+
* <GtkDropDown>
|
|
275
|
+
* <SimpleListItem id="opt1" value="Option 1" />
|
|
276
|
+
* <SimpleListItem id="opt2" value="Option 2" />
|
|
277
|
+
* </GtkDropDown>
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
export const SimpleListItem = "SimpleListItem";
|
|
281
|
+
/**
|
|
282
|
+
* Slot positions for AdwActionRow, AdwEntryRow, and AdwExpanderRow widgets.
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```tsx
|
|
286
|
+
* <AdwActionRow title="Setting">
|
|
287
|
+
* <ActionRow.Prefix>
|
|
288
|
+
* <GtkCheckButton />
|
|
289
|
+
* </ActionRow.Prefix>
|
|
290
|
+
* <ActionRow.Suffix>
|
|
291
|
+
* <GtkButton iconName="go-next-symbolic" />
|
|
292
|
+
* </ActionRow.Suffix>
|
|
293
|
+
* </AdwActionRow>
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
export const ActionRow = {
|
|
297
|
+
/** Place child as a prefix (left side) of the row */
|
|
298
|
+
Prefix: "ActionRow.Prefix",
|
|
299
|
+
/** Place child as a suffix (right side) of the row */
|
|
300
|
+
Suffix: "ActionRow.Suffix",
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* Slot positions for HeaderBar and ActionBar widgets.
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```tsx
|
|
307
|
+
* <GtkHeaderBar>
|
|
308
|
+
* <Pack.Start>
|
|
309
|
+
* <GtkButton label="Back" />
|
|
310
|
+
* </Pack.Start>
|
|
311
|
+
* <Pack.End>
|
|
312
|
+
* <GtkMenuButton />
|
|
313
|
+
* </Pack.End>
|
|
314
|
+
* </GtkHeaderBar>
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
export const Pack = {
|
|
318
|
+
/** Place child at the start (left in LTR) of the bar */
|
|
319
|
+
Start: "Pack.Start",
|
|
320
|
+
/** Place child at the end (right in LTR) of the bar */
|
|
321
|
+
End: "Pack.End",
|
|
322
|
+
};
|
|
323
|
+
/**
|
|
324
|
+
* Slot positions for AdwToolbarView.
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```tsx
|
|
328
|
+
* <AdwToolbarView>
|
|
329
|
+
* <Toolbar.Top>
|
|
330
|
+
* <AdwHeaderBar />
|
|
331
|
+
* </Toolbar.Top>
|
|
332
|
+
* <GtkLabel label="Content" />
|
|
333
|
+
* <Toolbar.Bottom>
|
|
334
|
+
* <GtkActionBar />
|
|
335
|
+
* </Toolbar.Bottom>
|
|
336
|
+
* </AdwToolbarView>
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
export const Toolbar = {
|
|
340
|
+
/** Place toolbar at the top */
|
|
341
|
+
Top: "Toolbar.Top",
|
|
342
|
+
/** Place toolbar at the bottom */
|
|
343
|
+
Bottom: "Toolbar.Bottom",
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Element type for GtkOverlay main child container.
|
|
347
|
+
*/
|
|
348
|
+
export const Overlay = "Overlay";
|
|
349
|
+
/**
|
|
350
|
+
* Element type for overlay children positioned above the main content.
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```tsx
|
|
354
|
+
* <GtkOverlay>
|
|
355
|
+
* <Overlay>
|
|
356
|
+
* <GtkImage file="background.png" />
|
|
357
|
+
* </Overlay>
|
|
358
|
+
* <OverlayChild>
|
|
359
|
+
* <GtkLabel label="Overlaid text" cssClasses={["title-1"]} />
|
|
360
|
+
* </OverlayChild>
|
|
361
|
+
* </GtkOverlay>
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
export const OverlayChild = "OverlayChild";
|
|
365
|
+
/**
|
|
366
|
+
* Element types for declarative menu construction.
|
|
367
|
+
*
|
|
368
|
+
* Build menus with items, sections, and submenus declaratively.
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* ```tsx
|
|
372
|
+
* <GtkMenuButton>
|
|
373
|
+
* <Menu.Section>
|
|
374
|
+
* <Menu.Item id="open" label="Open" onActivate={handleOpen} accels="<Control>o" />
|
|
375
|
+
* <Menu.Item id="save" label="Save" onActivate={handleSave} accels="<Control>s" />
|
|
376
|
+
* </Menu.Section>
|
|
377
|
+
* <Menu.Submenu label="Export">
|
|
378
|
+
* <Menu.Item id="pdf" label="As PDF" onActivate={exportPdf} />
|
|
379
|
+
* <Menu.Item id="png" label="As PNG" onActivate={exportPng} />
|
|
380
|
+
* </Menu.Submenu>
|
|
381
|
+
* </GtkMenuButton>
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
export const Menu = {
|
|
385
|
+
/** A clickable menu item with action */
|
|
386
|
+
Item: "Menu.Item",
|
|
387
|
+
/** A section grouping related menu items */
|
|
388
|
+
Section: "Menu.Section",
|
|
389
|
+
/** A submenu containing nested items */
|
|
390
|
+
Submenu: "Menu.Submenu",
|
|
391
|
+
};
|
|
392
|
+
export * from "./generated/jsx.js";
|
package/dist/node.d.ts
CHANGED
|
@@ -1,34 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
static matches(_type: string,
|
|
6
|
-
static
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
protected
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
protected isVirtual(): boolean;
|
|
16
|
-
protected isStandalone(): boolean;
|
|
17
|
-
constructor(type: string, widget?: Gtk.Widget);
|
|
18
|
-
initialize(props: Props): void;
|
|
19
|
-
protected createWidget(type: string, props: Props): T;
|
|
20
|
-
getWidget(): T;
|
|
21
|
-
appendChild(child: Node): void;
|
|
22
|
-
removeChild(child: Node): void;
|
|
23
|
-
insertBefore(child: Node, before: Node): void;
|
|
24
|
-
unmount(): void;
|
|
25
|
-
protected disconnectAllSignals(): void;
|
|
26
|
-
hasParent(): boolean;
|
|
27
|
-
protected consumedProps(): Set<string>;
|
|
28
|
-
updateProps(oldProps: Props, newProps: Props): void;
|
|
29
|
-
protected propKeyToEventName(key: string): string;
|
|
30
|
-
protected disconnectSignal(eventName: string): void;
|
|
31
|
-
protected connectSignal(widget: Gtk.Widget, eventName: string, handler: (...args: unknown[]) => unknown): void;
|
|
32
|
-
protected setProperty(widget: Gtk.Widget, key: string, value: unknown): void;
|
|
1
|
+
import { SignalStore } from "./nodes/internal/signal-store.js";
|
|
2
|
+
import type { Container, ContainerClass, Props } from "./types.js";
|
|
3
|
+
export declare class Node<T = unknown, P = Props> {
|
|
4
|
+
static priority: number;
|
|
5
|
+
static matches(_type: string, _containerOrClass?: Container | ContainerClass): boolean;
|
|
6
|
+
static createContainer(_props: Props, _containerClass: ContainerClass, _rootContainer?: Container): unknown;
|
|
7
|
+
container: T;
|
|
8
|
+
typeName: string;
|
|
9
|
+
protected signalStore: SignalStore;
|
|
10
|
+
constructor(typeName: string, _props: P | undefined, container: T, _rootContainer?: Container);
|
|
11
|
+
appendChild(_child: Node): void;
|
|
12
|
+
removeChild(_child: Node): void;
|
|
13
|
+
insertBefore(_child: Node, _before: Node): void;
|
|
14
|
+
updateProps(_oldProps: P | null, _newProps: P): void;
|
|
33
15
|
mount(): void;
|
|
16
|
+
unmount(): void;
|
|
34
17
|
}
|