@swiftbrowser/react 0.28.4 → 0.28.5

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/dist/lazy.d.ts CHANGED
@@ -1,13 +1,25 @@
1
1
  /**
2
2
  * Lazy rows (docs/ops-protocol.md, "Lazy rows"): inside a `List`,
3
- * `LazyVStack` or `LazyHStack`, a `ForEach` of more rows than a batch mounts
4
- * the first batch and a `lazyspacer`; the page reports the spacer when it
5
- * nears the visible area (`lazy`), and the next batch mounts, with a new
6
- * spacer after it.
3
+ * `LazyVStack`, `LazyHStack`, `LazyVGrid` or `LazyHGrid`, a `ForEach` of
4
+ * more rows (a grid's: cells) than a batch mounts the first batch and a
5
+ * `lazyspacer`; the page reports the spacer when it nears the visible area
6
+ * (`lazy`), and the next batch mounts, with a new spacer after it.
7
+ *
8
+ * In a lazy stack on the page (`LazyWindowContext`, `LazyStackContext`), the
9
+ * rows far from the visible area are unbuilt again, as SwiftUI's are: a
10
+ * leading `lazyspacer` stands for those before the built ones, as long as
11
+ * they were, and the page says which to drop and when to build them back.
7
12
  */
8
13
  import { type ReactElement, type ReactNode } from 'react';
9
14
  export declare const LAZY_BATCH = 12;
10
15
  export declare const LazyContext: import("react").Context<"vertical" | "horizontal" | null>;
16
+ /** How many rows a lazy container builds at a time: `LAZY_BATCH`, a grid's cells `LAZY_GRID_BATCH` (a few rows of them). */
17
+ export declare const LazyBatchContext: import("react").Context<number>;
18
+ export declare const LAZY_GRID_BATCH = 48;
19
+ /** Whether the renderer unbuilds a lazy stack's far rows (the page's does: `mount`). */
20
+ export declare const LazyWindowContext: import("react").Context<boolean>;
21
+ /** Whether the lazy container is a stack (`LazyVStack`, `LazyHStack`), whose rows a leading spacer can stand for. */
22
+ export declare const LazyStackContext: import("react").Context<boolean>;
11
23
  export interface LazyGroupProps {
12
24
  rows: ReactElement[];
13
25
  /** Set by a list: the group's first row's index among the container's children. */
@@ -1 +1 @@
1
- {"version":3,"file":"laz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AAS,CAAC,EAAE,IAAI,EAAE,KAAS,EAAE,IAAI,EAAE,EAAE,cAAc,GAAG,SAAS,CAuC9E"}
package/dist/mount.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  import { type ColorScheme, type DynamicTypeSize, type Platform } from '@swiftbrowser/web/src/protocol';
10
10
  import type { AssetCatalog } from '@swiftbrowser/web/src/assets';
11
11
  import { Renderer } from '@swiftbrowser/web/src/renderer';
12
- import type { ReactNode } from 'react';
12
+ import { type ReactNode } from 'react';
13
13
  import { type SwiftUIRoot } from './host/root';
14
14
  export interface MountOptions {
15
15
  colorScheme?: ColorScheme;
@@ -1 +1 @@
1
- {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAA0B,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC/H,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAIjE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAGlE,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACrF,mFAAmF;IACnF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,MA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MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,IAAI,CAAC;IACrG,eAAe,IAAI,IAAI,CAAC;IACxB,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAsB,GAAG,QAAQ,CAExG;AAMD,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CA0FlG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftbrowser/react",
3
- "version": "0.28.4",
3
+ "version": "0.28.5",
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.28.4"
32
+ "@swiftbrowser/web": "0.28.5"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^19.0.0",