@symbiote-native/engine 1.2.0 → 1.3.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 (110) 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/accessibility-props.d.ts +0 -11
  7. package/build/accessibility-props.js +30 -68
  8. package/build/alert/shared.d.ts +1 -1
  9. package/build/alert/shared.js +3 -7
  10. package/build/animated/graph.js +1 -1
  11. package/build/animated/leaf-lifecycle.js +2 -2
  12. package/build/app-state/index.d.ts +1 -1
  13. package/build/app-state/index.js +35 -27
  14. package/build/asset-source-resolver.d.ts +2 -0
  15. package/build/asset-source-resolver.js +13 -0
  16. package/build/back-handler/index.d.ts +7 -6
  17. package/build/back-handler/index.js +19 -16
  18. package/build/debug.js +8 -22
  19. package/build/dispatch.js +3 -9
  20. package/build/events/index.js +12 -3
  21. package/build/fabric-props.js +75 -180
  22. package/build/fabric.d.ts +2 -8
  23. package/build/fabric.js +27 -33
  24. package/build/host-access.d.ts +1 -128
  25. package/build/host-access.js +96 -205
  26. package/build/host-behavior.d.ts +1 -100
  27. package/build/host-behavior.js +125 -311
  28. package/build/image-loader.d.ts +4 -2
  29. package/build/image-loader.js +24 -48
  30. package/build/image-source-resolver.js +3 -7
  31. package/build/image-source-write.d.ts +1 -12
  32. package/build/image-source-write.js +28 -36
  33. package/build/imperative.d.ts +0 -28
  34. package/build/imperative.js +42 -92
  35. package/build/index.d.ts +3 -2
  36. package/build/index.js +30 -43
  37. package/build/invariant.d.ts +1 -0
  38. package/build/invariant.js +10 -0
  39. package/build/keyboard/index.js +11 -32
  40. package/build/linking/index.android.js +5 -3
  41. package/build/linking/shared.d.ts +1 -1
  42. package/build/linking/shared.js +16 -19
  43. package/build/mutation-buffer.d.ts +0 -177
  44. package/build/mutation-buffer.js +137 -308
  45. package/build/native-engine.d.ts +0 -102
  46. package/build/native-engine.js +38 -98
  47. package/build/native-events.d.ts +5 -0
  48. package/build/native-events.js +30 -18
  49. package/build/native-tree-host.d.ts +0 -21
  50. package/build/native-tree-host.js +14 -31
  51. package/build/node.d.ts +0 -212
  52. package/build/node.js +354 -774
  53. package/build/permissions-android/index.android.d.ts +59 -0
  54. package/build/permissions-android/index.android.js +47 -0
  55. package/build/permissions-android/index.d.ts +1 -115
  56. package/build/permissions-android/index.ios.d.ts +59 -0
  57. package/build/permissions-android/index.ios.js +31 -0
  58. package/build/permissions-android/index.js +3 -184
  59. package/build/permissions-android/shared.d.ts +63 -0
  60. package/build/permissions-android/shared.js +66 -0
  61. package/build/platform/index.android.js +3 -5
  62. package/build/platform/index.ios.js +3 -3
  63. package/build/platform/shared.d.ts +4 -0
  64. package/build/platform/shared.js +9 -0
  65. package/build/platform-color/index.android.d.ts +4 -0
  66. package/build/platform-color/index.android.js +7 -0
  67. package/build/platform-color/index.d.ts +2 -20
  68. package/build/platform-color/index.js +1 -45
  69. package/build/platform-color/shared.d.ts +21 -0
  70. package/build/platform-color/shared.js +41 -0
  71. package/build/post-commit.js +3 -8
  72. package/build/process-aspect-ratio.js +3 -7
  73. package/build/process-background-longhands.js +10 -19
  74. package/build/process-filter.js +11 -19
  75. package/build/process-font-variant.js +3 -7
  76. package/build/registry.d.ts +0 -33
  77. package/build/registry.js +22 -57
  78. package/build/report-error.js +4 -18
  79. package/build/settings/index.android.d.ts +6 -0
  80. package/build/settings/index.android.js +21 -0
  81. package/build/settings/index.d.ts +1 -8
  82. package/build/settings/index.ios.d.ts +8 -0
  83. package/build/settings/index.ios.js +122 -0
  84. package/build/settings/index.js +3 -122
  85. package/build/share/index.android.js +9 -32
  86. package/build/share/index.ios.js +14 -15
  87. package/build/share/shared.d.ts +4 -2
  88. package/build/share/shared.js +7 -10
  89. package/build/status-bar/index.android.js +1 -1
  90. package/build/status-bar/index.ios.js +4 -3
  91. package/build/structured-style.d.ts +0 -9
  92. package/build/structured-style.js +16 -31
  93. package/build/styles.js +3 -6
  94. package/build/surface.d.ts +0 -26
  95. package/build/surface.js +29 -76
  96. package/build/text-input-state.js +4 -8
  97. package/build/toast-android/index.android.d.ts +10 -0
  98. package/build/toast-android/index.android.js +108 -0
  99. package/build/toast-android/index.d.ts +1 -10
  100. package/build/toast-android/index.ios.d.ts +10 -0
  101. package/build/toast-android/index.ios.js +19 -0
  102. package/build/toast-android/index.js +3 -108
  103. package/build/touch-history.js +5 -11
  104. package/build/tree-host.d.ts +0 -270
  105. package/build/tree-host.js +63 -153
  106. package/build/view-config.js +17 -37
  107. package/cpp/SymbioteFabricProps.cpp +204 -120
  108. package/cpp/SymbioteFabricProps.h +5 -0
  109. package/cpp/SymbioteTree.cpp +20 -6
  110. 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.1",
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.4"
75
75
  },
76
76
  "scripts": {
77
77
  "typecheck": "tsc --build",