@wise/dynamic-flow-client 5.13.2-experimental-e750b58 → 5.13.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.
package/build/main.css CHANGED
@@ -90,41 +90,50 @@
90
90
  justify-content: end;
91
91
  align-items: end;
92
92
  }
93
- .df-image img {
94
- height: auto;
93
+ .df-image img.df-reserve-space {
95
94
  width: 100%;
95
+ /*
96
+ The auto keyword in aspect-ratio: auto 1 / 1 tells the browser to prefer the element's intrinsic aspect ratio (once the image is loaded) over the specified 1/1 fallback. So:
97
+ Loading: no intrinsic ratio yet → uses 1/1 → square placeholder reserved
98
+ Loaded: intrinsic ratio available → auto wins → image renders at its natural shape
99
+ */
100
+ aspect-ratio: auto 1 / 1;
101
+ height: auto;
102
+ }
103
+ .df-image img:not([src]) {
104
+ visibility: hidden;
96
105
  }
97
106
  /* wide screens (or default) */
98
- .df-image.xs img {
107
+ .df-image.xs img.df-reserve-space {
99
108
  width: 100px;
100
109
  }
101
- .df-image.sm img {
110
+ .df-image.sm img.df-reserve-space {
102
111
  width: 200px;
103
112
  }
104
- .df-image.md img {
113
+ .df-image.md img.df-reserve-space {
105
114
  width: 300px;
106
115
  }
107
- .df-image.lg img {
116
+ .df-image.lg img.df-reserve-space {
108
117
  width: 500px;
109
118
  }
110
- .df-image.xl img {
119
+ .df-image.xl img.df-reserve-space {
111
120
  max-width: 600px;
112
121
  }
113
122
  /* narrow screens */
114
123
  @media (width <576px) {
115
- .df-image.xs img {
124
+ .df-image.xs img.df-reserve-space {
116
125
  width: 50px;
117
126
  }
118
127
 
119
- .df-image.sm img {
128
+ .df-image.sm img.df-reserve-space {
120
129
  width: 100px;
121
130
  }
122
131
 
123
- .df-image.md img {
132
+ .df-image.md img.df-reserve-space {
124
133
  width: 200px;
125
134
  }
126
135
 
127
- .df-image.lg img {
136
+ .df-image.lg img.df-reserve-space {
128
137
  width: 300px;
129
138
  }
130
139
  }
@@ -137,19 +146,19 @@
137
146
  }
138
147
  /* narrow container */
139
148
  @container (max-width: 576px) {
140
- .df-image.xs img {
149
+ .df-image.xs img.df-reserve-space {
141
150
  width: 50px;
142
151
  }
143
152
 
144
- .df-image.sm img {
153
+ .df-image.sm img.df-reserve-space {
145
154
  width: 100px;
146
155
  }
147
156
 
148
- .df-image.md img {
157
+ .df-image.md img.df-reserve-space {
149
158
  width: 200px;
150
159
  }
151
160
 
152
- .df-image.lg img {
161
+ .df-image.lg img.df-reserve-space {
153
162
  width: 300px;
154
163
  }
155
164
  }
package/build/main.js CHANGED
@@ -2650,6 +2650,7 @@ var getStepPolling = ({
2650
2650
  const { interval, delay = interval, maxAttempts, url, onError } = pollingConfig;
2651
2651
  let abortController = new AbortController();
2652
2652
  let intervalRef = null;
2653
+ let hasCompleted = false;
2653
2654
  if (delay == null) {
2654
2655
  throw new Error("Polling configuration must include delay or interval");
2655
2656
  }
@@ -2662,18 +2663,24 @@ var getStepPolling = ({
2662
2663
  const { signal } = abortController;
2663
2664
  onPoll(url, onErrorBehavior, signal).then((result) => {
2664
2665
  if (result) {
2665
- stop();
2666
+ complete();
2666
2667
  return;
2667
2668
  }
2668
2669
  if (attempts >= maxAttempts && !signal.aborted) {
2670
+ complete();
2669
2671
  void onBehavior(onErrorBehavior);
2670
- stop();
2671
2672
  }
2672
2673
  }).catch(() => {
2673
2674
  });
2674
2675
  };
2676
+ const complete = () => {
2677
+ hasCompleted = true;
2678
+ stop();
2679
+ };
2675
2680
  const start = () => {
2676
- attempts = 0;
2681
+ if (hasCompleted) {
2682
+ return;
2683
+ }
2677
2684
  intervalRef = setInterval(poll, delay * 1e3);
2678
2685
  poll();
2679
2686
  };
@@ -2682,7 +2689,7 @@ var getStepPolling = ({
2682
2689
  logEvent("warning", "Attempted to stop polling but it was not started");
2683
2690
  return;
2684
2691
  }
2685
- clearTimeout(intervalRef);
2692
+ clearInterval(intervalRef);
2686
2693
  abortController.abort();
2687
2694
  };
2688
2695
  return { start, stop };
package/build/main.mjs CHANGED
@@ -2620,6 +2620,7 @@ var getStepPolling = ({
2620
2620
  const { interval, delay = interval, maxAttempts, url, onError } = pollingConfig;
2621
2621
  let abortController = new AbortController();
2622
2622
  let intervalRef = null;
2623
+ let hasCompleted = false;
2623
2624
  if (delay == null) {
2624
2625
  throw new Error("Polling configuration must include delay or interval");
2625
2626
  }
@@ -2632,18 +2633,24 @@ var getStepPolling = ({
2632
2633
  const { signal } = abortController;
2633
2634
  onPoll(url, onErrorBehavior, signal).then((result) => {
2634
2635
  if (result) {
2635
- stop();
2636
+ complete();
2636
2637
  return;
2637
2638
  }
2638
2639
  if (attempts >= maxAttempts && !signal.aborted) {
2640
+ complete();
2639
2641
  void onBehavior(onErrorBehavior);
2640
- stop();
2641
2642
  }
2642
2643
  }).catch(() => {
2643
2644
  });
2644
2645
  };
2646
+ const complete = () => {
2647
+ hasCompleted = true;
2648
+ stop();
2649
+ };
2645
2650
  const start = () => {
2646
- attempts = 0;
2651
+ if (hasCompleted) {
2652
+ return;
2653
+ }
2647
2654
  intervalRef = setInterval(poll, delay * 1e3);
2648
2655
  poll();
2649
2656
  };
@@ -2652,7 +2659,7 @@ var getStepPolling = ({
2652
2659
  logEvent("warning", "Attempted to stop polling but it was not started");
2653
2660
  return;
2654
2661
  }
2655
- clearTimeout(intervalRef);
2662
+ clearInterval(intervalRef);
2656
2663
  abortController.abort();
2657
2664
  };
2658
2665
  return { start, stop };