l-min-components 1.0.445 → 1.0.449

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.445",
3
+ "version": "1.0.449",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -37,7 +37,6 @@
37
37
  "react-input-emoji": "^5.3.1",
38
38
  "react-mic": "^12.4.6",
39
39
  "react-modal": "^3.16.1",
40
- "react-player": "2.12.0",
41
40
  "react-router-dom": "^6.8.2",
42
41
  "react-toastify": "^9.1.3",
43
42
  "react-tooltip": "^5.10.1",
@@ -8,7 +8,7 @@ import {
8
8
  } from "./index.styled";
9
9
  import { IoMdClose } from "react-icons/io";
10
10
  import Modal from "react-modal";
11
- import { ButtonComponent } from "l-min-components/src/components";
11
+ import ButtonComponent from "../../../button";
12
12
  import { WarningIcon } from "../../assets/svg/warning";
13
13
  import useMessaging from "../../hooks/useMessaging";
14
14
 
@@ -9,7 +9,7 @@ import {
9
9
  } from "./index.styled";
10
10
  import { IoMdClose } from "react-icons/io";
11
11
  import Modal from "react-modal";
12
- import { ButtonComponent } from "l-min-components/src/components";
12
+ import ButtonComponent from "../../../button";
13
13
  import { WarningIcon } from "../../assets/svg/warning";
14
14
  import useMessaging from "../../hooks/useMessaging";
15
15
  import { toast } from "react-toastify";
@@ -3,7 +3,8 @@ import moment from "moment";
3
3
  import { CheckCircleIcon } from "../../assets/svg/check_circle";
4
4
  import { MessageBox } from "../index.styled";
5
5
  import { getCookie } from "../../utils/helpers";
6
- import { Loader, OutletContext } from "l-min-components/src/components";
6
+ import Loader from "../../../loader";
7
+ import { OutletContext } from "../../../AppMainLayout";
7
8
  import WaveSurferPlayer from "./waveSurferPlayer";
8
9
  import { SendingStatusIcon } from "../../assets/svg/sending_status";
9
10
 
@@ -23,11 +23,11 @@ import ChatHeader from "./chatheader";
23
23
  import { getCookie } from "../utils/helpers";
24
24
  import useRooms from "../hooks/useRooms";
25
25
  import { NoMessage } from "../assets/svg/noMessage";
26
- import { Loader, OutletContext } from "l-min-components/src/components";
26
+ import Loader from "../../loader";
27
+ import { OutletContext } from "../../AppMainLayout";
27
28
  import { toast } from "react-toastify";
28
29
  import DeleteChatModal from "./message-modals/deleteChat-modal";
29
30
  import MessagesContext, { useMessagesContext } from "../hooks/messagesContext";
30
- import { ButtonComponent } from "l-min-components/src/components";
31
31
  import { BsFunnel } from "react-icons/bs";
32
32
  import { BsChevronDown } from "react-icons/bs";
33
33
  import { MdOutlineClose } from "react-icons/md";
@@ -59,7 +59,7 @@ const Messages = ({ close }) => {
59
59
  // } = useContext(MessagesContext);
60
60
  const { generalData, setRightLayout } = useContext(OutletContext);
61
61
  const [socketUrl, setSocketUrl] = useState(
62
- "dev-117782726-api.learngual.com/notify/v1/ws/connect/"
62
+ "dev-117782726-api.learngual.com/notify/v1/ws/connect/",
63
63
  );
64
64
  const [roomID, setRoomID] = useState("");
65
65
  const [userID, setUserID] = useState("");
@@ -159,7 +159,7 @@ const Messages = ({ close }) => {
159
159
 
160
160
  console.log("account_id", account_id);
161
161
  const websocket = new WebSocket(
162
- `wss://${socketUrl}?account=${account_id}&authorization=${token}`
162
+ `wss://${socketUrl}?account=${account_id}&authorization=${token}`,
163
163
  );
164
164
 
165
165
  useEffect(() => {
@@ -211,7 +211,7 @@ const Messages = ({ close }) => {
211
211
  const sortedList = chatListCopy?.sort(
212
212
  (chatA, chatB) =>
213
213
  new Date(chatA.last_message.created_at).getTime() -
214
- new Date(chatB.last_message.created_at).getTime()
214
+ new Date(chatB.last_message.created_at).getTime(),
215
215
  );
216
216
 
217
217
  setUserChatList(sortedList);
@@ -336,24 +336,23 @@ const Messages = ({ close }) => {
336
336
  )}
337
337
  </MessageBody>
338
338
  <div className="input">
339
- <InputSection
340
- setShowEmoji={setShowEmoji}
341
- userID={userID}
342
- setPreviewModalIsOpen={setPreviewModalIsOpen}
343
- mediaForm={mediaForm}
344
- setMediaForm={setMediaForm}
345
- setAllMessages={setAllMessages}
346
- allMessages={allMessages}
347
- newMessages={newMessages}
348
- setNewMessages={setNewMessages}
349
- setIsMessageSending={setIsMessageSending}
350
- lastMessage={lastMessage}
351
- setLastMessage={setLastMessage}
352
- handleRoomMessage={handleRoomMessage}
353
- roomID={roomID}
354
- />
339
+ <InputSection
340
+ setShowEmoji={setShowEmoji}
341
+ userID={userID}
342
+ setPreviewModalIsOpen={setPreviewModalIsOpen}
343
+ mediaForm={mediaForm}
344
+ setMediaForm={setMediaForm}
345
+ setAllMessages={setAllMessages}
346
+ allMessages={allMessages}
347
+ newMessages={newMessages}
348
+ setNewMessages={setNewMessages}
349
+ setIsMessageSending={setIsMessageSending}
350
+ lastMessage={lastMessage}
351
+ setLastMessage={setLastMessage}
352
+ handleRoomMessage={handleRoomMessage}
353
+ roomID={roomID}
354
+ />
355
355
  </div>
356
-
357
356
  </>
358
357
  </CardContainer>
359
358
 
@@ -4,29 +4,28 @@ import MoveUpDownWhite from "./assets/moveUppDownWhite";
4
4
  import "./style.scss";
5
5
  import { createEditor, Editor, Transforms } from "slate";
6
6
  import { Slate, Editable, withReact } from "slate-react";
7
- import { DropDownComponent,ButtonComponent, } from "l-min-components/src/components";
7
+ import DropDownComponent from "../dropdown component";
8
+ import ButtonComponent from "../button";
8
9
  // import { fontList } from "../../pages/createLectures/defaults";
9
10
  import EmojiPicker from "emoji-picker-react";
10
11
  import Grammerly from "./assets/grammerly";
11
- import { CompactPicker } from 'react-color'
12
+ import { CompactPicker } from "react-color";
12
13
  import ColorModal from "./colorModal";
13
14
 
14
15
  /**
15
16
  * @param {{
16
- * valueData: Object,
17
- * placeHolder: string,
18
- * }} props - properties of the editor
19
- */
17
+ * valueData: Object,
18
+ * placeHolder: string,
19
+ * }} props - properties of the editor
20
+ */
20
21
 
21
22
  const TextEditor = ({
22
23
  valueData,
23
24
  showOptions,
24
25
  announce,
25
- click,
26
+ click,
26
27
  placeHolder,
27
-
28
28
  }) => {
29
-
30
29
  const [heading, setHeading] = useState("");
31
30
  const [value, setValue] = useState(valueData);
32
31
  const editor = useMemo(() => withReact(createEditor()), []);
@@ -49,14 +48,14 @@ const TextEditor = ({
49
48
  event.preventDefault();
50
49
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
51
50
  setShowEmoji(false);
52
- setActive(false)
53
- }
51
+ setActive(false);
52
+ }
54
53
  };
55
54
 
56
55
  useEffect(() => {
57
- document.addEventListener('click', handleClickOutside);
56
+ document.addEventListener("click", handleClickOutside);
58
57
  return () => {
59
- document.removeEventListener('click', handleClickOutside);
58
+ document.removeEventListener("click", handleClickOutside);
60
59
  };
61
60
  }, []);
62
61
 
@@ -70,7 +69,7 @@ const TextEditor = ({
70
69
  // setActive(false)
71
70
  }
72
71
  };
73
-
72
+
74
73
  const isMarkActive = (editor, format) => {
75
74
  const marks = Editor.marks(editor);
76
75
  return marks ? marks[format] === true : false;
@@ -89,13 +88,12 @@ const TextEditor = ({
89
88
  return numbers;
90
89
  }, []);
91
90
 
92
-
93
91
  const handleEmojiButton = () => {
94
92
  setShowEmoji(!showEmoji);
95
93
  };
96
94
 
97
95
  const insertEmoji = useCallback((emoji) => {
98
- editor.insertText(emoji)
96
+ editor.insertText(emoji);
99
97
  }, []);
100
98
 
101
99
  return (
@@ -107,59 +105,69 @@ const TextEditor = ({
107
105
  onChange={(val) => {
108
106
  setValue(val);
109
107
  }}
110
- >
108
+ >
111
109
  <div className="editor-wrapper">
112
- {showEmoji && (
113
- <div
114
- className="emoji_picker"
115
- onMouseDown={(e) => {
116
- e.preventDefault();
117
- }}>
118
- <EmojiPicker
119
- onEmojiClick={(data) => {
120
- insertEmoji(data.emoji);
121
- }}
122
- autoFocusSearch={false}
123
- suggestedEmojisMode="frequent"
124
- lazyLoadEmojis={true}
125
- previewConfig={{
126
- showPreview: false,
127
- }}
128
- />
129
- </div>
130
- )}
131
- <ColorModal isOpen={showColor} onClose={() => setShowColor(false)} display={"none"} marginLeft={"0%"} top={"6%"} >
132
- <div className="color_picker">
133
- <CompactPicker
134
- color={fontColor}
135
- onChangeComplete={(color) => {
136
- setFontColor(color.hex);
137
- toggleMark(editor, "color", color.hex);
138
- }}
139
- />
140
- </div>
141
- </ColorModal>
110
+ {showEmoji && (
111
+ <div
112
+ className="emoji_picker"
113
+ onMouseDown={(e) => {
114
+ e.preventDefault();
115
+ }}
116
+ >
117
+ <EmojiPicker
118
+ onEmojiClick={(data) => {
119
+ insertEmoji(data.emoji);
120
+ }}
121
+ autoFocusSearch={false}
122
+ suggestedEmojisMode="frequent"
123
+ lazyLoadEmojis={true}
124
+ previewConfig={{
125
+ showPreview: false,
126
+ }}
127
+ />
128
+ </div>
129
+ )}
130
+ <ColorModal
131
+ isOpen={showColor}
132
+ onClose={() => setShowColor(false)}
133
+ display={"none"}
134
+ marginLeft={"0%"}
135
+ top={"6%"}
136
+ >
137
+ <div className="color_picker">
138
+ <CompactPicker
139
+ color={fontColor}
140
+ onChangeComplete={(color) => {
141
+ setFontColor(color.hex);
142
+ toggleMark(editor, "color", color.hex);
143
+ }}
144
+ />
145
+ </div>
146
+ </ColorModal>
142
147
  <div className="editor_area">
143
- {announce && (
144
- <input
148
+ {announce && (
149
+ <input
145
150
  placeholder="Announcement Heading"
146
151
  value={heading}
147
152
  onChange={(e) => setHeading(e.target.value)}
148
153
  />
149
- )}
150
-
154
+ )}
155
+
151
156
  <div className="editable">
152
- <Editable renderLeaf={(props) => <Leaf {...props} />} placeholder={placeHolder} />
157
+ <Editable
158
+ renderLeaf={(props) => <Leaf {...props} />}
159
+ placeholder={placeHolder}
160
+ />
153
161
  </div>
154
162
  </div>
155
-
156
163
 
157
164
  <div className="bottom">
158
165
  <div
159
166
  className="tool-bar"
160
167
  onMouseDown={(e) => {
161
168
  e.preventDefault();
162
- }}>
169
+ }}
170
+ >
163
171
  {/* <div className="font">
164
172
  <DropDownComponent
165
173
  className="font-dd"
@@ -187,7 +195,8 @@ const TextEditor = ({
187
195
  e.preventDefault();
188
196
  colorInput.current.click();
189
197
  setShowColor((state) => !state);
190
- }}>
198
+ }}
199
+ >
191
200
  <div className="wrap">
192
201
  <input
193
202
  type="color"
@@ -212,8 +221,9 @@ const TextEditor = ({
212
221
  onMouseDown={(event) => {
213
222
  event.preventDefault();
214
223
  toggleMark(editor, "bold");
215
- setBoldActive(!boldActive)
216
- }}>
224
+ setBoldActive(!boldActive);
225
+ }}
226
+ >
217
227
  <BoldIcons />
218
228
  </div>
219
229
  <div
@@ -221,17 +231,19 @@ const TextEditor = ({
221
231
  onMouseDown={(event) => {
222
232
  event.preventDefault();
223
233
  toggleMark(editor, "italic");
224
- setItalicActive(!italicActive)
225
- }}>
234
+ setItalicActive(!italicActive);
235
+ }}
236
+ >
226
237
  <ItalicIcon />
227
238
  </div>
228
239
  <div
229
- className={underlinective ? "active" : "underline"}
240
+ className={underlinective ? "active" : "underline"}
230
241
  onMouseDown={(event) => {
231
242
  event.preventDefault();
232
243
  toggleMark(editor, "underline");
233
- setUnderlineActive(!underlinective)
234
- }}>
244
+ setUnderlineActive(!underlinective);
245
+ }}
246
+ >
235
247
  <UnderlineIcon />
236
248
  </div>
237
249
  </div>
@@ -241,21 +253,23 @@ const TextEditor = ({
241
253
  onMouseDown={(event) => {
242
254
  event.preventDefault();
243
255
  toggleMark(editor, "textAlign", "left");
244
- setLeftActive(!leftActive)
245
- setCenterActive(false)
246
- setRightActive(false)
247
- }}>
256
+ setLeftActive(!leftActive);
257
+ setCenterActive(false);
258
+ setRightActive(false);
259
+ }}
260
+ >
248
261
  <TextAlignLeftIcon />
249
262
  </div>
250
263
  <div
251
- className={centerActive ? "a-center active" : "a-center"}
264
+ className={centerActive ? "a-center active" : "a-center"}
252
265
  onMouseDown={(event) => {
253
266
  event.preventDefault();
254
267
  toggleMark(editor, "textAlign", "center");
255
- setCenterActive(!centerActive)
256
- setLeftActive(false)
257
- setRightActive(false)
258
- }}>
268
+ setCenterActive(!centerActive);
269
+ setLeftActive(false);
270
+ setRightActive(false);
271
+ }}
272
+ >
259
273
  <TextAlignCenterIcon />
260
274
  </div>
261
275
  <div
@@ -263,40 +277,43 @@ const TextEditor = ({
263
277
  onMouseDown={(event) => {
264
278
  event.preventDefault();
265
279
  toggleMark(editor, "textAlign", "right");
266
- setRightActive(!rightActive)
267
- setCenterActive(false)
268
- setLeftActive(false)
269
- }}>
280
+ setRightActive(!rightActive);
281
+ setCenterActive(false);
282
+ setLeftActive(false);
283
+ }}
284
+ >
270
285
  <TextAlignRight />
271
286
  </div>
272
287
  </div>
273
- <div className="list" >
288
+ <div className="list">
274
289
  <div
275
290
  className={listActive ? "list-icon active" : "list-icon"}
276
291
  onClick={() => {
277
292
  toggleMark(editor, "list");
278
- setListActive(!listActive)
279
- }}>
293
+ setListActive(!listActive);
294
+ }}
295
+ >
280
296
  <ListIcon />
281
297
  </div>
282
298
  {/* <div className="first-line-icon">
283
299
  <FirstLineIcon />
284
300
  </div> */}
285
301
  </div>
286
- <button className={active ? "emoji_button_active" : "emoji_button" }
287
- // onClick={handleEmojiButton}
288
- onMouseDown={(e) => {
289
- e.preventDefault();
290
- setShowEmoji((state) => !state);
291
- setActive(!active)
292
- }}
302
+ <button
303
+ className={active ? "emoji_button_active" : "emoji_button"}
304
+ // onClick={handleEmojiButton}
305
+ onMouseDown={(e) => {
306
+ e.preventDefault();
307
+ setShowEmoji((state) => !state);
308
+ setActive(!active);
309
+ }}
293
310
  >
294
311
  {" "}
295
- <Grammerly />{" "}
312
+ <Grammerly />{" "}
296
313
  </button>
297
314
  </div>
298
315
  {announce && (
299
- <ButtonComponent
316
+ <ButtonComponent
300
317
  text="Create Announcement"
301
318
  styles={{
302
319
  fontSize: "18px",
@@ -309,7 +326,7 @@ const TextEditor = ({
309
326
  // marginLeft: "15px",
310
327
  }}
311
328
  onClick={click}
312
- />
329
+ />
313
330
  )}
314
331
  </div>
315
332
  </div>
@@ -393,7 +410,8 @@ const BoldIcons = (props) => (
393
410
  height="25"
394
411
  viewBox="0 0 25 25"
395
412
  fill="none"
396
- xmlns="http://www.w3.org/2000/svg">
413
+ xmlns="http://www.w3.org/2000/svg"
414
+ >
397
415
  <path
398
416
  d="M5.80664 5.27344C5.80664 4.17344 6.70664 3.27344 7.80664 3.27344H12.9266C15.5466 3.27344 17.6766 5.40344 17.6766 8.02344C17.6766 10.6434 15.5466 12.7734 12.9266 12.7734H5.80664V5.27344Z"
399
417
  stroke={props.stroke ?? "#313333"}
@@ -417,7 +435,8 @@ const ItalicIcon = () => (
417
435
  height="25"
418
436
  viewBox="0 0 25 25"
419
437
  fill="none"
420
- xmlns="http://www.w3.org/2000/svg">
438
+ xmlns="http://www.w3.org/2000/svg"
439
+ >
421
440
  <path
422
441
  d="M10.5449 3.77344H19.7949"
423
442
  stroke="#949999"
@@ -448,7 +467,8 @@ const UnderlineIcon = () => (
448
467
  height="25"
449
468
  viewBox="0 0 25 25"
450
469
  fill="none"
451
- xmlns="http://www.w3.org/2000/svg">
470
+ xmlns="http://www.w3.org/2000/svg"
471
+ >
452
472
  <path
453
473
  d="M5.92578 21.7734H19.9258"
454
474
  stroke="#949999"
@@ -472,7 +492,8 @@ const ArrowDown = () => (
472
492
  height="15"
473
493
  viewBox="0 0 15 15"
474
494
  fill="none"
475
- xmlns="http://www.w3.org/2000/svg">
495
+ xmlns="http://www.w3.org/2000/svg"
496
+ >
476
497
  <path
477
498
  d="M12.5466 5.99219L8.74331 9.79552C8.29414 10.2447 7.55914 10.2447 7.10997 9.79552L3.30664 5.99219"
478
499
  stroke="#949999"
@@ -490,7 +511,8 @@ const TextAlignLeftIcon = () => (
490
511
  height="25"
491
512
  viewBox="0 0 25 25"
492
513
  fill="none"
493
- xmlns="http://www.w3.org/2000/svg">
514
+ xmlns="http://www.w3.org/2000/svg"
515
+ >
494
516
  <path
495
517
  d="M3.92578 5.27344H21.9258"
496
518
  stroke="#949999"
@@ -528,7 +550,8 @@ const TextAlignCenterIcon = () => (
528
550
  height="25"
529
551
  viewBox="0 0 25 25"
530
552
  fill="none"
531
- xmlns="http://www.w3.org/2000/svg">
553
+ xmlns="http://www.w3.org/2000/svg"
554
+ >
532
555
  <path
533
556
  d="M3.92578 5.27344H21.9258"
534
557
  stroke="#949999"
@@ -566,7 +589,8 @@ const TextAlignRight = () => (
566
589
  height="25"
567
590
  viewBox="0 0 25 25"
568
591
  fill="none"
569
- xmlns="http://www.w3.org/2000/svg">
592
+ xmlns="http://www.w3.org/2000/svg"
593
+ >
570
594
  <path
571
595
  d="M3.92578 5.27344H21.9258"
572
596
  stroke="#949999"
@@ -604,7 +628,8 @@ const ListIcon = () => (
604
628
  height="25"
605
629
  viewBox="0 0 25 25"
606
630
  fill="none"
607
- xmlns="http://www.w3.org/2000/svg">
631
+ xmlns="http://www.w3.org/2000/svg"
632
+ >
608
633
  <path
609
634
  d="M11.9258 20.2734H21.9258"
610
635
  stroke="#949999"
@@ -656,7 +681,8 @@ const FirstLineIcon = () => (
656
681
  height="25"
657
682
  viewBox="0 0 25 25"
658
683
  fill="none"
659
- xmlns="http://www.w3.org/2000/svg">
684
+ xmlns="http://www.w3.org/2000/svg"
685
+ >
660
686
  <path
661
687
  d="M14.9258 5.27344H21.9258"
662
688
  stroke="#949999"