@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.
Files changed (84) hide show
  1. package/build/batched-updates.d.ts +2 -0
  2. package/build/batched-updates.js +5 -0
  3. package/build/components/checkbox-props.d.ts +5 -0
  4. package/build/components/checkbox-props.js +1 -0
  5. package/build/components/flat-list/index.d.ts +16 -13
  6. package/build/components/flat-list/index.js +86 -72
  7. package/build/components/input-accessory-view-props.d.ts +4 -3
  8. package/build/components/keyboard-avoiding-view/index.d.ts +2 -2
  9. package/build/components/keyboard-avoiding-view/index.js +45 -84
  10. package/build/components/layout-conformance-props.d.ts +6 -0
  11. package/build/components/layout-conformance-props.js +1 -0
  12. package/build/components/modal/index.d.ts +4 -4
  13. package/build/components/modal/index.js +47 -18
  14. package/build/components/refresh-control-props.d.ts +7 -6
  15. package/build/components/scroll-view/scroll-view-props.d.ts +8 -5
  16. package/build/components/text-input/text-input-props.d.ts +4 -0
  17. package/build/components/touchable/touchable-props.d.ts +6 -5
  18. package/build/components/virtualized-list/index.d.ts +3 -70
  19. package/build/components/virtualized-list/index.js +50 -548
  20. package/build/components/virtualized-list/list-children.d.ts +13 -0
  21. package/build/components/virtualized-list/list-children.js +79 -0
  22. package/build/components/virtualized-list/list-config.d.ts +11 -0
  23. package/build/components/virtualized-list/list-config.js +14 -0
  24. package/build/components/virtualized-list/list-elements.d.ts +11 -0
  25. package/build/components/virtualized-list/list-elements.js +26 -0
  26. package/build/components/virtualized-list/list-host.d.ts +14 -0
  27. package/build/components/virtualized-list/list-host.js +24 -0
  28. package/build/components/virtualized-list/list-scroll-props.d.ts +32 -0
  29. package/build/components/virtualized-list/list-scroll-props.js +30 -0
  30. package/build/components/virtualized-list/nested-scope.d.ts +10 -0
  31. package/build/components/virtualized-list/nested-scope.js +16 -0
  32. package/build/components/virtualized-list/use-list-driver.d.ts +22 -0
  33. package/build/components/virtualized-list/use-list-driver.js +104 -0
  34. package/build/components/virtualized-list/use-list-nesting.d.ts +12 -0
  35. package/build/components/virtualized-list/use-list-nesting.js +37 -0
  36. package/build/components/virtualized-list/use-list-parts.d.ts +12 -0
  37. package/build/components/virtualized-list/use-list-parts.js +20 -0
  38. package/build/components/virtualized-list/use-scroll-handlers.d.ts +17 -0
  39. package/build/components/virtualized-list/use-scroll-handlers.js +106 -0
  40. package/build/components/virtualized-list/use-separators.d.ts +8 -0
  41. package/build/components/virtualized-list/use-separators.js +17 -0
  42. package/build/components/virtualized-list/virtualized-list-props.d.ts +85 -0
  43. package/build/components/virtualized-list/virtualized-list-props.js +2 -0
  44. package/build/components/virtualized-section-list/index.d.ts +24 -8
  45. package/build/components/virtualized-section-list/index.js +89 -93
  46. package/build/components/virtualized-section-list/section-item-cell.d.ts +23 -0
  47. package/build/components/virtualized-section-list/section-item-cell.js +48 -0
  48. package/build/components.d.ts +5 -5
  49. package/build/descriptor-to-react/with-children.d.ts +4 -0
  50. package/build/descriptor-to-react/with-children.js +6 -0
  51. package/build/hooks/use-animated-value.d.ts +7 -0
  52. package/build/hooks/use-animated-value.js +19 -0
  53. package/build/hooks/use-color-scheme.d.ts +2 -2
  54. package/build/hooks/use-color-scheme.js +4 -13
  55. package/build/hooks/use-event.d.ts +6 -0
  56. package/build/hooks/use-event.js +15 -0
  57. package/build/hooks/use-native-view-controller.d.ts +3 -0
  58. package/build/hooks/use-native-view-controller.js +15 -0
  59. package/build/hooks/use-pressability.d.ts +34 -0
  60. package/build/hooks/use-pressability.js +39 -0
  61. package/build/hooks/use-window-dimensions.js +6 -10
  62. package/build/host-config.js +6 -5
  63. package/build/index.d.ts +23 -5
  64. package/build/index.js +23 -14
  65. package/build/jsx-runtime.d.ts +17 -16
  66. package/build/modules/animated/create-animated-component.d.ts +2 -2
  67. package/build/modules/animated/create-animated-component.js +10 -22
  68. package/build/modules/animated/index.d.ts +54 -41
  69. package/build/modules/animated/index.js +2 -27
  70. package/build/modules/app-registry/index.d.ts +3 -3
  71. package/build/modules/app-registry/index.js +2 -2
  72. package/build/modules/status-bar/index.android.d.ts +1 -1
  73. package/build/modules/status-bar/index.android.js +7 -27
  74. package/build/modules/status-bar/index.ios.d.ts +1 -1
  75. package/build/modules/status-bar/index.ios.js +4 -28
  76. package/build/modules/status-bar/shared.d.ts +5 -4
  77. package/build/modules/status-bar/shared.js +33 -6
  78. package/build/native-host-tags.d.ts +2 -0
  79. package/build/native-host-tags.js +4 -0
  80. package/build/render.d.ts +1 -1
  81. package/build/render.js +3 -1
  82. package/build/root-tag-context.d.ts +1 -0
  83. package/build/root-tag-context.js +4 -0
  84. package/package.json +6 -6
@@ -1,31 +1,11 @@
1
- // StatusBar on Android: the declarative React half only. The native StatusBarManager driving
2
- // (applyStatusBarProps), the imperative statics (statusBarImperative), and the Android
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, resolving '@symbiote-native/engine's relative
10
- // './status-bar' import to its own index.android.ts in turn (Android's native module is a
11
- // DIFFERENT shape from iOS — single-arg setHidden(hidden)/setStyle(style) plus
12
- // setColor/setTranslucent — all handled inside that engine module, not here).
13
- import { useEffect } from 'react';
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,3 +1,3 @@
1
- import type { IStatusBarComponent } from './shared';
1
+ import { type IStatusBarComponent } from './shared';
2
2
  export type { IStatusBarProps, IStatusBarStyle } from './shared';
3
3
  export declare const StatusBar: IStatusBarComponent;
@@ -1,29 +1,5 @@
1
- // StatusBar on iOS: the declarative React half only. The native `StatusBarManager`
2
- // TurboModule driving (applyStatusBarProps), the imperative statics (statusBarImperative),
3
- // and the iOS currentHeight stub all live in @symbiote-native/engine, shared verbatim with
4
- // every adapter (Vue's status-bar.ts, Angular's status-bar.ts drive the exact same functions).
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 { FC } from 'react';
2
- import type { IStatusBarImperative, IStatusBarProps } from '@symbiote-native/engine';
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 interface IStatusBarComponent extends FC<IStatusBarProps>, IStatusBarImperative {
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. The pure types + the imperative API + applyStatusBarProps
2
- // live in @symbiote-native/engine (shared verbatim with every adapter); React supplies only the
3
- // declarative component shape: an FC that renders null and applies the props in an effect, with
4
- // the imperative statics attached to the function object (RN's StatusBar). IStatusBarComponent
5
- // is the one React-coupled type (it names React's FC), so it stays here, not in the engine.
6
- export {};
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
+ };
@@ -0,0 +1,2 @@
1
+ export declare const unstable_NativeText = "text";
2
+ export declare const unstable_NativeView = "view";
@@ -0,0 +1,4 @@
1
+ // RN's `unstable_NativeText` and `unstable_NativeView`: the element types of its raw host
2
+ // components, which are the intrinsic `text` and `view` tags here
3
+ export const unstable_NativeText = 'text';
4
+ export const unstable_NativeView = 'view';
package/build/render.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
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>;
@@ -0,0 +1,4 @@
1
+ // RN's `RootTagContext`: every `mount` provides the tag of its surface, 0 stays the default
2
+ import { createContext } from 'react';
3
+ const NO_SURFACE = 0;
4
+ export const RootTagContext = createContext(NO_SURFACE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbiote-native/react",
3
- "version": "3.2.0",
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.1.4",
61
- "@symbiote-native/css-parser": "0.5.3"
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.5.0"
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.5.0",
74
- "@symbiote-native/test-utils": "0.4.6"
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",