@thewhateverapp/tile-sdk 0.13.14 → 0.13.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Slideshow.d.ts","sourceRoot":"","sources":["../../../src/react/overlay/Slideshow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAMf,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,oBAAoB,CAAC,EAAE,uBAAuB,CAAC;KAChD;CACF;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;AAErD;;;;;GAKG;AACH,cAAM,uBAAuB;IAC3B,OAAO,CAAC,cAAc,CAAiC;IACvD,OAAO,CAAC,YAAY,CAMlB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AAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACvC,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qGAAqG;IACrG,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,mCAAmC;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,UAAiB,EACjB,WAAkB,EAClB,UAAmB,EACnB,kBAAwB,EACxB,QAAe,EACf,UAAiB,EACjB,SAAgB,EAChB,SAAmB,EACnB,QAAQ,EACR,SAAc,EACd,cAAmB,GACpB,EAAE,cAAc,qBAmThB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,qBAAqB,CAMzD;AAGD,eAAO,MAAM,YAAY,0BAAoB,CAAC"}
@@ -75,12 +75,21 @@ class SlideshowSingletonClass {
75
75
  }
76
76
  // Navigation controls
77
77
  next() {
78
- if (this.currentState.isTransitioning || this.currentState.totalSlides <= 1)
78
+ console.log('[SlideshowSingleton] next() called:', {
79
+ isTransitioning: this.currentState.isTransitioning,
80
+ totalSlides: this.currentState.totalSlides,
81
+ currentIndex: this.currentState.currentIndex,
82
+ });
83
+ if (this.currentState.isTransitioning || this.currentState.totalSlides <= 1) {
84
+ console.log('[SlideshowSingleton] next() blocked:', this.currentState.isTransitioning ? 'transitioning' : 'single slide');
79
85
  return;
86
+ }
87
+ const newIndex = (this.currentState.currentIndex + 1) % this.currentState.totalSlides;
88
+ console.log('[SlideshowSingleton] next() advancing to index:', newIndex);
80
89
  this.currentState = {
81
90
  ...this.currentState,
82
91
  isTransitioning: true,
83
- currentIndex: (this.currentState.currentIndex + 1) % this.currentState.totalSlides,
92
+ currentIndex: newIndex,
84
93
  };
85
94
  this.notifyListeners();
86
95
  setTimeout(() => {
@@ -89,12 +98,21 @@ class SlideshowSingletonClass {
89
98
  }, this.transitionDuration);
90
99
  }
91
100
  prev() {
92
- if (this.currentState.isTransitioning || this.currentState.totalSlides <= 1)
101
+ console.log('[SlideshowSingleton] prev() called:', {
102
+ isTransitioning: this.currentState.isTransitioning,
103
+ totalSlides: this.currentState.totalSlides,
104
+ currentIndex: this.currentState.currentIndex,
105
+ });
106
+ if (this.currentState.isTransitioning || this.currentState.totalSlides <= 1) {
107
+ console.log('[SlideshowSingleton] prev() blocked:', this.currentState.isTransitioning ? 'transitioning' : 'single slide');
93
108
  return;
109
+ }
110
+ const newIndex = (this.currentState.currentIndex - 1 + this.currentState.totalSlides) % this.currentState.totalSlides;
111
+ console.log('[SlideshowSingleton] prev() going back to index:', newIndex);
94
112
  this.currentState = {
95
113
  ...this.currentState,
96
114
  isTransitioning: true,
97
- currentIndex: (this.currentState.currentIndex - 1 + this.currentState.totalSlides) % this.currentState.totalSlides,
115
+ currentIndex: newIndex,
98
116
  };
99
117
  this.notifyListeners();
100
118
  setTimeout(() => {
@@ -217,10 +235,34 @@ export function Slideshow({ images, intervalMs = 5000, autoAdvance = true, trans
217
235
  const touchCurrentRef = useRef(null);
218
236
  useEffect(() => {
219
237
  const container = containerRef.current;
220
- if (!container || !swipeable || state.totalSlides <= 1)
238
+ console.log('[Slideshow Swipe] Effect running:', {
239
+ hasContainer: !!container,
240
+ swipeable,
241
+ totalSlides: state.totalSlides,
242
+ isTransitioning: state.isTransitioning,
243
+ });
244
+ if (!container) {
245
+ console.log('[Slideshow Swipe] ❌ No container ref');
246
+ return;
247
+ }
248
+ if (!swipeable) {
249
+ console.log('[Slideshow Swipe] ❌ Swipeable is false');
221
250
  return;
251
+ }
252
+ if (state.totalSlides <= 1) {
253
+ console.log('[Slideshow Swipe] ❌ Only', state.totalSlides, 'slide(s)');
254
+ return;
255
+ }
256
+ console.log('[Slideshow Swipe] ✅ Attaching touch listeners to container');
222
257
  const handleTouchStart = (e) => {
223
258
  const touch = e.touches[0];
259
+ console.log('[Slideshow Swipe] touchstart:', {
260
+ hasTouch: !!touch,
261
+ clientX: touch?.clientX,
262
+ clientY: touch?.clientY,
263
+ target: e.target?.tagName,
264
+ currentTarget: e.currentTarget?.tagName,
265
+ });
224
266
  if (!touch)
225
267
  return;
226
268
  touchStartRef.current = {
@@ -231,28 +273,40 @@ export function Slideshow({ images, intervalMs = 5000, autoAdvance = true, trans
231
273
  touchCurrentRef.current = { x: touch.clientX, y: touch.clientY };
232
274
  };
233
275
  const handleTouchMove = (e) => {
234
- if (!touchStartRef.current)
276
+ if (!touchStartRef.current) {
277
+ console.log('[Slideshow Swipe] touchmove: no touchStart ref');
235
278
  return;
279
+ }
236
280
  const touch = e.touches[0];
237
- if (!touch)
281
+ if (!touch) {
282
+ console.log('[Slideshow Swipe] touchmove: no touch');
238
283
  return;
284
+ }
239
285
  touchCurrentRef.current = { x: touch.clientX, y: touch.clientY };
240
286
  // Prevent default and stop propagation for horizontal swipes
241
287
  const deltaX = touch.clientX - touchStartRef.current.x;
242
288
  const deltaY = touch.clientY - touchStartRef.current.y;
243
289
  if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > 10) {
290
+ console.log('[Slideshow Swipe] touchmove: horizontal swipe detected, preventing default', { deltaX, deltaY });
244
291
  e.preventDefault();
245
292
  e.stopPropagation();
246
293
  }
247
294
  };
248
295
  const handleTouchEnd = (e) => {
296
+ console.log('[Slideshow Swipe] touchend:', {
297
+ hasTouchStart: !!touchStartRef.current,
298
+ hasTouchCurrent: !!touchCurrentRef.current,
299
+ isTransitioning: state.isTransitioning,
300
+ });
249
301
  if (!touchStartRef.current || !touchCurrentRef.current) {
302
+ console.log('[Slideshow Swipe] touchend: missing refs, aborting');
250
303
  touchStartRef.current = null;
251
304
  touchCurrentRef.current = null;
252
305
  return;
253
306
  }
254
307
  // Don't process if transitioning
255
308
  if (state.isTransitioning) {
309
+ console.log('[Slideshow Swipe] touchend: transitioning, aborting');
256
310
  touchStartRef.current = null;
257
311
  touchCurrentRef.current = null;
258
312
  return;
@@ -265,16 +319,34 @@ export function Slideshow({ images, intervalMs = 5000, autoAdvance = true, trans
265
319
  const isHorizontalSwipe = Math.abs(deltaX) > Math.abs(deltaY);
266
320
  const isValidSwipe = Math.abs(deltaX) > minSwipeDistance && isHorizontalSwipe;
267
321
  const isQuickSwipe = deltaTime < 500 || Math.abs(deltaX) > 60;
322
+ console.log('[Slideshow Swipe] touchend analysis:', {
323
+ deltaX,
324
+ deltaY,
325
+ deltaTime,
326
+ minSwipeDistance,
327
+ isHorizontalSwipe,
328
+ isValidSwipe,
329
+ isQuickSwipe,
330
+ willTrigger: isValidSwipe && isQuickSwipe,
331
+ direction: deltaX > 0 ? 'prev' : 'next',
332
+ });
268
333
  if (isValidSwipe && isQuickSwipe) {
269
334
  e.preventDefault();
270
335
  e.stopPropagation();
271
336
  if (deltaX > 0) {
337
+ console.log('[Slideshow Swipe] 🎯 Triggering PREV');
272
338
  singleton.prev();
273
339
  }
274
340
  else {
341
+ console.log('[Slideshow Swipe] 🎯 Triggering NEXT');
275
342
  singleton.next();
276
343
  }
277
344
  }
345
+ else {
346
+ console.log('[Slideshow Swipe] ❌ Swipe not valid:', {
347
+ reason: !isHorizontalSwipe ? 'not horizontal' : !isValidSwipe ? 'too short' : 'too slow',
348
+ });
349
+ }
278
350
  touchStartRef.current = null;
279
351
  touchCurrentRef.current = null;
280
352
  };
@@ -282,7 +354,9 @@ export function Slideshow({ images, intervalMs = 5000, autoAdvance = true, trans
282
354
  container.addEventListener('touchstart', handleTouchStart, { passive: false });
283
355
  container.addEventListener('touchmove', handleTouchMove, { passive: false });
284
356
  container.addEventListener('touchend', handleTouchEnd, { passive: false });
357
+ console.log('[Slideshow Swipe] ✅ Listeners attached successfully');
285
358
  return () => {
359
+ console.log('[Slideshow Swipe] Cleaning up listeners');
286
360
  container.removeEventListener('touchstart', handleTouchStart);
287
361
  container.removeEventListener('touchmove', handleTouchMove);
288
362
  container.removeEventListener('touchend', handleTouchEnd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thewhateverapp/tile-sdk",
3
- "version": "0.13.14",
3
+ "version": "0.13.15",
4
4
  "description": "SDK for building interactive tiles on The Whatever App platform",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",