@performant-software/shared-components 1.0.8-beta.0 → 1.0.8-beta.2

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": "@performant-software/shared-components",
3
- "version": "1.0.8-beta.0",
3
+ "version": "1.0.8-beta.2",
4
4
  "description": "A package of shared, framework agnostic, components.",
5
5
  "license": "MIT",
6
6
  "main": "./build/index.js",
@@ -1,3 +1,5 @@
1
+ @import 'react-quill/dist/quill.snow.css';
2
+
1
3
  .rich-text-area.quill {
2
4
  width: 100%;
3
5
  }
@@ -2,7 +2,6 @@
2
2
 
3
3
  import React, { lazy } from 'react';
4
4
  import withSuspense from '../hooks/Suspense';
5
- import 'react-quill/dist/quill.snow.css';
6
5
  import './RichTextArea.css';
7
6
 
8
7
  type Props = {
@@ -13,32 +12,30 @@ type Props = {
13
12
  value: ?string
14
13
  };
15
14
 
15
+ const ReactQuill = lazy(() => import('react-quill'));
16
+
16
17
  const SEARCH_EMPTY = '<p><br></p>';
17
18
  const REPLACE_EMPTY = '';
18
19
 
19
- const RichTextArea = withSuspense((props: Props) => {
20
- const ReactQuill = lazy(() => import('react-quill'));
21
-
22
- return (
23
- <ReactQuill
24
- className='rich-text-area'
25
- formats={props.formats}
26
- modules={props.modules}
27
- onChange={(value) => {
28
- let newValue = value;
20
+ const RichTextArea = withSuspense((props: Props) => (
21
+ <ReactQuill
22
+ className='rich-text-area'
23
+ formats={props.formats}
24
+ modules={props.modules}
25
+ onChange={(value) => {
26
+ let newValue = value;
29
27
 
30
- if (value === SEARCH_EMPTY) {
31
- newValue = REPLACE_EMPTY;
32
- }
28
+ if (value === SEARCH_EMPTY) {
29
+ newValue = REPLACE_EMPTY;
30
+ }
33
31
 
34
- props.onChange(newValue);
35
- }}
36
- placeholder={props.placeholder}
37
- theme='snow'
38
- value={props.value}
39
- />
40
- );
41
- });
32
+ props.onChange(newValue);
33
+ }}
34
+ placeholder={props.placeholder}
35
+ theme='snow'
36
+ value={props.value}
37
+ />
38
+ ));
42
39
 
43
40
  RichTextArea.defaultProps = {
44
41
  formats: [
@@ -2,7 +2,6 @@
2
2
 
3
3
  import React, { lazy } from 'react';
4
4
  import withSuspense from '../hooks/Suspense';
5
- import 'react-quill/dist/quill.snow.css';
6
5
  import './RichTextArea.css';
7
6
 
8
7
  type Props = {
@@ -13,32 +12,30 @@ type Props = {
13
12
  value: ?string
14
13
  };
15
14
 
15
+ const ReactQuill = lazy(() => import('react-quill'));
16
+
16
17
  const SEARCH_EMPTY = '<p><br></p>';
17
18
  const REPLACE_EMPTY = '';
18
19
 
19
- const RichTextArea = withSuspense((props: Props) => {
20
- const ReactQuill = lazy(() => import('react-quill'));
21
-
22
- return (
23
- <ReactQuill
24
- className='rich-text-area'
25
- formats={props.formats}
26
- modules={props.modules}
27
- onChange={(value) => {
28
- let newValue = value;
20
+ const RichTextArea = withSuspense((props: Props) => (
21
+ <ReactQuill
22
+ className='rich-text-area'
23
+ formats={props.formats}
24
+ modules={props.modules}
25
+ onChange={(value) => {
26
+ let newValue = value;
29
27
 
30
- if (value === SEARCH_EMPTY) {
31
- newValue = REPLACE_EMPTY;
32
- }
28
+ if (value === SEARCH_EMPTY) {
29
+ newValue = REPLACE_EMPTY;
30
+ }
33
31
 
34
- props.onChange(newValue);
35
- }}
36
- placeholder={props.placeholder}
37
- theme='snow'
38
- value={props.value}
39
- />
40
- );
41
- });
32
+ props.onChange(newValue);
33
+ }}
34
+ placeholder={props.placeholder}
35
+ theme='snow'
36
+ value={props.value}
37
+ />
38
+ ));
42
39
 
43
40
  RichTextArea.defaultProps = {
44
41
  formats: [
package/webpack.config.js CHANGED
@@ -1,3 +1,13 @@
1
1
  const { configure } = require('@performant-software/webpack-config');
2
+ const path = require('path');
2
3
 
3
- module.exports = configure(__dirname);
4
+ module.exports = configure(__dirname, {
5
+ resolve: {
6
+ alias: {
7
+ './react-quill/dist/quill.snow.css$': path.resolve(
8
+ __dirname,
9
+ '../../node_modules/react-quill/dist/quill.snow.css'
10
+ )
11
+ }
12
+ }
13
+ });