@griddo/ax 11.4.24 → 11.5.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/package.json +2 -2
- package/src/__tests__/components/Fields/ImageField/ImageField.test.tsx +52 -34
- package/src/api/folders.tsx +62 -0
- package/src/api/images.tsx +159 -1
- package/src/api/index.tsx +2 -0
- package/src/api/sites.tsx +1 -1
- package/src/components/Fields/ImageField/index.tsx +7 -6
- package/src/components/Fields/Wysiwyg/index.tsx +5 -3
- package/src/components/FileGallery/index.tsx +22 -16
- package/src/components/FileGallery/style.tsx +18 -4
- package/src/components/Gallery/FolderItem/index.tsx +39 -0
- package/src/components/Gallery/FolderItem/style.tsx +31 -0
- package/src/components/Gallery/GalleryPanel/DetailPanel/index.tsx +112 -237
- package/src/components/Gallery/GalleryPanel/DetailPanel/style.tsx +77 -61
- package/src/components/Gallery/GalleryPanel/index.tsx +37 -32
- package/src/components/Gallery/GalleryPanel/style.tsx +1 -0
- package/src/components/Gallery/index.tsx +267 -163
- package/src/components/Gallery/style.tsx +200 -135
- package/src/components/Loading/index.tsx +7 -2
- package/src/components/Loading/style.tsx +2 -2
- package/src/components/TableFilters/StateFilter/index.tsx +1 -1
- package/src/containers/FileDrive/actions.tsx +1 -2
- package/src/containers/FileDrive/interfaces.tsx +3 -3
- package/src/containers/Gallery/actions.tsx +359 -13
- package/src/containers/Gallery/constants.tsx +12 -0
- package/src/containers/Gallery/interfaces.tsx +44 -1
- package/src/containers/Gallery/reducer.tsx +27 -3
- package/src/containers/Sites/actions.tsx +2 -2
- package/src/containers/Users/actions.tsx +9 -6
- package/src/helpers/files.tsx +37 -1
- package/src/helpers/index.tsx +3 -1
- package/src/modules/App/Routing/NavMenu/NavItem/NavSubItem/style.tsx +7 -2
- package/src/modules/App/Routing/NavMenu/index.tsx +2 -1
- package/src/modules/FileDrive/FileFilters/SortBy/style.tsx +3 -0
- package/src/modules/FileDrive/FileModal/DetailPanel/UsageContent/index.tsx +1 -1
- package/src/modules/FileDrive/FolderTree/MenuItem/index.tsx +14 -10
- package/src/modules/FileDrive/FolderTree/MenuItem/style.tsx +8 -1
- package/src/modules/FileDrive/FolderTree/MenuList/index.tsx +9 -2
- package/src/modules/FileDrive/index.tsx +45 -28
- package/src/modules/FileDrive/style.tsx +7 -6
- package/src/modules/GlobalEditor/index.tsx +1 -1
- package/src/modules/MediaGallery/Breadcrumb/index.tsx +42 -0
- package/src/modules/MediaGallery/Breadcrumb/style.tsx +18 -0
- package/src/modules/MediaGallery/BulkGridHeader/GridHeader/index.tsx +37 -0
- package/src/modules/MediaGallery/BulkGridHeader/GridHeader/style.tsx +19 -0
- package/src/modules/MediaGallery/BulkGridHeader/index.tsx +35 -0
- package/src/modules/MediaGallery/BulkGridHeader/style.tsx +17 -0
- package/src/modules/MediaGallery/BulkListHeader/TableHeader/index.tsx +46 -0
- package/src/modules/MediaGallery/BulkListHeader/TableHeader/style.tsx +53 -0
- package/src/modules/MediaGallery/BulkListHeader/index.tsx +42 -0
- package/src/modules/MediaGallery/BulkListHeader/style.tsx +17 -0
- package/src/modules/MediaGallery/FolderItem/index.tsx +191 -0
- package/src/modules/MediaGallery/FolderItem/style.tsx +39 -0
- package/src/modules/MediaGallery/FolderTree/MenuItem/index.tsx +87 -0
- package/src/modules/MediaGallery/FolderTree/MenuItem/style.tsx +76 -0
- package/src/modules/MediaGallery/FolderTree/MenuList/index.tsx +34 -0
- package/src/modules/MediaGallery/FolderTree/index.tsx +62 -0
- package/src/modules/MediaGallery/FolderTree/style.tsx +49 -0
- package/src/modules/MediaGallery/GridItem/index.tsx +149 -0
- package/src/modules/MediaGallery/GridItem/style.tsx +74 -0
- package/src/modules/MediaGallery/ImageDragAndDrop/index.tsx +299 -0
- package/src/{components/Gallery/GalleryPanel/GalleryDragAndDrop → modules/MediaGallery/ImageDragAndDrop}/style.tsx +114 -33
- package/src/{components/Gallery/GalleryFilters → modules/MediaGallery/ImageFilters}/Orientation/style.tsx +2 -1
- package/src/{components/Gallery/GalleryFilters → modules/MediaGallery/ImageFilters}/SortBy/style.tsx +3 -0
- package/src/{components/Gallery/GalleryFilters → modules/MediaGallery/ImageFilters}/Type/style.tsx +1 -0
- package/src/modules/MediaGallery/ImageFilters/Usage/index.tsx +75 -0
- package/src/modules/MediaGallery/ImageFilters/Usage/style.tsx +30 -0
- package/src/modules/MediaGallery/ImageModal/DetailPanel/UsageContent/Item/index.tsx +35 -0
- package/src/modules/MediaGallery/ImageModal/DetailPanel/UsageContent/Item/style.tsx +43 -0
- package/src/modules/MediaGallery/ImageModal/DetailPanel/UsageContent/ItemGroup/index.tsx +44 -0
- package/src/modules/MediaGallery/ImageModal/DetailPanel/UsageContent/ItemGroup/style.tsx +34 -0
- package/src/modules/MediaGallery/ImageModal/DetailPanel/UsageContent/index.tsx +233 -0
- package/src/modules/MediaGallery/ImageModal/DetailPanel/UsageContent/style.tsx +21 -0
- package/src/modules/MediaGallery/ImageModal/DetailPanel/index.tsx +209 -0
- package/src/modules/MediaGallery/ImageModal/DetailPanel/style.tsx +81 -0
- package/src/modules/MediaGallery/ImageModal/index.tsx +168 -0
- package/src/modules/MediaGallery/ImageModal/style.tsx +106 -0
- package/src/modules/MediaGallery/ListItem/index.tsx +181 -0
- package/src/modules/MediaGallery/ListItem/style.tsx +100 -0
- package/src/modules/MediaGallery/UploadItem/index.tsx +32 -0
- package/src/modules/MediaGallery/UploadItem/style.tsx +42 -0
- package/src/modules/MediaGallery/atoms.tsx +196 -0
- package/src/{components/Gallery → modules/MediaGallery}/hooks.tsx +10 -4
- package/src/modules/MediaGallery/index.tsx +892 -0
- package/src/modules/MediaGallery/style.tsx +216 -0
- package/src/{components/Gallery → modules/MediaGallery}/utils.tsx +1 -1
- package/src/modules/StructuredData/Form/index.tsx +2 -2
- package/src/routes/multisite.tsx +24 -4
- package/src/routes/site.tsx +24 -4
- package/src/types/files.tsx +98 -0
- package/src/types/index.tsx +33 -91
- package/src/__tests__/components/Gallery/Gallery.test.tsx +0 -559
- package/src/__tests__/components/Gallery/GalleryFilters/Orientation/Orientation.test.tsx +0 -54
- package/src/__tests__/components/Gallery/GalleryFilters/SortBy/SortBy.test.tsx +0 -118
- package/src/__tests__/components/Gallery/GalleryFilters/Type/Type.test.tsx +0 -54
- package/src/__tests__/components/Gallery/GalleryPanel/DetailPanel/DetailPanel.test.tsx +0 -869
- package/src/__tests__/components/Gallery/GalleryPanel/GalleryDragAndDrop/GalleryDragAndDrop.test.tsx +0 -249
- package/src/__tests__/components/Gallery/GalleryPanel/GalleryPanel.test.tsx +0 -55
- package/src/components/Gallery/GalleryPanel/GalleryDragAndDrop/index.tsx +0 -239
- package/src/containers/FileDrive/utils.tsx +0 -37
- /package/src/{components/Gallery/GalleryFilters → modules/MediaGallery/ImageFilters}/Orientation/index.tsx +0 -0
- /package/src/{components/Gallery/GalleryFilters → modules/MediaGallery/ImageFilters}/SortBy/index.tsx +0 -0
- /package/src/{components/Gallery/GalleryFilters → modules/MediaGallery/ImageFilters}/Type/index.tsx +0 -0
|
@@ -1,106 +1,122 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const DetailPanelWrapper = styled.div`
|
|
4
4
|
position: relative;
|
|
5
|
-
opacity: ${p => (p.hidden ? "0" : "1")};
|
|
5
|
+
opacity: ${(p) => (p.hidden ? "0" : "1")};
|
|
6
6
|
transition: opacity 0.1s;
|
|
7
7
|
height: 100%;
|
|
8
8
|
width: 100%;
|
|
9
|
-
display: ${p => (p.hidden ? "none" : "block")};
|
|
10
9
|
`;
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
const PanelActions = styled.div`
|
|
13
12
|
position: absolute;
|
|
14
13
|
bottom: 0;
|
|
15
14
|
left: 0;
|
|
16
15
|
right: 0;
|
|
17
16
|
display: flex;
|
|
18
17
|
justify-content: flex-end;
|
|
19
|
-
background-color: ${p => p.theme.color.uiBarBackground};
|
|
20
|
-
padding: ${p => p.theme.spacing.s} ${p => p.theme.spacing.m};
|
|
21
|
-
border-top: 1px solid ${p => p.theme.color.uiLine};
|
|
18
|
+
background-color: ${(p) => p.theme.color.uiBarBackground};
|
|
19
|
+
padding: ${(p) => p.theme.spacing.s} ${(p) => p.theme.spacing.m};
|
|
20
|
+
border-top: 1px solid ${(p) => p.theme.color.uiLine};
|
|
22
21
|
button:not(:first-child) {
|
|
23
|
-
margin-left: ${p => p.theme.spacing.s};
|
|
22
|
+
margin-left: ${(p) => p.theme.spacing.s};
|
|
24
23
|
}
|
|
25
24
|
`;
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
const PanelForm = styled.div`
|
|
28
27
|
position: relative;
|
|
29
28
|
width: 100%;
|
|
30
|
-
height: calc(${p => p.theme.spacing.xl} * 8);
|
|
29
|
+
height: calc(${(p) => p.theme.spacing.xl} * 8);
|
|
31
30
|
overflow: auto;
|
|
32
31
|
`;
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
${p => p.theme.textStyle.uiM};
|
|
36
|
-
color: ${p => p.theme.color.textMediumEmphasis};
|
|
37
|
-
margin-bottom: ${p => p.theme.spacing.xxs};
|
|
33
|
+
const InfoRow = styled.div`
|
|
34
|
+
${(p) => p.theme.textStyle.uiM};
|
|
35
|
+
color: ${(p) => p.theme.color.textMediumEmphasis};
|
|
36
|
+
margin-bottom: ${(p) => p.theme.spacing.xxs};
|
|
38
37
|
`;
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
${p => p.theme.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export const ImageInfoWrapper = styled.div`
|
|
47
|
-
padding: ${p => p.theme.spacing.m};
|
|
48
|
-
border-bottom: 1px solid ${p => p.theme.color.uiLine};
|
|
39
|
+
const InfoWrapper = styled.div`
|
|
40
|
+
padding: ${(p) => `${p.theme.spacing.s} ${p.theme.spacing.s} ${p.theme.spacing.m} ${p.theme.spacing.s}`};
|
|
41
|
+
border-bottom: 1px solid ${(p) => p.theme.color.uiLine};
|
|
42
|
+
strong {
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
}
|
|
49
45
|
`;
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
const ButtonsWrapper = styled.div`
|
|
52
48
|
display: flex;
|
|
53
|
-
|
|
54
|
-
align-items: flex-start;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
`;
|
|
49
|
+
align-items: center;
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
width: 100%;
|
|
61
|
-
img {
|
|
62
|
-
border: 1px solid ${p => p.theme.color.uiLine};
|
|
63
|
-
border-radius: 4px;
|
|
51
|
+
button:first-child {
|
|
52
|
+
margin-right: ${(p) => p.theme.spacing.xs};
|
|
64
53
|
}
|
|
65
54
|
`;
|
|
66
55
|
|
|
67
|
-
|
|
68
|
-
${p => p.theme.textStyle.uiL};
|
|
69
|
-
color: ${p => p.theme.color.textHighEmphasis};
|
|
70
|
-
margin-bottom: ${p => p.theme.spacing.xxs};
|
|
56
|
+
const Name = styled.div`
|
|
57
|
+
${(p) => p.theme.textStyle.uiL};
|
|
58
|
+
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
59
|
+
margin-bottom: ${(p) => p.theme.spacing.xxs};
|
|
71
60
|
overflow-wrap: break-word;
|
|
72
61
|
`;
|
|
73
62
|
|
|
74
|
-
|
|
75
|
-
${p => p.theme.
|
|
76
|
-
color: ${p => p.theme.color.textMediumEmphasis};
|
|
77
|
-
margin-bottom: ${p => p.theme.spacing.xxs};
|
|
78
|
-
`;
|
|
79
|
-
|
|
80
|
-
export const ImageDimensions = styled.div`
|
|
81
|
-
${p => p.theme.textStyle.uiM};
|
|
82
|
-
color: ${p => p.theme.color.textMediumEmphasis};
|
|
83
|
-
`;
|
|
84
|
-
|
|
85
|
-
export const FormWrapper = styled.div`
|
|
86
|
-
padding: ${p => p.theme.spacing.m};
|
|
63
|
+
const FormWrapper = styled.div`
|
|
64
|
+
padding: ${(p) => `${p.theme.spacing.s} ${p.theme.spacing.s} 0 ${p.theme.spacing.s}`};
|
|
87
65
|
`;
|
|
88
66
|
|
|
89
|
-
|
|
67
|
+
const Url = styled.div`
|
|
90
68
|
display: flex;
|
|
91
|
-
${p => p.theme.textStyle.fieldContent};
|
|
92
|
-
color: ${p => p.theme.color.textMediumEmphasis};
|
|
93
|
-
background-color: ${p => p.theme.color.uiBackground03};
|
|
69
|
+
${(p) => p.theme.textStyle.fieldContent};
|
|
70
|
+
color: ${(p) => p.theme.color.textMediumEmphasis};
|
|
71
|
+
background-color: ${(p) => p.theme.color.uiBackground03};
|
|
94
72
|
border-radius: 4px;
|
|
95
73
|
width: 100%;
|
|
96
|
-
height: ${p => p.theme.spacing.l};
|
|
97
|
-
padding: 0 ${p => p.theme.spacing.s};
|
|
98
|
-
margin-bottom: ${p => p.theme.spacing.m};
|
|
74
|
+
height: ${(p) => p.theme.spacing.l};
|
|
75
|
+
padding: 0 ${(p) => p.theme.spacing.s};
|
|
76
|
+
margin-bottom: ${(p) => p.theme.spacing.m};
|
|
99
77
|
overflow: hidden;
|
|
100
78
|
white-space: nowrap;
|
|
101
79
|
`;
|
|
102
80
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
81
|
+
const ImageWrapper = styled.div`
|
|
82
|
+
width: 120px;
|
|
83
|
+
height: auto;
|
|
84
|
+
img {
|
|
85
|
+
border-radius: ${(p) => p.theme.radii.s};
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
const Label = styled.div`
|
|
90
|
+
${(p) => p.theme.textStyle.fieldLabel};
|
|
91
|
+
color: ${(p) => p.theme.colors.textMediumEmphasis};
|
|
92
|
+
margin-bottom: ${(p) => p.theme.spacing.xxs};
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
const FieldText = styled.div`
|
|
96
|
+
${(p) => p.theme.textStyle.uiM};
|
|
97
|
+
color: ${(p) => p.theme.colors.textHighEmphasis};
|
|
98
|
+
margin-bottom: ${(p) => p.theme.spacing.s};
|
|
106
99
|
`;
|
|
100
|
+
|
|
101
|
+
const Header = styled.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: top;
|
|
104
|
+
margin-bottom: ${(p) => p.theme.spacing.xs};
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
DetailPanelWrapper,
|
|
110
|
+
PanelActions,
|
|
111
|
+
PanelForm,
|
|
112
|
+
InfoRow,
|
|
113
|
+
InfoWrapper,
|
|
114
|
+
ButtonsWrapper,
|
|
115
|
+
Name,
|
|
116
|
+
FormWrapper,
|
|
117
|
+
Url,
|
|
118
|
+
ImageWrapper,
|
|
119
|
+
Label,
|
|
120
|
+
FieldText,
|
|
121
|
+
Header,
|
|
122
|
+
};
|
|
@@ -1,52 +1,57 @@
|
|
|
1
1
|
import React, { memo } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { usePermission } from "@ax/hooks";
|
|
3
|
+
import { IGetFolderParams, IImage } from "@ax/types";
|
|
5
4
|
|
|
6
|
-
import GalleryDragAndDrop from "./GalleryDragAndDrop";
|
|
7
5
|
import DetailPanel from "./DetailPanel";
|
|
6
|
+
import ImageDragAndDrop from "@ax/modules/MediaGallery/ImageDragAndDrop";
|
|
7
|
+
|
|
8
8
|
import * as S from "./style";
|
|
9
9
|
|
|
10
10
|
const GalleryPanel = (props: IGalleryPanelProps) => {
|
|
11
|
-
const {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const {
|
|
12
|
+
selectedImage,
|
|
13
|
+
validFormats,
|
|
14
|
+
setImage,
|
|
15
|
+
scope,
|
|
16
|
+
currentFolderID,
|
|
17
|
+
isAllowedToAdd,
|
|
18
|
+
isAllowedToEdit,
|
|
19
|
+
handleUpload,
|
|
20
|
+
getParams,
|
|
21
|
+
} = props;
|
|
17
22
|
|
|
18
23
|
return (
|
|
19
24
|
<S.GalleryPanel>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
{!selectedImage ? (
|
|
26
|
+
<ImageDragAndDrop
|
|
27
|
+
validFormats={validFormats}
|
|
28
|
+
folderID={currentFolderID}
|
|
29
|
+
handleUpload={handleUpload}
|
|
30
|
+
siteID={scope}
|
|
31
|
+
isAllowedToUpload={isAllowedToAdd}
|
|
32
|
+
/>
|
|
33
|
+
) : (
|
|
34
|
+
<DetailPanel
|
|
35
|
+
selectedImage={selectedImage}
|
|
36
|
+
setImage={setImage}
|
|
37
|
+
isAllowedToEdit={isAllowedToEdit}
|
|
38
|
+
getParams={getParams}
|
|
39
|
+
/>
|
|
40
|
+
)}
|
|
36
41
|
</S.GalleryPanel>
|
|
37
42
|
);
|
|
38
43
|
};
|
|
39
44
|
|
|
40
45
|
export interface IGalleryPanelProps {
|
|
41
|
-
|
|
46
|
+
selectedImage: IImage | null;
|
|
42
47
|
validFormats: string[];
|
|
43
|
-
setImage: (
|
|
44
|
-
isGlobalTab: boolean;
|
|
48
|
+
setImage: (fileData: any) => void;
|
|
45
49
|
scope: number | "global";
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
currentFolderID: number | null;
|
|
51
|
+
handleUpload: (file: IImage[]) => void;
|
|
52
|
+
isAllowedToEdit: boolean;
|
|
53
|
+
isAllowedToAdd: boolean;
|
|
54
|
+
getParams(): IGetFolderParams;
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
export default memo(GalleryPanel);
|