scandit-capacitor-datacapture-core 8.3.1 → 8.4.0
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 +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/scandit/capacitor/datacapture/core/handlers/DataCaptureViewHandler.java +87 -8
- package/dist/core.js +379 -86
- package/dist/core.js.map +1 -1
- package/dist/dts/definitions.d.ts +3 -0
- package/dist/dts/ts/DataCaptureView.d.ts +4 -0
- package/dist/index.js +104 -115
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -32,6 +32,8 @@ export { FontFamily } from 'scandit-datacapture-frameworks-core';
|
|
|
32
32
|
export { TextAlignment } from 'scandit-datacapture-frameworks-core';
|
|
33
33
|
export { TorchSwitchControl } from 'scandit-datacapture-frameworks-core';
|
|
34
34
|
export { ZoomSwitchControl } from 'scandit-datacapture-frameworks-core';
|
|
35
|
+
export { ZoomSwitchOrientation } from 'scandit-datacapture-frameworks-core';
|
|
36
|
+
export { ZoomListener } from 'scandit-datacapture-frameworks-core';
|
|
35
37
|
export { NoneLocationSelection } from 'scandit-datacapture-frameworks-core';
|
|
36
38
|
export { RadiusLocationSelection } from 'scandit-datacapture-frameworks-core';
|
|
37
39
|
export { RectangularLocationSelection } from 'scandit-datacapture-frameworks-core';
|
|
@@ -75,6 +77,7 @@ export { DataCaptureComponent } from 'scandit-datacapture-frameworks-core';
|
|
|
75
77
|
export { DataCaptureOverlay } from 'scandit-datacapture-frameworks-core';
|
|
76
78
|
export { LicenseInfo } from 'scandit-datacapture-frameworks-core';
|
|
77
79
|
export { SwipeToZoom } from 'scandit-datacapture-frameworks-core';
|
|
80
|
+
export { PinchToZoom } from 'scandit-datacapture-frameworks-core';
|
|
78
81
|
export { TapToFocus } from 'scandit-datacapture-frameworks-core';
|
|
79
82
|
export { FocusGesture } from 'scandit-datacapture-frameworks-core';
|
|
80
83
|
export { FocusGestureListener } from 'scandit-datacapture-frameworks-core';
|
|
@@ -28,7 +28,11 @@ export declare class DataCaptureView {
|
|
|
28
28
|
set logoOffset(newValue: PointWithUnit);
|
|
29
29
|
get focusGesture(): FocusGesture | null;
|
|
30
30
|
set focusGesture(newValue: FocusGesture | null);
|
|
31
|
+
get zoomGestures(): ZoomGesture[];
|
|
32
|
+
set zoomGestures(newValue: ZoomGesture[]);
|
|
33
|
+
/** @deprecated Use zoomGestures instead. Will be removed in a future version. */
|
|
31
34
|
get zoomGesture(): ZoomGesture | null;
|
|
35
|
+
/** @deprecated Use zoomGestures instead. Will be removed in a future version. */
|
|
32
36
|
set zoomGesture(newValue: ZoomGesture | null);
|
|
33
37
|
get shouldShowZoomNotification(): boolean;
|
|
34
38
|
set shouldShowZoomNotification(newValue: boolean);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLElementState, BaseDataCaptureView, HtmlElementPosition, HtmlElementSize, ignoreFromSerialization, loadCoreDefaults, getCoreDefaults, AimerViewfinder, Anchor, Brush, Camera, CameraPosition, CameraSettings, ClusteringMode, Color, ContextStatus, DataCaptureContext, DataCaptureContextSettings, Direction, Expiration, Feedback, FocusGestureStrategy, FocusRange, FontFamily, FrameDataSettings, FrameDataSettingsBuilder, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LicenseInfo, LogoStyle, MacroMode, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, OpenSourceSoftwareLicenseInfo, Orientation, Point, PointWithUnit, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, ScanIntention, ScanditIcon, ScanditIconBuilder, ScanditIconShape, ScanditIconType, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SwipeToZoom, TapToFocus, TextAlignment, TorchState, TorchSwitchControl, Vibration, VideoResolution, ZoomSwitchControl, registerCoreProxies } from './core.js';
|
|
1
|
+
import { HTMLElementState, BaseDataCaptureView, HtmlElementPosition, HtmlElementSize, ignoreFromSerialization, loadCoreDefaults, getCoreDefaults, AimerViewfinder, Anchor, Brush, Camera, CameraPosition, CameraSettings, ClusteringMode, Color, ContextStatus, DataCaptureContext, DataCaptureContextSettings, Direction, Expiration, Feedback, FocusGestureStrategy, FocusRange, FontFamily, FrameDataSettings, FrameDataSettingsBuilder, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LicenseInfo, LogoStyle, MacroMode, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, OpenSourceSoftwareLicenseInfo, Orientation, PinchToZoom, Point, PointWithUnit, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, ScanIntention, ScanditIcon, ScanditIconBuilder, ScanditIconShape, ScanditIconType, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SwipeToZoom, TapToFocus, TextAlignment, TorchState, TorchSwitchControl, Vibration, VideoResolution, ZoomSwitchControl, ZoomSwitchOrientation, registerCoreProxies } from './core.js';
|
|
2
2
|
|
|
3
3
|
/******************************************************************************
|
|
4
4
|
Copyright (c) Microsoft Corporation.
|
|
@@ -94,9 +94,17 @@ class DataCaptureView {
|
|
|
94
94
|
set focusGesture(newValue) {
|
|
95
95
|
this.baseDataCaptureView.focusGesture = newValue;
|
|
96
96
|
}
|
|
97
|
+
get zoomGestures() {
|
|
98
|
+
return this.baseDataCaptureView.zoomGestures;
|
|
99
|
+
}
|
|
100
|
+
set zoomGestures(newValue) {
|
|
101
|
+
this.baseDataCaptureView.zoomGestures = newValue;
|
|
102
|
+
}
|
|
103
|
+
/** @deprecated Use zoomGestures instead. Will be removed in a future version. */
|
|
97
104
|
get zoomGesture() {
|
|
98
105
|
return this.baseDataCaptureView.zoomGesture;
|
|
99
106
|
}
|
|
107
|
+
/** @deprecated Use zoomGestures instead. Will be removed in a future version. */
|
|
100
108
|
set zoomGesture(newValue) {
|
|
101
109
|
this.baseDataCaptureView.zoomGesture = newValue;
|
|
102
110
|
}
|
|
@@ -289,7 +297,7 @@ __decorate([
|
|
|
289
297
|
|
|
290
298
|
class DataCaptureVersion {
|
|
291
299
|
static get pluginVersion() {
|
|
292
|
-
return '8.
|
|
300
|
+
return '8.4.0';
|
|
293
301
|
}
|
|
294
302
|
}
|
|
295
303
|
|
|
@@ -502,6 +510,7 @@ var CoreExports = /*#__PURE__*/Object.freeze({
|
|
|
502
510
|
NumberWithUnit: NumberWithUnit,
|
|
503
511
|
OpenSourceSoftwareLicenseInfo: OpenSourceSoftwareLicenseInfo,
|
|
504
512
|
get Orientation () { return Orientation; },
|
|
513
|
+
PinchToZoom: PinchToZoom,
|
|
505
514
|
Point: Point,
|
|
506
515
|
PointWithUnit: PointWithUnit,
|
|
507
516
|
Quadrilateral: Quadrilateral,
|
|
@@ -532,51 +541,11 @@ var CoreExports = /*#__PURE__*/Object.freeze({
|
|
|
532
541
|
Vibration: Vibration,
|
|
533
542
|
get VideoResolution () { return VideoResolution; },
|
|
534
543
|
VolumeButtonObserver: VolumeButtonObserver,
|
|
535
|
-
ZoomSwitchControl: ZoomSwitchControl
|
|
544
|
+
ZoomSwitchControl: ZoomSwitchControl,
|
|
545
|
+
get ZoomSwitchOrientation () { return ZoomSwitchOrientation; }
|
|
536
546
|
});
|
|
537
547
|
|
|
538
548
|
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
|
539
|
-
const createCapacitorPlatforms = (win) => {
|
|
540
|
-
const defaultPlatformMap = new Map();
|
|
541
|
-
defaultPlatformMap.set('web', { name: 'web' });
|
|
542
|
-
const capPlatforms = win.CapacitorPlatforms || {
|
|
543
|
-
currentPlatform: { name: 'web' },
|
|
544
|
-
platforms: defaultPlatformMap,
|
|
545
|
-
};
|
|
546
|
-
const addPlatform = (name, platform) => {
|
|
547
|
-
capPlatforms.platforms.set(name, platform);
|
|
548
|
-
};
|
|
549
|
-
const setPlatform = (name) => {
|
|
550
|
-
if (capPlatforms.platforms.has(name)) {
|
|
551
|
-
capPlatforms.currentPlatform = capPlatforms.platforms.get(name);
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
capPlatforms.addPlatform = addPlatform;
|
|
555
|
-
capPlatforms.setPlatform = setPlatform;
|
|
556
|
-
return capPlatforms;
|
|
557
|
-
};
|
|
558
|
-
const initPlatforms = (win) => (win.CapacitorPlatforms = createCapacitorPlatforms(win));
|
|
559
|
-
/**
|
|
560
|
-
* @deprecated Set `CapacitorCustomPlatform` on the window object prior to runtime executing in the web app instead
|
|
561
|
-
*/
|
|
562
|
-
const CapacitorPlatforms = /*#__PURE__*/ initPlatforms((typeof globalThis !== 'undefined'
|
|
563
|
-
? globalThis
|
|
564
|
-
: typeof self !== 'undefined'
|
|
565
|
-
? self
|
|
566
|
-
: typeof window !== 'undefined'
|
|
567
|
-
? window
|
|
568
|
-
: typeof global !== 'undefined'
|
|
569
|
-
? global
|
|
570
|
-
: {}));
|
|
571
|
-
/**
|
|
572
|
-
* @deprecated Set `CapacitorCustomPlatform` on the window object prior to runtime executing in the web app instead
|
|
573
|
-
*/
|
|
574
|
-
CapacitorPlatforms.addPlatform;
|
|
575
|
-
/**
|
|
576
|
-
* @deprecated Set `CapacitorCustomPlatform` on the window object prior to runtime executing in the web app instead
|
|
577
|
-
*/
|
|
578
|
-
CapacitorPlatforms.setPlatform;
|
|
579
|
-
|
|
580
549
|
var ExceptionCode;
|
|
581
550
|
(function (ExceptionCode) {
|
|
582
551
|
/**
|
|
@@ -617,23 +586,14 @@ const getPlatformId = (win) => {
|
|
|
617
586
|
};
|
|
618
587
|
|
|
619
588
|
const createCapacitor = (win) => {
|
|
620
|
-
var _a, _b, _c, _d, _e;
|
|
621
589
|
const capCustomPlatform = win.CapacitorCustomPlatform || null;
|
|
622
590
|
const cap = win.Capacitor || {};
|
|
623
591
|
const Plugins = (cap.Plugins = cap.Plugins || {});
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
*/
|
|
627
|
-
const capPlatforms = win.CapacitorPlatforms;
|
|
628
|
-
const defaultGetPlatform = () => {
|
|
629
|
-
return capCustomPlatform !== null
|
|
630
|
-
? capCustomPlatform.name
|
|
631
|
-
: getPlatformId(win);
|
|
592
|
+
const getPlatform = () => {
|
|
593
|
+
return capCustomPlatform !== null ? capCustomPlatform.name : getPlatformId(win);
|
|
632
594
|
};
|
|
633
|
-
const
|
|
634
|
-
const
|
|
635
|
-
const isNativePlatform = ((_b = capPlatforms === null || capPlatforms === void 0 ? void 0 : capPlatforms.currentPlatform) === null || _b === void 0 ? void 0 : _b.isNativePlatform) || defaultIsNativePlatform;
|
|
636
|
-
const defaultIsPluginAvailable = (pluginName) => {
|
|
595
|
+
const isNativePlatform = () => getPlatform() !== 'web';
|
|
596
|
+
const isPluginAvailable = (pluginName) => {
|
|
637
597
|
const plugin = registeredPlugins.get(pluginName);
|
|
638
598
|
if (plugin === null || plugin === void 0 ? void 0 : plugin.platforms.has(getPlatform())) {
|
|
639
599
|
// JS implementation available for the current platform.
|
|
@@ -645,16 +605,10 @@ const createCapacitor = (win) => {
|
|
|
645
605
|
}
|
|
646
606
|
return false;
|
|
647
607
|
};
|
|
648
|
-
const
|
|
649
|
-
defaultIsPluginAvailable;
|
|
650
|
-
const defaultGetPluginHeader = (pluginName) => { var _a; return (_a = cap.PluginHeaders) === null || _a === void 0 ? void 0 : _a.find(h => h.name === pluginName); };
|
|
651
|
-
const getPluginHeader = ((_d = capPlatforms === null || capPlatforms === void 0 ? void 0 : capPlatforms.currentPlatform) === null || _d === void 0 ? void 0 : _d.getPluginHeader) || defaultGetPluginHeader;
|
|
608
|
+
const getPluginHeader = (pluginName) => { var _a; return (_a = cap.PluginHeaders) === null || _a === void 0 ? void 0 : _a.find((h) => h.name === pluginName); };
|
|
652
609
|
const handleError = (err) => win.console.error(err);
|
|
653
|
-
const pluginMethodNoop = (_target, prop, pluginName) => {
|
|
654
|
-
return Promise.reject(`${pluginName} does not have an implementation of "${prop}".`);
|
|
655
|
-
};
|
|
656
610
|
const registeredPlugins = new Map();
|
|
657
|
-
const
|
|
611
|
+
const registerPlugin = (pluginName, jsImplementations = {}) => {
|
|
658
612
|
const registeredPlugin = registeredPlugins.get(pluginName);
|
|
659
613
|
if (registeredPlugin) {
|
|
660
614
|
console.warn(`Capacitor plugin "${pluginName}" already registered. Cannot register plugins twice.`);
|
|
@@ -670,9 +624,7 @@ const createCapacitor = (win) => {
|
|
|
670
624
|
? (jsImplementation = await jsImplementations[platform]())
|
|
671
625
|
: (jsImplementation = jsImplementations[platform]);
|
|
672
626
|
}
|
|
673
|
-
else if (capCustomPlatform !== null &&
|
|
674
|
-
!jsImplementation &&
|
|
675
|
-
'web' in jsImplementations) {
|
|
627
|
+
else if (capCustomPlatform !== null && !jsImplementation && 'web' in jsImplementations) {
|
|
676
628
|
jsImplementation =
|
|
677
629
|
typeof jsImplementations['web'] === 'function'
|
|
678
630
|
? (jsImplementation = await jsImplementations['web']())
|
|
@@ -683,7 +635,7 @@ const createCapacitor = (win) => {
|
|
|
683
635
|
const createPluginMethod = (impl, prop) => {
|
|
684
636
|
var _a, _b;
|
|
685
637
|
if (pluginHeader) {
|
|
686
|
-
const methodHeader = pluginHeader === null || pluginHeader === void 0 ? void 0 : pluginHeader.methods.find(m => prop === m.name);
|
|
638
|
+
const methodHeader = pluginHeader === null || pluginHeader === void 0 ? void 0 : pluginHeader.methods.find((m) => prop === m.name);
|
|
687
639
|
if (methodHeader) {
|
|
688
640
|
if (methodHeader.rtype === 'promise') {
|
|
689
641
|
return (options) => cap.nativePromise(pluginName, prop.toString(), options);
|
|
@@ -706,7 +658,7 @@ const createCapacitor = (win) => {
|
|
|
706
658
|
const createPluginMethodWrapper = (prop) => {
|
|
707
659
|
let remove;
|
|
708
660
|
const wrapper = (...args) => {
|
|
709
|
-
const p = loadPluginImplementation().then(impl => {
|
|
661
|
+
const p = loadPluginImplementation().then((impl) => {
|
|
710
662
|
const fn = createPluginMethod(impl, prop);
|
|
711
663
|
if (fn) {
|
|
712
664
|
const p = fn(...args);
|
|
@@ -742,7 +694,7 @@ const createCapacitor = (win) => {
|
|
|
742
694
|
callbackId,
|
|
743
695
|
}, callback);
|
|
744
696
|
};
|
|
745
|
-
const p = new Promise(resolve => call.then(() => resolve({ remove })));
|
|
697
|
+
const p = new Promise((resolve) => call.then(() => resolve({ remove })));
|
|
746
698
|
p.remove = async () => {
|
|
747
699
|
console.warn(`Using addListener() without 'await' is deprecated.`);
|
|
748
700
|
await remove();
|
|
@@ -770,30 +722,22 @@ const createCapacitor = (win) => {
|
|
|
770
722
|
registeredPlugins.set(pluginName, {
|
|
771
723
|
name: pluginName,
|
|
772
724
|
proxy,
|
|
773
|
-
platforms: new Set([
|
|
774
|
-
...Object.keys(jsImplementations),
|
|
775
|
-
...(pluginHeader ? [platform] : []),
|
|
776
|
-
]),
|
|
725
|
+
platforms: new Set([...Object.keys(jsImplementations), ...(pluginHeader ? [platform] : [])]),
|
|
777
726
|
});
|
|
778
727
|
return proxy;
|
|
779
728
|
};
|
|
780
|
-
const registerPlugin = ((_e = capPlatforms === null || capPlatforms === void 0 ? void 0 : capPlatforms.currentPlatform) === null || _e === void 0 ? void 0 : _e.registerPlugin) || defaultRegisterPlugin;
|
|
781
729
|
// Add in convertFileSrc for web, it will already be available in native context
|
|
782
730
|
if (!cap.convertFileSrc) {
|
|
783
|
-
cap.convertFileSrc = filePath => filePath;
|
|
731
|
+
cap.convertFileSrc = (filePath) => filePath;
|
|
784
732
|
}
|
|
785
733
|
cap.getPlatform = getPlatform;
|
|
786
734
|
cap.handleError = handleError;
|
|
787
735
|
cap.isNativePlatform = isNativePlatform;
|
|
788
736
|
cap.isPluginAvailable = isPluginAvailable;
|
|
789
|
-
cap.pluginMethodNoop = pluginMethodNoop;
|
|
790
737
|
cap.registerPlugin = registerPlugin;
|
|
791
738
|
cap.Exception = CapacitorException;
|
|
792
739
|
cap.DEBUG = !!cap.DEBUG;
|
|
793
740
|
cap.isLoggingEnabled = !!cap.isLoggingEnabled;
|
|
794
|
-
// Deprecated props
|
|
795
|
-
cap.platform = cap.getPlatform();
|
|
796
|
-
cap.isNative = cap.isNativePlatform();
|
|
797
741
|
return cap;
|
|
798
742
|
};
|
|
799
743
|
const initCapacitorGlobal = (win) => (win.Capacitor = createCapacitor(win));
|
|
@@ -808,26 +752,15 @@ const Capacitor = /*#__PURE__*/ initCapacitorGlobal(typeof globalThis !== 'undef
|
|
|
808
752
|
? global
|
|
809
753
|
: {});
|
|
810
754
|
const registerPlugin = Capacitor.registerPlugin;
|
|
811
|
-
/**
|
|
812
|
-
* @deprecated Provided for backwards compatibility for Capacitor v2 plugins.
|
|
813
|
-
* Capacitor v3 plugins should import the plugin directly. This "Plugins"
|
|
814
|
-
* export is deprecated in v3, and will be removed in v4.
|
|
815
|
-
*/
|
|
816
|
-
Capacitor.Plugins;
|
|
817
755
|
|
|
818
756
|
/**
|
|
819
757
|
* Base class web plugins should extend.
|
|
820
758
|
*/
|
|
821
759
|
class WebPlugin {
|
|
822
|
-
constructor(
|
|
760
|
+
constructor() {
|
|
823
761
|
this.listeners = {};
|
|
824
762
|
this.retainedEventArguments = {};
|
|
825
763
|
this.windowListeners = {};
|
|
826
|
-
if (config) {
|
|
827
|
-
// TODO: add link to upgrade guide
|
|
828
|
-
console.warn(`Capacitor WebPlugin "${config.name}" config object was deprecated in v3 and will be removed in v4.`);
|
|
829
|
-
this.config = config;
|
|
830
|
-
}
|
|
831
764
|
}
|
|
832
765
|
addListener(eventName, listenerFunc) {
|
|
833
766
|
let firstListener = false;
|
|
@@ -870,17 +803,18 @@ class WebPlugin {
|
|
|
870
803
|
}
|
|
871
804
|
return;
|
|
872
805
|
}
|
|
873
|
-
listeners.forEach(listener => listener(data));
|
|
806
|
+
listeners.forEach((listener) => listener(data));
|
|
874
807
|
}
|
|
875
808
|
hasListeners(eventName) {
|
|
876
|
-
|
|
809
|
+
var _a;
|
|
810
|
+
return !!((_a = this.listeners[eventName]) === null || _a === void 0 ? void 0 : _a.length);
|
|
877
811
|
}
|
|
878
812
|
registerWindowListener(windowEventName, pluginEventName) {
|
|
879
813
|
this.windowListeners[pluginEventName] = {
|
|
880
814
|
registered: false,
|
|
881
815
|
windowEventName,
|
|
882
816
|
pluginEventName,
|
|
883
|
-
handler: event => {
|
|
817
|
+
handler: (event) => {
|
|
884
818
|
this.notifyListeners(pluginEventName, event);
|
|
885
819
|
},
|
|
886
820
|
};
|
|
@@ -921,7 +855,7 @@ class WebPlugin {
|
|
|
921
855
|
return;
|
|
922
856
|
}
|
|
923
857
|
delete this.retainedEventArguments[eventName];
|
|
924
|
-
args.forEach(arg => {
|
|
858
|
+
args.forEach((arg) => {
|
|
925
859
|
this.notifyListeners(eventName, arg);
|
|
926
860
|
});
|
|
927
861
|
}
|
|
@@ -944,7 +878,7 @@ class CapacitorCookiesPluginWeb extends WebPlugin {
|
|
|
944
878
|
async getCookies() {
|
|
945
879
|
const cookies = document.cookie;
|
|
946
880
|
const cookieMap = {};
|
|
947
|
-
cookies.split(';').forEach(cookie => {
|
|
881
|
+
cookies.split(';').forEach((cookie) => {
|
|
948
882
|
if (cookie.length <= 0)
|
|
949
883
|
return;
|
|
950
884
|
// Replace first "=" with CAP_COOKIE to prevent splitting on additional "="
|
|
@@ -961,11 +895,9 @@ class CapacitorCookiesPluginWeb extends WebPlugin {
|
|
|
961
895
|
const encodedKey = encode(options.key);
|
|
962
896
|
const encodedValue = encode(options.value);
|
|
963
897
|
// Clean & sanitize options
|
|
964
|
-
const expires = `; expires=${
|
|
898
|
+
const expires = options.expires ? `; expires=${options.expires.replace('expires=', '')}` : '';
|
|
965
899
|
const path = (options.path || '/').replace('path=', ''); // Default is "path=/"
|
|
966
|
-
const domain = options.url != null && options.url.length > 0
|
|
967
|
-
? `domain=${options.url}`
|
|
968
|
-
: '';
|
|
900
|
+
const domain = options.url != null && options.url.length > 0 ? `domain=${options.url}` : '';
|
|
969
901
|
document.cookie = `${encodedKey}=${encodedValue || ''}${expires}; path=${path}; ${domain};`;
|
|
970
902
|
}
|
|
971
903
|
catch (error) {
|
|
@@ -984,9 +916,7 @@ class CapacitorCookiesPluginWeb extends WebPlugin {
|
|
|
984
916
|
try {
|
|
985
917
|
const cookies = document.cookie.split(';') || [];
|
|
986
918
|
for (const cookie of cookies) {
|
|
987
|
-
document.cookie = cookie
|
|
988
|
-
.replace(/^ +/, '')
|
|
989
|
-
.replace(/=.*/, `=;expires=${new Date().toUTCString()};path=/`);
|
|
919
|
+
document.cookie = cookie.replace(/^ +/, '').replace(/=.*/, `=;expires=${new Date().toUTCString()};path=/`);
|
|
990
920
|
}
|
|
991
921
|
}
|
|
992
922
|
catch (error) {
|
|
@@ -1015,9 +945,7 @@ const readBlobAsBase64 = async (blob) => new Promise((resolve, reject) => {
|
|
|
1015
945
|
reader.onload = () => {
|
|
1016
946
|
const base64String = reader.result;
|
|
1017
947
|
// remove prefix "data:application/pdf;base64,"
|
|
1018
|
-
resolve(base64String.indexOf(',') >= 0
|
|
1019
|
-
? base64String.split(',')[1]
|
|
1020
|
-
: base64String);
|
|
948
|
+
resolve(base64String.indexOf(',') >= 0 ? base64String.split(',')[1] : base64String);
|
|
1021
949
|
};
|
|
1022
950
|
reader.onerror = (error) => reject(error);
|
|
1023
951
|
reader.readAsDataURL(blob);
|
|
@@ -1028,7 +956,7 @@ const readBlobAsBase64 = async (blob) => new Promise((resolve, reject) => {
|
|
|
1028
956
|
*/
|
|
1029
957
|
const normalizeHttpHeaders = (headers = {}) => {
|
|
1030
958
|
const originalKeys = Object.keys(headers);
|
|
1031
|
-
const loweredKeys = Object.keys(headers).map(k => k.toLocaleLowerCase());
|
|
959
|
+
const loweredKeys = Object.keys(headers).map((k) => k.toLocaleLowerCase());
|
|
1032
960
|
const normalized = loweredKeys.reduce((acc, key, index) => {
|
|
1033
961
|
acc[key] = headers[originalKeys[index]];
|
|
1034
962
|
return acc;
|
|
@@ -1049,7 +977,7 @@ const buildUrlParams = (params, shouldEncode = true) => {
|
|
|
1049
977
|
let item;
|
|
1050
978
|
if (Array.isArray(value)) {
|
|
1051
979
|
item = '';
|
|
1052
|
-
value.forEach(str => {
|
|
980
|
+
value.forEach((str) => {
|
|
1053
981
|
encodedValue = shouldEncode ? encodeURIComponent(str) : str;
|
|
1054
982
|
item += `${key}=${encodedValue}&`;
|
|
1055
983
|
});
|
|
@@ -1087,8 +1015,7 @@ const buildRequestInit = (options, extra = {}) => {
|
|
|
1087
1015
|
}
|
|
1088
1016
|
output.body = params.toString();
|
|
1089
1017
|
}
|
|
1090
|
-
else if (type.includes('multipart/form-data') ||
|
|
1091
|
-
options.data instanceof FormData) {
|
|
1018
|
+
else if (type.includes('multipart/form-data') || options.data instanceof FormData) {
|
|
1092
1019
|
const form = new FormData();
|
|
1093
1020
|
if (options.data instanceof FormData) {
|
|
1094
1021
|
options.data.forEach((value, key) => {
|
|
@@ -1105,8 +1032,7 @@ const buildRequestInit = (options, extra = {}) => {
|
|
|
1105
1032
|
headers.delete('content-type'); // content-type will be set by `window.fetch` to includy boundary
|
|
1106
1033
|
output.headers = headers;
|
|
1107
1034
|
}
|
|
1108
|
-
else if (type.includes('application/json') ||
|
|
1109
|
-
typeof options.data === 'object') {
|
|
1035
|
+
else if (type.includes('application/json') || typeof options.data === 'object') {
|
|
1110
1036
|
output.body = JSON.stringify(options.data);
|
|
1111
1037
|
}
|
|
1112
1038
|
return output;
|
|
@@ -1196,6 +1122,69 @@ class CapacitorHttpPluginWeb extends WebPlugin {
|
|
|
1196
1122
|
registerPlugin('CapacitorHttp', {
|
|
1197
1123
|
web: () => new CapacitorHttpPluginWeb(),
|
|
1198
1124
|
});
|
|
1125
|
+
/******** END HTTP PLUGIN ********/
|
|
1126
|
+
/******** SYSTEM BARS PLUGIN ********/
|
|
1127
|
+
/**
|
|
1128
|
+
* Available status bar styles.
|
|
1129
|
+
*/
|
|
1130
|
+
var SystemBarsStyle;
|
|
1131
|
+
(function (SystemBarsStyle) {
|
|
1132
|
+
/**
|
|
1133
|
+
* Light system bar content on a dark background.
|
|
1134
|
+
*
|
|
1135
|
+
* @since 8.0.0
|
|
1136
|
+
*/
|
|
1137
|
+
SystemBarsStyle["Dark"] = "DARK";
|
|
1138
|
+
/**
|
|
1139
|
+
* For dark system bar content on a light background.
|
|
1140
|
+
*
|
|
1141
|
+
* @since 8.0.0
|
|
1142
|
+
*/
|
|
1143
|
+
SystemBarsStyle["Light"] = "LIGHT";
|
|
1144
|
+
/**
|
|
1145
|
+
* The style is based on the device appearance or the underlying content.
|
|
1146
|
+
* If the device is using Dark mode, the system bars content will be light.
|
|
1147
|
+
* If the device is using Light mode, the system bars content will be dark.
|
|
1148
|
+
*
|
|
1149
|
+
* @since 8.0.0
|
|
1150
|
+
*/
|
|
1151
|
+
SystemBarsStyle["Default"] = "DEFAULT";
|
|
1152
|
+
})(SystemBarsStyle || (SystemBarsStyle = {}));
|
|
1153
|
+
/**
|
|
1154
|
+
* Available system bar types.
|
|
1155
|
+
*/
|
|
1156
|
+
var SystemBarType;
|
|
1157
|
+
(function (SystemBarType) {
|
|
1158
|
+
/**
|
|
1159
|
+
* The top status bar on both Android and iOS.
|
|
1160
|
+
*
|
|
1161
|
+
* @since 8.0.0
|
|
1162
|
+
*/
|
|
1163
|
+
SystemBarType["StatusBar"] = "StatusBar";
|
|
1164
|
+
/**
|
|
1165
|
+
* The navigation bar (or gesture bar on iOS) on both Android and iOS.
|
|
1166
|
+
*
|
|
1167
|
+
* @since 8.0.0
|
|
1168
|
+
*/
|
|
1169
|
+
SystemBarType["NavigationBar"] = "NavigationBar";
|
|
1170
|
+
})(SystemBarType || (SystemBarType = {}));
|
|
1171
|
+
class SystemBarsPluginWeb extends WebPlugin {
|
|
1172
|
+
async setStyle() {
|
|
1173
|
+
this.unavailable('not available for web');
|
|
1174
|
+
}
|
|
1175
|
+
async setAnimation() {
|
|
1176
|
+
this.unavailable('not available for web');
|
|
1177
|
+
}
|
|
1178
|
+
async show() {
|
|
1179
|
+
this.unavailable('not available for web');
|
|
1180
|
+
}
|
|
1181
|
+
async hide() {
|
|
1182
|
+
this.unavailable('not available for web');
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
registerPlugin('SystemBars', {
|
|
1186
|
+
web: () => new SystemBarsPluginWeb(),
|
|
1187
|
+
});
|
|
1199
1188
|
|
|
1200
1189
|
class CapacitorCoreNativeCallerProvider {
|
|
1201
1190
|
getNativeCaller(_proxyType) {
|
|
@@ -1234,5 +1223,5 @@ registerPlugin(corePluginName, {
|
|
|
1234
1223
|
// tslint:disable-next-line:variable-name
|
|
1235
1224
|
const ScanditCaptureCorePlugin = new ScanditCaptureCorePluginImplementation();
|
|
1236
1225
|
|
|
1237
|
-
export { AimerViewfinder, Anchor, Brush, Camera, CameraPosition, CameraSettings, Capacitor$1 as CapacitorCore, CapacitorNativeCaller, ClusteringMode, Color, ContextStatus, DataCaptureContext, DataCaptureContextSettings, DataCaptureVersion, DataCaptureView, Direction, Expiration, Feedback, FocusGestureStrategy, FocusRange, FontFamily, FrameDataSettings, FrameDataSettingsBuilder, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LicenseInfo, LogoStyle, MacroMode, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, OpenSourceSoftwareLicenseInfo, Orientation, Point, PointWithUnit, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, ScanIntention, ScanditCaptureCorePlugin, ScanditCaptureCorePluginImplementation, ScanditIcon, ScanditIconBuilder, ScanditIconShape, ScanditIconType, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SwipeToZoom, TapToFocus, TextAlignment, TorchState, TorchSwitchControl, Vibration, VideoResolution, VolumeButtonObserver, ZoomSwitchControl, capacitorExec, doReturnWithFinish };
|
|
1226
|
+
export { AimerViewfinder, Anchor, Brush, Camera, CameraPosition, CameraSettings, Capacitor$1 as CapacitorCore, CapacitorNativeCaller, ClusteringMode, Color, ContextStatus, DataCaptureContext, DataCaptureContextSettings, DataCaptureVersion, DataCaptureView, Direction, Expiration, Feedback, FocusGestureStrategy, FocusRange, FontFamily, FrameDataSettings, FrameDataSettingsBuilder, FrameSourceState, ImageBuffer, ImageFrameSource, LaserlineViewfinder, LicenseInfo, LogoStyle, MacroMode, MarginsWithUnit, MeasureUnit, NoViewfinder, NoneLocationSelection, NumberWithUnit, OpenSourceSoftwareLicenseInfo, Orientation, PinchToZoom, Point, PointWithUnit, Quadrilateral, RadiusLocationSelection, Rect, RectWithUnit, RectangularLocationSelection, RectangularViewfinder, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle, ScanIntention, ScanditCaptureCorePlugin, ScanditCaptureCorePluginImplementation, ScanditIcon, ScanditIconBuilder, ScanditIconShape, ScanditIconType, Size, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizingMode, Sound, SwipeToZoom, TapToFocus, TextAlignment, TorchState, TorchSwitchControl, Vibration, VideoResolution, VolumeButtonObserver, ZoomSwitchControl, ZoomSwitchOrientation, capacitorExec, doReturnWithFinish };
|
|
1238
1227
|
//# sourceMappingURL=index.js.map
|