@eeacms/volto-clms-theme 1.1.254 → 1.1.255

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,6 +4,15 @@ 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
+ ### [1.1.255](https://github.com/eea/volto-clms-theme/compare/1.1.254...1.1.255) - 6 October 2025
8
+
9
+ #### :house: Internal changes
10
+
11
+ - style: Automated code fix [eea-jenkins - [`48b273a`](https://github.com/eea/volto-clms-theme/commit/48b273ab2e6a7a0a1f25a53de91029c2feb3acf8)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - Refs #289194 - Add ChatbotBannerBlock to be used in homepage. [GhitaB - [`e32d30e`](https://github.com/eea/volto-clms-theme/commit/e32d30e8995dbc73b6a62833949c2106e7244685)]
7
16
  ### [1.1.254](https://github.com/eea/volto-clms-theme/compare/1.1.253...1.1.254) - 24 September 2025
8
17
 
9
18
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.254",
3
+ "version": "1.1.255",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { BlockDataForm } from '@plone/volto/components';
3
+ import ChatbotBannerBlockSchema from './schema';
4
+ import ChatbotBannerBlockView from './ChatbotBannerBlockView';
5
+
6
+ const ChatbotBannerBlockEdit = (props) => {
7
+ const { data, block, onChangeBlock } = props;
8
+
9
+ return (
10
+ <div className="block-edit-wrapper">
11
+ <ChatbotBannerBlockView data={data} isEditMode />
12
+ <BlockDataForm
13
+ schema={ChatbotBannerBlockSchema}
14
+ title={ChatbotBannerBlockSchema.title}
15
+ onChangeField={(id, value) => {
16
+ onChangeBlock(block, {
17
+ ...data,
18
+ [id]: value,
19
+ });
20
+ }}
21
+ formData={data}
22
+ />
23
+ </div>
24
+ );
25
+ };
26
+
27
+ export default ChatbotBannerBlockEdit;
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import cx from 'classnames';
3
+ import './chatbot-banner-block.less';
4
+
5
+ const ChatbotBannerBlockView = ({ data, isEditMode }) => {
6
+ const { logo, logoLink, text, buttonText, buttonLink } = data;
7
+
8
+ const logoImage = logo ? (
9
+ <img src={logo} alt="Logo" className="chatbot-banner-logo" />
10
+ ) : null;
11
+
12
+ return (
13
+ <div
14
+ className={cx('chatbot-banner-block', 'ccl-container', {
15
+ edit: isEditMode,
16
+ })}
17
+ >
18
+ <div className="chatbot-banner-inner">
19
+ {logo &&
20
+ (logoLink ? (
21
+ <a
22
+ href={logoLink}
23
+ target="_blank"
24
+ rel="noopener noreferrer"
25
+ className="chatbot-banner-logo-link"
26
+ >
27
+ {logoImage}
28
+ </a>
29
+ ) : (
30
+ logoImage
31
+ ))}
32
+
33
+ <p className="chatbot-banner-text">{text || 'Your smart CLMS guide'}</p>
34
+
35
+ {buttonText && (
36
+ <a
37
+ href={buttonLink || '#'}
38
+ className="chatbot-banner-button"
39
+ target="_blank"
40
+ rel="noopener noreferrer"
41
+ >
42
+ {buttonText}
43
+ </a>
44
+ )}
45
+ </div>
46
+ </div>
47
+ );
48
+ };
49
+
50
+ export default ChatbotBannerBlockView;
@@ -0,0 +1,92 @@
1
+ .chatbot-banner-block {
2
+ padding: 1.5rem 2rem;
3
+ margin: 2rem 0;
4
+ background-color: #fafaf5;
5
+ border-radius: 8px;
6
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
7
+
8
+ .chatbot-banner-inner {
9
+ display: flex;
10
+ width: 100%;
11
+ align-items: center;
12
+ justify-content: space-between;
13
+ margin: 0 auto;
14
+ gap: 2rem;
15
+
16
+ // Logo section (left)
17
+ .chatbot-banner-logo-link,
18
+ .chatbot-banner-logo {
19
+ display: flex;
20
+ flex-shrink: 0;
21
+ align-items: center;
22
+ justify-content: center;
23
+
24
+ img {
25
+ width: auto;
26
+ max-height: 48px;
27
+ }
28
+ }
29
+
30
+ // Text section (center)
31
+ .chatbot-banner-text {
32
+ flex: 1;
33
+ margin: 0;
34
+ color: rgba(0, 0, 0, 0.68);
35
+ font-size: 1rem;
36
+ line-height: 1.5;
37
+ }
38
+
39
+ // Button section (right)
40
+ .chatbot-banner-button {
41
+ padding: 0.7rem 1.4rem;
42
+ background-color: #a0b128;
43
+ color: #fff;
44
+ font-weight: 500;
45
+ text-decoration: none;
46
+ white-space: nowrap;
47
+ }
48
+ }
49
+
50
+ /* ===== Responsive adjustments ===== */
51
+ @media (max-width: 992px) {
52
+ .chatbot-banner-inner {
53
+ gap: 1.5rem;
54
+
55
+ .chatbot-banner-text {
56
+ font-size: 0.95rem;
57
+ }
58
+
59
+ .chatbot-banner-button {
60
+ padding: 0.6rem 1.2rem;
61
+ }
62
+ }
63
+ }
64
+
65
+ @media (max-width: 768px) {
66
+ .chatbot-banner-inner {
67
+ flex-direction: column;
68
+ align-items: flex-start;
69
+ gap: 1rem;
70
+ text-align: left;
71
+
72
+ .chatbot-banner-logo-link,
73
+ .chatbot-banner-logo {
74
+ margin-bottom: 0.5rem;
75
+
76
+ img {
77
+ height: 40px;
78
+ }
79
+ }
80
+
81
+ .chatbot-banner-text {
82
+ max-width: 100%;
83
+ font-size: 0.95rem;
84
+ }
85
+
86
+ .chatbot-banner-button {
87
+ align-self: flex-start;
88
+ padding: 0.6rem 1.1rem;
89
+ }
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,38 @@
1
+ const ChatbotBannerBlockSchema = {
2
+ title: 'Chatbot Banner Block',
3
+ fieldsets: [
4
+ {
5
+ id: 'default',
6
+ title: 'Default',
7
+ fields: ['logo', 'logoLink', 'text', 'buttonText', 'buttonLink'],
8
+ },
9
+ ],
10
+ properties: {
11
+ logo: {
12
+ title: 'Logo Image URL',
13
+ widget: 'url',
14
+ description:
15
+ 'Direct URL to the logo image (e.g. https://example.com/logo.png/@@images/image-159-33658afa10134572e80822e139c721c4.png)',
16
+ },
17
+ logoLink: {
18
+ title: 'Logo Click Link',
19
+ widget: 'url',
20
+ description: 'Optional: URL to open when clicking the logo',
21
+ },
22
+ text: {
23
+ title: 'Banner Text',
24
+ widget: 'textarea',
25
+ },
26
+ buttonText: {
27
+ title: 'Button Text',
28
+ default: 'Open AI Assistant',
29
+ },
30
+ buttonLink: {
31
+ title: 'Button Link',
32
+ widget: 'url',
33
+ },
34
+ },
35
+ required: [],
36
+ };
37
+
38
+ export default ChatbotBannerBlockSchema;
@@ -77,6 +77,8 @@ import RelatedListingSchema from '@eeacms/volto-clms-theme/components/Blocks/Ccl
77
77
  import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants';
78
78
  import TextLinkCarouselEdit from '@eeacms/volto-clms-theme/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselEdit';
79
79
  import TextLinkCarouselView from '@eeacms/volto-clms-theme/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselView';
80
+ import ChatbotBannerBlockView from '@eeacms/volto-clms-theme/components/Blocks/ChatbotBannerBlock/ChatbotBannerBlockView';
81
+ import ChatbotBannerBlockEdit from '@eeacms/volto-clms-theme/components/Blocks/ChatbotBannerBlock/ChatbotBannerBlockEdit';
80
82
  import SubscriptionBlockView from '@eeacms/volto-clms-theme/components/Blocks/CclSubscriptionBlock/SubscriptionView';
81
83
  import SubscriptionBlockEdit from '@eeacms/volto-clms-theme/components/Blocks/CclSubscriptionBlock/SubscriptionEdit';
82
84
  import CclFAQBlockEdit from '@eeacms/volto-clms-theme/components/Blocks/CclFAQBlock/CclFAQBlockEdit';
@@ -611,6 +613,22 @@ const customBlocks = (config) => ({
611
613
  view: [], // Future proof (not implemented yet) view user role(s)
612
614
  },
613
615
  },
616
+ chatbotBannerBlock: {
617
+ id: 'chatbotBannerBlock', // The name (id) of the block
618
+ title: 'Chatbot Banner', // The display name of the block
619
+ icon: homeBand, // The icon used in the block chooser
620
+ group: 'common', // The group (blocks can be grouped, displayed in the chooser)
621
+ view: ChatbotBannerBlockView, // The view mode component
622
+ edit: ChatbotBannerBlockEdit, // The edit mode component
623
+ restricted: false, // If the block is restricted, it won't show in the chooser
624
+ mostUsed: false, // A meta group `most used`, appearing at the top of the chooser
625
+ blockHasOwnFocusManagement: false, // Set this to true if the block manages its own focus
626
+ sidebarTab: 1, // The sidebar tab you want to be selected when selecting the block
627
+ security: {
628
+ addPermission: [], // Future proof (not implemented yet) add user permission role(s)
629
+ view: [], // Future proof (not implemented yet) view user role(s)
630
+ },
631
+ },
614
632
  homeProducts: {
615
633
  id: 'homeProducts', // The name (id) of the block
616
634
  title: 'Home Products', // The display name of the block