@yoobic/yobi 7.7.128 → 7.7.129

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.
@@ -207487,7 +207487,9 @@ const YooPhotoEditorComponent = class {
207487
207487
  get keyboardActions() {
207488
207488
  return {
207489
207489
  WillShow: () => this.hasKeyboardOpened = true,
207490
- DidHide: () => this.hasKeyboardOpened = false
207490
+ WillHide: () => this.hasKeyboardOpened = false,
207491
+ DidHide: () => async () => await this.displayDrawings(this.currentDrawings),
207492
+ DidShow: async () => await this.displayDrawings(this.currentDrawings)
207491
207493
  };
207492
207494
  }
207493
207495
  get hostBounds() {
@@ -207612,7 +207614,7 @@ const YooPhotoEditorComponent = class {
207612
207614
  return (_a = this.imageSizeStyle) === null || _a === void 0 ? void 0 : _a[this.isImageZoomable ? 'natural' : 'resized'];
207613
207615
  }
207614
207616
  get changes() {
207615
- var _a, _b;
207617
+ var _a, _b, _c, _d;
207616
207618
  const checkChanges = (propName) => !isEqual$1.isEqual(this.savedAnnotations.sort((a, b) => a.text.localeCompare(b.text)).map((t) => t === null || t === void 0 ? void 0 : t[propName]), this.annotations
207617
207619
  .filter((a) => (a === null || a === void 0 ? void 0 : a.text) && !annotationsHelpers.isAnnotationDeleted(a))
207618
207620
  .sort((a, b) => a.text.localeCompare(b.text))
@@ -207623,7 +207625,7 @@ const YooPhotoEditorComponent = class {
207623
207625
  const hasCoordsChanged = checkChanges('coords');
207624
207626
  return {
207625
207627
  drawings: this.drawingsStack.length > 1 && !!this.drawingsStackIndex,
207626
- annotations: !!(hasTextChanged || hasStylesChanged || (hasTransformChanged || hasCoordsChanged))
207628
+ annotations: !!(hasTextChanged || hasStylesChanged || (hasTransformChanged || hasCoordsChanged)) || (((_c = this.savedAnnotations) === null || _c === void 0 ? void 0 : _c.length) !== ((_d = this.annotations) === null || _d === void 0 ? void 0 : _d.length))
207627
207629
  };
207628
207630
  }
207629
207631
  get currentDrawings() {
@@ -207768,6 +207770,7 @@ const YooPhotoEditorComponent = class {
207768
207770
  !rrule.isDarkTheme() && !this.isPreview && rrule.setStatusBarDarkMode(true);
207769
207771
  this.savedAnnotationElements = cloneDeep.cloneDeep(this.annotationElements);
207770
207772
  this.showSaveInitial && getActionButton().validate.classList.add('active');
207773
+ this.savedAnnotations = cloneDeep.cloneDeep(this.annotations);
207771
207774
  ResizeObserver_es.ScreenOrientation === null || ResizeObserver_es.ScreenOrientation === void 0 ? void 0 : ResizeObserver_es.ScreenOrientation.onChange().subscribe(() => index.forceUpdate(this));
207772
207775
  }
207773
207776
  async prepareSrc() {
@@ -207814,13 +207817,12 @@ const YooPhotoEditorComponent = class {
207814
207817
  if (!this.isLoading && this.hasZoomSetup && (this.displayAnnotations || !this.isReadonly)) {
207815
207818
  this.hasZoomSetup = false;
207816
207819
  this.toggleDraggableAnnotations();
207817
- this.savedAnnotations = cloneDeep.cloneDeep(this.annotations);
207818
207820
  }
207819
207821
  }
207820
207822
  }
207821
207823
  toggleKeyboardListeners(add) {
207822
207824
  if (rrule.isNativeMobile() && !this.isPreview) {
207823
- ['WillShow', 'DidHide'].forEach((event) => window[`${add ? 'add' : 'remove'}EventListener`](`keyboard${event}`, this.keyboardActions[event]));
207825
+ ['WillShow', 'WillHide', 'DidHide', 'DidShow'].forEach((event) => window[`${add ? 'add' : 'remove'}EventListener`](`keyboard${event}`, this.keyboardActions[event]));
207824
207826
  }
207825
207827
  }
207826
207828
  toggleShowNavbar(show = true) {
@@ -121,7 +121,9 @@ export class YooPhotoEditorComponent {
121
121
  get keyboardActions() {
122
122
  return {
123
123
  WillShow: () => this.hasKeyboardOpened = true,
124
- DidHide: () => this.hasKeyboardOpened = false
124
+ WillHide: () => this.hasKeyboardOpened = false,
125
+ DidHide: () => async () => await this.displayDrawings(this.currentDrawings),
126
+ DidShow: async () => await this.displayDrawings(this.currentDrawings)
125
127
  };
126
128
  }
127
129
  get hostBounds() {
@@ -246,7 +248,7 @@ export class YooPhotoEditorComponent {
246
248
  return (_a = this.imageSizeStyle) === null || _a === void 0 ? void 0 : _a[this.isImageZoomable ? 'natural' : 'resized'];
247
249
  }
248
250
  get changes() {
249
- var _a, _b;
251
+ var _a, _b, _c, _d;
250
252
  const checkChanges = (propName) => !isEqual(this.savedAnnotations.sort((a, b) => a.text.localeCompare(b.text)).map((t) => t === null || t === void 0 ? void 0 : t[propName]), this.annotations
251
253
  .filter((a) => (a === null || a === void 0 ? void 0 : a.text) && !isAnnotationDeleted(a))
252
254
  .sort((a, b) => a.text.localeCompare(b.text))
@@ -257,7 +259,7 @@ export class YooPhotoEditorComponent {
257
259
  const hasCoordsChanged = checkChanges('coords');
258
260
  return {
259
261
  drawings: this.drawingsStack.length > 1 && !!this.drawingsStackIndex,
260
- annotations: !!(hasTextChanged || hasStylesChanged || (hasTransformChanged || hasCoordsChanged))
262
+ annotations: !!(hasTextChanged || hasStylesChanged || (hasTransformChanged || hasCoordsChanged)) || (((_c = this.savedAnnotations) === null || _c === void 0 ? void 0 : _c.length) !== ((_d = this.annotations) === null || _d === void 0 ? void 0 : _d.length))
261
263
  };
262
264
  }
263
265
  get currentDrawings() {
@@ -402,6 +404,7 @@ export class YooPhotoEditorComponent {
402
404
  !isDarkTheme() && !this.isPreview && setStatusBarDarkMode(true);
403
405
  this.savedAnnotationElements = cloneDeep(this.annotationElements);
404
406
  this.showSaveInitial && getActionButton().validate.classList.add('active');
407
+ this.savedAnnotations = cloneDeep(this.annotations);
405
408
  ScreenOrientation === null || ScreenOrientation === void 0 ? void 0 : ScreenOrientation.onChange().subscribe(() => forceUpdate(this));
406
409
  }
407
410
  async prepareSrc() {
@@ -448,13 +451,12 @@ export class YooPhotoEditorComponent {
448
451
  if (!this.isLoading && this.hasZoomSetup && (this.displayAnnotations || !this.isReadonly)) {
449
452
  this.hasZoomSetup = false;
450
453
  this.toggleDraggableAnnotations();
451
- this.savedAnnotations = cloneDeep(this.annotations);
452
454
  }
453
455
  }
454
456
  }
455
457
  toggleKeyboardListeners(add) {
456
458
  if (isNativeMobile() && !this.isPreview) {
457
- ['WillShow', 'DidHide'].forEach((event) => window[`${add ? 'add' : 'remove'}EventListener`](`keyboard${event}`, this.keyboardActions[event]));
459
+ ['WillShow', 'WillHide', 'DidHide', 'DidShow'].forEach((event) => window[`${add ? 'add' : 'remove'}EventListener`](`keyboard${event}`, this.keyboardActions[event]));
458
460
  }
459
461
  }
460
462
  toggleShowNavbar(show = true) {