@symbiote-native/components 2.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 +8 -9
- package/build/accessibility-props.d.ts +1 -1
- package/build/accessibility-props.js +2 -2
- package/build/behaviors/activity-indicator/shared.js +41 -70
- package/build/behaviors/button.d.ts +11 -0
- package/build/behaviors/button.js +101 -89
- package/build/behaviors/image-background.d.ts +1 -0
- package/build/behaviors/image-background.js +97 -81
- package/build/behaviors/image.d.ts +0 -1
- package/build/behaviors/image.js +24 -105
- package/build/behaviors/input-accessory-view.d.ts +0 -1
- package/build/behaviors/input-accessory-view.js +47 -53
- package/build/behaviors/pressable.d.ts +1 -1
- package/build/behaviors/pressable.js +68 -97
- package/build/behaviors/refresh-control.js +15 -2
- package/build/behaviors/scroll-view/index.android.js +25 -37
- package/build/behaviors/scroll-view/index.d.ts +1 -0
- package/build/behaviors/scroll-view/index.js +3 -0
- package/build/behaviors/scroll-view/responder.d.ts +4 -0
- package/build/behaviors/scroll-view/responder.js +202 -0
- package/build/behaviors/scroll-view/shared.d.ts +1 -3
- package/build/behaviors/scroll-view/shared.js +95 -95
- package/build/behaviors/scroll-view/sticky.d.ts +1 -0
- package/build/behaviors/scroll-view/sticky.js +62 -49
- package/build/behaviors/switch.js +43 -86
- package/build/behaviors/text-input.js +219 -107
- package/build/behaviors/touchable-highlight.js +74 -61
- package/build/behaviors/touchable-native-feedback.js +43 -122
- package/build/behaviors/touchable-opacity.js +71 -59
- package/build/behaviors/touchable-without-feedback.js +35 -100
- package/build/component-names/index.android.js +7 -11
- package/build/component-names/index.ios.js +0 -7
- package/build/component-names/shared.d.ts +1 -1
- package/build/index.d.ts +15 -21
- package/build/index.js +21 -28
- package/build/resolve-intrinsic.js +3 -9
- package/build/scroll-view-commands.d.ts +1 -9
- package/build/scroll-view-commands.js +13 -74
- package/build/state/flat-list.d.ts +2 -2
- package/build/state/flat-list.js +10 -2
- package/build/state/pressable.d.ts +6 -1
- package/build/state/pressable.js +63 -28
- package/build/state/section-list.d.ts +2 -0
- package/build/state/section-list.js +14 -7
- package/build/state/text-input.d.ts +7 -40
- package/build/state/text-input.js +17 -186
- package/build/state/touchable.d.ts +1 -0
- package/build/state/touchable.js +11 -8
- package/build/state/virtualized-list-reducer.d.ts +2 -2
- package/build/state/virtualized-list.d.ts +6 -6
- package/build/state/virtualized-list.js +71 -37
- package/build/text-props.d.ts +0 -8
- package/build/text-props.js +14 -25
- package/build/view/render-button.d.ts +1 -29
- package/build/view/render-button.js +44 -81
- package/build/view/render-image/index.d.ts +14 -1
- package/build/view/render-image/index.js +22 -147
- package/build/view/render-input-accessory-view.d.ts +1 -5
- package/build/view/render-input-accessory-view.js +26 -48
- package/build/view/render-keyboard-avoiding-view.d.ts +7 -1
- package/build/view/render-keyboard-avoiding-view.js +40 -1
- package/build/view/render-modal.d.ts +1 -1
- package/build/view/render-modal.js +15 -5
- package/build/view/render-pressable/index.d.ts +1 -0
- package/build/view/render-pressable/index.js +4 -0
- package/build/view/render-scroll-view.d.ts +0 -4
- package/build/view/render-scroll-view.js +3 -49
- package/build/view/render-switch.d.ts +0 -14
- package/build/view/render-switch.js +4 -42
- package/build/view/render-touchable-highlight.d.ts +1 -0
- package/build/view/render-touchable-native-feedback.d.ts +0 -1
- package/build/view/render-touchable-native-feedback.js +15 -9
- package/host-primitives.cjs +49 -203
- package/host-primitives.d.cts +0 -1
- package/package.json +3 -7
- package/build/fold-host-bag.d.ts +0 -15
- package/build/fold-host-bag.js +0 -99
- package/build/view/render-text-input.d.ts +0 -11
- package/build/view/render-text-input.js +0 -39
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { IDescriptor } from '../descriptor';
|
|
2
|
-
import type { IFoldedTextInputProps, ITextInputSelection } from '../state/text-input';
|
|
3
|
-
export type ITextInputViewProps = {
|
|
4
|
-
multiline: boolean;
|
|
5
|
-
text: string | undefined;
|
|
6
|
-
mostRecentEventCount: number;
|
|
7
|
-
selection?: ITextInputSelection;
|
|
8
|
-
folded: IFoldedTextInputProps;
|
|
9
|
-
passthrough: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
export declare function renderTextInput(view: ITextInputViewProps): IDescriptor;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// TextInput: the render half (framework-agnostic). Picks the intrinsic (single- vs multiline)
|
|
2
|
-
// and maps the resolved props onto it: the controlled value rides as the private `text` prop
|
|
3
|
-
// plus `mostRecentEventCount`, the W3C/alias folds arrive pre-resolved in `folded`, and the
|
|
4
|
-
// ref + the change/focus/blur handlers + every pass-through prop (accessibility, testID, the
|
|
5
|
-
// remaining native events) arrive folded into `passthrough` and land on the host untouched.
|
|
6
|
-
// Pure and prop-driven; no hooks, no events. The adapter owns those.
|
|
7
|
-
import { dlog } from '@symbiote-native/engine';
|
|
8
|
-
import { el } from '../descriptor.js';
|
|
9
|
-
// One host element per native input class. Text carries the only non-trivial nesting elsewhere;
|
|
10
|
-
// here the choice is binary and runtime (the `multiline` prop), so the module stays flat.
|
|
11
|
-
// The `-managed` spelling, NOT the plain one the lowering transforms emit. Both resolve to the
|
|
12
|
-
// same native view; the tag is what decides whether the engine's TextInput machine attaches, and
|
|
13
|
-
// on this path the adapter's own lifecycle already owns that state. Sharing the tag would run both
|
|
14
|
-
// copies at once. Full reasoning in `component-names/shared.ts`.
|
|
15
|
-
const SINGLELINE_INTRINSIC = 'text-input-managed';
|
|
16
|
-
const MULTILINE_INTRINSIC = 'text-input-multiline-managed';
|
|
17
|
-
export function renderTextInput(view) {
|
|
18
|
-
const intrinsic = view.multiline ? MULTILINE_INTRINSIC : SINGLELINE_INTRINSIC;
|
|
19
|
-
dlog(`TextInput render multiline=${String(view.multiline)} ` +
|
|
20
|
-
`text=${JSON.stringify(view.text)} count=${view.mostRecentEventCount}`);
|
|
21
|
-
const props = {
|
|
22
|
-
...view.passthrough,
|
|
23
|
-
text: view.text,
|
|
24
|
-
mostRecentEventCount: view.mostRecentEventCount,
|
|
25
|
-
selection: view.selection,
|
|
26
|
-
keyboardType: view.folded.keyboardType,
|
|
27
|
-
returnKeyType: view.folded.returnKeyType,
|
|
28
|
-
editable: view.folded.editable,
|
|
29
|
-
submitBehavior: view.folded.submitBehavior,
|
|
30
|
-
selectionColor: view.folded.selectionColor,
|
|
31
|
-
cursorColor: view.folded.cursorColor,
|
|
32
|
-
selectionHandleColor: view.folded.selectionHandleColor,
|
|
33
|
-
underlineColorAndroid: view.folded.underlineColorAndroid,
|
|
34
|
-
autoComplete: view.folded.autoComplete,
|
|
35
|
-
textContentType: view.folded.textContentType,
|
|
36
|
-
showSoftInputOnFocus: view.folded.showSoftInputOnFocus,
|
|
37
|
-
};
|
|
38
|
-
return el(intrinsic, props);
|
|
39
|
-
}
|