@pocketping/widget 1.5.2 → 1.6.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/index.cjs +177 -101
- package/dist/index.js +177 -101
- package/dist/pocketping.min.global.js +83 -30
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -189,7 +189,7 @@ function styles(primaryColor, theme) {
|
|
|
189
189
|
display: flex;
|
|
190
190
|
align-items: center;
|
|
191
191
|
justify-content: space-between;
|
|
192
|
-
padding:
|
|
192
|
+
padding: 12px 14px;
|
|
193
193
|
background: ${primaryColor};
|
|
194
194
|
color: white;
|
|
195
195
|
}
|
|
@@ -197,24 +197,24 @@ function styles(primaryColor, theme) {
|
|
|
197
197
|
.pp-header-info {
|
|
198
198
|
display: flex;
|
|
199
199
|
align-items: center;
|
|
200
|
-
gap:
|
|
200
|
+
gap: 10px;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
.pp-avatar {
|
|
204
|
-
width:
|
|
205
|
-
height:
|
|
204
|
+
width: 36px;
|
|
205
|
+
height: 36px;
|
|
206
206
|
border-radius: 50%;
|
|
207
207
|
object-fit: cover;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
.pp-header-title {
|
|
211
211
|
font-weight: 600;
|
|
212
|
-
font-size:
|
|
212
|
+
font-size: 15px;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
.pp-header-status {
|
|
216
|
-
font-size:
|
|
217
|
-
opacity: 0.
|
|
216
|
+
font-size: 11px;
|
|
217
|
+
opacity: 0.85;
|
|
218
218
|
display: flex;
|
|
219
219
|
align-items: center;
|
|
220
220
|
gap: 4px;
|
|
@@ -260,10 +260,10 @@ function styles(primaryColor, theme) {
|
|
|
260
260
|
.pp-messages {
|
|
261
261
|
flex: 1;
|
|
262
262
|
overflow-y: auto;
|
|
263
|
-
padding:
|
|
263
|
+
padding: 12px;
|
|
264
264
|
display: flex;
|
|
265
265
|
flex-direction: column;
|
|
266
|
-
gap:
|
|
266
|
+
gap: 3px;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
.pp-welcome {
|
|
@@ -273,14 +273,32 @@ function styles(primaryColor, theme) {
|
|
|
273
273
|
font-size: 13px;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
+
.pp-date-separator {
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
justify-content: center;
|
|
280
|
+
margin: 16px 0 12px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.pp-date-separator span {
|
|
284
|
+
background: ${colors.bgSecondary};
|
|
285
|
+
color: ${colors.textSecondary};
|
|
286
|
+
font-size: 11px;
|
|
287
|
+
padding: 4px 12px;
|
|
288
|
+
border-radius: 12px;
|
|
289
|
+
font-weight: 500;
|
|
290
|
+
}
|
|
291
|
+
|
|
276
292
|
.pp-message {
|
|
277
|
-
max-width:
|
|
278
|
-
padding: 10px
|
|
279
|
-
border-radius:
|
|
293
|
+
max-width: 85%;
|
|
294
|
+
padding: 6px 10px;
|
|
295
|
+
border-radius: 12px;
|
|
280
296
|
word-wrap: break-word;
|
|
281
297
|
position: relative;
|
|
282
298
|
user-select: text;
|
|
283
299
|
-webkit-user-select: text;
|
|
300
|
+
font-size: 14px;
|
|
301
|
+
line-height: 1.35;
|
|
284
302
|
}
|
|
285
303
|
|
|
286
304
|
/* Hover actions container - positioned above message (Slack style) */
|
|
@@ -372,7 +390,8 @@ function styles(primaryColor, theme) {
|
|
|
372
390
|
align-self: flex-end;
|
|
373
391
|
background: ${primaryColor};
|
|
374
392
|
color: white;
|
|
375
|
-
border-bottom-right-radius:
|
|
393
|
+
border-bottom-right-radius: 3px;
|
|
394
|
+
margin-left: 32px;
|
|
376
395
|
}
|
|
377
396
|
|
|
378
397
|
.pp-message-operator,
|
|
@@ -380,19 +399,31 @@ function styles(primaryColor, theme) {
|
|
|
380
399
|
align-self: flex-start;
|
|
381
400
|
background: ${colors.messageBg};
|
|
382
401
|
color: ${colors.text};
|
|
383
|
-
border-bottom-left-radius:
|
|
402
|
+
border-bottom-left-radius: 3px;
|
|
403
|
+
margin-right: 32px;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/* Add spacing between different senders */
|
|
407
|
+
.pp-message-visitor + .pp-message-operator,
|
|
408
|
+
.pp-message-visitor + .pp-message-ai,
|
|
409
|
+
.pp-message-operator + .pp-message-visitor,
|
|
410
|
+
.pp-message-ai + .pp-message-visitor {
|
|
411
|
+
margin-top: 8px;
|
|
384
412
|
}
|
|
385
413
|
|
|
386
414
|
.pp-message-content {
|
|
387
|
-
|
|
415
|
+
display: inline;
|
|
388
416
|
}
|
|
389
417
|
|
|
390
418
|
.pp-message-time {
|
|
391
|
-
font-size:
|
|
392
|
-
opacity: 0.
|
|
393
|
-
display: flex;
|
|
419
|
+
font-size: 10px;
|
|
420
|
+
opacity: 0.6;
|
|
421
|
+
display: inline-flex;
|
|
394
422
|
align-items: center;
|
|
395
|
-
gap:
|
|
423
|
+
gap: 3px;
|
|
424
|
+
float: right;
|
|
425
|
+
margin-left: 8px;
|
|
426
|
+
margin-top: 4px;
|
|
396
427
|
}
|
|
397
428
|
|
|
398
429
|
.pp-ai-badge {
|
|
@@ -429,13 +460,13 @@ function styles(primaryColor, theme) {
|
|
|
429
460
|
|
|
430
461
|
.pp-typing {
|
|
431
462
|
display: flex;
|
|
432
|
-
gap:
|
|
433
|
-
padding:
|
|
463
|
+
gap: 3px;
|
|
464
|
+
padding: 8px 12px;
|
|
434
465
|
}
|
|
435
466
|
|
|
436
467
|
.pp-typing span {
|
|
437
|
-
width:
|
|
438
|
-
height:
|
|
468
|
+
width: 6px;
|
|
469
|
+
height: 6px;
|
|
439
470
|
background: ${colors.textSecondary};
|
|
440
471
|
border-radius: 50%;
|
|
441
472
|
animation: pp-bounce 1.4s infinite ease-in-out both;
|
|
@@ -451,14 +482,18 @@ function styles(primaryColor, theme) {
|
|
|
451
482
|
|
|
452
483
|
.pp-input-form {
|
|
453
484
|
display: flex;
|
|
454
|
-
padding: 12px;
|
|
485
|
+
padding: 10px 12px;
|
|
455
486
|
gap: 8px;
|
|
456
487
|
border-top: 1px solid ${colors.border};
|
|
488
|
+
align-items: center;
|
|
457
489
|
}
|
|
458
490
|
|
|
459
491
|
.pp-input {
|
|
460
492
|
flex: 1;
|
|
461
|
-
|
|
493
|
+
min-width: 0;
|
|
494
|
+
height: 40px;
|
|
495
|
+
line-height: 40px;
|
|
496
|
+
padding: 0 16px;
|
|
462
497
|
border: 1px solid ${colors.border};
|
|
463
498
|
border-radius: 20px;
|
|
464
499
|
background: ${colors.bg};
|
|
@@ -466,6 +501,8 @@ function styles(primaryColor, theme) {
|
|
|
466
501
|
font-size: 14px;
|
|
467
502
|
outline: none;
|
|
468
503
|
transition: border-color 0.2s;
|
|
504
|
+
box-sizing: border-box;
|
|
505
|
+
margin: 0;
|
|
469
506
|
}
|
|
470
507
|
|
|
471
508
|
.pp-input:focus {
|
|
@@ -479,6 +516,7 @@ function styles(primaryColor, theme) {
|
|
|
479
516
|
.pp-send-btn {
|
|
480
517
|
width: 40px;
|
|
481
518
|
height: 40px;
|
|
519
|
+
min-width: 40px;
|
|
482
520
|
border-radius: 50%;
|
|
483
521
|
background: ${primaryColor};
|
|
484
522
|
color: white;
|
|
@@ -487,7 +525,18 @@ function styles(primaryColor, theme) {
|
|
|
487
525
|
display: flex;
|
|
488
526
|
align-items: center;
|
|
489
527
|
justify-content: center;
|
|
490
|
-
transition: opacity 0.2s;
|
|
528
|
+
transition: opacity 0.2s, transform 0.1s;
|
|
529
|
+
flex-shrink: 0;
|
|
530
|
+
margin: 0;
|
|
531
|
+
padding: 0;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.pp-send-btn:not(:disabled):hover {
|
|
535
|
+
transform: scale(1.05);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.pp-send-btn:not(:disabled):active {
|
|
539
|
+
transform: scale(0.95);
|
|
491
540
|
}
|
|
492
541
|
|
|
493
542
|
.pp-send-btn:disabled {
|
|
@@ -506,6 +555,7 @@ function styles(primaryColor, theme) {
|
|
|
506
555
|
font-size: 11px;
|
|
507
556
|
color: ${colors.textSecondary};
|
|
508
557
|
border-top: 1px solid ${colors.border};
|
|
558
|
+
opacity: 0.7;
|
|
509
559
|
}
|
|
510
560
|
|
|
511
561
|
.pp-footer a {
|
|
@@ -534,6 +584,7 @@ function styles(primaryColor, theme) {
|
|
|
534
584
|
.pp-attach-btn {
|
|
535
585
|
width: 40px;
|
|
536
586
|
height: 40px;
|
|
587
|
+
min-width: 40px;
|
|
537
588
|
border-radius: 50%;
|
|
538
589
|
background: transparent;
|
|
539
590
|
color: ${colors.textSecondary};
|
|
@@ -542,6 +593,8 @@ function styles(primaryColor, theme) {
|
|
|
542
593
|
display: flex;
|
|
543
594
|
align-items: center;
|
|
544
595
|
justify-content: center;
|
|
596
|
+
margin: 0;
|
|
597
|
+
padding: 0;
|
|
545
598
|
transition: color 0.2s, border-color 0.2s;
|
|
546
599
|
flex-shrink: 0;
|
|
547
600
|
}
|
|
@@ -1060,6 +1113,24 @@ function styles(primaryColor, theme) {
|
|
|
1060
1113
|
|
|
1061
1114
|
// src/components/ChatWidget.tsx
|
|
1062
1115
|
var import_jsx_runtime = require("preact/jsx-runtime");
|
|
1116
|
+
function formatDateSeparator(date) {
|
|
1117
|
+
const now = /* @__PURE__ */ new Date();
|
|
1118
|
+
const messageDate = new Date(date);
|
|
1119
|
+
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
1120
|
+
const msgDay = new Date(messageDate.getFullYear(), messageDate.getMonth(), messageDate.getDate());
|
|
1121
|
+
const diffDays = Math.floor((today.getTime() - msgDay.getTime()) / (1e3 * 60 * 60 * 24));
|
|
1122
|
+
if (diffDays === 0) return "Today";
|
|
1123
|
+
if (diffDays === 1) return "Yesterday";
|
|
1124
|
+
return messageDate.toLocaleDateString("en-US", {
|
|
1125
|
+
month: "short",
|
|
1126
|
+
day: "numeric",
|
|
1127
|
+
year: messageDate.getFullYear() !== now.getFullYear() ? "numeric" : void 0
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
function getDateKey(date) {
|
|
1131
|
+
const d = new Date(date);
|
|
1132
|
+
return `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
1133
|
+
}
|
|
1063
1134
|
function ChatWidget({ client: client2, config: initialConfig }) {
|
|
1064
1135
|
const [isOpen, setIsOpen] = (0, import_hooks.useState)(false);
|
|
1065
1136
|
const [messages, setMessages] = (0, import_hooks.useState)([]);
|
|
@@ -1469,9 +1540,12 @@ function ChatWidget({ client: client2, config: initialConfig }) {
|
|
|
1469
1540
|
] }),
|
|
1470
1541
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "pp-messages", ref: messagesContainerRef, children: [
|
|
1471
1542
|
config.welcomeMessage && messages.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { class: "pp-welcome", children: config.welcomeMessage }),
|
|
1472
|
-
messages.map((msg) => {
|
|
1543
|
+
messages.map((msg, index) => {
|
|
1473
1544
|
const isDeleted = !!msg.deletedAt;
|
|
1474
1545
|
const isEdited = !!msg.editedAt;
|
|
1546
|
+
const msgDate = new Date(msg.timestamp);
|
|
1547
|
+
const prevMsg = index > 0 ? messages[index - 1] : null;
|
|
1548
|
+
const showDateSeparator = !prevMsg || getDateKey(new Date(prevMsg.timestamp)) !== getDateKey(msgDate);
|
|
1475
1549
|
let replyData = null;
|
|
1476
1550
|
if (msg.replyTo) {
|
|
1477
1551
|
if (typeof msg.replyTo === "object") {
|
|
@@ -1493,86 +1567,88 @@ function ChatWidget({ client: client2, config: initialConfig }) {
|
|
|
1493
1567
|
}
|
|
1494
1568
|
const isHovered = hoveredMessageId === msg.id;
|
|
1495
1569
|
const showActions = isHovered && !isDeleted;
|
|
1496
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1497
|
-
"div",
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
{
|
|
1512
|
-
class: "pp-action-btn",
|
|
1513
|
-
onClick: () => handleReply(msg),
|
|
1514
|
-
title: "Reply",
|
|
1515
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReplyIcon, { color: actionIconColor })
|
|
1516
|
-
}
|
|
1517
|
-
),
|
|
1518
|
-
msg.sender === "visitor" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_preact.Fragment, { children: [
|
|
1571
|
+
showDateSeparator && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { class: "pp-date-separator", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: formatDateSeparator(msgDate) }) }),
|
|
1572
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1573
|
+
"div",
|
|
1574
|
+
{
|
|
1575
|
+
id: `pp-msg-${msg.id}`,
|
|
1576
|
+
class: `pp-message pp-message-${msg.sender} ${isDeleted ? "pp-message-deleted" : ""}`,
|
|
1577
|
+
onContextMenu: (e) => handleMessageContextMenu(e, msg),
|
|
1578
|
+
onMouseEnter: () => setHoveredMessageId(msg.id),
|
|
1579
|
+
onMouseLeave: () => setHoveredMessageId(null),
|
|
1580
|
+
onTouchStart: () => handleTouchStart(msg),
|
|
1581
|
+
onTouchEnd: handleTouchEnd,
|
|
1582
|
+
onTouchCancel: handleTouchEnd,
|
|
1583
|
+
children: [
|
|
1584
|
+
showActions && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: `pp-message-actions ${msg.sender === "visitor" ? "pp-actions-left" : "pp-actions-right"}`, children: [
|
|
1519
1585
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1520
1586
|
"button",
|
|
1521
1587
|
{
|
|
1522
1588
|
class: "pp-action-btn",
|
|
1523
|
-
onClick: () =>
|
|
1524
|
-
title: "
|
|
1525
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1589
|
+
onClick: () => handleReply(msg),
|
|
1590
|
+
title: "Reply",
|
|
1591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReplyIcon, { color: actionIconColor })
|
|
1526
1592
|
}
|
|
1527
1593
|
),
|
|
1528
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1594
|
+
msg.sender === "visitor" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1596
|
+
"button",
|
|
1597
|
+
{
|
|
1598
|
+
class: "pp-action-btn",
|
|
1599
|
+
onClick: () => handleStartEdit(msg),
|
|
1600
|
+
title: "Edit",
|
|
1601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditIcon, { color: actionIconColor })
|
|
1602
|
+
}
|
|
1603
|
+
),
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1605
|
+
"button",
|
|
1606
|
+
{
|
|
1607
|
+
class: "pp-action-btn pp-action-delete",
|
|
1608
|
+
onClick: () => handleDelete(msg),
|
|
1609
|
+
title: "Delete",
|
|
1610
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DeleteIcon, { color: actionIconColor })
|
|
1611
|
+
}
|
|
1612
|
+
)
|
|
1613
|
+
] })
|
|
1614
|
+
] }),
|
|
1615
|
+
replyData && (replyData.content || replyData.hasAttachment) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1616
|
+
"div",
|
|
1617
|
+
{
|
|
1618
|
+
class: "pp-reply-quote pp-reply-quote-clickable",
|
|
1619
|
+
onClick: () => scrollToMessage(replyData.id),
|
|
1620
|
+
role: "button",
|
|
1621
|
+
tabIndex: 0,
|
|
1622
|
+
onKeyDown: (e) => e.key === "Enter" && scrollToMessage(replyData.id),
|
|
1623
|
+
children: [
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-reply-sender", children: replyData.sender === "visitor" ? "You" : "Support" }),
|
|
1625
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-reply-content", children: replyData.deleted ? "Message deleted" : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1626
|
+
replyData.hasAttachment && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-reply-attachment-icon", children: replyData.attachmentType?.startsWith("image/") ? "\u{1F4F7} " : "\u{1F4CE} " }),
|
|
1627
|
+
replyData.content ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1628
|
+
(replyData.content || "").slice(0, 50),
|
|
1629
|
+
(replyData.content || "").length > 50 ? "..." : ""
|
|
1630
|
+
] }) : replyData.attachmentType?.startsWith("image/") ? "Photo" : "File"
|
|
1631
|
+
] }) })
|
|
1632
|
+
]
|
|
1633
|
+
}
|
|
1634
|
+
),
|
|
1635
|
+
isDeleted ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "pp-message-content pp-deleted-content", children: [
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-deleted-icon", children: "\u{1F5D1}\uFE0F" }),
|
|
1637
|
+
" Message deleted"
|
|
1638
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1639
|
+
msg.content && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { class: "pp-message-content", children: msg.content }),
|
|
1640
|
+
msg.attachments && msg.attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { class: "pp-message-attachments", children: msg.attachments.map((att) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AttachmentDisplay, { attachment: att }, att.id)) })
|
|
1641
|
+
] }),
|
|
1642
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "pp-message-time", children: [
|
|
1643
|
+
formatTime(msg.timestamp),
|
|
1644
|
+
isEdited && !isDeleted && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-edited-badge", children: "edited" }),
|
|
1645
|
+
msg.sender === "ai" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-ai-badge", children: "AI" }),
|
|
1646
|
+
msg.sender === "visitor" && !isDeleted && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: `pp-status pp-status-${msg.status ?? "sent"}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusIcon, { status: msg.status }) })
|
|
1537
1647
|
] })
|
|
1538
|
-
]
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
class: "pp-reply-quote pp-reply-quote-clickable",
|
|
1543
|
-
onClick: () => scrollToMessage(replyData.id),
|
|
1544
|
-
role: "button",
|
|
1545
|
-
tabIndex: 0,
|
|
1546
|
-
onKeyDown: (e) => e.key === "Enter" && scrollToMessage(replyData.id),
|
|
1547
|
-
children: [
|
|
1548
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-reply-sender", children: replyData.sender === "visitor" ? "You" : "Support" }),
|
|
1549
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-reply-content", children: replyData.deleted ? "Message deleted" : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1550
|
-
replyData.hasAttachment && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-reply-attachment-icon", children: replyData.attachmentType?.startsWith("image/") ? "\u{1F4F7} " : "\u{1F4CE} " }),
|
|
1551
|
-
replyData.content ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1552
|
-
(replyData.content || "").slice(0, 50),
|
|
1553
|
-
(replyData.content || "").length > 50 ? "..." : ""
|
|
1554
|
-
] }) : replyData.attachmentType?.startsWith("image/") ? "Photo" : "File"
|
|
1555
|
-
] }) })
|
|
1556
|
-
]
|
|
1557
|
-
}
|
|
1558
|
-
),
|
|
1559
|
-
isDeleted ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "pp-message-content pp-deleted-content", children: [
|
|
1560
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-deleted-icon", children: "\u{1F5D1}\uFE0F" }),
|
|
1561
|
-
" Message deleted"
|
|
1562
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1563
|
-
msg.content && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { class: "pp-message-content", children: msg.content }),
|
|
1564
|
-
msg.attachments && msg.attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { class: "pp-message-attachments", children: msg.attachments.map((att) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AttachmentDisplay, { attachment: att }, att.id)) })
|
|
1565
|
-
] }),
|
|
1566
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "pp-message-time", children: [
|
|
1567
|
-
formatTime(msg.timestamp),
|
|
1568
|
-
isEdited && !isDeleted && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-edited-badge", children: "edited" }),
|
|
1569
|
-
msg.sender === "ai" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: "pp-ai-badge", children: "AI" }),
|
|
1570
|
-
msg.sender === "visitor" && !isDeleted && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { class: `pp-status pp-status-${msg.status ?? "sent"}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusIcon, { status: msg.status }) })
|
|
1571
|
-
] })
|
|
1572
|
-
]
|
|
1573
|
-
},
|
|
1574
|
-
msg.id
|
|
1575
|
-
);
|
|
1648
|
+
]
|
|
1649
|
+
}
|
|
1650
|
+
)
|
|
1651
|
+
] }, msg.id);
|
|
1576
1652
|
}),
|
|
1577
1653
|
isTyping && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "pp-message pp-message-operator pp-typing", children: [
|
|
1578
1654
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
@@ -1848,7 +1924,7 @@ function AttachmentDisplay({ attachment }) {
|
|
|
1848
1924
|
}
|
|
1849
1925
|
|
|
1850
1926
|
// src/version.ts
|
|
1851
|
-
var VERSION = "0.3.
|
|
1927
|
+
var VERSION = "0.3.7";
|
|
1852
1928
|
|
|
1853
1929
|
// src/client.ts
|
|
1854
1930
|
var PocketPingClient = class {
|