react-editable-photo-grid 2.3.7 → 3.0.1

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/src/types.ts CHANGED
@@ -1,78 +1,82 @@
1
- import { ReactElement } from "react";
2
-
3
- export interface PhotoIdAndRowKey {
4
- id: string;
5
- rowKey: number;
6
- }
7
-
8
- export interface ButtonArrows {
9
- up: string;
10
- down: string;
11
- left: string;
12
- right: string
13
- }
14
-
15
- export interface GalleryButtonArrows {
16
- prev: string;
17
- next: string;
18
- }
19
-
20
- export interface PhotoItem {
21
- id: string;
22
- column: number;
23
- row: number;
24
- image_path: string;
25
- thumbnail_path: string;
26
- width: number;
27
- height: number;
28
- name?: string;
29
- description?: string;
30
- }
31
-
32
- export enum imgSrcProperty {
33
- id = 'id',
34
- thumbnail_path = 'thumbnail_path',
35
- image_path = 'image_path'
36
- }
37
- export interface PhotoRows {
38
- [key: number]: PhotoItem[];
39
- }
40
- export interface PhotoGridProps {
41
- photos: PhotoItem[];
42
- rows: PhotoRows;
43
- updateRows: (rows: PhotoRows) => void;
44
- changes: number;
45
- increaseChanges: () => void;
46
- isEditing: boolean;
47
- selectedPhotos: Array<string>;
48
- updateSelectedPhotos: (ids: Array<string>) => void;
49
- onPhotoClick?: (e: React.MouseEvent<HTMLImageElement>) => void;
50
- imageSrcPrefix: string;
51
- imageSrcProperty: imgSrcProperty;
52
- photoMenu: ReactElement | undefined,
53
- useGallery?: boolean
54
- gallerySrcProperty?: imgSrcProperty;
55
- onGallerySwipe?: (photo: PhotoItem) => void;
56
- buttonArrows?: ButtonArrows;
57
- galleryButtonArrows?: GalleryButtonArrows;
58
- galleryType: string
59
- }
60
-
61
- export interface PhotoControlsProps {
62
- rowKey: string | number;
63
- photo: PhotoItem;
64
- rowCount: number,
65
- photoCount: number,
66
- movePhotoLeft: (e: React.MouseEvent<HTMLButtonElement>) => void;
67
- movePhotoUp: (e: React.MouseEvent<HTMLButtonElement>) => void;
68
- movePhotoDown: (e: React.MouseEvent<HTMLButtonElement>) => void;
69
- movePhotoRight: (e: React.MouseEvent<HTMLButtonElement>) => void;
70
- buttonArrows?: ButtonArrows;
71
- }
72
- export interface RowControlsProps {
73
- rowKey: string | number;
74
- moveRowUp: (e: React.MouseEvent<HTMLButtonElement>) => void;
75
- moveRowDown: (e: React.MouseEvent<HTMLButtonElement>) => void;
76
- rowCount: number;
77
- buttonArrows?: ButtonArrows;
1
+ import React, { ReactElement } from "react";
2
+
3
+ export type PhotoIdAndRowKey = {
4
+ id: string;
5
+ rowKey: number;
6
+ }
7
+
8
+ export type ButtonArrows = {
9
+ up: string;
10
+ down: string;
11
+ left: string;
12
+ right: string
13
+ }
14
+
15
+ export type GalleryButtonArrows = {
16
+ prev: string;
17
+ next: string;
18
+ }
19
+
20
+ export interface PhotoItem {
21
+ id: string;
22
+ column: number;
23
+ row: number;
24
+ image_path: string;
25
+ thumbnail_path: string;
26
+ width: number;
27
+ height: number;
28
+ name?: string;
29
+ description?: string;
30
+ }
31
+
32
+ export enum imgSrcProperty {
33
+ id = 'id',
34
+ thumbnail_path = 'thumbnail_path',
35
+ image_path = 'image_path'
36
+ }
37
+
38
+ export type PhotoRows = {
39
+ [key: number]: PhotoItem[];
40
+ }
41
+
42
+ export type PhotoGridProps = {
43
+ photos: PhotoItem[];
44
+ rows: PhotoRows;
45
+ changes: number;
46
+ isEditing: boolean;
47
+ selectedPhotos: Array<string>;
48
+ imageSrcPrefix: string;
49
+ imageSrcProperty: imgSrcProperty;
50
+ photoMenu: ReactElement | undefined;
51
+ photoActions: ReactElement| undefined;
52
+ galleryType: string;
53
+ useGallery?: boolean;
54
+ gallerySrcProperty?: imgSrcProperty;
55
+ buttonArrows?: ButtonArrows;
56
+ galleryButtonArrows?: GalleryButtonArrows;
57
+ updateRows: (rows: PhotoRows) => void;
58
+ increaseChanges: () => void;
59
+ onGallerySwipe?: (photo: PhotoItem) => void;
60
+ updateSelectedPhotos: (ids: Array<string>) => void;
61
+ onPhotoClick?: (e: React.MouseEvent<HTMLImageElement>) => void;
62
+ }
63
+
64
+ export type PhotoControlsProps = {
65
+ rowKey: string | number;
66
+ photo: PhotoItem;
67
+ rowCount: number,
68
+ photoCount: number,
69
+ movePhotoLeft: (e: React.MouseEvent<HTMLButtonElement>) => void;
70
+ movePhotoUp: (e: React.MouseEvent<HTMLButtonElement>) => void;
71
+ movePhotoDown: (e: React.MouseEvent<HTMLButtonElement>) => void;
72
+ movePhotoRight: (e: React.MouseEvent<HTMLButtonElement>) => void;
73
+ buttonArrows?: ButtonArrows;
74
+ }
75
+
76
+ export type RowControlsProps = {
77
+ rowKey: string | number;
78
+ moveRowUp: (e: React.MouseEvent<HTMLButtonElement>) => void;
79
+ moveRowDown: (e: React.MouseEvent<HTMLButtonElement>) => void;
80
+ rowCount: number;
81
+ buttonArrows?: ButtonArrows;
78
82
  }