@gtkx/react 0.17.2 → 0.18.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.
Files changed (194) hide show
  1. package/README.md +7 -7
  2. package/dist/factory.d.ts +0 -1
  3. package/dist/factory.js +21 -8
  4. package/dist/generated/internal.d.ts +4 -51
  5. package/dist/generated/internal.js +626 -412
  6. package/dist/generated/jsx.d.ts +453 -958
  7. package/dist/host-config.d.ts +1 -1
  8. package/dist/host-config.js +18 -23
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/jsx.d.ts +579 -302
  12. package/dist/jsx.js +37 -179
  13. package/dist/metadata.d.ts +3 -0
  14. package/dist/metadata.js +26 -0
  15. package/dist/node.d.ts +20 -12
  16. package/dist/node.js +72 -17
  17. package/dist/nodes/adjustable.d.ts +3 -16
  18. package/dist/nodes/adjustable.js +5 -22
  19. package/dist/nodes/alert-dialog-response.d.ts +14 -1
  20. package/dist/nodes/alert-dialog-response.js +36 -62
  21. package/dist/nodes/animation.d.ts +37 -1
  22. package/dist/nodes/animation.js +162 -105
  23. package/dist/nodes/application.d.ts +11 -1
  24. package/dist/nodes/application.js +17 -38
  25. package/dist/nodes/calendar.d.ts +13 -0
  26. package/dist/nodes/calendar.js +10 -16
  27. package/dist/nodes/color-dialog-button.d.ts +13 -0
  28. package/dist/nodes/color-dialog-button.js +10 -38
  29. package/dist/nodes/column-view-column.d.ts +13 -11
  30. package/dist/nodes/column-view-column.js +27 -23
  31. package/dist/nodes/column-view.d.ts +31 -0
  32. package/dist/nodes/column-view.js +44 -44
  33. package/dist/nodes/container-slot.d.ts +15 -0
  34. package/dist/nodes/container-slot.js +68 -0
  35. package/dist/nodes/dialog.d.ts +6 -8
  36. package/dist/nodes/dialog.js +12 -13
  37. package/dist/nodes/drawing-area.d.ts +12 -0
  38. package/dist/nodes/drawing-area.js +24 -24
  39. package/dist/nodes/drop-down.d.ts +22 -0
  40. package/dist/nodes/drop-down.js +72 -0
  41. package/dist/nodes/event-controller.d.ts +8 -17
  42. package/dist/nodes/event-controller.js +20 -42
  43. package/dist/nodes/fixed-child.d.ts +18 -1
  44. package/dist/nodes/fixed-child.js +52 -36
  45. package/dist/nodes/font-dialog-button.d.ts +13 -0
  46. package/dist/nodes/font-dialog-button.js +12 -35
  47. package/dist/nodes/grid-child.d.ts +17 -1
  48. package/dist/nodes/grid-child.js +57 -37
  49. package/dist/nodes/grid-view.d.ts +24 -0
  50. package/dist/nodes/grid-view.js +73 -0
  51. package/dist/nodes/internal/base-item-renderer.d.ts +7 -9
  52. package/dist/nodes/internal/base-item-renderer.js +15 -18
  53. package/dist/nodes/internal/grid-item-renderer.d.ts +17 -0
  54. package/dist/nodes/internal/grid-item-renderer.js +59 -0
  55. package/dist/nodes/internal/list-item-renderer.d.ts +14 -9
  56. package/dist/nodes/internal/list-item-renderer.js +96 -35
  57. package/dist/nodes/internal/list-store.d.ts +5 -0
  58. package/dist/nodes/internal/list-store.js +39 -9
  59. package/dist/nodes/internal/predicates.d.ts +4 -19
  60. package/dist/nodes/internal/predicates.js +1 -20
  61. package/dist/nodes/internal/props.d.ts +5 -0
  62. package/dist/nodes/internal/props.js +42 -0
  63. package/dist/nodes/internal/{selection-model.d.ts → selection-model-controller.d.ts} +4 -9
  64. package/dist/nodes/internal/{selection-model.js → selection-model-controller.js} +6 -15
  65. package/dist/nodes/internal/signal-store.js +12 -5
  66. package/dist/nodes/internal/simple-list-store.d.ts +5 -0
  67. package/dist/nodes/internal/simple-list-store.js +42 -13
  68. package/dist/nodes/internal/text-buffer-controller.d.ts +4 -12
  69. package/dist/nodes/internal/text-buffer-controller.js +32 -33
  70. package/dist/nodes/internal/tree-store.d.ts +7 -0
  71. package/dist/nodes/internal/tree-store.js +75 -18
  72. package/dist/nodes/internal/widget.d.ts +7 -0
  73. package/dist/nodes/internal/widget.js +68 -0
  74. package/dist/nodes/level-bar.d.ts +10 -0
  75. package/dist/nodes/level-bar.js +11 -22
  76. package/dist/nodes/list-item.d.ts +17 -9
  77. package/dist/nodes/list-item.js +67 -12
  78. package/dist/nodes/list-view.d.ts +23 -0
  79. package/dist/nodes/list-view.js +27 -31
  80. package/dist/nodes/menu.d.ts +2 -4
  81. package/dist/nodes/menu.js +0 -6
  82. package/dist/nodes/models/grid.d.ts +27 -0
  83. package/dist/nodes/models/grid.js +68 -0
  84. package/dist/nodes/models/list.d.ts +15 -13
  85. package/dist/nodes/models/list.js +48 -26
  86. package/dist/nodes/models/menu.d.ts +15 -16
  87. package/dist/nodes/models/menu.js +63 -93
  88. package/dist/nodes/navigation-page.d.ts +16 -10
  89. package/dist/nodes/navigation-page.js +108 -31
  90. package/dist/nodes/navigation-view.d.ts +15 -0
  91. package/dist/nodes/navigation-view.js +15 -65
  92. package/dist/nodes/notebook-page-tab.d.ts +10 -12
  93. package/dist/nodes/notebook-page-tab.js +24 -27
  94. package/dist/nodes/notebook-page.d.ts +19 -16
  95. package/dist/nodes/notebook-page.js +75 -56
  96. package/dist/nodes/notebook.d.ts +10 -1
  97. package/dist/nodes/notebook.js +10 -22
  98. package/dist/nodes/overlay-child.d.ts +17 -1
  99. package/dist/nodes/overlay-child.js +53 -75
  100. package/dist/nodes/popover-menu.d.ts +15 -0
  101. package/dist/nodes/popover-menu.js +13 -26
  102. package/dist/nodes/scale.d.ts +8 -0
  103. package/dist/nodes/scale.js +2 -11
  104. package/dist/nodes/scrolled-window.d.ts +9 -0
  105. package/dist/nodes/scrolled-window.js +5 -11
  106. package/dist/nodes/search-bar.d.ts +9 -0
  107. package/dist/nodes/search-bar.js +8 -33
  108. package/dist/nodes/shortcut-controller.d.ts +9 -1
  109. package/dist/nodes/shortcut-controller.js +12 -25
  110. package/dist/nodes/shortcut.d.ts +11 -33
  111. package/dist/nodes/shortcut.js +19 -15
  112. package/dist/nodes/slot.d.ts +16 -15
  113. package/dist/nodes/slot.js +63 -57
  114. package/dist/nodes/source-view.d.ts +16 -0
  115. package/dist/nodes/source-view.js +44 -44
  116. package/dist/nodes/stack-page.d.ts +21 -1
  117. package/dist/nodes/stack-page.js +68 -17
  118. package/dist/nodes/stack.d.ts +11 -0
  119. package/dist/nodes/stack.js +8 -26
  120. package/dist/nodes/text-anchor.d.ts +11 -30
  121. package/dist/nodes/text-anchor.js +20 -22
  122. package/dist/nodes/text-content.d.ts +1 -0
  123. package/dist/nodes/text-content.js +1 -1
  124. package/dist/nodes/text-paintable.d.ts +10 -15
  125. package/dist/nodes/text-paintable.js +16 -9
  126. package/dist/nodes/text-segment.d.ts +12 -10
  127. package/dist/nodes/text-segment.js +19 -11
  128. package/dist/nodes/text-tag.d.ts +20 -119
  129. package/dist/nodes/text-tag.js +153 -119
  130. package/dist/nodes/text-view.d.ts +13 -18
  131. package/dist/nodes/text-view.js +17 -17
  132. package/dist/nodes/toggle-group.d.ts +9 -0
  133. package/dist/nodes/toggle-group.js +8 -33
  134. package/dist/nodes/toggle.d.ts +15 -1
  135. package/dist/nodes/toggle.js +34 -52
  136. package/dist/nodes/virtual.d.ts +3 -10
  137. package/dist/nodes/virtual.js +1 -14
  138. package/dist/nodes/web-view.d.ts +9 -0
  139. package/dist/nodes/web-view.js +10 -24
  140. package/dist/nodes/widget.d.ts +17 -13
  141. package/dist/nodes/widget.js +185 -112
  142. package/dist/nodes/window.d.ts +20 -21
  143. package/dist/nodes/window.js +54 -35
  144. package/dist/registry.d.ts +17 -6
  145. package/dist/registry.js +104 -5
  146. package/dist/render.d.ts +1 -10
  147. package/dist/render.js +1 -13
  148. package/package.json +6 -6
  149. package/dist/animation/css-builder.d.ts +0 -3
  150. package/dist/animation/css-builder.js +0 -53
  151. package/dist/animation/types.d.ts +0 -120
  152. package/dist/animation/types.js +0 -1
  153. package/dist/nodes/abstract/positional-child.d.ts +0 -9
  154. package/dist/nodes/abstract/positional-child.js +0 -29
  155. package/dist/nodes/abstract/virtual-container.d.ts +0 -21
  156. package/dist/nodes/abstract/virtual-container.js +0 -68
  157. package/dist/nodes/abstract/virtual-single-child.d.ts +0 -18
  158. package/dist/nodes/abstract/virtual-single-child.js +0 -55
  159. package/dist/nodes/action-row-child.d.ts +0 -1
  160. package/dist/nodes/action-row-child.js +0 -30
  161. package/dist/nodes/autowrapped.d.ts +0 -1
  162. package/dist/nodes/autowrapped.js +0 -115
  163. package/dist/nodes/expander-row-child.d.ts +0 -1
  164. package/dist/nodes/expander-row-child.js +0 -30
  165. package/dist/nodes/grid.d.ts +0 -1
  166. package/dist/nodes/grid.js +0 -41
  167. package/dist/nodes/index.d.ts +0 -56
  168. package/dist/nodes/index.js +0 -56
  169. package/dist/nodes/internal/child-attachment.d.ts +0 -26
  170. package/dist/nodes/internal/child-attachment.js +0 -48
  171. package/dist/nodes/internal/deferred-action.d.ts +0 -9
  172. package/dist/nodes/internal/deferred-action.js +0 -22
  173. package/dist/nodes/internal/text-tag-styles.d.ts +0 -43
  174. package/dist/nodes/internal/text-tag-styles.js +0 -52
  175. package/dist/nodes/internal/tree-list-item-renderer.d.ts +0 -26
  176. package/dist/nodes/internal/tree-list-item-renderer.js +0 -134
  177. package/dist/nodes/internal/utils.d.ts +0 -12
  178. package/dist/nodes/internal/utils.js +0 -92
  179. package/dist/nodes/models/tree-list.d.ts +0 -28
  180. package/dist/nodes/models/tree-list.js +0 -113
  181. package/dist/nodes/pack-child.d.ts +0 -1
  182. package/dist/nodes/pack-child.js +0 -30
  183. package/dist/nodes/simple-list-item.d.ts +0 -9
  184. package/dist/nodes/simple-list-item.js +0 -9
  185. package/dist/nodes/simple-list-view.d.ts +0 -1
  186. package/dist/nodes/simple-list-view.js +0 -74
  187. package/dist/nodes/toolbar-child.d.ts +0 -1
  188. package/dist/nodes/toolbar-child.js +0 -30
  189. package/dist/nodes/tree-list-item.d.ts +0 -22
  190. package/dist/nodes/tree-list-item.js +0 -90
  191. package/dist/nodes/tree-list-view.d.ts +0 -1
  192. package/dist/nodes/tree-list-view.js +0 -77
  193. package/dist/scheduler.d.ts +0 -26
  194. package/dist/scheduler.js +0 -42
package/dist/jsx.d.ts CHANGED
@@ -1,19 +1,288 @@
1
1
  import type * as Adw from "@gtkx/ffi/adw";
2
+ import type * as cairo from "@gtkx/ffi/cairo";
3
+ import type * as Gdk from "@gtkx/ffi/gdk";
2
4
  import type * as Gsk from "@gtkx/ffi/gsk";
3
5
  import type * as Gtk from "@gtkx/ffi/gtk";
6
+ import type * as GtkSource from "@gtkx/ffi/gtksource";
7
+ import type * as Pango from "@gtkx/ffi/pango";
4
8
  import type { ReactElement, ReactNode } from "react";
5
- import type { AnimationProps } from "./animation/types.js";
6
- import type { GtkGridViewProps as GeneratedGtkGridViewProps, GtkListViewProps as GeneratedGtkListViewProps, WidgetSlotNames } from "./generated/jsx.js";
7
- import type { RenderItemFn } from "./nodes/internal/list-item-renderer.js";
8
- import type { TreeRenderItemFn } from "./nodes/internal/tree-list-item-renderer.js";
9
- import type { ShortcutProps as ShortcutNodeProps } from "./nodes/shortcut.js";
10
- import type { TextAnchorProps } from "./nodes/text-anchor.js";
11
- import type { TextPaintableProps } from "./nodes/text-paintable.js";
12
- import type { TextTagProps } from "./nodes/text-tag.js";
13
- export type { AnimatableProperties, AnimationMode, AnimationProps, SpringTransition, TimedTransition, } from "./animation/types.js";
14
- export type { TextAnchorProps } from "./nodes/text-anchor.js";
15
- export type { TextPaintableProps } from "./nodes/text-paintable.js";
16
- export type { TextTagProps } from "./nodes/text-tag.js";
9
+ import type { WidgetSlotNames } from "./generated/jsx.js";
10
+ /**
11
+ * CSS properties that can be animated on a widget.
12
+ *
13
+ * All transforms are applied via GTK CSS and rendered through the widget's style context.
14
+ */
15
+ export type AnimatableProperties = {
16
+ /** Opacity from 0 (fully transparent) to 1 (fully opaque) */
17
+ opacity?: number;
18
+ /** Horizontal translation in pixels (positive moves right) */
19
+ translateX?: number;
20
+ /** Vertical translation in pixels (positive moves down) */
21
+ translateY?: number;
22
+ /** Uniform scale factor (1 = original size, 2 = double size) */
23
+ scale?: number;
24
+ /** Horizontal scale factor */
25
+ scaleX?: number;
26
+ /** Vertical scale factor */
27
+ scaleY?: number;
28
+ /** Rotation angle in degrees (positive rotates clockwise) */
29
+ rotate?: number;
30
+ /** Horizontal skew angle in degrees */
31
+ skewX?: number;
32
+ /** Vertical skew angle in degrees */
33
+ skewY?: number;
34
+ };
35
+ /**
36
+ * Transition configuration for timed (duration-based) animations.
37
+ *
38
+ * @see {@link https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.TimedAnimation.html Adw.TimedAnimation}
39
+ */
40
+ export type TimedTransition = {
41
+ /** Discriminant: duration-based animation with easing curves */
42
+ mode: "timed";
43
+ /** Animation duration in milliseconds (default: 300) */
44
+ duration?: number;
45
+ /** Easing function for the animation curve (default: EASE_OUT_CUBIC) */
46
+ easing?: Adw.Easing;
47
+ /** Delay before starting the animation in milliseconds */
48
+ delay?: number;
49
+ /** Number of times to repeat the animation (0 = no repeat, -1 = infinite) */
50
+ repeat?: number;
51
+ /** Whether to play the animation in reverse */
52
+ reverse?: boolean;
53
+ /** Whether to alternate direction on each repeat */
54
+ alternate?: boolean;
55
+ };
56
+ /**
57
+ * Transition configuration for spring (physics-based) animations.
58
+ *
59
+ * Spring animations simulate a mass attached to a spring, providing natural-feeling motion.
60
+ * The animation settles when the spring reaches equilibrium.
61
+ *
62
+ * @see {@link https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SpringAnimation.html Adw.SpringAnimation}
63
+ */
64
+ export type SpringTransition = {
65
+ /** Discriminant: physics-based spring animation */
66
+ mode: "spring";
67
+ /** Damping ratio controlling oscillation decay (default: 1, critically damped) */
68
+ damping?: number;
69
+ /** Spring stiffness in N/m affecting animation speed (default: 100) */
70
+ stiffness?: number;
71
+ /** Virtual mass in kg affecting momentum (default: 1) */
72
+ mass?: number;
73
+ /** Initial velocity to apply at animation start */
74
+ initialVelocity?: number;
75
+ /** Whether to clamp the animation value to prevent overshooting */
76
+ clamp?: boolean;
77
+ /** Delay before starting the animation in milliseconds */
78
+ delay?: number;
79
+ };
80
+ /**
81
+ * Discriminated union of all transition configurations.
82
+ *
83
+ * The `mode` field determines the animation type:
84
+ * - `"timed"`: Duration-based animation with easing curves (uses {@link Adw.TimedAnimation})
85
+ * - `"spring"`: Physics-based spring animation (uses {@link Adw.SpringAnimation})
86
+ */
87
+ export type AnimationTransition = TimedTransition | SpringTransition;
88
+ /**
89
+ * Props for the Animation component.
90
+ *
91
+ * Provides a declarative API for animating widget properties using either
92
+ * timed (duration-based) or spring (physics-based) animations.
93
+ *
94
+ * @example
95
+ * ```tsx
96
+ * <x.Animation
97
+ * initial={{ opacity: 0, translateY: -20 }}
98
+ * animate={{ opacity: 1, translateY: 0 }}
99
+ * exit={{ opacity: 0, translateY: 20 }}
100
+ * transition={{ mode: "spring", damping: 0.8, stiffness: 200 }}
101
+ * animateOnMount
102
+ * >
103
+ * <GtkLabel label="Animated content" />
104
+ * </x.Animation>
105
+ * ```
106
+ */
107
+ export type AnimationProps = {
108
+ /** Initial property values before animation starts, or `false` to skip initial state */
109
+ initial?: AnimatableProperties | false;
110
+ /** Target property values to animate towards */
111
+ animate?: AnimatableProperties;
112
+ /** Property values to animate to when the component unmounts */
113
+ exit?: AnimatableProperties;
114
+ /** Transition configuration including animation mode and parameters */
115
+ transition?: AnimationTransition;
116
+ /** Whether to animate from `initial` to `animate` when first mounted (default: false) */
117
+ animateOnMount?: boolean;
118
+ /** Callback fired when an animation begins */
119
+ onAnimationStart?: () => void;
120
+ /** Callback fired when an animation completes */
121
+ onAnimationComplete?: () => void;
122
+ /** The child widget to animate (must be a single GTK widget) */
123
+ children?: ReactNode;
124
+ };
125
+ /**
126
+ * Props for the Shortcut virtual element.
127
+ *
128
+ * Defines a keyboard shortcut. Must be a child of `x.ShortcutController`.
129
+ *
130
+ * @example
131
+ * ```tsx
132
+ * <x.ShortcutController>
133
+ * <x.Shortcut trigger="<Control>s" onActivate={save} />
134
+ * <x.Shortcut trigger={["F5", "<Control>r"]} onActivate={refresh} />
135
+ * <x.Shortcut trigger="Escape" onActivate={cancel} disabled={!canCancel} />
136
+ * </x.ShortcutController>
137
+ * ```
138
+ */
139
+ export type ShortcutProps = {
140
+ /** The trigger string(s) using GTK accelerator format (e.g., "\<Control\>s", "F1") */
141
+ trigger: string | string[];
142
+ /**
143
+ * Called when the shortcut is activated.
144
+ * Return false to indicate the shortcut was not handled; otherwise it is considered handled.
145
+ */
146
+ onActivate: () => boolean | void;
147
+ /** Whether the shortcut is disabled */
148
+ disabled?: boolean;
149
+ };
150
+ /**
151
+ * Props for the TextAnchor virtual element.
152
+ *
153
+ * Used to declaratively embed widgets within text content in a TextBuffer.
154
+ * The anchor is placed at the current position in the text flow.
155
+ *
156
+ * @example
157
+ * ```tsx
158
+ * <GtkTextView>
159
+ * <x.TextBuffer>
160
+ * Click here: <x.TextAnchor>
161
+ * <GtkButton label="Click me" />
162
+ * </x.TextAnchor> to continue.
163
+ * </x.TextBuffer>
164
+ * </GtkTextView>
165
+ * ```
166
+ */
167
+ export type TextAnchorProps = {
168
+ /** The widget to embed at this anchor position */
169
+ children?: ReactNode;
170
+ };
171
+ /**
172
+ * Props for the TextPaintable virtual element.
173
+ *
174
+ * Used to embed inline images or icons within text content in a GtkTextView.
175
+ */
176
+ export type TextPaintableProps = {
177
+ /** The paintable (image, icon, etc.) to embed inline with the text */
178
+ paintable: Gdk.Paintable;
179
+ };
180
+ /**
181
+ * Props for the TextTag virtual element.
182
+ *
183
+ * Used to declaratively define and apply text formatting to content within a TextBuffer.
184
+ *
185
+ * @example
186
+ * ```tsx
187
+ * <GtkTextView>
188
+ * <x.TextBuffer>
189
+ * Hello <x.TextTag id="bold" weight={Pango.Weight.BOLD}>bold</x.TextTag> world
190
+ * </x.TextBuffer>
191
+ * </GtkTextView>
192
+ * ```
193
+ */
194
+ export type TextTagProps = {
195
+ /** Unique identifier for this tag in the tag table */
196
+ id: string;
197
+ /** Priority of this tag (higher wins when multiple tags affect same property) */
198
+ priority?: number;
199
+ /** Background color as a string (e.g., "red", "#ff0000") */
200
+ background?: string;
201
+ /** Whether the background fills the entire line height */
202
+ backgroundFullHeight?: boolean;
203
+ /** Foreground (text) color as a string */
204
+ foreground?: string;
205
+ /** Font family name (e.g., "Sans", "Monospace") */
206
+ family?: string;
207
+ /** Font description string (e.g., "Sans Italic 12") */
208
+ font?: string;
209
+ /** Font size in points */
210
+ sizePoints?: number;
211
+ /** Font size in Pango units */
212
+ size?: number;
213
+ /** Font size scale factor relative to default */
214
+ scale?: number;
215
+ /** Font weight (use Pango.Weight constants) */
216
+ weight?: Pango.Weight | number;
217
+ /** Font style (use Pango.Style constants) */
218
+ style?: Pango.Style;
219
+ /** Font stretch (use Pango.Stretch constants) */
220
+ stretch?: Pango.Stretch;
221
+ /** Font variant (use Pango.Variant constants) */
222
+ variant?: Pango.Variant;
223
+ /** Whether to strike through the text */
224
+ strikethrough?: boolean;
225
+ /** Underline style (use Pango.Underline constants) */
226
+ underline?: Pango.Underline;
227
+ /** Overline style (use Pango.Overline constants) */
228
+ overline?: Pango.Overline;
229
+ /** Offset of text above baseline in Pango units (negative = below) */
230
+ rise?: number;
231
+ /** Extra spacing between characters in Pango units */
232
+ letterSpacing?: number;
233
+ /** Factor to scale line height by */
234
+ lineHeight?: number;
235
+ /** Left margin in pixels */
236
+ leftMargin?: number;
237
+ /** Right margin in pixels */
238
+ rightMargin?: number;
239
+ /** Paragraph indent in pixels (negative = hanging) */
240
+ indent?: number;
241
+ /** Pixels of blank space above paragraphs */
242
+ pixelsAboveLines?: number;
243
+ /** Pixels of blank space below paragraphs */
244
+ pixelsBelowLines?: number;
245
+ /** Pixels of blank space between wrapped lines */
246
+ pixelsInsideWrap?: number;
247
+ /** Text justification */
248
+ justification?: Gtk.Justification;
249
+ /** Text direction */
250
+ direction?: Gtk.TextDirection;
251
+ /** Wrap mode for line breaks */
252
+ wrapMode?: Gtk.WrapMode;
253
+ /** Whether the text can be modified */
254
+ editable?: boolean;
255
+ /** Whether the text is invisible/hidden */
256
+ invisible?: boolean;
257
+ /** Whether breaks are allowed */
258
+ allowBreaks?: boolean;
259
+ /** Whether to insert hyphens at breaks */
260
+ insertHyphens?: boolean;
261
+ /** Whether font fallback is enabled */
262
+ fallback?: boolean;
263
+ /** Whether margins accumulate */
264
+ accumulativeMargin?: boolean;
265
+ /** Paragraph background color as a string */
266
+ paragraphBackground?: string;
267
+ /** How to render invisible characters */
268
+ showSpaces?: Pango.ShowFlags;
269
+ /** How to transform text for display */
270
+ textTransform?: Pango.TextTransform;
271
+ /** OpenType font features as a string */
272
+ fontFeatures?: string;
273
+ /** Language code (e.g., "en-US") */
274
+ language?: string;
275
+ /** Text content and nested TextTag children */
276
+ children?: ReactNode;
277
+ };
278
+ /** Props for the TextSegment virtual element.
279
+ *
280
+ * Represents a segment of text within a TextBuffer.
281
+ */
282
+ export type TextSegmentProps = {
283
+ /** The text content of this segment */
284
+ text: string;
285
+ };
17
286
  /**
18
287
  * Configuration for a mark on a GtkScale widget.
19
288
  *
@@ -57,29 +326,41 @@ export type SlotProps = {
57
326
  children?: ReactNode;
58
327
  };
59
328
  /**
60
- * Props for virtual child containers that don't expose slot id.
329
+ * Type mapping widgets to their valid container slot method names.
330
+ *
331
+ * Each key is a JSX element name and each value is a union of method names
332
+ * that can be used as the `id` prop on `x.ContainerSlot`.
61
333
  */
62
- export type VirtualSlotProps = {
63
- /** Content to place in the slot */
64
- children?: ReactNode;
334
+ export type ContainerSlotNames = {
335
+ AdwActionRow: "addPrefix" | "addSuffix";
336
+ AdwEntryRow: "addPrefix" | "addSuffix";
337
+ AdwExpanderRow: "addPrefix" | "addSuffix" | "addRow" | "addAction";
338
+ AdwHeaderBar: "packStart" | "packEnd";
339
+ AdwToolbarView: "addTopBar" | "addBottomBar";
340
+ GtkActionBar: "packStart" | "packEnd";
341
+ GtkHeaderBar: "packStart" | "packEnd";
65
342
  };
66
343
  /**
67
- * Props for items in a {@link ListView} or {@link GridView}.
344
+ * Props for method-based container slot child positioning.
68
345
  *
69
- * @typeParam T - The type of data associated with this list item
346
+ * @see {@link x.ContainerSlot} for type-safe usage
70
347
  */
71
- export type ListItemProps<T = unknown> = {
72
- /** Unique identifier for this item */
348
+ export type ContainerSlotProps = {
349
+ /** The method name to call on the parent widget */
73
350
  id: string;
74
- /** The data value for this item */
75
- value: T;
351
+ /** Content to place in the container slot */
352
+ children?: ReactNode;
76
353
  };
77
354
  /**
78
- * Props for items in a {@link TreeListView}.
355
+ * Props for items in a GtkListView, GtkGridView, or GtkColumnView.
356
+ *
357
+ * When used inside a GtkListView, items can be nested to create tree hierarchies.
358
+ * Tree-specific props (`indentForDepth`, `indentForIcon`, `hideExpander`) only
359
+ * apply when items are used inside a GtkListView with nested children.
79
360
  *
80
- * @typeParam T - The type of data associated with this tree item
361
+ * @typeParam T - The type of data associated with this list item
81
362
  */
82
- export type TreeListItemProps<T = unknown> = {
363
+ export type ListItemProps<T = unknown> = {
83
364
  /** Unique identifier for this item */
84
365
  id: string;
85
366
  /** The data value for this item */
@@ -90,26 +371,17 @@ export type TreeListItemProps<T = unknown> = {
90
371
  indentForIcon?: boolean;
91
372
  /** Whether to hide the expand/collapse arrow */
92
373
  hideExpander?: boolean;
93
- /** Nested tree items (children of this item) */
374
+ /** Nested list items (children of this item in a tree) */
94
375
  children?: ReactNode;
95
376
  };
96
- /**
97
- * Props for string-based list items.
98
- *
99
- * Use with `SimpleListItem` for simple string lists.
100
- */
101
- export type StringListItemProps = {
102
- /** Unique identifier for this item */
103
- id: string;
104
- /** The string value for this item */
105
- value: string;
106
- };
107
377
  /**
108
378
  * Props for positioning children within a GtkGrid.
109
379
  *
110
380
  * @see {@link GridChild} for usage
111
381
  */
112
- export type GridChildProps = VirtualSlotProps & {
382
+ export type GridChildProps = {
383
+ /** Content to place in the grid cell */
384
+ children?: ReactNode;
113
385
  /** Column index (0-based) */
114
386
  column?: number;
115
387
  /** Row index (0-based) */
@@ -124,7 +396,9 @@ export type GridChildProps = VirtualSlotProps & {
124
396
  *
125
397
  * @see {@link FixedChild} for usage
126
398
  */
127
- export type FixedChildProps = VirtualSlotProps & {
399
+ export type FixedChildProps = {
400
+ /** Content to place in the fixed container */
401
+ children?: ReactNode;
128
402
  /** X coordinate in pixels */
129
403
  x?: number;
130
404
  /** Y coordinate in pixels */
@@ -132,15 +406,6 @@ export type FixedChildProps = VirtualSlotProps & {
132
406
  /** 3D transform to apply to the child (perspective, rotation, etc.) */
133
407
  transform?: Gsk.Transform;
134
408
  };
135
- /**
136
- * Props for custom list view rendering.
137
- *
138
- * @typeParam T - The type of items in the list
139
- */
140
- export type ListViewRenderProps<T = unknown> = {
141
- /** Function to render each list item */
142
- renderItem: RenderItemFn<T>;
143
- };
144
409
  /**
145
410
  * Props for defining a column in a ColumnView (table).
146
411
  *
@@ -164,25 +429,12 @@ export type ColumnViewColumnProps<T = unknown> = {
164
429
  /** Function to render the cell content for each row */
165
430
  renderCell: (item: T | null) => ReactNode;
166
431
  };
167
- /**
168
- * Props for the root ColumnView component.
169
- *
170
- * @typeParam C - String literal type for column IDs
171
- */
172
- export type ColumnViewRootProps<C extends string = string> = {
173
- /** Currently sorted column ID, or null for no sorting */
174
- sortColumn?: C | null;
175
- /** Sort direction (ascending or descending) */
176
- sortOrder?: Gtk.SortType;
177
- /** Callback when sort changes */
178
- onSortChanged?: (column: C | null, order: Gtk.SortType) => void;
179
- /** Estimated row height in pixels for proper virtualization before content loads */
180
- estimatedRowHeight?: number;
181
- };
182
432
  /**
183
433
  * Props for notebook (tabbed) pages.
184
434
  */
185
- export type NotebookPageProps = VirtualSlotProps & {
435
+ export type NotebookPageProps = {
436
+ /** Content to place in the notebook page */
437
+ children?: ReactNode;
186
438
  /** Tab label text (optional when using Notebook.PageTab) */
187
439
  label?: string;
188
440
  /** Whether the tab should expand to fill available space */
@@ -193,20 +445,18 @@ export type NotebookPageProps = VirtualSlotProps & {
193
445
  /**
194
446
  * Props for custom notebook page tab widgets.
195
447
  */
196
- export type NotebookPageTabProps = VirtualSlotProps;
197
- /**
198
- * Props for the root Stack component.
199
- */
200
- export type StackRootProps = VirtualSlotProps & {
201
- /** ID of the currently visible page */
202
- page?: string;
448
+ export type NotebookPageTabProps = {
449
+ /** Content to place in the notebook page tab */
450
+ children?: ReactNode;
203
451
  };
204
452
  /**
205
453
  * Props for pages within a Stack or ViewStack.
206
454
  *
207
455
  * @see {@link StackPage} for usage
208
456
  */
209
- export type StackPageProps = VirtualSlotProps & {
457
+ export type StackPageProps = {
458
+ /** Content to place in the stack page */
459
+ children?: ReactNode;
210
460
  /** Unique identifier for this page (used with page prop) */
211
461
  id?: string;
212
462
  /** Display title shown in stack switchers */
@@ -260,7 +510,9 @@ export type MenuSubmenuProps = {
260
510
  /**
261
511
  * Props for children within an Overlay container.
262
512
  */
263
- export type OverlayChildProps = VirtualSlotProps & {
513
+ export type OverlayChildProps = {
514
+ /** Content to place in the overlay child */
515
+ children?: ReactNode;
264
516
  /** Whether to include this child in size measurement */
265
517
  measure?: boolean;
266
518
  /** Whether to clip this overlay child to the main child bounds */
@@ -311,25 +563,14 @@ export type AlertDialogResponseProps = {
311
563
  /** Whether the response button is enabled */
312
564
  enabled?: boolean;
313
565
  };
314
- /**
315
- * Props for ExpanderRow child slots (Row and Action).
316
- */
317
- export type ExpanderRowChildProps = {
318
- /** Children to add to this slot */
319
- children?: ReactNode;
320
- };
321
566
  type NavigationPageBaseProps = {
567
+ /** Display title for the navigation page */
322
568
  title?: string;
569
+ /** Whether the page can be popped from the navigation stack */
323
570
  canPop?: boolean;
571
+ /** Page content */
324
572
  children?: ReactNode;
325
573
  };
326
- export type { GtkShortcutControllerProps as ShortcutControllerProps } from "./generated/jsx.js";
327
- /**
328
- * Props for the Shortcut element in JSX.
329
- *
330
- * @see {@link x.Shortcut} for usage examples
331
- */
332
- export type ShortcutProps = ShortcutNodeProps;
333
574
  /**
334
575
  * Props for the NavigationPage virtual element with type-safe targeting.
335
576
  *
@@ -364,47 +605,84 @@ export type NavigationPageProps = (NavigationPageBaseProps & {
364
605
  for: "AdwNavigationSplitView";
365
606
  id: WidgetSlotNames["AdwNavigationSplitView"];
366
607
  });
367
- export type { WidgetSlotNames };
368
608
  /**
369
- * Props for the ListView component.
609
+ * Props shared by text buffer hosts (GtkTextView, GtkSourceView).
370
610
  *
371
- * @typeParam T - The type of items in the list
611
+ * Provides undo control and buffer mutation callbacks.
372
612
  */
373
- export type ListViewProps<T = unknown> = Omit<GeneratedGtkListViewProps, "renderItem"> & {
374
- /** Function to render each list item */
375
- renderItem: (item: T | null) => ReactNode;
376
- /** Estimated item height in pixels for proper virtualization before content loads */
613
+ export type TextBufferProps = {
614
+ /** Whether undo/redo is enabled on the text buffer */
615
+ enableUndo?: boolean;
616
+ /** Callback fired when the buffer content changes */
617
+ onBufferChanged?: ((buffer: Gtk.TextBuffer) => void) | null;
618
+ /** Callback fired when text is inserted into the buffer */
619
+ onTextInserted?: ((buffer: Gtk.TextBuffer, offset: number, text: string) => void) | null;
620
+ /** Callback fired when text is deleted from the buffer */
621
+ onTextDeleted?: ((buffer: Gtk.TextBuffer, startOffset: number, endOffset: number) => void) | null;
622
+ /** Callback fired when the undo availability changes */
623
+ onCanUndoChanged?: ((canUndo: boolean) => void) | null;
624
+ /** Callback fired when the redo availability changes */
625
+ onCanRedoChanged?: ((canRedo: boolean) => void) | null;
626
+ };
627
+ type BaseListViewProps = {
628
+ /** Estimated item height in pixels for virtualization */
377
629
  estimatedItemHeight?: number;
630
+ /** Array of selected item IDs */
631
+ selected?: string[] | null;
632
+ /** Callback fired when the selection changes */
633
+ onSelectionChanged?: ((ids: string[]) => void) | null;
634
+ /** Selection behavior (single, multiple, none, etc.) */
635
+ selectionMode?: Gtk.SelectionMode | null;
636
+ };
637
+ export type ListViewProps = BaseListViewProps & {
638
+ /** Function to render each list item. The `row` parameter provides tree state for hierarchical lists. */
639
+ renderItem: (item: any, row?: Gtk.TreeListRow | null) => ReactNode;
640
+ /** Whether to automatically expand new tree rows (default: false) */
641
+ autoexpand?: boolean;
642
+ };
643
+ export type GridViewProps = BaseListViewProps & {
644
+ /** Function to render each grid item */
645
+ renderItem: (item: any) => ReactNode;
378
646
  };
379
647
  /**
380
- * Props for the GridView component.
381
- *
382
- * @typeParam T - The type of items in the grid
648
+ * Props shared by single-selection dropdown widgets (GtkDropDown, AdwComboRow).
383
649
  */
384
- export type GridViewProps<T = unknown> = Omit<GeneratedGtkGridViewProps, "renderItem"> & {
385
- /** Function to render each grid item */
386
- renderItem: (item: T | null) => ReactNode;
387
- /** Estimated item height in pixels for proper virtualization before content loads */
388
- estimatedItemHeight?: number;
650
+ export type DropDownProps = {
651
+ /** ID of the currently selected item */
652
+ selectedId?: string | null;
653
+ /** Callback fired when the selected item changes */
654
+ onSelectionChanged?: ((id: string) => void) | null;
655
+ };
656
+ /**
657
+ * Props shared by dialog button widgets (GtkColorDialogButton, GtkFontDialogButton).
658
+ */
659
+ export type DialogButtonProps = {
660
+ /** Title for the chooser dialog */
661
+ title?: string;
662
+ /** Whether the dialog is modal */
663
+ modal?: boolean;
389
664
  };
390
665
  /**
391
- * Props for the TreeListView component.
666
+ * Props for widgets backed by a GtkAdjustment.
392
667
  *
393
- * @typeParam T - The type of items in the tree
668
+ * Used by GtkRange, GtkScaleButton, GtkSpinButton, and AdwSpinRow
669
+ * to configure the adjustment bounds, increments, and value change callback.
394
670
  */
395
- export type TreeListViewProps<T = unknown> = Omit<GeneratedGtkListViewProps, "renderItem"> & {
396
- /** Function to render each tree item */
397
- renderItem: TreeRenderItemFn<T>;
398
- /** Estimated item height in pixels for proper virtualization before content loads */
399
- estimatedItemHeight?: number;
400
- /** Whether to automatically expand new rows (default: false) */
401
- autoexpand?: boolean;
402
- /** Selection mode for the tree */
403
- selectionMode?: Gtk.SelectionMode;
404
- /** Currently selected item IDs */
405
- selected?: string[];
406
- /** Callback when selection changes */
407
- onSelectionChanged?: (ids: string[]) => void;
671
+ export type AdjustableProps = {
672
+ /** The current value of the adjustable */
673
+ value?: number;
674
+ /** The minimum allowed value */
675
+ lower?: number;
676
+ /** The maximum allowed value */
677
+ upper?: number;
678
+ /** The step increment for small adjustments */
679
+ stepIncrement?: number;
680
+ /** The page increment for larger adjustments */
681
+ pageIncrement?: number;
682
+ /** The size of the visible portion (for scrollbars) */
683
+ pageSize?: number;
684
+ /** Callback fired when the adjustable value changes */
685
+ onValueChanged?: ((value: number, self: Gtk.Range | Gtk.ScaleButton | Gtk.SpinButton | Adw.SpinRow) => void) | null;
408
686
  };
409
687
  /**
410
688
  * GTKX-specific intrinsic elements and components.
@@ -423,8 +701,8 @@ export type TreeListViewProps<T = unknown> = Omit<GeneratedGtkListViewProps, "re
423
701
  * </GtkHeaderBar>
424
702
  *
425
703
  * <GtkDropDown>
426
- * <x.SimpleListItem id="opt1" value="Option 1" />
427
- * <x.SimpleListItem id="opt2" value="Option 2" />
704
+ * <x.ListItem id="opt1" value="Option 1" />
705
+ * <x.ListItem id="opt2" value="Option 2" />
428
706
  * </GtkDropDown>
429
707
  * ```
430
708
  */
@@ -506,40 +784,26 @@ export declare const x: {
506
784
  */
507
785
  NotebookPageTab: "NotebookPageTab";
508
786
  /**
509
- * Element type for items in a ListView or GridView.
787
+ * Element type for items in a GtkListView, GtkGridView, or GtkColumnView.
510
788
  *
511
- * @example
512
- * ```tsx
513
- * <x.ListView renderItem={(item) => <GtkLabel label={item.name} />}>
514
- * <x.ListItem id="1" value={{ name: "Item 1" }} />
515
- * </x.ListView>
516
- * ```
517
- */
518
- ListItem: "ListItem";
519
- /**
520
- * Element type for items in a TreeListView.
789
+ * Items can be nested to create tree hierarchies inside a GtkListView.
521
790
  *
522
791
  * @example
523
792
  * ```tsx
524
- * <x.TreeListView renderItem={(item) => <GtkLabel label={item.name} />}>
525
- * <x.TreeListItem id="parent" value={{ name: "Parent" }}>
526
- * <x.TreeListItem id="child" value={{ name: "Child" }} />
527
- * </x.TreeListItem>
528
- * </x.TreeListView>
529
- * ```
530
- */
531
- TreeListItem: "TreeListItem";
532
- /**
533
- * Element type for simple string-based list items.
793
+ * // Flat list
794
+ * <GtkListView renderItem={(item) => <GtkLabel label={item.name} />}>
795
+ * <x.ListItem id="1" value={{ name: "Item 1" }} />
796
+ * </GtkListView>
534
797
  *
535
- * @example
536
- * ```tsx
537
- * <GtkDropDown>
538
- * <x.SimpleListItem id="opt1" value="Option 1" />
539
- * </GtkDropDown>
798
+ * // Tree list (nested items)
799
+ * <GtkListView renderItem={(item, row) => <GtkLabel label={item.name} />} autoexpand>
800
+ * <x.ListItem id="parent" value={{ name: "Parent" }}>
801
+ * <x.ListItem id="child" value={{ name: "Child" }} />
802
+ * </x.ListItem>
803
+ * </GtkListView>
540
804
  * ```
541
805
  */
542
- SimpleListItem: "SimpleListItem";
806
+ ListItem: "ListItem";
543
807
  /**
544
808
  * Component for defining columns in a ColumnView (table widget).
545
809
  *
@@ -557,118 +821,41 @@ export declare const x: {
557
821
  */
558
822
  ColumnViewColumn<T = unknown>(props: ColumnViewColumnProps<T>): ReactElement;
559
823
  /**
560
- * Virtualized list component with custom item rendering.
824
+ * Type-safe container slot for placing children via parent widget methods.
561
825
  *
562
- * @example
563
- * ```tsx
564
- * <x.ListView renderItem={(item) => <GtkLabel label={item?.name ?? ""} />}>
565
- * <x.ListItem id="1" value={{ name: "Apple" }} />
566
- * </x.ListView>
567
- * ```
568
- */
569
- ListView<T = unknown>(props: ListViewProps<T>): ReactElement;
570
- /**
571
- * Virtualized grid component with custom item rendering.
826
+ * Unlike `x.Slot` (which uses property setters for single-child slots),
827
+ * `x.ContainerSlot` calls attachment methods that support multiple children
828
+ * (e.g., `addPrefix()`, `packStart()`, `addTopBar()`).
572
829
  *
573
- * @example
574
- * ```tsx
575
- * <x.GridView renderItem={(item) => <GtkImage iconName={item?.icon ?? ""} />}>
576
- * <x.ListItem id="1" value={{ icon: "folder" }} />
577
- * </x.GridView>
578
- * ```
579
- */
580
- GridView<T = unknown>(props: GridViewProps<T>): ReactElement;
581
- /**
582
- * Tree list component with hierarchical data and expand/collapse support.
830
+ * The `for` prop provides TypeScript type narrowing for the `id` prop
831
+ * and is not used at runtime.
583
832
  *
584
833
  * @example
585
834
  * ```tsx
586
- * <x.TreeListView renderItem={(item, row) => <GtkLabel label={item.name} />}>
587
- * <x.TreeListItem id="root" value={{ name: "Root" }}>
588
- * <x.TreeListItem id="child" value={{ name: "Child" }} />
589
- * </x.TreeListItem>
590
- * </x.TreeListView>
591
- * ```
592
- */
593
- TreeListView<T = unknown>(props: TreeListViewProps<T>): ReactElement;
594
- /**
595
- * Place child as a prefix (left side) of AdwActionRow, AdwEntryRow, or AdwExpanderRow.
596
- *
597
- * @example
598
- * ```tsx
599
- * <AdwActionRow title="Setting">
600
- * <x.ActionRowPrefix>
601
- * <GtkCheckButton />
602
- * </x.ActionRowPrefix>
603
- * </AdwActionRow>
604
- * ```
605
- */
606
- ActionRowPrefix: "ActionRowPrefix";
607
- /**
608
- * Place child as a suffix (right side) of AdwActionRow, AdwEntryRow, or AdwExpanderRow.
609
- *
610
- * @example
611
- * ```tsx
612
- * <AdwActionRow title="Setting">
613
- * <x.ActionRowSuffix>
614
- * <GtkButton iconName="go-next-symbolic" />
615
- * </x.ActionRowSuffix>
616
- * </AdwActionRow>
617
- * ```
618
- */
619
- ActionRowSuffix: "ActionRowSuffix";
620
- /**
621
- * Place child at the start (left in LTR) of HeaderBar or ActionBar.
835
+ * <AdwToolbarView>
836
+ * <x.ContainerSlot for={AdwToolbarView} id="addTopBar">
837
+ * <AdwHeaderBar />
838
+ * </x.ContainerSlot>
839
+ * </AdwToolbarView>
622
840
  *
623
- * @example
624
- * ```tsx
625
841
  * <GtkHeaderBar>
626
- * <x.PackStart>
842
+ * <x.ContainerSlot for={GtkHeaderBar} id="packStart">
627
843
  * <GtkButton label="Back" />
628
- * </x.PackStart>
629
- * </GtkHeaderBar>
630
- * ```
631
- */
632
- PackStart: "PackStart";
633
- /**
634
- * Place child at the end (right in LTR) of HeaderBar or ActionBar.
635
- *
636
- * @example
637
- * ```tsx
638
- * <GtkHeaderBar>
639
- * <x.PackEnd>
640
- * <GtkMenuButton />
641
- * </x.PackEnd>
844
+ * </x.ContainerSlot>
642
845
  * </GtkHeaderBar>
643
- * ```
644
- */
645
- PackEnd: "PackEnd";
646
- /**
647
- * Place toolbar at the top of AdwToolbarView.
648
- *
649
- * @example
650
- * ```tsx
651
- * <AdwToolbarView>
652
- * <x.ToolbarTop>
653
- * <AdwHeaderBar />
654
- * </x.ToolbarTop>
655
- * </AdwToolbarView>
656
- * ```
657
- */
658
- ToolbarTop: "ToolbarTop";
659
- /**
660
- * Place toolbar at the bottom of AdwToolbarView.
661
846
  *
662
- * @example
663
- * ```tsx
664
- * <AdwToolbarView>
665
- * <x.ToolbarBottom>
666
- * <GtkActionBar />
667
- * </x.ToolbarBottom>
668
- * </AdwToolbarView>
847
+ * <AdwActionRow title="Setting">
848
+ * <x.ContainerSlot for={AdwActionRow} id="addPrefix">
849
+ * <GtkCheckButton />
850
+ * </x.ContainerSlot>
851
+ * </AdwActionRow>
669
852
  * ```
670
853
  */
671
- ToolbarBottom: "ToolbarBottom";
854
+ ContainerSlot<W extends keyof ContainerSlotNames>(props: {
855
+ for: W;
856
+ id: ContainerSlotNames[W];
857
+ children?: ReactNode;
858
+ }): ReactElement;
672
859
  /**
673
860
  * Element type for overlay children positioned above the main content.
674
861
  *
@@ -792,33 +979,6 @@ export declare const x: {
792
979
  * ```
793
980
  */
794
981
  AlertDialogResponse: "AlertDialogResponse";
795
- /**
796
- * Nested rows container for AdwExpanderRow.
797
- *
798
- * @example
799
- * ```tsx
800
- * <AdwExpanderRow title="Settings">
801
- * <ExpanderRow.Row>
802
- * <AdwActionRow title="Option 1" />
803
- * <AdwActionRow title="Option 2" />
804
- * </ExpanderRow.Row>
805
- * </AdwExpanderRow>
806
- * ```
807
- */
808
- ExpanderRowRow: "ExpanderRowRow";
809
- /**
810
- * Action widget container for AdwExpanderRow header.
811
- *
812
- * @example
813
- * ```tsx
814
- * <AdwExpanderRow title="Group">
815
- * <ExpanderRow.Action>
816
- * <GtkButton iconName="emblem-system-symbolic" />
817
- * </ExpanderRow.Action>
818
- * </AdwExpanderRow>
819
- * ```
820
- */
821
- ExpanderRowAction: "ExpanderRowAction";
822
982
  /**
823
983
  * Type-safe page component for AdwNavigationView or AdwNavigationSplitView.
824
984
  *
@@ -847,22 +1007,6 @@ export declare const x: {
847
1007
  * ```
848
1008
  */
849
1009
  NavigationPage: "NavigationPage";
850
- /**
851
- * Declarative keyboard shortcut controller.
852
- *
853
- * Attach keyboard shortcuts to a widget. Must contain `x.Shortcut` children.
854
- *
855
- * @example
856
- * ```tsx
857
- * <GtkBox>
858
- * <GtkShortcutController scope={Gtk.ShortcutScope.GLOBAL}>
859
- * <x.Shortcut trigger="<Control>f" onActivate={() => setSearchMode(s => !s)} />
860
- * <x.Shortcut trigger="<Control>q" onActivate={quit} />
861
- * </GtkShortcutController>
862
- * </GtkBox>
863
- * ```
864
- */
865
- ShortcutController: "GtkShortcutController";
866
1010
  /**
867
1011
  * A keyboard shortcut definition.
868
1012
  *
@@ -884,9 +1028,9 @@ export declare const x: {
884
1028
  * @example
885
1029
  * ```tsx
886
1030
  * <x.Animation
887
- * mode="spring"
888
1031
  * initial={{ opacity: 0, scale: 0.9 }}
889
1032
  * animate={{ opacity: 1, scale: 1 }}
1033
+ * transition={{ mode: "spring", damping: 0.8, stiffness: 200 }}
890
1034
  * animateOnMount
891
1035
  * >
892
1036
  * <GtkButton label="Animated Button" />
@@ -895,17 +1039,18 @@ export declare const x: {
895
1039
  */
896
1040
  Animation: "Animation";
897
1041
  };
1042
+ interface StackProps {
1043
+ /** ID of the currently visible page */
1044
+ page?: string | null;
1045
+ }
898
1046
  declare global {
899
1047
  namespace React {
900
1048
  namespace JSX {
901
1049
  interface IntrinsicElements {
902
- ActionRowPrefix: VirtualSlotProps;
903
- ActionRowSuffix: VirtualSlotProps;
904
1050
  AlertDialogResponse: AlertDialogResponseProps;
905
1051
  Animation: AnimationProps;
906
- ColumnViewColumn: ColumnViewColumnProps<any>;
907
- ExpanderRowAction: ExpanderRowChildProps;
908
- ExpanderRowRow: ExpanderRowChildProps;
1052
+ ContainerSlot: ContainerSlotProps;
1053
+ ColumnViewColumn: ColumnViewColumnProps;
909
1054
  FixedChild: FixedChildProps;
910
1055
  GridChild: GridChildProps;
911
1056
  ListItem: ListItemProps;
@@ -913,23 +1058,155 @@ declare global {
913
1058
  MenuSection: MenuSectionProps;
914
1059
  MenuSubmenu: MenuSubmenuProps;
915
1060
  NotebookPage: NotebookPageProps;
916
- NotebookPageTab: VirtualSlotProps;
1061
+ NotebookPageTab: NotebookPageTabProps;
917
1062
  OverlayChild: OverlayChildProps;
918
- PackEnd: VirtualSlotProps;
919
- PackStart: VirtualSlotProps;
920
1063
  TextAnchor: TextAnchorProps;
921
1064
  TextPaintable: TextPaintableProps;
922
1065
  TextTag: TextTagProps;
923
- SimpleListItem: StringListItemProps;
924
1066
  StackPage: StackPageProps;
925
1067
  Toggle: ToggleProps;
926
- ToolbarBottom: VirtualSlotProps;
927
- ToolbarTop: VirtualSlotProps;
928
- TreeListItem: TreeListItemProps<any>;
929
1068
  NavigationPage: NavigationPageProps;
930
1069
  Shortcut: ShortcutProps;
931
1070
  }
932
1071
  }
933
1072
  }
934
1073
  }
1074
+ declare module "./generated/jsx.js" {
1075
+ interface GtkRangeProps extends Omit<AdjustableProps, "onValueChanged"> {
1076
+ /** Callback fired when the range value changes */
1077
+ onValueChanged?: ((value: number, self: Gtk.Range) => void) | null;
1078
+ }
1079
+ interface GtkScaleProps {
1080
+ /** Visual marks placed along the scale at specific values */
1081
+ marks?: Array<{
1082
+ value: number;
1083
+ position?: Gtk.PositionType;
1084
+ label?: string | null;
1085
+ }> | null;
1086
+ }
1087
+ interface GtkScaleButtonProps extends Omit<AdjustableProps, "value" | "onValueChanged"> {
1088
+ /** Callback fired when the scale button value changes */
1089
+ onValueChanged?: ((value: number, self: Gtk.ScaleButton) => void) | null;
1090
+ }
1091
+ interface GtkSpinButtonProps extends Omit<AdjustableProps, "value" | "onValueChanged"> {
1092
+ /** Callback fired when the spin button value changes */
1093
+ onValueChanged?: ((value: number, self: Gtk.SpinButton) => void) | null;
1094
+ }
1095
+ interface AdwSpinRowProps extends Omit<AdjustableProps, "value" | "onValueChanged"> {
1096
+ /** Callback fired when the spin row value changes */
1097
+ onValueChanged?: ((value: number, self: Adw.SpinRow) => void) | null;
1098
+ }
1099
+ interface GtkCalendarProps {
1100
+ /** Array of day numbers (1-31) to display as marked */
1101
+ markedDays?: number[] | null;
1102
+ }
1103
+ interface GtkLevelBarProps {
1104
+ /** Named offset thresholds that change the bar's appearance */
1105
+ offsets?: Array<{
1106
+ id: string;
1107
+ value: number;
1108
+ }> | null;
1109
+ }
1110
+ interface GtkTextViewProps extends TextBufferProps {
1111
+ }
1112
+ interface GtkSourceViewProps extends TextBufferProps {
1113
+ /** Language for syntax highlighting (ID string or Language object) */
1114
+ language?: string | GtkSource.Language;
1115
+ /** Color scheme for syntax highlighting (ID string or StyleScheme object) */
1116
+ styleScheme?: string | GtkSource.StyleScheme;
1117
+ /** Whether syntax highlighting is enabled */
1118
+ highlightSyntax?: boolean;
1119
+ /** Whether matching brackets are highlighted */
1120
+ highlightMatchingBrackets?: boolean;
1121
+ /** Whether the buffer has an implicit trailing newline */
1122
+ implicitTrailingNewline?: boolean;
1123
+ /** Callback fired when the cursor position changes */
1124
+ onCursorMoved?: (() => void) | null;
1125
+ /** Callback fired when the highlighted region is updated */
1126
+ onHighlightUpdated?: ((start: Gtk.TextIter, end: Gtk.TextIter) => void) | null;
1127
+ }
1128
+ interface GtkListViewProps extends ListViewProps {
1129
+ }
1130
+ interface GtkGridViewProps extends GridViewProps {
1131
+ }
1132
+ interface GtkColumnViewProps {
1133
+ /** Array of selected row IDs */
1134
+ selected?: string[] | null;
1135
+ /** Callback fired when the selection changes */
1136
+ onSelectionChanged?: ((ids: string[]) => void) | null;
1137
+ /** Selection behavior (single, multiple, none, etc.) */
1138
+ selectionMode?: Gtk.SelectionMode | null;
1139
+ /** ID of the currently sorted column, or null for no sorting */
1140
+ sortColumn?: string | null;
1141
+ /** Sort direction (ascending or descending) */
1142
+ sortOrder?: Gtk.SortType | null;
1143
+ /** Callback fired when the sort column or order changes */
1144
+ onSortChanged?: ((column: string | null, order: Gtk.SortType) => void) | null;
1145
+ /** Estimated row height in pixels for virtualization */
1146
+ estimatedRowHeight?: number | null;
1147
+ }
1148
+ interface GtkDropDownProps extends DropDownProps {
1149
+ }
1150
+ interface AdwComboRowProps extends DropDownProps {
1151
+ }
1152
+ interface GtkStackProps extends StackProps {
1153
+ /** Callback fired when the visible page changes */
1154
+ onPageChanged?: ((page: string | null, self: Gtk.Stack) => void) | null;
1155
+ }
1156
+ interface AdwViewStackProps extends StackProps {
1157
+ /** Callback fired when the visible page changes */
1158
+ onPageChanged?: ((page: string | null, self: Adw.ViewStack) => void) | null;
1159
+ }
1160
+ interface AdwNavigationViewProps {
1161
+ /** Ordered list of page tags representing the navigation stack */
1162
+ history?: string[] | null;
1163
+ /** Callback fired when the navigation history changes */
1164
+ onHistoryChanged?: ((history: string[]) => void) | null;
1165
+ }
1166
+ interface GtkWindowProps {
1167
+ /** Callback fired when the window close button is clicked */
1168
+ onClose?: (() => void) | null;
1169
+ }
1170
+ interface GtkDrawingAreaProps {
1171
+ /** Callback fired when the drawing area needs to be redrawn */
1172
+ onDraw?: ((self: Gtk.DrawingArea, cr: cairo.Context, width: number, height: number) => void) | null;
1173
+ }
1174
+ interface GtkColorDialogButtonProps extends DialogButtonProps {
1175
+ /** Callback fired when the selected color changes */
1176
+ onRgbaChanged?: ((rgba: Gdk.RGBA) => void) | null;
1177
+ /** Whether to show an alpha (opacity) channel */
1178
+ withAlpha?: boolean;
1179
+ }
1180
+ interface GtkFontDialogButtonProps extends DialogButtonProps {
1181
+ /** Callback fired when the selected font changes */
1182
+ onFontDescChanged?: ((fontDesc: Pango.FontDescription) => void) | null;
1183
+ }
1184
+ interface GtkAboutDialogProps {
1185
+ /** Additional credit sections with names and lists of people */
1186
+ creditSections?: Array<{
1187
+ name: string;
1188
+ people: string[];
1189
+ }>;
1190
+ }
1191
+ interface GtkSearchBarProps {
1192
+ /** Callback fired when search mode is toggled */
1193
+ onSearchModeChanged?: ((searchMode: boolean) => void) | null;
1194
+ }
1195
+ interface AdwToggleGroupProps {
1196
+ /** Callback fired when the active toggle changes */
1197
+ onActiveChanged?: ((active: number, activeName: string | null) => void) | null;
1198
+ }
1199
+ interface GtkDragSourceProps {
1200
+ /** Paintable to use as the drag icon */
1201
+ icon?: Gdk.Paintable | null;
1202
+ /** X offset of the hotspot within the drag icon */
1203
+ iconHotX?: number;
1204
+ /** Y offset of the hotspot within the drag icon */
1205
+ iconHotY?: number;
1206
+ }
1207
+ interface GtkDropTargetProps {
1208
+ /** GType values for accepted drop content types */
1209
+ types?: number[];
1210
+ }
1211
+ }
935
1212
  export * from "./generated/jsx.js";