@kindly/react-chat 2.42.1 → 2.44.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/.storybook/main.js +1 -30
- package/.storybook/preview.js +16 -6
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +28 -13
- package/dist/index.js.map +1 -1
- package/package.json +46 -33
- package/stories/assets/settingsJson.js +19 -7
- package/stories/screens.stories/Chat/Composer.stories.jsx +174 -0
- package/stories/screens.stories/Chat/Notifications.stories.jsx +184 -0
- package/stories/screens.stories/Chat/TypingIndicator.stories.jsx +143 -0
- package/stories/screens.stories/Chat/index.stories.jsx +65 -44
- package/stories/screens.stories/Options.stories.jsx +4 -9
package/.storybook/main.js
CHANGED
|
@@ -33,38 +33,9 @@ module.exports = {
|
|
|
33
33
|
},
|
|
34
34
|
/* Modify the default storybook webpack config to our needs */
|
|
35
35
|
webpackFinal: (config) => {
|
|
36
|
-
// Support SVG imports. Ref: https://github.com/storybookjs/storybook/issues/6188#issuecomment-940081810
|
|
37
|
-
const fileLoaderRule = config.module.rules.find((rule) => !Array.isArray(rule.test) && rule.test.test('.svg'));
|
|
38
|
-
fileLoaderRule.exclude = /\.svg$/;
|
|
39
36
|
return {
|
|
40
37
|
...config,
|
|
41
|
-
|
|
42
|
-
...config.module,
|
|
43
|
-
rules: [
|
|
44
|
-
...config.module.rules,
|
|
45
|
-
{
|
|
46
|
-
test: /\.svg$/,
|
|
47
|
-
use: [
|
|
48
|
-
{
|
|
49
|
-
loader: 'babel-loader',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
loader: 'react-svg-loader',
|
|
53
|
-
options: {
|
|
54
|
-
jsx: true,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
resolve: {
|
|
62
|
-
...config.resolve,
|
|
63
|
-
alias: {
|
|
64
|
-
...config.resolve.alias,
|
|
65
|
-
app: path.resolve(__dirname, '../src'),
|
|
66
|
-
},
|
|
67
|
-
},
|
|
38
|
+
resolve: { ...config.resolve, alias: { ...config.resolve.alias, app: path.resolve(__dirname, '../src') } },
|
|
68
39
|
plugins: [
|
|
69
40
|
...config.plugins,
|
|
70
41
|
new webpack.EnvironmentPlugin({
|
package/.storybook/preview.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { fontFace } from 'app/styles/fonts';
|
|
2
4
|
|
|
3
5
|
const viewports = {
|
|
4
6
|
smallMobile: {
|
|
@@ -44,11 +46,19 @@ function viewportsToWidthInts(...viewportArray) {
|
|
|
44
46
|
export const chromaticViewports = viewportsToWidthInts(viewports.smallMobile, viewports.tablet, viewports.smallDesktop);
|
|
45
47
|
|
|
46
48
|
export const decorators = [
|
|
47
|
-
(Story) =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
(Story) => {
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const styleTag = document.createElement('style');
|
|
52
|
+
const fontFaceText = document.createTextNode(fontFace);
|
|
53
|
+
styleTag.appendChild(fontFaceText);
|
|
54
|
+
document.head.appendChild(styleTag);
|
|
55
|
+
}, []);
|
|
56
|
+
return (
|
|
57
|
+
<div style={{ minHeight: 500 }}>
|
|
58
|
+
<Story />
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
},
|
|
52
62
|
];
|
|
53
63
|
|
|
54
64
|
export const parameters = {
|