yet-another-react-lightbox 3.21.8 → 3.21.9
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/README.md +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/plugins/zoom/index.js +9 -8
- package/dist/types.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ extendable.
|
|
|
24
24
|
- **TypeScript:** type definitions come built-in in the package
|
|
25
25
|
- **RTL:** compatible with RTL layout
|
|
26
26
|
|
|
27
|
-

|
|
28
28
|
|
|
29
29
|
## Documentation
|
|
30
30
|
|
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ declare function useEventCallback<Args extends unknown[], Return>(fn: (...args:
|
|
|
83
83
|
declare function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
|
|
84
84
|
declare function useForkRef<InstanceA, InstanceB>(refA: React.Ref<InstanceA> | null | undefined, refB: React.Ref<InstanceB> | null | undefined): React.Ref<InstanceA & InstanceB> | null;
|
|
85
85
|
|
|
86
|
-
declare const useLayoutEffect: typeof React.
|
|
86
|
+
declare const useLayoutEffect: typeof React.useLayoutEffect;
|
|
87
87
|
|
|
88
88
|
declare function useLoseFocus(focus: () => void, disabled?: boolean): {
|
|
89
89
|
onFocus: () => void;
|
|
@@ -283,4 +283,5 @@ declare const RootModule: Module;
|
|
|
283
283
|
declare function Toolbar({ toolbar: { buttons }, render: { buttonClose, iconClose }, styles }: ComponentProps): React.JSX.Element;
|
|
284
284
|
declare const ToolbarModule: Module;
|
|
285
285
|
|
|
286
|
-
export { Augmentation, Callback, Carousel, CarouselModule, CarouselSettings, CloseIcon, Component, ComponentProps,
|
|
286
|
+
export { Augmentation, Callback, Carousel, CarouselModule, CarouselSettings, CloseIcon, Component, ComponentProps, ContainerRect, Controller, ControllerContext, ControllerModule, ControllerRef, ControllerSettings, DocumentContext, DocumentContextProvider, ErrorIcon, EventTypes, EventsContext, EventsProvider, IconButton, ImageSlide, Label, Labels, LengthOrPercentage, Lightbox, LightboxDefaultProps, LightboxDispatchContext, LightboxExternalProps, LightboxProps, LightboxPropsContext, LightboxPropsProvider, LightboxRoot, LightboxState, LightboxStateContext, LightboxStateProvider, LightboxStateSwipeAction, LightboxStateUpdateAction, LoadingIcon, Module, Navigation, NavigationButton, NavigationModule, NextIcon, NoScroll, NoScrollModule, Node$1 as Node, Plugin, Portal, PortalModule, PreviousIcon, Render, RenderFunction, Root, RootModule, Slide, SlideImage, SwipeState, TimeoutsContext, TimeoutsProvider, Toolbar, ToolbarModule, ToolbarSettings, addToolbarButton, calculatePreload, cleanup, clsx, composePrefix, computeSlideRect, createIcon, createIconDisabled, createModule, createNode, cssClass, cssVar, Lightbox as default, devicePixelRatio, getSlide, getSlideIfPresent, getSlideIndex, getSlideKey, hasSlides, hasWindow, isImageFitCover, isImageSlide, label, makeComposePrefix, makeInertWhen, makeUseContext, parseInt, parseLengthPercentage, round, setRef, stopNavigationEventsPropagation, useAnimation, useContainerRect, useController, useDelay, useDocumentContext, useEventCallback, useEvents, useForkRef, useKeyboardNavigation, useLayoutEffect, useLightboxDispatch, useLightboxProps, useLightboxState, useLoseFocus, useMotionPreference, useNavigationState, usePointerSwipe, usePreventWheelDefaults, useRTL, useSensors, useThrottle, useTimeouts, useWheelSwipe, withPlugins };
|
|
287
|
+
export type { ComputeAnimation, ControllerContextType, DocumentContextProviderProps, DocumentContextType, Event, EventCallback, EventsContextType, IconButtonProps, ImageSlideProps, KeyboardEventType, LightboxDispatchContextType, LightboxPropsContextType, LightboxStateAction, LightboxStateContextType, LightboxStateProviderProps, NavigationButtonProps, PointerEventType, Publish, ReactEventType, RegisterSensors, SensorCallback, Subscribe, SubscribeSensors, SupportedEventType, TimeoutsContextType, Topic, Unsubscribe, UseSensors, WheelEventType };
|
|
@@ -136,6 +136,8 @@ function useZoomSensors(zoom, maxZoom, disabled, changeZoom, changeOffsets, zoom
|
|
|
136
136
|
return [];
|
|
137
137
|
}, [containerRef, getOwnerWindow]);
|
|
138
138
|
const onKeyDown = useEventCallback((event) => {
|
|
139
|
+
const { key, metaKey, ctrlKey } = event;
|
|
140
|
+
const meta = metaKey || ctrlKey;
|
|
139
141
|
const preventDefault = () => {
|
|
140
142
|
event.preventDefault();
|
|
141
143
|
event.stopPropagation();
|
|
@@ -145,16 +147,16 @@ function useZoomSensors(zoom, maxZoom, disabled, changeZoom, changeOffsets, zoom
|
|
|
145
147
|
preventDefault();
|
|
146
148
|
changeOffsets(deltaX, deltaY);
|
|
147
149
|
};
|
|
148
|
-
if (
|
|
150
|
+
if (key === "ArrowDown") {
|
|
149
151
|
move(0, keyboardMoveDistance);
|
|
150
152
|
}
|
|
151
|
-
else if (
|
|
153
|
+
else if (key === "ArrowUp") {
|
|
152
154
|
move(0, -keyboardMoveDistance);
|
|
153
155
|
}
|
|
154
|
-
else if (
|
|
156
|
+
else if (key === "ArrowLeft") {
|
|
155
157
|
move(-keyboardMoveDistance, 0);
|
|
156
158
|
}
|
|
157
|
-
else if (
|
|
159
|
+
else if (key === "ArrowRight") {
|
|
158
160
|
move(keyboardMoveDistance, 0);
|
|
159
161
|
}
|
|
160
162
|
}
|
|
@@ -162,14 +164,13 @@ function useZoomSensors(zoom, maxZoom, disabled, changeZoom, changeOffsets, zoom
|
|
|
162
164
|
preventDefault();
|
|
163
165
|
changeZoom(zoomValue);
|
|
164
166
|
};
|
|
165
|
-
|
|
166
|
-
if (event.key === "+" || (event.key === "=" && hasMeta())) {
|
|
167
|
+
if (key === "+" || (meta && key === "=")) {
|
|
167
168
|
handleChangeZoom(zoom * zoomInMultiplier);
|
|
168
169
|
}
|
|
169
|
-
else if (
|
|
170
|
+
else if (key === "-" || (meta && key === "_")) {
|
|
170
171
|
handleChangeZoom(zoom / zoomInMultiplier);
|
|
171
172
|
}
|
|
172
|
-
else if (
|
|
173
|
+
else if (meta && key === "0") {
|
|
173
174
|
handleChangeZoom(1);
|
|
174
175
|
}
|
|
175
176
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -432,4 +432,5 @@ type DeepPartialValue<T, E extends string = never> = T extends any[] ? T : T ext
|
|
|
432
432
|
[P in keyof T]?: P extends E ? T[P] : DeepPartialValue<T[P], E>;
|
|
433
433
|
} : T;
|
|
434
434
|
|
|
435
|
-
export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING,
|
|
435
|
+
export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, CLASS_FLEX_CENTER, CLASS_FULLSIZE, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, CLASS_SLIDE_WRAPPER, CLASS_SLIDE_WRAPPER_INTERACTIVE, ELEMENT_BUTTON, ELEMENT_ICON, EVENT_ON_KEY_DOWN, EVENT_ON_KEY_UP, EVENT_ON_POINTER_CANCEL, EVENT_ON_POINTER_DOWN, EVENT_ON_POINTER_LEAVE, EVENT_ON_POINTER_MOVE, EVENT_ON_POINTER_UP, EVENT_ON_WHEEL, IMAGE_FIT_CONTAIN, IMAGE_FIT_COVER, MODULE_CAROUSEL, MODULE_CONTROLLER, MODULE_NAVIGATION, MODULE_NO_SCROLL, MODULE_PORTAL, MODULE_ROOT, MODULE_TOOLBAR, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SHARE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_LOADING, SLIDE_STATUS_PLACEHOLDER, SLIDE_STATUS_PLAYING, UNKNOWN_ACTION_TYPE, VK_ARROW_LEFT, VK_ARROW_RIGHT, VK_ESCAPE, activeSlideStatus };
|
|
436
|
+
export type { AnimationSettings, Augmentation, Callback, Callbacks, CarouselSettings, ClickCallbackProps, Component, ComponentProps, ContainerRect, ControllerRef, ControllerSettings, DeepPartial, DeepPartialValue, EventTypes, GenericSlide, ImageFit, ImageSource, Label, Labels, LengthOrPercentage, LightboxExternalProps, LightboxProps, LightboxState, LightboxStateSwipeAction, LightboxStateUpdateAction, Module, NavigationAction, NoScrollSettings, Node, Plugin, PluginProps, PortalSettings, Render, RenderFunction, RenderSlideContainerProps, RenderSlideFooterProps, RenderSlideHeaderProps, RenderSlideProps, Slide, SlideImage, SlideStatus, SlideTypeKey, SlideTypes, Slot, SlotStyles, SlotType, ToolbarButtonKey, ToolbarButtonKeys, ToolbarSettings, ViewCallbackProps };
|