vanilla-agent 1.20.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -0
- package/dist/index.cjs +24 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +608 -6
- package/dist/index.d.ts +608 -6
- package/dist/index.global.js +44 -44
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/install.global.js +1 -1
- package/dist/install.global.js.map +1 -1
- package/dist/widget.css +467 -5
- package/package.json +1 -1
- package/src/client.ts +215 -1
- package/src/components/launcher.ts +10 -1
- package/src/components/message-bubble.ts +208 -4
- package/src/components/messages.ts +10 -3
- package/src/defaults.ts +32 -0
- package/src/index.ts +20 -4
- package/src/install.ts +69 -7
- package/src/postprocessors.ts +124 -6
- package/src/session.ts +77 -1
- package/src/styles/widget.css +467 -5
- package/src/types.ts +487 -0
- package/src/ui.ts +40 -5
package/src/styles/widget.css
CHANGED
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
all: initial;
|
|
7
7
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
|
|
8
8
|
line-height: 1.5;
|
|
9
|
+
|
|
10
|
+
/* Theme-aware markdown variables - inherit from theme colors set by JavaScript */
|
|
11
|
+
--cw-md-code-block-bg: var(--cw-container, #f3f4f6);
|
|
12
|
+
--cw-md-code-block-border-color: var(--cw-border, #e5e7eb);
|
|
13
|
+
--cw-md-inline-code-bg: var(--cw-container, #f3f4f6);
|
|
14
|
+
--cw-md-table-border-color: var(--cw-border, #e5e7eb);
|
|
15
|
+
--cw-md-table-header-bg: var(--cw-container, #f8fafc);
|
|
16
|
+
--cw-md-hr-color: var(--cw-divider, #e5e7eb);
|
|
17
|
+
--cw-md-blockquote-border-color: var(--cw-accent, #3b82f6);
|
|
18
|
+
--cw-md-blockquote-text-color: var(--cw-muted, #6b7280);
|
|
9
19
|
}
|
|
10
20
|
|
|
11
21
|
#vanilla-agent-root * {
|
|
@@ -86,6 +96,71 @@
|
|
|
86
96
|
--cw-radius-lg: 1.5rem;
|
|
87
97
|
--cw-launcher-radius: 9999px;
|
|
88
98
|
--cw-button-radius: 9999px;
|
|
99
|
+
|
|
100
|
+
/* Markdown Header Variables */
|
|
101
|
+
--cw-md-h1-size: 1.5rem;
|
|
102
|
+
--cw-md-h1-weight: 700;
|
|
103
|
+
--cw-md-h1-margin: 1rem 0 0.5rem;
|
|
104
|
+
--cw-md-h1-line-height: 1.25;
|
|
105
|
+
--cw-md-h2-size: 1.25rem;
|
|
106
|
+
--cw-md-h2-weight: 700;
|
|
107
|
+
--cw-md-h2-margin: 0.875rem 0 0.5rem;
|
|
108
|
+
--cw-md-h2-line-height: 1.3;
|
|
109
|
+
--cw-md-h3-size: 1.125rem;
|
|
110
|
+
--cw-md-h3-weight: 600;
|
|
111
|
+
--cw-md-h3-margin: 0.75rem 0 0.375rem;
|
|
112
|
+
--cw-md-h3-line-height: 1.4;
|
|
113
|
+
--cw-md-h4-size: 1rem;
|
|
114
|
+
--cw-md-h4-weight: 600;
|
|
115
|
+
--cw-md-h4-margin: 0.625rem 0 0.25rem;
|
|
116
|
+
--cw-md-h4-line-height: 1.5;
|
|
117
|
+
--cw-md-h5-size: 0.875rem;
|
|
118
|
+
--cw-md-h5-weight: 600;
|
|
119
|
+
--cw-md-h5-margin: 0.5rem 0 0.25rem;
|
|
120
|
+
--cw-md-h5-line-height: 1.5;
|
|
121
|
+
--cw-md-h6-size: 0.75rem;
|
|
122
|
+
--cw-md-h6-weight: 600;
|
|
123
|
+
--cw-md-h6-margin: 0.5rem 0 0.25rem;
|
|
124
|
+
--cw-md-h6-line-height: 1.5;
|
|
125
|
+
|
|
126
|
+
/* Markdown Table Variables (defaults - theme-aware values set on #vanilla-agent-root) */
|
|
127
|
+
--cw-md-table-border-color: #e5e7eb;
|
|
128
|
+
--cw-md-table-header-bg: #f8fafc;
|
|
129
|
+
--cw-md-table-header-weight: 600;
|
|
130
|
+
--cw-md-table-cell-padding: 0.5rem 0.75rem;
|
|
131
|
+
--cw-md-table-border-radius: 0.375rem;
|
|
132
|
+
|
|
133
|
+
/* Markdown Horizontal Rule Variables (defaults - theme-aware values set on #vanilla-agent-root) */
|
|
134
|
+
--cw-md-hr-color: #e5e7eb;
|
|
135
|
+
--cw-md-hr-height: 1px;
|
|
136
|
+
--cw-md-hr-margin: 1rem 0;
|
|
137
|
+
|
|
138
|
+
/* Markdown Blockquote Variables (defaults - theme-aware values set on #vanilla-agent-root) */
|
|
139
|
+
--cw-md-blockquote-border-color: #3b82f6;
|
|
140
|
+
--cw-md-blockquote-border-width: 3px;
|
|
141
|
+
--cw-md-blockquote-padding: 0.5rem 1rem;
|
|
142
|
+
--cw-md-blockquote-margin: 0.5rem 0;
|
|
143
|
+
--cw-md-blockquote-bg: transparent;
|
|
144
|
+
--cw-md-blockquote-text-color: #6b7280;
|
|
145
|
+
--cw-md-blockquote-font-style: italic;
|
|
146
|
+
|
|
147
|
+
/* Markdown Code Block Variables (defaults - theme-aware values set on #vanilla-agent-root) */
|
|
148
|
+
--cw-md-code-block-bg: #f3f4f6;
|
|
149
|
+
--cw-md-code-block-border-color: #e5e7eb;
|
|
150
|
+
--cw-md-code-block-text-color: inherit;
|
|
151
|
+
--cw-md-code-block-padding: 0.75rem;
|
|
152
|
+
--cw-md-code-block-border-radius: 0.375rem;
|
|
153
|
+
--cw-md-code-block-font-size: 0.875rem;
|
|
154
|
+
|
|
155
|
+
/* Markdown Inline Code Variables (defaults - theme-aware values set on #vanilla-agent-root) */
|
|
156
|
+
--cw-md-inline-code-bg: #f3f4f6;
|
|
157
|
+
--cw-md-inline-code-padding: 0.125rem 0.375rem;
|
|
158
|
+
--cw-md-inline-code-border-radius: 0.25rem;
|
|
159
|
+
--cw-md-inline-code-font-size: 0.875em;
|
|
160
|
+
|
|
161
|
+
/* Markdown Strong/Em Variables */
|
|
162
|
+
--cw-md-strong-weight: 600;
|
|
163
|
+
--cw-md-em-style: italic;
|
|
89
164
|
}
|
|
90
165
|
|
|
91
166
|
.tvw-rounded-xl {
|
|
@@ -803,13 +878,14 @@ form:focus-within textarea {
|
|
|
803
878
|
word-wrap: break-word;
|
|
804
879
|
word-break: break-word;
|
|
805
880
|
white-space: pre-wrap;
|
|
806
|
-
background-color:
|
|
807
|
-
|
|
808
|
-
|
|
881
|
+
background-color: var(--cw-md-code-block-bg);
|
|
882
|
+
color: var(--cw-md-code-block-text-color);
|
|
883
|
+
padding: var(--cw-md-code-block-padding);
|
|
884
|
+
border-radius: var(--cw-md-code-block-border-radius);
|
|
809
885
|
margin: 0.5rem 0;
|
|
810
|
-
font-size:
|
|
886
|
+
font-size: var(--cw-md-code-block-font-size);
|
|
811
887
|
line-height: 1.5;
|
|
812
|
-
border: 1px solid
|
|
888
|
+
border: 1px solid var(--cw-md-code-block-border-color);
|
|
813
889
|
}
|
|
814
890
|
|
|
815
891
|
.vanilla-message-bubble code {
|
|
@@ -938,3 +1014,389 @@ form:focus-within textarea {
|
|
|
938
1014
|
margin: 0.25rem 0;
|
|
939
1015
|
padding-left: 0.25rem;
|
|
940
1016
|
}
|
|
1017
|
+
|
|
1018
|
+
/* ============================================
|
|
1019
|
+
Markdown Header Styles
|
|
1020
|
+
============================================ */
|
|
1021
|
+
.vanilla-message-bubble h1 {
|
|
1022
|
+
font-size: var(--cw-md-h1-size);
|
|
1023
|
+
font-weight: var(--cw-md-h1-weight);
|
|
1024
|
+
margin: var(--cw-md-h1-margin);
|
|
1025
|
+
line-height: var(--cw-md-h1-line-height);
|
|
1026
|
+
color: inherit;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
.vanilla-message-bubble h2 {
|
|
1030
|
+
font-size: var(--cw-md-h2-size);
|
|
1031
|
+
font-weight: var(--cw-md-h2-weight);
|
|
1032
|
+
margin: var(--cw-md-h2-margin);
|
|
1033
|
+
line-height: var(--cw-md-h2-line-height);
|
|
1034
|
+
color: inherit;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.vanilla-message-bubble h3 {
|
|
1038
|
+
font-size: var(--cw-md-h3-size);
|
|
1039
|
+
font-weight: var(--cw-md-h3-weight);
|
|
1040
|
+
margin: var(--cw-md-h3-margin);
|
|
1041
|
+
line-height: var(--cw-md-h3-line-height);
|
|
1042
|
+
color: inherit;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.vanilla-message-bubble h4 {
|
|
1046
|
+
font-size: var(--cw-md-h4-size);
|
|
1047
|
+
font-weight: var(--cw-md-h4-weight);
|
|
1048
|
+
margin: var(--cw-md-h4-margin);
|
|
1049
|
+
line-height: var(--cw-md-h4-line-height);
|
|
1050
|
+
color: inherit;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
.vanilla-message-bubble h5 {
|
|
1054
|
+
font-size: var(--cw-md-h5-size);
|
|
1055
|
+
font-weight: var(--cw-md-h5-weight);
|
|
1056
|
+
margin: var(--cw-md-h5-margin);
|
|
1057
|
+
line-height: var(--cw-md-h5-line-height);
|
|
1058
|
+
color: inherit;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
.vanilla-message-bubble h6 {
|
|
1062
|
+
font-size: var(--cw-md-h6-size);
|
|
1063
|
+
font-weight: var(--cw-md-h6-weight);
|
|
1064
|
+
margin: var(--cw-md-h6-margin);
|
|
1065
|
+
line-height: var(--cw-md-h6-line-height);
|
|
1066
|
+
color: inherit;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
/* Remove top margin on first heading */
|
|
1070
|
+
.vanilla-message-bubble h1:first-child,
|
|
1071
|
+
.vanilla-message-bubble h2:first-child,
|
|
1072
|
+
.vanilla-message-bubble h3:first-child,
|
|
1073
|
+
.vanilla-message-bubble h4:first-child,
|
|
1074
|
+
.vanilla-message-bubble h5:first-child,
|
|
1075
|
+
.vanilla-message-bubble h6:first-child {
|
|
1076
|
+
margin-top: 0;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/* ============================================
|
|
1080
|
+
Markdown Table Styles
|
|
1081
|
+
============================================ */
|
|
1082
|
+
.vanilla-message-bubble table {
|
|
1083
|
+
width: 100%;
|
|
1084
|
+
border-collapse: collapse;
|
|
1085
|
+
margin: 0.5rem 0;
|
|
1086
|
+
font-size: 0.875rem;
|
|
1087
|
+
overflow: hidden;
|
|
1088
|
+
border-radius: var(--cw-md-table-border-radius);
|
|
1089
|
+
border: 1px solid var(--cw-md-table-border-color);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
.vanilla-message-bubble thead {
|
|
1093
|
+
background-color: var(--cw-md-table-header-bg);
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
.vanilla-message-bubble th {
|
|
1097
|
+
font-weight: var(--cw-md-table-header-weight);
|
|
1098
|
+
text-align: left;
|
|
1099
|
+
padding: var(--cw-md-table-cell-padding);
|
|
1100
|
+
border-bottom: 1px solid var(--cw-md-table-border-color);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
.vanilla-message-bubble td {
|
|
1104
|
+
padding: var(--cw-md-table-cell-padding);
|
|
1105
|
+
border-bottom: 1px solid var(--cw-md-table-border-color);
|
|
1106
|
+
text-align: left;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
.vanilla-message-bubble tr:last-child td {
|
|
1110
|
+
border-bottom: none;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
.vanilla-message-bubble tbody tr:nth-child(even) {
|
|
1114
|
+
background-color: rgba(0, 0, 0, 0.02);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
/* ============================================
|
|
1118
|
+
Markdown Horizontal Rule Styles
|
|
1119
|
+
============================================ */
|
|
1120
|
+
.vanilla-message-bubble hr {
|
|
1121
|
+
border: none;
|
|
1122
|
+
height: var(--cw-md-hr-height);
|
|
1123
|
+
background-color: var(--cw-md-hr-color);
|
|
1124
|
+
margin: var(--cw-md-hr-margin);
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
/* ============================================
|
|
1128
|
+
Markdown Blockquote Styles
|
|
1129
|
+
============================================ */
|
|
1130
|
+
.vanilla-message-bubble blockquote {
|
|
1131
|
+
border-left: var(--cw-md-blockquote-border-width) solid var(--cw-md-blockquote-border-color);
|
|
1132
|
+
padding: var(--cw-md-blockquote-padding);
|
|
1133
|
+
margin: var(--cw-md-blockquote-margin);
|
|
1134
|
+
background-color: var(--cw-md-blockquote-bg);
|
|
1135
|
+
color: var(--cw-md-blockquote-text-color);
|
|
1136
|
+
font-style: var(--cw-md-blockquote-font-style);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
.vanilla-message-bubble blockquote p {
|
|
1140
|
+
margin: 0;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
.vanilla-message-bubble blockquote p + p {
|
|
1144
|
+
margin-top: 0.5rem;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/* Nested blockquotes */
|
|
1148
|
+
.vanilla-message-bubble blockquote blockquote {
|
|
1149
|
+
margin-left: 0.5rem;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/* ============================================
|
|
1153
|
+
Markdown Inline Code Styles (not in pre)
|
|
1154
|
+
============================================ */
|
|
1155
|
+
.vanilla-message-bubble code:not(pre code) {
|
|
1156
|
+
background-color: var(--cw-md-inline-code-bg);
|
|
1157
|
+
padding: var(--cw-md-inline-code-padding);
|
|
1158
|
+
border-radius: var(--cw-md-inline-code-border-radius);
|
|
1159
|
+
font-size: var(--cw-md-inline-code-font-size);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/* ============================================
|
|
1163
|
+
Markdown Strong/Emphasis Styles
|
|
1164
|
+
============================================ */
|
|
1165
|
+
.vanilla-message-bubble strong,
|
|
1166
|
+
.vanilla-message-bubble b {
|
|
1167
|
+
font-weight: var(--cw-md-strong-weight);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
.vanilla-message-bubble em,
|
|
1171
|
+
.vanilla-message-bubble i {
|
|
1172
|
+
font-style: var(--cw-md-em-style);
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/* ============================================
|
|
1176
|
+
User Message Markdown Overrides
|
|
1177
|
+
Ensure styles work in user bubbles too
|
|
1178
|
+
============================================ */
|
|
1179
|
+
.vanilla-message-user-bubble h1,
|
|
1180
|
+
.vanilla-message-user-bubble h2,
|
|
1181
|
+
.vanilla-message-user-bubble h3,
|
|
1182
|
+
.vanilla-message-user-bubble h4,
|
|
1183
|
+
.vanilla-message-user-bubble h5,
|
|
1184
|
+
.vanilla-message-user-bubble h6 {
|
|
1185
|
+
color: inherit;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.vanilla-message-user-bubble table {
|
|
1189
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
.vanilla-message-user-bubble th,
|
|
1193
|
+
.vanilla-message-user-bubble td {
|
|
1194
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
.vanilla-message-user-bubble thead {
|
|
1198
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
.vanilla-message-user-bubble tbody tr:nth-child(even) {
|
|
1202
|
+
background-color: rgba(255, 255, 255, 0.05);
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
.vanilla-message-user-bubble hr {
|
|
1206
|
+
background-color: rgba(255, 255, 255, 0.3);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
.vanilla-message-user-bubble blockquote {
|
|
1210
|
+
border-left-color: rgba(255, 255, 255, 0.5);
|
|
1211
|
+
color: inherit;
|
|
1212
|
+
opacity: 0.9;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.vanilla-message-user-bubble code:not(pre code) {
|
|
1216
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/* ============================================
|
|
1220
|
+
Message Action Buttons (Copy, Upvote, Downvote)
|
|
1221
|
+
============================================ */
|
|
1222
|
+
|
|
1223
|
+
/* Make message bubble position relative for overlay positioning */
|
|
1224
|
+
.vanilla-message-bubble {
|
|
1225
|
+
position: relative;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
/* Fade-in animation for action buttons */
|
|
1229
|
+
@keyframes tvw-message-actions-fade-in {
|
|
1230
|
+
from {
|
|
1231
|
+
opacity: 0;
|
|
1232
|
+
}
|
|
1233
|
+
to {
|
|
1234
|
+
opacity: 1;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/* Base action bar styles */
|
|
1239
|
+
.tvw-message-actions {
|
|
1240
|
+
display: flex;
|
|
1241
|
+
align-items: center;
|
|
1242
|
+
gap: 0.25rem;
|
|
1243
|
+
margin-top: 0.5rem;
|
|
1244
|
+
padding-top: 0.5rem;
|
|
1245
|
+
border-top: 1px solid var(--cw-divider, #f1f5f9);
|
|
1246
|
+
/* Fade in when first shown (for "always" visibility) */
|
|
1247
|
+
animation: tvw-message-actions-fade-in 0.3s ease-out;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/* Action bar alignment */
|
|
1251
|
+
.tvw-message-actions-left {
|
|
1252
|
+
justify-content: flex-start;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
.tvw-message-actions-center {
|
|
1256
|
+
justify-content: center;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
.tvw-message-actions-right {
|
|
1260
|
+
justify-content: flex-end;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/* Hover visibility mode - overlay on desktop */
|
|
1264
|
+
@media (hover: hover) {
|
|
1265
|
+
.tvw-message-actions-hover {
|
|
1266
|
+
/* Hidden by default */
|
|
1267
|
+
opacity: 0;
|
|
1268
|
+
pointer-events: none;
|
|
1269
|
+
transition: opacity 0.15s ease-in-out;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
/* Pill layout - compact floating pill */
|
|
1273
|
+
.tvw-message-actions-hover.tvw-message-actions-pill {
|
|
1274
|
+
position: absolute;
|
|
1275
|
+
bottom: 0.5rem;
|
|
1276
|
+
margin-top: 0;
|
|
1277
|
+
padding: 0.25rem;
|
|
1278
|
+
border-top: none;
|
|
1279
|
+
width: fit-content;
|
|
1280
|
+
background-color: var(--cw-surface, #ffffff);
|
|
1281
|
+
border: 1px solid var(--cw-divider, #f1f5f9);
|
|
1282
|
+
border-radius: var(--cw-radius-md, 0.75rem);
|
|
1283
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/* Pill layout - position based on alignment */
|
|
1287
|
+
.tvw-message-actions-hover.tvw-message-actions-pill.tvw-message-actions-left {
|
|
1288
|
+
left: 0.75rem;
|
|
1289
|
+
right: auto;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
.tvw-message-actions-hover.tvw-message-actions-pill.tvw-message-actions-center {
|
|
1293
|
+
left: 50%;
|
|
1294
|
+
right: auto;
|
|
1295
|
+
transform: translateX(-50%);
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
.tvw-message-actions-hover.tvw-message-actions-pill.tvw-message-actions-right {
|
|
1299
|
+
right: 0.75rem;
|
|
1300
|
+
left: auto;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/* Row layout - full-width bar at bottom */
|
|
1304
|
+
.tvw-message-actions-hover.tvw-message-actions-row {
|
|
1305
|
+
position: absolute;
|
|
1306
|
+
bottom: 0;
|
|
1307
|
+
left: 0;
|
|
1308
|
+
right: 0;
|
|
1309
|
+
margin-top: 0;
|
|
1310
|
+
padding: 0.5rem 0.75rem;
|
|
1311
|
+
border-top: none;
|
|
1312
|
+
background: linear-gradient(
|
|
1313
|
+
to top,
|
|
1314
|
+
var(--cw-surface, #ffffff) 70%,
|
|
1315
|
+
transparent
|
|
1316
|
+
);
|
|
1317
|
+
border-radius: 0 0 var(--cw-radius-lg, 1.5rem) var(--cw-radius-lg, 1.5rem);
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
.vanilla-message-bubble:hover .tvw-message-actions-hover,
|
|
1321
|
+
.vanilla-message-bubble:focus-within .tvw-message-actions-hover {
|
|
1322
|
+
opacity: 1;
|
|
1323
|
+
pointer-events: auto;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/* On touch devices (no hover support), show inline and always visible */
|
|
1328
|
+
@media (hover: none) {
|
|
1329
|
+
.tvw-message-actions-hover {
|
|
1330
|
+
/* Keep normal flow positioning on mobile */
|
|
1331
|
+
position: static;
|
|
1332
|
+
opacity: 1;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
/* Action button base styles */
|
|
1337
|
+
.tvw-message-action-btn {
|
|
1338
|
+
display: inline-flex;
|
|
1339
|
+
align-items: center;
|
|
1340
|
+
justify-content: center;
|
|
1341
|
+
width: 28px;
|
|
1342
|
+
height: 28px;
|
|
1343
|
+
padding: 0;
|
|
1344
|
+
border: none;
|
|
1345
|
+
border-radius: 6px;
|
|
1346
|
+
background-color: transparent;
|
|
1347
|
+
color: var(--cw-muted, #6b7280);
|
|
1348
|
+
cursor: pointer;
|
|
1349
|
+
transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
.tvw-message-action-btn:hover {
|
|
1353
|
+
background-color: var(--cw-container, #f8fafc);
|
|
1354
|
+
color: var(--cw-primary, #111827);
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
.tvw-message-action-btn:active {
|
|
1358
|
+
transform: scale(0.95);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
.tvw-message-action-btn:focus {
|
|
1362
|
+
outline: none;
|
|
1363
|
+
box-shadow: 0 0 0 2px var(--cw-accent, #1d4ed8);
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
.tvw-message-action-btn:focus:not(:focus-visible) {
|
|
1367
|
+
box-shadow: none;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
.tvw-message-action-btn:focus-visible {
|
|
1371
|
+
box-shadow: 0 0 0 2px var(--cw-accent, #1d4ed8);
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/* Active state (voted) */
|
|
1375
|
+
.tvw-message-action-btn.tvw-message-action-active {
|
|
1376
|
+
background-color: var(--cw-accent, #1d4ed8);
|
|
1377
|
+
color: #ffffff;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
.tvw-message-action-btn.tvw-message-action-active:hover {
|
|
1381
|
+
background-color: var(--cw-accent, #1d4ed8);
|
|
1382
|
+
color: #ffffff;
|
|
1383
|
+
opacity: 0.9;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
/* Success state (after copy) */
|
|
1387
|
+
.tvw-message-action-btn.tvw-message-action-success {
|
|
1388
|
+
background-color: #10b981;
|
|
1389
|
+
color: #ffffff;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
.tvw-message-action-btn.tvw-message-action-success:hover {
|
|
1393
|
+
background-color: #10b981;
|
|
1394
|
+
color: #ffffff;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/* Icon styling within buttons */
|
|
1398
|
+
.tvw-message-action-btn svg {
|
|
1399
|
+
width: 14px;
|
|
1400
|
+
height: 14px;
|
|
1401
|
+
flex-shrink: 0;
|
|
1402
|
+
}
|