@jekrch/react-viewport-lightbox 0.3.0 → 0.4.0

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/dist/styles.css CHANGED
@@ -48,6 +48,10 @@
48
48
  background-color: rgba(0, 0, 0, 0);
49
49
  transition: background-color var(--rvl-anim-duration) ease-out;
50
50
  -webkit-tap-highlight-color: transparent;
51
+ /* Prevent iOS Safari from auto-inflating text on rotation to landscape and
52
+ failing to restore it on rotation back to portrait. */
53
+ -webkit-text-size-adjust: 100%;
54
+ text-size-adjust: 100%;
51
55
  }
52
56
  .rvl-root.rvl-visible {
53
57
  background-color: var(--rvl-overlay-bg);
@@ -206,7 +210,11 @@
206
210
  width: 100%;
207
211
  height: 100%;
208
212
  touch-action: none;
209
- pointer-events: none;
213
+ /* The track spans the stage and owns every gesture (swipe/pan/pinch) plus the
214
+ backdrop close, so it must receive pointer/touch events across its whole
215
+ area — not just where the image sits. Adjacent panels stay
216
+ pointer-events:none so they never intercept a gesture in flight. */
217
+ pointer-events: auto;
210
218
  opacity: 0;
211
219
  transition: opacity var(--rvl-anim-duration) ease-out;
212
220
  }
@@ -221,6 +229,15 @@
221
229
  .rvl-track-visible {
222
230
  opacity: 1;
223
231
  }
232
+ /* Promote the track to its own compositing layer only while a swipe is in
233
+ flight (dragging or the commit/snap-back animation). The track is what the
234
+ swipe transforms, so this is where the hint belongs — a permanent
235
+ `will-change` on the images promoted the wrong elements and pinned three
236
+ full-size image layers for the viewer's whole life, which iOS flickers on.
237
+ Cleared the moment the gesture settles so the layers are released. */
238
+ .rvl-track-swiping {
239
+ will-change: transform;
240
+ }
224
241
 
225
242
  .rvl-adjacent {
226
243
  position: absolute;
@@ -251,7 +268,6 @@
251
268
  object-fit: contain;
252
269
  border-radius: var(--rvl-radius);
253
270
  max-width: 96vw;
254
- will-change: transform;
255
271
  }
256
272
 
257
273
  /* Loading spinner: shown only when the opening image is slow to load. Centered
@@ -410,6 +426,14 @@
410
426
  edge slots) stays visible and on top — even while an overlay slides in. */
411
427
  z-index: 15;
412
428
  pointer-events: none;
429
+ /* Fade the overlay with the rest of the chrome (backdrop/bars/track) so an
430
+ open drawer/graph fades out on close instead of popping out of existence
431
+ the instant the viewer unmounts. */
432
+ opacity: 0;
433
+ transition: opacity var(--rvl-anim-duration) ease-out;
434
+ }
435
+ .rvl-root.rvl-visible .rvl-overlay {
436
+ opacity: 1;
413
437
  }
414
438
  .rvl-overlay > * {
415
439
  pointer-events: auto;
@@ -423,6 +447,7 @@
423
447
  .rvl-bar,
424
448
  .rvl-stage,
425
449
  .rvl-track,
450
+ .rvl-overlay,
426
451
  .rvl-btn,
427
452
  .rvl-nav-btn {
428
453
  transition-duration: 0.01ms !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jekrch/react-viewport-lightbox",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A headless-capable, touch-friendly React image viewer and lightbox with zoom, pan, and swipe.",
5
5
  "type": "module",
6
6
  "sideEffects": [