@swiftbrowser/react 0.9.8 → 0.9.9

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.
@@ -3,7 +3,7 @@
3
3
  * marks the view with that id with a `scrollTo` command whose serial is new,
4
4
  * and the page scrolls every scrolling ancestor to it after the pass.
5
5
  */
6
- import type { UnitPoint } from '@swiftbrowser/web/src/protocol';
6
+ import type { ScrollAxes, UnitPoint } from '@swiftbrowser/web/src/protocol';
7
7
  import { type ReactNode } from 'react';
8
8
  import { type BindingValue } from './binding';
9
9
  import { type UnitPointValue } from './values';
@@ -11,11 +11,20 @@ interface ScrollRequest {
11
11
  id: string | number;
12
12
  anchor: UnitPoint | null;
13
13
  serial: number;
14
+ /** The axes to scroll on; both when absent. */
15
+ axes?: ScrollAxes;
14
16
  }
15
17
  export declare const ScrollRequestContext: import("react").Context<ScrollRequest | null>;
16
18
  export interface ScrollViewProxy {
17
- /** Scroll so `anchor` of the view with that `scrollID` meets the same point of the visible area; no anchor: as little as shows it. */
18
- scrollTo(id: string | number, anchor?: UnitPointValue): void;
19
+ /**
20
+ * Scroll so `anchor` of the view with that `scrollID` meets the same point
21
+ * of the visible area; no anchor: as little as shows it. Every scrolling
22
+ * ancestor moves on its axes, or only on `axes` when given (a horizontal
23
+ * pager inside a list: `{ axes: 'horizontal' }` leaves the list where it is).
24
+ */
25
+ scrollTo(id: string | number, anchor?: UnitPointValue, options?: {
26
+ axes?: ScrollAxes;
27
+ }): void;
19
28
  }
20
29
  export declare function ScrollViewReader({ children }: {
21
30
  children: (proxy: ScrollViewProxy) => ReactNode;
@@ -36,7 +45,7 @@ export type ScrollPositionValue = string | number | null;
36
45
  * to that target, as `proxy.scrollTo` would. A value the page just reported
37
46
  * scrolls nowhere.
38
47
  */
39
- export declare function useScrollPosition(binding: BindingValue<ScrollPositionValue> | undefined, anchor: UnitPointValue | undefined): {
48
+ export declare function useScrollPosition(binding: BindingValue<ScrollPositionValue> | undefined, anchor: UnitPointValue | undefined, axes: ScrollAxes): {
40
49
  props: Record<string, unknown>;
41
50
  provide(children: ReactNode): ReactNode;
42
51
  } | null;
@@ -1 +1 @@
1
- {"version":3,"file":"scrollReader.d.ts","sourceRoot":"","sources":["../src/scrollReader.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAA+C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAI3D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,oBAAoB,+CAA4C,CAAC;AAG9E,MAAM,WAAW,eAAe;IAC9B,sIAAsI;IACtI,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAC9D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAA;CAAE,GAAG,SAAS,CAM7G;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAQvG;AAED,6GAA6G;AAC7G,eAAO,MAAM,qBAAqB;YAA2B,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI;SAAgB,CAAC;AAE3G,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAE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QAAQ,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAQvG;AAED,6GAA6G;AAC7G,eAAO,MAAM,qBAAqB;YAA2B,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI;SAAgB,CAAC;AAE3G,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,CAAC,mBAAmB,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,cAAc,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,CAkClO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftbrowser/react",
3
- "version": "0.9.8",
3
+ "version": "0.9.9",
4
4
  "type": "module",
5
5
  "description": "SwiftUI's components for React: a react-reconciler host that emits SwiftBrowser render ops into the @swiftbrowser/web renderer, so a pure React/TypeScript web app gets the same iOS UI as a SwiftUI app in the browser.",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "test:unit": "vitest run"
30
30
  },
31
31
  "dependencies": {
32
- "@swiftbrowser/web": "0.9.8"
32
+ "@swiftbrowser/web": "0.9.9"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^19.0.0",