yet-another-react-lightbox 1.7.1 → 1.9.0

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/types.d.ts CHANGED
@@ -8,8 +8,12 @@ export interface SlideImage {
8
8
  src?: string;
9
9
  /** image 'alt' attribute */
10
10
  alt?: string;
11
- /** image aspect ratio */
11
+ /** @deprecated use `width` and `height` instead */
12
12
  aspectRatio?: number;
13
+ /** image width in pixels */
14
+ width?: number;
15
+ /** image height in pixels */
16
+ height?: number;
13
17
  /** `object-fit` setting */
14
18
  imageFit?: ImageFit;
15
19
  /** alternative images to be passed to the 'srcSet' */
@@ -18,6 +22,8 @@ export interface SlideImage {
18
22
  src: string;
19
23
  /** image width in pixels */
20
24
  width: number;
25
+ /** image height in pixels */
26
+ height?: number;
21
27
  }[];
22
28
  }
23
29
  /** Supported slide types */
@@ -175,24 +181,32 @@ export declare type Node = {
175
181
  export declare type Augmentation = (props: LightboxProps) => LightboxProps;
176
182
  /** Plugin methods */
177
183
  export declare type PluginMethods = {
178
- /** add module as parent */
184
+ /** test if a target module is present */
185
+ contains: (target: string) => boolean;
186
+ /** add module as a parent */
179
187
  addParent: (target: string, module: Module) => void;
180
- /** add module as child */
188
+ /** add module as a child */
181
189
  addChild: (target: string, module: Module, precede?: boolean) => void;
182
- /** add module as sibling */
190
+ /** add module as a sibling */
183
191
  addSibling: (target: string, module: Module, precede?: boolean) => void;
184
192
  /** replace module */
185
193
  replace: (target: string, module: Module) => void;
194
+ /** add module as a child and inherit all existing children */
195
+ append: (target: string, module: Module) => void;
186
196
  /** remove module */
187
197
  remove: (target: string) => void;
188
198
  /** augment lightbox props */
189
199
  augment: (augmentation: Augmentation) => void;
190
200
  };
191
201
  /** Lightbox plugin */
192
- export declare type Plugin = ({ addParent, addChild, addSibling, replace, remove, augment }: PluginMethods) => void;
202
+ export declare type Plugin = ({ addParent, addChild, addSibling, replace, remove, append, augment }: PluginMethods) => void;
193
203
  /** Deep partial utility type */
194
204
  export declare type DeepPartial<T, K extends keyof T> = Omit<T, K> & {
195
205
  [P in keyof Pick<T, K>]?: Partial<Pick<T, K>[P]>;
196
206
  };
207
+ /** Deep non-nullable utility type */
208
+ export declare type DeepNonNullable<T> = NonNullable<{
209
+ [K in keyof T]-?: NonNullable<T[K]>;
210
+ }>;
197
211
  /** Lightbox external props */
198
212
  export declare type LightboxExternalProps = DeepPartial<Partial<LightboxProps>, "carousel" | "animation" | "render" | "toolbar" | "controller" | "on">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yet-another-react-lightbox",
3
- "version": "1.7.1",
3
+ "version": "1.9.0",
4
4
  "description": "Modern React lightbox component",
5
5
  "author": "Igor Danchenko",
6
6
  "license": "MIT",
@@ -15,7 +15,10 @@
15
15
  "./plugins/fullscreen": "./dist/plugins/Fullscreen.js",
16
16
  "./plugins/inline": "./dist/plugins/Inline.js",
17
17
  "./plugins/slideshow": "./dist/plugins/Slideshow.js",
18
+ "./plugins/thumbnails": "./dist/plugins/Thumbnails.js",
19
+ "./plugins/thumbnails.css": "./dist/plugins/thumbnails.css",
18
20
  "./plugins/video": "./dist/plugins/Video.js",
21
+ "./plugins/zoom": "./dist/plugins/Zoom.js",
19
22
  "./styles.css": "./dist/styles.css"
20
23
  },
21
24
  "types": "dist/index.d.ts",
@@ -42,8 +45,14 @@
42
45
  "plugins/slideshow": [
43
46
  "dist/plugins/Slideshow.d.ts"
44
47
  ],
48
+ "plugins/thumbnails": [
49
+ "dist/plugins/Thumbnails.d.ts"
50
+ ],
45
51
  "plugins/video": [
46
52
  "dist/plugins/Video.d.ts"
53
+ ],
54
+ "plugins/zoom": [
55
+ "dist/plugins/Zoom.d.ts"
47
56
  ]
48
57
  }
49
58
  },
@@ -79,32 +88,32 @@
79
88
  "react-dom": ">=16.8.0"
80
89
  },
81
90
  "devDependencies": {
82
- "@commitlint/cli": "^17.0.2",
83
- "@commitlint/config-conventional": "^17.0.2",
91
+ "@commitlint/cli": "^17.0.3",
92
+ "@commitlint/config-conventional": "^17.0.3",
84
93
  "@semantic-release/changelog": "^6.0.1",
85
94
  "@semantic-release/github": "^8.0.4",
86
95
  "@testing-library/jest-dom": "^5.16.4",
87
96
  "@testing-library/react": "^13.3.0",
88
- "@testing-library/user-event": "^14.2.0",
89
- "@types/jest": "^28.1.1",
90
- "@types/react": "^18.0.13",
97
+ "@testing-library/user-event": "^14.2.1",
98
+ "@types/jest": "^28.1.3",
99
+ "@types/react": "^18.0.14",
91
100
  "@types/react-dom": "^18.0.5",
92
- "@typescript-eslint/eslint-plugin": "^5.28.0",
93
- "@typescript-eslint/parser": "^5.28.0",
101
+ "@typescript-eslint/eslint-plugin": "^5.30.0",
102
+ "@typescript-eslint/parser": "^5.30.0",
94
103
  "autoprefixer": "^10.4.7",
95
- "eslint": "^8.17.0",
104
+ "eslint": "^8.18.0",
96
105
  "eslint-config-airbnb": "^19.0.4",
97
106
  "eslint-config-airbnb-typescript": "^17.0.0",
98
107
  "eslint-config-prettier": "^8.5.0",
99
108
  "eslint-plugin-import": "^2.26.0",
100
- "eslint-plugin-jsx-a11y": "^6.5.1",
101
- "eslint-plugin-prettier": "^4.0.0",
102
- "eslint-plugin-react": "^7.30.0",
109
+ "eslint-plugin-jsx-a11y": "^6.6.0",
110
+ "eslint-plugin-prettier": "^4.1.0",
111
+ "eslint-plugin-react": "^7.30.1",
103
112
  "eslint-plugin-react-hooks": "^4.6.0",
104
113
  "husky": "^8.0.1",
105
- "jest": "^28.1.1",
106
- "jest-environment-jsdom": "^28.1.1",
107
- "lint-staged": "^13.0.2",
114
+ "jest": "^28.1.2",
115
+ "jest-environment-jsdom": "^28.1.2",
116
+ "lint-staged": "^13.0.3",
108
117
  "npm-run-all": "^4.1.5",
109
118
  "postcss": "^8.4.14",
110
119
  "postcss-cli": "^9.1.0",
@@ -112,9 +121,9 @@
112
121
  "react": "^18.2.0",
113
122
  "react-dom": "^18.2.0",
114
123
  "rimraf": "^3.0.2",
115
- "sass": "^1.52.3",
124
+ "sass": "^1.53.0",
116
125
  "ts-jest": "^28.0.5",
117
- "typescript": "^4.7.3"
126
+ "typescript": "^4.7.4"
118
127
  },
119
128
  "keywords": [
120
129
  "react",