@eeacms/volto-hero-block 1.0.0 → 2.0.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/.project.eslintrc.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
-
const projectRootPath = fs.
|
|
4
|
+
const projectRootPath = fs.existsSync('./project')
|
|
5
|
+
? fs.realpathSync('./project')
|
|
6
|
+
: fs.realpathSync('./../../../');
|
|
5
7
|
const packageJson = require(path.join(projectRootPath, 'package.json'));
|
|
6
8
|
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
|
|
7
9
|
|
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,20 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
### [
|
|
7
|
+
### [2.0.0](https://github.com/eea/volto-hero-block/compare/1.0.0...2.0.0) - 15 November 2022
|
|
8
|
+
|
|
9
|
+
#### :nail_care: Enhancements
|
|
10
|
+
|
|
11
|
+
- refactor(Styling): Use schemaEnhancer in favor of StyleWrapper [Alin Voinea - [`dacf4db`](https://github.com/eea/volto-hero-block/commit/dacf4db6c59a584639f13c7ce8a3d7bd808ea64c)]
|
|
12
|
+
|
|
13
|
+
#### :house: Internal changes
|
|
14
|
+
|
|
15
|
+
- style(volto-hero-block): set correctly the background color [Miu Razvan - [`9358a17`](https://github.com/eea/volto-hero-block/commit/9358a1777c25664cbfe9c66a6c9054521a11ff24)]
|
|
16
|
+
|
|
17
|
+
#### :hammer_and_wrench: Others
|
|
18
|
+
|
|
19
|
+
- test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`b8f0971`](https://github.com/eea/volto-hero-block/commit/b8f0971b21a5334d40c1b8f5103cea61d9ffe6f1)]
|
|
20
|
+
## [1.0.0](https://github.com/eea/volto-hero-block/compare/0.2.0...1.0.0) - 28 October 2022
|
|
8
21
|
|
|
9
22
|
#### :nail_care: Enhancements
|
|
10
23
|
|
package/README.md
CHANGED
|
@@ -21,6 +21,12 @@ Enhanced Hero Block [Volto](https://github.com/plone/volto) add-on
|
|
|
21
21
|
|
|
22
22
|
Demo GIF
|
|
23
23
|
|
|
24
|
+
## Upgrade
|
|
25
|
+
|
|
26
|
+
### Upgrading to 2.x
|
|
27
|
+
|
|
28
|
+
This version requires: `@plone/volto >= 16.0.0.alpha.46` (schemaEnhancer / addStyling).
|
|
29
|
+
|
|
24
30
|
## Getting started
|
|
25
31
|
|
|
26
32
|
### Add volto-hero-block to your Volto project
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-hero-block",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "@eeacms/volto-hero-block: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"i18n": "make i18n",
|
|
47
47
|
"cypress:run": "make cypress-run",
|
|
48
48
|
"cypress:open": "make cypress-open"
|
|
49
|
-
|
|
49
|
+
}
|
|
50
50
|
}
|
|
@@ -33,18 +33,28 @@ function Hero({
|
|
|
33
33
|
<div
|
|
34
34
|
className={cx(
|
|
35
35
|
'eea hero-block',
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
!image &&
|
|
37
|
+
backgroundVariant &&
|
|
38
|
+
!fullWidth &&
|
|
39
|
+
`color-bg-${backgroundVariant}`,
|
|
39
40
|
{
|
|
41
|
+
spaced,
|
|
42
|
+
inverted,
|
|
40
43
|
'full-height': fullHeight,
|
|
41
44
|
},
|
|
42
45
|
)}
|
|
43
46
|
>
|
|
44
47
|
<div
|
|
45
|
-
className={cx(
|
|
46
|
-
'
|
|
47
|
-
|
|
48
|
+
className={cx(
|
|
49
|
+
'hero-block-image-wrapper',
|
|
50
|
+
!image &&
|
|
51
|
+
backgroundVariant &&
|
|
52
|
+
fullWidth &&
|
|
53
|
+
`color-bg-${backgroundVariant}`,
|
|
54
|
+
{
|
|
55
|
+
'full-width': fullWidth,
|
|
56
|
+
},
|
|
57
|
+
)}
|
|
48
58
|
>
|
|
49
59
|
<div
|
|
50
60
|
className={cx('hero-block-image')}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { addStyling } from '@plone/volto/helpers';
|
|
2
|
+
|
|
3
|
+
export default () => {
|
|
2
4
|
return {
|
|
3
5
|
title: 'Hero',
|
|
4
6
|
fieldsets: [
|
|
@@ -66,69 +68,73 @@ export default ({ data }) => {
|
|
|
66
68
|
};
|
|
67
69
|
};
|
|
68
70
|
|
|
69
|
-
export const stylingSchema = (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
'
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
[
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
[
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
[
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
[
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
71
|
+
export const stylingSchema = (props) => {
|
|
72
|
+
const schema = addStyling(props);
|
|
73
|
+
schema.properties.styles.schema = {
|
|
74
|
+
title: 'Hero style',
|
|
75
|
+
block: 'hero',
|
|
76
|
+
fieldsets: [
|
|
77
|
+
{
|
|
78
|
+
id: 'default',
|
|
79
|
+
title: 'Default',
|
|
80
|
+
fields: [
|
|
81
|
+
'backgroundVariant',
|
|
82
|
+
'alignContent',
|
|
83
|
+
'textAlign',
|
|
84
|
+
'textVariant',
|
|
85
|
+
'buttonVariant',
|
|
86
|
+
'buttonAlign',
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
properties: {
|
|
91
|
+
backgroundVariant: {
|
|
92
|
+
title: 'Background theme',
|
|
93
|
+
choices: [
|
|
94
|
+
['primary', 'Primary'],
|
|
95
|
+
['secondary', 'Secondary'],
|
|
96
|
+
['tertiary', 'Tertiary'],
|
|
97
|
+
['grey', 'Grey'],
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
alignContent: {
|
|
101
|
+
title: 'Content align',
|
|
102
|
+
choices: [
|
|
103
|
+
['start', 'Top'],
|
|
104
|
+
['center', 'Center'],
|
|
105
|
+
['end', 'Bottom'],
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
textAlign: {
|
|
109
|
+
title: 'Text align',
|
|
110
|
+
widget: 'align',
|
|
111
|
+
actions: ['left', 'center', 'right'],
|
|
112
|
+
defaultValue: 'left',
|
|
113
|
+
},
|
|
114
|
+
textVariant: {
|
|
115
|
+
title: 'Text theme',
|
|
116
|
+
choices: [
|
|
117
|
+
['primary', 'Primary'],
|
|
118
|
+
['secondary', 'Secondary'],
|
|
119
|
+
['tertiary', 'Tertiary'],
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
buttonVariant: {
|
|
123
|
+
title: 'Button theme',
|
|
124
|
+
choices: [
|
|
125
|
+
['primary', 'Primary'],
|
|
126
|
+
['secondary', 'Secondary'],
|
|
127
|
+
['tertiary', 'Tertiary'],
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
buttonAlign: {
|
|
131
|
+
title: 'Button align',
|
|
132
|
+
widget: 'align',
|
|
133
|
+
actions: ['left', 'center', 'right'],
|
|
134
|
+
defaultValue: 'left',
|
|
135
|
+
},
|
|
131
136
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
required: [],
|
|
138
|
+
};
|
|
139
|
+
return schema;
|
|
140
|
+
};
|