@yoobic/yobi 8.5.33 → 8.5.34

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.
@@ -62,6 +62,7 @@ const YooFormCaptureComponent = class {
62
62
  this.max = 1;
63
63
  this.allowCamera = true;
64
64
  this.validators = [];
65
+ this.useStitching = false;
65
66
  this.isProcessingPhoto = true;
66
67
  this.isSelectorMode = false;
67
68
  this.selectedIndex = [];
@@ -249,6 +250,9 @@ const YooFormCaptureComponent = class {
249
250
  if (this.extraData.imageRecognitionResults) {
250
251
  this.imageRecognitionResults = this.extraData.imageRecognitionResults;
251
252
  }
253
+ if (this.extraData.useStitching) {
254
+ this.useStitching = this.extraData.useStitching;
255
+ }
252
256
  }
253
257
  this.initTags();
254
258
  }
@@ -430,7 +434,7 @@ const YooFormCaptureComponent = class {
430
434
  // Lenovo bug with taking photo, use media capture plugin or low pref cam instead
431
435
  const useMediaCapture = index.isLenovo() && !useLowPerfCamera && !useLibrary && mediaType === cameraHelpers.MediaType.PICTURE;
432
436
  let promise;
433
- if (this.algorithm && this.algorithm.stitch && !useLibrary) {
437
+ if (this.algorithm && this.useStitching && !useLibrary) {
434
438
  let stitchDirection = null;
435
439
  const buttons = [
436
440
  { text: index.translate('TOPTOBOTTOM'), icon: 'big-arrow-down', handler: () => {
@@ -1355,9 +1359,19 @@ const YooFormCaptureComponent = class {
1355
1359
  return (index$1.h("div", { class: "readonly-container" }, this.type === 'audio' ? this.renderAudio(this.value) : this.renderPreview(), this.extraData && this.extraData.distance && this.renderDistance(), this.hasExtraData() && !this.isHistory && this.renderEditIcon()));
1356
1360
  }
1357
1361
  else {
1358
- return (index$1.h("div", { class: "single" }, this.renderCameraContainer(this.value), this.isImageRecognition && !this.isBackgroundProcess && this.renderButtonContainer()));
1362
+ return (index$1.h("div", { class: "single" }, this.renderCameraContainer(this.value), this.isImageRecognition && this.renderButtonContainer()));
1359
1363
  }
1360
1364
  }
1365
+ toggleStitching(ev) {
1366
+ ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
1367
+ this.useStitching = !this.useStitching;
1368
+ this.extraData.useStitching = this.useStitching;
1369
+ this.extraDataChanged.emit(this.extraData);
1370
+ }
1371
+ renderStitchingToggle() {
1372
+ var _a;
1373
+ return (this.isImageRecognition && this.allowStitching && (index$1.h("div", { class: { 'capture-status': true, 'image-reco': this.isImageRecognition } }, index$1.h("div", { class: "status-counters" }, index.translate('YOOBICUSESTITCHING')), index$1.h("div", null, index$1.h("yoo-form-toggle", { class: "app-color", size: "medium", readonly: ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0, value: this.useStitching, onInputChanged: (ev) => { this.toggleStitching(ev); } })))));
1374
+ }
1361
1375
  renderCaptureStatus() {
1362
1376
  const value = this.value || [];
1363
1377
  return (value && (index$1.h("div", { class: { 'capture-status': true, 'image-reco': this.isImageRecognition } }, this.required && (index$1.h("div", { class: "status" }, value.length > this.min
@@ -1459,11 +1473,11 @@ const YooFormCaptureComponent = class {
1459
1473
  }
1460
1474
  renderMultipleInNormalMode() {
1461
1475
  const value = this.value || [];
1462
- return (index$1.h("div", { class: "multiple" }, this.showImageLoader ? index$1.h("yoo-loader", { class: "absolute backdrop", size: "large" }) : null, this.renderCaptureStatus(), index$1.h("div", { class: { 'camera-containers': true, 'no-padding': this.hideOptional } }, this.renderAddCameraContainer(), lodash.isArray(value) &&
1476
+ return (index$1.h("div", { class: "multiple" }, this.showImageLoader ? index$1.h("yoo-loader", { class: "absolute backdrop", size: "large" }) : null, this.renderStitchingToggle(), this.renderCaptureStatus(), index$1.h("div", { class: { 'camera-containers': true, 'no-padding': this.hideOptional } }, this.renderAddCameraContainer(), lodash.isArray(value) &&
1463
1477
  value.length > 0 &&
1464
1478
  value.map((item, index) => {
1465
1479
  return this.renderCameraContainer(item, index);
1466
- })), this.isImageRecognition && !this.isBackgroundProcess ? this.renderButtonContainer() : null));
1480
+ })), this.isImageRecognition ? this.renderButtonContainer() : null));
1467
1481
  }
1468
1482
  renderAddCameraContainer(index = -1) {
1469
1483
  return (index$1.h("div", { class: "camera-container", ref: (el) => (this.cameraContainerElement = el), onClick: (ev) => this.onShowActionSheet(null, index, ev) }, index$1.h("input", { name: "file", multiple: true, class: "add-input", type: "file", onChange: () => this.onAddFileSelect(), accept: this.getAcceptExtension() }), index$1.h("yoo-icon", { size: this.iconSize, name: this.getIcon(), color: this.disabled ? 'light' : 'app-color' })));
@@ -1646,7 +1646,8 @@ const YooFormDynamicComponent = class {
1646
1646
  tags: data[field.name].tags,
1647
1647
  _geoloc: data[field.name]._geoloc,
1648
1648
  imageRecognitionResults: data[field.name].imageRecognitionResults,
1649
- priceRecognitionResults: data[field.name].priceRecognitionResults
1649
+ priceRecognitionResults: data[field.name].priceRecognitionResults,
1650
+ useStitching: data[field.name].useStitching
1650
1651
  };
1651
1652
  }
1652
1653
  }
@@ -4007,9 +4008,10 @@ const YooFormDynamicComponent = class {
4007
4008
  allowCamera: field.allowCamera,
4008
4009
  allowUserImages: field.allowUserImages,
4009
4010
  isImageRecognition: field.isImageRecognition,
4011
+ allowStitching: field.allowStitching,
4012
+ useStitching: field.useStitching,
4010
4013
  algorithm: field.imageRecognitionAlgorithm,
4011
4014
  algorithmDisplay: field.imageRecognitionDisplay,
4012
- isBackgroundProcess: field.isBackgroundProcess,
4013
4015
  label: formHelpers.generateLabel(field),
4014
4016
  multiple: field.type === index.FormFieldType.multiphotos,
4015
4017
  min: field.minPhotos || 1,
@@ -18,6 +18,7 @@ export class YooFormCaptureComponent {
18
18
  this.max = 1;
19
19
  this.allowCamera = true;
20
20
  this.validators = [];
21
+ this.useStitching = false;
21
22
  this.isProcessingPhoto = true;
22
23
  this.isSelectorMode = false;
23
24
  this.selectedIndex = [];
@@ -205,6 +206,9 @@ export class YooFormCaptureComponent {
205
206
  if (this.extraData.imageRecognitionResults) {
206
207
  this.imageRecognitionResults = this.extraData.imageRecognitionResults;
207
208
  }
209
+ if (this.extraData.useStitching) {
210
+ this.useStitching = this.extraData.useStitching;
211
+ }
208
212
  }
209
213
  this.initTags();
210
214
  }
@@ -386,7 +390,7 @@ export class YooFormCaptureComponent {
386
390
  // Lenovo bug with taking photo, use media capture plugin or low pref cam instead
387
391
  const useMediaCapture = isLenovo() && !useLowPerfCamera && !useLibrary && mediaType === MediaType.PICTURE;
388
392
  let promise;
389
- if (this.algorithm && this.algorithm.stitch && !useLibrary) {
393
+ if (this.algorithm && this.useStitching && !useLibrary) {
390
394
  let stitchDirection = null;
391
395
  const buttons = [
392
396
  { text: translate('TOPTOBOTTOM'), icon: 'big-arrow-down', handler: () => {
@@ -1311,9 +1315,19 @@ export class YooFormCaptureComponent {
1311
1315
  return (h("div", { class: "readonly-container" }, this.type === 'audio' ? this.renderAudio(this.value) : this.renderPreview(), this.extraData && this.extraData.distance && this.renderDistance(), this.hasExtraData() && !this.isHistory && this.renderEditIcon()));
1312
1316
  }
1313
1317
  else {
1314
- return (h("div", { class: "single" }, this.renderCameraContainer(this.value), this.isImageRecognition && !this.isBackgroundProcess && this.renderButtonContainer()));
1318
+ return (h("div", { class: "single" }, this.renderCameraContainer(this.value), this.isImageRecognition && this.renderButtonContainer()));
1315
1319
  }
1316
1320
  }
1321
+ toggleStitching(ev) {
1322
+ ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
1323
+ this.useStitching = !this.useStitching;
1324
+ this.extraData.useStitching = this.useStitching;
1325
+ this.extraDataChanged.emit(this.extraData);
1326
+ }
1327
+ renderStitchingToggle() {
1328
+ var _a;
1329
+ return (this.isImageRecognition && this.allowStitching && (h("div", { class: { 'capture-status': true, 'image-reco': this.isImageRecognition } }, h("div", { class: "status-counters" }, translate('YOOBICUSESTITCHING')), h("div", null, h("yoo-form-toggle", { class: "app-color", size: "medium", readonly: ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0, value: this.useStitching, onInputChanged: (ev) => { this.toggleStitching(ev); } })))));
1330
+ }
1317
1331
  renderCaptureStatus() {
1318
1332
  const value = this.value || [];
1319
1333
  return (value && (h("div", { class: { 'capture-status': true, 'image-reco': this.isImageRecognition } }, this.required && (h("div", { class: "status" }, value.length > this.min
@@ -1415,11 +1429,11 @@ export class YooFormCaptureComponent {
1415
1429
  }
1416
1430
  renderMultipleInNormalMode() {
1417
1431
  const value = this.value || [];
1418
- return (h("div", { class: "multiple" }, this.showImageLoader ? h("yoo-loader", { class: "absolute backdrop", size: "large" }) : null, this.renderCaptureStatus(), h("div", { class: { 'camera-containers': true, 'no-padding': this.hideOptional } }, this.renderAddCameraContainer(), isArray(value) &&
1432
+ return (h("div", { class: "multiple" }, this.showImageLoader ? h("yoo-loader", { class: "absolute backdrop", size: "large" }) : null, this.renderStitchingToggle(), this.renderCaptureStatus(), h("div", { class: { 'camera-containers': true, 'no-padding': this.hideOptional } }, this.renderAddCameraContainer(), isArray(value) &&
1419
1433
  value.length > 0 &&
1420
1434
  value.map((item, index) => {
1421
1435
  return this.renderCameraContainer(item, index);
1422
- })), this.isImageRecognition && !this.isBackgroundProcess ? this.renderButtonContainer() : null));
1436
+ })), this.isImageRecognition ? this.renderButtonContainer() : null));
1423
1437
  }
1424
1438
  renderAddCameraContainer(index = -1) {
1425
1439
  return (h("div", { class: "camera-container", ref: (el) => (this.cameraContainerElement = el), onClick: (ev) => this.onShowActionSheet(null, index, ev) }, h("input", { name: "file", multiple: true, class: "add-input", type: "file", onChange: () => this.onAddFileSelect(), accept: this.getAcceptExtension() }), h("yoo-icon", { size: this.iconSize, name: this.getIcon(), color: this.disabled ? 'light' : 'app-color' })));
@@ -2084,6 +2098,23 @@ export class YooFormCaptureComponent {
2084
2098
  "attribute": "is-image-recognition",
2085
2099
  "reflect": false
2086
2100
  },
2101
+ "allowStitching": {
2102
+ "type": "boolean",
2103
+ "mutable": false,
2104
+ "complexType": {
2105
+ "original": "boolean",
2106
+ "resolved": "boolean",
2107
+ "references": {}
2108
+ },
2109
+ "required": false,
2110
+ "optional": false,
2111
+ "docs": {
2112
+ "tags": [],
2113
+ "text": ""
2114
+ },
2115
+ "attribute": "allow-stitching",
2116
+ "reflect": false
2117
+ },
2087
2118
  "algorithm": {
2088
2119
  "type": "unknown",
2089
2120
  "mutable": false,
@@ -2141,23 +2172,6 @@ export class YooFormCaptureComponent {
2141
2172
  "attribute": "is-animation-finished",
2142
2173
  "reflect": false
2143
2174
  },
2144
- "isBackgroundProcess": {
2145
- "type": "boolean",
2146
- "mutable": false,
2147
- "complexType": {
2148
- "original": "boolean",
2149
- "resolved": "boolean",
2150
- "references": {}
2151
- },
2152
- "required": false,
2153
- "optional": false,
2154
- "docs": {
2155
- "tags": [],
2156
- "text": ""
2157
- },
2158
- "attribute": "is-background-process",
2159
- "reflect": false
2160
- },
2161
2175
  "label": {
2162
2176
  "type": "string",
2163
2177
  "mutable": false,
@@ -2443,6 +2457,24 @@ export class YooFormCaptureComponent {
2443
2457
  },
2444
2458
  "attribute": "allow-u-r-l-input",
2445
2459
  "reflect": false
2460
+ },
2461
+ "useStitching": {
2462
+ "type": "boolean",
2463
+ "mutable": true,
2464
+ "complexType": {
2465
+ "original": "boolean",
2466
+ "resolved": "boolean",
2467
+ "references": {}
2468
+ },
2469
+ "required": false,
2470
+ "optional": false,
2471
+ "docs": {
2472
+ "tags": [],
2473
+ "text": ""
2474
+ },
2475
+ "attribute": "use-stitching",
2476
+ "reflect": false,
2477
+ "defaultValue": "false"
2446
2478
  }
2447
2479
  };
2448
2480
  }
@@ -1446,7 +1446,8 @@ export class YooFormDynamicComponent {
1446
1446
  tags: data[field.name].tags,
1447
1447
  _geoloc: data[field.name]._geoloc,
1448
1448
  imageRecognitionResults: data[field.name].imageRecognitionResults,
1449
- priceRecognitionResults: data[field.name].priceRecognitionResults
1449
+ priceRecognitionResults: data[field.name].priceRecognitionResults,
1450
+ useStitching: data[field.name].useStitching
1450
1451
  };
1451
1452
  }
1452
1453
  }
@@ -3807,9 +3808,10 @@ export class YooFormDynamicComponent {
3807
3808
  allowCamera: field.allowCamera,
3808
3809
  allowUserImages: field.allowUserImages,
3809
3810
  isImageRecognition: field.isImageRecognition,
3811
+ allowStitching: field.allowStitching,
3812
+ useStitching: field.useStitching,
3810
3813
  algorithm: field.imageRecognitionAlgorithm,
3811
3814
  algorithmDisplay: field.imageRecognitionDisplay,
3812
- isBackgroundProcess: field.isBackgroundProcess,
3813
3815
  label: generateLabel(field),
3814
3816
  multiple: field.type === FormFieldType.multiphotos,
3815
3817
  min: field.minPhotos || 1,