Merge branch 'main' into v3

This commit is contained in:
Marc Rousavy
2023-07-31 18:27:11 +02:00
committed by GitHub
22 changed files with 2893 additions and 2303 deletions

View File

@@ -26,8 +26,4 @@ This command generates static content into the `build` directory and can be serv
## Deployment
```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Docs are deployed to https://react-native-vision-camera.com using Next.js/Vercel.

View File

@@ -14,7 +14,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
The Camera's `isActive` property can be used to _pause_ the session (`isActive={false}`) while still keeping the session "warm". This is more desirable than completely unmounting the camera, since _resuming_ the session (`isActive={true}`) will be **much faster** than re-mounting the camera view.
For example, you want to **pause the camera** when the user **navigates to another page** or **minimizes the app** since otherwise the camera continues to run in the background without the user seeing it, causing **siginificant battery drain**. Also, on iOS a green dot indicates the user that the camera is still active, possibly causing the user to raise privacy concerns. (🔗 See ["About the orange and green indicators in your iPhone status bar"](https://support.apple.com/en-us/HT211876))
For example, you want to **pause the camera** when the user **navigates to another page** or **minimizes the app** since otherwise the camera continues to run in the background without the user seeing it, causing **significant battery drain**. Also, on iOS a green dot indicates the user that the camera is still active, possibly causing the user to raise privacy concerns. (🔗 See ["About the orange and green indicators in your iPhone status bar"](https://support.apple.com/en-us/HT211876))
This example demonstrates how you could pause the camera stream once the app goes into background using a [custom `useIsAppForeground` hook](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/src/hooks/useIsForeground.ts):

View File

@@ -87,7 +87,7 @@ A Camera device has different minimum, maximum and neutral zoom values. Those va
* The `neutralZoom` value is often `1`, but can be larger than `1` for devices with "fish-eye" (ultra-wide-angle) cameras. In those cases, the user expects to be at whatever zoom value `neutralZoom` is (e.g. `2`) per default, and if he tries to zoom out even more, he goes to `minZoom` (`1`), which switches over to the "fish-eye" (ultra-wide-angle) camera as seen in this GIF:
<div align="center">
<img src="https://developer.android.com/images/training/camera/multi-camera-4.gif" width="45%" />
<img src="/img/multi-camera.gif" width="45%" />
</div>
The Camera's `zoom` property expects values to be in the same "factor" scale as the `minZoom`, `neutralZoom` and `maxZoom` values - so if you pass `zoom={device.minZoom}` it is at the minimum available zoom, where as if you pass `zoom={device.maxZoom}` the maximum zoom value possible is zoomed in. It is recommended that you start at `device.neutralZoom` and let the user manually zoom out to the fish-eye camera on demand (if available).

View File

@@ -1,16 +1,17 @@
module.exports = {
title: 'VisionCamera',
tagline: '📸 The Camera library that sees the vision.',
url: 'https://mrousavy.github.io',
baseUrl: '/react-native-vision-camera/',
url: 'https://react-native-vision-camera.com',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: './favicon.ico',
favicon: '/favicon.ico',
organizationName: 'mrousavy',
projectName: 'react-native-vision-camera',
themeConfig: {
algolia: {
apiKey: 'ab7f44570bb62d0e07c0f7d92312ed1a',
appId: 'HBHXBT6T9E',
apiKey: '64bc77eda92b7efcb7003b56815f1113',
indexName: 'react-native-vision-camera',
},
prism: {
@@ -87,18 +88,55 @@ module.exports = {
},
{
label: 'Marc\'s Portfolio',
href: 'https://mrousavy.github.io',
href: 'https://mrousavy.com',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Marc Rousavy`,
},
image: 'img/11.png',
metadata: [
{
name: 'keywords',
content: 'documentation, coding, docs, guides, camera, react, native, react-native'
},
{
name: 'og:title',
content: 'VisionCamera Documentation'
},
{
name: 'og:type',
content: 'application'
},
{
name: 'og:description',
content: '📸 The Camera library that sees the vision.'
},
{
name: 'og:image',
content: '/img/11.png'
},
],
announcementBar: {
id: 'support_us',
content:
'<b>I am currently working on <a target="_blank" href="https://github.com/mrousavy/react-native-vision-camera/issues/1376">VisionCamera V3 ✨</a> which brings a lot of new features and a full rewrite on Android. Please consider <a target="_blank" href="https://github.com/sponsors/mrousavy">sponsoring me on GitHub</a> so I can work on this.</b>',
backgroundColor: '#ff5c5c',
textColor: '#ffffff',
isCloseable: false,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
sitemap: {
changefreq: 'weekly',
priority: 1.0,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
},
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/mrousavy/react-native-vision-camera/edit/main/docs/',
@@ -106,6 +144,10 @@ module.exports = {
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
gtag: {
trackingID: 'G-FX9Q0YKV7S',
anonymizeIP: false,
},
},
],
],

View File

@@ -3,6 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"postinstall": "yarn install --cwd ..",
"docusaurus": "docusaurus",
"start": "TYPEDOC_WATCH=true docusaurus start",
"build": "docusaurus build",
@@ -12,12 +13,15 @@
"clear": "docusaurus clear"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-beta.14",
"@docusaurus/preset-classic": "^2.0.0-beta.14",
"@docusaurus/core": "^2.3.1",
"@docusaurus/plugin-google-gtag": "^2.3.1",
"@docusaurus/plugin-sitemap": "^2.3.1",
"@docusaurus/preset-classic": "^2.3.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@vercel/analytics": "^0.1.11",
"clsx": "^1.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"browserslist": {
"production": [
@@ -32,9 +36,9 @@
]
},
"devDependencies": {
"docusaurus-plugin-typedoc": "^0.16.6",
"typedoc": "^0.22.10",
"typedoc-plugin-markdown": "^3.11.8",
"typescript": "^4.5.4"
"docusaurus-plugin-typedoc": "^0.18.0",
"typedoc": "^0.24.0-beta.2",
"typedoc-plugin-markdown": "^3.14.0",
"typescript": "^4.9.5"
}
}

View File

@@ -5,6 +5,7 @@ import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import styles from './styles.module.css';
import { Analytics } from '@vercel/analytics/react'
const features = [
{
@@ -56,8 +57,8 @@ function Home() {
const {siteConfig = {}} = context;
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
title="VisionCamera Documentation"
description="📸 The Camera library that sees the vision.">
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
@@ -86,6 +87,8 @@ function Home() {
</div>
</section>
)}
<Analytics />
</main>
</Layout>
);

BIN
docs/static/img/multi-camera.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

9
docs/static/robots.txt vendored Normal file
View File

@@ -0,0 +1,9 @@
# *
User-agent: *
Allow: /
# Host
Host: https://react-native-vision-camera.com
# Sitemaps
Sitemap: https://react-native-vision-camera.com/sitemap.xml

File diff suppressed because it is too large Load Diff