@symbiote-native/solid 1.0.0 → 3.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 +159 -86
- package/babel-preset.cjs +0 -5
- package/build/components/activity-indicator-props.d.ts +5 -0
- package/build/components/activity-indicator-props.js +1 -0
- package/build/components/button-props.d.ts +5 -0
- package/build/components/button-props.js +1 -0
- package/build/components/flat-list/index.jsx +4 -4
- package/build/components/{image-background.d.ts → image-background-props.d.ts} +2 -3
- package/build/components/image-background-props.js +1 -0
- package/build/components/image-props.d.ts +5 -0
- package/build/components/image-props.js +6 -0
- package/build/components/{input-accessory-view.d.ts → input-accessory-view-props.d.ts} +1 -2
- package/build/components/input-accessory-view-props.js +5 -0
- package/build/components/keyboard-avoiding-view.jsx +15 -6
- package/build/components/modal.jsx +6 -6
- package/build/components/{pressable.d.ts → pressable-props.d.ts} +10 -7
- package/build/components/pressable-props.js +13 -0
- package/build/components/{refresh-control.d.ts → refresh-control-props.d.ts} +3 -3
- package/build/components/refresh-control-props.js +7 -0
- package/build/components/safe-area-view-props.d.ts +10 -0
- package/build/components/safe-area-view-props.js +5 -0
- package/build/components/{scroll-view/shared.d.ts → scroll-view-props.d.ts} +7 -13
- package/build/components/scroll-view-props.js +29 -0
- package/build/components/switch-props.d.ts +6 -0
- package/build/components/switch-props.js +5 -0
- package/build/components/text-input-props.d.ts +8 -0
- package/build/components/text-input-props.js +1 -0
- package/build/components/{text.d.ts → text-props.d.ts} +3 -3
- package/build/components/text-props.js +11 -0
- package/build/components/touchable-native-feedback/touchable-native-feedback-props.d.ts +9 -0
- package/build/components/touchable-native-feedback/touchable-native-feedback-props.js +1 -0
- package/build/components/touchable-props.d.ts +20 -0
- package/build/components/touchable-props.js +1 -0
- package/build/components/touchable-without-feedback/touchable-without-feedback-props.d.ts +7 -0
- package/build/components/touchable-without-feedback/touchable-without-feedback-props.js +1 -0
- package/build/components/{view.d.ts → view-props.d.ts} +2 -3
- package/build/components/view-props.js +11 -0
- package/build/components/virtualized-list/index.android.js +5 -4
- package/build/components/virtualized-list/index.ios.js +6 -6
- package/build/components/virtualized-list/shared.d.ts +1 -3
- package/build/components/virtualized-list/shared.jsx +95 -102
- package/build/components/virtualized-list/sticky-header.d.ts +6 -0
- package/build/components/{scroll-view → virtualized-list}/sticky-header.jsx +28 -36
- package/build/components.d.ts +20 -30
- package/build/components.js +6 -33
- package/build/create-portal/index.jsx +3 -3
- package/build/descriptor-to-solid.js +1 -1
- package/build/host-instance.js +2 -2
- package/build/index.d.ts +1 -0
- package/build/index.js +11 -3
- package/build/jsx-runtime.d.ts +39 -2
- package/build/modules/animated/index.d.ts +26 -23
- package/build/modules/animated/index.js +16 -22
- package/build/modules/image.d.ts +3 -0
- package/build/modules/image.js +12 -0
- package/build/register.d.ts +1 -1
- package/build/register.js +12 -28
- package/build/renderer.js +74 -61
- package/build/utils/stable-keys.d.ts +1 -1
- package/build/utils/stable-keys.js +6 -5
- package/metro-css-parser.cjs +2 -1
- package/package.json +6 -11
- package/babel-lower-host-primitives.cjs +0 -323
- package/build/components/activity-indicator/index.android.d.ts +0 -2
- package/build/components/activity-indicator/index.android.js +0 -11
- package/build/components/activity-indicator/index.d.ts +0 -1
- package/build/components/activity-indicator/index.ios.d.ts +0 -2
- package/build/components/activity-indicator/index.ios.js +0 -10
- package/build/components/activity-indicator/index.js +0 -4
- package/build/components/activity-indicator/shared.d.ts +0 -8
- package/build/components/activity-indicator/shared.js +0 -51
- package/build/components/button.d.ts +0 -7
- package/build/components/button.jsx +0 -45
- package/build/components/image-background.jsx +0 -74
- package/build/components/image.d.ts +0 -9
- package/build/components/image.js +0 -75
- package/build/components/input-accessory-view.jsx +0 -39
- package/build/components/pressable.jsx +0 -211
- package/build/components/refresh-control.jsx +0 -36
- package/build/components/safe-area-view.d.ts +0 -11
- package/build/components/safe-area-view.jsx +0 -24
- package/build/components/scroll-view/index.android.d.ts +0 -2
- package/build/components/scroll-view/index.android.js +0 -11
- package/build/components/scroll-view/index.d.ts +0 -2
- package/build/components/scroll-view/index.ios.d.ts +0 -2
- package/build/components/scroll-view/index.ios.js +0 -8
- package/build/components/scroll-view/index.js +0 -9
- package/build/components/scroll-view/shared.jsx +0 -334
- package/build/components/scroll-view/sticky-header.d.ts +0 -18
- package/build/components/switch/index.android.d.ts +0 -2
- package/build/components/switch/index.android.js +0 -12
- package/build/components/switch/index.d.ts +0 -1
- package/build/components/switch/index.ios.d.ts +0 -2
- package/build/components/switch/index.ios.js +0 -11
- package/build/components/switch/index.js +0 -4
- package/build/components/switch/shared.d.ts +0 -11
- package/build/components/switch/shared.js +0 -87
- package/build/components/text-input.d.ts +0 -10
- package/build/components/text-input.js +0 -290
- package/build/components/text.jsx +0 -27
- package/build/components/touchable/index.d.ts +0 -22
- package/build/components/touchable/index.jsx +0 -247
- package/build/components/touchable-native-feedback/index.d.ts +0 -16
- package/build/components/touchable-native-feedback/index.jsx +0 -68
- package/build/components/view.jsx +0 -49
- package/build/state-style.d.ts +0 -1
- package/build/state-style.js +0 -13
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// TouchableNativeFeedback — Android's ripple / state-drawable touchable, built on Pressable like
|
|
2
|
-
// the rest of the family. RN clones its child into an RCTView carrying the native ripple props;
|
|
3
|
-
// we nest the child under a feedback view that carries them, inside a Pressable that owns the
|
|
4
|
-
// press wiring. `nativeBackgroundAndroid` / `nativeForegroundAndroid` are read by Android's
|
|
5
|
-
// ReactViewManager; on iOS they are inert props, so the component still renders its child with
|
|
6
|
-
// working press wiring — exactly what React's and Vue's do.
|
|
7
|
-
//
|
|
8
|
-
// EVERYTHING NON-LIFECYCLE IS SHARED. The static factories (selectableBackground,
|
|
9
|
-
// selectableBackgroundBorderless, rippleBackground), the platform gate (canUseNativeForeground)
|
|
10
|
-
// and the background→native-prop mapping (backgroundProps) all live in
|
|
11
|
-
// @symbiote-native/components; this file only attaches them to the component value and nests the
|
|
12
|
-
// feedback view. Press timing is Pressable's, which is the shared state machine.
|
|
13
|
-
//
|
|
14
|
-
// The feedback carrier is a raw `symbiote-view`, not the `View` component — the same choice
|
|
15
|
-
// Pressable already makes for its android_ripple wrapper. It carries native props and nothing
|
|
16
|
-
// else: no accessibility surface, no class, no ref, so View's aria fold and nativeID resolution
|
|
17
|
-
// would be pure overhead. The committed node is `RCTView` either way.
|
|
18
|
-
//
|
|
19
|
-
// NOTHING here destructures `props`. A Solid component body runs ONCE, so a destructure would
|
|
20
|
-
// freeze the background at its mount-time value; every read below sits inside an accessor.
|
|
21
|
-
import { splitProps } from 'solid-js';
|
|
22
|
-
import { backgroundProps, canUseNativeForeground, rippleBackground, selectableBackground, selectableBackgroundBorderless, } from '@symbiote-native/components';
|
|
23
|
-
import { dlog } from '@symbiote-native/engine';
|
|
24
|
-
import { withStableKeys } from '../../utils/stable-keys.js';
|
|
25
|
-
import { TouchablePressable as Pressable, } from '../pressable.jsx';
|
|
26
|
-
function TouchableNativeFeedbackImpl(props) {
|
|
27
|
-
const [local, rest] = splitProps(props, [
|
|
28
|
-
'background',
|
|
29
|
-
'useForeground',
|
|
30
|
-
'children',
|
|
31
|
-
]);
|
|
32
|
-
// ONE bag, and it goes through withStableKeys. backgroundProps returns a DIFFERENT single key
|
|
33
|
-
// per branch (nativeForegroundAndroid vs nativeBackgroundAndroid), and Solid's `spread` walks
|
|
34
|
-
// only the current key set with no removal pass — so flipping `useForeground` on an Android
|
|
35
|
-
// host would leave the abandoned key painting its old drawable forever. Widening restores what
|
|
36
|
-
// React and Vue get from their reconcilers: the vanished key arrives as `undefined`, which
|
|
37
|
-
// routeProp treats as a delete, and `spread` still does the actual diffing
|
|
38
|
-
// (.claude/rules/solid-descriptor-bridge.md §1).
|
|
39
|
-
const feedbackProps = withStableKeys(() => {
|
|
40
|
-
// RN never leaves a TouchableNativeFeedback without feedback: a missing background defaults
|
|
41
|
-
// to SelectableBackground().
|
|
42
|
-
const resolved = local.background ?? selectableBackground();
|
|
43
|
-
const useForeground = local.useForeground === true;
|
|
44
|
-
dlog(`TouchableNativeFeedback render ${resolved.type} useForeground ${useForeground}`);
|
|
45
|
-
// The no-op seam: RN silently routes a requested foreground back to the background slot off
|
|
46
|
-
// Android / below API 23, and a missing ripple on device looks like a broken component.
|
|
47
|
-
if (useForeground && !canUseNativeForeground()) {
|
|
48
|
-
dlog('TouchableNativeFeedback useForeground ignored: no native foreground here');
|
|
49
|
-
}
|
|
50
|
-
return backgroundProps(resolved, useForeground);
|
|
51
|
-
});
|
|
52
|
-
// Two single spreads, never spread-then-override: `mergeProps` (which the compiler uses for a
|
|
53
|
-
// spread followed by an explicit prop) keeps the FIRST non-undefined value, so an explicit
|
|
54
|
-
// `undefined` after a spread silently loses — the opposite of React's JSX spread
|
|
55
|
-
// (.claude/rules/solid-descriptor-bridge.md §6). `rest` and `feedbackProps()` are each the sole
|
|
56
|
-
// source for their element, so there is nothing to merge.
|
|
57
|
-
return (<Pressable {...rest}>
|
|
58
|
-
<symbiote-view {...feedbackProps()}>{local.children}</symbiote-view>
|
|
59
|
-
</Pressable>);
|
|
60
|
-
}
|
|
61
|
-
// The statics ride on the component value so callers reach TouchableNativeFeedback.Ripple(…)
|
|
62
|
-
// exactly like RN. They are the shared functions themselves, not wrappers.
|
|
63
|
-
export const TouchableNativeFeedback = Object.assign(TouchableNativeFeedbackImpl, {
|
|
64
|
-
SelectableBackground: selectableBackground,
|
|
65
|
-
SelectableBackgroundBorderless: selectableBackgroundBorderless,
|
|
66
|
-
Ripple: rippleBackground,
|
|
67
|
-
canUseNativeForeground,
|
|
68
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// View — the Solid host primitive, and the file that fixes the children/ref idiom every other
|
|
2
|
-
// Solid component will copy.
|
|
3
|
-
//
|
|
4
|
-
// WHY THIS IS REAL JSX AND NOT A HAND-BUILT NODE. `symbiote-view` takes a live subtree of the
|
|
5
|
-
// user's components, and reducing that subtree to primitives IS Solid's reconciler. So the only
|
|
6
|
-
// two moving parts are (a) forwarding a prop bag onto one host element and (b) handing the
|
|
7
|
-
// children accessor to the renderer's `insert` — precisely what compiled JSX emits
|
|
8
|
-
// (`spread(el, mergeProps(bag), true)` + `insert(el, () => props.children)`, verified against
|
|
9
|
-
// babel-preset-solid's output). Writing those calls by hand would be the compiler's job done
|
|
10
|
-
// worse, and this is the file a Solid author reads first.
|
|
11
|
-
//
|
|
12
|
-
// There is NO renderView() in @symbiote-native/components, and there must not be
|
|
13
|
-
// (.claude/rules/component-render-fn-boundary.md). A render fn moves to core only when every
|
|
14
|
-
// input is a framework-agnostic VALUE; `children` is a live framework subtree that flows through
|
|
15
|
-
// the reconciler and is never converted back into a Descriptor. So descriptorToSolid has nothing
|
|
16
|
-
// to do here — View builds its host element directly, exactly as React's and Vue's do.
|
|
17
|
-
//
|
|
18
|
-
// NOTHING here destructures `props` at setup. Solid props are getters and a component body runs
|
|
19
|
-
// ONCE; splitProps is the idiomatic split that keeps the rest reactive, and every read of the
|
|
20
|
-
// remaining props happens inside the bag accessor, which `spread` re-runs as a render effect.
|
|
21
|
-
import { splitProps } from 'solid-js';
|
|
22
|
-
import { resolveAccessibilityProps, } from '@symbiote-native/components';
|
|
23
|
-
import { applyHostRef } from '../utils/host-ref.js';
|
|
24
|
-
import { withStableKeys } from '../utils/stable-keys.js';
|
|
25
|
-
export function View(props) {
|
|
26
|
-
// `children` and `ref` are pulled out rather than left to ride in the bag. Both are skipped by
|
|
27
|
-
// spreadExpression's prop loop anyway, but leaving them in would make the bag accessor depend on
|
|
28
|
-
// the children subtree (recomputing every prop when only a child changed) and would put `ref`
|
|
29
|
-
// behind spread's own ref effect, which re-runs — and so re-calls the caller's ref — on EVERY
|
|
30
|
-
// prop change. React calls a ref once per attach; this keeps that contract.
|
|
31
|
-
const [local, rest] = splitProps(props, ['children', 'ref', 'id']);
|
|
32
|
-
// RN's modern `id` is a W3C-named alias for `nativeID`: View.js copies it over
|
|
33
|
-
// (`processedProps.nativeID = id`), so `id` wins when both are set. Folded here, with the raw
|
|
34
|
-
// `id` key dropped so it never reaches Fabric — every non-function prop otherwise passes
|
|
35
|
-
// through to the slot untouched. `nativeID` is emitted UNCONDITIONALLY (undefined when neither
|
|
36
|
-
// is set) rather than conditionally like React's resolveId: a key that appears and disappears
|
|
37
|
-
// between runs is the exact hazard withStableKeys exists for, and not creating it is cheaper
|
|
38
|
-
// than widening it back.
|
|
39
|
-
const bag = withStableKeys(() => ({
|
|
40
|
-
...resolveAccessibilityProps(rest),
|
|
41
|
-
nativeID: local.id ?? rest.nativeID,
|
|
42
|
-
}));
|
|
43
|
-
const attachRef = (node) => {
|
|
44
|
-
applyHostRef(local.ref, node);
|
|
45
|
-
};
|
|
46
|
-
return (<symbiote-view ref={attachRef} {...bag()}>
|
|
47
|
-
{local.children}
|
|
48
|
-
</symbiote-view>);
|
|
49
|
-
}
|
package/build/state-style.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { resolveStateStyle, type IPressStateArgument, type IResolvedStateStyle, } from '@symbiote-native/components/state-style';
|
package/build/state-style.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Re-export only. The implementation is shared (`@symbiote-native/components`) because two adapters
|
|
2
|
-
// had written byte-identical copies; this file exists so the code a transform EMITS keeps importing
|
|
3
|
-
// from the adapter package the app already depends on, rather than reaching past it.
|
|
4
|
-
//
|
|
5
|
-
// Imported from the SUBPATH, not the barrel: every adapter barrel re-exports
|
|
6
|
-
// `@symbiote-native/components` wholesale, so a name on that barrel silently becomes public API on
|
|
7
|
-
// all five — which is how a transform internal nearly shipped as a supported export.
|
|
8
|
-
//
|
|
9
|
-
// Present on every adapter, including those with no lowering transform yet: a per-framework subpath
|
|
10
|
-
// that four of five declare is exactly the silent gap `tests/package-subpath-parity.test.ts` exists
|
|
11
|
-
// to catch, and the file costs a re-export. Deliberately NOT on the public barrel — the emitted
|
|
12
|
-
// code names it, app code does not.
|
|
13
|
-
export { resolveStateStyle, } from '@symbiote-native/components/state-style';
|