@adatechnology/conversations-ui 0.5.0 → 0.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/README.md +82 -20
- package/dist/{chunk-JXJCPN34.js → chunk-FAQLC3TX.js} +1 -1
- package/dist/{chunk-RJMSM3YA.js → chunk-O6457XHK.js} +17 -11
- package/dist/chunk-OVFCLRQQ.js +84 -0
- package/dist/index.d.ts +14 -4
- package/dist/index.js +3 -3
- package/dist/participant/index.d.ts +25 -1
- package/dist/participant/index.js +454 -194
- package/dist/preview/index.js +2 -2
- package/dist/styles.css +98 -0
- package/package.json +2 -2
- package/src/MessageBubble.test.tsx +2 -2
- package/src/MessageText.test.tsx +27 -10
- package/src/MessageText.tsx +25 -17
- package/src/MessageTextCopiedBadge.tsx +10 -2
- package/src/StatusTicks.test.tsx +27 -6
- package/src/StatusTicks.tsx +30 -15
- package/src/legacyChannels.golden.test.ts +89 -0
- package/src/legacyDefaults.golden.test.tsx +127 -0
- package/src/legacyStyles.fixture.css +1121 -0
- package/src/legacyStyles.golden.test.ts +121 -0
- package/src/messageTextCopyInteraction.test.ts +75 -0
- package/src/messageTextCopyInteraction.ts +37 -0
- package/src/participant/ParticipantChannelBadges.test.tsx +59 -0
- package/src/participant/ParticipantChannelBadges.tsx +75 -0
- package/src/participant/ParticipantConversations.tsx +13 -6
- package/src/participant/ParticipantConversationsScreen.tsx +18 -7
- package/src/participant/ParticipantInbox.test.tsx +99 -2
- package/src/participant/ParticipantInbox.tsx +27 -46
- package/src/participant/ParticipantInboxRow.tsx +75 -0
- package/src/participant/ParticipantInboxSearchField.tsx +34 -0
- package/src/participant/ParticipantMessageBubble.test.tsx +2 -0
- package/src/participant/ParticipantMessageBubble.tsx +3 -3
- package/src/participant/ParticipantProtocolBadge.tsx +74 -0
- package/src/participant/ParticipantProtocolView.test.tsx +208 -0
- package/src/participant/ParticipantThread.test.tsx +19 -2
- package/src/participant/ParticipantThread.tsx +25 -15
- package/src/participant/index.ts +1 -0
- package/src/participant/participant.types.ts +9 -0
- package/src/participant/participantChannels.test.ts +42 -0
- package/src/participant/participantChannels.ts +33 -0
- package/src/participant/participantGrouping.test.ts +101 -3
- package/src/participant/participantGrouping.ts +20 -7
- package/src/participant/participantLabels.ts +29 -0
- package/src/participant/participantProtocol.test.ts +104 -0
- package/src/participant/participantProtocol.ts +52 -0
- package/src/participant/participantProtocolCopy.test.ts +45 -0
- package/src/participant/participantProtocolCopy.ts +32 -0
- package/src/styles.css +19 -1
- package/dist/chunk-WSFGNR5R.js +0 -55
package/dist/chunk-WSFGNR5R.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
parseWhatsAppFormatting
|
|
3
|
-
} from "./chunk-CBYEHPX6.js";
|
|
4
|
-
|
|
5
|
-
// src/MessageText.tsx
|
|
6
|
-
import { useCallback, useState } from "react";
|
|
7
|
-
|
|
8
|
-
// src/theme.ts
|
|
9
|
-
var CHAT_TEXT_PRIMARY_CLASS = "text-[#111b21] dark:text-[#e9edef]";
|
|
10
|
-
var CHAT_TEXT_SECONDARY_CLASS = "text-[#667781] dark:text-[#8696a0]";
|
|
11
|
-
|
|
12
|
-
// src/MessageTextCopiedBadge.tsx
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
function MessageTextCopiedBadge({ label = "Copied" }) {
|
|
15
|
-
return /* @__PURE__ */ jsx("span", { className: "cv-message-text__copied", children: label });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/MessageText.tsx
|
|
19
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
20
|
-
function MessageText({ message, copyOnClick = true, copiedLabel }) {
|
|
21
|
-
const [copied, setCopied] = useState(false);
|
|
22
|
-
const handleCopy = useCallback(async () => {
|
|
23
|
-
if (!copyOnClick || !message.content) return;
|
|
24
|
-
try {
|
|
25
|
-
await navigator.clipboard.writeText(message.content);
|
|
26
|
-
setCopied(true);
|
|
27
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
28
|
-
} catch {
|
|
29
|
-
}
|
|
30
|
-
}, [copyOnClick, message.content]);
|
|
31
|
-
const handleKeyDown = (event) => {
|
|
32
|
-
if (event.key !== "Enter" && event.key !== " ") return;
|
|
33
|
-
event.preventDefault();
|
|
34
|
-
void handleCopy();
|
|
35
|
-
};
|
|
36
|
-
if (message.type === "template")
|
|
37
|
-
return /* @__PURE__ */ jsx2("p", { className: `text-sm italic ${CHAT_TEXT_SECONDARY_CLASS}`, children: message.content ?? "Template message" });
|
|
38
|
-
return /* @__PURE__ */ jsxs(
|
|
39
|
-
"div",
|
|
40
|
-
{
|
|
41
|
-
className: copyOnClick ? "cv-message-text cv-message-text--copyable" : "cv-message-text",
|
|
42
|
-
...copyOnClick ? { role: "button", tabIndex: 0, onClick: handleCopy, onKeyDown: handleKeyDown } : {},
|
|
43
|
-
children: [
|
|
44
|
-
/* @__PURE__ */ jsx2("div", { children: parseWhatsAppFormatting(message.content ?? "") }),
|
|
45
|
-
copied && /* @__PURE__ */ jsx2(MessageTextCopiedBadge, { label: copiedLabel })
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
CHAT_TEXT_PRIMARY_CLASS,
|
|
53
|
-
CHAT_TEXT_SECONDARY_CLASS,
|
|
54
|
-
MessageText
|
|
55
|
-
};
|