@eeacms/volto-hero-block 0.2.0 → 1.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');
package/CHANGELOG.md CHANGED
@@ -4,50 +4,59 @@ 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
+ ### [1.0.0](https://github.com/eea/volto-hero-block/compare/0.2.0...1.0.0) - 28 October 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(volto-slate): Upgrade to @plone/volto-slate - refs #153447 [Alin Voinea - [`8e9aef4`](https://github.com/eea/volto-hero-block/commit/8e9aef42b9e92cca4666526b083f6f64bb5adfa8)]
14
12
 
15
- > 30 June 2022
13
+ #### :hammer_and_wrench: Others
16
14
 
15
+ - Remove cypress.json [Alin Voinea - [`593bdf2`](https://github.com/eea/volto-hero-block/commit/593bdf207ca4fd3f2393117b6f64a44727881ad0)]
16
+ - test(cypress): Upgrade to Cypress 10 / Razzle 4 [Alin Voinea - [`edd48a5`](https://github.com/eea/volto-hero-block/commit/edd48a5c13824bce5e03e46790f1890656b340d8)]
17
+ - Cleanup [Alin Voinea - [`9d72ee7`](https://github.com/eea/volto-hero-block/commit/9d72ee7a06d1c6fed46586d30bb85eae39e670bf)]
18
+ ### [0.2.0](https://github.com/eea/volto-hero-block/compare/0.1.4...0.2.0) - 6 July 2022
17
19
 
18
- #### [0.1.3](https://github.com/eea/volto-hero-block/compare/0.1.2...0.1.3)
20
+ #### :bug: Bug Fixes
19
21
 
20
- > 30 June 2022
22
+ - fix(hero): image dimensions when full width and height isn't enabled [David Ichim - [`69fb38e`](https://github.com/eea/volto-hero-block/commit/69fb38e9410f2a241a5d3babca9a712df946f859)]
21
23
 
22
- - Cleanup themeing options [`#4`](https://github.com/eea/volto-hero-block/pull/4)
24
+ #### :nail_care: Enhancements
23
25
 
24
- #### [0.1.2](https://github.com/eea/volto-hero-block/compare/0.1.1...0.1.2)
26
+ - change(hero): implemented meta alignment and renamed several options for consistency [David Ichim - [`df08d80`](https://github.com/eea/volto-hero-block/commit/df08d80201b079a083e8c742e763c7b144fb5724)]
27
+ - change(hero): re-added quoted option to the hero block [David Ichim - [`d8c9c59`](https://github.com/eea/volto-hero-block/commit/d8c9c59d7e7e5feaf592a52f9cc6ff23abca2fa2)]
25
28
 
26
- > 16 June 2022
29
+ ### [0.1.4](https://github.com/eea/volto-hero-block/compare/0.1.3...0.1.4) - 30 June 2022
27
30
 
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)
31
+ ### [0.1.3](https://github.com/eea/volto-hero-block/compare/0.1.2...0.1.3) - 30 June 2022
32
32
 
33
- #### [0.1.1](https://github.com/eea/volto-hero-block/compare/0.1.0...0.1.1)
33
+ ### [0.1.2](https://github.com/eea/volto-hero-block/compare/0.1.1...0.1.2) - 16 June 2022
34
34
 
35
- > 13 June 2022
35
+ #### :nail_care: Enhancements
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
+ - change(hero): wrap hero-block-image within a wrapper class [David Ichim - [`2802c41`](https://github.com/eea/volto-hero-block/commit/2802c41ee8eba4c34bf6d4b4766ebafb24056602)]
38
+ - change(hero): added spaced and inverted options to the main schema [David Ichim - [`b6865cd`](https://github.com/eea/volto-hero-block/commit/b6865cdc6dfae0d486f43fccfb31fa555af3a536)]
39
+ - change(hero): output h2 from slate instead of p tag [David Ichim - [`0b2a4c5`](https://github.com/eea/volto-hero-block/commit/0b2a4c5070cc2bf97f31ff4cf74ade0e27434d91)]
46
40
 
47
- #### 0.1.0
41
+ ### [0.1.1](https://github.com/eea/volto-hero-block/compare/0.1.0...0.1.1) - 13 June 2022
48
42
 
49
- > 10 June 2022
43
+ #### :nail_care: Enhancements
50
44
 
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)
45
+ - change(hero): added image overlay option [David Ichim - [`647ef2c`](https://github.com/eea/volto-hero-block/commit/647ef2ce68848ac38b71977485021b17e8c2f540)]
46
+
47
+ #### :hammer_and_wrench: Others
48
+
49
+ - Fix Hero image type [Alin Voinea - [`fb2188a`](https://github.com/eea/volto-hero-block/commit/fb2188ac604cfc57ba26ea482e799ca867a412ad)]
50
+ - Fix external vs internal image [Alin Voinea - [`5e447e9`](https://github.com/eea/volto-hero-block/commit/5e447e9a4e35229d9a29b74ad230a2e1e659bbea)]
51
+ - Fix block title [Alin Voinea - [`db8de23`](https://github.com/eea/volto-hero-block/commit/db8de237f523e8cb9b96c2702818b529805fd36e)]
52
+ - Support external images [Miu Razvan - [`196902a`](https://github.com/eea/volto-hero-block/commit/196902ac0214cefb8a4bdc643f0424bc7c318282)]
53
+ - Update slate footnote support [Miu Razvan - [`c1522b4`](https://github.com/eea/volto-hero-block/commit/c1522b4164dbe6de01771d211d7e0bf3009f44d4)]
54
+ - Use justify content for text and button as well [Miu Razvan - [`08599cc`](https://github.com/eea/volto-hero-block/commit/08599cc45546d9b349128c4f8ce9c01318385811)]
55
+ - Add dependencies [Miu Razvan - [`30e2881`](https://github.com/eea/volto-hero-block/commit/30e2881a2a97a899e7f4cc614a0405c300ac6fee)]
56
+ ### 0.1.0 - 10 June 2022
57
+
58
+ #### :hammer_and_wrench: Others
59
+
60
+ - jenkins file fix [David Ichim - [`3a51e37`](https://github.com/eea/volto-hero-block/commit/3a51e379dd70cb9c6045922050020e33fc896a74)]
61
+ - Initial commit [David Ichim - [`799ed92`](https://github.com/eea/volto-hero-block/commit/799ed92e506b9b0faded334c019f4a8ffc4b8d43)]
62
+ - Initial commit [ichim-david - [`b21bcfd`](https://github.com/eea/volto-hero-block/commit/b21bcfd42c775acc84179272fac0d6ecaad71430)]
package/README.md CHANGED
@@ -15,7 +15,7 @@
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
 
@@ -23,28 +23,6 @@ Demo GIF
23
23
 
24
24
  ## Getting started
25
25
 
26
- ### Try volto-hero-block with Docker
27
-
28
- 1. Get the latest Docker images
29
-
30
- ```
31
- docker pull plone
32
- docker pull plone/volto
33
- ```
34
-
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
41
-
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
47
-
48
26
  ### Add volto-hero-block to your Volto project
49
27
 
50
28
  1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
@@ -97,10 +75,6 @@ All Rights Reserved.
97
75
 
98
76
  See [LICENSE.md](https://github.com/eea/volto-hero-block/blob/master/LICENSE.md) for details.
99
77
 
100
- ## Funding
101
-
102
- [European Environment Agency (EU)](http://eea.europa.eu)
103
- volto-addon-template/blob/master/LICENSE.md) for details.
104
78
 
105
79
  ## Funding
106
80
 
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": "1.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"
48
- }
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"
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
 
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
- }