@motion-proto/live-tokens 0.99.0 → 0.99.1
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.99.1 — Lightbox zoom uses the whole screen
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **ImageLightbox zoom fills the viewport.** With `extended`, a zoomed image
|
|
8
|
+
used to stay clipped to its fitted frame, so a tall screenshot zoomed in
|
|
9
|
+
showed only a narrow column. The zoomed image now spills past the frame
|
|
10
|
+
across the whole viewport. An image larger than the viewport pans until
|
|
11
|
+
its edge meets the viewport's edge; a smaller one pans until an edge would
|
|
12
|
+
leave the screen. The cursor shows `grab` while zoomed.
|
|
13
|
+
|
|
3
14
|
## 0.99.0 — Accessibility reports by theme
|
|
4
15
|
|
|
5
16
|
### Changed
|
package/package.json
CHANGED
|
@@ -248,14 +248,23 @@
|
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
+
// The zoomed image spills past the stage onto the whole viewport. Larger than
|
|
252
|
+
// the viewport on an axis, it pans until an edge meets the viewport's edge;
|
|
253
|
+
// smaller, it pans until an edge would leave the screen.
|
|
254
|
+
function clampAxis(v: number, start: number, size: number, s: number, view: number) {
|
|
255
|
+
const half = (size * s) / 2;
|
|
256
|
+
const center = start + size / 2;
|
|
257
|
+
const toNear = half - center;
|
|
258
|
+
const toFar = view - center - half;
|
|
259
|
+
return Math.max(Math.min(toNear, toFar), Math.min(Math.max(toNear, toFar), v));
|
|
260
|
+
}
|
|
261
|
+
|
|
251
262
|
function clampOffset(x: number, y: number, s: number) {
|
|
252
263
|
if (!stageEl) return { x: 0, y: 0 };
|
|
253
264
|
const r = stageEl.getBoundingClientRect();
|
|
254
|
-
const maxX = Math.max(0, (r.width * s - r.width) / 2);
|
|
255
|
-
const maxY = Math.max(0, (r.height * s - r.height) / 2);
|
|
256
265
|
return {
|
|
257
|
-
x:
|
|
258
|
-
y:
|
|
266
|
+
x: clampAxis(x, r.left, r.width, s, vw),
|
|
267
|
+
y: clampAxis(y, r.top, r.height, s, vh),
|
|
259
268
|
};
|
|
260
269
|
}
|
|
261
270
|
|
|
@@ -726,7 +735,8 @@
|
|
|
726
735
|
class="image-lightbox-stage"
|
|
727
736
|
class:shadow-box={shadow === 'box'}
|
|
728
737
|
class:shadow-content={shadow === 'content'}
|
|
729
|
-
|
|
738
|
+
class:zoomed={scale > MIN_SCALE}
|
|
739
|
+
role="presentation"
|
|
730
740
|
tabindex="-1"
|
|
731
741
|
onclick={onStageClick}
|
|
732
742
|
onpointerdown={onPointerDown}
|
|
@@ -961,6 +971,14 @@
|
|
|
961
971
|
overflow: hidden;
|
|
962
972
|
}
|
|
963
973
|
|
|
974
|
+
.image-lightbox-stage.zoomed {
|
|
975
|
+
cursor: grab;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
.image-lightbox-stage.zoomed .image-lightbox-clip {
|
|
979
|
+
overflow: visible;
|
|
980
|
+
}
|
|
981
|
+
|
|
964
982
|
.image-lightbox-transform {
|
|
965
983
|
position: absolute;
|
|
966
984
|
inset: 0;
|