yet-another-react-lightbox 2.2.0 → 2.2.2
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.
|
@@ -4,4 +4,4 @@ export declare type IconButtonProps = Omit<React.DetailedHTMLProps<React.ButtonH
|
|
|
4
4
|
icon: React.ElementType;
|
|
5
5
|
renderIcon?: () => React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export declare const IconButton: React.ForwardRefExoticComponent<Pick<IconButtonProps, "icon" | "hidden" | "color" | "style" | "translate" | "disabled" | "className" | "placeholder" | "onPointerDown" | "onPointerMove" | "onPointerUp" | "onPointerLeave" | "onPointerCancel" | "onKeyDown" | "onKeyUp" | "onWheel" | "value" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "slot" | "spellCheck" | "tabIndex" | "title" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDownCapture" | "onPointerMoveCapture" | "onPointerUpCapture" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "label" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "renderIcon"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const IconButton: React.ForwardRefExoticComponent<Pick<IconButtonProps, "icon" | "hidden" | "color" | "style" | "translate" | "disabled" | "className" | "placeholder" | "onPointerDown" | "onPointerMove" | "onPointerUp" | "onPointerLeave" | "onPointerCancel" | "onKeyDown" | "onKeyUp" | "onWheel" | "value" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "title" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDownCapture" | "onPointerMoveCapture" | "onPointerUpCapture" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "label" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "renderIcon"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -21,8 +21,8 @@ export const ThumbnailsTrack = ({ container, startingIndex, slides, carousel, re
|
|
|
21
21
|
const containerRect = container.current.getBoundingClientRect();
|
|
22
22
|
const trackRect = track.current.getBoundingClientRect();
|
|
23
23
|
animationOffset.current = isHorizontal(thumbnails.position)
|
|
24
|
-
? trackRect.left - (containerRect.width - trackRect.width) / 2
|
|
25
|
-
: trackRect.top - (containerRect.height - trackRect.height) / 2;
|
|
24
|
+
? trackRect.left - containerRect.left - (containerRect.width - trackRect.width) / 2
|
|
25
|
+
: trackRect.top - containerRect.top - (containerRect.height - trackRect.height) / 2;
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
animationOffset.current = 0;
|
|
@@ -62,7 +62,8 @@ export const ThumbnailsTrack = ({ container, startingIndex, slides, carousel, re
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
useLayoutEffect(handleIndexOffsetChange, [index, offset, handleIndexOffsetChange]);
|
|
65
|
-
const { finite
|
|
65
|
+
const { finite } = carousel;
|
|
66
|
+
const preload = Math.max(Math.min(carousel.preload, slides.length - 1), 0);
|
|
66
67
|
const items = [];
|
|
67
68
|
if (slides.length > 0) {
|
|
68
69
|
if (offset < 0) {
|
|
@@ -23,7 +23,7 @@ export const ResponsiveImage = (props) => {
|
|
|
23
23
|
setState((prev) => ({ ...prev, preload: targetSource.src }));
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
useLayoutEffect(handleSourceChange, [rect === null || rect === void 0 ? void 0 : rect.width, rect === null || rect === void 0 ? void 0 : rect.height, pixelDensity, handleSourceChange]);
|
|
26
|
+
useLayoutEffect(handleSourceChange, [rect === null || rect === void 0 ? void 0 : rect.width, rect === null || rect === void 0 ? void 0 : rect.height, pixelDensity, image.src, handleSourceChange]);
|
|
27
27
|
const handlePreload = useEventCallback((currentPreload) => {
|
|
28
28
|
if (currentPreload === preload) {
|
|
29
29
|
setState((prev) => ({ ...prev, current: preload, preload: undefined }));
|
|
@@ -177,7 +177,7 @@ export const ZoomContainer = ({ slide, offset, rect, render, carousel, animation
|
|
|
177
177
|
preventDefault();
|
|
178
178
|
changeZoom(zoomValue);
|
|
179
179
|
};
|
|
180
|
-
const hasMeta = () => event.getModifierState("Meta")
|
|
180
|
+
const hasMeta = () => event.getModifierState("Meta");
|
|
181
181
|
if (event.key === "+" || (event.key === "=" && hasMeta())) {
|
|
182
182
|
handleChangeZoom(zoom * zoomInMultiplier);
|
|
183
183
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yet-another-react-lightbox",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Modern React lightbox component",
|
|
5
5
|
"author": "Igor Danchenko",
|
|
6
6
|
"license": "MIT",
|
|
@@ -90,40 +90,40 @@
|
|
|
90
90
|
"react-dom": ">=16.8.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@commitlint/cli": "^17.
|
|
94
|
-
"@commitlint/config-conventional": "^17.
|
|
93
|
+
"@commitlint/cli": "^17.2.0",
|
|
94
|
+
"@commitlint/config-conventional": "^17.2.0",
|
|
95
95
|
"@semantic-release/changelog": "^6.0.1",
|
|
96
96
|
"@semantic-release/github": "^8.0.6",
|
|
97
97
|
"@testing-library/jest-dom": "^5.16.5",
|
|
98
98
|
"@testing-library/react": "^13.4.0",
|
|
99
99
|
"@testing-library/user-event": "^14.4.3",
|
|
100
|
-
"@types/jest": "^29.
|
|
101
|
-
"@types/react": "^18.0.
|
|
102
|
-
"@types/react-dom": "^18.0.
|
|
103
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
104
|
-
"@typescript-eslint/parser": "^5.
|
|
105
|
-
"autoprefixer": "^10.4.
|
|
106
|
-
"eslint": "^8.
|
|
100
|
+
"@types/jest": "^29.2.2",
|
|
101
|
+
"@types/react": "^18.0.25",
|
|
102
|
+
"@types/react-dom": "^18.0.8",
|
|
103
|
+
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
|
104
|
+
"@typescript-eslint/parser": "^5.42.0",
|
|
105
|
+
"autoprefixer": "^10.4.13",
|
|
106
|
+
"eslint": "^8.27.0",
|
|
107
107
|
"eslint-config-airbnb": "^19.0.4",
|
|
108
108
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
109
109
|
"eslint-config-prettier": "^8.5.0",
|
|
110
110
|
"eslint-plugin-import": "^2.26.0",
|
|
111
111
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
112
112
|
"eslint-plugin-prettier": "^4.2.1",
|
|
113
|
-
"eslint-plugin-react": "^7.31.
|
|
113
|
+
"eslint-plugin-react": "^7.31.10",
|
|
114
114
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
115
115
|
"husky": "^8.0.1",
|
|
116
|
-
"jest": "^29.
|
|
117
|
-
"jest-environment-jsdom": "^29.
|
|
116
|
+
"jest": "^29.2.2",
|
|
117
|
+
"jest-environment-jsdom": "^29.2.2",
|
|
118
118
|
"lint-staged": "^13.0.3",
|
|
119
119
|
"npm-run-all": "^4.1.5",
|
|
120
|
-
"postcss": "^8.4.
|
|
120
|
+
"postcss": "^8.4.18",
|
|
121
121
|
"postcss-cli": "^10.0.0",
|
|
122
122
|
"prettier": "^2.7.1",
|
|
123
123
|
"react": "^18.2.0",
|
|
124
124
|
"react-dom": "^18.2.0",
|
|
125
125
|
"rimraf": "^3.0.2",
|
|
126
|
-
"sass": "^1.
|
|
126
|
+
"sass": "^1.56.0",
|
|
127
127
|
"ts-jest": "^29.0.3",
|
|
128
128
|
"typescript": "^4.8.4"
|
|
129
129
|
},
|