posthog-js 1.347.2 → 1.348.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/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/conversations.js +1 -1
- package/dist/conversations.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +43 -1
- package/dist/module.full.d.ts +43 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +43 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +43 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours-preview.d.ts +2 -0
- package/dist/product-tours-preview.js +1 -1
- package/dist/product-tours-preview.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
- package/dist/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
- package/dist/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
- package/dist/src/extensions/conversations/external/components/styles.d.ts +184 -0
- package/dist/src/extensions/conversations/external/components/utils.d.ts +8 -0
- package/dist/src/extensions/conversations/external/index.d.ts +39 -1
- package/dist/src/extensions/product-tours/product-tours.d.ts +2 -0
- package/dist/src/posthog-product-tours-types.d.ts +42 -0
- package/dist/surveys-preview.d.ts +2 -0
- package/lib/package.json +1 -1
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.js +96 -28
- package/lib/src/extensions/conversations/external/components/ConversationsWidget.js.map +1 -1
- package/lib/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
- package/lib/src/extensions/conversations/external/components/TicketListItem.js +47 -0
- package/lib/src/extensions/conversations/external/components/TicketListItem.js.map +1 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.js +75 -0
- package/lib/src/extensions/conversations/external/components/TicketListView.js.map +1 -0
- package/lib/src/extensions/conversations/external/components/styles.d.ts +184 -0
- package/lib/src/extensions/conversations/external/components/styles.js +189 -0
- package/lib/src/extensions/conversations/external/components/styles.js.map +1 -1
- package/lib/src/extensions/conversations/external/components/utils.d.ts +8 -0
- package/lib/src/extensions/conversations/external/components/utils.js +49 -0
- package/lib/src/extensions/conversations/external/components/utils.js.map +1 -0
- package/lib/src/extensions/conversations/external/index.d.ts +39 -1
- package/lib/src/extensions/conversations/external/index.js +253 -31
- package/lib/src/extensions/conversations/external/index.js.map +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js.map +1 -1
- package/lib/src/extensions/product-tours/product-tours.d.ts +2 -0
- package/lib/src/extensions/product-tours/product-tours.js +78 -71
- package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
- package/lib/src/posthog-product-tours-types.d.ts +42 -0
- package/lib/src/posthog-product-tours-types.js +43 -1
- package/lib/src/posthog-product-tours-types.js.map +1 -1
- package/lib/src/utils/product-tour-event-receiver.js +2 -1
- package/lib/src/utils/product-tour-event-receiver.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/react/dist/esm/index.js +25 -1
- package/react/dist/esm/index.js.map +1 -1
- package/react/dist/types/index.d.ts +4 -2
- package/react/dist/umd/index.js +25 -0
- package/react/dist/umd/index.js.map +1 -1
|
@@ -166,6 +166,7 @@ export declare const getStyles: (primaryColor: string, position?: WidgetPosition
|
|
|
166
166
|
};
|
|
167
167
|
windowOpen: {
|
|
168
168
|
width: string;
|
|
169
|
+
maxWidth: string;
|
|
169
170
|
height: string;
|
|
170
171
|
maxHeight: string;
|
|
171
172
|
};
|
|
@@ -371,4 +372,187 @@ export declare const getStyles: (primaryColor: string, position?: WidgetPosition
|
|
|
371
372
|
color: string;
|
|
372
373
|
fontWeight: number;
|
|
373
374
|
};
|
|
375
|
+
ticketListContainer: {
|
|
376
|
+
flex: number;
|
|
377
|
+
display: string;
|
|
378
|
+
flexDirection: "column";
|
|
379
|
+
background: string;
|
|
380
|
+
overflowY: "auto";
|
|
381
|
+
};
|
|
382
|
+
ticketList: {
|
|
383
|
+
flex: number;
|
|
384
|
+
overflowY: "auto";
|
|
385
|
+
};
|
|
386
|
+
ticketItem: {
|
|
387
|
+
padding: string;
|
|
388
|
+
borderBottom: string;
|
|
389
|
+
cursor: string;
|
|
390
|
+
transition: string;
|
|
391
|
+
background: string;
|
|
392
|
+
display: string;
|
|
393
|
+
alignItems: string;
|
|
394
|
+
gap: string;
|
|
395
|
+
};
|
|
396
|
+
ticketItemUnread: {
|
|
397
|
+
background: string;
|
|
398
|
+
};
|
|
399
|
+
ticketItemContent: {
|
|
400
|
+
display: string;
|
|
401
|
+
flexDirection: "column";
|
|
402
|
+
gap: string;
|
|
403
|
+
flex: number;
|
|
404
|
+
minWidth: number;
|
|
405
|
+
};
|
|
406
|
+
ticketItemArrow: {
|
|
407
|
+
color: string;
|
|
408
|
+
flexShrink: number;
|
|
409
|
+
display: string;
|
|
410
|
+
alignItems: string;
|
|
411
|
+
};
|
|
412
|
+
ticketItemHeader: {
|
|
413
|
+
display: string;
|
|
414
|
+
justifyContent: string;
|
|
415
|
+
alignItems: string;
|
|
416
|
+
gap: string;
|
|
417
|
+
};
|
|
418
|
+
ticketPreview: {
|
|
419
|
+
fontSize: string;
|
|
420
|
+
color: string;
|
|
421
|
+
lineHeight: number;
|
|
422
|
+
flex: number;
|
|
423
|
+
overflow: string;
|
|
424
|
+
textOverflow: string;
|
|
425
|
+
whiteSpace: "nowrap";
|
|
426
|
+
};
|
|
427
|
+
ticketPreviewUnread: {
|
|
428
|
+
fontSize: string;
|
|
429
|
+
color: string;
|
|
430
|
+
lineHeight: number;
|
|
431
|
+
flex: number;
|
|
432
|
+
overflow: string;
|
|
433
|
+
textOverflow: string;
|
|
434
|
+
whiteSpace: "nowrap";
|
|
435
|
+
fontWeight: number;
|
|
436
|
+
};
|
|
437
|
+
ticketUnreadBadge: {
|
|
438
|
+
minWidth: string;
|
|
439
|
+
height: string;
|
|
440
|
+
borderRadius: string;
|
|
441
|
+
background: string;
|
|
442
|
+
color: string;
|
|
443
|
+
fontSize: string;
|
|
444
|
+
fontWeight: number;
|
|
445
|
+
display: string;
|
|
446
|
+
alignItems: string;
|
|
447
|
+
justifyContent: string;
|
|
448
|
+
padding: string;
|
|
449
|
+
flexShrink: number;
|
|
450
|
+
};
|
|
451
|
+
ticketMeta: {
|
|
452
|
+
display: string;
|
|
453
|
+
alignItems: string;
|
|
454
|
+
gap: string;
|
|
455
|
+
};
|
|
456
|
+
ticketTime: {
|
|
457
|
+
fontSize: string;
|
|
458
|
+
color: string;
|
|
459
|
+
};
|
|
460
|
+
ticketStatus: {
|
|
461
|
+
fontSize: string;
|
|
462
|
+
color: string;
|
|
463
|
+
background: string;
|
|
464
|
+
padding: string;
|
|
465
|
+
borderRadius: string;
|
|
466
|
+
textTransform: "uppercase";
|
|
467
|
+
letterSpacing: string;
|
|
468
|
+
};
|
|
469
|
+
newConversationButton: {
|
|
470
|
+
display: string;
|
|
471
|
+
alignItems: string;
|
|
472
|
+
justifyContent: string;
|
|
473
|
+
margin: string;
|
|
474
|
+
padding: string;
|
|
475
|
+
borderRadius: string;
|
|
476
|
+
background: string;
|
|
477
|
+
color: string;
|
|
478
|
+
border: string;
|
|
479
|
+
cursor: string;
|
|
480
|
+
fontSize: string;
|
|
481
|
+
fontWeight: number;
|
|
482
|
+
transition: string;
|
|
483
|
+
};
|
|
484
|
+
ticketListLoading: {
|
|
485
|
+
flex: number;
|
|
486
|
+
display: string;
|
|
487
|
+
flexDirection: "column";
|
|
488
|
+
alignItems: string;
|
|
489
|
+
justifyContent: string;
|
|
490
|
+
gap: string;
|
|
491
|
+
color: string;
|
|
492
|
+
fontSize: string;
|
|
493
|
+
};
|
|
494
|
+
loadingSpinner: {
|
|
495
|
+
width: string;
|
|
496
|
+
height: string;
|
|
497
|
+
border: string;
|
|
498
|
+
borderTop: string;
|
|
499
|
+
borderRadius: string;
|
|
500
|
+
animation: string;
|
|
501
|
+
};
|
|
502
|
+
ticketListEmpty: {
|
|
503
|
+
flex: number;
|
|
504
|
+
display: string;
|
|
505
|
+
flexDirection: "column";
|
|
506
|
+
alignItems: string;
|
|
507
|
+
justifyContent: string;
|
|
508
|
+
padding: string;
|
|
509
|
+
textAlign: "center";
|
|
510
|
+
};
|
|
511
|
+
emptyStateIcon: {
|
|
512
|
+
color: string;
|
|
513
|
+
marginBottom: string;
|
|
514
|
+
};
|
|
515
|
+
emptyStateTitle: {
|
|
516
|
+
fontSize: string;
|
|
517
|
+
fontWeight: number;
|
|
518
|
+
color: string;
|
|
519
|
+
marginBottom: string;
|
|
520
|
+
};
|
|
521
|
+
emptyStateDescription: {
|
|
522
|
+
fontSize: string;
|
|
523
|
+
color: string;
|
|
524
|
+
lineHeight: number;
|
|
525
|
+
marginBottom: string;
|
|
526
|
+
};
|
|
527
|
+
newConversationButtonLarge: {
|
|
528
|
+
padding: string;
|
|
529
|
+
borderRadius: string;
|
|
530
|
+
background: string;
|
|
531
|
+
color: string;
|
|
532
|
+
border: string;
|
|
533
|
+
cursor: string;
|
|
534
|
+
fontSize: string;
|
|
535
|
+
fontWeight: number;
|
|
536
|
+
transition: string;
|
|
537
|
+
};
|
|
538
|
+
backButton: {
|
|
539
|
+
background: string;
|
|
540
|
+
border: string;
|
|
541
|
+
color: string;
|
|
542
|
+
cursor: string;
|
|
543
|
+
padding: string;
|
|
544
|
+
marginRight: string;
|
|
545
|
+
fontSize: string;
|
|
546
|
+
lineHeight: number;
|
|
547
|
+
borderRadius: string;
|
|
548
|
+
transition: string;
|
|
549
|
+
opacity: number;
|
|
550
|
+
display: string;
|
|
551
|
+
alignItems: string;
|
|
552
|
+
justifyContent: string;
|
|
553
|
+
};
|
|
554
|
+
headerWithBack: {
|
|
555
|
+
display: string;
|
|
556
|
+
alignItems: string;
|
|
557
|
+
};
|
|
374
558
|
};
|
|
@@ -57,6 +57,7 @@ var getStyles = function (primaryColor, position) {
|
|
|
57
57
|
border: 'none' }),
|
|
58
58
|
windowOpen: {
|
|
59
59
|
width: '400px',
|
|
60
|
+
maxWidth: 'calc(100vw - 40px)',
|
|
60
61
|
height: '600px',
|
|
61
62
|
maxHeight: 'calc(100vh - 100px)',
|
|
62
63
|
},
|
|
@@ -263,6 +264,194 @@ var getStyles = function (primaryColor, position) {
|
|
|
263
264
|
color: '#939393',
|
|
264
265
|
fontWeight: 400,
|
|
265
266
|
},
|
|
267
|
+
// Ticket list styles
|
|
268
|
+
ticketListContainer: {
|
|
269
|
+
flex: 1,
|
|
270
|
+
display: 'flex',
|
|
271
|
+
flexDirection: 'column',
|
|
272
|
+
background: 'white',
|
|
273
|
+
overflowY: 'auto',
|
|
274
|
+
},
|
|
275
|
+
ticketList: {
|
|
276
|
+
flex: 1,
|
|
277
|
+
overflowY: 'auto',
|
|
278
|
+
},
|
|
279
|
+
ticketItem: {
|
|
280
|
+
padding: '14px 16px',
|
|
281
|
+
borderBottom: '1px solid #f1f1f1',
|
|
282
|
+
cursor: 'pointer',
|
|
283
|
+
transition: 'background 0.15s ease-out',
|
|
284
|
+
background: 'white',
|
|
285
|
+
display: 'flex',
|
|
286
|
+
alignItems: 'center',
|
|
287
|
+
gap: '12px',
|
|
288
|
+
},
|
|
289
|
+
ticketItemUnread: {
|
|
290
|
+
background: '#fafafa',
|
|
291
|
+
},
|
|
292
|
+
ticketItemContent: {
|
|
293
|
+
display: 'flex',
|
|
294
|
+
flexDirection: 'column',
|
|
295
|
+
gap: '6px',
|
|
296
|
+
flex: 1,
|
|
297
|
+
minWidth: 0, // Allow text truncation
|
|
298
|
+
},
|
|
299
|
+
ticketItemArrow: {
|
|
300
|
+
color: '#939393',
|
|
301
|
+
flexShrink: 0,
|
|
302
|
+
display: 'flex',
|
|
303
|
+
alignItems: 'center',
|
|
304
|
+
},
|
|
305
|
+
ticketItemHeader: {
|
|
306
|
+
display: 'flex',
|
|
307
|
+
justifyContent: 'space-between',
|
|
308
|
+
alignItems: 'flex-start',
|
|
309
|
+
gap: '8px',
|
|
310
|
+
},
|
|
311
|
+
ticketPreview: {
|
|
312
|
+
fontSize: '13px',
|
|
313
|
+
color: '#020617',
|
|
314
|
+
lineHeight: 1.4,
|
|
315
|
+
flex: 1,
|
|
316
|
+
overflow: 'hidden',
|
|
317
|
+
textOverflow: 'ellipsis',
|
|
318
|
+
whiteSpace: 'nowrap',
|
|
319
|
+
},
|
|
320
|
+
ticketPreviewUnread: {
|
|
321
|
+
fontSize: '13px',
|
|
322
|
+
color: '#020617',
|
|
323
|
+
lineHeight: 1.4,
|
|
324
|
+
flex: 1,
|
|
325
|
+
overflow: 'hidden',
|
|
326
|
+
textOverflow: 'ellipsis',
|
|
327
|
+
whiteSpace: 'nowrap',
|
|
328
|
+
fontWeight: 600,
|
|
329
|
+
},
|
|
330
|
+
ticketUnreadBadge: {
|
|
331
|
+
minWidth: '18px',
|
|
332
|
+
height: '18px',
|
|
333
|
+
borderRadius: '9px',
|
|
334
|
+
background: '#ef4444',
|
|
335
|
+
color: 'white',
|
|
336
|
+
fontSize: '10px',
|
|
337
|
+
fontWeight: 600,
|
|
338
|
+
display: 'flex',
|
|
339
|
+
alignItems: 'center',
|
|
340
|
+
justifyContent: 'center',
|
|
341
|
+
padding: '0 5px',
|
|
342
|
+
flexShrink: 0,
|
|
343
|
+
},
|
|
344
|
+
ticketMeta: {
|
|
345
|
+
display: 'flex',
|
|
346
|
+
alignItems: 'center',
|
|
347
|
+
gap: '8px',
|
|
348
|
+
},
|
|
349
|
+
ticketTime: {
|
|
350
|
+
fontSize: '11px',
|
|
351
|
+
color: '#939393',
|
|
352
|
+
},
|
|
353
|
+
ticketStatus: {
|
|
354
|
+
fontSize: '10px',
|
|
355
|
+
color: '#64748b',
|
|
356
|
+
background: '#f1f5f9',
|
|
357
|
+
padding: '2px 6px',
|
|
358
|
+
borderRadius: '4px',
|
|
359
|
+
textTransform: 'uppercase',
|
|
360
|
+
letterSpacing: '0.3px',
|
|
361
|
+
},
|
|
362
|
+
newConversationButton: {
|
|
363
|
+
display: 'flex',
|
|
364
|
+
alignItems: 'center',
|
|
365
|
+
justifyContent: 'center',
|
|
366
|
+
margin: '12px 16px',
|
|
367
|
+
padding: '10px 16px',
|
|
368
|
+
borderRadius: '8px',
|
|
369
|
+
background: primaryColor,
|
|
370
|
+
color: getContrastTextColor(primaryColor),
|
|
371
|
+
border: 'none',
|
|
372
|
+
cursor: 'pointer',
|
|
373
|
+
fontSize: '13px',
|
|
374
|
+
fontWeight: 500,
|
|
375
|
+
transition: 'all 0.2s ease-out',
|
|
376
|
+
},
|
|
377
|
+
// Ticket list loading state
|
|
378
|
+
ticketListLoading: {
|
|
379
|
+
flex: 1,
|
|
380
|
+
display: 'flex',
|
|
381
|
+
flexDirection: 'column',
|
|
382
|
+
alignItems: 'center',
|
|
383
|
+
justifyContent: 'center',
|
|
384
|
+
gap: '12px',
|
|
385
|
+
color: '#64748b',
|
|
386
|
+
fontSize: '13px',
|
|
387
|
+
},
|
|
388
|
+
loadingSpinner: {
|
|
389
|
+
width: '24px',
|
|
390
|
+
height: '24px',
|
|
391
|
+
border: '2px solid #e2e8f0',
|
|
392
|
+
borderTop: "2px solid ".concat(primaryColor),
|
|
393
|
+
borderRadius: '50%',
|
|
394
|
+
animation: 'spin 0.8s linear infinite',
|
|
395
|
+
},
|
|
396
|
+
// Ticket list empty state
|
|
397
|
+
ticketListEmpty: {
|
|
398
|
+
flex: 1,
|
|
399
|
+
display: 'flex',
|
|
400
|
+
flexDirection: 'column',
|
|
401
|
+
alignItems: 'center',
|
|
402
|
+
justifyContent: 'center',
|
|
403
|
+
padding: '32px 24px',
|
|
404
|
+
textAlign: 'center',
|
|
405
|
+
},
|
|
406
|
+
emptyStateIcon: {
|
|
407
|
+
color: '#cbd5e1',
|
|
408
|
+
marginBottom: '16px',
|
|
409
|
+
},
|
|
410
|
+
emptyStateTitle: {
|
|
411
|
+
fontSize: '16px',
|
|
412
|
+
fontWeight: 600,
|
|
413
|
+
color: '#020617',
|
|
414
|
+
marginBottom: '8px',
|
|
415
|
+
},
|
|
416
|
+
emptyStateDescription: {
|
|
417
|
+
fontSize: '13px',
|
|
418
|
+
color: '#64748b',
|
|
419
|
+
lineHeight: 1.5,
|
|
420
|
+
marginBottom: '20px',
|
|
421
|
+
},
|
|
422
|
+
newConversationButtonLarge: {
|
|
423
|
+
padding: '12px 24px',
|
|
424
|
+
borderRadius: '8px',
|
|
425
|
+
background: primaryColor,
|
|
426
|
+
color: getContrastTextColor(primaryColor),
|
|
427
|
+
border: 'none',
|
|
428
|
+
cursor: 'pointer',
|
|
429
|
+
fontSize: '14px',
|
|
430
|
+
fontWeight: 600,
|
|
431
|
+
transition: 'all 0.2s ease-out',
|
|
432
|
+
},
|
|
433
|
+
// Back button for message view header
|
|
434
|
+
backButton: {
|
|
435
|
+
background: 'transparent',
|
|
436
|
+
border: 'none',
|
|
437
|
+
color: getContrastTextColor(primaryColor),
|
|
438
|
+
cursor: 'pointer',
|
|
439
|
+
padding: '6px 0px',
|
|
440
|
+
marginRight: '4px',
|
|
441
|
+
fontSize: '16px',
|
|
442
|
+
lineHeight: 1,
|
|
443
|
+
borderRadius: '4px',
|
|
444
|
+
transition: 'background 0.2s ease-out',
|
|
445
|
+
opacity: 0.9,
|
|
446
|
+
display: 'flex',
|
|
447
|
+
alignItems: 'center',
|
|
448
|
+
justifyContent: 'center',
|
|
449
|
+
},
|
|
450
|
+
// Header with back button layout
|
|
451
|
+
headerWithBack: {
|
|
452
|
+
display: 'flex',
|
|
453
|
+
alignItems: 'center',
|
|
454
|
+
},
|
|
266
455
|
};
|
|
267
456
|
};
|
|
268
457
|
exports.getStyles = getStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/extensions/conversations/external/components/styles.ts"],"names":[],"mappings":";AAAA,gDAAgD;;;;;;;;;;;;;;AAGhD,mDAA6D;AAE7D;;;GAGG;AACH,SAAS,oBAAoB,CAAC,QAAgB;IAC1C,IAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACtC,IAAM,OAAO,GAAG,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAE5F,IAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAC3C,IAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAC3C,IAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAE3C,yBAAyB;IACzB,IAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC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D,SAAS,EAAE;YACP,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,KAAK;SACnB;QACD,gBAAgB,EAAE;YACd,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,WAAW;YACpB,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,YAAY;YACxB,KAAK,EAAE,oBAAoB,CAAC,YAAY,CAAC;YACzC,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,mBAAmB;YAC/B,SAAS,EAAE,KAAK;SACnB;QACD,YAAY,EAAE;YACV,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,GAAG;SAClB;KACJ,CAAA;AACL,CAAC,CAAA;AAhRY,QAAA,SAAS,aAgRrB","sourcesContent":["// Inline styles following PostHog design system\n\nimport type { WidgetPosition } from '../../../../posthog-conversations-types'\nimport { Z_INDEX_CONVERSATIONS } from '../../../../constants'\n\n/**\n * Calculate contrasting text color (black or white) based on background brightness\n * Uses HSP (Highly Sensitive Purity) brightness formula\n */\nfunction getContrastTextColor(hexColor: string): string {\n const hex = hexColor.replace(/^#/, '')\n const fullHex = hex.length === 3 ? hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] : hex\n\n const r = parseInt(fullHex.slice(0, 2), 16)\n const g = parseInt(fullHex.slice(2, 4), 16)\n const b = parseInt(fullHex.slice(4, 6), 16)\n\n // HSP brightness formula\n const hsp = Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b))\n return hsp > 127.5 ? '#020617' : 'white'\n}\n\nexport const getStyles = (primaryColor: string, position: WidgetPosition = 'bottom_right') => {\n const isLeft = position.includes('left')\n const isTop = position.includes('top')\n\n return {\n widget: {\n position: 'fixed' as const,\n ...(isTop ? { top: '20px' } : { bottom: '20px' }),\n ...(isLeft ? { left: '20px' } : { right: '20px' }),\n zIndex: Z_INDEX_CONVERSATIONS,\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Inter\", \"Segoe UI\", \"Roboto\", Helvetica, Arial, sans-serif',\n },\n buttonContainer: {\n position: 'relative' as const,\n },\n button: {\n width: '50px',\n height: '50px',\n borderRadius: '50%',\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n border: 'none',\n cursor: 'pointer',\n boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'transform 0.2s ease-out, box-shadow 0.2s ease-out',\n },\n unreadBadge: {\n position: 'absolute' as const,\n ...(isTop ? { bottom: '-4px' } : { top: '-4px' }),\n ...(isLeft ? { left: '-4px' } : { right: '-4px' }),\n minWidth: '20px',\n height: '20px',\n borderRadius: '10px',\n background: '#ef4444',\n color: 'white',\n fontSize: '11px',\n fontWeight: 600,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '0 5px',\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.2)',\n border: '2px solid white',\n boxSizing: 'border-box' as const,\n },\n window: {\n position: 'absolute' as const,\n ...(isTop ? { top: 0 } : { bottom: 0 }),\n ...(isLeft ? { left: 0 } : { right: 0 }),\n background: 'white',\n borderRadius: '10px',\n boxShadow: '0 10px 25px -3px rgba(0,0,0,0.12), 0 4px 12px -2px rgba(0,0,0,0.10)',\n display: 'flex',\n flexDirection: 'column' as const,\n overflow: 'hidden',\n transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',\n //border: '1px solid #dcdcdc',\n border: 'none',\n },\n windowOpen: {\n width: '400px',\n height: '600px',\n maxHeight: 'calc(100vh - 100px)',\n },\n header: {\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n padding: '8px 12px',\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n flexShrink: 0,\n },\n headerTitle: {\n fontWeight: 500,\n fontSize: '14px',\n },\n headerActions: {\n display: 'flex',\n gap: '4px',\n },\n headerButton: {\n background: 'transparent',\n border: 'none',\n color: getContrastTextColor(primaryColor),\n cursor: 'pointer',\n padding: '6px 8px',\n fontSize: '16px',\n lineHeight: 1,\n borderRadius: '4px',\n transition: 'background 0.2s ease-out',\n opacity: 0.9,\n },\n messages: {\n flex: 1,\n overflowY: 'auto' as const,\n padding: '14px',\n display: 'flex',\n flexDirection: 'column' as const,\n gap: '8px',\n background: 'white',\n },\n message: {\n display: 'flex',\n flexDirection: 'column' as const,\n maxWidth: '85%',\n animation: 'fadeIn 0.2s ease-out',\n },\n messageCustomer: {\n alignSelf: 'flex-end',\n alignItems: 'flex-end',\n },\n messageAgent: {\n alignSelf: 'flex-start',\n alignItems: 'flex-start',\n },\n messageAuthor: {\n fontSize: '10px',\n color: '#939393',\n marginBottom: '4px',\n fontWeight: 500,\n },\n messageContent: {\n padding: '8px 12px',\n borderRadius: '8px',\n fontSize: '12px',\n lineHeight: 1.5,\n wordWrap: 'break-word' as const,\n whiteSpace: 'pre-wrap' as const,\n },\n messageContentCustomer: {\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n borderBottomRightRadius: '2px',\n },\n messageContentAgent: {\n background: 'white',\n color: '#020617',\n border: '1.5px solid #dcdcdc',\n borderBottomLeftRadius: '2px',\n },\n messageTime: {\n fontSize: '10px',\n color: '#939393',\n marginTop: '4px',\n opacity: 0.8,\n },\n error: {\n padding: '10px 16px',\n background: '#fee2e2',\n color: '#991b1b',\n fontSize: '13px',\n borderTop: '1px solid #fecaca',\n borderBottom: '1px solid #fecaca',\n textAlign: 'center' as const,\n fontWeight: 500,\n },\n inputContainer: {\n padding: '8px 12px',\n background: 'white',\n borderTop: '1px solid #dcdcdc',\n display: 'flex',\n gap: '8px',\n alignItems: 'center', // Changed from flex-end to center to vertically align input and sendButton\n flexShrink: 0,\n },\n input: {\n flex: 1,\n maxHeight: '120px',\n fontSize: '14px',\n resize: 'vertical',\n fontFamily: 'inherit',\n lineHeight: 1.5,\n color: '#020617',\n background: 'white',\n border: 'none',\n outline: 'none',\n transition: 'border-color 0.2s ease-out, box-shadow 0.2s ease-out',\n display: 'flex',\n alignItems: 'center',\n fieldSizing: 'content',\n },\n sendButton: {\n width: '33px',\n height: '33px', // Match input minHeight for vertical alignment\n borderRadius: '10px',\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n border: 'none',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'all 0.2s ease-out',\n boxShadow: '0 2px 0 rgba(0, 0, 0, 0.045)',\n fontWeight: 700,\n flexShrink: 0,\n },\n // Identification form styles\n identificationForm: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column' as const,\n padding: '24px',\n background: '#eeeded',\n overflowY: 'auto' as const,\n },\n formTitle: {\n fontSize: '18px',\n fontWeight: 600,\n color: '#020617',\n marginBottom: '8px',\n },\n formDescription: {\n fontSize: '14px',\n color: '#64748b',\n marginBottom: '24px',\n lineHeight: 1.5,\n },\n formField: {\n marginBottom: '16px',\n },\n formLabel: {\n display: 'block',\n fontSize: '13px',\n fontWeight: 500,\n color: '#020617',\n marginBottom: '6px',\n },\n formInput: {\n width: '100%',\n padding: '10px 12px',\n border: '1px solid #dcdcdc',\n borderRadius: '6px',\n fontSize: '14px',\n fontFamily: 'inherit',\n color: '#020617',\n background: 'white',\n transition: 'border-color 0.2s ease-out, box-shadow 0.2s ease-out',\n boxSizing: 'border-box' as const,\n },\n formInputError: {\n borderColor: '#ef4444',\n },\n formError: {\n fontSize: '12px',\n color: '#ef4444',\n marginTop: '4px',\n },\n formSubmitButton: {\n width: '100%',\n padding: '12px 16px',\n borderRadius: '6px',\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n border: 'none',\n cursor: 'pointer',\n fontSize: '14px',\n fontWeight: 600,\n transition: 'all 0.2s ease-out',\n marginTop: '8px',\n },\n formOptional: {\n fontSize: '12px',\n color: '#939393',\n fontWeight: 400,\n },\n }\n}\n"]}
|
|
1
|
+
{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AAY;YACxB,KAAK,EAAE,oBAAoB,CAAC,YAAY,CAAC;YACzC,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,mBAAmB;SAClC;QACD,sCAAsC;QACtC,UAAU,EAAE;YACR,UAAU,EAAE,aAAa;YACzB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,oBAAoB,CAAC,YAAY,CAAC;YACzC,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,CAAC;YACb,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,0BAA0B;YACtC,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;SAC3B;QACD,iCAAiC;QACjC,cAAc,EAAE;YACZ,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;SACvB;KACJ,CAAA;AACL,CAAC,CAAA;AA7cY,QAAA,SAAS,aA6crB","sourcesContent":["// Inline styles following PostHog design system\n\nimport type { WidgetPosition } from '../../../../posthog-conversations-types'\nimport { Z_INDEX_CONVERSATIONS } from '../../../../constants'\n\n/**\n * Calculate contrasting text color (black or white) based on background brightness\n * Uses HSP (Highly Sensitive Purity) brightness formula\n */\nfunction getContrastTextColor(hexColor: string): string {\n const hex = hexColor.replace(/^#/, '')\n const fullHex = hex.length === 3 ? hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] : hex\n\n const r = parseInt(fullHex.slice(0, 2), 16)\n const g = parseInt(fullHex.slice(2, 4), 16)\n const b = parseInt(fullHex.slice(4, 6), 16)\n\n // HSP brightness formula\n const hsp = Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b))\n return hsp > 127.5 ? '#020617' : 'white'\n}\n\nexport const getStyles = (primaryColor: string, position: WidgetPosition = 'bottom_right') => {\n const isLeft = position.includes('left')\n const isTop = position.includes('top')\n\n return {\n widget: {\n position: 'fixed' as const,\n ...(isTop ? { top: '20px' } : { bottom: '20px' }),\n ...(isLeft ? { left: '20px' } : { right: '20px' }),\n zIndex: Z_INDEX_CONVERSATIONS,\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Inter\", \"Segoe UI\", \"Roboto\", Helvetica, Arial, sans-serif',\n },\n buttonContainer: {\n position: 'relative' as const,\n },\n button: {\n width: '50px',\n height: '50px',\n borderRadius: '50%',\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n border: 'none',\n cursor: 'pointer',\n boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'transform 0.2s ease-out, box-shadow 0.2s ease-out',\n },\n unreadBadge: {\n position: 'absolute' as const,\n ...(isTop ? { bottom: '-4px' } : { top: '-4px' }),\n ...(isLeft ? { left: '-4px' } : { right: '-4px' }),\n minWidth: '20px',\n height: '20px',\n borderRadius: '10px',\n background: '#ef4444',\n color: 'white',\n fontSize: '11px',\n fontWeight: 600,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '0 5px',\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.2)',\n border: '2px solid white',\n boxSizing: 'border-box' as const,\n },\n window: {\n position: 'absolute' as const,\n ...(isTop ? { top: 0 } : { bottom: 0 }),\n ...(isLeft ? { left: 0 } : { right: 0 }),\n background: 'white',\n borderRadius: '10px',\n boxShadow: '0 10px 25px -3px rgba(0,0,0,0.12), 0 4px 12px -2px rgba(0,0,0,0.10)',\n display: 'flex',\n flexDirection: 'column' as const,\n overflow: 'hidden',\n transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',\n //border: '1px solid #dcdcdc',\n border: 'none',\n },\n windowOpen: {\n width: '400px',\n maxWidth: 'calc(100vw - 40px)',\n height: '600px',\n maxHeight: 'calc(100vh - 100px)',\n },\n header: {\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n padding: '8px 12px',\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n flexShrink: 0,\n },\n headerTitle: {\n fontWeight: 500,\n fontSize: '14px',\n },\n headerActions: {\n display: 'flex',\n gap: '4px',\n },\n headerButton: {\n background: 'transparent',\n border: 'none',\n color: getContrastTextColor(primaryColor),\n cursor: 'pointer',\n padding: '6px 8px',\n fontSize: '16px',\n lineHeight: 1,\n borderRadius: '4px',\n transition: 'background 0.2s ease-out',\n opacity: 0.9,\n },\n messages: {\n flex: 1,\n overflowY: 'auto' as const,\n padding: '14px',\n display: 'flex',\n flexDirection: 'column' as const,\n gap: '8px',\n background: 'white',\n },\n message: {\n display: 'flex',\n flexDirection: 'column' as const,\n maxWidth: '85%',\n animation: 'fadeIn 0.2s ease-out',\n },\n messageCustomer: {\n alignSelf: 'flex-end',\n alignItems: 'flex-end',\n },\n messageAgent: {\n alignSelf: 'flex-start',\n alignItems: 'flex-start',\n },\n messageAuthor: {\n fontSize: '10px',\n color: '#939393',\n marginBottom: '4px',\n fontWeight: 500,\n },\n messageContent: {\n padding: '8px 12px',\n borderRadius: '8px',\n fontSize: '12px',\n lineHeight: 1.5,\n wordWrap: 'break-word' as const,\n whiteSpace: 'pre-wrap' as const,\n },\n messageContentCustomer: {\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n borderBottomRightRadius: '2px',\n },\n messageContentAgent: {\n background: 'white',\n color: '#020617',\n border: '1.5px solid #dcdcdc',\n borderBottomLeftRadius: '2px',\n },\n messageTime: {\n fontSize: '10px',\n color: '#939393',\n marginTop: '4px',\n opacity: 0.8,\n },\n error: {\n padding: '10px 16px',\n background: '#fee2e2',\n color: '#991b1b',\n fontSize: '13px',\n borderTop: '1px solid #fecaca',\n borderBottom: '1px solid #fecaca',\n textAlign: 'center' as const,\n fontWeight: 500,\n },\n inputContainer: {\n padding: '8px 12px',\n background: 'white',\n borderTop: '1px solid #dcdcdc',\n display: 'flex',\n gap: '8px',\n alignItems: 'center', // Changed from flex-end to center to vertically align input and sendButton\n flexShrink: 0,\n },\n input: {\n flex: 1,\n maxHeight: '120px',\n fontSize: '14px',\n resize: 'vertical',\n fontFamily: 'inherit',\n lineHeight: 1.5,\n color: '#020617',\n background: 'white',\n border: 'none',\n outline: 'none',\n transition: 'border-color 0.2s ease-out, box-shadow 0.2s ease-out',\n display: 'flex',\n alignItems: 'center',\n fieldSizing: 'content',\n },\n sendButton: {\n width: '33px',\n height: '33px', // Match input minHeight for vertical alignment\n borderRadius: '10px',\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n border: 'none',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'all 0.2s ease-out',\n boxShadow: '0 2px 0 rgba(0, 0, 0, 0.045)',\n fontWeight: 700,\n flexShrink: 0,\n },\n // Identification form styles\n identificationForm: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column' as const,\n padding: '24px',\n background: '#eeeded',\n overflowY: 'auto' as const,\n },\n formTitle: {\n fontSize: '18px',\n fontWeight: 600,\n color: '#020617',\n marginBottom: '8px',\n },\n formDescription: {\n fontSize: '14px',\n color: '#64748b',\n marginBottom: '24px',\n lineHeight: 1.5,\n },\n formField: {\n marginBottom: '16px',\n },\n formLabel: {\n display: 'block',\n fontSize: '13px',\n fontWeight: 500,\n color: '#020617',\n marginBottom: '6px',\n },\n formInput: {\n width: '100%',\n padding: '10px 12px',\n border: '1px solid #dcdcdc',\n borderRadius: '6px',\n fontSize: '14px',\n fontFamily: 'inherit',\n color: '#020617',\n background: 'white',\n transition: 'border-color 0.2s ease-out, box-shadow 0.2s ease-out',\n boxSizing: 'border-box' as const,\n },\n formInputError: {\n borderColor: '#ef4444',\n },\n formError: {\n fontSize: '12px',\n color: '#ef4444',\n marginTop: '4px',\n },\n formSubmitButton: {\n width: '100%',\n padding: '12px 16px',\n borderRadius: '6px',\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n border: 'none',\n cursor: 'pointer',\n fontSize: '14px',\n fontWeight: 600,\n transition: 'all 0.2s ease-out',\n marginTop: '8px',\n },\n formOptional: {\n fontSize: '12px',\n color: '#939393',\n fontWeight: 400,\n },\n // Ticket list styles\n ticketListContainer: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column' as const,\n background: 'white',\n overflowY: 'auto' as const,\n },\n ticketList: {\n flex: 1,\n overflowY: 'auto' as const,\n },\n ticketItem: {\n padding: '14px 16px',\n borderBottom: '1px solid #f1f1f1',\n cursor: 'pointer',\n transition: 'background 0.15s ease-out',\n background: 'white',\n display: 'flex',\n alignItems: 'center',\n gap: '12px',\n },\n ticketItemUnread: {\n background: '#fafafa',\n },\n ticketItemContent: {\n display: 'flex',\n flexDirection: 'column' as const,\n gap: '6px',\n flex: 1,\n minWidth: 0, // Allow text truncation\n },\n ticketItemArrow: {\n color: '#939393',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center',\n },\n ticketItemHeader: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'flex-start',\n gap: '8px',\n },\n ticketPreview: {\n fontSize: '13px',\n color: '#020617',\n lineHeight: 1.4,\n flex: 1,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap' as const,\n },\n ticketPreviewUnread: {\n fontSize: '13px',\n color: '#020617',\n lineHeight: 1.4,\n flex: 1,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap' as const,\n fontWeight: 600,\n },\n ticketUnreadBadge: {\n minWidth: '18px',\n height: '18px',\n borderRadius: '9px',\n background: '#ef4444',\n color: 'white',\n fontSize: '10px',\n fontWeight: 600,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '0 5px',\n flexShrink: 0,\n },\n ticketMeta: {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n },\n ticketTime: {\n fontSize: '11px',\n color: '#939393',\n },\n ticketStatus: {\n fontSize: '10px',\n color: '#64748b',\n background: '#f1f5f9',\n padding: '2px 6px',\n borderRadius: '4px',\n textTransform: 'uppercase' as const,\n letterSpacing: '0.3px',\n },\n newConversationButton: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n margin: '12px 16px',\n padding: '10px 16px',\n borderRadius: '8px',\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n border: 'none',\n cursor: 'pointer',\n fontSize: '13px',\n fontWeight: 500,\n transition: 'all 0.2s ease-out',\n },\n // Ticket list loading state\n ticketListLoading: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column' as const,\n alignItems: 'center',\n justifyContent: 'center',\n gap: '12px',\n color: '#64748b',\n fontSize: '13px',\n },\n loadingSpinner: {\n width: '24px',\n height: '24px',\n border: '2px solid #e2e8f0',\n borderTop: `2px solid ${primaryColor}`,\n borderRadius: '50%',\n animation: 'spin 0.8s linear infinite',\n },\n // Ticket list empty state\n ticketListEmpty: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column' as const,\n alignItems: 'center',\n justifyContent: 'center',\n padding: '32px 24px',\n textAlign: 'center' as const,\n },\n emptyStateIcon: {\n color: '#cbd5e1',\n marginBottom: '16px',\n },\n emptyStateTitle: {\n fontSize: '16px',\n fontWeight: 600,\n color: '#020617',\n marginBottom: '8px',\n },\n emptyStateDescription: {\n fontSize: '13px',\n color: '#64748b',\n lineHeight: 1.5,\n marginBottom: '20px',\n },\n newConversationButtonLarge: {\n padding: '12px 24px',\n borderRadius: '8px',\n background: primaryColor,\n color: getContrastTextColor(primaryColor),\n border: 'none',\n cursor: 'pointer',\n fontSize: '14px',\n fontWeight: 600,\n transition: 'all 0.2s ease-out',\n },\n // Back button for message view header\n backButton: {\n background: 'transparent',\n border: 'none',\n color: getContrastTextColor(primaryColor),\n cursor: 'pointer',\n padding: '6px 0px',\n marginRight: '4px',\n fontSize: '16px',\n lineHeight: 1,\n borderRadius: '4px',\n transition: 'background 0.2s ease-out',\n opacity: 0.9,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n // Header with back button layout\n headerWithBack: {\n display: 'flex',\n alignItems: 'center',\n },\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a timestamp to a relative time string
|
|
3
|
+
*/
|
|
4
|
+
export declare function formatRelativeTime(isoString: string | undefined): string;
|
|
5
|
+
/**
|
|
6
|
+
* Truncate text to a maximum length with ellipsis
|
|
7
|
+
*/
|
|
8
|
+
export declare function truncateText(text: string | undefined, maxLength: number): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatRelativeTime = formatRelativeTime;
|
|
4
|
+
exports.truncateText = truncateText;
|
|
5
|
+
/**
|
|
6
|
+
* Format a timestamp to a relative time string
|
|
7
|
+
*/
|
|
8
|
+
function formatRelativeTime(isoString) {
|
|
9
|
+
if (!isoString) {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
var date = new Date(isoString);
|
|
13
|
+
var now = new Date();
|
|
14
|
+
var diffMs = now.getTime() - date.getTime();
|
|
15
|
+
var diffMins = Math.floor(diffMs / 60000);
|
|
16
|
+
var diffHours = Math.floor(diffMins / 60);
|
|
17
|
+
var diffDays = Math.floor(diffHours / 24);
|
|
18
|
+
if (diffMins < 1) {
|
|
19
|
+
return 'Just now';
|
|
20
|
+
}
|
|
21
|
+
else if (diffMins < 60) {
|
|
22
|
+
return "".concat(diffMins, "m ago");
|
|
23
|
+
}
|
|
24
|
+
else if (diffHours < 24) {
|
|
25
|
+
return "".concat(diffHours, "h ago");
|
|
26
|
+
}
|
|
27
|
+
else if (diffDays === 1) {
|
|
28
|
+
return 'Yesterday';
|
|
29
|
+
}
|
|
30
|
+
else if (diffDays < 7) {
|
|
31
|
+
return "".concat(diffDays, "d ago");
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return date.toLocaleDateString();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Truncate text to a maximum length with ellipsis
|
|
39
|
+
*/
|
|
40
|
+
function truncateText(text, maxLength) {
|
|
41
|
+
if (!text) {
|
|
42
|
+
return 'No messages yet';
|
|
43
|
+
}
|
|
44
|
+
if (text.length <= maxLength) {
|
|
45
|
+
return text;
|
|
46
|
+
}
|
|
47
|
+
return text.substring(0, maxLength - 3) + '...';
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/extensions/conversations/external/components/utils.ts"],"names":[],"mappings":";;AAGA,gDAyBC;AAKD,oCAQC;AAzCD;;GAEG;AACH,SAAgB,kBAAkB,CAAC,SAA6B;IAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO,EAAE,CAAA;IACb,CAAC;IAED,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAA;IAChC,IAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;IACtB,IAAM,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;IAC7C,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAA;IAC3C,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAA;IAC3C,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC,CAAA;IAE3C,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACf,OAAO,UAAU,CAAA;IACrB,CAAC;SAAM,IAAI,QAAQ,GAAG,EAAE,EAAE,CAAC;QACvB,OAAO,UAAG,QAAQ,UAAO,CAAA;IAC7B,CAAC;SAAM,IAAI,SAAS,GAAG,EAAE,EAAE,CAAC;QACxB,OAAO,UAAG,SAAS,UAAO,CAAA;IAC9B,CAAC;SAAM,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,WAAW,CAAA;IACtB,CAAC;SAAM,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,UAAG,QAAQ,UAAO,CAAA;IAC7B,CAAC;SAAM,CAAC;QACJ,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAA;IACpC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,IAAwB,EAAE,SAAiB;IACpE,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,iBAAiB,CAAA;IAC5B,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAA;IACf,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,KAAK,CAAA;AACnD,CAAC","sourcesContent":["/**\n * Format a timestamp to a relative time string\n */\nexport function formatRelativeTime(isoString: string | undefined): string {\n if (!isoString) {\n return ''\n }\n\n const date = new Date(isoString)\n const now = new Date()\n const diffMs = now.getTime() - date.getTime()\n const diffMins = Math.floor(diffMs / 60000)\n const diffHours = Math.floor(diffMins / 60)\n const diffDays = Math.floor(diffHours / 24)\n\n if (diffMins < 1) {\n return 'Just now'\n } else if (diffMins < 60) {\n return `${diffMins}m ago`\n } else if (diffHours < 24) {\n return `${diffHours}h ago`\n } else if (diffDays === 1) {\n return 'Yesterday'\n } else if (diffDays < 7) {\n return `${diffDays}d ago`\n } else {\n return date.toLocaleDateString()\n }\n}\n\n/**\n * Truncate text to a maximum length with ellipsis\n */\nexport function truncateText(text: string | undefined, maxLength: number): string {\n if (!text) {\n return 'No messages yet'\n }\n if (text.length <= maxLength) {\n return text\n }\n return text.substring(0, maxLength - 3) + '...'\n}\n"]}
|
|
@@ -17,6 +17,10 @@ export declare class ConversationsManager implements ConversationsManagerInterfa
|
|
|
17
17
|
private _isWidgetEnabled;
|
|
18
18
|
private _isDomainAllowed;
|
|
19
19
|
private _isWidgetRendered;
|
|
20
|
+
private _initializeWidgetPromise;
|
|
21
|
+
private _currentView;
|
|
22
|
+
private _tickets;
|
|
23
|
+
private _hasMultipleTickets;
|
|
20
24
|
constructor(config: ConversationsRemoteConfig, _posthog: PostHog);
|
|
21
25
|
/**
|
|
22
26
|
* Send a message programmatically via the API
|
|
@@ -45,8 +49,10 @@ export declare class ConversationsManager implements ConversationsManagerInterfa
|
|
|
45
49
|
private _initialize;
|
|
46
50
|
/**
|
|
47
51
|
* Initialize and render the widget UI
|
|
52
|
+
* Uses a promise guard to prevent race conditions from concurrent calls
|
|
48
53
|
*/
|
|
49
54
|
private _initializeWidget;
|
|
55
|
+
private _doInitializeWidget;
|
|
50
56
|
/**
|
|
51
57
|
* Get initial user traits from PostHog or localStorage
|
|
52
58
|
*/
|
|
@@ -80,7 +86,39 @@ export declare class ConversationsManager implements ConversationsManagerInterfa
|
|
|
80
86
|
*/
|
|
81
87
|
private _pollMessages;
|
|
82
88
|
/**
|
|
83
|
-
*
|
|
89
|
+
* Poll for tickets list
|
|
90
|
+
*/
|
|
91
|
+
private _pollTickets;
|
|
92
|
+
/**
|
|
93
|
+
* Load tickets list from API
|
|
94
|
+
*/
|
|
95
|
+
private _loadTickets;
|
|
96
|
+
/**
|
|
97
|
+
* Main poll function that polls based on current view
|
|
98
|
+
*/
|
|
99
|
+
private _poll;
|
|
100
|
+
/**
|
|
101
|
+
* Handle view changes from the widget
|
|
102
|
+
*/
|
|
103
|
+
private _handleViewChange;
|
|
104
|
+
/**
|
|
105
|
+
* Handle ticket selection from the list
|
|
106
|
+
*/
|
|
107
|
+
private _handleSelectTicket;
|
|
108
|
+
/**
|
|
109
|
+
* Handle new conversation request
|
|
110
|
+
*/
|
|
111
|
+
private _handleNewConversation;
|
|
112
|
+
/**
|
|
113
|
+
* Handle back to tickets request
|
|
114
|
+
*/
|
|
115
|
+
private _handleBackToTickets;
|
|
116
|
+
/**
|
|
117
|
+
* Determine initial view based on ticket count
|
|
118
|
+
*/
|
|
119
|
+
private _determineInitialView;
|
|
120
|
+
/**
|
|
121
|
+
* Start polling based on current view
|
|
84
122
|
*/
|
|
85
123
|
private _startPolling;
|
|
86
124
|
/**
|