pds-dev-kit-web 2.2.255 → 2.2.256
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/dist/src/common/services/i18n/resources/en.json +2 -1
- package/dist/src/common/services/i18n/resources/es.json +2 -1
- package/dist/src/common/services/i18n/resources/fil.json +2 -1
- package/dist/src/common/services/i18n/resources/index.d.ts +7 -0
- package/dist/src/common/services/i18n/resources/ja.json +2 -1
- package/dist/src/common/services/i18n/resources/ko.json +2 -1
- package/dist/src/common/services/i18n/resources/zh-cn.json +2 -1
- package/dist/src/common/services/i18n/resources/zh-tw.json +2 -1
- package/dist/src/common/styles/colorSet/UIColor.json +6 -1
- package/dist/src/common/styles/colorSet/index.d.ts +131 -126
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/styles/colorSet/ui-type.d.ts +5 -0
- package/dist/src/desktop/components/ChatBubbleListItem/ChatBubbleListItem.d.ts +12 -1
- package/dist/src/desktop/components/ChatBubbleListItem/ChatBubbleListItem.js +12 -7
- package/dist/src/desktop/components/ChatBubbleListItem/components/ReactionBubble.d.ts +11 -0
- package/dist/src/desktop/components/ChatBubbleListItem/components/ReactionBubble.js +86 -0
- package/dist/src/desktop/components/ChatBubbleListItem/components/ReactionRow.d.ts +18 -0
- package/dist/src/desktop/components/ChatBubbleListItem/components/ReactionRow.js +133 -0
- package/dist/src/desktop/components/ChatBubbleListItem/components/index.d.ts +1 -0
- package/dist/src/desktop/components/ChatBubbleListItem/components/index.js +8 -0
- package/dist/src/hybrid/components/LottieIcon/LottieIcon.js +1 -1
- package/dist/src/mobile/components/ChatBubbleListItem/ChatBubbleListItem.d.ts +12 -1
- package/dist/src/mobile/components/ChatBubbleListItem/ChatBubbleListItem.js +12 -7
- package/dist/src/mobile/components/ChatBubbleListItem/components/ReactionBubble.d.ts +11 -0
- package/dist/src/mobile/components/ChatBubbleListItem/components/ReactionBubble.js +86 -0
- package/dist/src/mobile/components/ChatBubbleListItem/components/ReactionRow.d.ts +18 -0
- package/dist/src/mobile/components/ChatBubbleListItem/components/ReactionRow.js +126 -0
- package/dist/src/mobile/components/ChatBubbleListItem/components/index.d.ts +1 -0
- package/dist/src/mobile/components/ChatBubbleListItem/components/index.js +8 -0
- package/package.json +1 -1
- package/release-note.md +2 -1
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"str_9069": "If French is not entered, members will see the content in English.",
|
|
103
103
|
"str_9070": "If Spanish is not entered, members will see the content in English.",
|
|
104
104
|
"str_upload": "Upload",
|
|
105
|
-
"str_delete": "Delete"
|
|
105
|
+
"str_delete": "Delete",
|
|
106
|
+
"str_reaction": "Reaction"
|
|
106
107
|
}
|
|
107
108
|
}
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"str_9069": "Si no ingresa en francés, se mostrará a los miembros en inglés.",
|
|
103
103
|
"str_9070": "Si no ingresa en español, se mostrará a los miembros en inglés.",
|
|
104
104
|
"str_upload": "Subir",
|
|
105
|
-
"str_delete": "borrar"
|
|
105
|
+
"str_delete": "borrar",
|
|
106
|
+
"str_reaction": "Reaction"
|
|
106
107
|
}
|
|
107
108
|
}
|
|
@@ -105,6 +105,7 @@ declare const locale: {
|
|
|
105
105
|
str_9070: string;
|
|
106
106
|
str_upload: string;
|
|
107
107
|
str_delete: string;
|
|
108
|
+
str_reaction: string;
|
|
108
109
|
};
|
|
109
110
|
};
|
|
110
111
|
readonly en: {
|
|
@@ -212,6 +213,7 @@ declare const locale: {
|
|
|
212
213
|
str_9070: string;
|
|
213
214
|
str_upload: string;
|
|
214
215
|
str_delete: string;
|
|
216
|
+
str_reaction: string;
|
|
215
217
|
};
|
|
216
218
|
};
|
|
217
219
|
readonly ja: {
|
|
@@ -319,6 +321,7 @@ declare const locale: {
|
|
|
319
321
|
str_9070: string;
|
|
320
322
|
str_upload: string;
|
|
321
323
|
str_delete: string;
|
|
324
|
+
str_reaction: string;
|
|
322
325
|
};
|
|
323
326
|
};
|
|
324
327
|
readonly es: {
|
|
@@ -426,6 +429,7 @@ declare const locale: {
|
|
|
426
429
|
str_9070: string;
|
|
427
430
|
str_upload: string;
|
|
428
431
|
str_delete: string;
|
|
432
|
+
str_reaction: string;
|
|
429
433
|
};
|
|
430
434
|
};
|
|
431
435
|
readonly 'zh-cn': {
|
|
@@ -533,6 +537,7 @@ declare const locale: {
|
|
|
533
537
|
str_9070: string;
|
|
534
538
|
str_upload: string;
|
|
535
539
|
str_delete: string;
|
|
540
|
+
str_reaction: string;
|
|
536
541
|
};
|
|
537
542
|
};
|
|
538
543
|
readonly 'zh-tw': {
|
|
@@ -640,6 +645,7 @@ declare const locale: {
|
|
|
640
645
|
str_9070: string;
|
|
641
646
|
str_upload: string;
|
|
642
647
|
str_delete: string;
|
|
648
|
+
str_reaction: string;
|
|
643
649
|
};
|
|
644
650
|
};
|
|
645
651
|
readonly fil: {
|
|
@@ -740,6 +746,7 @@ declare const locale: {
|
|
|
740
746
|
str_friendly_currency_dollar: string;
|
|
741
747
|
str_upload: string;
|
|
742
748
|
str_delete: string;
|
|
749
|
+
str_reaction: string;
|
|
743
750
|
};
|
|
744
751
|
};
|
|
745
752
|
};
|
|
@@ -905,5 +905,10 @@
|
|
|
905
905
|
"ui_142": "sys_widget_grey_08",
|
|
906
906
|
"ui_143": "sys_on_base_hover_01",
|
|
907
907
|
"ui_144": "sys_on_base_pressed_01",
|
|
908
|
-
"ui_cpnt_badge_base_confirm": "sys_component_base_green"
|
|
908
|
+
"ui_cpnt_badge_base_confirm": "sys_component_base_green",
|
|
909
|
+
"ui_cpnt_message_reaction_base_01": "sys_component_pastel_base_01",
|
|
910
|
+
"ui_cpnt_message_reaction_base_02": "sys_component_pastel_base_02",
|
|
911
|
+
"ui_cpnt_message_reaction_base_03": "sys_component_pastel_base_03",
|
|
912
|
+
"ui_cpnt_message_reaction_base_04": "sys_component_pastel_base_04",
|
|
913
|
+
"ui_cpnt_message_reaction_base_05": "sys_component_pastel_base_05"
|
|
909
914
|
}
|
|
@@ -1,5 +1,129 @@
|
|
|
1
1
|
declare const colorSet: {
|
|
2
|
-
readonly
|
|
2
|
+
readonly SemanticColor: {
|
|
3
|
+
blue500: string;
|
|
4
|
+
blue700: string;
|
|
5
|
+
blue300: string;
|
|
6
|
+
green700: string;
|
|
7
|
+
green500: string;
|
|
8
|
+
green300: string;
|
|
9
|
+
red500: string;
|
|
10
|
+
grey900: string;
|
|
11
|
+
grey500: string;
|
|
12
|
+
grey400: string;
|
|
13
|
+
grey100: string;
|
|
14
|
+
grey50: string;
|
|
15
|
+
white: string;
|
|
16
|
+
black: string;
|
|
17
|
+
darkblue500: string;
|
|
18
|
+
grey950: string;
|
|
19
|
+
darkgrey900: string;
|
|
20
|
+
darkgrey500: string;
|
|
21
|
+
darkgrey400: string;
|
|
22
|
+
darkgrey100: string;
|
|
23
|
+
darkgrey50: string;
|
|
24
|
+
darkred500: string;
|
|
25
|
+
darkgreen700: string;
|
|
26
|
+
orange500: string;
|
|
27
|
+
darkorange500: string;
|
|
28
|
+
opacity00: string;
|
|
29
|
+
opacity20: string;
|
|
30
|
+
opacity30: string;
|
|
31
|
+
opacity65: string;
|
|
32
|
+
darkgreen500: string;
|
|
33
|
+
grey70: string;
|
|
34
|
+
navy500: string;
|
|
35
|
+
lightgreen500: string;
|
|
36
|
+
pink500: string;
|
|
37
|
+
darkgrey70: string;
|
|
38
|
+
darknavy500: string;
|
|
39
|
+
darkpink500: string;
|
|
40
|
+
darklightgreen500: string;
|
|
41
|
+
opacity10: string;
|
|
42
|
+
grey600: string;
|
|
43
|
+
darkgrey600: string;
|
|
44
|
+
skyblue500: string;
|
|
45
|
+
skyblue300: string;
|
|
46
|
+
pink300: string;
|
|
47
|
+
lightpink500: string;
|
|
48
|
+
darkblue300: string;
|
|
49
|
+
darkblue700: string;
|
|
50
|
+
darkgreen300: string;
|
|
51
|
+
darkskyblue500: string;
|
|
52
|
+
navy100: string;
|
|
53
|
+
darknavy100: string;
|
|
54
|
+
opacity80: string;
|
|
55
|
+
opacity50: string;
|
|
56
|
+
grey30: string;
|
|
57
|
+
opacity95: string;
|
|
58
|
+
darkgrey30: string;
|
|
59
|
+
opacity40: string;
|
|
60
|
+
kakaoyellow: string;
|
|
61
|
+
pastelblue500: string;
|
|
62
|
+
pastelpink500: string;
|
|
63
|
+
pastelorange500: string;
|
|
64
|
+
pastelgreen500: string;
|
|
65
|
+
pastelpurple500: string;
|
|
66
|
+
darkpastelblue500: string;
|
|
67
|
+
darkpastelpink500: string;
|
|
68
|
+
darkpastelorange500: string;
|
|
69
|
+
darkpastelgreen500: string;
|
|
70
|
+
darkpastelpurple500: string;
|
|
71
|
+
green30: string;
|
|
72
|
+
darkgreen30: string;
|
|
73
|
+
orange50: string;
|
|
74
|
+
darkorange50: string;
|
|
75
|
+
orange30: string;
|
|
76
|
+
darkorange30: string;
|
|
77
|
+
green50: string;
|
|
78
|
+
darkgreen50: string;
|
|
79
|
+
opacity90: string;
|
|
80
|
+
facebookblue: string;
|
|
81
|
+
opacity05: string;
|
|
82
|
+
opacity15: string;
|
|
83
|
+
grey80: string;
|
|
84
|
+
grey200: string;
|
|
85
|
+
darkgrey80: string;
|
|
86
|
+
darkgrey200: string;
|
|
87
|
+
opacity70: string;
|
|
88
|
+
opacity60: string;
|
|
89
|
+
skyblue100: string;
|
|
90
|
+
green100: string;
|
|
91
|
+
darkgreen100: string;
|
|
92
|
+
darkskyblue100: string;
|
|
93
|
+
opacity25: string;
|
|
94
|
+
opacity35: string;
|
|
95
|
+
grey10: string;
|
|
96
|
+
darkgrey10: string;
|
|
97
|
+
blue50: string;
|
|
98
|
+
darkblue50: string;
|
|
99
|
+
blue10: string;
|
|
100
|
+
red10: string;
|
|
101
|
+
green10: string;
|
|
102
|
+
blue30: string;
|
|
103
|
+
red30: string;
|
|
104
|
+
orange300: string;
|
|
105
|
+
darkorange300: string;
|
|
106
|
+
darkpink300: string;
|
|
107
|
+
pastelblue300: string;
|
|
108
|
+
darkpastelblue300: string;
|
|
109
|
+
softpurple500: string;
|
|
110
|
+
darksoftpurple500: string;
|
|
111
|
+
coolpink500: string;
|
|
112
|
+
darkcoolpink500: string;
|
|
113
|
+
brown500: string;
|
|
114
|
+
darkbrown500: string;
|
|
115
|
+
yellow300: string;
|
|
116
|
+
darkyellow300: string;
|
|
117
|
+
grey20: string;
|
|
118
|
+
darkgrey20: string;
|
|
119
|
+
grey300: string;
|
|
120
|
+
darkgrey300: string;
|
|
121
|
+
yellow500: string;
|
|
122
|
+
darkyellow500: string;
|
|
123
|
+
grey450: string;
|
|
124
|
+
darkgrey450: string;
|
|
125
|
+
};
|
|
126
|
+
readonly PaletteColor_light: {
|
|
3
127
|
sys_container_background_01: string;
|
|
4
128
|
sys_container_background_02: string;
|
|
5
129
|
sys_container_background_03: string;
|
|
@@ -382,131 +506,7 @@ declare const colorSet: {
|
|
|
382
506
|
sys_on_base_hover_01: string;
|
|
383
507
|
sys_on_base_pressed_01: string;
|
|
384
508
|
};
|
|
385
|
-
readonly
|
|
386
|
-
blue500: string;
|
|
387
|
-
blue700: string;
|
|
388
|
-
blue300: string;
|
|
389
|
-
green700: string;
|
|
390
|
-
green500: string;
|
|
391
|
-
green300: string;
|
|
392
|
-
red500: string;
|
|
393
|
-
grey900: string;
|
|
394
|
-
grey500: string;
|
|
395
|
-
grey400: string;
|
|
396
|
-
grey100: string;
|
|
397
|
-
grey50: string;
|
|
398
|
-
white: string;
|
|
399
|
-
black: string;
|
|
400
|
-
darkblue500: string;
|
|
401
|
-
grey950: string;
|
|
402
|
-
darkgrey900: string;
|
|
403
|
-
darkgrey500: string;
|
|
404
|
-
darkgrey400: string;
|
|
405
|
-
darkgrey100: string;
|
|
406
|
-
darkgrey50: string;
|
|
407
|
-
darkred500: string;
|
|
408
|
-
darkgreen700: string;
|
|
409
|
-
orange500: string;
|
|
410
|
-
darkorange500: string;
|
|
411
|
-
opacity00: string;
|
|
412
|
-
opacity20: string;
|
|
413
|
-
opacity30: string;
|
|
414
|
-
opacity65: string;
|
|
415
|
-
darkgreen500: string;
|
|
416
|
-
grey70: string;
|
|
417
|
-
navy500: string;
|
|
418
|
-
lightgreen500: string;
|
|
419
|
-
pink500: string;
|
|
420
|
-
darkgrey70: string;
|
|
421
|
-
darknavy500: string;
|
|
422
|
-
darkpink500: string;
|
|
423
|
-
darklightgreen500: string;
|
|
424
|
-
opacity10: string;
|
|
425
|
-
grey600: string;
|
|
426
|
-
darkgrey600: string;
|
|
427
|
-
skyblue500: string;
|
|
428
|
-
skyblue300: string;
|
|
429
|
-
pink300: string;
|
|
430
|
-
lightpink500: string;
|
|
431
|
-
darkblue300: string;
|
|
432
|
-
darkblue700: string;
|
|
433
|
-
darkgreen300: string;
|
|
434
|
-
darkskyblue500: string;
|
|
435
|
-
navy100: string;
|
|
436
|
-
darknavy100: string;
|
|
437
|
-
opacity80: string;
|
|
438
|
-
opacity50: string;
|
|
439
|
-
grey30: string;
|
|
440
|
-
opacity95: string;
|
|
441
|
-
darkgrey30: string;
|
|
442
|
-
opacity40: string;
|
|
443
|
-
kakaoyellow: string;
|
|
444
|
-
pastelblue500: string;
|
|
445
|
-
pastelpink500: string;
|
|
446
|
-
pastelorange500: string;
|
|
447
|
-
pastelgreen500: string;
|
|
448
|
-
pastelpurple500: string;
|
|
449
|
-
darkpastelblue500: string;
|
|
450
|
-
darkpastelpink500: string;
|
|
451
|
-
darkpastelorange500: string;
|
|
452
|
-
darkpastelgreen500: string;
|
|
453
|
-
darkpastelpurple500: string;
|
|
454
|
-
green30: string;
|
|
455
|
-
darkgreen30: string;
|
|
456
|
-
orange50: string;
|
|
457
|
-
darkorange50: string;
|
|
458
|
-
orange30: string;
|
|
459
|
-
darkorange30: string;
|
|
460
|
-
green50: string;
|
|
461
|
-
darkgreen50: string;
|
|
462
|
-
opacity90: string;
|
|
463
|
-
facebookblue: string;
|
|
464
|
-
opacity05: string;
|
|
465
|
-
opacity15: string;
|
|
466
|
-
grey80: string;
|
|
467
|
-
grey200: string;
|
|
468
|
-
darkgrey80: string;
|
|
469
|
-
darkgrey200: string;
|
|
470
|
-
opacity70: string;
|
|
471
|
-
opacity60: string;
|
|
472
|
-
skyblue100: string;
|
|
473
|
-
green100: string;
|
|
474
|
-
darkgreen100: string;
|
|
475
|
-
darkskyblue100: string;
|
|
476
|
-
opacity25: string;
|
|
477
|
-
opacity35: string;
|
|
478
|
-
grey10: string;
|
|
479
|
-
darkgrey10: string;
|
|
480
|
-
blue50: string;
|
|
481
|
-
darkblue50: string;
|
|
482
|
-
blue10: string;
|
|
483
|
-
red10: string;
|
|
484
|
-
green10: string;
|
|
485
|
-
blue30: string;
|
|
486
|
-
red30: string;
|
|
487
|
-
orange300: string;
|
|
488
|
-
darkorange300: string;
|
|
489
|
-
darkpink300: string;
|
|
490
|
-
pastelblue300: string;
|
|
491
|
-
darkpastelblue300: string;
|
|
492
|
-
softpurple500: string;
|
|
493
|
-
darksoftpurple500: string;
|
|
494
|
-
coolpink500: string;
|
|
495
|
-
darkcoolpink500: string;
|
|
496
|
-
brown500: string;
|
|
497
|
-
darkbrown500: string;
|
|
498
|
-
yellow300: string;
|
|
499
|
-
darkyellow300: string;
|
|
500
|
-
grey20: string;
|
|
501
|
-
darkgrey20: string;
|
|
502
|
-
grey300: string;
|
|
503
|
-
darkgrey300: string;
|
|
504
|
-
yellow500: string;
|
|
505
|
-
darkyellow500: string;
|
|
506
|
-
grey450: string;
|
|
507
|
-
darkgrey450: string;
|
|
508
|
-
};
|
|
509
|
-
readonly PaletteColor_light: {
|
|
509
|
+
readonly PaletteColor_Dark: {
|
|
510
510
|
sys_container_background_01: string;
|
|
511
511
|
sys_container_background_02: string;
|
|
512
512
|
sys_container_background_03: string;
|
|
@@ -1797,6 +1797,11 @@ declare const colorSet: {
|
|
|
1797
1797
|
ui_143: string;
|
|
1798
1798
|
ui_144: string;
|
|
1799
1799
|
ui_cpnt_badge_base_confirm: string;
|
|
1800
|
+
ui_cpnt_message_reaction_base_01: string;
|
|
1801
|
+
ui_cpnt_message_reaction_base_02: string;
|
|
1802
|
+
ui_cpnt_message_reaction_base_03: string;
|
|
1803
|
+
ui_cpnt_message_reaction_base_04: string;
|
|
1804
|
+
ui_cpnt_message_reaction_base_05: string;
|
|
1800
1805
|
};
|
|
1801
1806
|
};
|
|
1802
1807
|
export default colorSet;
|
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
/* eslint-disable import/order */
|
|
7
|
-
var PaletteColor_Dark_json_1 = __importDefault(require("./PaletteColor_Dark.json"));
|
|
8
7
|
var SemanticColor_json_1 = __importDefault(require("./SemanticColor.json"));
|
|
9
8
|
var PaletteColor_light_json_1 = __importDefault(require("./PaletteColor_light.json"));
|
|
9
|
+
var PaletteColor_Dark_json_1 = __importDefault(require("./PaletteColor_Dark.json"));
|
|
10
10
|
var UIColor_json_1 = __importDefault(require("./UIColor.json"));
|
|
11
11
|
var colorSet = {
|
|
12
|
-
PaletteColor_Dark: PaletteColor_Dark_json_1.default,
|
|
13
12
|
SemanticColor: SemanticColor_json_1.default,
|
|
14
13
|
PaletteColor_light: PaletteColor_light_json_1.default,
|
|
14
|
+
PaletteColor_Dark: PaletteColor_Dark_json_1.default,
|
|
15
15
|
UIColor: UIColor_json_1.default
|
|
16
16
|
};
|
|
17
17
|
exports.default = colorSet;
|
|
@@ -906,4 +906,9 @@ export interface UITheme {
|
|
|
906
906
|
ui_143: string;
|
|
907
907
|
ui_144: string;
|
|
908
908
|
ui_cpnt_badge_base_confirm: string;
|
|
909
|
+
ui_cpnt_message_reaction_base_01: string;
|
|
910
|
+
ui_cpnt_message_reaction_base_02: string;
|
|
911
|
+
ui_cpnt_message_reaction_base_03: string;
|
|
912
|
+
ui_cpnt_message_reaction_base_04: string;
|
|
913
|
+
ui_cpnt_message_reaction_base_05: string;
|
|
909
914
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PDSTextType, PDSValueOption } from '../../../common';
|
|
3
3
|
type ColorThemeType = 'grey' | 'brand_primary' | 'translucent_white' | 'translucent_black' | 'transparent';
|
|
4
|
+
type ReactionType = 'heart' | 'like' | 'confetti';
|
|
5
|
+
type ReactionValueOption = {
|
|
6
|
+
type: ReactionType;
|
|
7
|
+
count: number;
|
|
8
|
+
};
|
|
9
|
+
type ReactionArrayType = ReactionValueOption[];
|
|
4
10
|
export type ChatBubbleListItemProps = {
|
|
5
11
|
titleText?: PDSTextType;
|
|
6
12
|
imageSrc?: string;
|
|
@@ -14,8 +20,13 @@ export type ChatBubbleListItemProps = {
|
|
|
14
20
|
contextMenuState?: 'normal' | 'disabled';
|
|
15
21
|
children?: React.ReactNode;
|
|
16
22
|
downloadIBtnMode?: 'use' | 'none';
|
|
23
|
+
reactionBtnMode?: 'use' | 'none';
|
|
24
|
+
reactionBtnText?: string;
|
|
25
|
+
reactionArray?: ReactionArrayType;
|
|
26
|
+
reactionBubblePosition?: 'top' | 'bottom';
|
|
17
27
|
onClickContextMenuItem?: (option: PDSValueOption) => void;
|
|
18
28
|
onClickDownloadIBtn?: () => void;
|
|
29
|
+
onClickReactionBtn?: (type: ReactionType) => void;
|
|
19
30
|
};
|
|
20
|
-
declare function ChatBubbleListItem({ titleText, imageSrc, hoverMode, styleTheme, colorTheme, timeMode, timeText, labelText, contextMenuOptionArray, contextMenuState, children, downloadIBtnMode, onClickContextMenuItem, onClickDownloadIBtn }: ChatBubbleListItemProps): JSX.Element;
|
|
31
|
+
declare function ChatBubbleListItem({ titleText, imageSrc, hoverMode, styleTheme, colorTheme, timeMode, timeText, labelText, contextMenuOptionArray, contextMenuState, children, downloadIBtnMode, reactionBtnMode, reactionBtnText, reactionArray, reactionBubblePosition, onClickContextMenuItem, onClickDownloadIBtn, onClickReactionBtn }: ChatBubbleListItemProps): JSX.Element;
|
|
21
32
|
export default ChatBubbleListItem;
|
|
@@ -50,6 +50,7 @@ var ContextMenuItem_1 = require("../ContextMenuItem");
|
|
|
50
50
|
var IconButton_1 = require("../IconButton");
|
|
51
51
|
var TextLabel_1 = require("../TextLabel");
|
|
52
52
|
var ChatBubble_1 = __importDefault(require("./ChatBubble"));
|
|
53
|
+
var components_1 = require("./components");
|
|
53
54
|
var Popup_1 = require("./Popup");
|
|
54
55
|
var chatBubbleTailType = {
|
|
55
56
|
other_avatar_impact: 'left_top',
|
|
@@ -68,8 +69,8 @@ var profileImageBorderColorTheme = {
|
|
|
68
69
|
transparent: 'ui_cpnt_list_chatbubble_base_transparent'
|
|
69
70
|
};
|
|
70
71
|
function ChatBubbleListItem(_a) {
|
|
71
|
-
var titleText = _a.titleText, imageSrc = _a.imageSrc, _b = _a.hoverMode, hoverMode = _b === void 0 ? 'use' : _b, styleTheme = _a.styleTheme, _c = _a.colorTheme, colorTheme = _c === void 0 ? 'grey' : _c, _d = _a.timeMode, timeMode = _d === void 0 ? 'use' : _d, timeText = _a.timeText, labelText = _a.labelText, contextMenuOptionArray = _a.contextMenuOptionArray, _e = _a.contextMenuState, contextMenuState = _e === void 0 ? 'normal' : _e, children = _a.children, _f = _a.downloadIBtnMode, downloadIBtnMode = _f === void 0 ? 'none' : _f, onClickContextMenuItem = _a.onClickContextMenuItem, onClickDownloadIBtn = _a.onClickDownloadIBtn;
|
|
72
|
-
var
|
|
72
|
+
var titleText = _a.titleText, imageSrc = _a.imageSrc, _b = _a.hoverMode, hoverMode = _b === void 0 ? 'use' : _b, styleTheme = _a.styleTheme, _c = _a.colorTheme, colorTheme = _c === void 0 ? 'grey' : _c, _d = _a.timeMode, timeMode = _d === void 0 ? 'use' : _d, timeText = _a.timeText, labelText = _a.labelText, contextMenuOptionArray = _a.contextMenuOptionArray, _e = _a.contextMenuState, contextMenuState = _e === void 0 ? 'normal' : _e, children = _a.children, _f = _a.downloadIBtnMode, downloadIBtnMode = _f === void 0 ? 'none' : _f, _g = _a.reactionBtnMode, reactionBtnMode = _g === void 0 ? 'none' : _g, _h = _a.reactionBtnText, reactionBtnText = _h === void 0 ? '-' : _h, reactionArray = _a.reactionArray, _j = _a.reactionBubblePosition, reactionBubblePosition = _j === void 0 ? 'bottom' : _j, onClickContextMenuItem = _a.onClickContextMenuItem, onClickDownloadIBtn = _a.onClickDownloadIBtn, onClickReactionBtn = _a.onClickReactionBtn;
|
|
73
|
+
var _k = (0, react_1.useState)(false), isContextMenuOpen = _k[0], setIsContextMenuOpen = _k[1];
|
|
73
74
|
var contextMenuRef = (0, react_1.useRef)(null);
|
|
74
75
|
var chatBody = document.querySelector('#chatMessageBox');
|
|
75
76
|
var rect = chatBody === null || chatBody === void 0 ? void 0 : chatBody.getBoundingClientRect();
|
|
@@ -135,7 +136,7 @@ function ChatBubbleListItem(_a) {
|
|
|
135
136
|
}
|
|
136
137
|
setIsContextMenuOpen(false);
|
|
137
138
|
};
|
|
138
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(S_ChatBubbleListItem, __assign({ "x-pds-name": "ChatBubbleListItem", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isMe: isMe }, { children: [hasLeftSpacing ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isProfileImageShow ? ((0, jsx_runtime_1.jsx)(S_ImageViewWrapper, __assign({ isOtherAvatarImpact: styleTheme === 'other_avatar_impact', colorTheme: colorTheme }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { shapeType: "circular", ratio: "1_1", scaleType: "cover", src: imageSrc, width: styleTheme === 'other_avatar_impact' ? 36 : 38 }) }))) : ((0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_g", spacingType: "width" })) })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" })), (0, jsx_runtime_1.jsxs)(S_RightBox, { children: [isTitleTextShow && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, styleTheme: "caption1Bold", colorTheme: titleTextColorTheme }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b" })] })), (0, jsx_runtime_1.jsxs)(S_ChatBubbleBox, { children: [(0, jsx_runtime_1.jsxs)(S_ChatBubbleWrapper, __assign({ isMe: isMe }, { children: [isMe && ((0, jsx_runtime_1.jsxs)(S_Box, { children: [downloadIBtnMode === 'use' && (0, jsx_runtime_1.jsx)("div", { style: { height: '32px', width: '1px' } }), (0, jsx_runtime_1.jsx)(S_DownloadIconWrapper, __assign({ isMe: isMe }, { children: downloadIBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { shapeType: "circular", iconFillType: "fill", baseColorKey: "ui_cpnt_list_chatbubble_download_button_base", iconColorKey: "ui_cpnt_button_icon_white", iconSize: 16, iconName: "ic_download", onClick: onClickDownloadIBtn })) })), (0, jsx_runtime_1.jsxs)(S_TimeWrapper, __assign({ isMe: isMe }, { children: [labelText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: labelText, styleTheme: "caption2Bold", colorTheme: "sysTextTertiary" })), timeMode === 'use' && timeText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: timeText, styleTheme: "caption2Regular", colorTheme: "sysTextTertiary", singleLineMode: "use" }))] }))] })), (0, jsx_runtime_1.jsx)(ChatBubble_1.default, __assign({ colorTheme: colorTheme, tailType: chatBubbleTailType[styleTheme] }, { children: children })), !isMe && ((0, jsx_runtime_1.jsxs)(S_Box, { children: [downloadIBtnMode === 'use' && (0, jsx_runtime_1.jsx)("div", { style: { height: '32px', width: '1px' } }), (0, jsx_runtime_1.jsx)(S_DownloadIconWrapper, __assign({ isMe: isMe }, { children: downloadIBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { shapeType: "circular", iconFillType: "fill", baseColorKey: "ui_cpnt_list_chatbubble_download_button_base", iconColorKey: "ui_cpnt_button_icon_white", iconSize: 16, iconName: "ic_download", onClick: onClickDownloadIBtn })) })), (0, jsx_runtime_1.jsxs)(S_TimeWrapper, __assign({ isMe: isMe }, { children: [labelText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: labelText, styleTheme: "caption2Bold", colorTheme: "sysTextTertiary" })), timeMode === 'use' && timeText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: timeText, styleTheme: "caption2Regular", colorTheme: "sysTextTertiary", singleLineMode: "use" }))] }))] }))] })), hoverMode === 'use' && !isMe && ((0, jsx_runtime_1.jsx)(S_SeeMoreButton, __assign({ isContextMenuOpen: isContextMenuOpen, hoverMode: hoverMode, ref: contextMenuRef }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { fillType: "fill", baseSize: "xsmall", iconFillType: "fill", iconSize: 20, iconName: "ic_more", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: "ui_cpnt_button_icon_enabled", onClick: handleMoreButtonClick }) })))] })] }), (0, jsx_runtime_1.jsx)(Popup_1.PopupProvider, { children: (0, jsx_runtime_1.jsx)(Popup_1.Popup, __assign({ targetRef: contextMenuRef, isOpen: isContextMenuOpen, placement: "top-end", wrapperHeight: rect === null || rect === void 0 ? void 0 : rect.height, onClickOutside: function () { return setIsContextMenuOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, { children: contextMenuOptionArray === null || contextMenuOptionArray === void 0 ? void 0 : contextMenuOptionArray.map(function (el) { return ((0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: el, onClick: handleContextMenuItemClick, state: contextMenuState }, el.value)); }) }) })) })] })) }));
|
|
139
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(S_ChatBubbleListItem, __assign({ "x-pds-name": "ChatBubbleListItem", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isMe: isMe }, { children: [hasLeftSpacing ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isProfileImageShow ? ((0, jsx_runtime_1.jsx)(S_ImageViewWrapper, __assign({ isOtherAvatarImpact: styleTheme === 'other_avatar_impact', colorTheme: colorTheme }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { shapeType: "circular", ratio: "1_1", scaleType: "cover", src: imageSrc, width: styleTheme === 'other_avatar_impact' ? 36 : 38 }) }))) : ((0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_g", spacingType: "width" })) })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" })), (0, jsx_runtime_1.jsxs)(S_RightBox, { children: [isTitleTextShow && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, styleTheme: "caption1Bold", colorTheme: titleTextColorTheme }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b" })] })), (0, jsx_runtime_1.jsxs)(S_ChatBubbleBox, __assign({ isMe: isMe }, { children: [(0, jsx_runtime_1.jsxs)(S_ChatBubbleWrapper, __assign({ isMe: isMe }, { children: [(0, jsx_runtime_1.jsxs)(S_BubbleWrapper, { children: [isMe && ((0, jsx_runtime_1.jsxs)(S_Box, { children: [downloadIBtnMode === 'use' && (0, jsx_runtime_1.jsx)("div", { style: { height: '32px', width: '1px' } }), (0, jsx_runtime_1.jsx)(S_DownloadIconWrapper, __assign({ isMe: isMe }, { children: downloadIBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { shapeType: "circular", iconFillType: "fill", baseColorKey: "ui_cpnt_list_chatbubble_download_button_base", iconColorKey: "ui_cpnt_button_icon_white", iconSize: 16, iconName: "ic_download", onClick: onClickDownloadIBtn })) })), (0, jsx_runtime_1.jsxs)(S_TimeWrapper, __assign({ isMe: isMe }, { children: [labelText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: labelText, styleTheme: "caption2Bold", colorTheme: "sysTextTertiary" })), timeMode === 'use' && timeText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: timeText, styleTheme: "caption2Regular", colorTheme: "sysTextTertiary", singleLineMode: "use" }))] }))] })), (0, jsx_runtime_1.jsx)(ChatBubble_1.default, __assign({ colorTheme: colorTheme, tailType: chatBubbleTailType[styleTheme] }, { children: children })), !isMe && ((0, jsx_runtime_1.jsxs)(S_Box, { children: [downloadIBtnMode === 'use' && (0, jsx_runtime_1.jsx)("div", { style: { height: '32px', width: '1px' } }), (0, jsx_runtime_1.jsx)(S_DownloadIconWrapper, __assign({ isMe: isMe }, { children: downloadIBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { shapeType: "circular", iconFillType: "fill", baseColorKey: "ui_cpnt_list_chatbubble_download_button_base", iconColorKey: "ui_cpnt_button_icon_white", iconSize: 16, iconName: "ic_download", onClick: onClickDownloadIBtn })) })), (0, jsx_runtime_1.jsxs)(S_TimeWrapper, __assign({ isMe: isMe }, { children: [labelText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: labelText, styleTheme: "caption2Bold", colorTheme: "sysTextTertiary" })), timeMode === 'use' && timeText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: timeText, styleTheme: "caption2Regular", colorTheme: "sysTextTertiary", singleLineMode: "use" }))] }))] }))] }), (0, jsx_runtime_1.jsx)(components_1.ReactionRow, { isMe: isMe, downloadIBtnMode: downloadIBtnMode, reactionBtnMode: reactionBtnMode, reactionArray: reactionArray, reactionBtnText: reactionBtnText, reactionBubblePosition: reactionBubblePosition, onClickReactionBtn: onClickReactionBtn })] })), hoverMode === 'use' && !isMe && ((0, jsx_runtime_1.jsx)(S_SeeMoreButton, __assign({ isContextMenuOpen: isContextMenuOpen, hoverMode: hoverMode, ref: contextMenuRef }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { fillType: "fill", baseSize: "xsmall", iconFillType: "fill", iconSize: 20, iconName: "ic_more", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: "ui_cpnt_button_icon_enabled", onClick: handleMoreButtonClick }) })))] }))] }), (0, jsx_runtime_1.jsx)(Popup_1.PopupProvider, { children: (0, jsx_runtime_1.jsx)(Popup_1.Popup, __assign({ targetRef: contextMenuRef, isOpen: isContextMenuOpen, placement: "top-end", wrapperHeight: rect === null || rect === void 0 ? void 0 : rect.height, onClickOutside: function () { return setIsContextMenuOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, { children: contextMenuOptionArray === null || contextMenuOptionArray === void 0 ? void 0 : contextMenuOptionArray.map(function (el) { return ((0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: el, onClick: handleContextMenuItemClick, state: contextMenuState }, el.value)); }) }) })) })] })) }));
|
|
139
140
|
}
|
|
140
141
|
var MyChatBubbleListItem = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: ", ";\n"], ["\n margin-right: ", ";\n"])), function (_a) {
|
|
141
142
|
var theme = _a.theme;
|
|
@@ -169,12 +170,15 @@ var S_DownloadIconWrapper = styled_components_1.default.div(templateObject_7 ||
|
|
|
169
170
|
return isMe && theme.spacing.spacingB;
|
|
170
171
|
});
|
|
171
172
|
var S_Box = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"])));
|
|
172
|
-
var S_ChatBubbleBox = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])))
|
|
173
|
-
var MyChatBubble = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n justify-content: flex-end;\n"], ["\n justify-content: flex-end;\n"])));
|
|
174
|
-
var S_ChatBubbleWrapper = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: flex;\n flex: 1;\n\n ", ";\n"], ["\n display: flex;\n flex: 1;\n\n ", ";\n"])), function (_a) {
|
|
173
|
+
var S_ChatBubbleBox = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n\n ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n\n ", ";\n"])), function (_a) {
|
|
175
174
|
var isMe = _a.isMe;
|
|
176
175
|
return isMe && MyChatBubble;
|
|
177
176
|
});
|
|
177
|
+
var MyChatBubble = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n justify-content: flex-end;\n"], ["\n justify-content: flex-end;\n"])));
|
|
178
|
+
var S_ChatBubbleWrapper = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n align-items: ", ";\n display: flex;\n flex: 1;\n flex-direction: column;\n max-width: fit-content;\n"], ["\n align-items: ", ";\n display: flex;\n flex: 1;\n flex-direction: column;\n max-width: fit-content;\n"])), function (_a) {
|
|
179
|
+
var isMe = _a.isMe;
|
|
180
|
+
return isMe && 'flex-end';
|
|
181
|
+
});
|
|
178
182
|
var S_TimeWrapper = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n align-items: ", ";\n align-self: ", ";\n display: flex;\n flex-direction: column;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n align-items: ", ";\n align-self: ", ";\n display: flex;\n flex-direction: column;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
179
183
|
var isMe = _a.isMe;
|
|
180
184
|
return isMe && 'flex-end';
|
|
@@ -201,5 +205,6 @@ var S_SeeMoreButton = styled_components_1.default.div(templateObject_13 || (temp
|
|
|
201
205
|
var hoverMode = _a.hoverMode;
|
|
202
206
|
return hoverMode === 'use' && '1';
|
|
203
207
|
});
|
|
208
|
+
var S_BubbleWrapper = styled_components_1.default.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
204
209
|
exports.default = ChatBubbleListItem;
|
|
205
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
210
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BubblePositionType } from '../../../../common/types/systemUI';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
type ContextBubbleSheetProps = {
|
|
4
|
+
pointingPosition: BubblePositionType;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @description ChatBubbleListItem에서의 사용 용례와 비슷한 사용 방식이 발생 한 경우, 별도의 PDS로 분리할 예정입니다.
|
|
9
|
+
*/
|
|
10
|
+
declare const ReactionBubble: ({ pointingPosition, children }: ContextBubbleSheetProps) => JSX.Element;
|
|
11
|
+
export default ReactionBubble;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
43
|
+
/**
|
|
44
|
+
* @description ChatBubbleListItem에서의 사용 용례와 비슷한 사용 방식이 발생 한 경우, 별도의 PDS로 분리할 예정입니다.
|
|
45
|
+
*/
|
|
46
|
+
var ReactionBubble = function (_a) {
|
|
47
|
+
var _b = _a.pointingPosition, pointingPosition = _b === void 0 ? 'start_bottom' : _b, children = _a.children;
|
|
48
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(S_ContextBubbleArea, __assign({ "$position": pointingPosition }, { children: (0, jsx_runtime_1.jsxs)(S_ContextBubbleWrapper, __assign({ "$position": pointingPosition }, { children: [children, (0, jsx_runtime_1.jsxs)(Arrow, __assign({ "$position": pointingPosition, viewBox: "0 0 18 10", xmlns: "http://www.w3.org/2000/svg" }, { children: [(0, jsx_runtime_1.jsx)("polygon", { points: "9,10 3,0 15,0", fill: theme.ui_cpnt_sheet_base_01 }), (0, jsx_runtime_1.jsx)("path", { d: "M3,1 L9,10", stroke: theme.ui_cpnt_sheet_border_01, strokeWidth: "1", strokeLinecap: "butt" }), (0, jsx_runtime_1.jsx)("path", { d: "M15,1 L9,10", stroke: theme.ui_cpnt_sheet_border_01, strokeWidth: "1", strokeLinecap: "butt" }), (0, jsx_runtime_1.jsx)("path", { d: "M0,0 L15,0", strokeWidth: "1" })] }))] })) })));
|
|
50
|
+
};
|
|
51
|
+
exports.default = ReactionBubble;
|
|
52
|
+
var S_ContextBubbleArea = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n flex-direction: column;\n ", "\n position: relative;\n"], ["\n align-items: center;\n display: flex;\n flex-direction: column;\n ", "\n position: relative;\n"])), function (_a) {
|
|
53
|
+
var $position = _a.$position, theme = _a.theme;
|
|
54
|
+
var isTop = $position.includes('top');
|
|
55
|
+
return !isTop
|
|
56
|
+
? "margin-bottom: ".concat(theme.spacing.spacingB, ";")
|
|
57
|
+
: "margin-top: ".concat(theme.spacing.spacingB, ";");
|
|
58
|
+
});
|
|
59
|
+
var S_ContextBubbleWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: ", ";\n border-radius: 12px;\n display: flex;\n padding: ", ";\n position: relative;\n width: 'fit-content';\n"], ["\n align-items: center;\n background-color: ", ";\n border: ", ";\n border-radius: 12px;\n display: flex;\n padding: ", ";\n position: relative;\n width: 'fit-content';\n"])), function (_a) {
|
|
60
|
+
var theme = _a.theme;
|
|
61
|
+
return theme.ui_cpnt_sheet_base_01;
|
|
62
|
+
}, function (_a) {
|
|
63
|
+
var theme = _a.theme;
|
|
64
|
+
return "1px solid ".concat(theme.ui_cpnt_sheet_border_01);
|
|
65
|
+
}, function (_a) {
|
|
66
|
+
var theme = _a.theme;
|
|
67
|
+
return "".concat(theme.spacing.spacingB, " ").concat(theme.spacing.spacingC);
|
|
68
|
+
});
|
|
69
|
+
var Arrow = styled_components_1.default.svg(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 12.6px;\n position: absolute;\n width: 15px;\n\n ", "\n\n ", "\n"], ["\n height: 12.6px;\n position: absolute;\n width: 15px;\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
70
|
+
var $position = _a.$position;
|
|
71
|
+
var isTop = $position.includes('top');
|
|
72
|
+
if (isTop) {
|
|
73
|
+
return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n top: -10px;\n transform: translateX(-50%) rotate(180deg);\n "], ["\n top: -10px;\n transform: translateX(-50%) rotate(180deg);\n "])));
|
|
74
|
+
}
|
|
75
|
+
return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n bottom: -10px;\n transform: translateX(-50%);\n "], ["\n bottom: -10px;\n transform: translateX(-50%);\n "])));
|
|
76
|
+
}, function (_a) {
|
|
77
|
+
var $position = _a.$position;
|
|
78
|
+
if ($position.includes('center')) {
|
|
79
|
+
return "left: 50%;";
|
|
80
|
+
}
|
|
81
|
+
if ($position.includes('end')) {
|
|
82
|
+
return "right: 12px;";
|
|
83
|
+
}
|
|
84
|
+
return "left: 19.5px;";
|
|
85
|
+
});
|
|
86
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ReactionType = 'heart' | 'like' | 'confetti';
|
|
3
|
+
type ReactionValueOption = {
|
|
4
|
+
type: ReactionType;
|
|
5
|
+
count: number;
|
|
6
|
+
};
|
|
7
|
+
type ReactionArrayType = ReactionValueOption[];
|
|
8
|
+
type Props = {
|
|
9
|
+
isMe: boolean;
|
|
10
|
+
downloadIBtnMode: 'use' | 'none';
|
|
11
|
+
reactionBtnMode: 'use' | 'none';
|
|
12
|
+
reactionBtnText: string;
|
|
13
|
+
reactionArray?: ReactionArrayType;
|
|
14
|
+
reactionBubblePosition: 'top' | 'bottom';
|
|
15
|
+
onClickReactionBtn?: (type: ReactionType) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function ReactionRow({ isMe, reactionBtnMode, downloadIBtnMode, reactionBtnText, reactionArray, reactionBubblePosition, onClickReactionBtn }: Props): JSX.Element;
|
|
18
|
+
export default ReactionRow;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
|
+
var react_1 = require("react");
|
|
23
|
+
var TextLabel_1 = require("../../../components/TextLabel");
|
|
24
|
+
var components_1 = require("../../../../hybrid/components");
|
|
25
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
26
|
+
var ReactionBubble_1 = __importDefault(require("./ReactionBubble"));
|
|
27
|
+
function ReactionRow(_a) {
|
|
28
|
+
var isMe = _a.isMe, reactionBtnMode = _a.reactionBtnMode, downloadIBtnMode = _a.downloadIBtnMode, reactionBtnText = _a.reactionBtnText, reactionArray = _a.reactionArray, reactionBubblePosition = _a.reactionBubblePosition, onClickReactionBtn = _a.onClickReactionBtn;
|
|
29
|
+
var _b = (0, react_1.useState)(false), isOpenReactionBubble = _b[0], setIsOpenReactionBubble = _b[1];
|
|
30
|
+
var bubbleRef = (0, react_1.useRef)(null);
|
|
31
|
+
var buttonRef = (0, react_1.useRef)(null);
|
|
32
|
+
/**
|
|
33
|
+
* @when 컴포넌트 렌더링 시
|
|
34
|
+
* @expected ReactionBubble의 외부를 클릭하면 ReactionBubble가 닫히도록 클릭 이벤트를 등록합니다.
|
|
35
|
+
* @clear document의 클릭 이벤트를 제거합니다.
|
|
36
|
+
*/
|
|
37
|
+
(0, react_1.useEffect)(function () {
|
|
38
|
+
function handleClickOutside(event) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
event.stopPropagation();
|
|
41
|
+
if (event.target instanceof Node &&
|
|
42
|
+
(((_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) || ((_b = bubbleRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))))
|
|
43
|
+
return;
|
|
44
|
+
if (isOpenReactionBubble) {
|
|
45
|
+
setIsOpenReactionBubble(false);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
49
|
+
return function () {
|
|
50
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
51
|
+
};
|
|
52
|
+
}, [isOpenReactionBubble]);
|
|
53
|
+
var defaultReactions = [
|
|
54
|
+
{ iconName: 'ic_lottie_heart', type: 'heart' },
|
|
55
|
+
{ iconName: 'ic_lottie_thumb_up', type: 'like' },
|
|
56
|
+
{ iconName: 'ic_lottie_confetti', type: 'confetti' }
|
|
57
|
+
];
|
|
58
|
+
var handleOpenReactionBubble = function () {
|
|
59
|
+
if (!isOpenReactionBubble) {
|
|
60
|
+
setIsOpenReactionBubble(true);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (isOpenReactionBubble) {
|
|
64
|
+
setIsOpenReactionBubble(false);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(S_Wrapper, { children: [(0, jsx_runtime_1.jsxs)(S_ReactionWrapper, __assign({ isMe: isMe, downloadIBtnMode: downloadIBtnMode === 'use' }, { children: [(0, jsx_runtime_1.jsx)(S_ButtonWrapper, __assign({ ref: buttonRef }, { children: !isMe && reactionBtnMode === 'use' && ((0, jsx_runtime_1.jsxs)(S_ReactionButton, __assign({ onClick: handleOpenReactionBubble }, { children: [(0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: "ic_plus_circle", size: 12 }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: reactionBtnText, singleLineMode: "use", styleTheme: "caption2Bold" })] }))) })), reactionArray && ((0, jsx_runtime_1.jsx)(S_ReactionBadgeWrapper, { children: reactionArray.map(function (reaction, index) {
|
|
69
|
+
var iconName = function () {
|
|
70
|
+
switch (reaction.type) {
|
|
71
|
+
case 'heart':
|
|
72
|
+
return 'ic_lottie_heart';
|
|
73
|
+
case 'like':
|
|
74
|
+
return 'ic_lottie_thumb_up';
|
|
75
|
+
case 'confetti':
|
|
76
|
+
return 'ic_lottie_confetti';
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(S_ReactionBadge, __assign({ type: reaction.type }, { children: (0, jsx_runtime_1.jsx)(components_1.LottieIcon, { iconName: iconName(), size: 16, autoplayMode: "none", loopMode: "none" }) }), index));
|
|
80
|
+
}) }))] })), (0, jsx_runtime_1.jsx)(S_ReactionBubbleWrapper, __assign({ ref: bubbleRef, reactionBubblePosition: reactionBubblePosition }, { children: isOpenReactionBubble && ((0, jsx_runtime_1.jsx)(ReactionBubble_1.default, __assign({ pointingPosition: reactionBubblePosition === 'bottom' ? 'start_top' : 'start_bottom' }, { children: (0, jsx_runtime_1.jsx)(S_ReactionBadgeWrapper, { children: defaultReactions.map(function (reaction, index) { return ((0, jsx_runtime_1.jsx)(S_ReactionBadge, __assign({ type: reaction.type, isButton: true, onClick: function () {
|
|
81
|
+
onClickReactionBtn && onClickReactionBtn(reaction.type);
|
|
82
|
+
setIsOpenReactionBubble(false);
|
|
83
|
+
} }, { children: (0, jsx_runtime_1.jsx)(components_1.LottieIcon, { iconName: reaction.iconName, size: 16, autoplayMode: "none", loopMode: "none" }) }), index)); }) }) }))) }))] }));
|
|
84
|
+
}
|
|
85
|
+
exports.default = ReactionRow;
|
|
86
|
+
var S_Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n gap: ", ";\n position: relative;\n"], ["\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n gap: ", ";\n position: relative;\n"])), function (_a) {
|
|
87
|
+
var theme = _a.theme;
|
|
88
|
+
return theme.spacing.spacingA;
|
|
89
|
+
});
|
|
90
|
+
var S_ReactionWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n gap: ", ";\n justify-content: space-between;\n max-width: -webkit-fill-available;\n padding-right: ", ";\n padding-top: ", ";\n width: 100%;\n"], ["\n display: flex;\n gap: ", ";\n justify-content: space-between;\n max-width: -webkit-fill-available;\n padding-right: ", ";\n padding-top: ", ";\n width: 100%;\n"])), function (_a) {
|
|
91
|
+
var theme = _a.theme;
|
|
92
|
+
return theme.spacing.spacingB;
|
|
93
|
+
}, function (_a) {
|
|
94
|
+
var isMe = _a.isMe, downloadIBtnMode = _a.downloadIBtnMode;
|
|
95
|
+
return !isMe && (downloadIBtnMode ? '40px' : '34px');
|
|
96
|
+
}, function (_a) {
|
|
97
|
+
var theme = _a.theme;
|
|
98
|
+
return theme.spacing.spacingA;
|
|
99
|
+
});
|
|
100
|
+
var S_ButtonWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
101
|
+
var S_ReactionButton = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: 8px;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n gap: ", ";\n height: 24px;\n justify-content: center;\n max-width: fit-content;\n padding: 0 ", ";\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: 8px;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n gap: ", ";\n height: 24px;\n justify-content: center;\n max-width: fit-content;\n padding: 0 ", ";\n"])), function (_a) {
|
|
102
|
+
var theme = _a.theme;
|
|
103
|
+
return theme.ui_cpnt_sheet_base_02;
|
|
104
|
+
}, function (_a) {
|
|
105
|
+
var theme = _a.theme;
|
|
106
|
+
return theme.spacing.spacingA;
|
|
107
|
+
}, function (_a) {
|
|
108
|
+
var theme = _a.theme;
|
|
109
|
+
return theme.spacing.spacingB;
|
|
110
|
+
});
|
|
111
|
+
var S_ReactionBadgeWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n gap: ", ";\n"], ["\n display: flex;\n gap: ", ";\n"])), function (_a) {
|
|
112
|
+
var theme = _a.theme;
|
|
113
|
+
return theme.spacing.spacingA;
|
|
114
|
+
});
|
|
115
|
+
var S_ReactionBadge = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: 100%;\n cursor: ", ";\n display: flex;\n height: 24px;\n justify-content: center;\n width: 24px;\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: 100%;\n cursor: ", ";\n display: flex;\n height: 24px;\n justify-content: center;\n width: 24px;\n"])), function (_a) {
|
|
116
|
+
var theme = _a.theme, type = _a.type;
|
|
117
|
+
switch (type) {
|
|
118
|
+
case 'heart':
|
|
119
|
+
return theme.ui_cpnt_message_reaction_base_01;
|
|
120
|
+
case 'like':
|
|
121
|
+
return theme.ui_cpnt_message_reaction_base_02;
|
|
122
|
+
case 'confetti':
|
|
123
|
+
return theme.ui_cpnt_message_reaction_base_03;
|
|
124
|
+
}
|
|
125
|
+
}, function (_a) {
|
|
126
|
+
var isButton = _a.isButton;
|
|
127
|
+
return isButton && 'pointer';
|
|
128
|
+
});
|
|
129
|
+
var S_ReactionBubbleWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n left: 0;\n position: absolute;\n ", "\n z-index: 10;\n"], ["\n left: 0;\n position: absolute;\n ", "\n z-index: 10;\n"])), function (_a) {
|
|
130
|
+
var reactionBubblePosition = _a.reactionBubblePosition;
|
|
131
|
+
return reactionBubblePosition === 'bottom' ? 'top: 28px;' : 'bottom: 24px;';
|
|
132
|
+
});
|
|
133
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ReactionRow } from './ReactionRow';
|
|
@@ -0,0 +1,8 @@
|
|
|
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.ReactionRow = void 0;
|
|
7
|
+
var ReactionRow_1 = require("./ReactionRow");
|
|
8
|
+
Object.defineProperty(exports, "ReactionRow", { enumerable: true, get: function () { return __importDefault(ReactionRow_1).default; } });
|
|
@@ -16,7 +16,7 @@ var LottieIcon = function (_a) {
|
|
|
16
16
|
var animationData = lotties_1.default[iconName];
|
|
17
17
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(S_Lottie, { "x-pds-name": "LottieIcon", "x-pds-element-type": "component", "x-pds-device-type": "hybrid", animationData: animationData, lottieRef: lottieRef, autoplay: autoplayMode === 'use' ? true : false, loop: loopMode === 'use' ? true : false, "$size": size, onComplete: onComplete }) }));
|
|
18
18
|
};
|
|
19
|
-
var S_Lottie = (0, styled_components_1.default)(lottie_react_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", ";\n min-height: ", ";\n min-width: ", ";\n width: ", ";\n"], ["\n height: ", ";\n min-height: ", ";\n min-width: ", ";\n width: ", ";\n"])), function (_a) {
|
|
19
|
+
var S_Lottie = (0, styled_components_1.default)(lottie_react_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: ", ";\n justify-content: center;\n min-height: ", ";\n min-width: ", ";\n width: ", ";\n"], ["\n align-items: center;\n display: flex;\n height: ", ";\n justify-content: center;\n min-height: ", ";\n min-width: ", ";\n width: ", ";\n"])), function (_a) {
|
|
20
20
|
var $size = _a.$size;
|
|
21
21
|
return "".concat($size, "px");
|
|
22
22
|
}, function (_a) {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PDSTextType, PDSValueOption } from '../../../common';
|
|
3
3
|
type ColorThemeType = 'grey' | 'brand_primary' | 'translucent_white' | 'translucent_black' | 'transparent';
|
|
4
|
+
type ReactionType = 'heart' | 'like' | 'confetti';
|
|
5
|
+
type ReactionValueOption = {
|
|
6
|
+
type: ReactionType;
|
|
7
|
+
count: number;
|
|
8
|
+
};
|
|
9
|
+
type ReactionArrayType = ReactionValueOption[];
|
|
4
10
|
export type ChatBubbleListItemProps = {
|
|
5
11
|
titleText?: PDSTextType;
|
|
6
12
|
imageSrc?: string;
|
|
@@ -14,8 +20,13 @@ export type ChatBubbleListItemProps = {
|
|
|
14
20
|
contextMenuState?: 'normal' | 'disabled';
|
|
15
21
|
children?: React.ReactNode;
|
|
16
22
|
downloadIBtnMode?: 'use' | 'none';
|
|
23
|
+
reactionBtnMode?: 'use' | 'none';
|
|
24
|
+
reactionBtnText?: string;
|
|
25
|
+
reactionArray?: ReactionArrayType;
|
|
26
|
+
reactionBubblePosition?: 'top' | 'bottom';
|
|
17
27
|
onClickContextMenuItem?: (option: PDSValueOption) => void;
|
|
18
28
|
onClickDownloadIBtn?: () => void;
|
|
29
|
+
onClickReactionBtn?: (type: ReactionType) => void;
|
|
19
30
|
};
|
|
20
|
-
declare function ChatBubbleListItem({ titleText, imageSrc, hoverMode, styleTheme, colorTheme, timeMode, timeText, labelText, contextMenuOptionArray, contextMenuState, children, downloadIBtnMode, onClickContextMenuItem, onClickDownloadIBtn }: ChatBubbleListItemProps): JSX.Element;
|
|
31
|
+
declare function ChatBubbleListItem({ titleText, imageSrc, hoverMode, styleTheme, colorTheme, timeMode, timeText, labelText, contextMenuOptionArray, contextMenuState, children, downloadIBtnMode, reactionBtnMode, reactionBtnText, reactionArray, reactionBubblePosition, onClickContextMenuItem, onClickDownloadIBtn, onClickReactionBtn }: ChatBubbleListItemProps): JSX.Element;
|
|
21
32
|
export default ChatBubbleListItem;
|
|
@@ -50,6 +50,7 @@ var ContextMenuItem_1 = require("../ContextMenuItem");
|
|
|
50
50
|
var IconButton_1 = require("../IconButton");
|
|
51
51
|
var TextLabel_1 = require("../TextLabel");
|
|
52
52
|
var ChatBubble_1 = __importDefault(require("./ChatBubble"));
|
|
53
|
+
var components_1 = require("./components");
|
|
53
54
|
var Popup_1 = require("./Popup");
|
|
54
55
|
var chatBubbleTailType = {
|
|
55
56
|
other_avatar_impact: 'left_top',
|
|
@@ -68,8 +69,8 @@ var profileImageBorderColorTheme = {
|
|
|
68
69
|
transparent: 'ui_cpnt_list_chatbubble_base_transparent'
|
|
69
70
|
};
|
|
70
71
|
function ChatBubbleListItem(_a) {
|
|
71
|
-
var titleText = _a.titleText, imageSrc = _a.imageSrc, _b = _a.hoverMode, hoverMode = _b === void 0 ? 'use' : _b, styleTheme = _a.styleTheme, _c = _a.colorTheme, colorTheme = _c === void 0 ? 'grey' : _c, _d = _a.timeMode, timeMode = _d === void 0 ? 'use' : _d, timeText = _a.timeText, labelText = _a.labelText, contextMenuOptionArray = _a.contextMenuOptionArray, _e = _a.contextMenuState, contextMenuState = _e === void 0 ? 'normal' : _e, children = _a.children, _f = _a.downloadIBtnMode, downloadIBtnMode = _f === void 0 ? 'none' : _f, onClickContextMenuItem = _a.onClickContextMenuItem, onClickDownloadIBtn = _a.onClickDownloadIBtn;
|
|
72
|
-
var
|
|
72
|
+
var titleText = _a.titleText, imageSrc = _a.imageSrc, _b = _a.hoverMode, hoverMode = _b === void 0 ? 'use' : _b, styleTheme = _a.styleTheme, _c = _a.colorTheme, colorTheme = _c === void 0 ? 'grey' : _c, _d = _a.timeMode, timeMode = _d === void 0 ? 'use' : _d, timeText = _a.timeText, labelText = _a.labelText, contextMenuOptionArray = _a.contextMenuOptionArray, _e = _a.contextMenuState, contextMenuState = _e === void 0 ? 'normal' : _e, children = _a.children, _f = _a.downloadIBtnMode, downloadIBtnMode = _f === void 0 ? 'none' : _f, _g = _a.reactionBtnMode, reactionBtnMode = _g === void 0 ? 'none' : _g, _h = _a.reactionBtnText, reactionBtnText = _h === void 0 ? '-' : _h, reactionArray = _a.reactionArray, _j = _a.reactionBubblePosition, reactionBubblePosition = _j === void 0 ? 'bottom' : _j, onClickContextMenuItem = _a.onClickContextMenuItem, onClickDownloadIBtn = _a.onClickDownloadIBtn, onClickReactionBtn = _a.onClickReactionBtn;
|
|
73
|
+
var _k = (0, react_1.useState)(false), isContextMenuOpen = _k[0], setIsContextMenuOpen = _k[1];
|
|
73
74
|
var contextMenuRef = (0, react_1.useRef)(null);
|
|
74
75
|
var chatBody = document.querySelector('#chatMessageBox');
|
|
75
76
|
var rect = chatBody === null || chatBody === void 0 ? void 0 : chatBody.getBoundingClientRect();
|
|
@@ -137,7 +138,7 @@ function ChatBubbleListItem(_a) {
|
|
|
137
138
|
}
|
|
138
139
|
setIsContextMenuOpen(false);
|
|
139
140
|
};
|
|
140
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(S_ChatBubbleListItem, __assign({ "x-pds-name": "ChatBubbleListItem", "x-pds-element-type": "component", "x-pds-device-type": "mobile", isMe: isMe }, { children: [hasLeftSpacing ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isProfileImageShow ? ((0, jsx_runtime_1.jsx)(S_ImageViewWrapper, __assign({ isOtherAvatarImpact: styleTheme === 'other_avatar_impact', colorTheme: colorTheme }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { shapeType: "circular", ratio: "1_1", scaleType: "cover", src: imageSrc, width: styleTheme === 'other_avatar_impact' ? 36 : 38 }) }))) : ((0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_g", spacingType: "width" })) })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" })), (0, jsx_runtime_1.jsxs)(S_RightBox, { children: [isTitleTextShow && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, styleTheme: "caption1Bold", colorTheme: titleTextColorTheme }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b" })] })), (0, jsx_runtime_1.jsxs)(S_ChatBubbleBox, { children: [(0, jsx_runtime_1.jsxs)(S_ChatBubbleWrapper, __assign({ isMe: isMe }, { children: [isMe && ((0, jsx_runtime_1.jsxs)(S_Box, { children: [downloadIBtnMode === 'use' && (0, jsx_runtime_1.jsx)("div", { style: { height: '32px', width: '1px' } }), (0, jsx_runtime_1.jsx)(S_DownloadIconWrapper, __assign({ isMe: isMe }, { children: downloadIBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { shapeType: "circular", iconFillType: "fill", baseColorKey: "ui_cpnt_list_chatbubble_download_button_base", iconColorKey: "ui_cpnt_button_icon_white", iconSize: 16, iconName: "ic_download", onClick: onClickDownloadIBtn })) })), (0, jsx_runtime_1.jsxs)(S_TimeWrapper, __assign({ isMe: isMe }, { children: [labelText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: labelText, styleTheme: "caption2Bold", colorTheme: "sysTextTertiary" })), timeMode === 'use' && timeText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: timeText, styleTheme: "caption2Regular", colorTheme: "sysTextTertiary", singleLineMode: "use" }))] }))] })), (0, jsx_runtime_1.jsx)(ChatBubble_1.default, __assign({ colorTheme: colorTheme, tailType: chatBubbleTailType[styleTheme] }, { children: children })), !isMe && ((0, jsx_runtime_1.jsxs)(S_Box, { children: [downloadIBtnMode === 'use' && (0, jsx_runtime_1.jsx)("div", { style: { height: '32px', width: '1px' } }), (0, jsx_runtime_1.jsx)(S_DownloadIconWrapper, __assign({ isMe: isMe }, { children: downloadIBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { shapeType: "circular", iconFillType: "fill", baseColorKey: "ui_cpnt_list_chatbubble_download_button_base", iconColorKey: "ui_cpnt_button_icon_white", iconSize: 16, iconName: "ic_download", onClick: onClickDownloadIBtn })) })), (0, jsx_runtime_1.jsxs)(S_TimeWrapper, __assign({ isMe: isMe }, { children: [labelText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: labelText, styleTheme: "caption2Bold", colorTheme: "sysTextTertiary" })), timeMode === 'use' && timeText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: timeText, styleTheme: "caption2Regular", colorTheme: "sysTextTertiary", singleLineMode: "use" }))] }))] }))] })), hoverMode === 'use' && !isMe && ((0, jsx_runtime_1.jsx)(S_SeeMoreButton, __assign({ isContextMenuOpen: isContextMenuOpen, hoverMode: hoverMode, ref: contextMenuRef }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { fillType: "fill", baseSize: "xsmall", iconFillType: "fill", iconSize: 20, iconName: "ic_more", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: "ui_cpnt_button_icon_enabled", onClick: handleMoreButtonClick }) })))] })] }), (0, jsx_runtime_1.jsx)(Popup_1.PopupProvider, { children: (0, jsx_runtime_1.jsx)(Popup_1.Popup, __assign({ targetRef: contextMenuRef, isOpen: isContextMenuOpen, placement: "top-end", wrapperHeight: rect === null || rect === void 0 ? void 0 : rect.height, onClickOutside: function () { return setIsContextMenuOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, { children: contextMenuOptionArray === null || contextMenuOptionArray === void 0 ? void 0 : contextMenuOptionArray.map(function (el) { return ((0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: el, onClick: handleContextMenuItemClick, state: contextMenuState }, el.value)); }) }) })) })] })) }));
|
|
141
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(S_ChatBubbleListItem, __assign({ "x-pds-name": "ChatBubbleListItem", "x-pds-element-type": "component", "x-pds-device-type": "mobile", isMe: isMe }, { children: [hasLeftSpacing ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isProfileImageShow ? ((0, jsx_runtime_1.jsx)(S_ImageViewWrapper, __assign({ isOtherAvatarImpact: styleTheme === 'other_avatar_impact', colorTheme: colorTheme }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { shapeType: "circular", ratio: "1_1", scaleType: "cover", src: imageSrc, width: styleTheme === 'other_avatar_impact' ? 36 : 38 }) }))) : ((0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_g", spacingType: "width" })) })) : ((0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" })), (0, jsx_runtime_1.jsxs)(S_RightBox, { children: [isTitleTextShow && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: titleText, styleTheme: "caption1Bold", colorTheme: titleTextColorTheme }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b" })] })), (0, jsx_runtime_1.jsxs)(S_ChatBubbleBox, __assign({ isMe: isMe }, { children: [(0, jsx_runtime_1.jsxs)(S_ChatBubbleWrapper, __assign({ isMe: isMe }, { children: [(0, jsx_runtime_1.jsxs)(S_BubbleWrapper, { children: [isMe && ((0, jsx_runtime_1.jsxs)(S_Box, { children: [downloadIBtnMode === 'use' && (0, jsx_runtime_1.jsx)("div", { style: { height: '32px', width: '1px' } }), (0, jsx_runtime_1.jsx)(S_DownloadIconWrapper, __assign({ isMe: isMe }, { children: downloadIBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { shapeType: "circular", iconFillType: "fill", baseColorKey: "ui_cpnt_list_chatbubble_download_button_base", iconColorKey: "ui_cpnt_button_icon_white", iconSize: 16, iconName: "ic_download", onClick: onClickDownloadIBtn })) })), (0, jsx_runtime_1.jsxs)(S_TimeWrapper, __assign({ isMe: isMe }, { children: [labelText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: labelText, styleTheme: "caption2Bold", colorTheme: "sysTextTertiary" })), timeMode === 'use' && timeText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: timeText, styleTheme: "caption2Regular", colorTheme: "sysTextTertiary", singleLineMode: "use" }))] }))] })), (0, jsx_runtime_1.jsx)(ChatBubble_1.default, __assign({ colorTheme: colorTheme, tailType: chatBubbleTailType[styleTheme] }, { children: children })), !isMe && ((0, jsx_runtime_1.jsxs)(S_Box, { children: [downloadIBtnMode === 'use' && (0, jsx_runtime_1.jsx)("div", { style: { height: '32px', width: '1px' } }), (0, jsx_runtime_1.jsx)(S_DownloadIconWrapper, __assign({ isMe: isMe }, { children: downloadIBtnMode === 'use' && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { shapeType: "circular", iconFillType: "fill", baseColorKey: "ui_cpnt_list_chatbubble_download_button_base", iconColorKey: "ui_cpnt_button_icon_white", iconSize: 16, iconName: "ic_download", onClick: onClickDownloadIBtn })) })), (0, jsx_runtime_1.jsxs)(S_TimeWrapper, __assign({ isMe: isMe }, { children: [labelText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: labelText, styleTheme: "caption2Bold", colorTheme: "sysTextTertiary" })), timeMode === 'use' && timeText && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: timeText, styleTheme: "caption2Regular", colorTheme: "sysTextTertiary", singleLineMode: "use" }))] }))] }))] }), (0, jsx_runtime_1.jsx)(components_1.ReactionRow, { isMe: isMe, downloadIBtnMode: downloadIBtnMode, reactionBtnMode: reactionBtnMode, reactionBtnText: reactionBtnText, reactionArray: reactionArray, reactionBubblePosition: reactionBubblePosition, onClickReactionBtn: onClickReactionBtn })] })), hoverMode === 'use' && !isMe && ((0, jsx_runtime_1.jsx)(S_SeeMoreButton, __assign({ isContextMenuOpen: isContextMenuOpen, hoverMode: hoverMode, ref: contextMenuRef }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { fillType: "fill", baseSize: "xsmall", iconFillType: "fill", iconSize: 20, iconName: "ic_more", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconColorKey: "ui_cpnt_button_icon_enabled", onClick: handleMoreButtonClick }) })))] }))] }), (0, jsx_runtime_1.jsx)(Popup_1.PopupProvider, { children: (0, jsx_runtime_1.jsx)(Popup_1.Popup, __assign({ targetRef: contextMenuRef, isOpen: isContextMenuOpen, placement: "top-end", wrapperHeight: rect === null || rect === void 0 ? void 0 : rect.height, onClickOutside: function () { return setIsContextMenuOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, { children: contextMenuOptionArray === null || contextMenuOptionArray === void 0 ? void 0 : contextMenuOptionArray.map(function (el) { return ((0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: el, onClick: handleContextMenuItemClick, state: contextMenuState }, el.value)); }) }) })) })] })) }));
|
|
141
142
|
}
|
|
142
143
|
var MyChatBubbleListItem = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: ", ";\n"], ["\n margin-right: ", ";\n"])), function (_a) {
|
|
143
144
|
var theme = _a.theme;
|
|
@@ -171,12 +172,15 @@ var S_DownloadIconWrapper = styled_components_1.default.div(templateObject_7 ||
|
|
|
171
172
|
return isMe && theme.spacing.spacingB;
|
|
172
173
|
});
|
|
173
174
|
var S_Box = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"])));
|
|
174
|
-
var S_ChatBubbleBox = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])))
|
|
175
|
-
var MyChatBubble = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n justify-content: flex-end;\n"], ["\n justify-content: flex-end;\n"])));
|
|
176
|
-
var S_ChatBubbleWrapper = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: flex;\n flex: 1;\n\n ", ";\n"], ["\n display: flex;\n flex: 1;\n\n ", ";\n"])), function (_a) {
|
|
175
|
+
var S_ChatBubbleBox = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n\n ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n\n ", ";\n"])), function (_a) {
|
|
177
176
|
var isMe = _a.isMe;
|
|
178
177
|
return isMe && MyChatBubble;
|
|
179
178
|
});
|
|
179
|
+
var MyChatBubble = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n justify-content: flex-end;\n"], ["\n justify-content: flex-end;\n"])));
|
|
180
|
+
var S_ChatBubbleWrapper = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n align-items: ", ";\n display: flex;\n flex: 1;\n flex-direction: column;\n max-width: fit-content;\n"], ["\n align-items: ", ";\n display: flex;\n flex: 1;\n flex-direction: column;\n max-width: fit-content;\n"])), function (_a) {
|
|
181
|
+
var isMe = _a.isMe;
|
|
182
|
+
return isMe && 'flex-end';
|
|
183
|
+
});
|
|
180
184
|
var S_TimeWrapper = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n align-items: ", ";\n align-self: ", ";\n display: flex;\n flex-direction: column;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n align-items: ", ";\n align-self: ", ";\n display: flex;\n flex-direction: column;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
181
185
|
var isMe = _a.isMe;
|
|
182
186
|
return isMe && 'flex-end';
|
|
@@ -203,5 +207,6 @@ var S_SeeMoreButton = styled_components_1.default.div(templateObject_13 || (temp
|
|
|
203
207
|
var hoverMode = _a.hoverMode;
|
|
204
208
|
return hoverMode === 'use' && '1';
|
|
205
209
|
});
|
|
210
|
+
var S_BubbleWrapper = styled_components_1.default.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
206
211
|
exports.default = ChatBubbleListItem;
|
|
207
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
212
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BubblePositionType } from '../../../../common/types/systemUI';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
type ContextBubbleSheetProps = {
|
|
4
|
+
pointingPosition: BubblePositionType;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @description ChatBubbleListItem에서의 사용 용례와 비슷한 사용 방식이 발생 한 경우, 별도의 PDS로 분리할 예정입니다.
|
|
9
|
+
*/
|
|
10
|
+
declare const ReactionBubble: ({ pointingPosition, children }: ContextBubbleSheetProps) => JSX.Element;
|
|
11
|
+
export default ReactionBubble;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
43
|
+
/**
|
|
44
|
+
* @description ChatBubbleListItem에서의 사용 용례와 비슷한 사용 방식이 발생 한 경우, 별도의 PDS로 분리할 예정입니다.
|
|
45
|
+
*/
|
|
46
|
+
var ReactionBubble = function (_a) {
|
|
47
|
+
var _b = _a.pointingPosition, pointingPosition = _b === void 0 ? 'start_bottom' : _b, children = _a.children;
|
|
48
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(S_ContextBubbleArea, __assign({ "$position": pointingPosition }, { children: (0, jsx_runtime_1.jsxs)(S_ContextBubbleWrapper, __assign({ "$position": pointingPosition }, { children: [children, (0, jsx_runtime_1.jsxs)(Arrow, __assign({ "$position": pointingPosition, viewBox: "0 0 18 10", xmlns: "http://www.w3.org/2000/svg" }, { children: [(0, jsx_runtime_1.jsx)("polygon", { points: "9,10 3,0 15,0", fill: theme.ui_cpnt_sheet_base_01 }), (0, jsx_runtime_1.jsx)("path", { d: "M3,1 L9,10", stroke: theme.ui_cpnt_sheet_border_01, strokeWidth: "1", strokeLinecap: "butt" }), (0, jsx_runtime_1.jsx)("path", { d: "M15,1 L9,10", stroke: theme.ui_cpnt_sheet_border_01, strokeWidth: "1", strokeLinecap: "butt" }), (0, jsx_runtime_1.jsx)("path", { d: "M0,0 L15,0", strokeWidth: "1" })] }))] })) })));
|
|
50
|
+
};
|
|
51
|
+
exports.default = ReactionBubble;
|
|
52
|
+
var S_ContextBubbleArea = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n flex-direction: column;\n ", "\n position: relative;\n"], ["\n align-items: center;\n display: flex;\n flex-direction: column;\n ", "\n position: relative;\n"])), function (_a) {
|
|
53
|
+
var $position = _a.$position, theme = _a.theme;
|
|
54
|
+
var isTop = $position.includes('top');
|
|
55
|
+
return !isTop
|
|
56
|
+
? "margin-bottom: ".concat(theme.spacing.spacingB, ";")
|
|
57
|
+
: "margin-top: ".concat(theme.spacing.spacingB, ";");
|
|
58
|
+
});
|
|
59
|
+
var S_ContextBubbleWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: ", ";\n border-radius: 12px;\n display: flex;\n padding: ", ";\n position: relative;\n width: 'fit-content';\n"], ["\n align-items: center;\n background-color: ", ";\n border: ", ";\n border-radius: 12px;\n display: flex;\n padding: ", ";\n position: relative;\n width: 'fit-content';\n"])), function (_a) {
|
|
60
|
+
var theme = _a.theme;
|
|
61
|
+
return theme.ui_cpnt_sheet_base_01;
|
|
62
|
+
}, function (_a) {
|
|
63
|
+
var theme = _a.theme;
|
|
64
|
+
return "1px solid ".concat(theme.ui_cpnt_sheet_border_01);
|
|
65
|
+
}, function (_a) {
|
|
66
|
+
var theme = _a.theme;
|
|
67
|
+
return "".concat(theme.spacing.spacingB, " ").concat(theme.spacing.spacingC);
|
|
68
|
+
});
|
|
69
|
+
var Arrow = styled_components_1.default.svg(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 12.6px;\n position: absolute;\n width: 15px;\n\n ", "\n\n ", "\n"], ["\n height: 12.6px;\n position: absolute;\n width: 15px;\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
70
|
+
var $position = _a.$position;
|
|
71
|
+
var isTop = $position.includes('top');
|
|
72
|
+
if (isTop) {
|
|
73
|
+
return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n top: -10px;\n transform: translateX(-50%) rotate(180deg);\n "], ["\n top: -10px;\n transform: translateX(-50%) rotate(180deg);\n "])));
|
|
74
|
+
}
|
|
75
|
+
return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n bottom: -10px;\n transform: translateX(-50%);\n "], ["\n bottom: -10px;\n transform: translateX(-50%);\n "])));
|
|
76
|
+
}, function (_a) {
|
|
77
|
+
var $position = _a.$position;
|
|
78
|
+
if ($position.includes('center')) {
|
|
79
|
+
return "left: 50%;";
|
|
80
|
+
}
|
|
81
|
+
if ($position.includes('end')) {
|
|
82
|
+
return "right: 12px;";
|
|
83
|
+
}
|
|
84
|
+
return "left: 19.5px;";
|
|
85
|
+
});
|
|
86
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ReactionType = 'heart' | 'like' | 'confetti';
|
|
3
|
+
type ReactionValueOption = {
|
|
4
|
+
type: ReactionType;
|
|
5
|
+
count: number;
|
|
6
|
+
};
|
|
7
|
+
type ReactionArrayType = ReactionValueOption[];
|
|
8
|
+
type Props = {
|
|
9
|
+
isMe: boolean;
|
|
10
|
+
downloadIBtnMode: 'use' | 'none';
|
|
11
|
+
reactionBtnMode: 'use' | 'none';
|
|
12
|
+
reactionBtnText: string;
|
|
13
|
+
reactionArray?: ReactionArrayType;
|
|
14
|
+
reactionBubblePosition: 'top' | 'bottom';
|
|
15
|
+
onClickReactionBtn?: (type: ReactionType) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function ReactionRow({ isMe, downloadIBtnMode, reactionBtnMode, reactionBtnText, reactionArray, reactionBubblePosition, onClickReactionBtn }: Props): JSX.Element;
|
|
18
|
+
export default ReactionRow;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
|
+
var react_1 = require("react");
|
|
23
|
+
var components_1 = require("../../../../hybrid/components");
|
|
24
|
+
var TextLabel_1 = require("../../../components/TextLabel");
|
|
25
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
26
|
+
var ReactionBubble_1 = __importDefault(require("./ReactionBubble"));
|
|
27
|
+
function ReactionRow(_a) {
|
|
28
|
+
var isMe = _a.isMe, downloadIBtnMode = _a.downloadIBtnMode, reactionBtnMode = _a.reactionBtnMode, reactionBtnText = _a.reactionBtnText, reactionArray = _a.reactionArray, reactionBubblePosition = _a.reactionBubblePosition, onClickReactionBtn = _a.onClickReactionBtn;
|
|
29
|
+
var _b = (0, react_1.useState)(false), isOpenReactionBubble = _b[0], setIsOpenReactionBubble = _b[1];
|
|
30
|
+
var bubbleRef = (0, react_1.useRef)(null);
|
|
31
|
+
var buttonRef = (0, react_1.useRef)(null);
|
|
32
|
+
/**
|
|
33
|
+
* @when : 컴포넌트 렌더링 시
|
|
34
|
+
* @expected : ReactionBubble의 외부를 클릭하면 ReactionBubble가 닫히도록 클릭 이벤트를 등록합니다.
|
|
35
|
+
* @clear document의 클릭 이벤트를 제거합니다.
|
|
36
|
+
*/
|
|
37
|
+
(0, react_1.useEffect)(function () {
|
|
38
|
+
function handleClickOutside(event) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
event.stopPropagation();
|
|
41
|
+
if (event.target instanceof Node &&
|
|
42
|
+
(((_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) || ((_b = bubbleRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))))
|
|
43
|
+
return;
|
|
44
|
+
if (isOpenReactionBubble) {
|
|
45
|
+
setIsOpenReactionBubble(false);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
49
|
+
return function () {
|
|
50
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
51
|
+
};
|
|
52
|
+
}, [isOpenReactionBubble]);
|
|
53
|
+
var defaultReactions = [
|
|
54
|
+
{ iconName: 'ic_lottie_heart', type: 'heart' },
|
|
55
|
+
{ iconName: 'ic_lottie_thumb_up', type: 'like' },
|
|
56
|
+
{ iconName: 'ic_lottie_confetti', type: 'confetti' }
|
|
57
|
+
];
|
|
58
|
+
var handleClickReactionButton = function () {
|
|
59
|
+
isOpenReactionBubble ? setIsOpenReactionBubble(false) : setIsOpenReactionBubble(true);
|
|
60
|
+
};
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)(S_Wrapper, { children: [(0, jsx_runtime_1.jsxs)(S_ReactionWrapper, __assign({ isMe: isMe, downloadIBtnMode: downloadIBtnMode === 'use' }, { children: [(0, jsx_runtime_1.jsx)(S_ButtonWrapper, __assign({ ref: buttonRef }, { children: !isMe && reactionBtnMode === 'use' && ((0, jsx_runtime_1.jsxs)(S_ReactionButton, __assign({ onClick: handleClickReactionButton }, { children: [(0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: "ic_plus_circle", size: 12 }), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: reactionBtnText, singleLineMode: "use", styleTheme: "caption2Bold" })] }))) })), reactionArray && ((0, jsx_runtime_1.jsx)(S_ReactionBadgeWrapper, { children: reactionArray.map(function (reaction, index) {
|
|
62
|
+
var iconName = function () {
|
|
63
|
+
switch (reaction.type) {
|
|
64
|
+
case 'heart':
|
|
65
|
+
return 'ic_lottie_heart';
|
|
66
|
+
case 'like':
|
|
67
|
+
return 'ic_lottie_thumb_up';
|
|
68
|
+
case 'confetti':
|
|
69
|
+
return 'ic_lottie_confetti';
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return ((0, jsx_runtime_1.jsx)(S_ReactionBadge, __assign({ type: reaction.type }, { children: (0, jsx_runtime_1.jsx)(components_1.LottieIcon, { iconName: iconName(), size: 16, autoplayMode: "none", loopMode: "none" }) }), index));
|
|
73
|
+
}) }))] })), (0, jsx_runtime_1.jsx)(S_ReactionBubbleWrapper, __assign({ ref: bubbleRef, reactionBubblePosition: reactionBubblePosition }, { children: isOpenReactionBubble && ((0, jsx_runtime_1.jsx)(ReactionBubble_1.default, __assign({ pointingPosition: reactionBubblePosition === 'bottom' ? 'start_top' : 'start_bottom' }, { children: (0, jsx_runtime_1.jsx)(S_ReactionBadgeWrapper, { children: defaultReactions.map(function (reaction, index) { return ((0, jsx_runtime_1.jsx)(S_ReactionBadge, __assign({ type: reaction.type, isButton: true, onClick: function () {
|
|
74
|
+
onClickReactionBtn && onClickReactionBtn(reaction.type);
|
|
75
|
+
setIsOpenReactionBubble(false);
|
|
76
|
+
} }, { children: (0, jsx_runtime_1.jsx)(components_1.LottieIcon, { iconName: reaction.iconName, size: 16, autoplayMode: "none", loopMode: "none" }) }), index)); }) }) }))) }))] }));
|
|
77
|
+
}
|
|
78
|
+
exports.default = ReactionRow;
|
|
79
|
+
var S_Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n gap: ", ";\n position: relative;\n"], ["\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n gap: ", ";\n position: relative;\n"])), function (_a) {
|
|
80
|
+
var theme = _a.theme;
|
|
81
|
+
return theme.spacing.spacingA;
|
|
82
|
+
});
|
|
83
|
+
var S_ReactionWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n gap: ", ";\n justify-content: space-between;\n max-width: -webkit-fill-available;\n padding-right: ", ";\n padding-top: ", ";\n width: 100%;\n"], ["\n display: flex;\n gap: ", ";\n justify-content: space-between;\n max-width: -webkit-fill-available;\n padding-right: ", ";\n padding-top: ", ";\n width: 100%;\n"])), function (_a) {
|
|
84
|
+
var theme = _a.theme;
|
|
85
|
+
return theme.spacing.spacingB;
|
|
86
|
+
}, function (_a) {
|
|
87
|
+
var isMe = _a.isMe, downloadIBtnMode = _a.downloadIBtnMode;
|
|
88
|
+
return !isMe && (downloadIBtnMode ? '40px' : '34px');
|
|
89
|
+
}, function (_a) {
|
|
90
|
+
var theme = _a.theme;
|
|
91
|
+
return theme.spacing.spacingA;
|
|
92
|
+
});
|
|
93
|
+
var S_ButtonWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
94
|
+
var S_ReactionButton = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: 8px;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n gap: ", ";\n height: 24px;\n justify-content: center;\n padding: 0 ", ";\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: 8px;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n gap: ", ";\n height: 24px;\n justify-content: center;\n padding: 0 ", ";\n"])), function (_a) {
|
|
95
|
+
var theme = _a.theme;
|
|
96
|
+
return theme.ui_cpnt_sheet_base_02;
|
|
97
|
+
}, function (_a) {
|
|
98
|
+
var theme = _a.theme;
|
|
99
|
+
return theme.spacing.spacingA;
|
|
100
|
+
}, function (_a) {
|
|
101
|
+
var theme = _a.theme;
|
|
102
|
+
return theme.spacing.spacingB;
|
|
103
|
+
});
|
|
104
|
+
var S_ReactionBadgeWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n gap: ", ";\n"], ["\n display: flex;\n gap: ", ";\n"])), function (_a) {
|
|
105
|
+
var theme = _a.theme;
|
|
106
|
+
return theme.spacing.spacingA;
|
|
107
|
+
});
|
|
108
|
+
var S_ReactionBadge = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: 100%;\n cursor: ", ";\n display: flex;\n height: 24px;\n justify-content: center;\n width: 24px;\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: 100%;\n cursor: ", ";\n display: flex;\n height: 24px;\n justify-content: center;\n width: 24px;\n"])), function (_a) {
|
|
109
|
+
var theme = _a.theme, type = _a.type;
|
|
110
|
+
switch (type) {
|
|
111
|
+
case 'heart':
|
|
112
|
+
return theme.ui_cpnt_message_reaction_base_01;
|
|
113
|
+
case 'like':
|
|
114
|
+
return theme.ui_cpnt_message_reaction_base_02;
|
|
115
|
+
case 'confetti':
|
|
116
|
+
return theme.ui_cpnt_message_reaction_base_03;
|
|
117
|
+
}
|
|
118
|
+
}, function (_a) {
|
|
119
|
+
var isButton = _a.isButton;
|
|
120
|
+
return isButton && 'pointer';
|
|
121
|
+
});
|
|
122
|
+
var S_ReactionBubbleWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n left: 0;\n position: absolute;\n ", "\n z-index: 10;\n"], ["\n left: 0;\n position: absolute;\n ", "\n z-index: 10;\n"])), function (_a) {
|
|
123
|
+
var reactionBubblePosition = _a.reactionBubblePosition;
|
|
124
|
+
return reactionBubblePosition === 'bottom' ? 'top: 28px;' : 'bottom: 24px;';
|
|
125
|
+
});
|
|
126
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ReactionRow } from './ReactionRow';
|
|
@@ -0,0 +1,8 @@
|
|
|
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.ReactionRow = void 0;
|
|
7
|
+
var ReactionRow_1 = require("./ReactionRow");
|
|
8
|
+
Object.defineProperty(exports, "ReactionRow", { enumerable: true, get: function () { return __importDefault(ReactionRow_1).default; } });
|
package/package.json
CHANGED
package/release-note.md
CHANGED