Skip to content

Commit

Permalink
chore: update from source repository (#32)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
kennethlynne authored and sondremare committed Oct 23, 2017
1 parent 4351453 commit 4186900
Show file tree
Hide file tree
Showing 45 changed files with 6,268 additions and 510 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules/
npm-debug.log
.idea/
TODO.md

.idea
7 changes: 7 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignore_dirs": [
".git",
"node_modules",
"example"
]
}
238 changes: 155 additions & 83 deletions README.md

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions example/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

# We fork some components by platform.
.*/*.android.js
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

# Ignore templates with `@flow` in header
.*/local-cli/generator.*
; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

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

[include]

Expand All @@ -17,25 +22,24 @@ node_modules/react-native/flow
flow/

[options]
module.system=haste

esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
emoji=true

experimental.strict_type_args=true
module.system=haste

munge_underscores=true

module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
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'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
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]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.27.0
^0.47.0
1 change: 1 addition & 0 deletions example/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pbxproj -text
20 changes: 16 additions & 4 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,32 @@ DerivedData
*.xcuserstate
project.xcworkspace

# Android/IJ
# Android/IntelliJ
#
*.iml
build/
.idea
.gradle
local.properties
*.iml

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore
*.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
9 changes: 5 additions & 4 deletions example/CustomActions.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import React from 'react';
import {
Modal,
StyleSheet,
TouchableOpacity,
View,
ViewPropTypes,
Text,
} from 'react-native';

Expand Down Expand Up @@ -170,7 +171,7 @@ const styles = StyleSheet.create({
borderRadius: 13,
borderColor: '#b2b2b2',
borderWidth: 2,
flexGrow: 1,
flex: 1,
},
iconText: {
color: '#b2b2b2',
Expand Down Expand Up @@ -198,7 +199,7 @@ CustomActions.propTypes = {
onSend: PropTypes.func,
options: PropTypes.object,
icon: PropTypes.func,
containerStyle: View.propTypes.style,
wrapperStyle: View.propTypes.style,
containerStyle: ViewPropTypes.style,
wrapperStyle: ViewPropTypes.style,
iconTextStyle: Text.propTypes.style,
};
16 changes: 7 additions & 9 deletions example/CustomView.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import React from 'react';
import {
Linking,
MapView,
Platform,
StyleSheet,
TouchableOpacity,
View,
ViewPropTypes,
} from 'react-native';
import MapView from 'react-native-maps';

export default class CustomView extends React.Component {
render() {
Expand All @@ -31,11 +31,9 @@ export default class CustomView extends React.Component {
region={{
latitude: this.props.currentMessage.location.latitude,
longitude: this.props.currentMessage.location.longitude,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
annotations={[{
latitude: this.props.currentMessage.location.latitude,
longitude: this.props.currentMessage.location.longitude,
}]}
scrollEnabled={false}
zoomEnabled={false}
/>
Expand Down Expand Up @@ -65,6 +63,6 @@ CustomView.defaultProps = {

CustomView.propTypes = {
currentMessage: PropTypes.object,
containerStyle: View.propTypes.style,
mapViewStyle: View.propTypes.style,
containerStyle: ViewPropTypes.style,
mapViewStyle: ViewPropTypes.style,
};
53 changes: 26 additions & 27 deletions example/android/app/BUCK
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import re

# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
Expand All @@ -11,56 +9,57 @@ import re
#

lib_deps = []

for jarfile in glob(['libs/*.jar']):
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
lib_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)

for aarfile in glob(['libs/*.aar']):
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
lib_deps.append(':' + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)

android_library(
name = 'all-libs',
exported_deps = lib_deps
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = 'app-code',
srcs = glob([
'src/main/java/**/*.java',
]),
deps = [
':all-libs',
':build_config',
':res',
],
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = 'build_config',
package = 'com.giftedchat',
name = "build_config",
package = "com.giftedchat",
)

android_resource(
name = 'res',
res = 'src/main/res',
package = 'com.giftedchat',
name = "res",
package = "com.giftedchat",
res = "src/main/res",
)

android_binary(
name = 'app',
package_type = 'debug',
manifest = 'src/main/AndroidManifest.xml',
keystore = '//android/keystores:debug',
deps = [
':app-code',
],
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
14 changes: 11 additions & 3 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ import com.android.build.OutputFile
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
Expand All @@ -58,7 +65,7 @@ import com.android.build.OutputFile
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
Expand Down Expand Up @@ -126,6 +133,7 @@ android {
}

dependencies {
compile project(':react-native-maps')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
Expand All @@ -134,6 +142,6 @@ dependencies {
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
from configurations.compile
into 'libs'
}
4 changes: 4 additions & 0 deletions example/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@

-dontwarn com.facebook.react.**

# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
-dontwarn android.text.StaticLayout

# okhttp

-keepattributes Signature
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.giftedchat;

import android.app.Application;
import android.util.Log;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.airbnb.android.react.maps.MapsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;
Expand All @@ -16,20 +16,27 @@ public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
new MainReactPackage(),
new MapsPackage()
);
}
};

@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
return mReactNativeHost;
}

@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.android.tools.build:gradle:2.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
Loading

0 comments on commit 4186900

Please sign in to comment.