@symbiote-native/solid 0.1.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.
Files changed (106) hide show
  1. package/README.md +24 -14
  2. package/build/components/activity-indicator-props.d.ts +5 -0
  3. package/build/components/activity-indicator-props.js +1 -0
  4. package/build/components/button-props.d.ts +5 -0
  5. package/build/components/button-props.js +1 -0
  6. package/build/components/flat-list/index.jsx +3 -3
  7. package/build/components/{image-background.d.ts → image-background-props.d.ts} +2 -3
  8. package/build/components/image-background-props.js +1 -0
  9. package/build/components/image-props.d.ts +5 -0
  10. package/build/components/image-props.js +6 -0
  11. package/build/components/{input-accessory-view.d.ts → input-accessory-view-props.d.ts} +1 -2
  12. package/build/components/input-accessory-view-props.js +5 -0
  13. package/build/components/keyboard-avoiding-view.jsx +9 -4
  14. package/build/components/modal.jsx +6 -6
  15. package/build/components/{pressable.d.ts → pressable-props.d.ts} +8 -6
  16. package/build/components/pressable-props.js +13 -0
  17. package/build/components/{refresh-control.d.ts → refresh-control-props.d.ts} +3 -3
  18. package/build/components/refresh-control-props.js +7 -0
  19. package/build/components/safe-area-view-props.d.ts +10 -0
  20. package/build/components/safe-area-view-props.js +5 -0
  21. package/build/components/{scroll-view/shared.d.ts → scroll-view-props.d.ts} +7 -13
  22. package/build/components/scroll-view-props.js +29 -0
  23. package/build/components/switch-props.d.ts +6 -0
  24. package/build/components/switch-props.js +5 -0
  25. package/build/components/text-input-props.d.ts +8 -0
  26. package/build/components/text-input-props.js +1 -0
  27. package/build/components/{text.d.ts → text-props.d.ts} +3 -3
  28. package/build/components/text-props.js +11 -0
  29. package/build/components/touchable-native-feedback/touchable-native-feedback-props.d.ts +8 -0
  30. package/build/components/touchable-native-feedback/touchable-native-feedback-props.js +1 -0
  31. package/build/components/touchable-props.d.ts +18 -0
  32. package/build/components/touchable-props.js +1 -0
  33. package/build/components/touchable-without-feedback/touchable-without-feedback-props.d.ts +6 -0
  34. package/build/components/touchable-without-feedback/touchable-without-feedback-props.js +1 -0
  35. package/build/components/{view.d.ts → view-props.d.ts} +2 -3
  36. package/build/components/view-props.js +11 -0
  37. package/build/components/virtualized-list/index.android.js +5 -4
  38. package/build/components/virtualized-list/index.ios.js +6 -6
  39. package/build/components/virtualized-list/shared.d.ts +1 -3
  40. package/build/components/virtualized-list/shared.jsx +87 -98
  41. package/build/components/virtualized-list/sticky-header.d.ts +6 -0
  42. package/build/components/{scroll-view → virtualized-list}/sticky-header.jsx +28 -36
  43. package/build/components.d.ts +20 -30
  44. package/build/components.js +6 -33
  45. package/build/create-portal/index.jsx +1 -1
  46. package/build/descriptor-to-solid.js +1 -1
  47. package/build/host-instance.js +3 -3
  48. package/build/index.d.ts +2 -0
  49. package/build/index.js +13 -3
  50. package/build/jsx-runtime.d.ts +39 -2
  51. package/build/modules/animated/create-animated-component.d.ts +1 -1
  52. package/build/modules/animated/create-animated-component.jsx +22 -0
  53. package/build/modules/animated/index.d.ts +0 -4
  54. package/build/modules/animated/index.js +16 -22
  55. package/build/modules/image.d.ts +3 -0
  56. package/build/modules/image.js +12 -0
  57. package/build/register.d.ts +1 -0
  58. package/build/register.js +15 -0
  59. package/build/renderer.d.ts +1 -0
  60. package/build/renderer.js +133 -6
  61. package/build/utils/stable-keys.d.ts +1 -1
  62. package/build/utils/stable-keys.js +6 -5
  63. package/metro-css-parser.cjs +2 -1
  64. package/package.json +18 -7
  65. package/build/components/activity-indicator/index.android.d.ts +0 -2
  66. package/build/components/activity-indicator/index.android.js +0 -11
  67. package/build/components/activity-indicator/index.d.ts +0 -1
  68. package/build/components/activity-indicator/index.ios.d.ts +0 -2
  69. package/build/components/activity-indicator/index.ios.js +0 -10
  70. package/build/components/activity-indicator/index.js +0 -4
  71. package/build/components/activity-indicator/shared.d.ts +0 -8
  72. package/build/components/activity-indicator/shared.js +0 -51
  73. package/build/components/button.d.ts +0 -7
  74. package/build/components/button.jsx +0 -45
  75. package/build/components/image-background.jsx +0 -74
  76. package/build/components/image.d.ts +0 -9
  77. package/build/components/image.js +0 -75
  78. package/build/components/input-accessory-view.jsx +0 -39
  79. package/build/components/pressable.jsx +0 -185
  80. package/build/components/refresh-control.jsx +0 -36
  81. package/build/components/safe-area-view.d.ts +0 -10
  82. package/build/components/safe-area-view.jsx +0 -24
  83. package/build/components/scroll-view/index.android.d.ts +0 -2
  84. package/build/components/scroll-view/index.android.js +0 -11
  85. package/build/components/scroll-view/index.d.ts +0 -2
  86. package/build/components/scroll-view/index.ios.d.ts +0 -2
  87. package/build/components/scroll-view/index.ios.js +0 -8
  88. package/build/components/scroll-view/index.js +0 -9
  89. package/build/components/scroll-view/shared.jsx +0 -334
  90. package/build/components/scroll-view/sticky-header.d.ts +0 -18
  91. package/build/components/switch/index.android.d.ts +0 -2
  92. package/build/components/switch/index.android.js +0 -12
  93. package/build/components/switch/index.d.ts +0 -1
  94. package/build/components/switch/index.ios.d.ts +0 -2
  95. package/build/components/switch/index.ios.js +0 -11
  96. package/build/components/switch/index.js +0 -4
  97. package/build/components/switch/shared.d.ts +0 -11
  98. package/build/components/switch/shared.js +0 -87
  99. package/build/components/text-input.d.ts +0 -10
  100. package/build/components/text-input.js +0 -268
  101. package/build/components/text.jsx +0 -27
  102. package/build/components/touchable/index.d.ts +0 -22
  103. package/build/components/touchable/index.jsx +0 -247
  104. package/build/components/touchable-native-feedback/index.d.ts +0 -16
  105. package/build/components/touchable-native-feedback/index.jsx +0 -68
  106. package/build/components/view.jsx +0 -49
@@ -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
- }