@gjsify/adwaita-nativescript 0.36.0 → 0.37.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.
@@ -1,36 +1,25 @@
1
1
  import { normalizeWrapBoxSpacing, type AdwWrapBoxJustify, type AdwWrapBoxOrientation, type AdwWrapBoxPackDirection, type AdwWrapPolicy } from '@gjsify/adwaita-core';
2
2
  export { normalizeWrapBoxSpacing };
3
- /**
4
- * `Adw.WrapBox:child-spacing` / `:line-spacing` default, in DIPs.
5
- *
6
- * Both are `g_param_spec_int (…, 0, G_MAXINT, 0, …)` — adw-wrap-box.c:285-287
7
- * and :393-395. The port used to default both to 6, so identical markup was
8
- * looser on a phone than in the browser and an EMPTY wrap box was already 12
9
- * DIPs tall.
10
- */
3
+ /** `Adw.WrapBox:child-spacing` / `:line-spacing` default, in DIPs. Both are 0 in C. */
11
4
  export declare const DEFAULT_WRAP_BOX_SPACING = 0;
12
5
  /**
13
6
  * Whether writing `next` over `current` is a change the widget must act on.
14
7
  *
15
- * The comparison happens AFTER the clamp (adw-wrap-box.c:592-593, :930-931), so
16
- * a negative value written over a spacing of 0 is an early return: it neither
17
- * reaches the layout nor notifies. On this port the same predicate decides
18
- * whether every child's margin is rewritten.
8
+ * The comparison happens AFTER the clamp, so a negative value written over a
9
+ * spacing of 0 is an early return: it neither reaches the layout nor notifies. Here
10
+ * the same predicate decides whether every child's margin is rewritten.
19
11
  */
20
12
  export declare function wrapBoxSpacingChanges(current: number, next: unknown): boolean;
21
13
  /**
22
14
  * The uniform margin that gives a `FlexboxLayout` child its share of the gaps.
23
15
  *
24
- * NativeScript has no gap property on any layout — `Style` carries no
25
- * `columnGap`/`rowGap` — so the inter-item spacing has to come out of the
26
- * children: half of it on each facing edge adds up to the whole gap between any
27
- * two neighbours. The margin string is NS's `top right bottom left` shorthand.
16
+ * Half the spacing on each facing edge adds up to the whole gap between any two
17
+ * neighbours. The margin string is NS's `top right bottom left` shorthand.
28
18
  *
29
- * This is the one place the port is knowingly looser than libadwaita: the halves
30
- * on the OUTER edges are an inset `Adw.WrapBox` does not have. It is invisible
31
- * at the default spacing of 0 and bounded by half a gap otherwise, where the
32
- * alternative — negative margins on the container — is not something the NS CSS
33
- * subset can be trusted with.
19
+ * Knowingly looser than libadwaita: the halves on the OUTER edges are an inset
20
+ * `Adw.WrapBox` does not have. Invisible at the default spacing of 0 and bounded by
21
+ * half a gap otherwise; the alternative is negative margins on the container, which
22
+ * the NS CSS subset cannot be trusted with.
34
23
  */
35
24
  export declare function wrapBoxChildMargin(childSpacing: number, lineSpacing: number): string;
36
25
  /** The `FlexboxLayout` knobs a wrap box's properties resolve to. */
@@ -63,14 +52,12 @@ export interface WrapBoxFlexInput {
63
52
  * The CONTAINER half of the decision, resolved onto `FlexboxLayout`.
64
53
  *
65
54
  * The line DECISION is `resolveWrapBoxLine` in `@gjsify/adwaita-core`, held to
66
- * `WRAP_BOX_LINE_VECTORS` — this function only maps its answer onto the knobs NS
67
- * has, exactly as the browser element maps it onto CSS.
55
+ * `WRAP_BOX_LINE_VECTORS`; this function only maps its answer onto the knobs NS has.
68
56
  *
69
- * Like a flex container, `FlexboxLayout` has ONE `justifyContent` for every
70
- * line, so it can only carry the COMPLETE-line rule. NativeScript offers no
71
- * `:only-child` selector and no generated content, so the final-line rule has no
72
- * container-level expression at all; what it CAN reach is the single-child case,
73
- * through {@link wrapBoxChildFlex}.
57
+ * `FlexboxLayout` has ONE `justifyContent` for every line, so it can only carry the
58
+ * COMPLETE-line rule. NativeScript offers no `:only-child` selector and no generated
59
+ * content, so the final-line rule has no container-level expression at all; the
60
+ * single-child case is reached through {@link wrapBoxChildFlex}.
74
61
  */
75
62
  export declare function wrapBoxFlexStyle(input: WrapBoxFlexInput): WrapBoxFlexStyle;
76
63
  /** What one child of the box gets set on it. */
@@ -83,15 +70,13 @@ export interface WrapBoxChildFlex {
83
70
  /**
84
71
  * The PER-CHILD half of the decision, which the container knobs cannot carry.
85
72
  *
86
- * Two of libadwaita's rules are facts about a child rather than about the box,
87
- * and a single `justifyContent` has nowhere to put either. A box with exactly
88
- * ONE child has one line, that line is the LAST one, and its child is alone on
89
- * it — so it is governed by `justify-last-line`, and `spread` STRETCHES it
90
- * rather than spreading anything (`n_children > 1` guards the keep-at-minimum
91
- * branch, adw-wrap-layout.c:338; adw-wrap-box.c:349-352 says so outright).
73
+ * A box with exactly ONE child has one line, that line is the LAST one, and its
74
+ * child is alone on it — so it is governed by `justify-last-line`, and `spread`
75
+ * STRETCHES it rather than spreading anything (C guards the keep-at-minimum branch
76
+ * with `n_children > 1`).
92
77
  *
93
- * `childCount` is the box's own child count, which is the most a renderer knows
94
- * without a layout pass: 1 means the lone-child-on-the-final-line case exactly,
95
- * anything more means at least one complete line.
78
+ * `childCount` is the box's own child count, the most a renderer knows without a
79
+ * layout pass: 1 is the lone-child-on-the-final-line case exactly, anything more
80
+ * means at least one complete line.
96
81
  */
97
82
  export declare function wrapBoxChildFlex(input: WrapBoxFlexInput, childCount: number): WrapBoxChildFlex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/adwaita-nativescript",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "description": "Native Adwaita widgets for the NativeScript runtime — real NativeScript components (StackLayout/GridLayout/Switch/Label) styled like Libadwaita, not a webview",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -47,10 +47,10 @@
47
47
  "design-system"
48
48
  ],
49
49
  "dependencies": {
50
- "@gjsify/adwaita-core": "^0.36.0",
51
- "@gjsify/adwaita-fonts": "^0.36.0",
52
- "@gjsify/adwaita-icons": "^0.36.0",
53
- "@gjsify/native-platform": "^0.36.0"
50
+ "@gjsify/adwaita-core": "^0.37.0",
51
+ "@gjsify/adwaita-fonts": "^0.37.0",
52
+ "@gjsify/adwaita-icons": "^0.37.0",
53
+ "@gjsify/native-platform": "^0.37.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@nativescript/core": "*"
@@ -61,8 +61,8 @@
61
61
  }
62
62
  },
63
63
  "devDependencies": {
64
- "@gjsify/cli": "^0.36.0",
65
- "@gjsify/unit": "^0.36.0",
64
+ "@gjsify/cli": "^0.37.0",
65
+ "@gjsify/unit": "^0.37.0",
66
66
  "@types/node": "^25.9.2",
67
67
  "typescript": "^6.0.3"
68
68
  },