@eeacms/volto-hero-block 0.2.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.
@@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');
2
2
 
3
3
  function applyDefault(api) {
4
4
  const voltoBabel = defaultBabel(api);
5
- voltoBabel.plugins.push('@babel/plugin-transform-modules-commonjs', 'transform-class-properties', 'istanbul');
5
+ voltoBabel.plugins.push('istanbul');
6
6
  return voltoBabel;
7
7
  }
8
8
 
@@ -0,0 +1 @@
1
+ module.exports = require('@plone/volto/babel');
@@ -1,7 +1,9 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
- const projectRootPath = fs.realpathSync('./project'); // __dirname
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,50 +4,72 @@ 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
- #### [0.2.0](https://github.com/eea/volto-hero-block/compare/0.1.4...0.2.0)
7
+ ### [2.0.0](https://github.com/eea/volto-hero-block/compare/1.0.0...2.0.0) - 15 November 2022
8
8
 
9
- - change(hero): implemented meta alignment and renamed several options for consistency [`df08d80`](https://github.com/eea/volto-hero-block/commit/df08d80201b079a083e8c742e763c7b144fb5724)
10
- - fix(hero): image dimensions when full width and height isn't enabled [`69fb38e`](https://github.com/eea/volto-hero-block/commit/69fb38e9410f2a241a5d3babca9a712df946f859)
11
- - change(hero): re-added quoted option to the hero block [`d8c9c59`](https://github.com/eea/volto-hero-block/commit/d8c9c59d7e7e5feaf592a52f9cc6ff23abca2fa2)
9
+ #### :nail_care: Enhancements
12
10
 
13
- #### [0.1.4](https://github.com/eea/volto-hero-block/compare/0.1.3...0.1.4)
11
+ - refactor(Styling): Use schemaEnhancer in favor of StyleWrapper [Alin Voinea - [`dacf4db`](https://github.com/eea/volto-hero-block/commit/dacf4db6c59a584639f13c7ce8a3d7bd808ea64c)]
14
12
 
15
- > 30 June 2022
13
+ #### :house: Internal changes
16
14
 
15
+ - style(volto-hero-block): set correctly the background color [Miu Razvan - [`9358a17`](https://github.com/eea/volto-hero-block/commit/9358a1777c25664cbfe9c66a6c9054521a11ff24)]
17
16
 
18
- #### [0.1.3](https://github.com/eea/volto-hero-block/compare/0.1.2...0.1.3)
17
+ #### :hammer_and_wrench: Others
19
18
 
20
- > 30 June 2022
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
21
21
 
22
- - Cleanup themeing options [`#4`](https://github.com/eea/volto-hero-block/pull/4)
22
+ #### :nail_care: Enhancements
23
23
 
24
- #### [0.1.2](https://github.com/eea/volto-hero-block/compare/0.1.1...0.1.2)
24
+ - refactor(volto-slate): Upgrade to @plone/volto-slate - refs #153447 [Alin Voinea - [`8e9aef4`](https://github.com/eea/volto-hero-block/commit/8e9aef42b9e92cca4666526b083f6f64bb5adfa8)]
25
25
 
26
- > 16 June 2022
26
+ #### :hammer_and_wrench: Others
27
27
 
28
- - Release [`#3`](https://github.com/eea/volto-hero-block/pull/3)
29
- - change(hero): wrap hero-block-image within a wrapper class [`2802c41`](https://github.com/eea/volto-hero-block/commit/2802c41ee8eba4c34bf6d4b4766ebafb24056602)
30
- - change(hero): added spaced and inverted options to the main schema [`b6865cd`](https://github.com/eea/volto-hero-block/commit/b6865cdc6dfae0d486f43fccfb31fa555af3a536)
31
- - change(hero): output h2 from slate instead of p tag [`0b2a4c5`](https://github.com/eea/volto-hero-block/commit/0b2a4c5070cc2bf97f31ff4cf74ade0e27434d91)
28
+ - Remove cypress.json [Alin Voinea - [`593bdf2`](https://github.com/eea/volto-hero-block/commit/593bdf207ca4fd3f2393117b6f64a44727881ad0)]
29
+ - test(cypress): Upgrade to Cypress 10 / Razzle 4 [Alin Voinea - [`edd48a5`](https://github.com/eea/volto-hero-block/commit/edd48a5c13824bce5e03e46790f1890656b340d8)]
30
+ - Cleanup [Alin Voinea - [`9d72ee7`](https://github.com/eea/volto-hero-block/commit/9d72ee7a06d1c6fed46586d30bb85eae39e670bf)]
31
+ ### [0.2.0](https://github.com/eea/volto-hero-block/compare/0.1.4...0.2.0) - 6 July 2022
32
32
 
33
- #### [0.1.1](https://github.com/eea/volto-hero-block/compare/0.1.0...0.1.1)
33
+ #### :bug: Bug Fixes
34
34
 
35
- > 13 June 2022
35
+ - fix(hero): image dimensions when full width and height isn't enabled [David Ichim - [`69fb38e`](https://github.com/eea/volto-hero-block/commit/69fb38e9410f2a241a5d3babca9a712df946f859)]
36
36
 
37
- - Add hero block [`#2`](https://github.com/eea/volto-hero-block/pull/2)
38
- - change(hero): added image overlay option [`647ef2c`](https://github.com/eea/volto-hero-block/commit/647ef2ce68848ac38b71977485021b17e8c2f540)
39
- - Fix Hero image type [`fb2188a`](https://github.com/eea/volto-hero-block/commit/fb2188ac604cfc57ba26ea482e799ca867a412ad)
40
- - Fix external vs internal image [`5e447e9`](https://github.com/eea/volto-hero-block/commit/5e447e9a4e35229d9a29b74ad230a2e1e659bbea)
41
- - Fix block title [`db8de23`](https://github.com/eea/volto-hero-block/commit/db8de237f523e8cb9b96c2702818b529805fd36e)
42
- - Support external images [`196902a`](https://github.com/eea/volto-hero-block/commit/196902ac0214cefb8a4bdc643f0424bc7c318282)
43
- - Update slate footnote support [`c1522b4`](https://github.com/eea/volto-hero-block/commit/c1522b4164dbe6de01771d211d7e0bf3009f44d4)
44
- - Use justify content for text and button as well [`08599cc`](https://github.com/eea/volto-hero-block/commit/08599cc45546d9b349128c4f8ce9c01318385811)
45
- - Add dependencies [`30e2881`](https://github.com/eea/volto-hero-block/commit/30e2881a2a97a899e7f4cc614a0405c300ac6fee)
37
+ #### :nail_care: Enhancements
46
38
 
47
- #### 0.1.0
39
+ - change(hero): implemented meta alignment and renamed several options for consistency [David Ichim - [`df08d80`](https://github.com/eea/volto-hero-block/commit/df08d80201b079a083e8c742e763c7b144fb5724)]
40
+ - change(hero): re-added quoted option to the hero block [David Ichim - [`d8c9c59`](https://github.com/eea/volto-hero-block/commit/d8c9c59d7e7e5feaf592a52f9cc6ff23abca2fa2)]
48
41
 
49
- > 10 June 2022
42
+ ### [0.1.4](https://github.com/eea/volto-hero-block/compare/0.1.3...0.1.4) - 30 June 2022
50
43
 
51
- - Empty release [`#1`](https://github.com/eea/volto-hero-block/pull/1)
52
- - Initial commit [`799ed92`](https://github.com/eea/volto-hero-block/commit/799ed92e506b9b0faded334c019f4a8ffc4b8d43)
53
- - Initial commit [`b21bcfd`](https://github.com/eea/volto-hero-block/commit/b21bcfd42c775acc84179272fac0d6ecaad71430)
44
+ ### [0.1.3](https://github.com/eea/volto-hero-block/compare/0.1.2...0.1.3) - 30 June 2022
45
+
46
+ ### [0.1.2](https://github.com/eea/volto-hero-block/compare/0.1.1...0.1.2) - 16 June 2022
47
+
48
+ #### :nail_care: Enhancements
49
+
50
+ - change(hero): wrap hero-block-image within a wrapper class [David Ichim - [`2802c41`](https://github.com/eea/volto-hero-block/commit/2802c41ee8eba4c34bf6d4b4766ebafb24056602)]
51
+ - change(hero): added spaced and inverted options to the main schema [David Ichim - [`b6865cd`](https://github.com/eea/volto-hero-block/commit/b6865cdc6dfae0d486f43fccfb31fa555af3a536)]
52
+ - change(hero): output h2 from slate instead of p tag [David Ichim - [`0b2a4c5`](https://github.com/eea/volto-hero-block/commit/0b2a4c5070cc2bf97f31ff4cf74ade0e27434d91)]
53
+
54
+ ### [0.1.1](https://github.com/eea/volto-hero-block/compare/0.1.0...0.1.1) - 13 June 2022
55
+
56
+ #### :nail_care: Enhancements
57
+
58
+ - change(hero): added image overlay option [David Ichim - [`647ef2c`](https://github.com/eea/volto-hero-block/commit/647ef2ce68848ac38b71977485021b17e8c2f540)]
59
+
60
+ #### :hammer_and_wrench: Others
61
+
62
+ - Fix Hero image type [Alin Voinea - [`fb2188a`](https://github.com/eea/volto-hero-block/commit/fb2188ac604cfc57ba26ea482e799ca867a412ad)]
63
+ - Fix external vs internal image [Alin Voinea - [`5e447e9`](https://github.com/eea/volto-hero-block/commit/5e447e9a4e35229d9a29b74ad230a2e1e659bbea)]
64
+ - Fix block title [Alin Voinea - [`db8de23`](https://github.com/eea/volto-hero-block/commit/db8de237f523e8cb9b96c2702818b529805fd36e)]
65
+ - Support external images [Miu Razvan - [`196902a`](https://github.com/eea/volto-hero-block/commit/196902ac0214cefb8a4bdc643f0424bc7c318282)]
66
+ - Update slate footnote support [Miu Razvan - [`c1522b4`](https://github.com/eea/volto-hero-block/commit/c1522b4164dbe6de01771d211d7e0bf3009f44d4)]
67
+ - Use justify content for text and button as well [Miu Razvan - [`08599cc`](https://github.com/eea/volto-hero-block/commit/08599cc45546d9b349128c4f8ce9c01318385811)]
68
+ - Add dependencies [Miu Razvan - [`30e2881`](https://github.com/eea/volto-hero-block/commit/30e2881a2a97a899e7f4cc614a0405c300ac6fee)]
69
+ ### 0.1.0 - 10 June 2022
70
+
71
+ #### :hammer_and_wrench: Others
72
+
73
+ - jenkins file fix [David Ichim - [`3a51e37`](https://github.com/eea/volto-hero-block/commit/3a51e379dd70cb9c6045922050020e33fc896a74)]
74
+ - Initial commit [David Ichim - [`799ed92`](https://github.com/eea/volto-hero-block/commit/799ed92e506b9b0faded334c019f4a8ffc4b8d43)]
75
+ - Initial commit [ichim-david - [`b21bcfd`](https://github.com/eea/volto-hero-block/commit/b21bcfd42c775acc84179272fac0d6ecaad71430)]
package/README.md CHANGED
@@ -15,35 +15,19 @@
15
15
  [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-hero-block-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-hero-block-develop)
16
16
 
17
17
 
18
- [Volto](https://github.com/plone/volto) add-on
18
+ Enhanced Hero Block [Volto](https://github.com/plone/volto) add-on
19
19
 
20
20
  ## Features
21
21
 
22
22
  Demo GIF
23
23
 
24
- ## Getting started
25
-
26
- ### Try volto-hero-block with Docker
27
-
28
- 1. Get the latest Docker images
24
+ ## Upgrade
29
25
 
30
- ```
31
- docker pull plone
32
- docker pull plone/volto
33
- ```
26
+ ### Upgrading to 2.x
34
27
 
35
- 1. Start Plone backend
36
- ```
37
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
38
- ```
39
-
40
- 1. Start Volto frontend
28
+ This version requires: `@plone/volto >= 16.0.0.alpha.46` (schemaEnhancer / addStyling).
41
29
 
42
- ```
43
- docker run -it --rm -p 3000:3000 --link plone -e ADDONS="@eeacms/volto-hero-block" plone/volto
44
- ```
45
-
46
- 1. Go to http://localhost:3000
30
+ ## Getting started
47
31
 
48
32
  ### Add volto-hero-block to your Volto project
49
33
 
@@ -97,10 +81,6 @@ All Rights Reserved.
97
81
 
98
82
  See [LICENSE.md](https://github.com/eea/volto-hero-block/blob/master/LICENSE.md) for details.
99
83
 
100
- ## Funding
101
-
102
- [European Environment Agency (EU)](http://eea.europa.eu)
103
- volto-addon-template/blob/master/LICENSE.md) for details.
104
84
 
105
85
  ## Funding
106
86
 
package/babel.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = function (api) {
2
2
  api.cache(true);
3
- const presets = ['razzle/babel'];
3
+ const presets = ['razzle'];
4
4
  const plugins = [
5
5
  [
6
6
  'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
@@ -0,0 +1,26 @@
1
+ const { defineConfig } = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ viewportWidth: 1280,
5
+ defaultCommandTimeout: 8888,
6
+ chromeWebSecurity: false,
7
+ reporter: 'junit',
8
+ video: true,
9
+ retries: {
10
+ runMode: 8,
11
+ openMode: 0,
12
+ },
13
+ reporterOptions: {
14
+ mochaFile: 'cypress/reports/cypress-[hash].xml',
15
+ jenkinsMode: true,
16
+ toConsole: true,
17
+ },
18
+ e2e: {
19
+ setupNodeEvents(on, config) {
20
+ // e2e testing node events setup code
21
+ require('@cypress/code-coverage/task')(on, config);
22
+ return config;
23
+ },
24
+ baseUrl: 'http://localhost:3000',
25
+ },
26
+ });
@@ -9,18 +9,18 @@ module.exports = {
9
9
  '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
10
10
  '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
11
11
  '@package/(.*)$': '<rootDir>/src/$1',
12
+ '@root/(.*)$': '<rootDir>/src/$1',
12
13
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
13
14
  '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
14
- 'volto-slate/(.*)$': '<rootDir>/src/addons/volto-slate/src/$1',
15
+ '@plone/volto-slate':
16
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
15
17
  '~/(.*)$': '<rootDir>/src/$1',
16
18
  'load-volto-addons':
17
19
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
20
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
18
21
  },
19
22
  transform: {
20
23
  '^.+\\.js(x)?$': 'babel-jest',
21
- '^.+\\.css$': 'jest-css-modules',
22
- '^.+\\.less$': 'jest-css-modules',
23
- '^.+\\.scss$': 'jest-css-modules',
24
24
  '^.+\\.(png)$': 'jest-file',
25
25
  '^.+\\.(jpg)$': 'jest-file',
26
26
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-hero-block",
3
- "version": "0.2.0",
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",
@@ -17,33 +17,34 @@
17
17
  "url": "git@github.com:eea/volto-hero-block.git"
18
18
  },
19
19
  "addons": [
20
- "@eeacms/volto-object-widget",
21
- "volto-slate"
20
+ "@eeacms/volto-object-widget"
22
21
  ],
23
22
  "dependencies": {
24
- "volto-slate": "*",
25
23
  "@eeacms/volto-object-widget": "*"
26
24
  },
27
25
  "devDependencies": {
28
26
  "@plone/scripts": "*",
29
- "@cypress/code-coverage": "^3.9.5",
30
- "babel-plugin-transform-class-properties": "^6.24.1"
27
+ "@cypress/code-coverage": "^3.10.0",
28
+ "babel-plugin-transform-class-properties": "^6.24.1",
29
+ "md5": "^2.3.0"
31
30
  },
32
31
  "scripts": {
33
32
  "release": "release-it",
33
+ "release-major-beta": "release-it major --preRelease=beta",
34
+ "release-beta": "release-it --preRelease=beta",
34
35
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
35
36
  "test": "make test",
36
37
  "test:fix": "make test-update",
37
38
  "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
38
- "stylelint": "if [ -d ./project ]; then ./project/node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; else ../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; fi",
39
- "stylelint:overrides": "if [ -d ./project ]; then ./project/node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; else ../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; fi",
40
- "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
41
- "prettier": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; fi",
42
- "prettier:fix": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; fi",
43
- "lint": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; fi",
44
- "lint:fix": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; fi",
45
- "i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
46
- "cypress:run": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress run; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress run; fi",
47
- "cypress:open": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress open; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress open; fi"
39
+ "stylelint": "make stylelint",
40
+ "stylelint:overrides": "make stylelint-overrides",
41
+ "stylelint:fix": "make stylelint-fix",
42
+ "prettier": "make prettier",
43
+ "prettier:fix": "make prettier-fix",
44
+ "lint": "make lint",
45
+ "lint:fix": "make lint-fix",
46
+ "i18n": "make i18n",
47
+ "cypress:run": "make cypress-run",
48
+ "cypress:open": "make cypress-open"
48
49
  }
49
50
  }
@@ -7,9 +7,12 @@ import {
7
7
  SidebarPortal,
8
8
  UniversalLink,
9
9
  } from '@plone/volto/components';
10
- import SlateEditor from 'volto-slate/editor/SlateEditor';
11
- import { handleKey } from 'volto-slate/blocks/Text/keyboard';
12
- import { uploadContent, saveSlateBlockSelection } from 'volto-slate/actions';
10
+ import SlateEditor from '@plone/volto-slate/editor/SlateEditor';
11
+ import { handleKey } from '@plone/volto-slate/blocks/Text/keyboard';
12
+ import {
13
+ uploadContent,
14
+ saveSlateBlockSelection,
15
+ } from '@plone/volto-slate/actions';
13
16
 
14
17
  import { createSlateHeader } from '@eeacms/volto-hero-block/helpers';
15
18
 
@@ -33,18 +33,28 @@ function Hero({
33
33
  <div
34
34
  className={cx(
35
35
  'eea hero-block',
36
- { spaced },
37
- { inverted },
38
- !image && backgroundVariant && `color-bg-${backgroundVariant}`,
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('hero-block-image-wrapper', {
46
- 'full-width': fullWidth,
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')}
@@ -12,8 +12,7 @@ export default (config) => {
12
12
  edit: HeroEdit,
13
13
  view: HeroView,
14
14
  blockHasOwnFocusManagement: true,
15
- stylesSchema: stylingSchema,
16
- enableStyling: true,
15
+ schemaEnhancer: stylingSchema,
17
16
  restricted: false,
18
17
  mostUsed: false,
19
18
  sidebarTab: 1,
@@ -1,4 +1,6 @@
1
- export default ({ data }) => {
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 = ({ intl }) => ({
70
- title: 'Hero style',
71
- block: 'hero',
72
- fieldsets: [
73
- {
74
- id: 'default',
75
- title: 'Default',
76
- fields: [
77
- 'backgroundVariant',
78
- 'alignContent',
79
- 'textAlign',
80
- 'textVariant',
81
- 'buttonVariant',
82
- 'buttonAlign',
83
- ],
84
- },
85
- ],
86
- properties: {
87
- backgroundVariant: {
88
- title: 'Background theme',
89
- choices: [
90
- ['primary', 'Primary'],
91
- ['secondary', 'Secondary'],
92
- ['tertiary', 'Tertiary'],
93
- ['grey', 'Grey'],
94
- ],
95
- },
96
- alignContent: {
97
- title: 'Content align',
98
- choices: [
99
- ['start', 'Top'],
100
- ['center', 'Center'],
101
- ['end', 'Bottom'],
102
- ],
103
- },
104
- textAlign: {
105
- title: 'Text align',
106
- widget: 'align',
107
- actions: ['left', 'center', 'right'],
108
- defaultValue: 'left',
109
- },
110
- textVariant: {
111
- title: 'Text theme',
112
- choices: [
113
- ['primary', 'Primary'],
114
- ['secondary', 'Secondary'],
115
- ['tertiary', 'Tertiary'],
116
- ],
117
- },
118
- buttonVariant: {
119
- title: 'Button theme',
120
- choices: [
121
- ['primary', 'Primary'],
122
- ['secondary', 'Secondary'],
123
- ['tertiary', 'Tertiary'],
124
- ],
125
- },
126
- buttonAlign: {
127
- title: 'Button align',
128
- widget: 'align',
129
- actions: ['left', 'center', 'right'],
130
- defaultValue: 'left',
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
- required: [],
134
- });
137
+ required: [],
138
+ };
139
+ return schema;
140
+ };
package/src/helpers.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { isArray } from 'lodash';
2
- import { serializeNodes } from 'volto-slate/editor/render';
2
+ import { serializeNodes } from '@plone/volto-slate/editor/render';
3
3
 
4
4
  const createEmptyHeader = () => {
5
5
  return {
package/cypress.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "baseUrl": "http://localhost:3000",
3
- "viewportWidth": 1280,
4
- "defaultCommandTimeout": 8888,
5
- "chromeWebSecurity": false,
6
- "reporter": "junit",
7
- "video": true,
8
- "retries": {
9
- "runMode": 8,
10
- "openMode": 0
11
- },
12
- "reporterOptions": {
13
- "mochaFile": "cypress/reports/cypress-[hash].xml",
14
- "jenkinsMode": true,
15
- "toConsole": true
16
- }
17
- }