@eeacms/volto-eea-chatbot 2.0.5 → 3.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/AGENTS.md CHANGED
@@ -87,3 +87,233 @@ and consistency.
87
87
 
88
88
  For more detailed contribution guidelines, refer to `DEVELOP.md`.
89
89
  For release procedures, refer to `RELEASE.md`.
90
+
91
+ ---
92
+
93
+ ## Frontend Development Guide for AI Assistants
94
+
95
+ ### EEA Design System Tokens
96
+
97
+ The EEA Design System provides shared LESS tokens for colors, spacing, typography, borders, and shapes. These are available via `@eeacms/volto-design-tokens`.
98
+
99
+ **Importing tokens:**
100
+
101
+ ```less
102
+ @import '@eeacms/volto-design-tokens/src/colors'; // @blue-6, @grey-0, @green-4, etc.
103
+ @import '@eeacms/volto-design-tokens/src/shapes'; // @radius-1, @radius-3, @radius-round
104
+ @import '@eeacms/volto-design-tokens/src/borders'; // @border-size-1, @border-size-2
105
+ @import '@eeacms/volto-design-tokens/src/fonts'; // @font-size-0, @font-weight-6, @font-lineheight-2
106
+ ```
107
+
108
+ **Pitfall:** Do NOT import `@eeacms/volto-design-tokens/src/sizes` directly — it references `@1px` which is a Semantic UI variable not available in standalone LESS. Instead, inline the spacing tokens you need:
109
+
110
+ ```less
111
+ // Spacing tokens (from sizes.less, inlined to avoid @1px dependency)
112
+ @spacer: 4px;
113
+ @space-05: @spacer * 0.5; // 2px
114
+ @space-1: @spacer * 1; // 4px
115
+ @space-2: @spacer * 2; // 8px
116
+ @space-3: @spacer * 3; // 12px
117
+ @space-4: @spacer * 4; // 16px
118
+ @space-5: @spacer * 5; // 20px
119
+ @space-6: @spacer * 6; // 24px
120
+ @space-8: @spacer * 8; // 32px
121
+ ```
122
+
123
+ **When adding new LESS files that use design tokens, ensure `@eeacms/volto-design-tokens` is listed in `package.json` dependencies:**
124
+
125
+ ```json
126
+ "dependencies": {
127
+ "@eeacms/volto-design-tokens": "*"
128
+ }
129
+ ```
130
+
131
+ ### Rendering Slate (Rich Text) Content
132
+
133
+ Volto stores rich text as Slate JSON. To render it in view components, use `serializeNodes`:
134
+
135
+ ```jsx
136
+ import { serializeNodes } from '@plone/volto-slate/editor/render';
137
+
138
+ // In your component:
139
+ {someSlateContent && serializeNodes(someSlateContent)}
140
+ ```
141
+
142
+ **Do NOT use `SlateViewer` from `@plone/volto/components`** — it does not exist. The `serializeNodes` function is the correct approach (used internally by the ChatBlock's `AIMessage.tsx`).
143
+
144
+ ### Volto Block Registration Pattern
145
+
146
+ When creating a new Volto block:
147
+
148
+ 1. **Schema function** accepts `{ intl, data }` and returns a schema object:
149
+ ```jsx
150
+ export function MyBlockSchema({ intl, data }) {
151
+ return {
152
+ title: intl.formatMessage({ id: 'My Block', defaultMessage: 'My Block' }),
153
+ fieldsets: [{ id: 'default', title: 'Default', fields: ['myField'] }],
154
+ properties: { /* ... */ },
155
+ required: [],
156
+ };
157
+ }
158
+ ```
159
+
160
+ 2. **Edit component** must inject `intl` via `useIntl` and pass it to the schema:
161
+ ```jsx
162
+ import { useIntl } from 'react-intl';
163
+
164
+ const MyBlockEdit = (props) => {
165
+ const intl = useIntl();
166
+ const schema = React.useMemo(
167
+ () => MyBlockSchema({ intl, data: props.data }),
168
+ [props.data, intl],
169
+ );
170
+ // ... render with BlockDataForm
171
+ };
172
+ ```
173
+
174
+ 3. **Block registration** in `index.js`:
175
+ ```js
176
+ export default function installMyBlock(config) {
177
+ config.blocks.blocksConfig.myBlock = {
178
+ id: 'myBlock',
179
+ title: 'My Block',
180
+ icon: someSVG,
181
+ group: 'common',
182
+ view: MyBlockView,
183
+ edit: MyBlockEdit,
184
+ schema: MyBlockSchema,
185
+ // ...
186
+ };
187
+ return config;
188
+ }
189
+ ```
190
+
191
+ 4. **Wire into `src/index.js`**: `installMyBlock(config);`
192
+
193
+ ### Internationalization (i18n)
194
+
195
+ **All user-facing strings MUST use `react-intl`:**
196
+
197
+ ```jsx
198
+ import { FormattedMessage, defineMessages } from 'react-intl';
199
+
200
+ // In JSX:
201
+ <FormattedMessage id="Hello world" defaultMessage="Hello world" />
202
+
203
+ // For message definitions (e.g., in messages.js):
204
+ export default defineMessages({
205
+ greeting: { id: 'Hello world', defaultMessage: 'Hello world' },
206
+ });
207
+ ```
208
+
209
+ After adding new strings, run `make i18n` to extract them into PO files.
210
+
211
+ ### Semantic UI Toggle Checkboxes
212
+
213
+ **Avoid using Semantic UI `<Checkbox toggle>` for custom-styled toggles.** The toggle's internal DOM structure (`.box`, `label:before`) is difficult to style reliably across different background colors, and the default styles often clash with custom themes.
214
+
215
+ **Preferred approach:** Use a pure CSS toggle with a hidden `<input type="checkbox">`:
216
+
217
+ ```jsx
218
+ <label className="my-toggle">
219
+ <input type="checkbox" checked={enabled} onChange={(e) => onChange(e.target.checked)} />
220
+ <span className="my-toggle-slider" />
221
+ Label text
222
+ </label>
223
+ ```
224
+
225
+ ```less
226
+ .my-toggle {
227
+ display: inline-flex;
228
+ align-items: center;
229
+ gap: 8px;
230
+ cursor: pointer;
231
+
232
+ input { display: none; }
233
+
234
+ .my-toggle-slider {
235
+ position: relative;
236
+ width: 28px;
237
+ height: 16px;
238
+ border: 1px solid currentColor;
239
+ border-radius: 1rem;
240
+ background-color: rgba(currentColor, 0.15);
241
+
242
+ &::before {
243
+ position: absolute;
244
+ top: 1px;
245
+ left: 2px;
246
+ width: 12px;
247
+ height: 12px;
248
+ border-radius: 50%;
249
+ background-color: currentColor;
250
+ content: '';
251
+ transition: left 0.2s;
252
+ }
253
+ }
254
+
255
+ input:checked ~ .my-toggle-slider {
256
+ background-color: @green-4;
257
+ border-color: @green-4;
258
+
259
+ &::before { left: 13px; }
260
+ }
261
+ }
262
+ ```
263
+
264
+ ### LESS Styling Conventions
265
+
266
+ - **Property ordering:** Stylelint enforces alphabetical property order. Run `make stylelint-fix` to auto-fix.
267
+ - **`:global()` usage:** Use `:global()` in LESS nesting to target Semantic UI or Volto classes without the parent selector prefix:
268
+ ```less
269
+ .my-component {
270
+ :global(.ui.button) { color: red; }
271
+ }
272
+ // Produces: .my-component .ui.button { color: red; }
273
+ ```
274
+
275
+ ### Testing Patterns
276
+
277
+ **Mocking common dependencies in Jest tests:**
278
+
279
+ ```js
280
+ // react-intl
281
+ jest.mock('react-intl', () => ({
282
+ useIntl: () => ({ formatMessage: ({ defaultMessage }) => defaultMessage }),
283
+ FormattedMessage: ({ defaultMessage }) => <span>{defaultMessage}</span>,
284
+ }));
285
+
286
+ // react-router-dom (Volto uses v5)
287
+ const mockHistory = { push: jest.fn(), replace: jest.fn() };
288
+ jest.mock('react-router-dom', () => ({ useHistory: () => mockHistory }));
289
+
290
+ // Volto components
291
+ jest.mock('@plone/volto/components/manage/Sidebar/SidebarPortal', () => ({
292
+ __esModule: true,
293
+ default: ({ selected, children }) =>
294
+ selected ? <div>{children}</div> : null,
295
+ }));
296
+ ```
297
+
298
+ ### Internal Import Paths
299
+
300
+ Use `@eeacms/volto-eea-chatbot/...` for internal imports (matches the Jest `moduleNameMapper`):
301
+
302
+ ```js
303
+ import SVGIcon from '@eeacms/volto-eea-chatbot/ChatBlock/components/Icon';
304
+ import SendIcon from '@eeacms/volto-eea-chatbot/icons/send.svg';
305
+ ```
306
+
307
+ ### Matomo Tracking
308
+
309
+ Use `trackEvent` from `@eeacms/volto-matomo/utils` for analytics:
310
+
311
+ ```js
312
+ import { trackEvent } from '@eeacms/volto-matomo/utils';
313
+
314
+ trackEvent({
315
+ category: 'Chatbot',
316
+ action: 'Some action',
317
+ name: 'Some name',
318
+ });
319
+ ```
package/CHANGELOG.md CHANGED
@@ -4,6 +4,39 @@ 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
+ ### [3.0.0](https://github.com/eea/volto-eea-chatbot/compare/2.0.5...3.0.0) - 7 July 2026
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: refine custom toggle switch sizing and proportions [Tiberiu Ichim - [`d4c7499`](https://github.com/eea/volto-eea-chatbot/commit/d4c749964f9a1be063fae930c01b4a34e608909d)]
12
+ - fix: use 50% border-radius for toggle knob instead of @radius-round [Tiberiu Ichim - [`9013d1c`](https://github.com/eea/volto-eea-chatbot/commit/9013d1c889b26715be7b6c8a3b76b9bbc20a96de)]
13
+ - fix: inline spacing tokens to avoid Semantic UI @1px dependency [Tiberiu Ichim - [`7cb8ee6`](https://github.com/eea/volto-eea-chatbot/commit/7cb8ee69710005632f76d6aabc171f0ac70561d8)]
14
+ - fix: add @eeacms/volto-design-tokens as dependency [Tiberiu Ichim - [`5573047`](https://github.com/eea/volto-eea-chatbot/commit/5573047ec574e6a50ec5fb39e673f993b439f237)]
15
+ - fix: replace Semantic UI Checkbox with custom CSS toggle switch [Tiberiu Ichim - [`8b6780b`](https://github.com/eea/volto-eea-chatbot/commit/8b6780b05b5f334142d53b7ce5070565d93e1fc5)]
16
+ - fix: remove custom checkbox styling, use Semantic UI defaults [Tiberiu Ichim - [`c070e90`](https://github.com/eea/volto-eea-chatbot/commit/c070e90142ea3ba7eb281193d32fe71066f6ef40)]
17
+ - fix: make deep research toggle checkbox visible [Tiberiu Ichim - [`793716f`](https://github.com/eea/volto-eea-chatbot/commit/793716ff52708f32b99644c9572975649c4b6a1e)]
18
+ - fix: place prompt chips and deep research toggle on same row [Tiberiu Ichim - [`97c2e82`](https://github.com/eea/volto-eea-chatbot/commit/97c2e82b54b7eb5612ef595bd4e7c83c231e2e8f)]
19
+ - fix: align deep research toggle to the right with flexbox [Tiberiu Ichim - [`64755cd`](https://github.com/eea/volto-eea-chatbot/commit/64755cd9d578081a12259ac991c7d8da67dda5e9)]
20
+ - fix: use EEA green/teal for accent variant instead of blue [Tiberiu Ichim - [`ff0e46c`](https://github.com/eea/volto-eea-chatbot/commit/ff0e46cb1a7c1c2b52e7524a6f95c135dcdd33b7)]
21
+ - fix: pass intl to AISearchInputSchema in edit component [Tiberiu Ichim - [`fd1144d`](https://github.com/eea/volto-eea-chatbot/commit/fd1144d0f351fd9630732b9c465c4ed4219cf1c7)]
22
+ - fix: import EEA Design System color tokens in styles.less [Tiberiu Ichim - [`d84cda9`](https://github.com/eea/volto-eea-chatbot/commit/d84cda9355e911607996a72539279cb53f2524b0)]
23
+ - fix: replace non-existent SlateViewer with serializeNodes from volto-slate [Tiberiu Ichim - [`246ac09`](https://github.com/eea/volto-eea-chatbot/commit/246ac099ebd0cd90879de9f52e4b124c3abbc8d5)]
24
+
25
+ #### :nail_care: Enhancements
26
+
27
+ - refactor: replace hardcoded values with EEA Design System tokens [Tiberiu Ichim - [`723c939`](https://github.com/eea/volto-eea-chatbot/commit/723c939546d8dbbc83b9df13860303d73478893a)]
28
+
29
+ #### :house: Internal changes
30
+
31
+ - chore: bump version to 3.0.0 (EEA design system dependency) [skip ci] [Tiberiu Ichim - [`bc5a8c1`](https://github.com/eea/volto-eea-chatbot/commit/bc5a8c1f72d4e706b096cb96d0d24c2c3f5ac0f8)]
32
+
33
+ #### :house: Documentation changes
34
+
35
+ - docs: add frontend development guide for AI assistants [Tiberiu Ichim - [`36a77dc`](https://github.com/eea/volto-eea-chatbot/commit/36a77dcc7c6b551d4f049066ced698ff905fd4ef)]
36
+
37
+ #### :hammer_and_wrench: Others
38
+
39
+ - test: pin Chromium version 149 to work with Cypress [valentinab25 - [`5db1fcc`](https://github.com/eea/volto-eea-chatbot/commit/5db1fcc53c3147cc35c5d8c561c5dd0776e683c7)]
7
40
  ### [2.0.5](https://github.com/eea/volto-eea-chatbot/compare/2.0.4...2.0.5) - 21 June 2026
8
41
 
9
42
  #### :bug: Bug Fixes
@@ -73,7 +106,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
73
106
  #### :house: Internal changes
74
107
 
75
108
  - style: Automated code fix [eea-jenkins - [`8a8c3c4`](https://github.com/eea/volto-eea-chatbot/commit/8a8c3c4172a4f669661378cf1b5a3569d85609e6)]
76
- - chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`535d986`](https://github.com/eea/volto-eea-chatbot/commit/535d986b7adc77743a668bc4ac63f835eef58df3)]
77
109
 
78
110
  #### :hammer_and_wrench: Others
79
111
 
@@ -84,7 +116,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
84
116
  #### :house: Internal changes
85
117
 
86
118
  - style: Automated code fix [eea-jenkins - [`fdcd884`](https://github.com/eea/volto-eea-chatbot/commit/fdcd8848fd4c3f990ca5ea021f407487aebd6010)]
87
- - chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`3d428d7`](https://github.com/eea/volto-eea-chatbot/commit/3d428d72f32c3d05452b0961c76f5db1c416e05c)]
88
119
 
89
120
  #### :hammer_and_wrench: Others
90
121
 
@@ -11,4 +11,48 @@ msgstr ""
11
11
  "Content-Transfer-Encoding: \n"
12
12
  "Plural-Forms: \n"
13
13
 
14
+ #. Default: "AI Search Input"
15
+ #: AISearchInput/messages
16
+ msgid "AI Search Input"
17
+ msgstr ""
18
+
19
+ #. Default: "Ask your question..."
20
+ #: AISearchInput/components/SearchInput
21
+ #: AISearchInput/messages
22
+ msgid "Ask your question..."
23
+ msgstr ""
24
+
25
+ #. Default: "Assistant page is not configured. Please contact the site administrator."
26
+ #: AISearchInput/AISearchInputView
27
+ #: AISearchInput/messages
28
+ msgid "Assistant page is not configured. Please contact the site administrator."
29
+ msgstr ""
30
+
31
+ #. Default: "Deep research"
32
+ #: AISearchInput/components/DeepResearchToggle
33
+ #: AISearchInput/messages
34
+ msgid "Deep research"
35
+ msgstr ""
14
36
 
37
+ #. Default: "Deep research on"
38
+ #: AISearchInput/components/DeepResearchToggle
39
+ #: AISearchInput/messages
40
+ msgid "Deep research on"
41
+ msgstr ""
42
+
43
+ #. Default: "Invalid assistant page URL."
44
+ #: AISearchInput/AISearchInputView
45
+ #: AISearchInput/messages
46
+ msgid "Invalid assistant page URL."
47
+ msgstr ""
48
+
49
+ #. Default: "Submit question"
50
+ #: AISearchInput/components/SearchInput
51
+ #: AISearchInput/messages
52
+ msgid "Submit question"
53
+ msgstr ""
54
+
55
+ #. Default: "This assistant uses AI. Responses may contain inaccuracies."
56
+ #: AISearchInput/messages
57
+ msgid "This assistant uses AI. Responses may contain inaccuracies."
58
+ msgstr ""
@@ -11,4 +11,48 @@ msgstr ""
11
11
  "Content-Transfer-Encoding: \n"
12
12
  "Plural-Forms: \n"
13
13
 
14
+ #. Default: "AI Search Input"
15
+ #: AISearchInput/messages
16
+ msgid "AI Search Input"
17
+ msgstr ""
18
+
19
+ #. Default: "Ask your question..."
20
+ #: AISearchInput/components/SearchInput
21
+ #: AISearchInput/messages
22
+ msgid "Ask your question..."
23
+ msgstr ""
24
+
25
+ #. Default: "Assistant page is not configured. Please contact the site administrator."
26
+ #: AISearchInput/AISearchInputView
27
+ #: AISearchInput/messages
28
+ msgid "Assistant page is not configured. Please contact the site administrator."
29
+ msgstr ""
30
+
31
+ #. Default: "Deep research"
32
+ #: AISearchInput/components/DeepResearchToggle
33
+ #: AISearchInput/messages
34
+ msgid "Deep research"
35
+ msgstr ""
14
36
 
37
+ #. Default: "Deep research on"
38
+ #: AISearchInput/components/DeepResearchToggle
39
+ #: AISearchInput/messages
40
+ msgid "Deep research on"
41
+ msgstr ""
42
+
43
+ #. Default: "Invalid assistant page URL."
44
+ #: AISearchInput/AISearchInputView
45
+ #: AISearchInput/messages
46
+ msgid "Invalid assistant page URL."
47
+ msgstr ""
48
+
49
+ #. Default: "Submit question"
50
+ #: AISearchInput/components/SearchInput
51
+ #: AISearchInput/messages
52
+ msgid "Submit question"
53
+ msgstr ""
54
+
55
+ #. Default: "This assistant uses AI. Responses may contain inaccuracies."
56
+ #: AISearchInput/messages
57
+ msgid "This assistant uses AI. Responses may contain inaccuracies."
58
+ msgstr ""
@@ -11,4 +11,48 @@ msgstr ""
11
11
  "Content-Transfer-Encoding: \n"
12
12
  "Plural-Forms: \n"
13
13
 
14
+ #. Default: "AI Search Input"
15
+ #: AISearchInput/messages
16
+ msgid "AI Search Input"
17
+ msgstr ""
18
+
19
+ #. Default: "Ask your question..."
20
+ #: AISearchInput/components/SearchInput
21
+ #: AISearchInput/messages
22
+ msgid "Ask your question..."
23
+ msgstr ""
24
+
25
+ #. Default: "Assistant page is not configured. Please contact the site administrator."
26
+ #: AISearchInput/AISearchInputView
27
+ #: AISearchInput/messages
28
+ msgid "Assistant page is not configured. Please contact the site administrator."
29
+ msgstr ""
30
+
31
+ #. Default: "Deep research"
32
+ #: AISearchInput/components/DeepResearchToggle
33
+ #: AISearchInput/messages
34
+ msgid "Deep research"
35
+ msgstr ""
14
36
 
37
+ #. Default: "Deep research on"
38
+ #: AISearchInput/components/DeepResearchToggle
39
+ #: AISearchInput/messages
40
+ msgid "Deep research on"
41
+ msgstr ""
42
+
43
+ #. Default: "Invalid assistant page URL."
44
+ #: AISearchInput/AISearchInputView
45
+ #: AISearchInput/messages
46
+ msgid "Invalid assistant page URL."
47
+ msgstr ""
48
+
49
+ #. Default: "Submit question"
50
+ #: AISearchInput/components/SearchInput
51
+ #: AISearchInput/messages
52
+ msgid "Submit question"
53
+ msgstr ""
54
+
55
+ #. Default: "This assistant uses AI. Responses may contain inaccuracies."
56
+ #: AISearchInput/messages
57
+ msgid "This assistant uses AI. Responses may contain inaccuracies."
58
+ msgstr ""
@@ -11,4 +11,48 @@ msgstr ""
11
11
  "Content-Transfer-Encoding: \n"
12
12
  "Plural-Forms: \n"
13
13
 
14
+ #. Default: "AI Search Input"
15
+ #: AISearchInput/messages
16
+ msgid "AI Search Input"
17
+ msgstr ""
18
+
19
+ #. Default: "Ask your question..."
20
+ #: AISearchInput/components/SearchInput
21
+ #: AISearchInput/messages
22
+ msgid "Ask your question..."
23
+ msgstr ""
24
+
25
+ #. Default: "Assistant page is not configured. Please contact the site administrator."
26
+ #: AISearchInput/AISearchInputView
27
+ #: AISearchInput/messages
28
+ msgid "Assistant page is not configured. Please contact the site administrator."
29
+ msgstr ""
30
+
31
+ #. Default: "Deep research"
32
+ #: AISearchInput/components/DeepResearchToggle
33
+ #: AISearchInput/messages
34
+ msgid "Deep research"
35
+ msgstr ""
14
36
 
37
+ #. Default: "Deep research on"
38
+ #: AISearchInput/components/DeepResearchToggle
39
+ #: AISearchInput/messages
40
+ msgid "Deep research on"
41
+ msgstr ""
42
+
43
+ #. Default: "Invalid assistant page URL."
44
+ #: AISearchInput/AISearchInputView
45
+ #: AISearchInput/messages
46
+ msgid "Invalid assistant page URL."
47
+ msgstr ""
48
+
49
+ #. Default: "Submit question"
50
+ #: AISearchInput/components/SearchInput
51
+ #: AISearchInput/messages
52
+ msgid "Submit question"
53
+ msgstr ""
54
+
55
+ #. Default: "This assistant uses AI. Responses may contain inaccuracies."
56
+ #: AISearchInput/messages
57
+ msgid "This assistant uses AI. Responses may contain inaccuracies."
58
+ msgstr ""
package/locales/volto.pot CHANGED
@@ -1,16 +1,60 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2023-06-28T10:48:22.678Z\n"
4
+ "POT-Creation-Date: 2026-07-07T08:22:35.802Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
- "MIME-Version: 1.0\n"
8
7
  "Content-Type: text/plain; charset=utf-8\n"
9
8
  "Content-Transfer-Encoding: 8bit\n"
10
9
  "Plural-Forms: nplurals=1; plural=0;\n"
10
+ "MIME-Version: 1.0\n"
11
11
  "Language-Code: en\n"
12
12
  "Language-Name: English\n"
13
13
  "Preferred-Encodings: utf-8\n"
14
14
  "Domain: volto\n"
15
15
 
16
+ #. Default: "AI Search Input"
17
+ #: AISearchInput/messages
18
+ msgid "AI Search Input"
19
+ msgstr ""
20
+
21
+ #. Default: "Ask your question..."
22
+ #: AISearchInput/components/SearchInput
23
+ #: AISearchInput/messages
24
+ msgid "Ask your question..."
25
+ msgstr ""
26
+
27
+ #. Default: "Assistant page is not configured. Please contact the site administrator."
28
+ #: AISearchInput/AISearchInputView
29
+ #: AISearchInput/messages
30
+ msgid "Assistant page is not configured. Please contact the site administrator."
31
+ msgstr ""
32
+
33
+ #. Default: "Deep research"
34
+ #: AISearchInput/components/DeepResearchToggle
35
+ #: AISearchInput/messages
36
+ msgid "Deep research"
37
+ msgstr ""
38
+
39
+ #. Default: "Deep research on"
40
+ #: AISearchInput/components/DeepResearchToggle
41
+ #: AISearchInput/messages
42
+ msgid "Deep research on"
43
+ msgstr ""
44
+
45
+ #. Default: "Invalid assistant page URL."
46
+ #: AISearchInput/AISearchInputView
47
+ #: AISearchInput/messages
48
+ msgid "Invalid assistant page URL."
49
+ msgstr ""
50
+
51
+ #. Default: "Submit question"
52
+ #: AISearchInput/components/SearchInput
53
+ #: AISearchInput/messages
54
+ msgid "Submit question"
55
+ msgstr ""
16
56
 
57
+ #. Default: "This assistant uses AI. Responses may contain inaccuracies."
58
+ #: AISearchInput/messages
59
+ msgid "This assistant uses AI. Responses may contain inaccuracies."
60
+ msgstr ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-chatbot",
3
- "version": "2.0.5",
3
+ "version": "3.0.0",
4
4
  "description": "@eeacms/volto-eea-chatbot: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -40,6 +40,7 @@
40
40
  "typescript": "^5.7.3"
41
41
  },
42
42
  "dependencies": {
43
+ "@eeacms/volto-design-tokens": "*",
43
44
  "@eeacms/volto-matomo": "*",
44
45
  "@microsoft/fetch-event-source": "2.0.1",
45
46
  "@plone-collective/volto-sentry": "*",
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
4
+ import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
5
+
6
+ import AISearchInputView from './AISearchInputView';
7
+ import { AISearchInputSchema } from './schema';
8
+
9
+ const AISearchInputEdit = (props) => {
10
+ const { onChangeBlock, block, data } = props;
11
+ const intl = useIntl();
12
+
13
+ const schema = React.useMemo(
14
+ () => AISearchInputSchema({ intl, data }),
15
+ [data, intl],
16
+ );
17
+
18
+ return (
19
+ <div>
20
+ <AISearchInputView {...props} isEditMode />
21
+ <SidebarPortal selected={props.selected}>
22
+ <BlockDataForm
23
+ schema={schema}
24
+ title={schema.title}
25
+ block={block}
26
+ onChangeBlock={onChangeBlock}
27
+ onChangeField={(id, value) => {
28
+ onChangeBlock(block, { ...data, [id]: value });
29
+ }}
30
+ formData={data}
31
+ />
32
+ </SidebarPortal>
33
+ </div>
34
+ );
35
+ };
36
+
37
+ export default AISearchInputEdit;