@consilioweb/payload-support 0.9.12 → 0.10.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.
@@ -18,9 +18,21 @@
18
18
 
19
19
  .title {
20
20
  font-size: 24px;
21
- font-weight: 800;
21
+ font-weight: 700;
22
22
  color: var(--theme-text);
23
23
  margin: 0;
24
+ line-height: 1.2;
25
+ }
26
+
27
+ .subtitle {
28
+ font-size: 13px;
29
+ color: var(--theme-elevation-500);
30
+ margin: 2px 0 0;
31
+ }
32
+
33
+ .subtitleBreach {
34
+ color: var(--theme-error-500, #c4392c);
35
+ font-weight: 600;
24
36
  }
25
37
 
26
38
  .headerRight {
@@ -56,8 +68,8 @@
56
68
 
57
69
  &:focus {
58
70
  outline: none;
59
- border-color: #2563eb;
60
- box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
71
+ border-color: var(--theme-info-500, #2a6bd8);
72
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-info-500, #2a6bd8) 18%, transparent);
61
73
  }
62
74
 
63
75
  &::placeholder { color: var(--theme-elevation-400); }
@@ -78,50 +90,84 @@
78
90
  .newTicketBtn {
79
91
  padding: 8px 18px;
80
92
  border-radius: 8px;
81
- border: 1px solid var(--theme-elevation-200);
82
- background: var(--theme-elevation-0, #fff);
83
- color: var(--theme-text);
93
+ border: 1px solid var(--theme-text);
94
+ background: var(--theme-text);
95
+ color: var(--theme-bg, #fff);
84
96
  font-size: 13px;
85
97
  font-weight: 600;
86
98
  cursor: pointer;
87
99
  transition: all 100ms;
88
100
  text-decoration: none;
89
- &:hover { background: var(--theme-elevation-100); }
101
+ &:hover {
102
+ background: var(--theme-elevation-800);
103
+ border-color: var(--theme-elevation-800);
104
+ }
90
105
  }
91
106
 
92
- // Filter tabs
107
+ // Filter tabs / segments
93
108
  .tabs {
94
- display: flex;
109
+ display: inline-flex;
110
+ align-items: center;
95
111
  gap: 0;
96
- border-bottom: 1px solid var(--theme-elevation-150, #f1f5f9);
97
- margin-bottom: 0;
112
+ background: var(--theme-elevation-100);
113
+ border: 1px solid var(--theme-elevation-200);
114
+ border-radius: 8px;
115
+ padding: 2px;
116
+ margin: 4px 0 6px;
117
+ flex-wrap: wrap;
98
118
  }
99
119
 
100
120
  .tab {
101
- padding: 10px 16px;
121
+ display: inline-flex;
122
+ align-items: center;
123
+ gap: 6px;
124
+ height: 30px;
125
+ padding: 0 12px;
102
126
  font-size: 13px;
103
- font-weight: 600;
127
+ font-weight: 500;
104
128
  color: var(--theme-elevation-500);
105
129
  background: none;
106
130
  border: none;
107
- border-bottom: 2px solid transparent;
131
+ border-radius: 6px;
108
132
  cursor: pointer;
109
- transition: all 100ms;
133
+ transition: background 100ms, color 100ms;
110
134
  white-space: nowrap;
111
135
 
112
136
  &:hover { color: var(--theme-text); }
113
137
 
114
138
  &.tabActive {
115
139
  color: var(--theme-text);
116
- border-bottom-color: #2563eb;
140
+ background: var(--theme-elevation-0, #fff);
141
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
142
+ }
143
+
144
+ &.tabAlert:not(.tabActive) {
145
+ color: var(--theme-error-500, #c4392c);
117
146
  }
118
147
  }
119
148
 
120
149
  .tabCount {
150
+ display: inline-flex;
151
+ align-items: center;
152
+ justify-content: center;
153
+ min-width: 18px;
154
+ height: 18px;
155
+ padding: 0 6px;
121
156
  font-size: 11px;
122
- font-weight: 700;
123
- color: var(--theme-elevation-400);
124
- margin-left: 4px;
157
+ font-weight: 600;
158
+ color: var(--theme-elevation-500);
159
+ background: var(--theme-elevation-200);
160
+ border-radius: 999px;
161
+ }
162
+
163
+ .tabActive .tabCount {
164
+ background: var(--theme-elevation-100);
165
+ color: var(--theme-text);
166
+ }
167
+
168
+ .tabCountAlert {
169
+ color: var(--theme-error-500, #c4392c) !important;
170
+ background: color-mix(in srgb, var(--theme-error-500, #c4392c) 12%, transparent) !important;
125
171
  }
126
172
 
127
173
  .sortRow {
@@ -147,54 +193,73 @@
147
193
  flex-direction: column;
148
194
  }
149
195
 
196
+ // Layout : check | priority-dot | StatusPill | ticket# | subject | client | sla | updated | unread
150
197
  .row {
151
198
  display: grid;
152
- grid-template-columns: 18px 16px 70px 50px 1fr 180px 100px 80px 100px 12px;
153
- gap: 10px;
199
+ grid-template-columns: 18px 12px 110px 80px 1fr 200px 90px 90px 12px;
200
+ gap: 12px;
154
201
  align-items: center;
155
- padding: 11px 12px;
156
- border-bottom: 1px solid var(--theme-elevation-100, #f8fafc);
202
+ padding: 10px 14px;
203
+ border-bottom: 1px solid var(--theme-elevation-100, #f3f3f3);
157
204
  cursor: pointer;
158
- transition: background 60ms;
205
+ transition: background 80ms ease;
159
206
  text-decoration: none;
160
207
  color: inherit;
208
+ position: relative;
161
209
 
162
210
  &:hover { background: var(--theme-elevation-50); }
163
211
 
164
212
  @media (max-width: 900px) {
165
- grid-template-columns: 16px 60px 1fr 100px 80px;
213
+ grid-template-columns: 16px 110px 1fr 80px 80px;
166
214
  }
167
215
  }
168
216
 
169
217
  .rowSelected {
170
- background: #eff6ff;
171
- border-left: 3px solid #2563eb;
172
- padding-left: 9px;
218
+ background: var(--theme-elevation-100);
219
+ }
220
+
221
+ .rowUnread {
222
+ background: linear-gradient(90deg, color-mix(in srgb, var(--theme-info-500, #2a6bd8) 8%, transparent) 0, transparent 6px);
223
+
224
+ .subject { font-weight: 700; }
173
225
  }
174
226
 
175
- .statusDot {
227
+ .rowBreach::before {
228
+ content: '';
229
+ position: absolute;
230
+ left: 0;
231
+ top: 0;
232
+ bottom: 0;
233
+ width: 3px;
234
+ background: var(--theme-error-500, #c4392c);
235
+ }
236
+
237
+ .rowCheck {
238
+ width: 14px;
239
+ height: 14px;
240
+ cursor: pointer;
241
+ accent-color: var(--theme-text);
242
+ }
243
+
244
+ .priorityDot {
245
+ display: inline-block;
176
246
  width: 8px;
177
247
  height: 8px;
178
248
  border-radius: 50%;
179
249
  flex-shrink: 0;
180
250
  }
181
251
 
182
- .statusText {
183
- font-size: 12px;
184
- font-weight: 600;
185
- color: var(--theme-elevation-500);
186
- }
187
-
188
252
  .ticketNum {
189
253
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace;
190
254
  font-size: 11px;
191
255
  color: var(--theme-elevation-400);
192
256
  font-weight: 500;
257
+ letter-spacing: 0.02em;
193
258
  }
194
259
 
195
260
  .subject {
196
261
  font-size: 13px;
197
- font-weight: 600;
262
+ font-weight: 500;
198
263
  color: var(--theme-text);
199
264
  overflow: hidden;
200
265
  text-overflow: ellipsis;
@@ -209,35 +274,32 @@
209
274
  white-space: nowrap;
210
275
  }
211
276
 
212
- .categoryChip {
277
+ // SLA cell — color reflects state (computed in computeSlaState)
278
+ .slaCell {
213
279
  font-size: 11px;
214
- font-weight: 600;
215
- color: var(--theme-elevation-500);
216
- padding: 2px 8px;
217
- border-radius: 4px;
218
- background: var(--theme-elevation-100);
280
+ font-weight: 500;
281
+ font-variant-numeric: tabular-nums;
282
+ text-align: right;
283
+ color: var(--theme-elevation-400);
219
284
  white-space: nowrap;
220
285
  }
221
-
222
- .priorityBar {
223
- width: 4px;
224
- height: 18px;
225
- border-radius: 2px;
226
- flex-shrink: 0;
227
- }
286
+ .slaOk { color: var(--theme-elevation-400); }
287
+ .slaWarn { color: var(--theme-warning-500, #c97a0a); font-weight: 600; }
288
+ .slaBreach { color: var(--theme-error-500, #c4392c); font-weight: 700; }
228
289
 
229
290
  .timeAgo {
230
291
  font-size: 12px;
231
292
  color: var(--theme-elevation-400);
232
293
  white-space: nowrap;
233
294
  text-align: right;
295
+ font-variant-numeric: tabular-nums;
234
296
  }
235
297
 
236
298
  .unreadDot {
237
299
  width: 7px;
238
300
  height: 7px;
239
301
  border-radius: 50%;
240
- background: #2563eb;
302
+ background: var(--theme-info-500, #2a6bd8);
241
303
  flex-shrink: 0;
242
304
  }
243
305
 
@@ -7,6 +7,7 @@ import { RichTextEditor, type RichTextEditorHandle } from '../../components/Rich
7
7
  import { hasCodeBlocks, MessageWithCodeBlocks, CodeBlockRendererHtml } from '../../components/TicketConversation/components/CodeBlock'
8
8
  import { CodeBlockInserter } from '../../components/TicketConversation/components/CodeBlockInserter'
9
9
  import { getFeatures } from '../shared/config'
10
+ import { computeSlaState, formatSlaRemaining } from '../shared/sla'
10
11
  import { useTranslation } from '../../components/TicketConversation/hooks/useTranslation'
11
12
  import s from '../../styles/TicketDetail.module.scss'
12
13
 
@@ -604,6 +605,41 @@ const [clientTyping, setClientTyping] = useState(false)
604
605
  </div>
605
606
  </div>
606
607
 
608
+ {/* SLA BREACH BANNER */}
609
+ {(() => {
610
+ const slaInfo = computeSlaState({
611
+ slaFirstResponseDue: ticket.slaFirstResponseDue as string | null,
612
+ slaFirstResponseBreached: ticket.slaFirstResponseBreached as boolean | null,
613
+ slaResolutionDue: ticket.slaResolutionDue as string | null,
614
+ slaResolutionBreached: ticket.slaResolutionBreached as boolean | null,
615
+ firstResponseAt: ticket.firstResponseAt as string | null,
616
+ })
617
+ if (slaInfo.state !== 'breach') return null
618
+ const duration = formatSlaRemaining(slaInfo.remainingMs).replace(/^−/, '')
619
+ const target = slaInfo.due ? new Date(slaInfo.due).toLocaleString('fr-FR', { day: '2-digit', month: 'short', hour: '2-digit', minute: '2-digit' }) : ''
620
+ return (
621
+ <div className={s.slaBanner} role="alert">
622
+ <span className={s.slaBannerIcon} aria-hidden>
623
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M12 9v4M12 17h.01" /><path d="M10.3 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" /></svg>
624
+ </span>
625
+ <div className={s.slaBannerBody}>
626
+ <strong>{t('inbox.slaBanner.breached')}</strong>
627
+ <span className={s.slaBannerSep}>—</span>
628
+ <span>{t('inbox.slaBanner.responseAwaitedFor', { duration })}</span>
629
+ {target && <span className={s.slaBannerTarget}>· {t('inbox.slaBanner.target', { target })}</span>}
630
+ </div>
631
+ <button
632
+ type="button"
633
+ className={s.slaBannerCta}
634
+ onClick={() => handleStatusChange('escalated' as any)}
635
+ aria-label={t('inbox.slaBanner.escalate')}
636
+ >
637
+ ↑ {t('inbox.slaBanner.escalate')}
638
+ </button>
639
+ </div>
640
+ )
641
+ })()}
642
+
607
643
  {/* PRESENCE BANNER */}
608
644
  {otherViewers.length > 0 && (
609
645
  <div style={{
@@ -632,9 +668,18 @@ const [clientTyping, setClientTyping] = useState(false)
632
668
  return (
633
669
  <React.Fragment key={msg.id}>
634
670
  {showDate && <div className={s.dateSeparator}><span className={s.dateSeparatorText}>{dateLabel(msg.createdAt)}</span></div>}
635
- <div className={`${s.message} ${msg.isInternal ? s.messageInternal : ''}`} style={isPendingDelete ? { opacity: 0.3, pointerEvents: 'none' } : undefined}>
671
+ <div className={`${s.message} ${isAdmin ? s.messageAdmin : s.messageClient} ${msg.isInternal ? s.messageInternal : ''}`} style={isPendingDelete ? { opacity: 0.3, pointerEvents: 'none' } : undefined}>
636
672
  {/* #10 — Client avatar purple */}
637
- <div className={s.avatar} style={{ backgroundColor: isAdmin ? '#2563eb' : msg.authorType === 'email' ? '#ea580c' : '#7c3aed' }}>
673
+ <div
674
+ className={s.avatar}
675
+ style={{
676
+ backgroundColor: isAdmin
677
+ ? 'var(--theme-info-500, #2a6bd8)'
678
+ : msg.authorType === 'email'
679
+ ? 'var(--theme-warning-500, #c97a0a)'
680
+ : 'var(--theme-accent-500, #6b46e8)',
681
+ }}
682
+ >
638
683
  {isAdmin ? 'CW' : initials}
639
684
  </div>
640
685
  <div className={s.messageContent}>
@@ -741,7 +786,15 @@ const [clientTyping, setClientTyping] = useState(false)
741
786
  <div className={s.composerToolbar}>
742
787
  {features.ai && (
743
788
  <>
744
- <button className={s.toolbarBtn} data-tooltip={t('detail.iaSuggestion')} aria-label={t('detail.iaSuggestion')} onClick={handleAiSuggest} disabled={aiReplying || messages.length === 0} style={{ fontSize: 11, fontWeight: 700, padding: '4px 10px', width: 'auto' }}>{aiReplying ? '...' : `✨ ${t('detail.iaSuggestion')}`}</button>
789
+ <button
790
+ className={`${s.toolbarBtn} ${s.toolbarBtnAi}`}
791
+ data-tooltip={t('detail.iaSuggestion')}
792
+ aria-label={t('detail.iaSuggestion')}
793
+ onClick={handleAiSuggest}
794
+ disabled={aiReplying || messages.length === 0}
795
+ >
796
+ {aiReplying ? '…' : `✨ ${t('detail.iaSuggestion')}`}
797
+ </button>
745
798
  <RewriteDropdown disabled={aiRewriting || !replyBody.trim()} loading={aiRewriting} onSelect={(style) => handleAiRewrite(style)} toolbarBtnClass={s.toolbarBtn} />
746
799
  </>
747
800
  )}
@@ -832,6 +885,9 @@ const [clientTyping, setClientTyping] = useState(false)
832
885
  </>
833
886
  )}
834
887
  </div>
888
+ <span className={s.sendShortcut} aria-hidden>
889
+ <kbd>⌘</kbd><kbd>↵</kbd>
890
+ </span>
835
891
  <button className={`${s.sendBtn} ${isInternal ? s.sendBtnInternal : ''}`} onClick={handleSend} disabled={sending || !replyBody.trim()} data-action="send-reply">
836
892
  {sending ? t('detail.sending') : sendAsClient ? 'Ajouter message client' : isInternal ? t('detail.sendNote') : t('detail.sendReply')}
837
893
  </button>
@@ -858,6 +914,34 @@ const [clientTyping, setClientTyping] = useState(false)
858
914
  </div>
859
915
  )}
860
916
 
917
+ {/* AI client synthesis — promoted: highest-value briefing for the agent */}
918
+ {clientSummary && clientSummary.summary && (
919
+ <div className={`${s.sideSection} ${s.aiCard}`}>
920
+ <div className={s.aiCardTitle}>
921
+ <span className={s.aiCardIcon} aria-hidden>✨</span>
922
+ Synthèse client
923
+ </div>
924
+ <p className={s.aiCardLead}>{clientSummary.summary}</p>
925
+ {clientSummary.recurringTopics && clientSummary.recurringTopics.length > 0 && (
926
+ <div className={s.aiCardChips}>
927
+ {clientSummary.recurringTopics.slice(0, 5).map((tp, i) => (
928
+ <span key={`tp-${i}`} className={s.aiChip}>{tp.topic}</span>
929
+ ))}
930
+ </div>
931
+ )}
932
+ {clientSummary.keyFacts && clientSummary.keyFacts.length > 0 && (
933
+ <ul className={s.aiCardFacts}>
934
+ {clientSummary.keyFacts.slice(0, 4).map((f, i) => (
935
+ <li key={`kf-${i}`} className={s.aiCardFact}>
936
+ <span className={s.aiCardDot} aria-hidden />
937
+ {f}
938
+ </li>
939
+ ))}
940
+ </ul>
941
+ )}
942
+ </div>
943
+ )}
944
+
861
945
  {/* #1 — Editable sidebar fields */}
862
946
  <div className={s.sideSection}>
863
947
  <div className={s.sideSectionTitle}>{t('detail.details')}</div>
@@ -1092,32 +1176,9 @@ const [clientTyping, setClientTyping] = useState(false)
1092
1176
  </div>
1093
1177
  )}
1094
1178
 
1095
- {/* Client Intelligence (compact) */}
1096
- {clientSummary && clientSummary.summary && (
1097
- <div className={s.sideSection} style={{ background: 'linear-gradient(135deg, rgba(37,99,235,0.03) 0%, rgba(139,92,246,0.03) 100%)' }}>
1098
- <div className={s.sideSectionTitle} style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
1099
- <span style={{ fontSize: 13 }}>🧠</span> Résumé client
1100
- </div>
1101
- <p style={{ margin: '0 0 8px', fontSize: 11, lineHeight: 1.6, color: '#374151' }}>{clientSummary.summary}</p>
1102
- {clientSummary.recurringTopics && clientSummary.recurringTopics.length > 0 && (
1103
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: 4, marginBottom: 6 }}>
1104
- {clientSummary.recurringTopics.slice(0, 3).map((tp, i) => (
1105
- <span key={i} style={{ padding: '2px 8px', borderRadius: 10, background: 'rgba(37,99,235,0.08)', color: '#2563eb', fontSize: 10, fontWeight: 600 }}>{tp.topic}</span>
1106
- ))}
1107
- </div>
1108
- )}
1109
- {clientSummary.keyFacts && clientSummary.keyFacts.length > 0 && (
1110
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: 4 }}>
1111
- {clientSummary.keyFacts.slice(0, 3).map((f, i) => (
1112
- <span key={i} style={{ padding: '2px 8px', borderRadius: 10, background: 'rgba(22,163,74,0.08)', color: '#16a34a', fontSize: 10, fontWeight: 600 }}>{f}</span>
1113
- ))}
1114
- </div>
1115
- )}
1116
- </div>
1117
- )}
1118
1179
  {summaryLoading && (
1119
1180
  <div className={s.sideSection}>
1120
- <div style={{ fontSize: 11, color: '#94a3b8', textAlign: 'center', padding: 8 }}>🧠 Chargement résumé...</div>
1181
+ <div style={{ fontSize: 11, color: 'var(--theme-elevation-400)', textAlign: 'center', padding: 8 }}>✨ Chargement de la synthèse…</div>
1121
1182
  </div>
1122
1183
  )}
1123
1184
  </div>