@swiftbrowser/react 0.25.0 → 0.26.1

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,10 +3,16 @@ import { type ReactNode } from 'react';
3
3
  export interface NavigationContextValue {
4
4
  push(value: unknown): void;
5
5
  pop(): void;
6
+ /** The pushed values, and replacing them whole: how a `RemoteTree` keeps another root's stack in step with this one. */
7
+ path: readonly unknown[];
8
+ setPath(path: readonly unknown[]): void;
6
9
  /** `.navigationDestination(for:)`: how a pushed value becomes a screen. */
7
10
  registerDestination(destination: (value: unknown) => ReactNode): void;
8
11
  }
9
12
  export declare const NavigationContext: import("react").Context<NavigationContextValue | null>;
13
+ /** The depth of the stack screen a view is in: 0 for the root screen, 1 for the first pushed one. */
14
+ export declare const ScreenDepthContext: import("react").Context<number>;
15
+ export declare function useScreenDepth(): number;
10
16
  export declare function useNavigation(): NavigationContextValue | null;
11
17
  /** Rendered by the `navigationDestination` modifier: registers the builder with the enclosing stack. */
12
18
  export declare function RegisterDestination({ destination }: {
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-context.d.ts","sourceRoot":"","sources":["../src/navigation-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,2DAA2D;AAC3D,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,GAAG,IAAI,IAAI,CAAC;IACZ,2EAA2E;IAC3E,mBAAmB,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,SAAS,GAAG,IAAI,CAAC;CACvE;AAED,eAAO,MAAM,iBAAiB,wDAAqD,CAAC;AAEpF,wBAAgB,aAAa,IAAI,sBAAsB,GAAG,IAAI,CAE7D;AAED,wGAAwG;AACxG,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAA;CAAE,GAAG,IAAI,CAIvG"}
1
+ {"version":3,"file":"navigation-context.d.ts","sourceRoot":"","sources":["../src/navigation-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,2DAA2D;AAC3D,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,GAAG,IAAI,IAAI,CAAC;IACZ,wHAAwH;IACxH,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;IACzB,OAAO,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAAC;IACxC,2EAA2E;IAC3E,mBAAmB,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,SAAS,GAAG,IAAI,CAAC;CACvE;AAED,eAAO,MAAM,iBAAiB,wDAAqD,CAAC;AAEpF,qGAAqG;AACrG,eAAO,MAAM,kBAAkB,iCAAmB,CAAC;AAEnD,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,aAAa,IAAI,sBAAsB,GAAG,IAAI,CAE7D;AAED,wGAAwG;AACxG,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAA;CAAE,GAAG,IAAI,CAIvG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftbrowser/react",
3
- "version": "0.25.0",
3
+ "version": "0.26.1",
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.25.0"
32
+ "@swiftbrowser/web": "0.26.1"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^19.0.0",