@plusscommunities/pluss-core-web 1.4.29 → 1.4.31
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/dist/index.cjs.js +71 -700
- package/dist/index.esm.js +71 -701
- package/dist/index.umd.js +71 -700
- package/package.json +2 -2
- package/src/components/HubSidebar.js +21 -0
- package/src/components/ImageInput.js +25 -22
- package/src/helper/HelpDeskWidget.js +6 -42
- package/src/helper/helper.js +0 -688
- package/src/index.js +2 -1
- package/src/urls.js +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-core-web",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.31",
|
|
4
4
|
"description": "Core extension package for Pluss Communities platform",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"lodash": "^4.17.4",
|
|
38
38
|
"moment": "^2.18.1",
|
|
39
39
|
"react": "^16.14.0",
|
|
40
|
-
"react-dropzone": "^14.2.
|
|
40
|
+
"react-dropzone": "^14.2.3",
|
|
41
41
|
"react-fontawesome": "^1.6.1",
|
|
42
42
|
"react-redux": "^5.0.6",
|
|
43
43
|
"react-router-dom": "^4.2.2",
|
|
@@ -86,6 +86,24 @@ class HubSidebar extends PureComponent {
|
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
renderHelpGuide = () => {
|
|
90
|
+
if (!this.props.helpGuide) return null
|
|
91
|
+
|
|
92
|
+
const { text, url } = this.props.helpGuide
|
|
93
|
+
|
|
94
|
+
const onHelpGuidePress = () => {
|
|
95
|
+
if (!url) return
|
|
96
|
+
window.open(url, '_blank')
|
|
97
|
+
}
|
|
98
|
+
return (
|
|
99
|
+
<div className="hubSidebar_helpGuideContainer">
|
|
100
|
+
<Button buttonType="outlined" isActive leftIcon="info-circle" narrow onClick={onHelpGuidePress}>
|
|
101
|
+
{text || 'Help Guide'}
|
|
102
|
+
</Button>
|
|
103
|
+
</div>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
89
107
|
render() {
|
|
90
108
|
return (
|
|
91
109
|
<div
|
|
@@ -99,6 +117,9 @@ class HubSidebar extends PureComponent {
|
|
|
99
117
|
return this.renderSection(section, i);
|
|
100
118
|
})}
|
|
101
119
|
</div>
|
|
120
|
+
|
|
121
|
+
{/* Help Guide Button. */}
|
|
122
|
+
{this.renderHelpGuide()}
|
|
102
123
|
</div>
|
|
103
124
|
);
|
|
104
125
|
}
|
|
@@ -535,13 +535,18 @@ class ImageInputComponent extends Component {
|
|
|
535
535
|
}}
|
|
536
536
|
>
|
|
537
537
|
<Dropzone disabled={this.props.disabled} accept={this.getAccept()} onDrop={(files) => this.onDrop(files, true)}>
|
|
538
|
-
{(
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
538
|
+
{(state) => {
|
|
539
|
+
const { getRootProps, getInputProps } = state;
|
|
540
|
+
|
|
541
|
+
return (
|
|
542
|
+
<div className="imageInput_buttonContainer-simple" {...getRootProps()}>
|
|
543
|
+
<input {...getInputProps()} />
|
|
544
|
+
<Button buttonType="secondary" className="imageInput_button imageInput_button-simple" disabled>
|
|
545
|
+
Change image
|
|
546
|
+
</Button>
|
|
547
|
+
</div>
|
|
548
|
+
);
|
|
549
|
+
}}
|
|
545
550
|
</Dropzone>
|
|
546
551
|
</div>
|
|
547
552
|
</div>
|
|
@@ -582,9 +587,11 @@ class ImageInputComponent extends Component {
|
|
|
582
587
|
return (
|
|
583
588
|
<div key={index} className={this.getClassNames(input, inputsLength)} style={{ ...this.props.style }}>
|
|
584
589
|
<Dropzone disabled={this.props.disabled} accept={this.getAccept()} onDrop={this.onDrop}>
|
|
585
|
-
{(
|
|
590
|
+
{(state) => {
|
|
591
|
+
const { getRootProps, getInputProps, isDragActive } = state;
|
|
586
592
|
return (
|
|
587
593
|
<div style={{ ...this.props.style }} className={`imageInput_upload ${this.getErrorState()}`} {...getRootProps()}>
|
|
594
|
+
<input {...getInputProps()} />
|
|
588
595
|
<div
|
|
589
596
|
className={`${isDragActive ? 'imageInput_dropZoneActive' : ''} ${
|
|
590
597
|
this.props.horizontalText ? ' imageInput_horizontalText' : ''
|
|
@@ -805,9 +812,11 @@ class ImageInputComponent extends Component {
|
|
|
805
812
|
<div>
|
|
806
813
|
{this.canAddImageToLibrary() && (
|
|
807
814
|
<Dropzone disabled={this.props.disabled} accept={this.getAccept()} onDrop={(files) => this.onDrop(files, true)}>
|
|
808
|
-
{(
|
|
815
|
+
{(state) => {
|
|
816
|
+
const { getRootProps, getInputProps, isDragActive } = state;
|
|
809
817
|
return (
|
|
810
818
|
<div style={{ padding: '15px' }} className={`imageInput_upload folder ${this.getErrorState()}`} {...getRootProps()}>
|
|
819
|
+
<input {...getInputProps()} />
|
|
811
820
|
<div className={isDragActive ? 'imageInput_dropZoneActive' : ''}>
|
|
812
821
|
<img
|
|
813
822
|
src="https://s3-ap-southeast-2.amazonaws.com/pluss60-dev-media/pluss/document.svg"
|
|
@@ -899,23 +908,17 @@ class ImageInputComponent extends Component {
|
|
|
899
908
|
return (
|
|
900
909
|
<div className="imageInputRight">
|
|
901
910
|
<Dropzone disabled={this.props.disabled} accept={this.getAccept()} onDrop={(files) => this.onDrop(files, true)}>
|
|
902
|
-
{(
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
<
|
|
906
|
-
</div>
|
|
907
|
-
)}
|
|
908
|
-
</Dropzone>
|
|
909
|
-
{/* <Dropzone onDrop={(files) => this.onDrop(files, true)}>{({ getRootProps, getInputProps }) => (
|
|
910
|
-
<div {...getRootProps({ disabled: this.props.disabled, accept: this.getAccept(), className: 'imageInputRight_button' })}>
|
|
911
|
-
<div className="imageInputRight_button">
|
|
911
|
+
{(state) => {
|
|
912
|
+
const { getRootProps, getInputProps } = state;
|
|
913
|
+
return (
|
|
914
|
+
<div {...getRootProps()} className="imageInputRight_button">
|
|
912
915
|
<input {...getInputProps()} />
|
|
913
916
|
<FontAwesome className="imageInputRight_button_icon" name="plus-circle" />
|
|
914
917
|
<p className="imageInputRight_button_text">Upload File</p>
|
|
915
918
|
</div>
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
</Dropzone>
|
|
919
|
+
);
|
|
920
|
+
}}
|
|
921
|
+
</Dropzone>
|
|
919
922
|
<div
|
|
920
923
|
className="imageInputRight_button"
|
|
921
924
|
onClick={() => {
|
|
@@ -1,52 +1,16 @@
|
|
|
1
1
|
import Config from '../config';
|
|
2
2
|
|
|
3
|
+
// deprecated
|
|
3
4
|
export const setChatUser = (auth) => {
|
|
4
|
-
|
|
5
|
-
setTimeout(() => {
|
|
6
|
-
setChatUser(auth);
|
|
7
|
-
}, 1000);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (!auth.user) {
|
|
11
|
-
return (
|
|
12
|
-
window.tidioChatApi &&
|
|
13
|
-
window.tidioChatApi.setVisitorData({
|
|
14
|
-
name: undefined,
|
|
15
|
-
email: undefined,
|
|
16
|
-
phone: undefined,
|
|
17
|
-
site: undefined,
|
|
18
|
-
company: Config.env.clientName,
|
|
19
|
-
distinct_id: undefined,
|
|
20
|
-
})
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
return (
|
|
24
|
-
window.tidioChatApi &&
|
|
25
|
-
window.tidioChatApi.setVisitorData({
|
|
26
|
-
name: `${auth.user.displayName} - ${Config.env.clientName} ${auth.site}`,
|
|
27
|
-
email: auth.user.email,
|
|
28
|
-
phone: auth.user.phoneNumber,
|
|
29
|
-
site: auth.site,
|
|
30
|
-
userType: auth.auth,
|
|
31
|
-
company: Config.env.clientName,
|
|
32
|
-
distinct_id: auth.user.Id,
|
|
33
|
-
})
|
|
34
|
-
);
|
|
5
|
+
return;
|
|
35
6
|
};
|
|
36
7
|
|
|
8
|
+
// deprecated
|
|
37
9
|
export const openChat = () => {
|
|
38
|
-
|
|
39
|
-
window.tidioChatApi.open();
|
|
10
|
+
return;
|
|
40
11
|
};
|
|
41
12
|
|
|
13
|
+
// deprecated
|
|
42
14
|
export const hideChat = () => {
|
|
43
|
-
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
window.tidioChatApi.display(false);
|
|
46
|
-
}, 1000);
|
|
47
|
-
} else {
|
|
48
|
-
setTimeout(() => {
|
|
49
|
-
hideChat();
|
|
50
|
-
}, 1000);
|
|
51
|
-
}
|
|
15
|
+
return;
|
|
52
16
|
};
|