@wise/dynamic-flow-client 2.2.0-beta-baf68b.13 → 2.2.0-beta-31583b.16
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 +211 -25
- 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,37 @@ 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 unlockOrientation = () => {
|
|
6382
|
+
var _a, _b;
|
|
6383
|
+
if ((_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.unlock) {
|
|
6384
|
+
window.screen.orientation.unlock();
|
|
6385
|
+
}
|
|
6386
|
+
};
|
|
6387
|
+
const enterFullScreen = (0, import_react35.useCallback)(() => {
|
|
6388
|
+
if (mode === "CAPTURE" && isMobileDevice && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
|
|
6389
|
+
import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
|
|
6390
|
+
lockOrientation();
|
|
6391
|
+
}).catch((e) => {
|
|
6392
|
+
console.log(e);
|
|
6393
|
+
});
|
|
6394
|
+
}
|
|
6395
|
+
}, [mode, isMobileDevice, lockOrientation]);
|
|
6396
|
+
const exitFullScreen = () => {
|
|
6397
|
+
import_screenfull.default.exit().then(() => {
|
|
6398
|
+
console.log("Document Exited from Full screen mode");
|
|
6399
|
+
}).catch((err) => {
|
|
6400
|
+
console.error(err);
|
|
6401
|
+
});
|
|
6402
|
+
};
|
|
6209
6403
|
const handleCapture = (0, import_react35.useCallback)(async () => {
|
|
6210
6404
|
var _a, _b, _c, _d, _e, _f;
|
|
6211
6405
|
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 +6436,12 @@ var CameraCapture = ({
|
|
|
6242
6436
|
);
|
|
6243
6437
|
const handleUserMedia = (0, import_react35.useCallback)(
|
|
6244
6438
|
(stream) => {
|
|
6439
|
+
enterFullScreen();
|
|
6245
6440
|
setReady(true);
|
|
6246
6441
|
setIsVideoMirrored(isSelfieCamera(stream));
|
|
6247
6442
|
void trackCameraFeedStarted(onEvent, { direction }, stream);
|
|
6248
6443
|
},
|
|
6249
|
-
[setIsVideoMirrored, onEvent, direction]
|
|
6444
|
+
[setIsVideoMirrored, onEvent, direction, enterFullScreen]
|
|
6250
6445
|
);
|
|
6251
6446
|
const handleReviewSubmit = () => {
|
|
6252
6447
|
onCapture((reviewImage == null ? void 0 : reviewImage.blob) || null);
|
|
@@ -6257,33 +6452,17 @@ var CameraCapture = ({
|
|
|
6257
6452
|
};
|
|
6258
6453
|
const handleRetryCameraAccess = () => setMode("CAPTURE");
|
|
6259
6454
|
(0, import_react35.useEffect)(() => {
|
|
6260
|
-
if (mode
|
|
6261
|
-
|
|
6262
|
-
|
|
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
|
-
});
|
|
6455
|
+
if (mode !== "CAPTURE" || !isMobileDevice) {
|
|
6456
|
+
exitFullScreen();
|
|
6457
|
+
unlockOrientation();
|
|
6272
6458
|
}
|
|
6459
|
+
}, [mode, isMobileDevice]);
|
|
6460
|
+
(0, import_react35.useEffect)(() => {
|
|
6273
6461
|
return () => {
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
document.exitFullscreen().then(() => {
|
|
6277
|
-
console.log("Document Exited from Full screen mode");
|
|
6278
|
-
}).catch((err) => {
|
|
6279
|
-
console.error(err);
|
|
6280
|
-
});
|
|
6281
|
-
if ((_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.unlock) {
|
|
6282
|
-
window.screen.orientation.unlock();
|
|
6283
|
-
}
|
|
6284
|
-
}
|
|
6462
|
+
exitFullScreen();
|
|
6463
|
+
unlockOrientation();
|
|
6285
6464
|
};
|
|
6286
|
-
}, [
|
|
6465
|
+
}, []);
|
|
6287
6466
|
const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
6288
6467
|
videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6289
6468
|
import_react_webcam.default,
|
|
@@ -7867,4 +8046,11 @@ classnames/index.js:
|
|
|
7867
8046
|
Licensed under the MIT License (MIT), see
|
|
7868
8047
|
http://jedwatson.github.io/classnames
|
|
7869
8048
|
*)
|
|
8049
|
+
|
|
8050
|
+
screenfull/dist/screenfull.js:
|
|
8051
|
+
(*!
|
|
8052
|
+
* screenfull
|
|
8053
|
+
* v5.2.0 - 2021-11-03
|
|
8054
|
+
* (c) Sindre Sorhus; MIT License
|
|
8055
|
+
*)
|
|
7870
8056
|
*/
|