scandit-capacitor-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/ScanditCapacitorDatacaptureCore.podspec +10 -10
- package/android/build.gradle +1 -2
- package/android/src/main/java/com/scandit/capacitor/datacapture/core/ScanditCaptureCoreNative.kt +64 -1
- package/android/src/main/java/com/scandit/capacitor/datacapture/core/handlers/DataCaptureViewHandler.kt +1 -1
- package/android/src/main/java/com/scandit/capacitor/datacapture/core/utils/CapacitorResult.kt +10 -0
- package/dist/core.js +191 -50
- package/dist/core.js.map +1 -1
- package/dist/dts/ts/Capacitor/CameraProxy.d.ts +1 -1
- package/dist/dts/ts/Capacitor/Capacitor.d.ts +10 -1
- package/dist/dts/ts/Capacitor/DataCaptureContextProxy.d.ts +7 -4
- package/dist/dts/ts/Capacitor/DataCaptureViewProxy.d.ts +5 -0
- package/dist/dts/ts/Capacitor/ImageFrameSourceProxy.d.ts +1 -1
- package/dist/dts/ts/DataCaptureView.d.ts +1 -0
- package/dist/index.js +69 -13
- package/dist/index.js.map +1 -1
- package/ios/Plugin/CDVPluginResult+Extensions.swift +5 -0
- package/ios/Plugin/Plugin.m +10 -1
- package/ios/Plugin/ScanditCaptureCore.swift +76 -8
- package/package.json +2 -2
- package/scripts/detect_frameworks.rb +1 -1
|
@@ -4,17 +4,17 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
4
4
|
version = package["version"]
|
|
5
5
|
|
|
6
6
|
Pod::Spec.new do |s|
|
|
7
|
-
s.name
|
|
8
|
-
s.version
|
|
9
|
-
s.summary
|
|
10
|
-
s.license
|
|
11
|
-
s.homepage
|
|
12
|
-
s.author
|
|
13
|
-
s.source
|
|
14
|
-
s.source_files
|
|
7
|
+
s.name = "ScanditCapacitorDatacaptureCore"
|
|
8
|
+
s.version = version
|
|
9
|
+
s.summary = package["description"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.homepage = package["homepage"]
|
|
12
|
+
s.author = package["author"]
|
|
13
|
+
s.source = { :git => package["homepage"], :tag => s.version.to_s }
|
|
14
|
+
s.source_files = "ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}"
|
|
15
15
|
s.ios.deployment_target = "13.0"
|
|
16
|
-
s.swift_version
|
|
16
|
+
s.swift_version = "5.7"
|
|
17
17
|
|
|
18
18
|
s.dependency "Capacitor"
|
|
19
|
-
s.dependency "scandit-datacapture-frameworks-core", '= 6.
|
|
19
|
+
s.dependency "scandit-datacapture-frameworks-core", '= 6.22.0-beta.2'
|
|
20
20
|
end
|
package/android/build.gradle
CHANGED
|
@@ -56,7 +56,7 @@ repositories {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
dependencies {
|
|
59
|
-
def sdk_version = "6.
|
|
59
|
+
def sdk_version = "6.22.0-beta.2"
|
|
60
60
|
|
|
61
61
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
62
62
|
|
|
@@ -68,7 +68,6 @@ dependencies {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
implementation project(':capacitor-android')
|
|
71
|
-
implementation "com.squareup.okhttp3:okhttp:4.9.2"
|
|
72
71
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
73
72
|
implementation "androidx.core:core-ktx:$androidxCoreVersion"
|
|
74
73
|
}
|
package/android/src/main/java/com/scandit/capacitor/datacapture/core/ScanditCaptureCoreNative.kt
CHANGED
|
@@ -114,8 +114,13 @@ class ScanditCaptureCoreNative :
|
|
|
114
114
|
coreModule.onDestroy()
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
override fun onDataCaptureViewDeserialized(dataCaptureView: DataCaptureView)
|
|
117
|
+
override fun onDataCaptureViewDeserialized(dataCaptureView: DataCaptureView?) {
|
|
118
|
+
if (dataCaptureView == null) {
|
|
119
|
+
captureViewHandler.disposeCurrentDataCaptureView()
|
|
120
|
+
return
|
|
121
|
+
}
|
|
118
122
|
captureViewHandler.attachDataCaptureView(dataCaptureView, this.activity)
|
|
123
|
+
}
|
|
119
124
|
|
|
120
125
|
private fun checkCameraPermission(): Boolean =
|
|
121
126
|
getPermissionState("camera") == PermissionState.GRANTED
|
|
@@ -181,6 +186,12 @@ class ScanditCaptureCoreNative :
|
|
|
181
186
|
coreModule.unregisterFrameSourceListener()
|
|
182
187
|
call.resolve()
|
|
183
188
|
}
|
|
189
|
+
|
|
190
|
+
@PluginMethod
|
|
191
|
+
fun switchCameraToDesiredState(call: PluginCall) {
|
|
192
|
+
val desiredStateJson = call.data.getString("desiredState") ?: return
|
|
193
|
+
coreModule.switchCameraToDesiredState(desiredStateJson, CapacitorResult(call))
|
|
194
|
+
}
|
|
184
195
|
//endregion
|
|
185
196
|
|
|
186
197
|
//region DataCaptureContextProxy
|
|
@@ -321,6 +332,58 @@ class ScanditCaptureCoreNative :
|
|
|
321
332
|
|
|
322
333
|
//endregion
|
|
323
334
|
|
|
335
|
+
@PluginMethod
|
|
336
|
+
fun addModeToContext(call: PluginCall) {
|
|
337
|
+
val modeJson = call.data.getString("modeJson")
|
|
338
|
+
?: return call.reject(EMPTY_STRING_ERROR)
|
|
339
|
+
coreModule.addModeToContext(modeJson, CapacitorResult(call))
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
@PluginMethod
|
|
343
|
+
fun removeModeFromContext(call: PluginCall) {
|
|
344
|
+
val modeJson = call.data.getString("modeJson")
|
|
345
|
+
?: return call.reject(EMPTY_STRING_ERROR)
|
|
346
|
+
coreModule.removeModeFromContext(modeJson, CapacitorResult(call))
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
@PluginMethod
|
|
350
|
+
fun removeAllModesFromContext(call: PluginCall) {
|
|
351
|
+
coreModule.removeAllModes(CapacitorResult(call))
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
@PluginMethod
|
|
355
|
+
fun createDataCaptureView(call: PluginCall) {
|
|
356
|
+
val viewJson = call.data.getString("viewJson")
|
|
357
|
+
?: return call.reject(EMPTY_STRING_ERROR)
|
|
358
|
+
coreModule.createDataCaptureView(viewJson, CapacitorResult(call))
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
@PluginMethod
|
|
362
|
+
fun updateDataCaptureView(call: PluginCall) {
|
|
363
|
+
val viewJson = call.data.getString("viewJson")
|
|
364
|
+
?: return call.reject(EMPTY_STRING_ERROR)
|
|
365
|
+
coreModule.updateDataCaptureView(viewJson, CapacitorResult(call))
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
@PluginMethod
|
|
369
|
+
fun addOverlay(call: PluginCall) {
|
|
370
|
+
val overlayJson = call.data.getString("overlayJson")
|
|
371
|
+
?: return call.reject(EMPTY_STRING_ERROR)
|
|
372
|
+
coreModule.addOverlayToView(overlayJson, CapacitorResult(call))
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
@PluginMethod
|
|
376
|
+
fun removeOverlay(call: PluginCall) {
|
|
377
|
+
val overlayJson = call.data.getString("overlayJson")
|
|
378
|
+
?: return call.reject(EMPTY_STRING_ERROR)
|
|
379
|
+
coreModule.removeOverlayFromView(overlayJson, CapacitorResult(call))
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
@PluginMethod
|
|
383
|
+
fun removeAllOverlays(call: PluginCall) {
|
|
384
|
+
coreModule.removeAllOverlays(CapacitorResult(call))
|
|
385
|
+
}
|
|
386
|
+
|
|
324
387
|
override fun emit(eventName: String, payload: MutableMap<String, Any?>) {
|
|
325
388
|
payload["name"] = eventName
|
|
326
389
|
notifyListeners(eventName, JSObject.fromJSONObject(JSONObject(payload)))
|
|
@@ -68,7 +68,7 @@ class DataCaptureViewHandler(
|
|
|
68
68
|
disposeCurrentWebView()
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
fun disposeCurrentDataCaptureView() {
|
|
72
72
|
val dataCaptureView = dataCaptureViewReference.get() ?: return
|
|
73
73
|
removeDataCaptureView(dataCaptureView)
|
|
74
74
|
}
|
package/android/src/main/java/com/scandit/capacitor/datacapture/core/utils/CapacitorResult.kt
CHANGED
|
@@ -20,3 +20,13 @@ class CapacitorResult(private val call: PluginCall) : FrameworksResult {
|
|
|
20
20
|
call.reject(errorMessage, errorMessage)
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
class CapacitorNoopResult : FrameworksResult {
|
|
25
|
+
override fun success(result: Any?) {
|
|
26
|
+
// noop
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) {
|
|
30
|
+
// noop
|
|
31
|
+
}
|
|
32
|
+
}
|
package/dist/core.js
CHANGED
|
@@ -365,8 +365,10 @@ class FactoryMaker {
|
|
|
365
365
|
console.warn(`Trying to get a non existing instance for ${clsName}`);
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
if (!item.instance && item.builder) {
|
|
369
|
+
item.instance = (_a = item.builder) === null || _a === void 0 ? void 0 : _a.call(item);
|
|
370
|
+
}
|
|
371
|
+
return item.instance;
|
|
370
372
|
}
|
|
371
373
|
}
|
|
372
374
|
FactoryMaker.instances = new Map();
|
|
@@ -590,6 +592,9 @@ class ImageFrameSourceController {
|
|
|
590
592
|
getCurrentState() {
|
|
591
593
|
return this._proxy.getCurrentCameraState(this.imageFrameSource.position);
|
|
592
594
|
}
|
|
595
|
+
switchCameraToDesiredState(desiredStateJson) {
|
|
596
|
+
return this._proxy.switchCameraToDesiredState(desiredStateJson);
|
|
597
|
+
}
|
|
593
598
|
subscribeListener() {
|
|
594
599
|
this._proxy.registerListenerForEvents();
|
|
595
600
|
this._proxy.subscribeDidChangeState();
|
|
@@ -652,7 +657,7 @@ class ImageFrameSource extends DefaultSerializeable {
|
|
|
652
657
|
}
|
|
653
658
|
switchToDesiredState(state) {
|
|
654
659
|
this._desiredState = state;
|
|
655
|
-
return this.
|
|
660
|
+
return this.controller.switchCameraToDesiredState(state);
|
|
656
661
|
}
|
|
657
662
|
addListener(listener) {
|
|
658
663
|
if (listener == null) {
|
|
@@ -751,9 +756,13 @@ class CameraController {
|
|
|
751
756
|
getIsTorchAvailable() {
|
|
752
757
|
return CameraController._proxy.isTorchAvailable(this.privateCamera.position);
|
|
753
758
|
}
|
|
759
|
+
switchCameraToDesiredState(desiredState) {
|
|
760
|
+
return CameraController._proxy.switchCameraToDesiredState(desiredState);
|
|
761
|
+
}
|
|
754
762
|
subscribeListener() {
|
|
763
|
+
var _a, _b;
|
|
755
764
|
CameraController._proxy.registerListenerForCameraEvents();
|
|
756
|
-
CameraController._proxy.subscribeDidChangeState();
|
|
765
|
+
(_b = (_a = CameraController._proxy).subscribeDidChangeState) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
757
766
|
this.eventEmitter.on(FrameSourceListenerEvents.didChangeState, (state) => {
|
|
758
767
|
this.privateCamera.listeners.forEach(listener => {
|
|
759
768
|
var _a;
|
|
@@ -763,7 +772,6 @@ class CameraController {
|
|
|
763
772
|
}
|
|
764
773
|
unsubscribeListener() {
|
|
765
774
|
CameraController._proxy.unregisterListenerForCameraEvents();
|
|
766
|
-
CameraController._proxy.unsubscribeDidChangeState();
|
|
767
775
|
this.eventEmitter.off(FrameSourceListenerEvents.didChangeState);
|
|
768
776
|
}
|
|
769
777
|
}
|
|
@@ -827,7 +835,7 @@ class Camera extends DefaultSerializeable {
|
|
|
827
835
|
}
|
|
828
836
|
switchToDesiredState(state) {
|
|
829
837
|
this._desiredState = state;
|
|
830
|
-
return this.
|
|
838
|
+
return this.controller.switchCameraToDesiredState(state);
|
|
831
839
|
}
|
|
832
840
|
getCurrentState() {
|
|
833
841
|
return this.controller.getCurrentState();
|
|
@@ -835,6 +843,13 @@ class Camera extends DefaultSerializeable {
|
|
|
835
843
|
getIsTorchAvailable() {
|
|
836
844
|
return this.controller.getIsTorchAvailable();
|
|
837
845
|
}
|
|
846
|
+
/**
|
|
847
|
+
* @deprecated
|
|
848
|
+
*/
|
|
849
|
+
get isTorchAvailable() {
|
|
850
|
+
console.warn('isTorchAvailable is deprecated. Use getIsTorchAvailable instead.');
|
|
851
|
+
return false;
|
|
852
|
+
}
|
|
838
853
|
addListener(listener) {
|
|
839
854
|
if (listener == null) {
|
|
840
855
|
return;
|
|
@@ -878,7 +893,7 @@ __decorate([
|
|
|
878
893
|
nameForSerialization('desiredTorchState')
|
|
879
894
|
], Camera.prototype, "_desiredTorchState", void 0);
|
|
880
895
|
__decorate([
|
|
881
|
-
|
|
896
|
+
ignoreFromSerialization
|
|
882
897
|
], Camera.prototype, "_desiredState", void 0);
|
|
883
898
|
__decorate([
|
|
884
899
|
ignoreFromSerialization
|
|
@@ -902,6 +917,8 @@ class ZoomSwitchControl extends DefaultSerializeable {
|
|
|
902
917
|
zoomedIn: { default: null, pressed: null },
|
|
903
918
|
};
|
|
904
919
|
this.view = null;
|
|
920
|
+
this.anchor = null;
|
|
921
|
+
this.offset = null;
|
|
905
922
|
}
|
|
906
923
|
get zoomedOutImage() {
|
|
907
924
|
return this.icon.zoomedOut.default;
|
|
@@ -949,6 +966,8 @@ class TorchSwitchControl extends DefaultSerializeable {
|
|
|
949
966
|
off: { default: null, pressed: null },
|
|
950
967
|
};
|
|
951
968
|
this.view = null;
|
|
969
|
+
this.anchor = null;
|
|
970
|
+
this.offset = null;
|
|
952
971
|
}
|
|
953
972
|
get torchOffImage() {
|
|
954
973
|
return this.icon.off.default;
|
|
@@ -1947,6 +1966,12 @@ var DataCaptureContextEvents;
|
|
|
1947
1966
|
DataCaptureContextEvents["didStartObservingContext"] = "didStartObservingContext";
|
|
1948
1967
|
})(DataCaptureContextEvents || (DataCaptureContextEvents = {}));
|
|
1949
1968
|
class DataCaptureContextController {
|
|
1969
|
+
get framework() {
|
|
1970
|
+
return this._proxy.framework;
|
|
1971
|
+
}
|
|
1972
|
+
get frameworkVersion() {
|
|
1973
|
+
return this._proxy.frameworkVersion;
|
|
1974
|
+
}
|
|
1950
1975
|
get privateContext() {
|
|
1951
1976
|
return this.context;
|
|
1952
1977
|
}
|
|
@@ -1971,6 +1996,15 @@ class DataCaptureContextController {
|
|
|
1971
1996
|
}
|
|
1972
1997
|
});
|
|
1973
1998
|
}
|
|
1999
|
+
addModeToContext(mode) {
|
|
2000
|
+
return this._proxy.addModeToContext(JSON.stringify(mode.toJSON()));
|
|
2001
|
+
}
|
|
2002
|
+
removeModeFromContext(mode) {
|
|
2003
|
+
return this._proxy.removeModeFromContext(JSON.stringify(mode.toJSON()));
|
|
2004
|
+
}
|
|
2005
|
+
removeAllModesFromContext() {
|
|
2006
|
+
return this._proxy.removeAllModesFromContext();
|
|
2007
|
+
}
|
|
1974
2008
|
dispose() {
|
|
1975
2009
|
this.unsubscribeListener();
|
|
1976
2010
|
this._proxy.dispose();
|
|
@@ -1996,9 +2030,10 @@ class DataCaptureContextController {
|
|
|
1996
2030
|
});
|
|
1997
2031
|
}
|
|
1998
2032
|
subscribeListener() {
|
|
2033
|
+
var _a, _b, _c, _d;
|
|
1999
2034
|
this._proxy.registerListenerForEvents();
|
|
2000
|
-
this._proxy.subscribeDidChangeStatus();
|
|
2001
|
-
this._proxy.subscribeDidStartObservingContext();
|
|
2035
|
+
(_b = (_a = this._proxy).subscribeDidChangeStatus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
2036
|
+
(_d = (_c = this._proxy).subscribeDidStartObservingContext) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
2002
2037
|
this.eventEmitter.on(DataCaptureContextEvents.didChangeStatus, (contextStatus) => {
|
|
2003
2038
|
this.notifyListenersOfDidChangeStatus(contextStatus);
|
|
2004
2039
|
});
|
|
@@ -2028,6 +2063,12 @@ class DataCaptureContextController {
|
|
|
2028
2063
|
}
|
|
2029
2064
|
|
|
2030
2065
|
class DataCaptureContext extends DefaultSerializeable {
|
|
2066
|
+
get framework() {
|
|
2067
|
+
return this.controller.framework;
|
|
2068
|
+
}
|
|
2069
|
+
get frameworkVersion() {
|
|
2070
|
+
return this.controller.frameworkVersion;
|
|
2071
|
+
}
|
|
2031
2072
|
static get coreDefaults() {
|
|
2032
2073
|
return getCoreDefaults();
|
|
2033
2074
|
}
|
|
@@ -2037,6 +2078,13 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2037
2078
|
static get deviceID() {
|
|
2038
2079
|
return DataCaptureContext.coreDefaults.deviceID;
|
|
2039
2080
|
}
|
|
2081
|
+
/**
|
|
2082
|
+
* @deprecated
|
|
2083
|
+
*/
|
|
2084
|
+
get deviceID() {
|
|
2085
|
+
console.log('The instance property "deviceID" on the DataCaptureContext is deprecated, please use the static property DataCaptureContext.deviceID instead.');
|
|
2086
|
+
return DataCaptureContext.deviceID;
|
|
2087
|
+
}
|
|
2040
2088
|
static forLicenseKey(licenseKey) {
|
|
2041
2089
|
return DataCaptureContext.forLicenseKeyWithOptions(licenseKey, null);
|
|
2042
2090
|
}
|
|
@@ -2057,16 +2105,10 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2057
2105
|
super();
|
|
2058
2106
|
this.licenseKey = licenseKey;
|
|
2059
2107
|
this.deviceName = deviceName;
|
|
2060
|
-
// TODO Needs to be changed
|
|
2061
|
-
this.framework = 'capacitor';
|
|
2062
|
-
this.frameworkVersion = `TODO:CHANGE`;
|
|
2063
2108
|
this.settings = new DataCaptureContextSettings();
|
|
2064
2109
|
this._frameSource = null;
|
|
2065
|
-
// TODO: Change this
|
|
2066
|
-
// private view: PrivateDataCaptureView | null = null;
|
|
2067
2110
|
this.view = null;
|
|
2068
2111
|
this.modes = [];
|
|
2069
|
-
this.components = [];
|
|
2070
2112
|
this.listeners = [];
|
|
2071
2113
|
this.initialize();
|
|
2072
2114
|
}
|
|
@@ -2096,14 +2138,14 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2096
2138
|
if (!this.modes.includes(mode)) {
|
|
2097
2139
|
this.modes.push(mode);
|
|
2098
2140
|
mode._context = this;
|
|
2099
|
-
this.
|
|
2141
|
+
this.controller.addModeToContext(mode);
|
|
2100
2142
|
}
|
|
2101
2143
|
}
|
|
2102
2144
|
removeMode(mode) {
|
|
2103
2145
|
if (this.modes.includes(mode)) {
|
|
2104
2146
|
this.modes.splice(this.modes.indexOf(mode), 1);
|
|
2105
2147
|
mode._context = null;
|
|
2106
|
-
this.
|
|
2148
|
+
this.controller.removeModeFromContext(mode);
|
|
2107
2149
|
}
|
|
2108
2150
|
}
|
|
2109
2151
|
removeAllModes() {
|
|
@@ -2111,7 +2153,7 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2111
2153
|
mode._context = null;
|
|
2112
2154
|
});
|
|
2113
2155
|
this.modes = [];
|
|
2114
|
-
this.
|
|
2156
|
+
this.controller.removeAllModesFromContext();
|
|
2115
2157
|
}
|
|
2116
2158
|
dispose() {
|
|
2117
2159
|
var _a;
|
|
@@ -2139,18 +2181,13 @@ class DataCaptureContext extends DefaultSerializeable {
|
|
|
2139
2181
|
}
|
|
2140
2182
|
return this.controller.updateContextFromJSON();
|
|
2141
2183
|
}
|
|
2142
|
-
addComponent(component) {
|
|
2143
|
-
if (this.components.includes(component)) {
|
|
2144
|
-
return Promise.resolve();
|
|
2145
|
-
}
|
|
2146
|
-
this.components.push(component);
|
|
2147
|
-
component._context = this;
|
|
2148
|
-
return this.update();
|
|
2149
|
-
}
|
|
2150
2184
|
}
|
|
2151
2185
|
__decorate([
|
|
2152
2186
|
nameForSerialization('frameSource')
|
|
2153
2187
|
], DataCaptureContext.prototype, "_frameSource", void 0);
|
|
2188
|
+
__decorate([
|
|
2189
|
+
ignoreFromSerialization
|
|
2190
|
+
], DataCaptureContext.prototype, "modes", void 0);
|
|
2154
2191
|
__decorate([
|
|
2155
2192
|
ignoreFromSerialization
|
|
2156
2193
|
], DataCaptureContext.prototype, "controller", void 0);
|
|
@@ -2161,6 +2198,15 @@ __decorate([
|
|
|
2161
2198
|
ignoreFromSerialization
|
|
2162
2199
|
], DataCaptureContext, "coreDefaults", null);
|
|
2163
2200
|
|
|
2201
|
+
var VibrationType;
|
|
2202
|
+
(function (VibrationType) {
|
|
2203
|
+
VibrationType["default"] = "default";
|
|
2204
|
+
VibrationType["selectionHaptic"] = "selectionHaptic";
|
|
2205
|
+
VibrationType["successHaptic"] = "successHaptic";
|
|
2206
|
+
VibrationType["waveForm"] = "waveForm";
|
|
2207
|
+
VibrationType["impactHaptic"] = "impactHaptic";
|
|
2208
|
+
})(VibrationType || (VibrationType = {}));
|
|
2209
|
+
|
|
2164
2210
|
class Vibration extends DefaultSerializeable {
|
|
2165
2211
|
static get defaultVibration() {
|
|
2166
2212
|
return new Vibration(VibrationType.default);
|
|
@@ -2171,6 +2217,9 @@ class Vibration extends DefaultSerializeable {
|
|
|
2171
2217
|
static get successHapticFeedback() {
|
|
2172
2218
|
return new Vibration(VibrationType.successHaptic);
|
|
2173
2219
|
}
|
|
2220
|
+
static get impactHapticFeedback() {
|
|
2221
|
+
return new Vibration(VibrationType.impactHaptic);
|
|
2222
|
+
}
|
|
2174
2223
|
static fromJSON(json) {
|
|
2175
2224
|
if (json.type === 'waveForm') {
|
|
2176
2225
|
return new WaveFormVibration(json.timings, json.amplitudes);
|
|
@@ -2182,13 +2231,6 @@ class Vibration extends DefaultSerializeable {
|
|
|
2182
2231
|
this.type = type;
|
|
2183
2232
|
}
|
|
2184
2233
|
}
|
|
2185
|
-
var VibrationType;
|
|
2186
|
-
(function (VibrationType) {
|
|
2187
|
-
VibrationType["default"] = "default";
|
|
2188
|
-
VibrationType["selectionHaptic"] = "selectionHaptic";
|
|
2189
|
-
VibrationType["successHaptic"] = "successHaptic";
|
|
2190
|
-
VibrationType["waveForm"] = "waveForm";
|
|
2191
|
-
})(VibrationType || (VibrationType = {}));
|
|
2192
2234
|
class WaveFormVibration extends Vibration {
|
|
2193
2235
|
get timings() {
|
|
2194
2236
|
return this._timings;
|
|
@@ -2371,6 +2413,7 @@ class DataCaptureViewController extends BaseController {
|
|
|
2371
2413
|
static forDataCaptureView(view) {
|
|
2372
2414
|
const controller = new DataCaptureViewController();
|
|
2373
2415
|
controller.view = view;
|
|
2416
|
+
controller.createView();
|
|
2374
2417
|
controller.subscribeListener();
|
|
2375
2418
|
return controller;
|
|
2376
2419
|
}
|
|
@@ -2398,12 +2441,28 @@ class DataCaptureViewController extends BaseController {
|
|
|
2398
2441
|
hide() {
|
|
2399
2442
|
return this._proxy.hide();
|
|
2400
2443
|
}
|
|
2444
|
+
createView() {
|
|
2445
|
+
return this._proxy.createView(JSON.stringify(this.view.toJSON()));
|
|
2446
|
+
}
|
|
2447
|
+
updateView() {
|
|
2448
|
+
return this._proxy.updateView(JSON.stringify(this.view.toJSON()));
|
|
2449
|
+
}
|
|
2401
2450
|
dispose() {
|
|
2402
2451
|
this.unsubscribeListener();
|
|
2403
2452
|
}
|
|
2453
|
+
addOverlay(overlay) {
|
|
2454
|
+
return this._proxy.addOverlay(JSON.stringify(overlay.toJSON()));
|
|
2455
|
+
}
|
|
2456
|
+
removeOverlay(overlay) {
|
|
2457
|
+
return this._proxy.removeOverlay(JSON.stringify(overlay.toJSON()));
|
|
2458
|
+
}
|
|
2459
|
+
removeAllOverlays() {
|
|
2460
|
+
return this._proxy.removeAllOverlays();
|
|
2461
|
+
}
|
|
2404
2462
|
subscribeListener() {
|
|
2463
|
+
var _a, _b;
|
|
2405
2464
|
this._proxy.registerListenerForViewEvents();
|
|
2406
|
-
this._proxy.subscribeDidChangeSize();
|
|
2465
|
+
(_b = (_a = this._proxy).subscribeDidChangeSize) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
2407
2466
|
this.eventEmitter.on(DataCaptureViewEvents.didChangeSize, (payload) => {
|
|
2408
2467
|
const payloadJSON = JSON.parse(payload);
|
|
2409
2468
|
const size = Size.fromJSON(payloadJSON.size);
|
|
@@ -2433,12 +2492,60 @@ class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
2433
2492
|
this._context = context;
|
|
2434
2493
|
if (this._context) {
|
|
2435
2494
|
this._context.view = this;
|
|
2436
|
-
this._context.update();
|
|
2437
2495
|
}
|
|
2438
2496
|
}
|
|
2439
2497
|
get coreDefaults() {
|
|
2440
2498
|
return getCoreDefaults();
|
|
2441
2499
|
}
|
|
2500
|
+
get scanAreaMargins() {
|
|
2501
|
+
return this._scanAreaMargins;
|
|
2502
|
+
}
|
|
2503
|
+
set scanAreaMargins(newValue) {
|
|
2504
|
+
this._scanAreaMargins = newValue;
|
|
2505
|
+
this.controller.updateView();
|
|
2506
|
+
}
|
|
2507
|
+
get pointOfInterest() {
|
|
2508
|
+
return this._pointOfInterest;
|
|
2509
|
+
}
|
|
2510
|
+
set pointOfInterest(newValue) {
|
|
2511
|
+
this._pointOfInterest = newValue;
|
|
2512
|
+
this.controller.updateView();
|
|
2513
|
+
}
|
|
2514
|
+
get logoAnchor() {
|
|
2515
|
+
return this._logoAnchor;
|
|
2516
|
+
}
|
|
2517
|
+
set logoAnchor(newValue) {
|
|
2518
|
+
this._logoAnchor = newValue;
|
|
2519
|
+
this.controller.updateView();
|
|
2520
|
+
}
|
|
2521
|
+
get logoOffset() {
|
|
2522
|
+
return this._logoOffset;
|
|
2523
|
+
}
|
|
2524
|
+
set logoOffset(newValue) {
|
|
2525
|
+
this._logoOffset = newValue;
|
|
2526
|
+
this.controller.updateView();
|
|
2527
|
+
}
|
|
2528
|
+
get focusGesture() {
|
|
2529
|
+
return this._focusGesture;
|
|
2530
|
+
}
|
|
2531
|
+
set focusGesture(newValue) {
|
|
2532
|
+
this._focusGesture = newValue;
|
|
2533
|
+
this.controller.updateView();
|
|
2534
|
+
}
|
|
2535
|
+
get zoomGesture() {
|
|
2536
|
+
return this._zoomGesture;
|
|
2537
|
+
}
|
|
2538
|
+
set zoomGesture(newValue) {
|
|
2539
|
+
this._zoomGesture = newValue;
|
|
2540
|
+
this.controller.updateView();
|
|
2541
|
+
}
|
|
2542
|
+
get logoStyle() {
|
|
2543
|
+
return this._logoStyle;
|
|
2544
|
+
}
|
|
2545
|
+
set logoStyle(newValue) {
|
|
2546
|
+
this._logoStyle = newValue;
|
|
2547
|
+
this.controller.updateView();
|
|
2548
|
+
}
|
|
2442
2549
|
get privateContext() {
|
|
2443
2550
|
return this.context;
|
|
2444
2551
|
}
|
|
@@ -2454,13 +2561,13 @@ class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
2454
2561
|
this.controls = [];
|
|
2455
2562
|
this.listeners = [];
|
|
2456
2563
|
this.controller = DataCaptureViewController.forDataCaptureView(this);
|
|
2457
|
-
this.
|
|
2458
|
-
this.
|
|
2459
|
-
this.
|
|
2460
|
-
this.
|
|
2461
|
-
this.
|
|
2462
|
-
this.
|
|
2463
|
-
this.
|
|
2564
|
+
this._scanAreaMargins = this.coreDefaults.DataCaptureView.scanAreaMargins;
|
|
2565
|
+
this._pointOfInterest = this.coreDefaults.DataCaptureView.pointOfInterest;
|
|
2566
|
+
this._logoAnchor = this.coreDefaults.DataCaptureView.logoAnchor;
|
|
2567
|
+
this._logoOffset = this.coreDefaults.DataCaptureView.logoOffset;
|
|
2568
|
+
this._focusGesture = this.coreDefaults.DataCaptureView.focusGesture;
|
|
2569
|
+
this._zoomGesture = this.coreDefaults.DataCaptureView.zoomGesture;
|
|
2570
|
+
this._logoStyle = this.coreDefaults.DataCaptureView.logoStyle;
|
|
2464
2571
|
}
|
|
2465
2572
|
addOverlay(overlay) {
|
|
2466
2573
|
if (this.overlays.includes(overlay)) {
|
|
@@ -2468,7 +2575,7 @@ class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
2468
2575
|
}
|
|
2469
2576
|
overlay.view = this;
|
|
2470
2577
|
this.overlays.push(overlay);
|
|
2471
|
-
this.
|
|
2578
|
+
this.controller.addOverlay(overlay);
|
|
2472
2579
|
}
|
|
2473
2580
|
removeOverlay(overlay) {
|
|
2474
2581
|
if (!this.overlays.includes(overlay)) {
|
|
@@ -2476,7 +2583,7 @@ class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
2476
2583
|
}
|
|
2477
2584
|
overlay.view = null;
|
|
2478
2585
|
this.overlays.splice(this.overlays.indexOf(overlay), 1);
|
|
2479
|
-
this.
|
|
2586
|
+
this.controller.removeOverlay(overlay);
|
|
2480
2587
|
}
|
|
2481
2588
|
addListener(listener) {
|
|
2482
2589
|
if (!this.listeners.includes(listener)) {
|
|
@@ -2498,21 +2605,31 @@ class BaseDataCaptureView extends DefaultSerializeable {
|
|
|
2498
2605
|
if (!this.controls.includes(control)) {
|
|
2499
2606
|
control.view = this;
|
|
2500
2607
|
this.controls.push(control);
|
|
2501
|
-
this.
|
|
2608
|
+
this.controller.updateView();
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
addControlWithAnchorAndOffset(control, anchor, offset) {
|
|
2612
|
+
if (!this.controls.includes(control)) {
|
|
2613
|
+
control.view = this;
|
|
2614
|
+
control.anchor = anchor;
|
|
2615
|
+
control.offset = offset;
|
|
2616
|
+
this.controls.push(control);
|
|
2617
|
+
this.controller.updateView();
|
|
2502
2618
|
}
|
|
2503
2619
|
}
|
|
2504
2620
|
removeControl(control) {
|
|
2505
2621
|
if (this.controls.includes(control)) {
|
|
2506
2622
|
control.view = null;
|
|
2507
|
-
this.controls.splice(this.
|
|
2508
|
-
this.
|
|
2623
|
+
this.controls.splice(this.controls.indexOf(control), 1);
|
|
2624
|
+
this.controller.updateView();
|
|
2509
2625
|
}
|
|
2510
2626
|
}
|
|
2511
2627
|
controlUpdated() {
|
|
2512
|
-
this.
|
|
2628
|
+
this.controller.updateView();
|
|
2513
2629
|
}
|
|
2514
2630
|
dispose() {
|
|
2515
|
-
this.overlays
|
|
2631
|
+
this.overlays = [];
|
|
2632
|
+
this.controller.removeAllOverlays();
|
|
2516
2633
|
this.listeners.forEach(listener => this.removeListener(listener));
|
|
2517
2634
|
this.controller.dispose();
|
|
2518
2635
|
}
|
|
@@ -2546,6 +2663,30 @@ __decorate([
|
|
|
2546
2663
|
__decorate([
|
|
2547
2664
|
ignoreFromSerialization
|
|
2548
2665
|
], BaseDataCaptureView.prototype, "coreDefaults", null);
|
|
2666
|
+
__decorate([
|
|
2667
|
+
ignoreFromSerialization
|
|
2668
|
+
], BaseDataCaptureView.prototype, "_scanAreaMargins", void 0);
|
|
2669
|
+
__decorate([
|
|
2670
|
+
ignoreFromSerialization
|
|
2671
|
+
], BaseDataCaptureView.prototype, "_pointOfInterest", void 0);
|
|
2672
|
+
__decorate([
|
|
2673
|
+
ignoreFromSerialization
|
|
2674
|
+
], BaseDataCaptureView.prototype, "_logoAnchor", void 0);
|
|
2675
|
+
__decorate([
|
|
2676
|
+
ignoreFromSerialization
|
|
2677
|
+
], BaseDataCaptureView.prototype, "_logoOffset", void 0);
|
|
2678
|
+
__decorate([
|
|
2679
|
+
ignoreFromSerialization
|
|
2680
|
+
], BaseDataCaptureView.prototype, "_focusGesture", void 0);
|
|
2681
|
+
__decorate([
|
|
2682
|
+
ignoreFromSerialization
|
|
2683
|
+
], BaseDataCaptureView.prototype, "_zoomGesture", void 0);
|
|
2684
|
+
__decorate([
|
|
2685
|
+
ignoreFromSerialization
|
|
2686
|
+
], BaseDataCaptureView.prototype, "_logoStyle", void 0);
|
|
2687
|
+
__decorate([
|
|
2688
|
+
ignoreFromSerialization
|
|
2689
|
+
], BaseDataCaptureView.prototype, "overlays", void 0);
|
|
2549
2690
|
__decorate([
|
|
2550
2691
|
ignoreFromSerialization
|
|
2551
2692
|
], BaseDataCaptureView.prototype, "controller", void 0);
|
|
@@ -2572,5 +2713,5 @@ var Expiration;
|
|
|
2572
2713
|
|
|
2573
2714
|
createEventEmitter();
|
|
2574
2715
|
|
|
2575
|
-
export { AimerViewfinder, Anchor, BaseController, BaseDataCaptureView, BaseNativeProxy, Brush, Camera, CameraController, CameraPosition, CameraSettings, Color, ContextStatus, DataCaptureContext, DataCaptureContextEvents, DataCaptureContextSettings, DataCaptureViewController, DataCaptureViewEvents, DefaultSerializeable, Direction, EventEmitter, Expiration, FactoryMaker, Feedback, FocusGestureStrategy, FocusRange, FrameSourceListenerEvents, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LaserlineViewfinderStyle, LicenseInfo, LogoStyle, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, Orientation, Point, PointWithUnit, PrivateFocusGestureDeserializer, PrivateFrameData, PrivateZoomGestureDeserializer, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SpotlightViewfinder, SwipeToZoom, TapToFocus, TorchState, TorchSwitchControl, Vibration, VideoResolution, WaveFormVibration, ZoomSwitchControl, getCoreDefaults, ignoreFromSerialization, ignoreFromSerializationIfNull, loadCoreDefaults, nameForSerialization, serializationDefault };
|
|
2716
|
+
export { AimerViewfinder, Anchor, BaseController, BaseDataCaptureView, BaseNativeProxy, Brush, Camera, CameraController, CameraPosition, CameraSettings, Color, ContextStatus, DataCaptureContext, DataCaptureContextEvents, DataCaptureContextSettings, DataCaptureViewController, DataCaptureViewEvents, DefaultSerializeable, Direction, EventEmitter, Expiration, FactoryMaker, Feedback, FocusGestureStrategy, FocusRange, FrameSourceListenerEvents, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LaserlineViewfinderStyle, LicenseInfo, LogoStyle, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, Orientation, Point, PointWithUnit, PrivateFocusGestureDeserializer, PrivateFrameData, PrivateZoomGestureDeserializer, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SpotlightViewfinder, SwipeToZoom, TapToFocus, TorchState, TorchSwitchControl, Vibration, VibrationType, VideoResolution, WaveFormVibration, ZoomSwitchControl, getCoreDefaults, ignoreFromSerialization, ignoreFromSerializationIfNull, loadCoreDefaults, nameForSerialization, serializationDefault };
|
|
2576
2717
|
//# sourceMappingURL=core.js.map
|