aix 0.1.0-alpha.1 → 0.2.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 (50) hide show
  1. package/ios/HybridAix.swift +22 -8
  2. package/lib/commonjs/aix.js +11 -0
  3. package/lib/commonjs/aix.js.map +1 -1
  4. package/lib/commonjs/hooks/useContentInsetHandler.js +30 -0
  5. package/lib/commonjs/hooks/useContentInsetHandler.js.map +1 -0
  6. package/lib/commonjs/index.js +9 -1
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/module/aix.js +11 -0
  9. package/lib/module/aix.js.map +1 -1
  10. package/lib/module/hooks/useContentInsetHandler.js +26 -0
  11. package/lib/module/hooks/useContentInsetHandler.js.map +1 -0
  12. package/lib/module/index.js +1 -0
  13. package/lib/module/index.js.map +1 -1
  14. package/lib/typescript/src/aix.d.ts +7 -3
  15. package/lib/typescript/src/aix.d.ts.map +1 -1
  16. package/lib/typescript/src/hooks/useContentInsetHandler.d.ts +21 -0
  17. package/lib/typescript/src/hooks/useContentInsetHandler.d.ts.map +1 -0
  18. package/lib/typescript/src/index.d.ts +2 -0
  19. package/lib/typescript/src/index.d.ts.map +1 -1
  20. package/lib/typescript/src/views/aix.nitro.d.ts +30 -0
  21. package/lib/typescript/src/views/aix.nitro.d.ts.map +1 -1
  22. package/nitrogen/generated/android/AixOnLoad.cpp +2 -0
  23. package/nitrogen/generated/android/c++/JAixContentInsets.hpp +69 -0
  24. package/nitrogen/generated/android/c++/JFunc_void_AixContentInsets.hpp +78 -0
  25. package/nitrogen/generated/android/c++/JHybridAixSpec.cpp +33 -0
  26. package/nitrogen/generated/android/c++/JHybridAixSpec.hpp +4 -0
  27. package/nitrogen/generated/android/c++/views/JHybridAixStateUpdater.cpp +8 -0
  28. package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixContentInsets.kt +47 -0
  29. package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/Func_void_AixContentInsets.kt +80 -0
  30. package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixSpec.kt +20 -0
  31. package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.cpp +8 -0
  32. package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.hpp +41 -0
  33. package/nitrogen/generated/ios/Aix-Swift-Cxx-Umbrella.hpp +4 -0
  34. package/nitrogen/generated/ios/c++/HybridAixSpecSwift.hpp +18 -0
  35. package/nitrogen/generated/ios/c++/views/HybridAixComponent.mm +10 -0
  36. package/nitrogen/generated/ios/swift/AixContentInsets.swift +117 -0
  37. package/nitrogen/generated/ios/swift/Func_void_AixContentInsets.swift +47 -0
  38. package/nitrogen/generated/ios/swift/HybridAixSpec.swift +2 -0
  39. package/nitrogen/generated/ios/swift/HybridAixSpec_cxx.swift +56 -0
  40. package/nitrogen/generated/shared/c++/AixContentInsets.hpp +87 -0
  41. package/nitrogen/generated/shared/c++/HybridAixSpec.cpp +4 -0
  42. package/nitrogen/generated/shared/c++/HybridAixSpec.hpp +8 -0
  43. package/nitrogen/generated/shared/c++/views/HybridAixComponent.cpp +24 -0
  44. package/nitrogen/generated/shared/c++/views/HybridAixComponent.hpp +4 -1
  45. package/nitrogen/generated/shared/json/AixConfig.json +2 -0
  46. package/package.json +4 -2
  47. package/src/aix.tsx +26 -11
  48. package/src/hooks/useContentInsetHandler.ts +28 -0
  49. package/src/index.ts +2 -0
  50. package/src/views/aix.nitro.ts +10 -0
@@ -30,18 +30,12 @@ protocol AixContext: AnyObject {
30
30
 
31
31
  /// Register the composer view
32
32
  func registerComposerView(_ composerView: HybridAixComposer)
33
- <<<<<<< HEAD
34
33
 
35
34
  /// Unregister the composer view
36
35
  func unregisterComposerView(_ composerView: HybridAixComposer)
37
36
 
38
37
  /// Called when the composer's height changes
39
38
  func reportComposerHeightChange(height: CGFloat)
40
- =======
41
-
42
- /// Unregister the composer view
43
- func unregisterComposerView(_ composerView: HybridAixComposer)
44
- >>>>>>> e1f4b6081b44dde75cebf1c5e876c6c02fd5a7ef
45
39
  }
46
40
 
47
41
  extension UIView {
@@ -96,6 +90,9 @@ extension UIView {
96
90
  class HybridAix: HybridAixSpec, AixContext, KeyboardNotificationsDelegate {
97
91
 
98
92
  var penultimateCellIndex: Double?
93
+
94
+ var shouldApplyContentInsets: Bool? = nil
95
+ var onWillApplyContentInsets: ((_ insets: AixContentInsets) -> Void)? = nil
99
96
 
100
97
  var additionalContentInsets: AixAdditionalContentInsetsProp?
101
98
 
@@ -394,11 +391,28 @@ class HybridAix: HybridAixSpec, AixContext, KeyboardNotificationsDelegate {
394
391
  guard let scrollView else { return }
395
392
 
396
393
  let targetTop = additionalContentInsetTop
394
+ let targetBottom = overrideContentInsetBottom ?? self.contentInsetBottom
395
+
396
+ // Create insets struct for callback (fields are optional in the interface)
397
+ let insets = AixContentInsets(
398
+ top: Double(targetTop),
399
+ left: nil,
400
+ bottom: Double(targetBottom),
401
+ right: nil
402
+ )
403
+
404
+ print("[aix] applyContentInset \(targetBottom)")
405
+
406
+ // If shouldApplyContentInsets is explicitly false, call callback and return
407
+ if shouldApplyContentInsets == false {
408
+ onWillApplyContentInsets?(insets)
409
+ return
410
+ }
411
+
412
+ // Default behavior: apply insets directly
397
413
  if scrollView.contentInset.top != targetTop {
398
414
  scrollView.contentInset.top = targetTop
399
415
  }
400
-
401
- let targetBottom = overrideContentInsetBottom ?? self.contentInsetBottom
402
416
  if scrollView.contentInset.bottom != targetBottom {
403
417
  scrollView.contentInset.bottom = targetBottom
404
418
  }
@@ -10,9 +10,20 @@ var _react = require("react");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const AixInternal = (0, _reactNativeNitroModules.getHostComponent)('Aix', () => _AixConfig.default);
13
+
14
+ // User-facing props type that accepts regular functions (not wrapped callbacks)
15
+
13
16
  const Aix = exports.Aix = /*#__PURE__*/(0, _react.forwardRef)(function Aix(props, ref) {
14
17
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(AixInternal, {
15
18
  ...props,
19
+ scrollOnFooterSizeUpdate: props.scrollOnFooterSizeUpdate ?? {
20
+ enabled: true,
21
+ scrolledToEndThreshold: 100,
22
+ animated: false
23
+ }
24
+ // Wrap onWillApplyContentInsets with callback() if provided
25
+ ,
26
+ onWillApplyContentInsets: props.onWillApplyContentInsets ? (0, _reactNativeNitroModules.callback)(props.onWillApplyContentInsets) : undefined,
16
27
  hybridRef: ref ? (0, _reactNativeNitroModules.callback)(r => {
17
28
  if (typeof ref === 'function') {
18
29
  ref(r);
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeNitroModules","require","_AixConfig","_interopRequireDefault","_react","_jsxRuntime","e","__esModule","default","AixInternal","getHostComponent","AixConfig","Aix","exports","forwardRef","props","ref","jsx","hybridRef","callback","r","current","undefined"],"sourceRoot":"../../src","sources":["aix.tsx"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAAkC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIlC,MAAMG,WAAW,GAAG,IAAAC,yCAAgB,EAClC,KAAK,EACL,MAAMC,kBACR,CAAC;AAEM,MAAMC,GAAG,GAAAC,OAAA,CAAAD,GAAA,gBAAG,IAAAE,iBAAU,EAC3B,SAASF,GAAGA,CAACG,KAAK,EAAEC,GAAG,EAAE;EACvB,oBACE,IAAAX,WAAA,CAAAY,GAAA,EAACR,WAAW;IAAA,GACNM,KAAK;IACTG,SAAS,EACPF,GAAG,GACC,IAAAG,iCAAQ,EAAEC,CAAC,IAAK;MACd,IAAI,OAAOJ,GAAG,KAAK,UAAU,EAAE;QAC7BA,GAAG,CAACI,CAAC,CAAC;MACR,CAAC,MAAM;QACLJ,GAAG,CAACK,OAAO,GAAGD,CAAC;MACjB;IACF,CAAC,CAAC,GACFE;EACL,CACF,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeNitroModules","require","_AixConfig","_interopRequireDefault","_react","_jsxRuntime","e","__esModule","default","AixInternal","getHostComponent","AixConfig","Aix","exports","forwardRef","props","ref","jsx","scrollOnFooterSizeUpdate","enabled","scrolledToEndThreshold","animated","onWillApplyContentInsets","callback","undefined","hybridRef","r","current"],"sourceRoot":"../../src","sources":["aix.tsx"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAAuD,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIvD,MAAMG,WAAW,GAAG,IAAAC,yCAAgB,EAClC,KAAK,EACL,MAAMC,kBACR,CAAC;;AAED;;AAQO,MAAMC,GAAG,GAAAC,OAAA,CAAAD,GAAA,gBAAG,IAAAE,iBAAU,EAC3B,SAASF,GAAGA,CAACG,KAAK,EAAEC,GAAG,EAAE;EACvB,oBACE,IAAAX,WAAA,CAAAY,GAAA,EAACR,WAAW;IAAA,GACNM,KAAK;IACTG,wBAAwB,EACtBH,KAAK,CAACG,wBAAwB,IAAI;MAChCC,OAAO,EAAE,IAAI;MACbC,sBAAsB,EAAE,GAAG;MAC3BC,QAAQ,EAAE;IACZ;IAEF;IAAA;IACAC,wBAAwB,EACtBP,KAAK,CAACO,wBAAwB,GAC1B,IAAAC,iCAAQ,EAACR,KAAK,CAACO,wBAAwB,CAAC,GACxCE,SACL;IACDC,SAAS,EACPT,GAAG,GACC,IAAAO,iCAAQ,EAAEG,CAAC,IAAK;MACd,IAAI,OAAOV,GAAG,KAAK,UAAU,EAAE;QAC7BA,GAAG,CAACU,CAAC,CAAC;MACR,CAAC,MAAM;QACLV,GAAG,CAACW,OAAO,GAAGD,CAAC;MACjB;IACF,CAAC,CAAC,GACFF;EACL,CACF,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useContentInsetHandler = useContentInsetHandler;
7
+ var _react = require("react");
8
+ /**
9
+ * Hook that creates a stable callback handler for content inset updates.
10
+ * Use this with `onWillApplyContentInsets` prop to receive inset updates.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * const bottomInset = useSharedValue<number | null>(null)
15
+ *
16
+ * const contentInsetHandler = useContentInsetHandler((insets) => {
17
+ * bottomInset.value = insets.bottom ?? null
18
+ * })
19
+ *
20
+ * <Aix
21
+ * shouldApplyContentInsets={false}
22
+ * onWillApplyContentInsets={contentInsetHandler}
23
+ * />
24
+ * ```
25
+ */
26
+ function useContentInsetHandler(handler, dependencies = []) {
27
+ // eslint-disable-next-line react-hooks/exhaustive-deps
28
+ return (0, _react.useCallback)(handler, dependencies);
29
+ }
30
+ //# sourceMappingURL=useContentInsetHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","useContentInsetHandler","handler","dependencies","useCallback"],"sourceRoot":"../../../src","sources":["hooks/useContentInsetHandler.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CACpCC,OAA2C,EAC3CC,YAAuB,GAAG,EAAE,EAC5B;EACA;EACA,OAAO,IAAAC,kBAAW,EAACF,OAAO,EAAEC,YAAY,CAAC;AAC3C","ignoreList":[]}
@@ -7,7 +7,8 @@ var _exportNames = {
7
7
  AixCell: true,
8
8
  useAixRef: true,
9
9
  Aix: true,
10
- AixFooter: true
10
+ AixFooter: true,
11
+ useContentInsetHandler: true
11
12
  };
12
13
  Object.defineProperty(exports, "Aix", {
13
14
  enumerable: true,
@@ -23,6 +24,12 @@ Object.defineProperty(exports, "AixFooter", {
23
24
  }
24
25
  });
25
26
  exports.useAixRef = useAixRef;
27
+ Object.defineProperty(exports, "useContentInsetHandler", {
28
+ enumerable: true,
29
+ get: function () {
30
+ return _useContentInsetHandler.useContentInsetHandler;
31
+ }
32
+ });
26
33
  var _reactNativeNitroModules = require("react-native-nitro-modules");
27
34
  var _AixCellViewConfig = _interopRequireDefault(require("../nitrogen/generated/shared/json/AixCellViewConfig.json"));
28
35
  var _react = require("react");
@@ -40,6 +47,7 @@ Object.keys(_fadeIn).forEach(function (key) {
40
47
  });
41
48
  var _aix = require("./aix");
42
49
  var _footer = require("./footer");
50
+ var _useContentInsetHandler = require("./hooks/useContentInsetHandler");
43
51
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
44
52
  const AixCell = exports.AixCell = (0, _reactNativeNitroModules.getHostComponent)('AixCellView', () => _AixCellViewConfig.default);
45
53
  function useAixRef() {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeNitroModules","require","_AixCellViewConfig","_interopRequireDefault","_react","_fadeIn","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_aix","_footer","e","__esModule","default","AixCell","getHostComponent","AixCellViewConfig","useAixRef","useRef"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAS,IAAA,GAAAjB,OAAA;AACA,IAAAkB,OAAA,GAAAlB,OAAA;AAAoC,SAAAE,uBAAAiB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7B,MAAMG,OAAO,GAAAT,OAAA,CAAAS,OAAA,GAAG,IAAAC,yCAAgB,EACrC,aAAa,EACb,MAAMC,0BACR,CAAC;AAIM,SAASC,SAASA,CAAA,EAAG;EAC1B,OAAO,IAAAC,aAAM,EAAgB,IAAI,CAAC;AACpC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeNitroModules","require","_AixCellViewConfig","_interopRequireDefault","_react","_fadeIn","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_aix","_footer","_useContentInsetHandler","e","__esModule","default","AixCell","getHostComponent","AixCellViewConfig","useAixRef","useRef"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAS,IAAA,GAAAjB,OAAA;AACA,IAAAkB,OAAA,GAAAlB,OAAA;AACA,IAAAmB,uBAAA,GAAAnB,OAAA;AAAuE,SAAAE,uBAAAkB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGhE,MAAMG,OAAO,GAAAV,OAAA,CAAAU,OAAA,GAAG,IAAAC,yCAAgB,EACrC,aAAa,EACb,MAAMC,0BACR,CAAC;AAIM,SAASC,SAASA,CAAA,EAAG;EAC1B,OAAO,IAAAC,aAAM,EAAgB,IAAI,CAAC;AACpC","ignoreList":[]}
package/lib/module/aix.js CHANGED
@@ -5,9 +5,20 @@ import AixConfig from '../nitrogen/generated/shared/json/AixConfig.json';
5
5
  import { forwardRef } from 'react';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  const AixInternal = getHostComponent('Aix', () => AixConfig);
8
+
9
+ // User-facing props type that accepts regular functions (not wrapped callbacks)
10
+
8
11
  export const Aix = /*#__PURE__*/forwardRef(function Aix(props, ref) {
9
12
  return /*#__PURE__*/_jsx(AixInternal, {
10
13
  ...props,
14
+ scrollOnFooterSizeUpdate: props.scrollOnFooterSizeUpdate ?? {
15
+ enabled: true,
16
+ scrolledToEndThreshold: 100,
17
+ animated: false
18
+ }
19
+ // Wrap onWillApplyContentInsets with callback() if provided
20
+ ,
21
+ onWillApplyContentInsets: props.onWillApplyContentInsets ? callback(props.onWillApplyContentInsets) : undefined,
11
22
  hybridRef: ref ? callback(r => {
12
23
  if (typeof ref === 'function') {
13
24
  ref(r);
@@ -1 +1 @@
1
- {"version":3,"names":["callback","getHostComponent","AixConfig","forwardRef","jsx","_jsx","AixInternal","Aix","props","ref","hybridRef","r","current","undefined"],"sourceRoot":"../../src","sources":["aix.tsx"],"mappings":";;AAAA,SACEA,QAAQ,EACRC,gBAAgB,QAEX,4BAA4B;AACnC,OAAOC,SAAS,MAAM,kDAAkD;AAExE,SAASC,UAAU,QAAQ,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIlC,MAAMC,WAAW,GAAGL,gBAAgB,CAClC,KAAK,EACL,MAAMC,SACR,CAAC;AAED,OAAO,MAAMK,GAAG,gBAAGJ,UAAU,CAC3B,SAASI,GAAGA,CAACC,KAAK,EAAEC,GAAG,EAAE;EACvB,oBACEJ,IAAA,CAACC,WAAW;IAAA,GACNE,KAAK;IACTE,SAAS,EACPD,GAAG,GACCT,QAAQ,CAAEW,CAAC,IAAK;MACd,IAAI,OAAOF,GAAG,KAAK,UAAU,EAAE;QAC7BA,GAAG,CAACE,CAAC,CAAC;MACR,CAAC,MAAM;QACLF,GAAG,CAACG,OAAO,GAAGD,CAAC;MACjB;IACF,CAAC,CAAC,GACFE;EACL,CACF,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["callback","getHostComponent","AixConfig","forwardRef","jsx","_jsx","AixInternal","Aix","props","ref","scrollOnFooterSizeUpdate","enabled","scrolledToEndThreshold","animated","onWillApplyContentInsets","undefined","hybridRef","r","current"],"sourceRoot":"../../src","sources":["aix.tsx"],"mappings":";;AAAA,SACEA,QAAQ,EACRC,gBAAgB,QAEX,4BAA4B;AACnC,OAAOC,SAAS,MAAM,kDAAkD;AAExE,SAASC,UAAU,QAA6B,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIvD,MAAMC,WAAW,GAAGL,gBAAgB,CAClC,KAAK,EACL,MAAMC,SACR,CAAC;;AAED;;AAQA,OAAO,MAAMK,GAAG,gBAAGJ,UAAU,CAC3B,SAASI,GAAGA,CAACC,KAAK,EAAEC,GAAG,EAAE;EACvB,oBACEJ,IAAA,CAACC,WAAW;IAAA,GACNE,KAAK;IACTE,wBAAwB,EACtBF,KAAK,CAACE,wBAAwB,IAAI;MAChCC,OAAO,EAAE,IAAI;MACbC,sBAAsB,EAAE,GAAG;MAC3BC,QAAQ,EAAE;IACZ;IAEF;IAAA;IACAC,wBAAwB,EACtBN,KAAK,CAACM,wBAAwB,GAC1Bd,QAAQ,CAACQ,KAAK,CAACM,wBAAwB,CAAC,GACxCC,SACL;IACDC,SAAS,EACPP,GAAG,GACCT,QAAQ,CAAEiB,CAAC,IAAK;MACd,IAAI,OAAOR,GAAG,KAAK,UAAU,EAAE;QAC7BA,GAAG,CAACQ,CAAC,CAAC;MACR,CAAC,MAAM;QACLR,GAAG,CAACS,OAAO,GAAGD,CAAC;MACjB;IACF,CAAC,CAAC,GACFF;EACL,CACF,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ import { useCallback } from 'react';
4
+ /**
5
+ * Hook that creates a stable callback handler for content inset updates.
6
+ * Use this with `onWillApplyContentInsets` prop to receive inset updates.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * const bottomInset = useSharedValue<number | null>(null)
11
+ *
12
+ * const contentInsetHandler = useContentInsetHandler((insets) => {
13
+ * bottomInset.value = insets.bottom ?? null
14
+ * })
15
+ *
16
+ * <Aix
17
+ * shouldApplyContentInsets={false}
18
+ * onWillApplyContentInsets={contentInsetHandler}
19
+ * />
20
+ * ```
21
+ */
22
+ export function useContentInsetHandler(handler, dependencies = []) {
23
+ // eslint-disable-next-line react-hooks/exhaustive-deps
24
+ return useCallback(handler, dependencies);
25
+ }
26
+ //# sourceMappingURL=useContentInsetHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useContentInsetHandler","handler","dependencies"],"sourceRoot":"../../../src","sources":["hooks/useContentInsetHandler.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AAGnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,OAA2C,EAC3CC,YAAuB,GAAG,EAAE,EAC5B;EACA;EACA,OAAOH,WAAW,CAACE,OAAO,EAAEC,YAAY,CAAC;AAC3C","ignoreList":[]}
@@ -6,6 +6,7 @@ import { useRef } from 'react';
6
6
  export * from './fade-in';
7
7
  export { Aix } from './aix';
8
8
  export { AixFooter } from './footer';
9
+ export { useContentInsetHandler } from './hooks/useContentInsetHandler';
9
10
  export const AixCell = getHostComponent('AixCellView', () => AixCellViewConfig);
10
11
  export function useAixRef() {
11
12
  return useRef(null);
@@ -1 +1 @@
1
- {"version":3,"names":["getHostComponent","AixCellViewConfig","useRef","Aix","AixFooter","AixCell","useAixRef"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAwB,4BAA4B;AAC7E,OAAOC,iBAAiB,MAAM,0DAA0D;AAExF,SAASC,MAAM,QAAQ,OAAO;AAE9B,cAAc,WAAW;AAEzB,SAASC,GAAG,QAAqB,OAAO;AACxC,SAASC,SAAS,QAAQ,UAAU;AAEpC,OAAO,MAAMC,OAAO,GAAGL,gBAAgB,CACrC,aAAa,EACb,MAAMC,iBACR,CAAC;AAID,OAAO,SAASK,SAASA,CAAA,EAAG;EAC1B,OAAOJ,MAAM,CAAgB,IAAI,CAAC;AACpC","ignoreList":[]}
1
+ {"version":3,"names":["getHostComponent","AixCellViewConfig","useRef","Aix","AixFooter","useContentInsetHandler","AixCell","useAixRef"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAwB,4BAA4B;AAC7E,OAAOC,iBAAiB,MAAM,0DAA0D;AAExF,SAASC,MAAM,QAAQ,OAAO;AAE9B,cAAc,WAAW;AAEzB,SAASC,GAAG,QAAqB,OAAO;AACxC,SAASC,SAAS,QAAQ,UAAU;AACpC,SAASC,sBAAsB,QAAQ,gCAAgC;AAGvE,OAAO,MAAMC,OAAO,GAAGN,gBAAgB,CACrC,aAAa,EACb,MAAMC,iBACR,CAAC;AAID,OAAO,SAASM,SAASA,CAAA,EAAG;EAC1B,OAAOL,MAAM,CAAgB,IAAI,CAAC;AACpC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import { type HybridRef } from 'react-native-nitro-modules';
2
- import type { AixProps, AixMethods } from './views/aix.nitro';
2
+ import type { AixProps, AixMethods, AixContentInsets } from './views/aix.nitro';
3
3
  export type AixRef = HybridRef<AixProps, AixMethods>;
4
- export declare const Aix: import("react").ForwardRefExoticComponent<{
4
+ export declare const Aix: import("react").ForwardRefExoticComponent<Omit<{
5
5
  hybridRef?: import("react-native-nitro-modules").NitroViewWrappedCallback<((ref: import("react-native-nitro-modules").HybridView<AixProps, AixMethods>) => void) | undefined> | undefined;
6
6
  shouldStartAtEnd: boolean;
7
7
  scrollOnFooterSizeUpdate?: import("./views/aix.nitro").AixScrollOnFooterSizeUpdate | undefined;
@@ -10,5 +10,9 @@ export declare const Aix: import("react").ForwardRefExoticComponent<{
10
10
  additionalScrollIndicatorInsets?: import("./views/aix.nitro").AixScrollIndicatorInsets | undefined;
11
11
  mainScrollViewID?: string | undefined;
12
12
  penultimateCellIndex?: number | undefined;
13
- } & import("react-native").ViewProps & import("react").RefAttributes<AixRef>>;
13
+ shouldApplyContentInsets?: boolean | undefined;
14
+ onWillApplyContentInsets?: import("react-native-nitro-modules").NitroViewWrappedCallback<((insets: AixContentInsets) => void) | undefined> | undefined;
15
+ } & import("react-native").ViewProps, "onWillApplyContentInsets" | "hybridRef"> & {
16
+ onWillApplyContentInsets?: (insets: AixContentInsets) => void;
17
+ } & import("react").RefAttributes<AixRef>>;
14
18
  //# sourceMappingURL=aix.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aix.d.ts","sourceRoot":"","sources":["../../../src/aix.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG7D,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;AAOpD,eAAO,MAAM,GAAG;;;;;;;;;6EAmBf,CAAA"}
1
+ {"version":3,"file":"aix.d.ts","sourceRoot":"","sources":["../../../src/aix.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAG/E,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;AAepD,eAAO,MAAM,GAAG;;;;;;;;;;;;+BAHa,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI;0CAmC9D,CAAA"}
@@ -0,0 +1,21 @@
1
+ import type { AixContentInsets } from '../views/aix.nitro';
2
+ /**
3
+ * Hook that creates a stable callback handler for content inset updates.
4
+ * Use this with `onWillApplyContentInsets` prop to receive inset updates.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * const bottomInset = useSharedValue<number | null>(null)
9
+ *
10
+ * const contentInsetHandler = useContentInsetHandler((insets) => {
11
+ * bottomInset.value = insets.bottom ?? null
12
+ * })
13
+ *
14
+ * <Aix
15
+ * shouldApplyContentInsets={false}
16
+ * onWillApplyContentInsets={contentInsetHandler}
17
+ * />
18
+ * ```
19
+ */
20
+ export declare function useContentInsetHandler(handler: (insets: AixContentInsets) => void, dependencies?: unknown[]): (insets: AixContentInsets) => void;
21
+ //# sourceMappingURL=useContentInsetHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContentInsetHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useContentInsetHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,EAC3C,YAAY,GAAE,OAAO,EAAO,YADV,gBAAgB,KAAK,IAAI,CAK5C"}
@@ -4,6 +4,8 @@ import type { AixRef } from './aix';
4
4
  export * from './fade-in';
5
5
  export { Aix, type AixRef } from './aix';
6
6
  export { AixFooter } from './footer';
7
+ export { useContentInsetHandler } from './hooks/useContentInsetHandler';
8
+ export type { AixContentInsets } from './views/aix.nitro';
7
9
  export declare const AixCell: import("react-native-nitro-modules").ReactNativeView<AixCellViewProps, {}>;
8
10
  export type AixCellViewRef = HybridRef<AixCellViewProps, {}>;
9
11
  export declare function useAixRef(): import("react").RefObject<AixRef | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACnC,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,GAAG,EAAE,KAAK,MAAM,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,eAAO,MAAM,OAAO,4EAGnB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAA;AAE5D,wBAAgB,SAAS,6CAExB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACnC,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,GAAG,EAAE,KAAK,MAAM,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,eAAO,MAAM,OAAO,4EAGnB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAA;AAE5D,wBAAgB,SAAS,6CAExB"}
@@ -16,12 +16,40 @@ export interface AixScrollIndicatorInsets {
16
16
  bottom?: AixScrollIndicatorInsetValue;
17
17
  }
18
18
  export interface AixScrollOnFooterSizeUpdate {
19
+ /**
20
+ * Whether to scroll on footer size update.
21
+ *
22
+ * Default: true
23
+ */
19
24
  enabled: boolean;
25
+ /**
26
+ * The number of pixels from the bottom of the scroll view to the end of the content that is considered "scrolled near the end".
27
+ *
28
+ * Default: 100
29
+ */
20
30
  scrolledToEndThreshold?: number;
31
+ /**
32
+ * Whether to animate the scroll.
33
+ *
34
+ * Default: false
35
+ */
21
36
  animated?: boolean;
22
37
  }
38
+ export interface AixContentInsets {
39
+ top?: number;
40
+ left?: number;
41
+ bottom?: number;
42
+ right?: number;
43
+ }
23
44
  export interface AixProps extends HybridViewProps {
24
45
  shouldStartAtEnd: boolean;
46
+ /**
47
+ * Control the behavior of scrolling the content when footer size changes.
48
+ *
49
+ * By default, changing the height of the footer will shift content up in the scroll view.
50
+ *
51
+ * Default: { enabled: true, scrolledToEndThreshold: 100, animated: false }
52
+ */
25
53
  scrollOnFooterSizeUpdate?: AixScrollOnFooterSizeUpdate;
26
54
  /**
27
55
  * The number of pixels from the bottom of the scroll view to the end of the content that is considered "near the end".
@@ -75,6 +103,8 @@ export interface AixProps extends HybridViewProps {
75
103
  *
76
104
  */
77
105
  penultimateCellIndex?: number;
106
+ shouldApplyContentInsets?: boolean;
107
+ onWillApplyContentInsets?: (insets: AixContentInsets) => void;
78
108
  }
79
109
  export interface AixMethods extends HybridViewMethods {
80
110
  scrollToEnd(animated?: boolean): void;
@@ -1 +1 @@
1
- {"version":3,"file":"aix.nitro.d.ts","sourceRoot":"","sources":["../../../../src/views/aix.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,MAAM,CAAA;IACxB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,8BAA8B;IAC7C,GAAG,CAAC,EAAE,0BAA0B,CAAA;IAChC,MAAM,CAAC,EAAE,0BAA0B,CAAA;CACpC;AAED,MAAM,WAAW,4BAA4B;IAC3C,gBAAgB,EAAE,MAAM,CAAA;IACxB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,CAAC,EAAE,4BAA4B,CAAA;IAClC,MAAM,CAAC,EAAE,4BAA4B,CAAA;CACtC;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAA;IAChB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,QAAS,SAAQ,eAAe;IAC/C,gBAAgB,EAAE,OAAO,CAAA;IACzB,wBAAwB,CAAC,EAAE,2BAA2B,CAAA;IACtD;;;;;;;;;OASG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC;;;;;;;;;;;;OAYG;IAEH,uBAAuB,CAAC,EAAE,8BAA8B,CAAA;IAExD;;;OAGG;IACH,+BAA+B,CAAC,EAAE,wBAAwB,CAAA;IAE1D;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,UAAW,SAAQ,iBAAiB;IACnD,WAAW,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACrC,+BAA+B,CAC7B,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,OAAO,EAClB,oBAAoB,CAAC,EAAE,OAAO,GAC7B,IAAI,CAAA;CACR;AAED,MAAM,MAAM,GAAG,GAAG,UAAU,CAC1B,QAAQ,EACR,UAAU,EACV;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CACpC,CAAA;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,gBAAgB,EAChB,EAAE,EACF;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CACpC,CAAA;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;CAAG;AAE5D,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,gBAAgB,EAChB,EAAE,EACF;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CACpC,CAAA"}
1
+ {"version":3,"file":"aix.nitro.d.ts","sourceRoot":"","sources":["../../../../src/views/aix.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,MAAM,CAAA;IACxB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,8BAA8B;IAC7C,GAAG,CAAC,EAAE,0BAA0B,CAAA;IAChC,MAAM,CAAC,EAAE,0BAA0B,CAAA;CACpC;AAED,MAAM,WAAW,4BAA4B;IAC3C,gBAAgB,EAAE,MAAM,CAAA;IACxB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,CAAC,EAAE,4BAA4B,CAAA;IAClC,MAAM,CAAC,EAAE,4BAA4B,CAAA;CACtC;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,QAAS,SAAQ,eAAe;IAC/C,gBAAgB,EAAE,OAAO,CAAA;IACzB;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,2BAA2B,CAAA;IACtD;;;;;;;;;OASG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC;;;;;;;;;;;;OAYG;IAEH,uBAAuB,CAAC,EAAE,8BAA8B,CAAA;IAExD;;;OAGG;IACH,+BAA+B,CAAC,EAAE,wBAAwB,CAAA;IAE1D;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,wBAAwB,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAC9D;AAED,MAAM,WAAW,UAAW,SAAQ,iBAAiB;IACnD,WAAW,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACrC,+BAA+B,CAC7B,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,OAAO,EAClB,oBAAoB,CAAC,EAAE,OAAO,GAC7B,IAAI,CAAA;CACR;AAED,MAAM,MAAM,GAAG,GAAG,UAAU,CAC1B,QAAQ,EACR,UAAU,EACV;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CACpC,CAAA;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,gBAAgB,EAChB,EAAE,EACF;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CACpC,CAAA;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;CAAG;AAE5D,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,gBAAgB,EAChB,EAAE,EACF;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CACpC,CAAA"}
@@ -16,6 +16,7 @@
16
16
  #include <NitroModules/HybridObjectRegistry.hpp>
17
17
 
18
18
  #include "JHybridAixSpec.hpp"
19
+ #include "JFunc_void_AixContentInsets.hpp"
19
20
  #include "views/JHybridAixStateUpdater.hpp"
20
21
  #include "JHybridAixCellViewSpec.hpp"
21
22
  #include "views/JHybridAixCellViewStateUpdater.hpp"
@@ -33,6 +34,7 @@ int initialize(JavaVM* vm) {
33
34
  return facebook::jni::initialize(vm, [] {
34
35
  // Register native JNI methods
35
36
  margelo::nitro::aix::JHybridAixSpec::registerNatives();
37
+ margelo::nitro::aix::JFunc_void_AixContentInsets_cxx::registerNatives();
36
38
  margelo::nitro::aix::views::JHybridAixStateUpdater::registerNatives();
37
39
  margelo::nitro::aix::JHybridAixCellViewSpec::registerNatives();
38
40
  margelo::nitro::aix::views::JHybridAixCellViewStateUpdater::registerNatives();
@@ -0,0 +1,69 @@
1
+ ///
2
+ /// JAixContentInsets.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "AixContentInsets.hpp"
12
+
13
+ #include <optional>
14
+
15
+ namespace margelo::nitro::aix {
16
+
17
+ using namespace facebook;
18
+
19
+ /**
20
+ * The C++ JNI bridge between the C++ struct "AixContentInsets" and the the Kotlin data class "AixContentInsets".
21
+ */
22
+ struct JAixContentInsets final: public jni::JavaClass<JAixContentInsets> {
23
+ public:
24
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/AixContentInsets;";
25
+
26
+ public:
27
+ /**
28
+ * Convert this Java/Kotlin-based struct to the C++ struct AixContentInsets by copying all values to C++.
29
+ */
30
+ [[maybe_unused]]
31
+ [[nodiscard]]
32
+ AixContentInsets toCpp() const {
33
+ static const auto clazz = javaClassStatic();
34
+ static const auto fieldTop = clazz->getField<jni::JDouble>("top");
35
+ jni::local_ref<jni::JDouble> top = this->getFieldValue(fieldTop);
36
+ static const auto fieldLeft = clazz->getField<jni::JDouble>("left");
37
+ jni::local_ref<jni::JDouble> left = this->getFieldValue(fieldLeft);
38
+ static const auto fieldBottom = clazz->getField<jni::JDouble>("bottom");
39
+ jni::local_ref<jni::JDouble> bottom = this->getFieldValue(fieldBottom);
40
+ static const auto fieldRight = clazz->getField<jni::JDouble>("right");
41
+ jni::local_ref<jni::JDouble> right = this->getFieldValue(fieldRight);
42
+ return AixContentInsets(
43
+ top != nullptr ? std::make_optional(top->value()) : std::nullopt,
44
+ left != nullptr ? std::make_optional(left->value()) : std::nullopt,
45
+ bottom != nullptr ? std::make_optional(bottom->value()) : std::nullopt,
46
+ right != nullptr ? std::make_optional(right->value()) : std::nullopt
47
+ );
48
+ }
49
+
50
+ public:
51
+ /**
52
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
53
+ */
54
+ [[maybe_unused]]
55
+ static jni::local_ref<JAixContentInsets::javaobject> fromCpp(const AixContentInsets& value) {
56
+ using JSignature = JAixContentInsets(jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>);
57
+ static const auto clazz = javaClassStatic();
58
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
59
+ return create(
60
+ clazz,
61
+ value.top.has_value() ? jni::JDouble::valueOf(value.top.value()) : nullptr,
62
+ value.left.has_value() ? jni::JDouble::valueOf(value.left.value()) : nullptr,
63
+ value.bottom.has_value() ? jni::JDouble::valueOf(value.bottom.value()) : nullptr,
64
+ value.right.has_value() ? jni::JDouble::valueOf(value.right.value()) : nullptr
65
+ );
66
+ }
67
+ };
68
+
69
+ } // namespace margelo::nitro::aix
@@ -0,0 +1,78 @@
1
+ ///
2
+ /// JFunc_void_AixContentInsets.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include <functional>
12
+
13
+ #include "AixContentInsets.hpp"
14
+ #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
16
+ #include "JAixContentInsets.hpp"
17
+ #include <optional>
18
+
19
+ namespace margelo::nitro::aix {
20
+
21
+ using namespace facebook;
22
+
23
+ /**
24
+ * Represents the Java/Kotlin callback `(insets: AixContentInsets) -> Unit`.
25
+ * This can be passed around between C++ and Java/Kotlin.
26
+ */
27
+ struct JFunc_void_AixContentInsets: public jni::JavaClass<JFunc_void_AixContentInsets> {
28
+ public:
29
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/Func_void_AixContentInsets;";
30
+
31
+ public:
32
+ /**
33
+ * Invokes the function this `JFunc_void_AixContentInsets` instance holds through JNI.
34
+ */
35
+ void invoke(const AixContentInsets& insets) const {
36
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JAixContentInsets> /* insets */)>("invoke");
37
+ method(self(), JAixContentInsets::fromCpp(insets));
38
+ }
39
+ };
40
+
41
+ /**
42
+ * An implementation of Func_void_AixContentInsets that is backed by a C++ implementation (using `std::function<...>`)
43
+ */
44
+ class JFunc_void_AixContentInsets_cxx final: public jni::HybridClass<JFunc_void_AixContentInsets_cxx, JFunc_void_AixContentInsets> {
45
+ public:
46
+ static jni::local_ref<JFunc_void_AixContentInsets::javaobject> fromCpp(const std::function<void(const AixContentInsets& /* insets */)>& func) {
47
+ return JFunc_void_AixContentInsets_cxx::newObjectCxxArgs(func);
48
+ }
49
+
50
+ public:
51
+ /**
52
+ * Invokes the C++ `std::function<...>` this `JFunc_void_AixContentInsets_cxx` instance holds.
53
+ */
54
+ void invoke_cxx(jni::alias_ref<JAixContentInsets> insets) {
55
+ _func(insets->toCpp());
56
+ }
57
+
58
+ public:
59
+ [[nodiscard]]
60
+ inline const std::function<void(const AixContentInsets& /* insets */)>& getFunction() const {
61
+ return _func;
62
+ }
63
+
64
+ public:
65
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/Func_void_AixContentInsets_cxx;";
66
+ static void registerNatives() {
67
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_AixContentInsets_cxx::invoke_cxx)});
68
+ }
69
+
70
+ private:
71
+ explicit JFunc_void_AixContentInsets_cxx(const std::function<void(const AixContentInsets& /* insets */)>& func): _func(func) { }
72
+
73
+ private:
74
+ friend HybridBase;
75
+ std::function<void(const AixContentInsets& /* insets */)> _func;
76
+ };
77
+
78
+ } // namespace margelo::nitro::aix
@@ -17,6 +17,8 @@ namespace margelo::nitro::aix { struct AixAdditionalContentInsets; }
17
17
  namespace margelo::nitro::aix { struct AixScrollIndicatorInsets; }
18
18
  // Forward declaration of `AixScrollIndicatorInsetValue` to properly resolve imports.
19
19
  namespace margelo::nitro::aix { struct AixScrollIndicatorInsetValue; }
20
+ // Forward declaration of `AixContentInsets` to properly resolve imports.
21
+ namespace margelo::nitro::aix { struct AixContentInsets; }
20
22
 
21
23
  #include "AixScrollOnFooterSizeUpdate.hpp"
22
24
  #include <optional>
@@ -30,6 +32,11 @@ namespace margelo::nitro::aix { struct AixScrollIndicatorInsetValue; }
30
32
  #include "AixScrollIndicatorInsetValue.hpp"
31
33
  #include "JAixScrollIndicatorInsetValue.hpp"
32
34
  #include <string>
35
+ #include "AixContentInsets.hpp"
36
+ #include <functional>
37
+ #include "JFunc_void_AixContentInsets.hpp"
38
+ #include <NitroModules/JNICallable.hpp>
39
+ #include "JAixContentInsets.hpp"
33
40
 
34
41
  namespace margelo::nitro::aix {
35
42
 
@@ -123,6 +130,32 @@ namespace margelo::nitro::aix {
123
130
  static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* penultimateCellIndex */)>("setPenultimateCellIndex");
124
131
  method(_javaPart, penultimateCellIndex.has_value() ? jni::JDouble::valueOf(penultimateCellIndex.value()) : nullptr);
125
132
  }
133
+ std::optional<bool> JHybridAixSpec::getShouldApplyContentInsets() {
134
+ static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getShouldApplyContentInsets");
135
+ auto __result = method(_javaPart);
136
+ return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
137
+ }
138
+ void JHybridAixSpec::setShouldApplyContentInsets(std::optional<bool> shouldApplyContentInsets) {
139
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* shouldApplyContentInsets */)>("setShouldApplyContentInsets");
140
+ method(_javaPart, shouldApplyContentInsets.has_value() ? jni::JBoolean::valueOf(shouldApplyContentInsets.value()) : nullptr);
141
+ }
142
+ std::optional<std::function<void(const AixContentInsets& /* insets */)>> JHybridAixSpec::getOnWillApplyContentInsets() {
143
+ static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_AixContentInsets::javaobject>()>("getOnWillApplyContentInsets_cxx");
144
+ auto __result = method(_javaPart);
145
+ return __result != nullptr ? std::make_optional([&]() -> std::function<void(const AixContentInsets& /* insets */)> {
146
+ if (__result->isInstanceOf(JFunc_void_AixContentInsets_cxx::javaClassStatic())) [[likely]] {
147
+ auto downcast = jni::static_ref_cast<JFunc_void_AixContentInsets_cxx::javaobject>(__result);
148
+ return downcast->cthis()->getFunction();
149
+ } else {
150
+ auto __resultRef = jni::make_global(__result);
151
+ return JNICallable<JFunc_void_AixContentInsets, void(AixContentInsets)>(std::move(__resultRef));
152
+ }
153
+ }()) : std::nullopt;
154
+ }
155
+ void JHybridAixSpec::setOnWillApplyContentInsets(const std::optional<std::function<void(const AixContentInsets& /* insets */)>>& onWillApplyContentInsets) {
156
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_AixContentInsets::javaobject> /* onWillApplyContentInsets */)>("setOnWillApplyContentInsets_cxx");
157
+ method(_javaPart, onWillApplyContentInsets.has_value() ? JFunc_void_AixContentInsets_cxx::fromCpp(onWillApplyContentInsets.value()) : nullptr);
158
+ }
126
159
 
127
160
  // Methods
128
161
  void JHybridAixSpec::scrollToEnd(std::optional<bool> animated) {
@@ -64,6 +64,10 @@ namespace margelo::nitro::aix {
64
64
  void setMainScrollViewID(const std::optional<std::string>& mainScrollViewID) override;
65
65
  std::optional<double> getPenultimateCellIndex() override;
66
66
  void setPenultimateCellIndex(std::optional<double> penultimateCellIndex) override;
67
+ std::optional<bool> getShouldApplyContentInsets() override;
68
+ void setShouldApplyContentInsets(std::optional<bool> shouldApplyContentInsets) override;
69
+ std::optional<std::function<void(const AixContentInsets& /* insets */)>> getOnWillApplyContentInsets() override;
70
+ void setOnWillApplyContentInsets(const std::optional<std::function<void(const AixContentInsets& /* insets */)>>& onWillApplyContentInsets) override;
67
71
 
68
72
  public:
69
73
  // Methods
@@ -64,6 +64,14 @@ void JHybridAixStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* clas
64
64
  view->setPenultimateCellIndex(props.penultimateCellIndex.value);
65
65
  // TODO: Set isDirty = false
66
66
  }
67
+ if (props.shouldApplyContentInsets.isDirty) {
68
+ view->setShouldApplyContentInsets(props.shouldApplyContentInsets.value);
69
+ // TODO: Set isDirty = false
70
+ }
71
+ if (props.onWillApplyContentInsets.isDirty) {
72
+ view->setOnWillApplyContentInsets(props.onWillApplyContentInsets.value);
73
+ // TODO: Set isDirty = false
74
+ }
67
75
 
68
76
  // Update hybridRef if it changed
69
77
  if (props.hybridRef.isDirty) {