@symbiote-native/components 0.4.0 → 0.5.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 (39) hide show
  1. package/README.md +10 -2
  2. package/build/accessibility-props.js +2 -1
  3. package/build/bootstrap/index.js +1 -1
  4. package/build/component-names/index.android.js +1 -1
  5. package/build/component-names/index.ios.js +1 -1
  6. package/build/component-names/shared.js +4 -1
  7. package/build/descriptor.d.ts +8 -0
  8. package/build/descriptor.js +27 -0
  9. package/build/index.d.ts +19 -11
  10. package/build/index.js +12 -5
  11. package/build/state/pressable.js +13 -3
  12. package/build/state/sticky-header-reducer.js +28 -5
  13. package/build/state/switch.js +1 -1
  14. package/build/state/text-input.d.ts +2 -1
  15. package/build/state/text-input.js +35 -8
  16. package/build/state/touchable.d.ts +30 -1
  17. package/build/state/touchable.js +94 -5
  18. package/build/state/virtualized-list-diagnostics.d.ts +31 -0
  19. package/build/state/virtualized-list-diagnostics.js +33 -0
  20. package/build/state/virtualized-list-reducer.d.ts +14 -0
  21. package/build/state/virtualized-list-reducer.js +179 -45
  22. package/build/state/virtualized-list.d.ts +5 -2
  23. package/build/state/virtualized-list.js +143 -34
  24. package/build/text-props.d.ts +9 -0
  25. package/build/text-props.js +24 -0
  26. package/build/view/render-activity-indicator.js +11 -3
  27. package/build/view/render-image/index.js +13 -3
  28. package/build/view/render-input-accessory-view.js +5 -2
  29. package/build/view/render-keyboard-avoiding-view.d.ts +14 -2
  30. package/build/view/render-keyboard-avoiding-view.js +52 -6
  31. package/build/view/render-modal.js +4 -2
  32. package/build/view/render-pressable/index.js +3 -1
  33. package/build/view/render-scroll-sticky.js +1 -1
  34. package/build/view/render-scroll-view.js +9 -3
  35. package/build/view/render-switch.js +4 -1
  36. package/build/view/render-touchable-highlight.d.ts +11 -1
  37. package/build/view/render-touchable-highlight.js +11 -10
  38. package/build/view/render-touchable-native-feedback.js +5 -1
  39. package/package.json +2 -2
@@ -1,12 +1,13 @@
1
1
  // TouchableHighlight underlay: the shared render decision (framework-agnostic). RN drives the
2
- // highlight with setState (not Animated) — while pressed it paints underlayColor + lowers the child
3
- // opacity, at rest it is the bare style (TouchableHighlight.js). This 3-line gating was triplicated
4
- // verbatim across adapters; it lives here once, prop-driven. Each adapter passes its own resolved
5
- // style base (React the raw style, Angular the anchor+style array, Vue the untyped attrs style) plus
6
- // the live `pressed`, so the base is generic — the overlay is layered on top when pressed.
7
- export function highlightPressedStyle(pressed, style, underlayColor, activeOpacity) {
8
- if (!pressed)
9
- return style;
10
- const overlay = { backgroundColor: underlayColor, opacity: activeOpacity };
11
- return [style, overlay];
2
+ // highlight with setState, not Animated — while shown it paints underlayColor and lowers the child
3
+ // opacity; at rest it is the bare style (TouchableHighlight.js).
4
+ import { DEFAULT_HIGHLIGHT_CHILD_OPACITY, DEFAULT_UNDERLAY_COLOR, } from '../state/touchable.js';
5
+ // undefined = paint nothing extra, which is RN's `extraStyles: null` state.
6
+ export function resolveHighlightExtraStyles(view) {
7
+ if (!view.shown || !view.hasPressHandler)
8
+ return undefined;
9
+ return {
10
+ underlay: { backgroundColor: view.underlayColor ?? DEFAULT_UNDERLAY_COLOR },
11
+ child: { opacity: view.activeOpacity ?? DEFAULT_HIGHLIGHT_CHILD_OPACITY },
12
+ };
12
13
  }
@@ -14,7 +14,11 @@ export function canUseNativeForeground() {
14
14
  Platform.Version >= ANDROID_FOREGROUND_MIN_VERSION);
15
15
  }
16
16
  export function selectableBackground(rippleRadius) {
17
- return { type: 'ThemeAttrAndroid', attribute: 'selectableItemBackground', rippleRadius };
17
+ return {
18
+ type: 'ThemeAttrAndroid',
19
+ attribute: 'selectableItemBackground',
20
+ rippleRadius,
21
+ };
18
22
  }
19
23
  export function selectableBackgroundBorderless(rippleRadius) {
20
24
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbiote-native/components",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Framework-agnostic component logic (state machines + render functions) for SymbioteNative — written once, inherited by every adapter (React, Vue, Angular, ...).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^26.0.0",
42
- "@symbiote-native/engine": "0.2.0"
42
+ "@symbiote-native/engine": "0.3.0"
43
43
  },
44
44
  "scripts": {
45
45
  "typecheck": "tsc --build",