yet-another-react-lightbox 3.10.2 → 3.11.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/dist/index.js +5 -4
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1076,7 +1076,7 @@ function Controller({ children, ...props }) {
|
|
|
1076
1076
|
React.useEffect(onViewCallback, [state.globalIndex, onViewCallback]);
|
|
1077
1077
|
React.useEffect(() => cleanup(subscribe(ACTION_PREV, (action) => swipe({ direction: ACTION_PREV, ...action })), subscribe(ACTION_NEXT, (action) => swipe({ direction: ACTION_NEXT, ...action })), subscribe(ACTION_SWIPE, (action) => dispatch(action))), [subscribe, swipe, dispatch]);
|
|
1078
1078
|
React.useEffect(() => subscribeSensors(EVENT_ON_KEY_UP, (event) => {
|
|
1079
|
-
if (event.
|
|
1079
|
+
if (event.key === VK_ESCAPE) {
|
|
1080
1080
|
close();
|
|
1081
1081
|
}
|
|
1082
1082
|
}), [subscribeSensors, close]);
|
|
@@ -1143,7 +1143,7 @@ function CarouselSlide({ slide, offset }) {
|
|
|
1143
1143
|
const containerRef = React.useRef(null);
|
|
1144
1144
|
const { currentIndex } = useLightboxState();
|
|
1145
1145
|
const { slideRect, close } = useController();
|
|
1146
|
-
const { render, carousel: { imageFit, imageProps }, on: { click: onClick }, controller: { closeOnBackdropClick }, } = useLightboxProps();
|
|
1146
|
+
const { render, carousel: { imageFit, imageProps }, on: { click: onClick }, controller: { closeOnBackdropClick }, styles: { slide: style }, } = useLightboxProps();
|
|
1147
1147
|
const renderSlide = () => {
|
|
1148
1148
|
var _a, _b, _c, _d;
|
|
1149
1149
|
let rendered = (_a = render.slide) === null || _a === void 0 ? void 0 : _a.call(render, { slide, offset, rect: slideRect });
|
|
@@ -1167,10 +1167,11 @@ function CarouselSlide({ slide, offset }) {
|
|
|
1167
1167
|
close();
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
return (React.createElement("div", { ref: containerRef, className: clsx(cssClass(cssSlidePrefix()), offset === 0 && cssClass(cssSlidePrefix("current")), cssClass(CLASS_FLEX_CENTER)), onClick: handleBackdropClick }, renderSlide()));
|
|
1170
|
+
return (React.createElement("div", { ref: containerRef, className: clsx(cssClass(cssSlidePrefix()), offset === 0 && cssClass(cssSlidePrefix("current")), cssClass(CLASS_FLEX_CENTER)), onClick: handleBackdropClick, style: style }, renderSlide()));
|
|
1171
1171
|
}
|
|
1172
1172
|
function Placeholder() {
|
|
1173
|
-
|
|
1173
|
+
const style = useLightboxProps().styles.slide;
|
|
1174
|
+
return React.createElement("div", { className: cssClass("slide"), style: style });
|
|
1174
1175
|
}
|
|
1175
1176
|
function Carousel({ carousel: { finite, preload, padding, spacing } }) {
|
|
1176
1177
|
const { slides, currentIndex, globalIndex } = useLightboxState();
|
package/dist/types.d.ts
CHANGED
|
@@ -161,6 +161,8 @@ interface SlotType {
|
|
|
161
161
|
root: "root";
|
|
162
162
|
/** lightbox container customization slot */
|
|
163
163
|
container: "container";
|
|
164
|
+
/** lightbox slide customization slot */
|
|
165
|
+
slide: "slide";
|
|
164
166
|
/** lightbox button customization slot */
|
|
165
167
|
button: "button";
|
|
166
168
|
/** lightbox icon customization slot */
|