@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/README.md
CHANGED
|
@@ -332,7 +332,9 @@ own would add a second entry for the same screen). When the app pops on its
|
|
|
332
332
|
own (the bar's back button), the renderer's step back is asynchronous and
|
|
333
333
|
the app's `replaceState` for what it shows now runs before it lands; the
|
|
334
334
|
renderer sets that URL again on the entry it arrives at, so the address bar
|
|
335
|
-
follows either back button.
|
|
335
|
+
follows either back button. A reload keeps the entry it was on, and its URL,
|
|
336
|
+
while the app restores the screens it shows (ten seconds at most), rather
|
|
337
|
+
than stepping back to an older entry at the first commit.
|
|
336
338
|
On a phone, a `fill` island follows the on-screen keyboard (`keyboard`,
|
|
337
339
|
on by default for `fill`, or `mount(..., { keyboard: true })`): its height
|
|
338
340
|
becomes a bottom inset, so a field, a bottom search field or a chat's
|
package/dist/index.js
CHANGED
|
@@ -3735,9 +3735,12 @@ function decidePlatform(width, media = matchesMedia) {
|
|
|
3735
3735
|
function matchesMedia(query) {
|
|
3736
3736
|
return typeof matchMedia === "function" && matchMedia(query).matches;
|
|
3737
3737
|
}
|
|
3738
|
+
function pageRoot(root) {
|
|
3739
|
+
return { ...root, render: (element) => root.render(createElement(LazyWindowContext.Provider, { value: true }, element)) };
|
|
3740
|
+
}
|
|
3738
3741
|
function mount(screen, element, options = {}) {
|
|
3739
3742
|
let renderer = null;
|
|
3740
|
-
const root = createSwiftUIRoot((ops) => renderer?.applyOps(ops));
|
|
3743
|
+
const root = pageRoot(createSwiftUIRoot((ops) => renderer?.applyOps(ops)));
|
|
3741
3744
|
renderer = new Renderer(screen, (event) => root.dispatch(event));
|
|
3742
3745
|
renderer.fileDrops = "reference";
|
|
3743
3746
|
const measurer = (text, font2, width2) => renderer.measureText(text, font2, width2);
|
|
@@ -3784,7 +3787,7 @@ function mount(screen, element, options = {}) {
|
|
|
3784
3787
|
}) : null;
|
|
3785
3788
|
observer?.observe(screen);
|
|
3786
3789
|
const stopScenePhase = typeof document !== "undefined" ? watchScenePhase((scenePhase) => root.setEnvironment({ scenePhase })) : null;
|
|
3787
|
-
root.render(
|
|
3790
|
+
root.render(element);
|
|
3788
3791
|
const mounted = {
|
|
3789
3792
|
root,
|
|
3790
3793
|
renderer,
|