@symbiote-native/react 3.2.0 → 3.4.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/build/batched-updates.d.ts +2 -0
- package/build/batched-updates.js +5 -0
- package/build/components/checkbox-props.d.ts +5 -0
- package/build/components/checkbox-props.js +1 -0
- package/build/components/flat-list/index.d.ts +16 -13
- package/build/components/flat-list/index.js +86 -72
- package/build/components/input-accessory-view-props.d.ts +4 -3
- package/build/components/keyboard-avoiding-view/index.d.ts +2 -2
- package/build/components/keyboard-avoiding-view/index.js +45 -84
- package/build/components/layout-conformance-props.d.ts +6 -0
- package/build/components/layout-conformance-props.js +1 -0
- package/build/components/modal/index.d.ts +4 -4
- package/build/components/modal/index.js +47 -18
- package/build/components/refresh-control-props.d.ts +7 -6
- package/build/components/scroll-view/scroll-view-props.d.ts +8 -5
- package/build/components/text-input/text-input-props.d.ts +4 -0
- package/build/components/touchable/touchable-props.d.ts +6 -5
- package/build/components/virtualized-list/index.d.ts +3 -70
- package/build/components/virtualized-list/index.js +50 -548
- package/build/components/virtualized-list/list-children.d.ts +13 -0
- package/build/components/virtualized-list/list-children.js +79 -0
- package/build/components/virtualized-list/list-config.d.ts +11 -0
- package/build/components/virtualized-list/list-config.js +14 -0
- package/build/components/virtualized-list/list-elements.d.ts +11 -0
- package/build/components/virtualized-list/list-elements.js +26 -0
- package/build/components/virtualized-list/list-host.d.ts +14 -0
- package/build/components/virtualized-list/list-host.js +24 -0
- package/build/components/virtualized-list/list-scroll-props.d.ts +32 -0
- package/build/components/virtualized-list/list-scroll-props.js +30 -0
- package/build/components/virtualized-list/nested-scope.d.ts +10 -0
- package/build/components/virtualized-list/nested-scope.js +16 -0
- package/build/components/virtualized-list/use-list-driver.d.ts +22 -0
- package/build/components/virtualized-list/use-list-driver.js +104 -0
- package/build/components/virtualized-list/use-list-nesting.d.ts +12 -0
- package/build/components/virtualized-list/use-list-nesting.js +37 -0
- package/build/components/virtualized-list/use-list-parts.d.ts +12 -0
- package/build/components/virtualized-list/use-list-parts.js +20 -0
- package/build/components/virtualized-list/use-scroll-handlers.d.ts +17 -0
- package/build/components/virtualized-list/use-scroll-handlers.js +106 -0
- package/build/components/virtualized-list/use-separators.d.ts +8 -0
- package/build/components/virtualized-list/use-separators.js +17 -0
- package/build/components/virtualized-list/virtualized-list-props.d.ts +85 -0
- package/build/components/virtualized-list/virtualized-list-props.js +2 -0
- package/build/components/virtualized-section-list/index.d.ts +24 -8
- package/build/components/virtualized-section-list/index.js +89 -93
- package/build/components/virtualized-section-list/section-item-cell.d.ts +23 -0
- package/build/components/virtualized-section-list/section-item-cell.js +48 -0
- package/build/components.d.ts +5 -5
- package/build/descriptor-to-react/with-children.d.ts +4 -0
- package/build/descriptor-to-react/with-children.js +6 -0
- package/build/hooks/use-animated-value.d.ts +7 -0
- package/build/hooks/use-animated-value.js +19 -0
- package/build/hooks/use-color-scheme.d.ts +2 -2
- package/build/hooks/use-color-scheme.js +4 -13
- package/build/hooks/use-event.d.ts +6 -0
- package/build/hooks/use-event.js +15 -0
- package/build/hooks/use-native-view-controller.d.ts +3 -0
- package/build/hooks/use-native-view-controller.js +15 -0
- package/build/hooks/use-pressability.d.ts +34 -0
- package/build/hooks/use-pressability.js +39 -0
- package/build/hooks/use-window-dimensions.js +6 -10
- package/build/host-config.js +6 -5
- package/build/index.d.ts +23 -5
- package/build/index.js +23 -14
- package/build/jsx-runtime.d.ts +17 -16
- package/build/modules/animated/create-animated-component.d.ts +2 -2
- package/build/modules/animated/create-animated-component.js +10 -22
- package/build/modules/animated/index.d.ts +54 -41
- package/build/modules/animated/index.js +2 -27
- package/build/modules/app-registry/index.d.ts +3 -3
- package/build/modules/app-registry/index.js +2 -2
- package/build/modules/status-bar/index.android.d.ts +1 -1
- package/build/modules/status-bar/index.android.js +7 -27
- package/build/modules/status-bar/index.ios.d.ts +1 -1
- package/build/modules/status-bar/index.ios.js +4 -28
- package/build/modules/status-bar/shared.d.ts +5 -4
- package/build/modules/status-bar/shared.js +33 -6
- package/build/native-host-tags.d.ts +2 -0
- package/build/native-host-tags.js +4 -0
- package/build/render.d.ts +1 -1
- package/build/render.js +3 -1
- package/build/root-tag-context.d.ts +1 -0
- package/build/root-tag-context.js +4 -0
- package/package.json +6 -6
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
// StatusBar on Android: the declarative
|
|
2
|
-
//
|
|
3
|
-
// currentHeight getter (statusBarCurrentHeight) all live in @symbiote-native/engine, shared
|
|
4
|
-
// verbatim with every adapter (Vue's status-bar.ts, Angular's status-bar.ts drive the exact
|
|
5
|
-
// same functions). This file supplies only what's React-specific: an FC that renders null and
|
|
6
|
-
// re-applies props via useEffect on mount + every prop change, with the imperative statics
|
|
7
|
-
// attached to the function object, exactly like RN's own StatusBar.
|
|
1
|
+
// StatusBar on Android: the shared declarative component with the engine's imperative statics
|
|
2
|
+
// attached to the function object, plus the `currentHeight` getter
|
|
8
3
|
//
|
|
9
|
-
// Metro picks this file on an Android host
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import { applyStatusBarProps, statusBarImperative, statusBarCurrentHeight, } from '@symbiote-native/engine';
|
|
15
|
-
// Renders null and applies its props to the native module in an effect, on mount and on
|
|
16
|
-
// every prop change, same contract as iOS.
|
|
17
|
-
const StatusBarAndroidComponent = props => {
|
|
18
|
-
const { barStyle, hidden, animated, backgroundColor, translucent } = props;
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
applyStatusBarProps(props);
|
|
21
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- deps are the primitive fields, not `props` itself, so an unchanged prop shape doesn't re-fire.
|
|
22
|
-
}, [barStyle, hidden, animated, backgroundColor, translucent]);
|
|
23
|
-
return null;
|
|
24
|
-
};
|
|
25
|
-
const StatusBarAndroid = Object.assign(StatusBarAndroidComponent, statusBarImperative);
|
|
26
|
-
// Android exposes the bar height as a native constant; undefined if the module or the
|
|
27
|
-
// constant is absent. Read lazily (getter, not a value) so nothing touches native at import
|
|
28
|
-
// time — the engine's Android impl resolves it on access.
|
|
4
|
+
// Metro picks this file on an Android host
|
|
5
|
+
import { statusBarImperative, statusBarCurrentHeight, } from '@symbiote-native/engine';
|
|
6
|
+
import { StatusBarComponent } from './shared.js';
|
|
7
|
+
const StatusBarAndroid = Object.assign(StatusBarComponent, statusBarImperative);
|
|
8
|
+
// A getter, not a value, so nothing touches native at import time
|
|
29
9
|
Object.defineProperty(StatusBarAndroid, 'currentHeight', {
|
|
30
10
|
get: statusBarCurrentHeight,
|
|
31
11
|
enumerable: true,
|
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
// StatusBar on iOS: the
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// This file supplies only what's React-specific: an FC that renders null and re-applies props
|
|
6
|
-
// via useEffect on mount + every prop change, with the imperative statics attached to the
|
|
7
|
-
// function object, exactly like RN's own StatusBar.
|
|
8
|
-
//
|
|
9
|
-
// Metro picks this file on an iOS host; the headless/tsx base (status-bar/index.ts) re-exports
|
|
10
|
-
// it, which is also what a bare '@symbiote-native/engine' import resolves to under vitest — so
|
|
11
|
-
// this file's own engine import is already vitest-correct, no platform-selection subtlety here.
|
|
12
|
-
import { useEffect } from 'react';
|
|
13
|
-
import { applyStatusBarProps, statusBarImperative, } from '@symbiote-native/engine';
|
|
14
|
-
// StatusBar renders null and applies its props to the native module in an effect,
|
|
15
|
-
// on mount and on every prop change. Simplification vs RN: RN maintains a
|
|
16
|
-
// prop-merge stack so nested StatusBars compose (deepest/last wins). This module
|
|
17
|
-
// direct-applies a single component's props, which is correct for one StatusBar.
|
|
18
|
-
const StatusBarComponent = props => {
|
|
19
|
-
const { barStyle, hidden, animated, networkActivityIndicatorVisible } = props;
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
applyStatusBarProps(props);
|
|
22
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- deps are the primitive fields, not `props` itself, so an unchanged prop shape doesn't re-fire.
|
|
23
|
-
}, [barStyle, hidden, animated, networkActivityIndicatorVisible]);
|
|
24
|
-
return null;
|
|
25
|
-
};
|
|
26
|
-
// The imperative statics mirror the declarative component: non-throwing, a missing optional
|
|
27
|
-
// native module is a no-op. currentHeight is Android-only; absent on iOS (RN sets it to null
|
|
28
|
-
// on iOS), so it's intentionally not attached here.
|
|
1
|
+
// StatusBar on iOS: the shared component with the engine's statics attached, like RN
|
|
2
|
+
// `currentHeight` is Android-only, so it is absent here
|
|
3
|
+
import { statusBarImperative } from '@symbiote-native/engine';
|
|
4
|
+
import { StatusBarComponent } from './shared.js';
|
|
29
5
|
export const StatusBar = Object.assign(StatusBarComponent, statusBarImperative);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type IStatusBarImperative, type IStatusBarProps } from '@symbiote-native/engine';
|
|
3
3
|
export type { IStatusBarProps, IStatusBarStyle, IStatusBarAnimation, } from '@symbiote-native/engine';
|
|
4
|
-
export
|
|
4
|
+
export type IStatusBarComponent = FC<IStatusBarProps> & IStatusBarImperative & {
|
|
5
5
|
currentHeight?: number;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
|
+
export declare const StatusBarComponent: FC<IStatusBarProps>;
|
|
@@ -1,6 +1,33 @@
|
|
|
1
|
-
// StatusBar is the React-side contract.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// StatusBar is the React-side contract. Types, the imperative API and the props stack live in
|
|
2
|
+
// @symbiote-native/engine, React supplies the declarative component: an FC that renders null and
|
|
3
|
+
// keeps one stack entry for as long as it is mounted
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { createStatusBarEntry, } from '@symbiote-native/engine';
|
|
6
|
+
// Every field is a dependency, the engine ignores the ones its platform has no use for
|
|
7
|
+
export const StatusBarComponent = props => {
|
|
8
|
+
const { barStyle, hidden, animated, showHideTransition, networkActivityIndicatorVisible, backgroundColor, translucent, } = props;
|
|
9
|
+
const [entry] = useState(createStatusBarEntry);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
entry.apply({
|
|
12
|
+
barStyle,
|
|
13
|
+
hidden,
|
|
14
|
+
animated,
|
|
15
|
+
showHideTransition,
|
|
16
|
+
networkActivityIndicatorVisible,
|
|
17
|
+
backgroundColor,
|
|
18
|
+
translucent,
|
|
19
|
+
});
|
|
20
|
+
}, [
|
|
21
|
+
entry,
|
|
22
|
+
barStyle,
|
|
23
|
+
hidden,
|
|
24
|
+
animated,
|
|
25
|
+
showHideTransition,
|
|
26
|
+
networkActivityIndicatorVisible,
|
|
27
|
+
backgroundColor,
|
|
28
|
+
translucent,
|
|
29
|
+
]);
|
|
30
|
+
// Popping on unmount restores what the stack held below this entry
|
|
31
|
+
useEffect(() => () => entry.release(), [entry]);
|
|
32
|
+
return null;
|
|
33
|
+
};
|
package/build/render.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type IRootTag, type SymbioteSurface } from '@symbiote-native/engine';
|
|
3
3
|
export declare function mount(rootTag: IRootTag, element: ReactNode): SymbioteSurface;
|
|
4
4
|
export declare function unmount(rootTag: IRootTag): void;
|
package/build/render.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Mount a React element tree onto a Fabric surface. The native host hands us a
|
|
2
2
|
// rootTag (via AppRegistry.registerRunnable); we create a surface for it and let
|
|
3
3
|
// the reconciler drive shared, which commits into nativeFabricUIManager.
|
|
4
|
+
import { createElement } from 'react';
|
|
4
5
|
import { createSurface, disposeRoot, setEventDispatcher, dlog, reportUncaughtError, } from '@symbiote-native/engine';
|
|
5
6
|
import reconciler, { flushExternalUpdate } from './host-config.js';
|
|
6
7
|
import { ConcurrentRoot } from './reconciler-constants.js';
|
|
8
|
+
import { RootTagContext } from './root-tag-context.js';
|
|
7
9
|
const noop = () => { };
|
|
8
10
|
function errorReporter(origin) {
|
|
9
11
|
return (error, info) => {
|
|
@@ -71,7 +73,7 @@ export function mount(rootTag, element) {
|
|
|
71
73
|
containers.set(rootTag, container);
|
|
72
74
|
// react-reconciler 0.33 renamed updateContainer/flushSync; @types 0.32 still has the old names.
|
|
73
75
|
// @ts-expect-error updateContainerSync exists at runtime in react-reconciler 0.33
|
|
74
|
-
reconciler.updateContainerSync(element, container, null, noop);
|
|
76
|
+
reconciler.updateContainerSync(createElement(RootTagContext.Provider, { value: rootTag }, element), container, null, noop);
|
|
75
77
|
// @ts-expect-error flushSyncWork exists at runtime in react-reconciler 0.33
|
|
76
78
|
reconciler.flushSyncWork();
|
|
77
79
|
return surface;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RootTagContext: import("react").Context<number>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "SymbioteNative's React adapter — a react-reconciler host config (mutation mode) driving real native iOS/Android views through stock React Native Fabric.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -57,21 +57,21 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"react-reconciler": "^0.33.0",
|
|
60
|
-
"@symbiote-native/components": "3.
|
|
61
|
-
"@symbiote-native/css-parser": "0.
|
|
60
|
+
"@symbiote-native/components": "3.3.0",
|
|
61
|
+
"@symbiote-native/css-parser": "0.6.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"react": ">=19.0.0",
|
|
65
65
|
"react-native": ">=0.86",
|
|
66
|
-
"@symbiote-native/engine": "^1.
|
|
66
|
+
"@symbiote-native/engine": "^1.7.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/node": "^26.0.0",
|
|
70
70
|
"@types/react": "^19.2.0",
|
|
71
71
|
"@types/react-reconciler": "^0.32.2",
|
|
72
72
|
"react": "19.2.3",
|
|
73
|
-
"@symbiote-native/engine": "1.
|
|
74
|
-
"@symbiote-native/test-utils": "0.
|
|
73
|
+
"@symbiote-native/engine": "1.7.0",
|
|
74
|
+
"@symbiote-native/test-utils": "0.5.0"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"typecheck": "tsc --build",
|