react-native-tree-multi-select 1.2.3 → 1.2.4
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.
- package/package.json +1 -1
- package/.editorconfig +0 -15
- package/.gitattributes +0 -3
- package/.github/FUNDING.yml +0 -13
- package/.github/ISSUE_TEMPLATE/bug-report.md +0 -42
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -30
- package/.github/actions/setup/action.yml +0 -28
- package/.github/assets/Jairaj_Jangle_Google_Pay_UPI_QR_Code.jpg +0 -0
- package/.github/assets/paypal_donate.png +0 -0
- package/.github/assets/upi.png +0 -0
- package/.github/workflows/ci.yml +0 -225
- package/.gitignore +0 -73
- package/.nvmrc +0 -1
- package/.watchmanconfig +0 -1
- package/.yarnrc +0 -3
- package/CHANGELOG.md +0 -145
- package/CODE_OF_CONDUCT.md +0 -133
- package/CONTRIBUTING.md +0 -114
- package/babel.config.js +0 -3
- package/example/.bundle/config +0 -2
- package/example/.watchmanconfig +0 -1
- package/example/Gemfile +0 -6
- package/example/README.md +0 -79
- package/example/android/app/build.gradle +0 -130
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +0 -10
- package/example/android/app/src/debug/AndroidManifest.xml +0 -13
- package/example/android/app/src/debug/java/com/treemultiselectexample/ReactNativeFlipper.java +0 -75
- package/example/android/app/src/main/AndroidManifest.xml +0 -25
- package/example/android/app/src/main/java/com/treemultiselectexample/MainActivity.java +0 -32
- package/example/android/app/src/main/java/com/treemultiselectexample/MainApplication.java +0 -62
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +0 -3
- package/example/android/app/src/main/res/values/styles.xml +0 -9
- package/example/android/app/src/release/java/com/treemultiselectexample/ReactNativeFlipper.java +0 -20
- package/example/android/build.gradle +0 -23
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/example/android/gradle.properties +0 -44
- package/example/android/gradlew +0 -244
- package/example/android/gradlew.bat +0 -92
- package/example/android/settings.gradle +0 -4
- package/example/app.json +0 -4
- package/example/babel.config.js +0 -17
- package/example/index.js +0 -5
- package/example/ios/.xcode.env +0 -11
- package/example/ios/File.swift +0 -6
- package/example/ios/Podfile +0 -62
- package/example/ios/Podfile.lock +0 -639
- package/example/ios/TreeMultiSelectExample/AppDelegate.h +0 -6
- package/example/ios/TreeMultiSelectExample/AppDelegate.mm +0 -26
- package/example/ios/TreeMultiSelectExample/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
- package/example/ios/TreeMultiSelectExample/Images.xcassets/Contents.json +0 -6
- package/example/ios/TreeMultiSelectExample/Info.plist +0 -74
- package/example/ios/TreeMultiSelectExample/LaunchScreen.storyboard +0 -47
- package/example/ios/TreeMultiSelectExample/main.m +0 -10
- package/example/ios/TreeMultiSelectExample-Bridging-Header.h +0 -3
- package/example/ios/TreeMultiSelectExample.xcodeproj/project.pbxproj +0 -706
- package/example/ios/TreeMultiSelectExample.xcodeproj/xcshareddata/xcschemes/TreeMultiSelectExample.xcscheme +0 -88
- package/example/ios/TreeMultiSelectExample.xcworkspace/contents.xcworkspacedata +0 -10
- package/example/ios/TreeMultiSelectExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/TreeMultiSelectExampleTests/Info.plist +0 -24
- package/example/ios/TreeMultiSelectExampleTests/TreeMultiSelectExampleTests.m +0 -66
- package/example/metro.config.js +0 -45
- package/example/package.json +0 -41
- package/example/react-native.config.js +0 -10
- package/example/src/App.tsx +0 -70
- package/example/src/components/CustomArrow.tsx +0 -71
- package/example/src/components/CustomCheckboxView.tsx +0 -119
- package/example/src/components/CustomNodeRowView.tsx +0 -124
- package/example/src/components/SearchInput.tsx +0 -68
- package/example/src/screens/CustomArrowScreen.tsx +0 -99
- package/example/src/screens/CustomCheckboxScreen.tsx +0 -99
- package/example/src/screens/CustomNodeRowViewScreen.tsx +0 -99
- package/example/src/screens/LargeDataScreen.tsx +0 -95
- package/example/src/screens/MediumDataScreen.tsx +0 -96
- package/example/src/screens/SmallDataScreen.tsx +0 -96
- package/example/src/screens/screens.styles.ts +0 -25
- package/example/src/utils/sampleDataGenerator.ts +0 -32
- package/example/yarn.lock +0 -6368
- package/lefthook.yml +0 -17
- package/lib/typescript/__mocks__/generateTree.mock.d.ts +0 -17
- package/lib/typescript/__mocks__/generateTree.mock.d.ts.map +0 -1
- package/lib/typescript/__mocks__/zustand.d.ts +0 -3
- package/lib/typescript/__mocks__/zustand.d.ts.map +0 -1
- package/lib/typescript/__tests__/expandCollapse.helper.test.d.ts +0 -2
- package/lib/typescript/__tests__/expandCollapse.helper.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/flattenTree.helper.test.d.ts +0 -2
- package/lib/typescript/__tests__/flattenTree.helper.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/initNodeMap.helper.test.d.ts +0 -2
- package/lib/typescript/__tests__/initNodeMap.helper.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/search.helper.test.d.ts +0 -2
- package/lib/typescript/__tests__/search.helper.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/selectAll.helper.test.d.ts +0 -2
- package/lib/typescript/__tests__/selectAll.helper.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/store.test.d.ts +0 -2
- package/lib/typescript/__tests__/store.test.d.ts.map +0 -1
- package/lib/typescript/__tests__/toggleCheckbox.helper.test.d.ts +0 -2
- package/lib/typescript/__tests__/toggleCheckbox.helper.test.d.ts.map +0 -1
- package/scripts/bootstrap.js +0 -29
- package/src/__mocks__/generateTree.mock.ts +0 -125
- package/src/__mocks__/zustand.ts +0 -24
- package/src/__tests__/expandCollapse.helper.test.ts +0 -189
- package/src/__tests__/flattenTree.helper.test.ts +0 -78
- package/src/__tests__/initNodeMap.helper.test.ts +0 -46
- package/src/__tests__/search.helper.test.ts +0 -47
- package/src/__tests__/selectAll.helper.test.ts +0 -233
- package/src/__tests__/store.test.ts +0 -208
- package/src/__tests__/toggleCheckbox.helper.test.ts +0 -124
- package/tsconfig.build.json +0 -5
- package/tsconfig.json +0 -31
- package/turbo.json +0 -34
- package/yarn.lock +0 -9953
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Contributor Covenant Code of Conduct
|
|
3
|
-
|
|
4
|
-
## Our Pledge
|
|
5
|
-
|
|
6
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
7
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
9
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
10
|
-
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
11
|
-
identity and orientation.
|
|
12
|
-
|
|
13
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
14
|
-
diverse, inclusive, and healthy community.
|
|
15
|
-
|
|
16
|
-
## Our Standards
|
|
17
|
-
|
|
18
|
-
Examples of behavior that contributes to a positive environment for our
|
|
19
|
-
community include:
|
|
20
|
-
|
|
21
|
-
* Demonstrating empathy and kindness toward other people
|
|
22
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
23
|
-
* Giving and gracefully accepting constructive feedback
|
|
24
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
25
|
-
and learning from the experience
|
|
26
|
-
* Focusing on what is best not just for us as individuals, but for the overall
|
|
27
|
-
community
|
|
28
|
-
|
|
29
|
-
Examples of unacceptable behavior include:
|
|
30
|
-
|
|
31
|
-
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
32
|
-
any kind
|
|
33
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
34
|
-
* Public or private harassment
|
|
35
|
-
* Publishing others' private information, such as a physical or email address,
|
|
36
|
-
without their explicit permission
|
|
37
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
38
|
-
professional setting
|
|
39
|
-
|
|
40
|
-
## Enforcement Responsibilities
|
|
41
|
-
|
|
42
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
43
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
44
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
45
|
-
or harmful.
|
|
46
|
-
|
|
47
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
|
48
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
49
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
50
|
-
decisions when appropriate.
|
|
51
|
-
|
|
52
|
-
## Scope
|
|
53
|
-
|
|
54
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
|
55
|
-
an individual is officially representing the community in public spaces.
|
|
56
|
-
Examples of representing our community include using an official e-mail address,
|
|
57
|
-
posting via an official social media account, or acting as an appointed
|
|
58
|
-
representative at an online or offline event.
|
|
59
|
-
|
|
60
|
-
## Enforcement
|
|
61
|
-
|
|
62
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
63
|
-
reported to the community leaders responsible for enforcement at
|
|
64
|
-
[INSERT CONTACT METHOD].
|
|
65
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
66
|
-
|
|
67
|
-
All community leaders are obligated to respect the privacy and security of the
|
|
68
|
-
reporter of any incident.
|
|
69
|
-
|
|
70
|
-
## Enforcement Guidelines
|
|
71
|
-
|
|
72
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
73
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
74
|
-
|
|
75
|
-
### 1. Correction
|
|
76
|
-
|
|
77
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
78
|
-
unprofessional or unwelcome in the community.
|
|
79
|
-
|
|
80
|
-
**Consequence**: A private, written warning from community leaders, providing
|
|
81
|
-
clarity around the nature of the violation and an explanation of why the
|
|
82
|
-
behavior was inappropriate. A public apology may be requested.
|
|
83
|
-
|
|
84
|
-
### 2. Warning
|
|
85
|
-
|
|
86
|
-
**Community Impact**: A violation through a single incident or series of
|
|
87
|
-
actions.
|
|
88
|
-
|
|
89
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
90
|
-
interaction with the people involved, including unsolicited interaction with
|
|
91
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
|
92
|
-
includes avoiding interactions in community spaces as well as external channels
|
|
93
|
-
like social media. Violating these terms may lead to a temporary or permanent
|
|
94
|
-
ban.
|
|
95
|
-
|
|
96
|
-
### 3. Temporary Ban
|
|
97
|
-
|
|
98
|
-
**Community Impact**: A serious violation of community standards, including
|
|
99
|
-
sustained inappropriate behavior.
|
|
100
|
-
|
|
101
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
102
|
-
communication with the community for a specified period of time. No public or
|
|
103
|
-
private interaction with the people involved, including unsolicited interaction
|
|
104
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
|
105
|
-
Violating these terms may lead to a permanent ban.
|
|
106
|
-
|
|
107
|
-
### 4. Permanent Ban
|
|
108
|
-
|
|
109
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
110
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
111
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
|
112
|
-
|
|
113
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
114
|
-
community.
|
|
115
|
-
|
|
116
|
-
## Attribution
|
|
117
|
-
|
|
118
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
119
|
-
version 2.1, available at
|
|
120
|
-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
121
|
-
|
|
122
|
-
Community Impact Guidelines were inspired by
|
|
123
|
-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
124
|
-
|
|
125
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
126
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
127
|
-
[https://www.contributor-covenant.org/translations][translations].
|
|
128
|
-
|
|
129
|
-
[homepage]: https://www.contributor-covenant.org
|
|
130
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
131
|
-
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
132
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
|
133
|
-
[translations]: https://www.contributor-covenant.org/translations
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
Contributions are always welcome, no matter how large or small!
|
|
4
|
-
|
|
5
|
-
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md).
|
|
6
|
-
|
|
7
|
-
## Development workflow
|
|
8
|
-
|
|
9
|
-
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
yarn
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
|
|
16
|
-
|
|
17
|
-
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
|
|
18
|
-
|
|
19
|
-
To start the packager:
|
|
20
|
-
|
|
21
|
-
```sh
|
|
22
|
-
yarn example start
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
To run the example app on Android:
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
yarn example android
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
To run the example app on iOS:
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
yarn example ios
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Make sure your code passes TypeScript and ESLint. Run the following to verify:
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
yarn typecheck
|
|
41
|
-
yarn lint
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
To fix formatting errors, run the following:
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
yarn lint --fix
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Remember to add tests for your change if possible. Run the unit tests by:
|
|
51
|
-
|
|
52
|
-
```sh
|
|
53
|
-
yarn test
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
To edit the Objective-C or Swift files, open `example/ios/TreeMultiSelectExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-tree-multi-select`.
|
|
57
|
-
|
|
58
|
-
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-tree-multi-select` under `Android`.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
### Commit message convention
|
|
62
|
-
|
|
63
|
-
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
|
|
64
|
-
|
|
65
|
-
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
|
|
66
|
-
- `feat`: new features, e.g. add new method to the module.
|
|
67
|
-
- `refactor`: code refactor, e.g. migrate from class components to hooks.
|
|
68
|
-
- `docs`: changes into documentation, e.g. add usage example for the module..
|
|
69
|
-
- `test`: adding or updating tests, e.g. add integration tests using detox.
|
|
70
|
-
- `chore`: tooling changes, e.g. change CI config.
|
|
71
|
-
|
|
72
|
-
Our pre-commit hooks verify that your commit message matches this format when committing.
|
|
73
|
-
|
|
74
|
-
### Linting and tests
|
|
75
|
-
|
|
76
|
-
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
|
|
77
|
-
|
|
78
|
-
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
|
|
79
|
-
|
|
80
|
-
Our pre-commit hooks verify that the linter and tests pass when committing.
|
|
81
|
-
|
|
82
|
-
### Publishing to npm
|
|
83
|
-
|
|
84
|
-
We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
|
|
85
|
-
|
|
86
|
-
To publish new versions, run the following:
|
|
87
|
-
|
|
88
|
-
```sh
|
|
89
|
-
yarn release
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Scripts
|
|
93
|
-
|
|
94
|
-
The `package.json` file contains various scripts for common tasks:
|
|
95
|
-
|
|
96
|
-
- `yarn bootstrap`: setup project by installing all dependencies and pods.
|
|
97
|
-
- `yarn typecheck`: type-check files with TypeScript.
|
|
98
|
-
- `yarn lint`: lint files with ESLint.
|
|
99
|
-
- `yarn test`: run unit tests with Jest.
|
|
100
|
-
- `yarn example start`: start the Metro server for the example app.
|
|
101
|
-
- `yarn example android`: run the example app on Android.
|
|
102
|
-
- `yarn example ios`: run the example app on iOS.
|
|
103
|
-
|
|
104
|
-
### Sending a pull request
|
|
105
|
-
|
|
106
|
-
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
|
|
107
|
-
|
|
108
|
-
When you're sending a pull request:
|
|
109
|
-
|
|
110
|
-
- Prefer small pull requests focused on one change.
|
|
111
|
-
- Verify that linters and tests are passing.
|
|
112
|
-
- Review the documentation to make sure it looks good.
|
|
113
|
-
- Follow the pull request template when opening a pull request.
|
|
114
|
-
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
|
package/babel.config.js
DELETED
package/example/.bundle/config
DELETED
package/example/.watchmanconfig
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
package/example/Gemfile
DELETED
package/example/README.md
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
|
|
2
|
-
|
|
3
|
-
# Getting Started
|
|
4
|
-
|
|
5
|
-
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
|
|
6
|
-
|
|
7
|
-
## Step 1: Start the Metro Server
|
|
8
|
-
|
|
9
|
-
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
|
|
10
|
-
|
|
11
|
-
To start Metro, run the following command from the _root_ of your React Native project:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
# using npm
|
|
15
|
-
npm start
|
|
16
|
-
|
|
17
|
-
# OR using Yarn
|
|
18
|
-
yarn start
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Step 2: Start your Application
|
|
22
|
-
|
|
23
|
-
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
|
|
24
|
-
|
|
25
|
-
### For Android
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# using npm
|
|
29
|
-
npm run android
|
|
30
|
-
|
|
31
|
-
# OR using Yarn
|
|
32
|
-
yarn android
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### For iOS
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
# using npm
|
|
39
|
-
npm run ios
|
|
40
|
-
|
|
41
|
-
# OR using Yarn
|
|
42
|
-
yarn ios
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
|
|
46
|
-
|
|
47
|
-
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
|
|
48
|
-
|
|
49
|
-
## Step 3: Modifying your App
|
|
50
|
-
|
|
51
|
-
Now that you have successfully run the app, let's modify it.
|
|
52
|
-
|
|
53
|
-
1. Open `App.tsx` in your text editor of choice and edit some lines.
|
|
54
|
-
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
|
|
55
|
-
|
|
56
|
-
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
|
|
57
|
-
|
|
58
|
-
## Congratulations! :tada:
|
|
59
|
-
|
|
60
|
-
You've successfully run and modified your React Native App. :partying_face:
|
|
61
|
-
|
|
62
|
-
### Now what?
|
|
63
|
-
|
|
64
|
-
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
|
|
65
|
-
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
|
|
66
|
-
|
|
67
|
-
# Troubleshooting
|
|
68
|
-
|
|
69
|
-
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
|
|
70
|
-
|
|
71
|
-
# Learn More
|
|
72
|
-
|
|
73
|
-
To learn more about React Native, take a look at the following resources:
|
|
74
|
-
|
|
75
|
-
- [React Native Website](https://reactnative.dev) - learn more about React Native.
|
|
76
|
-
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
|
|
77
|
-
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
|
|
78
|
-
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
|
|
79
|
-
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
apply plugin: "com.android.application"
|
|
2
|
-
apply plugin: "com.facebook.react"
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* This is the configuration block to customize your React Native Android app.
|
|
6
|
-
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
7
|
-
*/
|
|
8
|
-
react {
|
|
9
|
-
/* Folders */
|
|
10
|
-
// The root of your project, i.e. where "package.json" lives. Default is '..'
|
|
11
|
-
// root = file("../")
|
|
12
|
-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
|
|
13
|
-
// reactNativeDir = file("../node_modules/react-native")
|
|
14
|
-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
|
|
15
|
-
// codegenDir = file("../node_modules/@react-native/codegen")
|
|
16
|
-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
|
|
17
|
-
// cliFile = file("../node_modules/react-native/cli.js")
|
|
18
|
-
|
|
19
|
-
/* Variants */
|
|
20
|
-
// The list of variants to that are debuggable. For those we're going to
|
|
21
|
-
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
|
|
22
|
-
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
|
|
23
|
-
// debuggableVariants = ["liteDebug", "prodDebug"]
|
|
24
|
-
|
|
25
|
-
/* Bundling */
|
|
26
|
-
// A list containing the node command and its flags. Default is just 'node'.
|
|
27
|
-
// nodeExecutableAndArgs = ["node"]
|
|
28
|
-
//
|
|
29
|
-
// The command to run when bundling. By default is 'bundle'
|
|
30
|
-
// bundleCommand = "ram-bundle"
|
|
31
|
-
//
|
|
32
|
-
// The path to the CLI configuration file. Default is empty.
|
|
33
|
-
// bundleConfig = file(../rn-cli.config.js)
|
|
34
|
-
//
|
|
35
|
-
// The name of the generated asset file containing your JS bundle
|
|
36
|
-
// bundleAssetName = "MyApplication.android.bundle"
|
|
37
|
-
//
|
|
38
|
-
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
|
|
39
|
-
// entryFile = file("../js/MyApplication.android.js")
|
|
40
|
-
//
|
|
41
|
-
// A list of extra flags to pass to the 'bundle' commands.
|
|
42
|
-
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
|
|
43
|
-
// extraPackagerArgs = []
|
|
44
|
-
|
|
45
|
-
/* Hermes Commands */
|
|
46
|
-
// The hermes compiler command to run. By default it is 'hermesc'
|
|
47
|
-
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
|
|
48
|
-
//
|
|
49
|
-
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
50
|
-
// hermesFlags = ["-O", "-output-source-map"]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
55
|
-
*/
|
|
56
|
-
def enableProguardInReleaseBuilds = true
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The preferred build flavor of JavaScriptCore (JSC)
|
|
60
|
-
*
|
|
61
|
-
* For example, to use the international variant, you can use:
|
|
62
|
-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
63
|
-
*
|
|
64
|
-
* The international variant includes ICU i18n library and necessary data
|
|
65
|
-
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
66
|
-
* give correct results when using with locales other than en-US. Note that
|
|
67
|
-
* this variant is about 6MiB larger per architecture than default.
|
|
68
|
-
*/
|
|
69
|
-
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
70
|
-
|
|
71
|
-
android {
|
|
72
|
-
ndkVersion rootProject.ext.ndkVersion
|
|
73
|
-
|
|
74
|
-
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
75
|
-
|
|
76
|
-
namespace "com.treemultiselectexample"
|
|
77
|
-
defaultConfig {
|
|
78
|
-
applicationId "com.treemultiselectexample"
|
|
79
|
-
minSdkVersion rootProject.ext.minSdkVersion
|
|
80
|
-
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
81
|
-
versionCode 40
|
|
82
|
-
versionName "1.0.0"
|
|
83
|
-
}
|
|
84
|
-
signingConfigs {
|
|
85
|
-
debug {
|
|
86
|
-
storeFile file('debug.keystore')
|
|
87
|
-
storePassword 'android'
|
|
88
|
-
keyAlias 'androiddebugkey'
|
|
89
|
-
keyPassword 'android'
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
buildTypes {
|
|
93
|
-
debug {
|
|
94
|
-
signingConfig signingConfigs.debug
|
|
95
|
-
}
|
|
96
|
-
release {
|
|
97
|
-
// Caution! In production, you need to generate your own keystore file.
|
|
98
|
-
// see https://reactnative.dev/docs/signed-apk-android.
|
|
99
|
-
signingConfig signingConfigs.debug
|
|
100
|
-
minifyEnabled enableProguardInReleaseBuilds
|
|
101
|
-
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
dependencies {
|
|
107
|
-
// The version of react-native is set by the React Native Gradle Plugin
|
|
108
|
-
implementation("com.facebook.react:react-android")
|
|
109
|
-
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
|
|
110
|
-
|
|
111
|
-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
|
|
112
|
-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
|
|
113
|
-
exclude group:'com.squareup.okhttp3', module:'okhttp'
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
|
|
117
|
-
if (hermesEnabled.toBoolean()) {
|
|
118
|
-
implementation("com.facebook.react:hermes-android")
|
|
119
|
-
} else {
|
|
120
|
-
implementation jscFlavor
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
project.ext.vectoricons = [
|
|
125
|
-
iconFontNames: [ 'MaterialIcons.ttf', 'FontAwesome.ttf', 'MaterialCommunityIcons.ttf', 'Ionicons.ttf'] // Name of the font files you want to copy
|
|
126
|
-
]
|
|
127
|
-
|
|
128
|
-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
129
|
-
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
|
|
130
|
-
|
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Add project specific ProGuard rules here.
|
|
2
|
-
# By default, the flags in this file are appended to flags specified
|
|
3
|
-
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
4
|
-
# You can edit the include path and order by changing the proguardFiles
|
|
5
|
-
# directive in build.gradle.
|
|
6
|
-
#
|
|
7
|
-
# For more details, see
|
|
8
|
-
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
9
|
-
|
|
10
|
-
# Add any project specific keep options here:
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:tools="http://schemas.android.com/tools">
|
|
4
|
-
|
|
5
|
-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
6
|
-
|
|
7
|
-
<application
|
|
8
|
-
android:usesCleartextTraffic="true"
|
|
9
|
-
tools:targetApi="28"
|
|
10
|
-
tools:ignore="GoogleAppIndexingWarning">
|
|
11
|
-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
|
|
12
|
-
</application>
|
|
13
|
-
</manifest>
|
package/example/android/app/src/debug/java/com/treemultiselectexample/ReactNativeFlipper.java
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
-
* directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
package com.treemultiselectexample;
|
|
8
|
-
|
|
9
|
-
import android.content.Context;
|
|
10
|
-
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
-
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
-
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
-
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
-
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
-
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
-
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
-
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
-
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
-
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
-
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
21
|
-
import com.facebook.react.ReactInstanceEventListener;
|
|
22
|
-
import com.facebook.react.ReactInstanceManager;
|
|
23
|
-
import com.facebook.react.bridge.ReactContext;
|
|
24
|
-
import com.facebook.react.modules.network.NetworkingModule;
|
|
25
|
-
import okhttp3.OkHttpClient;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Class responsible of loading Flipper inside your React Native application. This is the debug
|
|
29
|
-
* flavor of it. Here you can add your own plugins and customize the Flipper setup.
|
|
30
|
-
*/
|
|
31
|
-
public class ReactNativeFlipper {
|
|
32
|
-
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
33
|
-
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
34
|
-
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
35
|
-
|
|
36
|
-
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
37
|
-
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
38
|
-
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
39
|
-
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
40
|
-
|
|
41
|
-
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
42
|
-
NetworkingModule.setCustomClientBuilder(
|
|
43
|
-
new NetworkingModule.CustomClientBuilder() {
|
|
44
|
-
@Override
|
|
45
|
-
public void apply(OkHttpClient.Builder builder) {
|
|
46
|
-
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
client.addPlugin(networkFlipperPlugin);
|
|
50
|
-
client.start();
|
|
51
|
-
|
|
52
|
-
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
53
|
-
// Hence we run if after all native modules have been initialized
|
|
54
|
-
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
55
|
-
if (reactContext == null) {
|
|
56
|
-
reactInstanceManager.addReactInstanceEventListener(
|
|
57
|
-
new ReactInstanceEventListener() {
|
|
58
|
-
@Override
|
|
59
|
-
public void onReactContextInitialized(ReactContext reactContext) {
|
|
60
|
-
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
61
|
-
reactContext.runOnNativeModulesQueueThread(
|
|
62
|
-
new Runnable() {
|
|
63
|
-
@Override
|
|
64
|
-
public void run() {
|
|
65
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
} else {
|
|
71
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
-
|
|
3
|
-
<uses-permission android:name="android.permission.INTERNET" />
|
|
4
|
-
|
|
5
|
-
<application
|
|
6
|
-
android:name=".MainApplication"
|
|
7
|
-
android:label="@string/app_name"
|
|
8
|
-
android:icon="@mipmap/ic_launcher"
|
|
9
|
-
android:roundIcon="@mipmap/ic_launcher_round"
|
|
10
|
-
android:allowBackup="false"
|
|
11
|
-
android:theme="@style/AppTheme">
|
|
12
|
-
<activity
|
|
13
|
-
android:name=".MainActivity"
|
|
14
|
-
android:label="@string/app_name"
|
|
15
|
-
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
16
|
-
android:launchMode="singleTask"
|
|
17
|
-
android:windowSoftInputMode="adjustResize"
|
|
18
|
-
android:exported="true">
|
|
19
|
-
<intent-filter>
|
|
20
|
-
<action android:name="android.intent.action.MAIN" />
|
|
21
|
-
<category android:name="android.intent.category.LAUNCHER" />
|
|
22
|
-
</intent-filter>
|
|
23
|
-
</activity>
|
|
24
|
-
</application>
|
|
25
|
-
</manifest>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
package com.treemultiselectexample;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactActivity;
|
|
4
|
-
import com.facebook.react.ReactActivityDelegate;
|
|
5
|
-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
6
|
-
import com.facebook.react.defaults.DefaultReactActivityDelegate;
|
|
7
|
-
|
|
8
|
-
public class MainActivity extends ReactActivity {
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
12
|
-
* rendering of the component.
|
|
13
|
-
*/
|
|
14
|
-
@Override
|
|
15
|
-
protected String getMainComponentName() {
|
|
16
|
-
return "TreeMultiSelectExample";
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
|
|
21
|
-
* DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
|
|
22
|
-
* (aka React 18) with two boolean flags.
|
|
23
|
-
*/
|
|
24
|
-
@Override
|
|
25
|
-
protected ReactActivityDelegate createReactActivityDelegate() {
|
|
26
|
-
return new DefaultReactActivityDelegate(
|
|
27
|
-
this,
|
|
28
|
-
getMainComponentName(),
|
|
29
|
-
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
|
30
|
-
DefaultNewArchitectureEntryPoint.getFabricEnabled());
|
|
31
|
-
}
|
|
32
|
-
}
|