@capacitor/camera 6.1.2 → 7.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorCamera.podspec +1 -1
- package/Package.swift +2 -2
- package/README.md +2 -2
- package/android/build.gradle +11 -11
- package/dist/plugin.cjs.js +0 -2
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +0 -2
- package/dist/plugin.js.map +1 -1
- package/package.json +10 -10
package/CapacitorCamera.podspec
CHANGED
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'camera/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target
|
|
14
|
+
s.ios.deployment_target = '14.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapacitorCamera",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v14)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapacitorCamera",
|
|
10
10
|
targets: ["CameraPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git",
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/README.md
CHANGED
|
@@ -68,8 +68,8 @@ Additionally, because the Camera API launches a separate Activity to handle taki
|
|
|
68
68
|
|
|
69
69
|
This plugin will use the following project variables (defined in your app's `variables.gradle` file):
|
|
70
70
|
|
|
71
|
-
- `androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.
|
|
72
|
-
- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.
|
|
71
|
+
- `androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.7`)
|
|
72
|
+
- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.12.0`)
|
|
73
73
|
|
|
74
74
|
## PWA Notes
|
|
75
75
|
|
package/android/build.gradle
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
capacitorVersion = System.getenv('CAPACITOR_VERSION')
|
|
3
3
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
4
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
6
|
-
androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.
|
|
7
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1
|
|
8
|
-
androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.
|
|
4
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
6
|
+
androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.7'
|
|
7
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
8
|
+
androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.12.0'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
buildscript {
|
|
@@ -17,7 +17,7 @@ buildscript {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
dependencies {
|
|
20
|
-
classpath 'com.android.tools.build:gradle:8.2
|
|
20
|
+
classpath 'com.android.tools.build:gradle:8.7.2'
|
|
21
21
|
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
22
22
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
23
23
|
}
|
|
@@ -33,10 +33,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
|
33
33
|
|
|
34
34
|
android {
|
|
35
35
|
namespace "com.capacitorjs.plugins.camera"
|
|
36
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
36
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
37
37
|
defaultConfig {
|
|
38
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
39
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
38
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
|
|
39
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
40
40
|
versionCode 1
|
|
41
41
|
versionName "1.0"
|
|
42
42
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -51,8 +51,8 @@ android {
|
|
|
51
51
|
abortOnError false
|
|
52
52
|
}
|
|
53
53
|
compileOptions {
|
|
54
|
-
sourceCompatibility JavaVersion.
|
|
55
|
-
targetCompatibility JavaVersion.
|
|
54
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
55
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
56
56
|
}
|
|
57
57
|
publishing {
|
|
58
58
|
singleVariant("release")
|
package/dist/plugin.cjs.js
CHANGED
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/web.js","esm/index.js"],"sourcesContent":["export var CameraSource;\n(function (CameraSource) {\n /**\n * Prompts the user to select either the photo album or take a photo.\n */\n CameraSource[\"Prompt\"] = \"PROMPT\";\n /**\n * Take a new photo using the camera.\n */\n CameraSource[\"Camera\"] = \"CAMERA\";\n /**\n * Pick an existing photo from the gallery or photo album.\n */\n CameraSource[\"Photos\"] = \"PHOTOS\";\n})(CameraSource || (CameraSource = {}));\nexport var CameraDirection;\n(function (CameraDirection) {\n CameraDirection[\"Rear\"] = \"REAR\";\n CameraDirection[\"Front\"] = \"FRONT\";\n})(CameraDirection || (CameraDirection = {}));\nexport var CameraResultType;\n(function (CameraResultType) {\n CameraResultType[\"Uri\"] = \"uri\";\n CameraResultType[\"Base64\"] = \"base64\";\n CameraResultType[\"DataUrl\"] = \"dataUrl\";\n})(CameraResultType || (CameraResultType = {}));\n//# sourceMappingURL=definitions.js.map","import { WebPlugin, CapacitorException } from '@capacitor/core';\nimport { CameraSource, CameraDirection } from './definitions';\nexport class CameraWeb extends WebPlugin {\n async getPhoto(options) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n if (options.webUseInput || options.source === CameraSource.Photos) {\n this.fileInputExperience(options, resolve, reject);\n }\n else if (options.source === CameraSource.Prompt) {\n let actionSheet = document.querySelector('pwa-action-sheet');\n if (!actionSheet) {\n actionSheet = document.createElement('pwa-action-sheet');\n document.body.appendChild(actionSheet);\n }\n actionSheet.header = options.promptLabelHeader || 'Photo';\n actionSheet.cancelable = false;\n actionSheet.options = [\n { title: options.promptLabelPhoto || 'From Photos' },\n { title: options.promptLabelPicture || 'Take Picture' },\n ];\n actionSheet.addEventListener('onSelection', async (e) => {\n const selection = e.detail;\n if (selection === 0) {\n this.fileInputExperience(options, resolve, reject);\n }\n else {\n this.cameraExperience(options, resolve, reject);\n }\n });\n }\n else {\n this.cameraExperience(options, resolve, reject);\n }\n });\n }\n async pickImages(_options) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n this.multipleFileInputExperience(resolve, reject);\n });\n }\n async cameraExperience(options, resolve, reject) {\n if (customElements.get('pwa-camera-modal')) {\n const cameraModal = document.createElement('pwa-camera-modal');\n cameraModal.facingMode =\n options.direction === CameraDirection.Front ? 'user' : 'environment';\n document.body.appendChild(cameraModal);\n try {\n await cameraModal.componentOnReady();\n cameraModal.addEventListener('onPhoto', async (e) => {\n const photo = e.detail;\n if (photo === null) {\n reject(new CapacitorException('User cancelled photos app'));\n }\n else if (photo instanceof Error) {\n reject(photo);\n }\n else {\n resolve(await this._getCameraPhoto(photo, options));\n }\n cameraModal.dismiss();\n document.body.removeChild(cameraModal);\n });\n cameraModal.present();\n }\n catch (e) {\n this.fileInputExperience(options, resolve, reject);\n }\n }\n else {\n console.error(`Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements.`);\n this.fileInputExperience(options, resolve, reject);\n }\n }\n fileInputExperience(options, resolve, reject) {\n let input = document.querySelector('#_capacitor-camera-input');\n const cleanup = () => {\n var _a;\n (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(input);\n };\n if (!input) {\n input = document.createElement('input');\n input.id = '_capacitor-camera-input';\n input.type = 'file';\n input.hidden = true;\n document.body.appendChild(input);\n input.addEventListener('change', (_e) => {\n const file = input.files[0];\n let format = 'jpeg';\n if (file.type === 'image/png') {\n format = 'png';\n }\n else if (file.type === 'image/gif') {\n format = 'gif';\n }\n if (options.resultType === 'dataUrl' ||\n options.resultType === 'base64') {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n if (options.resultType === 'dataUrl') {\n resolve({\n dataUrl: reader.result,\n format,\n });\n }\n else if (options.resultType === 'base64') {\n const b64 = reader.result.split(',')[1];\n resolve({\n base64String: b64,\n format,\n });\n }\n cleanup();\n });\n reader.readAsDataURL(file);\n }\n else {\n resolve({\n webPath: URL.createObjectURL(file),\n format: format,\n });\n cleanup();\n }\n });\n input.addEventListener('cancel', (_e) => {\n reject(new CapacitorException('User cancelled photos app'));\n cleanup();\n });\n }\n input.accept = 'image/*';\n input.capture = true;\n if (options.source === CameraSource.Photos ||\n options.source === CameraSource.Prompt) {\n input.removeAttribute('capture');\n }\n else if (options.direction === CameraDirection.Front) {\n input.capture = 'user';\n }\n else if (options.direction === CameraDirection.Rear) {\n input.capture = 'environment';\n }\n input.click();\n }\n multipleFileInputExperience(resolve, reject) {\n let input = document.querySelector('#_capacitor-camera-input-multiple');\n const cleanup = () => {\n var _a;\n (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(input);\n };\n if (!input) {\n input = document.createElement('input');\n input.id = '_capacitor-camera-input-multiple';\n input.type = 'file';\n input.hidden = true;\n input.multiple = true;\n document.body.appendChild(input);\n input.addEventListener('change', (_e) => {\n const photos = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.files.length; i++) {\n const file = input.files[i];\n let format = 'jpeg';\n if (file.type === 'image/png') {\n format = 'png';\n }\n else if (file.type === 'image/gif') {\n format = 'gif';\n }\n photos.push({\n webPath: URL.createObjectURL(file),\n format: format,\n });\n }\n resolve({ photos });\n cleanup();\n });\n input.addEventListener('cancel', (_e) => {\n reject(new CapacitorException('User cancelled photos app'));\n cleanup();\n });\n }\n input.accept = 'image/*';\n input.click();\n }\n _getCameraPhoto(photo, options) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n const format = photo.type.split('/')[1];\n if (options.resultType === 'uri') {\n resolve({\n webPath: URL.createObjectURL(photo),\n format: format,\n saved: false,\n });\n }\n else {\n reader.readAsDataURL(photo);\n reader.onloadend = () => {\n const r = reader.result;\n if (options.resultType === 'dataUrl') {\n resolve({\n dataUrl: r,\n format: format,\n saved: false,\n });\n }\n else {\n resolve({\n base64String: r.split(',')[1],\n format: format,\n saved: false,\n });\n }\n };\n reader.onerror = e => {\n reject(e);\n };\n }\n });\n }\n async checkPermissions() {\n if (typeof navigator === 'undefined' || !navigator.permissions) {\n throw this.unavailable('Permissions API not available in this browser');\n }\n try {\n // https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query\n // the specific permissions that are supported varies among browsers that implement the\n // permissions API, so we need a try/catch in case 'camera' is invalid\n const permission = await window.navigator.permissions.query({\n name: 'camera',\n });\n return {\n camera: permission.state,\n photos: 'granted',\n };\n }\n catch (_a) {\n throw this.unavailable('Camera permissions are not available in this browser');\n }\n }\n async requestPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async pickLimitedLibraryPhotos() {\n throw this.unavailable('Not implemented on web.');\n }\n async getLimitedLibraryPhotos() {\n throw this.unavailable('Not implemented on web.');\n }\n}\nconst Camera = new CameraWeb();\nexport { Camera };\n//# sourceMappingURL=web.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CameraWeb } from './web';\nconst Camera = registerPlugin('Camera', {\n web: () => new CameraWeb(),\n});\nexport * from './definitions';\nexport { Camera };\n//# sourceMappingURL=index.js.map"],"names":["CameraSource","CameraDirection","CameraResultType","WebPlugin","CapacitorException","registerPlugin"],"mappings":";;;;;;AAAWA,8BAAa;AACxB,CAAC,UAAU,YAAY,EAAE;AACzB;AACA;AACA;AACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AACtC;AACA;AACA;AACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AACtC;AACA;AACA;AACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AACtC,CAAC,EAAEA,oBAAY,KAAK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Q,EAAE;AACxC,IAAI,GAAG,EAAE,MAAM,IAAI,SAAS,EAAE;AAC9B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/web.js","esm/index.js"],"sourcesContent":["export var CameraSource;\n(function (CameraSource) {\n /**\n * Prompts the user to select either the photo album or take a photo.\n */\n CameraSource[\"Prompt\"] = \"PROMPT\";\n /**\n * Take a new photo using the camera.\n */\n CameraSource[\"Camera\"] = \"CAMERA\";\n /**\n * Pick an existing photo from the gallery or photo album.\n */\n CameraSource[\"Photos\"] = \"PHOTOS\";\n})(CameraSource || (CameraSource = {}));\nexport var CameraDirection;\n(function (CameraDirection) {\n CameraDirection[\"Rear\"] = \"REAR\";\n CameraDirection[\"Front\"] = \"FRONT\";\n})(CameraDirection || (CameraDirection = {}));\nexport var CameraResultType;\n(function (CameraResultType) {\n CameraResultType[\"Uri\"] = \"uri\";\n CameraResultType[\"Base64\"] = \"base64\";\n CameraResultType[\"DataUrl\"] = \"dataUrl\";\n})(CameraResultType || (CameraResultType = {}));\n//# sourceMappingURL=definitions.js.map","import { WebPlugin, CapacitorException } from '@capacitor/core';\nimport { CameraSource, CameraDirection } from './definitions';\nexport class CameraWeb extends WebPlugin {\n async getPhoto(options) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n if (options.webUseInput || options.source === CameraSource.Photos) {\n this.fileInputExperience(options, resolve, reject);\n }\n else if (options.source === CameraSource.Prompt) {\n let actionSheet = document.querySelector('pwa-action-sheet');\n if (!actionSheet) {\n actionSheet = document.createElement('pwa-action-sheet');\n document.body.appendChild(actionSheet);\n }\n actionSheet.header = options.promptLabelHeader || 'Photo';\n actionSheet.cancelable = false;\n actionSheet.options = [\n { title: options.promptLabelPhoto || 'From Photos' },\n { title: options.promptLabelPicture || 'Take Picture' },\n ];\n actionSheet.addEventListener('onSelection', async (e) => {\n const selection = e.detail;\n if (selection === 0) {\n this.fileInputExperience(options, resolve, reject);\n }\n else {\n this.cameraExperience(options, resolve, reject);\n }\n });\n }\n else {\n this.cameraExperience(options, resolve, reject);\n }\n });\n }\n async pickImages(_options) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n this.multipleFileInputExperience(resolve, reject);\n });\n }\n async cameraExperience(options, resolve, reject) {\n if (customElements.get('pwa-camera-modal')) {\n const cameraModal = document.createElement('pwa-camera-modal');\n cameraModal.facingMode =\n options.direction === CameraDirection.Front ? 'user' : 'environment';\n document.body.appendChild(cameraModal);\n try {\n await cameraModal.componentOnReady();\n cameraModal.addEventListener('onPhoto', async (e) => {\n const photo = e.detail;\n if (photo === null) {\n reject(new CapacitorException('User cancelled photos app'));\n }\n else if (photo instanceof Error) {\n reject(photo);\n }\n else {\n resolve(await this._getCameraPhoto(photo, options));\n }\n cameraModal.dismiss();\n document.body.removeChild(cameraModal);\n });\n cameraModal.present();\n }\n catch (e) {\n this.fileInputExperience(options, resolve, reject);\n }\n }\n else {\n console.error(`Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements.`);\n this.fileInputExperience(options, resolve, reject);\n }\n }\n fileInputExperience(options, resolve, reject) {\n let input = document.querySelector('#_capacitor-camera-input');\n const cleanup = () => {\n var _a;\n (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(input);\n };\n if (!input) {\n input = document.createElement('input');\n input.id = '_capacitor-camera-input';\n input.type = 'file';\n input.hidden = true;\n document.body.appendChild(input);\n input.addEventListener('change', (_e) => {\n const file = input.files[0];\n let format = 'jpeg';\n if (file.type === 'image/png') {\n format = 'png';\n }\n else if (file.type === 'image/gif') {\n format = 'gif';\n }\n if (options.resultType === 'dataUrl' ||\n options.resultType === 'base64') {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n if (options.resultType === 'dataUrl') {\n resolve({\n dataUrl: reader.result,\n format,\n });\n }\n else if (options.resultType === 'base64') {\n const b64 = reader.result.split(',')[1];\n resolve({\n base64String: b64,\n format,\n });\n }\n cleanup();\n });\n reader.readAsDataURL(file);\n }\n else {\n resolve({\n webPath: URL.createObjectURL(file),\n format: format,\n });\n cleanup();\n }\n });\n input.addEventListener('cancel', (_e) => {\n reject(new CapacitorException('User cancelled photos app'));\n cleanup();\n });\n }\n input.accept = 'image/*';\n input.capture = true;\n if (options.source === CameraSource.Photos ||\n options.source === CameraSource.Prompt) {\n input.removeAttribute('capture');\n }\n else if (options.direction === CameraDirection.Front) {\n input.capture = 'user';\n }\n else if (options.direction === CameraDirection.Rear) {\n input.capture = 'environment';\n }\n input.click();\n }\n multipleFileInputExperience(resolve, reject) {\n let input = document.querySelector('#_capacitor-camera-input-multiple');\n const cleanup = () => {\n var _a;\n (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(input);\n };\n if (!input) {\n input = document.createElement('input');\n input.id = '_capacitor-camera-input-multiple';\n input.type = 'file';\n input.hidden = true;\n input.multiple = true;\n document.body.appendChild(input);\n input.addEventListener('change', (_e) => {\n const photos = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.files.length; i++) {\n const file = input.files[i];\n let format = 'jpeg';\n if (file.type === 'image/png') {\n format = 'png';\n }\n else if (file.type === 'image/gif') {\n format = 'gif';\n }\n photos.push({\n webPath: URL.createObjectURL(file),\n format: format,\n });\n }\n resolve({ photos });\n cleanup();\n });\n input.addEventListener('cancel', (_e) => {\n reject(new CapacitorException('User cancelled photos app'));\n cleanup();\n });\n }\n input.accept = 'image/*';\n input.click();\n }\n _getCameraPhoto(photo, options) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n const format = photo.type.split('/')[1];\n if (options.resultType === 'uri') {\n resolve({\n webPath: URL.createObjectURL(photo),\n format: format,\n saved: false,\n });\n }\n else {\n reader.readAsDataURL(photo);\n reader.onloadend = () => {\n const r = reader.result;\n if (options.resultType === 'dataUrl') {\n resolve({\n dataUrl: r,\n format: format,\n saved: false,\n });\n }\n else {\n resolve({\n base64String: r.split(',')[1],\n format: format,\n saved: false,\n });\n }\n };\n reader.onerror = e => {\n reject(e);\n };\n }\n });\n }\n async checkPermissions() {\n if (typeof navigator === 'undefined' || !navigator.permissions) {\n throw this.unavailable('Permissions API not available in this browser');\n }\n try {\n // https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query\n // the specific permissions that are supported varies among browsers that implement the\n // permissions API, so we need a try/catch in case 'camera' is invalid\n const permission = await window.navigator.permissions.query({\n name: 'camera',\n });\n return {\n camera: permission.state,\n photos: 'granted',\n };\n }\n catch (_a) {\n throw this.unavailable('Camera permissions are not available in this browser');\n }\n }\n async requestPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async pickLimitedLibraryPhotos() {\n throw this.unavailable('Not implemented on web.');\n }\n async getLimitedLibraryPhotos() {\n throw this.unavailable('Not implemented on web.');\n }\n}\nconst Camera = new CameraWeb();\nexport { Camera };\n//# sourceMappingURL=web.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CameraWeb } from './web';\nconst Camera = registerPlugin('Camera', {\n web: () => new CameraWeb(),\n});\nexport * from './definitions';\nexport { Camera };\n//# sourceMappingURL=index.js.map"],"names":["CameraSource","CameraDirection","CameraResultType","WebPlugin","CapacitorException","registerPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA;AACA;AACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACrC;AACA;AACA;AACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACrC;AACA;AACA;AACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACrC,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AAC5BC;AACX,CAAC,UAAU,eAAe,EAAE;AAC5B,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,MAAM;AACpC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,CAAC,EAAEA,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C,mBAAc,CAAC,QAAQ,EAAE;AACxC,IAAI,GAAG,EAAE,MAAM,IAAI,SAAS,EAAE;AAC9B,CAAC;;;;"}
|
package/dist/plugin.js
CHANGED
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/web.js","esm/index.js"],"sourcesContent":["export var CameraSource;\n(function (CameraSource) {\n /**\n * Prompts the user to select either the photo album or take a photo.\n */\n CameraSource[\"Prompt\"] = \"PROMPT\";\n /**\n * Take a new photo using the camera.\n */\n CameraSource[\"Camera\"] = \"CAMERA\";\n /**\n * Pick an existing photo from the gallery or photo album.\n */\n CameraSource[\"Photos\"] = \"PHOTOS\";\n})(CameraSource || (CameraSource = {}));\nexport var CameraDirection;\n(function (CameraDirection) {\n CameraDirection[\"Rear\"] = \"REAR\";\n CameraDirection[\"Front\"] = \"FRONT\";\n})(CameraDirection || (CameraDirection = {}));\nexport var CameraResultType;\n(function (CameraResultType) {\n CameraResultType[\"Uri\"] = \"uri\";\n CameraResultType[\"Base64\"] = \"base64\";\n CameraResultType[\"DataUrl\"] = \"dataUrl\";\n})(CameraResultType || (CameraResultType = {}));\n//# sourceMappingURL=definitions.js.map","import { WebPlugin, CapacitorException } from '@capacitor/core';\nimport { CameraSource, CameraDirection } from './definitions';\nexport class CameraWeb extends WebPlugin {\n async getPhoto(options) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n if (options.webUseInput || options.source === CameraSource.Photos) {\n this.fileInputExperience(options, resolve, reject);\n }\n else if (options.source === CameraSource.Prompt) {\n let actionSheet = document.querySelector('pwa-action-sheet');\n if (!actionSheet) {\n actionSheet = document.createElement('pwa-action-sheet');\n document.body.appendChild(actionSheet);\n }\n actionSheet.header = options.promptLabelHeader || 'Photo';\n actionSheet.cancelable = false;\n actionSheet.options = [\n { title: options.promptLabelPhoto || 'From Photos' },\n { title: options.promptLabelPicture || 'Take Picture' },\n ];\n actionSheet.addEventListener('onSelection', async (e) => {\n const selection = e.detail;\n if (selection === 0) {\n this.fileInputExperience(options, resolve, reject);\n }\n else {\n this.cameraExperience(options, resolve, reject);\n }\n });\n }\n else {\n this.cameraExperience(options, resolve, reject);\n }\n });\n }\n async pickImages(_options) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n this.multipleFileInputExperience(resolve, reject);\n });\n }\n async cameraExperience(options, resolve, reject) {\n if (customElements.get('pwa-camera-modal')) {\n const cameraModal = document.createElement('pwa-camera-modal');\n cameraModal.facingMode =\n options.direction === CameraDirection.Front ? 'user' : 'environment';\n document.body.appendChild(cameraModal);\n try {\n await cameraModal.componentOnReady();\n cameraModal.addEventListener('onPhoto', async (e) => {\n const photo = e.detail;\n if (photo === null) {\n reject(new CapacitorException('User cancelled photos app'));\n }\n else if (photo instanceof Error) {\n reject(photo);\n }\n else {\n resolve(await this._getCameraPhoto(photo, options));\n }\n cameraModal.dismiss();\n document.body.removeChild(cameraModal);\n });\n cameraModal.present();\n }\n catch (e) {\n this.fileInputExperience(options, resolve, reject);\n }\n }\n else {\n console.error(`Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements.`);\n this.fileInputExperience(options, resolve, reject);\n }\n }\n fileInputExperience(options, resolve, reject) {\n let input = document.querySelector('#_capacitor-camera-input');\n const cleanup = () => {\n var _a;\n (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(input);\n };\n if (!input) {\n input = document.createElement('input');\n input.id = '_capacitor-camera-input';\n input.type = 'file';\n input.hidden = true;\n document.body.appendChild(input);\n input.addEventListener('change', (_e) => {\n const file = input.files[0];\n let format = 'jpeg';\n if (file.type === 'image/png') {\n format = 'png';\n }\n else if (file.type === 'image/gif') {\n format = 'gif';\n }\n if (options.resultType === 'dataUrl' ||\n options.resultType === 'base64') {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n if (options.resultType === 'dataUrl') {\n resolve({\n dataUrl: reader.result,\n format,\n });\n }\n else if (options.resultType === 'base64') {\n const b64 = reader.result.split(',')[1];\n resolve({\n base64String: b64,\n format,\n });\n }\n cleanup();\n });\n reader.readAsDataURL(file);\n }\n else {\n resolve({\n webPath: URL.createObjectURL(file),\n format: format,\n });\n cleanup();\n }\n });\n input.addEventListener('cancel', (_e) => {\n reject(new CapacitorException('User cancelled photos app'));\n cleanup();\n });\n }\n input.accept = 'image/*';\n input.capture = true;\n if (options.source === CameraSource.Photos ||\n options.source === CameraSource.Prompt) {\n input.removeAttribute('capture');\n }\n else if (options.direction === CameraDirection.Front) {\n input.capture = 'user';\n }\n else if (options.direction === CameraDirection.Rear) {\n input.capture = 'environment';\n }\n input.click();\n }\n multipleFileInputExperience(resolve, reject) {\n let input = document.querySelector('#_capacitor-camera-input-multiple');\n const cleanup = () => {\n var _a;\n (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(input);\n };\n if (!input) {\n input = document.createElement('input');\n input.id = '_capacitor-camera-input-multiple';\n input.type = 'file';\n input.hidden = true;\n input.multiple = true;\n document.body.appendChild(input);\n input.addEventListener('change', (_e) => {\n const photos = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.files.length; i++) {\n const file = input.files[i];\n let format = 'jpeg';\n if (file.type === 'image/png') {\n format = 'png';\n }\n else if (file.type === 'image/gif') {\n format = 'gif';\n }\n photos.push({\n webPath: URL.createObjectURL(file),\n format: format,\n });\n }\n resolve({ photos });\n cleanup();\n });\n input.addEventListener('cancel', (_e) => {\n reject(new CapacitorException('User cancelled photos app'));\n cleanup();\n });\n }\n input.accept = 'image/*';\n input.click();\n }\n _getCameraPhoto(photo, options) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n const format = photo.type.split('/')[1];\n if (options.resultType === 'uri') {\n resolve({\n webPath: URL.createObjectURL(photo),\n format: format,\n saved: false,\n });\n }\n else {\n reader.readAsDataURL(photo);\n reader.onloadend = () => {\n const r = reader.result;\n if (options.resultType === 'dataUrl') {\n resolve({\n dataUrl: r,\n format: format,\n saved: false,\n });\n }\n else {\n resolve({\n base64String: r.split(',')[1],\n format: format,\n saved: false,\n });\n }\n };\n reader.onerror = e => {\n reject(e);\n };\n }\n });\n }\n async checkPermissions() {\n if (typeof navigator === 'undefined' || !navigator.permissions) {\n throw this.unavailable('Permissions API not available in this browser');\n }\n try {\n // https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query\n // the specific permissions that are supported varies among browsers that implement the\n // permissions API, so we need a try/catch in case 'camera' is invalid\n const permission = await window.navigator.permissions.query({\n name: 'camera',\n });\n return {\n camera: permission.state,\n photos: 'granted',\n };\n }\n catch (_a) {\n throw this.unavailable('Camera permissions are not available in this browser');\n }\n }\n async requestPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async pickLimitedLibraryPhotos() {\n throw this.unavailable('Not implemented on web.');\n }\n async getLimitedLibraryPhotos() {\n throw this.unavailable('Not implemented on web.');\n }\n}\nconst Camera = new CameraWeb();\nexport { Camera };\n//# sourceMappingURL=web.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CameraWeb } from './web';\nconst Camera = registerPlugin('Camera', {\n web: () => new CameraWeb(),\n});\nexport * from './definitions';\nexport { Camera };\n//# sourceMappingURL=index.js.map"],"names":["CameraSource","CameraDirection","CameraResultType","WebPlugin","CapacitorException","registerPlugin"],"mappings":";;;AAAWA,kCAAa;IACxB,CAAC,UAAU,YAAY,EAAE;IACzB;IACA;IACA;IACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IACtC;IACA;IACA;IACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IACtC;IACA;IACA;IACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IACtC,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC,CAAC;AAC7BC,qCAAgB;IAC3B,CAAC,UAAU,eAAe,E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;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/web.js","esm/index.js"],"sourcesContent":["export var CameraSource;\n(function (CameraSource) {\n /**\n * Prompts the user to select either the photo album or take a photo.\n */\n CameraSource[\"Prompt\"] = \"PROMPT\";\n /**\n * Take a new photo using the camera.\n */\n CameraSource[\"Camera\"] = \"CAMERA\";\n /**\n * Pick an existing photo from the gallery or photo album.\n */\n CameraSource[\"Photos\"] = \"PHOTOS\";\n})(CameraSource || (CameraSource = {}));\nexport var CameraDirection;\n(function (CameraDirection) {\n CameraDirection[\"Rear\"] = \"REAR\";\n CameraDirection[\"Front\"] = \"FRONT\";\n})(CameraDirection || (CameraDirection = {}));\nexport var CameraResultType;\n(function (CameraResultType) {\n CameraResultType[\"Uri\"] = \"uri\";\n CameraResultType[\"Base64\"] = \"base64\";\n CameraResultType[\"DataUrl\"] = \"dataUrl\";\n})(CameraResultType || (CameraResultType = {}));\n//# sourceMappingURL=definitions.js.map","import { WebPlugin, CapacitorException } from '@capacitor/core';\nimport { CameraSource, CameraDirection } from './definitions';\nexport class CameraWeb extends WebPlugin {\n async getPhoto(options) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n if (options.webUseInput || options.source === CameraSource.Photos) {\n this.fileInputExperience(options, resolve, reject);\n }\n else if (options.source === CameraSource.Prompt) {\n let actionSheet = document.querySelector('pwa-action-sheet');\n if (!actionSheet) {\n actionSheet = document.createElement('pwa-action-sheet');\n document.body.appendChild(actionSheet);\n }\n actionSheet.header = options.promptLabelHeader || 'Photo';\n actionSheet.cancelable = false;\n actionSheet.options = [\n { title: options.promptLabelPhoto || 'From Photos' },\n { title: options.promptLabelPicture || 'Take Picture' },\n ];\n actionSheet.addEventListener('onSelection', async (e) => {\n const selection = e.detail;\n if (selection === 0) {\n this.fileInputExperience(options, resolve, reject);\n }\n else {\n this.cameraExperience(options, resolve, reject);\n }\n });\n }\n else {\n this.cameraExperience(options, resolve, reject);\n }\n });\n }\n async pickImages(_options) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n this.multipleFileInputExperience(resolve, reject);\n });\n }\n async cameraExperience(options, resolve, reject) {\n if (customElements.get('pwa-camera-modal')) {\n const cameraModal = document.createElement('pwa-camera-modal');\n cameraModal.facingMode =\n options.direction === CameraDirection.Front ? 'user' : 'environment';\n document.body.appendChild(cameraModal);\n try {\n await cameraModal.componentOnReady();\n cameraModal.addEventListener('onPhoto', async (e) => {\n const photo = e.detail;\n if (photo === null) {\n reject(new CapacitorException('User cancelled photos app'));\n }\n else if (photo instanceof Error) {\n reject(photo);\n }\n else {\n resolve(await this._getCameraPhoto(photo, options));\n }\n cameraModal.dismiss();\n document.body.removeChild(cameraModal);\n });\n cameraModal.present();\n }\n catch (e) {\n this.fileInputExperience(options, resolve, reject);\n }\n }\n else {\n console.error(`Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements.`);\n this.fileInputExperience(options, resolve, reject);\n }\n }\n fileInputExperience(options, resolve, reject) {\n let input = document.querySelector('#_capacitor-camera-input');\n const cleanup = () => {\n var _a;\n (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(input);\n };\n if (!input) {\n input = document.createElement('input');\n input.id = '_capacitor-camera-input';\n input.type = 'file';\n input.hidden = true;\n document.body.appendChild(input);\n input.addEventListener('change', (_e) => {\n const file = input.files[0];\n let format = 'jpeg';\n if (file.type === 'image/png') {\n format = 'png';\n }\n else if (file.type === 'image/gif') {\n format = 'gif';\n }\n if (options.resultType === 'dataUrl' ||\n options.resultType === 'base64') {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n if (options.resultType === 'dataUrl') {\n resolve({\n dataUrl: reader.result,\n format,\n });\n }\n else if (options.resultType === 'base64') {\n const b64 = reader.result.split(',')[1];\n resolve({\n base64String: b64,\n format,\n });\n }\n cleanup();\n });\n reader.readAsDataURL(file);\n }\n else {\n resolve({\n webPath: URL.createObjectURL(file),\n format: format,\n });\n cleanup();\n }\n });\n input.addEventListener('cancel', (_e) => {\n reject(new CapacitorException('User cancelled photos app'));\n cleanup();\n });\n }\n input.accept = 'image/*';\n input.capture = true;\n if (options.source === CameraSource.Photos ||\n options.source === CameraSource.Prompt) {\n input.removeAttribute('capture');\n }\n else if (options.direction === CameraDirection.Front) {\n input.capture = 'user';\n }\n else if (options.direction === CameraDirection.Rear) {\n input.capture = 'environment';\n }\n input.click();\n }\n multipleFileInputExperience(resolve, reject) {\n let input = document.querySelector('#_capacitor-camera-input-multiple');\n const cleanup = () => {\n var _a;\n (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(input);\n };\n if (!input) {\n input = document.createElement('input');\n input.id = '_capacitor-camera-input-multiple';\n input.type = 'file';\n input.hidden = true;\n input.multiple = true;\n document.body.appendChild(input);\n input.addEventListener('change', (_e) => {\n const photos = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.files.length; i++) {\n const file = input.files[i];\n let format = 'jpeg';\n if (file.type === 'image/png') {\n format = 'png';\n }\n else if (file.type === 'image/gif') {\n format = 'gif';\n }\n photos.push({\n webPath: URL.createObjectURL(file),\n format: format,\n });\n }\n resolve({ photos });\n cleanup();\n });\n input.addEventListener('cancel', (_e) => {\n reject(new CapacitorException('User cancelled photos app'));\n cleanup();\n });\n }\n input.accept = 'image/*';\n input.click();\n }\n _getCameraPhoto(photo, options) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n const format = photo.type.split('/')[1];\n if (options.resultType === 'uri') {\n resolve({\n webPath: URL.createObjectURL(photo),\n format: format,\n saved: false,\n });\n }\n else {\n reader.readAsDataURL(photo);\n reader.onloadend = () => {\n const r = reader.result;\n if (options.resultType === 'dataUrl') {\n resolve({\n dataUrl: r,\n format: format,\n saved: false,\n });\n }\n else {\n resolve({\n base64String: r.split(',')[1],\n format: format,\n saved: false,\n });\n }\n };\n reader.onerror = e => {\n reject(e);\n };\n }\n });\n }\n async checkPermissions() {\n if (typeof navigator === 'undefined' || !navigator.permissions) {\n throw this.unavailable('Permissions API not available in this browser');\n }\n try {\n // https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query\n // the specific permissions that are supported varies among browsers that implement the\n // permissions API, so we need a try/catch in case 'camera' is invalid\n const permission = await window.navigator.permissions.query({\n name: 'camera',\n });\n return {\n camera: permission.state,\n photos: 'granted',\n };\n }\n catch (_a) {\n throw this.unavailable('Camera permissions are not available in this browser');\n }\n }\n async requestPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async pickLimitedLibraryPhotos() {\n throw this.unavailable('Not implemented on web.');\n }\n async getLimitedLibraryPhotos() {\n throw this.unavailable('Not implemented on web.');\n }\n}\nconst Camera = new CameraWeb();\nexport { Camera };\n//# sourceMappingURL=web.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CameraWeb } from './web';\nconst Camera = registerPlugin('Camera', {\n web: () => new CameraWeb(),\n});\nexport * from './definitions';\nexport { Camera };\n//# sourceMappingURL=index.js.map"],"names":["CameraSource","CameraDirection","CameraResultType","WebPlugin","CapacitorException","registerPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,YAAY,EAAE;IACzB;IACA;IACA;IACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;IACrC;IACA;IACA;IACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;IACrC;IACA;IACA;IACA,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;IACrC,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AAC5BC;IACX,CAAC,UAAU,eAAe,EAAE;IAC5B,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,MAAM;IACpC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;IACtC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC;AAClCC;IACX,CAAC,UAAU,gBAAgB,E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C9B,CAAC;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/camera",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.2",
|
|
4
4
|
"description": "The Camera API provides the ability to take a photo with the camera or choose an existing one from the photo album.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
34
|
-
"verify:ios": "xcodebuild build -scheme CapacitorCamera -
|
|
34
|
+
"verify:ios": "xcodebuild build -scheme CapacitorCamera -destination generic/platform=iOS",
|
|
35
35
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
36
36
|
"verify:web": "npm run build",
|
|
37
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
@@ -40,30 +40,30 @@
|
|
|
40
40
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api CameraPlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.
|
|
43
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
44
44
|
"clean": "rimraf ./dist",
|
|
45
45
|
"watch": "tsc --watch",
|
|
46
46
|
"prepublishOnly": "npm run build",
|
|
47
47
|
"publish:cocoapod": "pod trunk push ./CapacitorCamera.podspec --allow-warnings"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@capacitor/android": "
|
|
51
|
-
"@capacitor/core": "
|
|
50
|
+
"@capacitor/android": "next",
|
|
51
|
+
"@capacitor/core": "next",
|
|
52
52
|
"@capacitor/docgen": "0.2.2",
|
|
53
|
-
"@capacitor/ios": "
|
|
53
|
+
"@capacitor/ios": "next",
|
|
54
54
|
"@ionic/eslint-config": "^0.4.0",
|
|
55
55
|
"@ionic/prettier-config": "~1.0.1",
|
|
56
56
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
57
57
|
"eslint": "^8.57.0",
|
|
58
58
|
"prettier": "~2.3.0",
|
|
59
59
|
"prettier-plugin-java": "~1.0.2",
|
|
60
|
-
"rimraf": "^
|
|
61
|
-
"rollup": "^
|
|
60
|
+
"rimraf": "^6.0.1",
|
|
61
|
+
"rollup": "^4.26.0",
|
|
62
62
|
"swiftlint": "^1.0.1",
|
|
63
63
|
"typescript": "~4.1.5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@capacitor/core": "
|
|
66
|
+
"@capacitor/core": "next"
|
|
67
67
|
},
|
|
68
68
|
"prettier": "@ionic/prettier-config",
|
|
69
69
|
"swiftlint": "@ionic/swiftlint-config",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "023f53b42a81049b7cdef6c7b0102b85b4df1c01"
|
|
85
85
|
}
|