@kindly/react-chat 2.41.6 → 2.42.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kindly/react-chat",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.42.0",
|
|
4
4
|
"description": "Kindly Chat react component",
|
|
5
5
|
"repository": "https://github.com/kindly-ai/kindly-chat/tree/main/packages/react-chat",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"pusher-js": "8.0.1"
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "4b8f2bf59a0cce3540ea8262de8b7393e367239c"
|
|
133
133
|
}
|
|
@@ -400,6 +400,102 @@ FormActive2.play = async ({ canvasElement }) => {
|
|
|
400
400
|
fireEvent.scroll(chatBody, { target: { scrollTop: chatBody.clientHeight } });
|
|
401
401
|
};
|
|
402
402
|
|
|
403
|
+
export const FormActive3 = Template.bind({});
|
|
404
|
+
FormActive3.parameters = {
|
|
405
|
+
...defaultParameters,
|
|
406
|
+
initialStateModifier: {
|
|
407
|
+
...defaultParameters.initialStateModifier,
|
|
408
|
+
messages: {
|
|
409
|
+
chatMessages: [
|
|
410
|
+
{
|
|
411
|
+
chat_source: 'web',
|
|
412
|
+
chat_language_code: 'en',
|
|
413
|
+
from_bot: true,
|
|
414
|
+
sender: 'BOT',
|
|
415
|
+
message: '',
|
|
416
|
+
message_format: 'txt',
|
|
417
|
+
buttons: [],
|
|
418
|
+
created: '2022-06-15T19:03:46.186495Z',
|
|
419
|
+
id: '1',
|
|
420
|
+
form: {
|
|
421
|
+
submission_id: 'submissionId',
|
|
422
|
+
id: 'formId',
|
|
423
|
+
dialogue_id: '2',
|
|
424
|
+
submit_dialogue_id: 'c0d685d3-3f11-41b8-9cfd-e35d54df2c95',
|
|
425
|
+
abandon_dialogue_id: 'b1cde0f3-0715-48eb-8482-a9355fa11ba8',
|
|
426
|
+
languageCode: 'en',
|
|
427
|
+
texts: {
|
|
428
|
+
title: 'This is a form',
|
|
429
|
+
error_text: 'There was an error around here',
|
|
430
|
+
submit_button_text: 'Submit',
|
|
431
|
+
cancel_button_text: 'Exit',
|
|
432
|
+
unanswered_text: 'You failed to answer this form',
|
|
433
|
+
cancel_text: 'You have cancelled/exited this form',
|
|
434
|
+
},
|
|
435
|
+
fields: [
|
|
436
|
+
{
|
|
437
|
+
input_type: FIELDS.RADIO,
|
|
438
|
+
order: 1,
|
|
439
|
+
required: true,
|
|
440
|
+
slug: 'radui-icecream-option',
|
|
441
|
+
attributes: {
|
|
442
|
+
options: [
|
|
443
|
+
{
|
|
444
|
+
value: 'chocolate',
|
|
445
|
+
label: 'Chocolate',
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
value: 'vanilla',
|
|
449
|
+
label: 'Vanilla',
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
},
|
|
453
|
+
texts: {
|
|
454
|
+
label: 'Please select an icecream flavour.',
|
|
455
|
+
},
|
|
456
|
+
validators: [],
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
input_type: FIELDS.RADIO,
|
|
460
|
+
order: 2,
|
|
461
|
+
required: true,
|
|
462
|
+
slug: 'radui-payment-method',
|
|
463
|
+
attributes: {
|
|
464
|
+
options: [
|
|
465
|
+
{
|
|
466
|
+
value: 'paypal',
|
|
467
|
+
label: 'Paypal',
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
value: 'Debit',
|
|
471
|
+
label: 'Debit',
|
|
472
|
+
},
|
|
473
|
+
],
|
|
474
|
+
},
|
|
475
|
+
texts: {
|
|
476
|
+
label: 'Please select a way to pay.',
|
|
477
|
+
},
|
|
478
|
+
validators: [],
|
|
479
|
+
},
|
|
480
|
+
],
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
],
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
};
|
|
487
|
+
FormActive3.play = async ({ canvasElement }) => {
|
|
488
|
+
await within(canvasElement).findByText('Submit', undefined, { timeout: 5000 });
|
|
489
|
+
await fireEvent(await within(canvasElement).getByRole('button', { name: /submit/i }), new MouseEvent('click'));
|
|
490
|
+
|
|
491
|
+
const checkboxTerms = await within(canvasElement).findByLabelText('Debit');
|
|
492
|
+
await userEvent.click(checkboxTerms);
|
|
493
|
+
|
|
494
|
+
const chatBody = await within(canvasElement).findByTestId('chat-body-container');
|
|
495
|
+
await wait(300); // wait for the autoscroll to finish, so we can bottom for the Chromatic snapshot
|
|
496
|
+
fireEvent.scroll(chatBody, { target: { scrollTop: chatBody.clientHeight } });
|
|
497
|
+
};
|
|
498
|
+
|
|
403
499
|
export const FormWithoutTitle = Template.bind({});
|
|
404
500
|
FormWithoutTitle.parameters = {
|
|
405
501
|
...defaultParameters,
|
|
@@ -178,6 +178,24 @@ Maintenance.parameters = {
|
|
|
178
178
|
},
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
+
export const Announcement = Template.bind({});
|
|
182
|
+
Announcement.parameters = {
|
|
183
|
+
botSettings: defaultBotSettings,
|
|
184
|
+
initialStateModifier: {
|
|
185
|
+
chatbubble: {
|
|
186
|
+
active: true,
|
|
187
|
+
chatHasStarted: true,
|
|
188
|
+
currentLanguage: 'en',
|
|
189
|
+
},
|
|
190
|
+
announcement: {
|
|
191
|
+
show: true,
|
|
192
|
+
text: 'Maintenance mode!',
|
|
193
|
+
url: 'https://example.com',
|
|
194
|
+
type: 'WARNING',
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
|
|
181
199
|
export const HiddenInput = Template.bind({});
|
|
182
200
|
HiddenInput.parameters = {
|
|
183
201
|
botSettings: defaultBotSettings,
|