@kitconcept/volto-light-theme 1.0.0-rc.6 → 1.0.0-rc.8
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/.eslintrc +48 -0
- package/CHANGELOG.md +23 -0
- package/Makefile +3 -4
- package/README.md +187 -7
- package/dockerfiles/docker-compose.yml +6 -1
- package/package.json +12 -1
- package/src/components/Theme/EventView.jsx +11 -11
- package/src/customizations/volto/components/theme/View/FileView.jsx +132 -0
- package/src/theme/_breadcrumbs.scss +5 -1
- package/src/theme/_content.scss +56 -2
- package/src/theme/_layout.scss +18 -6
- package/src/theme/blocks/_accordion.scss +51 -0
- package/src/theme/blocks/_grid.scss +4 -1
- package/src/theme/blocks/_listing.scss +4 -3
- package/.eslintrc.local.js +0 -50
package/.eslintrc
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["react-app", "prettier", "plugin:jsx-a11y/recommended"],
|
|
3
|
+
"plugins": ["prettier", "react-hooks", "jsx-a11y"],
|
|
4
|
+
"env": {
|
|
5
|
+
"es6": true,
|
|
6
|
+
"browser": true,
|
|
7
|
+
"node": true,
|
|
8
|
+
"mocha": true,
|
|
9
|
+
"jasmine": true
|
|
10
|
+
},
|
|
11
|
+
"parser": "babel-eslint",
|
|
12
|
+
"parserOptions": {
|
|
13
|
+
"ecmaVersion": 6,
|
|
14
|
+
"sourceType": "module",
|
|
15
|
+
"ecmaFeatures": {
|
|
16
|
+
"legacyDecorators": true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"rules": {
|
|
20
|
+
"import/no-unresolved": 0,
|
|
21
|
+
"no-alert": 1,
|
|
22
|
+
"no-console": 1,
|
|
23
|
+
"no-debugger": 1,
|
|
24
|
+
"prettier/prettier": [
|
|
25
|
+
"error",
|
|
26
|
+
{ "trailingComma": "all", "singleQuote": true }
|
|
27
|
+
],
|
|
28
|
+
"react-hooks/rules-of-hooks": "error",
|
|
29
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
30
|
+
"react/react-in-jsx-scope": "off"
|
|
31
|
+
},
|
|
32
|
+
"globals": {
|
|
33
|
+
"root": true,
|
|
34
|
+
"__DEVELOPMENT__": true,
|
|
35
|
+
"__CLIENT__": true,
|
|
36
|
+
"__SERVER__": true,
|
|
37
|
+
"__DISABLE_SSR__": true,
|
|
38
|
+
"__DEVTOOLS__": true,
|
|
39
|
+
"__DEBUG__": true,
|
|
40
|
+
"__SSR__": true,
|
|
41
|
+
"__SENTRY__": true,
|
|
42
|
+
"cy": true,
|
|
43
|
+
"Cypress": true,
|
|
44
|
+
"jest": true,
|
|
45
|
+
"socket": true,
|
|
46
|
+
"webpackIsomorphicTools": true
|
|
47
|
+
}
|
|
48
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,29 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 1.0.0-rc.8 (2023-07-14)
|
|
12
|
+
|
|
13
|
+
### Bugfix
|
|
14
|
+
|
|
15
|
+
- Fix Image content type @iRohitSingh [#18](https://github.com/kitconcept/volto-light-theme/pull/18)
|
|
16
|
+
- Fix a11y issues in EventView @steffenri [#147](https://github.com/kitconcept/volto-light-theme/pull/147)
|
|
17
|
+
- Remove typo in fileview @steffenri [#148](https://github.com/kitconcept/volto-light-theme/pull/148)
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
- Documentation on local docker development - local ESlint working @sneridagh [#144](https://github.com/kitconcept/volto-light-theme/pull/144)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## 1.0.0-rc.7 (2023-07-13)
|
|
25
|
+
|
|
26
|
+
### Bugfix
|
|
27
|
+
|
|
28
|
+
- Fix File content type @iRohitSingh [#17](https://github.com/kitconcept/volto-light-theme/pull/17)
|
|
29
|
+
- Add idiomatic order CSS package @sneridagh
|
|
30
|
+
Fix margin in edit mode for all blocks @sneridagh [#142](https://github.com/kitconcept/volto-light-theme/pull/142)
|
|
31
|
+
- Fix CSS for Accordion block. @danalvrz [#143](https://github.com/kitconcept/volto-light-theme/pull/143)
|
|
32
|
+
|
|
33
|
+
|
|
11
34
|
## 1.0.0-rc.6 (2023-07-12)
|
|
12
35
|
|
|
13
36
|
### Bugfix
|
package/Makefile
CHANGED
|
@@ -135,7 +135,6 @@ status-test-acceptance-server: ## Status of Acceptance Server (for use it while
|
|
|
135
135
|
debug-frontend: ## Run bash in the Frontend container (for debug infrastructure purposes)
|
|
136
136
|
${DEV_COMPOSE} run --entrypoint bash addon-dev
|
|
137
137
|
|
|
138
|
-
.PHONY:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
mv .eslintrc.local.js .eslintrc.js
|
|
138
|
+
.PHONY: pull-backend-image
|
|
139
|
+
pull-backend-image: ## Pulls and updates the backend image (for use it while developing)
|
|
140
|
+
docker pull ghcr.io/kitconcept/voltolighttheme:latest
|
package/README.md
CHANGED
|
@@ -98,11 +98,68 @@ These main rules spec applies to the theme:
|
|
|
98
98
|
- Separator-Block (https://www.npmjs.com/package/@kitconcept/volto-separator-block)
|
|
99
99
|
- Heading-Block (https://www.npmjs.com/package/@kitconcept/volto-heading-block)
|
|
100
100
|
- Introduction-Block (https://www.npmjs.com/package/@kitconcept/volto-introduction-block)
|
|
101
|
+
- Accordion-Block (https://www.npmjs.com/package/@eeacms/volto-accordion-block)
|
|
101
102
|
|
|
102
103
|
and the following add-ons:
|
|
103
104
|
|
|
104
105
|
- DSGVO-Banner (https://www.npmjs.com/package/@kitconcept/volto-dsgvo-banner)
|
|
105
106
|
|
|
107
|
+
## Installation
|
|
108
|
+
|
|
109
|
+
It is recommended that your project or policy add-on `package.json` include the aforementioned add-ons.
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
"dependencies": {
|
|
113
|
+
"@eeacms/volto-accordion-block": "9.0.0",
|
|
114
|
+
"@kitconcept/volto-button-block": "2.1.0",
|
|
115
|
+
"@kitconcept/volto-dsgvo-banner": "1.3.0",
|
|
116
|
+
"@kitconcept/volto-heading-block": "2.2.0",
|
|
117
|
+
"@kitconcept/volto-introduction-block": "1.0.0",
|
|
118
|
+
"@kitconcept/volto-light-theme": "1.0.0",
|
|
119
|
+
"@kitconcept/volto-separator-block": "3.2.0",
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This theme won't install them for you, as they are declared as `peerDependencies`.
|
|
124
|
+
This is because the theme won't have to force you to use any specific add-on version, and avoids package hoisting issues.
|
|
125
|
+
|
|
126
|
+
In your project or policy add-on `package.json` you should declare all of them as Volto add-ons
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
"addons": [
|
|
130
|
+
"@eeacms/volto-accordion-block",
|
|
131
|
+
"@kitconcept/volto-button-block",
|
|
132
|
+
"@kitconcept/volto-heading-block",
|
|
133
|
+
"@kitconcept/volto-introduction-block",
|
|
134
|
+
"@kitconcept/volto-highlight-block",
|
|
135
|
+
"@kitconcept/volto-separator-block",
|
|
136
|
+
"@kitconcept/volto-light-theme",
|
|
137
|
+
"your_policy_addon_here"
|
|
138
|
+
],
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Make sure your policy add-on is the last one, as you would want that its configuration has priority over all the others. Make sure also that `@kitconcept/volto-light-theme` is the one before your policy add-on.
|
|
142
|
+
|
|
143
|
+
Then, declare the theme in your project `package.json`:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
"theme": "@kitconcept/volto-light-theme",
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Alternativelly, you can also declare it in your project's `volto.config.js`:
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
const addons = [];
|
|
153
|
+
const theme = '@kitconcept/volto-light-theme';
|
|
154
|
+
|
|
155
|
+
module.exports = {
|
|
156
|
+
addons,
|
|
157
|
+
theme,
|
|
158
|
+
};
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
You can specify your project add-ons in `volto.config.js`, but sometimes is better to have them all in one place (in your policy add-on) for portability.
|
|
162
|
+
|
|
106
163
|
## Development Setup
|
|
107
164
|
|
|
108
165
|
This theme works under Volto 17 alpha 16 onwards.
|
|
@@ -110,24 +167,147 @@ Compatibility with Volto 16 might be achieved, but it has to be at customization
|
|
|
110
167
|
specific project add-on.
|
|
111
168
|
This is mainly due to the `RenderBlocks` customization that is based in the one in 17 because of the Grid block in core and the autogrouping feature.
|
|
112
169
|
See more information about the other dependencies in `peerDependencies` in `package.json`.
|
|
170
|
+
It is possible to develop this add-on using docker containers and the provided convenience Makefile commands.
|
|
171
|
+
Run `make help` to list the available commands.
|
|
172
|
+
|
|
173
|
+
````text
|
|
174
|
+
build-backend Build
|
|
175
|
+
start-backend Starts Docker backend
|
|
176
|
+
stop-backend Stop Docker backend
|
|
177
|
+
build-live Build Addon live
|
|
178
|
+
build-addon Build Addon dev
|
|
179
|
+
start-dev Starts Dev container
|
|
180
|
+
dev Develop the addon
|
|
181
|
+
help Show this help.
|
|
182
|
+
i18n Sync i18n
|
|
183
|
+
format Format codebase
|
|
184
|
+
lint Lint Codebase
|
|
185
|
+
test Run unit tests
|
|
186
|
+
test-ci Run unit tests in CI
|
|
187
|
+
install-acceptance Install Cypress, build acceptance containers
|
|
188
|
+
start-test-acceptance-server Start acceptance server (for use it in while developing)
|
|
189
|
+
start-test-acceptance-server-prod Start acceptance server in prod (used by CI)
|
|
190
|
+
test-acceptance Start Cypress (for use it while developing)
|
|
191
|
+
test-acceptance-headless Run cypress tests in CI
|
|
192
|
+
stop-test-acceptance-server Stop acceptance server (for use it while finished developing)
|
|
193
|
+
status-test-acceptance-server Status of Acceptance Server (for use it while developing)
|
|
194
|
+
debug-frontend Run bash in the Frontend container (for debug infrastructure purposes)
|
|
195
|
+
pull-backend-image Pulls and updates the backend image (for use it while developing)
|
|
196
|
+
````
|
|
113
197
|
|
|
114
198
|
### Prerequisites
|
|
115
199
|
|
|
116
200
|
- Docker
|
|
117
201
|
- Node 18 (e.g. via nvm)
|
|
118
202
|
|
|
119
|
-
###
|
|
203
|
+
### Development environment Setup
|
|
204
|
+
|
|
205
|
+
Run once
|
|
206
|
+
|
|
207
|
+
```shell
|
|
208
|
+
make dev
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
which will build and launch the backend and frontend containers.
|
|
212
|
+
There's no need to build them again after doing it the first time unless something has changed from the container setup.
|
|
213
|
+
|
|
214
|
+
In order to make the local IDE play well with this setup, is it required to run once `yarn` to install locally the required packages (ESlint, Prettier, Stylelint).
|
|
120
215
|
|
|
121
216
|
Run
|
|
122
217
|
|
|
123
|
-
|
|
218
|
+
```shell
|
|
219
|
+
yarn
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Build the containers manually
|
|
223
|
+
|
|
224
|
+
Run
|
|
225
|
+
|
|
226
|
+
```shell
|
|
227
|
+
make build-backend
|
|
228
|
+
make build-addon
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Run the containers
|
|
232
|
+
|
|
233
|
+
Run
|
|
234
|
+
|
|
235
|
+
```shell
|
|
124
236
|
make start-dev
|
|
125
|
-
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
This will start both the frontend and backend containers.
|
|
126
240
|
|
|
127
241
|
### Stop Backend (Docker)
|
|
128
242
|
|
|
129
|
-
|
|
243
|
+
After developing, in order to stop the running backend, don't forget to run:
|
|
130
244
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
245
|
+
Run
|
|
246
|
+
|
|
247
|
+
```shell
|
|
248
|
+
make stop-backend
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Linting
|
|
252
|
+
|
|
253
|
+
Run
|
|
254
|
+
|
|
255
|
+
```shell
|
|
256
|
+
make lint
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Formatting
|
|
260
|
+
|
|
261
|
+
Run
|
|
262
|
+
|
|
263
|
+
```shell
|
|
264
|
+
make format
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### i18n
|
|
268
|
+
|
|
269
|
+
Run
|
|
270
|
+
|
|
271
|
+
```shell
|
|
272
|
+
make i18n
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Unit tests
|
|
276
|
+
|
|
277
|
+
Run
|
|
278
|
+
|
|
279
|
+
```shell
|
|
280
|
+
make test
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Acceptance tests
|
|
284
|
+
|
|
285
|
+
Run once
|
|
286
|
+
|
|
287
|
+
```shell
|
|
288
|
+
make install-acceptance
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
For starting the servers
|
|
292
|
+
|
|
293
|
+
Run
|
|
294
|
+
|
|
295
|
+
```shell
|
|
296
|
+
make start-test-acceptance-server
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
The frontend is run in dev mode, so development while writing tests is possible.
|
|
300
|
+
|
|
301
|
+
Run
|
|
302
|
+
|
|
303
|
+
```shell
|
|
304
|
+
make test-acceptance
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
To run Cypress tests afterwards.
|
|
308
|
+
|
|
309
|
+
When finished, don't forget to shutdown the backend server.
|
|
310
|
+
|
|
311
|
+
```shell
|
|
312
|
+
make stop-test-acceptance-server
|
|
313
|
+
```
|
|
@@ -14,8 +14,13 @@ services:
|
|
|
14
14
|
- ${CURRENT_DIR}:/app/src/addons/${ADDON_PATH}/
|
|
15
15
|
environment:
|
|
16
16
|
RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone
|
|
17
|
-
|
|
17
|
+
# In case that you want to connect to and outside (non-docker) local instance
|
|
18
|
+
# coment the above, use the next line
|
|
19
|
+
# RAZZLE_INTERNAL_API_PATH: http://host.docker.internal:8080/Plone
|
|
20
|
+
RAZZLE_API_PATH: http://127.0.0.1:8080/Plone
|
|
18
21
|
HOST: 0.0.0.0
|
|
22
|
+
depends_on:
|
|
23
|
+
- backend
|
|
19
24
|
ports:
|
|
20
25
|
- 3000:3000
|
|
21
26
|
- 3001:3001
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitconcept/volto-light-theme",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.8",
|
|
4
4
|
"description": "Volto Light Theme by kitconcept",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -33,10 +33,21 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@plone/scripts": "^3.0.0",
|
|
36
|
+
"babel-eslint": "10.1.0",
|
|
37
|
+
"eslint": "6.8.0",
|
|
38
|
+
"eslint-config-prettier": "6.11.0",
|
|
39
|
+
"eslint-config-react-app": "5.2.1",
|
|
40
|
+
"eslint-plugin-flowtype": "4.7.0",
|
|
41
|
+
"eslint-plugin-import": "2.20.2",
|
|
42
|
+
"eslint-plugin-jsx-a11y": "6.2.3",
|
|
43
|
+
"eslint-plugin-prettier": "3.1.3",
|
|
44
|
+
"eslint-plugin-react": "7.20.0",
|
|
45
|
+
"eslint-plugin-react-hooks": "4.0.2",
|
|
36
46
|
"postcss-scss": "4.0.6",
|
|
37
47
|
"prettier": "2.0.5",
|
|
38
48
|
"razzle-plugin-scss": "4.2.18",
|
|
39
49
|
"release-it": "^16.1.0",
|
|
50
|
+
"stylelint-config-idiomatic-order": "8.1.0",
|
|
40
51
|
"stylelint-config-prettier": "9.0.4",
|
|
41
52
|
"stylelint-config-sass-guidelines": "9.0.1",
|
|
42
53
|
"stylelint-prettier": "1.1.2"
|
|
@@ -224,21 +224,21 @@ const EventView = (props) => {
|
|
|
224
224
|
</div>
|
|
225
225
|
</Grid.Column>
|
|
226
226
|
<div className="event-button">
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
>
|
|
227
|
+
<a
|
|
228
|
+
className="ics-download"
|
|
229
|
+
target="_blank"
|
|
230
|
+
rel="noreferrer"
|
|
231
|
+
href={`${expandToBackendURL(
|
|
232
|
+
content['@id'],
|
|
233
|
+
)}/ics_view`}
|
|
234
|
+
>
|
|
235
|
+
<Button className="event-btn">
|
|
236
236
|
<FormattedMessage
|
|
237
237
|
id="ICS-Download"
|
|
238
238
|
defaultMessage="ICS Download"
|
|
239
239
|
/>
|
|
240
|
-
</
|
|
241
|
-
</
|
|
240
|
+
</Button>
|
|
241
|
+
</a>
|
|
242
242
|
</div>
|
|
243
243
|
</Grid.Row>
|
|
244
244
|
</Grid>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OVERRIDE FileView.jsx
|
|
3
|
+
* REASON: BFS theme
|
|
4
|
+
* DATE: 2023-07-11
|
|
5
|
+
* DEVELOPER: @iRohitSingh
|
|
6
|
+
*/
|
|
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
|
+
};
|
|
131
|
+
|
|
132
|
+
export default FileView;
|
|
@@ -7,7 +7,7 @@ body.view-contentsview {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
#main .breadcrumbs {
|
|
10
|
-
padding:
|
|
10
|
+
padding: 20px 0;
|
|
11
11
|
background-color: $lightgrey;
|
|
12
12
|
|
|
13
13
|
.breadcrumb {
|
|
@@ -26,6 +26,10 @@ body.view-contentsview {
|
|
|
26
26
|
|
|
27
27
|
.home {
|
|
28
28
|
margin-right: 0.5em;
|
|
29
|
+
|
|
30
|
+
svg {
|
|
31
|
+
margin-bottom: -4px;
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
.section {
|
package/src/theme/_content.scss
CHANGED
|
@@ -120,7 +120,61 @@
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
.contenttype-file {
|
|
123
|
-
.content-area
|
|
124
|
-
|
|
123
|
+
.content-area {
|
|
124
|
+
.documentFirstHeading {
|
|
125
|
+
max-width: var(--default-container-width) !important;
|
|
126
|
+
margin-right: auto;
|
|
127
|
+
margin-left: auto;
|
|
128
|
+
}
|
|
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
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.contenttype-image {
|
|
149
|
+
.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
|
+
figure {
|
|
160
|
+
img {
|
|
161
|
+
aspect-ratio: $aspect-ratio;
|
|
162
|
+
}
|
|
163
|
+
figcaption {
|
|
164
|
+
margin-top: 20px;
|
|
165
|
+
margin-bottom: 0;
|
|
166
|
+
.title {
|
|
167
|
+
margin-bottom: 5px;
|
|
168
|
+
}
|
|
169
|
+
.description div {
|
|
170
|
+
margin-bottom: 5px;
|
|
171
|
+
}
|
|
172
|
+
.credits {
|
|
173
|
+
padding-bottom: 20px;
|
|
174
|
+
margin-bottom: 0;
|
|
175
|
+
color: #0066cc;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
125
179
|
}
|
|
126
180
|
}
|
package/src/theme/_layout.scss
CHANGED
|
@@ -44,6 +44,13 @@ $narrow-container-width: 620px !default;
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
@mixin adjustMarginsToEditContainer($width) {
|
|
48
|
+
@container (max-width: #{$width + 2 * $spacing-medium}) {
|
|
49
|
+
margin-right: $spacing-medium;
|
|
50
|
+
margin-left: $spacing-medium;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
47
54
|
// Container adjustments for dealing correctly with absoluted elements
|
|
48
55
|
@mixin container-preference-order($zindex) {
|
|
49
56
|
position: relative;
|
|
@@ -102,12 +109,16 @@ footer {
|
|
|
102
109
|
@include layout-container-width();
|
|
103
110
|
}
|
|
104
111
|
|
|
105
|
-
.header-wrapper .header
|
|
106
|
-
.breadcrumbs .breadcrumb {
|
|
112
|
+
.header-wrapper .header {
|
|
107
113
|
@include layout-container-width();
|
|
108
114
|
@include adjustMarginsToContainer($layout-container-width);
|
|
109
115
|
}
|
|
110
116
|
|
|
117
|
+
.breadcrumbs .breadcrumb {
|
|
118
|
+
@include default-container-width();
|
|
119
|
+
@include adjustMarginsToContainer($default-container-width);
|
|
120
|
+
}
|
|
121
|
+
|
|
111
122
|
// Content Layout Styling
|
|
112
123
|
#page-document .blocks-group-wrapper {
|
|
113
124
|
& > h2,
|
|
@@ -153,6 +164,7 @@ footer {
|
|
|
153
164
|
& > .block.introduction .block-container,
|
|
154
165
|
& > .block.teaser .teaser-item.default,
|
|
155
166
|
& > .table-of-contents,
|
|
167
|
+
& > .accordion-block,
|
|
156
168
|
& > .slate blockquote {
|
|
157
169
|
@include default-container-width();
|
|
158
170
|
@include adjustMarginsToContainer($default-container-width);
|
|
@@ -186,7 +198,7 @@ footer {
|
|
|
186
198
|
#page-edit {
|
|
187
199
|
[class*='block-editor-'] {
|
|
188
200
|
@include layout-container-width();
|
|
189
|
-
@include
|
|
201
|
+
@include adjustMarginsToEditContainer($layout-container-width);
|
|
190
202
|
}
|
|
191
203
|
}
|
|
192
204
|
|
|
@@ -205,7 +217,7 @@ footer {
|
|
|
205
217
|
.block-editor-codeBlock,
|
|
206
218
|
.block-editor-mermaidBlock {
|
|
207
219
|
@include narrow-container-width();
|
|
208
|
-
@include
|
|
220
|
+
@include adjustMarginsToEditContainer($narrow-container-width);
|
|
209
221
|
}
|
|
210
222
|
|
|
211
223
|
.block-editor-title h1,
|
|
@@ -223,7 +235,7 @@ footer {
|
|
|
223
235
|
.block-editor-teaser .teaser-item.default,
|
|
224
236
|
.block-editor-toc {
|
|
225
237
|
@include default-container-width();
|
|
226
|
-
@include
|
|
238
|
+
@include adjustMarginsToEditContainer($default-container-width);
|
|
227
239
|
}
|
|
228
240
|
|
|
229
241
|
.block-editor-slate,
|
|
@@ -232,7 +244,7 @@ footer {
|
|
|
232
244
|
.block-editor-teaser,
|
|
233
245
|
.block-editor-separator.has--align--left {
|
|
234
246
|
@include layout-container-width();
|
|
235
|
-
@include
|
|
247
|
+
@include adjustMarginsToEditContainer($layout-container-width);
|
|
236
248
|
}
|
|
237
249
|
}
|
|
238
250
|
|
|
@@ -2,3 +2,54 @@
|
|
|
2
2
|
.block.accordion [data-rbd-draggable-context-id] {
|
|
3
3
|
margin-bottom: 2rem;
|
|
4
4
|
}
|
|
5
|
+
|
|
6
|
+
.accordion-block {
|
|
7
|
+
.ui.styled.accordion {
|
|
8
|
+
border-top: 1px solid $black;
|
|
9
|
+
|
|
10
|
+
&:last-child {
|
|
11
|
+
border-bottom: 1px solid $black;
|
|
12
|
+
}
|
|
13
|
+
.title.accordion-title {
|
|
14
|
+
padding: 20px 0 20px 0;
|
|
15
|
+
background-color: unset;
|
|
16
|
+
|
|
17
|
+
& > svg {
|
|
18
|
+
height: 50px !important;
|
|
19
|
+
fill: $grey !important;
|
|
20
|
+
transform: rotate(-90deg);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
& > span {
|
|
24
|
+
@include introduction();
|
|
25
|
+
color: $darkGrey;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.active > span {
|
|
29
|
+
color: $black;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.active > svg {
|
|
33
|
+
fill: $black !important;
|
|
34
|
+
transform: rotate(180deg);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.block.listing {
|
|
39
|
+
&:first-child {
|
|
40
|
+
margin-top: 0;
|
|
41
|
+
}
|
|
42
|
+
.listing-item:last-child {
|
|
43
|
+
border-bottom: none !important;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.block:last-child {
|
|
48
|
+
margin-bottom: 0 !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.content {
|
|
52
|
+
padding: 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -129,6 +129,9 @@
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.block.listing {
|
|
132
|
+
&.previous--has--same--backgroundColor:not(.has--headline) {
|
|
133
|
+
margin-top: 0;
|
|
134
|
+
}
|
|
132
135
|
h2 {
|
|
133
136
|
margin-bottom: 40px !important;
|
|
134
137
|
}
|
|
@@ -144,7 +147,7 @@
|
|
|
144
147
|
|
|
145
148
|
.block-editor-empty {
|
|
146
149
|
padding: 0;
|
|
147
|
-
margin:
|
|
150
|
+
margin: 0.5rem 0.5rem 0.5rem 0.5rem !important;
|
|
148
151
|
}
|
|
149
152
|
}
|
|
150
153
|
|
|
@@ -185,12 +185,13 @@
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
&.previous--
|
|
188
|
+
&.previous--has--same--backgroundColor:not(.has--headline) {
|
|
189
189
|
margin-top: 200px;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
.documentFirstHeading
|
|
193
|
+
+ &.previous--has--same--backgroundColor:not(.has--headline) {
|
|
194
|
+
margin-top: 0;
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
|
package/.eslintrc.local.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const projectRootPath = __dirname;
|
|
4
|
-
const packageJson = require(path.join(projectRootPath, 'package.json'));
|
|
5
|
-
|
|
6
|
-
let voltoPath = './node_modules/@plone/volto';
|
|
7
|
-
|
|
8
|
-
let configFile;
|
|
9
|
-
if (fs.existsSync(`${this.projectRootPath}/tsconfig.json`))
|
|
10
|
-
configFile = `${this.projectRootPath}/tsconfig.json`;
|
|
11
|
-
else if (fs.existsSync(`${this.projectRootPath}/jsconfig.json`))
|
|
12
|
-
configFile = `${this.projectRootPath}/jsconfig.json`;
|
|
13
|
-
|
|
14
|
-
if (configFile) {
|
|
15
|
-
const jsConfig = require(configFile).compilerOptions;
|
|
16
|
-
const pathsConfig = jsConfig.paths;
|
|
17
|
-
if (pathsConfig['@plone/volto'])
|
|
18
|
-
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
|
|
22
|
-
const reg = new AddonConfigurationRegistry(__dirname);
|
|
23
|
-
|
|
24
|
-
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
25
|
-
const addonAliases = Object.keys(reg.packages).map((o) => [
|
|
26
|
-
o,
|
|
27
|
-
reg.packages[o].modulePath,
|
|
28
|
-
]);
|
|
29
|
-
|
|
30
|
-
module.exports = {
|
|
31
|
-
extends: `${voltoPath}/.eslintrc`,
|
|
32
|
-
settings: {
|
|
33
|
-
'import/resolver': {
|
|
34
|
-
alias: {
|
|
35
|
-
map: [
|
|
36
|
-
['@plone/volto', '@plone/volto/src'],
|
|
37
|
-
['@plone/volto-slate', '@plone/volto/packages/volto-slate/src'],
|
|
38
|
-
...addonAliases,
|
|
39
|
-
['@package', `${__dirname}/src`],
|
|
40
|
-
['@root', `${__dirname}/src`],
|
|
41
|
-
['~', `${__dirname}/src`],
|
|
42
|
-
],
|
|
43
|
-
extensions: ['.js', '.jsx', '.json'],
|
|
44
|
-
},
|
|
45
|
-
'babel-plugin-root-import': {
|
|
46
|
-
rootPathSuffix: 'src',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
};
|