@symbiote-native/react 1.0.0 → 2.0.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/README.md +12 -11
- package/build/components/activity-indicator-props.d.ts +4 -0
- package/build/components/{button.d.ts → button-props.d.ts} +0 -2
- package/build/components/button-props.js +1 -0
- package/build/components/flat-list/index.js +2 -2
- package/build/components/image/image-props.d.ts +4 -0
- package/build/components/image/image-props.js +1 -0
- package/build/components/image-background-props.d.ts +9 -0
- package/build/components/image-background-props.js +1 -0
- package/build/components/input-accessory-view-props.d.ts +10 -0
- package/build/components/input-accessory-view-props.js +1 -0
- package/build/components/keyboard-avoiding-view/index.js +4 -4
- package/build/components/modal/index.js +3 -3
- package/build/components/pressable/{index.d.ts → pressable-props.d.ts} +4 -5
- package/build/components/pressable/pressable-props.js +1 -0
- package/build/components/{refresh-control/index.d.ts → refresh-control-props.d.ts} +3 -3
- package/build/components/refresh-control-props.js +1 -0
- package/build/components/safe-area-view-props.d.ts +11 -0
- package/build/components/safe-area-view-props.js +1 -0
- package/build/components/scroll-view/{shared.d.ts → scroll-view-props.d.ts} +4 -26
- package/build/components/scroll-view/scroll-view-props.js +1 -0
- package/build/components/switch/switch-props.d.ts +4 -0
- package/build/components/switch/switch-props.js +1 -0
- package/build/components/text-input/text-input-props.d.ts +4 -0
- package/build/components/text-input/text-input-props.js +1 -0
- package/build/components/touchable/touchable-props.d.ts +17 -0
- package/build/components/touchable/touchable-props.js +1 -0
- package/build/components/touchable-native-feedback/touchable-native-feedback-props.d.ts +8 -0
- package/build/components/touchable-native-feedback/touchable-native-feedback-props.js +1 -0
- package/build/components/touchable-without-feedback/touchable-without-feedback-props.d.ts +6 -0
- package/build/components/touchable-without-feedback/touchable-without-feedback-props.js +1 -0
- package/build/components/virtualized-list/index.js +83 -38
- package/build/components.d.ts +1 -2
- package/build/components.js +5 -19
- package/build/create-portal/index.js +1 -1
- package/build/create-tunnel/index.js +1 -1
- package/build/descriptor-to-react/index.js +1 -1
- package/build/host-config.js +22 -4
- package/build/index.d.ts +23 -28
- package/build/index.js +14 -14
- package/build/jsx-dev-runtime.d.ts +3 -0
- package/build/jsx-dev-runtime.js +10 -0
- package/build/jsx-namespace.type-check.d.ts +1 -0
- package/build/jsx-namespace.type-check.js +7 -0
- package/build/jsx-runtime.d.ts +62 -0
- package/build/jsx-runtime.js +1 -0
- package/build/modules/animated/index.d.ts +0 -1
- package/build/modules/animated/index.js +16 -22
- package/build/modules/image/index.d.ts +3 -0
- package/build/modules/image/index.js +14 -0
- package/build/register.d.ts +1 -0
- package/build/register.js +15 -0
- package/metro-css-parser.cjs +2 -1
- package/package.json +12 -8
- package/build/components/activity-indicator/index.android.d.ts +0 -3
- package/build/components/activity-indicator/index.android.js +0 -17
- package/build/components/activity-indicator/index.d.ts +0 -1
- package/build/components/activity-indicator/index.ios.d.ts +0 -3
- package/build/components/activity-indicator/index.ios.js +0 -16
- package/build/components/activity-indicator/index.js +0 -4
- package/build/components/activity-indicator/shared.d.ts +0 -6
- package/build/components/activity-indicator/shared.js +0 -22
- package/build/components/button.js +0 -42
- package/build/components/image/index.d.ts +0 -9
- package/build/components/image/index.js +0 -28
- package/build/components/image-background/index.d.ts +0 -10
- package/build/components/image-background/index.js +0 -46
- package/build/components/input-accessory-view/index.d.ts +0 -11
- package/build/components/input-accessory-view/index.js +0 -19
- package/build/components/pressable/index.js +0 -112
- package/build/components/refresh-control/index.js +0 -21
- package/build/components/safe-area-view/index.d.ts +0 -12
- package/build/components/safe-area-view/index.js +0 -18
- package/build/components/scroll-view/index.android.d.ts +0 -3
- package/build/components/scroll-view/index.android.js +0 -61
- package/build/components/scroll-view/index.d.ts +0 -1
- package/build/components/scroll-view/index.ios.d.ts +0 -3
- package/build/components/scroll-view/index.ios.js +0 -29
- package/build/components/scroll-view/index.js +0 -4
- package/build/components/scroll-view/shared.js +0 -240
- package/build/components/scroll-view/sticky-header.d.ts +0 -18
- package/build/components/scroll-view/sticky-header.js +0 -227
- package/build/components/switch/index.android.d.ts +0 -3
- package/build/components/switch/index.android.js +0 -18
- package/build/components/switch/index.d.ts +0 -1
- package/build/components/switch/index.ios.d.ts +0 -3
- package/build/components/switch/index.ios.js +0 -16
- package/build/components/switch/index.js +0 -6
- package/build/components/switch/shared.d.ts +0 -9
- package/build/components/switch/shared.js +0 -60
- package/build/components/text-input/index.d.ts +0 -50
- package/build/components/text-input/index.js +0 -180
- package/build/components/touchable/index.d.ts +0 -22
- package/build/components/touchable/index.js +0 -165
- package/build/components/touchable-native-feedback/index.d.ts +0 -18
- package/build/components/touchable-native-feedback/index.js +0 -32
- package/build/jsx.d.ts +0 -18
- package/build/state-style.d.ts +0 -1
- package/build/state-style.js +0 -13
- /package/build/{jsx.js → components/activity-indicator-props.js} +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// Button is the minimal cross-platform button, rendered in its iOS shape per RN's Button.js: a
|
|
2
|
-
// TouchableOpacity wrapping a Text. The base text style, the role constant, and the color fold
|
|
3
|
-
// (caller color tints the label; disabled greys it) are shared in @symbiote-native/components/view; here
|
|
4
|
-
// React only composes its TouchableOpacity + Text and forwards the native-only props.
|
|
5
|
-
import { createElement } from 'react';
|
|
6
|
-
import { Text } from '../components.js';
|
|
7
|
-
import { TouchableOpacity } from './touchable/index.js';
|
|
8
|
-
import { BUTTON_ACCESSIBILITY_ROLE, resolveButtonTextStyle, } from '@symbiote-native/components';
|
|
9
|
-
export const Button = props => {
|
|
10
|
-
const { title, onPress, color, disabled, touchSoundDisabled, testID, hasTVPreferredFocus, nextFocusDown, nextFocusForward, nextFocusLeft, nextFocusRight, nextFocusUp, ...accessibilityRest } = props;
|
|
11
|
-
const textStyle = resolveButtonTextStyle(color, disabled);
|
|
12
|
-
// The pressable / native View props TouchableOpacity does not type but forwards to Fabric
|
|
13
|
-
// (testID + TV-focus). Carried as a plain record (the pass-through idiom Image uses) so
|
|
14
|
-
// excess-property typing does not reject the native-only keys. TV-focus is inert on a phone.
|
|
15
|
-
const nativeForward = { testID };
|
|
16
|
-
if (hasTVPreferredFocus !== undefined)
|
|
17
|
-
nativeForward.hasTVPreferredFocus = hasTVPreferredFocus;
|
|
18
|
-
if (nextFocusDown !== undefined)
|
|
19
|
-
nativeForward.nextFocusDown = nextFocusDown;
|
|
20
|
-
if (nextFocusForward !== undefined)
|
|
21
|
-
nativeForward.nextFocusForward = nextFocusForward;
|
|
22
|
-
if (nextFocusLeft !== undefined)
|
|
23
|
-
nativeForward.nextFocusLeft = nextFocusLeft;
|
|
24
|
-
if (nextFocusRight !== undefined)
|
|
25
|
-
nativeForward.nextFocusRight = nextFocusRight;
|
|
26
|
-
if (nextFocusUp !== undefined)
|
|
27
|
-
nativeForward.nextFocusUp = nextFocusUp;
|
|
28
|
-
// RN's Button sets role=button, is accessible, and propagates the disabled accessibility state.
|
|
29
|
-
// The caller's accessibility props pass through, but Button's fixed role / accessible /
|
|
30
|
-
// disabled-state win, applied after the spread. touchSoundDisabled maps to the pressable's
|
|
31
|
-
// android_disableSound.
|
|
32
|
-
return createElement(TouchableOpacity, {
|
|
33
|
-
...accessibilityRest,
|
|
34
|
-
...nativeForward,
|
|
35
|
-
onPress,
|
|
36
|
-
disabled,
|
|
37
|
-
android_disableSound: touchSoundDisabled,
|
|
38
|
-
accessibilityRole: BUTTON_ACCESSIBILITY_ROLE,
|
|
39
|
-
accessible: true,
|
|
40
|
-
accessibilityState: { disabled },
|
|
41
|
-
}, createElement(Text, { style: textStyle }, title));
|
|
42
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { type IImageStatics, type IImageProps as IImageBaseProps } from '@symbiote-native/components';
|
|
3
|
-
export type IImageProps = IImageBaseProps & {
|
|
4
|
-
className?: string;
|
|
5
|
-
};
|
|
6
|
-
export type IImageWithStatics = FC<IImageProps> & IImageStatics;
|
|
7
|
-
export declare const Image: IImageWithStatics;
|
|
8
|
-
export { setImageSourceResolver } from '@symbiote-native/components';
|
|
9
|
-
export type { IImageSource, IImageSourceProp, IResizeMode, IImageSize, IImageCacheStatus, } from '@symbiote-native/components';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {} from 'react';
|
|
2
|
-
import { imageStatics, renderImage, resolveAccessibilityProps, } from '@symbiote-native/components';
|
|
3
|
-
import { descriptorToReact } from '../../descriptor-to-react/index.js';
|
|
4
|
-
// renderImage takes a pre-resolved view + passthrough (the ISwitchViewProps shape), so the
|
|
5
|
-
// adapter folds aria/role and splits the typed transform fields from the forward-only rest.
|
|
6
|
-
// The W3C source aliases (src/srcSet/crossOrigin/referrerPolicy) and width/height become typed
|
|
7
|
-
// view fields (consumed by the source/style fold), so they never leak to Fabric via passthrough.
|
|
8
|
-
const ImageComponent = rawProps => {
|
|
9
|
-
const { source, defaultSource, loadingIndicatorSource, style, resizeMode, tintColor, src, srcSet, alt, width, height, crossOrigin, referrerPolicy, ...passthrough } = resolveAccessibilityProps(rawProps);
|
|
10
|
-
return descriptorToReact(renderImage({
|
|
11
|
-
source,
|
|
12
|
-
defaultSource,
|
|
13
|
-
loadingIndicatorSource,
|
|
14
|
-
style,
|
|
15
|
-
resizeMode,
|
|
16
|
-
tintColor,
|
|
17
|
-
src,
|
|
18
|
-
srcSet,
|
|
19
|
-
alt,
|
|
20
|
-
width,
|
|
21
|
-
height,
|
|
22
|
-
crossOrigin,
|
|
23
|
-
referrerPolicy,
|
|
24
|
-
passthrough,
|
|
25
|
-
}));
|
|
26
|
-
};
|
|
27
|
-
export const Image = Object.assign(ImageComponent, imageStatics);
|
|
28
|
-
export { setImageSourceResolver } from '@symbiote-native/components';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
-
import { type IImageProps } from '@symbiote-native/components';
|
|
3
|
-
import type { IStyleProp, IViewStyle } from '../../utils/styles';
|
|
4
|
-
export interface IImageBackgroundProps extends Omit<IImageProps, 'style'> {
|
|
5
|
-
style?: IStyleProp<IViewStyle>;
|
|
6
|
-
imageStyle?: IStyleProp<IViewStyle> | string;
|
|
7
|
-
className?: string;
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare function ImageBackground(props: IImageBackgroundProps): ReactElement;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// ImageBackground: the React lifecycle half. The composition (the absolute-fill Image behind
|
|
2
|
-
// the children, the dimension-proxy + style-merge math) lives framework-agnostic in
|
|
3
|
-
// @symbiote-native/components/renderImageBackground and is shared verbatim with Vue; here React only
|
|
4
|
-
// folds aria/role, splits the typed Image transform fields from the forward-only rest, bridges
|
|
5
|
-
// the Descriptor to elements, and appends the user children ON TOP of the inner image.
|
|
6
|
-
import { createElement } from 'react';
|
|
7
|
-
import { resolveClassName } from '@symbiote-native/engine';
|
|
8
|
-
import { renderImageBackground, resolveAccessibilityProps, } from '@symbiote-native/components';
|
|
9
|
-
import { descriptorToReact } from '../../descriptor-to-react/index.js';
|
|
10
|
-
function toChild(child) {
|
|
11
|
-
return typeof child === 'string' ? child : descriptorToReact(child);
|
|
12
|
-
}
|
|
13
|
-
export function ImageBackground(props) {
|
|
14
|
-
// className is pulled out here, like style, and applied to the WRAPPER element below — left
|
|
15
|
-
// in ...imageProps it would fall into `passthrough` and land on the INNER Image instead
|
|
16
|
-
// (renderImageBackground's `image.passthrough`, not the wrapper's own props).
|
|
17
|
-
const { children, style, imageStyle, className, ...imageProps } = props;
|
|
18
|
-
// imageStyle targets the INNER image (renderImageBackground's own field), unlike className
|
|
19
|
-
// above which lands on the wrapper — resolve the string here, before it flows in below.
|
|
20
|
-
const resolvedImageStyle = typeof imageStyle === 'string' ? resolveClassName(imageStyle) : imageStyle;
|
|
21
|
-
// The W3C source aliases (src/srcSet/crossOrigin/referrerPolicy) and width/height become typed
|
|
22
|
-
// Image view fields (consumed by the source/style fold), so they never leak to Fabric via
|
|
23
|
-
// passthrough; everything else (events, blurRadius, the folded accessibility*, testID) forwards.
|
|
24
|
-
const { source, defaultSource, loadingIndicatorSource, resizeMode, tintColor, src, srcSet, alt, width, height, crossOrigin, referrerPolicy, ...passthrough } = resolveAccessibilityProps(imageProps);
|
|
25
|
-
const wrapper = renderImageBackground({
|
|
26
|
-
style,
|
|
27
|
-
imageStyle: resolvedImageStyle,
|
|
28
|
-
image: {
|
|
29
|
-
source,
|
|
30
|
-
defaultSource,
|
|
31
|
-
loadingIndicatorSource,
|
|
32
|
-
resizeMode,
|
|
33
|
-
tintColor,
|
|
34
|
-
src,
|
|
35
|
-
srcSet,
|
|
36
|
-
alt,
|
|
37
|
-
width,
|
|
38
|
-
height,
|
|
39
|
-
crossOrigin,
|
|
40
|
-
referrerPolicy,
|
|
41
|
-
passthrough,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
// wrapper = symbiote-view > [imageDescriptor]; the user children paint AFTER the image (on top).
|
|
45
|
-
return createElement(wrapper.type, { key: wrapper.key, ...wrapper.props, className }, ...wrapper.children.map(toChild), children);
|
|
46
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type FC, type ReactNode } from 'react';
|
|
2
|
-
import { type IAccessibilityProps, type IAriaProps } from '@symbiote-native/components';
|
|
3
|
-
import type { IStyleProp, IViewStyle } from '../../utils/styles';
|
|
4
|
-
export interface IInputAccessoryViewProps extends IAccessibilityProps, IAriaProps {
|
|
5
|
-
nativeID?: string;
|
|
6
|
-
backgroundColor?: string;
|
|
7
|
-
style?: IStyleProp<IViewStyle>;
|
|
8
|
-
className?: string;
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export declare const InputAccessoryView: FC<IInputAccessoryViewProps>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// InputAccessoryView: the React lifecycle half (iOS). The host-node assembly (nativeID /
|
|
2
|
-
// backgroundColor / style / accessibility forwarding) lives framework-agnostic in
|
|
3
|
-
// @symbiote-native/components/renderInputAccessoryView and is shared verbatim with Vue; here React only
|
|
4
|
-
// folds aria/role, bridges the Descriptor, and nests the user children under the host.
|
|
5
|
-
import { createElement } from 'react';
|
|
6
|
-
import { renderInputAccessoryView, resolveAccessibilityProps, } from '@symbiote-native/components';
|
|
7
|
-
export const InputAccessoryView = rawProps => {
|
|
8
|
-
// Owns its host element (symbiote-input-accessory-view), so it folds aria/role here; the
|
|
9
|
-
// resolved accessibility* surface rides the node via `...passthrough`.
|
|
10
|
-
const { nativeID, backgroundColor, style, children, ...passthrough } = resolveAccessibilityProps(rawProps);
|
|
11
|
-
const host = renderInputAccessoryView({
|
|
12
|
-
nativeID,
|
|
13
|
-
backgroundColor,
|
|
14
|
-
style,
|
|
15
|
-
passthrough,
|
|
16
|
-
});
|
|
17
|
-
// host has no structural children; the user children nest directly under it.
|
|
18
|
-
return createElement(host.type, { key: host.key, ...host.props }, children);
|
|
19
|
-
};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// Pressable: the React lifecycle half. The press lifecycle (the long-press timer, unstable_press-
|
|
2
|
-
// Delay deferral, the pressRetentionOffset drift test, the suppression flags) lives in
|
|
3
|
-
// @symbiote-native/components/state as a pure machine over a runtime + host; the render decisions (the
|
|
4
|
-
// responder listeners, the disabled→accessibilityState fold, the ripple prop) in
|
|
5
|
-
// @symbiote-native/components/view. Here React owns only the lifecycle: useState for `pressed`, a ref for
|
|
6
|
-
// the runtime, a ref for the View instance (the measure handle), and a useMemo that rebuilds the
|
|
7
|
-
// handlers when the config changes. This is the React twin of the Vue adapter's setup-scope
|
|
8
|
-
// runtime + setPressed ref.
|
|
9
|
-
//
|
|
10
|
-
// Three RN interaction props that change real app feel ride on top of the shared synthesis,
|
|
11
|
-
// entirely in JS: android_ripple (an Android native-feedback prop on a dedicated inner View, inert
|
|
12
|
-
// on iOS), unstable_pressDelay, and pressRetentionOffset (the drift region), all handled by the
|
|
13
|
-
// shared machine; here we only wire its host + render the View.
|
|
14
|
-
import { createElement, useEffect, useMemo, useRef, useState, } from 'react';
|
|
15
|
-
import { createPressHandlers, createPressRuntime, disposePressRuntime, rippleProps, buildPressableListeners, resolveDisabledAccessibilityState, noteHoverNoop, DEFAULT_DELAY_LONG_PRESS_MS, DEFAULT_MIN_PRESS_DURATION_MS, } from '@symbiote-native/components';
|
|
16
|
-
import { View } from '../../components.js';
|
|
17
|
-
import { flushExternalUpdate } from '../../host-config.js';
|
|
18
|
-
function resolveStyle(style, state) {
|
|
19
|
-
if (typeof style === 'function')
|
|
20
|
-
return style(state);
|
|
21
|
-
return style;
|
|
22
|
-
}
|
|
23
|
-
function resolveChildren(children, state) {
|
|
24
|
-
if (typeof children === 'function')
|
|
25
|
-
return children(state);
|
|
26
|
-
return children;
|
|
27
|
-
}
|
|
28
|
-
const PressableImpl = props => {
|
|
29
|
-
const { onPress, onPressIn, onPressOut, onPressMove, onLongPress, delayLongPress = DEFAULT_DELAY_LONG_PRESS_MS, disabled, cancelable, hitSlop, pressRetentionOffset, unstable_pressDelay = 0, __minPressDuration = DEFAULT_MIN_PRESS_DURATION_MS, android_ripple, android_disableSound, onHoverIn, onHoverOut, delayHoverIn, delayHoverOut, accessibilityState, testID, style, children,
|
|
30
|
-
// The remaining accessibility / aria props forward to View untouched; View runs
|
|
31
|
-
// resolveAccessibilityProps, so aria/role fold there, once.
|
|
32
|
-
...accessibilityRest } = props;
|
|
33
|
-
const [pressed, setPressed] = useState(false);
|
|
34
|
-
// The mutable press runtime (timers, suppression flags, measured region), a ref so mutating it
|
|
35
|
-
// never triggers a re-render; only setPressed does.
|
|
36
|
-
const runtime = useRef(createPressRuntime()).current;
|
|
37
|
-
// The View instance, so the machine can measure its on-screen rect on responder grant.
|
|
38
|
-
const viewRef = useRef(null);
|
|
39
|
-
// The lifecycle seam the machine fills: flip pressed-state, and expose the View's raw measure.
|
|
40
|
-
const host = useMemo(() => ({
|
|
41
|
-
setPressed,
|
|
42
|
-
getMeasureFn: () => {
|
|
43
|
-
const view = viewRef.current;
|
|
44
|
-
if (view === null)
|
|
45
|
-
return undefined;
|
|
46
|
-
return callback => view.measure(callback);
|
|
47
|
-
},
|
|
48
|
-
schedule: (callback, ms) => {
|
|
49
|
-
const id = setTimeout(() => flushExternalUpdate(callback), ms);
|
|
50
|
-
return () => clearTimeout(id);
|
|
51
|
-
},
|
|
52
|
-
now: Date.now,
|
|
53
|
-
}), []);
|
|
54
|
-
// This renderer tears insertion effects down during host updates, so use the stable passive
|
|
55
|
-
// unmount seam to cancel delayed press-in, long-press and press-out callbacks.
|
|
56
|
-
useEffect(() => () => {
|
|
57
|
-
disposePressRuntime(runtime);
|
|
58
|
-
}, [runtime]);
|
|
59
|
-
const handlers = useMemo(() => createPressHandlers({
|
|
60
|
-
onPress,
|
|
61
|
-
onPressIn,
|
|
62
|
-
onPressOut,
|
|
63
|
-
onPressMove,
|
|
64
|
-
onLongPress,
|
|
65
|
-
delayLongPress,
|
|
66
|
-
unstable_pressDelay,
|
|
67
|
-
minPressDuration: __minPressDuration,
|
|
68
|
-
hitSlop,
|
|
69
|
-
pressRetentionOffset,
|
|
70
|
-
}, runtime, host), [
|
|
71
|
-
onPress,
|
|
72
|
-
onPressIn,
|
|
73
|
-
onPressOut,
|
|
74
|
-
onPressMove,
|
|
75
|
-
onLongPress,
|
|
76
|
-
delayLongPress,
|
|
77
|
-
unstable_pressDelay,
|
|
78
|
-
__minPressDuration,
|
|
79
|
-
hitSlop,
|
|
80
|
-
pressRetentionOffset,
|
|
81
|
-
runtime,
|
|
82
|
-
host,
|
|
83
|
-
]);
|
|
84
|
-
noteHoverNoop(onHoverIn, onHoverOut);
|
|
85
|
-
void delayHoverIn;
|
|
86
|
-
void delayHoverOut;
|
|
87
|
-
const state = { pressed };
|
|
88
|
-
const resolvedAccessibilityState = resolveDisabledAccessibilityState(accessibilityState, disabled);
|
|
89
|
-
const viewProps = {
|
|
90
|
-
...accessibilityRest,
|
|
91
|
-
// The ref is the handle the retention measure reaches through (measure on grant).
|
|
92
|
-
ref: viewRef,
|
|
93
|
-
style: resolveStyle(style, state),
|
|
94
|
-
hitSlop,
|
|
95
|
-
accessibilityState: resolvedAccessibilityState,
|
|
96
|
-
testID,
|
|
97
|
-
};
|
|
98
|
-
// Forward the Android tap-sound suppressor under RN's own key; inert on iOS.
|
|
99
|
-
if (android_disableSound !== undefined)
|
|
100
|
-
viewProps.android_disableSound = android_disableSound;
|
|
101
|
-
Object.assign(viewProps, buildPressableListeners(handlers, { disabled, cancelable }));
|
|
102
|
-
// android_ripple rides a dedicated inner View (the Pressable's own View only forwards a fixed
|
|
103
|
-
// prop set), mirroring touchable-native-feedback. On iOS the ripple prop is undefined, so the
|
|
104
|
-
// child renders unwrapped, no extra node.
|
|
105
|
-
const ripple = android_ripple !== undefined ? rippleProps(android_ripple) : undefined;
|
|
106
|
-
const content = resolveChildren(children, state);
|
|
107
|
-
const inner = ripple !== undefined ? createElement(View, ripple, content) : content;
|
|
108
|
-
return createElement(View, viewProps, inner);
|
|
109
|
-
};
|
|
110
|
-
export const Pressable = PressableImpl;
|
|
111
|
-
// Relative-only composition seam; it is deliberately absent from the adapter barrel.
|
|
112
|
-
export const TouchablePressable = props => createElement(PressableImpl, { ...props, __minPressDuration: 0 });
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// RefreshControl primitive. On iOS this is the PullToRefreshView Fabric node that
|
|
2
|
-
// lives INSIDE a ScrollView (a sibling of the content container), giving the
|
|
3
|
-
// pull-to-refresh gesture. `refreshing` is a controlled prop: the parent owns it
|
|
4
|
-
// and pushes it down each commit; native reports the gesture via the direct
|
|
5
|
-
// `topRefresh` event, which shared routes to the `refresh` listener (onRefresh).
|
|
6
|
-
import { createElement } from 'react';
|
|
7
|
-
import { dlog } from '@symbiote-native/engine';
|
|
8
|
-
import { resolveAccessibilityProps, } from '@symbiote-native/components';
|
|
9
|
-
export const RefreshControl = rawProps => {
|
|
10
|
-
// Owns its host element (symbiote-refresh-control), so it folds aria/role here;
|
|
11
|
-
// the resolved accessibility* fields ride down via `...nativeProps`.
|
|
12
|
-
const props = resolveAccessibilityProps(rawProps);
|
|
13
|
-
const { children, ...nativeProps } = props;
|
|
14
|
-
dlog('RefreshControl -> PullToRefreshView');
|
|
15
|
-
dlog(`RefreshControl refreshing=${String(props.refreshing)}`);
|
|
16
|
-
if (props.enabled !== undefined)
|
|
17
|
-
dlog(`RefreshControl enabled=${String(props.enabled)} (Android-only)`);
|
|
18
|
-
if (props.onRefresh !== undefined)
|
|
19
|
-
dlog('RefreshControl onRefresh listener wired');
|
|
20
|
-
return createElement('symbiote-refresh-control', { ...nativeProps }, children);
|
|
21
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type FC, type ReactNode } from 'react';
|
|
2
|
-
import { type ISymbioteEvent } from '@symbiote-native/engine';
|
|
3
|
-
import { type IAccessibilityProps, type IAriaProps } from '@symbiote-native/components';
|
|
4
|
-
import type { IStyleProp, IViewStyle } from '../../utils/styles';
|
|
5
|
-
export interface ISafeAreaViewProps extends IAccessibilityProps, IAriaProps {
|
|
6
|
-
style?: IStyleProp<IViewStyle>;
|
|
7
|
-
id?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
onLayout?: (event: ISymbioteEvent) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const SafeAreaView: FC<ISafeAreaViewProps>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// SafeAreaView primitive. A plain view whose native side insets its children to
|
|
2
|
-
// the safe area (notch, rounded corners, system bars). There is no JS-side
|
|
3
|
-
// translation; RN just renders the native RCTSafeAreaView and lets the host do
|
|
4
|
-
// the inset math, so this maps style + children straight onto the intrinsic.
|
|
5
|
-
import { createElement } from 'react';
|
|
6
|
-
import { dlog } from '@symbiote-native/engine';
|
|
7
|
-
import { resolveAccessibilityProps, } from '@symbiote-native/components';
|
|
8
|
-
export const SafeAreaView = rawProps => {
|
|
9
|
-
// Owns its host element (symbiote-safe-area-view), so it folds aria/role here;
|
|
10
|
-
// the resolved accessibility* surface rides the node via `...accessibilityRest`.
|
|
11
|
-
const props = resolveAccessibilityProps(rawProps);
|
|
12
|
-
const { style, children, onLayout, ...accessibilityRest } = props;
|
|
13
|
-
dlog('SafeAreaView -> SafeAreaView');
|
|
14
|
-
const nodeProps = { ...accessibilityRest, style };
|
|
15
|
-
if (onLayout !== undefined)
|
|
16
|
-
nodeProps.onLayout = onLayout;
|
|
17
|
-
return createElement('symbiote-safe-area-view', nodeProps, children);
|
|
18
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type IScrollViewHandle, type IScrollViewProps } from './shared';
|
|
2
|
-
export type { IScrollViewProps, IScrollViewHandle } from './shared';
|
|
3
|
-
export declare const ScrollView: import("react").ForwardRefExoticComponent<IScrollViewProps & import("react").RefAttributes<IScrollViewHandle>>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// ScrollView on Android: an Android ScrollView accepts only ONE child, so a RefreshControl
|
|
2
|
-
// can't be a sibling of the content the way iOS allows ("addViewAt: failed to insert view
|
|
3
|
-
// ... at index 1"). Instead the RefreshControl (AndroidSwipeRefreshLayout) WRAPS the
|
|
4
|
-
// scroll view, with the scroll view nested inside and nestedScrollEnabled so the inner
|
|
5
|
-
// scroll handles the gesture before the refresh parent, which mirrors RN's ScrollView.js
|
|
6
|
-
// android branch (cloneElement(refreshControl, {style}, <ScrollView nestedScrollEnabled
|
|
7
|
-
// style={flex:1}>{content}</ScrollView>)). Metro picks this on an Android host; no
|
|
8
|
-
// Platform.OS read.
|
|
9
|
-
import { cloneElement, createElement, forwardRef, useImperativeHandle, useRef, } from 'react';
|
|
10
|
-
import { dlog } from '@symbiote-native/engine';
|
|
11
|
-
import { buildScrollViewHandle, splitLayoutProps, } from '@symbiote-native/components';
|
|
12
|
-
import { usePreparedScrollView, useNativeStickyScrollAttach, } from './shared.js';
|
|
13
|
-
export const ScrollView = forwardRef((props, forwardedRef) => {
|
|
14
|
-
const { scrollViewIntrinsic, scrollViewBaseStyle, outerProps, style, layoutSplitStyle, content, refreshControl, scrollAnimatedValue, nativeStickyAvailable, } = usePreparedScrollView(props);
|
|
15
|
-
// The node ref backs the imperative handle; it attaches to the inner scroll-view element
|
|
16
|
-
// (the wrap shape leaves the scroll view as the command target, not the RefreshControl).
|
|
17
|
-
const ref = useRef(null);
|
|
18
|
-
// Lazy getter, not the ref itself: the node is null until the element commits, so the handle
|
|
19
|
-
// must read ref.current on each command, an eager capture would freeze null.
|
|
20
|
-
useImperativeHandle(forwardedRef, () => buildScrollViewHandle(() => ref.current), []);
|
|
21
|
-
// Drive the sticky scroll value on the native UI thread (RN attachNativeEvent). No-op on a
|
|
22
|
-
// host without the native animated module. The JS sticky path stays in effect.
|
|
23
|
-
useNativeStickyScrollAttach(ref, scrollAnimatedValue, nativeStickyAvailable);
|
|
24
|
-
dlog('ScrollView.ANDROID refreshControl=' +
|
|
25
|
-
(refreshControl === undefined ? 'NONE(1child)' : 'WRAP'));
|
|
26
|
-
if (refreshControl === undefined) {
|
|
27
|
-
// Base style (flexDirection: row for horizontal) under user style; undefined base
|
|
28
|
-
// (vertical) passes the user style through unchanged.
|
|
29
|
-
const scrollStyle = scrollViewBaseStyle
|
|
30
|
-
? [scrollViewBaseStyle, style]
|
|
31
|
-
: style;
|
|
32
|
-
return createElement(scrollViewIntrinsic, { ...outerProps, style: scrollStyle, ref }, content);
|
|
33
|
-
}
|
|
34
|
-
// RN splits the flattened style across the two boxes (ScrollView.js android branch):
|
|
35
|
-
// LAYOUT props (margin/flex/size/position/transform/gap/…) drive the outer
|
|
36
|
-
// AndroidSwipeRefreshLayout frame; VISUAL props (background/padding/border/opacity/…) paint
|
|
37
|
-
// the inner scroll view. So the wrapper carries `outer`, and the inner scroll view its base
|
|
38
|
-
// (flexDirection/overflow) plus the visual `inner` composed over it, NOT a hardcoded flex:1
|
|
39
|
-
// that would override an explicit user height/width.
|
|
40
|
-
//
|
|
41
|
-
// layoutSplitStyle (not style): a class-only layout prop (flex/height/gap/…) is invisible to
|
|
42
|
-
// `style` (it never carries the resolved `className` value), so splitting on `style` alone
|
|
43
|
-
// starves the wrapper of its layout style and it collapses to nothing. layoutSplitStyle is
|
|
44
|
-
// `style` merged with the resolved className style (see usePreparedScrollView).
|
|
45
|
-
const { outer: outerStyle, inner: innerStyle } = splitLayoutProps(layoutSplitStyle);
|
|
46
|
-
const scrollStyle = scrollViewBaseStyle
|
|
47
|
-
? [scrollViewBaseStyle, innerStyle]
|
|
48
|
-
: innerStyle;
|
|
49
|
-
// className is stripped from the spread here: layoutSplitStyle already folded its resolved
|
|
50
|
-
// value into `outer`/`inner` above, so forwarding the raw prop too would re-apply its LAYOUT
|
|
51
|
-
// half onto the inner scroll view a second time (on top of the outer wrapper).
|
|
52
|
-
const { className: _classNameAppliedViaSplit, ...innerOuterProps } = outerProps;
|
|
53
|
-
const scrollView = createElement(scrollViewIntrinsic, {
|
|
54
|
-
...innerOuterProps,
|
|
55
|
-
style: scrollStyle,
|
|
56
|
-
nestedScrollEnabled: true,
|
|
57
|
-
ref,
|
|
58
|
-
}, content);
|
|
59
|
-
return cloneElement(refreshControl, { style: outerStyle }, scrollView);
|
|
60
|
-
});
|
|
61
|
-
ScrollView.displayName = 'ScrollView';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './index.ios';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type IScrollViewHandle, type IScrollViewProps } from './shared';
|
|
2
|
-
export type { IScrollViewProps, IScrollViewHandle } from './shared';
|
|
3
|
-
export declare const ScrollView: import("react").ForwardRefExoticComponent<IScrollViewProps & import("react").RefAttributes<IScrollViewHandle>>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// ScrollView (iOS): RefreshControl renders as a sibling BEFORE the content container, matching
|
|
2
|
-
// RN's ScrollView.js ({refreshControl}{contentContainer}). Also the base export
|
|
3
|
-
// (scroll-view.ts re-exports it) for headless / web.
|
|
4
|
-
import { createElement, forwardRef, useImperativeHandle, useRef } from 'react';
|
|
5
|
-
import { buildScrollViewHandle } from '@symbiote-native/components';
|
|
6
|
-
import { usePreparedScrollView, useNativeStickyScrollAttach, } from './shared.js';
|
|
7
|
-
export const ScrollView = forwardRef((props, forwardedRef) => {
|
|
8
|
-
const { scrollViewIntrinsic, scrollViewBaseStyle, outerProps, style, content, refreshControl, scrollAnimatedValue, nativeStickyAvailable, } = usePreparedScrollView(props);
|
|
9
|
-
// Backs the imperative handle; passing `ref` through createElement props binds it to the
|
|
10
|
-
// SymbioteNode below, as TextInput does.
|
|
11
|
-
const ref = useRef(null);
|
|
12
|
-
// Lazy getter: the node is null until commit, so the handle reads ref.current per call
|
|
13
|
-
// instead of capturing eagerly, which would freeze null.
|
|
14
|
-
useImperativeHandle(forwardedRef, () => buildScrollViewHandle(() => ref.current), []);
|
|
15
|
-
// Drives sticky scroll on the native UI thread (RN attachNativeEvent); no-ops without the
|
|
16
|
-
// native animated module, falling back to the JS sticky path.
|
|
17
|
-
useNativeStickyScrollAttach(ref, scrollAnimatedValue, nativeStickyAvailable);
|
|
18
|
-
// Base style stays under user style so an explicit value wins; undefined base (vertical)
|
|
19
|
-
// passes the user style through unchanged.
|
|
20
|
-
const scrollStyle = scrollViewBaseStyle
|
|
21
|
-
? [scrollViewBaseStyle, style]
|
|
22
|
-
: style;
|
|
23
|
-
const scrollProps = { ...outerProps, style: scrollStyle, ref };
|
|
24
|
-
if (refreshControl === undefined) {
|
|
25
|
-
return createElement(scrollViewIntrinsic, scrollProps, content);
|
|
26
|
-
}
|
|
27
|
-
return createElement(scrollViewIntrinsic, scrollProps, refreshControl, content);
|
|
28
|
-
});
|
|
29
|
-
ScrollView.displayName = 'ScrollView';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// Base / default ScrollView: re-exports the iOS build. Metro overrides this with
|
|
2
|
-
// scroll-view.ios.ts / .android.ts on a real host; under tsx / tsc / web the host config
|
|
3
|
-
// resolves here. Filename is the selector, no Platform.OS read.
|
|
4
|
-
export * from './index.ios.js';
|