{"_id":"@azrico/flat-list-mvcp","_rev":"2-0f41899001609f514240acb77bea9c85","name":"@azrico/flat-list-mvcp","dist-tags":{"latest":"0.10.2-alpha.2"},"versions":{"0.10.2":{"name":"@azrico/flat-list-mvcp","version":"0.10.2","description":"`maintainVisibleContentPosition` support for Android react-native","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"prepare":"bob build","test":"jest","typescript":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","lint-fix":"prettier --write 'src/**/*.{js,ts,tsx,md,json}' && eslint --fix 'src/**/*.{js,ts,tsx,md}' --max-warnings 0 && stylelint --fix 'src/**/*.{js,ts,tsx}'","release":"release-it","example":"yarn --cwd example","pods":"cd example && pod-install --quiet","bootstrap":"yarn example && yarn && yarn pods"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/GetStream/flat-list-mvcp.git"},"author":{"name":"vishtree","email":"vishalnarkhede.iitd@gmail.com","url":"https://github.com/vishalnarkhede"},"license":"MIT","bugs":{"url":"https://github.com/GetStream/flat-list-mvcp/issues"},"homepage":"https://github.com/GetStream/flat-list-mvcp#readme","devDependencies":{"@commitlint/config-conventional":"^8.3.4","@react-native-community/eslint-config":"^2.0.0","@release-it/conventional-changelog":"^1.1.4","@types/jest":"^26.0.0","@types/react":"^16.9.19","@types/react-native":"0.63.50","commitlint":"^8.3.5","eslint":"^7.2.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.3","husky":"^4.3.5","jest":"^26.0.1","pod-install":"^0.1.0","prettier":"^2.0.5","react":"16.13.1","react-native":"0.63.4","react-native-builder-bob":"^0.18.2","release-it":"^13.5.8","typescript":"^4.1.4"},"peerDependencies":{"react":"*","react-native":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"husky":{"hooks":{"pre-commit":"yarn lint && yarn typescript"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"extends":["@react-native-community","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"_id":"@azrico/flat-list-mvcp@0.10.2","gitHead":"b9abef495e1a727852e3bf4e420fd7663162edd4","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-RfUbNQhP2dxzXkZTtXuhwx0O+sB6mJduni20aCxztVEF7w2gjaeH+k7r0I2mdJvhMt7cv2rxXN5pbrdtTN7BPg==","shasum":"e653d7f5b36d2fefde250f54290ab65add4a5d20","tarball":"https://registry.npmjs.org/@azrico/flat-list-mvcp/-/flat-list-mvcp-0.10.2.tgz","fileCount":39,"unpackedSize":175298,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICz1aVh3/T/1zJWd8OOWQgLvTRoVg1+IdPXRONu9qIgWAiBj22VDewjpHKXNpn6SO+5WqytasJeC4MAiSPOb/OgGUA=="}]},"_npmUser":{"name":"azrideus","email":"mehrdadtavangar@gmail.com"},"directories":{},"maintainers":[{"name":"azrideus","email":"mehrdadtavangar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flat-list-mvcp_0.10.2_1707763569440_0.48193259747568185"},"_hasShrinkwrap":false},"0.10.2-alpha.1":{"name":"@azrico/flat-list-mvcp","version":"0.10.2-alpha.1","description":"`maintainVisibleContentPosition` support for Android react-native","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"prepare":"bob build","test":"jest","typescript":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","lint-fix":"prettier --write \"**/*.{js,ts,tsx}\" && eslint --fix \"**/*.{js,ts,tsx}\" --max-warnings 0 && stylelint --fix \"**/*.{js,ts,tsx}\"","release":"release-it","example":"yarn --cwd example","pods":"cd example && pod-install --quiet","bootstrap":"yarn example && yarn && yarn pods"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/GetStream/flat-list-mvcp.git"},"author":{"name":"vishtree","email":"vishalnarkhede.iitd@gmail.com","url":"https://github.com/vishalnarkhede"},"license":"MIT","bugs":{"url":"https://github.com/GetStream/flat-list-mvcp/issues"},"homepage":"https://github.com/GetStream/flat-list-mvcp#readme","devDependencies":{"@commitlint/config-conventional":"^8.3.4","@react-native-community/eslint-config":"^2.0.0","@release-it/conventional-changelog":"^1.1.4","@types/jest":"^26.0.0","@types/react":"^16.9.19","@types/react-native":"0.63.50","commitlint":"^8.3.5","eslint":"^7.2.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.3","husky":"^4.3.5","jest":"^26.0.1","pod-install":"^0.1.0","prettier":"^2.0.5","react":"16.13.1","react-native":"0.63.4","react-native-builder-bob":"^0.18.2","release-it":"^13.5.8","typescript":"^4.1.4"},"peerDependencies":{"react":"*","react-native":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"husky":{"hooks":{"pre-commit":"yarn lint && yarn typescript"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"extends":["@react-native-community","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"_id":"@azrico/flat-list-mvcp@0.10.2-alpha.1","gitHead":"b9abef495e1a727852e3bf4e420fd7663162edd4","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-imZVWgvl47+B7h3/qqr2Fy0ELLFdOf8ClZv2rUCOGdwxKdyFtK6pvIqRItlbaDsfHhRYm/R/Br0NEWtNmGWIvA==","shasum":"aa21c0e9996c2c41ec92c251adceb03d8a73a02a","tarball":"https://registry.npmjs.org/@azrico/flat-list-mvcp/-/flat-list-mvcp-0.10.2-alpha.1.tgz","fileCount":39,"unpackedSize":173582,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmkeqXd4MK3Iy/qj+CBgoe/TyS+ZiqWsYoVcMib08MngIgdZE4AtjWJCCQBFgNpYQbU1hy95C04/a0qPuGpWDeOu8="}]},"_npmUser":{"name":"azrideus","email":"mehrdadtavangar@gmail.com"},"directories":{},"maintainers":[{"name":"azrideus","email":"mehrdadtavangar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flat-list-mvcp_0.10.2-alpha.1_1707764804417_0.7395511045884988"},"_hasShrinkwrap":false},"0.10.2-alpha.2":{"name":"@azrico/flat-list-mvcp","version":"0.10.2-alpha.2","description":"`maintainVisibleContentPosition` support for Android react-native","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"prepare":"bob build","test":"jest","typescript":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","lint-fix":"prettier --write \"**/*.{js,ts,tsx}\" && eslint --fix \"**/*.{js,ts,tsx}\" --max-warnings 0 && stylelint --fix \"**/*.{js,ts,tsx}\"","release":"release-it","example":"yarn --cwd example","pods":"cd example && pod-install --quiet","bootstrap":"yarn example && yarn && yarn pods"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/GetStream/flat-list-mvcp.git"},"author":{"name":"vishtree","email":"vishalnarkhede.iitd@gmail.com","url":"https://github.com/vishalnarkhede"},"license":"MIT","bugs":{"url":"https://github.com/GetStream/flat-list-mvcp/issues"},"homepage":"https://github.com/GetStream/flat-list-mvcp#readme","devDependencies":{"@commitlint/config-conventional":"^8.3.4","@react-native-community/eslint-config":"^2.0.0","@release-it/conventional-changelog":"^1.1.4","@types/jest":"^26.0.0","@types/react":"^16.9.19","@types/react-native":"0.63.50","commitlint":"^8.3.5","eslint":"^7.2.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.3","husky":"^4.3.5","jest":"^26.0.1","pod-install":"^0.1.0","prettier":"^2.0.5","react":"16.13.1","react-native":"0.63.4","react-native-builder-bob":"^0.18.2","release-it":"^13.5.8","typescript":"^4.1.4"},"peerDependencies":{"react":"*","react-native":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"husky":{"hooks":{"pre-commit":"yarn lint && yarn typescript"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"extends":["@react-native-community","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"_id":"@azrico/flat-list-mvcp@0.10.2-alpha.2","gitHead":"ec6592c21d15058868936ffd06e254c61cea4d6b","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-rHsZB6a+cMzYCRF4wxYr5YxjRki0NOIkhD0+xx8oivJKflIZxTy1q7Dt5E2yrewAbharr1U4HWM7WYvuegvvZQ==","shasum":"df57e3d7a6b0e6ec350a31779bfd51e90737dccd","tarball":"https://registry.npmjs.org/@azrico/flat-list-mvcp/-/flat-list-mvcp-0.10.2-alpha.2.tgz","fileCount":39,"unpackedSize":173233,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHvQuK31JXwime5iyRwWPS7JSy8WcPVxf8Ps43FRCb2LAiEA2b5z3tS99//O920BhklEQ+oTu82dE2BgZrHOAYAbLKM="}]},"_npmUser":{"name":"azrideus","email":"mehrdadtavangar@gmail.com"},"directories":{},"maintainers":[{"name":"azrideus","email":"mehrdadtavangar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flat-list-mvcp_0.10.2-alpha.2_1707766534412_0.10372411775166102"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-12T18:46:09.316Z","0.10.2":"2024-02-12T18:46:09.597Z","modified":"2024-02-12T19:35:34.782Z","0.10.2-alpha.1":"2024-02-12T19:06:44.565Z","0.10.2-alpha.2":"2024-02-12T19:35:34.568Z"},"maintainers":[{"name":"azrideus","email":"mehrdadtavangar@gmail.com"}],"description":"`maintainVisibleContentPosition` support for Android react-native","homepage":"https://github.com/GetStream/flat-list-mvcp#readme","keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/GetStream/flat-list-mvcp.git"},"author":{"name":"vishtree","email":"vishalnarkhede.iitd@gmail.com","url":"https://github.com/vishalnarkhede"},"bugs":{"url":"https://github.com/GetStream/flat-list-mvcp/issues"},"license":"MIT","readme":"# `maintainVisibleContentPosition` prop support for Android react-native.\r\n\r\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/GetStream/flat-list-mvcp/blob/main/LICENSE)\r\n[![Npm Package](https://img.shields.io/badge/npm--package-v0.0.8-blue)](https://www.npmjs.com/package/@stream-io/flat-list-mvcp)\r\n[![Compatibility](https://img.shields.io/badge/react--native%20--%20android%20%7C%20iOS-compatible-brightgreen)](https://reactnative.dev/)\r\n\r\n**[** Built with ♥ at [Stream](https://getstream.io/) **]**\r\n\r\nIn react-native, [ScrollView](https://reactnative.dev/docs/scrollview) (and [FlatList](https://reactnative.dev/docs/flatlist)) component have support for a prop [`maintainVisibleContentPosition`](https://reactnative.dev/docs/scrollview#maintainvisiblecontentposition), which is really useful for chat-like applications where you want to see new messages scroll into place. Also you might need it in other applications where you need bi-directional infinite scroll. Although currently its only supported on iOS. So here we have built a simple wrapper for FlatList and ScrollView to add support for this prop for android.  On iOS, we simply return FlatList and ScrollView from react-native package.\r\n\r\nWe built this wrapper for our in-house [react-native chat sdk](https://github.com/GetStream/stream-chat-react-native), but we are making it public, in case it helps other devs from react-native community.\r\n\r\nBefore you proceed, please don't forget to also check other relevant packages, built at Stream:\r\n\r\n- [react-native-bidirectional-infinite-scroll](https://github.com/GetStream/react-native-bidirectional-infinite-scroll)\r\n- [stream-chat-react-native](https://github.com/GetStream/stream-chat-react-native)\r\n\r\n> ⚠️ Horizontal list is currently not supported on this package.\r\n\r\n## Example\r\n\r\n```sh\r\n#  clone the repo\r\ngit clone https://github.com/GetStream/flat-list-mvcp.git\r\ncd flat-list-mvcp/Example\r\n\r\n# Install npm and pod dependencies\r\nyarn; npx pod-install;\r\n\r\n# run the app\r\nnpx react-native run-android\r\n```\r\n## Installation\r\n\r\n```sh\r\nyarn add @stream-io/flat-list-mvcp\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nimport { FlatList, ScrollView } from '@stream-io/flat-list-mvcp';\r\n\r\n<FlatList\r\n    maintainVisibleContentPosition={{\r\n        autoscrollToTopThreshold: 10,\r\n        minIndexForVisible: 1,\r\n    }}\r\n    ...\r\n/>\r\n\r\n<ScrollView\r\n    maintainVisibleContentPosition={{\r\n        autoscrollToTopThreshold: 10,\r\n        minIndexForVisible: 1,\r\n    }}\r\n    ...\r\n/>\r\n\r\n```\r\n\r\n## Expo support\r\n\r\nThis package doesn't support [Expo managed workflow](https://docs.expo.io/introduction/managed-vs-bare/#managed-workflow). There is a feature request open for expo - https://expo.canny.io/feature-requests/p/android-maintainvisiblecontentposition-on-flatlist (please upvote)\r\n\r\n\r\n## Credits\r\n\r\nThanks to [stackia](https://github.com/stackia) for https://github.com/facebook/react-native/pull/29466#issuecomment-664367382\r\n\r\n## Contributing\r\n\r\nPRs for improvement are welcome :) \r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}