scandit-react-native-datacapture-core 6.21.2 → 6.22.0-beta.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/android/build.gradle +1 -2
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ScanditDataCaptureCoreModule.kt +45 -0
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ui/DataCaptureViewManager.kt +3 -1
- package/dist/core.js +191 -50
- package/dist/core.js.map +1 -1
- package/dist/dts/DataCaptureView.d.ts +3 -2
- package/dist/dts/native/CameraProxy.d.ts +1 -1
- package/dist/dts/native/DataCaptureContextProxy.d.ts +7 -4
- package/dist/dts/native/DataCaptureViewProxy.d.ts +8 -0
- package/dist/dts/native/ImageFrameSourceProxy.d.ts +1 -2
- package/dist/index.js +52 -14
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ios/Sources/ScanditDataCaptureCore.m +43 -0
- package/ios/Sources/ScanditDataCaptureCore.swift +68 -8
- package/ios/Sources/ScanditDataCaptureViewManager.swift +5 -5
- package/package.json +3 -3
- package/scandit-react-native-datacapture-core.podspec +3 -2
- package/scripts/detect_frameworks.rb +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Control, FocusGesture, LogoStyle, MarginsWithUnit, Point, PointWithUnit, Quadrilateral, Size, ZoomGesture } from 'scandit-datacapture-frameworks-core';
|
|
2
|
+
import { Control, FocusGesture, LogoStyle, MarginsWithUnit, Point, PointWithUnit, Quadrilateral, Size, ZoomGesture, Serializeable } from 'scandit-datacapture-frameworks-core';
|
|
3
3
|
import { Anchor, Orientation } from 'scandit-datacapture-frameworks-core';
|
|
4
4
|
import { DataCaptureContext } from 'scandit-datacapture-frameworks-core';
|
|
5
|
-
export interface DataCaptureOverlay {
|
|
5
|
+
export interface DataCaptureOverlay extends Serializeable {
|
|
6
6
|
}
|
|
7
7
|
export interface DataCaptureViewListener {
|
|
8
8
|
didChangeSize?(view: DataCaptureView, size: Size, orientation: Orientation): void;
|
|
@@ -35,6 +35,7 @@ export declare class DataCaptureView extends React.Component<DataCaptureViewProp
|
|
|
35
35
|
viewPointForFramePoint(point: Point): Promise<Point>;
|
|
36
36
|
viewQuadrilateralForFrameQuadrilateral(quadrilateral: Quadrilateral): Promise<Quadrilateral>;
|
|
37
37
|
addControl(control: Control): void;
|
|
38
|
+
addControlWithAnchorAndOffset(control: Control, anchor: Anchor, offset: PointWithUnit): void;
|
|
38
39
|
removeControl(control: Control): void;
|
|
39
40
|
componentWillUnmount(): void;
|
|
40
41
|
render(): React.JSX.Element;
|
|
@@ -7,8 +7,8 @@ export declare class NativeCameraProxy implements CameraProxy {
|
|
|
7
7
|
getLastFrameOrNull(): Promise<string | null>;
|
|
8
8
|
getCurrentCameraState(position: CameraPosition): Promise<FrameSourceState>;
|
|
9
9
|
isTorchAvailable(position: CameraPosition): Promise<boolean>;
|
|
10
|
+
switchCameraToDesiredState(desiredStateJson: string): Promise<void>;
|
|
10
11
|
registerListenerForCameraEvents(): void;
|
|
11
12
|
unregisterListenerForCameraEvents(): void;
|
|
12
|
-
unsubscribeDidChangeState(): void;
|
|
13
13
|
subscribeDidChangeState(): void;
|
|
14
14
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { DataCaptureContext, DataCaptureContextProxy } from 'scandit-datacapture-frameworks-core';
|
|
2
|
-
export declare class NativeDataCaptureContextProxy implements DataCaptureContextProxy {
|
|
3
|
-
private eventEmitter;
|
|
1
|
+
import { BaseNativeProxy, DataCaptureContext, DataCaptureContextProxy } from 'scandit-datacapture-frameworks-core';
|
|
2
|
+
export declare class NativeDataCaptureContextProxy extends BaseNativeProxy implements DataCaptureContextProxy {
|
|
4
3
|
private nativeListeners;
|
|
5
|
-
|
|
4
|
+
get framework(): string;
|
|
5
|
+
get frameworkVersion(): string;
|
|
6
6
|
contextFromJSON(context: DataCaptureContext): Promise<void>;
|
|
7
7
|
updateContextFromJSON(context: DataCaptureContext): Promise<void>;
|
|
8
|
+
addModeToContext(modeJson: string): Promise<void>;
|
|
9
|
+
removeModeFromContext(modeJson: string): Promise<void>;
|
|
10
|
+
removeAllModesFromContext(): Promise<void>;
|
|
8
11
|
dispose(): void;
|
|
9
12
|
registerListenerForEvents(): void;
|
|
10
13
|
unsubscribeListener(): void;
|
|
@@ -2,6 +2,14 @@ import { DataCaptureViewProxy, BaseNativeProxy } from 'scandit-datacapture-frame
|
|
|
2
2
|
export declare class NativeDataCaptureViewProxy extends BaseNativeProxy implements DataCaptureViewProxy {
|
|
3
3
|
private nativeListeners;
|
|
4
4
|
constructor();
|
|
5
|
+
addOverlay(overlayJson: string): Promise<void>;
|
|
6
|
+
removeOverlay(overlayJson: string): Promise<void>;
|
|
7
|
+
removeAllOverlays(): Promise<void>;
|
|
8
|
+
createView(viewJson: string): Promise<void>;
|
|
9
|
+
updateView(viewJson: string): Promise<void>;
|
|
10
|
+
addOverlayToDCView(overlayJson: string): Promise<void>;
|
|
11
|
+
removeOverlayFromDCView(overlayJson: string): Promise<void>;
|
|
12
|
+
removeAllOverlaysFromDCView(): Promise<void>;
|
|
5
13
|
viewPointForFramePoint(pointJson: string): Promise<string>;
|
|
6
14
|
viewQuadrilateralForFrameQuadrilateral(quadrilateralJson: string): Promise<string>;
|
|
7
15
|
registerListenerForViewEvents(): void;
|
|
@@ -4,9 +4,8 @@ export declare class NativeImageFrameSourceProxy implements ImageFrameSourceProx
|
|
|
4
4
|
private nativeListeners;
|
|
5
5
|
constructor();
|
|
6
6
|
getCurrentCameraState(position: CameraPosition): Promise<FrameSourceState>;
|
|
7
|
-
|
|
7
|
+
switchCameraToDesiredState(desiredStateJson: string): Promise<void>;
|
|
8
8
|
registerListenerForEvents(): void;
|
|
9
9
|
unregisterListenerForEvents(): void;
|
|
10
|
-
unsubscribeDidChangeState(): void;
|
|
11
10
|
subscribeDidChangeState(): void;
|
|
12
11
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FactoryMaker,
|
|
1
|
+
import { FactoryMaker, FrameSourceListenerEvents, BaseNativeProxy, ContextStatus, DataCaptureContextEvents, DataCaptureViewEvents, loadCoreDefaults, BaseDataCaptureView } from './core.js';
|
|
2
2
|
export { AimerViewfinder, Anchor, Brush, Camera, CameraPosition, CameraSettings, Color, DataCaptureContext, DataCaptureContextSettings, Direction, Expiration, Feedback, FocusGestureStrategy, FocusRange, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LaserlineViewfinderStyle, LicenseInfo, LogoStyle, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, Orientation, Point, PointWithUnit, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SpotlightViewfinder, SwipeToZoom, TapToFocus, TorchState, TorchSwitchControl, Vibration, VideoResolution, WaveFormVibration, ZoomSwitchControl } from './core.js';
|
|
3
|
-
import { NativeModules, NativeEventEmitter, requireNativeComponent } from 'react-native';
|
|
3
|
+
import { NativeModules, NativeEventEmitter, Platform, requireNativeComponent } from 'react-native';
|
|
4
4
|
|
|
5
5
|
// tslint:disable-next-line:variable-name
|
|
6
6
|
const NativeModule$6 = NativeModules.ScanditDataCaptureCore;
|
|
@@ -27,23 +27,21 @@ class NativeImageFrameSourceProxy {
|
|
|
27
27
|
getCurrentCameraState(position) {
|
|
28
28
|
return NativeModule$5.getCurrentCameraState(position);
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
NativeModule$5.
|
|
30
|
+
switchCameraToDesiredState(desiredStateJson) {
|
|
31
|
+
return NativeModule$5.switchCameraToDesiredState(desiredStateJson);
|
|
32
32
|
}
|
|
33
33
|
registerListenerForEvents() {
|
|
34
34
|
NativeModule$5.registerListenerForCameraEvents();
|
|
35
35
|
}
|
|
36
36
|
unregisterListenerForEvents() {
|
|
37
37
|
NativeModule$5.unregisterListenerForCameraEvents();
|
|
38
|
-
}
|
|
39
|
-
unsubscribeDidChangeState() {
|
|
40
38
|
this.nativeListeners.forEach(listener => listener.remove());
|
|
41
39
|
this.nativeListeners = [];
|
|
42
40
|
}
|
|
43
41
|
subscribeDidChangeState() {
|
|
44
42
|
const didChangeState = RNEventEmitter$3.addListener(FrameSourceListenerName$1.didChangeState, (body) => {
|
|
45
43
|
const payload = JSON.parse(body);
|
|
46
|
-
this.eventEmitter.emit(
|
|
44
|
+
this.eventEmitter.emit(FrameSourceListenerEvents.didChangeState, payload);
|
|
47
45
|
});
|
|
48
46
|
this.nativeListeners.push(didChangeState);
|
|
49
47
|
}
|
|
@@ -58,11 +56,14 @@ var DataCaptureContextListenerName;
|
|
|
58
56
|
DataCaptureContextListenerName["didChangeStatus"] = "DataCaptureContextListener.onStatusChanged";
|
|
59
57
|
DataCaptureContextListenerName["didStartObservingContext"] = "DataCaptureContextListener.onObservationStarted";
|
|
60
58
|
})(DataCaptureContextListenerName || (DataCaptureContextListenerName = {}));
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const { major, minor, patch } = Platform.constants?.reactNativeVersion;
|
|
60
|
+
class NativeDataCaptureContextProxy extends BaseNativeProxy {
|
|
63
61
|
nativeListeners = [];
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
get framework() {
|
|
63
|
+
return 'react-native';
|
|
64
|
+
}
|
|
65
|
+
get frameworkVersion() {
|
|
66
|
+
return `${major}.${minor}.${patch}`;
|
|
66
67
|
}
|
|
67
68
|
contextFromJSON(context) {
|
|
68
69
|
return NativeModule$4.contextFromJSON(JSON.stringify(context.toJSON()));
|
|
@@ -70,6 +71,15 @@ class NativeDataCaptureContextProxy {
|
|
|
70
71
|
updateContextFromJSON(context) {
|
|
71
72
|
return NativeModule$4.updateContextFromJSON(JSON.stringify(context.toJSON()));
|
|
72
73
|
}
|
|
74
|
+
addModeToContext(modeJson) {
|
|
75
|
+
return NativeModule$4.addModeToContext(modeJson);
|
|
76
|
+
}
|
|
77
|
+
removeModeFromContext(modeJson) {
|
|
78
|
+
return NativeModule$4.removeModeFromContext(modeJson);
|
|
79
|
+
}
|
|
80
|
+
removeAllModesFromContext() {
|
|
81
|
+
return NativeModule$4.removeAllModesFromContext();
|
|
82
|
+
}
|
|
73
83
|
dispose() {
|
|
74
84
|
return NativeModule$4.dispose();
|
|
75
85
|
}
|
|
@@ -110,6 +120,30 @@ class NativeDataCaptureViewProxy extends BaseNativeProxy {
|
|
|
110
120
|
constructor() {
|
|
111
121
|
super();
|
|
112
122
|
}
|
|
123
|
+
addOverlay(overlayJson) {
|
|
124
|
+
return NativeModule$3.addOverlay(overlayJson);
|
|
125
|
+
}
|
|
126
|
+
removeOverlay(overlayJson) {
|
|
127
|
+
return NativeModule$3.removeOverlay(overlayJson);
|
|
128
|
+
}
|
|
129
|
+
removeAllOverlays() {
|
|
130
|
+
return NativeModule$3.removeAllOverlays();
|
|
131
|
+
}
|
|
132
|
+
createView(viewJson) {
|
|
133
|
+
return NativeModule$3.createDataCaptureView(viewJson);
|
|
134
|
+
}
|
|
135
|
+
updateView(viewJson) {
|
|
136
|
+
return NativeModule$3.updateDataCaptureView(viewJson);
|
|
137
|
+
}
|
|
138
|
+
addOverlayToDCView(overlayJson) {
|
|
139
|
+
return NativeModule$3.addOverlayToView(overlayJson);
|
|
140
|
+
}
|
|
141
|
+
removeOverlayFromDCView(overlayJson) {
|
|
142
|
+
return NativeModule$3.removeOverlayFromView(overlayJson);
|
|
143
|
+
}
|
|
144
|
+
removeAllOverlaysFromDCView() {
|
|
145
|
+
return NativeModule$3.removeAllOverlays();
|
|
146
|
+
}
|
|
113
147
|
viewPointForFramePoint(pointJson) {
|
|
114
148
|
return NativeModule$3.viewPointForFramePoint(pointJson);
|
|
115
149
|
}
|
|
@@ -169,13 +203,14 @@ class NativeCameraProxy {
|
|
|
169
203
|
isTorchAvailable(position) {
|
|
170
204
|
return NativeModule$2.isTorchAvailable(position);
|
|
171
205
|
}
|
|
206
|
+
switchCameraToDesiredState(desiredStateJson) {
|
|
207
|
+
return NativeModule$2.switchCameraToDesiredState(desiredStateJson);
|
|
208
|
+
}
|
|
172
209
|
registerListenerForCameraEvents() {
|
|
173
210
|
NativeModule$2.registerListenerForCameraEvents();
|
|
174
211
|
}
|
|
175
212
|
unregisterListenerForCameraEvents() {
|
|
176
213
|
NativeModule$2.unregisterListenerForCameraEvents();
|
|
177
|
-
}
|
|
178
|
-
unsubscribeDidChangeState() {
|
|
179
214
|
this.nativeListeners.forEach(listener => listener.remove());
|
|
180
215
|
this.nativeListeners = [];
|
|
181
216
|
}
|
|
@@ -207,7 +242,7 @@ function initCoreDefaults() {
|
|
|
207
242
|
const NativeModule = NativeModules.ScanditDataCaptureCore;
|
|
208
243
|
class DataCaptureVersion {
|
|
209
244
|
static get pluginVersion() {
|
|
210
|
-
return '6.
|
|
245
|
+
return '6.22.0-beta.2';
|
|
211
246
|
}
|
|
212
247
|
static get sdkVersion() {
|
|
213
248
|
return NativeModule.Version;
|
|
@@ -3103,6 +3138,9 @@ class DataCaptureView extends React.Component {
|
|
|
3103
3138
|
addControl(control) {
|
|
3104
3139
|
return this.view.addControl(control);
|
|
3105
3140
|
}
|
|
3141
|
+
addControlWithAnchorAndOffset(control, anchor, offset) {
|
|
3142
|
+
return this.view.addControlWithAnchorAndOffset(control, anchor, offset);
|
|
3143
|
+
}
|
|
3106
3144
|
removeControl(control) {
|
|
3107
3145
|
return this.view.removeControl(control);
|
|
3108
3146
|
}
|