@symbiote-native/react 3.3.0 → 3.4.1
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/bootstrap.d.ts +1 -0
- package/build/bootstrap.js +6 -5
- 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/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-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 +19 -5
- package/build/index.js +20 -14
- package/build/jsx-runtime.d.ts +15 -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
package/build/host-config.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// canary: a known-good driver exercising shared end to end.
|
|
5
5
|
import createReconciler from 'react-reconciler';
|
|
6
6
|
import { createContext } from 'react';
|
|
7
|
-
import { appendChild, createElement, createRawText, insertBefore, removeChild, routeProp, setNodeComponent, setNodeHidden, setText, SymbioteSurface, } from '@symbiote-native/engine';
|
|
7
|
+
import { appendChild, createElement, createRawText, hostBehaviorFor, insertBefore, removeChild, routeProp, setNodeComponent, setNodeHidden, setText, SymbioteSurface, } from '@symbiote-native/engine';
|
|
8
8
|
import { DefaultEventPriority, DiscreteEventPriority, NoEventPriority, } from './reconciler-constants.js';
|
|
9
9
|
import { toPublicInstance } from './host-instance.js';
|
|
10
10
|
// Intrinsic JSX type -> Fabric component name. The name table + resolver live once in
|
|
@@ -95,7 +95,8 @@ const reconciler = createReconciler({
|
|
|
95
95
|
scheduleMicrotask: queueMicrotask,
|
|
96
96
|
getRootHostContext: () => ({ isInsideText: false }),
|
|
97
97
|
getChildHostContext(parentHostContext, type) {
|
|
98
|
-
const isInsideText = descriptorFor(type).isText
|
|
98
|
+
const isInsideText = descriptorFor(type).isText ||
|
|
99
|
+
hostBehaviorFor(type)?.acceptsTextChildren === true;
|
|
99
100
|
return parentHostContext.isInsideText === isInsideText
|
|
100
101
|
? parentHostContext
|
|
101
102
|
: { isInsideText };
|
|
@@ -196,9 +197,9 @@ const reconciler = createReconciler({
|
|
|
196
197
|
currentUpdatePriority = priority;
|
|
197
198
|
},
|
|
198
199
|
getCurrentUpdatePriority: () => currentUpdatePriority,
|
|
199
|
-
resolveUpdatePriority: () => currentUpdatePriority
|
|
200
|
-
?
|
|
201
|
-
:
|
|
200
|
+
resolveUpdatePriority: () => currentUpdatePriority === NoEventPriority
|
|
201
|
+
? DefaultEventPriority
|
|
202
|
+
: currentUpdatePriority,
|
|
202
203
|
maySuspendCommit: () => false,
|
|
203
204
|
NotPendingTransition: null,
|
|
204
205
|
// react's Context IS the runtime value react-reconciler's ReactContext wants
|
package/build/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export type { ISwitchProps } from './components/switch/switch-props';
|
|
|
20
20
|
export type { ISwitchTrackColor, ISwitchChangeEvent, } from '@symbiote-native/components';
|
|
21
21
|
export type { IActivityIndicatorProps } from './components/activity-indicator-props';
|
|
22
22
|
export type { ISafeAreaViewProps } from './components/safe-area-view-props';
|
|
23
|
+
export type { ILayoutConformanceProps } from './components/layout-conformance-props';
|
|
24
|
+
export type { ILayoutConformanceMode } from '@symbiote-native/components';
|
|
23
25
|
export type { IRefreshControlProps } from './components/refresh-control-props';
|
|
24
26
|
export { Modal } from './components/modal';
|
|
25
27
|
export type { IModalProps, IModalAnimationType, IModalPresentationStyle, IModalOrientation, } from './components/modal';
|
|
@@ -35,7 +37,9 @@ export type { ISectionListProps, ISectionListHandle, ISection, } from './compone
|
|
|
35
37
|
export { VirtualizedSectionList } from './components/virtualized-section-list';
|
|
36
38
|
export type { IVirtualizedSectionListProps, IVirtualizedSectionListHandle, } from './components/virtualized-section-list';
|
|
37
39
|
export { VirtualizedList } from './components/virtualized-list';
|
|
38
|
-
export
|
|
40
|
+
export { useVirtualizedListScope } from './components/virtualized-list/nested-scope';
|
|
41
|
+
export type { IListScope } from '@symbiote-native/components';
|
|
42
|
+
export type { ICellRendererComponent, ICellRendererProps, IVirtualizedListProps, IVirtualizedListHandle, IViewToken, IViewableItemsChangedInfo, IViewabilityConfig, IViewabilityConfigCallbackPair, } from './components/virtualized-list';
|
|
39
43
|
export type { IViewStyle, ITextStyle, IFlexAlign, IFlexJustify, } from './utils/styles';
|
|
40
44
|
export { mount, unmount } from './render';
|
|
41
45
|
export { createPortal, type IPortalContainer } from './create-portal';
|
|
@@ -44,20 +48,26 @@ export { descriptorToReact } from './descriptor-to-react';
|
|
|
44
48
|
export { descriptorToReactWithChildren } from './descriptor-to-react/with-children';
|
|
45
49
|
export { findNodeHandle } from './host-instance';
|
|
46
50
|
export type { IHostInstance } from './host-instance';
|
|
47
|
-
export { AppRegistry, setHostRegistrar } from './modules/app-registry';
|
|
48
|
-
export type { IComponentProvider, IAppParameters, IRunnable, IHostRegistrar, IWrapperComponentProvider, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from './modules/app-registry';
|
|
51
|
+
export { AppRegistry, HeadlessJsTaskError, setHostRegistrar, } from './modules/app-registry';
|
|
52
|
+
export type { IComponentProvider, IAppConfig, IAppParameters, IRunnable, IHostRegistrar, IWrapperComponentProvider, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from './modules/app-registry';
|
|
49
53
|
export { Animated, createAnimatedComponent } from './modules/animated';
|
|
50
54
|
export { Platform, StyleSheet } from '@symbiote-native/engine';
|
|
51
55
|
export { PlatformColor, DynamicColorIOS, processColor, } from '@symbiote-native/engine';
|
|
52
56
|
export type { IColorValue, IOpaqueColorValue, IDynamicColorIOSTuple, } from '@symbiote-native/engine';
|
|
53
|
-
export { setNativeViewConfigSource, setColorProcessor,
|
|
57
|
+
export { setNativeViewConfigSource, setColorProcessor, } from '@symbiote-native/engine';
|
|
54
58
|
export { dlog, isDebug } from '@symbiote-native/engine';
|
|
55
59
|
export type { INativeViewConfig, INativeViewConfigSource, } from '@symbiote-native/engine';
|
|
56
60
|
export type { IPlatformStatic, IPlatformOSType, IPlatformConstantsIOS, IPlatformConstantsAndroid, IPlatformSelectSpec, } from '@symbiote-native/engine';
|
|
57
|
-
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, LayoutAnimation, PixelRatio, } from '@symbiote-native/engine';
|
|
61
|
+
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, matchMedia, MediaQueryList, MediaQueryListEvent, setVariable, getComputedVariable, registerProperty, AppState, Keyboard, KEYBOARD_EVENT, TextInputState, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, LayoutAnimation, PixelRatio, } from '@symbiote-native/engine';
|
|
58
62
|
export type { IAlertType, IAlertButtonStyle, IAlertButton, IAlertButtons, IAlertOptions, IShareContent, IShareOptions, IShareAction, IActionSheetIOSOptions, IShareActionSheetIOSOptions, IShareActionSheetError, IUrlEvent, II18nManagerConstants, IDisplayMetrics, IDisplayMetricsAndroid, IDimensionsPayload, IDimensionsSet, IDimensionsKey, IDimensionsChangeListener, IDimensionsStatic, IColorSchemeName, IColorSchemePreference, IAppStateStatus, IAppStateEvent, IKeyboardEventName, IKeyboardEvent, IKeyboardMetrics, IBackPressEventName, IBackPressHandler, IPermission, IPermissionStatus, IRationale, ILayoutAnimationType, ILayoutAnimationProperty, ILayoutAnimationConfig, ILayoutAnimationAnim, IPixelRatioStatic, } from '@symbiote-native/engine';
|
|
59
63
|
export { useWindowDimensions } from './hooks/use-window-dimensions';
|
|
60
64
|
export { useColorScheme } from './hooks/use-color-scheme';
|
|
65
|
+
export { RootTagContext } from './root-tag-context';
|
|
66
|
+
export { unstable_batchedUpdates } from './batched-updates';
|
|
67
|
+
export { unstable_NativeText, unstable_NativeView } from './native-host-tags';
|
|
68
|
+
export { usePressability } from './hooks/use-pressability';
|
|
69
|
+
export type { IPressabilityConfig } from './hooks/use-pressability';
|
|
70
|
+
export { useAnimatedColor, useAnimatedValue, useAnimatedValueXY, } from './hooks/use-animated-value';
|
|
61
71
|
export { createPermissionHook } from './hooks/create-permission-hook';
|
|
62
72
|
export { createResourceHook } from './hooks/create-resource-hook';
|
|
63
73
|
export { useNativeViewController } from './hooks/use-native-view-controller';
|
|
@@ -74,3 +84,7 @@ export type { INativeFeedbackBackground, IThemeAttrBackground, IRippleBackground
|
|
|
74
84
|
export type { ITouchableNativeFeedbackProps } from './components/touchable-native-feedback/touchable-native-feedback-props';
|
|
75
85
|
export type { ISymbioteEvent, ISymbioteNode, IRootTag, } from '@symbiote-native/engine';
|
|
76
86
|
export type { ICellLayout, ISeparatorProps, ISeparators, IModalOrientationChangeEvent, IPressableAndroidRippleConfig, IEnterKeyHint, IInputMode, ISubmitBehavior, ITextInputSelection, IImageStatics, } from '@symbiote-native/components';
|
|
87
|
+
export { DeviceEventEmitter, Easing, EventEmitter, NativeAppEventEmitter, NativeEventEmitter, } from '@symbiote-native/engine';
|
|
88
|
+
export type { IEasing, IEasingFunction, IEmitterSubscription, IEventEmitter, IEventEmitterModule, IEventSubscription, INativeEventListener, } from '@symbiote-native/engine';
|
|
89
|
+
export { codegenNativeCommands, codegenNativeComponent, DevMenu, DevSettings, LogBox, NativeComponentRegistry, NativeModules, Networking, PushNotificationIOS, ReactNativeVersion, registerCallableModule, requireNativeComponent, Systrace, Touchable, TurboModuleRegistry, UIManager, UTFSequence, } from '@symbiote-native/engine';
|
|
90
|
+
export type { IDevSettings } from '@symbiote-native/engine';
|
package/build/index.js
CHANGED
|
@@ -18,15 +18,13 @@ export { FlatList } from './components/flat-list/index.js';
|
|
|
18
18
|
export { SectionList } from './components/section-list/index.js';
|
|
19
19
|
export { VirtualizedSectionList } from './components/virtualized-section-list/index.js';
|
|
20
20
|
export { VirtualizedList } from './components/virtualized-list/index.js';
|
|
21
|
+
export { useVirtualizedListScope } from './components/virtualized-list/nested-scope.js';
|
|
21
22
|
export { mount, unmount } from './render.js';
|
|
22
|
-
// createPortal
|
|
23
|
-
//
|
|
24
|
-
// see create-portal.ts). v1 scope: target must be an already-mounted node in the SAME surface.
|
|
23
|
+
// `createPortal` needs mutation mode, stock RN's persistent-mode renderer has no portal
|
|
24
|
+
// The target must be a mounted node of the same surface, see create-portal.ts
|
|
25
25
|
export { createPortal } from './create-portal/index.js';
|
|
26
|
-
// createTunnel
|
|
27
|
-
//
|
|
28
|
-
// (see github.com/facebook/react/issues/17147), so reaching a different surface means letting
|
|
29
|
-
// that surface commit its own content by reading from a shared store instead.
|
|
26
|
+
// `createTunnel` shares content across surfaces, since a React portal cannot reach another root
|
|
27
|
+
// (github.com/facebook/react/issues/17147) and the other surface reads a shared store instead
|
|
30
28
|
export { createTunnel } from './create-tunnel/index.js';
|
|
31
29
|
// descriptorToReact: the @symbiote-native/components Descriptor → React.createElement bridge. Exported so
|
|
32
30
|
// an external wrapper package (e.g. @symbiote-native/slider/react over a third-party native view) can map
|
|
@@ -36,7 +34,7 @@ export { descriptorToReactWithChildren } from './descriptor-to-react/with-childr
|
|
|
36
34
|
export { findNodeHandle } from './host-instance.js';
|
|
37
35
|
// AppRegistry: RN's app entry point over `mount`. setHostRegistrar wires RN's own
|
|
38
36
|
// registrar so the native Fabric host finds our runnable by app key.
|
|
39
|
-
export { AppRegistry, setHostRegistrar } from './modules/app-registry/index.js';
|
|
37
|
+
export { AppRegistry, HeadlessJsTaskError, setHostRegistrar, } from './modules/app-registry/index.js';
|
|
40
38
|
// Animated bridge: createAnimatedComponent + Animated.View/Text/Image, driving the
|
|
41
39
|
// shared JS Animated engine. Imperative timing/spring drivers merge into this
|
|
42
40
|
// namespace once they land in shared.
|
|
@@ -48,21 +46,24 @@ export { Platform, StyleSheet } from '@symbiote-native/engine';
|
|
|
48
46
|
// processColor runs a color through the injected platform processor. All pure /
|
|
49
47
|
// seam-backed, so they live in shared and the adapter re-exports them.
|
|
50
48
|
export { PlatformColor, DynamicColorIOS, processColor, } from '@symbiote-native/engine';
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
// setNativeViewConfigSource(name => ReactNativeViewConfigRegistry.get(name))
|
|
55
|
-
export { setNativeViewConfigSource, setColorProcessor, setDeviceEventSource, } from '@symbiote-native/engine';
|
|
49
|
+
// Seams wired once on a real host: `setNativeViewConfigSource` derives third-party view configs
|
|
50
|
+
// `setNativeViewConfigSource(name => ReactNativeViewConfigRegistry.get(name))`
|
|
51
|
+
export { setNativeViewConfigSource, setColorProcessor, } from '@symbiote-native/engine';
|
|
56
52
|
// Diagnostics, gated by DEBUG (<keep_logs_gate_behind_DEBUG>): app code logs through the same
|
|
57
53
|
// seam the engine does instead of a bare console.log.
|
|
58
54
|
export { dlog, isDebug } from '@symbiote-native/engine';
|
|
59
55
|
// Imperative runtime modules: the SAME module every adapter shares, re-exported straight from
|
|
60
56
|
// @symbiote-native/engine so app code names only @symbiote-native/react (RN's single import
|
|
61
57
|
// root). Thin JS over getNativeModule + device events, no Fabric component of their own.
|
|
62
|
-
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, LayoutAnimation, PixelRatio, } from '@symbiote-native/engine';
|
|
58
|
+
export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, matchMedia, MediaQueryList, MediaQueryListEvent, setVariable, getComputedVariable, registerProperty, AppState, Keyboard, KEYBOARD_EVENT, TextInputState, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, LayoutAnimation, PixelRatio, } from '@symbiote-native/engine';
|
|
63
59
|
// React lifecycle over those core device-state modules.
|
|
64
60
|
export { useWindowDimensions } from './hooks/use-window-dimensions.js';
|
|
65
61
|
export { useColorScheme } from './hooks/use-color-scheme.js';
|
|
62
|
+
export { RootTagContext } from './root-tag-context.js';
|
|
63
|
+
export { unstable_batchedUpdates } from './batched-updates.js';
|
|
64
|
+
export { unstable_NativeText, unstable_NativeView } from './native-host-tags.js';
|
|
65
|
+
export { usePressability } from './hooks/use-pressability.js';
|
|
66
|
+
export { useAnimatedColor, useAnimatedValue, useAnimatedValueXY, } from './hooks/use-animated-value.js';
|
|
66
67
|
export { createPermissionHook } from './hooks/create-permission-hook.js';
|
|
67
68
|
export { createResourceHook } from './hooks/create-resource-hook.js';
|
|
68
69
|
export { useNativeViewController } from './hooks/use-native-view-controller.js';
|
|
@@ -81,3 +82,8 @@ export { InteractionManager } from '@symbiote-native/engine';
|
|
|
81
82
|
// `<touchable-native-feedback>`, which commits no node of its own and clones onto its single child.
|
|
82
83
|
// `TouchableNativeFeedback.Ripple(…)` / `.SelectableBackground(…)` are unchanged.
|
|
83
84
|
export { TouchableNativeFeedback } from '@symbiote-native/components';
|
|
85
|
+
// The device event bus and the easing curves, shared verbatim from the engine
|
|
86
|
+
export { DeviceEventEmitter, Easing, EventEmitter, NativeAppEventEmitter, NativeEventEmitter, } from '@symbiote-native/engine';
|
|
87
|
+
// RN's dev and native-module utilities, shared verbatim from the engine. The ones RN owns forward
|
|
88
|
+
// to its own module, which `registerApp` hands over
|
|
89
|
+
export { codegenNativeCommands, codegenNativeComponent, DevMenu, DevSettings, LogBox, NativeComponentRegistry, NativeModules, Networking, PushNotificationIOS, ReactNativeVersion, registerCallableModule, requireNativeComponent, Systrace, Touchable, TurboModuleRegistry, UIManager, UTFSequence, } from '@symbiote-native/engine';
|
package/build/jsx-runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ICrossTypedIntrinsics } from '@symbiote-native/components';
|
|
2
|
-
import type { Key } from 'react';
|
|
2
|
+
import type { JSX as ReactJsx, Key } from 'react';
|
|
3
3
|
import type { IViewProps, ITextProps } from './components';
|
|
4
4
|
import type { IPressableProps } from './components/pressable/pressable-props';
|
|
5
5
|
import type { IButtonProps } from './components/button-props';
|
|
@@ -18,12 +18,12 @@ import type { ITextInputProps } from './components/text-input/text-input-props';
|
|
|
18
18
|
import type { IModalProps } from './components/modal';
|
|
19
19
|
import type { IActivityIndicatorProps } from './components/activity-indicator-props';
|
|
20
20
|
export { Fragment, jsx, jsxs } from 'react/jsx-runtime';
|
|
21
|
-
|
|
21
|
+
type IHostProps = {
|
|
22
22
|
style?: unknown;
|
|
23
23
|
children?: import('react').ReactNode;
|
|
24
24
|
[key: string]: unknown;
|
|
25
|
-
}
|
|
26
|
-
export
|
|
25
|
+
};
|
|
26
|
+
export type ICrossedPrimitiveProps = {
|
|
27
27
|
view: IViewProps;
|
|
28
28
|
text: ITextProps;
|
|
29
29
|
pressable: IPressableProps;
|
|
@@ -43,22 +43,21 @@ export interface ICrossedPrimitiveProps {
|
|
|
43
43
|
'text-input': ITextInputProps;
|
|
44
44
|
modal: IModalProps;
|
|
45
45
|
'activity-indicator': IActivityIndicatorProps;
|
|
46
|
-
}
|
|
46
|
+
};
|
|
47
47
|
type IWithKey<Props> = Props & {
|
|
48
48
|
key?: Key | null;
|
|
49
49
|
};
|
|
50
50
|
export declare namespace JSX {
|
|
51
|
-
type ElementType =
|
|
52
|
-
type Element =
|
|
53
|
-
type ElementClass =
|
|
54
|
-
type ElementAttributesProperty =
|
|
55
|
-
type ElementChildrenAttribute =
|
|
56
|
-
type LibraryManagedAttributes<C, P> =
|
|
57
|
-
type IntrinsicAttributes =
|
|
58
|
-
type IntrinsicClassAttributes<T> =
|
|
59
|
-
|
|
51
|
+
type ElementType = ReactJsx.ElementType;
|
|
52
|
+
type Element = ReactJsx.Element;
|
|
53
|
+
type ElementClass = ReactJsx.ElementClass;
|
|
54
|
+
type ElementAttributesProperty = ReactJsx.ElementAttributesProperty;
|
|
55
|
+
type ElementChildrenAttribute = ReactJsx.ElementChildrenAttribute;
|
|
56
|
+
type LibraryManagedAttributes<C, P> = ReactJsx.LibraryManagedAttributes<C, P>;
|
|
57
|
+
type IntrinsicAttributes = ReactJsx.IntrinsicAttributes;
|
|
58
|
+
type IntrinsicClassAttributes<T> = ReactJsx.IntrinsicClassAttributes<T>;
|
|
59
|
+
type IntrinsicElements = ICrossTypedIntrinsics<IHostProps, {
|
|
60
60
|
[K in keyof ICrossedPrimitiveProps]: IWithKey<ICrossedPrimitiveProps[K]>;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
61
|
+
}>;
|
|
63
62
|
}
|
|
64
63
|
export type ISymbioteIntrinsicTag = keyof JSX.IntrinsicElements;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentType, type Ref } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type IAnimatedComponentProps = {
|
|
3
3
|
style?: unknown;
|
|
4
4
|
ref?: Ref<unknown>;
|
|
5
5
|
[key: string]: unknown;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
type IAnimatableProps = {
|
|
8
8
|
style?: unknown;
|
|
9
9
|
children?: unknown;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// and detaches on unmount / when the leaf identity changes. The per-frame path is
|
|
14
14
|
// then: value.setValue / animation -> flushValue -> AnimatedProps.update() ->
|
|
15
15
|
// setNativeProps(node, partial).
|
|
16
|
-
import { createElement, useEffect, useRef, } from 'react';
|
|
16
|
+
import { createElement, useCallback, useEffect, useRef, } from 'react';
|
|
17
17
|
import { createAnimatedLeafLifecycle, isSymbioteNode, isNativeAnimatedAvailable, reduceProps, readPassthroughStyle, resolveHostNode, } from '@symbiote-native/engine';
|
|
18
18
|
// A ref can be a function or a `.current` object; assign through both forms without
|
|
19
19
|
// casting so a forwarded ref from the caller still receives the instance. Framework-
|
|
@@ -39,41 +39,29 @@ export function createAnimatedComponent(Component) {
|
|
|
39
39
|
// Native driving is opt-in per the passthrough prop AND requires a real native module;
|
|
40
40
|
// headless / unsupported hosts keep the JS flush path (and the existing JS smokes green).
|
|
41
41
|
const wantsNative = passthrough != null && isNativeAnimatedAvailable();
|
|
42
|
-
//
|
|
43
|
-
// rebuild-vs-skip decision - is the engine's, shared by every adapter
|
|
44
|
-
// (core/engine/src/animated/leaf-lifecycle.ts). React owns only WHEN to run it.
|
|
45
|
-
//
|
|
46
|
-
// This used to be `useMemo(() => new AnimatedProps(rest), [rest])`, which reads like the same
|
|
47
|
-
// guard but never was one: `rest` comes out of a rest-destructure, so it is a fresh object on
|
|
48
|
-
// every render and the memo's dependency always differed. The real content check now lives in
|
|
49
|
-
// the shared lifecycle.
|
|
42
|
+
// Жизненный цикл листа общий для адаптеров (`leaf-lifecycle.ts`), React решает лишь когда
|
|
50
43
|
const lifecycleRef = useRef(null);
|
|
51
44
|
lifecycleRef.current ??= createAnimatedLeafLifecycle('react');
|
|
52
45
|
const lifecycle = lifecycleRef.current;
|
|
53
46
|
// The committed host node, captured by the ref below - a native event binds to the node's
|
|
54
47
|
// tag, not the AnimatedProps leaf.
|
|
55
48
|
const nodeRef = useRef(null);
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
// rebuild-vs-skip decision is the lifecycle's, and it compares CONTENT by key identity.
|
|
49
|
+
// `rest` пересобирается каждым рендером, поэтому эффект идёт после каждого коммита,
|
|
50
|
+
// а пересобирать ли лист, решает жизненный цикл по содержимому
|
|
59
51
|
useEffect(() => {
|
|
60
52
|
lifecycle.reconcile(rest, isSymbioteNode(nodeRef.current) ? nodeRef.current : null, wantsNative);
|
|
61
|
-
});
|
|
53
|
+
}, [lifecycle, rest, wantsNative]);
|
|
62
54
|
// Final teardown: detach the last-attached leaf and any native event bindings on unmount.
|
|
63
55
|
useEffect(() => {
|
|
64
56
|
return () => lifecycle.teardown();
|
|
65
57
|
}, [lifecycle]);
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
// instance to the caller, who expects the component's public handle (scrollTo, …).
|
|
70
|
-
const captureRef = (instance) => {
|
|
58
|
+
// Стабильный ref, как у RN: пока `ref` приложения тот же, он не отцепляется и не цепляется
|
|
59
|
+
// заново на каждый рендер. Приложению уходит исходный instance, а узлу для привязки - host node
|
|
60
|
+
const captureRef = useCallback((instance) => {
|
|
71
61
|
nodeRef.current = resolveHostNode(instance);
|
|
72
62
|
assignRef(forwardedRef, instance);
|
|
73
|
-
};
|
|
74
|
-
//
|
|
75
|
-
// capture ref. Build via Object.assign so the merged object stays typed as P & ref
|
|
76
|
-
// without a cast. createElement then accepts it for the generic base component.
|
|
63
|
+
}, [forwardedRef]);
|
|
64
|
+
// Object.assign держит тип P & ref без приведения, `createElement` принимает его для базы
|
|
77
65
|
const reduced = reduceProps(rest);
|
|
78
66
|
// Override the committed style with the explicit passthrough values (last wins via the style
|
|
79
67
|
// array, which the commit layer flattens) so the ShadowTree carries the current transform.
|
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
import { AnimatedValue, AnimatedValueXY, AnimatedColor, timing, spring, decay, parallel, sequence, stagger, loop, delay, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent } from '@symbiote-native/engine';
|
|
2
1
|
import { createAnimatedComponent } from './create-animated-component';
|
|
3
2
|
export { createAnimatedComponent } from './create-animated-component';
|
|
4
3
|
export { AnimatedProps, AnimatedStyle, AnimatedTransform, } from '@symbiote-native/engine';
|
|
5
4
|
export declare const Animated: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
timing: {
|
|
6
|
+
(value: import("@symbiote-native/engine").AnimatedValue, config: import("@symbiote-native/engine").ITimingConfig): import("@symbiote-native/engine").ICompositeAnimation;
|
|
7
|
+
(value: import("@symbiote-native/engine").IVectorValue, config: import("@symbiote-native/engine").IVectorTimingConfig): import("@symbiote-native/engine").ICompositeAnimation;
|
|
8
|
+
};
|
|
9
|
+
spring: {
|
|
10
|
+
(value: import("@symbiote-native/engine").AnimatedValue, config: import("@symbiote-native/engine").ISpringConfig): import("@symbiote-native/engine").ICompositeAnimation;
|
|
11
|
+
(value: import("@symbiote-native/engine").IVectorValue, config: import("@symbiote-native/engine").IVectorSpringConfig): import("@symbiote-native/engine").ICompositeAnimation;
|
|
12
|
+
};
|
|
13
|
+
decay: (_value: import("@symbiote-native/engine").AnimatedValue, _config: import("@symbiote-native/engine").IDecayConfig) => import("@symbiote-native/engine").ICompositeAnimation;
|
|
14
|
+
parallel: (animations: import("@symbiote-native/engine").ICompositeAnimation[], _config?: import("@symbiote-native/engine").IParallelConfig) => import("@symbiote-native/engine").ICompositeAnimation;
|
|
15
|
+
sequence: (animations: import("@symbiote-native/engine").ICompositeAnimation[]) => import("@symbiote-native/engine").ICompositeAnimation;
|
|
16
|
+
stagger: (_time: number, animations: import("@symbiote-native/engine").ICompositeAnimation[]) => import("@symbiote-native/engine").ICompositeAnimation;
|
|
17
|
+
loop: (_animation: import("@symbiote-native/engine").ICompositeAnimation) => import("@symbiote-native/engine").ICompositeAnimation;
|
|
18
|
+
delay: (_time: number) => import("@symbiote-native/engine").ICompositeAnimation;
|
|
19
|
+
Value: typeof import("@symbiote-native/engine").AnimatedValue;
|
|
20
|
+
ValueXY: typeof import("@symbiote-native/engine").AnimatedValueXY;
|
|
21
|
+
Color: typeof import("@symbiote-native/engine").AnimatedColor;
|
|
22
|
+
Interpolation: typeof import("@symbiote-native/engine").AnimatedInterpolation;
|
|
23
|
+
Node: typeof import("@symbiote-native/engine").AnimatedNode;
|
|
9
24
|
Easing: import("@symbiote-native/engine").IEasing;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
divide: typeof divide;
|
|
22
|
-
modulo: typeof modulo;
|
|
23
|
-
diffClamp: typeof diffClamp;
|
|
24
|
-
event: typeof event;
|
|
25
|
-
forkEvent: typeof forkEvent;
|
|
26
|
-
unforkEvent: typeof unforkEvent;
|
|
25
|
+
add: typeof import("@symbiote-native/engine").add;
|
|
26
|
+
subtract: typeof import("@symbiote-native/engine").subtract;
|
|
27
|
+
multiply: typeof import("@symbiote-native/engine").multiply;
|
|
28
|
+
divide: typeof import("@symbiote-native/engine").divide;
|
|
29
|
+
modulo: typeof import("@symbiote-native/engine").modulo;
|
|
30
|
+
diffClamp: typeof import("@symbiote-native/engine").diffClamp;
|
|
31
|
+
event: typeof import("@symbiote-native/engine").event;
|
|
32
|
+
attachNativeEvent: typeof import("@symbiote-native/engine").attachNativeEvent;
|
|
33
|
+
forkEvent: typeof import("@symbiote-native/engine").forkEvent;
|
|
34
|
+
unforkEvent: typeof import("@symbiote-native/engine").unforkEvent;
|
|
35
|
+
Event: typeof import("@symbiote-native/engine").AnimatedEvent;
|
|
27
36
|
View: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
28
37
|
Text: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
29
38
|
Image: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
@@ -31,27 +40,31 @@ export declare const Animated: {
|
|
|
31
40
|
SectionList: ReturnType<typeof createAnimatedComponent>;
|
|
32
41
|
createAnimatedComponent: typeof createAnimatedComponent;
|
|
33
42
|
} | {
|
|
34
|
-
Value: typeof AnimatedValue;
|
|
35
|
-
ValueXY: typeof AnimatedValueXY;
|
|
36
|
-
Color: typeof AnimatedColor;
|
|
43
|
+
Value: typeof import("@symbiote-native/engine").AnimatedValue;
|
|
44
|
+
ValueXY: typeof import("@symbiote-native/engine").AnimatedValueXY;
|
|
45
|
+
Color: typeof import("@symbiote-native/engine").AnimatedColor;
|
|
46
|
+
Interpolation: typeof import("@symbiote-native/engine").AnimatedInterpolation;
|
|
47
|
+
Node: typeof import("@symbiote-native/engine").AnimatedNode;
|
|
37
48
|
Easing: import("@symbiote-native/engine").IEasing;
|
|
38
|
-
timing:
|
|
39
|
-
spring:
|
|
40
|
-
decay:
|
|
41
|
-
parallel:
|
|
42
|
-
sequence:
|
|
43
|
-
stagger:
|
|
44
|
-
loop:
|
|
45
|
-
delay:
|
|
46
|
-
add: typeof add;
|
|
47
|
-
subtract: typeof subtract;
|
|
48
|
-
multiply: typeof multiply;
|
|
49
|
-
divide: typeof divide;
|
|
50
|
-
modulo: typeof modulo;
|
|
51
|
-
diffClamp: typeof diffClamp;
|
|
52
|
-
event: typeof event;
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
timing: typeof import("@symbiote-native/engine").timing;
|
|
50
|
+
spring: typeof import("@symbiote-native/engine").spring;
|
|
51
|
+
decay: typeof import("@symbiote-native/engine").decay;
|
|
52
|
+
parallel: typeof import("@symbiote-native/engine").parallel;
|
|
53
|
+
sequence: typeof import("@symbiote-native/engine").sequence;
|
|
54
|
+
stagger: typeof import("@symbiote-native/engine").stagger;
|
|
55
|
+
loop: typeof import("@symbiote-native/engine").loop;
|
|
56
|
+
delay: typeof import("@symbiote-native/engine").delay;
|
|
57
|
+
add: typeof import("@symbiote-native/engine").add;
|
|
58
|
+
subtract: typeof import("@symbiote-native/engine").subtract;
|
|
59
|
+
multiply: typeof import("@symbiote-native/engine").multiply;
|
|
60
|
+
divide: typeof import("@symbiote-native/engine").divide;
|
|
61
|
+
modulo: typeof import("@symbiote-native/engine").modulo;
|
|
62
|
+
diffClamp: typeof import("@symbiote-native/engine").diffClamp;
|
|
63
|
+
event: typeof import("@symbiote-native/engine").event;
|
|
64
|
+
attachNativeEvent: typeof import("@symbiote-native/engine").attachNativeEvent;
|
|
65
|
+
forkEvent: typeof import("@symbiote-native/engine").forkEvent;
|
|
66
|
+
unforkEvent: typeof import("@symbiote-native/engine").unforkEvent;
|
|
67
|
+
Event: typeof import("@symbiote-native/engine").AnimatedEvent;
|
|
55
68
|
View: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
56
69
|
Text: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
57
70
|
Image: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
// easing and imperative drivers come from @symbiote-native/engine (framework-agnostic,
|
|
4
4
|
// JS-driven). Both halves meet here in one `Animated` object so the
|
|
5
5
|
// familiar surface (`Animated.timing(new Animated.Value(0), …).start()`) works.
|
|
6
|
-
import {
|
|
6
|
+
import { AnimatedDrivers, AnimatedMock, Platform, } from '@symbiote-native/engine';
|
|
7
7
|
import { FlatList } from '../../components/flat-list/index.js';
|
|
8
8
|
import { SectionList } from '../../components/section-list/index.js';
|
|
9
9
|
import { createAnimatedComponent } from './create-animated-component.js';
|
|
10
|
-
import { AnimatedMock } from '@symbiote-native/engine';
|
|
11
10
|
export { createAnimatedComponent } from './create-animated-component.js';
|
|
12
11
|
// The pure graph leaves now live in @symbiote-native/engine (they extend AnimatedWithChildren,
|
|
13
12
|
// no React); re-exported here so @symbiote-native/react's Animated surface is unchanged.
|
|
@@ -30,37 +29,13 @@ const AnimatedImage = createAnimatedComponent('image');
|
|
|
30
29
|
// own `get FlatList() { return require(...) }`.
|
|
31
30
|
let animatedFlatList;
|
|
32
31
|
let animatedSectionList;
|
|
33
|
-
// The live, JS-driven driver namespace (real frames). RN's AnimatedImplementation.
|
|
34
|
-
const liveDrivers = {
|
|
35
|
-
Value: AnimatedValue,
|
|
36
|
-
ValueXY: AnimatedValueXY,
|
|
37
|
-
Color: AnimatedColor,
|
|
38
|
-
Easing,
|
|
39
|
-
timing,
|
|
40
|
-
spring,
|
|
41
|
-
decay,
|
|
42
|
-
parallel,
|
|
43
|
-
sequence,
|
|
44
|
-
stagger,
|
|
45
|
-
loop,
|
|
46
|
-
delay,
|
|
47
|
-
add,
|
|
48
|
-
subtract,
|
|
49
|
-
multiply,
|
|
50
|
-
divide,
|
|
51
|
-
modulo,
|
|
52
|
-
diffClamp,
|
|
53
|
-
event,
|
|
54
|
-
forkEvent,
|
|
55
|
-
unforkEvent,
|
|
56
|
-
};
|
|
57
32
|
// RN's AnimatedExports.js:21 swaps the WHOLE namespace for the mock when the host
|
|
58
33
|
// reports isDisableAnimations (reduced motion / test env): the mock keeps the same
|
|
59
34
|
// surface but jumps each animation to its final value synchronously, no frames.
|
|
60
35
|
// The animated COMPONENTS (View/Text/Image + the lazy container getters) are live in
|
|
61
36
|
// both branches; only the drivers/value/operators/events half is swapped, exactly
|
|
62
37
|
// like RN spreading `...Animated` (impl or mock) over the same component getters.
|
|
63
|
-
const drivers = Platform.isDisableAnimations ? AnimatedMock :
|
|
38
|
+
const drivers = Platform.isDisableAnimations ? AnimatedMock : AnimatedDrivers;
|
|
64
39
|
export const Animated = {
|
|
65
40
|
View: AnimatedView,
|
|
66
41
|
Text: AnimatedText,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ComponentType } from 'react';
|
|
2
|
-
import { type IAppParameters } from '@symbiote-native/engine';
|
|
2
|
+
import { HeadlessJsTaskError, type IAppParameters } from '@symbiote-native/engine';
|
|
3
3
|
export type IComponentProvider = () => ComponentType<object>;
|
|
4
4
|
export type IWrapperComponentProvider = (appParameters: IAppParameters) => ComponentType<object>;
|
|
5
5
|
declare const AppRegistry: import("@symbiote-native/engine").IAppRegistry<IComponentProvider, IWrapperComponentProvider>, setHostRegistrar: (registrar: import("@symbiote-native/engine").IHostRegistrar) => void;
|
|
6
|
-
export { AppRegistry, setHostRegistrar };
|
|
7
|
-
export type { IAppParameters, IRunnable, IHostRegistrar, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from '@symbiote-native/engine';
|
|
6
|
+
export { AppRegistry, HeadlessJsTaskError, setHostRegistrar };
|
|
7
|
+
export type { IAppConfig, IAppParameters, IRunnable, IHostRegistrar, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from '@symbiote-native/engine';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// only the one React-specific seam — building a runnable from a component provider via
|
|
6
6
|
// createElement + mount — so existing RN app-entry code ports verbatim.
|
|
7
7
|
import { createElement } from 'react';
|
|
8
|
-
import { createAppRegistry, dlog, } from '@symbiote-native/engine';
|
|
8
|
+
import { createAppRegistry, dlog, HeadlessJsTaskError, } from '@symbiote-native/engine';
|
|
9
9
|
import { mount } from '../../render.js';
|
|
10
10
|
function runnableFor(componentProvider, getWrapperComponentProvider) {
|
|
11
11
|
return appParameters => {
|
|
@@ -23,4 +23,4 @@ function runnableFor(componentProvider, getWrapperComponentProvider) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
const { AppRegistry, setHostRegistrar } = createAppRegistry(runnableFor);
|
|
26
|
-
export { AppRegistry, setHostRegistrar };
|
|
26
|
+
export { AppRegistry, HeadlessJsTaskError, setHostRegistrar };
|
|
@@ -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>;
|