context-drop 0.2.0 → 0.3.1

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.
@@ -128,6 +128,47 @@ export const WIDGET_SHADOW_STYLES = `
128
128
  border-color: #3b4252;
129
129
  }
130
130
 
131
+ :host([data-cd-theme="dark"]) .cd-msg-action-btn:hover:not(:disabled),
132
+ :host([data-theme="dark"]) .cd-msg-action-btn:hover:not(:disabled),
133
+ .cd-composer[data-theme="dark"] .cd-msg-action-btn:hover:not(:disabled) {
134
+ background: rgba(255, 255, 255, 0.09);
135
+ color: var(--cd-ink);
136
+ }
137
+
138
+ :host([data-cd-theme="dark"]) .cd-msg-action-btn.is-danger:hover:not(:disabled),
139
+ :host([data-theme="dark"]) .cd-msg-action-btn.is-danger:hover:not(:disabled),
140
+ .cd-composer[data-theme="dark"] .cd-msg-action-btn.is-danger:hover:not(:disabled) {
141
+ background: var(--cd-danger-soft);
142
+ color: #fca5a5;
143
+ }
144
+
145
+ :host([data-cd-theme="dark"]) .cd-edit-banner-info,
146
+ :host([data-theme="dark"]) .cd-edit-banner-info,
147
+ .cd-composer[data-theme="dark"] .cd-edit-banner-info {
148
+ color: var(--cd-ink);
149
+ }
150
+
151
+ :host([data-cd-theme="dark"]) .cd-msg-delete-label,
152
+ :host([data-theme="dark"]) .cd-msg-delete-label,
153
+ .cd-composer[data-theme="dark"] .cd-msg-delete-label {
154
+ color: #fca5a5;
155
+ }
156
+
157
+ :host([data-cd-theme="dark"]) .cd-btn-danger,
158
+ :host([data-theme="dark"]) .cd-btn-danger,
159
+ .cd-composer[data-theme="dark"] .cd-btn-danger {
160
+ background: #dc2626;
161
+ border-color: #dc2626;
162
+ color: #ffffff;
163
+ }
164
+
165
+ :host([data-cd-theme="dark"]) .cd-btn-danger:hover:not(:disabled),
166
+ :host([data-theme="dark"]) .cd-btn-danger:hover:not(:disabled),
167
+ .cd-composer[data-theme="dark"] .cd-btn-danger:hover:not(:disabled) {
168
+ background: #ef4444;
169
+ border-color: #ef4444;
170
+ }
171
+
131
172
  *, *::before, *::after {
132
173
  box-sizing: border-box;
133
174
  }
@@ -990,11 +1031,18 @@ select:focus-visible {
990
1031
  flex-direction: column;
991
1032
  gap: 5px;
992
1033
  align-self: flex-end;
1034
+ width: 92%;
993
1035
  max-width: 92%;
994
1036
  padding: 9px 11px;
995
1037
  background: var(--cd-surface-elevated);
996
1038
  border: 1px solid var(--cd-border);
997
1039
  border-radius: 12px 12px 3px 12px;
1040
+ transition: border-color 0.14s var(--cd-ease), box-shadow 0.14s var(--cd-ease);
1041
+ }
1042
+
1043
+ .cd-chat-msg.is-editing {
1044
+ border-color: var(--cd-accent);
1045
+ box-shadow: 0 0 0 2px var(--cd-accent-soft);
998
1046
  }
999
1047
 
1000
1048
  .cd-chat-msg-text {
@@ -1015,6 +1063,83 @@ select:focus-visible {
1015
1063
  font-variant-numeric: tabular-nums;
1016
1064
  }
1017
1065
 
1066
+ .cd-chat-msg-meta-info {
1067
+ display: inline-flex;
1068
+ align-items: center;
1069
+ gap: 6px;
1070
+ min-width: 0;
1071
+ flex-wrap: wrap;
1072
+ }
1073
+
1074
+ .cd-chat-msg-actions {
1075
+ display: inline-flex;
1076
+ align-items: center;
1077
+ gap: 2px;
1078
+ flex-shrink: 0;
1079
+ }
1080
+
1081
+ .cd-msg-action-btn {
1082
+ appearance: none;
1083
+ display: inline-flex;
1084
+ align-items: center;
1085
+ justify-content: center;
1086
+ width: 24px;
1087
+ height: 24px;
1088
+ padding: 0;
1089
+ border: 1px solid transparent;
1090
+ border-radius: 6px;
1091
+ background: transparent;
1092
+ color: var(--cd-ink-secondary);
1093
+ cursor: pointer;
1094
+ transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
1095
+ }
1096
+
1097
+ .cd-msg-action-btn:hover:not(:disabled) {
1098
+ background: rgba(17, 19, 24, 0.06);
1099
+ color: var(--cd-ink);
1100
+ }
1101
+
1102
+ .cd-msg-action-btn.is-active {
1103
+ background: var(--cd-accent-soft);
1104
+ color: var(--cd-accent-hover);
1105
+ border-color: rgba(29, 78, 216, 0.25);
1106
+ }
1107
+
1108
+ .cd-msg-action-btn.is-danger:hover:not(:disabled) {
1109
+ background: var(--cd-danger-soft);
1110
+ color: var(--cd-danger);
1111
+ }
1112
+
1113
+ .cd-msg-action-btn:disabled {
1114
+ opacity: 0.4;
1115
+ cursor: not-allowed;
1116
+ }
1117
+
1118
+ .cd-msg-delete-confirm {
1119
+ display: flex;
1120
+ align-items: center;
1121
+ justify-content: space-between;
1122
+ gap: 8px;
1123
+ margin-top: 2px;
1124
+ padding: 6px 8px;
1125
+ border-radius: 8px;
1126
+ background: var(--cd-danger-soft);
1127
+ border: 1px solid rgba(185, 28, 28, 0.24);
1128
+ }
1129
+
1130
+ .cd-msg-delete-label {
1131
+ font-size: 11.5px;
1132
+ font-weight: 600;
1133
+ color: var(--cd-danger);
1134
+ }
1135
+
1136
+ .cd-msg-delete-btns {
1137
+ display: inline-flex;
1138
+ align-items: center;
1139
+ gap: 5px;
1140
+ flex-shrink: 0;
1141
+ }
1142
+
1018
1143
  .cd-chat-msg-pills {
1019
1144
  display: flex;
1020
1145
  flex-wrap: wrap;
@@ -1037,6 +1162,136 @@ select:focus-visible {
1037
1162
  font-weight: 500;
1038
1163
  }
1039
1164
 
1165
+ .cd-chat-msg.is-commenting {
1166
+ border-color: var(--cd-accent);
1167
+ box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12);
1168
+ }
1169
+
1170
+ .cd-msg-status-badge {
1171
+ display: inline-flex;
1172
+ align-items: center;
1173
+ padding: 1px 6px;
1174
+ border-radius: 999px;
1175
+ font-size: 10px;
1176
+ font-weight: 600;
1177
+ text-transform: capitalize;
1178
+ letter-spacing: 0.01em;
1179
+ border: 1px solid transparent;
1180
+ line-height: 1.4;
1181
+ }
1182
+
1183
+ .cd-msg-status-badge.is-new {
1184
+ background: #eff6ff;
1185
+ border-color: #bfdbfe;
1186
+ color: #1d4ed8;
1187
+ }
1188
+
1189
+ .cd-msg-status-badge.is-updated {
1190
+ background: #fffbeb;
1191
+ border-color: #fde68a;
1192
+ color: #b45309;
1193
+ }
1194
+
1195
+ .cd-msg-status-badge.is-fixed {
1196
+ background: #eef2ff;
1197
+ border-color: #c7d2fe;
1198
+ color: #4338ca;
1199
+ }
1200
+
1201
+ .cd-msg-status-badge.is-reviewed {
1202
+ background: #f0fdf4;
1203
+ border-color: #bbf7d0;
1204
+ color: #15803d;
1205
+ }
1206
+
1207
+ .cd-msg-status-badge.is-dismissed {
1208
+ background: #f8fafc;
1209
+ border-color: #e2e8f0;
1210
+ color: #64748b;
1211
+ }
1212
+
1213
+ .cd-review-btn {
1214
+ display: inline-flex;
1215
+ align-items: center;
1216
+ gap: 4px;
1217
+ padding: 2px 7px;
1218
+ border-radius: 5px;
1219
+ border: 1px solid #bbf7d0;
1220
+ background: #f0fdf4;
1221
+ color: #15803d;
1222
+ font-family: inherit;
1223
+ font-size: 10.5px;
1224
+ font-weight: 600;
1225
+ cursor: pointer;
1226
+ transition: background 0.12s ease, border-color 0.12s ease;
1227
+ }
1228
+
1229
+ .cd-review-btn:hover:not(:disabled) {
1230
+ background: #dcfce7;
1231
+ border-color: #86efac;
1232
+ }
1233
+
1234
+ .cd-review-btn:disabled {
1235
+ opacity: 0.5;
1236
+ cursor: default;
1237
+ }
1238
+
1239
+ .cd-comments-list {
1240
+ display: flex;
1241
+ flex-direction: column;
1242
+ gap: 6px;
1243
+ margin-top: 6px;
1244
+ padding-top: 6px;
1245
+ border-top: 1px dashed var(--cd-border-subtle);
1246
+ }
1247
+
1248
+ .cd-comment-item {
1249
+ background: var(--cd-surface-recessed);
1250
+ border: 1px solid var(--cd-border-subtle);
1251
+ border-radius: 6px;
1252
+ padding: 6px 8px;
1253
+ }
1254
+
1255
+ .cd-comment-header {
1256
+ display: flex;
1257
+ align-items: center;
1258
+ justify-content: space-between;
1259
+ gap: 6px;
1260
+ font-size: 10.5px;
1261
+ color: var(--cd-muted);
1262
+ margin-bottom: 2px;
1263
+ }
1264
+
1265
+ .cd-comment-author {
1266
+ font-weight: 600;
1267
+ color: var(--cd-ink);
1268
+ }
1269
+
1270
+ .cd-comment-body {
1271
+ margin: 0;
1272
+ font-size: 11.5px;
1273
+ line-height: 1.42;
1274
+ color: var(--cd-ink);
1275
+ white-space: pre-wrap;
1276
+ word-break: break-word;
1277
+ }
1278
+
1279
+ .cd-comment-images {
1280
+ display: flex;
1281
+ flex-wrap: wrap;
1282
+ gap: 5px;
1283
+ margin-top: 5px;
1284
+ }
1285
+
1286
+ .cd-comment-thumb {
1287
+ width: 48px;
1288
+ height: 48px;
1289
+ object-fit: cover;
1290
+ border-radius: 4px;
1291
+ border: 1px solid var(--cd-border);
1292
+ display: block;
1293
+ }
1294
+
1040
1295
  /* ==========================================================================
1041
1296
  4. LOCAL BYOK AGENTIC CODING SIDEBAR (.cd-agent-sidebar)
1042
1297
  ========================================================================== */
@@ -1899,6 +2154,42 @@ select:focus-visible {
1899
2154
  border-top: 1px solid var(--cd-border);
1900
2155
  }
1901
2156
 
2157
+ .cd-edit-banner {
2158
+ display: flex;
2159
+ align-items: center;
2160
+ justify-content: space-between;
2161
+ gap: 8px;
2162
+ padding: 6px 12px;
2163
+ background: var(--cd-accent-soft);
2164
+ border-bottom: 1px solid var(--cd-border-subtle);
2165
+ font-size: 12px;
2166
+ color: var(--cd-ink);
2167
+ }
2168
+
2169
+ .cd-edit-banner[hidden] {
2170
+ display: none !important;
2171
+ }
2172
+
2173
+ .cd-edit-banner-info {
2174
+ display: inline-flex;
2175
+ align-items: center;
2176
+ gap: 6px;
2177
+ min-width: 0;
2178
+ font-weight: 600;
2179
+ color: var(--cd-accent-hover);
2180
+ }
2181
+
2182
+ .cd-edit-banner-info svg {
2183
+ color: var(--cd-accent-hover);
2184
+ flex-shrink: 0;
2185
+ }
2186
+
2187
+ .cd-edit-banner-id {
2188
+ font-family: var(--cd-mono);
2189
+ font-size: 11px;
2190
+ font-variant-numeric: tabular-nums;
2191
+ }
2192
+
1902
2193
  .cd-textarea {
1903
2194
  width: 100%;
1904
2195
  min-height: 68px;
@@ -1979,6 +2270,24 @@ select:focus-visible {
1979
2270
  border-color: #252a34;
1980
2271
  }
1981
2272
 
2273
+ .cd-btn-xs {
2274
+ padding: 3px 8px;
2275
+ font-size: 11.5px;
2276
+ border-radius: 6px;
2277
+ }
2278
+
2279
+ .cd-btn-danger {
2280
+ background: var(--cd-danger);
2281
+ border-color: var(--cd-danger);
2282
+ color: #ffffff;
2283
+ font-weight: 600;
2284
+ }
2285
+
2286
+ .cd-btn-danger:hover:not(:disabled) {
2287
+ background: #991b1b;
2288
+ border-color: #991b1b;
2289
+ }
2290
+
1982
2291
  @media (max-width: 560px) {
1983
2292
  .cd-composer,
1984
2293
  .cd-compact-bar {
@@ -2006,6 +2315,8 @@ select:focus-visible {
2006
2315
  .cd-corner-flap,
2007
2316
  .cd-drag-pin-head,
2008
2317
  .cd-composer,
2318
+ .cd-chat-msg,
2319
+ .cd-msg-action-btn,
2009
2320
  .cd-agent-sidebar,
2010
2321
  .cd-skeleton-bar {
2011
2322
  animation: none !important;
@@ -45,6 +45,7 @@ export interface SmartComponentDescription {
45
45
  }
46
46
  export interface PendingAttachmentItem {
47
47
  id: string;
48
+ existing_attachment_id?: number | string;
48
49
  attachment_type: "image" | "screenshot";
49
50
  label: string;
50
51
  preview_url: string;
@@ -55,17 +56,40 @@ export interface PendingAttachmentItem {
55
56
  element_reference_ref?: string;
56
57
  metadata: Record<string, unknown>;
57
58
  }
59
+ export interface SessionFeedbackAttachmentItem {
60
+ id: string;
61
+ server_id?: number | string;
62
+ label: string;
63
+ preview_url: string;
64
+ attachment_type: "image" | "screenshot";
65
+ filename?: string | null;
66
+ signed_blob_id?: string;
67
+ data_url?: string;
68
+ element_reference_ref?: string | null;
69
+ metadata?: Record<string, unknown>;
70
+ }
71
+ export interface SessionFeedbackCommentItem {
72
+ id: number | string;
73
+ author_label: string;
74
+ author_type?: string | null;
75
+ body: string | null;
76
+ createdAt: string;
77
+ rawCreatedAt?: string;
78
+ attachments: SessionFeedbackAttachmentItem[];
79
+ }
58
80
  export interface SessionFeedbackEntry {
59
81
  id: number | string;
60
82
  message: string;
83
+ rawMessage?: string;
61
84
  createdAt: string;
85
+ rawCreatedAt?: string;
86
+ rawUpdatedAt?: string;
87
+ isEdited?: boolean;
88
+ status?: string;
89
+ ownershipToken?: string;
62
90
  elements: ElementReferenceSnapshot[];
63
- attachments: Array<{
64
- id: string;
65
- label: string;
66
- preview_url: string;
67
- attachment_type: "image" | "screenshot";
68
- }>;
91
+ attachments: SessionFeedbackAttachmentItem[];
92
+ comments?: SessionFeedbackCommentItem[];
69
93
  }
70
94
  export interface ContextDropApiClientOptions {
71
95
  credentials?: RequestCredentials;
@@ -113,6 +137,97 @@ export interface FeedbackSubmissionPayload {
113
137
  metadata: Record<string, unknown>;
114
138
  }>;
115
139
  }
140
+ export interface OwnFeedbackAttachment {
141
+ id: number | string;
142
+ attachment_type: "image" | "screenshot";
143
+ filename: string | null;
144
+ content_type?: string | null;
145
+ byte_size?: number | null;
146
+ element_reference_ref?: string | null;
147
+ metadata?: Record<string, unknown>;
148
+ created_at?: string;
149
+ }
150
+ export interface FeedbackCommentRecord {
151
+ id: number | string;
152
+ feedback_id?: number | string;
153
+ author_label: string;
154
+ author_type?: string | null;
155
+ body: string | null;
156
+ attachments: OwnFeedbackAttachment[];
157
+ created_at: string;
158
+ updated_at?: string;
159
+ }
160
+ export interface OwnFeedbackRecord {
161
+ id: number;
162
+ environment?: string;
163
+ message: string;
164
+ page_url?: string;
165
+ status: string;
166
+ metadata?: Record<string, unknown>;
167
+ attachments_count: number;
168
+ element_references_count: number;
169
+ element_references: ElementReferenceSnapshot[];
170
+ attachments: OwnFeedbackAttachment[];
171
+ comments_count?: number;
172
+ comments?: FeedbackCommentRecord[];
173
+ created_at: string;
174
+ updated_at: string;
175
+ ownership_token?: string;
176
+ }
177
+ export interface OwnFeedbackListResponse {
178
+ total_count: number;
179
+ feedbacks: OwnFeedbackRecord[];
180
+ }
181
+ export interface FeedbackAttachmentUpdateInput {
182
+ existing_id?: number | string;
183
+ attachment_type?: "image" | "screenshot";
184
+ filename?: string;
185
+ signed_blob_id?: string;
186
+ data_url?: string;
187
+ element_reference_ref?: string;
188
+ metadata?: Record<string, unknown>;
189
+ }
190
+ export interface FeedbackUpdatePayload {
191
+ message?: string;
192
+ status?: string;
193
+ metadata?: Record<string, unknown>;
194
+ element_references?: ElementReferenceSnapshot[];
195
+ attachments?: FeedbackAttachmentUpdateInput[];
196
+ }
197
+ export interface CreateCommentPayload {
198
+ body: string;
199
+ attachments: Array<{
200
+ attachment_type: "image" | "screenshot";
201
+ filename: string;
202
+ signed_blob_id?: string;
203
+ data_url?: string;
204
+ metadata: Record<string, unknown>;
205
+ }>;
206
+ }
207
+ export interface CreateCommentResponse {
208
+ id: number | string;
209
+ feedback_id: number | string;
210
+ status: string;
211
+ comment: FeedbackCommentRecord;
212
+ feedback?: OwnFeedbackRecord;
213
+ created_at: string;
214
+ }
215
+ export interface FeedbackUpdateResponse {
216
+ id: number;
217
+ environment?: string;
218
+ status: string;
219
+ attachments_count: number;
220
+ element_references_count: number;
221
+ created_at: string;
222
+ updated_at: string;
223
+ ownership_token?: string;
224
+ feedback?: OwnFeedbackRecord;
225
+ }
226
+ export interface FeedbackDeleteResponse {
227
+ id: number;
228
+ deleted: boolean;
229
+ deleted_at: string;
230
+ }
116
231
  export interface FeedbackSubmissionResponse {
117
232
  id: number;
118
233
  environment?: string;
@@ -120,6 +235,9 @@ export interface FeedbackSubmissionResponse {
120
235
  attachments_count: number;
121
236
  element_references_count: number;
122
237
  created_at: string;
238
+ updated_at?: string;
239
+ ownership_token?: string;
240
+ feedback?: OwnFeedbackRecord;
123
241
  }
124
242
  export interface AgentProviderInfo {
125
243
  id: string;
@@ -28,6 +28,14 @@ export declare class ContextDropWidgetElement extends BaseHTMLElement {
28
28
  private elementDomNodes;
29
29
  private attachments;
30
30
  private sessionHistory;
31
+ private ownFeedbacksLoaded;
32
+ private inFlightOwnFeedbacksPromise;
33
+ private editingFeedbackId;
34
+ private commentingFeedbackId;
35
+ private reviewingFeedbackId;
36
+ private confirmingDeleteId;
37
+ private deletingFeedbackId;
38
+ private stashedDraftBeforeEdit;
31
39
  private agentStatusLoaded;
32
40
  private agentWorkspaceName;
33
41
  private agentMcpEnvironments;
@@ -63,6 +71,8 @@ export declare class ContextDropWidgetElement extends BaseHTMLElement {
63
71
  private composerToolbarScreenshotBtn;
64
72
  private composerToolbarUploadBtn;
65
73
  private chatThreadEl;
74
+ private editBannerEl;
75
+ private editBannerInfoEl;
66
76
  private textareaEl;
67
77
  private trayEl;
68
78
  private statusEl;
@@ -112,6 +122,19 @@ export declare class ContextDropWidgetElement extends BaseHTMLElement {
112
122
  getElementReferences(): ElementReferenceSnapshot[];
113
123
  getAttachments(): PendingAttachmentItem[];
114
124
  getSessionHistory(): SessionFeedbackEntry[];
125
+ getEditingFeedbackId(): string | null;
126
+ private formatTimestampLabel;
127
+ private mapOwnRecordToSessionEntry;
128
+ refreshOwnFeedbacks(): Promise<SessionFeedbackEntry[]>;
129
+ private ensureOwnFeedbacksLoaded;
130
+ startEditingFeedback(feedbackId: number | string): boolean;
131
+ cancelEditingFeedback(): void;
132
+ startCommentingFeedback(feedbackId: number | string): boolean;
133
+ cancelCommentingFeedback(): void;
134
+ markFeedbackReviewed(feedbackId: number | string): Promise<void>;
135
+ requestDeleteFeedback(feedbackId: number | string): void;
136
+ cancelDeleteFeedback(): void;
137
+ confirmDeleteFeedback(feedbackId: number | string): Promise<void>;
115
138
  getAgentMessages(): AgentChatMessage[];
116
139
  isAgentModeActive(): boolean;
117
140
  isSmartSelectionMode(): boolean;