@kitconcept/volto-light-theme 1.0.0-rc.8 → 1.0.0-rc.9

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.
@@ -1,132 +1,10 @@
1
1
  /**
2
2
  * OVERRIDE FileView.jsx
3
- * REASON: BFS theme
3
+ * REASON: Adding size of file.
4
4
  * DATE: 2023-07-11
5
5
  * DEVELOPER: @iRohitSingh
6
6
  */
7
7
 
8
- /**
9
- * File view component.
10
- * @module components/theme/View/FileView
11
- */
12
-
13
- import React from 'react';
14
- import PropTypes from 'prop-types';
15
- import { Container } from 'semantic-ui-react';
16
-
17
- import { flattenToAppURL } from '@plone/volto/helpers';
18
-
19
- /**
20
- * File view component class.
21
- * @function FileView
22
- * @params {object} content Content object.
23
- * @returns {string} Markup of the component.
24
- */
25
- const FileView = ({ content }) => (
26
- <Container className="view-wrapper">
27
- <h1 className="documentFirstHeading">
28
- {content.title}
29
- {content.subtitle && ` - ${content.subtitle}`}
30
- </h1>
31
- <div className="file-detail">
32
- {content.description && (
33
- <p className="documentDescription">{content.description}</p>
34
- )}
35
- {content.file?.download && (
36
- <>
37
- <a href={flattenToAppURL(content.file.download)}>
38
- {content.file.filename}
39
- </a>{' '}
40
- <span>
41
- (
42
- {(() => {
43
- switch (content?.file['content-type']) {
44
- case 'image/jpeg':
45
- return 'JPEG';
46
- case 'image/png':
47
- return 'PNG';
48
- case 'image/svg+xml':
49
- return 'SVG';
50
- case 'image/gif':
51
- return 'GIF';
52
- case 'application/pdf':
53
- return 'PDF';
54
- case 'application/msexcel':
55
- return 'XLS';
56
- case 'application/vnd.ms-excel':
57
- return 'XLS';
58
- case 'application/msword':
59
- return 'DOC';
60
- case 'application/mspowerpoint':
61
- return 'PPT';
62
- case 'audio/mp4':
63
- return 'MP4';
64
- case 'application/zip':
65
- return 'ZIP';
66
- case 'video/webm':
67
- return 'WEBM';
68
- case 'video/x-msvideo':
69
- return 'AVI';
70
- case 'video/x-sgi-movie':
71
- return 'MOVIE';
72
- case 'text/xml':
73
- return 'XML';
74
- case 'text/plain':
75
- return 'TXT';
76
- case 'text/calendar':
77
- return 'ICS';
78
- case 'image/x-icon':
79
- return 'ICO';
80
- case 'image/bmp':
81
- return 'BMP';
82
- case 'audio/mpeg':
83
- return 'MP3';
84
- case 'audio/wav':
85
- return 'WAV';
86
- case 'application/json':
87
- return 'JSON';
88
- case 'application/postscript':
89
- return 'PS';
90
- case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
91
- return 'XLSX';
92
- case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
93
- return 'DOCX';
94
- case 'application/xml':
95
- return 'XML';
96
- case 'application/mshelp':
97
- return 'HLP';
98
- case 'application/gzip':
99
- return 'GZ';
100
- default:
101
- return '';
102
- }
103
- })()}{' '}
104
- /{' '}
105
- {content.file?.size < 1000000
106
- ? Math.round(content.file.size / 1000)
107
- : Math.round(content.file.size / 1000000)}
108
- {content.file?.size < 1000000 ? 'KB' : 'MB'})
109
- </span>
110
- </>
111
- )}
112
- </div>
113
- </Container>
114
- );
115
-
116
- /**
117
- * Property types.
118
- * @property {Object} propTypes Property types.
119
- * @static
120
- */
121
- FileView.propTypes = {
122
- content: PropTypes.shape({
123
- title: PropTypes.string,
124
- description: PropTypes.string,
125
- file: PropTypes.shape({
126
- download: PropTypes.string,
127
- filename: PropTypes.string,
128
- }),
129
- }).isRequired,
130
- };
8
+ import FileView from '../../../../../components/Theme/FileView';
131
9
 
132
10
  export default FileView;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * OVERRIDE ImageView.jsx
3
+ * REASON: Using custom component to render Image and Caption.
4
+ * DATE: 2023-07-19
5
+ * DEVELOPER: @IFlameing
6
+ */
7
+
8
+ import ImageView from '../../../../../components/Theme/ImageView';
9
+
10
+ export default ImageView;
@@ -1,57 +1,10 @@
1
1
  /**
2
2
  * OVERRIDE NewsItemView.jsx
3
- * REASON: BFS theme
3
+ * REASON: Adding dates and headtitle above the title of page.
4
4
  * DATE: 2023-07-04
5
5
  * DEVELOPER: @IFlameing
6
6
  */
7
7
 
8
- /**
9
- * NewsItemView view component.
10
- * @module components/theme/View/NewsItemView
11
- */
12
-
13
- import React from 'react';
14
- import PropTypes from 'prop-types';
15
- import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
16
- import { FormattedDate } from '@plone/volto/components';
17
-
18
- /**
19
- * NewsItemView view component class.
20
- * @function NewsItemView
21
- * @params {object} content Content object.
22
- * @returns {string} Markup of the component.
23
- */
24
- const NewsItemView = ({ content }) => {
25
- return (
26
- <div id="page-document" className="ui container viewwrapper event-view">
27
- <div className="dates">
28
- {content?.effective ? (
29
- <span className="day">
30
- <FormattedDate date={content?.effective} />{' '}
31
- </span>
32
- ) : (
33
- <span className="day">No date</span>
34
- )}{' '}
35
- <span className="headtitle">| {content?.head_title}</span>
36
- </div>
37
- <RenderBlocks content={content} />
38
- </div>
39
- );
40
- };
41
-
42
- /**
43
- * Property types.
44
- * @property {Object} propTypes Property types.
45
- * @static
46
- */
47
- NewsItemView.propTypes = {
48
- content: PropTypes.shape({
49
- title: PropTypes.string,
50
- description: PropTypes.string,
51
- text: PropTypes.shape({
52
- data: PropTypes.string,
53
- }),
54
- }).isRequired,
55
- };
8
+ import NewsItemView from '../../../../../components/Theme/NewsItemView';
56
9
 
57
10
  export default NewsItemView;
@@ -0,0 +1,64 @@
1
+ const Filetype = (mime_type) => {
2
+ switch (mime_type) {
3
+ case 'image/jpeg':
4
+ return 'JPEG';
5
+ case 'image/png':
6
+ return 'PNG';
7
+ case 'image/svg+xml':
8
+ return 'SVG';
9
+ case 'image/gif':
10
+ return 'GIF';
11
+ case 'application/pdf':
12
+ return 'PDF';
13
+ case 'application/msexcel':
14
+ return 'XLS';
15
+ case 'application/vnd.ms-excel':
16
+ return 'XLS';
17
+ case 'application/msword':
18
+ return 'DOC';
19
+ case 'application/mspowerpoint':
20
+ return 'PPT';
21
+ case 'audio/mp4':
22
+ return 'MP4';
23
+ case 'application/zip':
24
+ return 'ZIP';
25
+ case 'video/webm':
26
+ return 'WEBM';
27
+ case 'video/x-msvideo':
28
+ return 'AVI';
29
+ case 'video/x-sgi-movie':
30
+ return 'MOVIE';
31
+ case 'text/xml':
32
+ return 'XML';
33
+ case 'text/plain':
34
+ return 'TXT';
35
+ case 'text/calendar':
36
+ return 'ICS';
37
+ case 'image/x-icon':
38
+ return 'ICO';
39
+ case 'image/bmp':
40
+ return 'BMP';
41
+ case 'audio/mpeg':
42
+ return 'MP3';
43
+ case 'audio/wav':
44
+ return 'WAV';
45
+ case 'application/json':
46
+ return 'JSON';
47
+ case 'application/postscript':
48
+ return 'PS';
49
+ case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
50
+ return 'XLSX';
51
+ case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
52
+ return 'DOCX';
53
+ case 'application/xml':
54
+ return 'XML';
55
+ case 'application/mshelp':
56
+ return 'HLP';
57
+ case 'application/gzip':
58
+ return 'GZ';
59
+ default:
60
+ return '';
61
+ }
62
+ };
63
+
64
+ export default Filetype;
package/src/index.js CHANGED
@@ -47,21 +47,6 @@ const applyConfig = (config) => {
47
47
  component: Container,
48
48
  });
49
49
 
50
- config.settings.apiExpanders = [
51
- ...config.settings.apiExpanders,
52
- {
53
- match: '',
54
- GET_CONTENT: ['breadcrumbs', 'actions', 'types'],
55
- },
56
- {
57
- match: '',
58
- GET_CONTENT: ['navigation'],
59
- querystring: {
60
- 'expand.navigation.depth': config.settings.navDepth,
61
- },
62
- },
63
- ];
64
-
65
50
  // Register custom StyleWrapper ClassNames
66
51
  config.settings.styleClassNameExtenders = [
67
52
  ({ block, content, data, classNames }) => {
@@ -13,19 +13,15 @@
13
13
  .blocks-group-wrapper {
14
14
  padding-top: 0px;
15
15
  }
16
- .dates {
17
- max-width: var(--default-container-width) !important;
18
- margin-top: 40px;
19
- margin-right: auto;
20
- margin-bottom: 40px;
21
- margin-left: auto;
16
+ #page-document .dates {
17
+ @include default-container-width();
18
+ @include adjustMarginsToContainer($default-container-width);
19
+ margin-top: $spacing-medium;
20
+ margin-bottom: $spacing-medium;
22
21
  .day,
23
22
  .headtitle {
24
- font-size: 18px;
25
-
26
- font-weight: 700;
23
+ @include body-text-bold();
27
24
  letter-spacing: 1px;
28
- line-height: 24px;
29
25
  text-transform: uppercase;
30
26
  }
31
27
  }
@@ -121,47 +117,22 @@
121
117
 
122
118
  .contenttype-file {
123
119
  .content-area {
124
- .documentFirstHeading {
125
- max-width: var(--default-container-width) !important;
126
- margin-right: auto;
127
- margin-left: auto;
120
+ a {
121
+ text-decoration: underline;
128
122
  }
129
- .file-detail {
130
- max-width: var(--narrow-container-width) !important;
131
- margin-right: auto;
132
- margin-left: auto;
133
- .documentDescription {
134
- padding-top: 40px;
135
- padding-bottom: 40px;
136
- margin-bottom: 0;
137
- }
138
-
139
- a {
140
- text-decoration: underline;
141
- }
142
- span {
143
- color: #808080;
144
- }
123
+ span {
124
+ color: #808080;
145
125
  }
146
126
  }
147
127
  }
148
128
  .contenttype-image {
149
129
  .content-area {
150
- max-width: var(--default-container-width) !important;
151
- margin-right: auto;
152
- margin-bottom: 0;
153
- margin-left: auto;
154
- .documentFirstHeading {
155
- @media only screen and (max-width: 769px) {
156
- margin-bottom: 60px;
157
- }
158
- }
159
130
  figure {
160
131
  img {
161
132
  aspect-ratio: $aspect-ratio;
162
133
  }
163
134
  figcaption {
164
- margin-top: 20px;
135
+ margin-top: $spacing-small;
165
136
  margin-bottom: 0;
166
137
  .title {
167
138
  margin-bottom: 5px;
@@ -170,7 +141,7 @@
170
141
  margin-bottom: 5px;
171
142
  }
172
143
  .credits {
173
- padding-bottom: 20px;
144
+ padding-bottom: $spacing-small;
174
145
  margin-bottom: 0;
175
146
  color: #0066cc;
176
147
  }
@@ -178,3 +149,24 @@
178
149
  }
179
150
  }
180
151
  }
152
+
153
+ .contenttype-link,
154
+ .contenttype-file,
155
+ .contenttype-image {
156
+ #page-document > *,
157
+ #page-edit > *,
158
+ #page-add > * {
159
+ @include default-container-width();
160
+ @include adjustMarginsToContainer($default-container-width);
161
+ }
162
+
163
+ #page-document > p {
164
+ @include narrow-container-width();
165
+ @include adjustMarginsToContainer($narrow-container-width);
166
+ }
167
+ .documentDescription {
168
+ margin-bottom: $spacing-medium;
169
+ color: $black;
170
+ @include body-text();
171
+ }
172
+ }
@@ -1,44 +0,0 @@
1
- // TODO: Remove after this is merged: https://github.com/plone/volto/pull/4932
2
- import { Grid } from 'semantic-ui-react';
3
- import cx from 'classnames';
4
- import { RenderBlocks } from '@plone/volto/components';
5
- import { withBlockExtensions } from '@plone/volto/helpers';
6
- import config from '@plone/volto/registry';
7
-
8
- const GridBlockView = (props) => {
9
- const { data, path, className } = props;
10
- const metadata = props.metadata || props.properties;
11
- const columns = data.blocks_layout.items;
12
- const blocksConfig =
13
- config.blocks.blocksConfig[data['@type']].blocksConfig ||
14
- props.blocksConfig;
15
- const location = {
16
- pathname: path,
17
- };
18
- return (
19
- <div
20
- className={cx('block', data['@type'], className, {
21
- one: columns?.length === 1,
22
- two: columns?.length === 2,
23
- three: columns?.length === 3,
24
- four: columns?.length === 4,
25
- })}
26
- >
27
- {data.headline && <h2 className="headline">{data.headline}</h2>}
28
-
29
- <Grid stackable stretched columns={columns.length}>
30
- <RenderBlocks
31
- {...props}
32
- blockWrapperTag={Grid.Column}
33
- metadata={metadata}
34
- content={data}
35
- location={location}
36
- blocksConfig={blocksConfig}
37
- isContainer
38
- />
39
- </Grid>
40
- </div>
41
- );
42
- };
43
-
44
- export default withBlockExtensions(GridBlockView);