capacitor-community-multilens-camerapreview 5.0.1 → 6.0.1

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.
Files changed (37) hide show
  1. package/CapacitorCommunityMultilensCamerapreview.podspec +17 -17
  2. package/README.md +16 -16
  3. package/android/build.gradle +57 -55
  4. package/android/src/main/AndroidManifest.xml +4 -4
  5. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +1005 -1008
  6. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +543 -544
  7. package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomSurfaceView.java +23 -23
  8. package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomTextureView.java +29 -29
  9. package/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java +386 -386
  10. package/android/src/main/java/com/ahm/capacitor/camera/preview/TapGestureDetector.java +24 -24
  11. package/android/src/main/res/layout/bridge_layout_main.xml +15 -15
  12. package/android/src/main/res/layout/camera_activity.xml +68 -68
  13. package/android/src/main/res/values/camera_ids.xml +4 -4
  14. package/android/src/main/res/values/camera_theme.xml +9 -9
  15. package/android/src/main/res/values/colors.xml +3 -3
  16. package/android/src/main/res/values/strings.xml +3 -3
  17. package/android/src/main/res/values/styles.xml +3 -3
  18. package/dist/esm/definitions.d.ts +82 -80
  19. package/dist/esm/definitions.js +1 -1
  20. package/dist/esm/definitions.js.map +1 -1
  21. package/dist/esm/index.d.ts +4 -4
  22. package/dist/esm/index.js +6 -6
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/esm/web.d.ts +30 -28
  25. package/dist/esm/web.js +146 -155
  26. package/dist/esm/web.js.map +1 -1
  27. package/dist/plugin.cjs.js +146 -150
  28. package/dist/plugin.cjs.js.map +1 -1
  29. package/dist/plugin.js +147 -151
  30. package/dist/plugin.js.map +1 -1
  31. package/ios/Plugin/CameraController.swift +732 -733
  32. package/ios/Plugin/Info.plist +24 -24
  33. package/ios/Plugin/Plugin.h +10 -10
  34. package/ios/Plugin/Plugin.m +18 -18
  35. package/ios/Plugin/Plugin.swift +309 -308
  36. package/package.json +85 -78
  37. package/dist/docs.json +0 -408
package/package.json CHANGED
@@ -1,78 +1,85 @@
1
- {
2
- "name": "capacitor-community-multilens-camerapreview",
3
- "version": "5.0.1",
4
- "description": "fork of capacitor community camera preview with support for switchting lenses",
5
- "main": "dist/plugin.cjs.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/esm/index.d.ts",
8
- "unpkg": "dist/plugin.js",
9
- "files": [
10
- "android/src/main/",
11
- "android/build.gradle",
12
- "dist/",
13
- "ios/Plugin/",
14
- "CapacitorCommunityMultilensCamerapreview.podspec"
15
- ],
16
- "author": "Petar Kraguljac",
17
- "license": "MIT",
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/cuttercroix/CameraPreview.git"
21
- },
22
- "bugs": {
23
- "url": "https://github.com/cuttercroix/CameraPreview/issues"
24
- },
25
- "keywords": [
26
- "capacitor",
27
- "plugin",
28
- "native"
29
- ],
30
- "scripts": {
31
- "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
32
- "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
33
- "verify:android": "cd android && ./gradlew clean build test && cd ..",
34
- "verify:web": "npm run build",
35
- "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
36
- "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
37
- "eslint": "eslint . --ext ts",
38
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
39
- "swiftlint": "node-swiftlint",
40
- "docgen": "docgen --api CameraPreviewPlugin --output-readme README.md --output-json dist/docs.json",
41
- "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
42
- "clean": "rimraf ./dist",
43
- "watch": "tsc --watch",
44
- "prepublishOnly": "npm run build"
45
- },
46
- "devDependencies": {
47
- "@capacitor/android": "^5.0.0",
48
- "@capacitor/core": "^5.0.0",
49
- "@capacitor/docgen": "^0.0.18",
50
- "@capacitor/ios": "^5.0.0",
51
- "@ionic/eslint-config": "^0.3.0",
52
- "@ionic/prettier-config": "^1.0.1",
53
- "@ionic/swiftlint-config": "^1.1.2",
54
- "eslint": "^7.11.0",
55
- "prettier": "~2.3.0",
56
- "prettier-plugin-java": "~1.0.2",
57
- "rimraf": "^3.0.2",
58
- "rollup": "^2.32.0",
59
- "swiftlint": "^1.0.1",
60
- "typescript": "~4.1.5"
61
- },
62
- "peerDependencies": {
63
- "@capacitor/core": "^5.0.0"
64
- },
65
- "prettier": "@ionic/prettier-config",
66
- "swiftlint": "@ionic/swiftlint-config",
67
- "eslintConfig": {
68
- "extends": "@ionic/eslint-config/recommended"
69
- },
70
- "capacitor": {
71
- "ios": {
72
- "src": "ios"
73
- },
74
- "android": {
75
- "src": "android"
76
- }
77
- }
78
- }
1
+ {
2
+ "name": "capacitor-community-multilens-camerapreview",
3
+ "version": "6.0.1",
4
+ "description": "fork of capacitor community camera preview with support for switchting lenses",
5
+ "main": "dist/plugin.cjs.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "unpkg": "dist/plugin.js",
9
+ "files": [
10
+ "android/src/main/",
11
+ "android/build.gradle",
12
+ "dist/",
13
+ "ios/Plugin/",
14
+ "CapacitorCommunityMultilensCamerapreview.podspec"
15
+ ],
16
+ "author": "Petar Kraguljac",
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/cuttercroix/CameraPreview.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/cuttercroix/CameraPreview/issues"
24
+ },
25
+ "keywords": [
26
+ "capacitor",
27
+ "plugin",
28
+ "native"
29
+ ],
30
+ "scripts": {
31
+ "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
32
+ "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
33
+ "verify:android": "cd android && ./gradlew clean build test && cd ..",
34
+ "verify:web": "npm run build",
35
+ "build": "npm run clean && tsc && rollup -c rollup.config.js",
36
+ "clean": "rimraf './dist'",
37
+ "watch": "tsc --watch",
38
+ "lint": "concurrently -g \"npm:eslint\" \"npm:prettier -- --check\" \"npm run swiftlint -- lint ios\"",
39
+ "fmt": "concurrently -g \"npm:eslint -- --fix\" \"npm:prettier -- --write\" \"npm:swiftlint -- lint --fix --format ios\"",
40
+ "eslint": "eslint . --ext ts",
41
+ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
42
+ "swiftlint": "node-swiftlint",
43
+ "prepublishOnly": "npm run build",
44
+ "prepare": "husky install && npm run build"
45
+ },
46
+ "devDependencies": {
47
+ "@capacitor/android": "^6.0.0",
48
+ "@capacitor/core": "^6.0.0",
49
+ "@capacitor/ios": "^6.0.0",
50
+ "@ionic/eslint-config": "^0.3.0",
51
+ "@ionic/prettier-config": "^2.0.0",
52
+ "@ionic/swiftlint-config": "^1.1.2",
53
+ "concurrently": "^7.0.0",
54
+ "eslint": "^7.32.0",
55
+ "husky": "^7.0.4",
56
+ "prettier": "^2.5.1",
57
+ "prettier-plugin-java": "^1.6.1",
58
+ "pretty-quick": "^3.1.3",
59
+ "rimraf": "^3.0.2",
60
+ "rollup": "^2.79.1",
61
+ "swiftlint": "^1.0.1",
62
+ "typescript": "^4.3.2"
63
+ },
64
+ "peerDependencies": {
65
+ "@capacitor/core": "^6.0.0"
66
+ },
67
+ "husky": {
68
+ "hooks": {
69
+ "pre-commit": "pretty-quick --staged"
70
+ }
71
+ },
72
+ "prettier": "@ionic/prettier-config",
73
+ "swiftlint": "@ionic/swiftlint-config",
74
+ "eslintConfig": {
75
+ "extends": "@ionic/eslint-config/recommended"
76
+ },
77
+ "capacitor": {
78
+ "ios": {
79
+ "src": "ios"
80
+ },
81
+ "android": {
82
+ "src": "android"
83
+ }
84
+ }
85
+ }
package/dist/docs.json DELETED
@@ -1,408 +0,0 @@
1
- {
2
- "api": {
3
- "name": "CameraPreviewPlugin",
4
- "slug": "camerapreviewplugin",
5
- "docs": "",
6
- "tags": [],
7
- "methods": [
8
- {
9
- "name": "start",
10
- "signature": "(options: CameraPreviewOptions) => Promise<{}>",
11
- "parameters": [
12
- {
13
- "name": "options",
14
- "docs": "",
15
- "type": "CameraPreviewOptions"
16
- }
17
- ],
18
- "returns": "Promise<{}>",
19
- "tags": [],
20
- "docs": "",
21
- "complexTypes": [
22
- "CameraPreviewOptions"
23
- ],
24
- "slug": "start"
25
- },
26
- {
27
- "name": "stop",
28
- "signature": "() => Promise<{}>",
29
- "parameters": [],
30
- "returns": "Promise<{}>",
31
- "tags": [],
32
- "docs": "",
33
- "complexTypes": [],
34
- "slug": "stop"
35
- },
36
- {
37
- "name": "capture",
38
- "signature": "(options: CameraPreviewPictureOptions) => Promise<{ value: string; }>",
39
- "parameters": [
40
- {
41
- "name": "options",
42
- "docs": "",
43
- "type": "CameraPreviewPictureOptions"
44
- }
45
- ],
46
- "returns": "Promise<{ value: string; }>",
47
- "tags": [],
48
- "docs": "",
49
- "complexTypes": [
50
- "CameraPreviewPictureOptions"
51
- ],
52
- "slug": "capture"
53
- },
54
- {
55
- "name": "captureSample",
56
- "signature": "(options: CameraSampleOptions) => Promise<{ value: string; }>",
57
- "parameters": [
58
- {
59
- "name": "options",
60
- "docs": "",
61
- "type": "CameraSampleOptions"
62
- }
63
- ],
64
- "returns": "Promise<{ value: string; }>",
65
- "tags": [],
66
- "docs": "",
67
- "complexTypes": [
68
- "CameraSampleOptions"
69
- ],
70
- "slug": "capturesample"
71
- },
72
- {
73
- "name": "getSupportedFlashModes",
74
- "signature": "() => Promise<{ result: CameraPreviewFlashMode[]; }>",
75
- "parameters": [],
76
- "returns": "Promise<{ result: CameraPreviewFlashMode[]; }>",
77
- "tags": [],
78
- "docs": "",
79
- "complexTypes": [
80
- "CameraPreviewFlashMode"
81
- ],
82
- "slug": "getsupportedflashmodes"
83
- },
84
- {
85
- "name": "setFlashMode",
86
- "signature": "(options: { flashMode: CameraPreviewFlashMode | string; }) => Promise<void>",
87
- "parameters": [
88
- {
89
- "name": "options",
90
- "docs": "",
91
- "type": "{ flashMode: string; }"
92
- }
93
- ],
94
- "returns": "Promise<void>",
95
- "tags": [],
96
- "docs": "",
97
- "complexTypes": [
98
- "CameraPreviewFlashMode"
99
- ],
100
- "slug": "setflashmode"
101
- },
102
- {
103
- "name": "flip",
104
- "signature": "() => Promise<void>",
105
- "parameters": [],
106
- "returns": "Promise<void>",
107
- "tags": [],
108
- "docs": "",
109
- "complexTypes": [],
110
- "slug": "flip"
111
- },
112
- {
113
- "name": "setOpacity",
114
- "signature": "(options: CameraOpacityOptions) => Promise<{}>",
115
- "parameters": [
116
- {
117
- "name": "options",
118
- "docs": "",
119
- "type": "CameraOpacityOptions"
120
- }
121
- ],
122
- "returns": "Promise<{}>",
123
- "tags": [],
124
- "docs": "",
125
- "complexTypes": [
126
- "CameraOpacityOptions"
127
- ],
128
- "slug": "setopacity"
129
- },
130
- {
131
- "name": "setZoom",
132
- "signature": "(options: CameraPreviewOptions) => Promise<void>",
133
- "parameters": [
134
- {
135
- "name": "options",
136
- "docs": "",
137
- "type": "CameraPreviewOptions"
138
- }
139
- ],
140
- "returns": "Promise<void>",
141
- "tags": [],
142
- "docs": "",
143
- "complexTypes": [
144
- "CameraPreviewOptions"
145
- ],
146
- "slug": "setzoom"
147
- },
148
- {
149
- "name": "getSupportedZoomLevels",
150
- "signature": "() => Promise<{ result: any[]; }>",
151
- "parameters": [],
152
- "returns": "Promise<{ result: any[]; }>",
153
- "tags": [],
154
- "docs": "",
155
- "complexTypes": [],
156
- "slug": "getsupportedzoomlevels"
157
- }
158
- ],
159
- "properties": []
160
- },
161
- "interfaces": [
162
- {
163
- "name": "CameraPreviewOptions",
164
- "slug": "camerapreviewoptions",
165
- "docs": "",
166
- "tags": [],
167
- "methods": [],
168
- "properties": [
169
- {
170
- "name": "parent",
171
- "tags": [],
172
- "docs": "Parent element to attach the video preview element to (applicable to the web platform only)",
173
- "complexTypes": [],
174
- "type": "string | undefined"
175
- },
176
- {
177
- "name": "className",
178
- "tags": [],
179
- "docs": "Class name to add to the video preview element (applicable to the web platform only)",
180
- "complexTypes": [],
181
- "type": "string | undefined"
182
- },
183
- {
184
- "name": "width",
185
- "tags": [],
186
- "docs": "The preview width in pixels, default window.screen.width",
187
- "complexTypes": [],
188
- "type": "number | undefined"
189
- },
190
- {
191
- "name": "height",
192
- "tags": [],
193
- "docs": "The preview height in pixels, default window.screen.height",
194
- "complexTypes": [],
195
- "type": "number | undefined"
196
- },
197
- {
198
- "name": "x",
199
- "tags": [],
200
- "docs": "The x origin, default 0 (applicable to the android and ios platforms only)",
201
- "complexTypes": [],
202
- "type": "number | undefined"
203
- },
204
- {
205
- "name": "y",
206
- "tags": [],
207
- "docs": "The y origin, default 0 (applicable to the android and ios platforms only)",
208
- "complexTypes": [],
209
- "type": "number | undefined"
210
- },
211
- {
212
- "name": "toBack",
213
- "tags": [],
214
- "docs": "Brings your html in front of your preview, default false (applicable to the android only)",
215
- "complexTypes": [],
216
- "type": "boolean | undefined"
217
- },
218
- {
219
- "name": "paddingBottom",
220
- "tags": [],
221
- "docs": "The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only)",
222
- "complexTypes": [],
223
- "type": "number | undefined"
224
- },
225
- {
226
- "name": "rotateWhenOrientationChanged",
227
- "tags": [],
228
- "docs": "Rotate preview when orientation changes (applicable to the ios platforms only; default value is true)",
229
- "complexTypes": [],
230
- "type": "boolean | undefined"
231
- },
232
- {
233
- "name": "position",
234
- "tags": [],
235
- "docs": "Choose the camera to use 'front' or 'rear', default 'front'",
236
- "complexTypes": [
237
- "CameraPosition"
238
- ],
239
- "type": "string | undefined"
240
- },
241
- {
242
- "name": "storeToFile",
243
- "tags": [],
244
- "docs": "Defaults to false - Capture images to a file and return the file path instead of returning base64 encoded data",
245
- "complexTypes": [],
246
- "type": "boolean | undefined"
247
- },
248
- {
249
- "name": "disableExifHeaderStripping",
250
- "tags": [],
251
- "docs": "Defaults to false - Android Only - Disable automatic rotation of the image, and let the browser deal with it (keep reading on how to achieve it)",
252
- "complexTypes": [],
253
- "type": "boolean | undefined"
254
- },
255
- {
256
- "name": "enableHighResolution",
257
- "tags": [],
258
- "docs": "Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device *",
259
- "complexTypes": [],
260
- "type": "boolean | undefined"
261
- },
262
- {
263
- "name": "disableAudio",
264
- "tags": [],
265
- "docs": "Defaults to false - Web only - Disables audio stream to prevent permission requests and output switching",
266
- "complexTypes": [],
267
- "type": "boolean | undefined"
268
- },
269
- {
270
- "name": "lockAndroidOrientation",
271
- "tags": [],
272
- "docs": "Android Only - Locks device orientation when camera is showing.",
273
- "complexTypes": [],
274
- "type": "boolean | undefined"
275
- },
276
- {
277
- "name": "enableOpacity",
278
- "tags": [],
279
- "docs": "Defaults to false - Android and Web only. Set if camera preview can change opacity.",
280
- "complexTypes": [],
281
- "type": "boolean | undefined"
282
- },
283
- {
284
- "name": "enableZoom",
285
- "tags": [],
286
- "docs": "Defaults to false - Android only. Set if camera preview will support pinch to zoom.",
287
- "complexTypes": [],
288
- "type": "boolean | undefined"
289
- },
290
- {
291
- "name": "zoomFactor",
292
- "tags": [],
293
- "docs": "override defualt lens choice ios String 'ultra','wide','tele' android int example 100, 200 etc",
294
- "complexTypes": [],
295
- "type": "any"
296
- }
297
- ]
298
- },
299
- {
300
- "name": "CameraPreviewPictureOptions",
301
- "slug": "camerapreviewpictureoptions",
302
- "docs": "",
303
- "tags": [],
304
- "methods": [],
305
- "properties": [
306
- {
307
- "name": "height",
308
- "tags": [],
309
- "docs": "The picture height, optional, default 0 (Device default)",
310
- "complexTypes": [],
311
- "type": "number | undefined"
312
- },
313
- {
314
- "name": "width",
315
- "tags": [],
316
- "docs": "The picture width, optional, default 0 (Device default)",
317
- "complexTypes": [],
318
- "type": "number | undefined"
319
- },
320
- {
321
- "name": "quality",
322
- "tags": [],
323
- "docs": "The picture quality, 0 - 100, default 85 on `iOS/Android`.\r\n\r\nIf left undefined, the `web` implementation will export a PNG, otherwise a JPEG will be generated",
324
- "complexTypes": [],
325
- "type": "number | undefined"
326
- }
327
- ]
328
- },
329
- {
330
- "name": "CameraSampleOptions",
331
- "slug": "camerasampleoptions",
332
- "docs": "",
333
- "tags": [],
334
- "methods": [],
335
- "properties": [
336
- {
337
- "name": "quality",
338
- "tags": [],
339
- "docs": "The picture quality, 0 - 100, default 85",
340
- "complexTypes": [],
341
- "type": "number | undefined"
342
- }
343
- ]
344
- },
345
- {
346
- "name": "CameraOpacityOptions",
347
- "slug": "cameraopacityoptions",
348
- "docs": "",
349
- "tags": [],
350
- "methods": [],
351
- "properties": [
352
- {
353
- "name": "opacity",
354
- "tags": [],
355
- "docs": "The percent opacity to set for camera view, default 1",
356
- "complexTypes": [],
357
- "type": "number | undefined"
358
- }
359
- ]
360
- }
361
- ],
362
- "enums": [],
363
- "typeAliases": [
364
- {
365
- "name": "CameraPosition",
366
- "slug": "cameraposition",
367
- "docs": "",
368
- "types": [
369
- {
370
- "text": "'rear'",
371
- "complexTypes": []
372
- },
373
- {
374
- "text": "'front'",
375
- "complexTypes": []
376
- }
377
- ]
378
- },
379
- {
380
- "name": "CameraPreviewFlashMode",
381
- "slug": "camerapreviewflashmode",
382
- "docs": "",
383
- "types": [
384
- {
385
- "text": "'off'",
386
- "complexTypes": []
387
- },
388
- {
389
- "text": "'on'",
390
- "complexTypes": []
391
- },
392
- {
393
- "text": "'auto'",
394
- "complexTypes": []
395
- },
396
- {
397
- "text": "'red-eye'",
398
- "complexTypes": []
399
- },
400
- {
401
- "text": "'torch'",
402
- "complexTypes": []
403
- }
404
- ]
405
- }
406
- ],
407
- "pluginConfigs": []
408
- }