diff --git a/.npmignore b/.npmignore index 2bdd752..103599a 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,7 @@ /docs /example +/node_modules .eslintignore .eslintrc.js -.travis.yml \ No newline at end of file +.travis.yml +yarn.lock \ No newline at end of file diff --git a/docs/zh-cn/struct/Event.md b/docs/zh-cn/struct/Event.md index 77c5823..8290472 100644 --- a/docs/zh-cn/struct/Event.md +++ b/docs/zh-cn/struct/Event.md @@ -1,6 +1,6 @@ # 事件 -采用[react-native-general-listener](https://github.com/gaoxiaosong/react-native-general-listener)作为事件监听的类,这个库是支持多级层次的事件结构,并支持对所有下级事件的监听。 +采用[@hecom/listener](https://github.com/hecom-rn/listener)作为事件监听的类,这个库是支持多级层次的事件结构,并支持对所有下级事件的监听。 事件类型都放在`src/constant.js`中,其中`BaseEvent`代表基础事件类型,是每个事件的根类型。 diff --git a/example/yarn.lock b/example/yarn.lock index edff6f6..655b006 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -797,6 +797,30 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@egjs/hammerjs@^2.0.17": + version "2.0.17" + resolved "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124" + integrity sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A== + dependencies: + "@types/hammerjs" "^2.0.36" + +"@hecom-rn/react-native-full-image-picker@1.3.1": + version "1.3.1" + resolved "https://registry.npmjs.org/@hecom-rn/react-native-full-image-picker/-/react-native-full-image-picker-1.3.1.tgz#b22b70fde9dcfb53ebdde830b9e19ad5a14266cb" + integrity sha512-e9ZLGwgyBDsmJW+kvsJtekcSlPZP/LfLbrUAvw8AS0XphRMBwQ1uGJjO+zFH5j1dUwXa30bD2wRMytYvtXhvUg== + dependencies: + "@react-native-community/cameraroll" "^1.2.1" + react-native-fs "^2.13.3" + react-native-pure-navigation-bar "^1.4.7" + react-native-root-siblings "^3.1.7" + +"@hecom-rn/react-native-general-actionsheet@1.0.5": + version "1.0.5" + resolved "https://registry.npmjs.org/@hecom-rn/react-native-general-actionsheet/-/react-native-general-actionsheet-1.0.5.tgz#2d2f8584e408fb1ed99614be9572473e0cbc4bf1" + integrity sha512-aA4aDwxw/ijzdWeumWKbMUFkpTO7lg6aioh0LXAS3P9qCExt63Tlh6axjwPj7q8dDkCKc3+2ChdqhbIRC+PeZg== + dependencies: + react-native-safe-area-utility "^1.0.0" + "@hecom/badge@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@hecom/badge/-/badge-1.0.3.tgz#ea7691709a47df04e26d858f994a213406ada317" @@ -807,10 +831,24 @@ resolved "https://registry.yarnpkg.com/@hecom/image-arrow/-/image-arrow-1.0.3.tgz#cddbd10a1c7e716a7c08d8108f8a00f804a20471" integrity sha512-Ao5kIffZUCFcavPjBSoz+2nrMqLHYcv7nwQqqSmgj5nEq0OsS4vpSjTHL1ernZrudnJ/Bodw13w4BjtvQgDHWA== -"@hecom/react-native-image-capinsets@^0.5.1": - version "0.5.1" - resolved "https://registry.yarnpkg.com/@hecom/react-native-image-capinsets/-/react-native-image-capinsets-0.5.1.tgz#7f6d8aa340d5b224fa92218f26ac0336cd6e386d" - integrity sha512-D6828mND/6WBIaAihQRHRqL4X/ykO97e8XahCBj+69MpH2CMIaMSkiwEIywUOGoZWJfRcFDLHoITeDwUayZUbA== +"@hecom/listener@^1.0.0": + version "1.0.0" + resolved "https://registry.npmjs.org/@hecom/listener/-/listener-1.0.0.tgz#31fd889e8dbf3dcb304e93213052a5d3422e60d3" + integrity sha512-hGsqbsecEDRDMgq/MBe2ZqmdUJIMY+NZrDACOC/CndGUoTVaS+LGHUjaidbrYN1b8dCpW2pa6DqRySiUeWHPiA== + +"@react-native-community/art@^1.1.2": + version "1.2.0" + resolved "https://registry.npmjs.org/@react-native-community/art/-/art-1.2.0.tgz#386d95393f6042d9006f9d4bc6063fb898794460" + integrity sha512-a+ZcRGl/BzLa89yi33Mbn5SHavsEXqKUMdbfLf3U8MDLElndPqUetoJyGkv63+BcPO49UMWiQRP1YUz6/zfJ+A== + dependencies: + art "^0.10.3" + invariant "^2.2.4" + prop-types "^15.7.2" + +"@react-native-community/cameraroll@^1.2.1": + version "1.7.2" + resolved "https://registry.npmjs.org/@react-native-community/cameraroll/-/cameraroll-1.7.2.tgz#d1fc3770fb3c2ab85456cff0a587f756ae4838bf" + integrity sha512-qPIE+53Q3T41jD32W6YvzzwZteAwldMttroER2an2yrSoZbIP4r74DOWYLAv2FqS3NBs1k4jQ+fMp5rL22HtkQ== "@react-native-community/cli@^1.2.1": version "1.9.2" @@ -871,6 +909,11 @@ react-native-safe-area-view "^0.13.0" react-native-screens "^1.0.0 || ^1.0.0-alpha" +"@types/hammerjs@^2.0.36": + version "2.0.36" + resolved "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.36.tgz#17ce0a235e9ffbcdcdf5095646b374c2bf615a4c" + integrity sha512-7TUK/k2/QGpEAv/BCwSHlYu3NXZhQ9ZwBYpzr9tjlPIL2C5BeGhH3DmVavRx3ZNyELX5TLC91JTz/cen6AAtIQ== + abbrev@1: version "1.1.1" resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -1080,7 +1123,7 @@ array-unique@^0.3.2: resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -art@^0.10.0: +art@^0.10.0, art@^0.10.3: version "0.10.3" resolved "https://registry.npmjs.org/art/-/art-0.10.3.tgz#b01d84a968ccce6208df55a733838c96caeeaea2" integrity sha512-HXwbdofRTiJT6qZX/FnchtldzJjS3vkLJxQilc3Xj+ma2MXjY4UAyQ0ls1XZYVnDvVIBiFZbC6QsvtW86TD6tQ== @@ -3148,11 +3191,6 @@ jsx-ast-utils@^2.0.1: dependencies: array-includes "^3.0.3" -keymirror@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/keymirror/-/keymirror-0.1.1.tgz#918889ea13f8d0a42e7c557250eee713adc95c35" - integrity sha1-kYiJ6hP40KQufFVyUO7nE63JXDU= - kind-of@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz#140a3d2d41a36d2efcfa9377b62c24f8495a5c44" @@ -3237,6 +3275,11 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +lodash.debounce@4.0.8: + version "4.0.8" + resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + lodash.pad@^4.1.0: version "4.5.1" resolved "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz#4330949a833a7c8da22cc20f6a26c4d59debba70" @@ -4370,7 +4413,14 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2: +prop-types@15.5.8: + version "15.5.8" + resolved "https://registry.npmjs.org/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" + integrity sha1-a3suFBCDvjjIWVqlH8VXdccZk5Q= + dependencies: + fbjs "^0.8.9" + +prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -4477,13 +4527,6 @@ react-lifecycles-compat@^3.0.4: resolved "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== -react-native-camera@^1.8.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/react-native-camera/-/react-native-camera-1.13.1.tgz#19277ccae0a49dbf1b96049da5b95c847ea7aff2" - integrity sha512-wYjMi06ygYIiHRM4dSCH914xFUay7Wplx0bAej4iBkZeh54M4AxJDcF4vVZ5vdkpuAg8zvof3l+L1VhcKziMgw== - dependencies: - prop-types "^15.6.2" - react-native-fs@^2.13.3: version "2.13.3" resolved "https://registry.yarnpkg.com/react-native-fs/-/react-native-fs-2.13.3.tgz#a422f0ecd8a093a7e99d8d51ff51440e090a18a8" @@ -4492,30 +4535,6 @@ react-native-fs@^2.13.3: base-64 "^0.1.0" utf8 "^2.1.1" -react-native-full-image-picker@^1.2.10: - version "1.2.11" - resolved "https://registry.yarnpkg.com/react-native-full-image-picker/-/react-native-full-image-picker-1.2.11.tgz#342953c5281adc8f8749ee52b96d21a41a57b47f" - integrity sha512-cOAyhfbjzl8FFICylcm+c1bwg4jZbuNBaevkAzXeYTtBPZRUOnvXHRFM2D/+IjmaBENFvQi0vSrNCxaaunCREg== - dependencies: - react-native-camera "^1.8.0" - react-native-fs "^2.13.3" - react-native-pure-navigation-bar "^1.4.7" - react-native-root-siblings "^3.1.7" - react-native-video "^4.3.0" - -react-native-general-actionsheet@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/react-native-general-actionsheet/-/react-native-general-actionsheet-1.0.3.tgz#4d94f5f7b6295c9a1023383a3f4d72e2d9eaed52" - integrity sha512-va60UNTvUTv7Nd0RLYAyqeD0K6KNdrNaSnhD551FFhQb//fJDNm2+ECwfkB2PK4WRgPrElxYBDYpWLiYrzxqvA== - dependencies: - react-native-pure-navigation-bar "^1.4.6" - react-native-root-siblings "^3.1.6" - -react-native-general-listener@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/react-native-general-listener/-/react-native-general-listener-1.0.3.tgz#72525b8e77fcc121b10d349984bd24433788efb9" - integrity sha512-MGtiKU8pBnJd3ybqkhQM9K+smaQieOHRS8GDQLmxO2pj0vxFNFDUHFOl/IIajczjPF0vNN2+4bJSmu0YAuPzLw== - react-native-general-searchbar@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/react-native-general-searchbar/-/react-native-general-searchbar-1.0.6.tgz#e17f445e57f4402577f54ac0625800e167a5a9da" @@ -4535,6 +4554,16 @@ react-native-gesture-handler@^1.1.0: invariant "^2.2.2" prop-types "^15.5.10" +react-native-gesture-handler@^1.6.0: + version "1.6.1" + resolved "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.6.1.tgz#678e2dce250ed66e93af409759be22cd6375dd17" + integrity sha512-gQgIKhDiYf754yzhhliagLuLupvGb6ZyBdzYzr7aus3Fyi87TLOw63ers+r4kGw0h26oAWTAdHd34JnF4NeL6Q== + dependencies: + "@egjs/hammerjs" "^2.0.17" + hoist-non-react-statics "^2.3.1" + invariant "^2.2.4" + prop-types "^15.7.2" + react-native-im-easemob@^1.0.22: version "1.0.22" resolved "https://registry.yarnpkg.com/react-native-im-easemob/-/react-native-im-easemob-1.0.22.tgz#1f9a325659ae84ef88a7925716414058c366655c" @@ -4543,31 +4572,31 @@ react-native-im-easemob@^1.0.22: react-native-im@../: version "0.1.0" dependencies: + "@hecom-rn/react-native-full-image-picker" "1.3.1" + "@hecom-rn/react-native-general-actionsheet" "1.0.5" "@hecom/badge" "^1.0.2" "@hecom/image-arrow" "^1.0.3" - "@hecom/react-native-image-capinsets" "^0.5.1" + "@hecom/listener" "^1.0.0" dateformat "^3.0.3" i18n-js "^3.2.1" react-native-fs "^2.13.3" - react-native-full-image-picker "^1.2.10" - react-native-general-actionsheet "^1.0.3" - react-native-general-listener "^1.0.3" react-native-general-searchbar "^1.0.6" react-native-general-storage "^1.0.4" - react-native-keyboard-aware-scroll-view "^0.7.4" + react-native-gesture-handler "^1.6.0" + react-native-keyboard-aware-scroll-view "^0.9.1" react-native-localize "^1.1.2" - react-native-photo-browse "^1.0.1" + react-native-photo-browse "^1.1.1" react-native-picklist "^1.2.5" react-native-popover-view "^1.0.17" react-native-popup-dialog "^0.16.6" react-native-pure-navigation-bar "^1.4.9" - react-native-root-toast "^3.0.2" + react-native-root-toast "^3.1.1" react-native-section-list-get-item-layout "^2.2.3" react-native-sound "^0.10.9" react-native-sound-recorder "^1.3.2" react-native-swipe-list-view "^1.5.0" - react-native-video "^4.3.0" react-navigation-header-buttons "^2.1.1" + recyclerlistview "^3.0.0" specials "^2.0.4" react-native-image-pan-zoom@^2.1.9: @@ -4587,10 +4616,10 @@ react-native-iphone-x-helper@^1.0.3: resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.2.0.tgz#9f8a376eb00bc712115abff4420318a0063fa796" integrity sha512-xIeTo4s77wwKgBZLVRIZC9tM9/PkXS46Ul76NXmvmixEb3ZwqGdQesR3zRiLMOoIdfOURB6N9bba9po7+x9Bag== -react-native-keyboard-aware-scroll-view@^0.7.4: - version "0.7.4" - resolved "https://registry.yarnpkg.com/react-native-keyboard-aware-scroll-view/-/react-native-keyboard-aware-scroll-view-0.7.4.tgz#80fb4b56f3c5cb399da0c6832ec52729856ac08a" - integrity sha512-5AJ11sGcleiX43IJ32T0kPtIxcd1JWw0R+YPwkgyZWro7uuGBlq09CFW5jS9JTNoGq7crFzFfTcoTIY6B41rNQ== +react-native-keyboard-aware-scroll-view@^0.9.1: + version "0.9.1" + resolved "https://registry.npmjs.org/react-native-keyboard-aware-scroll-view/-/react-native-keyboard-aware-scroll-view-0.9.1.tgz#9e54b565a5f19b30bed12221d48921781f7630af" + integrity sha512-tBZ8rmjELN0F6t5UBp5CW3NYmZXgVnJSzVCssv/OqG2t6kiB+OUTqxNvUP24K+HARX4H+XaW0aEJSFQkQCv6KA== dependencies: prop-types "^15.6.2" react-native-iphone-x-helper "^1.0.3" @@ -4605,13 +4634,14 @@ react-native-permissions@^1.1.1: resolved "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-1.1.1.tgz#4876004681ff8556454613d85249b01baff9b35b" integrity sha512-t0Ujm177bagjUOSzhpmkSz+LqFW04HnY9TeZFavDCmV521fQvFz82aD+POXqWsAdsJVOK3umJYBNNqCjC3g0hQ== -react-native-photo-browse@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/react-native-photo-browse/-/react-native-photo-browse-1.0.1.tgz#404c9cb45060f60f9ce10df7d27a7e5e06ac6dc4" - integrity sha512-7eL03jnxChLrIgOzgFWjDQ1KdCnHLd8/l4qLA8DZ6hurzxsoxocXHb8p86NnRi/IOs9/Kcwe9OIpEj8DW8rPpw== +react-native-photo-browse@^1.1.1: + version "1.2.0" + resolved "https://registry.npmjs.org/react-native-photo-browse/-/react-native-photo-browse-1.2.0.tgz#b79cd57193ba30c18854146db58d8d91b4c8dade" + integrity sha512-CMkar5g+l1TSun+C2unFAS/DvxeEs1Ru194EJ9t+TpblLRnMv1Ep0LkURks7FTh6UQmqowwhYV3S6zHyZK09VQ== dependencies: + react-native-fs "^2.13.3" react-native-image-zoom-viewer "^2.2.23" - react-native-pure-navigation-bar "^1.4.6" + react-native-progress "^4.1.0" react-native-root-siblings "^3.1.6" react-native-root-toast "^3.0.1" @@ -4646,7 +4676,15 @@ react-native-popup-dialog@^0.16.6: prop-types "^15.6.0" react-native-root-siblings "^3.1.7" -react-native-pure-navigation-bar@^1.4.6, react-native-pure-navigation-bar@^1.4.7, react-native-pure-navigation-bar@^1.4.9: +react-native-progress@^4.1.0: + version "4.1.2" + resolved "https://registry.npmjs.org/react-native-progress/-/react-native-progress-4.1.2.tgz#ffb2264ddfeba409c730e36a9791bb7bbe07a00d" + integrity sha512-sFHs6k6npWDOyvQoL2NeyOyHb+q1s8iOAOeyzoObN77zkxOAsgJt9FcSJLRq70Mw7qSGNJMFDqCgvYR1huYRwQ== + dependencies: + "@react-native-community/art" "^1.1.2" + prop-types "^15.7.2" + +react-native-pure-navigation-bar@^1.4.7, react-native-pure-navigation-bar@^1.4.9: version "1.4.9" resolved "https://registry.yarnpkg.com/react-native-pure-navigation-bar/-/react-native-pure-navigation-bar-1.4.9.tgz#990d4da090300b57bf643f5e702c5181b62e7ffd" integrity sha512-tDktla7L5aaq3T1AcnCGzwYb68o2QtCvaOHBdN0hOy+LI1nrvSp2IBofylHegJTkUYBh64mbyfgmJp/VSbGGww== @@ -4664,7 +4702,14 @@ react-native-root-siblings@^3.0.0, react-native-root-siblings@^3.1.6, react-nati prop-types "^15.6.2" static-container "^1.0.0" -react-native-root-toast@^3.0.1, react-native-root-toast@^3.0.2: +react-native-root-siblings@^4.0.0: + version "4.0.6" + resolved "https://registry.npmjs.org/react-native-root-siblings/-/react-native-root-siblings-4.0.6.tgz#6dd7eedb725faacd7ba19c159dd279cf2e6d8476" + integrity sha512-u/MaJLdD3bnshDFg8HWB0Xys1xlkQy6++3QthQlYw4kOFElobb6V1IIn5r46JvBTr9cf6dXsrFC4zPVXuwW1ww== + dependencies: + static-container "^1.5.1" + +react-native-root-toast@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/react-native-root-toast/-/react-native-root-toast-3.0.2.tgz#85c0c50d300c895a35ea98587b4ad4c9540297ee" integrity sha512-I3yJkfFP7yEBRBiJAToQgPtxZwf+8j60KDPN3nOYSg9Nfqldq6VwIC4Pgq6Wt8XgqpSuIBtwGYfpc5JS8TxFeg== @@ -4672,6 +4717,19 @@ react-native-root-toast@^3.0.1, react-native-root-toast@^3.0.2: prop-types "^15.5.10" react-native-root-siblings "^3.0.0" +react-native-root-toast@^3.1.1: + version "3.2.1" + resolved "https://registry.npmjs.org/react-native-root-toast/-/react-native-root-toast-3.2.1.tgz#f456d029f5c5b76e4b686334f25371465478a3be" + integrity sha512-BNf6LKMqcIAonKgqCGQWk+1lduFqSjPYbEF0FygMZbXhODRTvrGUAvAgV6kfamVPOkKHUkPU7dnnvmgEQ8ZDzQ== + dependencies: + prop-types "^15.5.10" + react-native-root-siblings "^4.0.0" + +react-native-safe-area-utility@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/react-native-safe-area-utility/-/react-native-safe-area-utility-1.0.0.tgz#1dc289145f67d65ff70cb57b3aa8898e2d588438" + integrity sha512-tavIx5ONlc+VqthQnjgNUE2WqfZJ/kf2kXyWq7y/wRxz5Ag0wG8eInQnRYkKA1cM7LncPx+9agBmy54IOXY2dw== + react-native-safe-area-view@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.10.0.tgz#e8e9228d22698c0f82ad1202d24a4e4977260489" @@ -4725,15 +4783,6 @@ react-native-tab-view@^1.3.4: dependencies: prop-types "^15.6.1" -react-native-video@^4.3.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/react-native-video/-/react-native-video-4.4.0.tgz#18012cb8ad90aac42be3d04c92430f820f3ab03b" - integrity sha512-QXdud1JII1tuTVeYAedWqRJnf8eDuY87ucSXdERuWQb9umuLVbkF1BcAckhiWf3/+R4YdKBFR0nY2n4o8e0qkg== - dependencies: - keymirror "^0.1.1" - prop-types "^15.5.10" - shaka-player "^2.4.4" - react-native@0.59.5: version "0.59.5" resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.59.5.tgz#79500d2885a3dc83216715e1fc6effa878ad6ea9" @@ -4886,6 +4935,15 @@ readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.2.2, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" +recyclerlistview@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/recyclerlistview/-/recyclerlistview-3.0.0.tgz#72ef5ef0246cb851695698c37836001651e70b4f" + integrity sha512-t9AiPgwGkCwhCXJhrRj7UhEJ0kpiOkc4g89txurZs2crACg8zVStRRYk6tehECz2NQvmM9Gmp+apGBqie33++Q== + dependencies: + lodash.debounce "4.0.8" + prop-types "15.5.8" + ts-object-utils "0.0.5" + regenerate-unicode-properties@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" @@ -5204,11 +5262,6 @@ setprototypeof@1.1.0: resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== -shaka-player@^2.4.4: - version "2.4.7" - resolved "https://registry.yarnpkg.com/shaka-player/-/shaka-player-2.4.7.tgz#8532e53ba7d8781b0785b552c7c68681c13c3206" - integrity sha512-KXYVB7snrrmcmDvusf2IIGOXZCvrlb6vXkl1q0pXP/QdUkvHm2SsW6jIXKvDz9xsvs9Pt/R7tm8POgfUOzybcQ== - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -5398,6 +5451,11 @@ static-container@^1.0.0: resolved "https://registry.yarnpkg.com/static-container/-/static-container-1.3.0.tgz#e4f7b4be4e42954e3d1955ab7b3974a78b7bad87" integrity sha512-OJnvgv6tq9T5QbFUMioEK4WP48pMn/X4qdcrWAhop6boMMz6pMmWPWXgjimn1wKqcClZ6Ff0iSKViRXzwx111w== +static-container@^1.5.1: + version "1.5.1" + resolved "https://registry.npmjs.org/static-container/-/static-container-1.5.1.tgz#9d7a94e04dea864539a7b6a1304843ada740dc19" + integrity sha512-OFChfLKIvSzaMA3otS5CEabJTIzHFPhMxogIT+io4F207PXTvS6woFyjXIyXyqMIYAhryePGeFZYC6uLcG1lpA== + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -5630,6 +5688,11 @@ trim-right@^1.0.1: resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= +ts-object-utils@0.0.5: + version "0.0.5" + resolved "https://registry.npmjs.org/ts-object-utils/-/ts-object-utils-0.0.5.tgz#95361cdecd7e52167cfc5e634c76345e90a26077" + integrity sha1-lTYc3s1+UhZ8/F5jTHY0XpCiYHc= + tslib@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" diff --git a/language/zh.json b/language/zh.json index 182b3ec..b951b05 100644 --- a/language/zh.json +++ b/language/zh.json @@ -23,8 +23,9 @@ "IMPageChooseConversationTitle": "选择聊天", "IMPageChooseConversationCreateNew": "创建新聊天", "IMPageChooseUserSelectFromOrg": "按部门选同事", + "IMPageChooseUserAll": "所有人", "IMSettingAddGroupMember": "添加群成员", - "IMSettingAllMembers": "全体成员({{length}})", + "IMSettingAllMembers": "查看全体群成员({{length}})", "IMSettingAllowInvite": "允许添加成员", "IMSettingAvoid": "消息免打扰", "IMSettingChooseGroupMember": "选择群成员", @@ -37,6 +38,8 @@ "IMSettingGroupNameChangeTips": "请输入群聊名称", "IMSettingGroupNameNotEmpty": "群聊名称不能为空", "IMSettingLeaveGroupDestroy": "解散群聊", + "IMSettingGroupAnnouncement": "群公告", + "IMSettingGroupAnnouncementChange": "更改群公告", "IMSettingLeaveGroupQuit": "退出群聊", "IMSettingRemoveGroupMember": "删除群成员", "IMSettingTop": "置顶聊天", @@ -44,5 +47,6 @@ "IMSettingTransferOwnerAction": "转交", "IMToastError": "{{action}}失败", "IMToastMessageNotSupport": "当前版本暂不支持该消息", - "IMToastSuccess": "{{action}}成功" -} \ No newline at end of file + "IMToastSuccess": "{{action}}成功", + "IMSettingGroupDataInfo": "资料" +} diff --git a/package.json b/package.json index 17ee2e7..cf47455 100644 --- a/package.json +++ b/package.json @@ -19,47 +19,68 @@ }, "homepage": "https://github.com/gaoxiaosong/react-native-im#readme", "dependencies": { - "@hecom/badge": "^1.0.2", - "@hecom/image-arrow": "^1.0.3", - "@hecom-rn/react-native-full-image-picker":"1.3.1", - "@hecom-rn/react-native-general-actionsheet":"1.0.5", + "@hecom-rn/react-native-general-actionsheet": "1.0.5", "dateformat": "^3.0.3", "i18n-js": "^3.2.1", - "react-native-fs": "^2.13.3", - "react-native-general-listener": "^1.0.3", - "react-native-general-searchbar": "^1.0.6", - "react-native-general-storage": "^1.0.4", - "react-native-gesture-handler": "^1.6.0", - "react-native-keyboard-aware-scroll-view": "^0.9.1", - "react-native-localize": "^1.1.2", - "react-native-photo-browse": "^1.1.0", - "react-native-picklist": "^1.2.5", - "react-native-popover-view": "^1.0.17", - "react-native-popup-dialog": "^0.16.6", - "react-native-pure-navigation-bar": "^1.4.9", - "react-native-root-toast": "^3.1.1", + "md5": "^2.3.0", "react-native-section-list-get-item-layout": "^2.2.3", - "react-native-sound": "^0.10.9", - "react-native-sound-recorder": "^1.3.2", - "react-native-swipe-list-view": "^1.5.0", - "react-navigation-header-buttons": "^2.1.1", - "specials": "^2.0.4" + "recyclerlistview": "^3.0.0" }, "peerDependencies": { + "@hecom-rn/react-native-full-image-picker": "*", + "@hecom/badge": "*", + "@hecom/image-arrow": "*", + "@hecom/listener": "*", "@hecom/react-native-image-capinsets": "*", + "@hecom/react-native-picklist": "*", + "@hecom/react-native-pure-navigation-bar": "*", + "@hecom/storage": ">=1.1", + "@react-navigation/native": "*", "react": "*", "react-native": "*", + "react-native-fs": ">=2", + "react-native-general-searchbar": ">=1", + "react-native-gesture-handler": ">=1", + "react-native-keyboard-aware-scroll-view": "*", + "react-native-localize": "*", + "react-native-modals": "*", + "react-native-photo-browse": "*", + "react-native-popover-view": ">=3.0.3", + "react-native-root-toast": "*", + "react-native-sound": "*", + "react-native-sound-recorder": "*", + "react-native-swipe-list-view": "*", "react-native-video": "*", - "react-navigation": "*" + "react-navigation-header-buttons": ">=2.1.1", + "specials": "^2.0.4", + "react-native-permissions": "*" }, "devDependencies": { + "@hecom/badge": "^1.0.3", + "@hecom/image-arrow": "^1.0.3", + "@hecom/listener": "^1.0.0", + "@hecom/storage": "1.1.0", "@types/i18n-js": "^3.0.1", "@types/promise.prototype.finally": "^2.0.3", "@types/react": "^16.8.14", "@types/react-native": "^0.57.46", - "@types/react-navigation": "^3.0.6", "eslint-plugin-automatic": "latest", + "react-native-fs": "^2.13.3", + "react-native-general-searchbar": "^1.0.6", + "react-native-gesture-handler": "^1.6.0", "react-native-im-easemob": "^1.0.24", - "tslib": "^1.9.3" + "react-native-keyboard-aware-scroll-view": "^0.9.1", + "react-native-localize": "^1.1.2", + "react-native-modals": "^0.19.9", + "react-native-photo-browse": "1.3.0", + "react-native-picklist": "^1.2.5", + "react-native-popover-view": "^3.0.3", + "react-native-root-toast": "^3.2.1", + "react-native-sound": "^0.10.9", + "react-native-sound-recorder": "^1.3.2", + "react-native-swipe-list-view": "^1.5.0", + "react-navigation-header-buttons": "^2.1.1", + "tslib": "^1.9.3", + "react-native-permissions": "^2.2.2" } } diff --git a/plugin/easemob/IMConversationDelegate.ts b/plugin/easemob/IMConversationDelegate.ts index 11197a2..e86678b 100644 --- a/plugin/easemob/IMConversationDelegate.ts +++ b/plugin/easemob/IMConversationDelegate.ts @@ -26,6 +26,12 @@ export default function () { Delegate.im.conversation.deleteOne = (imId) => { return ChatManager.deleteConversation(imId); }; + Delegate.im.conversation.deleteAllMessages = (imId, chatType) => { + return ChatManager.deleteAllMessages(imId, chatType); + }; + Delegate.im.conversation.updateMessageExt = (messageId, ext) => { + return ChatManager.updateMessageExt(messageId, ext); + }; // TODO updateConfig Delegate.im.conversation.markAllRead = (imId, chatType) => { return ChatManager.markAllMessagesAsRead(imId, chatType); diff --git a/plugin/easemob/ParseAction.ts b/plugin/easemob/ParseAction.ts index 7ce4377..da1d787 100644 --- a/plugin/easemob/ParseAction.ts +++ b/plugin/easemob/ParseAction.ts @@ -37,6 +37,7 @@ function convertText(message: Typings.Message.Origin) { text: message.body.text, atMemberList: message.ext ? message.ext.atMemberList : [], isSystem: message.ext ? message.ext.isSystemMessage : false, + quoteMsg: message.ext ? message.ext.quoteMsg : undefined, } ); } @@ -79,6 +80,7 @@ function convertVideo(message: Typings.Message.Origin) { localPath: message.body.localPath, remotePath: message.body.remotePath, duration: 0, // TODO duration + shouldRead: message.ext.shouldRead, } ); } diff --git a/plugin/easemob/SendAction.ts b/plugin/easemob/SendAction.ts index a6ff9b6..fff20f1 100644 --- a/plugin/easemob/SendAction.ts +++ b/plugin/easemob/SendAction.ts @@ -43,6 +43,7 @@ function sendText(params: Typings.Action.Send.Params) chatType, message.data.text, { + quoteMsg:message.data.quoteMsg, atMemberList: message.data.atMemberList, ...ext, }, diff --git a/plugin/message/display/ImageBubble.tsx b/plugin/message/display/ImageBubble.tsx index e3d9f84..a8e5b62 100644 --- a/plugin/message/display/ImageBubble.tsx +++ b/plugin/message/display/ImageBubble.tsx @@ -65,21 +65,31 @@ export default class extends React.PureComponent { resizeMode={'contain'} source={this.state.source} style={[styles.image, {width, height}]} + onError={this.onError} /> ) : null; } + onError = () => this.setState({source: require('./image/load_error.png')}) + public onPress() { - const {message: {data: {remotePath}, messageId}, messages = []} = this.props; - const images = messages.filter(({type}) => type === IMConstant.MessageType.image).reverse(); - const currentIndex = images.findIndex(image => image.messageId === messageId); - showPhotoBrowserPage({ - currentIndex: currentIndex < 0 ? 0 : currentIndex, - images: images.length === 0 ? [remotePath] : images.map(({data: {remotePath}}) => remotePath), - canSave: true, - renderIndicator: () => null, - }); + const {message: {data: {remotePath, localPath}, messageId}, messages = []} = this.props; + + if (!remotePath && !localPath) { + return; + } + const images = messages.filter(({type, data: {remotePath: remoteP, localPath: localP}}) => { + return type === IMConstant.MessageType.image && + ((remoteP && remoteP.length > 0) || (localP && localP.length > 0)) + }).reverse(); + const currentIndex = images.findIndex(image => image.messageId === messageId); + showPhotoBrowserPage({ + currentIndex: currentIndex < 0 ? 0 : currentIndex, + images: images.length === 0 ? [remotePath] : images.map(({data: {remotePath, localPath}}) => remotePath ? remotePath : localPath), + canSave: true, + renderIndicator: () => null, + }); } } diff --git a/plugin/message/display/QuoteMsgBubble.tsx b/plugin/message/display/QuoteMsgBubble.tsx new file mode 100644 index 0000000..0b30d30 --- /dev/null +++ b/plugin/message/display/QuoteMsgBubble.tsx @@ -0,0 +1,74 @@ +import React from 'react'; +import { Platform, StyleSheet, Text, TextStyle, TouchableWithoutFeedback } from 'react-native'; +import { Message } from 'react-native-im/standard/typings'; +import { Model as MsgModel } from '../../../standard'; + +interface Props { + message: Message.General; + maxWidth: number, + paddingLeft: number, + paddingRight: number, + innerMaxWidth: number, +} + +export default class QuoteMsgBubble extends React.PureComponent { + + constructor(props: Props) { + super(props); + } + + + render() { + + const { message: { data: { quoteMsg } }, maxWidth, paddingRight } = this.props; + + return quoteMsg ? ( + + + {(MsgModel.Quote.msgDescResolver.get(quoteMsg.type) as Function)(quoteMsg)} + + + ) : null; + } + + protected _onPress() { + const { message: { data: { quoteMsg: quoteMsg } } } = this.props; + (MsgModel.Quote.msgClickHandleResolver.get(quoteMsg.type) as Function)(quoteMsg); + } +} + +const styles = StyleSheet.create({ + container: { + flexDirection: 'column', + alignItems: 'flex-end', + }, + quoteText: { + height: 20, + fontSize: 13, + marginTop: 3, + paddingTop: 2, + alignContent: "center", + paddingBottom: 2, + borderRadius: 3, + backgroundColor: '#cccccc', + ...Platform.select({ + android: { textAlignVertical: 'center' }, + }), + overflow: 'hidden', + } as TextStyle, + view: { + backgroundColor: 'transparent', + paddingHorizontal: 13, + paddingVertical: 10, + flexDirection: 'row', + justifyContent: 'flex-start', + alignItems: 'center', + flexWrap: 'wrap', + }, +}); \ No newline at end of file diff --git a/plugin/message/display/VideoBubble.tsx b/plugin/message/display/VideoBubble.tsx index cd9b710..02b857a 100644 --- a/plugin/message/display/VideoBubble.tsx +++ b/plugin/message/display/VideoBubble.tsx @@ -1,47 +1,164 @@ import React from 'react'; -import { Image, StyleSheet, View } from 'react-native'; +import {ActivityIndicator, Image, Platform, StyleSheet, Text, View} from "react-native"; import Video from 'react-native-video'; -import { Typings } from '../../../standard'; +import {Typings} from '../../../standard'; +import OSSManager from 'core/oss/OSSManager'; +import md5 from 'md5'; +import RNFS from "react-native-fs"; + +import {IMStandard} from "react-native-im/index"; + export type Props = Typings.Action.Display.Params; export interface State { paused: boolean; + downloadReady: boolean; + displaySize?: Size; +} + +class Size { + width: number; + height: number; } export default class extends React.PureComponent { protected player: Video | null; - + private isAndroid: Boolean = Platform.OS === 'android'; state: State = { paused: true, + downloadReady: false, }; + private remotePath: string; + private localPath: string; + private playableDuration: any; + private displayPath: string; + private maxDisplaySize: number; + private size: Size; + + constructor(props: Props) { + super(props); + const {message: {data: {localPath, remotePath, playableDuration, size}}, maxWidth} = props; + this.remotePath = remotePath; + this.localPath = localPath; + this.maxDisplaySize = maxWidth * 0.6; + this.size = size; + this.playableDuration = playableDuration; + } render() { - const {message: {data: {localPath, remotePath}}, maxWidth} = this.props; - const width = maxWidth; - const height = maxWidth * 0.75; + const content = this.state.downloadReady ? this._renderContent() : this._renderLoading(); return ( + {content} + + ); + } + + _renderContent() { + let content; + if (this.isAndroid) { + content = ( + + ); + } else { + content = (