one 2.6.21 → 2.6.22
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/android/src/main/java/dev/onejs/onenative/OneNativeCameraManager.kt +24 -0
- package/android/src/main/java/dev/onejs/onenative/OneNativeCameraView.kt +197 -2
- package/dist/cjs/platform/camera/index.cjs +3 -2
- package/dist/cjs/platform/camera/index.native.cjs +89 -3
- package/dist/cjs/platform/camera/index.native.js +89 -3
- package/dist/cjs/platform/camera/index.native.js.map +1 -1
- package/dist/cjs/platform/specs/OneNativeCameraNativeComponent.cjs +37 -21
- package/dist/cjs/platform/specs/OneNativeCameraNativeComponent.native.cjs +37 -21
- package/dist/cjs/platform/specs/OneNativeCameraNativeComponent.native.js +37 -21
- package/dist/cjs/platform/specs/OneNativeCameraNativeComponent.native.js.map +3 -3
- package/dist/cjs/router/router.cjs +4 -1
- package/dist/esm/platform/camera/index.mjs +4 -2
- package/dist/esm/platform/camera/index.mjs.map +1 -1
- package/dist/esm/platform/camera/index.native.js +90 -4
- package/dist/esm/platform/camera/index.native.js.map +1 -1
- package/dist/esm/platform/specs/OneNativeCameraNativeComponent.mjs +25 -9
- package/dist/esm/platform/specs/OneNativeCameraNativeComponent.mjs.map +3 -3
- package/dist/esm/platform/specs/OneNativeCameraNativeComponent.native.js +25 -9
- package/dist/esm/platform/specs/OneNativeCameraNativeComponent.native.js.map +3 -3
- package/dist/esm/router/router.mjs +5 -2
- package/dist/esm/router/router.mjs.map +1 -1
- package/ios/OneNativeCameraComponentView.mm +28 -0
- package/ios/OneNativeCameraView.swift +163 -0
- package/package.json +12 -12
- package/src/index.ts +3 -0
- package/src/platform/camera/index.native.tsx +116 -12
- package/src/platform/camera/index.tsx +15 -4
- package/src/platform/camera/types.ts +22 -0
- package/src/platform/index.native.ts +4 -0
- package/src/platform/index.ts +4 -0
- package/src/platform/specs/OneNativeCameraNativeComponent.ts +35 -2
- package/src/router/router.ts +7 -4
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/platform/camera/index.d.ts +3 -3
- package/types/platform/camera/index.d.ts.map +1 -1
- package/types/platform/camera/index.native.d.ts +3 -3
- package/types/platform/camera/index.native.d.ts.map +1 -1
- package/types/platform/camera/types.d.ts +18 -0
- package/types/platform/camera/types.d.ts.map +1 -1
- package/types/platform/index.d.ts +1 -1
- package/types/platform/index.d.ts.map +1 -1
- package/types/platform/index.native.d.ts +1 -1
- package/types/platform/index.native.d.ts.map +1 -1
- package/types/platform/specs/OneNativeCameraNativeComponent.d.ts +18 -2
- package/types/platform/specs/OneNativeCameraNativeComponent.d.ts.map +1 -1
- package/types/router/router.d.ts.map +1 -1
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
2
|
var s = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var m = Object.getOwnPropertyNames;
|
|
4
|
+
var c = Object.prototype.hasOwnProperty;
|
|
5
5
|
var d = (t, e) => {
|
|
6
|
-
for (var
|
|
7
|
-
i(t,
|
|
6
|
+
for (var a in e)
|
|
7
|
+
i(t, a, { get: e[a], enumerable: true });
|
|
8
8
|
};
|
|
9
|
-
var
|
|
9
|
+
var v = (t, e, a, o) => {
|
|
10
10
|
if (e && typeof e === "object" || typeof e === "function") {
|
|
11
|
-
for (let
|
|
12
|
-
if (!
|
|
13
|
-
i(t,
|
|
11
|
+
for (let r of m(e))
|
|
12
|
+
if (!c.call(t, r) && r !== a)
|
|
13
|
+
i(t, r, { get: () => e[r], enumerable: !(o = s(e, r)) || o.enumerable });
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
16
|
};
|
|
17
|
-
var C = (t) =>
|
|
18
|
-
var
|
|
19
|
-
d(
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
var C = (t) => v(i({}, "__esModule", { value: true }), t);
|
|
18
|
+
var f = {};
|
|
19
|
+
d(f, {
|
|
20
|
+
Commands: () => y,
|
|
21
|
+
__INTERNAL_VIEW_CONFIG: () => n,
|
|
22
|
+
default: () => g
|
|
22
23
|
});
|
|
23
|
-
module.exports = C(
|
|
24
|
-
const
|
|
24
|
+
module.exports = C(f);
|
|
25
|
+
const p = require("react-native/Libraries/NativeComponent/NativeComponentRegistry");
|
|
25
26
|
const {
|
|
26
|
-
ConditionallyIgnoredEventHandlers:
|
|
27
|
+
ConditionallyIgnoredEventHandlers: u
|
|
27
28
|
} = require("react-native/Libraries/NativeComponent/ViewConfigIgnore");
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const {
|
|
30
|
+
dispatchCommand: N
|
|
31
|
+
} = require("react-native/Libraries/ReactNative/RendererProxy");
|
|
32
|
+
let l = "OneNativeCamera";
|
|
33
|
+
const n = {
|
|
30
34
|
uiViewClassName: "OneNativeCamera",
|
|
31
35
|
directEventTypes: {
|
|
32
36
|
topNativeCameraState: {
|
|
@@ -34,16 +38,28 @@ const o = {
|
|
|
34
38
|
},
|
|
35
39
|
topNativeCameraCode: {
|
|
36
40
|
registrationName: "onNativeCameraCode"
|
|
41
|
+
},
|
|
42
|
+
topNativeCameraPicture: {
|
|
43
|
+
registrationName: "onNativeCameraPicture"
|
|
37
44
|
}
|
|
38
45
|
},
|
|
39
46
|
validAttributes: {
|
|
40
47
|
active: true,
|
|
41
48
|
facing: true,
|
|
42
49
|
codeTypes: true,
|
|
43
|
-
|
|
50
|
+
flash: true,
|
|
51
|
+
enableTorch: true,
|
|
52
|
+
zoom: true,
|
|
53
|
+
...u({
|
|
44
54
|
onNativeCameraState: true,
|
|
45
|
-
onNativeCameraCode: true
|
|
55
|
+
onNativeCameraCode: true,
|
|
56
|
+
onNativeCameraPicture: true
|
|
46
57
|
})
|
|
47
58
|
}
|
|
48
59
|
};
|
|
49
|
-
var
|
|
60
|
+
var g = p.get(l, () => n);
|
|
61
|
+
const y = {
|
|
62
|
+
takePicture(t, e, a, o) {
|
|
63
|
+
N(t, "takePicture", [e, a, o]);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
2
|
var s = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var m = Object.getOwnPropertyNames;
|
|
4
|
+
var c = Object.prototype.hasOwnProperty;
|
|
5
5
|
var d = (t, e) => {
|
|
6
|
-
for (var
|
|
7
|
-
i(t,
|
|
6
|
+
for (var a in e)
|
|
7
|
+
i(t, a, { get: e[a], enumerable: true });
|
|
8
8
|
};
|
|
9
|
-
var
|
|
9
|
+
var v = (t, e, a, o) => {
|
|
10
10
|
if (e && typeof e === "object" || typeof e === "function") {
|
|
11
|
-
for (let
|
|
12
|
-
if (!
|
|
13
|
-
i(t,
|
|
11
|
+
for (let r of m(e))
|
|
12
|
+
if (!c.call(t, r) && r !== a)
|
|
13
|
+
i(t, r, { get: () => e[r], enumerable: !(o = s(e, r)) || o.enumerable });
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
16
|
};
|
|
17
|
-
var C = (t) =>
|
|
18
|
-
var
|
|
19
|
-
d(
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
var C = (t) => v(i({}, "__esModule", { value: true }), t);
|
|
18
|
+
var f = {};
|
|
19
|
+
d(f, {
|
|
20
|
+
Commands: () => y,
|
|
21
|
+
__INTERNAL_VIEW_CONFIG: () => n,
|
|
22
|
+
default: () => g
|
|
22
23
|
});
|
|
23
|
-
module.exports = C(
|
|
24
|
-
const
|
|
24
|
+
module.exports = C(f);
|
|
25
|
+
const p = require("react-native/Libraries/NativeComponent/NativeComponentRegistry");
|
|
25
26
|
const {
|
|
26
|
-
ConditionallyIgnoredEventHandlers:
|
|
27
|
+
ConditionallyIgnoredEventHandlers: u
|
|
27
28
|
} = require("react-native/Libraries/NativeComponent/ViewConfigIgnore");
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const {
|
|
30
|
+
dispatchCommand: N
|
|
31
|
+
} = require("react-native/Libraries/ReactNative/RendererProxy");
|
|
32
|
+
let l = "OneNativeCamera";
|
|
33
|
+
const n = {
|
|
30
34
|
uiViewClassName: "OneNativeCamera",
|
|
31
35
|
directEventTypes: {
|
|
32
36
|
topNativeCameraState: {
|
|
@@ -34,16 +38,28 @@ const o = {
|
|
|
34
38
|
},
|
|
35
39
|
topNativeCameraCode: {
|
|
36
40
|
registrationName: "onNativeCameraCode"
|
|
41
|
+
},
|
|
42
|
+
topNativeCameraPicture: {
|
|
43
|
+
registrationName: "onNativeCameraPicture"
|
|
37
44
|
}
|
|
38
45
|
},
|
|
39
46
|
validAttributes: {
|
|
40
47
|
active: true,
|
|
41
48
|
facing: true,
|
|
42
49
|
codeTypes: true,
|
|
43
|
-
|
|
50
|
+
flash: true,
|
|
51
|
+
enableTorch: true,
|
|
52
|
+
zoom: true,
|
|
53
|
+
...u({
|
|
44
54
|
onNativeCameraState: true,
|
|
45
|
-
onNativeCameraCode: true
|
|
55
|
+
onNativeCameraCode: true,
|
|
56
|
+
onNativeCameraPicture: true
|
|
46
57
|
})
|
|
47
58
|
}
|
|
48
59
|
};
|
|
49
|
-
var
|
|
60
|
+
var g = p.get(l, () => n);
|
|
61
|
+
const y = {
|
|
62
|
+
takePicture(t, e, a, o) {
|
|
63
|
+
N(t, "takePicture", [e, a, o]);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
2
|
var s = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var m = Object.getOwnPropertyNames;
|
|
4
|
+
var c = Object.prototype.hasOwnProperty;
|
|
5
5
|
var d = (t, e) => {
|
|
6
|
-
for (var
|
|
7
|
-
i(t,
|
|
6
|
+
for (var a in e)
|
|
7
|
+
i(t, a, { get: e[a], enumerable: true });
|
|
8
8
|
};
|
|
9
|
-
var
|
|
9
|
+
var v = (t, e, a, o) => {
|
|
10
10
|
if (e && typeof e === "object" || typeof e === "function") {
|
|
11
|
-
for (let
|
|
12
|
-
if (!
|
|
13
|
-
i(t,
|
|
11
|
+
for (let r of m(e))
|
|
12
|
+
if (!c.call(t, r) && r !== a)
|
|
13
|
+
i(t, r, { get: () => e[r], enumerable: !(o = s(e, r)) || o.enumerable });
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
16
|
};
|
|
17
|
-
var C = (t) =>
|
|
18
|
-
var
|
|
19
|
-
d(
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
var C = (t) => v(i({}, "__esModule", { value: true }), t);
|
|
18
|
+
var f = {};
|
|
19
|
+
d(f, {
|
|
20
|
+
Commands: () => y,
|
|
21
|
+
__INTERNAL_VIEW_CONFIG: () => n,
|
|
22
|
+
default: () => g
|
|
22
23
|
});
|
|
23
|
-
module.exports = C(
|
|
24
|
-
const
|
|
24
|
+
module.exports = C(f);
|
|
25
|
+
const p = require("react-native/Libraries/NativeComponent/NativeComponentRegistry");
|
|
25
26
|
const {
|
|
26
|
-
ConditionallyIgnoredEventHandlers:
|
|
27
|
+
ConditionallyIgnoredEventHandlers: u
|
|
27
28
|
} = require("react-native/Libraries/NativeComponent/ViewConfigIgnore");
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const {
|
|
30
|
+
dispatchCommand: N
|
|
31
|
+
} = require("react-native/Libraries/ReactNative/RendererProxy");
|
|
32
|
+
let l = "OneNativeCamera";
|
|
33
|
+
const n = {
|
|
30
34
|
uiViewClassName: "OneNativeCamera",
|
|
31
35
|
directEventTypes: {
|
|
32
36
|
topNativeCameraState: {
|
|
@@ -34,17 +38,29 @@ const o = {
|
|
|
34
38
|
},
|
|
35
39
|
topNativeCameraCode: {
|
|
36
40
|
registrationName: "onNativeCameraCode"
|
|
41
|
+
},
|
|
42
|
+
topNativeCameraPicture: {
|
|
43
|
+
registrationName: "onNativeCameraPicture"
|
|
37
44
|
}
|
|
38
45
|
},
|
|
39
46
|
validAttributes: {
|
|
40
47
|
active: true,
|
|
41
48
|
facing: true,
|
|
42
49
|
codeTypes: true,
|
|
43
|
-
|
|
50
|
+
flash: true,
|
|
51
|
+
enableTorch: true,
|
|
52
|
+
zoom: true,
|
|
53
|
+
...u({
|
|
44
54
|
onNativeCameraState: true,
|
|
45
|
-
onNativeCameraCode: true
|
|
55
|
+
onNativeCameraCode: true,
|
|
56
|
+
onNativeCameraPicture: true
|
|
46
57
|
})
|
|
47
58
|
}
|
|
48
59
|
};
|
|
49
|
-
var
|
|
60
|
+
var g = p.get(l, () => n);
|
|
61
|
+
const y = {
|
|
62
|
+
takePicture(t, e, a, o) {
|
|
63
|
+
N(t, "takePicture", [e, a, o]);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
50
66
|
//# sourceMappingURL=OneNativeCameraNativeComponent.native.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/platform/specs/OneNativeCameraNativeComponent.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ViewProps } from 'react-native';\nimport type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';\nimport codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\ninterface NativeProps extends ViewProps {\n active: boolean;\n facing: string;\n codeTypes: ReadonlyArray<string>;\n onNativeCameraState?: DirectEventHandler<Readonly<{\n state: string;\n }>>;\n onNativeCameraCode?: DirectEventHandler<Readonly<{\n type: string;\n data: string;\n }>>;\n}\nconst NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\nconst {\n ConditionallyIgnoredEventHandlers\n} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');\nlet nativeComponentName = 'OneNativeCamera';\nexport const __INTERNAL_VIEW_CONFIG = {\n uiViewClassName: \"OneNativeCamera\",\n directEventTypes: {\n topNativeCameraState: {\n registrationName: \"onNativeCameraState\"\n },\n topNativeCameraCode: {\n registrationName: \"onNativeCameraCode\"\n }\n },\n validAttributes: {\n active: true,\n facing: true,\n codeTypes: true,\n ...ConditionallyIgnoredEventHandlers({\n onNativeCameraState: true,\n onNativeCameraCode: true\n })\n }\n};\nexport default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA;AAAAC,EAAAD,GAAA;AAAA,
|
|
6
|
-
"names": ["OneNativeCameraNativeComponent_exports", "__export", "__INTERNAL_VIEW_CONFIG", "OneNativeCameraNativeComponent_default", "__toCommonJS", "NativeComponentRegistry", "ConditionallyIgnoredEventHandlers", "nativeComponentName"]
|
|
4
|
+
"sourcesContent": ["import type { HostComponent, ViewProps } from 'react-native';\nimport type { DirectEventHandler, Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';\nimport codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';\nimport codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type * as React from 'react';\ninterface NativeProps extends ViewProps {\n active: boolean;\n facing: string;\n codeTypes: ReadonlyArray<string>;\n flash: string;\n enableTorch: boolean;\n zoom: Double;\n onNativeCameraState?: DirectEventHandler<Readonly<{\n state: string;\n }>>;\n onNativeCameraCode?: DirectEventHandler<Readonly<{\n type: string;\n data: string;\n }>>;\n // error is empty on success, otherwise \"<code>: <message>\".\n onNativeCameraPicture?: DirectEventHandler<Readonly<{\n requestId: Int32;\n uri: string;\n width: Int32;\n height: Int32;\n base64: string;\n error: string;\n }>>;\n}\ninterface NativeCommands {\n takePicture(viewRef: React.ElementRef<HostComponent<NativeProps>>, requestId: Int32, quality: Double, base64: boolean): void;\n}\nconst NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\nconst {\n ConditionallyIgnoredEventHandlers\n} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');\nconst {\n dispatchCommand\n} = require(\"react-native/Libraries/ReactNative/RendererProxy\");\nlet nativeComponentName = 'OneNativeCamera';\nexport const __INTERNAL_VIEW_CONFIG = {\n uiViewClassName: \"OneNativeCamera\",\n directEventTypes: {\n topNativeCameraState: {\n registrationName: \"onNativeCameraState\"\n },\n topNativeCameraCode: {\n registrationName: \"onNativeCameraCode\"\n },\n topNativeCameraPicture: {\n registrationName: \"onNativeCameraPicture\"\n }\n },\n validAttributes: {\n active: true,\n facing: true,\n codeTypes: true,\n flash: true,\n enableTorch: true,\n zoom: true,\n ...ConditionallyIgnoredEventHandlers({\n onNativeCameraState: true,\n onNativeCameraCode: true,\n onNativeCameraPicture: true\n })\n }\n};\nexport default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);\nexport const Commands = {\n takePicture(ref, requestId, quality, base64) {\n dispatchCommand(ref, \"takePicture\", [requestId, quality, base64]);\n }\n};"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA;AAAAC,EAAAD,GAAA;AAAA,kBAAAE;AAAA,EAAA,8BAAAC;AAAA,EAAA,eAAAC;AAAA;AAAA,iBAAAC,EAAAL;AAgCA,MAAMM,IAA0B,QAAQ,gEAAgE;AACxG,MAAM;AAAA,EACJ,mCAAAC;AACF,IAAI,QAAQ,yDAAyD;AACrE,MAAM;AAAA,EACJ,iBAAAC;AACF,IAAI,QAAQ,kDAAkD;AAC9D,IAAIC,IAAsB;AACnB,MAAMN,IAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,IAChB,sBAAsB;AAAA,MACpB,kBAAkB;AAAA,IACpB;AAAA,IACA,qBAAqB;AAAA,MACnB,kBAAkB;AAAA,IACpB;AAAA,IACA,wBAAwB;AAAA,MACtB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,GAAGI,EAAkC;AAAA,MACnC,qBAAqB;AAAA,MACrB,oBAAoB;AAAA,MACpB,uBAAuB;AAAA,IACzB,CAAC;AAAA,EACH;AACF;AACA,IAAOH,IAAQE,EAAwB,IAAIG,GAAqB,MAAMN,CAAsB;AACrF,MAAMD,IAAW;AAAA,EACtB,YAAYQ,GAAKC,GAAWC,GAASC,GAAQ;AAC3C,IAAAL,EAAgBE,GAAK,eAAe,CAACC,GAAWC,GAASC,CAAM,CAAC;AAAA,EAClE;AACF;",
|
|
6
|
+
"names": ["OneNativeCameraNativeComponent_exports", "__export", "Commands", "__INTERNAL_VIEW_CONFIG", "OneNativeCameraNativeComponent_default", "__toCommonJS", "NativeComponentRegistry", "ConditionallyIgnoredEventHandlers", "dispatchCommand", "nativeComponentName", "ref", "requestId", "quality", "base64"]
|
|
7
7
|
}
|
|
@@ -640,7 +640,10 @@ function preloadRoute(href, injectCSS = false) {
|
|
|
640
640
|
}
|
|
641
641
|
return data;
|
|
642
642
|
}, (err) => {
|
|
643
|
-
if (injectCSS && process.env.ONE_SKEW_PROTECTION !== "false" && (0, import_dynamicImport.isChunkLoadError)(err)
|
|
643
|
+
if (injectCSS && process.env.ONE_SKEW_PROTECTION !== "false" && (0, import_dynamicImport.isChunkLoadError)(err)) {
|
|
644
|
+
window.location.href = href;
|
|
645
|
+
return new Promise(() => {});
|
|
646
|
+
}
|
|
644
647
|
return null;
|
|
645
648
|
});
|
|
646
649
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["esm/platform/camera/index.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/platform/camera/index.js"],"sourcesContent":["import { forwardRef } from \"react\";\nconst CameraView = forwardRef(function CameraView2() {\n throw new Error(\"CameraView requires a native build\");\n});\nexport {\n CameraView\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,MAAM,aAAa,WAAW,SAAS,cAAc;CACnD,MAAM,IAAI,MAAM,oCAAoC;AACtD,CAAC"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
|
|
2
3
|
import { Platform } from "react-native";
|
|
3
|
-
import NativeCamera from "../specs/OneNativeCameraNativeComponent.native.js";
|
|
4
|
+
import NativeCamera, { Commands } from "../specs/OneNativeCameraNativeComponent.native.js";
|
|
4
5
|
|
|
6
|
+
var nextRequestId = 1;
|
|
7
|
+
function codedError(code, message) {
|
|
8
|
+
return Object.assign(new Error(message), { code });
|
|
9
|
+
}
|
|
10
|
+
function nativeError(value) {
|
|
11
|
+
var coded = /^((?:E|ERR)_[A-Z0-9_]+): ([\s\S]*)$/.exec(value);
|
|
12
|
+
return coded ? codedError(coded[1], coded[2]) : new Error(value);
|
|
13
|
+
}
|
|
5
14
|
function cameraState(value) {
|
|
6
15
|
switch (value) {
|
|
7
16
|
case "inactive":
|
|
@@ -32,8 +41,8 @@ function codeType(value) {
|
|
|
32
41
|
if (!isCodeType(value)) throw new Error(`CameraView received an unknown code type: ${value}`);
|
|
33
42
|
return value;
|
|
34
43
|
}
|
|
35
|
-
|
|
36
|
-
var { active = true, facing = "back", codeTypes = ["qr"], onStateChange, onCodeScanned, ...viewProps } = param;
|
|
44
|
+
var CameraView = /* @__PURE__ */ forwardRef(function CameraView2(param, ref) {
|
|
45
|
+
var { active = true, facing = "back", codeTypes = ["qr"], flash = "off", enableTorch = false, zoom = 0, onStateChange, onCodeScanned, ...viewProps } = param;
|
|
37
46
|
if (Platform.OS !== "ios" && Platform.OS !== "android") throw new Error("CameraView requires a native build");
|
|
38
47
|
if (typeof active !== "boolean") throw new TypeError("CameraView.active must be a boolean");
|
|
39
48
|
if (facing !== "back" && facing !== "front") {
|
|
@@ -44,11 +53,71 @@ function CameraView(param) {
|
|
|
44
53
|
})) {
|
|
45
54
|
throw new TypeError("CameraView.codeTypes contains an unsupported code type");
|
|
46
55
|
}
|
|
56
|
+
if (flash !== "off" && flash !== "on" && flash !== "auto") {
|
|
57
|
+
throw new TypeError("CameraView.flash must be off, on or auto");
|
|
58
|
+
}
|
|
59
|
+
if (typeof enableTorch !== "boolean") {
|
|
60
|
+
throw new TypeError("CameraView.enableTorch must be a boolean");
|
|
61
|
+
}
|
|
62
|
+
if (typeof zoom !== "number" || !(zoom >= 0 && zoom <= 1)) {
|
|
63
|
+
throw new RangeError("CameraView.zoom must be a number from 0 to 1");
|
|
64
|
+
}
|
|
65
|
+
var nativeRef = useRef(null);
|
|
66
|
+
var pending = useRef(/* @__PURE__ */ new Map());
|
|
67
|
+
useEffect(function() {
|
|
68
|
+
var requests = pending.current;
|
|
69
|
+
return function() {
|
|
70
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
71
|
+
try {
|
|
72
|
+
for (var _iterator = requests.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
73
|
+
var request = _step.value;
|
|
74
|
+
request.reject(codedError("E_CAMERA_UNMOUNTED", "CameraView unmounted before the picture was taken"));
|
|
75
|
+
}
|
|
76
|
+
} catch (err) {
|
|
77
|
+
_didIteratorError = true;
|
|
78
|
+
_iteratorError = err;
|
|
79
|
+
} finally {
|
|
80
|
+
try {
|
|
81
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
82
|
+
_iterator.return();
|
|
83
|
+
}
|
|
84
|
+
} finally {
|
|
85
|
+
if (_didIteratorError) {
|
|
86
|
+
throw _iteratorError;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
requests.clear();
|
|
91
|
+
};
|
|
92
|
+
}, []);
|
|
93
|
+
useImperativeHandle(ref, function() {
|
|
94
|
+
return { takePicture() {
|
|
95
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
96
|
+
var { quality = 1, base64 = false } = options;
|
|
97
|
+
if (typeof quality !== "number" || !(quality >= 0 && quality <= 1)) return Promise.reject(new RangeError("takePicture quality must be a number from 0 to 1"));
|
|
98
|
+
if (typeof base64 !== "boolean") return Promise.reject(new TypeError("takePicture base64 must be a boolean"));
|
|
99
|
+
var view = nativeRef.current;
|
|
100
|
+
if (!view) return Promise.reject(codedError("E_CAMERA_UNMOUNTED", "CameraView is not mounted"));
|
|
101
|
+
var requestId = nextRequestId++;
|
|
102
|
+
return new Promise(function(resolve, reject) {
|
|
103
|
+
pending.current.set(requestId, {
|
|
104
|
+
resolve,
|
|
105
|
+
reject,
|
|
106
|
+
base64
|
|
107
|
+
});
|
|
108
|
+
Commands.takePicture(view, requestId, quality, base64);
|
|
109
|
+
});
|
|
110
|
+
} };
|
|
111
|
+
}, []);
|
|
47
112
|
return /* @__PURE__ */ jsx(NativeCamera, {
|
|
48
113
|
...viewProps,
|
|
114
|
+
ref: nativeRef,
|
|
49
115
|
active,
|
|
50
116
|
facing,
|
|
51
117
|
codeTypes: [...new Set(codeTypes)],
|
|
118
|
+
flash,
|
|
119
|
+
enableTorch,
|
|
120
|
+
zoom,
|
|
52
121
|
onNativeCameraState: function onNativeCameraState(param2) {
|
|
53
122
|
var { nativeEvent } = param2;
|
|
54
123
|
return onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(cameraState(nativeEvent.state));
|
|
@@ -59,9 +128,26 @@ function CameraView(param) {
|
|
|
59
128
|
type: codeType(nativeEvent.type),
|
|
60
129
|
data: nativeEvent.data
|
|
61
130
|
});
|
|
131
|
+
},
|
|
132
|
+
onNativeCameraPicture: function onNativeCameraPicture(param2) {
|
|
133
|
+
var { nativeEvent } = param2;
|
|
134
|
+
var request = pending.current.get(nativeEvent.requestId);
|
|
135
|
+
if (!request) return;
|
|
136
|
+
pending.current.delete(nativeEvent.requestId);
|
|
137
|
+
if (nativeEvent.error) {
|
|
138
|
+
request.reject(nativeError(nativeEvent.error));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
request.resolve({
|
|
142
|
+
uri: nativeEvent.uri,
|
|
143
|
+
width: nativeEvent.width,
|
|
144
|
+
height: nativeEvent.height,
|
|
145
|
+
format: "jpg",
|
|
146
|
+
...request.base64 ? { base64: nativeEvent.base64 } : {}
|
|
147
|
+
});
|
|
62
148
|
}
|
|
63
149
|
});
|
|
64
|
-
}
|
|
150
|
+
});
|
|
65
151
|
|
|
66
152
|
export { CameraView };
|
|
67
153
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/camera/index.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Platform } from \"react-native\";\nimport NativeCamera from \"../specs/OneNativeCameraNativeComponent\";\nfunction cameraState(value) {\n switch (value) {\n case \"inactive\":\n case \"permission-required\":\n case \"unavailable\":\n case \"ready\":\n case \"unsupported\":\n case \"failed\":\n return value;\n default:\n throw new Error(`CameraView received an unknown native state: ${value}`);\n }\n}\nfunction isCodeType(value) {\n switch (value) {\n case \"qr\":\n case \"ean13\":\n case \"ean8\":\n case \"upce\":\n case \"code128\":\n case \"code39\":\n case \"code93\":\n case \"pdf417\":\n case \"aztec\":\n case \"dataMatrix\":\n return true;\n default:\n return false;\n }\n}\nfunction codeType(value) {\n if (!isCodeType(value)) throw new Error(`CameraView received an unknown code type: ${value}`);\n return value;\n}\
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/camera/index.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef, useEffect, useImperativeHandle, useRef } from \"react\";\nimport { Platform } from \"react-native\";\nimport NativeCamera, { Commands } from \"../specs/OneNativeCameraNativeComponent\";\nvar nextRequestId = 1;\nfunction codedError(code, message) {\n return Object.assign(new Error(message), {\n code\n });\n}\nfunction nativeError(value) {\n var coded = /^((?:E|ERR)_[A-Z0-9_]+): ([\\s\\S]*)$/.exec(value);\n return coded ? codedError(coded[1], coded[2]) : new Error(value);\n}\nfunction cameraState(value) {\n switch (value) {\n case \"inactive\":\n case \"permission-required\":\n case \"unavailable\":\n case \"ready\":\n case \"unsupported\":\n case \"failed\":\n return value;\n default:\n throw new Error(`CameraView received an unknown native state: ${value}`);\n }\n}\nfunction isCodeType(value) {\n switch (value) {\n case \"qr\":\n case \"ean13\":\n case \"ean8\":\n case \"upce\":\n case \"code128\":\n case \"code39\":\n case \"code93\":\n case \"pdf417\":\n case \"aztec\":\n case \"dataMatrix\":\n return true;\n default:\n return false;\n }\n}\nfunction codeType(value) {\n if (!isCodeType(value)) throw new Error(`CameraView received an unknown code type: ${value}`);\n return value;\n}\nvar CameraView = /* @__PURE__ */ forwardRef(function CameraView2(param, ref) {\n var { active = true, facing = \"back\", codeTypes = [\n \"qr\"\n ], flash = \"off\", enableTorch = false, zoom = 0, onStateChange, onCodeScanned, ...viewProps } = param;\n if (Platform.OS !== \"ios\" && Platform.OS !== \"android\") throw new Error(\"CameraView requires a native build\");\n if (typeof active !== \"boolean\") throw new TypeError(\"CameraView.active must be a boolean\");\n if (facing !== \"back\" && facing !== \"front\") {\n throw new TypeError(\"CameraView.facing must be back or front\");\n }\n if (!Array.isArray(codeTypes) || codeTypes.some(function(type) {\n return !isCodeType(type);\n })) {\n throw new TypeError(\"CameraView.codeTypes contains an unsupported code type\");\n }\n if (flash !== \"off\" && flash !== \"on\" && flash !== \"auto\") {\n throw new TypeError(\"CameraView.flash must be off, on or auto\");\n }\n if (typeof enableTorch !== \"boolean\") {\n throw new TypeError(\"CameraView.enableTorch must be a boolean\");\n }\n if (typeof zoom !== \"number\" || !(zoom >= 0 && zoom <= 1)) {\n throw new RangeError(\"CameraView.zoom must be a number from 0 to 1\");\n }\n var nativeRef = useRef(null);\n var pending = useRef(/* @__PURE__ */ new Map());\n useEffect(function() {\n var requests = pending.current;\n return function() {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = requests.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var request = _step.value;\n request.reject(codedError(\"E_CAMERA_UNMOUNTED\", \"CameraView unmounted before the picture was taken\"));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n requests.clear();\n };\n }, []);\n useImperativeHandle(ref, function() {\n return {\n takePicture() {\n var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n var { quality = 1, base64 = false } = options;\n if (typeof quality !== \"number\" || !(quality >= 0 && quality <= 1)) return Promise.reject(new RangeError(\"takePicture quality must be a number from 0 to 1\"));\n if (typeof base64 !== \"boolean\") return Promise.reject(new TypeError(\"takePicture base64 must be a boolean\"));\n var view = nativeRef.current;\n if (!view) return Promise.reject(codedError(\"E_CAMERA_UNMOUNTED\", \"CameraView is not mounted\"));\n var requestId = nextRequestId++;\n return new Promise(function(resolve, reject) {\n pending.current.set(requestId, {\n resolve,\n reject,\n base64\n });\n Commands.takePicture(view, requestId, quality, base64);\n });\n }\n };\n }, []);\n return /* @__PURE__ */ _jsx(NativeCamera, {\n ...viewProps,\n ref: nativeRef,\n active,\n facing,\n codeTypes: [\n ...new Set(codeTypes)\n ],\n flash,\n enableTorch,\n zoom,\n onNativeCameraState: function onNativeCameraState(param2) {\n var { nativeEvent } = param2;\n return onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(cameraState(nativeEvent.state));\n },\n onNativeCameraCode: function onNativeCameraCode(param2) {\n var { nativeEvent } = param2;\n return onCodeScanned === null || onCodeScanned === void 0 ? void 0 : onCodeScanned({\n type: codeType(nativeEvent.type),\n data: nativeEvent.data\n });\n },\n onNativeCameraPicture: function onNativeCameraPicture(param2) {\n var { nativeEvent } = param2;\n var request = pending.current.get(nativeEvent.requestId);\n if (!request) return;\n pending.current.delete(nativeEvent.requestId);\n if (nativeEvent.error) {\n request.reject(nativeError(nativeEvent.error));\n return;\n }\n request.resolve({\n uri: nativeEvent.uri,\n width: nativeEvent.width,\n height: nativeEvent.height,\n format: \"jpg\",\n ...request.base64 ? {\n base64: nativeEvent.base64\n } : {}\n });\n }\n });\n});\nexport {\n CameraView\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":"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"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o = require("react-native/Libraries/NativeComponent/NativeComponentRegistry");
|
|
2
2
|
const {
|
|
3
|
-
ConditionallyIgnoredEventHandlers:
|
|
3
|
+
ConditionallyIgnoredEventHandlers: i
|
|
4
4
|
} = require("react-native/Libraries/NativeComponent/ViewConfigIgnore");
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const {
|
|
6
|
+
dispatchCommand: n
|
|
7
|
+
} = require("react-native/Libraries/ReactNative/RendererProxy");
|
|
8
|
+
let s = "OneNativeCamera";
|
|
9
|
+
const m = {
|
|
7
10
|
uiViewClassName: "OneNativeCamera",
|
|
8
11
|
directEventTypes: {
|
|
9
12
|
topNativeCameraState: {
|
|
@@ -11,21 +14,34 @@ const r = {
|
|
|
11
14
|
},
|
|
12
15
|
topNativeCameraCode: {
|
|
13
16
|
registrationName: "onNativeCameraCode"
|
|
17
|
+
},
|
|
18
|
+
topNativeCameraPicture: {
|
|
19
|
+
registrationName: "onNativeCameraPicture"
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
22
|
validAttributes: {
|
|
17
23
|
active: true,
|
|
18
24
|
facing: true,
|
|
19
25
|
codeTypes: true,
|
|
20
|
-
|
|
26
|
+
flash: true,
|
|
27
|
+
enableTorch: true,
|
|
28
|
+
zoom: true,
|
|
29
|
+
...i({
|
|
21
30
|
onNativeCameraState: true,
|
|
22
|
-
onNativeCameraCode: true
|
|
31
|
+
onNativeCameraCode: true,
|
|
32
|
+
onNativeCameraPicture: true
|
|
23
33
|
})
|
|
24
34
|
}
|
|
25
35
|
};
|
|
26
|
-
var
|
|
36
|
+
var p = o.get(s, () => m);
|
|
37
|
+
const u = {
|
|
38
|
+
takePicture(e, t, a, r) {
|
|
39
|
+
n(e, "takePicture", [t, a, r]);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
27
42
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
u as Commands,
|
|
44
|
+
m as __INTERNAL_VIEW_CONFIG,
|
|
45
|
+
p as default
|
|
30
46
|
};
|
|
31
47
|
//# sourceMappingURL=OneNativeCameraNativeComponent.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/platform/specs/OneNativeCameraNativeComponent.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ViewProps } from 'react-native';\nimport type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';\nimport codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\ninterface NativeProps extends ViewProps {\n active: boolean;\n facing: string;\n codeTypes: ReadonlyArray<string>;\n onNativeCameraState?: DirectEventHandler<Readonly<{\n state: string;\n }>>;\n onNativeCameraCode?: DirectEventHandler<Readonly<{\n type: string;\n data: string;\n }>>;\n}\nconst NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\nconst {\n ConditionallyIgnoredEventHandlers\n} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');\nlet nativeComponentName = 'OneNativeCamera';\nexport const __INTERNAL_VIEW_CONFIG = {\n uiViewClassName: \"OneNativeCamera\",\n directEventTypes: {\n topNativeCameraState: {\n registrationName: \"onNativeCameraState\"\n },\n topNativeCameraCode: {\n registrationName: \"onNativeCameraCode\"\n }\n },\n validAttributes: {\n active: true,\n facing: true,\n codeTypes: true,\n ...ConditionallyIgnoredEventHandlers({\n onNativeCameraState: true,\n onNativeCameraCode: true\n })\n }\n};\nexport default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["NativeComponentRegistry", "ConditionallyIgnoredEventHandlers", "nativeComponentName", "__INTERNAL_VIEW_CONFIG", "OneNativeCameraNativeComponent_default"]
|
|
4
|
+
"sourcesContent": ["import type { HostComponent, ViewProps } from 'react-native';\nimport type { DirectEventHandler, Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';\nimport codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';\nimport codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type * as React from 'react';\ninterface NativeProps extends ViewProps {\n active: boolean;\n facing: string;\n codeTypes: ReadonlyArray<string>;\n flash: string;\n enableTorch: boolean;\n zoom: Double;\n onNativeCameraState?: DirectEventHandler<Readonly<{\n state: string;\n }>>;\n onNativeCameraCode?: DirectEventHandler<Readonly<{\n type: string;\n data: string;\n }>>;\n // error is empty on success, otherwise \"<code>: <message>\".\n onNativeCameraPicture?: DirectEventHandler<Readonly<{\n requestId: Int32;\n uri: string;\n width: Int32;\n height: Int32;\n base64: string;\n error: string;\n }>>;\n}\ninterface NativeCommands {\n takePicture(viewRef: React.ElementRef<HostComponent<NativeProps>>, requestId: Int32, quality: Double, base64: boolean): void;\n}\nconst NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\nconst {\n ConditionallyIgnoredEventHandlers\n} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');\nconst {\n dispatchCommand\n} = require(\"react-native/Libraries/ReactNative/RendererProxy\");\nlet nativeComponentName = 'OneNativeCamera';\nexport const __INTERNAL_VIEW_CONFIG = {\n uiViewClassName: \"OneNativeCamera\",\n directEventTypes: {\n topNativeCameraState: {\n registrationName: \"onNativeCameraState\"\n },\n topNativeCameraCode: {\n registrationName: \"onNativeCameraCode\"\n },\n topNativeCameraPicture: {\n registrationName: \"onNativeCameraPicture\"\n }\n },\n validAttributes: {\n active: true,\n facing: true,\n codeTypes: true,\n flash: true,\n enableTorch: true,\n zoom: true,\n ...ConditionallyIgnoredEventHandlers({\n onNativeCameraState: true,\n onNativeCameraCode: true,\n onNativeCameraPicture: true\n })\n }\n};\nexport default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);\nexport const Commands = {\n takePicture(ref, requestId, quality, base64) {\n dispatchCommand(ref, \"takePicture\", [requestId, quality, base64]);\n }\n};"],
|
|
5
|
+
"mappings": "AAgCA,MAAMA,IAA0B,QAAQ,gEAAgE;AACxG,MAAM;AAAA,EACJ,mCAAAC;AACF,IAAI,QAAQ,yDAAyD;AACrE,MAAM;AAAA,EACJ,iBAAAC;AACF,IAAI,QAAQ,kDAAkD;AAC9D,IAAIC,IAAsB;AACnB,MAAMC,IAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,IAChB,sBAAsB;AAAA,MACpB,kBAAkB;AAAA,IACpB;AAAA,IACA,qBAAqB;AAAA,MACnB,kBAAkB;AAAA,IACpB;AAAA,IACA,wBAAwB;AAAA,MACtB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,GAAGH,EAAkC;AAAA,MACnC,qBAAqB;AAAA,MACrB,oBAAoB;AAAA,MACpB,uBAAuB;AAAA,IACzB,CAAC;AAAA,EACH;AACF;AACA,IAAOI,IAAQL,EAAwB,IAAIG,GAAqB,MAAMC,CAAsB;AACrF,MAAME,IAAW;AAAA,EACtB,YAAYC,GAAKC,GAAWC,GAASC,GAAQ;AAC3C,IAAAR,EAAgBK,GAAK,eAAe,CAACC,GAAWC,GAASC,CAAM,CAAC;AAAA,EAClE;AACF;",
|
|
6
|
+
"names": ["NativeComponentRegistry", "ConditionallyIgnoredEventHandlers", "dispatchCommand", "nativeComponentName", "__INTERNAL_VIEW_CONFIG", "OneNativeCameraNativeComponent_default", "Commands", "ref", "requestId", "quality", "base64"]
|
|
7
7
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o = require("react-native/Libraries/NativeComponent/NativeComponentRegistry");
|
|
2
2
|
const {
|
|
3
|
-
ConditionallyIgnoredEventHandlers:
|
|
3
|
+
ConditionallyIgnoredEventHandlers: i
|
|
4
4
|
} = require("react-native/Libraries/NativeComponent/ViewConfigIgnore");
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const {
|
|
6
|
+
dispatchCommand: n
|
|
7
|
+
} = require("react-native/Libraries/ReactNative/RendererProxy");
|
|
8
|
+
let s = "OneNativeCamera";
|
|
9
|
+
const m = {
|
|
7
10
|
uiViewClassName: "OneNativeCamera",
|
|
8
11
|
directEventTypes: {
|
|
9
12
|
topNativeCameraState: {
|
|
@@ -11,21 +14,34 @@ const r = {
|
|
|
11
14
|
},
|
|
12
15
|
topNativeCameraCode: {
|
|
13
16
|
registrationName: "onNativeCameraCode"
|
|
17
|
+
},
|
|
18
|
+
topNativeCameraPicture: {
|
|
19
|
+
registrationName: "onNativeCameraPicture"
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
22
|
validAttributes: {
|
|
17
23
|
active: true,
|
|
18
24
|
facing: true,
|
|
19
25
|
codeTypes: true,
|
|
20
|
-
|
|
26
|
+
flash: true,
|
|
27
|
+
enableTorch: true,
|
|
28
|
+
zoom: true,
|
|
29
|
+
...i({
|
|
21
30
|
onNativeCameraState: true,
|
|
22
|
-
onNativeCameraCode: true
|
|
31
|
+
onNativeCameraCode: true,
|
|
32
|
+
onNativeCameraPicture: true
|
|
23
33
|
})
|
|
24
34
|
}
|
|
25
35
|
};
|
|
26
|
-
var
|
|
36
|
+
var p = o.get(s, () => m);
|
|
37
|
+
const u = {
|
|
38
|
+
takePicture(e, t, a, r) {
|
|
39
|
+
n(e, "takePicture", [t, a, r]);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
27
42
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
u as Commands,
|
|
44
|
+
m as __INTERNAL_VIEW_CONFIG,
|
|
45
|
+
p as default
|
|
30
46
|
};
|
|
31
47
|
//# sourceMappingURL=OneNativeCameraNativeComponent.native.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/platform/specs/OneNativeCameraNativeComponent.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ViewProps } from 'react-native';\nimport type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';\nimport codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\ninterface NativeProps extends ViewProps {\n active: boolean;\n facing: string;\n codeTypes: ReadonlyArray<string>;\n onNativeCameraState?: DirectEventHandler<Readonly<{\n state: string;\n }>>;\n onNativeCameraCode?: DirectEventHandler<Readonly<{\n type: string;\n data: string;\n }>>;\n}\nconst NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\nconst {\n ConditionallyIgnoredEventHandlers\n} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');\nlet nativeComponentName = 'OneNativeCamera';\nexport const __INTERNAL_VIEW_CONFIG = {\n uiViewClassName: \"OneNativeCamera\",\n directEventTypes: {\n topNativeCameraState: {\n registrationName: \"onNativeCameraState\"\n },\n topNativeCameraCode: {\n registrationName: \"onNativeCameraCode\"\n }\n },\n validAttributes: {\n active: true,\n facing: true,\n codeTypes: true,\n ...ConditionallyIgnoredEventHandlers({\n onNativeCameraState: true,\n onNativeCameraCode: true\n })\n }\n};\nexport default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["NativeComponentRegistry", "ConditionallyIgnoredEventHandlers", "nativeComponentName", "__INTERNAL_VIEW_CONFIG", "OneNativeCameraNativeComponent_default"]
|
|
4
|
+
"sourcesContent": ["import type { HostComponent, ViewProps } from 'react-native';\nimport type { DirectEventHandler, Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';\nimport codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';\nimport codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type * as React from 'react';\ninterface NativeProps extends ViewProps {\n active: boolean;\n facing: string;\n codeTypes: ReadonlyArray<string>;\n flash: string;\n enableTorch: boolean;\n zoom: Double;\n onNativeCameraState?: DirectEventHandler<Readonly<{\n state: string;\n }>>;\n onNativeCameraCode?: DirectEventHandler<Readonly<{\n type: string;\n data: string;\n }>>;\n // error is empty on success, otherwise \"<code>: <message>\".\n onNativeCameraPicture?: DirectEventHandler<Readonly<{\n requestId: Int32;\n uri: string;\n width: Int32;\n height: Int32;\n base64: string;\n error: string;\n }>>;\n}\ninterface NativeCommands {\n takePicture(viewRef: React.ElementRef<HostComponent<NativeProps>>, requestId: Int32, quality: Double, base64: boolean): void;\n}\nconst NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\nconst {\n ConditionallyIgnoredEventHandlers\n} = require('react-native/Libraries/NativeComponent/ViewConfigIgnore');\nconst {\n dispatchCommand\n} = require(\"react-native/Libraries/ReactNative/RendererProxy\");\nlet nativeComponentName = 'OneNativeCamera';\nexport const __INTERNAL_VIEW_CONFIG = {\n uiViewClassName: \"OneNativeCamera\",\n directEventTypes: {\n topNativeCameraState: {\n registrationName: \"onNativeCameraState\"\n },\n topNativeCameraCode: {\n registrationName: \"onNativeCameraCode\"\n },\n topNativeCameraPicture: {\n registrationName: \"onNativeCameraPicture\"\n }\n },\n validAttributes: {\n active: true,\n facing: true,\n codeTypes: true,\n flash: true,\n enableTorch: true,\n zoom: true,\n ...ConditionallyIgnoredEventHandlers({\n onNativeCameraState: true,\n onNativeCameraCode: true,\n onNativeCameraPicture: true\n })\n }\n};\nexport default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);\nexport const Commands = {\n takePicture(ref, requestId, quality, base64) {\n dispatchCommand(ref, \"takePicture\", [requestId, quality, base64]);\n }\n};"],
|
|
5
|
+
"mappings": "AAgCA,MAAMA,IAA0B,QAAQ,gEAAgE;AACxG,MAAM;AAAA,EACJ,mCAAAC;AACF,IAAI,QAAQ,yDAAyD;AACrE,MAAM;AAAA,EACJ,iBAAAC;AACF,IAAI,QAAQ,kDAAkD;AAC9D,IAAIC,IAAsB;AACnB,MAAMC,IAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,IAChB,sBAAsB;AAAA,MACpB,kBAAkB;AAAA,IACpB;AAAA,IACA,qBAAqB;AAAA,MACnB,kBAAkB;AAAA,IACpB;AAAA,IACA,wBAAwB;AAAA,MACtB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,GAAGH,EAAkC;AAAA,MACnC,qBAAqB;AAAA,MACrB,oBAAoB;AAAA,MACpB,uBAAuB;AAAA,IACzB,CAAC;AAAA,EACH;AACF;AACA,IAAOI,IAAQL,EAAwB,IAAIG,GAAqB,MAAMC,CAAsB;AACrF,MAAME,IAAW;AAAA,EACtB,YAAYC,GAAKC,GAAWC,GAASC,GAAQ;AAC3C,IAAAR,EAAgBK,GAAK,eAAe,CAACC,GAAWC,GAASC,CAAM,CAAC;AAAA,EAClE;AACF;",
|
|
6
|
+
"names": ["NativeComponentRegistry", "ConditionallyIgnoredEventHandlers", "dispatchCommand", "nativeComponentName", "__INTERNAL_VIEW_CONFIG", "OneNativeCameraNativeComponent_default", "Commands", "ref", "requestId", "quality", "base64"]
|
|
7
7
|
}
|