@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.
- package/README.md +1 -0
- package/dist/errors.js +3 -0
- package/dist/factory.d.ts +3 -2
- package/dist/factory.js +1 -1
- package/dist/generated/internal.d.ts +28 -1
- package/dist/generated/internal.js +93 -18
- package/dist/generated/jsx.d.ts +1489 -1300
- package/dist/generated/jsx.js +475 -0
- package/dist/host-config.d.ts +3 -1
- package/dist/host-config.js +31 -11
- package/dist/jsx.d.ts +107 -166
- package/dist/jsx.js +58 -69
- package/dist/node.d.ts +3 -1
- package/dist/node.js +5 -3
- package/dist/nodes/abstract/positional-child.d.ts +9 -0
- package/dist/nodes/abstract/positional-child.js +29 -0
- package/dist/nodes/abstract/positional-parent.d.ts +18 -0
- package/dist/nodes/abstract/positional-parent.js +48 -0
- package/dist/nodes/abstract/virtual-container.d.ts +17 -0
- package/dist/nodes/abstract/virtual-container.js +59 -0
- package/dist/nodes/abstract/virtual-single-child.d.ts +18 -0
- package/dist/nodes/abstract/virtual-single-child.js +54 -0
- package/dist/nodes/action-row-child.d.ts +0 -13
- package/dist/nodes/action-row-child.js +14 -12
- package/dist/nodes/action-row.d.ts +6 -1
- package/dist/nodes/action-row.js +4 -37
- package/dist/nodes/adjustable.d.ts +23 -0
- package/dist/nodes/adjustable.js +62 -0
- package/dist/nodes/alert-dialog-response.d.ts +1 -0
- package/dist/nodes/alert-dialog-response.js +86 -0
- package/dist/nodes/animation/animation-controller.d.ts +17 -0
- package/dist/nodes/animation/animation-controller.js +107 -0
- package/dist/nodes/animation/animation-factory.d.ts +15 -0
- package/dist/nodes/animation/animation-factory.js +25 -0
- package/dist/nodes/animation/animation-node.d.ts +9 -0
- package/dist/nodes/animation/animation-node.js +126 -0
- package/dist/nodes/animation/animation-style-sheet.d.ts +16 -0
- package/dist/nodes/animation/animation-style-sheet.js +74 -0
- package/dist/nodes/animation/index.d.ts +4 -0
- package/dist/nodes/animation/index.js +1 -0
- package/dist/nodes/animation/property-mapper.d.ts +11 -0
- package/dist/nodes/animation/property-mapper.js +36 -0
- package/dist/nodes/animation/transform-state.d.ts +11 -0
- package/dist/nodes/animation/transform-state.js +57 -0
- package/dist/nodes/animation/widget-registry.d.ts +5 -0
- package/dist/nodes/animation/widget-registry.js +42 -0
- package/dist/nodes/application.js +17 -7
- package/dist/nodes/autowrapped.js +37 -43
- package/dist/nodes/calendar.js +17 -43
- package/dist/nodes/color-dialog-button.d.ts +1 -0
- package/dist/nodes/color-dialog-button.js +70 -0
- package/dist/nodes/column-view-column.d.ts +3 -3
- package/dist/nodes/column-view-column.js +1 -1
- package/dist/nodes/column-view.js +36 -39
- package/dist/nodes/dialog.d.ts +11 -0
- package/dist/nodes/dialog.js +20 -0
- package/dist/nodes/drawing-area.js +24 -7
- package/dist/nodes/event-controller.d.ts +1 -0
- package/dist/nodes/event-controller.js +96 -0
- package/dist/nodes/expander-row-child.d.ts +0 -14
- package/dist/nodes/expander-row-child.js +14 -12
- package/dist/nodes/expander-row.d.ts +6 -1
- package/dist/nodes/expander-row.js +11 -48
- package/dist/nodes/fixed-child.js +48 -36
- package/dist/nodes/font-dialog-button.d.ts +1 -0
- package/dist/nodes/font-dialog-button.js +90 -0
- package/dist/nodes/grid-child.js +39 -45
- package/dist/nodes/grid.d.ts +1 -0
- package/dist/nodes/grid.js +41 -0
- package/dist/nodes/index.d.ts +17 -9
- package/dist/nodes/index.js +17 -9
- package/dist/nodes/internal/base-item-renderer.d.ts +29 -0
- package/dist/nodes/internal/base-item-renderer.js +88 -0
- package/dist/nodes/internal/base-store.d.ts +9 -0
- package/dist/nodes/internal/base-store.js +20 -0
- package/dist/nodes/internal/child-attachment.d.ts +26 -0
- package/dist/nodes/internal/child-attachment.js +48 -0
- package/dist/nodes/internal/deferred-action.d.ts +8 -0
- package/dist/nodes/internal/deferred-action.js +19 -0
- package/dist/nodes/internal/list-item-renderer.d.ts +14 -15
- package/dist/nodes/internal/list-item-renderer.js +51 -77
- package/dist/nodes/internal/list-store.d.ts +7 -6
- package/dist/nodes/internal/list-store.js +20 -24
- package/dist/nodes/internal/predicates.d.ts +25 -2
- package/dist/nodes/internal/predicates.js +53 -41
- package/dist/nodes/internal/selection-model.d.ts +30 -0
- package/dist/nodes/internal/selection-model.js +91 -0
- package/dist/nodes/internal/signal-store.d.ts +5 -4
- package/dist/nodes/internal/signal-store.js +30 -28
- package/dist/nodes/internal/simple-list-store.js +6 -9
- package/dist/nodes/internal/text-buffer-controller.d.ts +43 -0
- package/dist/nodes/internal/text-buffer-controller.js +287 -0
- package/dist/nodes/internal/text-tag-styles.d.ts +43 -0
- package/dist/nodes/internal/text-tag-styles.js +52 -0
- package/dist/nodes/internal/tree-list-item-renderer.d.ts +15 -14
- package/dist/nodes/internal/tree-list-item-renderer.js +85 -96
- package/dist/nodes/internal/tree-store.d.ts +10 -9
- package/dist/nodes/internal/tree-store.js +31 -35
- package/dist/nodes/internal/utils.d.ts +7 -4
- package/dist/nodes/internal/utils.js +50 -5
- package/dist/nodes/level-bar.js +19 -54
- package/dist/nodes/list-item.d.ts +6 -3
- package/dist/nodes/list-item.js +7 -4
- package/dist/nodes/list-view.js +15 -11
- package/dist/nodes/menu.d.ts +3 -3
- package/dist/nodes/menu.js +3 -3
- package/dist/nodes/models/list.d.ts +11 -13
- package/dist/nodes/models/list.js +16 -73
- package/dist/nodes/models/menu.d.ts +8 -7
- package/dist/nodes/models/menu.js +43 -50
- package/dist/nodes/models/tree-list.d.ts +6 -12
- package/dist/nodes/models/tree-list.js +30 -93
- package/dist/nodes/navigation-page.d.ts +1 -0
- package/dist/nodes/navigation-page.js +27 -32
- package/dist/nodes/navigation-view.js +17 -28
- package/dist/nodes/notebook-page-tab.d.ts +3 -3
- package/dist/nodes/notebook-page-tab.js +11 -14
- package/dist/nodes/notebook-page.d.ts +7 -5
- package/dist/nodes/notebook-page.js +45 -25
- package/dist/nodes/notebook.js +2 -2
- package/dist/nodes/overlay-child.js +90 -30
- package/dist/nodes/pack-child.d.ts +0 -13
- package/dist/nodes/pack-child.js +14 -12
- package/dist/nodes/pack.d.ts +6 -1
- package/dist/nodes/pack.js +4 -37
- package/dist/nodes/popover-menu.js +2 -2
- package/dist/nodes/scale.js +15 -45
- package/dist/nodes/scrolled-window.js +7 -6
- package/dist/nodes/search-bar.d.ts +1 -0
- package/dist/nodes/search-bar.js +40 -0
- package/dist/nodes/shortcut-controller.d.ts +1 -37
- package/dist/nodes/shortcut-controller.js +24 -8
- package/dist/nodes/shortcut.d.ts +5 -4
- package/dist/nodes/shortcut.js +11 -5
- package/dist/nodes/simple-list-view.js +2 -3
- package/dist/nodes/slot.d.ts +6 -9
- package/dist/nodes/slot.js +27 -42
- package/dist/nodes/source-view.js +80 -29
- package/dist/nodes/stack-page.js +20 -22
- package/dist/nodes/stack.js +19 -5
- package/dist/nodes/text-anchor.d.ts +41 -0
- package/dist/nodes/text-anchor.js +59 -0
- package/dist/nodes/text-content.d.ts +10 -0
- package/dist/nodes/text-content.js +1 -0
- package/dist/nodes/text-paintable.d.ts +17 -0
- package/dist/nodes/text-paintable.js +34 -0
- package/dist/nodes/text-segment.d.ts +15 -0
- package/dist/nodes/text-segment.js +29 -0
- package/dist/nodes/text-tag.d.ts +136 -0
- package/dist/nodes/text-tag.js +202 -0
- package/dist/nodes/text-view.d.ts +30 -0
- package/dist/nodes/text-view.js +49 -21
- package/dist/nodes/toggle-group.js +24 -32
- package/dist/nodes/toggle.d.ts +1 -15
- package/dist/nodes/toggle.js +40 -32
- package/dist/nodes/toolbar-child.js +14 -16
- package/dist/nodes/tree-list-item.d.ts +7 -5
- package/dist/nodes/tree-list-item.js +24 -36
- package/dist/nodes/tree-list-view.js +7 -6
- package/dist/nodes/virtual.d.ts +1 -1
- package/dist/nodes/widget.d.ts +2 -16
- package/dist/nodes/widget.js +105 -294
- package/dist/nodes/window.d.ts +9 -3
- package/dist/nodes/window.js +29 -15
- package/dist/registry.d.ts +1 -1
- package/dist/render.js +8 -6
- package/dist/scheduler.d.ts +11 -1
- package/dist/scheduler.js +16 -4
- package/dist/types.d.ts +2 -136
- package/package.json +3 -3
- package/dist/nodes/adjustment.d.ts +0 -48
- package/dist/nodes/adjustment.js +0 -70
- package/dist/nodes/calendar-mark.d.ts +0 -15
- package/dist/nodes/calendar-mark.js +0 -29
- package/dist/nodes/internal/constants.d.ts +0 -1
- package/dist/nodes/internal/constants.js +0 -24
- package/dist/nodes/level-bar-offset.d.ts +0 -13
- package/dist/nodes/level-bar-offset.js +0 -35
- package/dist/nodes/scale-mark.d.ts +0 -17
- package/dist/nodes/scale-mark.js +0 -38
- package/dist/nodes/source-buffer.d.ts +0 -73
- package/dist/nodes/source-buffer.js +0 -149
- package/dist/nodes/text-buffer.d.ts +0 -43
- package/dist/nodes/text-buffer.js +0 -81
- package/dist/nodes/virtual-child.d.ts +0 -18
- 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 {
|
|
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 {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
12
|
-
export type {
|
|
13
|
-
export type {
|
|
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:
|
|
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<
|
|
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<
|
|
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<
|
|
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
|
|
418
|
+
Slot<W extends keyof WidgetSlotNames>(props: {
|
|
465
419
|
for: W;
|
|
466
|
-
id:
|
|
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
|
|
695
|
+
* Declarative text tag for styling text content.
|
|
742
696
|
*
|
|
743
|
-
*
|
|
697
|
+
* Wrap text content with a TextTag to apply styling. Tags can be nested.
|
|
744
698
|
*
|
|
745
699
|
* @example
|
|
746
700
|
* ```tsx
|
|
747
|
-
* <
|
|
748
|
-
*
|
|
749
|
-
*
|
|
750
|
-
*
|
|
751
|
-
*
|
|
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
|
-
|
|
708
|
+
TextTag: "TextTag";
|
|
758
709
|
/**
|
|
759
|
-
*
|
|
710
|
+
* Declarative anchor for embedding widgets in text flow.
|
|
760
711
|
*
|
|
761
|
-
*
|
|
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
|
-
*
|
|
778
|
-
*
|
|
779
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
725
|
+
* Declarative inline paintable for embedding images/icons in text flow.
|
|
805
726
|
*
|
|
806
|
-
*
|
|
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
|
-
* <
|
|
822
|
-
*
|
|
823
|
-
*
|
|
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
|
-
|
|
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
|
-
* <
|
|
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
|
-
* </
|
|
832
|
+
* </GtkShortcutController>
|
|
908
833
|
* </GtkBox>
|
|
909
834
|
* ```
|
|
910
835
|
*/
|
|
911
|
-
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
|
-
|
|
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
|
-
|
|
949
|
-
|
|
950
|
-
|
|
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
|
|
323
|
+
* Declarative text tag for styling text content.
|
|
324
324
|
*
|
|
325
|
-
*
|
|
325
|
+
* Wrap text content with a TextTag to apply styling. Tags can be nested.
|
|
326
326
|
*
|
|
327
327
|
* @example
|
|
328
328
|
* ```tsx
|
|
329
|
-
* <
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
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
|
-
|
|
336
|
+
TextTag: "TextTag",
|
|
340
337
|
/**
|
|
341
|
-
*
|
|
338
|
+
* Declarative anchor for embedding widgets in text flow.
|
|
342
339
|
*
|
|
343
|
-
*
|
|
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
|
-
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
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
|
-
|
|
351
|
+
TextAnchor: "TextAnchor",
|
|
368
352
|
/**
|
|
369
|
-
* Declarative
|
|
353
|
+
* Declarative inline paintable for embedding images/icons in text flow.
|
|
370
354
|
*
|
|
371
|
-
*
|
|
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
|
-
* <
|
|
404
|
-
*
|
|
405
|
-
*
|
|
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
|
-
|
|
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
|
-
* <
|
|
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
|
-
* </
|
|
460
|
+
* </GtkShortcutController>
|
|
490
461
|
* </GtkBox>
|
|
491
462
|
* ```
|
|
492
463
|
*/
|
|
493
|
-
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
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
+
}
|