@gtkx/react 0.15.0 → 0.16.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 (186) hide show
  1. package/README.md +1 -0
  2. package/dist/errors.js +3 -0
  3. package/dist/factory.d.ts +3 -2
  4. package/dist/factory.js +1 -1
  5. package/dist/generated/internal.d.ts +28 -1
  6. package/dist/generated/internal.js +93 -18
  7. package/dist/generated/jsx.d.ts +1489 -1300
  8. package/dist/generated/jsx.js +475 -0
  9. package/dist/host-config.d.ts +3 -1
  10. package/dist/host-config.js +31 -11
  11. package/dist/jsx.d.ts +107 -166
  12. package/dist/jsx.js +58 -69
  13. package/dist/node.d.ts +3 -1
  14. package/dist/node.js +5 -3
  15. package/dist/nodes/abstract/positional-child.d.ts +9 -0
  16. package/dist/nodes/abstract/positional-child.js +29 -0
  17. package/dist/nodes/abstract/positional-parent.d.ts +18 -0
  18. package/dist/nodes/abstract/positional-parent.js +48 -0
  19. package/dist/nodes/abstract/virtual-container.d.ts +17 -0
  20. package/dist/nodes/abstract/virtual-container.js +59 -0
  21. package/dist/nodes/abstract/virtual-single-child.d.ts +18 -0
  22. package/dist/nodes/abstract/virtual-single-child.js +54 -0
  23. package/dist/nodes/action-row-child.d.ts +0 -13
  24. package/dist/nodes/action-row-child.js +14 -12
  25. package/dist/nodes/action-row.d.ts +6 -1
  26. package/dist/nodes/action-row.js +4 -37
  27. package/dist/nodes/adjustable.d.ts +23 -0
  28. package/dist/nodes/adjustable.js +62 -0
  29. package/dist/nodes/alert-dialog-response.d.ts +1 -0
  30. package/dist/nodes/alert-dialog-response.js +86 -0
  31. package/dist/nodes/animation/animation-controller.d.ts +17 -0
  32. package/dist/nodes/animation/animation-controller.js +107 -0
  33. package/dist/nodes/animation/animation-factory.d.ts +15 -0
  34. package/dist/nodes/animation/animation-factory.js +25 -0
  35. package/dist/nodes/animation/animation-node.d.ts +9 -0
  36. package/dist/nodes/animation/animation-node.js +126 -0
  37. package/dist/nodes/animation/animation-style-sheet.d.ts +16 -0
  38. package/dist/nodes/animation/animation-style-sheet.js +74 -0
  39. package/dist/nodes/animation/index.d.ts +4 -0
  40. package/dist/nodes/animation/index.js +1 -0
  41. package/dist/nodes/animation/property-mapper.d.ts +11 -0
  42. package/dist/nodes/animation/property-mapper.js +36 -0
  43. package/dist/nodes/animation/transform-state.d.ts +11 -0
  44. package/dist/nodes/animation/transform-state.js +57 -0
  45. package/dist/nodes/animation/widget-registry.d.ts +5 -0
  46. package/dist/nodes/animation/widget-registry.js +42 -0
  47. package/dist/nodes/application.js +17 -7
  48. package/dist/nodes/autowrapped.js +37 -43
  49. package/dist/nodes/calendar.js +17 -43
  50. package/dist/nodes/color-dialog-button.d.ts +1 -0
  51. package/dist/nodes/color-dialog-button.js +70 -0
  52. package/dist/nodes/column-view-column.d.ts +3 -3
  53. package/dist/nodes/column-view-column.js +1 -1
  54. package/dist/nodes/column-view.js +36 -39
  55. package/dist/nodes/dialog.d.ts +11 -0
  56. package/dist/nodes/dialog.js +20 -0
  57. package/dist/nodes/drawing-area.js +24 -7
  58. package/dist/nodes/event-controller.d.ts +1 -0
  59. package/dist/nodes/event-controller.js +96 -0
  60. package/dist/nodes/expander-row-child.d.ts +0 -14
  61. package/dist/nodes/expander-row-child.js +14 -12
  62. package/dist/nodes/expander-row.d.ts +6 -1
  63. package/dist/nodes/expander-row.js +11 -48
  64. package/dist/nodes/fixed-child.js +48 -36
  65. package/dist/nodes/font-dialog-button.d.ts +1 -0
  66. package/dist/nodes/font-dialog-button.js +90 -0
  67. package/dist/nodes/grid-child.js +39 -45
  68. package/dist/nodes/grid.d.ts +1 -0
  69. package/dist/nodes/grid.js +41 -0
  70. package/dist/nodes/index.d.ts +17 -9
  71. package/dist/nodes/index.js +17 -9
  72. package/dist/nodes/internal/base-item-renderer.d.ts +29 -0
  73. package/dist/nodes/internal/base-item-renderer.js +88 -0
  74. package/dist/nodes/internal/base-store.d.ts +9 -0
  75. package/dist/nodes/internal/base-store.js +20 -0
  76. package/dist/nodes/internal/child-attachment.d.ts +26 -0
  77. package/dist/nodes/internal/child-attachment.js +48 -0
  78. package/dist/nodes/internal/deferred-action.d.ts +8 -0
  79. package/dist/nodes/internal/deferred-action.js +19 -0
  80. package/dist/nodes/internal/list-item-renderer.d.ts +14 -15
  81. package/dist/nodes/internal/list-item-renderer.js +51 -77
  82. package/dist/nodes/internal/list-store.d.ts +7 -6
  83. package/dist/nodes/internal/list-store.js +20 -24
  84. package/dist/nodes/internal/predicates.d.ts +25 -2
  85. package/dist/nodes/internal/predicates.js +53 -41
  86. package/dist/nodes/internal/selection-model.d.ts +30 -0
  87. package/dist/nodes/internal/selection-model.js +91 -0
  88. package/dist/nodes/internal/signal-store.d.ts +5 -4
  89. package/dist/nodes/internal/signal-store.js +30 -28
  90. package/dist/nodes/internal/simple-list-store.js +6 -9
  91. package/dist/nodes/internal/text-buffer-controller.d.ts +43 -0
  92. package/dist/nodes/internal/text-buffer-controller.js +287 -0
  93. package/dist/nodes/internal/text-tag-styles.d.ts +43 -0
  94. package/dist/nodes/internal/text-tag-styles.js +52 -0
  95. package/dist/nodes/internal/tree-list-item-renderer.d.ts +15 -14
  96. package/dist/nodes/internal/tree-list-item-renderer.js +85 -96
  97. package/dist/nodes/internal/tree-store.d.ts +10 -9
  98. package/dist/nodes/internal/tree-store.js +31 -35
  99. package/dist/nodes/internal/utils.d.ts +7 -4
  100. package/dist/nodes/internal/utils.js +50 -5
  101. package/dist/nodes/level-bar.js +19 -54
  102. package/dist/nodes/list-item.d.ts +6 -3
  103. package/dist/nodes/list-item.js +7 -4
  104. package/dist/nodes/list-view.js +15 -11
  105. package/dist/nodes/menu.d.ts +3 -3
  106. package/dist/nodes/menu.js +3 -3
  107. package/dist/nodes/models/list.d.ts +11 -13
  108. package/dist/nodes/models/list.js +16 -73
  109. package/dist/nodes/models/menu.d.ts +8 -7
  110. package/dist/nodes/models/menu.js +43 -50
  111. package/dist/nodes/models/tree-list.d.ts +6 -12
  112. package/dist/nodes/models/tree-list.js +30 -93
  113. package/dist/nodes/navigation-page.d.ts +1 -0
  114. package/dist/nodes/navigation-page.js +27 -32
  115. package/dist/nodes/navigation-view.js +17 -28
  116. package/dist/nodes/notebook-page-tab.d.ts +3 -3
  117. package/dist/nodes/notebook-page-tab.js +11 -14
  118. package/dist/nodes/notebook-page.d.ts +7 -5
  119. package/dist/nodes/notebook-page.js +45 -25
  120. package/dist/nodes/notebook.js +2 -2
  121. package/dist/nodes/overlay-child.js +90 -30
  122. package/dist/nodes/pack-child.d.ts +0 -13
  123. package/dist/nodes/pack-child.js +14 -12
  124. package/dist/nodes/pack.d.ts +6 -1
  125. package/dist/nodes/pack.js +4 -37
  126. package/dist/nodes/popover-menu.js +2 -2
  127. package/dist/nodes/scale.js +15 -45
  128. package/dist/nodes/scrolled-window.js +7 -6
  129. package/dist/nodes/search-bar.d.ts +1 -0
  130. package/dist/nodes/search-bar.js +40 -0
  131. package/dist/nodes/shortcut-controller.d.ts +1 -37
  132. package/dist/nodes/shortcut-controller.js +24 -8
  133. package/dist/nodes/shortcut.d.ts +5 -4
  134. package/dist/nodes/shortcut.js +11 -5
  135. package/dist/nodes/simple-list-view.js +2 -3
  136. package/dist/nodes/slot.d.ts +6 -9
  137. package/dist/nodes/slot.js +27 -42
  138. package/dist/nodes/source-view.js +80 -29
  139. package/dist/nodes/stack-page.js +20 -22
  140. package/dist/nodes/stack.js +19 -5
  141. package/dist/nodes/text-anchor.d.ts +41 -0
  142. package/dist/nodes/text-anchor.js +59 -0
  143. package/dist/nodes/text-content.d.ts +10 -0
  144. package/dist/nodes/text-content.js +1 -0
  145. package/dist/nodes/text-paintable.d.ts +17 -0
  146. package/dist/nodes/text-paintable.js +34 -0
  147. package/dist/nodes/text-segment.d.ts +15 -0
  148. package/dist/nodes/text-segment.js +29 -0
  149. package/dist/nodes/text-tag.d.ts +136 -0
  150. package/dist/nodes/text-tag.js +202 -0
  151. package/dist/nodes/text-view.d.ts +30 -0
  152. package/dist/nodes/text-view.js +49 -21
  153. package/dist/nodes/toggle-group.js +24 -32
  154. package/dist/nodes/toggle.d.ts +1 -15
  155. package/dist/nodes/toggle.js +40 -32
  156. package/dist/nodes/toolbar-child.js +14 -16
  157. package/dist/nodes/tree-list-item.d.ts +7 -5
  158. package/dist/nodes/tree-list-item.js +24 -36
  159. package/dist/nodes/tree-list-view.js +7 -6
  160. package/dist/nodes/virtual.d.ts +1 -1
  161. package/dist/nodes/widget.d.ts +2 -16
  162. package/dist/nodes/widget.js +105 -294
  163. package/dist/nodes/window.d.ts +9 -3
  164. package/dist/nodes/window.js +29 -15
  165. package/dist/registry.d.ts +1 -1
  166. package/dist/render.js +8 -6
  167. package/dist/scheduler.d.ts +11 -1
  168. package/dist/scheduler.js +16 -4
  169. package/dist/types.d.ts +2 -136
  170. package/package.json +3 -3
  171. package/dist/nodes/adjustment.d.ts +0 -48
  172. package/dist/nodes/adjustment.js +0 -70
  173. package/dist/nodes/calendar-mark.d.ts +0 -15
  174. package/dist/nodes/calendar-mark.js +0 -29
  175. package/dist/nodes/internal/constants.d.ts +0 -1
  176. package/dist/nodes/internal/constants.js +0 -24
  177. package/dist/nodes/level-bar-offset.d.ts +0 -13
  178. package/dist/nodes/level-bar-offset.js +0 -35
  179. package/dist/nodes/scale-mark.d.ts +0 -17
  180. package/dist/nodes/scale-mark.js +0 -38
  181. package/dist/nodes/source-buffer.d.ts +0 -73
  182. package/dist/nodes/source-buffer.js +0 -149
  183. package/dist/nodes/text-buffer.d.ts +0 -43
  184. package/dist/nodes/text-buffer.js +0 -81
  185. package/dist/nodes/virtual-child.d.ts +0 -18
  186. package/dist/nodes/virtual-child.js +0 -62
package/dist/jsx.d.ts CHANGED
@@ -1,16 +1,28 @@
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 { GtkGridViewProps as GeneratedGtkGridViewProps, GtkListViewProps as GeneratedGtkListViewProps, WidgetSlotNames } from "./generated/jsx.js";
6
+ import type { AnimationProps as AnimationNodeProps } from "./nodes/animation/index.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, SpringTransition, TimedTransition, Transition } from "./nodes/animation/index.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
+ export type ScaleMark = {
18
+ value: number;
19
+ position?: Gtk.PositionType;
20
+ label?: string | null;
21
+ };
22
+ export type LevelBarOffset = {
23
+ id: string;
24
+ value: number;
25
+ };
14
26
  /**
15
27
  * Props for slot-based child positioning.
16
28
  *
@@ -95,6 +107,8 @@ export type FixedChildProps = VirtualSlotProps & {
95
107
  x?: number;
96
108
  /** Y coordinate in pixels */
97
109
  y?: number;
110
+ /** 3D transform to apply to the child (perspective, rotation, etc.) */
111
+ transform?: Gsk.Transform;
98
112
  };
99
113
  /**
100
114
  * Props for custom list view rendering.
@@ -149,6 +163,10 @@ export type ColumnViewRootProps<C extends string = string> = {
149
163
  export type NotebookPageProps = VirtualSlotProps & {
150
164
  /** Tab label text (optional when using Notebook.PageTab) */
151
165
  label?: string;
166
+ /** Whether the tab should expand to fill available space */
167
+ tabExpand?: boolean;
168
+ /** Whether the tab should fill its allocated space */
169
+ tabFill?: boolean;
152
170
  };
153
171
  /**
154
172
  * Props for custom notebook page tab widgets.
@@ -226,67 +244,6 @@ export type OverlayChildProps = VirtualSlotProps & {
226
244
  /** Whether to clip this overlay child to the main child bounds */
227
245
  clipOverlay?: boolean;
228
246
  };
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
247
  /**
291
248
  * Props for the Toggle virtual element.
292
249
  *
@@ -315,6 +272,16 @@ export type ToggleProps = {
315
272
  /** Whether underline in label indicates mnemonic */
316
273
  useUnderline?: boolean;
317
274
  };
275
+ export type AlertDialogResponseProps = {
276
+ /** Unique response ID (used in response signal and for default/close response) */
277
+ id: string;
278
+ /** Button label text */
279
+ label: string;
280
+ /** Visual appearance of the response button */
281
+ appearance?: Adw.ResponseAppearance;
282
+ /** Whether the response button is enabled */
283
+ enabled?: boolean;
284
+ };
318
285
  /**
319
286
  * Props for ExpanderRow child slots (Row and Action).
320
287
  */
@@ -327,17 +294,7 @@ type NavigationPageBaseProps = {
327
294
  canPop?: boolean;
328
295
  children?: ReactNode;
329
296
  };
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
- };
297
+ export type { GtkShortcutControllerProps as ShortcutControllerProps } from "./generated/jsx.js";
341
298
  /**
342
299
  * Props for the Shortcut element in JSX.
343
300
  *
@@ -376,18 +333,15 @@ export type NavigationPageProps = (NavigationPageBaseProps & {
376
333
  id: string;
377
334
  }) | (NavigationPageBaseProps & {
378
335
  for: "AdwNavigationSplitView";
379
- id: import("./generated/jsx.js").WidgetSlotNames["AdwNavigationSplitView"];
336
+ id: WidgetSlotNames["AdwNavigationSplitView"];
380
337
  });
381
- /**
382
- * Type mapping widget names to their available slot IDs.
383
- */
384
- export type { WidgetSlotNames } from "./generated/jsx.js";
338
+ export type { WidgetSlotNames };
385
339
  /**
386
340
  * Props for the ListView component.
387
341
  *
388
342
  * @typeParam T - The type of items in the list
389
343
  */
390
- export type ListViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkListViewProps, "renderItem"> & {
344
+ export type ListViewProps<T = unknown> = Omit<GeneratedGtkListViewProps, "renderItem"> & {
391
345
  /** Function to render each list item */
392
346
  renderItem: (item: T | null) => ReactNode;
393
347
  /** Estimated item height in pixels for proper virtualization before content loads */
@@ -398,7 +352,7 @@ export type ListViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkLi
398
352
  *
399
353
  * @typeParam T - The type of items in the grid
400
354
  */
401
- export type GridViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkGridViewProps, "renderItem"> & {
355
+ export type GridViewProps<T = unknown> = Omit<GeneratedGtkGridViewProps, "renderItem"> & {
402
356
  /** Function to render each grid item */
403
357
  renderItem: (item: T | null) => ReactNode;
404
358
  /** Estimated item height in pixels for proper virtualization before content loads */
@@ -409,7 +363,7 @@ export type GridViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkGr
409
363
  *
410
364
  * @typeParam T - The type of items in the tree
411
365
  */
412
- export type TreeListViewProps<T = unknown> = Omit<import("./generated/jsx.js").GtkListViewProps, "renderItem"> & {
366
+ export type TreeListViewProps<T = unknown> = Omit<GeneratedGtkListViewProps, "renderItem"> & {
413
367
  /** Function to render each tree item */
414
368
  renderItem: TreeRenderItemFn<T>;
415
369
  /** Estimated item height in pixels for proper virtualization before content loads */
@@ -461,9 +415,9 @@ export declare const x: {
461
415
  * </GtkHeaderBar>
462
416
  * ```
463
417
  */
464
- Slot<W extends keyof import("./generated/jsx.js").WidgetSlotNames>(props: {
418
+ Slot<W extends keyof WidgetSlotNames>(props: {
465
419
  for: W;
466
- id: import("./generated/jsx.js").WidgetSlotNames[W];
420
+ id: WidgetSlotNames[W];
467
421
  children?: ReactNode;
468
422
  }): ReactElement;
469
423
  /**
@@ -738,94 +692,48 @@ export declare const x: {
738
692
  */
739
693
  MenuSubmenu: "MenuSubmenu";
740
694
  /**
741
- * Declarative adjustment configuration for adjustable widgets.
695
+ * Declarative text tag for styling text content.
742
696
  *
743
- * Works with Scale, Scrollbar, ScaleButton, SpinButton, and ListBox.
697
+ * Wrap text content with a TextTag to apply styling. Tags can be nested.
744
698
  *
745
699
  * @example
746
700
  * ```tsx
747
- * <GtkScale>
748
- * <x.Adjustment
749
- * value={50}
750
- * lower={0}
751
- * upper={100}
752
- * onValueChanged={(v) => console.log(v)}
753
- * />
754
- * </GtkScale>
701
+ * <GtkTextView>
702
+ * Normal <x.TextTag id="bold" weight={Pango.Weight.BOLD}>
703
+ * bold <x.TextTag id="red" foreground="red">and red</x.TextTag>
704
+ * </x.TextTag> text.
705
+ * </GtkTextView>
755
706
  * ```
756
707
  */
757
- Adjustment: "Adjustment";
708
+ TextTag: "TextTag";
758
709
  /**
759
- * A mark to display on a GtkScale slider.
710
+ * Declarative anchor for embedding widgets in text flow.
760
711
  *
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.
712
+ * The anchor is placed at the current position in the text.
773
713
  *
774
714
  * @example
775
715
  * ```tsx
776
716
  * <GtkTextView>
777
- * <x.TextBuffer
778
- * text="Hello!"
779
- * enableUndo
780
- * onTextChanged={(text) => console.log(text)}
781
- * />
717
+ * Click here: <x.TextAnchor>
718
+ * <GtkButton label="Click me" />
719
+ * </x.TextAnchor> to continue.
782
720
  * </GtkTextView>
783
721
  * ```
784
722
  */
785
- TextBuffer: "TextBuffer";
786
- /**
787
- * Declarative source buffer for a GtkSourceView with syntax highlighting.
788
- *
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";
723
+ TextAnchor: "TextAnchor";
803
724
  /**
804
- * A day mark on a GtkCalendar.
725
+ * Declarative inline paintable for embedding images/icons in text flow.
805
726
  *
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.
727
+ * The paintable is placed at the current position in the text.
818
728
  *
819
729
  * @example
820
730
  * ```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>
731
+ * <GtkTextView>
732
+ * Click the icon <x.TextPaintable paintable={iconPaintable} /> to continue.
733
+ * </GtkTextView>
826
734
  * ```
827
735
  */
828
- LevelBarOffset: "LevelBarOffset";
736
+ TextPaintable: "TextPaintable";
829
737
  /**
830
738
  * A toggle button for an AdwToggleGroup.
831
739
  *
@@ -838,6 +746,23 @@ export declare const x: {
838
746
  * ```
839
747
  */
840
748
  Toggle: "Toggle";
749
+ /**
750
+ * A response button for an AdwAlertDialog.
751
+ *
752
+ * @example
753
+ * ```tsx
754
+ * <AdwAlertDialog
755
+ * heading="Delete File?"
756
+ * body="This cannot be undone."
757
+ * defaultResponse="cancel"
758
+ * closeResponse="cancel"
759
+ * >
760
+ * <x.AlertDialogResponse id="cancel" label="Cancel" />
761
+ * <x.AlertDialogResponse id="delete" label="Delete" appearance={Adw.ResponseAppearance.DESTRUCTIVE} />
762
+ * </AdwAlertDialog>
763
+ * ```
764
+ */
765
+ AlertDialogResponse: "AlertDialogResponse";
841
766
  /**
842
767
  * Nested rows container for AdwExpanderRow.
843
768
  *
@@ -901,14 +826,14 @@ export declare const x: {
901
826
  * @example
902
827
  * ```tsx
903
828
  * <GtkBox>
904
- * <x.ShortcutController scope={Gtk.ShortcutScope.GLOBAL}>
829
+ * <GtkShortcutController scope={Gtk.ShortcutScope.GLOBAL}>
905
830
  * <x.Shortcut trigger="<Control>f" onActivate={() => setSearchMode(s => !s)} />
906
831
  * <x.Shortcut trigger="<Control>q" onActivate={quit} />
907
- * </x.ShortcutController>
832
+ * </GtkShortcutController>
908
833
  * </GtkBox>
909
834
  * ```
910
835
  */
911
- ShortcutController: "ShortcutController";
836
+ ShortcutController: "GtkShortcutController";
912
837
  /**
913
838
  * A keyboard shortcut definition.
914
839
  *
@@ -922,6 +847,24 @@ export declare const x: {
922
847
  * ```
923
848
  */
924
849
  Shortcut: "Shortcut";
850
+ /**
851
+ * Declarative animation wrapper using libadwaita's animation primitives.
852
+ *
853
+ * Provides Framer Motion-like API for animating GTK widgets with spring
854
+ * or timed animations.
855
+ *
856
+ * @example
857
+ * ```tsx
858
+ * <x.Animation
859
+ * initial={{ opacity: 0, y: -20 }}
860
+ * animate={{ opacity: 1, y: 0 }}
861
+ * transition={{ type: "spring", stiffness: 300, damping: 20 }}
862
+ * >
863
+ * <GtkLabel label="Hello World" />
864
+ * </x.Animation>
865
+ * ```
866
+ */
867
+ Animation: "Animation";
925
868
  };
926
869
  declare global {
927
870
  namespace React {
@@ -929,13 +872,12 @@ declare global {
929
872
  interface IntrinsicElements {
930
873
  ActionRowPrefix: VirtualSlotProps;
931
874
  ActionRowSuffix: VirtualSlotProps;
932
- CalendarMark: CalendarMarkProps;
875
+ AlertDialogResponse: AlertDialogResponseProps;
933
876
  ColumnViewColumn: ColumnViewColumnProps<any>;
934
877
  ExpanderRowAction: ExpanderRowChildProps;
935
878
  ExpanderRowRow: ExpanderRowChildProps;
936
879
  FixedChild: FixedChildProps;
937
880
  GridChild: GridChildProps;
938
- LevelBarOffset: LevelBarOffsetProps;
939
881
  ListItem: ListItemProps;
940
882
  MenuItem: MenuItemProps;
941
883
  MenuSection: MenuSectionProps;
@@ -945,10 +887,9 @@ declare global {
945
887
  OverlayChild: OverlayChildProps;
946
888
  PackEnd: VirtualSlotProps;
947
889
  PackStart: VirtualSlotProps;
948
- Adjustment: AdjustmentProps;
949
- ScaleMark: ScaleMarkProps;
950
- SourceBuffer: SourceBufferProps;
951
- TextBuffer: TextBufferProps;
890
+ TextAnchor: TextAnchorProps;
891
+ TextPaintable: TextPaintableProps;
892
+ TextTag: TextTagProps;
952
893
  SimpleListItem: StringListItemProps;
953
894
  StackPage: StackPageProps;
954
895
  Toggle: ToggleProps;
@@ -956,8 +897,8 @@ declare global {
956
897
  ToolbarTop: VirtualSlotProps;
957
898
  TreeListItem: TreeListItemProps<any>;
958
899
  NavigationPage: NavigationPageProps;
959
- ShortcutController: ShortcutControllerProps;
960
900
  Shortcut: ShortcutProps;
901
+ Animation: AnimationNodeProps;
961
902
  }
962
903
  }
963
904
  }
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 libadwaita's animation primitives.
480
+ *
481
+ * Provides Framer Motion-like API for animating GTK widgets with spring
482
+ * or timed animations.
483
+ *
484
+ * @example
485
+ * ```tsx
486
+ * <x.Animation
487
+ * initial={{ opacity: 0, y: -20 }}
488
+ * animate={{ opacity: 1, y: 0 }}
489
+ * transition={{ type: "spring", stiffness: 300, damping: 20 }}
490
+ * >
491
+ * <GtkLabel label="Hello World" />
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,7 +6,8 @@ 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;
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- import { signalStore } from "./nodes/internal/signal-store.js";
1
+ import { getSignalStore } from "./nodes/internal/signal-store.js";
2
2
  export class Node {
3
3
  static priority = 0;
4
4
  static matches(_type, _containerOrClass) {
@@ -9,9 +9,11 @@ export class Node {
9
9
  }
10
10
  container;
11
11
  typeName;
12
- constructor(typeName, _props = {}, container, _rootContainer) {
12
+ signalStore;
13
+ constructor(typeName, _props = {}, container, rootContainer) {
13
14
  this.typeName = typeName;
14
15
  this.container = container;
16
+ this.signalStore = getSignalStore(rootContainer);
15
17
  }
16
18
  appendChild(_child) { }
17
19
  removeChild(_child) { }
@@ -19,6 +21,6 @@ export class Node {
19
21
  updateProps(_oldProps, _newProps) { }
20
22
  mount() { }
21
23
  unmount() {
22
- signalStore.clear(this);
24
+ this.signalStore.clear(this);
23
25
  }
24
26
  }
@@ -0,0 +1,9 @@
1
+ import type * as Gtk from "@gtkx/ffi/gtk";
2
+ import type { Props } from "../../types.js";
3
+ import { VirtualSingleChildNode } from "./virtual-single-child.js";
4
+ export declare abstract class PositionalChildNode<P extends Props = Props> extends VirtualSingleChildNode<P> {
5
+ protected abstract attachToParent(parent: Gtk.Widget, child: Gtk.Widget): void;
6
+ protected abstract detachFromParent(parent: Gtk.Widget, child: Gtk.Widget): void;
7
+ unmount(): void;
8
+ protected onChildChange(oldChild: Gtk.Widget | null): void;
9
+ }