@unissey-web/sdk-react 5.0.0-rc.8 → 5.0.0-rc.9

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -553,7 +553,7 @@ var EN = {
553
553
  };
554
554
 
555
555
  var name$1 = "@unissey-web/web-components";
556
- var version$1 = "5.0.0-rc.8";
556
+ var version$1 = "5.0.0-rc.9";
557
557
  var description$1 = "";
558
558
  var module$1 = "./dist/index.js";
559
559
  var typings$1 = "./dist/index.d.ts";
@@ -619,7 +619,7 @@ var buildPacked = {exports: {}};
619
619
  }(buildPacked, buildPacked.exports));
620
620
 
621
621
  var _templateObject$f;
622
- var cameraStyle = i$1(_templateObject$f || (_templateObject$f = _taggedTemplateLiteral(["\n .container {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .wrapper {\n position: relative;\n top: 0;\n left: 0;\n width: ", ";\n }\n\n .hints,\n .instructions,\n .errors,\n .flip-icon-container,\n .face-hints {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n .face-hints {\n width: 100%;\n height: 100%;\n z-index: 5;\n }\n\n .top-hints {\n margin-bottom: 20px;\n }\n\n .bottom-hints {\n margin-top: 20px;\n }\n\n .spinner {\n z-index: -1;\n width: 100%;\n height: 400px;\n }\n\n .flip-icon-container {\n z-index: 4;\n }\n\n .flip-icon {\n position: absolute;\n bottom: 5%;\n left: 5d%;\n }\n\n .hints {\n z-index: 3;\n }\n\n .instructions {\n z-index: 4;\n }\n\n .errors {\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 3;\n\n border-radius: 10px;\n }\n\n .errors .message {\n display: inline-block;\n width: 70%;\n background-color: ", ";\n color: var(--uni-light-color, #fff);\n padding: 7px 15px;\n border-radius: 5px;\n text-align: center;\n }\n\n .item-center {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .buttons {\n text-align: center;\n width: 100%;\n\n margin: ", ";\n }\n\n .buttons-item {\n padding: 7px;\n }\n\n @media screen and (max-width: 576px) {\n .buttons-item {\n width: 95%;\n }\n\n .buttons {\n margin-top: 15px;\n }\n }\n"])), recorderVars.videoWidth, defaultVars.colors.error, recorderVars.buttonsMargin);
622
+ var cameraStyle = i$1(_templateObject$f || (_templateObject$f = _taggedTemplateLiteral(["\n .container {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n .wrapper {\n position: relative;\n top: 0;\n left: 0;\n width: ", ";\n }\n\n .hints,\n .instructions,\n .errors,\n .flip-icon-container,\n .face-hints {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n .face-hints {\n width: 100%;\n height: 100%;\n z-index: 5;\n }\n\n .top-hints {\n margin-bottom: 20px;\n }\n\n .bottom-hints {\n margin-top: 20px;\n }\n\n .spinner {\n z-index: -1;\n width: 100%;\n height: 400px;\n }\n\n .flip-icon-container {\n z-index: 4;\n }\n\n .flip-icon {\n position: absolute;\n bottom: 5%;\n left: 5d%;\n }\n\n .hints {\n z-index: 3;\n }\n\n .instructions {\n z-index: 4;\n }\n\n .errors {\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 3;\n\n border-radius: 10px;\n }\n\n .errors .message {\n display: inline-block;\n width: 70%;\n background-color: ", ";\n color: var(--uni-light-color, #fff);\n padding: 7px 15px;\n border-radius: 5px;\n text-align: center;\n }\n\n .item-center {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .buttons {\n text-align: center;\n width: 100%;\n\n margin: ", ";\n }\n\n .buttons-item {\n display: inline-block;\n padding: 7px;\n }\n\n @media screen and (max-width: 576px) {\n .buttons-item {\n width: 95%;\n }\n\n .buttons {\n margin-top: 15px;\n }\n }\n"])), recorderVars.videoWidth, defaultVars.colors.error, recorderVars.buttonsMargin);
623
623
 
624
624
  var _templateObject$e;
625
625
  var fadeAnimation = i$1(_templateObject$e || (_templateObject$e = _taggedTemplateLiteral(["\n @keyframes fade {\n from {\n width: 25px;\n margin-left: 0%;\n margin-top: 0%;\n opacity: 1;\n }\n to {\n width: 30px;\n margin-left: -2%;\n margin-top: -2%;\n opacity: 0;\n }\n }\n\n .icon {\n width: 25px;\n animation-name: fade;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n }\n"])));
@@ -1584,41 +1584,46 @@ var Recorder = /*#__PURE__*/function (_LitElement) {
1584
1584
  }, {
1585
1585
  key: "setVideoCustomStyle",
1586
1586
  value: function setVideoCustomStyle() {
1587
- var _this$shadowRoot7, _this$shadowRoot8;
1587
+ var _this$shadowRoot7, _this$shadowRoot8, _this$shadowRoot9;
1588
1588
  var video = (_this$shadowRoot7 = this.shadowRoot) === null || _this$shadowRoot7 === void 0 ? void 0 : _this$shadowRoot7.getElementById(buildPacked.exports.VIDEO_ELEMENT_ID);
1589
- var videoParent = (_this$shadowRoot8 = this.shadowRoot) === null || _this$shadowRoot8 === void 0 ? void 0 : _this$shadowRoot8.getElementById(buildPacked.exports.CONTAINER_ELEMENT_ID);
1589
+ var canvas = (_this$shadowRoot8 = this.shadowRoot) === null || _this$shadowRoot8 === void 0 ? void 0 : _this$shadowRoot8.getElementById(buildPacked.exports.CANVAS_ELEMENT_ID);
1590
+ var videoParent = (_this$shadowRoot9 = this.shadowRoot) === null || _this$shadowRoot9 === void 0 ? void 0 : _this$shadowRoot9.getElementById(buildPacked.exports.CONTAINER_ELEMENT_ID);
1590
1591
  if (video) video.style.filter = recorderVars.videoFilter.cssText;
1591
- if (videoParent) {
1592
+ if (videoParent && this.preset !== buildPacked.exports.AcquisitionPreset.DOC_VIDEO && this.preset !== buildPacked.exports.AcquisitionPreset.DOC_IMAGE) {
1592
1593
  videoParent.style.borderRadius = recorderVars.borderRadius.cssText;
1593
1594
  videoParent.style.boxShadow = recorderVars.boxShadow.cssText;
1595
+ } else if (this.preset === buildPacked.exports.AcquisitionPreset.DOC_VIDEO || this.preset === buildPacked.exports.AcquisitionPreset.DOC_IMAGE) {
1596
+ video.style.borderRadius = recorderVars.borderRadius.cssText;
1597
+ canvas.style.borderRadius = recorderVars.borderRadius.cssText;
1598
+ video.style.boxShadow = recorderVars.boxShadow.cssText;
1594
1599
  }
1595
1600
  }
1596
1601
  }, {
1597
1602
  key: "displaySpinner",
1598
1603
  value: function displaySpinner() {
1599
- var _this$shadowRoot9;
1600
- var spinner = (_this$shadowRoot9 = this.shadowRoot) === null || _this$shadowRoot9 === void 0 ? void 0 : _this$shadowRoot9.querySelector("#spinner");
1604
+ var _this$shadowRoot0;
1605
+ var spinner = (_this$shadowRoot0 = this.shadowRoot) === null || _this$shadowRoot0 === void 0 ? void 0 : _this$shadowRoot0.querySelector("#spinner");
1601
1606
  spinner.style.display = "flex";
1602
1607
  spinner.style.height = "100%";
1603
1608
  }
1604
1609
  }, {
1605
1610
  key: "hideSpinner",
1606
1611
  value: function hideSpinner() {
1607
- var _this$shadowRoot0;
1608
- var spinner = (_this$shadowRoot0 = this.shadowRoot) === null || _this$shadowRoot0 === void 0 ? void 0 : _this$shadowRoot0.querySelector("#spinner");
1612
+ var _this$shadowRoot1;
1613
+ var spinner = (_this$shadowRoot1 = this.shadowRoot) === null || _this$shadowRoot1 === void 0 ? void 0 : _this$shadowRoot1.querySelector("#spinner");
1609
1614
  spinner.style.display = "none";
1610
1615
  }
1611
1616
  }, {
1612
1617
  key: "displayError",
1613
1618
  value: function () {
1614
1619
  var _displayError = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(message) {
1615
- var _this$shadowRoot1;
1620
+ var _this$shadowRoot10;
1616
1621
  var errors;
1617
1622
  return _regenerator().w(function (_context9) {
1618
1623
  while (1) switch (_context9.n) {
1619
1624
  case 0:
1620
1625
  this.error = message !== null && message !== void 0 ? message : "Error";
1621
- errors = (_this$shadowRoot1 = this.shadowRoot) === null || _this$shadowRoot1 === void 0 ? void 0 : _this$shadowRoot1.querySelector("#errors");
1626
+ errors = (_this$shadowRoot10 = this.shadowRoot) === null || _this$shadowRoot10 === void 0 ? void 0 : _this$shadowRoot10.querySelector("#errors");
1622
1627
  errors.style.display = "flex";
1623
1628
  errors.style.height = "100%";
1624
1629
  case 1:
@@ -1634,8 +1639,8 @@ var Recorder = /*#__PURE__*/function (_LitElement) {
1634
1639
  }, {
1635
1640
  key: "hideError",
1636
1641
  value: function hideError() {
1637
- var _this$shadowRoot10;
1638
- var errors = (_this$shadowRoot10 = this.shadowRoot) === null || _this$shadowRoot10 === void 0 ? void 0 : _this$shadowRoot10.querySelector("#errors");
1642
+ var _this$shadowRoot11;
1643
+ var errors = (_this$shadowRoot11 = this.shadowRoot) === null || _this$shadowRoot11 === void 0 ? void 0 : _this$shadowRoot11.querySelector("#errors");
1639
1644
  errors.style.display = "none";
1640
1645
  this.error = "";
1641
1646
  }
@@ -1643,7 +1648,7 @@ var Recorder = /*#__PURE__*/function (_LitElement) {
1643
1648
  key: "render",
1644
1649
  value: function render() {
1645
1650
  // not necessary : this.strings = { ...this.defaultStrings, ...this.strings };
1646
- return x$2(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteral(["\n <div class=\"container\" id=\"container\">\n <div id=\"top-hints\" class=\"top-hints\">\n <slot name=\"ac-top-hints\"></slot>\n </div>\n <div class=\"wrapper\" id=\"wrapper\">\n <div id=\"face-hints\" class=\"face-hints\">\n <slot name=\"ac-face-hints\"></slot>\n </div>\n\n ", "\n\n <uni-overlay-hints\n class=\"hints item-center\"\n hints=\"", "\"\n strings=\"", "\"\n ></uni-overlay-hints>\n\n <div id=\"spinner\" class=\"spinner item-center\" style=\"display: none\">\n <uni-spinner></uni-spinner>\n </div>\n <div class=\"errors\" id=\"errors\">\n <span class=\"message\">", "</span>\n </div>\n </div>\n <div id=\"bottom-hints\" class=\"bottom-hints\">\n <slot name=\"ac-bottom-hints\"></slot>\n <div class=\"ac-bottom-hints\">", "</div>\n </div>\n <div class=\"buttons\" id=\"buttons\">\n <div class=\"buttons-item\">\n <slot name=\"left\"></slot>\n </div>\n\n <div class=\"buttons-item item-center\">\n <!-- Display record/retry button -->\n ", "\n </div>\n </div>\n </div>\n "])), isMobileDevice() && (
1651
+ return x$2(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteral(["\n <div class=\"container\" id=\"container\">\n <div id=\"top-hints\" class=\"top-hints\">\n <slot name=\"ac-top-hints\"></slot>\n </div>\n <div class=\"wrapper\" id=\"wrapper\">\n <div id=\"face-hints\" class=\"face-hints\">\n <slot name=\"ac-face-hints\"></slot>\n </div>\n\n ", "\n\n <uni-overlay-hints\n class=\"hints item-center\"\n hints=\"", "\"\n strings=\"", "\"\n ></uni-overlay-hints>\n\n <div id=\"spinner\" class=\"spinner item-center\" style=\"display: none\">\n <uni-spinner></uni-spinner>\n </div>\n <div class=\"errors\" id=\"errors\">\n <span class=\"message\">", "</span>\n </div>\n </div>\n <div id=\"bottom-hints\" class=\"bottom-hints\">\n <slot name=\"ac-bottom-hints\"></slot>\n <div class=\"ac-bottom-hints\">", "</div>\n </div>\n <div class=\"buttons\" id=\"buttons\">\n <div class=\"buttons-item\">\n <slot name=\"left\"></slot>\n </div>\n\n <div class=\"buttons-item\">\n <!-- Display record/retry button -->\n ", "\n </div>\n </div>\n </div>\n "])), isMobileDevice() && (
1647
1652
  // eslint-disable-next-line no-extra-boolean-cast
1648
1653
  !!this.displayFlipCameraBtn ? this.displayFlipCameraBtn : this.preset === buildPacked.exports.AcquisitionPreset.DOC_VIDEO || this.preset === buildPacked.exports.AcquisitionPreset.DOC_IMAGE) && !this.isRunning() ? x$2(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral([" <div id=\"flip-icon-container\" class=\"flip-icon-container\">\n <uni-flip-camera-icon @click=\"", "\" class=\"flip-icon\"> </uni-flip-camera-icon>\n </div>"])), this.flipCamera) : x$2(_templateObject4$3 || (_templateObject4$3 = _taggedTemplateLiteral([""]))), this.hints, JSON.stringify(this.getString(["hints"])), this.error, this.getString(["hints", this.hints]), !this.hideCaptureBtn || this.willRetryCapture ? x$2(_templateObject5$3 || (_templateObject5$3 = _taggedTemplateLiteral(["<uni-button id=\"capture\" @click=\"", "\">\n <div slot=\"icon\">", "</div>\n ", "\n </uni-button>"])), this.capture, this.captureButtonPicto, this.willRetryCapture ? this.getString(["retry"]) : this.getString(["capture"])) : x$2(_templateObject6$3 || (_templateObject6$3 = _taggedTemplateLiteral([""]))));
1649
1654
  }
@@ -3603,7 +3608,7 @@ function _extends() {
3603
3608
  }
3604
3609
 
3605
3610
  var name = "@unissey-web/sdk-react";
3606
- var version = "5.0.0-rc.8";
3611
+ var version = "5.0.0-rc.9";
3607
3612
  var description = "Unissey React Sdk";
3608
3613
  var license = "ISC";
3609
3614
  var module = "./dist/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unissey-web/sdk-react",
3
- "version": "5.0.0-rc.8",
3
+ "version": "5.0.0-rc.9",
4
4
  "description": "Unissey React Sdk",
5
5
  "license": "ISC",
6
6
  "module": "./dist/index.js",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@lit-labs/react": "^1.0.2",
25
- "@unissey-web/web-components": "5.0.0-rc.8"
25
+ "@unissey-web/web-components": "5.0.0-rc.9"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",