@gjsify/adwaita-core 0.36.0 → 0.38.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 (66) hide show
  1. package/lib/esm/accent.js +1 -0
  2. package/lib/esm/conformance/accent.js +1 -0
  3. package/lib/esm/conformance/index.js +1 -1
  4. package/lib/esm/conformance/shortcut-label.js +1 -0
  5. package/lib/esm/index.js +1 -1
  6. package/lib/esm/shortcut-label.js +1 -0
  7. package/lib/types/about-dialog.d.ts +92 -98
  8. package/lib/types/accent.d.ts +36 -0
  9. package/lib/types/accent.spec.d.ts +2 -0
  10. package/lib/types/action-row.d.ts +95 -125
  11. package/lib/types/avatar.d.ts +30 -37
  12. package/lib/types/banner.d.ts +25 -53
  13. package/lib/types/breakpoint.d.ts +6 -7
  14. package/lib/types/button-content.d.ts +41 -80
  15. package/lib/types/carousel.d.ts +175 -252
  16. package/lib/types/checks.d.ts +13 -30
  17. package/lib/types/chrome.d.ts +90 -136
  18. package/lib/types/color-scheme.d.ts +5 -6
  19. package/lib/types/conformance/about-dialog.d.ts +64 -91
  20. package/lib/types/conformance/accent.d.ts +20 -0
  21. package/lib/types/conformance/action-row.d.ts +26 -46
  22. package/lib/types/conformance/avatar.d.ts +8 -10
  23. package/lib/types/conformance/banner.d.ts +17 -37
  24. package/lib/types/conformance/button-content.d.ts +24 -46
  25. package/lib/types/conformance/carousel.d.ts +35 -75
  26. package/lib/types/conformance/checks.d.ts +0 -4
  27. package/lib/types/conformance/chrome.d.ts +28 -36
  28. package/lib/types/conformance/data-grid.d.ts +28 -47
  29. package/lib/types/conformance/dialog.d.ts +4 -9
  30. package/lib/types/conformance/entry-row.d.ts +20 -39
  31. package/lib/types/conformance/index.d.ts +4 -0
  32. package/lib/types/conformance/navigation-view.d.ts +0 -4
  33. package/lib/types/conformance/popover.d.ts +4 -9
  34. package/lib/types/conformance/preferences.d.ts +15 -28
  35. package/lib/types/conformance/rows.d.ts +5 -12
  36. package/lib/types/conformance/shortcut-label.d.ts +34 -0
  37. package/lib/types/conformance/sidebar.d.ts +28 -49
  38. package/lib/types/conformance/spinner.d.ts +21 -27
  39. package/lib/types/conformance/split-button.d.ts +21 -43
  40. package/lib/types/conformance/split-view.d.ts +29 -36
  41. package/lib/types/conformance/tab-view.d.ts +32 -73
  42. package/lib/types/conformance/view-stack.d.ts +0 -12
  43. package/lib/types/conformance/view-switcher.d.ts +46 -114
  44. package/lib/types/conformance/wrap-box.d.ts +40 -63
  45. package/lib/types/data-grid.d.ts +38 -48
  46. package/lib/types/dialog.d.ts +39 -51
  47. package/lib/types/easing.d.ts +6 -12
  48. package/lib/types/entry-row.d.ts +94 -123
  49. package/lib/types/glib.d.ts +17 -25
  50. package/lib/types/index.d.ts +4 -0
  51. package/lib/types/length-unit.d.ts +7 -12
  52. package/lib/types/navigation-view.d.ts +62 -68
  53. package/lib/types/popover.d.ts +39 -66
  54. package/lib/types/preferences.d.ts +83 -100
  55. package/lib/types/rows.d.ts +45 -63
  56. package/lib/types/shortcut-label.d.ts +79 -0
  57. package/lib/types/shortcut-label.spec.d.ts +2 -0
  58. package/lib/types/sidebar.d.ts +95 -121
  59. package/lib/types/spinner.d.ts +39 -61
  60. package/lib/types/split-button.d.ts +78 -134
  61. package/lib/types/split-view.d.ts +74 -89
  62. package/lib/types/tab-view.d.ts +174 -256
  63. package/lib/types/view-stack.d.ts +87 -129
  64. package/lib/types/view-switcher.d.ts +126 -211
  65. package/lib/types/wrap-box.d.ts +62 -123
  66. package/package.json +3 -3
@@ -1,9 +1,6 @@
1
- /**
2
- * The style class `AdwButtonContent` stamps on its parent button (:115) and
3
- * removes again on unroot (:126).
4
- */
1
+ /** The style class `AdwButtonContent` stamps on its parent button, removed on unroot. */
5
2
  export declare const BUTTON_CONTENT_STYLE_CLASS = "image-text-button";
6
- /** The icon `GtkImage` falls back to for an empty `icon-name` (:355-356). */
3
+ /** The icon `GtkImage` falls back to for an empty `icon-name`. */
7
4
  export declare const BUTTON_CONTENT_FALLBACK_ICON = "image-missing";
8
5
  /** How `can-shrink` reaches the label — `PangoEllipsizeMode` as a string union. */
9
6
  export type ButtonContentEllipsize = 'none' | 'end';
@@ -18,124 +15,88 @@ export interface AdwButtonContentProps {
18
15
  /** `can-shrink` — whether the label ellipsizes rather than widening the button. */
19
16
  canShrink: boolean;
20
17
  }
21
- /**
22
- * The property defaults a freshly constructed `AdwButtonContent` has, straight
23
- * from the `GParamSpec`s. All four are the empty/false end of their type.
24
- */
18
+ /** The property defaults of a freshly constructed `AdwButtonContent`, from the `GParamSpec`s. */
25
19
  export declare const ADW_BUTTON_CONTENT_DEFAULTS: Readonly<AdwButtonContentProps>;
26
20
  /**
27
- * Whether the icon slot is empty — the `!icon_name[0]` test at :355.
28
- *
29
- * The one icon question that does not depend on how a renderer represents the
30
- * icon: a name is empty or it is not, an SVG string is empty or it is not. Kept
31
- * separate from {@link buttonContentIconName} so the NativeScript port, which
32
- * holds SVG source rather than theme names, has something in core to ask.
21
+ * Whether the icon slot is empty — the `!icon_name[0]` test. Separate from
22
+ * {@link buttonContentIconName} because it is the one icon question an SVG-holding
23
+ * renderer can also ask.
33
24
  */
34
25
  export declare function buttonContentIconIsEmpty(icon: string): boolean;
35
26
  /**
36
27
  * The icon-theme name the image is actually set from: `icon_name`, or
37
- * `image-missing` when it is empty (:355-358).
28
+ * `image-missing` when it is empty.
38
29
  *
39
- * UPSTREAM CONTRADICTION — the code and the docs disagree, and this follows the
40
- * CODE. Both doc comments say the icon "is not shown" when `icon-name` is empty
41
- * (:228 on the property, :343 on the setter), but nothing in the widget ever
42
- * hides `self->icon`: `gtk_widget_set_visible` is called on the LABEL (:300,
43
- * :398) and never on the image, `init` sets the image to `image-missing` while
44
- * `icon_name` is still `""` (:284, :294), and the setter re-applies that
45
- * fallback for every empty value (:355-356). A default-constructed
46
- * `AdwButtonContent` therefore draws the broken-image glyph. Both ports followed
47
- * the prose and hid the icon; a vector written from the prose would have pinned
48
- * that guess and shipped it under the word "conformance", which is the one thing
49
- * these tables must not do.
30
+ * UPSTREAM CONTRADICTION, resolved in favour of the CODE: both libadwaita doc
31
+ * comments say the icon "is not shown" when `icon-name` is empty, but
32
+ * `gtk_widget_set_visible` is only ever called on the LABEL, `init` sets the image to
33
+ * `image-missing` while `icon_name` is still `""`, and the setter re-applies that
34
+ * fallback for every empty value. A default-constructed `AdwButtonContent` therefore
35
+ * draws the broken-image glyph.
50
36
  */
51
37
  export declare function buttonContentIconName(iconName: string): string;
52
38
  /**
53
39
  * Whether the label node is in the tree: `gtk_widget_set_visible (self->label,
54
- * label[0])` (:398).
55
- *
56
- * First character, not truthiness and not a trim — `" "` is a label and its node
57
- * is shown, exactly as with the banner button.
40
+ * label[0])` — first character, not truthiness and not a trim, so `" "` is a label
41
+ * and its node is shown.
58
42
  */
59
43
  export declare function buttonContentLabelVisible(label: string): boolean;
60
44
  /**
61
- * Whether the icon takes the box's free space: `gtk_widget_set_hexpand
62
- * (self->icon, !label[0])` (:399), matching the `TRUE` init sets while the label
63
- * is still empty (:296).
64
- *
65
- * The complement of {@link buttonContentLabelVisible} by construction, and named
66
- * for what it DOES rather than derived at each call site: with no label the icon
67
- * expands and so centres itself inside the button; with a label the pair sits
68
- * together under the box's `halign: CENTER` (:289).
45
+ * Whether the icon takes the box's free space: `gtk_widget_set_hexpand (self->icon,
46
+ * !label[0])`. With no label the icon expands and so centres itself inside the
47
+ * button; with a label the pair sits together under the box's `halign: CENTER`.
69
48
  */
70
49
  export declare function buttonContentIconExpands(label: string): boolean;
71
50
  /**
72
- * The text painted on the label, with mnemonic markers removed when
73
- * `use-underline` is set (:442).
74
- *
75
- * Default FALSE (:253-256), so an underscore survives unless the app asked for
76
- * mnemonics — the opposite default to the banner's action button, which its
77
- * template pins to TRUE.
51
+ * The text painted on the label, with mnemonic markers removed when `use-underline`
52
+ * is set. Default FALSE, so an underscore survives unless the app asked for
53
+ * mnemonics — the opposite default to the banner's action button, whose template
54
+ * pins it to TRUE.
78
55
  */
79
56
  export declare function buttonContentLabelText(label: string, useUnderline: boolean): string;
80
- /**
81
- * The label's `PangoEllipsizeMode` for `can-shrink` — `END` or `NONE`
82
- * (:489-491), which is also how the getter reads the property back (:462).
83
- */
57
+ /** The label's `PangoEllipsizeMode` for `can-shrink` — `END` or `NONE`. */
84
58
  export declare function buttonContentEllipsize(canShrink: boolean): ButtonContentEllipsize;
85
59
  /**
86
- * One entry of the ancestor chain `adw_button_content_root` walks, nearest
87
- * first, tagged by the only distinction the C makes.
60
+ * One entry of the ancestor chain `adw_button_content_root` walks, nearest first.
88
61
  *
89
- * `'button'` is a `GtkButton` (or any subclass); `'menu-button'` and
90
- * `'split-button'` are `GtkMenuButton` and `AdwSplitButton`, neither of which
91
- * derives from `GtkButton` — `AdwSplitButton` is a `GtkWidget`
92
- * (adw-split-button.c:112), which is exactly why it cannot be found by
93
- * `gtk_widget_get_ancestor (…, GTK_TYPE_BUTTON)` and needs the retarget.
94
- * `'other'` is any other container.
62
+ * Neither `'menu-button'` (`GtkMenuButton`) nor `'split-button'` (`AdwSplitButton`)
63
+ * derives from `GtkButton`, so neither is found by
64
+ * `gtk_widget_get_ancestor (…, GTK_TYPE_BUTTON)` — which is why the retarget exists.
95
65
  */
96
66
  export type ButtonContentAncestor = 'button' | 'menu-button' | 'split-button' | 'other';
97
67
  /**
98
68
  * Which ancestor receives {@link BUTTON_CONTENT_STYLE_CLASS}, as an INDEX into
99
69
  * `ancestors` (nearest first), or `null` when there is no button ancestor.
100
70
  *
101
- * `adw_button_content_root` (:108-116) takes the nearest `GtkButton`, then makes
102
- * ONE substitution: if that button's DIRECT parent is an `AdwSplitButton`, the
103
- * class goes on the split button instead (:112-113), because the split button is
104
- * the node the stylesheet styles (`splitbutton.image-text-button > button`,
105
- * _buttons.scss:499-507). Inside a `GtkMenuButton` no substitution happens, so
106
- * the menu button's INTERNAL button keeps the class — which is what the class
107
- * docs describe (:56-59).
71
+ * `adw_button_content_root` takes the nearest `GtkButton`, then makes ONE
72
+ * substitution: if that button's DIRECT parent is an `AdwSplitButton`, the class goes
73
+ * on the split button instead, because that is the node the stylesheet styles
74
+ * (`splitbutton.image-text-button > button`). Inside a `GtkMenuButton` no
75
+ * substitution happens, so the menu button's INTERNAL button keeps the class.
108
76
  *
109
- * `null` is this port's answer to a case the C does not survive: with no button
110
- * ancestor at all `gtk_widget_get_ancestor` returns `NULL`, and the very next
111
- * lines call `gtk_widget_get_parent (NULL)` and `gtk_widget_add_css_class (NULL,
112
- * …)` (:112-115), which are two `CRITICAL`s. A renderer has nothing to style,
113
- * and saying so is better than reproducing a crash.
77
+ * MODIFICATION: `null` where the C does not survive — with no button ancestor
78
+ * `gtk_widget_get_ancestor` returns `NULL` and the next lines call
79
+ * `gtk_widget_get_parent (NULL)` / `gtk_widget_add_css_class (NULL, …)`, two
80
+ * `CRITICAL`s. A renderer has nothing to style; saying so beats reproducing a crash.
114
81
  */
115
82
  export declare function buttonContentStyleTargetIndex(ancestors: readonly ButtonContentAncestor[]): number | null;
116
83
  /** What one button-content derivation tells a renderer to draw. */
117
84
  export interface AdwButtonContentRenderState {
118
- /** The icon-theme name the image node shows (:355-358). */
119
85
  iconName: string;
120
86
  /** Whether {@link iconName} is the empty-slot fallback rather than an app value. */
121
87
  iconIsFallback: boolean;
122
- /** Whether the icon takes the box's free space (:399). */
88
+ /** Whether the icon takes the box's free space. */
123
89
  iconExpands: boolean;
124
- /** Whether the label node is in the tree (:398). */
125
90
  labelVisible: boolean;
126
- /** The label text, mnemonic markers resolved (:442). */
91
+ /** The label text, mnemonic markers resolved. */
127
92
  labelText: string;
128
- /** The label's ellipsize mode (:489-491). */
129
93
  ellipsize: ButtonContentEllipsize;
130
- /** The style class the parent button carries while this content is rooted (:115). */
94
+ /** The style class the parent button carries while this content is rooted. */
131
95
  parentClass: string;
132
96
  }
133
97
  /**
134
98
  * The full render state for a button content, filling every unset property from
135
- * {@link ADW_BUTTON_CONTENT_DEFAULTS}.
136
- *
137
- * `parentClass` is constant, and is in the state anyway so a renderer takes the
138
- * class from the same call that gives it the rest — the whole defect this module
139
- * fixes was a renderer never being handed that string at all.
99
+ * {@link ADW_BUTTON_CONTENT_DEFAULTS}. `parentClass` is constant but travels in the
100
+ * state anyway, so a renderer cannot get everything else and still miss the class.
140
101
  */
141
102
  export declare function buttonContentRenderState(props?: Partial<AdwButtonContentProps>): AdwButtonContentRenderState;