@symbiote-native/react 0.4.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 +32 -16
- package/build/components/activity-indicator-props.d.ts +4 -0
- package/build/components/activity-indicator-props.js +1 -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 -4
- 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 +3 -4
- package/build/components.js +5 -17
- 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.d.ts +2 -2
- package/build/host-config.js +51 -10
- package/build/host-instance.js +1 -1
- package/build/index.d.ts +23 -27
- 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/create-animated-component.d.ts +2 -1
- package/build/modules/animated/create-animated-component.js +7 -1
- 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/build/render.js +2 -4
- package/metro-css-parser.cjs +2 -1
- package/package.json +28 -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 -100
- package/build/components/refresh-control/index.js +0 -21
- package/build/components/safe-area-view/index.d.ts +0 -11
- 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 -172
- 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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ICrossTypedIntrinsics } from '@symbiote-native/components';
|
|
2
|
+
import type { Key } from 'react';
|
|
3
|
+
import type { IViewProps, ITextProps } from './components';
|
|
4
|
+
import type { IPressableProps } from './components/pressable/pressable-props';
|
|
5
|
+
import type { IButtonProps } from './components/button-props';
|
|
6
|
+
import type { IImageProps } from './components/image/image-props';
|
|
7
|
+
import type { IImageBackgroundProps } from './components/image-background-props';
|
|
8
|
+
import type { IInputAccessoryViewProps } from './components/input-accessory-view-props';
|
|
9
|
+
import type { IRefreshControlProps } from './components/refresh-control-props';
|
|
10
|
+
import type { ISafeAreaViewProps } from './components/safe-area-view-props';
|
|
11
|
+
import type { ITouchableNativeFeedbackProps } from './components/touchable-native-feedback/touchable-native-feedback-props';
|
|
12
|
+
import type { ITouchableOpacityProps, ITouchableHighlightProps } from './components/touchable/touchable-props';
|
|
13
|
+
import type { ITouchableWithoutFeedbackProps } from './components/touchable-without-feedback/touchable-without-feedback-props';
|
|
14
|
+
import type { IScrollViewProps } from './components/scroll-view/scroll-view-props';
|
|
15
|
+
import type { ISwitchProps } from './components/switch/switch-props';
|
|
16
|
+
import type { ITextInputProps } from './components/text-input/text-input-props';
|
|
17
|
+
import type { IModalProps } from './components/modal';
|
|
18
|
+
import type { IActivityIndicatorProps } from './components/activity-indicator-props';
|
|
19
|
+
export { Fragment, jsx, jsxs } from 'react/jsx-runtime';
|
|
20
|
+
interface IHostProps {
|
|
21
|
+
style?: unknown;
|
|
22
|
+
children?: import('react').ReactNode;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface ICrossedPrimitiveProps {
|
|
26
|
+
view: IViewProps;
|
|
27
|
+
text: ITextProps;
|
|
28
|
+
pressable: IPressableProps;
|
|
29
|
+
button: IButtonProps;
|
|
30
|
+
image: IImageProps;
|
|
31
|
+
'image-background': IImageBackgroundProps;
|
|
32
|
+
'input-accessory-view': IInputAccessoryViewProps;
|
|
33
|
+
'refresh-control': IRefreshControlProps;
|
|
34
|
+
'safe-area-view': ISafeAreaViewProps;
|
|
35
|
+
'touchable-native-feedback': ITouchableNativeFeedbackProps;
|
|
36
|
+
'touchable-opacity': ITouchableOpacityProps;
|
|
37
|
+
'touchable-highlight': ITouchableHighlightProps;
|
|
38
|
+
'touchable-without-feedback': ITouchableWithoutFeedbackProps;
|
|
39
|
+
'scroll-view': IScrollViewProps;
|
|
40
|
+
switch: ISwitchProps;
|
|
41
|
+
'text-input': ITextInputProps;
|
|
42
|
+
modal: IModalProps;
|
|
43
|
+
'activity-indicator': IActivityIndicatorProps;
|
|
44
|
+
}
|
|
45
|
+
type IWithKey<Props> = Props & {
|
|
46
|
+
key?: Key | null;
|
|
47
|
+
};
|
|
48
|
+
export declare namespace JSX {
|
|
49
|
+
type ElementType = import('react').JSX.ElementType;
|
|
50
|
+
type Element = import('react').JSX.Element;
|
|
51
|
+
type ElementClass = import('react').JSX.ElementClass;
|
|
52
|
+
type ElementAttributesProperty = import('react').JSX.ElementAttributesProperty;
|
|
53
|
+
type ElementChildrenAttribute = import('react').JSX.ElementChildrenAttribute;
|
|
54
|
+
type LibraryManagedAttributes<C, P> = import('react').JSX.LibraryManagedAttributes<C, P>;
|
|
55
|
+
type IntrinsicAttributes = import('react').JSX.IntrinsicAttributes;
|
|
56
|
+
type IntrinsicClassAttributes<T> = import('react').JSX.IntrinsicClassAttributes<T>;
|
|
57
|
+
interface IntrinsicElements extends ICrossTypedIntrinsics<IHostProps, {
|
|
58
|
+
[K in keyof ICrossedPrimitiveProps]: IWithKey<ICrossedPrimitiveProps[K]>;
|
|
59
|
+
}> {
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export type ISymbioteIntrinsicTag = keyof JSX.IntrinsicElements;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Fragment, jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -8,5 +8,6 @@ type IAnimatableProps = {
|
|
|
8
8
|
style?: unknown;
|
|
9
9
|
children?: unknown;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type IAnimatableBase<P extends IAnimatableProps> = ComponentType<P> | string;
|
|
12
|
+
export declare function createAnimatedComponent<P extends IAnimatableProps>(Component: IAnimatableBase<P>): ComponentType<IAnimatedComponentProps>;
|
|
12
13
|
export {};
|
|
@@ -27,6 +27,12 @@ function assignRef(ref, value) {
|
|
|
27
27
|
}
|
|
28
28
|
ref.current = value;
|
|
29
29
|
}
|
|
30
|
+
// A tag has no displayName/name, so read the label through the shape actually present.
|
|
31
|
+
function baseNameOf(base) {
|
|
32
|
+
if (typeof base === 'string')
|
|
33
|
+
return base;
|
|
34
|
+
return base.displayName ?? base.name ?? 'Anonymous';
|
|
35
|
+
}
|
|
30
36
|
export function createAnimatedComponent(Component) {
|
|
31
37
|
function AnimatedComponent(props) {
|
|
32
38
|
const { ref: forwardedRef, passthroughAnimatedPropExplicitValues: passthrough, ...rest } = props;
|
|
@@ -81,6 +87,6 @@ export function createAnimatedComponent(Component) {
|
|
|
81
87
|
const childProps = Object.assign(Object.create(null), reduced, { ref: captureRef });
|
|
82
88
|
return createElement(Component, childProps);
|
|
83
89
|
}
|
|
84
|
-
AnimatedComponent.displayName = `Animated(${Component
|
|
90
|
+
AnimatedComponent.displayName = `Animated(${baseNameOf(Component)})`;
|
|
85
91
|
return AnimatedComponent;
|
|
86
92
|
}
|
|
@@ -45,7 +45,6 @@ export declare const Animated: {
|
|
|
45
45
|
View: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
46
46
|
Text: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
47
47
|
Image: import("react").ComponentType<import("./create-animated-component").IAnimatedComponentProps>;
|
|
48
|
-
ScrollView: ReturnType<typeof createAnimatedComponent>;
|
|
49
48
|
FlatList: ReturnType<typeof createAnimatedComponent>;
|
|
50
49
|
SectionList: ReturnType<typeof createAnimatedComponent>;
|
|
51
50
|
createAnimatedComponent: typeof createAnimatedComponent;
|
|
@@ -4,9 +4,6 @@
|
|
|
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
6
|
import { AnimatedValue, AnimatedValueXY, AnimatedColor, Easing, Platform, timing, spring, decay, parallel, sequence, stagger, loop, delay, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent, } from '@symbiote-native/engine';
|
|
7
|
-
import { View, Text } from '../../components.js';
|
|
8
|
-
import { Image } from '../../components/image/index.js';
|
|
9
|
-
import { ScrollView } from '../../components/scroll-view';
|
|
10
7
|
import { FlatList } from '../../components/flat-list/index.js';
|
|
11
8
|
import { SectionList } from '../../components/section-list/index.js';
|
|
12
9
|
import { createAnimatedComponent } from './create-animated-component.js';
|
|
@@ -15,21 +12,22 @@ export { createAnimatedComponent } from './create-animated-component.js';
|
|
|
15
12
|
// The pure graph leaves now live in @symbiote-native/engine (they extend AnimatedWithChildren,
|
|
16
13
|
// no React); re-exported here so @symbiote-native/react's Animated surface is unchanged.
|
|
17
14
|
export { AnimatedProps, AnimatedStyle, AnimatedTransform, } from '@symbiote-native/engine';
|
|
18
|
-
// View/Text/Image are pure host primitives, so wrap them eagerly.
|
|
19
|
-
const AnimatedView = createAnimatedComponent(
|
|
20
|
-
const AnimatedText = createAnimatedComponent(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
|
|
15
|
+
// The tags themselves: View/Text/Image are pure host primitives, so wrap them eagerly.
|
|
16
|
+
const AnimatedView = createAnimatedComponent('view');
|
|
17
|
+
const AnimatedText = createAnimatedComponent('text');
|
|
18
|
+
// The tag, not the `Image` name: that one is the STATICS namespace now (`modules/image`).
|
|
19
|
+
const AnimatedImage = createAnimatedComponent('image');
|
|
20
|
+
// There is no `Animated.ScrollView` any more, and nothing replaced it — the whole API is
|
|
21
|
+
// `<scroll-view style={{ opacity: v }} onScroll={Animated.event(…)}>`. A scroll wrapper's one
|
|
22
|
+
// remaining animated job looked like the native scroll-event attach, and that is engine-side for
|
|
23
|
+
// EVERY host node: `setEventListener` calls `bindAnimatedEvent` on any `on*` prop
|
|
24
|
+
// (`core/engine/src/node.ts`), and an AnimatedNode written into any style key is resolved by
|
|
25
|
+
// `routeProp`. Its lazy getter existed only to dodge a TDZ through `scroll-view/sticky-header`,
|
|
26
|
+
// which is deleted with the wrapper.
|
|
27
|
+
//
|
|
28
|
+
// The two below REMAIN because the list family is tier 3: a render prop decides their output shape
|
|
29
|
+
// in JS, so there is no tag for `<Animated.X>` to be an alias of. Both stay LAZY, mirroring RN's
|
|
30
|
+
// own `get FlatList() { return require(...) }`.
|
|
33
31
|
let animatedFlatList;
|
|
34
32
|
let animatedSectionList;
|
|
35
33
|
// The live, JS-driven driver namespace (real frames). RN's AnimatedImplementation.
|
|
@@ -67,10 +65,6 @@ export const Animated = {
|
|
|
67
65
|
View: AnimatedView,
|
|
68
66
|
Text: AnimatedText,
|
|
69
67
|
Image: AnimatedImage,
|
|
70
|
-
get ScrollView() {
|
|
71
|
-
animatedScrollView ??= createAnimatedComponent(ScrollView);
|
|
72
|
-
return animatedScrollView;
|
|
73
|
-
},
|
|
74
68
|
get FlatList() {
|
|
75
69
|
animatedFlatList ??= createAnimatedComponent(FlatList);
|
|
76
70
|
return animatedFlatList;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// RN's Image STATICS — `getSize`, `getSizeWithHeaders`, `prefetch`, `abortPrefetch`, `queryCache`,
|
|
2
|
+
// `resolveAssetSource`.
|
|
3
|
+
//
|
|
4
|
+
// IN `modules/`, NOT `components/`. The primitive is the `<image>` tag and its fold runs in the
|
|
5
|
+
// engine (`behaviors/image.ts`); what is left under the name `Image` is an imperative API with no
|
|
6
|
+
// view, which is what this bucket is for (<adapter_src_follows_framework_idioms>). Sitting in
|
|
7
|
+
// `components/` was what made a statics object read as a component.
|
|
8
|
+
//
|
|
9
|
+
// A NAMESPACE OBJECT rather than six bare functions, deliberately: `Alert`, `Share`, `Linking` and
|
|
10
|
+
// `AppState` all take that shape, and an app porting from RN writes `Image.getSize(...)` verbatim.
|
|
11
|
+
//
|
|
12
|
+
// Shared verbatim via `imageStatics`, the same source every other adapter's Image uses.
|
|
13
|
+
import { imageStatics } from '@symbiote-native/components';
|
|
14
|
+
export const Image = imageStatics;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@symbiote-native/components/register';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Side-effect ONLY. Exports nothing, and must never be re-exported from the barrel.
|
|
2
|
+
//
|
|
3
|
+
// The fourteen calls live once, in `@symbiote-native/components/register` — they were identical in
|
|
4
|
+
// all five adapters, and each copy carried a migration ledger justifying a call against a wrapper
|
|
5
|
+
// that no longer exists. What is per-adapter is only the SPELLING of the import below: every
|
|
6
|
+
// `*-tag.test.*` here reaches the registry through `import './register';`, and this adapter's own
|
|
7
|
+
// barrel guard pins that line.
|
|
8
|
+
//
|
|
9
|
+
// WHY A SIDE-EFFECT SUBPATH AND NOT A BARREL EXPORT. Metro turns on `inlineRequires` for PRODUCTION
|
|
10
|
+
// only: it moves a `require` down to the first place its binding is used as a VALUE, and
|
|
11
|
+
// `export { X } from './x'` compiles to a lazy getter. A registration reached that way never
|
|
12
|
+
// evaluates in a Release build — invisible to tsc, to vitest, and to grepping the bundle. A bare
|
|
13
|
+
// `import` placed NEXT TO a re-export of the same specifier does not help either: Babel merges the
|
|
14
|
+
// two into one dependency and the merged dependency stays lazy.
|
|
15
|
+
import '@symbiote-native/components/register';
|
package/build/render.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
4
|
import { createSurface, disposeRoot, setEventDispatcher, dlog, reportUncaughtError, } from '@symbiote-native/engine';
|
|
5
|
-
import reconciler, {
|
|
5
|
+
import reconciler, { flushExternalUpdate } from './host-config.js';
|
|
6
6
|
import { LegacyRoot } from './reconciler-constants.js';
|
|
7
7
|
const noop = () => { };
|
|
8
8
|
function errorReporter(origin) {
|
|
@@ -40,10 +40,8 @@ const onRecoverableError = errorReporter('react render (recovered)');
|
|
|
40
40
|
// to compare against Vue/Angular's microtask-coalesced requestCommit(). Kept
|
|
41
41
|
// behind DEBUG per <keep_logs_gate_behind_DEBUG>, never removed.
|
|
42
42
|
setEventDispatcher(run => {
|
|
43
|
-
withDiscretePriority(run);
|
|
44
43
|
dlog('react event-dispatch: forced flushSyncWork');
|
|
45
|
-
|
|
46
|
-
reconciler.flushSyncWork();
|
|
44
|
+
flushExternalUpdate(run);
|
|
47
45
|
});
|
|
48
46
|
const containers = new Map();
|
|
49
47
|
// Unmount a surface's React tree (render null → empty completeRoot, clearing the
|
package/metro-css-parser.cjs
CHANGED
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
// .cjs, not .js: this package is "type": "module", but Metro's babelTransformerPath loading needs
|
|
6
6
|
// a require()-able file. createCssMetroTransformer() is a factory — Metro needs the actual
|
|
7
7
|
// {transform, getCacheKey} object it returns, not the css-parser package barrel.
|
|
8
|
-
module.exports =
|
|
8
|
+
module.exports =
|
|
9
|
+
require('@symbiote-native/css-parser').createCssMetroTransformer();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.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": {
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
"url": "https://github.com/OneEyed1366/symbiote-native/issues"
|
|
14
14
|
},
|
|
15
15
|
"author": "Andrey Prokopenko <psevdoproger@gmail.com>",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"react-native",
|
|
18
|
+
"symbiote-native",
|
|
19
|
+
"react",
|
|
20
|
+
"fabric",
|
|
21
|
+
"reconciler",
|
|
22
|
+
"renderer",
|
|
23
|
+
"cross-platform",
|
|
24
|
+
"mobile",
|
|
25
|
+
"ios",
|
|
26
|
+
"android"
|
|
27
|
+
],
|
|
16
28
|
"type": "module",
|
|
17
29
|
"main": "./build/index.js",
|
|
18
30
|
"module": "./build/index.js",
|
|
@@ -26,7 +38,15 @@
|
|
|
26
38
|
"types": "./build/bootstrap.d.ts",
|
|
27
39
|
"default": "./build/bootstrap.js"
|
|
28
40
|
},
|
|
29
|
-
"./metro-css-parser": "./metro-css-parser.cjs"
|
|
41
|
+
"./metro-css-parser": "./metro-css-parser.cjs",
|
|
42
|
+
"./jsx-runtime": {
|
|
43
|
+
"types": "./build/jsx-runtime.d.ts",
|
|
44
|
+
"default": "./build/jsx-runtime.js"
|
|
45
|
+
},
|
|
46
|
+
"./jsx-dev-runtime": {
|
|
47
|
+
"types": "./build/jsx-dev-runtime.d.ts",
|
|
48
|
+
"default": "./build/jsx-dev-runtime.js"
|
|
49
|
+
}
|
|
30
50
|
},
|
|
31
51
|
"files": [
|
|
32
52
|
"build",
|
|
@@ -37,20 +57,20 @@
|
|
|
37
57
|
},
|
|
38
58
|
"dependencies": {
|
|
39
59
|
"react-reconciler": "^0.33.0",
|
|
40
|
-
"@symbiote-native/components": "0.
|
|
41
|
-
"@symbiote-native/css-parser": "0.
|
|
60
|
+
"@symbiote-native/components": "2.0.0",
|
|
61
|
+
"@symbiote-native/css-parser": "0.5.0"
|
|
42
62
|
},
|
|
43
63
|
"peerDependencies": {
|
|
44
|
-
"@symbiote-native/engine": ">=0.1.7",
|
|
45
64
|
"react": ">=19.0.0",
|
|
46
|
-
"react-native": ">=0.86"
|
|
65
|
+
"react-native": ">=0.86",
|
|
66
|
+
"@symbiote-native/engine": "^0.5.0"
|
|
47
67
|
},
|
|
48
68
|
"devDependencies": {
|
|
49
69
|
"@types/react": "^19.2.0",
|
|
50
70
|
"@types/react-reconciler": "^0.32.2",
|
|
51
71
|
"react": "19.2.3",
|
|
52
|
-
"@symbiote-native/engine": "0.
|
|
53
|
-
"@symbiote-native/test-utils": "0.
|
|
72
|
+
"@symbiote-native/engine": "0.5.0",
|
|
73
|
+
"@symbiote-native/test-utils": "0.3.0"
|
|
54
74
|
},
|
|
55
75
|
"scripts": {
|
|
56
76
|
"typecheck": "tsc --build",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IActivityIndicatorProps } from './shared';
|
|
2
|
-
export type { IActivityIndicatorProps } from './shared';
|
|
3
|
-
export declare function ActivityIndicator(rawProps: IActivityIndicatorProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// AndroidProgressBar needs `styleAttr` (drives ProgressBar.setStyle(); missing it throws
|
|
2
|
-
// "setStyle() not called") and `indeterminate: true`; default color is the theme (null) —
|
|
3
|
-
// mirrors RN's ActivityIndicator.js android branch. Metro selects this file on an Android
|
|
4
|
-
// host, no Platform.OS read needed.
|
|
5
|
-
// device-verify-pending: confirmed by the absence of the setStyle() red box on a real host.
|
|
6
|
-
import { descriptorToReact } from '../../descriptor-to-react/index.js';
|
|
7
|
-
import { useActivityIndicatorLogic } from './shared.js';
|
|
8
|
-
const PLATFORM = {
|
|
9
|
-
// RN: `color = Platform.OS === 'ios' ? GRAY : null`; Android lets the theme color it.
|
|
10
|
-
defaultColor: null,
|
|
11
|
-
nativeExtras: { styleAttr: 'Normal', indeterminate: true },
|
|
12
|
-
};
|
|
13
|
-
// A top-level named function, not a factory-returned closure: React Compiler's
|
|
14
|
-
// component detection only walks top-level declarations (see shared.ts).
|
|
15
|
-
export function ActivityIndicator(rawProps) {
|
|
16
|
-
return descriptorToReact(useActivityIndicatorLogic(rawProps, PLATFORM));
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './index.ios';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IActivityIndicatorProps } from './shared';
|
|
2
|
-
export type { IActivityIndicatorProps } from './shared';
|
|
3
|
-
export declare function ActivityIndicator(rawProps: IActivityIndicatorProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// ActivityIndicator on iOS: RCTActivityIndicatorView takes the size enum + a GRAY
|
|
2
|
-
// default color and no extra native props. Also the base (activity-indicator.ts
|
|
3
|
-
// re-exports it) for headless / web.
|
|
4
|
-
import { descriptorToReact } from '../../descriptor-to-react/index.js';
|
|
5
|
-
import { useActivityIndicatorLogic } from './shared.js';
|
|
6
|
-
// RN's iOS default spinner color (Libraries/.../ActivityIndicator.js GRAY).
|
|
7
|
-
const IOS_DEFAULT_COLOR = '#999999';
|
|
8
|
-
const PLATFORM = {
|
|
9
|
-
defaultColor: IOS_DEFAULT_COLOR,
|
|
10
|
-
nativeExtras: {},
|
|
11
|
-
};
|
|
12
|
-
// A top-level named function, not a factory-returned closure: React Compiler's
|
|
13
|
-
// component detection only walks top-level declarations (see shared.ts).
|
|
14
|
-
export function ActivityIndicator(rawProps) {
|
|
15
|
-
return descriptorToReact(useActivityIndicatorLogic(rawProps, PLATFORM));
|
|
16
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// Base / default ActivityIndicator: re-exports the iOS build. Metro overrides this with
|
|
2
|
-
// activity-indicator.ios.ts / .android.ts on a real host; under tsx / tsc / web the host
|
|
3
|
-
// config resolves here. Filename is the selector, no Platform.OS read.
|
|
4
|
-
export * from './index.ios.js';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IActivityIndicatorPlatform, IActivityIndicatorProps as IActivityIndicatorBaseProps } from '@symbiote-native/components';
|
|
2
|
-
export type { IActivityIndicatorPlatform } from '@symbiote-native/components';
|
|
3
|
-
export type IActivityIndicatorProps = IActivityIndicatorBaseProps & {
|
|
4
|
-
className?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function useActivityIndicatorLogic(rawProps: IActivityIndicatorProps, platform: IActivityIndicatorPlatform): import("@symbiote-native/components").IDescriptor;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// ActivityIndicator is the React lifecycle half. The render (size translation, wrapper +
|
|
2
|
-
// spinner, color omission) lives framework-agnostic in @symbiote-native/components; here the
|
|
3
|
-
// adapter only resolves props (accessibility, defaults), calls the render fn, and bridges
|
|
4
|
-
// the Descriptor to a React element. No state, no effects: this component is render-only.
|
|
5
|
-
//
|
|
6
|
-
// The per-platform bits (iOS GRAY default + no extras; Android theme/null + styleAttr +
|
|
7
|
-
// indeterminate) are supplied by the .ios/.android files via `IActivityIndicatorPlatform`.
|
|
8
|
-
//
|
|
9
|
-
// useActivityIndicatorLogic is a plain top-level hook, not a component factory returning a
|
|
10
|
-
// closure: React Compiler's component/hook detection only walks top-level declarations, so
|
|
11
|
-
// index.ios.ts / index.android.ts each declare their OWN top-level `ActivityIndicator`
|
|
12
|
-
// function that calls this hook, rather than exporting whatever a factory here returns (same
|
|
13
|
-
// shape as switch/shared.ts's useSwitchLogic).
|
|
14
|
-
import { renderActivityIndicator, resolveAccessibilityProps, } from '@symbiote-native/components';
|
|
15
|
-
export function useActivityIndicatorLogic(rawProps, platform) {
|
|
16
|
-
// The wrapper is a raw symbiote-view, not the View FC, so it never runs
|
|
17
|
-
// resolveAccessibilityProps itself, so fold aria/role here, then forward the resolved
|
|
18
|
-
// accessibility* surface (plus testID / onLayout) onto the wrapper via `passthrough`.
|
|
19
|
-
const props = resolveAccessibilityProps(rawProps);
|
|
20
|
-
const { animating = true, color, hidesWhenStopped = true, size = 'small', style, ...passthrough } = props;
|
|
21
|
-
return renderActivityIndicator({ animating, color, hidesWhenStopped, size, style, passthrough }, platform);
|
|
22
|
-
}
|
|
@@ -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
|
-
};
|