@messenger-box/platform-browser 0.0.1-alpha.16 → 0.0.1-alpha.17
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/CHANGELOG.md +8 -0
- package/lib/components/messenger/avatar/index.d.ts +9 -0
- package/lib/components/messenger/avatar/style.d.ts +78 -0
- package/lib/components/messenger/mock.d.ts +12 -0
- package/lib/components/messenger/style.d.ts +10 -0
- package/lib/index.js +206 -7
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/messenger/avatar/index.tsx +36 -0
- package/src/components/messenger/avatar/style.ts +82 -0
- package/src/components/messenger/index.tsx +21 -15
- package/src/components/messenger/messagesList/index.tsx +6 -4
- package/src/components/messenger/mock.ts +13 -0
- package/src/components/messenger/style.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.0.1-alpha.17](https://github.com/cdmbase/messenger-box/compare/v0.0.1-alpha.16...v0.0.1-alpha.17) (2021-10-05)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @messenger-box/platform-browser
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.0.1-alpha.16](https://github.com/cdmbase/messenger-box/compare/v0.0.1-alpha.15...v0.0.1-alpha.16) (2021-10-04)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @messenger-box/platform-browser
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare type IAvatarSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
2
|
+
declare type IProps = {
|
|
3
|
+
text?: string;
|
|
4
|
+
url?: string | any;
|
|
5
|
+
size?: IAvatarSize;
|
|
6
|
+
username?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const Avatar: ({ url, size, text, username }: IProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const styleSheet: {
|
|
2
|
+
avatarStyles: () => {
|
|
3
|
+
display: string;
|
|
4
|
+
alignItems: string;
|
|
5
|
+
'& .Avatar': {
|
|
6
|
+
'-webkit-user-select': string;
|
|
7
|
+
'-moz-user-select': string;
|
|
8
|
+
'-ms-user-select': string;
|
|
9
|
+
'user-select': string;
|
|
10
|
+
verticalAlign: string;
|
|
11
|
+
};
|
|
12
|
+
'& .Avatar, .Avatar:focus, .Avatar.a11y--focused': {
|
|
13
|
+
borderRadius: string;
|
|
14
|
+
};
|
|
15
|
+
'& .Avatar.Avatar-xs': {
|
|
16
|
+
width: string;
|
|
17
|
+
minWidth: string;
|
|
18
|
+
height: string;
|
|
19
|
+
fontSize: string;
|
|
20
|
+
};
|
|
21
|
+
'& .Avatar.Avatar-sm': {
|
|
22
|
+
width: string;
|
|
23
|
+
minWidth: string;
|
|
24
|
+
height: string;
|
|
25
|
+
fontSize: string;
|
|
26
|
+
};
|
|
27
|
+
'& .Avatar.Avatar-md': {
|
|
28
|
+
width: string;
|
|
29
|
+
minWidth: string;
|
|
30
|
+
height: string;
|
|
31
|
+
fontSize: string;
|
|
32
|
+
};
|
|
33
|
+
'& .Avatar.Avatar-lg': {
|
|
34
|
+
width: string;
|
|
35
|
+
minWidth: string;
|
|
36
|
+
height: string;
|
|
37
|
+
fontSize: string;
|
|
38
|
+
};
|
|
39
|
+
'& .Avatar.Avatar-xl': {
|
|
40
|
+
width: string;
|
|
41
|
+
minWidth: string;
|
|
42
|
+
height: string;
|
|
43
|
+
fontSize: string;
|
|
44
|
+
};
|
|
45
|
+
'& .Avatar.Avatar-xxl': {
|
|
46
|
+
width: string;
|
|
47
|
+
minWidth: string;
|
|
48
|
+
height: string;
|
|
49
|
+
fontSize: string;
|
|
50
|
+
};
|
|
51
|
+
'& .Avatar.Avatar-plain': {
|
|
52
|
+
position: string;
|
|
53
|
+
display: string;
|
|
54
|
+
alignItems: string;
|
|
55
|
+
justifyContent: string;
|
|
56
|
+
background: string;
|
|
57
|
+
};
|
|
58
|
+
'& .Avatar.Avatar-plain::before': {
|
|
59
|
+
position: string;
|
|
60
|
+
display: string;
|
|
61
|
+
width: string;
|
|
62
|
+
height: string;
|
|
63
|
+
alignItems: string;
|
|
64
|
+
justifyContent: string;
|
|
65
|
+
borderRadius: string;
|
|
66
|
+
color: string;
|
|
67
|
+
content: string;
|
|
68
|
+
};
|
|
69
|
+
'& .username': {
|
|
70
|
+
marginBottom: string;
|
|
71
|
+
marginLeft: string;
|
|
72
|
+
};
|
|
73
|
+
'& .username p': {
|
|
74
|
+
marginBottom: string;
|
|
75
|
+
marginLeft: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
@@ -3,3 +3,15 @@ export declare const messagesData: {
|
|
|
3
3
|
loginUser: boolean;
|
|
4
4
|
message: string;
|
|
5
5
|
}[];
|
|
6
|
+
export declare const userProfile: {
|
|
7
|
+
displayName: string;
|
|
8
|
+
isBusy: boolean;
|
|
9
|
+
user: {
|
|
10
|
+
username: string;
|
|
11
|
+
};
|
|
12
|
+
isShared: boolean;
|
|
13
|
+
disablePopover: boolean;
|
|
14
|
+
displayUsername: boolean;
|
|
15
|
+
hasMention: boolean;
|
|
16
|
+
hideStatus: boolean;
|
|
17
|
+
}[];
|
package/lib/index.js
CHANGED
|
@@ -87,6 +87,138 @@ module.exports =
|
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
89
89
|
|
|
90
|
+
/***/ "./src/components/messenger/avatar/index.tsx":
|
|
91
|
+
/*!***************************************************!*\
|
|
92
|
+
!*** ./src/components/messenger/avatar/index.tsx ***!
|
|
93
|
+
\***************************************************/
|
|
94
|
+
/*! no static exports found */
|
|
95
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
96
|
+
|
|
97
|
+
"use strict";
|
|
98
|
+
|
|
99
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
100
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
101
|
+
};
|
|
102
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
103
|
+
exports.Avatar = void 0;
|
|
104
|
+
const react_1 = __importDefault(__webpack_require__(/*! react */ "react"));
|
|
105
|
+
const classnames_1 = __importDefault(__webpack_require__(/*! classnames */ "classnames"));
|
|
106
|
+
const react_fela_1 = __webpack_require__(/*! react-fela */ "react-fela");
|
|
107
|
+
const style_1 = __webpack_require__(/*! ./style */ "./src/components/messenger/avatar/style.ts");
|
|
108
|
+
exports.Avatar = ({ url, size = 'md', text, username }) => {
|
|
109
|
+
const { css } = react_fela_1.useFela();
|
|
110
|
+
const classes = classnames_1.default(`Avatar Avatar-${size}`);
|
|
111
|
+
if (text) {
|
|
112
|
+
return (react_1.default.createElement("div", { className: css(style_1.styleSheet.avatarStyles) },
|
|
113
|
+
react_1.default.createElement("div", { className: classes + ` Avatar-plain`, "data-content": text })));
|
|
114
|
+
}
|
|
115
|
+
return (react_1.default.createElement("div", { className: css(style_1.styleSheet.avatarStyles) },
|
|
116
|
+
react_1.default.createElement("img", { src: url, className: classes, alt: "" }),
|
|
117
|
+
react_1.default.createElement("div", { className: "username" },
|
|
118
|
+
react_1.default.createElement("h4", null, username),
|
|
119
|
+
react_1.default.createElement("p", null, "6:40"))));
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/***/ }),
|
|
124
|
+
|
|
125
|
+
/***/ "./src/components/messenger/avatar/style.ts":
|
|
126
|
+
/*!**************************************************!*\
|
|
127
|
+
!*** ./src/components/messenger/avatar/style.ts ***!
|
|
128
|
+
\**************************************************/
|
|
129
|
+
/*! no static exports found */
|
|
130
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
131
|
+
|
|
132
|
+
"use strict";
|
|
133
|
+
|
|
134
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
135
|
+
exports.styleSheet = void 0;
|
|
136
|
+
exports.styleSheet = {
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
138
|
+
avatarStyles: () => ({
|
|
139
|
+
display: 'flex',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
'& .Avatar': {
|
|
142
|
+
'-webkit-user-select': 'none',
|
|
143
|
+
/* Chrome all / Safari all */
|
|
144
|
+
'-moz-user-select': 'none',
|
|
145
|
+
/* Firefox all */
|
|
146
|
+
'-ms-user-select': 'none',
|
|
147
|
+
/* IE 10+ */
|
|
148
|
+
'user-select': 'none',
|
|
149
|
+
verticalAlign: 'sub',
|
|
150
|
+
},
|
|
151
|
+
'& .Avatar, .Avatar:focus, .Avatar.a11y--focused': {
|
|
152
|
+
borderRadius: '50%',
|
|
153
|
+
},
|
|
154
|
+
'& .Avatar.Avatar-xs': {
|
|
155
|
+
width: '20px',
|
|
156
|
+
minWidth: '20px',
|
|
157
|
+
height: '20px',
|
|
158
|
+
fontSize: '9.5px',
|
|
159
|
+
},
|
|
160
|
+
'& .Avatar.Avatar-sm': {
|
|
161
|
+
width: '24px',
|
|
162
|
+
minWidth: '24px',
|
|
163
|
+
height: '24px',
|
|
164
|
+
fontSize: '10px',
|
|
165
|
+
},
|
|
166
|
+
'& .Avatar.Avatar-md': {
|
|
167
|
+
width: '32px',
|
|
168
|
+
minWidth: '32px',
|
|
169
|
+
height: '32px',
|
|
170
|
+
fontSize: '12px',
|
|
171
|
+
},
|
|
172
|
+
'& .Avatar.Avatar-lg': {
|
|
173
|
+
width: '36px',
|
|
174
|
+
minWidth: '36px',
|
|
175
|
+
height: '36px',
|
|
176
|
+
fontSize: '14px',
|
|
177
|
+
},
|
|
178
|
+
'& .Avatar.Avatar-xl': {
|
|
179
|
+
width: '50px',
|
|
180
|
+
minWidth: '50px',
|
|
181
|
+
height: '50px',
|
|
182
|
+
fontSize: '18px',
|
|
183
|
+
},
|
|
184
|
+
'& .Avatar.Avatar-xxl': {
|
|
185
|
+
width: '128px',
|
|
186
|
+
minWidth: '128px',
|
|
187
|
+
height: '128px',
|
|
188
|
+
fontSize: '44px',
|
|
189
|
+
},
|
|
190
|
+
'& .Avatar.Avatar-plain': {
|
|
191
|
+
position: 'relative',
|
|
192
|
+
display: 'inline-flex',
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
justifyContent: 'center',
|
|
195
|
+
background: 'red',
|
|
196
|
+
},
|
|
197
|
+
'& .Avatar.Avatar-plain::before': {
|
|
198
|
+
position: 'absolute',
|
|
199
|
+
display: 'inline-flex',
|
|
200
|
+
width: '100%',
|
|
201
|
+
height: '100%',
|
|
202
|
+
alignItems: 'center',
|
|
203
|
+
justifyContent: 'center',
|
|
204
|
+
borderRadius: '50%',
|
|
205
|
+
color: 'rgba(0, 1, 0, )',
|
|
206
|
+
content: 'attr(data-content)',
|
|
207
|
+
},
|
|
208
|
+
'& .username': {
|
|
209
|
+
marginBottom: '30px',
|
|
210
|
+
marginLeft: '10px',
|
|
211
|
+
},
|
|
212
|
+
'& .username p': {
|
|
213
|
+
marginBottom: '30px',
|
|
214
|
+
marginLeft: '10px',
|
|
215
|
+
},
|
|
216
|
+
}),
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
/***/ }),
|
|
221
|
+
|
|
90
222
|
/***/ "./src/components/messenger/index.tsx":
|
|
91
223
|
/*!********************************************!*\
|
|
92
224
|
!*** ./src/components/messenger/index.tsx ***!
|
|
@@ -121,7 +253,10 @@ const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
|
121
253
|
const antd_1 = __webpack_require__(/*! antd */ "antd");
|
|
122
254
|
const index_1 = __webpack_require__(/*! ./messagesList/index */ "./src/components/messenger/messagesList/index.tsx");
|
|
123
255
|
const mock_1 = __webpack_require__(/*! ./mock */ "./src/components/messenger/mock.ts");
|
|
256
|
+
const react_fela_1 = __webpack_require__(/*! react-fela */ "react-fela");
|
|
257
|
+
const style_1 = __webpack_require__(/*! ./style */ "./src/components/messenger/style.ts");
|
|
124
258
|
exports.MessengerComponent = () => {
|
|
259
|
+
const { css } = react_fela_1.useFela();
|
|
125
260
|
const [enterValue, setEnterValue] = react_1.useState('');
|
|
126
261
|
const [userMessagesList, setUserMessagesList] = react_1.useState(mock_1.messagesData);
|
|
127
262
|
const handleEnterButton = (e) => {
|
|
@@ -135,11 +270,13 @@ exports.MessengerComponent = () => {
|
|
|
135
270
|
]);
|
|
136
271
|
setEnterValue('');
|
|
137
272
|
};
|
|
138
|
-
return (react_1.default.createElement(
|
|
139
|
-
react_1.default.createElement(antd_1.
|
|
140
|
-
react_1.default.createElement(
|
|
141
|
-
|
|
142
|
-
|
|
273
|
+
return (react_1.default.createElement("div", { className: css(style_1.styleSheet.messengerStyles) },
|
|
274
|
+
react_1.default.createElement(antd_1.Row, { gutter: [24, 6] },
|
|
275
|
+
react_1.default.createElement(antd_1.Card, { style: { width: '100%', marginBottom: '100px' } },
|
|
276
|
+
react_1.default.createElement(antd_1.Col, { md: 24 },
|
|
277
|
+
react_1.default.createElement(index_1.MessagesList, { userMessagesList: userMessagesList }))),
|
|
278
|
+
react_1.default.createElement(antd_1.Col, { md: 24, className: "message--box-outer" },
|
|
279
|
+
react_1.default.createElement(antd_1.Input, { value: enterValue, onChange: (e) => { var _a; return setEnterValue((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value); }, onPressEnter: (e) => handleEnterButton(e), placeholder: "Please Enter" })))));
|
|
143
280
|
};
|
|
144
281
|
|
|
145
282
|
|
|
@@ -161,14 +298,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
161
298
|
exports.MessagesList = void 0;
|
|
162
299
|
const react_1 = __importDefault(__webpack_require__(/*! react */ "react"));
|
|
163
300
|
const antd_1 = __webpack_require__(/*! antd */ "antd");
|
|
301
|
+
const avatar_1 = __webpack_require__(/*! ../avatar */ "./src/components/messenger/avatar/index.tsx");
|
|
164
302
|
exports.MessagesList = ({ userMessagesList }) => {
|
|
165
|
-
return (react_1.default.createElement(antd_1.Row,
|
|
303
|
+
return (react_1.default.createElement(antd_1.Row, { gutter: [24, 6] }, userMessagesList === null || userMessagesList === void 0 ? void 0 : userMessagesList.map((item, index) => {
|
|
166
304
|
if (!item.loginUser) {
|
|
167
305
|
return (react_1.default.createElement(antd_1.Col, { md: 24, key: index, style: { textAlign: 'right' } },
|
|
168
306
|
react_1.default.createElement("p", null, item === null || item === void 0 ? void 0 : item.message)));
|
|
169
307
|
}
|
|
170
308
|
else {
|
|
171
309
|
return (react_1.default.createElement(antd_1.Col, { md: 24, key: index },
|
|
310
|
+
react_1.default.createElement(avatar_1.Avatar, { url: 'https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&ixlib=rb-1.2.1&w=1000&q=80', size: 'lg', username: 'admin' }),
|
|
172
311
|
react_1.default.createElement("p", null, item === null || item === void 0 ? void 0 : item.message)));
|
|
173
312
|
}
|
|
174
313
|
})));
|
|
@@ -187,7 +326,7 @@ exports.MessagesList = ({ userMessagesList }) => {
|
|
|
187
326
|
"use strict";
|
|
188
327
|
|
|
189
328
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
190
|
-
exports.messagesData = void 0;
|
|
329
|
+
exports.userProfile = exports.messagesData = void 0;
|
|
191
330
|
exports.messagesData = [
|
|
192
331
|
{
|
|
193
332
|
id: 1,
|
|
@@ -210,6 +349,44 @@ exports.messagesData = [
|
|
|
210
349
|
message: 'I am fine!',
|
|
211
350
|
},
|
|
212
351
|
];
|
|
352
|
+
exports.userProfile = [
|
|
353
|
+
{
|
|
354
|
+
displayName: 'nickname',
|
|
355
|
+
isBusy: false,
|
|
356
|
+
user: { username: 'Admin' },
|
|
357
|
+
isShared: true,
|
|
358
|
+
disablePopover: true,
|
|
359
|
+
displayUsername: true,
|
|
360
|
+
hasMention: false,
|
|
361
|
+
hideStatus: false,
|
|
362
|
+
},
|
|
363
|
+
];
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
/***/ }),
|
|
367
|
+
|
|
368
|
+
/***/ "./src/components/messenger/style.ts":
|
|
369
|
+
/*!*******************************************!*\
|
|
370
|
+
!*** ./src/components/messenger/style.ts ***!
|
|
371
|
+
\*******************************************/
|
|
372
|
+
/*! no static exports found */
|
|
373
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
374
|
+
|
|
375
|
+
"use strict";
|
|
376
|
+
|
|
377
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
378
|
+
exports.styleSheet = void 0;
|
|
379
|
+
exports.styleSheet = {
|
|
380
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
381
|
+
messengerStyles: () => ({
|
|
382
|
+
display: 'inharit',
|
|
383
|
+
'& .message--box-outer': {
|
|
384
|
+
position: 'fixed',
|
|
385
|
+
bottom: '10%',
|
|
386
|
+
width: '84.7%',
|
|
387
|
+
},
|
|
388
|
+
}),
|
|
389
|
+
};
|
|
213
390
|
|
|
214
391
|
|
|
215
392
|
/***/ }),
|
|
@@ -463,6 +640,17 @@ module.exports = require("antd");
|
|
|
463
640
|
|
|
464
641
|
/***/ }),
|
|
465
642
|
|
|
643
|
+
/***/ "classnames":
|
|
644
|
+
/*!*****************************!*\
|
|
645
|
+
!*** external "classnames" ***!
|
|
646
|
+
\*****************************/
|
|
647
|
+
/*! no static exports found */
|
|
648
|
+
/***/ (function(module, exports) {
|
|
649
|
+
|
|
650
|
+
module.exports = require("classnames");
|
|
651
|
+
|
|
652
|
+
/***/ }),
|
|
653
|
+
|
|
466
654
|
/***/ "react":
|
|
467
655
|
/*!************************!*\
|
|
468
656
|
!*** external "react" ***!
|
|
@@ -474,6 +662,17 @@ module.exports = require("react");
|
|
|
474
662
|
|
|
475
663
|
/***/ }),
|
|
476
664
|
|
|
665
|
+
/***/ "react-fela":
|
|
666
|
+
/*!*****************************!*\
|
|
667
|
+
!*** external "react-fela" ***!
|
|
668
|
+
\*****************************/
|
|
669
|
+
/*! no static exports found */
|
|
670
|
+
/***/ (function(module, exports) {
|
|
671
|
+
|
|
672
|
+
module.exports = require("react-fela");
|
|
673
|
+
|
|
674
|
+
/***/ }),
|
|
675
|
+
|
|
477
676
|
/***/ "react-intl":
|
|
478
677
|
/*!*****************************!*\
|
|
479
678
|
!*** external "react-intl" ***!
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/components/messenger/index.tsx","webpack:///./src/components/messenger/messagesList/index.tsx","webpack:///./src/components/messenger/mock.ts","webpack:///./src/compute.tsx","webpack:///./src/containers/Dashboard.tsx","webpack:///./src/containers/Messenger.tsx","webpack:///./src/index.tsx","webpack:///./src/module.ts","webpack:///./src/utils/index.ts","webpack:///external \"@adminide-stack/platform-browser/lib/components\"","webpack:///external \"@common-stack/client-react\"","webpack:///external \"antd\"","webpack:///external \"react\"","webpack:///external \"react-intl\""],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA,wEAA4C;AAC5C,uDA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;;;;;;;;;;;;;;;;ACjBU,yBAAiB,GAAG,CAAC,gBAAgB,EAAE,cAAc,EAAE,EAAE,CAClE,gBAAgB;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;IACV,IAAI,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;QACzC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,OAAO;YACH,CAAC,IAAI,CAAC,EAAE,IAAI;SACf,CAAC;KACL;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;KACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;;;;;;;;;;;;ACXlC,4E;;;;;;;;;;;ACAA,uD;;;;;;;;;;;ACAA,iC;;;;;;;;;;;ACAA,kC;;;;;;;;;;;ACAA,uC","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.tsx\");\n","import React, { FC, useState } from 'react';\nimport { Col, Row, Input } from 'antd';\nimport { MessagesList } from './messagesList/index';\nimport { messagesData } from './mock';\nimport { IMessageList } from './types/message';\n\n\nexport const MessengerComponent: FC = () => {\n const [enterValue, setEnterValue] = useState<string>('');\n const [userMessagesList, setUserMessagesList] = useState<IMessageList[]>(messagesData);\n const handleEnterButton = (e) => {\n setUserMessagesList([\n ...userMessagesList,\n {\n id: Math.random(),\n loginUser: true,\n message: enterValue,\n },\n ]);\n setEnterValue('');\n };\n\n return (\n <Row gutter={[24, 6]}>\n <Col md={24}>\n <MessagesList userMessagesList={userMessagesList} />\n </Col>\n <Col md={24}>\n <Input\n value={enterValue}\n onChange={(e: any) => setEnterValue(e?.target?.value)}\n onPressEnter={(e) => handleEnterButton(e)}\n placeholder=\"Please Enter\"\n />\n </Col>\n </Row>\n );\n};\n","import React, { FC } from 'react';\nimport { Col, Row } from 'antd';\nimport { IMessageList } from '../types/message';\n\ninterface IProps {\n userMessagesList: IMessageList[]\n}\nexport const MessagesList: FC<IProps> = ({ userMessagesList }) => {\n return (\n <Row>\n {userMessagesList?.map((item:IMessageList, index: number) => {\n if (!item.loginUser) {\n return (\n <Col md={24} key={index} style={{ textAlign: 'right' }}>\n <p>{item?.message}</p>\n </Col>\n );\n } else {\n return (\n <Col md={24} key={index}>\n <p>{item?.message}</p>\n </Col>\n );\n }\n })}\n </Row>\n );\n};\n","export const messagesData = [\n {\n id: 1,\n loginUser: true,\n message: 'Hello!',\n },\n {\n id: 2,\n loginUser: false,\n message: 'Hey!',\n },\n {\n id: 3,\n loginUser: true,\n message: 'How are you!',\n },\n {\n id: 4,\n loginUser: false,\n message: 'I am fine!',\n },\n];\n","import * as React from 'react';\nimport { IMenuPosition } from '@common-stack/client-react';\nimport { FileOutlined } from '@ant-design/icons';\nimport { userIsAuthenticatedRedir } from '@adminide-stack/user-auth0-browser';\nimport { DashboardFill } from '@adminide-stack/platform-browser/lib/components';\nimport { IPreDefineAccountPermissions, ConfigurationTarget } from '@adminide-stack/core';\nimport { getFilteredRoutes } from './utils';\nimport { IntlProvider } from 'react-intl';\n\nconst Dashboard = React.lazy(() => import('./containers/Dashboard'));\nconst Messenger = React.lazy(() => import('./containers/Messenger'));\n\nexport const DashboardProvider = () => {\n return (\n <DashboardFill>\n {/* <Dashboard/> */}\n <IntlProvider locale=\"en\">\n <Messenger />\n </IntlProvider>\n </DashboardFill>\n );\n};\n\nexport const messengerPageStore: any[] = [\n // {\n // exact: false,\n // icon: <FileOutlined />,\n // key: 'dashboard',\n // component: userIsAuthenticatedRedir(Dashboard),\n // position: IMenuPosition.MIDDLE,\n // tab: 'Dashboard',\n // name: 'Dashboard',\n // path: '/:orgName/o/dashboard',\n // priority: 1,\n // },\n];\n\nconst selectedRoutesAndMenus = ['dashboard'];\n\nconst filteredRoutes = getFilteredRoutes(messengerPageStore, selectedRoutesAndMenus);\nexport { filteredRoutes };\n","import * as React from 'react';\n\nconst Dashboard: React.FC = () => {\n return <> This is Dashboard page </>;\n};\n\nexport default Dashboard;\n","import * as React from 'react';\nimport { PostViewPage } from './../components/post/index';\nimport { MessengerComponent } from './../components/messenger'\n\nconst Messenger: React.FC = () => {\n return (\n <>\n <MessengerComponent />\n </>\n );\n};\n\nexport default Messenger;\n","import PlatformModule from './module';\n\nimport { Feature } from '@common-stack/client-react';\n\nexport default new Feature(PlatformModule);\n","/* eslint-disable import/no-extraneous-dependencies */\nimport { Feature } from '@common-stack/client-react';\nimport { filteredRoutes, DashboardProvider } from './compute';\n\nexport default new Feature({\n routeConfig: filteredRoutes,\n stylesInsert: [\n 'bootstrap/dist/css/bootstrap.css',\n 'jasny-bootstrap/dist/css/jasny-bootstrap.css',\n 'font-awesome/css/font-awesome.css',\n ],\n componentFillPlugins: [\n {\n name: 'report-fill-component',\n render: DashboardProvider,\n },\n ],\n});\n","export const getFilteredRoutes = (accountPageStore, selectedRoutes) =>\n accountPageStore\n .map((item) => {\n if (selectedRoutes.indexOf(item.key) !== -1) {\n const { path } = item;\n return {\n [path]: item,\n };\n }\n return null;\n })\n .filter((valid) => valid);\n","module.exports = require(\"@adminide-stack/platform-browser/lib/components\");","module.exports = require(\"@common-stack/client-react\");","module.exports = require(\"antd\");","module.exports = require(\"react\");","module.exports = require(\"react-intl\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/components/messenger/avatar/index.tsx","webpack:///./src/components/messenger/avatar/style.ts","webpack:///./src/components/messenger/index.tsx","webpack:///./src/components/messenger/messagesList/index.tsx","webpack:///./src/components/messenger/mock.ts","webpack:///./src/components/messenger/style.ts","webpack:///./src/compute.tsx","webpack:///./src/containers/Dashboard.tsx","webpack:///./src/containers/Messenger.tsx","webpack:///./src/index.tsx","webpack:///./src/module.ts","webpack:///./src/utils/index.ts","webpack:///external \"@adminide-stack/platform-browser/lib/components\"","webpack:///external \"@common-stack/client-react\"","webpack:///external \"antd\"","webpack:///external \"classnames\"","webpack:///external \"react\"","webpack:///external \"react-fela\"","webpack:///external \"react-intl\""],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;AClFA,2EAA0B;AAC1B,0FAAoC;AAEpC,yEAAqC;AACrC,iGAAqC;AAWxB,cAAM,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAU,EAAE,EAAE;IACnE,MAAM,EAAE,GAAG,EAAE,GAAG,oBAAO,EAAE,CAAC;IAC1B,MAAM,OAAO,GAAG,oBAAU,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAEpD,IAAI,IAAI,EAAE;QACN,OAAO,CACH,uCAAK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"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.tsx\");\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { useFela } from 'react-fela';\nimport { styleSheet } from './style';\n\ntype IAvatarSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';\n\ntype IProps = {\n text?: string;\n url?: string | any;\n size?: IAvatarSize;\n username?: string;\n};\n\nexport const Avatar = ({ url, size = 'md', text, username }: IProps) => {\n const { css } = useFela();\n const classes = classNames(`Avatar Avatar-${size}`);\n\n if (text) {\n return (\n <div className={css(styleSheet.avatarStyles as any)}>\n <div className={classes + ` Avatar-plain`} data-content={text} />\n </div>\n );\n }\n return (\n <div className={css(styleSheet.avatarStyles as any)}>\n <img src={url} className={classes} alt=\"\" />\n <div className=\"username\"> \n <h4>{username}</h4>\n <p>6:40</p>\n </div>\n </div>\n );\n};\n","export const styleSheet = {\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n avatarStyles: () => ({\n display: 'flex',\n alignItems: 'center',\n '& .Avatar': {\n '-webkit-user-select': 'none',\n /* Chrome all / Safari all */\n '-moz-user-select': 'none',\n /* Firefox all */\n '-ms-user-select': 'none',\n /* IE 10+ */\n 'user-select': 'none',\n verticalAlign: 'sub',\n },\n '& .Avatar, .Avatar:focus, .Avatar.a11y--focused': {\n borderRadius: '50%',\n },\n '& .Avatar.Avatar-xs': {\n width: '20px',\n minWidth: '20px',\n height: '20px',\n fontSize: '9.5px',\n },\n '& .Avatar.Avatar-sm': {\n width: '24px',\n minWidth: '24px',\n height: '24px',\n fontSize: '10px',\n },\n '& .Avatar.Avatar-md': {\n width: '32px',\n minWidth: '32px',\n height: '32px',\n fontSize: '12px',\n },\n '& .Avatar.Avatar-lg': {\n width: '36px',\n minWidth: '36px',\n height: '36px',\n fontSize: '14px',\n },\n '& .Avatar.Avatar-xl': {\n width: '50px',\n minWidth: '50px',\n height: '50px',\n fontSize: '18px',\n },\n '& .Avatar.Avatar-xxl': {\n width: '128px',\n minWidth: '128px',\n height: '128px',\n fontSize: '44px',\n },\n '& .Avatar.Avatar-plain': {\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: 'red',\n },\n '& .Avatar.Avatar-plain::before': {\n position: 'absolute',\n display: 'inline-flex',\n width: '100%',\n height: '100%',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '50%',\n color: 'rgba(0, 1, 0, )',\n content: 'attr(data-content)',\n },\n '& .username': {\n marginBottom: '30px',\n marginLeft: '10px',\n },\n '& .username p': {\n marginBottom: '30px',\n marginLeft: '10px',\n },\n }),\n};\n","import React, { FC, useState } from 'react';\nimport { Col, Row, Input, Card } from 'antd';\nimport { MessagesList } from './messagesList/index';\nimport { messagesData } from './mock';\nimport { IMessageList } from './types/message';\nimport { useFela } from 'react-fela';\nimport { styleSheet } from './style';\n\nexport const MessengerComponent: FC = () => {\n const { css } = useFela();\n const [enterValue, setEnterValue] = useState<string>('');\n const [userMessagesList, setUserMessagesList] = useState<IMessageList[]>(messagesData);\n const handleEnterButton = (e) => {\n setUserMessagesList([\n ...userMessagesList,\n {\n id: Math.random(),\n loginUser: true,\n message: enterValue,\n },\n ]);\n setEnterValue('');\n };\n\n return (\n <div className={css(styleSheet.messengerStyles as any)}>\n <Row gutter={[24, 6]}>\n <Card style={{ width: '100%', marginBottom: '100px' }}>\n <Col md={24}>\n <MessagesList userMessagesList={userMessagesList} />\n </Col>\n </Card>\n <Col md={24} className=\"message--box-outer\">\n <Input\n value={enterValue}\n onChange={(e: any) => setEnterValue(e?.target?.value)}\n onPressEnter={(e) => handleEnterButton(e)}\n placeholder=\"Please Enter\"\n />\n </Col>\n </Row>\n </div>\n );\n};\n","import React, { FC } from 'react';\nimport { Col, Row } from 'antd';\nimport { IMessageList } from '../types/message';\nimport { Avatar} from '../avatar'\n\ninterface IProps {\n userMessagesList: IMessageList[];\n}\nexport const MessagesList: FC<IProps> = ({ userMessagesList }) => {\n return ( \n <Row gutter={[24, 6]}>\n {userMessagesList?.map((item: IMessageList, index: number) => {\n if (!item.loginUser) {\n return (\n <Col md={24} key={index} style={{ textAlign: 'right' }}>\n <p>{item?.message}</p>\n </Col>\n );\n } else {\n return (\n <Col md={24} key={index}>\n <Avatar url='https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&ixlib=rb-1.2.1&w=1000&q=80' size='lg' username='admin'/>\n <p>{item?.message}</p>\n </Col>\n );\n }\n })}\n </Row>\n );\n};\n","export const messagesData = [\n {\n id: 1,\n loginUser: true,\n message: 'Hello!',\n },\n {\n id: 2,\n loginUser: false,\n message: 'Hey!',\n },\n {\n id: 3,\n loginUser: true,\n message: 'How are you!',\n },\n {\n id: 4,\n loginUser: false,\n message: 'I am fine!',\n },\n];\n\nexport const userProfile = [\n {\n displayName: 'nickname',\n isBusy: false,\n user: { username: 'Admin' },\n isShared: true,\n disablePopover: true,\n displayUsername: true,\n hasMention: false,\n hideStatus: false,\n },\n];\n","export const styleSheet = {\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n messengerStyles: () => ({\n display: 'inharit',\n '& .message--box-outer': {\n position: 'fixed',\n bottom: '10%',\n width: '84.7%',\n },\n }),\n};\n","import * as React from 'react';\nimport { IMenuPosition } from '@common-stack/client-react';\nimport { FileOutlined } from '@ant-design/icons';\nimport { userIsAuthenticatedRedir } from '@adminide-stack/user-auth0-browser';\nimport { DashboardFill } from '@adminide-stack/platform-browser/lib/components';\nimport { IPreDefineAccountPermissions, ConfigurationTarget } from '@adminide-stack/core';\nimport { getFilteredRoutes } from './utils';\nimport { IntlProvider } from 'react-intl';\n\nconst Dashboard = React.lazy(() => import('./containers/Dashboard'));\nconst Messenger = React.lazy(() => import('./containers/Messenger'));\n\nexport const DashboardProvider = () => {\n return (\n <DashboardFill>\n {/* <Dashboard/> */}\n <IntlProvider locale=\"en\">\n <Messenger />\n </IntlProvider>\n </DashboardFill>\n );\n};\n\nexport const messengerPageStore: any[] = [\n // {\n // exact: false,\n // icon: <FileOutlined />,\n // key: 'dashboard',\n // component: userIsAuthenticatedRedir(Dashboard),\n // position: IMenuPosition.MIDDLE,\n // tab: 'Dashboard',\n // name: 'Dashboard',\n // path: '/:orgName/o/dashboard',\n // priority: 1,\n // },\n];\n\nconst selectedRoutesAndMenus = ['dashboard'];\n\nconst filteredRoutes = getFilteredRoutes(messengerPageStore, selectedRoutesAndMenus);\nexport { filteredRoutes };\n","import * as React from 'react';\n\nconst Dashboard: React.FC = () => {\n return <> This is Dashboard page </>;\n};\n\nexport default Dashboard;\n","import * as React from 'react';\nimport { PostViewPage } from './../components/post/index';\nimport { MessengerComponent } from './../components/messenger'\n\nconst Messenger: React.FC = () => {\n return (\n <>\n <MessengerComponent />\n </>\n );\n};\n\nexport default Messenger;\n","import PlatformModule from './module';\n\nimport { Feature } from '@common-stack/client-react';\n\nexport default new Feature(PlatformModule);\n","/* eslint-disable import/no-extraneous-dependencies */\nimport { Feature } from '@common-stack/client-react';\nimport { filteredRoutes, DashboardProvider } from './compute';\n\nexport default new Feature({\n routeConfig: filteredRoutes,\n stylesInsert: [\n 'bootstrap/dist/css/bootstrap.css',\n 'jasny-bootstrap/dist/css/jasny-bootstrap.css',\n 'font-awesome/css/font-awesome.css',\n ],\n componentFillPlugins: [\n {\n name: 'report-fill-component',\n render: DashboardProvider,\n },\n ],\n});\n","export const getFilteredRoutes = (accountPageStore, selectedRoutes) =>\n accountPageStore\n .map((item) => {\n if (selectedRoutes.indexOf(item.key) !== -1) {\n const { path } = item;\n return {\n [path]: item,\n };\n }\n return null;\n })\n .filter((valid) => valid);\n","module.exports = require(\"@adminide-stack/platform-browser/lib/components\");","module.exports = require(\"@common-stack/client-react\");","module.exports = require(\"antd\");","module.exports = require(\"classnames\");","module.exports = require(\"react\");","module.exports = require(\"react-fela\");","module.exports = require(\"react-intl\");"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-box/platform-browser",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.17",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"typescript": {
|
|
65
65
|
"definition": "lib/index.d.ts"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "94fd90e6112304d90cb9895de90798a56cb0563a"
|
|
68
68
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
import { useFela } from 'react-fela';
|
|
5
|
+
import { styleSheet } from './style';
|
|
6
|
+
|
|
7
|
+
type IAvatarSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
8
|
+
|
|
9
|
+
type IProps = {
|
|
10
|
+
text?: string;
|
|
11
|
+
url?: string | any;
|
|
12
|
+
size?: IAvatarSize;
|
|
13
|
+
username?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Avatar = ({ url, size = 'md', text, username }: IProps) => {
|
|
17
|
+
const { css } = useFela();
|
|
18
|
+
const classes = classNames(`Avatar Avatar-${size}`);
|
|
19
|
+
|
|
20
|
+
if (text) {
|
|
21
|
+
return (
|
|
22
|
+
<div className={css(styleSheet.avatarStyles as any)}>
|
|
23
|
+
<div className={classes + ` Avatar-plain`} data-content={text} />
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return (
|
|
28
|
+
<div className={css(styleSheet.avatarStyles as any)}>
|
|
29
|
+
<img src={url} className={classes} alt="" />
|
|
30
|
+
<div className="username">
|
|
31
|
+
<h4>{username}</h4>
|
|
32
|
+
<p>6:40</p>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export const styleSheet = {
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
3
|
+
avatarStyles: () => ({
|
|
4
|
+
display: 'flex',
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
'& .Avatar': {
|
|
7
|
+
'-webkit-user-select': 'none',
|
|
8
|
+
/* Chrome all / Safari all */
|
|
9
|
+
'-moz-user-select': 'none',
|
|
10
|
+
/* Firefox all */
|
|
11
|
+
'-ms-user-select': 'none',
|
|
12
|
+
/* IE 10+ */
|
|
13
|
+
'user-select': 'none',
|
|
14
|
+
verticalAlign: 'sub',
|
|
15
|
+
},
|
|
16
|
+
'& .Avatar, .Avatar:focus, .Avatar.a11y--focused': {
|
|
17
|
+
borderRadius: '50%',
|
|
18
|
+
},
|
|
19
|
+
'& .Avatar.Avatar-xs': {
|
|
20
|
+
width: '20px',
|
|
21
|
+
minWidth: '20px',
|
|
22
|
+
height: '20px',
|
|
23
|
+
fontSize: '9.5px',
|
|
24
|
+
},
|
|
25
|
+
'& .Avatar.Avatar-sm': {
|
|
26
|
+
width: '24px',
|
|
27
|
+
minWidth: '24px',
|
|
28
|
+
height: '24px',
|
|
29
|
+
fontSize: '10px',
|
|
30
|
+
},
|
|
31
|
+
'& .Avatar.Avatar-md': {
|
|
32
|
+
width: '32px',
|
|
33
|
+
minWidth: '32px',
|
|
34
|
+
height: '32px',
|
|
35
|
+
fontSize: '12px',
|
|
36
|
+
},
|
|
37
|
+
'& .Avatar.Avatar-lg': {
|
|
38
|
+
width: '36px',
|
|
39
|
+
minWidth: '36px',
|
|
40
|
+
height: '36px',
|
|
41
|
+
fontSize: '14px',
|
|
42
|
+
},
|
|
43
|
+
'& .Avatar.Avatar-xl': {
|
|
44
|
+
width: '50px',
|
|
45
|
+
minWidth: '50px',
|
|
46
|
+
height: '50px',
|
|
47
|
+
fontSize: '18px',
|
|
48
|
+
},
|
|
49
|
+
'& .Avatar.Avatar-xxl': {
|
|
50
|
+
width: '128px',
|
|
51
|
+
minWidth: '128px',
|
|
52
|
+
height: '128px',
|
|
53
|
+
fontSize: '44px',
|
|
54
|
+
},
|
|
55
|
+
'& .Avatar.Avatar-plain': {
|
|
56
|
+
position: 'relative',
|
|
57
|
+
display: 'inline-flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
background: 'red',
|
|
61
|
+
},
|
|
62
|
+
'& .Avatar.Avatar-plain::before': {
|
|
63
|
+
position: 'absolute',
|
|
64
|
+
display: 'inline-flex',
|
|
65
|
+
width: '100%',
|
|
66
|
+
height: '100%',
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
borderRadius: '50%',
|
|
70
|
+
color: 'rgba(0, 1, 0, )',
|
|
71
|
+
content: 'attr(data-content)',
|
|
72
|
+
},
|
|
73
|
+
'& .username': {
|
|
74
|
+
marginBottom: '30px',
|
|
75
|
+
marginLeft: '10px',
|
|
76
|
+
},
|
|
77
|
+
'& .username p': {
|
|
78
|
+
marginBottom: '30px',
|
|
79
|
+
marginLeft: '10px',
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { FC, useState } from 'react';
|
|
2
|
-
import { Col, Row, Input } from 'antd';
|
|
2
|
+
import { Col, Row, Input, Card } from 'antd';
|
|
3
3
|
import { MessagesList } from './messagesList/index';
|
|
4
4
|
import { messagesData } from './mock';
|
|
5
5
|
import { IMessageList } from './types/message';
|
|
6
|
-
|
|
6
|
+
import { useFela } from 'react-fela';
|
|
7
|
+
import { styleSheet } from './style';
|
|
7
8
|
|
|
8
9
|
export const MessengerComponent: FC = () => {
|
|
10
|
+
const { css } = useFela();
|
|
9
11
|
const [enterValue, setEnterValue] = useState<string>('');
|
|
10
12
|
const [userMessagesList, setUserMessagesList] = useState<IMessageList[]>(messagesData);
|
|
11
13
|
const handleEnterButton = (e) => {
|
|
@@ -21,18 +23,22 @@ export const MessengerComponent: FC = () => {
|
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
return (
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
<div className={css(styleSheet.messengerStyles as any)}>
|
|
27
|
+
<Row gutter={[24, 6]}>
|
|
28
|
+
<Card style={{ width: '100%', marginBottom: '100px' }}>
|
|
29
|
+
<Col md={24}>
|
|
30
|
+
<MessagesList userMessagesList={userMessagesList} />
|
|
31
|
+
</Col>
|
|
32
|
+
</Card>
|
|
33
|
+
<Col md={24} className="message--box-outer">
|
|
34
|
+
<Input
|
|
35
|
+
value={enterValue}
|
|
36
|
+
onChange={(e: any) => setEnterValue(e?.target?.value)}
|
|
37
|
+
onPressEnter={(e) => handleEnterButton(e)}
|
|
38
|
+
placeholder="Please Enter"
|
|
39
|
+
/>
|
|
40
|
+
</Col>
|
|
41
|
+
</Row>
|
|
42
|
+
</div>
|
|
37
43
|
);
|
|
38
44
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { Col, Row } from 'antd';
|
|
3
3
|
import { IMessageList } from '../types/message';
|
|
4
|
+
import { Avatar} from '../avatar'
|
|
4
5
|
|
|
5
6
|
interface IProps {
|
|
6
|
-
userMessagesList: IMessageList[]
|
|
7
|
+
userMessagesList: IMessageList[];
|
|
7
8
|
}
|
|
8
9
|
export const MessagesList: FC<IProps> = ({ userMessagesList }) => {
|
|
9
|
-
return (
|
|
10
|
-
<Row>
|
|
11
|
-
{userMessagesList?.map((item:IMessageList, index: number) => {
|
|
10
|
+
return (
|
|
11
|
+
<Row gutter={[24, 6]}>
|
|
12
|
+
{userMessagesList?.map((item: IMessageList, index: number) => {
|
|
12
13
|
if (!item.loginUser) {
|
|
13
14
|
return (
|
|
14
15
|
<Col md={24} key={index} style={{ textAlign: 'right' }}>
|
|
@@ -18,6 +19,7 @@ export const MessagesList: FC<IProps> = ({ userMessagesList }) => {
|
|
|
18
19
|
} else {
|
|
19
20
|
return (
|
|
20
21
|
<Col md={24} key={index}>
|
|
22
|
+
<Avatar url='https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&ixlib=rb-1.2.1&w=1000&q=80' size='lg' username='admin'/>
|
|
21
23
|
<p>{item?.message}</p>
|
|
22
24
|
</Col>
|
|
23
25
|
);
|
|
@@ -20,3 +20,16 @@ export const messagesData = [
|
|
|
20
20
|
message: 'I am fine!',
|
|
21
21
|
},
|
|
22
22
|
];
|
|
23
|
+
|
|
24
|
+
export const userProfile = [
|
|
25
|
+
{
|
|
26
|
+
displayName: 'nickname',
|
|
27
|
+
isBusy: false,
|
|
28
|
+
user: { username: 'Admin' },
|
|
29
|
+
isShared: true,
|
|
30
|
+
disablePopover: true,
|
|
31
|
+
displayUsername: true,
|
|
32
|
+
hasMention: false,
|
|
33
|
+
hideStatus: false,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const styleSheet = {
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
3
|
+
messengerStyles: () => ({
|
|
4
|
+
display: 'inharit',
|
|
5
|
+
'& .message--box-outer': {
|
|
6
|
+
position: 'fixed',
|
|
7
|
+
bottom: '10%',
|
|
8
|
+
width: '84.7%',
|
|
9
|
+
},
|
|
10
|
+
}),
|
|
11
|
+
};
|