@eeacms/volto-tabs-block 7.0.1 → 7.0.3

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/CHANGELOG.md CHANGED
@@ -4,10 +4,27 @@ 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.0.3](https://github.com/eea/volto-tabs-block/compare/7.0.2...7.0.3) - 29 November 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: delete styles on tab - refs #260427 [dobri1408 - [`6925c95`](https://github.com/eea/volto-tabs-block/commit/6925c958780e9446949c9023053970f042052ecf)]
12
+
13
+ ### [7.0.2](https://github.com/eea/volto-tabs-block/compare/7.0.1...7.0.2) - 24 November 2023
14
+
15
+ #### :bug: Bug Fixes
16
+
17
+ - fix(menu): Update secondary pointing inverted active border color variable in menu [David Ichim - [`d8a7837`](https://github.com/eea/volto-tabs-block/commit/d8a78377058732c42295196810416b41ad41417c)]
18
+
19
+ #### :hammer_and_wrench: Others
20
+
21
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`3b87d12`](https://github.com/eea/volto-tabs-block/commit/3b87d12df4d01031231b15eb4196f6ff6937706b)]
22
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`f5f3430`](https://github.com/eea/volto-tabs-block/commit/f5f343024b45bb0206e0169cce6dd0e8472b6795)]
7
23
  ### [7.0.1](https://github.com/eea/volto-tabs-block/compare/7.0.0...7.0.1) - 9 November 2023
8
24
 
9
25
  #### :bug: Bug Fixes
10
26
 
27
+ - fix(tabs): default view style due to missing class found on edit #75 from eea/develop [ichim-david - [`f620621`](https://github.com/eea/volto-tabs-block/commit/f6206213915d072838173ca2a5bff4d4ddc461c1)]
11
28
  - fix(tabs): added missing tabs-secondary-variant class to default tab view template [David Ichim - [`a122359`](https://github.com/eea/volto-tabs-block/commit/a122359601d548d7577e7f978b5025a92469d1dd)]
12
29
 
13
30
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-tabs-block",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "description": "volto-tabs-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -51,7 +51,8 @@ const Edit = (props) => {
51
51
  const accordionConfig = config.blocks.blocksConfig[
52
52
  TABS_BLOCK
53
53
  ].variations.filter((v, _i) => v.id === data.variation);
54
- const { icons, semanticIcon, transformWidth = 800 } = accordionConfig?.[0];
54
+ const { icons, semanticIcon, transformWidth = 800 } =
55
+ accordionConfig?.[0] || {};
55
56
 
56
57
  const tabsContainer = React.useRef();
57
58
  const [mounted, setMounted] = React.useState(false);
@@ -42,7 +42,8 @@ const View = (props) => {
42
42
  const accordionConfig = config.blocks.blocksConfig[
43
43
  TABS_BLOCK
44
44
  ].variations.filter((v, _i) => v.id === data.variation);
45
- const { icons, semanticIcon, transformWidth = 800 } = accordionConfig?.[0];
45
+ const { icons, semanticIcon, transformWidth = 800 } =
46
+ accordionConfig?.[0] || {};
46
47
 
47
48
  const tabsContainer = React.useRef();
48
49
  const [mounted, setMounted] = React.useState(false);
package/src/index.js CHANGED
@@ -107,7 +107,7 @@ const applyConfig = (config) => {
107
107
  },
108
108
  ],
109
109
  getBlocks: (data) => {
110
- const { blocks = {}, blocks_layout = {} } = data?.data;
110
+ const { blocks = {}, blocks_layout = {} } = data?.data || {};
111
111
  if (blocks_layout?.items?.length) {
112
112
  return {
113
113
  blocks: blocks_layout.items.map((block, index) => ({
@@ -24,7 +24,7 @@
24
24
 
25
25
  /* Menu item */
26
26
  @menuItemCountDisplay: none;
27
- @secondaryPointingInvertedActiveBorderColor: var(--inverted-secondary-active-border-color, @pink);
27
+ @secondaryPointingInvertedActiveBorderColor: var(--tab-inverted-secondary-active-border-color, @pink);
28
28
  @menuItemActiveBackgroundColor: var(--tab-active-bg-color, rgba(0, 0, 0, 0.05));
29
29
  @menuItemInvertedBackgroundColor: var(--tab-inverted-bg-color, #C7D5D8);
30
30
  @menuItemInvertedActiveBackgroundColor: var(--tab-inverted-active-bg-color, rgba(0, 0, 0, 0.1));
@@ -101,7 +101,7 @@ const TabsWidget = (props) => {
101
101
  },
102
102
  blocks_layout: {
103
103
  ...value.blocks_layout,
104
- items: [...value.blocks_layout?.items, newId],
104
+ items: [...(value.blocks_layout?.items || []), newId],
105
105
  },
106
106
  });
107
107
  }}
@@ -170,7 +170,7 @@ const TabsWidget = (props) => {
170
170
  blocks_layout: {
171
171
  ...value.blocks_layout,
172
172
  items: without(
173
- [...value.blocks_layout?.items],
173
+ [...(value.blocks_layout?.items || [])],
174
174
  childId,
175
175
  ),
176
176
  },
@@ -227,6 +227,7 @@ const TabsWidget = (props) => {
227
227
  <StyleWrapperEdit
228
228
  {...props}
229
229
  selected={activeTabId}
230
+ blockData={activeTabData}
230
231
  isVisible={blockStyleVisible}
231
232
  setIsVisible={(value) => {
232
233
  setActiveTabId(null);
@@ -238,6 +239,17 @@ const TabsWidget = (props) => {
238
239
  ...(activeTabData.size ? { size: activeTabData.size } : {}),
239
240
  }}
240
241
  choices={[]}
242
+ onChangeBlock={(block, newData) => {
243
+ onChange(id, {
244
+ ...value,
245
+ blocks: {
246
+ ...value.blocks,
247
+ [activeTabId]: {
248
+ ...newData,
249
+ },
250
+ },
251
+ });
252
+ }}
241
253
  onChangeValue={(styleId, styleValue) =>
242
254
  onChange(id, {
243
255
  ...value,