@kindly/react-chat 2.45.0 → 2.46.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.46.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",
|
|
@@ -65,15 +65,15 @@
|
|
|
65
65
|
"@babel/plugin-transform-runtime": "^7.21.0",
|
|
66
66
|
"@babel/preset-env": "^7.20.2",
|
|
67
67
|
"@babel/preset-react": "^7.18.6",
|
|
68
|
-
"@storybook/addon-a11y": "^7.0.
|
|
69
|
-
"@storybook/addon-actions": "^7.0.
|
|
70
|
-
"@storybook/addon-essentials": "^7.0.
|
|
71
|
-
"@storybook/addon-interactions": "^7.0.
|
|
72
|
-
"@storybook/addon-links": "^7.0.
|
|
73
|
-
"@storybook/addon-mdx-gfm": "^7.0.
|
|
68
|
+
"@storybook/addon-a11y": "^7.0.20",
|
|
69
|
+
"@storybook/addon-actions": "^7.0.20",
|
|
70
|
+
"@storybook/addon-essentials": "^7.0.20",
|
|
71
|
+
"@storybook/addon-interactions": "^7.0.20",
|
|
72
|
+
"@storybook/addon-links": "^7.0.20",
|
|
73
|
+
"@storybook/addon-mdx-gfm": "^7.0.20",
|
|
74
74
|
"@storybook/jest": "^0.1.0",
|
|
75
|
-
"@storybook/react": "^7.0.
|
|
76
|
-
"@storybook/react-webpack5": "^7.0.
|
|
75
|
+
"@storybook/react": "^7.0.20",
|
|
76
|
+
"@storybook/react-webpack5": "^7.0.20",
|
|
77
77
|
"@storybook/test-runner": "^0.10.0",
|
|
78
78
|
"@storybook/testing-library": "^0.1.0",
|
|
79
79
|
"@testing-library/jest-dom": "^5.16.5",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"react-dom": "^18.2.0",
|
|
109
109
|
"react-test-renderer": "18.2.0",
|
|
110
110
|
"resolve-url-loader": "^5.0.0",
|
|
111
|
-
"storybook": "^7.0.
|
|
111
|
+
"storybook": "^7.0.20",
|
|
112
112
|
"storybook-addon-mock": "^4.0.0",
|
|
113
113
|
"url-loader": "^4.1.1",
|
|
114
114
|
"webpack": "^5.76.1",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "ad0be1ee03bb68e073ff348a07398dd15cc24e2f"
|
|
147
147
|
}
|
|
@@ -308,6 +308,17 @@ export default {
|
|
|
308
308
|
sv: 'Detta svar är genererat baserat på innehållet från vår hemsida',
|
|
309
309
|
nn: 'Dette svaret er generert basert på innhald frå nettsida vår.',
|
|
310
310
|
},
|
|
311
|
+
reference_list_title: {
|
|
312
|
+
en: 'Reference to reply',
|
|
313
|
+
nb: 'kilder',
|
|
314
|
+
sv: 'k\u00e4llor',
|
|
315
|
+
},
|
|
316
|
+
read_more_text: {
|
|
317
|
+
en: 'Read more',
|
|
318
|
+
nb: 'Les mer',
|
|
319
|
+
nn: 'Les meir',
|
|
320
|
+
sv: 'L\u00e4s mer',
|
|
321
|
+
},
|
|
311
322
|
},
|
|
312
323
|
nudges: {
|
|
313
324
|
form_nudges: [
|
|
@@ -261,7 +261,7 @@ export const MultilineBotMessage = Template.bind({});
|
|
|
261
261
|
const MESSAGES = {
|
|
262
262
|
single: 'Single-line lonely message',
|
|
263
263
|
double: "Double-line message \n\n vibin'",
|
|
264
|
-
multi: 'This is a \n\n three-multiline \n\n
|
|
264
|
+
multi: 'This is a \n\n three-multiline \n\n message',
|
|
265
265
|
};
|
|
266
266
|
MultilineBotMessage.storyName = 'Multiline Bot & User Messages';
|
|
267
267
|
MultilineBotMessage.parameters = {
|
|
@@ -631,6 +631,7 @@ ImageGallery.args = {
|
|
|
631
631
|
imageQuantity: 3,
|
|
632
632
|
hasLink: false,
|
|
633
633
|
newTab: false,
|
|
634
|
+
thonImageAboveText: false,
|
|
634
635
|
initialStateModifierFromArgs: ({
|
|
635
636
|
imageCarouselSize,
|
|
636
637
|
imageQuantity,
|
|
@@ -638,6 +639,7 @@ ImageGallery.args = {
|
|
|
638
639
|
descriptionSize,
|
|
639
640
|
hasLink,
|
|
640
641
|
newTab,
|
|
642
|
+
thonImageAboveText,
|
|
641
643
|
}) => ({
|
|
642
644
|
...defaultParameters.initialStateModifier,
|
|
643
645
|
messages: {
|
|
@@ -650,6 +652,7 @@ ImageGallery.args = {
|
|
|
650
652
|
sender: 'BOT',
|
|
651
653
|
message: 'Here is an image gallery',
|
|
652
654
|
message_format: 'txt',
|
|
655
|
+
thon_image_above_text: thonImageAboveText,
|
|
653
656
|
image_carousel: [
|
|
654
657
|
{
|
|
655
658
|
id: '1',
|
|
@@ -819,7 +822,7 @@ LeaveContactDetails.parameters = {
|
|
|
819
822
|
id: 'ae14453c-0156-40c9-a13a-0037f46bd14a',
|
|
820
823
|
contact_type: 'email',
|
|
821
824
|
label: 'Your email:',
|
|
822
|
-
edit_text: '
|
|
825
|
+
edit_text: 'Edit email',
|
|
823
826
|
placeholder: 'me@example.com',
|
|
824
827
|
},
|
|
825
828
|
},
|
|
@@ -836,4 +839,78 @@ LeaveContactDetails.play = async ({ canvasElement }) => {
|
|
|
836
839
|
LeaveContactDetails.parameters.initialStateModifier.messages.chatMessages[0].buttons[2].label,
|
|
837
840
|
);
|
|
838
841
|
await userEvent.click(LeaveContactButton);
|
|
842
|
+
const composer = await within(canvasElement).findByPlaceholderText(
|
|
843
|
+
LeaveContactDetails.parameters.initialStateModifier.messages.chatMessages[0].buttons[2].contact_details.placeholder,
|
|
844
|
+
);
|
|
845
|
+
await userEvent.type(composer, 'contact@example.com');
|
|
846
|
+
const submitButton = await within(canvasElement).getByTestId('send-contact-details-button');
|
|
847
|
+
await userEvent.click(submitButton);
|
|
848
|
+
const EditContactButton = await within(canvasElement).findByText(
|
|
849
|
+
LeaveContactDetails.parameters.initialStateModifier.messages.chatMessages[0].buttons[2].contact_details.edit_text,
|
|
850
|
+
);
|
|
851
|
+
await userEvent.click(EditContactButton);
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
export const MessageReference = Template.bind({});
|
|
855
|
+
MessageReference.parameters = {
|
|
856
|
+
botSettings: defaultBotSettings,
|
|
857
|
+
initialStateModifier: {
|
|
858
|
+
chatbubble: {
|
|
859
|
+
active: true,
|
|
860
|
+
chatHasStarted: true,
|
|
861
|
+
currentLanguage: 'en',
|
|
862
|
+
},
|
|
863
|
+
messages: {
|
|
864
|
+
chatMessages: [
|
|
865
|
+
{
|
|
866
|
+
...defaultParameters.initialStateModifier.messages.chatMessages[2],
|
|
867
|
+
message: 'Kahoot: Fun quizzes, big learning.\n\nPlay, learn, Kahoot!',
|
|
868
|
+
message_references: [{ url: 'http://example.com', offset: 19 }],
|
|
869
|
+
from_bot: true,
|
|
870
|
+
handler: 'MIMIR',
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
...defaultParameters.initialStateModifier.messages.chatMessages[1],
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
...defaultParameters.initialStateModifier.messages.chatMessages[2],
|
|
877
|
+
message:
|
|
878
|
+
"As a player in a Kahoot game, you cannot hide the answers of other players. The game is designed to display all answers on the host's screen and on individual player devices for transparency and fairness.",
|
|
879
|
+
message_references: [
|
|
880
|
+
{
|
|
881
|
+
url: 'http://example.com#1',
|
|
882
|
+
offset: 75,
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
url: 'http://example.com#2',
|
|
886
|
+
offset: 75,
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
url: 'http://example.com#3',
|
|
890
|
+
offset: 75,
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
url: 'http://example.com#2',
|
|
894
|
+
offset: 140,
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
url: 'http://example.com#4',
|
|
898
|
+
offset: 204,
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
url: 'http://example.com#1',
|
|
902
|
+
offset: 204,
|
|
903
|
+
},
|
|
904
|
+
],
|
|
905
|
+
from_bot: true,
|
|
906
|
+
handler: 'MIMIR',
|
|
907
|
+
},
|
|
908
|
+
],
|
|
909
|
+
messageSentTime: '2020-12-01T12:00:00.000Z',
|
|
910
|
+
lastMessageSeen: {
|
|
911
|
+
id: '3',
|
|
912
|
+
index: 3,
|
|
913
|
+
},
|
|
914
|
+
},
|
|
915
|
+
},
|
|
839
916
|
};
|