@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.
@@ -58,6 +58,7 @@ const YooFormCaptureComponent = class {
58
58
  this.max = 1;
59
59
  this.allowCamera = true;
60
60
  this.validators = [];
61
+ this.useStitching = false;
61
62
  this.isProcessingPhoto = true;
62
63
  this.isSelectorMode = false;
63
64
  this.selectedIndex = [];
@@ -245,6 +246,9 @@ const YooFormCaptureComponent = class {
245
246
  if (this.extraData.imageRecognitionResults) {
246
247
  this.imageRecognitionResults = this.extraData.imageRecognitionResults;
247
248
  }
249
+ if (this.extraData.useStitching) {
250
+ this.useStitching = this.extraData.useStitching;
251
+ }
248
252
  }
249
253
  this.initTags();
250
254
  }
@@ -426,7 +430,7 @@ const YooFormCaptureComponent = class {
426
430
  // Lenovo bug with taking photo, use media capture plugin or low pref cam instead
427
431
  const useMediaCapture = isLenovo() && !useLowPerfCamera && !useLibrary && mediaType === MediaType.PICTURE;
428
432
  let promise;
429
- if (this.algorithm && this.algorithm.stitch && !useLibrary) {
433
+ if (this.algorithm && this.useStitching && !useLibrary) {
430
434
  let stitchDirection = null;
431
435
  const buttons = [
432
436
  { text: translate('TOPTOBOTTOM'), icon: 'big-arrow-down', handler: () => {
@@ -1351,9 +1355,19 @@ const YooFormCaptureComponent = class {
1351
1355
  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()));
1352
1356
  }
1353
1357
  else {
1354
- return (h("div", { class: "single" }, this.renderCameraContainer(this.value), this.isImageRecognition && !this.isBackgroundProcess && this.renderButtonContainer()));
1358
+ return (h("div", { class: "single" }, this.renderCameraContainer(this.value), this.isImageRecognition && this.renderButtonContainer()));
1355
1359
  }
1356
1360
  }
1361
+ toggleStitching(ev) {
1362
+ ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
1363
+ this.useStitching = !this.useStitching;
1364
+ this.extraData.useStitching = this.useStitching;
1365
+ this.extraDataChanged.emit(this.extraData);
1366
+ }
1367
+ renderStitchingToggle() {
1368
+ var _a;
1369
+ 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); } })))));
1370
+ }
1357
1371
  renderCaptureStatus() {
1358
1372
  const value = this.value || [];
1359
1373
  return (value && (h("div", { class: { 'capture-status': true, 'image-reco': this.isImageRecognition } }, this.required && (h("div", { class: "status" }, value.length > this.min
@@ -1455,11 +1469,11 @@ const YooFormCaptureComponent = class {
1455
1469
  }
1456
1470
  renderMultipleInNormalMode() {
1457
1471
  const value = this.value || [];
1458
- 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) &&
1472
+ 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) &&
1459
1473
  value.length > 0 &&
1460
1474
  value.map((item, index) => {
1461
1475
  return this.renderCameraContainer(item, index);
1462
- })), this.isImageRecognition && !this.isBackgroundProcess ? this.renderButtonContainer() : null));
1476
+ })), this.isImageRecognition ? this.renderButtonContainer() : null));
1463
1477
  }
1464
1478
  renderAddCameraContainer(index = -1) {
1465
1479
  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' })));
@@ -1642,7 +1642,8 @@ const YooFormDynamicComponent = class {
1642
1642
  tags: data[field.name].tags,
1643
1643
  _geoloc: data[field.name]._geoloc,
1644
1644
  imageRecognitionResults: data[field.name].imageRecognitionResults,
1645
- priceRecognitionResults: data[field.name].priceRecognitionResults
1645
+ priceRecognitionResults: data[field.name].priceRecognitionResults,
1646
+ useStitching: data[field.name].useStitching
1646
1647
  };
1647
1648
  }
1648
1649
  }
@@ -4003,9 +4004,10 @@ const YooFormDynamicComponent = class {
4003
4004
  allowCamera: field.allowCamera,
4004
4005
  allowUserImages: field.allowUserImages,
4005
4006
  isImageRecognition: field.isImageRecognition,
4007
+ allowStitching: field.allowStitching,
4008
+ useStitching: field.useStitching,
4006
4009
  algorithm: field.imageRecognitionAlgorithm,
4007
4010
  algorithmDisplay: field.imageRecognitionDisplay,
4008
- isBackgroundProcess: field.isBackgroundProcess,
4009
4011
  label: generateLabel(field),
4010
4012
  multiple: field.type === FormFieldType.multiphotos,
4011
4013
  min: field.minPhotos || 1,