uilib-native 5.0.0 → 5.0.1-snapshot.7783

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.
@@ -1,10 +1,10 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  project.ext {
4
- buildToolsVersion = rootProject.ext.has("buildToolsVersion") ? rootProject.ext.buildToolsVersion : '35.0.0'
4
+ buildToolsVersion = rootProject.ext.has("buildToolsVersion") ? rootProject.ext.buildToolsVersion : '36.0.0'
5
5
  minSdkVersion = rootProject.ext.has("minSdkVersion") ? rootProject.ext.minSdkVersion : 24
6
- compileSdkVersion = rootProject.ext.has("compileSdkVersion") ? rootProject.ext.compileSdkVersion : 35
7
- targetSdkVersion = rootProject.ext.has("targetSdkVersion") ? rootProject.ext.targetSdkVersion : 34
6
+ compileSdkVersion = rootProject.ext.has("compileSdkVersion") ? rootProject.ext.compileSdkVersion : 36
7
+ targetSdkVersion = rootProject.ext.has("targetSdkVersion") ? rootProject.ext.targetSdkVersion : 36
8
8
  supportLibVersion = rootProject.ext.has("supportLibVersion") ? rootProject.ext.supportLibVersion : '28.0.0'
9
9
  }
10
10
 
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { type JSX } from 'react';
2
2
  import { ViewStyle } from 'react-native';
3
3
  type HighlightFrameType = {
4
4
  x: number;
@@ -28,7 +28,7 @@ export type HighlighterOverlayViewProps = {
28
28
  testID?: string;
29
29
  };
30
30
  declare const HighlighterOverlayView: {
31
- (props: HighlighterOverlayViewProps): React.JSX.Element;
31
+ (props: HighlighterOverlayViewProps): JSX.Element;
32
32
  displayName: string;
33
33
  };
34
34
  export default HighlighterOverlayView;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { type JSX } from 'react';
2
2
  import { ViewStyle } from 'react-native';
3
3
  type HighlightFrameType = {
4
4
  x: number;
@@ -28,7 +28,7 @@ export type HighlighterOverlayViewProps = {
28
28
  testID?: string;
29
29
  };
30
30
  declare const HighlighterOverlayView: {
31
- (props: HighlighterOverlayViewProps): React.JSX.Element;
31
+ (props: HighlighterOverlayViewProps): JSX.Element;
32
32
  displayName: string;
33
33
  };
34
34
  export default HighlighterOverlayView;
@@ -9,7 +9,7 @@ export type CustomKeyboardViewBaseProps = {
9
9
  component?: string;
10
10
  onItemSelected?: (component?: string, args?: any) => void;
11
11
  onRequestShowKeyboard?: (keyboardId: string) => void;
12
- children?: React.ReactChild | React.ReactChild[];
12
+ children?: React.ReactNode;
13
13
  };
14
14
  export default class CustomKeyboardViewBase<T extends CustomKeyboardViewBaseProps> extends Component<T> {
15
15
  static defaultProps: {
@@ -33,6 +33,8 @@ export default class KeyboardRegistry {
33
33
  */
34
34
  static registerKeyboard = (componentID, generator, params = {}) => {
35
35
  if (!_isFunction(generator)) {
36
+ // TODO: do we want to add a util for this?
37
+ // eslint-disable-next-line no-restricted-syntax
36
38
  console.error(`KeyboardRegistry.registerKeyboard: ${componentID} you must register a generator function`);
37
39
  return;
38
40
  }
@@ -50,7 +52,9 @@ export default class KeyboardRegistry {
50
52
  */
51
53
  static getKeyboard = componentID => {
52
54
  const res = KeyboardRegistry.registeredKeyboards[componentID];
53
- if (!res || !res.generator) {
55
+ if (!res?.generator) {
56
+ // TODO: do we want to add a util for this?
57
+ // eslint-disable-next-line no-restricted-syntax
54
58
  console.error(`KeyboardRegistry.getKeyboard: ${componentID} used but not yet registered`);
55
59
  return undefined;
56
60
  }
@@ -6,7 +6,7 @@ export type KeyboardAccessoryViewProps = kbTrackingViewProps & {
6
6
  /**
7
7
  * Content to be rendered above the keyboard
8
8
  */
9
- renderContent?: () => React.ReactElement;
9
+ renderContent?: () => React.ReactElement<any>;
10
10
  /**
11
11
  * iOS only.
12
12
  * The reference to the actual text input (or the keyboard may not reset when instructed to, etc.).
@@ -37,7 +37,7 @@ export type KeyboardAccessoryViewProps = kbTrackingViewProps & {
37
37
  * Callback that will be called once the keyboard has been closed
38
38
  */
39
39
  onKeyboardResigned?: () => void;
40
- children?: React.ReactChild;
40
+ children?: React.ReactNode;
41
41
  };
42
42
  /**
43
43
  * @description: View that allows replacing the default keyboard with other components
@@ -141,7 +141,9 @@ class KeyboardAccessoryView extends Component {
141
141
  scrollBehavior,
142
142
  ...others
143
143
  } = this.props;
144
- return <KeyboardTrackingView {...others} scrollBehavior={scrollBehavior} ref={r => this.trackingViewRef = r} style={styles.trackingToolbarContainer} onLayout={this.onContainerComponentHeightChanged}>
144
+ return <KeyboardTrackingView {...others} scrollBehavior={scrollBehavior} ref={r => {
145
+ this.trackingViewRef = r;
146
+ }} style={styles.trackingToolbarContainer} onLayout={this.onContainerComponentHeightChanged}>
145
147
  <KeyboardHeightListener id={`${this.id}`} onDismiss={this.onDismiss} onKeyboardHeightChange={this.onKeyboardHeightChange} />
146
148
  <>{renderContent?.()}</>
147
149
  <CustomKeyboardView keyboardHeight={keyboardHeight} shouldFocus={shouldFocus} onKeyboardDismiss={this.onKeyboardDismiss} inputRef={kbInputRef} component={kbComponent} initialProps={this.processInitialProps()} onItemSelected={onItemSelected} onRequestShowKeyboard={onRequestShowKeyboard} useSafeArea={others.useSafeArea} />
@@ -18,7 +18,9 @@ class KeyboardTrackingView extends PureComponent {
18
18
  useSafeArea: false
19
19
  };
20
20
  render() {
21
- return <KeyboardTrackingViewNativeComponent {...this.props} ref={r => this.ref = r} />;
21
+ return <KeyboardTrackingViewNativeComponent {...this.props} ref={r => {
22
+ this.ref = r;
23
+ }} />;
22
24
  }
23
25
  async getNativeProps() {
24
26
  if (this.ref && KeyboardTrackingViewTempManager && KeyboardTrackingViewTempManager.getNativeProps) {
@@ -73,9 +73,13 @@ export type KeyboardTrackingViewProps = ViewProps & {
73
73
  usesBottomTabs?: boolean;
74
74
  ref?: any;
75
75
  style?: StyleProp<ViewStyle>;
76
- children?: React.ReactChild | React.ReactChild[];
76
+ children?: React.ReactNode;
77
77
  };
78
- declare const _default: React.ForwardRefExoticComponent<Omit<KeyboardTrackingViewProps, "ref"> & React.RefAttributes<unknown>> & {
78
+ declare const defaultProps: KeyboardTrackingViewProps;
79
+ declare const KeyboardTrackingView: React.ForwardRefExoticComponent<Omit<KeyboardTrackingViewProps, "ref"> & React.RefAttributes<unknown>>;
80
+ type KeyboardTrackingViewType = typeof KeyboardTrackingView & {
79
81
  scrollBehaviors: typeof SCROLL_BEHAVIORS;
82
+ defaultProps: typeof defaultProps;
80
83
  };
84
+ declare const _default: KeyboardTrackingViewType;
81
85
  export default _default;
@@ -8,15 +8,16 @@ const SCROLL_BEHAVIORS = {
8
8
  SCROLL_TO_BOTTOM_INVERTED_ONLY: NativeModules.KeyboardTrackingViewTempManager?.KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly,
9
9
  FIXED_OFFSET: NativeModules.KeyboardTrackingViewTempManager?.KeyboardTrackingScrollBehaviorFixedOffset
10
10
  };
11
+ const defaultProps = {};
11
12
  const KeyboardTrackingView = forwardRef(({
12
13
  children,
13
14
  ...others
14
15
  }, ref) => {
15
16
  const KeyboardTrackingViewContainer = isAndroid ? KeyboardTrackingViewAndroid : KeyboardTrackingViewIOS;
16
- return <KeyboardTrackingViewContainer {...others} ref={ref}>
17
+ return <KeyboardTrackingViewContainer {...defaultProps} {...others} ref={ref}>
17
18
  {children}
18
19
  </KeyboardTrackingViewContainer>;
19
20
  });
20
- export default KeyboardTrackingView;
21
- // @ts-expect-error
22
- KeyboardTrackingView.scrollBehaviors = SCROLL_BEHAVIORS;
21
+ KeyboardTrackingView.defaultProps = defaultProps;
22
+ KeyboardTrackingView.scrollBehaviors = SCROLL_BEHAVIORS;
23
+ export default KeyboardTrackingView;
@@ -11,6 +11,7 @@ declare const _default: {
11
11
  SCROLL_TO_BOTTOM_INVERTED_ONLY: any;
12
12
  FIXED_OFFSET: any;
13
13
  };
14
+ defaultProps: KeyboardTrackingViewProps;
14
15
  };
15
16
  KeyboardAwareInsetsView: {
16
17
  (props: import("react-native/types").ViewProps & {
@@ -27,7 +28,7 @@ declare const _default: {
27
28
  usesBottomTabs?: boolean | undefined;
28
29
  ref?: any;
29
30
  style?: import("react-native/types").StyleProp<import("react-native/types").ViewStyle>;
30
- children?: import("react").ReactChild | import("react").ReactChild[] | undefined;
31
+ children?: import("react").ReactNode;
31
32
  } & {
32
33
  offset?: number | undefined;
33
34
  }): import("react").JSX.Element;
@@ -207,7 +207,9 @@ typedef NS_ENUM(NSUInteger, KeyboardTrackingScrollBehavior) {
207
207
  {
208
208
  if(_scrollViewToManage == nil)
209
209
  {
210
- if ([NSStringFromClass([subview class]) isEqualToString:@"RCTScrollViewComponentView"]) {
210
+ if ([NSStringFromClass([subview class]) isEqualToString:@"RCTScrollViewComponentView"] &&
211
+ subview.superview != self) {
212
+
211
213
  UIScrollView *scrollView = [self extractUIScrollView:subview];
212
214
 
213
215
  if ([scrollView isKindOfClass:[UIScrollView class]])
@@ -434,9 +436,7 @@ typedef NS_ENUM(NSUInteger, KeyboardTrackingScrollBehavior) {
434
436
 
435
437
  - (void)_updateScrollViewInsets
436
438
  {
437
- // Because our view is now being transformed inside it's superview (from RN77 it inherited a RCTLegacyViewManagerInteropComponentView as superview) we no longer need the scrollview to also update because it's inside our view
438
- return;
439
- /*if(self.scrollViewToManage != nil)
439
+ if(self.scrollViewToManage != nil)
440
440
  {
441
441
  UIEdgeInsets insets = self.scrollViewToManage.contentInset;
442
442
  CGFloat bottomSafeArea = [self getBottomSafeArea];
@@ -483,7 +483,7 @@ typedef NS_ENUM(NSUInteger, KeyboardTrackingScrollBehavior) {
483
483
  insets.bottom = bottomInset;
484
484
  }
485
485
  self.scrollViewToManage.scrollIndicatorInsets = insets;
486
- }*/
486
+ }
487
487
  }
488
488
 
489
489
  #pragma mark - bottom view
package/package.json CHANGED
@@ -1,23 +1,22 @@
1
1
  {
2
- "name": "uilib-native",
3
- "version": "5.0.0",
4
- "homepage": "https://github.com/wix/react-native-ui-lib",
5
- "description": "uilib native components (separated from js components)",
6
- "main": "components/index",
7
- "scripts": {
8
- "releaseNative": "node ./scripts/releaseNative.js"
9
- },
10
- "author": "Ethan Sharabi <ethan.shar@gmail.com>",
11
- "license": "MIT",
12
- "dependencies": {
13
- "lodash": "^4.17.21",
14
- "prop-types": "^15.5.10"
15
- },
16
- "devDependencies": {
17
- "shell-utils": "^1.0.10"
18
- },
19
- "peerDependencies": {
20
- "react": ">=18.3.1",
21
- "react-native": ">=0.77.3"
22
- }
2
+ "name": "uilib-native",
3
+ "version": "5.0.1-snapshot.7783",
4
+ "homepage": "https://github.com/wix/react-native-ui-lib",
5
+ "description": "uilib native components (separated from js components)",
6
+ "main": "components/index",
7
+ "scripts": {
8
+ "releaseNative": ""
9
+ },
10
+ "author": "Ethan Sharabi <ethan.shar@gmail.com>",
11
+ "license": "MIT",
12
+ "dependencies": {
13
+ "lodash": "^4.17.21"
14
+ },
15
+ "devDependencies": {
16
+ "shell-utils": "^1.0.10"
17
+ },
18
+ "peerDependencies": {
19
+ "react": ">=19.0.0",
20
+ "react-native": ">=0.78.3"
21
+ }
23
22
  }
@@ -4,7 +4,7 @@ module.exports = {
4
4
  /* TODO: Once we upgrade to RN69 we should try using podspecPath again, for now I copied ReactNativeUiLib.podspec file to the root - it seems to work
5
5
  I copied it, because we need it for both the main uilib and the uilib-native package */
6
6
  // ios: {
7
- // podspecPath: './lib/ReactNativeUiLib.podspec'
7
+ // podspecPath: './uilib-native/ReactNativeUiLib.podspec'
8
8
  // },
9
9
  android: {
10
10
  sourceDir: './android/',
@@ -1,72 +0,0 @@
1
- const exec = require('shell-utils').exec;
2
- const p = require('path');
3
-
4
- // Export buildkite variables for Release build
5
- // We cast toString() because function returns 'object'
6
- const IS_SNAPSHOT = process.env.BUILDKITE_MESSAGE?.match(/^snapshot$/i);
7
- const VERSION_TAG = IS_SNAPSHOT ? 'snapshot' : 'latest';
8
-
9
- function run() {
10
- if (!validateEnv()) {
11
- console.log('Do not release native');
12
- return;
13
- }
14
-
15
- console.log('Release native');
16
- const packageJsonVersion = require('../package.json').version;
17
- const currentPublished = findCurrentPublishedVersion();
18
- const newVersion = IS_SNAPSHOT
19
- ? `${packageJsonVersion}-snapshot.${process.env.BUILDKITE_BUILD_NUMBER}`
20
- : packageJsonVersion;
21
-
22
- if (currentPublished !== packageJsonVersion) {
23
- createNpmRc();
24
- versionTagAndPublish(currentPublished, newVersion);
25
- }
26
- }
27
-
28
- function validateEnv() {
29
- if (!process.env.CI) {
30
- throw new Error('releasing is only available from CI');
31
- }
32
- return process.env.BUILDKITE_BRANCH === 'master' || process.env.BUILDKITE_MESSAGE === 'snapshot';
33
- }
34
-
35
- function createNpmRc() {
36
- exec.execSync('rm -f package-lock.json');
37
- const npmrcPath = p.resolve(`${__dirname}/.npmrc`);
38
- exec.execSync(`cp -rf ${npmrcPath} .`);
39
- }
40
-
41
- function versionTagAndPublish(currentPublished, newVersion) {
42
- console.log(`current published version: ${currentPublished}`);
43
- console.log(`Publishing version: ${newVersion}`);
44
- tryPublishAndTag(newVersion);
45
- }
46
-
47
- function findCurrentPublishedVersion() {
48
- return exec.execSyncRead(`npm view ${process.env.npm_package_name} dist-tags.latest`);
49
- }
50
-
51
- function tryPublishAndTag(version) {
52
- try {
53
- tagAndPublish(version);
54
- console.log(`Released ${version}`);
55
- } catch (err) {
56
- console.log(`Failed to release ${version}`, err);
57
- }
58
- }
59
-
60
- function tagAndPublish(newVersion) {
61
- console.log(`trying to publish ${newVersion}...`);
62
- if (IS_SNAPSHOT) {
63
- exec.execSync(`npm --no-git-tag-version version ${newVersion}`);
64
- }
65
- exec.execSync(`npm publish --tag ${VERSION_TAG}`);
66
- if (!IS_SNAPSHOT) {
67
- exec.execSync(`git tag -a ${newVersion} -m "${newVersion}"`);
68
- }
69
- exec.execSyncSilent(`git push deploy ${newVersion} || true`);
70
- }
71
-
72
- run();