@adatechnology/conversations-ui 0.5.0 → 0.6.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.
- 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 +7 -7
- 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 +106 -0
- package/package.json +3 -3
- 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/cssBlocks.test-helper.ts +31 -0
- 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 +92 -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/participantLayoutShrink.test.ts +82 -0
- package/src/styles.css +22 -1
- package/dist/chunk-WSFGNR5R.js +0 -55
package/src/styles.css
CHANGED
|
@@ -1139,7 +1139,8 @@
|
|
|
1139
1139
|
|
|
1140
1140
|
/* Participant view (.cv-p-*). Public theming API: override --cv-p-surface, --cv-p-surface-raised,
|
|
1141
1141
|
--cv-p-text, --cv-p-text-muted, --cv-p-border, --cv-p-accent, --cv-p-accent-contrast,
|
|
1142
|
-
--cv-p-highlight, --cv-p-danger, --cv-p-radius on .cv-p or any
|
|
1142
|
+
--cv-p-highlight, --cv-p-danger, --cv-p-radius, --cv-p-channel-app, --cv-p-channel-whatsapp on .cv-p or any
|
|
1143
|
+
ancestor. Channel colors must keep 3:1 against surface, surface-raised and highlight. */
|
|
1143
1144
|
.cv-p {
|
|
1144
1145
|
--cv-p-i-surface: var(--cv-p-surface, #ffffff);
|
|
1145
1146
|
--cv-p-i-surface-raised: var(--cv-p-surface-raised, #f3f4f6);
|
|
@@ -1229,6 +1230,14 @@
|
|
|
1229
1230
|
width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 1px solid var(--cv-p-i-border);
|
|
1230
1231
|
border-radius: var(--cv-p-i-radius); font: 0.7rem 'SFMono-Regular', Consolas, monospace; text-transform: uppercase; color: var(--cv-p-i-accent);
|
|
1231
1232
|
}
|
|
1233
|
+
.cv-p-inbox__icon { color: var(--cv-p-i-accent); font-size: 1rem; }
|
|
1234
|
+
.cv-p-inbox__icon svg { width: 1.25rem; height: 1.25rem; }
|
|
1235
|
+
.cv-p-row__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
|
|
1236
|
+
.cv-p-channels { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
|
|
1237
|
+
.cv-p-channel { display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; border: 1px solid var(--cv-p-i-border); border-radius: var(--cv-p-i-radius); color: var(--cv-p-i-text-muted); }
|
|
1238
|
+
.cv-p-channel svg { display: block; }
|
|
1239
|
+
.cv-p-channel--whatsapp { color: var(--cv-p-channel-whatsapp, #20914f); }
|
|
1240
|
+
.cv-p-channel--app { color: var(--cv-p-channel-app, var(--cv-p-i-accent)); }
|
|
1232
1241
|
.cv-p-row__body { display: flex; flex-direction: column; min-width: 0; }
|
|
1233
1242
|
.cv-p-row__kind { font: 0.64rem 'SFMono-Regular', Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cv-p-i-text-muted); }
|
|
1234
1243
|
.cv-p-row__title { font-weight: 600; font-size: 0.92rem; }
|
|
@@ -1237,6 +1246,7 @@
|
|
|
1237
1246
|
.cv-p-row__unread { min-width: 1.25rem; padding: 0 0.3rem; text-align: center; font-weight: 700; background: var(--cv-p-i-accent); color: var(--cv-p-i-accent-contrast); }
|
|
1238
1247
|
|
|
1239
1248
|
.cv-p-thread__header { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-bottom: 1px solid var(--cv-p-i-border); }
|
|
1249
|
+
.cv-p-thread__heading { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
1240
1250
|
.cv-p-thread__title { flex: 1; margin: 0; font-size: 1rem; min-width: 0; }
|
|
1241
1251
|
.cv-p-thread__title-button { min-height: var(--cv-p-i-touch); padding: 0; background: none; border: 0; color: inherit; font: inherit; font-weight: 600; text-align: left; text-decoration: underline; cursor: pointer; }
|
|
1242
1252
|
.cv-p-thread__subject-card { margin: 0.75rem 1rem 0; padding: 0.625rem 0.75rem; border: 1px solid var(--cv-p-i-border); background: var(--cv-p-i-surface-raised); border-radius: var(--cv-p-i-radius); font-size: 0.82rem; }
|
|
@@ -1273,9 +1283,20 @@
|
|
|
1273
1283
|
.cv-p-files__size { color: var(--cv-p-i-text-muted); }
|
|
1274
1284
|
.cv-p-files__remove { min-width: var(--cv-p-i-touch); min-height: var(--cv-p-i-touch); background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer; }
|
|
1275
1285
|
|
|
1286
|
+
.cv-p-protocol { min-width: 0; overflow-wrap: anywhere; font: 0.7rem 'SFMono-Regular', Consolas, monospace; letter-spacing: 0.04em; color: var(--cv-p-i-text-muted); }
|
|
1287
|
+
.cv-p-protocol--header { display: flex; align-items: center; gap: 0.5rem; }
|
|
1288
|
+
.cv-p-protocol__copy { min-height: var(--cv-p-i-touch); min-width: var(--cv-p-i-touch); padding: 0 0.75rem; background: transparent; border: 1px solid var(--cv-p-i-border); border-radius: var(--cv-p-i-radius); color: var(--cv-p-i-text); font: inherit; font-size: 0.75rem; cursor: pointer; }
|
|
1289
|
+
.cv-p-search { padding: 0.625rem 1rem; border-bottom: 1px solid var(--cv-p-i-border); }
|
|
1290
|
+
.cv-p-search__input { width: 100%; box-sizing: border-box; min-height: var(--cv-p-i-touch); padding: 0 0.75rem; font: inherit; font-size: 0.9rem; color: var(--cv-p-i-text); background: var(--cv-p-i-surface); border: 1px solid var(--cv-p-i-border); border-radius: var(--cv-p-i-radius); }
|
|
1291
|
+
.cv-p-search__input:focus-visible, .cv-p-protocol__copy:focus-visible { outline: 2px solid var(--cv-p-i-accent); outline-offset: 2px; }
|
|
1292
|
+
|
|
1276
1293
|
@media (prefers-reduced-motion: no-preference) {
|
|
1294
|
+
.cv-p-protocol__copy, .cv-p-search__input { transition: border-color 0.12s, background-color 0.12s; }
|
|
1277
1295
|
.cv-p-row, .cv-p-button, .cv-p-chip { transition: background-color 0.12s, border-color 0.12s; }
|
|
1278
1296
|
}
|
|
1279
1297
|
|
|
1298
|
+
/* Item de coluna flex com overflow ≠ visible (no próprio item) perde o min-height:auto e encolhe; os quatro últimos são defensivos. */
|
|
1299
|
+
.cv-p-filters, .cv-p-quick, .cv-p-search, .cv-p-composer, .cv-p-thread__header, .cv-p-thread__subject-card { flex: 0 0 auto; }
|
|
1300
|
+
|
|
1280
1301
|
.cv-p-root { display: flex; flex-direction: column; min-height: 0; height: 100%; }
|
|
1281
1302
|
.cv-p-root__screen { display: flex; flex-direction: column; flex: 1; min-height: 0; }
|
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
|
-
};
|