idmission-web-sdk 2.2.55 → 2.2.57

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
@@ -203,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
203
203
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
204
204
  };
205
205
 
206
- var webSdkVersion = '2.2.55';
206
+ var webSdkVersion = '2.2.57';
207
207
 
208
208
  function getPlatform() {
209
209
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -485,7 +485,16 @@ var OverlayImageRow = styled.div(templateObject_4$l || (templateObject_4$l = __m
485
485
  var GrayOverlayContainer = styled(OverlayContainer)(templateObject_5$c || (templateObject_5$c = __makeTemplateObject(["\n background: #f7f6fb;\n"], ["\n background: #f7f6fb;\n"])));
486
486
  var ButtonsColumn = styled.div(templateObject_6$9 || (templateObject_6$9 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 15px 0;\n justify-content: center;\n margin-top: 24px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 15px 0;\n justify-content: center;\n margin-top: 24px;\n"])));
487
487
  var WideButton = styled(LoaderButton)(templateObject_7$6 || (templateObject_7$6 = __makeTemplateObject(["\n width: 100%;\n border-radius: 30px;\n"], ["\n width: 100%;\n border-radius: 30px;\n"])));
488
- var WideBorderButton = styled(WideButton)(templateObject_8$3 || (templateObject_8$3 = __makeTemplateObject(["\n color: black;\n background: white;\n border: 1px solid var(--idm-color-secondary-500);\n box-sizing: border-box;\n"], ["\n color: black;\n background: white;\n border: 1px solid var(--idm-color-secondary-500);\n box-sizing: border-box;\n"])));
488
+ var WideBorderButton = styled(WideButton)(templateObject_8$3 || (templateObject_8$3 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n box-sizing: border-box;\n"], ["\n color: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n box-sizing: border-box;\n"])), function (props) {
489
+ var _a, _b;
490
+ return (_b = (_a = props.colors) === null || _a === void 0 ? void 0 : _a.textColor) !== null && _b !== void 0 ? _b : 'black';
491
+ }, function (props) {
492
+ var _a, _b;
493
+ return (_b = (_a = props.colors) === null || _a === void 0 ? void 0 : _a.backgroundColor) !== null && _b !== void 0 ? _b : 'white';
494
+ }, function (props) {
495
+ var _a, _b;
496
+ return (_b = (_a = props.colors) === null || _a === void 0 ? void 0 : _a.borderColor) !== null && _b !== void 0 ? _b : 'var(--idm-color-secondary-500)';
497
+ });
489
498
  var templateObject_1$J, templateObject_2$A, templateObject_3$r, templateObject_4$l, templateObject_5$c, templateObject_6$9, templateObject_7$6, templateObject_8$3;
490
499
 
491
500
  var GeolocationAccessDeniedOverlay = function GeolocationAccessDeniedOverlay(_a) {
@@ -1296,7 +1305,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
1296
1305
  var uploadDocument = useCallback(function (src, metadata) {
1297
1306
  return new Promise(function (resolve, reject) {
1298
1307
  return __awaiter(void 0, void 0, void 0, function () {
1299
- var blob, _a, upload, _b, _c;
1308
+ var blob, _a, documentId, upload, _b, _c;
1300
1309
  var _d, _e;
1301
1310
  var _f;
1302
1311
  return __generator(this, function (_g) {
@@ -1334,9 +1343,22 @@ var SubmissionProvider = function SubmissionProvider(_a) {
1334
1343
  percentage: (bytesUploaded / bytesTotal * 100).toFixed(2) + '%',
1335
1344
  metadata: metadata
1336
1345
  });
1346
+ }, _d.onAfterResponse = function (_req, res) {
1347
+ var contentType = res.getHeader('Content-Type');
1348
+ if (!(contentType === null || contentType === void 0 ? void 0 : contentType.startsWith('application/json'))) return;
1349
+ var body = res.getBody();
1350
+ if (!body) return;
1351
+ try {
1352
+ var parsedId = JSON.parse(body).id;
1353
+ if (parsedId.startsWith('urn:documentsv1:')) {
1354
+ documentId = parsedId;
1355
+ }
1356
+ } catch (e) {
1357
+ warn('Failed to parse documents service response body', e);
1358
+ }
1337
1359
  }, _d.onSuccess = function () {
1338
1360
  var _a, _b;
1339
- var documentId = 'urn:documentsv1:' + ((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift());
1361
+ documentId || (documentId = "urn:documentsv1:".concat((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
1340
1362
  (_b = onDocumentUploaded.current) === null || _b === void 0 ? void 0 : _b.call(onDocumentUploaded, documentId, metadata);
1341
1363
  resolve(documentId);
1342
1364
  }, _d.onError = function (error) {