@shoper/phoenix_design_system 1.18.38-1 → 1.18.38-3

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.
@@ -23,8 +23,8 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
23
23
  this._resizeObserver = null;
24
24
  this._isTransitioning = false;
25
25
  this._resizeDebounceTimer = null;
26
- this._lastViewportWidth = window.innerWidth;
27
26
  this._mutationDebounceTimer = null;
27
+ this._lastViewportWidth = window.innerWidth;
28
28
  this._mutationObserver = null;
29
29
  this._handleResizeObserver = () => {
30
30
  if (this._isTransitioning || this.hidden || this.style.height === '0px')
@@ -39,19 +39,19 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
39
39
  };
40
40
  this._handleResize = () => {
41
41
  if (this.isDevAccordionSafariFlashFixEnabled) {
42
- if (window.innerWidth === this._lastViewportWidth)
42
+ if (this._isIosViewportHeightOnlyResize())
43
43
  return;
44
44
  this._lastViewportWidth = window.innerWidth;
45
45
  }
46
46
  if (this._resizeDebounceTimer !== null) {
47
- const clearMethod = this.isDevAccordionSafariFlashFixEnabled ? window.clearTimeout : window.cancelAnimationFrame;
47
+ const clearMethod = this.isDevAccordionSafariFlashFixEnabled ? clearTimeout : cancelAnimationFrame;
48
48
  clearMethod(this._resizeDebounceTimer);
49
49
  }
50
50
  if (this.isDevAccordionSafariFlashFixEnabled) {
51
51
  this._resizeDebounceTimer = window.setTimeout(this._setStylingOptions, RESIZE_DEBOUNCE_MS);
52
52
  }
53
53
  else {
54
- this._resizeDebounceTimer = window.requestAnimationFrame(() => {
54
+ this._resizeDebounceTimer = requestAnimationFrame(() => {
55
55
  setTimeout(() => {
56
56
  this._setStylingOptions();
57
57
  }, RESIZE_DEBOUNCE_MS);
@@ -87,7 +87,7 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
87
87
  };
88
88
  this._handleMutation = () => {
89
89
  if (this._mutationDebounceTimer !== null) {
90
- window.clearTimeout(this._mutationDebounceTimer);
90
+ clearTimeout(this._mutationDebounceTimer);
91
91
  }
92
92
  this._mutationDebounceTimer = window.setTimeout(() => {
93
93
  requestAnimationFrame(() => {
@@ -171,6 +171,9 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
171
171
  this._setStylingOptions();
172
172
  }
173
173
  }
174
+ _isIosViewportHeightOnlyResize() {
175
+ return window.innerWidth === this._lastViewportWidth;
176
+ }
174
177
  _setupImageLoadListeners() {
175
178
  const images = this.querySelectorAll('img');
176
179
  images.forEach((img) => {
@@ -231,11 +234,11 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
231
234
  (_c = this._mutationObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
232
235
  window.removeEventListener('resize', this._handleResize);
233
236
  if (this._resizeDebounceTimer !== null) {
234
- const clearMethod = this.isDevAccordionSafariFlashFixEnabled ? window.clearTimeout : window.cancelAnimationFrame;
237
+ const clearMethod = this.isDevAccordionSafariFlashFixEnabled ? clearTimeout : cancelAnimationFrame;
235
238
  clearMethod(this._resizeDebounceTimer);
236
239
  }
237
240
  if (this._mutationDebounceTimer !== null) {
238
- window.clearTimeout(this._mutationDebounceTimer);
241
+ clearTimeout(this._mutationDebounceTimer);
239
242
  }
240
243
  }
241
244
  const images = this.querySelectorAll('img');
@@ -243,9 +246,6 @@ exports.HAccordionContent = class HAccordionContent extends phoenix_light_lit_el
243
246
  img.removeEventListener('load', this._boundHandleImageLoad);
244
247
  img.removeEventListener('error', this._boundHandleImageLoad);
245
248
  });
246
- if (!this.isDevAccordionSafariFlashFixEnabled) {
247
- window.removeEventListener('resize', this._handleResize);
248
- }
249
249
  this.removeEventListener('transitionend', this._boundHandleTransitionEnd);
250
250
  }
251
251
  };
@@ -12,8 +12,8 @@ export declare class HAccordionContent extends PhoenixLightLitElement {
12
12
  private _resizeObserver;
13
13
  private _isTransitioning;
14
14
  private _resizeDebounceTimer;
15
- private _lastViewportWidth;
16
15
  private _mutationDebounceTimer;
16
+ private _lastViewportWidth;
17
17
  private _mutationObserver;
18
18
  private _boundHandleTransitionEnd;
19
19
  private _boundHandleImageLoad;
@@ -22,6 +22,7 @@ export declare class HAccordionContent extends PhoenixLightLitElement {
22
22
  firstUpdated(props: PropertyValues): void;
23
23
  private _handleResizeObserver;
24
24
  private _updateOriginalHeight;
25
+ private _isIosViewportHeightOnlyResize;
25
26
  private _handleResize;
26
27
  private _setStylingOptions;
27
28
  private _setOriginalHeightValue;
@@ -19,8 +19,8 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
19
19
  this._resizeObserver = null;
20
20
  this._isTransitioning = false;
21
21
  this._resizeDebounceTimer = null;
22
- this._lastViewportWidth = window.innerWidth;
23
22
  this._mutationDebounceTimer = null;
23
+ this._lastViewportWidth = window.innerWidth;
24
24
  this._mutationObserver = null;
25
25
  this._handleResizeObserver = () => {
26
26
  if (this._isTransitioning || this.hidden || this.style.height === '0px')
@@ -35,19 +35,19 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
35
35
  };
36
36
  this._handleResize = () => {
37
37
  if (this.isDevAccordionSafariFlashFixEnabled) {
38
- if (window.innerWidth === this._lastViewportWidth)
38
+ if (this._isIosViewportHeightOnlyResize())
39
39
  return;
40
40
  this._lastViewportWidth = window.innerWidth;
41
41
  }
42
42
  if (this._resizeDebounceTimer !== null) {
43
- const clearMethod = this.isDevAccordionSafariFlashFixEnabled ? window.clearTimeout : window.cancelAnimationFrame;
43
+ const clearMethod = this.isDevAccordionSafariFlashFixEnabled ? clearTimeout : cancelAnimationFrame;
44
44
  clearMethod(this._resizeDebounceTimer);
45
45
  }
46
46
  if (this.isDevAccordionSafariFlashFixEnabled) {
47
47
  this._resizeDebounceTimer = window.setTimeout(this._setStylingOptions, RESIZE_DEBOUNCE_MS);
48
48
  }
49
49
  else {
50
- this._resizeDebounceTimer = window.requestAnimationFrame(() => {
50
+ this._resizeDebounceTimer = requestAnimationFrame(() => {
51
51
  setTimeout(() => {
52
52
  this._setStylingOptions();
53
53
  }, RESIZE_DEBOUNCE_MS);
@@ -83,7 +83,7 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
83
83
  };
84
84
  this._handleMutation = () => {
85
85
  if (this._mutationDebounceTimer !== null) {
86
- window.clearTimeout(this._mutationDebounceTimer);
86
+ clearTimeout(this._mutationDebounceTimer);
87
87
  }
88
88
  this._mutationDebounceTimer = window.setTimeout(() => {
89
89
  requestAnimationFrame(() => {
@@ -167,6 +167,9 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
167
167
  this._setStylingOptions();
168
168
  }
169
169
  }
170
+ _isIosViewportHeightOnlyResize() {
171
+ return window.innerWidth === this._lastViewportWidth;
172
+ }
170
173
  _setupImageLoadListeners() {
171
174
  const images = this.querySelectorAll('img');
172
175
  images.forEach((img) => {
@@ -227,11 +230,11 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
227
230
  (_c = this._mutationObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
228
231
  window.removeEventListener('resize', this._handleResize);
229
232
  if (this._resizeDebounceTimer !== null) {
230
- const clearMethod = this.isDevAccordionSafariFlashFixEnabled ? window.clearTimeout : window.cancelAnimationFrame;
233
+ const clearMethod = this.isDevAccordionSafariFlashFixEnabled ? clearTimeout : cancelAnimationFrame;
231
234
  clearMethod(this._resizeDebounceTimer);
232
235
  }
233
236
  if (this._mutationDebounceTimer !== null) {
234
- window.clearTimeout(this._mutationDebounceTimer);
237
+ clearTimeout(this._mutationDebounceTimer);
235
238
  }
236
239
  }
237
240
  const images = this.querySelectorAll('img');
@@ -239,9 +242,6 @@ let HAccordionContent = class HAccordionContent extends PhoenixLightLitElement {
239
242
  img.removeEventListener('load', this._boundHandleImageLoad);
240
243
  img.removeEventListener('error', this._boundHandleImageLoad);
241
244
  });
242
- if (!this.isDevAccordionSafariFlashFixEnabled) {
243
- window.removeEventListener('resize', this._handleResize);
244
- }
245
245
  this.removeEventListener('transitionend', this._boundHandleTransitionEnd);
246
246
  }
247
247
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "1.18.38-1",
5
+ "version": "1.18.38-3",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",