@gtkx/react 0.15.0 → 0.17.1

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 (172) hide show
  1. package/README.md +1 -0
  2. package/dist/animation/css-builder.d.ts +3 -0
  3. package/dist/animation/css-builder.js +53 -0
  4. package/dist/animation/types.d.ts +120 -0
  5. package/dist/errors.js +3 -0
  6. package/dist/factory.d.ts +3 -2
  7. package/dist/factory.js +1 -1
  8. package/dist/fiber-root.js +1 -1
  9. package/dist/generated/internal.d.ts +28 -1
  10. package/dist/generated/internal.js +93 -18
  11. package/dist/generated/jsx.d.ts +1672 -1483
  12. package/dist/generated/jsx.js +475 -0
  13. package/dist/host-config.d.ts +3 -1
  14. package/dist/host-config.js +26 -11
  15. package/dist/jsx.d.ts +136 -166
  16. package/dist/jsx.js +58 -69
  17. package/dist/node.d.ts +4 -1
  18. package/dist/node.js +14 -3
  19. package/dist/nodes/abstract/positional-child.d.ts +9 -0
  20. package/dist/nodes/abstract/positional-child.js +29 -0
  21. package/dist/nodes/abstract/virtual-container.d.ts +21 -0
  22. package/dist/nodes/abstract/virtual-container.js +68 -0
  23. package/dist/nodes/abstract/virtual-single-child.d.ts +18 -0
  24. package/dist/nodes/abstract/virtual-single-child.js +55 -0
  25. package/dist/nodes/action-row-child.d.ts +0 -13
  26. package/dist/nodes/action-row-child.js +22 -12
  27. package/dist/nodes/adjustable.d.ts +23 -0
  28. package/dist/nodes/adjustable.js +62 -0
  29. package/dist/nodes/alert-dialog-response.js +86 -0
  30. package/dist/nodes/animation.js +252 -0
  31. package/dist/nodes/application.js +17 -7
  32. package/dist/nodes/autowrapped.js +37 -43
  33. package/dist/nodes/calendar.js +17 -43
  34. package/dist/nodes/color-dialog-button.d.ts +1 -0
  35. package/dist/nodes/color-dialog-button.js +70 -0
  36. package/dist/nodes/column-view-column.d.ts +3 -3
  37. package/dist/nodes/column-view-column.js +1 -1
  38. package/dist/nodes/column-view.js +36 -39
  39. package/dist/nodes/dialog.d.ts +11 -0
  40. package/dist/nodes/dialog.js +20 -0
  41. package/dist/nodes/drawing-area.js +24 -7
  42. package/dist/nodes/event-controller.d.ts +22 -0
  43. package/dist/nodes/event-controller.js +96 -0
  44. package/dist/nodes/expander-row-child.d.ts +0 -14
  45. package/dist/nodes/expander-row-child.js +22 -12
  46. package/dist/nodes/fixed-child.js +52 -36
  47. package/dist/nodes/font-dialog-button.d.ts +1 -0
  48. package/dist/nodes/font-dialog-button.js +90 -0
  49. package/dist/nodes/grid-child.js +43 -45
  50. package/dist/nodes/grid.d.ts +1 -0
  51. package/dist/nodes/grid.js +41 -0
  52. package/dist/nodes/index.d.ts +18 -12
  53. package/dist/nodes/index.js +18 -12
  54. package/dist/nodes/internal/base-item-renderer.d.ts +29 -0
  55. package/dist/nodes/internal/base-item-renderer.js +88 -0
  56. package/dist/nodes/internal/child-attachment.d.ts +26 -0
  57. package/dist/nodes/internal/child-attachment.js +48 -0
  58. package/dist/nodes/internal/deferred-action.d.ts +9 -0
  59. package/dist/nodes/internal/deferred-action.js +22 -0
  60. package/dist/nodes/internal/list-item-renderer.d.ts +14 -15
  61. package/dist/nodes/internal/list-item-renderer.js +51 -77
  62. package/dist/nodes/internal/list-store.d.ts +5 -6
  63. package/dist/nodes/internal/list-store.js +29 -38
  64. package/dist/nodes/internal/predicates.d.ts +25 -2
  65. package/dist/nodes/internal/predicates.js +53 -41
  66. package/dist/nodes/internal/selection-model.d.ts +30 -0
  67. package/dist/nodes/internal/selection-model.js +87 -0
  68. package/dist/nodes/internal/signal-store.d.ts +9 -5
  69. package/dist/nodes/internal/signal-store.js +31 -31
  70. package/dist/nodes/internal/simple-list-store.js +6 -9
  71. package/dist/nodes/internal/text-buffer-controller.d.ts +43 -0
  72. package/dist/nodes/internal/text-buffer-controller.js +287 -0
  73. package/dist/nodes/internal/text-tag-styles.d.ts +43 -0
  74. package/dist/nodes/internal/text-tag-styles.js +52 -0
  75. package/dist/nodes/internal/tree-list-item-renderer.d.ts +15 -14
  76. package/dist/nodes/internal/tree-list-item-renderer.js +85 -96
  77. package/dist/nodes/internal/tree-store.d.ts +8 -11
  78. package/dist/nodes/internal/tree-store.js +70 -72
  79. package/dist/nodes/internal/utils.d.ts +7 -4
  80. package/dist/nodes/internal/utils.js +50 -5
  81. package/dist/nodes/level-bar.js +19 -54
  82. package/dist/nodes/list-item.d.ts +6 -3
  83. package/dist/nodes/list-item.js +7 -4
  84. package/dist/nodes/list-view.js +17 -12
  85. package/dist/nodes/menu.d.ts +3 -3
  86. package/dist/nodes/menu.js +3 -3
  87. package/dist/nodes/models/list.d.ts +11 -13
  88. package/dist/nodes/models/list.js +16 -73
  89. package/dist/nodes/models/menu.d.ts +8 -7
  90. package/dist/nodes/models/menu.js +43 -50
  91. package/dist/nodes/models/tree-list.d.ts +6 -12
  92. package/dist/nodes/models/tree-list.js +30 -93
  93. package/dist/nodes/navigation-page.d.ts +1 -0
  94. package/dist/nodes/navigation-page.js +27 -32
  95. package/dist/nodes/navigation-view.js +17 -28
  96. package/dist/nodes/notebook-page-tab.d.ts +3 -3
  97. package/dist/nodes/notebook-page-tab.js +11 -14
  98. package/dist/nodes/notebook-page.d.ts +7 -5
  99. package/dist/nodes/notebook-page.js +45 -25
  100. package/dist/nodes/notebook.js +2 -2
  101. package/dist/nodes/overlay-child.js +90 -30
  102. package/dist/nodes/pack-child.d.ts +0 -13
  103. package/dist/nodes/pack-child.js +22 -12
  104. package/dist/nodes/popover-menu.js +2 -2
  105. package/dist/nodes/scale.js +15 -45
  106. package/dist/nodes/scrolled-window.js +7 -6
  107. package/dist/nodes/search-bar.d.ts +1 -0
  108. package/dist/nodes/search-bar.js +40 -0
  109. package/dist/nodes/shortcut-controller.d.ts +1 -37
  110. package/dist/nodes/shortcut-controller.js +8 -47
  111. package/dist/nodes/shortcut.d.ts +5 -4
  112. package/dist/nodes/shortcut.js +11 -5
  113. package/dist/nodes/simple-list-view.js +2 -3
  114. package/dist/nodes/slot.d.ts +6 -9
  115. package/dist/nodes/slot.js +27 -42
  116. package/dist/nodes/source-view.js +80 -29
  117. package/dist/nodes/stack-page.js +20 -22
  118. package/dist/nodes/stack.js +19 -5
  119. package/dist/nodes/text-anchor.d.ts +41 -0
  120. package/dist/nodes/text-anchor.js +59 -0
  121. package/dist/nodes/text-content.d.ts +10 -0
  122. package/dist/nodes/text-content.js +1 -0
  123. package/dist/nodes/text-paintable.d.ts +17 -0
  124. package/dist/nodes/text-paintable.js +34 -0
  125. package/dist/nodes/text-segment.d.ts +15 -0
  126. package/dist/nodes/text-segment.js +29 -0
  127. package/dist/nodes/text-tag.d.ts +136 -0
  128. package/dist/nodes/text-tag.js +202 -0
  129. package/dist/nodes/text-view.d.ts +30 -0
  130. package/dist/nodes/text-view.js +49 -21
  131. package/dist/nodes/toggle-group.js +24 -32
  132. package/dist/nodes/toggle.d.ts +1 -15
  133. package/dist/nodes/toggle.js +40 -32
  134. package/dist/nodes/toolbar-child.js +22 -31
  135. package/dist/nodes/tree-list-item.d.ts +7 -5
  136. package/dist/nodes/tree-list-item.js +24 -36
  137. package/dist/nodes/tree-list-view.js +9 -7
  138. package/dist/nodes/virtual.d.ts +1 -1
  139. package/dist/nodes/web-view.d.ts +1 -0
  140. package/dist/nodes/web-view.js +29 -0
  141. package/dist/nodes/widget.d.ts +2 -16
  142. package/dist/nodes/widget.js +105 -294
  143. package/dist/nodes/window.d.ts +9 -3
  144. package/dist/nodes/window.js +29 -15
  145. package/dist/registry.d.ts +1 -1
  146. package/dist/render.js +9 -7
  147. package/dist/scheduler.d.ts +11 -1
  148. package/dist/scheduler.js +16 -4
  149. package/dist/types.d.ts +2 -136
  150. package/package.json +4 -4
  151. package/dist/nodes/action-row.js +0 -46
  152. package/dist/nodes/adjustment.d.ts +0 -48
  153. package/dist/nodes/adjustment.js +0 -70
  154. package/dist/nodes/calendar-mark.d.ts +0 -15
  155. package/dist/nodes/calendar-mark.js +0 -29
  156. package/dist/nodes/expander-row.js +0 -55
  157. package/dist/nodes/internal/constants.d.ts +0 -1
  158. package/dist/nodes/internal/constants.js +0 -24
  159. package/dist/nodes/level-bar-offset.d.ts +0 -13
  160. package/dist/nodes/level-bar-offset.js +0 -35
  161. package/dist/nodes/pack.js +0 -46
  162. package/dist/nodes/scale-mark.d.ts +0 -17
  163. package/dist/nodes/scale-mark.js +0 -38
  164. package/dist/nodes/source-buffer.d.ts +0 -73
  165. package/dist/nodes/source-buffer.js +0 -149
  166. package/dist/nodes/text-buffer.d.ts +0 -43
  167. package/dist/nodes/text-buffer.js +0 -81
  168. package/dist/nodes/virtual-child.d.ts +0 -18
  169. package/dist/nodes/virtual-child.js +0 -62
  170. /package/dist/{nodes/action-row.d.ts → animation/types.js} +0 -0
  171. /package/dist/nodes/{expander-row.d.ts → alert-dialog-response.d.ts} +0 -0
  172. /package/dist/nodes/{pack.d.ts → animation.d.ts} +0 -0
package/dist/jsx.d.ts CHANGED
@@ -1,16 +1,50 @@
1
+ import type * as Adw from "@gtkx/ffi/adw";
2
+ import type * as Gsk from "@gtkx/ffi/gsk";
1
3
  import type * as Gtk from "@gtkx/ffi/gtk";
2
4
  import type { ReactElement, ReactNode } from "react";
3
- import type { AdjustmentProps } from "./nodes/adjustment.js";
5
+ import type { AnimationProps } from "./animation/types.js";
6
+ import type { GtkGridViewProps as GeneratedGtkGridViewProps, GtkListViewProps as GeneratedGtkListViewProps, WidgetSlotNames } from "./generated/jsx.js";
4
7
  import type { RenderItemFn } from "./nodes/internal/list-item-renderer.js";
5
8
  import type { TreeRenderItemFn } from "./nodes/internal/tree-list-item-renderer.js";
6
9
  import type { ShortcutProps as ShortcutNodeProps } from "./nodes/shortcut.js";
7
- import type { ShortcutControllerProps as ShortcutControllerNodeProps } from "./nodes/shortcut-controller.js";
8
- import type { SourceBufferProps } from "./nodes/source-buffer.js";
9
- import type { TextBufferProps } from "./nodes/text-buffer.js";
10
- export type { AdjustmentProps } from "./nodes/adjustment.js";
11
- export type { SourceBufferProps } from "./nodes/source-buffer.js";
12
- export type { TextBufferProps } from "./nodes/text-buffer.js";
13
- export type { DragSourceProps, DropTargetProps, EventControllerProps, GestureDragProps } from "./types.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";
17
+ /**
18
+ * Configuration for a mark on a GtkScale widget.
19
+ *
20
+ * Marks are visual indicators placed along the scale at specific values,
21
+ * optionally with text labels.
22
+ *
23
+ * @see {@link https://docs.gtk.org/gtk4/method.Scale.add_mark.html GtkScale.add_mark}
24
+ */
25
+ export type ScaleMark = {
26
+ /** The value at which to place the mark */
27
+ value: number;
28
+ /** Position of the mark relative to the scale (default: BOTTOM) */
29
+ position?: Gtk.PositionType;
30
+ /** Optional text label to display at the mark */
31
+ label?: string | null;
32
+ };
33
+ /**
34
+ * Configuration for an offset threshold on a GtkLevelBar widget.
35
+ *
36
+ * Offsets define named value thresholds that change the bar's appearance
37
+ * (e.g., "low", "high", "full"). Built-in offsets include GTK_LEVEL_BAR_OFFSET_LOW,
38
+ * GTK_LEVEL_BAR_OFFSET_HIGH, and GTK_LEVEL_BAR_OFFSET_FULL.
39
+ *
40
+ * @see {@link https://docs.gtk.org/gtk4/method.LevelBar.add_offset_value.html GtkLevelBar.add_offset_value}
41
+ */
42
+ export type LevelBarOffset = {
43
+ /** Unique identifier for this offset (e.g., "low", "high", "full") */
44
+ id: string;
45
+ /** The threshold value at which this offset applies */
46
+ value: number;
47
+ };
14
48
  /**
15
49
  * Props for slot-based child positioning.
16
50
  *
@@ -95,6 +129,8 @@ export type FixedChildProps = VirtualSlotProps & {
95
129
  x?: number;
96
130
  /** Y coordinate in pixels */
97
131
  y?: number;
132
+ /** 3D transform to apply to the child (perspective, rotation, etc.) */
133
+ transform?: Gsk.Transform;
98
134
  };
99
135
  /**
100
136
  * Props for custom list view rendering.
@@ -149,6 +185,10 @@ export type ColumnViewRootProps<C extends string = string> = {
149
185
  export type NotebookPageProps = VirtualSlotProps & {
150
186
  /** Tab label text (optional when using Notebook.PageTab) */
151
187
  label?: string;
188
+ /** Whether the tab should expand to fill available space */
189
+ tabExpand?: boolean;
190
+ /** Whether the tab should fill its allocated space */
191
+ tabFill?: boolean;
152
192
  };
153
193
  /**
154
194
  * Props for custom notebook page tab widgets.
@@ -226,67 +266,6 @@ export type OverlayChildProps = VirtualSlotProps & {
226
266
  /** Whether to clip this overlay child to the main child bounds */
227
267
  clipOverlay?: boolean;
228
268
  };
229
- /**
230
- * Props for the ScaleMark virtual element.
231
- *
232
- * Used to declaratively add marks to a GtkScale slider.
233
- *
234
- * @example
235
- * ```tsx
236
- * <GtkScale>
237
- * <x.ScaleMark value={0} label="Min" />
238
- * <x.ScaleMark value={50} label="Mid" />
239
- * <x.ScaleMark value={100} label="Max" />
240
- * </GtkScale>
241
- * ```
242
- */
243
- export type ScaleMarkProps = {
244
- /** The value at which to place the mark */
245
- value: number;
246
- /** Position of the mark (TOP or BOTTOM for horizontal, LEFT or RIGHT for vertical) */
247
- position?: Gtk.PositionType;
248
- /** Optional label text (supports Pango markup) */
249
- label?: string | null;
250
- };
251
- /**
252
- * Props for the CalendarMark virtual element.
253
- *
254
- * Used to declaratively mark days on a GtkCalendar.
255
- *
256
- * @example
257
- * ```tsx
258
- * <GtkCalendar>
259
- * <x.CalendarMark day={15} />
260
- * <x.CalendarMark day={20} />
261
- * <x.CalendarMark day={25} />
262
- * </GtkCalendar>
263
- * ```
264
- */
265
- export type CalendarMarkProps = {
266
- /** The day of the month to mark (1-31) */
267
- day: number;
268
- };
269
- /**
270
- * Props for the LevelBarOffset virtual element.
271
- *
272
- * Used to declaratively add offset thresholds to a GtkLevelBar.
273
- * Each offset defines a named threshold that triggers visual style changes.
274
- *
275
- * @example
276
- * ```tsx
277
- * <GtkLevelBar>
278
- * <x.LevelBarOffset id="low" value={0.25} />
279
- * <x.LevelBarOffset id="high" value={0.75} />
280
- * <x.LevelBarOffset id="full" value={1.0} />
281
- * </GtkLevelBar>
282
- * ```
283
- */
284
- export type LevelBarOffsetProps = {
285
- /** Unique identifier for this offset (used for CSS styling) */
286
- id: string;
287
- /** The threshold value (0.0 to 1.0 for continuous mode, or integer for discrete) */
288
- value: number;
289
- };
290
269
  /**
291
270
  * Props for the Toggle virtual element.
292
271
  *
@@ -315,6 +294,23 @@ export type ToggleProps = {
315
294
  /** Whether underline in label indicates mnemonic */
316
295
  useUnderline?: boolean;
317
296
  };
297
+ /**
298
+ * Props for response buttons in an AdwAlertDialog.
299
+ *
300
+ * Each response represents a button the user can click to dismiss the dialog.
301
+ *
302
+ * @see {@link x.AlertDialogResponse} for usage
303
+ */
304
+ export type AlertDialogResponseProps = {
305
+ /** Unique response ID (used in response signal and for default/close response) */
306
+ id: string;
307
+ /** Button label text */
308
+ label: string;
309
+ /** Visual appearance of the response button */
310
+ appearance?: Adw.ResponseAppearance;
311
+ /** Whether the response button is enabled */
312
+ enabled?: boolean;
313
+ };
318
314
  /**
319
315
  * Props for ExpanderRow child slots (Row and Action).
320
316
  */
@@ -327,17 +323,7 @@ type NavigationPageBaseProps = {
327
323
  canPop?: boolean;
328
324
  children?: ReactNode;
329
325
  };
330
- /**
331
- * Props for the ShortcutController element in JSX.
332
- *
333
- * Extends the base ShortcutControllerProps with support for children.
334
- *
335
- * @see {@link x.ShortcutController} for usage examples
336
- */
337
- export type ShortcutControllerProps = ShortcutControllerNodeProps & {
338
- /** Shortcut children to add to this controller */
339
- children?: ReactNode;
340
- };
326
+ export type { GtkShortcutControllerProps as ShortcutControllerProps } from "./generated/jsx.js";
341
327
  /**
342
328
  * Props for the Shortcut element in JSX.
343
329
  *
@@ -376,18 +362,15 @@ export type NavigationPageProps = (NavigationPageBaseProps & {
376
362
  id: string;
377
363
  }) | (NavigationPageBaseProps & {
378
364
  for: "AdwNavigationSplitView";
379
- id: import("./generated/jsx.js").WidgetSlotNames["AdwNavigationSplitView"];
365
+ id: WidgetSlotNames["AdwNavigationSplitView"];
380
366
  });
381
- /**
382
- * Type mapping widget names to their available slot IDs.
383
- */
384
- export type { WidgetSlotNames } from "./generated/jsx.js";
367
+ export type { WidgetSlotNames };
385
368
  /**
386
369
  * Props for the ListView component.
387
370
  *
388
371
  * @typeParam T - The type of items in the list
389
372
  */
390
- export type ListViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkListViewProps, "renderItem"> & {
373
+ export type ListViewProps<T = unknown> = Omit<GeneratedGtkListViewProps, "renderItem"> & {
391
374
  /** Function to render each list item */
392
375
  renderItem: (item: T | null) => ReactNode;
393
376
  /** Estimated item height in pixels for proper virtualization before content loads */
@@ -398,7 +381,7 @@ export type ListViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkLi
398
381
  *
399
382
  * @typeParam T - The type of items in the grid
400
383
  */
401
- export type GridViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkGridViewProps, "renderItem"> & {
384
+ export type GridViewProps<T = unknown> = Omit<GeneratedGtkGridViewProps, "renderItem"> & {
402
385
  /** Function to render each grid item */
403
386
  renderItem: (item: T | null) => ReactNode;
404
387
  /** Estimated item height in pixels for proper virtualization before content loads */
@@ -409,7 +392,7 @@ export type GridViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkGr
409
392
  *
410
393
  * @typeParam T - The type of items in the tree
411
394
  */
412
- export type TreeListViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkListViewProps, "renderItem"> & {
395
+ export type TreeListViewProps<T = unknown> = Omit<GeneratedGtkListViewProps, "renderItem"> & {
413
396
  /** Function to render each tree item */
414
397
  renderItem: TreeRenderItemFn<T>;
415
398
  /** Estimated item height in pixels for proper virtualization before content loads */
@@ -461,9 +444,9 @@ export declare const x: {
461
444
  * </GtkHeaderBar>
462
445
  * ```
463
446
  */
464
- Slot<W extends keyof import("./generated/jsx.js").WidgetSlotNames>(props: {
447
+ Slot<W extends keyof WidgetSlotNames>(props: {
465
448
  for: W;
466
- id: import("./generated/jsx.js").WidgetSlotNames[W];
449
+ id: WidgetSlotNames[W];
467
450
  children?: ReactNode;
468
451
  }): ReactElement;
469
452
  /**
@@ -738,94 +721,48 @@ export declare const x: {
738
721
  */
739
722
  MenuSubmenu: "MenuSubmenu";
740
723
  /**
741
- * Declarative adjustment configuration for adjustable widgets.
724
+ * Declarative text tag for styling text content.
742
725
  *
743
- * Works with Scale, Scrollbar, ScaleButton, SpinButton, and ListBox.
726
+ * Wrap text content with a TextTag to apply styling. Tags can be nested.
744
727
  *
745
728
  * @example
746
729
  * ```tsx
747
- * <GtkScale>
748
- * <x.Adjustment
749
- * value={50}
750
- * lower={0}
751
- * upper={100}
752
- * onValueChanged={(v) => console.log(v)}
753
- * />
754
- * </GtkScale>
730
+ * <GtkTextView>
731
+ * Normal <x.TextTag id="bold" weight={Pango.Weight.BOLD}>
732
+ * bold <x.TextTag id="red" foreground="red">and red</x.TextTag>
733
+ * </x.TextTag> text.
734
+ * </GtkTextView>
755
735
  * ```
756
736
  */
757
- Adjustment: "Adjustment";
737
+ TextTag: "TextTag";
758
738
  /**
759
- * A mark to display on a GtkScale slider.
739
+ * Declarative anchor for embedding widgets in text flow.
760
740
  *
761
- * @example
762
- * ```tsx
763
- * <GtkScale>
764
- * <x.ScaleMark value={0} label="Min" />
765
- * <x.ScaleMark value={50} />
766
- * <x.ScaleMark value={100} label="Max" />
767
- * </GtkScale>
768
- * ```
769
- */
770
- ScaleMark: "ScaleMark";
771
- /**
772
- * Declarative text buffer for a GtkTextView.
741
+ * The anchor is placed at the current position in the text.
773
742
  *
774
743
  * @example
775
744
  * ```tsx
776
745
  * <GtkTextView>
777
- * <x.TextBuffer
778
- * text="Hello!"
779
- * enableUndo
780
- * onTextChanged={(text) => console.log(text)}
781
- * />
746
+ * Click here: <x.TextAnchor>
747
+ * <GtkButton label="Click me" />
748
+ * </x.TextAnchor> to continue.
782
749
  * </GtkTextView>
783
750
  * ```
784
751
  */
785
- TextBuffer: "TextBuffer";
752
+ TextAnchor: "TextAnchor";
786
753
  /**
787
- * Declarative source buffer for a GtkSourceView with syntax highlighting.
754
+ * Declarative inline paintable for embedding images/icons in text flow.
788
755
  *
789
- * @example
790
- * ```tsx
791
- * <GtkSourceView>
792
- * <x.SourceBuffer
793
- * text={code}
794
- * language="typescript"
795
- * styleScheme="Adwaita-dark"
796
- * highlightMatchingBrackets
797
- * onTextChanged={(text) => console.log(text)}
798
- * />
799
- * </GtkSourceView>
800
- * ```
801
- */
802
- SourceBuffer: "SourceBuffer";
803
- /**
804
- * A day mark on a GtkCalendar.
805
- *
806
- * @example
807
- * ```tsx
808
- * <GtkCalendar>
809
- * <x.CalendarMark day={15} />
810
- * <x.CalendarMark day={20} />
811
- * <x.CalendarMark day={25} />
812
- * </GtkCalendar>
813
- * ```
814
- */
815
- CalendarMark: "CalendarMark";
816
- /**
817
- * An offset threshold for a GtkLevelBar.
756
+ * The paintable is placed at the current position in the text.
818
757
  *
819
758
  * @example
820
759
  * ```tsx
821
- * <GtkLevelBar>
822
- * <x.LevelBarOffset id="low" value={0.25} />
823
- * <x.LevelBarOffset id="high" value={0.75} />
824
- * <x.LevelBarOffset id="full" value={1.0} />
825
- * </GtkLevelBar>
760
+ * <GtkTextView>
761
+ * Click the icon <x.TextPaintable paintable={iconPaintable} /> to continue.
762
+ * </GtkTextView>
826
763
  * ```
827
764
  */
828
- LevelBarOffset: "LevelBarOffset";
765
+ TextPaintable: "TextPaintable";
829
766
  /**
830
767
  * A toggle button for an AdwToggleGroup.
831
768
  *
@@ -838,6 +775,23 @@ export declare const x: {
838
775
  * ```
839
776
  */
840
777
  Toggle: "Toggle";
778
+ /**
779
+ * A response button for an AdwAlertDialog.
780
+ *
781
+ * @example
782
+ * ```tsx
783
+ * <AdwAlertDialog
784
+ * heading="Delete File?"
785
+ * body="This cannot be undone."
786
+ * defaultResponse="cancel"
787
+ * closeResponse="cancel"
788
+ * >
789
+ * <x.AlertDialogResponse id="cancel" label="Cancel" />
790
+ * <x.AlertDialogResponse id="delete" label="Delete" appearance={Adw.ResponseAppearance.DESTRUCTIVE} />
791
+ * </AdwAlertDialog>
792
+ * ```
793
+ */
794
+ AlertDialogResponse: "AlertDialogResponse";
841
795
  /**
842
796
  * Nested rows container for AdwExpanderRow.
843
797
  *
@@ -901,14 +855,14 @@ export declare const x: {
901
855
  * @example
902
856
  * ```tsx
903
857
  * <GtkBox>
904
- * <x.ShortcutController scope={Gtk.ShortcutScope.GLOBAL}>
858
+ * <GtkShortcutController scope={Gtk.ShortcutScope.GLOBAL}>
905
859
  * <x.Shortcut trigger="<Control>f" onActivate={() => setSearchMode(s => !s)} />
906
860
  * <x.Shortcut trigger="<Control>q" onActivate={quit} />
907
- * </x.ShortcutController>
861
+ * </GtkShortcutController>
908
862
  * </GtkBox>
909
863
  * ```
910
864
  */
911
- ShortcutController: "ShortcutController";
865
+ ShortcutController: "GtkShortcutController";
912
866
  /**
913
867
  * A keyboard shortcut definition.
914
868
  *
@@ -922,6 +876,24 @@ export declare const x: {
922
876
  * ```
923
877
  */
924
878
  Shortcut: "Shortcut";
879
+ /**
880
+ * Declarative animation wrapper using Adw.TimedAnimation or Adw.SpringAnimation.
881
+ *
882
+ * Provides framer-motion-inspired API for animating child widgets.
883
+ *
884
+ * @example
885
+ * ```tsx
886
+ * <x.Animation
887
+ * mode="spring"
888
+ * initial={{ opacity: 0, scale: 0.9 }}
889
+ * animate={{ opacity: 1, scale: 1 }}
890
+ * animateOnMount
891
+ * >
892
+ * <GtkButton label="Animated Button" />
893
+ * </x.Animation>
894
+ * ```
895
+ */
896
+ Animation: "Animation";
925
897
  };
926
898
  declare global {
927
899
  namespace React {
@@ -929,13 +901,13 @@ declare global {
929
901
  interface IntrinsicElements {
930
902
  ActionRowPrefix: VirtualSlotProps;
931
903
  ActionRowSuffix: VirtualSlotProps;
932
- CalendarMark: CalendarMarkProps;
904
+ AlertDialogResponse: AlertDialogResponseProps;
905
+ Animation: AnimationProps;
933
906
  ColumnViewColumn: ColumnViewColumnProps<any>;
934
907
  ExpanderRowAction: ExpanderRowChildProps;
935
908
  ExpanderRowRow: ExpanderRowChildProps;
936
909
  FixedChild: FixedChildProps;
937
910
  GridChild: GridChildProps;
938
- LevelBarOffset: LevelBarOffsetProps;
939
911
  ListItem: ListItemProps;
940
912
  MenuItem: MenuItemProps;
941
913
  MenuSection: MenuSectionProps;
@@ -945,10 +917,9 @@ declare global {
945
917
  OverlayChild: OverlayChildProps;
946
918
  PackEnd: VirtualSlotProps;
947
919
  PackStart: VirtualSlotProps;
948
- Adjustment: AdjustmentProps;
949
- ScaleMark: ScaleMarkProps;
950
- SourceBuffer: SourceBufferProps;
951
- TextBuffer: TextBufferProps;
920
+ TextAnchor: TextAnchorProps;
921
+ TextPaintable: TextPaintableProps;
922
+ TextTag: TextTagProps;
952
923
  SimpleListItem: StringListItemProps;
953
924
  StackPage: StackPageProps;
954
925
  Toggle: ToggleProps;
@@ -956,7 +927,6 @@ declare global {
956
927
  ToolbarTop: VirtualSlotProps;
957
928
  TreeListItem: TreeListItemProps<any>;
958
929
  NavigationPage: NavigationPageProps;
959
- ShortcutController: ShortcutControllerProps;
960
930
  Shortcut: ShortcutProps;
961
931
  }
962
932
  }
package/dist/jsx.js CHANGED
@@ -320,94 +320,48 @@ export const x = {
320
320
  */
321
321
  MenuSubmenu: "MenuSubmenu",
322
322
  /**
323
- * Declarative adjustment configuration for adjustable widgets.
323
+ * Declarative text tag for styling text content.
324
324
  *
325
- * Works with Scale, Scrollbar, ScaleButton, SpinButton, and ListBox.
325
+ * Wrap text content with a TextTag to apply styling. Tags can be nested.
326
326
  *
327
327
  * @example
328
328
  * ```tsx
329
- * <GtkScale>
330
- * <x.Adjustment
331
- * value={50}
332
- * lower={0}
333
- * upper={100}
334
- * onValueChanged={(v) => console.log(v)}
335
- * />
336
- * </GtkScale>
329
+ * <GtkTextView>
330
+ * Normal <x.TextTag id="bold" weight={Pango.Weight.BOLD}>
331
+ * bold <x.TextTag id="red" foreground="red">and red</x.TextTag>
332
+ * </x.TextTag> text.
333
+ * </GtkTextView>
337
334
  * ```
338
335
  */
339
- Adjustment: "Adjustment",
336
+ TextTag: "TextTag",
340
337
  /**
341
- * A mark to display on a GtkScale slider.
338
+ * Declarative anchor for embedding widgets in text flow.
342
339
  *
343
- * @example
344
- * ```tsx
345
- * <GtkScale>
346
- * <x.ScaleMark value={0} label="Min" />
347
- * <x.ScaleMark value={50} />
348
- * <x.ScaleMark value={100} label="Max" />
349
- * </GtkScale>
350
- * ```
351
- */
352
- ScaleMark: "ScaleMark",
353
- /**
354
- * Declarative text buffer for a GtkTextView.
340
+ * The anchor is placed at the current position in the text.
355
341
  *
356
342
  * @example
357
343
  * ```tsx
358
344
  * <GtkTextView>
359
- * <x.TextBuffer
360
- * text="Hello!"
361
- * enableUndo
362
- * onTextChanged={(text) => console.log(text)}
363
- * />
345
+ * Click here: <x.TextAnchor>
346
+ * <GtkButton label="Click me" />
347
+ * </x.TextAnchor> to continue.
364
348
  * </GtkTextView>
365
349
  * ```
366
350
  */
367
- TextBuffer: "TextBuffer",
351
+ TextAnchor: "TextAnchor",
368
352
  /**
369
- * Declarative source buffer for a GtkSourceView with syntax highlighting.
353
+ * Declarative inline paintable for embedding images/icons in text flow.
370
354
  *
371
- * @example
372
- * ```tsx
373
- * <GtkSourceView>
374
- * <x.SourceBuffer
375
- * text={code}
376
- * language="typescript"
377
- * styleScheme="Adwaita-dark"
378
- * highlightMatchingBrackets
379
- * onTextChanged={(text) => console.log(text)}
380
- * />
381
- * </GtkSourceView>
382
- * ```
383
- */
384
- SourceBuffer: "SourceBuffer",
385
- /**
386
- * A day mark on a GtkCalendar.
387
- *
388
- * @example
389
- * ```tsx
390
- * <GtkCalendar>
391
- * <x.CalendarMark day={15} />
392
- * <x.CalendarMark day={20} />
393
- * <x.CalendarMark day={25} />
394
- * </GtkCalendar>
395
- * ```
396
- */
397
- CalendarMark: "CalendarMark",
398
- /**
399
- * An offset threshold for a GtkLevelBar.
355
+ * The paintable is placed at the current position in the text.
400
356
  *
401
357
  * @example
402
358
  * ```tsx
403
- * <GtkLevelBar>
404
- * <x.LevelBarOffset id="low" value={0.25} />
405
- * <x.LevelBarOffset id="high" value={0.75} />
406
- * <x.LevelBarOffset id="full" value={1.0} />
407
- * </GtkLevelBar>
359
+ * <GtkTextView>
360
+ * Click the icon <x.TextPaintable paintable={iconPaintable} /> to continue.
361
+ * </GtkTextView>
408
362
  * ```
409
363
  */
410
- LevelBarOffset: "LevelBarOffset",
364
+ TextPaintable: "TextPaintable",
411
365
  /**
412
366
  * A toggle button for an AdwToggleGroup.
413
367
  *
@@ -420,6 +374,23 @@ export const x = {
420
374
  * ```
421
375
  */
422
376
  Toggle: "Toggle",
377
+ /**
378
+ * A response button for an AdwAlertDialog.
379
+ *
380
+ * @example
381
+ * ```tsx
382
+ * <AdwAlertDialog
383
+ * heading="Delete File?"
384
+ * body="This cannot be undone."
385
+ * defaultResponse="cancel"
386
+ * closeResponse="cancel"
387
+ * >
388
+ * <x.AlertDialogResponse id="cancel" label="Cancel" />
389
+ * <x.AlertDialogResponse id="delete" label="Delete" appearance={Adw.ResponseAppearance.DESTRUCTIVE} />
390
+ * </AdwAlertDialog>
391
+ * ```
392
+ */
393
+ AlertDialogResponse: "AlertDialogResponse",
423
394
  /**
424
395
  * Nested rows container for AdwExpanderRow.
425
396
  *
@@ -483,14 +454,14 @@ export const x = {
483
454
  * @example
484
455
  * ```tsx
485
456
  * <GtkBox>
486
- * <x.ShortcutController scope={Gtk.ShortcutScope.GLOBAL}>
457
+ * <GtkShortcutController scope={Gtk.ShortcutScope.GLOBAL}>
487
458
  * <x.Shortcut trigger="<Control>f" onActivate={() => setSearchMode(s => !s)} />
488
459
  * <x.Shortcut trigger="<Control>q" onActivate={quit} />
489
- * </x.ShortcutController>
460
+ * </GtkShortcutController>
490
461
  * </GtkBox>
491
462
  * ```
492
463
  */
493
- ShortcutController: "ShortcutController",
464
+ ShortcutController: "GtkShortcutController",
494
465
  /**
495
466
  * A keyboard shortcut definition.
496
467
  *
@@ -504,5 +475,23 @@ export const x = {
504
475
  * ```
505
476
  */
506
477
  Shortcut: "Shortcut",
478
+ /**
479
+ * Declarative animation wrapper using Adw.TimedAnimation or Adw.SpringAnimation.
480
+ *
481
+ * Provides framer-motion-inspired API for animating child widgets.
482
+ *
483
+ * @example
484
+ * ```tsx
485
+ * <x.Animation
486
+ * mode="spring"
487
+ * initial={{ opacity: 0, scale: 0.9 }}
488
+ * animate={{ opacity: 1, scale: 1 }}
489
+ * animateOnMount
490
+ * >
491
+ * <GtkButton label="Animated Button" />
492
+ * </x.Animation>
493
+ * ```
494
+ */
495
+ Animation: "Animation",
507
496
  };
508
497
  export * from "./generated/jsx.js";
package/dist/node.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type SignalStore } from "./nodes/internal/signal-store.js";
1
2
  import type { Container, ContainerClass, Props } from "./types.js";
2
3
  export declare class Node<T = unknown, P = Props> {
3
4
  static priority: number;
@@ -5,11 +6,13 @@ export declare class Node<T = unknown, P = Props> {
5
6
  static createContainer(_props: Props, _containerClass: ContainerClass, _rootContainer?: Container): unknown;
6
7
  container: T;
7
8
  typeName: string;
8
- constructor(typeName: string, _props: P | undefined, container: T, _rootContainer?: Container);
9
+ signalStore: SignalStore;
10
+ constructor(typeName: string, _props: P | undefined, container: T, rootContainer: Container);
9
11
  appendChild(_child: Node): void;
10
12
  removeChild(_child: Node): void;
11
13
  insertBefore(_child: Node, _before: Node): void;
12
14
  updateProps(_oldProps: P | null, _newProps: P): void;
13
15
  mount(): void;
16
+ commitProps(oldProps: P | null, newProps: P): void;
14
17
  unmount(): void;
15
18
  }