@swiftbrowser/react 0.23.0 → 0.26.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.
package/README.md CHANGED
@@ -983,6 +983,55 @@ side and provided again inside:
983
983
  The list must be the same on every render of that component (each entry is
984
984
  read with a hook). Props, callbacks and external stores need no bridging.
985
985
 
986
+ ### Another root's tree, drawn here
987
+
988
+ `RemoteTree` draws a tree that another SwiftUI root produces, wherever that
989
+ root runs: a sandboxed script, a worker, another JavaScript runtime, a
990
+ server. The other side renders with this package as usual, into a root made
991
+ with `remote: true`, and sends the ops it gets to a `RemoteRoot` here; the
992
+ `RemoteRoot` keeps a mirror of the elements and `RemoteTree` draws them as
993
+ elements of this tree, so they lay out, scroll and animate with the rest and
994
+ work on the web and natively alike. Events the renderer sends them go back
995
+ to the other root, synchronously when the other root is in the same thread:
996
+
997
+ ```tsx
998
+ // Here: the host.
999
+ const remote = createRemoteRoot();
1000
+ remote.onEvent((event) => sandbox.dispatch(event)); // taps, text, toggles… for the child's elements
1001
+ remote.onEnvironment((environment) => sandbox.setEnvironment(environment));
1002
+ sandbox.onOps((ops) => remote.applyOps(ops)); // the child's render passes
1003
+ <NavigationStack>
1004
+ <RemoteTree root={remote} />
1005
+ </NavigationStack>
1006
+
1007
+ // There: the child (the same package, its own React).
1008
+ const root = createSwiftUIRoot((ops) => send(ops), { remote: true });
1009
+ root.render(<Counter />);
1010
+ receive((event) => root.dispatch(event));
1011
+ ```
1012
+
1013
+ The child's top-level views are drawn in place; what it would put on a
1014
+ screen of its own joins the screen `RemoteTree` sits in (`navigationTitle`,
1015
+ `toolbar`, `searchable`, `toolbarVisibility`), and its `sheet`s and `alert`s
1016
+ are presented over the host's root. A pass the child made in `withAnimation`
1017
+ animates here too, and the child's completion runs when the host's animation
1018
+ ends.
1019
+
1020
+ A `NavigationStack` in the child becomes the host's, when `RemoteTree` sits
1021
+ in one: the child's root screen is drawn in place, and every screen the
1022
+ child pushes (`NavigationLink`, its `path`) is pushed on the host's stack,
1023
+ with the child's title, display mode, toolbar and search field on it. The
1024
+ child's path stays the truth: a push or pop there (`dismiss` included)
1025
+ pushes or pops the host's screens, and a pop in the host (the back button,
1026
+ the swipe, a tap on an earlier screen in the bar) pops the child's path to
1027
+ the same place. The host's path holds the child's screens as pushed views,
1028
+ so a bound `path` sees them; a screen the host pushes over them stays until
1029
+ the child's stack moves. Outside a host stack the child's stack is drawn as
1030
+ its own. Only the child's first stack is mapped (one in a sheet presents in
1031
+ the sheet), and not yet: `NavigationSplitView` in the child, `Host` elements
1032
+ (their DOM lives in the child's page, which has none here), and the ops a
1033
+ loader answers (`request`, `swiftdata`, `defaults`).
1034
+
986
1035
  ## How it works
987
1036
 
988
1037
  - `src/host/`: a [react-reconciler](https://www.npmjs.com/package/react-reconciler)
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/components/navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EAA4C,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAM5F,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,mDAAmD;IACnD,IAAI,CAAC,EAAE,YAAY,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,KAAK,IAAI,CAAC;IAClD,8DAA8D;IAC9D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC;IAC1C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAUD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAMtE;AA0DD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CA4BpE"}
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/components/navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EAA4C,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAM5F,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,mDAAmD;IACnD,IAAI,CAAC,EAAE,YAAY,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,KAAK,IAAI,CAAC;IAClD,8DAA8D;IAC9D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC;IAC1C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAUD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAMtE;AA8DD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CA4BpE"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `RemoteTree`: another root's tree drawn here. The child root (made with
3
+ * `createSwiftUIRoot(sink, { remote: true })` wherever it runs) sends its
4
+ * ops to a `RemoteRoot`'s `applyOps`; this component draws the mirror as
5
+ * host elements, so the child's views take part in this tree's layout, its
6
+ * screen and its renderer, web or native alike. What a child hoists to its
7
+ * root for lack of a screen of its own joins this tree's enclosing screen
8
+ * (a title, a toolbar, a search field) or root (a sheet, an alert).
9
+ *
10
+ * A child's `NavigationStack` becomes this tree's: inside a host stack, the
11
+ * child's root screen is drawn in place (its title and toolbar on the host's
12
+ * screen) and each screen the child pushes is pushed onto the host's stack,
13
+ * so the child's screens slide in, get the host's back button and swipe,
14
+ * and show in its bar like the host's own. The child's path stays the
15
+ * truth: a push or pop in the child pushes or pops the host's screens, and
16
+ * a pop in the host (back, swipe, a tap on an earlier screen) is sent to the
17
+ * child as the renderer would send it (a `tap` on the popped screen), which
18
+ * pops the child's path.
19
+ */
20
+ import { type ReactNode } from 'react';
21
+ import type { RemoteRoot } from '../host/remote';
22
+ export interface RemoteTreeProps {
23
+ root: RemoteRoot;
24
+ }
25
+ export declare function RemoteTree({ root }: RemoteTreeProps): ReactNode;
26
+ //# sourceMappingURL=remoteTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteTree.d.ts","sourceRoot":"","sources":["../../src/components/remoteTree.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAsF,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3H,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK7D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,CAAC;CAClB;AA+DD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,SAAS,CA6D/D"}
@@ -11,10 +11,20 @@ export type EventType = RendererEvent['type'];
11
11
  export type EventOf<K extends EventType> = Extract<RendererEvent, {
12
12
  type: K;
13
13
  }>;
14
- /** The renderer's events an element answers, by type. */
14
+ /**
15
+ * The renderer's events an element answers, by type. `'*'` takes every
16
+ * event addressed to the element that no typed handler took: a mirrored
17
+ * element (`RemoteTree`) forwards them all to the root that drew it.
18
+ */
15
19
  export type EventHandlers = {
16
20
  [K in EventType]?: (event: EventOf<K>) => void;
21
+ } & {
22
+ '*'?: (event: AddressedEvent) => void;
17
23
  };
24
+ /** An event the renderer addresses to one element. */
25
+ export type AddressedEvent = Extract<RendererEvent, {
26
+ id: number;
27
+ }>;
18
28
  /**
19
29
  * Where a virtual element acts: the nearest enclosing `navscreen` or `sheet`
20
30
  * element, or the root container.
@@ -1 +1 @@
1
- {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/host/instance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAC9C,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,SAAS,IAAI,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAC/E,yDAAyD;AACzD,MAAM,MAAM,aAAa,GAAG;KAAG,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI;CAAE,CAAC;AAE/E;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC;;;;GAIG;AACH,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,EAAE,CAAC,EAAE,aAAa,C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AAO,CAAC,GAAG,IAAI,CAAC;IAC/C,eAAe,EAAE,QAAQ,GAAG,IAAI,CAAC;IACjC,iBAAiB,EAAE,QAAQ,EAAE,CAAC;CAC/B;AAED,wCAAwC;AACxC,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,CAAC,CAAC;IACN,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,iBAAiB,EAAE,QAAQ,EAAE,CAAC;CAC/B;AAED,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * A tree drawn by another root. `createRemoteRoot` keeps a mirror of the
3
+ * elements a second SwiftUI root emits (one in a sandbox, a worker, another
4
+ * runtime: anything that produces the ops protocol), and `RemoteTree` draws
5
+ * the mirror as host elements inside a host tree, forwarding the events the
6
+ * renderer sends those elements back to the root that owns them. Everything
7
+ * stays synchronous: a tap mirrored to the child runs its handler, the
8
+ * child's pass re-enters `applyOps`, and the host's own pass draws the result
9
+ * before the tap returns.
10
+ */
11
+ import type { Op, RendererEvent } from '@swiftbrowser/web/src/protocol';
12
+ import type { Environment } from '../environment';
13
+ import type { EventHandlers } from './instance';
14
+ import type { HostTree } from './tree';
15
+ /** An element of the child's tree as the mirror holds it. */
16
+ export interface MirrorNode {
17
+ id: number;
18
+ kind: string;
19
+ props: Record<string, unknown>;
20
+ children: MirrorNode[];
21
+ parent: MirrorNode | null;
22
+ }
23
+ export interface RemoteRoot {
24
+ /** The child root's ops, one pass at a time (each ending in `commit`). */
25
+ applyOps(ops: readonly Op[]): void;
26
+ /** Where the events for the child's elements go: its root's `dispatch`. */
27
+ onEvent(handler: (event: RendererEvent) => void): void;
28
+ /** Where the host's environment goes: its root's `setEnvironment`. */
29
+ onEnvironment(handler: (environment: Environment) => void): void;
30
+ /** An event for the child (by the child's element id, or unaddressed). */
31
+ dispatch(event: RendererEvent): void;
32
+ setEnvironment(environment: Environment): void;
33
+ /** For `useSyncExternalStore`: the version moves on every `commit`. */
34
+ subscribe(listener: () => void): () => void;
35
+ getVersion(): number;
36
+ /** The mirror: element 0, whose children are the child's top-level elements (hoisted sheets and alerts last). */
37
+ readonly root: MirrorNode;
38
+ /** The mirrored element with that id (the child's own id), if it is there. */
39
+ node(id: number): MirrorNode | undefined;
40
+ /** What the child's root carries (a title with no screen of its own, a color scheme); `update` of element 0. */
41
+ readonly rootProps: Record<string, unknown>;
42
+ /** The handlers a mirrored element gets: every event forwarded to the child under the child's id. */
43
+ handlersFor(id: number): EventHandlers;
44
+ /** `RemoteTree` names the tree it draws into, so a child's animated pass animates that tree's. */
45
+ attach(tree: HostTree | null): void;
46
+ /** Forget the mirror and the handlers; the child root is the caller's to unmount. */
47
+ dispose(): void;
48
+ }
49
+ export declare function createRemoteRoot(): RemoteRoot;
50
+ //# sourceMappingURL=remote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/host/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAa,EAAE,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,6DAA6D;AAC7D,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC;IACnC,2EAA2E;IAC3E,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,IAAI,CAAC;IACvD,sEAAsE;IACtE,aAAa,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAAC;IACjE,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/C,uEAAuE;IACvE,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,UAAU,IAAI,MAAM,CAAC;IACrB,iHAAiH;IACjH,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,8EAA8E;IAC9E,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACzC,gHAAgH;IAChH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,qGAAqG;IACrG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,CAAC;IACvC,kGAAkG;IAClG,MAAM,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;IACpC,qFAAqF;IACrF,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,gBAAgB,IAAI,UAAU,CAkJ7C"}
@@ -7,7 +7,7 @@
7
7
  import type { Animation, ColorScheme, DynamicTypeSize, Op, RendererEvent } from '@swiftbrowser/web/src/protocol';
8
8
  import { type ReactNode } from 'react';
9
9
  import { type Environment } from '../environment';
10
- import { type OpsSink } from './tree';
10
+ import { HostTree, type HostTreeOptions, type OpsSink } from './tree';
11
11
  export interface SwiftUIRoot {
12
12
  /** Render (or re-render) the tree; the ops of the pass reach the sink before this returns. */
13
13
  render(element: ReactNode): void;
@@ -17,7 +17,14 @@ export interface SwiftUIRoot {
17
17
  /** The device environment the tree reads through `useColorScheme` and friends. */
18
18
  setEnvironment(environment: Partial<Environment>): void;
19
19
  }
20
- export declare function createSwiftUIRoot(sink: OpsSink): SwiftUIRoot;
20
+ /** The tree a component renders into (`RemoteTree` stamps a child's animation on it). */
21
+ export declare const HostTreeContext: import("react").Context<HostTree | null>;
22
+ export type SwiftUIRootOptions = HostTreeOptions;
23
+ /**
24
+ * A root whose ops reach `sink`. `remote: true` for a tree another root
25
+ * draws through `RemoteTree` (`createRemoteRoot`), rather than a renderer.
26
+ */
27
+ export declare function createSwiftUIRoot(sink: OpsSink, options?: SwiftUIRootOptions): SwiftUIRoot;
21
28
  export type { ColorScheme, DynamicTypeSize, Op };
22
29
  /**
23
30
  * Registers the reconciler with the React DevTools hook (`__REACT_DEVTOOLS_GLOBAL_HOOK__`)
@@ -36,6 +43,17 @@ export interface WithAnimationOptions {
36
43
  */
37
44
  completionCriteria?: AnimationCompletionCriteria;
38
45
  }
46
+ /**
47
+ * Stamps one tree's next `commit` with an animation (and a completion, whose
48
+ * serial is answered), without a body: for a pass another root animated,
49
+ * drawn here by `RemoteTree`. The stamp waits for the tree's next flush,
50
+ * however late React runs it; `withAnimation` clears its stamps as its body
51
+ * returns.
52
+ */
53
+ export declare function stampNextCommit(tree: HostTree, animation: Animation, completion?: {
54
+ criteria: AnimationCompletionCriteria;
55
+ callback: () => void;
56
+ }): number;
39
57
  /**
40
58
  * `withAnimation { }`: the state changes `body` makes render in one pass whose
41
59
  * `commit` carries the animation, so the renderer animates every frame and
@@ -1 +1 @@
1
- {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/host/root.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACjH,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAA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;IAAE,QAAQ,EAAE,2BAA2B,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,MAAM,CAM1J;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,CAAC,CAAC;AAC9G,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,CAAC,CAAC;AAC7I,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC"}
@@ -8,8 +8,19 @@
8
8
  import type { Animation, Op, RendererEvent } from '@swiftbrowser/web/src/protocol';
9
9
  import { type HostProps, type Instance, type RootNode } from './instance';
10
10
  export type OpsSink = (ops: Op[]) => void;
11
+ export interface HostTreeOptions {
12
+ /**
13
+ * The tree is drawn by another root (`RemoteTree`), not a renderer: a
14
+ * preference with no screen to take it goes to the root instead of being
15
+ * dropped, and the root's props are sent whole as `update` of element 0
16
+ * (a renderer takes only `colorScheme` there), so the host can lift them
17
+ * to the screen it draws the tree in.
18
+ */
19
+ remote?: boolean;
20
+ }
11
21
  export declare class HostTree {
12
22
  private readonly sink;
23
+ private readonly options;
13
24
  readonly root: RootNode;
14
25
  private nextId;
15
26
  /** Emitted elements by id, for event dispatch. */
@@ -24,11 +35,14 @@ export declare class HostTree {
24
35
  serial: number;
25
36
  criteria: 'logicallyComplete' | 'removed';
26
37
  callback: () => void;
38
+ whenNothingDrawn?: boolean;
27
39
  } | undefined;
28
40
  private readonly completions;
29
41
  /** The root's `colorScheme` last sent (`.preferredColorScheme`); undefined while none was. */
30
42
  private committedColorScheme;
31
- constructor(sink: OpsSink);
43
+ /** Remote: the root's props last sent. */
44
+ private committedRootProps;
45
+ constructor(sink: OpsSink, options?: HostTreeOptions);
32
46
  createInstance(props: HostProps): Instance;
33
47
  updateInstance(instance: Instance, next: HostProps): void;
34
48
  /** Emit the ops for everything that changed since the last commit. */
@@ -1 +1 @@
1
- {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/host/tree.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAY,EAAE,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC7F,OAAO,EAAyB,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAEhH,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;AAqC1C,qBAAa,QAAQ;IAgBP,OAAO,CAAC,QAAQ,CAAC,IAAI;IAfjC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAgE;IACvF,OAAO,CAAC,MAAM,CAAK;IACnB,kDAAkD;IAClD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+B;IACpD,OAAO,CAAC,aAAa,CAAuB;IAC5C,4EAA4E;IAC5E,OAAO,CAAC,OAAO,CAAgB;IAC/B,qDAAqD;IACrD,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAAC;IACxC,8IAA8I;IAC9I,iBAAiB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,CAAC;QAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IACnH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAC7D,8FAA8F;IAC9F,OAAO,CAAC,oBAAoB,CAAsC;gBAErC,IAAI,EAAE,OAAO;IAE1C,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ;IAgB1C,cAAc,CAAC,QAA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,CAAC;QAAC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,CAAC;QAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;IAC/I,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAC7D,8FAA8F;IAC9F,OAAO,CAAC,oBAAoB,CAAsC;IAClE,0CAA0C;IAC1C,OAAO,CAAC,kBAAkB,CAA+B;gBAGtC,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,eAAoB;IAGhD,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ;IAgB1C,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAoBzD,sEAAsE;IACtE,MAAM,IAAI,IAAI;IAKd,KAAK,IAAI,EAAE,EAAE;IAoIb,qEAAqE;IACrE,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIzC,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;CAgBrC;AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAazD"}
package/dist/index.d.ts CHANGED
@@ -3,7 +3,10 @@
3
3
  * SwiftBrowser's render ops; `createSwiftUIRoot` hands them to the renderer
4
4
  * of @swiftbrowser/web, which draws them with its iOS layout engine.
5
5
  */
6
- export { createSwiftUIRoot, injectIntoDevTools, withAnimation, type AnimationCompletionCriteria, type SwiftUIRoot, type WithAnimationOptions } from './host/root';
6
+ export { createSwiftUIRoot, injectIntoDevTools, withAnimation, type AnimationCompletionCriteria, type SwiftUIRoot, type SwiftUIRootOptions, type WithAnimationOptions } from './host/root';
7
+ export { createRemoteRoot, type MirrorNode, type RemoteRoot } from './host/remote';
8
+ export { RemoteTree, type RemoteTreeProps } from './components/remoteTree';
9
+ export type { Op, RendererEvent } from '@swiftbrowser/web/src/protocol';
7
10
  export { mount, type MountOptions, type Mounted } from './mount';
8
11
  export { SwiftUIView, type SwiftUIViewProps } from './island';
9
12
  export { useContextBridge } from './bridge';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,aAAa,EAAE,KAAK,2BAA2B,EAAE,KAAK,WAAW,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAClK,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,UAAU,EACV,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,YAAY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