@symbiote-native/components 2.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +8 -9
  2. package/build/accessibility-props.d.ts +1 -1
  3. package/build/accessibility-props.js +2 -2
  4. package/build/behaviors/activity-indicator/shared.js +41 -70
  5. package/build/behaviors/button.d.ts +11 -0
  6. package/build/behaviors/button.js +101 -89
  7. package/build/behaviors/image-background.d.ts +1 -0
  8. package/build/behaviors/image-background.js +97 -81
  9. package/build/behaviors/image.d.ts +0 -1
  10. package/build/behaviors/image.js +24 -105
  11. package/build/behaviors/input-accessory-view.d.ts +0 -1
  12. package/build/behaviors/input-accessory-view.js +47 -53
  13. package/build/behaviors/pressable.d.ts +1 -1
  14. package/build/behaviors/pressable.js +89 -100
  15. package/build/behaviors/refresh-control.js +15 -2
  16. package/build/behaviors/scroll-view/index.android.js +25 -37
  17. package/build/behaviors/scroll-view/index.d.ts +1 -0
  18. package/build/behaviors/scroll-view/index.js +3 -0
  19. package/build/behaviors/scroll-view/responder.d.ts +4 -0
  20. package/build/behaviors/scroll-view/responder.js +202 -0
  21. package/build/behaviors/scroll-view/shared.d.ts +1 -3
  22. package/build/behaviors/scroll-view/shared.js +95 -95
  23. package/build/behaviors/scroll-view/sticky.d.ts +1 -0
  24. package/build/behaviors/scroll-view/sticky.js +62 -49
  25. package/build/behaviors/switch.js +43 -86
  26. package/build/behaviors/text-input.js +219 -107
  27. package/build/behaviors/touchable-highlight.js +74 -61
  28. package/build/behaviors/touchable-native-feedback.js +43 -122
  29. package/build/behaviors/touchable-opacity.js +71 -59
  30. package/build/behaviors/touchable-without-feedback.js +35 -100
  31. package/build/component-names/index.android.js +7 -11
  32. package/build/component-names/index.ios.js +0 -7
  33. package/build/component-names/shared.d.ts +1 -1
  34. package/build/index.d.ts +15 -21
  35. package/build/index.js +21 -28
  36. package/build/resolve-intrinsic.js +3 -9
  37. package/build/scroll-view-commands.d.ts +1 -9
  38. package/build/scroll-view-commands.js +13 -74
  39. package/build/state/flat-list.d.ts +2 -2
  40. package/build/state/flat-list.js +10 -2
  41. package/build/state/pressable.d.ts +6 -1
  42. package/build/state/pressable.js +63 -28
  43. package/build/state/section-list.d.ts +2 -0
  44. package/build/state/section-list.js +14 -7
  45. package/build/state/text-input.d.ts +7 -40
  46. package/build/state/text-input.js +17 -186
  47. package/build/state/touchable.d.ts +1 -0
  48. package/build/state/touchable.js +11 -8
  49. package/build/state/virtualized-list-reducer.d.ts +2 -2
  50. package/build/state/virtualized-list.d.ts +6 -6
  51. package/build/state/virtualized-list.js +71 -37
  52. package/build/text-props.d.ts +0 -8
  53. package/build/text-props.js +14 -25
  54. package/build/view/render-button.d.ts +1 -29
  55. package/build/view/render-button.js +44 -81
  56. package/build/view/render-image/index.d.ts +14 -1
  57. package/build/view/render-image/index.js +22 -147
  58. package/build/view/render-input-accessory-view.d.ts +1 -5
  59. package/build/view/render-input-accessory-view.js +26 -48
  60. package/build/view/render-keyboard-avoiding-view.d.ts +7 -1
  61. package/build/view/render-keyboard-avoiding-view.js +40 -1
  62. package/build/view/render-modal.d.ts +1 -1
  63. package/build/view/render-modal.js +15 -5
  64. package/build/view/render-pressable/index.d.ts +1 -0
  65. package/build/view/render-pressable/index.js +4 -0
  66. package/build/view/render-scroll-view.d.ts +0 -4
  67. package/build/view/render-scroll-view.js +3 -49
  68. package/build/view/render-switch.d.ts +0 -14
  69. package/build/view/render-switch.js +4 -42
  70. package/build/view/render-touchable-highlight.d.ts +1 -0
  71. package/build/view/render-touchable-native-feedback.d.ts +0 -1
  72. package/build/view/render-touchable-native-feedback.js +15 -9
  73. package/host-primitives.cjs +49 -203
  74. package/host-primitives.d.cts +0 -1
  75. package/package.json +3 -7
  76. package/build/fold-host-bag.d.ts +0 -15
  77. package/build/fold-host-bag.js +0 -99
  78. package/build/view/render-text-input.d.ts +0 -11
  79. 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
- }