Skip to content

Commit 4186900

Browse files
kennethlynnesondremare
authored andcommitted
chore: update from source repository (#32)
* [Request] Add prop for tintColor for ActionSheet in Actions FaridSafi#185 Add prop optionTintColor for ActionSheet options text * Update default optionTintColor to native color * Initial support tick messages * The message sent and delivered props have been removed from GiftedChat and are now read from the message state * Added possibility to override the behaviour of renderTicks, deleted nested function in renderTicks * Updated example and ticks on the right the time and ticks only appear for the sent messages * renderTick: Move the constant declaration to the top of the function * Expose GiftedAvatar * renderTick: Possibility to change style of the ticks passing the parameter tickStyle to GiftedChat * Change the new messages' ids Now are UUIDs generated with `node-uuid` and is possible to change this behavior using `messageIdGenerator` prop. * fixed chat height bug * Refactor utils into stand-alone functions * Improve readability of utils * Keep improving readability of utils * Add utils to root exports * Add prop onInputTextChanged on GiftedChat API and help fix FaridSafi#286 * Maintain backward compatibility with deprecation warning * Add eslint script (extends airbnb + react + react-native) Currently 506 errors, 7 warnings :D * Upgrade to eslint config v0.2.3 Removed a few unnecessarily strict rules, so we're down to 486 errors now. * Add react-native-lightbox for enlarging chat images * Add navigator to propTypes * Use a commit hash to fix Lightbox warning [Android] Currently the fix is unpublished. * Remove touch events and external keyboard dependency * Bump RN version * Remove commented code * Downgrade RN version * Enabling access to Library Example crashes when you want to choose an image via „choose from library“ . Fixed that. Example should work with this edit like intended. * Remove dependency from package.json * Update property Deprecated property true for keyboardShouldPersistTaps * Update property for Gifted Chat Deprecated property true for keyboardShouldPersistTaps * Add 'onPressActionButton' prop * Add 'imageProps' prop, passed through to <Image> * Use 'lightboxProps' instead of just 'navigator' * config ListView props support * fix warning for Avatar Warning: Failed prop type: Invalid prop `left` of type `object` supplied to `Avatar`, expected `number`. Bad object: { "left": { "borderWidth": 1, "borderColor": "#236CC3" } } * avoid listViewProps to override render methd and datasources * Add listViewPoprs description to README * add listViewProps to default props and propTypes * Downgrade RN version to original * Update prop validation for keyboardShouldPersistTaps * Update Readme * Update RN version to 0.40 * readme for 0.1.0 * bump npm versions * Improve send message performance * add missing props to inner message components * v0.1.0 * fix for npm dependency * node-uuid -> uuid * v0.1.1 * Create GiftedChatInteractionManager.js * Update GiftedChat.js * v0.1.2 * v0.1.3 * render avatar on top * Remove duplicated enableEmptySections * If the keyboard has been dismissed and the user sends a message, the text input tool bar can be rendered incorrectly due to the bottom offset * Allow minimum input tool bar height to be configurable in properties * Update Bubble.js * Export MessageContainer in GiftedChat * fix for _messageContainerRef === null * Bubble.js: Default value for prop bottomContainerStyle * Applying fixes per comments * rename @exponent to @expo * v0.1.4 * image source add number type * formatting * Bump react-native-communications version to 2.2.1 * Support for orientation changes. Turned on onLayout handler for all platforms. Android only: on-screen keyboard resized main container and has own height. https://developer.android.com/training/keyboard-input/visibility.html So for calculate the messages container height need ignore keyboard height. * Fix messagesContainerHeight resetting on orientation change By using the same formula for messagesContainerHeight in onMainViewLayout as everywhere else. * Factor out repeated math into getBasicMessagesContainerHeight() * Factor out repeated math into getMessagesContainerHeightWithKeyboard() * Add onPressAvatar prop * Pass currentMessage to onLongPress callback * Add maxLength parameter for Composer input * fix-extra spacing shown when avatar is not rendered * fix isSameDay function * Update @expo/react-native-action-sheet * incorporate review and documentation * incorporate review * Fix default rendering of avatars (FaridSafi#479) * Default renderAvatar to undefined so that it renders by default Fixes bug introduced in FaridSafi#447 * Ignore .idea for IntelliJ * Commit yarn.lock files No changes to dependencies * Remove `runAfterInteractions` during init (FaridSafi#380) Fixes FaridSafi#377. Fixes FaridSafi#228. * 0.1.5 * Upgrade all dependencies to latest And RN v0.45 on the example app * [Example] Remove extraneous files when installing They get copied by Yarn, or libraries that publish their babel configs * Temporarily fork shallowequal to get rid of babel config dashed/shallowequal#14 * Upgrade shallowequal now that PR is merged * Change deprecated View.propTypes to ViewPropTypes (FaridSafi#478) * [Example] Migrate to react-native-maps (MapView was deprecated) * [Example] Temporarily fork react-native-nav to update ViewPropTypes jineshshah36/react-native-nav#17 * Temporarily fork RN-action-sheet for deprecated React.PropTypes expo/react-native-action-sheet#51 * Update README with new RN dependency requirements * Clean up README * 0.2.0 * [Example] Run react-native upgrade for RN v0.45 * [Example] Add back RCTCameraRoll.xcodeproj for camera roll picker * Replace deprecated `onChange` with `onContentSizeChange` (FaridSafi#500) * Migrate from deprecated React.PropTypes to prop-types (FaridSafi#508) * Commit new prop-types dependency in yarn.lock * Fix URLs that get linkified but are missing a scheme (FaridSafi#506) * Add code comment and error logging for MessageText.onUrlPress * Clarify Android installation steps for CRNA/Expo (FaridSafi#482) Explain that no native project changes are required in Create React Native App or Expo * Fix janky fullscreen Lightbox images by using flex: 1 (FaridSafi#467) Setting image to full width/height makes animation returning image to previous spot look extremely awkward. flex: 1 allows image to resize between thumbnail and fullscreen as was intended with lightbox. * Add `timeFormat` prop (FaridSafi#273) * Added property for time format * Added property to readme * Add `dateFormat` prop * Add .watchmanconfig and README notes for local development * [Example] Upgrade to RN v0.46 to verify compatibility * 0.2.1 * Add some README badges * 0.2.2 * Remove dead code introduced by FaridSafi#467 (FaridSafi#509) * Add 'showUserAvatar' prop; don't render null avatars (FaridSafi#511) * fix(Avatar): display user chat message avatar - check if current message user has an avatar to display - don't base the logic of the display of the avatar on the user object id Issue: FaridSafi#495 Issue URL: FaridSafi#495 * Only return null if avatar is set to null (otherwise render initials) * Add 'showUserAvatar' prop, default to false * Rearrange existing propTypes to match the README * Add missing props to GiftedChat root component * 0.2.3 * Accept a 'text' prop to override the internal state (e.g. redux) * Add Redux notes to the README * 0.2.4 * Use both onChange and onContentSizeChange to support Android RN <0.46 * 0.2.5 * Fix call/text onPhonePress actions ordering (FaridSafi#521) * Fix email sending recipient array (FaridSafi#522) * Fix minor typo in README (FaridSafi#517) * Fix `Linking.canOpenURL` usage (FaridSafi#516) * Add children props to Send component (FaridSafi#487) * Simplify logic for Send component children * 0.2.6 * Add imperative focusTextInput() method * 0.2.7 * Add `parsePatterns` prop for custom message links (FaridSafi#551) * Add a more generic function prop `parsePatterns` * Clean up README * [Example] Don't remove extraneous git dir Just in case someone is mistakenly trying to use symlinks with RN. * [Example] Update path to scripts/react-native-xcode.sh for RN v0.46 * Use better doc link for onLongPress (FaridSafi#573) * Fixed doc link for long press * Hard-code date for code link * rm test command * clean up * fix: use newer version of parsed-text which has fixed propTypes * fix: use newer version of lightbox which has fixed propTypes * fix: use newer invertible-scroll-view that has fixed propTypes for react 16 * fix: do not account for keyboard here, as we have our own component in differ which does that * reimplement inputToolbar ref * reimplement listview ref * add proptype for renderSuggestions
1 parent 4351453 commit 4186900

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6268
-510
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ node_modules/
33
npm-debug.log
44
.idea/
55
TODO.md
6+
7+
.idea

.watchmanconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ignore_dirs": [
3+
".git",
4+
"node_modules",
5+
"example"
6+
]
7+
}

README.md

Lines changed: 155 additions & 83 deletions
Large diffs are not rendered by default.

example/.flowconfig

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
24

3-
# We fork some components by platform.
4-
.*/*.android.js
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
57

6-
# Ignore templates with `@flow` in header
7-
.*/local-cli/generator.*
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
810

9-
# Ignore malformed json
10-
.*/node_modules/y18n/test/.*\.json
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
.*/Libraries/react-native/ReactNative.js
1116

1217
[include]
1318

@@ -17,25 +22,24 @@ node_modules/react-native/flow
1722
flow/
1823

1924
[options]
20-
module.system=haste
21-
22-
esproposal.class_static_fields=enable
23-
esproposal.class_instance_fields=enable
25+
emoji=true
2426

25-
experimental.strict_type_args=true
27+
module.system=haste
2628

2729
munge_underscores=true
2830

29-
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
3031
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
3132

3233
suppress_type=$FlowIssue
3334
suppress_type=$FlowFixMe
3435
suppress_type=$FixMe
3536

36-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
37-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
37+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
3839
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
40+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
41+
42+
unsafe.enable_getters_and_setters=true
3943

4044
[version]
41-
^0.27.0
45+
^0.47.0

example/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

example/.gitignore

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,32 @@ DerivedData
2222
*.xcuserstate
2323
project.xcworkspace
2424

25-
# Android/IJ
25+
# Android/IntelliJ
2626
#
27-
*.iml
27+
build/
2828
.idea
2929
.gradle
3030
local.properties
31+
*.iml
3132

3233
# node.js
3334
#
3435
node_modules/
3536
npm-debug.log
37+
yarn-error.log
3638

3739
# BUCK
3840
buck-out/
3941
\.buckd/
40-
android/app/libs
41-
android/keystores/debug.keystore
42+
*.keystore
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
50+
51+
fastlane/report.xml
52+
fastlane/Preview.html
53+
fastlane/screenshots

example/CustomActions.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import React from 'react';
21
import PropTypes from 'prop-types';
2+
import React from 'react';
33
import {
44
Modal,
55
StyleSheet,
66
TouchableOpacity,
77
View,
8+
ViewPropTypes,
89
Text,
910
} from 'react-native';
1011

@@ -170,7 +171,7 @@ const styles = StyleSheet.create({
170171
borderRadius: 13,
171172
borderColor: '#b2b2b2',
172173
borderWidth: 2,
173-
flexGrow: 1,
174+
flex: 1,
174175
},
175176
iconText: {
176177
color: '#b2b2b2',
@@ -198,7 +199,7 @@ CustomActions.propTypes = {
198199
onSend: PropTypes.func,
199200
options: PropTypes.object,
200201
icon: PropTypes.func,
201-
containerStyle: View.propTypes.style,
202-
wrapperStyle: View.propTypes.style,
202+
containerStyle: ViewPropTypes.style,
203+
wrapperStyle: ViewPropTypes.style,
203204
iconTextStyle: Text.propTypes.style,
204205
};

example/CustomView.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React from 'react';
21
import PropTypes from 'prop-types';
2+
import React from 'react';
33
import {
44
Linking,
5-
MapView,
65
Platform,
76
StyleSheet,
87
TouchableOpacity,
9-
View,
8+
ViewPropTypes,
109
} from 'react-native';
10+
import MapView from 'react-native-maps';
1111

1212
export default class CustomView extends React.Component {
1313
render() {
@@ -31,11 +31,9 @@ export default class CustomView extends React.Component {
3131
region={{
3232
latitude: this.props.currentMessage.location.latitude,
3333
longitude: this.props.currentMessage.location.longitude,
34+
latitudeDelta: 0.0922,
35+
longitudeDelta: 0.0421,
3436
}}
35-
annotations={[{
36-
latitude: this.props.currentMessage.location.latitude,
37-
longitude: this.props.currentMessage.location.longitude,
38-
}]}
3937
scrollEnabled={false}
4038
zoomEnabled={false}
4139
/>
@@ -65,6 +63,6 @@ CustomView.defaultProps = {
6563

6664
CustomView.propTypes = {
6765
currentMessage: PropTypes.object,
68-
containerStyle: View.propTypes.style,
69-
mapViewStyle: View.propTypes.style,
66+
containerStyle: ViewPropTypes.style,
67+
mapViewStyle: ViewPropTypes.style,
7068
};

example/android/app/BUCK

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import re
2-
31
# To learn about Buck see [Docs](https://buckbuild.com/).
42
# To run your application with Buck:
53
# - install Buck
@@ -11,56 +9,57 @@ import re
119
#
1210

1311
lib_deps = []
12+
1413
for jarfile in glob(['libs/*.jar']):
15-
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
14+
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
1615
lib_deps.append(':' + name)
1716
prebuilt_jar(
1817
name = name,
1918
binary_jar = jarfile,
2019
)
2120

2221
for aarfile in glob(['libs/*.aar']):
23-
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
22+
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
2423
lib_deps.append(':' + name)
2524
android_prebuilt_aar(
2625
name = name,
2726
aar = aarfile,
2827
)
2928

3029
android_library(
31-
name = 'all-libs',
32-
exported_deps = lib_deps
30+
name = "all-libs",
31+
exported_deps = lib_deps,
3332
)
3433

3534
android_library(
36-
name = 'app-code',
37-
srcs = glob([
38-
'src/main/java/**/*.java',
39-
]),
40-
deps = [
41-
':all-libs',
42-
':build_config',
43-
':res',
44-
],
35+
name = "app-code",
36+
srcs = glob([
37+
"src/main/java/**/*.java",
38+
]),
39+
deps = [
40+
":all-libs",
41+
":build_config",
42+
":res",
43+
],
4544
)
4645

4746
android_build_config(
48-
name = 'build_config',
49-
package = 'com.giftedchat',
47+
name = "build_config",
48+
package = "com.giftedchat",
5049
)
5150

5251
android_resource(
53-
name = 'res',
54-
res = 'src/main/res',
55-
package = 'com.giftedchat',
52+
name = "res",
53+
package = "com.giftedchat",
54+
res = "src/main/res",
5655
)
5756

5857
android_binary(
59-
name = 'app',
60-
package_type = 'debug',
61-
manifest = 'src/main/AndroidManifest.xml',
62-
keystore = '//android/keystores:debug',
63-
deps = [
64-
':app-code',
65-
],
58+
name = "app",
59+
keystore = "//android/keystores:debug",
60+
manifest = "src/main/AndroidManifest.xml",
61+
package_type = "debug",
62+
deps = [
63+
":app-code",
64+
],
6665
)

example/android/app/build.gradle

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ import com.android.build.OutputFile
3333
* // bundleInPaidRelease: true,
3434
* // bundleInBeta: true,
3535
*
36+
* // whether to disable dev mode in custom build variants (by default only disabled in release)
37+
* // for example: to disable dev mode in the staging build type (if configured)
38+
* devDisabledInStaging: true,
39+
* // The configuration property can be in the following formats
40+
* // 'devDisabledIn${productFlavor}${buildType}'
41+
* // 'devDisabledIn${buildType}'
42+
*
3643
* // the root of your project, i.e. where "package.json" lives
3744
* root: "../../",
3845
*
@@ -58,7 +65,7 @@ import com.android.build.OutputFile
5865
* inputExcludes: ["android/**", "ios/**"],
5966
*
6067
* // override which node gets called and with what additional arguments
61-
* nodeExecutableAndArgs: ["node"]
68+
* nodeExecutableAndArgs: ["node"],
6269
*
6370
* // supply additional arguments to the packager
6471
* extraPackagerArgs: []
@@ -126,6 +133,7 @@ android {
126133
}
127134

128135
dependencies {
136+
compile project(':react-native-maps')
129137
compile fileTree(dir: "libs", include: ["*.jar"])
130138
compile "com.android.support:appcompat-v7:23.0.1"
131139
compile "com.facebook.react:react-native:+" // From node_modules
@@ -134,6 +142,6 @@ dependencies {
134142
// Run this once to be able to run the application with BUCK
135143
// puts all compile dependencies into folder libs for BUCK to use
136144
task copyDownloadableDepsToLibs(type: Copy) {
137-
from configurations.compile
138-
into 'libs'
145+
from configurations.compile
146+
into 'libs'
139147
}

0 commit comments

Comments
 (0)