@plusscommunities/pluss-core-web 1.7.3-beta.1 → 1.7.4-beta.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.
Files changed (116) hide show
  1. package/dist/components.js +37233 -474
  2. package/dist/components.js.map +1 -1
  3. package/dist/index.js +37233 -474
  4. package/dist/index.js.map +1 -1
  5. package/package.json +22 -31
  6. package/.babelrc +0 -3
  7. package/dist/index.cjs.js +0 -10388
  8. package/dist/index.esm.js +0 -10349
  9. package/dist/index.umd.js +0 -10361
  10. package/rollup.config.js +0 -57
  11. package/src/actions/AuthActions.js +0 -83
  12. package/src/actions/LocalActions.js +0 -8
  13. package/src/actions/NavActions.js +0 -8
  14. package/src/actions/ScheduledActionsActions.js +0 -8
  15. package/src/actions/TemplateActions.js +0 -15
  16. package/src/actions/UsersActions.js +0 -95
  17. package/src/actions/index.js +0 -6
  18. package/src/actions/types.js +0 -23
  19. package/src/analytics.js +0 -183
  20. package/src/apis/analyticsActions.js +0 -53
  21. package/src/apis/authActions.js +0 -58
  22. package/src/apis/fileActions.js +0 -152
  23. package/src/apis/index.js +0 -10
  24. package/src/apis/profileActions.js +0 -133
  25. package/src/apis/scheduledActionsActions.js +0 -12
  26. package/src/apis/stringActions.js +0 -25
  27. package/src/apis/templateActions.js +0 -41
  28. package/src/apis/typeActions.js +0 -186
  29. package/src/apis/userActions.js +0 -169
  30. package/src/apis/utilityActions.js +0 -35
  31. package/src/colours.js +0 -134
  32. package/src/components/AddButton.js +0 -27
  33. package/src/components/AnalyticsFilter.js +0 -115
  34. package/src/components/Attachment.js +0 -27
  35. package/src/components/AudienceIncluder.js +0 -175
  36. package/src/components/AudienceSelector.js +0 -700
  37. package/src/components/Button.js +0 -66
  38. package/src/components/CheckBox.js +0 -77
  39. package/src/components/ColourOptions.js +0 -197
  40. package/src/components/ColourPicker.js +0 -267
  41. package/src/components/Comment.js +0 -46
  42. package/src/components/CommentSection.js +0 -116
  43. package/src/components/DatePicker.js +0 -290
  44. package/src/components/DropdownInput.js +0 -223
  45. package/src/components/DurationInput.js +0 -51
  46. package/src/components/ExportCsvPopup.js +0 -222
  47. package/src/components/FileInput.js +0 -389
  48. package/src/components/GenericInput.js +0 -169
  49. package/src/components/Header.js +0 -82
  50. package/src/components/HubSidebar.js +0 -134
  51. package/src/components/ImageInput.js +0 -987
  52. package/src/components/InputGroup.js +0 -18
  53. package/src/components/MakerPopup.js +0 -310
  54. package/src/components/MoreMenu.js +0 -22
  55. package/src/components/OptionsSection.js +0 -84
  56. package/src/components/OverlayPage.js +0 -74
  57. package/src/components/OverlayPageBottomButtons.js +0 -48
  58. package/src/components/OverlayPageContents.js +0 -48
  59. package/src/components/OverlayPageSection.js +0 -38
  60. package/src/components/P60Icon.js +0 -40
  61. package/src/components/PageTitle.js +0 -13
  62. package/src/components/Popup.js +0 -104
  63. package/src/components/ProfilePic.js +0 -50
  64. package/src/components/RadioButton.js +0 -144
  65. package/src/components/Reactions.js +0 -77
  66. package/src/components/SVGIcon.js +0 -33
  67. package/src/components/SideNavItem.js +0 -98
  68. package/src/components/StatBox.js +0 -49
  69. package/src/components/StatusButton.js +0 -22
  70. package/src/components/SuccessPopup.js +0 -57
  71. package/src/components/Tabs.js +0 -56
  72. package/src/components/Tag.js +0 -62
  73. package/src/components/Text.js +0 -20
  74. package/src/components/TextFormatPopup.js +0 -54
  75. package/src/components/TimePicker.js +0 -225
  76. package/src/components/UserListing.js +0 -111
  77. package/src/components/index.js +0 -46
  78. package/src/components/svg-icons.json +0 -821
  79. package/src/config.js +0 -25
  80. package/src/helper/HelpDeskWidget.js +0 -16
  81. package/src/helper/api/getUrl.js +0 -15
  82. package/src/helper/api/getUrlParams.js +0 -9
  83. package/src/helper/api/safeReadParams.js +0 -6
  84. package/src/helper/auth/getUserFromState.js +0 -8
  85. package/src/helper/colours/getAppColourFromState.js +0 -10
  86. package/src/helper/files/canvasImageUploader.js +0 -159
  87. package/src/helper/files/generateImageName.js +0 -10
  88. package/src/helper/files/get1400.js +0 -32
  89. package/src/helper/files/getExtension.js +0 -9
  90. package/src/helper/files/getFileName.js +0 -13
  91. package/src/helper/files/getThumb300.js +0 -36
  92. package/src/helper/files/isVideo.js +0 -8
  93. package/src/helper/helper.js +0 -97
  94. package/src/helper/index.js +0 -44
  95. package/src/helper/site/getMerchantsFromState.js +0 -9
  96. package/src/helper/site/getSiteLevelFromState.js +0 -34
  97. package/src/helper/site/getSiteName.js +0 -16
  98. package/src/helper/site/getSiteNameFromRoles.js +0 -12
  99. package/src/helper/site/getSiteSettingFromState.js +0 -10
  100. package/src/helper/storage/readJSONFromStorage.js +0 -9
  101. package/src/helper/storage/readStorageWithCookie.js +0 -22
  102. package/src/helper/storage/setLocalStorage.js +0 -5
  103. package/src/helper/strings/getFirstName.js +0 -10
  104. package/src/helper/strings/htmlDecode.js +0 -4
  105. package/src/helper/strings/htmlEncode.js +0 -4
  106. package/src/helper/strings/isEmail.js +0 -11
  107. package/src/helper/strings/isUrl.js +0 -13
  108. package/src/helper/strings/onlyAlphanumeric.js +0 -8
  109. package/src/helper/strings/randomString.js +0 -10
  110. package/src/helper/strings/toParagraphed.js +0 -17
  111. package/src/index.js +0 -12
  112. package/src/reducers/ScheduledActionsReducer.js +0 -14
  113. package/src/reducers/TemplatesReducer.js +0 -29
  114. package/src/reducers/index.js +0 -7
  115. package/src/session.js +0 -289
  116. package/src/urls.js +0 -21
@@ -1,62 +0,0 @@
1
- import React, { Component } from 'react';
2
- import FontAwesome from 'react-fontawesome';
3
-
4
- class Tag extends Component {
5
- renderLeft() {
6
- if (!this.props.leftIcon) {
7
- return null;
8
- }
9
- return (
10
- <FontAwesome
11
- name={this.props.leftIcon}
12
- className={`tag_icon tag_icon-left ${this.props.leftClick ? 'tag_icon-clickable' : ''}`}
13
- style={this.props.leftIconStyle}
14
- onClick={this.props.leftClick}
15
- />
16
- );
17
- }
18
-
19
- renderRight() {
20
- if (!this.props.rightIcon) {
21
- return null;
22
- }
23
- return (
24
- <FontAwesome
25
- name={this.props.rightIcon}
26
- className={`tag_icon tag_icon-right ${this.props.rightClick ? 'tag_icon-clickable' : ''}`}
27
- style={this.props.rightIconStyle}
28
- onClick={this.props.rightClick}
29
- />
30
- );
31
- }
32
-
33
- renderText() {
34
- if (!this.props.text) {
35
- return null;
36
- }
37
- return <span className="tag_text">{this.props.text}</span>;
38
- }
39
-
40
- render() {
41
- return (
42
- <div
43
- onClick={this.props.onClick}
44
- className={`tag ${this.props.onClick ? 'tag-clickable' : ''} ${this.props.className || ''} ${
45
- this.props.leftIcon || this.props.rightIcon ? 'tag-hasIcon' : ''
46
- }`}
47
- style={this.props.style}
48
- >
49
- <div className="tag_inner">
50
- {this.renderLeft()}
51
- <div className={`tag_center ${this.props.centerClass}`}>
52
- {this.renderText()}
53
- {this.props.children}
54
- </div>
55
- {this.renderRight()}
56
- </div>
57
- </div>
58
- );
59
- }
60
- }
61
-
62
- export { Tag };
@@ -1,20 +0,0 @@
1
- import React, { Component } from 'react';
2
-
3
- class Text extends Component {
4
- getClassName() {
5
- if (this.props.className) {
6
- return ` ${this.props.className}`;
7
- }
8
- return '';
9
- }
10
-
11
- render() {
12
- return (
13
- <p {...this.props} className={`text-${this.props.type}${this.getClassName()}`} style={this.props.style}>
14
- {this.props.children}
15
- </p>
16
- );
17
- }
18
- }
19
-
20
- export { Text };
@@ -1,54 +0,0 @@
1
- import React, { Component } from 'react';
2
- import { Button } from './Button';
3
- import { COLOUR_BRANDING_MAIN } from '../colours';
4
-
5
- class TextFormatPopup extends Component {
6
- render() {
7
- if (!this.props.isOpen) {
8
- return null;
9
- }
10
- return (
11
- <div className="successPopupBackground pointer">
12
- <div className="successPopup">
13
- <p className={`successPopup_text successPopup_text-small`}>
14
- <br />
15
- <span style={{ fontWeight: 600 }}>Text formatting:</span>
16
- <br />
17
- <br />
18
- Surround text with <span style={{ fontWeight: 400 }}>**</span> to create bold text:
19
- <br />
20
- <span style={{ fontWeight: 400 }}>**</span>Some Text<span style={{ fontWeight: 400 }}>**</span> ={' '}
21
- <span style={{ fontWeight: 600 }}>Some Text</span>
22
- <br />
23
- <br />
24
- Surround text with <span style={{ fontWeight: 400 }}>*t*</span> to create a title:
25
- <br />
26
- <span style={{ fontWeight: 400 }}>*t*</span>Some Text<span style={{ fontWeight: 400 }}>*t*</span> ={' '}
27
- <span style={{ fontWeight: 600, color: COLOUR_BRANDING_MAIN, fontSize: 20 }}>Some Text</span>
28
- <br />
29
- <br />
30
- Surround text with <span style={{ fontWeight: 400 }}>*s*</span> to create a smaller title:
31
- <br />
32
- <span style={{ fontWeight: 400 }}>*s*</span>Some Text<span style={{ fontWeight: 400 }}>*s*</span> ={' '}
33
- <span style={{ fontWeight: 600, fontSize: 16 }}>Some Text</span>
34
- <br />
35
- <br />
36
- Create links with <span style={{ fontWeight: 400 }}>[website|text]</span>:
37
- <br />
38
- <span style={{ fontWeight: 400 }}>[https://example.com|Click here]</span> ={' '}
39
- <a href="https://example.com" target="_blank" rel="noopener noreferrer" style={{ fontWeight: 600, fontSize: 16 }}>
40
- Click here
41
- </a>
42
- </p>
43
- <div className="successPopup_buttons">
44
- <Button buttonClassName="successPopup_button" buttonType="primary" isActive onClick={this.props.onClose}>
45
- Close
46
- </Button>
47
- </div>
48
- </div>
49
- </div>
50
- );
51
- }
52
- }
53
-
54
- export { TextFormatPopup };
@@ -1,225 +0,0 @@
1
- import React, { Component } from "react";
2
- import moment from "moment";
3
- import _ from "lodash";
4
- import { randomString } from "../helper";
5
- import { SVGIcon } from "./SVGIcon";
6
- import { COLOUR_DUSK_LIGHT } from "../colours";
7
-
8
- class TimePicker extends Component {
9
- state = {
10
- id: randomString(),
11
- selectedTime: this.props.optional ? this.props.selectedTime : moment(),
12
- grid: [],
13
- hourInput: "",
14
- minuteInput: "",
15
- mInput: "",
16
- };
17
-
18
- UNSAFE_componentWillMount() {
19
- this.onNewProps(this.props, !this.props.optional);
20
- }
21
-
22
- UNSAFE_componentWillReceiveProps(nextProps) {
23
- this.onNewProps(nextProps);
24
- }
25
-
26
- onNewProps(nextProps, forceUpdate) {
27
- if (forceUpdate || nextProps.selectedTime !== this.props.selectedTime) {
28
- let mDate = moment(nextProps.selectedTime, "h:mma");
29
- if (!mDate.isValid()) {
30
- this.setState({
31
- selectedTime: null,
32
- hourInput: "",
33
- minuteInput: "",
34
- mInput: "",
35
- });
36
- } else {
37
- const minutesFocused =
38
- document.getElementById(`time_minute_${this.state.id}`) ===
39
- document.activeElement;
40
- this.setState({
41
- selectedTime: mDate,
42
- hourInput: mDate.format("h"),
43
- minuteInput: mDate.format(minutesFocused ? "m" : "mm"),
44
- mInput: mDate.format("a"),
45
- });
46
- }
47
- }
48
- }
49
-
50
- getDefaultTime() {
51
- const result = moment();
52
- result.hour(12);
53
- result.minute(0);
54
- result.second(0);
55
- return result;
56
- }
57
-
58
- onChangeHour(event) {
59
- let hour = 0;
60
- if (!_.isEmpty(event.target.value)) {
61
- hour = parseInt(event.target.value, 10);
62
- } else {
63
- this.setState({ ...this.state, hourInput: "" });
64
- return;
65
- }
66
- if (isNaN(hour)) {
67
- return;
68
- }
69
- hour = Math.max(Math.min(12, hour), 0);
70
- const dateToUse = this.state.selectedTime || this.getDefaultTime();
71
- const selectNext = hour > 1; // if hour is > 1, assume user is done typing and select minutes input
72
- if (dateToUse.format("a") === "pm") {
73
- hour += 12;
74
- }
75
- dateToUse.hour(hour);
76
- this.setState({
77
- selectedTime: moment(dateToUse),
78
- });
79
-
80
- this.selectTime(dateToUse);
81
-
82
- if (selectNext) {
83
- this.select(`time_minute_${this.state.id}`);
84
- }
85
- }
86
-
87
- onChangeMinute(event) {
88
- let minute = 0;
89
- if (!_.isEmpty(event.target.value)) {
90
- minute = parseInt(event.target.value, 10);
91
- } else {
92
- this.setState({ ...this.state, minuteInput: "" });
93
- return;
94
- }
95
- if (isNaN(minute)) {
96
- return;
97
- }
98
- minute = Math.max(Math.min(59, minute), 0);
99
- const dateToUse = this.state.selectedTime || this.getDefaultTime();
100
- dateToUse.minute(minute);
101
- this.setState({
102
- selectedTime: moment(dateToUse),
103
- });
104
-
105
- this.selectTime(dateToUse);
106
-
107
- if (minute >= 10 || event.target.value === "00") {
108
- this.select(`time_am_${this.state.id}`);
109
- }
110
- }
111
-
112
- onBlurMinute() {
113
- if (this.state.selectedTime) {
114
- this.setState({
115
- minuteInput: this.state.selectedTime.format("mm"),
116
- });
117
- }
118
- }
119
-
120
- onChangeM(event) {
121
- const dateToUse = this.state.selectedTime || this.getDefaultTime();
122
- if (event.target.value.toLowerCase().indexOf("a") > -1) {
123
- // am
124
- if (dateToUse.format("a") === "pm") {
125
- dateToUse.hour(dateToUse.hour() - 12);
126
- }
127
- } else {
128
- // pm
129
- if (dateToUse.format("a") === "am") {
130
- dateToUse.hour(dateToUse.hour() + 12);
131
- }
132
- }
133
- this.setState({
134
- selectedTime: moment(dateToUse),
135
- });
136
- this.selectTime(dateToUse);
137
- }
138
-
139
- selectTime(date) {
140
- this.props.selectTime(
141
- moment(date).format(this.props.callbackFormat || "h:mma"),
142
- );
143
- }
144
-
145
- onClear = () => {
146
- this.props.selectTime(undefined);
147
- };
148
-
149
- select(id) {
150
- document.getElementById(id).select();
151
- }
152
-
153
- renderClear() {
154
- if (!this.props.hasClear) return null;
155
- return (
156
- <SVGIcon
157
- colour={COLOUR_DUSK_LIGHT}
158
- icon="close"
159
- className="timepicker_clear"
160
- onClick={this.onClear}
161
- />
162
- );
163
- }
164
-
165
- render() {
166
- const { disabled } = this.props;
167
- if (disabled) {
168
- return (
169
- <div className="timepicker disabled" style={this.props.style}>
170
- <span
171
- className="timepicker__span"
172
- style={this.props.inputStyle}
173
- >{`${this.state.hourInput} : ${this.state.minuteInput} ${this.state.mInput}`}</span>
174
- </div>
175
- );
176
- }
177
- return (
178
- <div
179
- className={`timepicker ${this.props.className}`}
180
- style={this.props.style}
181
- >
182
- <input
183
- className="timepicker__input"
184
- maxLength="2"
185
- placeholder="hh"
186
- type="text"
187
- id={`time_hour_${this.state.id}`}
188
- value={this.state.hourInput}
189
- onChange={this.onChangeHour.bind(this)}
190
- onClick={this.select.bind(this, `time_hour_${this.state.id}`)}
191
- style={this.props.inputStyle}
192
- />
193
- <span className="timepicker__separator" style={this.props.inputStyle}>
194
- :
195
- </span>
196
- <input
197
- className="timepicker__input"
198
- maxLength="2"
199
- placeholder="mm"
200
- type="text"
201
- id={`time_minute_${this.state.id}`}
202
- value={this.state.minuteInput}
203
- onChange={this.onChangeMinute.bind(this)}
204
- onBlur={this.onBlurMinute.bind(this)}
205
- onClick={this.select.bind(this, `time_minute_${this.state.id}`)}
206
- style={this.props.inputStyle}
207
- />
208
- <input
209
- className="timepicker__input"
210
- maxLength="2"
211
- placeholder="pm"
212
- type="text"
213
- id={`time_am_${this.state.id}`}
214
- value={this.state.mInput}
215
- onChange={this.onChangeM.bind(this)}
216
- onClick={this.select.bind(this, `time_am_${this.state.id}`)}
217
- style={this.props.inputStyle}
218
- />
219
- {this.renderClear()}
220
- </div>
221
- );
222
- }
223
- }
224
-
225
- export { TimePicker };
@@ -1,111 +0,0 @@
1
- import React, { Component } from 'react';
2
- import { Text } from './Text';
3
- import { ProfilePic } from './ProfilePic';
4
- import { COLOUR_BRANDING_MAIN } from '../colours';
5
-
6
- class UserListing extends Component {
7
- getSize() {
8
- return this.props.size || 30;
9
- }
10
-
11
- getImage() {
12
- if (this.props.user && this.props.user.profilePic) {
13
- return this.props.user.profilePic;
14
- }
15
- if (this.props.image) {
16
- return this.props.image;
17
- }
18
- return undefined;
19
- }
20
-
21
- getKey() {
22
- if (this.props.user && this.props.user.id) {
23
- return this.props.user.id;
24
- }
25
- return this.props.id;
26
- }
27
-
28
- getText() {
29
- if (this.props.user && this.props.user.displayName) {
30
- return this.props.user.displayName;
31
- }
32
- return this.props.title;
33
- }
34
-
35
- getBorderRadius() {
36
- if (this.props.squareImage) {
37
- return 4;
38
- }
39
- return this.getSize() / 2;
40
- }
41
-
42
- isLoading() {
43
- if (this.props.user && this.props.user.loading) {
44
- return this.props.user && this.props.user.loading;
45
- }
46
- return this.props.isLoading;
47
- }
48
-
49
- renderRight() {
50
- if (!this.props.rightContent) {
51
- return null;
52
- }
53
- return this.props.rightContent;
54
- }
55
-
56
- renderSub() {
57
- if (!this.props.subContent) {
58
- return null;
59
- }
60
- return this.props.subContent;
61
- }
62
-
63
- renderImage() {
64
- if (this.props.squareImage) {
65
- return (
66
- <div
67
- style={{
68
- height: this.getSize(),
69
- width: this.getSize(),
70
- borderRadius: this.getBorderRadius(),
71
- marginRight: 8,
72
- backgroundSize: 'cover',
73
- backgroundPosition: 'center',
74
- backgroundImage: `url(${this.getImage()})`,
75
- backgroundColor: COLOUR_BRANDING_MAIN,
76
- }}
77
- alt={`${this.getText()} Image`}
78
- />
79
- );
80
- }
81
- return <ProfilePic size={this.getSize()} className="userListing_profilePic" image={this.getImage()} />;
82
- }
83
-
84
- render() {
85
- return (
86
- <div
87
- key={this.getKey()}
88
- className="userListing"
89
- style={{
90
- minHeight: this.getSize() + 5,
91
- cursor: this.props.onClick ? 'pointer' : 'inherit',
92
- opacity: this.isLoading() ? 0.5 : 1,
93
- }}
94
- onClick={this.props.onClick}
95
- >
96
- <div className="userListing_inner">
97
- {this.renderImage()}
98
- <div className="userListing_middle" style={{ height: this.getSize() }}>
99
- <Text type="name" style={this.props.whiteText ? { color: '#fff' } : null} className={this.props.textClass}>
100
- {this.getText()}
101
- </Text>
102
- {this.renderSub()}
103
- </div>
104
- </div>
105
- {this.renderRight()}
106
- </div>
107
- );
108
- }
109
- }
110
-
111
- export { UserListing };
@@ -1,46 +0,0 @@
1
- export * from './AddButton';
2
- export * from './Attachment';
3
- export * from './Button';
4
- export * from './CheckBox';
5
- export * from './Comment';
6
- export * from './CommentSection';
7
- export * from './DatePicker';
8
- export * from './DurationInput';
9
- export * from './FileInput';
10
- export * from './GenericInput';
11
- export * from './Header';
12
- export * from './HubSidebar';
13
- export * from './ImageInput';
14
- export * from './MoreMenu';
15
- export * from './OverlayPage';
16
- export * from './OverlayPageContents';
17
- export * from './OverlayPageSection';
18
- export * from './OverlayPageBottomButtons';
19
- export * from './PageTitle';
20
- export * from './Popup';
21
- export * from './P60Icon';
22
- export * from './ProfilePic';
23
- export * from './RadioButton';
24
- export * from './SVGIcon';
25
- export * from './Tag';
26
- export * from './Text';
27
- export * from './SideNavItem';
28
- export * from './StatusButton';
29
- export * from './SuccessPopup';
30
- export * from './Reactions';
31
- export * from './P60Icon';
32
- export * from './DatePicker';
33
- export * from './AnalyticsFilter';
34
- export * from './UserListing';
35
- export * from './TimePicker';
36
- export * from './AudienceSelector';
37
- export * from './TextFormatPopup';
38
- export * from './OptionsSection';
39
- export * from './DropdownInput';
40
- export * from './MakerPopup';
41
- export * from './ExportCsvPopup';
42
- export * from './InputGroup';
43
- export * from './ColourOptions';
44
- export * from './ColourPicker';
45
- export * from './StatBox';
46
- export * from './Tabs';