@selfcommunity/react-ui 0.7.0-alpha.94 → 0.7.0-alpha.96
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/PrivateMessageComponent/PrivateMessageComponent.d.ts +53 -0
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.d.ts.map +1 -0
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +463 -0
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js.map +1 -0
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +34 -0
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts.map +1 -0
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.js +54 -0
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.js.map +1 -0
- package/lib/cjs/components/PrivateMessageComponent/index.d.ts +5 -0
- package/lib/cjs/components/PrivateMessageComponent/index.d.ts.map +1 -0
- package/lib/cjs/components/PrivateMessageComponent/index.js +11 -0
- package/lib/cjs/components/PrivateMessageComponent/index.js.map +1 -0
- package/lib/cjs/components/PrivateMessageSnippetItem/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageSnippetItem/Skeleton.js +2 -1
- package/lib/cjs/components/PrivateMessageSnippetItem/Skeleton.js.map +1 -1
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js +0 -1
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js.map +1 -1
- package/lib/cjs/components/PrivateMessageSnippets/Skeleton.d.ts +2 -0
- package/lib/cjs/components/PrivateMessageSnippets/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageSnippets/Skeleton.js +8 -1
- package/lib/cjs/components/PrivateMessageSnippets/Skeleton.js.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts +25 -11
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +17 -175
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/Skeleton.js +1 -10
- package/lib/cjs/components/PrivateMessageThread/Skeleton.js.map +1 -1
- package/lib/cjs/index.d.ts +2 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +5 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +53 -0
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.d.ts.map +1 -0
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +434 -0
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js.map +1 -0
- package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +34 -0
- package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts.map +1 -0
- package/lib/esm/components/PrivateMessageComponent/Skeleton.js +48 -0
- package/lib/esm/components/PrivateMessageComponent/Skeleton.js.map +1 -0
- package/lib/esm/components/PrivateMessageComponent/index.d.ts +5 -0
- package/lib/esm/components/PrivateMessageComponent/index.d.ts.map +1 -0
- package/lib/esm/components/PrivateMessageComponent/index.js +5 -0
- package/lib/esm/components/PrivateMessageComponent/index.js.map +1 -0
- package/lib/esm/components/PrivateMessageSnippetItem/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageSnippetItem/Skeleton.js +2 -1
- package/lib/esm/components/PrivateMessageSnippetItem/Skeleton.js.map +1 -1
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js +0 -1
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js.map +1 -1
- package/lib/esm/components/PrivateMessageSnippets/Skeleton.d.ts +2 -0
- package/lib/esm/components/PrivateMessageSnippets/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageSnippets/Skeleton.js +9 -2
- package/lib/esm/components/PrivateMessageSnippets/Skeleton.js.map +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts +25 -11
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +20 -178
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js.map +1 -1
- package/lib/esm/components/PrivateMessageThread/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageThread/Skeleton.js +1 -10
- package/lib/esm/components/PrivateMessageThread/Skeleton.js.map +1 -1
- package/lib/esm/index.d.ts +2 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/umd/react-ui.js +6 -6
- package/lib/umd/react-ui.js.LICENSE.txt +2 -2
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface PrivateMessageComponentProps {
|
|
2
|
+
/**
|
|
3
|
+
* Thread receiver id
|
|
4
|
+
* @default null
|
|
5
|
+
*/
|
|
6
|
+
id?: number | string;
|
|
7
|
+
/**
|
|
8
|
+
* Handler on message click
|
|
9
|
+
* @default null
|
|
10
|
+
*/
|
|
11
|
+
onItemClick?: (id: any) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Overrides or extends the styles applied to the component.
|
|
14
|
+
* @default null
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Hides this component
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
autoHide?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Any other properties
|
|
24
|
+
*/
|
|
25
|
+
[p: string]: any;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
> API documentation for the Community-JS Private Messages template. Learn about the available props and the CSS API.
|
|
30
|
+
|
|
31
|
+
#### Import
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
import {PrivateMessageComponent} from '@selfcommunity/react-templates';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### Component Name
|
|
38
|
+
|
|
39
|
+
The name `SCPrivateMessageComponent` can be used when providing style overrides in the theme.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
#### CSS
|
|
43
|
+
|
|
44
|
+
|Rule Name|Global class|Description|
|
|
45
|
+
|---|---|---|
|
|
46
|
+
|root|.SCPrivateMessageComponent-root|Styles applied to the root element.|
|
|
47
|
+
|snippetsBox|.SCPrivateMessageComponent-snippets-box|Styles applied to the snippets box element.|
|
|
48
|
+
|threadBox|.SCPrivateMessageComponent-thread-box|Styles applied to the thread box element.|
|
|
49
|
+
|
|
50
|
+
* @param inProps
|
|
51
|
+
*/
|
|
52
|
+
export default function PrivateMessageComponent(inProps: PrivateMessageComponentProps): JSX.Element;
|
|
53
|
+
//# sourceMappingURL=PrivateMessageComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrivateMessageComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/PrivateMessageComponent/PrivateMessageComponent.tsx"],"names":[],"mappings":"AAgCA,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,EAAE,KAAA,KAAK,IAAI,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AACD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,OAAO,EAAE,4BAA4B,GAAG,GAAG,CAAC,OAAO,CA+blG"}
|
|
@@ -0,0 +1,463 @@
|
|
|
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 material_1 = require("@mui/material");
|
|
43
|
+
const react_intl_1 = require("react-intl");
|
|
44
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
45
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
46
|
+
const system_1 = require("@mui/system");
|
|
47
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
48
|
+
const types_1 = require("@selfcommunity/types");
|
|
49
|
+
const pubsub_js_1 = __importDefault(require("pubsub-js"));
|
|
50
|
+
const PrivateMessageThread_1 = __importDefault(require("../PrivateMessageThread"));
|
|
51
|
+
const PrivateMessageSnippets_1 = __importDefault(require("../PrivateMessageSnippets"));
|
|
52
|
+
const ConfirmDialog_1 = __importDefault(require("../../shared/ConfirmDialog/ConfirmDialog"));
|
|
53
|
+
const notistack_1 = require("notistack");
|
|
54
|
+
const Errors_1 = require("../../constants/Errors");
|
|
55
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
56
|
+
const HiddenPlaceholder_1 = __importDefault(require("../../shared/HiddenPlaceholder"));
|
|
57
|
+
const PREFIX = 'SCPrivateMessageComponent';
|
|
58
|
+
const classes = {
|
|
59
|
+
root: `${PREFIX}-root`,
|
|
60
|
+
snippetsBox: `${PREFIX}-snippets-box`,
|
|
61
|
+
threadBox: `${PREFIX}-thread-box`
|
|
62
|
+
};
|
|
63
|
+
const Root = (0, styles_1.styled)(material_1.Grid, {
|
|
64
|
+
name: PREFIX,
|
|
65
|
+
slot: 'Root',
|
|
66
|
+
overridesResolver: (props, styles) => styles.root
|
|
67
|
+
})(({ theme }) => ({}));
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
> API documentation for the Community-JS Private Messages template. Learn about the available props and the CSS API.
|
|
71
|
+
|
|
72
|
+
#### Import
|
|
73
|
+
|
|
74
|
+
```jsx
|
|
75
|
+
import {PrivateMessageComponent} from '@selfcommunity/react-templates';
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Component Name
|
|
79
|
+
|
|
80
|
+
The name `SCPrivateMessageComponent` can be used when providing style overrides in the theme.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
#### CSS
|
|
84
|
+
|
|
85
|
+
|Rule Name|Global class|Description|
|
|
86
|
+
|---|---|---|
|
|
87
|
+
|root|.SCPrivateMessageComponent-root|Styles applied to the root element.|
|
|
88
|
+
|snippetsBox|.SCPrivateMessageComponent-snippets-box|Styles applied to the snippets box element.|
|
|
89
|
+
|threadBox|.SCPrivateMessageComponent-thread-box|Styles applied to the thread box element.|
|
|
90
|
+
|
|
91
|
+
* @param inProps
|
|
92
|
+
*/
|
|
93
|
+
function PrivateMessageComponent(inProps) {
|
|
94
|
+
//PROPS
|
|
95
|
+
const props = (0, system_1.useThemeProps)({
|
|
96
|
+
props: inProps,
|
|
97
|
+
name: PREFIX
|
|
98
|
+
});
|
|
99
|
+
const { id = null, autoHide = false, className = null, onItemClick = null } = props, rest = __rest(props, ["id", "autoHide", "className", "onItemClick"]);
|
|
100
|
+
// STATE
|
|
101
|
+
const theme = (0, material_1.useTheme)();
|
|
102
|
+
const [snippets, setSnippets] = (0, react_1.useState)([]);
|
|
103
|
+
const [messageObjs, setMessageObjs] = (0, react_1.useState)([]);
|
|
104
|
+
const [clear, setClear] = (0, react_1.useState)(false);
|
|
105
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
106
|
+
const [loadingMessageObjs, setLoadingMessageObjs] = (0, react_1.useState)(true);
|
|
107
|
+
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
108
|
+
const [layout, setLayout] = (0, react_1.useState)('default');
|
|
109
|
+
const [obj, setObj] = (0, react_1.useState)(id !== null && id !== void 0 ? id : null);
|
|
110
|
+
const [deletingThread, setDeletingThread] = (0, react_1.useState)(null);
|
|
111
|
+
const [deletingMsg, setDeletingMsg] = (0, react_1.useState)(null);
|
|
112
|
+
const [openNewMessage, setOpenNewMessage] = (0, react_1.useState)(false);
|
|
113
|
+
const [openDeleteThreadDialog, setOpenDeleteThreadDialog] = (0, react_1.useState)(false);
|
|
114
|
+
const [openDeleteMessageDialog, setOpenDeleteMessageDialog] = (0, react_1.useState)(false);
|
|
115
|
+
const [receiver, setReceiver] = (0, react_1.useState)(null);
|
|
116
|
+
const [recipients, setRecipients] = (0, react_1.useState)([]);
|
|
117
|
+
const mobileSnippetsView = (layout === 'default' && !id) || (layout === 'mobile' && id);
|
|
118
|
+
const mobileThreadView = (layout === 'mobile' && !id) || (layout === 'default' && id);
|
|
119
|
+
const [newMessageThread, setNewMessageThread] = (0, react_1.useState)(false);
|
|
120
|
+
const { enqueueSnackbar, closeSnackbar } = (0, notistack_1.useSnackbar)();
|
|
121
|
+
// REFS
|
|
122
|
+
const refreshSubscription = (0, react_1.useRef)(null);
|
|
123
|
+
// CONTEXT
|
|
124
|
+
const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
|
|
125
|
+
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
126
|
+
const isNumber = typeof obj === 'number';
|
|
127
|
+
// HANDLERS
|
|
128
|
+
/**
|
|
129
|
+
* Handles thread opening on click
|
|
130
|
+
* @param item
|
|
131
|
+
*/
|
|
132
|
+
const handleThreadOpening = (item) => {
|
|
133
|
+
updateSnippetsParams(item.id, 'seen');
|
|
134
|
+
onItemClick && onItemClick(item.id);
|
|
135
|
+
setObj(item);
|
|
136
|
+
setOpenNewMessage(false);
|
|
137
|
+
isMobile && setLayout('mobile');
|
|
138
|
+
id && setLayout('default');
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Handles new message opening on button action click
|
|
142
|
+
*/
|
|
143
|
+
const handleOpenNewMessage = () => {
|
|
144
|
+
setOpenNewMessage(!openNewMessage);
|
|
145
|
+
setObj(null);
|
|
146
|
+
isMobile && setLayout('mobile');
|
|
147
|
+
id && setLayout('default');
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Handles delete message dialog opening
|
|
151
|
+
* @param msg
|
|
152
|
+
*/
|
|
153
|
+
const handleOpenDeleteMessageDialog = (msg) => {
|
|
154
|
+
setOpenDeleteMessageDialog(true);
|
|
155
|
+
setDeletingMsg(msg);
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Handles delete message dialog close
|
|
159
|
+
*/
|
|
160
|
+
const handleCloseDeleteMessageDialog = () => {
|
|
161
|
+
setOpenDeleteMessageDialog(false);
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Handles delete thread dialog opening
|
|
165
|
+
*/
|
|
166
|
+
function handleOpenDeleteThreadDialog(threadObj) {
|
|
167
|
+
setOpenDeleteThreadDialog(true);
|
|
168
|
+
setDeletingThread(threadObj.id);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Handles delete thread dialog close
|
|
172
|
+
*/
|
|
173
|
+
const handleCloseDeleteThreadDialog = () => {
|
|
174
|
+
setOpenDeleteThreadDialog(false);
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Handles
|
|
178
|
+
*/
|
|
179
|
+
const handleMessageBack = () => {
|
|
180
|
+
setLayout('default');
|
|
181
|
+
id && setLayout('mobile');
|
|
182
|
+
setOpenNewMessage(false);
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Handles snippets list update on message changes inside thread component
|
|
186
|
+
* @param message
|
|
187
|
+
*/
|
|
188
|
+
const handleSnippetsUpdate = (message) => {
|
|
189
|
+
updateSnippetsList(message);
|
|
190
|
+
if (openNewMessage) {
|
|
191
|
+
setObj(message);
|
|
192
|
+
setOpenNewMessage(false);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Handles autocomplete recipients selection
|
|
197
|
+
* @param event
|
|
198
|
+
* @param recipient
|
|
199
|
+
*/
|
|
200
|
+
const handleRecipientSelect = (event, recipient) => {
|
|
201
|
+
setRecipients(recipient);
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Memoized message recipients ids
|
|
205
|
+
*/
|
|
206
|
+
const ids = (0, react_1.useMemo)(() => {
|
|
207
|
+
if (recipients !== null && openNewMessage) {
|
|
208
|
+
return recipients.map((u) => {
|
|
209
|
+
return parseInt(u.id, 10);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
if (newMessageThread && !openNewMessage) {
|
|
213
|
+
return recipients;
|
|
214
|
+
}
|
|
215
|
+
}, [recipients]);
|
|
216
|
+
/**
|
|
217
|
+
* Updates snippet headline and status or just snippet status
|
|
218
|
+
* @param id
|
|
219
|
+
* @param status
|
|
220
|
+
* @param headline
|
|
221
|
+
*/
|
|
222
|
+
function updateSnippetsParams(id, status, headline) {
|
|
223
|
+
const newSnippets = [...snippets];
|
|
224
|
+
const index = newSnippets.findIndex((s) => s.id === id);
|
|
225
|
+
if (index !== -1) {
|
|
226
|
+
newSnippets[index].headline = headline !== null && headline !== void 0 ? headline : newSnippets[index].headline;
|
|
227
|
+
newSnippets[index].thread_status = status;
|
|
228
|
+
setSnippets(newSnippets);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Updates snippets list when a new message is sent or another one is deleted
|
|
233
|
+
* @param message
|
|
234
|
+
*/
|
|
235
|
+
function updateSnippetsList(message) {
|
|
236
|
+
const newSnippets = [...snippets];
|
|
237
|
+
const inList = newSnippets.some((o) => o.receiver.id === message.receiver.id);
|
|
238
|
+
//if snippet is already present in the list, its headline gets updated
|
|
239
|
+
if (inList) {
|
|
240
|
+
const index = newSnippets.findIndex((s) => s.receiver.id === message.receiver.id);
|
|
241
|
+
if (index !== -1) {
|
|
242
|
+
newSnippets[index].headline = message.message;
|
|
243
|
+
setSnippets(newSnippets);
|
|
244
|
+
}
|
|
245
|
+
//a new snippets gets added to the list
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
setSnippets((prev) => [...prev, message]);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Handles thread deletion
|
|
253
|
+
*/
|
|
254
|
+
function handleDeleteThread() {
|
|
255
|
+
api_services_1.PrivateMessageService.deleteAThread(deletingThread !== null && deletingThread !== void 0 ? deletingThread : obj.id)
|
|
256
|
+
.then(() => {
|
|
257
|
+
if (layout === 'mobile') {
|
|
258
|
+
setLayout('default');
|
|
259
|
+
}
|
|
260
|
+
id && setLayout('mobile');
|
|
261
|
+
setOpenDeleteThreadDialog(false);
|
|
262
|
+
deletingThread === (obj === null || obj === void 0 ? void 0 : obj.id) && setObj(null);
|
|
263
|
+
const _snippets = snippets.filter((s) => s.id !== deletingThread);
|
|
264
|
+
setSnippets(_snippets);
|
|
265
|
+
setClear(true);
|
|
266
|
+
})
|
|
267
|
+
.catch((error) => {
|
|
268
|
+
setOpenDeleteThreadDialog(false);
|
|
269
|
+
console.log(error);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Handles the deletion of a single message
|
|
274
|
+
*/
|
|
275
|
+
function handleDeleteMessage() {
|
|
276
|
+
api_services_1.PrivateMessageService.deleteAMessage(deletingMsg.id)
|
|
277
|
+
.then(() => {
|
|
278
|
+
const result = messageObjs.filter((m) => m.id !== deletingMsg.id);
|
|
279
|
+
setMessageObjs(result);
|
|
280
|
+
handleSnippetsUpdate(result.length >= 1 ? result.slice(-1)[0] : deletingMsg);
|
|
281
|
+
handleCloseDeleteMessageDialog();
|
|
282
|
+
})
|
|
283
|
+
.catch((error) => {
|
|
284
|
+
console.log(error);
|
|
285
|
+
let _snackBar = enqueueSnackbar(react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.common.error", defaultMessage: "ui.common.error" }), {
|
|
286
|
+
variant: 'error',
|
|
287
|
+
onClick: () => {
|
|
288
|
+
closeSnackbar(_snackBar);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Handles message sending
|
|
295
|
+
* @param message
|
|
296
|
+
* @param file
|
|
297
|
+
*/
|
|
298
|
+
function handleSend(message, file) {
|
|
299
|
+
var _a;
|
|
300
|
+
if (react_core_1.UserUtils.isBlocked(scUserContext.user)) {
|
|
301
|
+
enqueueSnackbar(react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.common.userBlocked", defaultMessage: "ui.common.userBlocked" }), {
|
|
302
|
+
variant: 'warning',
|
|
303
|
+
autoHideDuration: 3000
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
api_services_1.http
|
|
308
|
+
.request({
|
|
309
|
+
url: api_services_1.Endpoints.SendMessage.url(),
|
|
310
|
+
method: api_services_1.Endpoints.SendMessage.method,
|
|
311
|
+
data: {
|
|
312
|
+
recipients: openNewMessage ? ids : [isNumber ? obj : (_a = obj === null || obj === void 0 ? void 0 : obj.receiver) === null || _a === void 0 ? void 0 : _a.id],
|
|
313
|
+
message: message,
|
|
314
|
+
file_uuid: file && !message ? file : null
|
|
315
|
+
}
|
|
316
|
+
})
|
|
317
|
+
.then((res) => {
|
|
318
|
+
setMessageObjs((prev) => [...prev, res.data]);
|
|
319
|
+
handleSnippetsUpdate(res.data);
|
|
320
|
+
if (openNewMessage || newMessageThread) {
|
|
321
|
+
setNewMessageThread(false);
|
|
322
|
+
setRecipients([]);
|
|
323
|
+
}
|
|
324
|
+
})
|
|
325
|
+
.catch((error) => {
|
|
326
|
+
console.log(error);
|
|
327
|
+
let _snackBar = enqueueSnackbar(react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.common.error.messageError", defaultMessage: "ui.common.error.messageError" }), {
|
|
328
|
+
variant: 'error',
|
|
329
|
+
onClick: () => {
|
|
330
|
+
closeSnackbar(_snackBar);
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Fetches thread
|
|
338
|
+
*/
|
|
339
|
+
function fetchThread() {
|
|
340
|
+
const _threadObjId = isNumber ? obj : obj === null || obj === void 0 ? void 0 : obj.id;
|
|
341
|
+
api_services_1.http
|
|
342
|
+
.request({
|
|
343
|
+
url: api_services_1.Endpoints.GetAThread.url(),
|
|
344
|
+
method: api_services_1.Endpoints.GetAThread.method,
|
|
345
|
+
params: {
|
|
346
|
+
thread: _threadObjId
|
|
347
|
+
}
|
|
348
|
+
})
|
|
349
|
+
.then((res) => {
|
|
350
|
+
var _a;
|
|
351
|
+
const data = res.data;
|
|
352
|
+
setMessageObjs(data.results);
|
|
353
|
+
if (data.results.length) {
|
|
354
|
+
if (data.results[0].receiver.id !== scUserContext.user.id) {
|
|
355
|
+
setReceiver(data.results[0].receiver);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
setReceiver(data.results[0].sender);
|
|
359
|
+
}
|
|
360
|
+
setNewMessageThread(false);
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
setNewMessageThread(true);
|
|
364
|
+
setRecipients((_a = obj === null || obj === void 0 ? void 0 : obj.receiver) === null || _a === void 0 ? void 0 : _a.id);
|
|
365
|
+
}
|
|
366
|
+
setLoadingMessageObjs(false);
|
|
367
|
+
})
|
|
368
|
+
.catch((error) => {
|
|
369
|
+
setLoadingMessageObjs(false);
|
|
370
|
+
console.log(error);
|
|
371
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, { error });
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Memoized fetchSnippets
|
|
376
|
+
*/
|
|
377
|
+
const fetchSnippets = (0, react_1.useMemo)(() => () => {
|
|
378
|
+
return api_services_1.PrivateMessageService.getAllSnippets()
|
|
379
|
+
.then((data) => {
|
|
380
|
+
setSnippets(data.results);
|
|
381
|
+
setLoading(false);
|
|
382
|
+
})
|
|
383
|
+
.catch((error) => {
|
|
384
|
+
setLoading(false);
|
|
385
|
+
console.log(error);
|
|
386
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, { error });
|
|
387
|
+
});
|
|
388
|
+
}, []);
|
|
389
|
+
/**
|
|
390
|
+
* On mount, fetches snippets
|
|
391
|
+
*/
|
|
392
|
+
(0, react_1.useEffect)(() => {
|
|
393
|
+
authUserId && fetchSnippets();
|
|
394
|
+
}, [authUserId]);
|
|
395
|
+
/**
|
|
396
|
+
* On mount, if obj, fetches thread
|
|
397
|
+
*/
|
|
398
|
+
(0, react_1.useEffect)(() => {
|
|
399
|
+
obj && fetchThread();
|
|
400
|
+
}, [obj, authUserId]);
|
|
401
|
+
/**
|
|
402
|
+
* Notification subscriber
|
|
403
|
+
*/
|
|
404
|
+
const subscriber = (msg, data) => {
|
|
405
|
+
const res = data.data;
|
|
406
|
+
updateSnippetsParams(res.thread_id, res.notification_obj.snippet.thread_status, res.notification_obj.snippet.headline);
|
|
407
|
+
const newMessages = [...messageObjs];
|
|
408
|
+
const index = newMessages.findIndex((m) => m.sender.id === res.notification_obj.message.sender.id);
|
|
409
|
+
if (index !== -1) {
|
|
410
|
+
setMessageObjs((prev) => [...prev, res.notification_obj.message]);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* When a ws notification arrives, updates thread and snippets data
|
|
415
|
+
*/
|
|
416
|
+
(0, react_1.useEffect)(() => {
|
|
417
|
+
refreshSubscription.current = pubsub_js_1.default.subscribe(`${types_1.SCNotificationTopicType.INTERACTION}.${types_1.SCNotificationTypologyType.PRIVATE_MESSAGE}`, subscriber);
|
|
418
|
+
return () => {
|
|
419
|
+
pubsub_js_1.default.unsubscribe(refreshSubscription.current);
|
|
420
|
+
};
|
|
421
|
+
}, [snippets, messageObjs]);
|
|
422
|
+
/**
|
|
423
|
+
* Renders snippets section
|
|
424
|
+
*/
|
|
425
|
+
function renderSnippets() {
|
|
426
|
+
return (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, md: 5, className: classes.snippetsBox },
|
|
427
|
+
react_1.default.createElement(PrivateMessageSnippets_1.default, { snippets: snippets, loading: loading, snippetActions: {
|
|
428
|
+
onSnippetClick: handleThreadOpening,
|
|
429
|
+
onNewMessageClick: handleOpenNewMessage,
|
|
430
|
+
onMenuItemClick: handleOpenDeleteThreadDialog
|
|
431
|
+
}, threadObj: obj !== null && obj !== void 0 ? obj : null, clearSearch: clear }),
|
|
432
|
+
openDeleteThreadDialog && (react_1.default.createElement(ConfirmDialog_1.default, { open: openDeleteThreadDialog, title: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.privateMessage.component.delete.thread.dialog.msg", defaultMessage: "ui.privateMessage.component.delete.thread.dialog.msg" }), btnConfirm: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.privateMessage.component.delete.thread.dialog.confirm", defaultMessage: "ui.privateMessage.component.delete.thread.dialog.confirm" }), onConfirm: handleDeleteThread, onClose: handleCloseDeleteThreadDialog }))));
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Renders thread section
|
|
436
|
+
*/
|
|
437
|
+
function renderThread() {
|
|
438
|
+
return (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, md: 7, className: classes.threadBox },
|
|
439
|
+
react_1.default.createElement(PrivateMessageThread_1.default, { receiver: receiver, recipients: recipients, threadObj: obj !== null && obj !== void 0 ? obj : null, loadingMessageObjs: loadingMessageObjs, messages: messageObjs, openNewMessage: openNewMessage, newMessageThread: newMessageThread, threadCallbacks: {
|
|
440
|
+
onMessageBack: handleMessageBack,
|
|
441
|
+
onMessageDelete: handleOpenDeleteMessageDialog,
|
|
442
|
+
onRecipientSelect: handleRecipientSelect,
|
|
443
|
+
onMessageSend: handleSend
|
|
444
|
+
} }),
|
|
445
|
+
openDeleteMessageDialog && (react_1.default.createElement(ConfirmDialog_1.default, { open: openDeleteMessageDialog, title: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.privateMessage.component.delete.message.dialog.msg", defaultMessage: "ui.privateMessage.component.delete.message.dialog.msg" }), btnConfirm: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.privateMessage.component.delete.message.dialog.confirm", defaultMessage: "ui.privateMessage.component.delete.message.dialog.confirm" }), onConfirm: handleDeleteMessage, onClose: handleCloseDeleteMessageDialog }))));
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Renders the component (if not hidden by autoHide prop)
|
|
449
|
+
*/
|
|
450
|
+
if (!scUserContext.user) {
|
|
451
|
+
return react_1.default.createElement(HiddenPlaceholder_1.default, null);
|
|
452
|
+
}
|
|
453
|
+
if (!autoHide) {
|
|
454
|
+
return (react_1.default.createElement(Root, Object.assign({ container: true }, rest, { className: (0, classnames_1.default)(classes.root, className) }), isMobile ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
455
|
+
mobileSnippetsView && react_1.default.createElement(react_1.default.Fragment, null, renderSnippets()),
|
|
456
|
+
mobileThreadView && react_1.default.createElement(react_1.default.Fragment, null, renderThread()))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
457
|
+
renderSnippets(),
|
|
458
|
+
renderThread()))));
|
|
459
|
+
}
|
|
460
|
+
return react_1.default.createElement(HiddenPlaceholder_1.default, null);
|
|
461
|
+
}
|
|
462
|
+
exports.default = PrivateMessageComponent;
|
|
463
|
+
//# sourceMappingURL=PrivateMessageComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrivateMessageComponent.js","sourceRoot":"","sources":["../../../../src/components/PrivateMessageComponent/PrivateMessageComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;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,8BAAC,2BAAiB,OAAG,CAAC;KAC9B;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,CACL,8BAAC,IAAI,kBAAC,SAAS,UAAK,IAAI,IAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,KACrE,QAAQ,CAAC,CAAC,CAAC,CACV;YACG,kBAAkB,IAAI,8DAAG,cAAc,EAAE,CAAI;YAC7C,gBAAgB,IAAI,8DAAG,YAAY,EAAE,CAAI,CACzC,CACJ,CAAC,CAAC,CAAC,CACF;YACG,cAAc,EAAE;YAChB,YAAY,EAAE,CACd,CACJ,CACI,CACR,CAAC;KACH;IACD,OAAO,8BAAC,2BAAiB,OAAG,CAAC;AAC/B,CAAC;AA/bD,0CA+bC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PrivateMessageComponentSkeletonMap {
|
|
3
|
+
/**
|
|
4
|
+
* Overrides or extends the styles applied to the component.
|
|
5
|
+
* @default null
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare type PrivateMessageComponentProps = React.PropsWithChildren<PrivateMessageComponentSkeletonMap>;
|
|
10
|
+
/**
|
|
11
|
+
* > API documentation for the Community-JS Private Messages Skeleton Template. Learn about the available props and the CSS API.
|
|
12
|
+
|
|
13
|
+
#### Import
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
import {PrivateMessageComponentSkeleton} from '@selfcommunity/react-templates';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
#### Component Name
|
|
20
|
+
|
|
21
|
+
The name `SCPrivateMessageComponentSkeleton` can be used when providing style overrides in the theme.
|
|
22
|
+
|
|
23
|
+
#### CSS
|
|
24
|
+
|
|
25
|
+
|Rule Name|Global class|Description|
|
|
26
|
+
|---|---|---|
|
|
27
|
+
|root|.SCPrivateMessageComponentSkeleton-root|Styles applied to the root element.|
|
|
28
|
+
|snippetsSection|.SCPrivateMessageComponentSkeleton-snippets-section|Styles applied to the snippets section|
|
|
29
|
+
|threadSection|.SCPrivateMessageComponentSkeleton-thread-section|Styles applied to the thread section|
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export default function PrivateMessageComponentSkeleton(props: PrivateMessageComponentProps): JSX.Element;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=Skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/PrivateMessageComponent/Skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,UAAU,kCAAkC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,oBAAY,4BAA4B,GAAG,KAAK,CAAC,iBAAiB,CAAC,kCAAkC,CAAC,CAAC;AACvG;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,OAAO,UAAU,+BAA+B,CAAC,KAAK,EAAE,4BAA4B,GAAG,GAAG,CAAC,OAAO,CAYxG"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const styles_1 = require("@mui/material/styles");
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const PrivateMessageSnippets_1 = __importDefault(require("../PrivateMessageSnippets"));
|
|
10
|
+
const PrivateMessageThread_1 = __importDefault(require("../PrivateMessageThread"));
|
|
11
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
12
|
+
const PREFIX = 'SCPrivateMessageComponentSkeleton';
|
|
13
|
+
const classes = {
|
|
14
|
+
root: `${PREFIX}-root`,
|
|
15
|
+
snippetsSection: `${PREFIX}-snippets-section`,
|
|
16
|
+
threadSection: `${PREFIX}-thread-section`
|
|
17
|
+
};
|
|
18
|
+
const Root = (0, styles_1.styled)(material_1.Grid, {
|
|
19
|
+
name: PREFIX,
|
|
20
|
+
slot: 'Root',
|
|
21
|
+
overridesResolver: (props, styles) => styles.root
|
|
22
|
+
})(() => ({}));
|
|
23
|
+
/**
|
|
24
|
+
* > API documentation for the Community-JS Private Messages Skeleton Template. Learn about the available props and the CSS API.
|
|
25
|
+
|
|
26
|
+
#### Import
|
|
27
|
+
|
|
28
|
+
```jsx
|
|
29
|
+
import {PrivateMessageComponentSkeleton} from '@selfcommunity/react-templates';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Component Name
|
|
33
|
+
|
|
34
|
+
The name `SCPrivateMessageComponentSkeleton` can be used when providing style overrides in the theme.
|
|
35
|
+
|
|
36
|
+
#### CSS
|
|
37
|
+
|
|
38
|
+
|Rule Name|Global class|Description|
|
|
39
|
+
|---|---|---|
|
|
40
|
+
|root|.SCPrivateMessageComponentSkeleton-root|Styles applied to the root element.|
|
|
41
|
+
|snippetsSection|.SCPrivateMessageComponentSkeleton-snippets-section|Styles applied to the snippets section|
|
|
42
|
+
|threadSection|.SCPrivateMessageComponentSkeleton-thread-section|Styles applied to the thread section|
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
function PrivateMessageComponentSkeleton(props) {
|
|
46
|
+
const { className } = props;
|
|
47
|
+
return (react_1.default.createElement(Root, { container: true, className: (0, classnames_1.default)(classes.root, className) },
|
|
48
|
+
react_1.default.createElement(material_1.Grid, { item: true, xs: 12, md: 5, className: classes.snippetsSection },
|
|
49
|
+
react_1.default.createElement(PrivateMessageSnippets_1.default, null)),
|
|
50
|
+
react_1.default.createElement(material_1.Grid, { item: true, xs: 12, md: 7, className: classes.threadSection },
|
|
51
|
+
react_1.default.createElement(PrivateMessageThread_1.default, null))));
|
|
52
|
+
}
|
|
53
|
+
exports.default = PrivateMessageComponentSkeleton;
|
|
54
|
+
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sourceRoot":"","sources":["../../../../src/components/PrivateMessageComponent/Skeleton.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,iDAA4C;AAC5C,4CAAmC;AACnC,uFAAuE;AACvE,mFAAmE;AACnE,4DAAoC;AAEpC,MAAM,MAAM,GAAG,mCAAmC,CAAC;AAEnD,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,eAAe,EAAE,GAAG,MAAM,mBAAmB;IAC7C,aAAa,EAAE,GAAG,MAAM,iBAAiB;CAC1C,CAAC;AACF,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,eAAI,EAAE;IACxB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI;CAClD,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAUf;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAwB,+BAA+B,CAAC,KAAmC;IACzF,MAAM,EAAC,SAAS,EAAC,GAAG,KAAK,CAAC;IAC1B,OAAO,CACL,8BAAC,IAAI,IAAC,SAAS,QAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;QAC5D,8BAAC,eAAI,IAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,eAAe;YAC1D,8BAAC,gCAA8B,OAAG,CAC7B;QACP,8BAAC,eAAI,IAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,aAAa;YACxD,8BAAC,8BAA4B,OAAG,CAC3B,CACF,CACR,CAAC;AACJ,CAAC;AAZD,kDAYC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import PrivateMessageComponent, { PrivateMessageComponentProps } from './PrivateMessageComponent';
|
|
2
|
+
import PrivateMessageComponentSkeleton from './Skeleton';
|
|
3
|
+
export default PrivateMessageComponent;
|
|
4
|
+
export { PrivateMessageComponentProps, PrivateMessageComponentSkeleton };
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/PrivateMessageComponent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,EAAE,EAAC,4BAA4B,EAAC,MAAM,2BAA2B,CAAC;AAChG,OAAO,+BAA+B,MAAM,YAAY,CAAC;AACzD,eAAe,uBAAuB,CAAC;AACvC,OAAO,EAAC,4BAA4B,EAAE,+BAA+B,EAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PrivateMessageComponentSkeleton = void 0;
|
|
7
|
+
const PrivateMessageComponent_1 = __importDefault(require("./PrivateMessageComponent"));
|
|
8
|
+
const Skeleton_1 = __importDefault(require("./Skeleton"));
|
|
9
|
+
exports.PrivateMessageComponentSkeleton = Skeleton_1.default;
|
|
10
|
+
exports.default = PrivateMessageComponent_1.default;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|