yet-another-react-lightbox 1.1.2 → 1.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.
@@ -39,11 +39,11 @@ declare const LightboxComponent: {
39
39
  on: import("./types.js").Callbacks;
40
40
  };
41
41
  };
42
- declare type ComponentProps<T> = T extends React.ComponentType<infer P> | React.Component<infer P> ? JSX.LibraryManagedAttributes<T, P> : never;
42
+ declare type LightboxComponentProps<T> = T extends React.ComponentType<infer P> | React.Component<infer P> ? JSX.LibraryManagedAttributes<T, P> : never;
43
43
  declare type MakePartial<T> = T extends object ? Partial<T> : T;
44
44
  declare type NestedPartial<T extends object> = {
45
45
  [P in keyof T]?: MakePartial<T[P]>;
46
46
  };
47
47
  declare type NestedOptional<T, K extends keyof T> = Omit<T, K> & NestedPartial<Pick<T, K>>;
48
- export declare const Lightbox: (props: NestedOptional<ComponentProps<typeof LightboxComponent>, "carousel" | "animation">) => JSX.Element;
48
+ export declare const Lightbox: (props: NestedOptional<LightboxComponentProps<typeof LightboxComponent>, "carousel" | "animation">) => JSX.Element;
49
49
  export {};
@@ -1,7 +1,7 @@
1
1
  import { Augmentation, Component, Module, Node, Plugin } from "../types.js";
2
2
  export declare const createModule: (name: string, component: Component) => Module;
3
- export declare const createNode: (module: Module, children?: Node[] | undefined) => Node;
4
- export declare const withPlugins: (root: Node[], plugins?: Plugin[] | undefined) => {
3
+ export declare const createNode: (module: Module, children?: Node[]) => Node;
4
+ export declare const withPlugins: (root: Node[], plugins?: Plugin[]) => {
5
5
  config: Node[];
6
6
  augmentation: Augmentation;
7
7
  };
@@ -4,7 +4,7 @@ export declare type TouchEventType = "onTouchStart" | "onTouchMove" | "onTouchEn
4
4
  export declare type KeyboardEventType = "onKeyDown" | "onKeyUp";
5
5
  export declare type WheelEventType = "onWheel";
6
6
  export declare type SupportedEventType = PointerEventType | TouchEventType | KeyboardEventType | WheelEventType;
7
- export declare type ReactEventType<T, K extends SupportedEventType> = K extends TouchEventType ? React.TouchEvent<T> : K extends KeyboardEventType ? React.KeyboardEvent<T> : K extends WheelEventType ? React.WheelEvent<T> : K extends PointerEventType ? React.PointerEvent<T> : never;
7
+ export declare type ReactEventType<T, K> = K extends TouchEventType ? React.TouchEvent<T> : K extends KeyboardEventType ? React.KeyboardEvent<T> : K extends WheelEventType ? React.WheelEvent<T> : K extends PointerEventType ? React.PointerEvent<T> : never;
8
8
  export declare type EventCallback<T, P extends React.PointerEvent<T> | React.TouchEvent<T> | React.KeyboardEvent<T> | React.WheelEvent<T>> = (event: P) => void;
9
9
  export declare type SubscribeSensors<T> = <ET extends SupportedEventType>(type: ET, callback: EventCallback<T, ReactEventType<T, ET>>) => () => void;
10
10
  export declare type RegisterSensors<T> = Required<Pick<React.HTMLAttributes<T>, PointerEventType>> & Required<Pick<React.HTMLAttributes<T>, TouchEventType>> & Required<Pick<React.HTMLAttributes<T>, KeyboardEventType>> & Required<Pick<React.HTMLAttributes<T>, WheelEventType>>;
@@ -22,11 +22,10 @@ export const useSensors = () => {
22
22
  onWheel: (event) => notifySubscribers("onWheel", event),
23
23
  },
24
24
  subscribeSensors: (type, callback) => {
25
- var _a;
26
25
  if (!subscribers[type]) {
27
26
  subscribers[type] = [];
28
27
  }
29
- (_a = subscribers[type]) === null || _a === void 0 ? void 0 : _a.push(callback);
28
+ subscribers[type].push(callback);
30
29
  return () => {
31
30
  const listeners = subscribers[type];
32
31
  if (listeners) {
@@ -10,6 +10,7 @@ export const Inline = ({ augment, replace, remove }) => {
10
10
  buttons: buttons.filter((button) => button !== "close"),
11
11
  ...restToolbar,
12
12
  },
13
+ inline: { style: { width: "100%", height: "100%" } },
13
14
  ...restProps,
14
15
  }));
15
16
  remove("no-scroll");
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "yet-another-react-lightbox",
3
- "version": "1.1.2",
3
+ "version": "1.2.2",
4
4
  "description": "Modern lightbox component for React",
5
5
  "author": "Igor Danchenko",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
- "types": "dist/index.d.ts",
10
9
  "exports": {
11
10
  ".": "./dist/index.js",
12
- "./styles.css": "./dist/styles.css",
13
11
  "./core": "./dist/core/index.js",
14
- "./plugins": "./dist/plugins/index.js"
12
+ "./plugins": "./dist/plugins/index.js",
13
+ "./plugins/fullscreen": "./dist/plugins/Fullscreen.js",
14
+ "./plugins/inline": "./dist/plugins/Inline.js",
15
+ "./plugins/video": "./dist/plugins/Video.js",
16
+ "./styles.css": "./dist/styles.css"
15
17
  },
18
+ "types": "dist/index.d.ts",
16
19
  "typesVersions": {
17
20
  "*": {
18
21
  "*": [
@@ -23,6 +26,15 @@
23
26
  ],
24
27
  "plugins": [
25
28
  "dist/plugins/index.d.ts"
29
+ ],
30
+ "plugins/fullscreen": [
31
+ "dist/plugins/Fullscreen.d.ts"
32
+ ],
33
+ "plugins/inline": [
34
+ "dist/plugins/Inline.d.ts"
35
+ ],
36
+ "plugins/video": [
37
+ "dist/plugins/Video.d.ts"
26
38
  ]
27
39
  }
28
40
  },
@@ -53,27 +65,27 @@
53
65
  "test": "jest"
54
66
  },
55
67
  "dependencies": {
56
- "prop-types": "^15.8.1"
68
+ "prop-types": "^15.5.7"
57
69
  },
58
70
  "peerDependencies": {
59
71
  "react": ">=16.8.0",
60
72
  "react-dom": ">=16.8.0"
61
73
  },
62
74
  "devDependencies": {
63
- "@commitlint/cli": "^17.0.0",
75
+ "@commitlint/cli": "^17.0.1",
64
76
  "@commitlint/config-conventional": "^17.0.0",
65
77
  "@semantic-release/changelog": "^6.0.1",
66
78
  "@semantic-release/github": "^8.0.4",
67
79
  "@testing-library/jest-dom": "^5.16.4",
68
- "@testing-library/react": "^13.2.0",
80
+ "@testing-library/react": "^13.3.0",
69
81
  "@testing-library/user-event": "^14.2.0",
70
82
  "@types/jest": "^27.5.1",
71
83
  "@types/react": "^18.0.9",
72
- "@types/react-dom": "^18.0.4",
73
- "@typescript-eslint/eslint-plugin": "^5.25.0",
74
- "@typescript-eslint/parser": "^5.25.0",
84
+ "@types/react-dom": "^18.0.5",
85
+ "@typescript-eslint/eslint-plugin": "^5.26.0",
86
+ "@typescript-eslint/parser": "^5.26.0",
75
87
  "autoprefixer": "^10.4.7",
76
- "eslint": "^8.15.0",
88
+ "eslint": "^8.16.0",
77
89
  "eslint-config-airbnb": "^19.0.4",
78
90
  "eslint-config-airbnb-typescript": "^17.0.0",
79
91
  "eslint-config-prettier": "^8.5.0",
@@ -85,7 +97,7 @@
85
97
  "husky": "^8.0.1",
86
98
  "jest": "^28.1.0",
87
99
  "jest-environment-jsdom": "^28.1.0",
88
- "lint-staged": "^12.4.1",
100
+ "lint-staged": "^12.4.2",
89
101
  "npm-run-all": "^4.1.5",
90
102
  "postcss": "^8.4.14",
91
103
  "postcss-cli": "^9.1.0",
@@ -93,9 +105,9 @@
93
105
  "react": "^18.1.0",
94
106
  "react-dom": "^18.1.0",
95
107
  "rimraf": "^3.0.2",
96
- "sass": "^1.52.0",
97
- "ts-jest": "^28.0.2",
98
- "typescript": "^4.6.4"
108
+ "sass": "^1.52.1",
109
+ "ts-jest": "^28.0.3",
110
+ "typescript": "^4.7.2"
99
111
  },
100
112
  "keywords": [
101
113
  "react",