@kindly/react-chat 2.36.0 → 2.36.1

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.
@@ -0,0 +1,72 @@
1
+ const path = require('path');
2
+ const webpack = require('webpack');
3
+
4
+ const envConfig = require('../../../config');
5
+ const envVars = envConfig['local'];
6
+
7
+ const SETTINGS_HOST = 'https://example.com/mockme';
8
+
9
+
10
+ module.exports = {
11
+ stories: [
12
+ '../src/**/*.stories.mdx',
13
+ '../src/**/*.stories.@(js|jsx|ts|tsx)',
14
+ '../stories/**/*.stories.@(js|jsx|ts|tsx)',
15
+ '../stories/**/*.stories.@(js|jsx|ts|tsx)',
16
+ ],
17
+ addons: [
18
+ '@storybook/addon-links',
19
+ '@storybook/addon-essentials',
20
+ '@storybook/addon-interactions',
21
+ 'storybook-addon-mock/register',
22
+ ],
23
+ framework: '@storybook/react',
24
+ /* Modify the default storybook webpack config to our needs */
25
+ webpackFinal: (config) => {
26
+ // Support SVG imports. Ref: https://github.com/storybookjs/storybook/issues/6188#issuecomment-940081810
27
+ const fileLoaderRule = config.module.rules.find((rule) => !Array.isArray(rule.test) && rule.test.test('.svg'));
28
+ fileLoaderRule.exclude = /\.svg$/;
29
+
30
+ return {
31
+ ...config,
32
+ module: {
33
+ ...config.module,
34
+ rules: [
35
+ ...config.module.rules,
36
+ {
37
+ test: /\.svg$/,
38
+ use: [
39
+ {
40
+ loader: 'babel-loader',
41
+ },
42
+ {
43
+ loader: 'react-svg-loader',
44
+ options: {
45
+ jsx: true,
46
+ },
47
+ },
48
+ ],
49
+ },
50
+ ],
51
+ },
52
+ resolve: {
53
+ ...config.resolve,
54
+ alias: {
55
+ ...config.resolve.alias,
56
+ app: path.resolve(__dirname, '../src'),
57
+ },
58
+ },
59
+ plugins: [
60
+ ...config.plugins,
61
+ new webpack.EnvironmentPlugin({
62
+ ...envVars,
63
+ KINDLY_CHAT_URL: 'https://localhost',
64
+ SETTINGS_HOST,
65
+ IS_STORYBOOK: true,
66
+ SAGE_DISABLED: 1,
67
+ PAT_HOST: 'https://example.com',
68
+ }),
69
+ ],
70
+ };
71
+ },
72
+ };
@@ -0,0 +1,48 @@
1
+ export const parameters = {
2
+ actions: { argTypesRegex: '^on[A-Z].*' },
3
+ controls: {
4
+ matchers: {
5
+ color: /(background|color)$/i,
6
+ date: /Date$/,
7
+ },
8
+ },
9
+ chromatic: { pauseAnimationAtEnd: true },
10
+ };
11
+
12
+ export const argTypes = {
13
+ onNudgeFormSubmit: {
14
+ table: {
15
+ disable: true,
16
+ },
17
+ },
18
+ onNudgeProductClick: {
19
+ table: {
20
+ disable: true,
21
+ },
22
+ },
23
+ onNudgeDismiss: {
24
+ table: {
25
+ disable: true,
26
+ },
27
+ },
28
+ hidden: {
29
+ table: {
30
+ disable: true,
31
+ },
32
+ },
33
+ setKindlyChatRef: {
34
+ table: {
35
+ disable: true,
36
+ },
37
+ },
38
+ botKey: {
39
+ table: {
40
+ disable: true,
41
+ },
42
+ },
43
+ options: {
44
+ table: {
45
+ disable: true,
46
+ },
47
+ },
48
+ };