@wise/dynamic-flow-client 2.2.0-beta-baf68b.13 → 2.2.0-beta-4f3927.14
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/build/main.js +192 -16
- package/build/main.min.js +8 -1
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -525,6 +525,168 @@ var require_react_webcam = __commonJS({
|
|
|
525
525
|
}
|
|
526
526
|
});
|
|
527
527
|
|
|
528
|
+
// ../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js
|
|
529
|
+
var require_screenfull = __commonJS({
|
|
530
|
+
"../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js"(exports, module2) {
|
|
531
|
+
(function() {
|
|
532
|
+
"use strict";
|
|
533
|
+
var document2 = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {};
|
|
534
|
+
var isCommonjs = typeof module2 !== "undefined" && module2.exports;
|
|
535
|
+
var fn = function() {
|
|
536
|
+
var val;
|
|
537
|
+
var fnMap = [
|
|
538
|
+
[
|
|
539
|
+
"requestFullscreen",
|
|
540
|
+
"exitFullscreen",
|
|
541
|
+
"fullscreenElement",
|
|
542
|
+
"fullscreenEnabled",
|
|
543
|
+
"fullscreenchange",
|
|
544
|
+
"fullscreenerror"
|
|
545
|
+
],
|
|
546
|
+
// New WebKit
|
|
547
|
+
[
|
|
548
|
+
"webkitRequestFullscreen",
|
|
549
|
+
"webkitExitFullscreen",
|
|
550
|
+
"webkitFullscreenElement",
|
|
551
|
+
"webkitFullscreenEnabled",
|
|
552
|
+
"webkitfullscreenchange",
|
|
553
|
+
"webkitfullscreenerror"
|
|
554
|
+
],
|
|
555
|
+
// Old WebKit
|
|
556
|
+
[
|
|
557
|
+
"webkitRequestFullScreen",
|
|
558
|
+
"webkitCancelFullScreen",
|
|
559
|
+
"webkitCurrentFullScreenElement",
|
|
560
|
+
"webkitCancelFullScreen",
|
|
561
|
+
"webkitfullscreenchange",
|
|
562
|
+
"webkitfullscreenerror"
|
|
563
|
+
],
|
|
564
|
+
[
|
|
565
|
+
"mozRequestFullScreen",
|
|
566
|
+
"mozCancelFullScreen",
|
|
567
|
+
"mozFullScreenElement",
|
|
568
|
+
"mozFullScreenEnabled",
|
|
569
|
+
"mozfullscreenchange",
|
|
570
|
+
"mozfullscreenerror"
|
|
571
|
+
],
|
|
572
|
+
[
|
|
573
|
+
"msRequestFullscreen",
|
|
574
|
+
"msExitFullscreen",
|
|
575
|
+
"msFullscreenElement",
|
|
576
|
+
"msFullscreenEnabled",
|
|
577
|
+
"MSFullscreenChange",
|
|
578
|
+
"MSFullscreenError"
|
|
579
|
+
]
|
|
580
|
+
];
|
|
581
|
+
var i = 0;
|
|
582
|
+
var l = fnMap.length;
|
|
583
|
+
var ret = {};
|
|
584
|
+
for (; i < l; i++) {
|
|
585
|
+
val = fnMap[i];
|
|
586
|
+
if (val && val[1] in document2) {
|
|
587
|
+
for (i = 0; i < val.length; i++) {
|
|
588
|
+
ret[fnMap[0][i]] = val[i];
|
|
589
|
+
}
|
|
590
|
+
return ret;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
return false;
|
|
594
|
+
}();
|
|
595
|
+
var eventNameMap = {
|
|
596
|
+
change: fn.fullscreenchange,
|
|
597
|
+
error: fn.fullscreenerror
|
|
598
|
+
};
|
|
599
|
+
var screenfull2 = {
|
|
600
|
+
request: function(element, options) {
|
|
601
|
+
return new Promise(function(resolve, reject) {
|
|
602
|
+
var onFullScreenEntered = function() {
|
|
603
|
+
this.off("change", onFullScreenEntered);
|
|
604
|
+
resolve();
|
|
605
|
+
}.bind(this);
|
|
606
|
+
this.on("change", onFullScreenEntered);
|
|
607
|
+
element = element || document2.documentElement;
|
|
608
|
+
var returnPromise = element[fn.requestFullscreen](options);
|
|
609
|
+
if (returnPromise instanceof Promise) {
|
|
610
|
+
returnPromise.then(onFullScreenEntered).catch(reject);
|
|
611
|
+
}
|
|
612
|
+
}.bind(this));
|
|
613
|
+
},
|
|
614
|
+
exit: function() {
|
|
615
|
+
return new Promise(function(resolve, reject) {
|
|
616
|
+
if (!this.isFullscreen) {
|
|
617
|
+
resolve();
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
var onFullScreenExit = function() {
|
|
621
|
+
this.off("change", onFullScreenExit);
|
|
622
|
+
resolve();
|
|
623
|
+
}.bind(this);
|
|
624
|
+
this.on("change", onFullScreenExit);
|
|
625
|
+
var returnPromise = document2[fn.exitFullscreen]();
|
|
626
|
+
if (returnPromise instanceof Promise) {
|
|
627
|
+
returnPromise.then(onFullScreenExit).catch(reject);
|
|
628
|
+
}
|
|
629
|
+
}.bind(this));
|
|
630
|
+
},
|
|
631
|
+
toggle: function(element, options) {
|
|
632
|
+
return this.isFullscreen ? this.exit() : this.request(element, options);
|
|
633
|
+
},
|
|
634
|
+
onchange: function(callback) {
|
|
635
|
+
this.on("change", callback);
|
|
636
|
+
},
|
|
637
|
+
onerror: function(callback) {
|
|
638
|
+
this.on("error", callback);
|
|
639
|
+
},
|
|
640
|
+
on: function(event, callback) {
|
|
641
|
+
var eventName = eventNameMap[event];
|
|
642
|
+
if (eventName) {
|
|
643
|
+
document2.addEventListener(eventName, callback, false);
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
off: function(event, callback) {
|
|
647
|
+
var eventName = eventNameMap[event];
|
|
648
|
+
if (eventName) {
|
|
649
|
+
document2.removeEventListener(eventName, callback, false);
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
raw: fn
|
|
653
|
+
};
|
|
654
|
+
if (!fn) {
|
|
655
|
+
if (isCommonjs) {
|
|
656
|
+
module2.exports = { isEnabled: false };
|
|
657
|
+
} else {
|
|
658
|
+
window.screenfull = { isEnabled: false };
|
|
659
|
+
}
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
Object.defineProperties(screenfull2, {
|
|
663
|
+
isFullscreen: {
|
|
664
|
+
get: function() {
|
|
665
|
+
return Boolean(document2[fn.fullscreenElement]);
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
element: {
|
|
669
|
+
enumerable: true,
|
|
670
|
+
get: function() {
|
|
671
|
+
return document2[fn.fullscreenElement];
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
isEnabled: {
|
|
675
|
+
enumerable: true,
|
|
676
|
+
get: function() {
|
|
677
|
+
return Boolean(document2[fn.fullscreenEnabled]);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
if (isCommonjs) {
|
|
682
|
+
module2.exports = screenfull2;
|
|
683
|
+
} else {
|
|
684
|
+
window.screenfull = screenfull2;
|
|
685
|
+
}
|
|
686
|
+
})();
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
|
|
528
690
|
// src/index.ts
|
|
529
691
|
var src_exports = {};
|
|
530
692
|
__export(src_exports, {
|
|
@@ -5847,6 +6009,7 @@ var import_react36 = require("react");
|
|
|
5847
6009
|
var import_react35 = require("react");
|
|
5848
6010
|
var import_react_intl30 = require("react-intl");
|
|
5849
6011
|
var import_react_webcam = __toESM(require_react_webcam());
|
|
6012
|
+
var import_screenfull = __toESM(require_screenfull());
|
|
5850
6013
|
|
|
5851
6014
|
// src/step/cameraStep/cameraCapture/CameraCapture.messages.ts
|
|
5852
6015
|
var import_react_intl22 = require("react-intl");
|
|
@@ -6206,6 +6369,24 @@ var CameraCapture = ({
|
|
|
6206
6369
|
const webcamReference = (0, import_react35.useRef)(null);
|
|
6207
6370
|
const { videoConstraints } = useVideoConstraints(direction);
|
|
6208
6371
|
const intl = (0, import_react_intl30.useIntl)();
|
|
6372
|
+
const lockOrientation = (0, import_react35.useCallback)(() => {
|
|
6373
|
+
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
6374
|
+
window.screen.orientation.lock("portrait").then(() => {
|
|
6375
|
+
console.log("orientation locked");
|
|
6376
|
+
}).catch((e) => {
|
|
6377
|
+
console.log(e);
|
|
6378
|
+
});
|
|
6379
|
+
}
|
|
6380
|
+
}, []);
|
|
6381
|
+
const enterFullScreen = (0, import_react35.useCallback)(() => {
|
|
6382
|
+
if (mode === "CAPTURE" && isMobileDevice && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
|
|
6383
|
+
import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
|
|
6384
|
+
lockOrientation();
|
|
6385
|
+
}).catch((e) => {
|
|
6386
|
+
console.log(e);
|
|
6387
|
+
});
|
|
6388
|
+
}
|
|
6389
|
+
}, [mode, isMobileDevice, lockOrientation]);
|
|
6209
6390
|
const handleCapture = (0, import_react35.useCallback)(async () => {
|
|
6210
6391
|
var _a, _b, _c, _d, _e, _f;
|
|
6211
6392
|
if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
|
|
@@ -6242,11 +6423,12 @@ var CameraCapture = ({
|
|
|
6242
6423
|
);
|
|
6243
6424
|
const handleUserMedia = (0, import_react35.useCallback)(
|
|
6244
6425
|
(stream) => {
|
|
6426
|
+
enterFullScreen();
|
|
6245
6427
|
setReady(true);
|
|
6246
6428
|
setIsVideoMirrored(isSelfieCamera(stream));
|
|
6247
6429
|
void trackCameraFeedStarted(onEvent, { direction }, stream);
|
|
6248
6430
|
},
|
|
6249
|
-
[setIsVideoMirrored, onEvent, direction]
|
|
6431
|
+
[setIsVideoMirrored, onEvent, direction, enterFullScreen]
|
|
6250
6432
|
);
|
|
6251
6433
|
const handleReviewSubmit = () => {
|
|
6252
6434
|
onCapture((reviewImage == null ? void 0 : reviewImage.blob) || null);
|
|
@@ -6257,23 +6439,10 @@ var CameraCapture = ({
|
|
|
6257
6439
|
};
|
|
6258
6440
|
const handleRetryCameraAccess = () => setMode("CAPTURE");
|
|
6259
6441
|
(0, import_react35.useEffect)(() => {
|
|
6260
|
-
if (mode === "CAPTURE" && isMobileDevice && !document.fullscreenElement) {
|
|
6261
|
-
document.documentElement.requestFullscreen({ navigationUI: "show" }).then(() => {
|
|
6262
|
-
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
6263
|
-
window.screen.orientation.lock("portrait").then(() => {
|
|
6264
|
-
console.log("orientation locked");
|
|
6265
|
-
}).catch((e) => {
|
|
6266
|
-
console.log(e);
|
|
6267
|
-
});
|
|
6268
|
-
}
|
|
6269
|
-
}).catch((e) => {
|
|
6270
|
-
console.log(e);
|
|
6271
|
-
});
|
|
6272
|
-
}
|
|
6273
6442
|
return () => {
|
|
6274
6443
|
var _a, _b;
|
|
6275
|
-
if (
|
|
6276
|
-
|
|
6444
|
+
if ((mode !== "CAPTURE" || !isMobileDevice) && import_screenfull.default.isFullscreen) {
|
|
6445
|
+
import_screenfull.default.exit().then(() => {
|
|
6277
6446
|
console.log("Document Exited from Full screen mode");
|
|
6278
6447
|
}).catch((err) => {
|
|
6279
6448
|
console.error(err);
|
|
@@ -7867,4 +8036,11 @@ classnames/index.js:
|
|
|
7867
8036
|
Licensed under the MIT License (MIT), see
|
|
7868
8037
|
http://jedwatson.github.io/classnames
|
|
7869
8038
|
*)
|
|
8039
|
+
|
|
8040
|
+
screenfull/dist/screenfull.js:
|
|
8041
|
+
(*!
|
|
8042
|
+
* screenfull
|
|
8043
|
+
* v5.2.0 - 2021-11-03
|
|
8044
|
+
* (c) Sindre Sorhus; MIT License
|
|
8045
|
+
*)
|
|
7870
8046
|
*/
|