@swiftbrowser/react 0.28.6 → 0.28.7
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 +3 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/mount.d.ts +14 -0
- package/dist/mount.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/mount.d.ts
CHANGED
|
@@ -70,6 +70,11 @@ export interface MountOptions {
|
|
|
70
70
|
sidebarTitleBar?: boolean;
|
|
71
71
|
}
|
|
72
72
|
export interface Mounted {
|
|
73
|
+
/**
|
|
74
|
+
* The tree's root. Its `render` draws an element in the page's providers
|
|
75
|
+
* (`LazyWindowContext`), as `mount` drew the first, so a re-render updates
|
|
76
|
+
* the tree in place rather than remounting it.
|
|
77
|
+
*/
|
|
73
78
|
root: SwiftUIRoot;
|
|
74
79
|
renderer: Renderer;
|
|
75
80
|
/** The device environment, for the renderer and the tree both (the page's theme toggle, a device picker's platform). */
|
|
@@ -94,5 +99,14 @@ export interface Mounted {
|
|
|
94
99
|
* otherwise. Width alone is no signal: a narrow desktop window is not a phone.
|
|
95
100
|
*/
|
|
96
101
|
export declare function decidePlatform(width: number, media?: (query: string) => boolean): Platform;
|
|
102
|
+
/**
|
|
103
|
+
* A root that renders its elements in the page's providers: the page unbuilds
|
|
104
|
+
* a lazy stack's rows far from the visible area (renderer.ts
|
|
105
|
+
* `checkLazyWindow`). Every render goes through it, the first and each one
|
|
106
|
+
* after, so the element at the top of the tree keeps its type and React
|
|
107
|
+
* updates the tree rather than mounting it again (a `SwiftUIView` re-renders
|
|
108
|
+
* its children right after `mount`).
|
|
109
|
+
*/
|
|
110
|
+
export declare function pageRoot(root: SwiftUIRoot): SwiftUIRoot;
|
|
97
111
|
export declare function mount(screen: HTMLElement, element: ReactNode, options?: MountOptions): Mounted;
|
|
98
112
|
//# sourceMappingURL=mount.d.ts.map
|
package/dist/mount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|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AW,CAEvD;AAED,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAyFlG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftbrowser/react",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.7",
|
|
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.
|
|
32
|
+
"@swiftbrowser/web": "0.28.7"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^19.0.0",
|