yet-another-react-lightbox 2.0.0-rc.5 → 2.0.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.
- package/dist/core/components/IconButton.d.ts +1 -1
- package/dist/core/modules/Carousel.js +1 -1
- package/dist/plugins/thumbnails/Thumbnails.d.ts +1 -0
- package/dist/plugins/thumbnails/Thumbnails.js +1 -0
- package/dist/plugins/thumbnails/ThumbnailsTrack.js +2 -2
- package/dist/plugins/thumbnails/index.d.ts +2 -0
- package/dist/plugins/zoom/ResponsiveImage.js +1 -1
- package/dist/styles.css +4 -2
- package/dist/types.d.ts +6 -1
- package/package.json +11 -11
|
@@ -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" | "className" | "placeholder" | "onPointerDown" | "onPointerMove" | "onPointerUp" | "onPointerLeave" | "onPointerCancel" | "onKeyDown" | "onKeyUp" | "onWheel" | "value" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "
|
|
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>>;
|
|
@@ -57,7 +57,7 @@ export const Carousel = ({ slides, carousel: { finite, preload, padding, spacing
|
|
|
57
57
|
items.push(!finite || i <= slides.length - 1 ? (React.createElement(CarouselSlide, { key: key, slide: slides[i % slides.length], offset: i - currentIndex })) : (React.createElement(Placeholder, { key: key })));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
return (React.createElement("div", { ref: setCarouselRef, className: cssClass(cssPrefix()), style: {
|
|
60
|
+
return (React.createElement("div", { ref: setCarouselRef, className: clsx(cssClass(cssPrefix()), items.length > 0 && cssClass(cssPrefix("with_slides"))), style: {
|
|
61
61
|
[`${cssVar(cssPrefix("slides_count"))}`]: items.length,
|
|
62
62
|
[`${cssVar(cssPrefix("spacing_px"))}`]: spacingValue.pixel || 0,
|
|
63
63
|
[`${cssVar(cssPrefix("spacing_percent"))}`]: spacingValue.percent || 0,
|
|
@@ -101,7 +101,7 @@ export const ThumbnailsTrack = ({ container, startingIndex, slides, carousel, re
|
|
|
101
101
|
publish(ACTION_PREV, index - slideIndex);
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
-
const { width, height, border, borderRadius, padding, gap, imageFit } = thumbnails;
|
|
104
|
+
const { width, height, border, borderRadius, padding, gap, imageFit, vignette } = thumbnails;
|
|
105
105
|
return (React.createElement("div", { className: clsx(cssClass(cssPrefix("container")), cssClass(CLASS_FLEX_CENTER)), style: {
|
|
106
106
|
...(width !== defaultThumbnailsProps.width
|
|
107
107
|
? { [cssVar(cssThumbnailPrefix("width"))]: `${boxSize(thumbnails, width)}px` }
|
|
@@ -144,5 +144,5 @@ export const ThumbnailsTrack = ({ container, startingIndex, slides, carousel, re
|
|
|
144
144
|
: undefined;
|
|
145
145
|
return (React.createElement(Thumbnail, { key: slideIndex, rect: thumbnailRect, slide: slide, imageFit: imageFit, render: render, active: slideIndex === index, fadeIn: fadeIn, fadeOut: fadeOut, placeholder: Boolean(placeholder), onClick: handleClick(slideIndex), style: styles.thumbnail }));
|
|
146
146
|
})),
|
|
147
|
-
React.createElement("div", { className: cssClass(cssPrefix("vignette")) })));
|
|
147
|
+
vignette && React.createElement("div", { className: cssClass(cssPrefix("vignette")) })));
|
|
148
148
|
};
|
package/dist/styles.css
CHANGED
|
@@ -36,11 +36,13 @@
|
|
|
36
36
|
justify-content: center;
|
|
37
37
|
align-items: stretch;
|
|
38
38
|
width: calc(100% + (var(--yarl__carousel_slides_count, 0) - 1) * (100% + var(--yarl__carousel_spacing_px, 0) * 1px + var(--yarl__carousel_spacing_percent, 0) * 1%));
|
|
39
|
+
-webkit-transform: translateX(var(--yarl__swipe_offset, 0px));
|
|
40
|
+
transform: translateX(var(--yarl__swipe_offset, 0px));
|
|
41
|
+
}
|
|
42
|
+
.yarl__carousel_with_slides {
|
|
39
43
|
-webkit-column-gap: calc(var(--yarl__carousel_spacing_px, 0) * 1px + 100 / (100 * var(--yarl__carousel_slides_count, 0) + (var(--yarl__carousel_slides_count, 0) - 1) * var(--yarl__carousel_spacing_percent, 0)) * var(--yarl__carousel_spacing_percent, 0) * 1%);
|
|
40
44
|
-moz-column-gap: calc(var(--yarl__carousel_spacing_px, 0) * 1px + 100 / (100 * var(--yarl__carousel_slides_count, 0) + (var(--yarl__carousel_slides_count, 0) - 1) * var(--yarl__carousel_spacing_percent, 0)) * var(--yarl__carousel_spacing_percent, 0) * 1%);
|
|
41
45
|
column-gap: calc(var(--yarl__carousel_spacing_px, 0) * 1px + 100 / (100 * var(--yarl__carousel_slides_count, 0) + (var(--yarl__carousel_slides_count, 0) - 1) * var(--yarl__carousel_spacing_percent, 0)) * var(--yarl__carousel_spacing_percent, 0) * 1%);
|
|
42
|
-
-webkit-transform: translateX(var(--yarl__swipe_offset, 0px));
|
|
43
|
-
transform: translateX(var(--yarl__swipe_offset, 0px));
|
|
44
46
|
}
|
|
45
47
|
.yarl__flex_center {
|
|
46
48
|
display: flex;
|
package/dist/types.d.ts
CHANGED
|
@@ -51,9 +51,13 @@ export interface SlotType {
|
|
|
51
51
|
}
|
|
52
52
|
/** Customization slots */
|
|
53
53
|
export declare type Slot = SlotType[keyof SlotType];
|
|
54
|
+
/** Customization slot CSS properties */
|
|
55
|
+
interface SlotCSSProperties extends React.CSSProperties {
|
|
56
|
+
[key: `--yarl__${string}`]: string | number;
|
|
57
|
+
}
|
|
54
58
|
/** Customization slots styles */
|
|
55
59
|
export declare type SlotStyles = {
|
|
56
|
-
[key in Slot]?:
|
|
60
|
+
[key in Slot]?: SlotCSSProperties;
|
|
57
61
|
};
|
|
58
62
|
/** Carousel settings */
|
|
59
63
|
export interface CarouselSettings {
|
|
@@ -228,3 +232,4 @@ export declare type DeepNonNullable<T> = NonNullable<{
|
|
|
228
232
|
}>;
|
|
229
233
|
/** Lightbox external props */
|
|
230
234
|
export declare type LightboxExternalProps = DeepPartial<Partial<LightboxProps>, "carousel" | "animation" | "controller" | "toolbar">;
|
|
235
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yet-another-react-lightbox",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Modern React lightbox component",
|
|
5
5
|
"author": "Igor Danchenko",
|
|
6
6
|
"license": "MIT",
|
|
@@ -94,16 +94,16 @@
|
|
|
94
94
|
"@commitlint/config-conventional": "^17.0.3",
|
|
95
95
|
"@semantic-release/changelog": "^6.0.1",
|
|
96
96
|
"@semantic-release/github": "^8.0.5",
|
|
97
|
-
"@testing-library/jest-dom": "^5.16.
|
|
97
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
98
98
|
"@testing-library/react": "^13.3.0",
|
|
99
|
-
"@testing-library/user-event": "^14.3
|
|
100
|
-
"@types/jest": "^28.1.
|
|
101
|
-
"@types/react": "^18.0.
|
|
99
|
+
"@testing-library/user-event": "^14.4.3",
|
|
100
|
+
"@types/jest": "^28.1.7",
|
|
101
|
+
"@types/react": "^18.0.17",
|
|
102
102
|
"@types/react-dom": "^18.0.6",
|
|
103
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
104
|
-
"@typescript-eslint/parser": "^5.
|
|
103
|
+
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
|
104
|
+
"@typescript-eslint/parser": "^5.33.1",
|
|
105
105
|
"autoprefixer": "^10.4.8",
|
|
106
|
-
"eslint": "^8.
|
|
106
|
+
"eslint": "^8.22.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",
|
|
@@ -117,14 +117,14 @@
|
|
|
117
117
|
"jest-environment-jsdom": "^28.1.3",
|
|
118
118
|
"lint-staged": "^13.0.3",
|
|
119
119
|
"npm-run-all": "^4.1.5",
|
|
120
|
-
"postcss": "^8.4.
|
|
120
|
+
"postcss": "^8.4.16",
|
|
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.54.
|
|
127
|
-
"ts-jest": "^28.0.
|
|
126
|
+
"sass": "^1.54.4",
|
|
127
|
+
"ts-jest": "^28.0.8",
|
|
128
128
|
"typescript": "^4.7.4"
|
|
129
129
|
},
|
|
130
130
|
"keywords": [
|