@symbiote-native/engine 1.2.0 → 1.3.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 (71) hide show
  1. package/android/CMakeLists.txt +31 -1
  2. package/android/build.gradle +4 -1
  3. package/build/accessibility-info/index.android.js +21 -17
  4. package/build/accessibility-info/index.ios.js +2 -0
  5. package/build/accessibility-info/shared.d.ts +1 -1
  6. package/build/alert/shared.d.ts +1 -1
  7. package/build/alert/shared.js +3 -7
  8. package/build/app-state/index.d.ts +1 -1
  9. package/build/app-state/index.js +35 -27
  10. package/build/back-handler/index.d.ts +7 -2
  11. package/build/back-handler/index.js +19 -10
  12. package/build/events/index.js +10 -1
  13. package/build/fabric-props.js +1 -1
  14. package/build/fabric.d.ts +7 -0
  15. package/build/fabric.js +14 -0
  16. package/build/host-behavior.d.ts +1 -0
  17. package/build/image-loader.d.ts +4 -2
  18. package/build/image-loader.js +14 -25
  19. package/build/image-source-write.d.ts +1 -1
  20. package/build/image-source-write.js +14 -2
  21. package/build/index.d.ts +2 -2
  22. package/build/index.js +6 -6
  23. package/build/invariant.d.ts +1 -0
  24. package/build/invariant.js +10 -0
  25. package/build/keyboard/index.js +11 -32
  26. package/build/linking/index.android.js +5 -3
  27. package/build/linking/shared.d.ts +1 -1
  28. package/build/linking/shared.js +16 -19
  29. package/build/native-events.d.ts +5 -0
  30. package/build/native-events.js +21 -0
  31. package/build/node.js +18 -2
  32. package/build/permissions-android/index.android.d.ts +59 -0
  33. package/build/permissions-android/index.android.js +47 -0
  34. package/build/permissions-android/index.d.ts +1 -115
  35. package/build/permissions-android/index.ios.d.ts +59 -0
  36. package/build/permissions-android/index.ios.js +31 -0
  37. package/build/permissions-android/index.js +3 -184
  38. package/build/permissions-android/shared.d.ts +63 -0
  39. package/build/permissions-android/shared.js +66 -0
  40. package/build/platform/index.android.js +3 -5
  41. package/build/platform/index.ios.js +3 -3
  42. package/build/platform/shared.d.ts +4 -0
  43. package/build/platform/shared.js +9 -0
  44. package/build/platform-color/index.android.d.ts +4 -0
  45. package/build/platform-color/index.android.js +7 -0
  46. package/build/platform-color/index.d.ts +2 -20
  47. package/build/platform-color/index.js +1 -45
  48. package/build/platform-color/shared.d.ts +21 -0
  49. package/build/platform-color/shared.js +41 -0
  50. package/build/settings/index.android.d.ts +6 -0
  51. package/build/settings/index.android.js +21 -0
  52. package/build/settings/index.d.ts +1 -8
  53. package/build/settings/index.ios.d.ts +8 -0
  54. package/build/settings/index.ios.js +122 -0
  55. package/build/settings/index.js +3 -122
  56. package/build/share/index.android.js +9 -32
  57. package/build/share/index.ios.js +14 -15
  58. package/build/share/shared.d.ts +4 -2
  59. package/build/share/shared.js +7 -10
  60. package/build/status-bar/index.android.js +1 -1
  61. package/build/status-bar/index.ios.js +4 -3
  62. package/build/toast-android/index.android.d.ts +10 -0
  63. package/build/toast-android/index.android.js +108 -0
  64. package/build/toast-android/index.d.ts +1 -10
  65. package/build/toast-android/index.ios.d.ts +10 -0
  66. package/build/toast-android/index.ios.js +19 -0
  67. package/build/toast-android/index.js +3 -108
  68. package/cpp/SymbioteFabricProps.cpp +204 -120
  69. package/cpp/SymbioteFabricProps.h +5 -0
  70. package/cpp/SymbioteTree.cpp +20 -6
  71. package/package.json +2 -2
@@ -18,9 +18,10 @@
18
18
  #include <react/renderer/uimanager/primitives.h>
19
19
 
20
20
  // `react/renderer/dom/` is NOT among the header folders ReactAndroid copies into its prefab
21
- // (`ReactAndroid/build.gradle.kts` lists uimanager, mounting, core, … and no dom), so including it
22
- // unconditionally breaks the Android build of this same file. iOS compiles against the full
23
- // ReactCommon tree and has it.
21
+ // (`ReactAndroid/build.gradle.kts` lists uimanager, mounting, core, … and no dom), though
22
+ // libreactnative.so exports the functions. `android/CMakeLists.txt` copies `DOM.h` from the app's
23
+ // react-native onto the include path; without it this falls back to the throwing stubs. iOS compiles
24
+ // against the full ReactCommon tree and has it.
24
25
  //
25
26
  // Detected rather than branched on `__ANDROID__`, because the fact is about the TOOLCHAIN'S HEADERS,
26
27
  // not about the platform — and it self-heals the day upstream exports the folder. The three
@@ -73,6 +74,13 @@ constexpr int32_t kOpCreateVoid = 13;
73
74
  // The owned listener names any platform rule reads, one bit each — see `Node::pressListeners`.
74
75
  // `press` is deliberately bit 0 so the `focusable` question is the cheapest of the two.
75
76
  constexpr uint8_t kPressListenerPress = 1u << 0;
77
+ // The four press names; `hasAnyPressListener` asks about these and nothing else.
78
+ constexpr uint8_t kPressListenerMask = 0x0f;
79
+ // ScrollView's `sendMomentumEvents` (`ScrollView.js:1801-1804`) asks about either of these two.
80
+ constexpr uint8_t kMomentumListenerMask = (1u << 4) | (1u << 5);
81
+ // Text's pressability (`Text.js:145-163`): onPress / onLongPress, plus onStartShouldSetResponder.
82
+ constexpr uint8_t kTextPressMask = kPressListenerPress | (1u << 3);
83
+ constexpr uint8_t kStartShouldSetResponder = 1u << 6;
76
84
 
77
85
  /** 0 for a name the host has no rule for, which is nearly all of them. */
78
86
  uint8_t pressListenerBit(const std::string &name) {
@@ -80,6 +88,9 @@ uint8_t pressListenerBit(const std::string &name) {
80
88
  if (name == "pressIn") return 1u << 1;
81
89
  if (name == "pressOut") return 1u << 2;
82
90
  if (name == "longPress") return 1u << 3;
91
+ if (name == "momentumScrollBegin") return 1u << 4;
92
+ if (name == "momentumScrollEnd") return 1u << 5;
93
+ if (name == "startShouldSetResponder") return kStartShouldSetResponder;
83
94
  return 0;
84
95
  }
85
96
 
@@ -1055,15 +1066,18 @@ IOwner ownerOf(const Node &node) {
1055
1066
  node.parent->tagName.c_str(),
1056
1067
  (node.parent->pressListeners & kPressListenerPress) != 0,
1057
1068
  node.parent->underlayShown,
1058
- node.parent->pressListeners != 0};
1069
+ (node.parent->pressListeners & kPressListenerMask) != 0};
1059
1070
  }
1060
1071
 
1061
1072
  /** The node's own non-prop bits, unpacked from the mask the ops maintain. See `ISelf`. */
1062
1073
  ISelf selfOf(const Node &node) {
1063
1074
  return ISelf{
1064
1075
  (node.pressListeners & kPressListenerPress) != 0,
1065
- node.pressListeners != 0,
1066
- node.underlayShown};
1076
+ (node.pressListeners & kPressListenerMask) != 0,
1077
+ node.underlayShown,
1078
+ (node.pressListeners & kMomentumListenerMask) != 0,
1079
+ (node.pressListeners & kTextPressMask) != 0,
1080
+ (node.pressListeners & kStartShouldSetResponder) != 0};
1067
1081
  }
1068
1082
 
1069
1083
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbiote-native/engine",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "SymbioteNative's retained shadow-tree engine — clone-on-write commit path + event normalization over React Native Fabric, shared by every framework adapter.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "peerDependenciesMeta": {},
73
73
  "devDependencies": {
74
- "@symbiote-native/test-utils": "0.4.1"
74
+ "@symbiote-native/test-utils": "0.4.2"
75
75
  },
76
76
  "scripts": {
77
77
  "typecheck": "tsc --build",