idmission-web-sdk 2.3.111 → 2.3.113

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/dist/sdk2.esm.js CHANGED
@@ -205,7 +205,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
205
205
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
206
206
  };
207
207
 
208
- var webSdkVersion = '2.3.111';
208
+ var webSdkVersion = '2.3.113';
209
209
 
210
210
  function getPlatform() {
211
211
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -14250,7 +14250,7 @@ var SignaturePaperBacking = styled.div(templateObject_1$d || (templateObject_1$d
14250
14250
  return ((_a = props.theme.signatureCapture) === null || _a === void 0 ? void 0 : _a.backgroundPosition) ? "background-position: ".concat((_b = props.theme.signatureCapture) === null || _b === void 0 ? void 0 : _b.backgroundPosition, ";") : "";
14251
14251
  });
14252
14252
  var SignatureCanvasContainer$1 = styled.div(templateObject_2$c || (templateObject_2$c = __makeTemplateObject(["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"], ["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"])));
14253
- var SignaturePad = styled.div(templateObject_3$a || (templateObject_3$a = __makeTemplateObject(["\n position: relative;\n background: ", ";\n border: ", ";\n border-radius: ", ";\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n\n &.empty {\n background: ", ";\n border: ", ";\n color: ", ";\n }\n\n &.head-tracking-unsatisfied {\n background: ", ";\n border: ", ";\n color: ", ";\n }\n"], ["\n position: relative;\n background: ", ";\n border: ", ";\n border-radius: ", ";\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n\n &.empty {\n background: ", ";\n border: ", ";\n color: ", ";\n }\n\n &.head-tracking-unsatisfied {\n background: ", ";\n border: ", ";\n color: ", ";\n }\n"])), function (props) {
14253
+ var SignaturePad = styled.div(templateObject_3$a || (templateObject_3$a = __makeTemplateObject(["\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n background: ", ";\n border: ", ";\n border-radius: ", ";\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n\n &.empty {\n background: ", ";\n border: ", ";\n color: ", ";\n }\n\n &.head-tracking-unsatisfied {\n background: ", ";\n border: ", ";\n color: ", ";\n }\n"], ["\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n background: ", ";\n border: ", ";\n border-radius: ", ";\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n\n &.empty {\n background: ", ";\n border: ", ";\n color: ", ";\n }\n\n &.head-tracking-unsatisfied {\n background: ", ";\n border: ", ";\n color: ", ";\n }\n"])), function (props) {
14254
14254
  var _a, _b, _c;
14255
14255
  return (_c = (_b = (_a = props.theme.signatureCapture) === null || _a === void 0 ? void 0 : _a.canvas) === null || _b === void 0 ? void 0 : _b.background) !== null && _c !== void 0 ? _c : 'rgba(255, 255, 255, 0.5)';
14256
14256
  }, function (props) {
@@ -14686,16 +14686,34 @@ function VideoSignaturePad(_a) {
14686
14686
  signaturePad: signaturePad
14687
14687
  });
14688
14688
  }, []);
14689
+ // We discovered that react-signature-canvas clears the canvas when the width and height are changed.
14690
+ // On some devices, the width and height appear to be occilating, so we lock them to the first observed width and height.
14691
+ // Consequently, the signature canvas is also locked to the first observed width and height, so resize behavior can be a little bit weird.
14692
+ var _j = useState(undefined),
14693
+ lockedWidth = _j[0],
14694
+ setLockedWidth = _j[1];
14695
+ var _k = useState(undefined),
14696
+ lockedHeight = _k[0],
14697
+ setLockedHeight = _k[1];
14698
+ useEffect(function () {
14699
+ if (!width || width < 10 || !height || height < 10) return;
14700
+ setLockedWidth(function (lockedWidth) {
14701
+ return lockedWidth !== null && lockedWidth !== void 0 ? lockedWidth : width;
14702
+ });
14703
+ setLockedHeight(function (lockedHeight) {
14704
+ return lockedHeight !== null && lockedHeight !== void 0 ? lockedHeight : height;
14705
+ });
14706
+ }, [width, height]);
14689
14707
  var canvasProps = useMemo(function () {
14690
14708
  return {
14691
- width: width,
14692
- height: height,
14709
+ width: lockedWidth,
14710
+ height: lockedHeight,
14693
14711
  className: classNames.signatureCanvas
14694
14712
  };
14695
- }, [classNames.signatureCanvas, height, width]);
14696
- var _j = useState(false),
14697
- emptyContentDismissed = _j[0],
14698
- setEmptyContentDismissed = _j[1];
14713
+ }, [classNames.signatureCanvas, lockedHeight, lockedWidth]);
14714
+ var _l = useState(false),
14715
+ emptyContentDismissed = _l[0],
14716
+ setEmptyContentDismissed = _l[1];
14699
14717
  useEffect(function () {
14700
14718
  if (signaturePadEmpty) setEmptyContentDismissed(false);
14701
14719
  }, [signaturePadEmpty]);
@@ -15011,6 +15029,9 @@ var templateObject_1$8, templateObject_2$8, templateObject_3$7, templateObject_4
15011
15029
  var assetSelectorOpts$1 = [{
15012
15030
  value: 'signatureVideo',
15013
15031
  label: 'Signature Video'
15032
+ }, {
15033
+ value: 'signatureImage',
15034
+ label: 'Signature Image'
15014
15035
  }, {
15015
15036
  value: 'selfieImage',
15016
15037
  label: 'Selfie Image'
@@ -15070,6 +15091,9 @@ var VideoSignatureSuccess = function VideoSignatureSuccess(_a) {
15070
15091
  controls: true,
15071
15092
  preload: "metadata",
15072
15093
  autoPlay: true
15094
+ })), displayedAsset === 'signatureImage' && ctx.signatureData && ( /*#__PURE__*/React__default.createElement("img", {
15095
+ src: "data:image/jpeg;base64,".concat(ctx.signatureData.fileContent),
15096
+ alt: ""
15073
15097
  })), displayedAsset === 'selfieImage' && ctx.selfieImage && ( /*#__PURE__*/React__default.createElement("img", {
15074
15098
  src: ctx.selfieImage,
15075
15099
  alt: ""