@swiftbrowser/react 0.9.6 → 0.9.8
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 +11 -0
- package/dist/components/controls.d.ts +2 -0
- package/dist/components/controls.d.ts.map +1 -1
- package/dist/components/stacks.d.ts +9 -0
- package/dist/components/stacks.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -16
- package/dist/index.js.map +1 -1
- package/dist/island.d.ts +10 -1
- package/dist/island.d.ts.map +1 -1
- package/dist/mount.d.ts +8 -0
- package/dist/mount.d.ts.map +1 -1
- package/dist/scrollReader.d.ts +17 -0
- package/dist/scrollReader.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/island.d.ts
CHANGED
|
@@ -35,6 +35,15 @@ export interface SwiftUIViewProps {
|
|
|
35
35
|
* owns the history.
|
|
36
36
|
*/
|
|
37
37
|
history?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Follow the on-screen keyboard: its height becomes a bottom inset, so a
|
|
40
|
+
* field, a bottom search field or a chat's composer rises above it and a
|
|
41
|
+
* list stops above it, as on iOS, instead of the browser panning the page
|
|
42
|
+
* to the field. On by default for a `fill` island, which fills the layout
|
|
43
|
+
* viewport as a full-screen app; a `content` island in a page leaves the
|
|
44
|
+
* page to the browser.
|
|
45
|
+
*/
|
|
46
|
+
keyboard?: boolean;
|
|
38
47
|
className?: string;
|
|
39
48
|
style?: CSSProperties;
|
|
40
49
|
}
|
|
@@ -45,6 +54,6 @@ interface SafeAreaInsets {
|
|
|
45
54
|
trailing: number;
|
|
46
55
|
}
|
|
47
56
|
export declare function insetsOf(safeArea: SwiftUIViewProps['safeArea'], fit: 'fill' | 'content'): SafeAreaInsets;
|
|
48
|
-
export declare function SwiftUIView({ children, fit, colorScheme, dynamicTypeSize, contexts, assets, safeArea, history, className, style, }: SwiftUIViewProps): ReactNode;
|
|
57
|
+
export declare function SwiftUIView({ children, fit, colorScheme, dynamicTypeSize, contexts, assets, safeArea, history, keyboard, className, style, }: SwiftUIViewProps): ReactNode;
|
|
49
58
|
export {};
|
|
50
59
|
//# sourceMappingURL=island.d.ts.map
|
package/dist/island.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"island.d.ts","sourceRoot":"","sources":["../src/island.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEnF,OAAO,EAA2B,KAAK,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,EAAE,SAAS,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IACvC,sFAAsF;IACtF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5C;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC,UAAU,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EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,CAGxG;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,GAAY,EACZ,WAAqB,EACrB,eAAyB,EACzB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAc,EACd,QAAyB,EACzB,SAAS,EACT,KAAK,GACN,EAAE,gBAAgB,GAAG,SAAS,CAoD9B"}
|
package/dist/mount.d.ts
CHANGED
|
@@ -38,6 +38,14 @@ export interface MountOptions {
|
|
|
38
38
|
* router owns it.
|
|
39
39
|
*/
|
|
40
40
|
history?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Follow the on-screen keyboard (a phone's): its height becomes a bottom
|
|
43
|
+
* inset, so a field, a bottom search field or a chat's composer rises
|
|
44
|
+
* above it and a list stops above it, as on iOS, instead of the browser
|
|
45
|
+
* panning the page to the field. For a root that fills the layout
|
|
46
|
+
* viewport (a full-screen app); off by default.
|
|
47
|
+
*/
|
|
48
|
+
keyboard?: boolean;
|
|
41
49
|
}
|
|
42
50
|
export interface Mounted {
|
|
43
51
|
root: SwiftUIRoot;
|
package/dist/mount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA0B,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAChH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA0B,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE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|
import { type ReactNode } from 'react';
|
|
8
|
+
import { type BindingValue } from './binding';
|
|
8
9
|
import { type UnitPointValue } from './values';
|
|
9
10
|
interface ScrollRequest {
|
|
10
11
|
id: string | number;
|
|
@@ -23,5 +24,21 @@ export declare function ScrollTarget({ id, children }: {
|
|
|
23
24
|
id: string | number;
|
|
24
25
|
children?: ReactNode;
|
|
25
26
|
}): ReactNode;
|
|
27
|
+
/** What a `scrollPosition` scroll view hands the targets inside it: where to say they came to the anchor. */
|
|
28
|
+
export declare const ScrollPositionContext: import("react").Context<{
|
|
29
|
+
report: (id: string | number) => void;
|
|
30
|
+
} | null>;
|
|
31
|
+
export type ScrollPositionValue = string | number | null;
|
|
32
|
+
/**
|
|
33
|
+
* `scrollPosition={[id, setId]}` on a `ScrollView` (`.scrollPosition(id:anchor:)`):
|
|
34
|
+
* the scroll view reports the target at its anchor when scrolling settles
|
|
35
|
+
* (`reportsPosition`), and a value the app sets, the first included, scrolls
|
|
36
|
+
* to that target, as `proxy.scrollTo` would. A value the page just reported
|
|
37
|
+
* scrolls nowhere.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useScrollPosition(binding: BindingValue<ScrollPositionValue> | undefined, anchor: UnitPointValue | undefined): {
|
|
40
|
+
props: Record<string, unknown>;
|
|
41
|
+
provide(children: ReactNode): ReactNode;
|
|
42
|
+
} | null;
|
|
26
43
|
export {};
|
|
27
44
|
//# sourceMappingURL=scrollReader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollReader.d.ts","sourceRoot":"","sources":["../src/scrollReader.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"scrollReader.d.ts","sourceRoot":"","sources":["../src/scrollReader.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,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AAA;CAAE,GAAG,IAAI,CAiChN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftbrowser/react",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
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.9.
|
|
32
|
+
"@swiftbrowser/web": "0.9.8"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^19.0.0",
|