@selfcommunity/react-ui 0.4.2-alpha.1 → 0.5.0-alpha.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/lib/cjs/components/AccountRecover/AccountRecover.d.ts +3 -4
- package/lib/cjs/components/AccountRecover/AccountRecover.d.ts.map +1 -1
- package/lib/cjs/components/AccountRecover/AccountRecover.js +16 -6
- package/lib/cjs/components/AccountRecover/AccountRecover.js.map +1 -1
- package/lib/cjs/components/{AccountSignUp/AccountSignUp.d.ts → AccountReset/AccountReset.d.ts} +13 -10
- package/lib/cjs/components/AccountReset/AccountReset.d.ts.map +1 -0
- package/lib/cjs/components/{AccountSignUp/AccountSignUp.js → AccountReset/AccountReset.js} +35 -29
- package/lib/cjs/components/AccountReset/AccountReset.js.map +1 -0
- package/lib/cjs/components/AccountReset/index.d.ts +4 -0
- package/lib/cjs/components/AccountReset/index.d.ts.map +1 -0
- package/lib/cjs/components/{AccountSignUp → AccountReset}/index.js +2 -2
- package/lib/cjs/components/AccountReset/index.js.map +1 -0
- package/lib/cjs/components/AccountVerify/AccountVerify.d.ts +46 -0
- package/lib/cjs/components/AccountVerify/AccountVerify.d.ts.map +1 -0
- package/lib/cjs/components/AccountVerify/AccountVerify.js +119 -0
- package/lib/cjs/components/AccountVerify/AccountVerify.js.map +1 -0
- package/lib/cjs/components/AccountVerify/index.d.ts +4 -0
- package/lib/cjs/components/{AccountSignIn → AccountVerify}/index.d.ts.map +1 -1
- package/lib/cjs/components/{AccountSignIn → AccountVerify}/index.js +2 -2
- package/lib/cjs/components/AccountVerify/index.js.map +1 -0
- package/lib/cjs/index.d.ts +9 -9
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +10 -10
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/shared/PasswordTextField/index.js +1 -1
- package/lib/cjs/shared/PasswordTextField/index.js.map +1 -1
- package/lib/esm/components/AccountRecover/AccountRecover.d.ts +3 -4
- package/lib/esm/components/AccountRecover/AccountRecover.d.ts.map +1 -1
- package/lib/esm/components/AccountRecover/AccountRecover.js +17 -7
- package/lib/esm/components/AccountRecover/AccountRecover.js.map +1 -1
- package/lib/esm/components/{AccountSignUp/AccountSignUp.d.ts → AccountReset/AccountReset.d.ts} +13 -10
- package/lib/esm/components/AccountReset/AccountReset.d.ts.map +1 -0
- package/lib/esm/components/{AccountSignUp/AccountSignUp.js → AccountReset/AccountReset.js} +35 -29
- package/lib/esm/components/AccountReset/AccountReset.js.map +1 -0
- package/lib/esm/components/AccountReset/index.d.ts +4 -0
- package/lib/esm/components/AccountReset/index.d.ts.map +1 -0
- package/lib/esm/components/AccountReset/index.js +3 -0
- package/lib/esm/components/AccountReset/index.js.map +1 -0
- package/lib/esm/components/AccountVerify/AccountVerify.d.ts +46 -0
- package/lib/esm/components/AccountVerify/AccountVerify.d.ts.map +1 -0
- package/lib/esm/components/AccountVerify/AccountVerify.js +90 -0
- package/lib/esm/components/AccountVerify/AccountVerify.js.map +1 -0
- package/lib/esm/components/AccountVerify/index.d.ts +4 -0
- package/lib/{cjs/components/AccountSignUp → esm/components/AccountVerify}/index.d.ts.map +1 -1
- package/lib/esm/components/AccountVerify/index.js +3 -0
- package/lib/esm/components/AccountVerify/index.js.map +1 -0
- package/lib/esm/index.d.ts +9 -9
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +7 -7
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/shared/PasswordTextField/index.js +1 -1
- package/lib/esm/shared/PasswordTextField/index.js.map +1 -1
- package/lib/umd/react-ui.js +16 -16
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +7 -7
- package/lib/cjs/components/AccountSignIn/AccountSignIn.d.ts +0 -64
- package/lib/cjs/components/AccountSignIn/AccountSignIn.d.ts.map +0 -1
- package/lib/cjs/components/AccountSignIn/AccountSignIn.js +0 -151
- package/lib/cjs/components/AccountSignIn/AccountSignIn.js.map +0 -1
- package/lib/cjs/components/AccountSignIn/index.d.ts +0 -4
- package/lib/cjs/components/AccountSignIn/index.js.map +0 -1
- package/lib/cjs/components/AccountSignUp/AccountSignUp.d.ts.map +0 -1
- package/lib/cjs/components/AccountSignUp/AccountSignUp.js.map +0 -1
- package/lib/cjs/components/AccountSignUp/index.d.ts +0 -4
- package/lib/cjs/components/AccountSignUp/index.js.map +0 -1
- package/lib/esm/components/AccountSignIn/AccountSignIn.d.ts +0 -64
- package/lib/esm/components/AccountSignIn/AccountSignIn.d.ts.map +0 -1
- package/lib/esm/components/AccountSignIn/AccountSignIn.js +0 -122
- package/lib/esm/components/AccountSignIn/AccountSignIn.js.map +0 -1
- package/lib/esm/components/AccountSignIn/index.d.ts +0 -4
- package/lib/esm/components/AccountSignIn/index.d.ts.map +0 -1
- package/lib/esm/components/AccountSignIn/index.js +0 -3
- package/lib/esm/components/AccountSignIn/index.js.map +0 -1
- package/lib/esm/components/AccountSignUp/AccountSignUp.d.ts.map +0 -1
- package/lib/esm/components/AccountSignUp/AccountSignUp.js.map +0 -1
- package/lib/esm/components/AccountSignUp/index.d.ts +0 -4
- package/lib/esm/components/AccountSignUp/index.d.ts.map +0 -1
- package/lib/esm/components/AccountSignUp/index.js +0 -3
- package/lib/esm/components/AccountSignUp/index.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SCUserType } from '@selfcommunity/types';
|
|
2
1
|
import { ButtonProps, TextFieldProps } from '@mui/material';
|
|
3
2
|
export interface AccountRecoverProps {
|
|
4
3
|
/**
|
|
@@ -10,7 +9,7 @@ export interface AccountRecoverProps {
|
|
|
10
9
|
* Callback triggered on success sign in
|
|
11
10
|
* @default null
|
|
12
11
|
*/
|
|
13
|
-
onSuccess?: (
|
|
12
|
+
onSuccess?: () => void;
|
|
14
13
|
/**
|
|
15
14
|
* Default props to TextField Input
|
|
16
15
|
* @default {variant: 'outlined'}
|
|
@@ -27,12 +26,12 @@ export interface AccountRecoverProps {
|
|
|
27
26
|
[p: string]: any;
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
|
-
* > API documentation for the Community-JS
|
|
29
|
+
* > API documentation for the Community-JS AccountVerify component. Learn about the available props and the CSS API.
|
|
31
30
|
|
|
32
31
|
#### Import
|
|
33
32
|
|
|
34
33
|
```jsx
|
|
35
|
-
import {
|
|
34
|
+
import {AccountVerify} from '@selfcommunity/react-ui';
|
|
36
35
|
```
|
|
37
36
|
|
|
38
37
|
#### Component Name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountRecover.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountRecover/AccountRecover.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccountRecover.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountRecover/AccountRecover.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAS,WAAW,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AA2BlE,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CA8DhF"}
|
|
@@ -45,6 +45,7 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
45
45
|
const react_intl_1 = require("react-intl");
|
|
46
46
|
const EmailTextField_1 = __importDefault(require("../../shared/EmailTextField"));
|
|
47
47
|
const system_1 = require("@mui/system");
|
|
48
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
48
49
|
const PREFIX = 'SCAccountRecover';
|
|
49
50
|
const classes = {
|
|
50
51
|
root: `${PREFIX}-root`,
|
|
@@ -63,12 +64,12 @@ const Root = (0, styles_1.styled)('form', {
|
|
|
63
64
|
}
|
|
64
65
|
}));
|
|
65
66
|
/**
|
|
66
|
-
* > API documentation for the Community-JS
|
|
67
|
+
* > API documentation for the Community-JS AccountVerify component. Learn about the available props and the CSS API.
|
|
67
68
|
|
|
68
69
|
#### Import
|
|
69
70
|
|
|
70
71
|
```jsx
|
|
71
|
-
import {
|
|
72
|
+
import {AccountVerify} from '@selfcommunity/react-ui';
|
|
72
73
|
```
|
|
73
74
|
|
|
74
75
|
#### Component Name
|
|
@@ -99,14 +100,23 @@ function AccountRecover(inProps) {
|
|
|
99
100
|
const [isSubmitting, setIsSubmitting] = (0, react_1.useState)(false);
|
|
100
101
|
// CONTEXT
|
|
101
102
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
102
|
-
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
103
103
|
// HANDLERS
|
|
104
|
+
const handleChange = (event) => {
|
|
105
|
+
setEmail(event.target.value);
|
|
106
|
+
};
|
|
104
107
|
const handleSubmit = (event) => {
|
|
105
108
|
event.preventDefault();
|
|
106
109
|
event.stopPropagation();
|
|
107
110
|
setIsSubmitting(true);
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
api_services_1.AccountService.recover({ email })
|
|
112
|
+
.then(() => onSuccess && onSuccess())
|
|
113
|
+
.catch((error) => {
|
|
114
|
+
const _error = (0, api_services_1.formatHttpError)(error);
|
|
115
|
+
if (_error.emailError) {
|
|
116
|
+
setEmailError(_error.emailError.error);
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
.then(() => setIsSubmitting(false));
|
|
110
120
|
return false;
|
|
111
121
|
};
|
|
112
122
|
if (scUserContext.user !== null) {
|
|
@@ -115,7 +125,7 @@ function AccountRecover(inProps) {
|
|
|
115
125
|
}
|
|
116
126
|
// RENDER
|
|
117
127
|
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onSubmit: handleSubmit }),
|
|
118
|
-
react_1.default.createElement(EmailTextField_1.default, Object.assign({ className: classes.email, label: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountRecover.email.label", defaultMessage: "ui.accountRecover.email.label" }) }, TextFieldProps, { value: email, onChange:
|
|
128
|
+
react_1.default.createElement(EmailTextField_1.default, Object.assign({ className: classes.email, disabled: isSubmitting, label: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountRecover.email.label", defaultMessage: "ui.accountRecover.email.label" }) }, TextFieldProps, { value: email, onChange: handleChange, error: Boolean(emailError), helperText: emailError })),
|
|
119
129
|
react_1.default.createElement(material_1.Button, Object.assign({ type: "submit" }, ButtonProps, { disabled: !email || isSubmitting }),
|
|
120
130
|
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountRecover.submit", defaultMessage: "ui.accountRecover.submit" }))));
|
|
121
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountRecover.js","sourceRoot":"","sources":["../../../../src/components/AccountRecover/AccountRecover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsC;AACtC,iDAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"AccountRecover.js","sourceRoot":"","sources":["../../../../src/components/AccountRecover/AccountRecover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsC;AACtC,iDAA4C;AAC5C,0DAAuE;AAEvE,4CAAkE;AAClE,4DAAoC;AACpC,2CAA4C;AAC5C,iFAAyD;AACzD,wCAA0C;AAC1C,8DAA8E;AAE9E,MAAM,MAAM,GAAG,kBAAkB,CAAC;AAElC,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,KAAK,EAAE,GAAG,MAAM,QAAQ;CACzB,CAAC;AA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EAAE,8BAAC,6BAAgB,IAAC,EAAE,EAAC,+BAA+B,EAAC,cAAc,EAAC,+BAA+B,GAAG,IACzG,cAAc,IAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,EAC1B,UAAU,EAAE,UAAU,IACtB;QACF,8BAAC,iBAAM,kBAAC,IAAI,EAAC,QAAQ,IAAK,WAAW,IAAE,QAAQ,EAAE,CAAC,KAAK,IAAI,YAAY;YACrE,8BAAC,6BAAgB,IAAC,EAAE,EAAC,0BAA0B,EAAC,cAAc,EAAC,0BAA0B,GAAG,CACrF,CACJ,CACR,CAAC;AACJ,CAAC;AA9DD,iCA8DC"}
|
package/lib/cjs/components/{AccountSignUp/AccountSignUp.d.ts → AccountReset/AccountReset.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SCUserType } from '@selfcommunity/types';
|
|
2
2
|
import { ButtonProps, TextFieldProps } from '@mui/material';
|
|
3
|
-
export interface
|
|
3
|
+
export interface AccountResetProps {
|
|
4
4
|
/**
|
|
5
5
|
* Overrides or extends the styles applied to the component.
|
|
6
6
|
* @default null
|
|
@@ -21,36 +21,39 @@ export interface AccountSignUpProps {
|
|
|
21
21
|
* @default {variant: 'contained'}
|
|
22
22
|
*/
|
|
23
23
|
ButtonProps?: ButtonProps;
|
|
24
|
+
/**
|
|
25
|
+
* Validation code sent by email to the user
|
|
26
|
+
* @default empty string
|
|
27
|
+
*/
|
|
28
|
+
validationCode: string;
|
|
24
29
|
/**
|
|
25
30
|
* Other props
|
|
26
31
|
*/
|
|
27
32
|
[p: string]: any;
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
30
|
-
* > API documentation for the Community-JS
|
|
35
|
+
* > API documentation for the Community-JS AccountVerify component. Learn about the available props and the CSS API.
|
|
31
36
|
|
|
32
37
|
#### Import
|
|
33
38
|
|
|
34
39
|
```jsx
|
|
35
|
-
import {
|
|
40
|
+
import {AccountVerify} from '@selfcommunity/react-ui';
|
|
36
41
|
```
|
|
37
42
|
|
|
38
43
|
#### Component Name
|
|
39
44
|
|
|
40
|
-
The name `
|
|
45
|
+
The name `SCAccountReset` can be used when providing style overrides in the theme.
|
|
41
46
|
|
|
42
47
|
|
|
43
48
|
#### CSS
|
|
44
49
|
|
|
45
50
|
|Rule Name|Global class|Description|
|
|
46
51
|
|---|---|---|
|
|
47
|
-
|root|.
|
|
48
|
-
|email|.
|
|
49
|
-
|username|.SCAccountSignUp-username|Styles applied to the username TextField.|
|
|
50
|
-
|password|.SCAccountSignUp-password|Styles applied to the password TextField.|
|
|
52
|
+
|root|.SCAccountReset-root|Styles applied to the root element.|
|
|
53
|
+
|email|.SCAccountReset-password|Styles applied to the password TextField.|
|
|
51
54
|
|
|
52
55
|
*
|
|
53
56
|
* @param inProps
|
|
54
57
|
*/
|
|
55
|
-
export default function
|
|
56
|
-
//# sourceMappingURL=
|
|
58
|
+
export default function AccountReset(inProps: AccountResetProps): JSX.Element;
|
|
59
|
+
//# sourceMappingURL=AccountReset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountReset.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountReset/AccountReset.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAS,WAAW,EAAE,cAAc,EAAa,MAAM,eAAe,CAAC;AA2B9E,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAkF5E"}
|
|
@@ -43,15 +43,12 @@ const react_core_1 = require("@selfcommunity/react-core");
|
|
|
43
43
|
const material_1 = require("@mui/material");
|
|
44
44
|
const classnames_1 = __importDefault(require("classnames"));
|
|
45
45
|
const react_intl_1 = require("react-intl");
|
|
46
|
-
const PasswordTextField_1 = __importDefault(require("../../shared/PasswordTextField"));
|
|
47
|
-
const EmailTextField_1 = __importDefault(require("../../shared/EmailTextField"));
|
|
48
|
-
const UsernameTextField_1 = __importDefault(require("../../shared/UsernameTextField"));
|
|
49
46
|
const system_1 = require("@mui/system");
|
|
50
|
-
const
|
|
47
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
48
|
+
const PasswordTextField_1 = __importDefault(require("../../shared/PasswordTextField"));
|
|
49
|
+
const PREFIX = 'SCAccountReset';
|
|
51
50
|
const classes = {
|
|
52
51
|
root: `${PREFIX}-root`,
|
|
53
|
-
email: `${PREFIX}-email`,
|
|
54
|
-
username: `${PREFIX}-username`,
|
|
55
52
|
password: `${PREFIX}-password`
|
|
56
53
|
};
|
|
57
54
|
const Root = (0, styles_1.styled)('form', {
|
|
@@ -67,54 +64,64 @@ const Root = (0, styles_1.styled)('form', {
|
|
|
67
64
|
}
|
|
68
65
|
}));
|
|
69
66
|
/**
|
|
70
|
-
* > API documentation for the Community-JS
|
|
67
|
+
* > API documentation for the Community-JS AccountVerify component. Learn about the available props and the CSS API.
|
|
71
68
|
|
|
72
69
|
#### Import
|
|
73
70
|
|
|
74
71
|
```jsx
|
|
75
|
-
import {
|
|
72
|
+
import {AccountVerify} from '@selfcommunity/react-ui';
|
|
76
73
|
```
|
|
77
74
|
|
|
78
75
|
#### Component Name
|
|
79
76
|
|
|
80
|
-
The name `
|
|
77
|
+
The name `SCAccountReset` can be used when providing style overrides in the theme.
|
|
81
78
|
|
|
82
79
|
|
|
83
80
|
#### CSS
|
|
84
81
|
|
|
85
82
|
|Rule Name|Global class|Description|
|
|
86
83
|
|---|---|---|
|
|
87
|
-
|root|.
|
|
88
|
-
|email|.
|
|
89
|
-
|username|.SCAccountSignUp-username|Styles applied to the username TextField.|
|
|
90
|
-
|password|.SCAccountSignUp-password|Styles applied to the password TextField.|
|
|
84
|
+
|root|.SCAccountReset-root|Styles applied to the root element.|
|
|
85
|
+
|email|.SCAccountReset-password|Styles applied to the password TextField.|
|
|
91
86
|
|
|
92
87
|
*
|
|
93
88
|
* @param inProps
|
|
94
89
|
*/
|
|
95
|
-
function
|
|
90
|
+
function AccountReset(inProps) {
|
|
96
91
|
const props = (0, system_1.useThemeProps)({
|
|
97
92
|
props: inProps,
|
|
98
93
|
name: PREFIX
|
|
99
94
|
});
|
|
100
95
|
// PROPS
|
|
101
|
-
const { className, onSuccess = null, TextFieldProps = { variant: 'outlined', fullWidth: true }, ButtonProps = { variant: 'contained' } } = props, rest = __rest(props, ["className", "onSuccess", "TextFieldProps", "ButtonProps"]);
|
|
96
|
+
const { className, onSuccess = null, TextFieldProps = { variant: 'outlined', fullWidth: true }, ButtonProps = { variant: 'contained' }, validationCode } = props, rest = __rest(props, ["className", "onSuccess", "TextFieldProps", "ButtonProps", "validationCode"]);
|
|
102
97
|
// STATE
|
|
103
|
-
const [email, setEmail] = (0, react_1.useState)('');
|
|
104
|
-
const [emailError, setEmailError] = (0, react_1.useState)(null);
|
|
105
|
-
const [username, setUsername] = (0, react_1.useState)('');
|
|
106
|
-
const [usernameError, setUsernameError] = (0, react_1.useState)(null);
|
|
107
98
|
const [password, setPassword] = (0, react_1.useState)('');
|
|
99
|
+
const [passwordError, setPasswordError] = (0, react_1.useState)('');
|
|
100
|
+
const [validationCodeError, setValidationCodeError] = (0, react_1.useState)('');
|
|
108
101
|
const [isSubmitting, setIsSubmitting] = (0, react_1.useState)(false);
|
|
109
102
|
// CONTEXT
|
|
110
103
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
111
104
|
// HANDLERS
|
|
105
|
+
const handleChange = (event) => {
|
|
106
|
+
setPassword(event.target.value);
|
|
107
|
+
};
|
|
112
108
|
const handleSubmit = (event) => {
|
|
113
109
|
event.preventDefault();
|
|
114
110
|
event.stopPropagation();
|
|
115
111
|
setIsSubmitting(true);
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
api_services_1.AccountService.reset({ validation_code: validationCode, password })
|
|
113
|
+
.then((res) => onSuccess && onSuccess(null))
|
|
114
|
+
.catch((error) => {
|
|
115
|
+
const _error = (0, api_services_1.formatHttpError)(error);
|
|
116
|
+
console.log(_error);
|
|
117
|
+
if (_error.passwordError) {
|
|
118
|
+
setPasswordError(_error.passwordError.error);
|
|
119
|
+
}
|
|
120
|
+
if (_error.validationCodeError) {
|
|
121
|
+
setValidationCodeError(_error.validationCodeError.error);
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
.then(() => setIsSubmitting(false));
|
|
118
125
|
return false;
|
|
119
126
|
};
|
|
120
127
|
if (scUserContext.user !== null) {
|
|
@@ -122,12 +129,11 @@ function AccountSignUp(inProps) {
|
|
|
122
129
|
return null;
|
|
123
130
|
}
|
|
124
131
|
// RENDER
|
|
125
|
-
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onSubmit: handleSubmit }),
|
|
126
|
-
react_1.default.createElement(
|
|
127
|
-
react_1.default.createElement(
|
|
128
|
-
react_1.default.createElement(
|
|
129
|
-
|
|
130
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountSignup.submit", defaultMessage: "ui.accountSignup.submit" }))));
|
|
132
|
+
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onSubmit: handleSubmit }), validationCodeError ? (react_1.default.createElement(material_1.Typography, { color: "error" },
|
|
133
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountReset.code.error", defaultMessage: "ui.accountReset.code.error" }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
134
|
+
react_1.default.createElement(PasswordTextField_1.default, Object.assign({ className: classes.password, disabled: isSubmitting, label: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountReset.password.label", defaultMessage: "ui.accountReset.password.label" }) }, TextFieldProps, { value: password, onChange: handleChange, error: Boolean(passwordError), helperText: passwordError })),
|
|
135
|
+
react_1.default.createElement(material_1.Button, Object.assign({ type: "submit" }, ButtonProps, { disabled: !password || isSubmitting }),
|
|
136
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountReset.submit", defaultMessage: "ui.accountReset.submit" }))))));
|
|
131
137
|
}
|
|
132
|
-
exports.default =
|
|
133
|
-
//# sourceMappingURL=
|
|
138
|
+
exports.default = AccountReset;
|
|
139
|
+
//# sourceMappingURL=AccountReset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountReset.js","sourceRoot":"","sources":["../../../../src/components/AccountReset/AccountReset.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsC;AACtC,iDAA4C;AAC5C,0DAAuE;AAEvE,4CAA8E;AAC9E,4DAAoC;AACpC,2CAA4C;AAC5C,wCAA0C;AAC1C,8DAA4E;AAC5E,uFAA+D;AAE/D,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAEhC,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,QAAQ,EAAE,GAAG,MAAM,WAAW;CAC/B,CAAC;AAEF,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,MAAM,EAAE;IAC1B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI;CAClD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M,IAAI,IAAE,QAAQ,EAAE,YAAY,KACnF,mBAAmB,CAAC,CAAC,CAAC,CACrB,8BAAC,qBAAU,IAAC,KAAK,EAAC,OAAO;QACvB,8BAAC,6BAAgB,IAAC,EAAE,EAAC,4BAA4B,EAAC,cAAc,EAAC,4BAA4B,GAAG,CACrF,CACd,CAAC,CAAC,CAAC,CACF;QACE,8BAAC,2BAAiB,kBAChB,SAAS,EAAE,OAAO,CAAC,QAAQ,EAC3B,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,8BAAC,6BAAgB,IAAC,EAAE,EAAC,gCAAgC,EAAC,cAAc,EAAC,gCAAgC,GAAG,IAC3G,cAAc,IAClB,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,EAC7B,UAAU,EAAE,aAAa,IACzB;QACF,8BAAC,iBAAM,kBAAC,IAAI,EAAC,QAAQ,IAAK,WAAW,IAAE,QAAQ,EAAE,CAAC,QAAQ,IAAI,YAAY;YACxE,8BAAC,6BAAgB,IAAC,EAAE,EAAC,wBAAwB,EAAC,cAAc,EAAC,wBAAwB,GAAG,CACjF,CACR,CACJ,CACI,CACR,CAAC;AACJ,CAAC;AAlFD,+BAkFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountReset/index.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAE/D,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAC,iBAAiB,EAAC,CAAC"}
|
|
@@ -3,6 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
exports.default =
|
|
6
|
+
const AccountReset_1 = __importDefault(require("./AccountReset"));
|
|
7
|
+
exports.default = AccountReset_1.default;
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/AccountReset/index.tsx"],"names":[],"mappings":";;;;;AAAA,kEAA+D;AAE/D,kBAAe,sBAAY,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AccountVerifyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Overrides or extends the styles applied to the component.
|
|
5
|
+
* @default null
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Validation code sent by email to the user
|
|
10
|
+
* @default empty string
|
|
11
|
+
*/
|
|
12
|
+
validationCode: string;
|
|
13
|
+
/**
|
|
14
|
+
* Action component to display after success message
|
|
15
|
+
* */
|
|
16
|
+
successAction?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Other props
|
|
19
|
+
*/
|
|
20
|
+
[p: string]: any;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* > API documentation for the Community-JS AccountVerify component. Learn about the available props and the CSS API.
|
|
24
|
+
|
|
25
|
+
#### Import
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
import {AccountVerify} from '@selfcommunity/react-ui';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Component Name
|
|
32
|
+
|
|
33
|
+
The name `SCAccountVerify` can be used when providing style overrides in the theme.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
#### CSS
|
|
37
|
+
|
|
38
|
+
|Rule Name|Global class|Description|
|
|
39
|
+
|---|---|---|
|
|
40
|
+
|root|.SCAccountVerify-root|Styles applied to the root element.|
|
|
41
|
+
|
|
42
|
+
*
|
|
43
|
+
* @param inProps
|
|
44
|
+
*/
|
|
45
|
+
export default function AccountVerify(inProps: AccountVerifyProps): JSX.Element;
|
|
46
|
+
//# sourceMappingURL=AccountVerify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountVerify.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountVerify/AccountVerify.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AA6BjD,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;SAEK;IACL,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEhC;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,OAAO,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAgD9E"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const styles_1 = require("@mui/material/styles");
|
|
42
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
43
|
+
const material_1 = require("@mui/material");
|
|
44
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
45
|
+
const system_1 = require("@mui/system");
|
|
46
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
47
|
+
const react_intl_1 = require("react-intl");
|
|
48
|
+
const PREFIX = 'SCAccountVerify';
|
|
49
|
+
const classes = {
|
|
50
|
+
root: `${PREFIX}-root`
|
|
51
|
+
};
|
|
52
|
+
const Root = (0, styles_1.styled)(material_1.Typography, {
|
|
53
|
+
name: PREFIX,
|
|
54
|
+
slot: 'Root',
|
|
55
|
+
overridesResolver: (props, styles) => styles.root
|
|
56
|
+
})(({ theme }) => ({
|
|
57
|
+
[`&.${classes.root}`]: {
|
|
58
|
+
display: 'flex',
|
|
59
|
+
flexDirection: 'column',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center'
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
/**
|
|
65
|
+
* > API documentation for the Community-JS AccountVerify component. Learn about the available props and the CSS API.
|
|
66
|
+
|
|
67
|
+
#### Import
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
import {AccountVerify} from '@selfcommunity/react-ui';
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### Component Name
|
|
74
|
+
|
|
75
|
+
The name `SCAccountVerify` can be used when providing style overrides in the theme.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
#### CSS
|
|
79
|
+
|
|
80
|
+
|Rule Name|Global class|Description|
|
|
81
|
+
|---|---|---|
|
|
82
|
+
|root|.SCAccountVerify-root|Styles applied to the root element.|
|
|
83
|
+
|
|
84
|
+
*
|
|
85
|
+
* @param inProps
|
|
86
|
+
*/
|
|
87
|
+
function AccountVerify(inProps) {
|
|
88
|
+
const props = (0, system_1.useThemeProps)({
|
|
89
|
+
props: inProps,
|
|
90
|
+
name: PREFIX
|
|
91
|
+
});
|
|
92
|
+
// PROPS
|
|
93
|
+
const { className, onSuccess = null, validationCode, successAction = null } = props, rest = __rest(props, ["className", "onSuccess", "validationCode", "successAction"]);
|
|
94
|
+
// STATE
|
|
95
|
+
const [isValidating, setIsValidating] = (0, react_1.useState)(true);
|
|
96
|
+
const [error, setError] = (0, react_1.useState)(false);
|
|
97
|
+
// CONTEXT
|
|
98
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
99
|
+
// EFFECTS
|
|
100
|
+
(0, react_1.useEffect)(() => {
|
|
101
|
+
setIsValidating(true);
|
|
102
|
+
setError(false);
|
|
103
|
+
api_services_1.AccountService.verify({ validation_code: validationCode })
|
|
104
|
+
.catch((error) => setError(true))
|
|
105
|
+
.then(() => setIsValidating(false));
|
|
106
|
+
}, [validationCode]);
|
|
107
|
+
if (scUserContext.user !== null) {
|
|
108
|
+
// User already logged in
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
// RENDER
|
|
112
|
+
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest), isValidating ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
113
|
+
react_1.default.createElement(material_1.CircularProgress, null),
|
|
114
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountVerify.verifying", defaultMessage: "ui.accountVerify.verifying" }))) : error ? (react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountVerify.error", defaultMessage: "ui.accountVerify.error" })) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
115
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.accountVerify.success", defaultMessage: "ui.accountVerify.success" }),
|
|
116
|
+
successAction))));
|
|
117
|
+
}
|
|
118
|
+
exports.default = AccountVerify;
|
|
119
|
+
//# sourceMappingURL=AccountVerify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountVerify.js","sourceRoot":"","sources":["../../../../src/components/AccountVerify/AccountVerify.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiD;AACjD,iDAA4C;AAC5C,0DAAuE;AAEvE,4CAA2D;AAC3D,4DAAoC;AACpC,wCAA0C;AAC1C,8DAA2D;AAC3D,2CAA4C;AAE5C,MAAM,MAAM,GAAG,iBAAiB,CAAC;AAEjC,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;CACvB,CAAC;AAEF,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,qBAAU,EAAE;IAC9B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,iBAA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AAC,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,IAAI,aAAa,CAAC,IAAI,KAAK,IAAI,EAAE;QAC/B,yBAAyB;QACzB,OAAO,IAAI,CAAC;KACb;IAED,SAAS;IACT,OAAO,CACL,8BAAC,IAAI,kBAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,IAAM,IAAI,GAC3D,YAAY,CAAC,CAAC,CAAC,CACd;QACE,8BAAC,2BAAgB,OAAG;QACpB,8BAAC,6BAAgB,IAAC,EAAE,EAAC,4BAA4B,EAAC,cAAc,EAAC,4BAA4B,GAAG,CAC/F,CACJ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CACV,8BAAC,6BAAgB,IAAC,EAAE,EAAC,wBAAwB,EAAC,cAAc,EAAC,wBAAwB,GAAG,CACzF,CAAC,CAAC,CAAC,CACF;QACE,8BAAC,6BAAgB,IAAC,EAAE,EAAC,0BAA0B,EAAC,cAAc,EAAC,0BAA0B,GAAG;QAC3F,aAAa,CACb,CACJ,CACI,CACR,CAAC;AACJ,CAAC;AAhDD,gCAgDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountVerify/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,EAAE,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAElE,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAC,kBAAkB,EAAC,CAAC"}
|
|
@@ -3,6 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
exports.default =
|
|
6
|
+
const AccountVerify_1 = __importDefault(require("./AccountVerify"));
|
|
7
|
+
exports.default = AccountVerify_1.default;
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/AccountVerify/index.tsx"],"names":[],"mappings":";;;;;AAAA,oEAAkE;AAElE,kBAAe,uBAAa,CAAC"}
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import Composer, { ComposerProps, ComposerSkeleton } from './components/Composer
|
|
|
14
14
|
import { COMPOSER_TYPE_DISCUSSION, COMPOSER_TYPE_POST } from './constants/Composer';
|
|
15
15
|
import Editor, { EditorProps, EditorSkeleton } from './components/Editor';
|
|
16
16
|
import User, { UserProps, UserSkeleton } from './components/User';
|
|
17
|
-
import Feed, {
|
|
17
|
+
import Feed, { FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton } from './components/Feed';
|
|
18
18
|
import FeedObject, { FeedObjectProps, FeedObjectSkeleton } from './components/FeedObject';
|
|
19
19
|
import FeedUpdates, { FeedUpdatesProps, FeedUpdatesSkeleton } from './components/FeedUpdates';
|
|
20
20
|
import FollowCategoryButton, { FollowCategoryButtonProps } from './components/FollowCategoryButton';
|
|
@@ -39,20 +39,20 @@ import CommentsObject, { CommentsObjectProps, CommentsObjectSkeleton } from './c
|
|
|
39
39
|
import CommentsFeedObject, { CommentsFeedObjectProps, CommentsFeedObjectSkeleton } from './components/CommentsFeedObject';
|
|
40
40
|
import ReplyComment from './components/CommentObject/ReplyComment';
|
|
41
41
|
import CustomAdv, { CustomAdvProps, CustomAdvSkeleton } from './components/CustomAdv';
|
|
42
|
-
import {
|
|
42
|
+
import { AvatarGroupSkeleton, GenericSkeleton } from './components/Skeleton';
|
|
43
43
|
import Message, { MessageProps, MessageSkeleton } from './components/Message';
|
|
44
44
|
import MessageEditor, { MessageEditorProps, MessageEditorSkeleton } from './components/MessageEditor';
|
|
45
45
|
import Thread, { ThreadProps, ThreadSkeleton } from './components/Thread';
|
|
46
46
|
import ToastNotifications, { ToastNotificationsProps, ToastNotificationsSkeleton } from './components/ToastNotifications';
|
|
47
47
|
import SnippetNotifications, { SnippetNotificationsProps, SnippetNotificationsSkeleton } from './components/SnippetNotifications';
|
|
48
48
|
import Notification, { NotificationProps, NotificationSkeleton } from './components/Notification';
|
|
49
|
-
import AccountSignIn, { AccountSignInProps } from './components/AccountSignIn';
|
|
50
|
-
import AccountSignUp, { AccountSignUpProps } from './components/AccountSignUp';
|
|
51
49
|
import AccountRecover, { AccountRecoverProps } from './components/AccountRecover';
|
|
52
|
-
import
|
|
50
|
+
import AccountReset, { AccountResetProps } from './components/AccountReset';
|
|
51
|
+
import AccountVerify, { AccountVerifyProps } from './components/AccountVerify';
|
|
52
|
+
import { SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType } from './types';
|
|
53
53
|
import Widget from './components/Widget';
|
|
54
54
|
import MediaChunkUploader, { MediaChunkUploaderProps } from './shared/MediaChunkUploader';
|
|
55
|
-
import { Document, Image, Link, Share
|
|
55
|
+
import { Document, EditMediaProps, Image, Link, Share } from './shared/Media';
|
|
56
56
|
import { MEDIA_TYPE_EMBED } from './constants/Media';
|
|
57
57
|
import PollSuggestion, { PollSuggestionProps } from './components/PollSuggestion';
|
|
58
58
|
import Incubator, { IncubatorProps } from './components/Incubator';
|
|
@@ -61,8 +61,8 @@ import IncubatorDetail, { IncubatorDetailProps } from './components/IncubatorDet
|
|
|
61
61
|
import IncubatorSuggestion, { IncubatorSuggestionProps } from './components/IncubatorSuggestion';
|
|
62
62
|
import Footer, { FooterProps } from './components/Footer';
|
|
63
63
|
import Header, { HeaderProps } from './components/Header';
|
|
64
|
-
import { FACEBOOK_SHARE,
|
|
65
|
-
import { DEFAULT_PRELOAD_OFFSET_VIEWPORT,
|
|
64
|
+
import { FACEBOOK_SHARE, LINKEDIN_SHARE, TWITTER_SHARE } from './constants/SocialShare';
|
|
65
|
+
import { DEFAULT_PRELOAD_OFFSET_VIEWPORT, MAX_PRELOAD_OFFSET_VIEWPORT, MIN_PRELOAD_OFFSET_VIEWPORT } from './constants/LazyLoad';
|
|
66
66
|
/**
|
|
67
67
|
* Utilities:
|
|
68
68
|
* contribute
|
|
@@ -71,5 +71,5 @@ import * as ContributionUtils from './utils/contribution';
|
|
|
71
71
|
/**
|
|
72
72
|
* List all exports
|
|
73
73
|
*/
|
|
74
|
-
export {
|
|
74
|
+
export { AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, Category, CategoryProps, CategorySkeleton, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoriesFollowed, CategoriesFollowedSkeleton, CategoriesPopular, CategoriesPopularSkeleton, CategoriesSuggestion, CategoriesListProps, CategoriesSuggestionSkeleton, ChangeCover, ChangePicture, ChangePictureProps, ChangeCoverProps, Composer, COMPOSER_TYPE_DISCUSSION, COMPOSER_TYPE_POST, ComposerProps, ComposerSkeleton, Editor, EditorProps, EditorSkeleton, FriendshipUserButton, FriendshipButtonProps, Feed, FeedRef, FeedProps, FeedSidebarProps, FeedSkeleton, FollowCategoryButton, FollowCategoryButtonProps, FollowUserButton, FollowUserButtonProps, ConnectionUserButton, FeedObject, FeedObjectProps, FeedObjectSkeleton, FeedUpdates, FeedUpdatesProps, FeedUpdatesSkeleton, GenericSkeleton, AvatarGroupSkeleton, CommentObject, CommentsObject, CommentsObjectProps, CommentObjectProps, CommentsObjectSkeleton, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, ReplyComment, InlineComposer, InlineComposerProps, InlineComposerSkeleton, Notification, NotificationProps, NotificationSkeleton, PeopleSuggestion, PeopleSuggestionProps, PeopleSuggestionSkeleton, Platform, PlatformProps, PlatformSkeleton, LoyaltyProgram, LoyaltyProgramProps, LoyaltyProgramSkeleton, LoyaltyProgramDetail, LoyaltyProgramDetailSkeleton, LoyaltyProgramDetailProps, TrendingFeed, TrendingFeedProps, TrendingFeedSkeleton, TrendingPeople, TrendingPeopleProps, TrendingPeopleSkeleton, RelatedFeedObjects, RelatedFeedObjectsProps, RelatedFeedObjectsSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProfileInfo, UserProfileInfoProps, UserProfileInfoSkeleton, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UsersFollowed, UsersFollowedProps, UsersFollowedSkeleton, UserFollowers, UserFollowersProps, UserFollowersSkeleton, CustomAdv, CustomAdvProps, CustomAdvSkeleton, User, UserProps, UserSkeleton, Thread, ThreadProps, ThreadSkeleton, Message, MessageProps, MessageEditor, MessageEditorProps, MessageEditorSkeleton, Snippets, SnippetsProps, SnippetsSkeleton, MessageSkeleton, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, Widget, SCFeedWidgetType, SCFeedObjectTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCMediaObjectType, SCMediaChunkType, SCNotificationObjectTemplateType, SCBroadcastMessageTemplateType, MediaChunkUploader, MediaChunkUploaderProps, Document, Image, Link, Share, EditMediaProps, MEDIA_TYPE_EMBED, FACEBOOK_SHARE, TWITTER_SHARE, LINKEDIN_SHARE, DEFAULT_PRELOAD_OFFSET_VIEWPORT, MIN_PRELOAD_OFFSET_VIEWPORT, MAX_PRELOAD_OFFSET_VIEWPORT, PollSuggestion, PollSuggestionProps, Incubator, IncubatorProps, IncubatorsList, IncubatorsListProps, IncubatorDetail, IncubatorDetailProps, IncubatorSuggestion, IncubatorSuggestionProps, ContributionUtils, Footer, FooterProps, Header, HeaderProps };
|
|
75
75
|
//# sourceMappingURL=index.d.ts.map
|