@adatechnology/conversations-ui 0.2.1 → 0.3.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/dist/{ConversationSimulatorPanel-ikgmlciE.d.ts → ConversationSimulatorPanel-DmV8uaFE.d.ts} +1 -1
- package/dist/{chunk-DKPXKQGC.js → chunk-HMCOTZAX.js} +18 -1
- package/dist/{chunk-NHQDQJL2.js → chunk-L4OE4ORQ.js} +18 -19
- package/dist/{chunk-WCBDXZ3X.js → chunk-PJNR6UMN.js} +73 -8
- package/dist/flows/index.js +32 -28
- package/dist/index.d.ts +44 -5
- package/dist/index.js +563 -289
- package/dist/preview/index.d.ts +2 -2
- package/dist/preview/index.js +2 -2
- package/package.json +2 -2
- package/src/InteractiveMessage.tsx +13 -13
- package/src/MessageText.tsx +1 -3
- package/src/blockFormattingNesting.test.tsx +47 -0
- package/src/flows/FlowWhatsAppPreview.tsx +40 -42
- package/src/index.ts +3 -0
- package/src/lib/WhatsAppMessagePreview.tsx +32 -0
- package/src/lib/composer-formatting.ts +8 -0
- package/src/lib/whatsapp-formatting.test.tsx +65 -2
- package/src/lib/whatsapp-formatting.tsx +110 -13
- package/src/quickReplies/QuickRepliesWorkspace.tsx +249 -164
- package/src/quickReplies/QuickReplyFormattingToolbar.tsx +62 -0
- package/src/quickReplies/QuickReplyWhatsAppPreview.tsx +57 -0
- package/src/quickReplies/labels.ts +27 -1
- package/src/quickReplies/quickReplyFormatting.test.tsx +336 -0
- package/src/quickReplies/quickReplyFormatting.ts +232 -0
- package/src/quickReplies/useQuickRepliesWorkspace.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TOOLTIP_ATTRIBUTE,
|
|
3
|
-
TooltipLayer
|
|
4
|
-
|
|
3
|
+
TooltipLayer,
|
|
4
|
+
WhatsAppMessagePreview
|
|
5
|
+
} from "./chunk-HMCOTZAX.js";
|
|
5
6
|
import {
|
|
6
7
|
AudioPlayer,
|
|
7
8
|
AudioRecorderButton,
|
|
@@ -52,7 +53,6 @@ import {
|
|
|
52
53
|
applyQuickReplyVariables,
|
|
53
54
|
capabilitiesOf,
|
|
54
55
|
channelFiltersFor,
|
|
55
|
-
cn,
|
|
56
56
|
contactFlag,
|
|
57
57
|
conversationsOf,
|
|
58
58
|
createMediaUrlResolver,
|
|
@@ -76,16 +76,17 @@ import {
|
|
|
76
76
|
useConversationLocales,
|
|
77
77
|
useConversations,
|
|
78
78
|
useQuickRepliesPicker
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-L4OE4ORQ.js";
|
|
80
80
|
import {
|
|
81
81
|
ZERO_WIDTH_SPACE,
|
|
82
|
+
cn,
|
|
82
83
|
htmlToWA,
|
|
83
84
|
parseWhatsAppFormatting,
|
|
84
85
|
useDarkMode,
|
|
85
86
|
useIsDarkTheme,
|
|
86
87
|
waToHTML,
|
|
87
88
|
waToHTMLInline
|
|
88
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-PJNR6UMN.js";
|
|
89
90
|
|
|
90
91
|
// src/RichMessageComposer.tsx
|
|
91
92
|
import {
|
|
@@ -122,6 +123,12 @@ var FORMATTING_ACTION = {
|
|
|
122
123
|
STRIKETHROUGH: "strikethrough",
|
|
123
124
|
MONOSPACE: "monospace"
|
|
124
125
|
};
|
|
126
|
+
var WHATSAPP_MARKER_BY_ACTION = {
|
|
127
|
+
[FORMATTING_ACTION.BOLD]: "*",
|
|
128
|
+
[FORMATTING_ACTION.ITALIC]: "_",
|
|
129
|
+
[FORMATTING_ACTION.STRIKETHROUGH]: "~",
|
|
130
|
+
[FORMATTING_ACTION.MONOSPACE]: "```"
|
|
131
|
+
};
|
|
125
132
|
var EXEC_COMMAND_BY_ACTION = {
|
|
126
133
|
[FORMATTING_ACTION.BOLD]: "bold",
|
|
127
134
|
[FORMATTING_ACTION.ITALIC]: "italic",
|
|
@@ -611,7 +618,7 @@ var RichMessageComposer = forwardRef(
|
|
|
611
618
|
document.addEventListener("mousedown", handleOutsideClick);
|
|
612
619
|
return () => document.removeEventListener("mousedown", handleOutsideClick);
|
|
613
620
|
}, [isQuickRepliesOpen, quickRepliesMode, closeQuickRepliesAndRefocus]);
|
|
614
|
-
const
|
|
621
|
+
const wrapSelection2 = useCallback(
|
|
615
622
|
(action) => {
|
|
616
623
|
const range = currentRange();
|
|
617
624
|
const selectedText = range?.toString();
|
|
@@ -638,17 +645,17 @@ var RichMessageComposer = forwardRef(
|
|
|
638
645
|
} else if (code) {
|
|
639
646
|
unwrapMonospace(code);
|
|
640
647
|
} else {
|
|
641
|
-
|
|
648
|
+
wrapSelection2(action);
|
|
642
649
|
}
|
|
643
650
|
emitChange(editor.innerHTML);
|
|
644
651
|
refreshActiveFormatting();
|
|
645
652
|
return;
|
|
646
653
|
}
|
|
647
654
|
if (toggleFormattingCommand(action)) emitChange(editor.innerHTML);
|
|
648
|
-
else
|
|
655
|
+
else wrapSelection2(action);
|
|
649
656
|
refreshActiveFormatting();
|
|
650
657
|
},
|
|
651
|
-
[currentRange, emitChange, refreshActiveFormatting,
|
|
658
|
+
[currentRange, emitChange, refreshActiveFormatting, wrapSelection2]
|
|
652
659
|
);
|
|
653
660
|
const handleInput = useCallback(
|
|
654
661
|
(event) => {
|
|
@@ -928,7 +935,7 @@ function WhatsAppMessageEditor({
|
|
|
928
935
|
}) {
|
|
929
936
|
const editorLabels = { ...DEFAULT_WHATSAPP_MESSAGE_EDITOR_LABELS, ...labels };
|
|
930
937
|
const textareaRef = useRef3(null);
|
|
931
|
-
function
|
|
938
|
+
function wrapSelection2(marker) {
|
|
932
939
|
const textarea = textareaRef.current;
|
|
933
940
|
if (!textarea) return;
|
|
934
941
|
const start = textarea.selectionStart;
|
|
@@ -957,9 +964,9 @@ function WhatsAppMessageEditor({
|
|
|
957
964
|
const toolbarButtonClass = "inline-flex items-center justify-center h-8 w-8 rounded-lg border border-gray-200 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors";
|
|
958
965
|
return /* @__PURE__ */ jsxs3("div", { children: [
|
|
959
966
|
/* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center gap-1.5 mb-2", children: [
|
|
960
|
-
/* @__PURE__ */ jsx3("button", { type: "button", onClick: () =>
|
|
961
|
-
/* @__PURE__ */ jsx3("button", { type: "button", onClick: () =>
|
|
962
|
-
/* @__PURE__ */ jsx3("button", { type: "button", onClick: () =>
|
|
967
|
+
/* @__PURE__ */ jsx3("button", { type: "button", onClick: () => wrapSelection2("*"), className: toolbarButtonClass, "data-cv-tooltip": editorLabels.boldHint, "aria-label": editorLabels.bold, children: /* @__PURE__ */ jsx3(Bold2, { size: 15 }) }),
|
|
968
|
+
/* @__PURE__ */ jsx3("button", { type: "button", onClick: () => wrapSelection2("_"), className: toolbarButtonClass, "data-cv-tooltip": editorLabels.italicHint, "aria-label": editorLabels.italic, children: /* @__PURE__ */ jsx3(Italic2, { size: 15 }) }),
|
|
969
|
+
/* @__PURE__ */ jsx3("button", { type: "button", onClick: () => wrapSelection2("~"), className: toolbarButtonClass, "data-cv-tooltip": editorLabels.strikethroughHint, "aria-label": editorLabels.strikethrough, children: /* @__PURE__ */ jsx3(Strikethrough2, { size: 15 }) }),
|
|
963
970
|
placeholders.length > 0 && /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
964
971
|
/* @__PURE__ */ jsx3("span", { className: "mx-1 h-5 w-px bg-gray-200 dark:bg-gray-600" }),
|
|
965
972
|
placeholders.map((token) => /* @__PURE__ */ jsx3(
|
|
@@ -1328,7 +1335,7 @@ function MessageText({ message }) {
|
|
|
1328
1335
|
onClick: handleCopy,
|
|
1329
1336
|
className: "text-[14.2px] leading-[19px] whitespace-pre-wrap break-words select-all [&_strong]:font-bold [&_em]:italic [&_del]:line-through",
|
|
1330
1337
|
children: [
|
|
1331
|
-
/* @__PURE__ */ jsx7("
|
|
1338
|
+
/* @__PURE__ */ jsx7("div", { children: parseWhatsAppFormatting(message.content ?? "") }),
|
|
1332
1339
|
copied && /* @__PURE__ */ jsx7("span", { className: "absolute top-0 right-0 -translate-y-full bg-[#3b4a54] text-white text-[11px] px-1.5 py-0.5 rounded shadow-lg", children: "Copiado!" })
|
|
1333
1340
|
]
|
|
1334
1341
|
}
|
|
@@ -4341,6 +4348,7 @@ async function sendQueuedMessage(params) {
|
|
|
4341
4348
|
|
|
4342
4349
|
// src/quickReplies/QuickRepliesWorkspace.tsx
|
|
4343
4350
|
import { useEffect as useEffect13, useId as useId2, useRef as useRef11, useState as useState18 } from "react";
|
|
4351
|
+
import { Pencil as Pencil2, Plus as Plus2, Trash2 as Trash23 } from "lucide-react";
|
|
4344
4352
|
|
|
4345
4353
|
// src/quickReplies/useQuickRepliesWorkspace.ts
|
|
4346
4354
|
import { useCallback as useCallback10, useEffect as useEffect12, useState as useState17 } from "react";
|
|
@@ -4769,10 +4777,208 @@ function useQuickRepliesWorkspace({
|
|
|
4769
4777
|
};
|
|
4770
4778
|
}
|
|
4771
4779
|
|
|
4780
|
+
// src/quickReplies/quickReplyFormatting.ts
|
|
4781
|
+
var LEADING_WHITESPACE = /^\s*/;
|
|
4782
|
+
var TRAILING_WHITESPACE = /\s*$/;
|
|
4783
|
+
function isWrappedBy(core, marker) {
|
|
4784
|
+
return core.length >= marker.length * 2 && core.startsWith(marker) && core.endsWith(marker);
|
|
4785
|
+
}
|
|
4786
|
+
function toggleLine({ line, marker, shouldUnwrap }) {
|
|
4787
|
+
if (!line.trim()) return line;
|
|
4788
|
+
const leading = LEADING_WHITESPACE.exec(line)?.[0] ?? "";
|
|
4789
|
+
const trailing = TRAILING_WHITESPACE.exec(line)?.[0] ?? "";
|
|
4790
|
+
const core = line.slice(leading.length, line.length - trailing.length);
|
|
4791
|
+
const toggled = shouldUnwrap ? core.slice(marker.length, core.length - marker.length) : marker + core + marker;
|
|
4792
|
+
return leading + toggled + trailing;
|
|
4793
|
+
}
|
|
4794
|
+
function wrapLines({ text, start, end, marker }) {
|
|
4795
|
+
const lines = text.slice(start, end).split("\n");
|
|
4796
|
+
const shouldUnwrap = lines.filter((line) => line.trim()).every((line) => isWrappedBy(line.trim(), marker));
|
|
4797
|
+
const replaced = lines.map((line) => toggleLine({ line, marker, shouldUnwrap })).join("\n");
|
|
4798
|
+
return {
|
|
4799
|
+
text: text.slice(0, start) + replaced + text.slice(end),
|
|
4800
|
+
selectionStart: start,
|
|
4801
|
+
selectionEnd: start + replaced.length
|
|
4802
|
+
};
|
|
4803
|
+
}
|
|
4804
|
+
function wrapSelection({ text, start, end, marker }) {
|
|
4805
|
+
const selected = text.slice(start, end);
|
|
4806
|
+
if (!selected.trim()) {
|
|
4807
|
+
return {
|
|
4808
|
+
text: text.slice(0, start) + marker + selected + marker + text.slice(end),
|
|
4809
|
+
selectionStart: start + marker.length,
|
|
4810
|
+
selectionEnd: end + marker.length
|
|
4811
|
+
};
|
|
4812
|
+
}
|
|
4813
|
+
if (selected.includes("\n")) return wrapLines({ text, start, end, marker });
|
|
4814
|
+
const coreStart = start + (LEADING_WHITESPACE.exec(selected)?.[0].length ?? 0);
|
|
4815
|
+
const coreEnd = end - (TRAILING_WHITESPACE.exec(selected)?.[0].length ?? 0);
|
|
4816
|
+
const core = text.slice(coreStart, coreEnd);
|
|
4817
|
+
const before = text.slice(0, coreStart);
|
|
4818
|
+
const after = text.slice(coreEnd);
|
|
4819
|
+
const size = marker.length;
|
|
4820
|
+
if (isWrappedBy(core, marker)) {
|
|
4821
|
+
const unwrapped = core.slice(size, core.length - size);
|
|
4822
|
+
return { text: before + unwrapped + after, selectionStart: coreStart, selectionEnd: coreStart + unwrapped.length };
|
|
4823
|
+
}
|
|
4824
|
+
if (before.endsWith(marker) && after.startsWith(marker)) {
|
|
4825
|
+
return {
|
|
4826
|
+
text: before.slice(0, before.length - size) + core + after.slice(size),
|
|
4827
|
+
selectionStart: coreStart - size,
|
|
4828
|
+
selectionEnd: coreEnd - size
|
|
4829
|
+
};
|
|
4830
|
+
}
|
|
4831
|
+
return {
|
|
4832
|
+
text: before + marker + core + marker + after,
|
|
4833
|
+
selectionStart: coreStart + size,
|
|
4834
|
+
selectionEnd: coreEnd + size
|
|
4835
|
+
};
|
|
4836
|
+
}
|
|
4837
|
+
var QUICK_REPLY_FORMATTING_ACTION = {
|
|
4838
|
+
...FORMATTING_ACTION,
|
|
4839
|
+
INLINE_CODE: "inlineCode",
|
|
4840
|
+
BULLETED_LIST: "bulletedList",
|
|
4841
|
+
NUMBERED_LIST: "numberedList",
|
|
4842
|
+
QUOTE: "quote"
|
|
4843
|
+
};
|
|
4844
|
+
var LINE_PREFIX_PATTERN = {
|
|
4845
|
+
[QUICK_REPLY_FORMATTING_ACTION.BULLETED_LIST]: /^[-*] /,
|
|
4846
|
+
[QUICK_REPLY_FORMATTING_ACTION.NUMBERED_LIST]: /^\d+\. /,
|
|
4847
|
+
[QUICK_REPLY_FORMATTING_ACTION.QUOTE]: /^> /
|
|
4848
|
+
};
|
|
4849
|
+
var INLINE_MARKER_BY_ACTION = {
|
|
4850
|
+
...WHATSAPP_MARKER_BY_ACTION,
|
|
4851
|
+
[QUICK_REPLY_FORMATTING_ACTION.INLINE_CODE]: "`"
|
|
4852
|
+
};
|
|
4853
|
+
function isLinePrefixAction(action) {
|
|
4854
|
+
return action in LINE_PREFIX_PATTERN;
|
|
4855
|
+
}
|
|
4856
|
+
function prefixFor(action, position) {
|
|
4857
|
+
if (action === QUICK_REPLY_FORMATTING_ACTION.NUMBERED_LIST) return `${position}. `;
|
|
4858
|
+
return action === QUICK_REPLY_FORMATTING_ACTION.QUOTE ? "> " : "- ";
|
|
4859
|
+
}
|
|
4860
|
+
function toggleLinePrefix({ text, start, end, action }) {
|
|
4861
|
+
const lineStart = start === 0 ? 0 : text.lastIndexOf("\n", start - 1) + 1;
|
|
4862
|
+
const searchFrom = end > start && text[end - 1] === "\n" ? end - 1 : end;
|
|
4863
|
+
const nextBreak = text.indexOf("\n", searchFrom);
|
|
4864
|
+
const lineEnd = nextBreak === -1 ? text.length : nextBreak;
|
|
4865
|
+
const original = text.slice(lineStart, lineEnd);
|
|
4866
|
+
const lines = original.split("\n");
|
|
4867
|
+
const pattern = LINE_PREFIX_PATTERN[action];
|
|
4868
|
+
const filledLines = lines.filter((line) => line.trim());
|
|
4869
|
+
const shouldRemove = filledLines.length > 0 && filledLines.every((line) => pattern.test(line));
|
|
4870
|
+
let position = 0;
|
|
4871
|
+
const replaced = lines.map((line) => {
|
|
4872
|
+
if (shouldRemove) return line.replace(pattern, "");
|
|
4873
|
+
if (!line.trim() && lines.length > 1) return line;
|
|
4874
|
+
position += 1;
|
|
4875
|
+
return prefixFor(action, position) + line.replace(pattern, "");
|
|
4876
|
+
}).join("\n");
|
|
4877
|
+
const nextText = text.slice(0, lineStart) + replaced + text.slice(lineEnd);
|
|
4878
|
+
if (start === end) {
|
|
4879
|
+
const caret = Math.max(lineStart, start + replaced.length - original.length);
|
|
4880
|
+
return { text: nextText, selectionStart: caret, selectionEnd: caret };
|
|
4881
|
+
}
|
|
4882
|
+
return { text: nextText, selectionStart: lineStart, selectionEnd: lineStart + replaced.length };
|
|
4883
|
+
}
|
|
4884
|
+
function computeFormattingEdit({
|
|
4885
|
+
text,
|
|
4886
|
+
selectionStart,
|
|
4887
|
+
selectionEnd,
|
|
4888
|
+
action,
|
|
4889
|
+
maximumLength
|
|
4890
|
+
}) {
|
|
4891
|
+
const edit = isLinePrefixAction(action) ? toggleLinePrefix({ text, start: selectionStart, end: selectionEnd, action }) : wrapSelection({ text, start: selectionStart, end: selectionEnd, marker: INLINE_MARKER_BY_ACTION[action] ?? "" });
|
|
4892
|
+
return edit.text.length > maximumLength ? void 0 : edit;
|
|
4893
|
+
}
|
|
4894
|
+
var SHORTCUT_ACTION_BY_KEY = {
|
|
4895
|
+
b: FORMATTING_ACTION.BOLD,
|
|
4896
|
+
i: FORMATTING_ACTION.ITALIC
|
|
4897
|
+
};
|
|
4898
|
+
var FORMATTING_SHORTCUT_HINT = {
|
|
4899
|
+
[FORMATTING_ACTION.BOLD]: "Ctrl/\u2318+B",
|
|
4900
|
+
[FORMATTING_ACTION.ITALIC]: "Ctrl/\u2318+I"
|
|
4901
|
+
};
|
|
4902
|
+
function formattingActionForShortcut(event) {
|
|
4903
|
+
if (event.isComposing || event.shiftKey || event.altKey) return void 0;
|
|
4904
|
+
if (!(event.ctrlKey || event.metaKey)) return void 0;
|
|
4905
|
+
return SHORTCUT_ACTION_BY_KEY[event.key.toLowerCase()];
|
|
4906
|
+
}
|
|
4907
|
+
function changedRange(previous, next) {
|
|
4908
|
+
let prefix = 0;
|
|
4909
|
+
const shortest = Math.min(previous.length, next.length);
|
|
4910
|
+
while (prefix < shortest && previous[prefix] === next[prefix]) prefix += 1;
|
|
4911
|
+
let suffix = 0;
|
|
4912
|
+
while (suffix < shortest - prefix && previous[previous.length - 1 - suffix] === next[next.length - 1 - suffix]) {
|
|
4913
|
+
suffix += 1;
|
|
4914
|
+
}
|
|
4915
|
+
return { start: prefix, end: previous.length - suffix, insertedText: next.slice(prefix, next.length - suffix) };
|
|
4916
|
+
}
|
|
4917
|
+
|
|
4918
|
+
// src/quickReplies/QuickReplyFormattingToolbar.tsx
|
|
4919
|
+
import { Bold as Bold3, Code as Code2, Italic as Italic3, List, ListOrdered, Quote, SquareCode, Strikethrough as Strikethrough3 } from "lucide-react";
|
|
4920
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
4921
|
+
function QuickReplyFormattingToolbar({ labels, onFormat }) {
|
|
4922
|
+
const buttons = [
|
|
4923
|
+
{ action: QUICK_REPLY_FORMATTING_ACTION.BOLD, label: labels.formatBold, Icon: Bold3 },
|
|
4924
|
+
{ action: QUICK_REPLY_FORMATTING_ACTION.ITALIC, label: labels.formatItalic, Icon: Italic3 },
|
|
4925
|
+
{ action: QUICK_REPLY_FORMATTING_ACTION.STRIKETHROUGH, label: labels.formatStrikethrough, Icon: Strikethrough3 },
|
|
4926
|
+
{ action: QUICK_REPLY_FORMATTING_ACTION.MONOSPACE, label: labels.formatMonospace, Icon: SquareCode },
|
|
4927
|
+
{ action: QUICK_REPLY_FORMATTING_ACTION.INLINE_CODE, label: labels.formatInlineCode, Icon: Code2 },
|
|
4928
|
+
{ action: QUICK_REPLY_FORMATTING_ACTION.BULLETED_LIST, label: labels.formatBulletedList, Icon: List },
|
|
4929
|
+
{ action: QUICK_REPLY_FORMATTING_ACTION.NUMBERED_LIST, label: labels.formatNumberedList, Icon: ListOrdered },
|
|
4930
|
+
{ action: QUICK_REPLY_FORMATTING_ACTION.QUOTE, label: labels.formatQuote, Icon: Quote }
|
|
4931
|
+
];
|
|
4932
|
+
return /* @__PURE__ */ jsx25("div", { role: "toolbar", "aria-label": labels.formattingToolbar, className: "flex flex-wrap gap-1", children: buttons.map(({ action, label, Icon }) => /* @__PURE__ */ jsx25(
|
|
4933
|
+
"button",
|
|
4934
|
+
{
|
|
4935
|
+
type: "button",
|
|
4936
|
+
"aria-label": label,
|
|
4937
|
+
title: FORMATTING_SHORTCUT_HINT[action] ? `${label} (${FORMATTING_SHORTCUT_HINT[action]})` : label,
|
|
4938
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
4939
|
+
onClick: () => onFormat(action),
|
|
4940
|
+
className: cn(COMPOSER_TOOL_BUTTON_CLASS, COMPOSER_TOOL_BUTTON_IDLE_CLASS),
|
|
4941
|
+
children: /* @__PURE__ */ jsx25(Icon, { size: 16, "aria-hidden": "true" })
|
|
4942
|
+
},
|
|
4943
|
+
action
|
|
4944
|
+
)) });
|
|
4945
|
+
}
|
|
4946
|
+
|
|
4947
|
+
// src/quickReplies/QuickReplyWhatsAppPreview.tsx
|
|
4948
|
+
import { Paperclip as Paperclip2 } from "lucide-react";
|
|
4949
|
+
import { jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4950
|
+
function resolvePreviewVariables(body, variables = []) {
|
|
4951
|
+
return variables.reduce(
|
|
4952
|
+
(resolved, variable) => variable.marker ? resolved.split(variable.marker).join(variable.value || variable.label) : resolved,
|
|
4953
|
+
body
|
|
4954
|
+
);
|
|
4955
|
+
}
|
|
4956
|
+
function QuickReplyWhatsAppPreview({ body, variables, attachments, labels }) {
|
|
4957
|
+
const resolvedBody = resolvePreviewVariables(body, variables);
|
|
4958
|
+
const hasAttachments = (attachments?.length ?? 0) > 0;
|
|
4959
|
+
return /* @__PURE__ */ jsxs23("section", { "aria-label": labels.previewTitle, className: "space-y-1", children: [
|
|
4960
|
+
/* @__PURE__ */ jsx26("h3", { className: "text-sm font-medium", children: labels.previewTitle }),
|
|
4961
|
+
/* @__PURE__ */ jsxs23(WhatsAppMessagePreview, { children: [
|
|
4962
|
+
hasAttachments ? /* @__PURE__ */ jsx26("ul", { className: "mb-1.5 flex flex-wrap gap-1 whitespace-normal", children: attachments?.map((attachment) => /* @__PURE__ */ jsxs23(
|
|
4963
|
+
"li",
|
|
4964
|
+
{
|
|
4965
|
+
className: "inline-flex max-w-full items-center gap-1 rounded-md bg-black/5 px-1.5 py-0.5 text-xs dark:bg-white/10",
|
|
4966
|
+
children: [
|
|
4967
|
+
/* @__PURE__ */ jsx26(Paperclip2, { size: 12, "aria-hidden": "true", className: "shrink-0" }),
|
|
4968
|
+
/* @__PURE__ */ jsx26("span", { className: "truncate", children: attachment.filename })
|
|
4969
|
+
]
|
|
4970
|
+
},
|
|
4971
|
+
attachment.uploadId
|
|
4972
|
+
)) }) : null,
|
|
4973
|
+
resolvedBody ? parseWhatsAppFormatting(resolvedBody) : /* @__PURE__ */ jsx26("span", { className: "italic text-gray-400", children: labels.previewEmptyBody })
|
|
4974
|
+
] })
|
|
4975
|
+
] });
|
|
4976
|
+
}
|
|
4977
|
+
|
|
4772
4978
|
// src/quickReplies/AttachmentsFormSection.tsx
|
|
4773
4979
|
import { useRef as useRef10 } from "react";
|
|
4774
|
-
import { Paperclip as
|
|
4775
|
-
import { Fragment as Fragment7, jsx as
|
|
4980
|
+
import { Paperclip as Paperclip3, X as X4 } from "lucide-react";
|
|
4981
|
+
import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4776
4982
|
function AttachmentsFormSection({
|
|
4777
4983
|
labels: text,
|
|
4778
4984
|
attachments,
|
|
@@ -4786,18 +4992,18 @@ function AttachmentsFormSection({
|
|
|
4786
4992
|
onDismissRejections
|
|
4787
4993
|
}) {
|
|
4788
4994
|
const attachmentFileInputRef = useRef10(null);
|
|
4789
|
-
return /* @__PURE__ */
|
|
4790
|
-
/* @__PURE__ */
|
|
4791
|
-
attachments.length === 0 && pendingUploads.length === 0 ? /* @__PURE__ */
|
|
4792
|
-
attachments.map((attachment, index) => /* @__PURE__ */
|
|
4995
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-2", children: [
|
|
4996
|
+
/* @__PURE__ */ jsx27("span", { className: "block text-sm font-medium", children: text.attachmentsTitle }),
|
|
4997
|
+
attachments.length === 0 && pendingUploads.length === 0 ? /* @__PURE__ */ jsx27("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: text.attachmentsEmpty }) : /* @__PURE__ */ jsxs24("ul", { className: "space-y-1", children: [
|
|
4998
|
+
attachments.map((attachment, index) => /* @__PURE__ */ jsxs24(
|
|
4793
4999
|
"li",
|
|
4794
5000
|
{
|
|
4795
5001
|
className: "flex items-center gap-2 rounded-md border border-gray-200 px-2 py-1.5 text-xs dark:border-gray-700",
|
|
4796
5002
|
children: [
|
|
4797
|
-
/* @__PURE__ */
|
|
4798
|
-
/* @__PURE__ */
|
|
4799
|
-
/* @__PURE__ */
|
|
4800
|
-
/* @__PURE__ */
|
|
5003
|
+
/* @__PURE__ */ jsx27(Paperclip3, { "aria-hidden": "true", className: "h-3.5 w-3.5 flex-none text-gray-400" }),
|
|
5004
|
+
/* @__PURE__ */ jsx27("span", { className: "min-w-0 flex-1 truncate", children: attachment.filename }),
|
|
5005
|
+
/* @__PURE__ */ jsx27("span", { className: "flex-none text-gray-400", children: formatFileSize(attachment.sizeBytes) }),
|
|
5006
|
+
/* @__PURE__ */ jsx27(
|
|
4801
5007
|
"button",
|
|
4802
5008
|
{
|
|
4803
5009
|
type: "button",
|
|
@@ -4808,7 +5014,7 @@ function AttachmentsFormSection({
|
|
|
4808
5014
|
children: "\u2191"
|
|
4809
5015
|
}
|
|
4810
5016
|
),
|
|
4811
|
-
/* @__PURE__ */
|
|
5017
|
+
/* @__PURE__ */ jsx27(
|
|
4812
5018
|
"button",
|
|
4813
5019
|
{
|
|
4814
5020
|
type: "button",
|
|
@@ -4819,32 +5025,32 @@ function AttachmentsFormSection({
|
|
|
4819
5025
|
children: "\u2193"
|
|
4820
5026
|
}
|
|
4821
5027
|
),
|
|
4822
|
-
/* @__PURE__ */
|
|
5028
|
+
/* @__PURE__ */ jsx27(
|
|
4823
5029
|
"button",
|
|
4824
5030
|
{
|
|
4825
5031
|
type: "button",
|
|
4826
5032
|
"aria-label": text.attachmentRemove,
|
|
4827
5033
|
onClick: () => onRemoveAttachment(attachment.uploadId),
|
|
4828
5034
|
className: "flex-none text-red-600 dark:text-red-400",
|
|
4829
|
-
children: /* @__PURE__ */
|
|
5035
|
+
children: /* @__PURE__ */ jsx27(X4, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
4830
5036
|
}
|
|
4831
5037
|
)
|
|
4832
5038
|
]
|
|
4833
5039
|
},
|
|
4834
5040
|
attachment.uploadId
|
|
4835
5041
|
)),
|
|
4836
|
-
pendingUploads.map((pending) => /* @__PURE__ */
|
|
5042
|
+
pendingUploads.map((pending) => /* @__PURE__ */ jsxs24(
|
|
4837
5043
|
"li",
|
|
4838
5044
|
{
|
|
4839
5045
|
className: "flex items-center gap-2 rounded-md border border-gray-200 px-2 py-1.5 text-xs dark:border-gray-700",
|
|
4840
5046
|
"aria-busy": pending.status === "uploading",
|
|
4841
5047
|
"aria-live": "polite",
|
|
4842
5048
|
children: [
|
|
4843
|
-
/* @__PURE__ */
|
|
4844
|
-
/* @__PURE__ */
|
|
4845
|
-
pending.status === "uploading" ? /* @__PURE__ */
|
|
4846
|
-
/* @__PURE__ */
|
|
4847
|
-
/* @__PURE__ */
|
|
5049
|
+
/* @__PURE__ */ jsx27(Paperclip3, { "aria-hidden": "true", className: "h-3.5 w-3.5 flex-none text-gray-400" }),
|
|
5050
|
+
/* @__PURE__ */ jsx27("span", { className: "min-w-0 flex-1 truncate", children: pending.file.name }),
|
|
5051
|
+
pending.status === "uploading" ? /* @__PURE__ */ jsx27("span", { className: "flex-none text-gray-500 dark:text-gray-400", children: text.attachmentUploading(Math.round(pending.progress * 100)) }) : /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
5052
|
+
/* @__PURE__ */ jsx27("span", { role: "alert", className: "flex-none text-red-600 dark:text-red-400", children: pending.error }),
|
|
5053
|
+
/* @__PURE__ */ jsx27(
|
|
4848
5054
|
"button",
|
|
4849
5055
|
{
|
|
4850
5056
|
type: "button",
|
|
@@ -4854,14 +5060,14 @@ function AttachmentsFormSection({
|
|
|
4854
5060
|
}
|
|
4855
5061
|
)
|
|
4856
5062
|
] }),
|
|
4857
|
-
/* @__PURE__ */
|
|
5063
|
+
/* @__PURE__ */ jsx27(
|
|
4858
5064
|
"button",
|
|
4859
5065
|
{
|
|
4860
5066
|
type: "button",
|
|
4861
5067
|
"aria-label": text.attachmentCancel,
|
|
4862
5068
|
onClick: () => onCancelUpload(pending.localId),
|
|
4863
5069
|
className: "flex-none text-gray-400",
|
|
4864
|
-
children: /* @__PURE__ */
|
|
5070
|
+
children: /* @__PURE__ */ jsx27(X4, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
4865
5071
|
}
|
|
4866
5072
|
)
|
|
4867
5073
|
]
|
|
@@ -4869,11 +5075,11 @@ function AttachmentsFormSection({
|
|
|
4869
5075
|
pending.localId
|
|
4870
5076
|
))
|
|
4871
5077
|
] }),
|
|
4872
|
-
attachmentRejections.length > 0 ? /* @__PURE__ */
|
|
4873
|
-
attachmentRejections.map((rejection, index) => /* @__PURE__ */
|
|
4874
|
-
/* @__PURE__ */
|
|
5078
|
+
attachmentRejections.length > 0 ? /* @__PURE__ */ jsxs24("div", { role: "alert", className: "space-y-0.5 text-xs text-red-600 dark:text-red-400", children: [
|
|
5079
|
+
attachmentRejections.map((rejection, index) => /* @__PURE__ */ jsx27("p", { children: rejection.reason === "limit" ? text.attachmentLimitReached : text.attachmentTooLarge(rejection.file.name) }, index)),
|
|
5080
|
+
/* @__PURE__ */ jsx27("button", { type: "button", onClick: onDismissRejections, className: "hover:underline", children: text.cancel })
|
|
4875
5081
|
] }) : null,
|
|
4876
|
-
/* @__PURE__ */
|
|
5082
|
+
/* @__PURE__ */ jsx27(
|
|
4877
5083
|
"input",
|
|
4878
5084
|
{
|
|
4879
5085
|
ref: attachmentFileInputRef,
|
|
@@ -4886,7 +5092,7 @@ function AttachmentsFormSection({
|
|
|
4886
5092
|
}
|
|
4887
5093
|
}
|
|
4888
5094
|
),
|
|
4889
|
-
/* @__PURE__ */
|
|
5095
|
+
/* @__PURE__ */ jsx27(
|
|
4890
5096
|
"button",
|
|
4891
5097
|
{
|
|
4892
5098
|
type: "button",
|
|
@@ -4899,8 +5105,19 @@ function AttachmentsFormSection({
|
|
|
4899
5105
|
}
|
|
4900
5106
|
|
|
4901
5107
|
// src/quickReplies/QuickRepliesWorkspace.tsx
|
|
4902
|
-
import { jsx as
|
|
5108
|
+
import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4903
5109
|
var TABLE_SKELETON_ROWS = 3;
|
|
5110
|
+
function replaceWithNativeUndo(field, previous, next) {
|
|
5111
|
+
if (!canExecuteFormattingCommand()) return false;
|
|
5112
|
+
const range = changedRange(previous, next);
|
|
5113
|
+
field.focus();
|
|
5114
|
+
field.setSelectionRange(range.start, range.end);
|
|
5115
|
+
try {
|
|
5116
|
+
return range.insertedText ? document.execCommand("insertText", false, range.insertedText) : document.execCommand("delete");
|
|
5117
|
+
} catch {
|
|
5118
|
+
return false;
|
|
5119
|
+
}
|
|
5120
|
+
}
|
|
4904
5121
|
function QuickRepliesWorkspace({
|
|
4905
5122
|
api,
|
|
4906
5123
|
variables,
|
|
@@ -4972,14 +5189,46 @@ function QuickRepliesWorkspace({
|
|
|
4972
5189
|
field.setSelectionRange(caret, caret);
|
|
4973
5190
|
});
|
|
4974
5191
|
};
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
5192
|
+
const applyFormatting = (action) => {
|
|
5193
|
+
const field = bodyFieldRef.current;
|
|
5194
|
+
if (!field || !editing) return;
|
|
5195
|
+
const next = computeFormattingEdit({
|
|
5196
|
+
text: editing.body,
|
|
5197
|
+
selectionStart: field.selectionStart,
|
|
5198
|
+
selectionEnd: field.selectionEnd,
|
|
5199
|
+
action,
|
|
5200
|
+
maximumLength: BODY_MAX_LENGTH
|
|
5201
|
+
});
|
|
5202
|
+
if (!next) return;
|
|
5203
|
+
if (!replaceWithNativeUndo(field, editing.body, next.text) || field.value !== next.text) {
|
|
5204
|
+
updateField("body", next.text);
|
|
5205
|
+
}
|
|
5206
|
+
requestAnimationFrame(() => {
|
|
5207
|
+
field.focus();
|
|
5208
|
+
field.setSelectionRange(next.selectionStart, next.selectionEnd);
|
|
5209
|
+
});
|
|
5210
|
+
};
|
|
5211
|
+
const handleBodyKeyDown = (event) => {
|
|
5212
|
+
const action = formattingActionForShortcut({
|
|
5213
|
+
key: event.key,
|
|
5214
|
+
ctrlKey: event.ctrlKey,
|
|
5215
|
+
metaKey: event.metaKey,
|
|
5216
|
+
shiftKey: event.shiftKey,
|
|
5217
|
+
altKey: event.altKey,
|
|
5218
|
+
isComposing: event.nativeEvent.isComposing
|
|
5219
|
+
});
|
|
5220
|
+
if (!action) return;
|
|
5221
|
+
event.preventDefault();
|
|
5222
|
+
applyFormatting(action);
|
|
5223
|
+
};
|
|
5224
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("space-y-4", className), children: [
|
|
5225
|
+
/* @__PURE__ */ jsxs25("header", { className: "space-y-0.5", children: [
|
|
5226
|
+
/* @__PURE__ */ jsx28("h2", { className: "text-lg font-semibold", children: text.title }),
|
|
5227
|
+
/* @__PURE__ */ jsx28("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: text.subtitle(quickReplies.length) })
|
|
4979
5228
|
] }),
|
|
4980
|
-
readOnly ? /* @__PURE__ */
|
|
4981
|
-
/* @__PURE__ */
|
|
4982
|
-
/* @__PURE__ */
|
|
5229
|
+
readOnly ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: text.readOnlyNotice }) : null,
|
|
5230
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5231
|
+
/* @__PURE__ */ jsx28(
|
|
4983
5232
|
"input",
|
|
4984
5233
|
{
|
|
4985
5234
|
type: "search",
|
|
@@ -4990,158 +5239,176 @@ function QuickRepliesWorkspace({
|
|
|
4990
5239
|
className: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm dark:border-gray-700 dark:bg-gray-900 sm:w-64"
|
|
4991
5240
|
}
|
|
4992
5241
|
),
|
|
4993
|
-
!readOnly ? /* @__PURE__ */
|
|
5242
|
+
!readOnly ? /* @__PURE__ */ jsxs25(
|
|
4994
5243
|
"button",
|
|
4995
5244
|
{
|
|
4996
5245
|
type: "button",
|
|
4997
5246
|
onClick: startCreate,
|
|
4998
|
-
className: "cv-header-action ml-auto inline-flex items-center gap-1",
|
|
4999
|
-
children:
|
|
5247
|
+
className: "cv-header-action cv-header-action--primary ml-auto inline-flex items-center gap-1",
|
|
5248
|
+
children: [
|
|
5249
|
+
/* @__PURE__ */ jsx28(Plus2, { size: 14, "aria-hidden": "true" }),
|
|
5250
|
+
text.create
|
|
5251
|
+
]
|
|
5000
5252
|
}
|
|
5001
5253
|
) : null
|
|
5002
5254
|
] }),
|
|
5003
|
-
isLoading ? /* @__PURE__ */
|
|
5004
|
-
loadError ? /* @__PURE__ */
|
|
5005
|
-
editing ? /* @__PURE__ */
|
|
5255
|
+
isLoading ? /* @__PURE__ */ jsx28("span", { className: "sr-only", "aria-live": "polite", children: text.loading }) : null,
|
|
5256
|
+
loadError ? /* @__PURE__ */ jsx28("p", { role: "alert", className: "text-sm text-red-600 dark:text-red-400", children: loadError || text.failure }) : null,
|
|
5257
|
+
editing ? /* @__PURE__ */ jsxs25(
|
|
5006
5258
|
"form",
|
|
5007
5259
|
{
|
|
5008
|
-
className: "
|
|
5260
|
+
className: "grid gap-4 rounded-lg border border-gray-200 p-4 dark:border-gray-700 lg:grid-cols-[minmax(0,1fr)_minmax(0,22rem)]",
|
|
5009
5261
|
onSubmit: (event) => {
|
|
5010
5262
|
event.preventDefault();
|
|
5011
5263
|
void submit();
|
|
5012
5264
|
},
|
|
5013
5265
|
children: [
|
|
5014
|
-
/* @__PURE__ */
|
|
5015
|
-
/* @__PURE__ */
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
/* @__PURE__ */
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
/* @__PURE__ */
|
|
5050
|
-
|
|
5051
|
-
|
|
5266
|
+
/* @__PURE__ */ jsxs25("div", { className: "space-y-3", children: [
|
|
5267
|
+
/* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
|
|
5268
|
+
/* @__PURE__ */ jsx28("label", { className: "block text-sm font-medium", htmlFor: titleFieldId, children: text.fieldTitle }),
|
|
5269
|
+
/* @__PURE__ */ jsx28(
|
|
5270
|
+
"input",
|
|
5271
|
+
{
|
|
5272
|
+
id: titleFieldId,
|
|
5273
|
+
type: "text",
|
|
5274
|
+
maxLength: 40,
|
|
5275
|
+
value: editing.title,
|
|
5276
|
+
onChange: (event) => updateField("title", event.target.value),
|
|
5277
|
+
"aria-invalid": Boolean(fieldErrors.title),
|
|
5278
|
+
"aria-describedby": fieldErrors.title ? `${titleFieldId}-error` : void 0,
|
|
5279
|
+
className: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm dark:border-gray-700 dark:bg-gray-900"
|
|
5280
|
+
}
|
|
5281
|
+
),
|
|
5282
|
+
fieldErrors.title ? /* @__PURE__ */ jsx28("p", { id: `${titleFieldId}-error`, role: "alert", className: "text-xs text-red-600 dark:text-red-400", children: fieldErrors.title }) : null
|
|
5283
|
+
] }),
|
|
5284
|
+
/* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
|
|
5285
|
+
/* @__PURE__ */ jsx28("label", { className: "block text-sm font-medium", htmlFor: shortcutFieldId, children: text.fieldShortcut }),
|
|
5286
|
+
/* @__PURE__ */ jsx28(
|
|
5287
|
+
"input",
|
|
5288
|
+
{
|
|
5289
|
+
id: shortcutFieldId,
|
|
5290
|
+
type: "text",
|
|
5291
|
+
maxLength: 20,
|
|
5292
|
+
value: editing.shortcut,
|
|
5293
|
+
onChange: (event) => updateField("shortcut", event.target.value),
|
|
5294
|
+
"aria-invalid": Boolean(fieldErrors.shortcut),
|
|
5295
|
+
"aria-describedby": fieldErrors.shortcut ? `${shortcutFieldId}-error` : `${shortcutFieldId}-hint`,
|
|
5296
|
+
className: "w-full rounded-md border border-gray-300 px-3 py-2 text-sm font-mono dark:border-gray-700 dark:bg-gray-900"
|
|
5297
|
+
}
|
|
5298
|
+
),
|
|
5299
|
+
fieldErrors.shortcut ? /* @__PURE__ */ jsx28("p", { id: `${shortcutFieldId}-error`, role: "alert", className: "text-xs text-red-600 dark:text-red-400", children: fieldErrors.shortcut }) : /* @__PURE__ */ jsx28("p", { id: `${shortcutFieldId}-hint`, className: "text-xs text-gray-400", children: text.fieldShortcutHint })
|
|
5300
|
+
] }),
|
|
5301
|
+
/* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
|
|
5302
|
+
/* @__PURE__ */ jsx28("label", { className: "block text-sm font-medium", htmlFor: bodyFieldId, children: text.fieldBody }),
|
|
5303
|
+
/* @__PURE__ */ jsx28(QuickReplyFormattingToolbar, { labels: text, onFormat: applyFormatting }),
|
|
5304
|
+
/* @__PURE__ */ jsx28(
|
|
5305
|
+
"textarea",
|
|
5306
|
+
{
|
|
5307
|
+
id: bodyFieldId,
|
|
5308
|
+
ref: bodyFieldRef,
|
|
5309
|
+
maxLength: BODY_MAX_LENGTH,
|
|
5310
|
+
rows: 4,
|
|
5311
|
+
value: editing.body,
|
|
5312
|
+
onChange: (event) => updateField("body", event.target.value),
|
|
5313
|
+
onKeyDown: handleBodyKeyDown,
|
|
5314
|
+
"aria-invalid": Boolean(fieldErrors.body),
|
|
5315
|
+
"aria-describedby": fieldErrors.body ? `${bodyFieldId}-error` : void 0,
|
|
5316
|
+
className: "w-full resize-none rounded-md border border-gray-300 px-3 py-2 text-sm dark:border-gray-700 dark:bg-gray-900"
|
|
5317
|
+
}
|
|
5318
|
+
),
|
|
5319
|
+
fieldErrors.body ? /* @__PURE__ */ jsx28("p", { id: `${bodyFieldId}-error`, role: "alert", className: "text-xs text-red-600 dark:text-red-400", children: fieldErrors.body }) : null,
|
|
5320
|
+
variables && variables.length > 0 ? /* @__PURE__ */ jsx28("div", { className: "flex flex-wrap gap-1 pt-1", children: variables.map((variable) => /* @__PURE__ */ jsx28(
|
|
5321
|
+
"button",
|
|
5322
|
+
{
|
|
5323
|
+
type: "button",
|
|
5324
|
+
onClick: () => insertVariableAtCursor(variable.marker),
|
|
5325
|
+
"aria-label": `${text.insertVariable}: ${variable.label}`,
|
|
5326
|
+
className: "rounded-full border border-gray-200 px-2 py-0.5 text-xs text-gray-600 hover:bg-gray-100 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800",
|
|
5327
|
+
children: variable.label
|
|
5328
|
+
},
|
|
5329
|
+
variable.id
|
|
5330
|
+
)) }) : null
|
|
5331
|
+
] }),
|
|
5332
|
+
hasAttachmentsCapability ? /* @__PURE__ */ jsx28(
|
|
5333
|
+
AttachmentsFormSection,
|
|
5052
5334
|
{
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5335
|
+
labels: text,
|
|
5336
|
+
attachments: editing.attachments,
|
|
5337
|
+
pendingUploads,
|
|
5338
|
+
attachmentRejections,
|
|
5339
|
+
onAddFiles: addAttachmentFiles,
|
|
5340
|
+
onRetryUpload: retryAttachmentUpload,
|
|
5341
|
+
onCancelUpload: cancelAttachmentUpload,
|
|
5342
|
+
onRemoveAttachment: removeAttachment,
|
|
5343
|
+
onMoveAttachment: moveAttachmentAt,
|
|
5344
|
+
onDismissRejections: dismissAttachmentRejections
|
|
5062
5345
|
}
|
|
5063
|
-
),
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5346
|
+
) : null,
|
|
5347
|
+
saveError ? /* @__PURE__ */ jsx28("p", { role: "alert", className: "text-sm text-red-600 dark:text-red-400", children: saveError }) : null,
|
|
5348
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
5349
|
+
/* @__PURE__ */ jsx28(
|
|
5350
|
+
"button",
|
|
5351
|
+
{
|
|
5352
|
+
type: "submit",
|
|
5353
|
+
disabled: isSaving || hasPendingUploads,
|
|
5354
|
+
"aria-busy": isSaving,
|
|
5355
|
+
title: hasPendingUploads ? text.saveBlockedUploading : void 0,
|
|
5356
|
+
className: "cv-header-action inline-flex items-center gap-1 disabled:opacity-40",
|
|
5357
|
+
children: isSaving ? text.saving : hasPendingUploads ? text.saveBlockedUploading : text.save
|
|
5358
|
+
}
|
|
5359
|
+
),
|
|
5360
|
+
/* @__PURE__ */ jsx28("button", { type: "button", onClick: cancelEdit, className: "text-sm text-gray-500 hover:underline", children: text.cancel })
|
|
5361
|
+
] })
|
|
5076
5362
|
] }),
|
|
5077
|
-
|
|
5078
|
-
|
|
5363
|
+
/* @__PURE__ */ jsx28(
|
|
5364
|
+
QuickReplyWhatsAppPreview,
|
|
5079
5365
|
{
|
|
5080
|
-
|
|
5366
|
+
body: editing.body,
|
|
5367
|
+
...variables ? { variables } : {},
|
|
5081
5368
|
attachments: editing.attachments,
|
|
5082
|
-
|
|
5083
|
-
attachmentRejections,
|
|
5084
|
-
onAddFiles: addAttachmentFiles,
|
|
5085
|
-
onRetryUpload: retryAttachmentUpload,
|
|
5086
|
-
onCancelUpload: cancelAttachmentUpload,
|
|
5087
|
-
onRemoveAttachment: removeAttachment,
|
|
5088
|
-
onMoveAttachment: moveAttachmentAt,
|
|
5089
|
-
onDismissRejections: dismissAttachmentRejections
|
|
5369
|
+
labels: text
|
|
5090
5370
|
}
|
|
5091
|
-
)
|
|
5092
|
-
saveError ? /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-sm text-red-600 dark:text-red-400", children: saveError }) : null,
|
|
5093
|
-
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2", children: [
|
|
5094
|
-
/* @__PURE__ */ jsx26(
|
|
5095
|
-
"button",
|
|
5096
|
-
{
|
|
5097
|
-
type: "submit",
|
|
5098
|
-
disabled: isSaving || hasPendingUploads,
|
|
5099
|
-
"aria-busy": isSaving,
|
|
5100
|
-
title: hasPendingUploads ? text.saveBlockedUploading : void 0,
|
|
5101
|
-
className: "cv-header-action inline-flex items-center gap-1 disabled:opacity-40",
|
|
5102
|
-
children: isSaving ? text.saving : hasPendingUploads ? text.saveBlockedUploading : text.save
|
|
5103
|
-
}
|
|
5104
|
-
),
|
|
5105
|
-
/* @__PURE__ */ jsx26("button", { type: "button", onClick: cancelEdit, className: "text-sm text-gray-500 hover:underline", children: text.cancel })
|
|
5106
|
-
] })
|
|
5371
|
+
)
|
|
5107
5372
|
]
|
|
5108
5373
|
}
|
|
5109
5374
|
) : null,
|
|
5110
|
-
/* @__PURE__ */
|
|
5111
|
-
/* @__PURE__ */
|
|
5112
|
-
/* @__PURE__ */
|
|
5113
|
-
/* @__PURE__ */
|
|
5114
|
-
/* @__PURE__ */
|
|
5115
|
-
!readOnly ? /* @__PURE__ */
|
|
5375
|
+
/* @__PURE__ */ jsx28("div", { className: "cv-table-card", children: /* @__PURE__ */ jsxs25("table", { className: "cv-table", children: [
|
|
5376
|
+
/* @__PURE__ */ jsx28("thead", { children: /* @__PURE__ */ jsxs25("tr", { children: [
|
|
5377
|
+
/* @__PURE__ */ jsx28("th", { scope: "col", className: "px-3 py-2 text-left text-xs font-medium", children: text.columnTitle }),
|
|
5378
|
+
/* @__PURE__ */ jsx28("th", { scope: "col", className: "px-3 py-2 text-left text-xs font-medium", children: text.columnShortcut }),
|
|
5379
|
+
/* @__PURE__ */ jsx28("th", { scope: "col", className: "hidden px-3 py-2 text-left text-xs font-medium sm:table-cell", children: text.columnBody }),
|
|
5380
|
+
!readOnly ? /* @__PURE__ */ jsx28("th", { scope: "col", className: "px-3 py-2 text-left text-xs font-medium", children: text.columnActions }) : null
|
|
5116
5381
|
] }) }),
|
|
5117
|
-
/* @__PURE__ */
|
|
5118
|
-
isLoading ? Array.from({ length: TABLE_SKELETON_ROWS }).map((_, index) => /* @__PURE__ */
|
|
5119
|
-
/* @__PURE__ */
|
|
5120
|
-
/* @__PURE__ */
|
|
5121
|
-
/* @__PURE__ */
|
|
5122
|
-
!readOnly ? /* @__PURE__ */
|
|
5123
|
-
] }, index)) : filtered.length === 0 ? /* @__PURE__ */
|
|
5124
|
-
!isLoading && filtered.map((quickReply) => /* @__PURE__ */
|
|
5125
|
-
/* @__PURE__ */
|
|
5126
|
-
/* @__PURE__ */
|
|
5382
|
+
/* @__PURE__ */ jsxs25("tbody", { children: [
|
|
5383
|
+
isLoading ? Array.from({ length: TABLE_SKELETON_ROWS }).map((_, index) => /* @__PURE__ */ jsxs25("tr", { "aria-hidden": "true", children: [
|
|
5384
|
+
/* @__PURE__ */ jsx28("td", { className: "px-3 py-3", children: /* @__PURE__ */ jsx28("span", { className: "cv-skeleton-line cv-skeleton-line--title block" }) }),
|
|
5385
|
+
/* @__PURE__ */ jsx28("td", { className: "px-3 py-3", children: /* @__PURE__ */ jsx28("span", { className: "cv-skeleton-line cv-skeleton-line--shortcut block" }) }),
|
|
5386
|
+
/* @__PURE__ */ jsx28("td", { className: "hidden px-3 py-3 sm:table-cell", children: /* @__PURE__ */ jsx28("span", { className: "cv-skeleton-line cv-skeleton-line--body block" }) }),
|
|
5387
|
+
!readOnly ? /* @__PURE__ */ jsx28("td", { className: "px-3 py-3" }) : null
|
|
5388
|
+
] }, index)) : filtered.length === 0 ? /* @__PURE__ */ jsx28("tr", { children: /* @__PURE__ */ jsx28("td", { colSpan: 4, className: "px-3 py-4 text-center text-sm text-gray-500 dark:text-gray-400", children: search.trim() ? text.noResults : text.empty }) }) : null,
|
|
5389
|
+
!isLoading && filtered.map((quickReply) => /* @__PURE__ */ jsxs25("tr", { className: cn(deletingId === quickReply.id ? "cv-row-departing" : void 0), children: [
|
|
5390
|
+
/* @__PURE__ */ jsx28("td", { className: "px-3 py-2 font-medium", children: quickReply.title }),
|
|
5391
|
+
/* @__PURE__ */ jsxs25("td", { className: "px-3 py-2 font-mono text-xs text-gray-500", children: [
|
|
5127
5392
|
"/",
|
|
5128
5393
|
quickReply.shortcut
|
|
5129
5394
|
] }),
|
|
5130
|
-
/* @__PURE__ */
|
|
5131
|
-
!readOnly ? /* @__PURE__ */
|
|
5132
|
-
canEdit ? /* @__PURE__ */
|
|
5395
|
+
/* @__PURE__ */ jsx28("td", { className: "hidden max-w-sm truncate px-3 py-2 text-gray-500 sm:table-cell", children: quickReply.body }),
|
|
5396
|
+
!readOnly ? /* @__PURE__ */ jsx28("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-1", children: [
|
|
5397
|
+
canEdit ? /* @__PURE__ */ jsx28(
|
|
5133
5398
|
"button",
|
|
5134
5399
|
{
|
|
5135
5400
|
type: "button",
|
|
5136
5401
|
onClick: () => startEdit(quickReply),
|
|
5137
|
-
|
|
5138
|
-
|
|
5402
|
+
"data-cv-tooltip": text.edit,
|
|
5403
|
+
"aria-label": `${text.edit}: ${quickReply.title}`,
|
|
5404
|
+
className: "cv-header-icon",
|
|
5405
|
+
children: /* @__PURE__ */ jsx28(Pencil2, { size: 14, "aria-hidden": "true" })
|
|
5139
5406
|
}
|
|
5140
5407
|
) : null,
|
|
5141
5408
|
canDelete ? confirmingDeleteId === quickReply.id ? (
|
|
5142
5409
|
// Linha de confirmação inline em vez de `window.confirm`: trava a aba
|
|
5143
5410
|
// inteira e não segue os tokens visuais do pacote (`web.md` §14).
|
|
5144
|
-
/* @__PURE__ */
|
|
5411
|
+
/* @__PURE__ */ jsxs25(
|
|
5145
5412
|
"span",
|
|
5146
5413
|
{
|
|
5147
5414
|
role: "group",
|
|
@@ -5150,7 +5417,7 @@ function QuickRepliesWorkspace({
|
|
|
5150
5417
|
className: "flex items-center gap-2 text-xs",
|
|
5151
5418
|
children: [
|
|
5152
5419
|
text.removeConfirm(quickReply.title),
|
|
5153
|
-
/* @__PURE__ */
|
|
5420
|
+
/* @__PURE__ */ jsxs25(
|
|
5154
5421
|
"button",
|
|
5155
5422
|
{
|
|
5156
5423
|
ref: confirmButtonRef,
|
|
@@ -5159,23 +5426,26 @@ function QuickRepliesWorkspace({
|
|
|
5159
5426
|
setConfirmingDeleteId(null);
|
|
5160
5427
|
void remove(quickReply.id);
|
|
5161
5428
|
},
|
|
5162
|
-
className: "
|
|
5163
|
-
children:
|
|
5429
|
+
className: "cv-header-action cv-header-action--danger inline-flex items-center gap-1",
|
|
5430
|
+
children: [
|
|
5431
|
+
/* @__PURE__ */ jsx28(Trash23, { size: 12, "aria-hidden": "true" }),
|
|
5432
|
+
text.remove
|
|
5433
|
+
]
|
|
5164
5434
|
}
|
|
5165
5435
|
),
|
|
5166
|
-
/* @__PURE__ */
|
|
5436
|
+
/* @__PURE__ */ jsx28(
|
|
5167
5437
|
"button",
|
|
5168
5438
|
{
|
|
5169
5439
|
type: "button",
|
|
5170
5440
|
onClick: () => cancelDeleteConfirm(quickReply.id),
|
|
5171
|
-
className: "
|
|
5441
|
+
className: "cv-header-action",
|
|
5172
5442
|
children: text.cancel
|
|
5173
5443
|
}
|
|
5174
5444
|
)
|
|
5175
5445
|
]
|
|
5176
5446
|
}
|
|
5177
5447
|
)
|
|
5178
|
-
) : /* @__PURE__ */
|
|
5448
|
+
) : /* @__PURE__ */ jsx28(
|
|
5179
5449
|
"button",
|
|
5180
5450
|
{
|
|
5181
5451
|
ref: (node) => {
|
|
@@ -5185,11 +5455,13 @@ function QuickRepliesWorkspace({
|
|
|
5185
5455
|
disabled: deletingId === quickReply.id,
|
|
5186
5456
|
"aria-busy": deletingId === quickReply.id,
|
|
5187
5457
|
onClick: () => setConfirmingDeleteId(quickReply.id),
|
|
5188
|
-
|
|
5189
|
-
|
|
5458
|
+
"data-cv-tooltip": deletingId === quickReply.id ? text.deleting : text.remove,
|
|
5459
|
+
"aria-label": `${deletingId === quickReply.id ? text.deleting : text.remove}: ${quickReply.title}`,
|
|
5460
|
+
className: "cv-header-icon disabled:opacity-40",
|
|
5461
|
+
children: /* @__PURE__ */ jsx28(Trash23, { size: 14, "aria-hidden": "true", className: "text-red-500" })
|
|
5190
5462
|
}
|
|
5191
5463
|
) : null
|
|
5192
|
-
] }) : null
|
|
5464
|
+
] }) }) : null
|
|
5193
5465
|
] }, quickReply.id))
|
|
5194
5466
|
] })
|
|
5195
5467
|
] }) })
|
|
@@ -5202,7 +5474,7 @@ import { Check as Check2, CheckCheck, FlaskConical, Hourglass as Hourglass2, Mai
|
|
|
5202
5474
|
|
|
5203
5475
|
// src/workspace/BulkTemplateModal.tsx
|
|
5204
5476
|
import { useEffect as useEffect14, useMemo as useMemo4, useState as useState19 } from "react";
|
|
5205
|
-
import { jsx as
|
|
5477
|
+
import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5206
5478
|
function BulkTemplateModal({
|
|
5207
5479
|
labels,
|
|
5208
5480
|
expiredCount,
|
|
@@ -5233,15 +5505,15 @@ function BulkTemplateModal({
|
|
|
5233
5505
|
if (!term) return templates;
|
|
5234
5506
|
return templates.filter((template) => template.name.toLowerCase().includes(term));
|
|
5235
5507
|
}, [templates, search]);
|
|
5236
|
-
return /* @__PURE__ */
|
|
5237
|
-
/* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5239
|
-
/* @__PURE__ */
|
|
5240
|
-
/* @__PURE__ */
|
|
5508
|
+
return /* @__PURE__ */ jsx29("div", { className: "cv-workspace-modal", role: "dialog", "aria-modal": "true", "aria-label": labels.templateModalTitle, children: /* @__PURE__ */ jsxs26("div", { className: "cv-workspace-modal__box", children: [
|
|
5509
|
+
/* @__PURE__ */ jsxs26("header", { className: "cv-workspace-modal__header", children: [
|
|
5510
|
+
/* @__PURE__ */ jsxs26("div", { children: [
|
|
5511
|
+
/* @__PURE__ */ jsx29("h3", { children: labels.templateModalTitle }),
|
|
5512
|
+
/* @__PURE__ */ jsx29("p", { children: labels.templateModalAvailable(templates.length) })
|
|
5241
5513
|
] }),
|
|
5242
|
-
/* @__PURE__ */
|
|
5514
|
+
/* @__PURE__ */ jsx29("button", { "data-cv-tooltip": labels.templateModalCancel, type: "button", onClick: onClose, "aria-label": labels.templateModalCancel, children: "\u2715" })
|
|
5243
5515
|
] }),
|
|
5244
|
-
/* @__PURE__ */
|
|
5516
|
+
/* @__PURE__ */ jsx29("div", { className: "cv-workspace-modal__search", children: /* @__PURE__ */ jsx29(
|
|
5245
5517
|
"input",
|
|
5246
5518
|
{
|
|
5247
5519
|
type: "search",
|
|
@@ -5251,9 +5523,9 @@ function BulkTemplateModal({
|
|
|
5251
5523
|
autoFocus: true
|
|
5252
5524
|
}
|
|
5253
5525
|
) }),
|
|
5254
|
-
/* @__PURE__ */
|
|
5255
|
-
filtered.length === 0 ? /* @__PURE__ */
|
|
5256
|
-
filtered.map((template) => /* @__PURE__ */
|
|
5526
|
+
/* @__PURE__ */ jsxs26("div", { className: "cv-workspace-modal__list", children: [
|
|
5527
|
+
filtered.length === 0 ? /* @__PURE__ */ jsx29("p", { className: "cv-workspace-empty", children: labels.templateModalEmpty }) : null,
|
|
5528
|
+
filtered.map((template) => /* @__PURE__ */ jsxs26(
|
|
5257
5529
|
"button",
|
|
5258
5530
|
{
|
|
5259
5531
|
"data-cv-tooltip": template.name,
|
|
@@ -5263,8 +5535,8 @@ function BulkTemplateModal({
|
|
|
5263
5535
|
"aria-pressed": template.name === selected,
|
|
5264
5536
|
className: `cv-workspace-modal__item${template.name === selected ? " cv-workspace-modal__item--on" : ""}`,
|
|
5265
5537
|
children: [
|
|
5266
|
-
/* @__PURE__ */
|
|
5267
|
-
/* @__PURE__ */
|
|
5538
|
+
/* @__PURE__ */ jsx29("span", { className: "cv-workspace-modal__item-name", children: template.name }),
|
|
5539
|
+
/* @__PURE__ */ jsxs26("span", { className: "cv-workspace-modal__item-meta", children: [
|
|
5268
5540
|
template.language,
|
|
5269
5541
|
template.category ? ` \xB7 ${template.category.toLowerCase()}` : ""
|
|
5270
5542
|
] })
|
|
@@ -5273,10 +5545,10 @@ function BulkTemplateModal({
|
|
|
5273
5545
|
template.name
|
|
5274
5546
|
))
|
|
5275
5547
|
] }),
|
|
5276
|
-
expiredCount === 0 ? /* @__PURE__ */
|
|
5277
|
-
/* @__PURE__ */
|
|
5278
|
-
/* @__PURE__ */
|
|
5279
|
-
/* @__PURE__ */
|
|
5548
|
+
expiredCount === 0 ? /* @__PURE__ */ jsx29("p", { className: "cv-workspace-modal__warning", children: labels.templateModalNoneExpired }) : null,
|
|
5549
|
+
/* @__PURE__ */ jsxs26("footer", { className: "cv-workspace-modal__footer", children: [
|
|
5550
|
+
/* @__PURE__ */ jsx29("button", { "data-cv-tooltip": labels.templateModalCancel, "aria-label": labels.templateModalCancel, type: "button", onClick: onClose, children: labels.templateModalCancel }),
|
|
5551
|
+
/* @__PURE__ */ jsx29(
|
|
5280
5552
|
"button",
|
|
5281
5553
|
{
|
|
5282
5554
|
"data-cv-tooltip": sending ? labels.templateModalSending : labels.templateModalSend(expiredCount),
|
|
@@ -5314,7 +5586,7 @@ function resolveConversationVariables({
|
|
|
5314
5586
|
|
|
5315
5587
|
// src/workspace/QueuedAttachmentsList.tsx
|
|
5316
5588
|
import { useEffect as useEffect15, useRef as useRef12, useState as useState20 } from "react";
|
|
5317
|
-
import { jsx as
|
|
5589
|
+
import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5318
5590
|
function nameOf(item) {
|
|
5319
5591
|
return item.kind === "local" ? item.file.name : item.filename;
|
|
5320
5592
|
}
|
|
@@ -5349,7 +5621,7 @@ function AttachmentThumbnail({
|
|
|
5349
5621
|
};
|
|
5350
5622
|
}, [isImage, uploadId, getThumbnailUrl]);
|
|
5351
5623
|
if (!isImage) return null;
|
|
5352
|
-
return /* @__PURE__ */
|
|
5624
|
+
return /* @__PURE__ */ jsx30("span", { className: "cv-attachment-item__thumbnail", "aria-hidden": "true", children: url ? /* @__PURE__ */ jsx30("img", { src: url, alt: "" }) : null });
|
|
5353
5625
|
}
|
|
5354
5626
|
function departedItemsOf(previouslyRendered, items) {
|
|
5355
5627
|
const currentKeys = new Set(items.map(attachmentKey));
|
|
@@ -5396,25 +5668,25 @@ function QueuedAttachmentsList({
|
|
|
5396
5668
|
if (status === "skipped") return labels.skipped;
|
|
5397
5669
|
return labels.waiting;
|
|
5398
5670
|
};
|
|
5399
|
-
return /* @__PURE__ */
|
|
5671
|
+
return /* @__PURE__ */ jsx30("ul", { className: "cv-workspace-attachments", "aria-busy": busy, "aria-live": "polite", children: rendered.map((item) => {
|
|
5400
5672
|
const key = attachmentKey(item);
|
|
5401
5673
|
const status = statusOf2(key);
|
|
5402
5674
|
const isDeparting = departingKeys.has(key);
|
|
5403
|
-
return /* @__PURE__ */
|
|
5675
|
+
return /* @__PURE__ */ jsxs27(
|
|
5404
5676
|
"li",
|
|
5405
5677
|
{
|
|
5406
5678
|
className: `cv-attachment-item cv-attachment-item--${status}${isDeparting ? " cv-attachment-item--departing" : ""}`,
|
|
5407
5679
|
children: [
|
|
5408
|
-
/* @__PURE__ */
|
|
5409
|
-
/* @__PURE__ */
|
|
5410
|
-
/* @__PURE__ */
|
|
5411
|
-
/* @__PURE__ */
|
|
5680
|
+
/* @__PURE__ */ jsx30(AttachmentThumbnail, { item, getThumbnailUrl }),
|
|
5681
|
+
/* @__PURE__ */ jsxs27("span", { className: "cv-attachment-item__info", children: [
|
|
5682
|
+
/* @__PURE__ */ jsx30("span", { className: "cv-attachment-item__name", children: nameOf(item) }),
|
|
5683
|
+
/* @__PURE__ */ jsxs27("span", { className: "cv-attachment-item__meta", children: [
|
|
5412
5684
|
formatFileSize(sizeOf(item)),
|
|
5413
5685
|
" \xB7 ",
|
|
5414
5686
|
statusLabelOf(status)
|
|
5415
5687
|
] })
|
|
5416
5688
|
] }),
|
|
5417
|
-
(status === "failed" || status === "skipped") && onRetry ? /* @__PURE__ */
|
|
5689
|
+
(status === "failed" || status === "skipped") && onRetry ? /* @__PURE__ */ jsx30(
|
|
5418
5690
|
"button",
|
|
5419
5691
|
{
|
|
5420
5692
|
type: "button",
|
|
@@ -5425,7 +5697,7 @@ function QueuedAttachmentsList({
|
|
|
5425
5697
|
children: labels.retry
|
|
5426
5698
|
}
|
|
5427
5699
|
) : null,
|
|
5428
|
-
/* @__PURE__ */
|
|
5700
|
+
/* @__PURE__ */ jsx30(
|
|
5429
5701
|
"button",
|
|
5430
5702
|
{
|
|
5431
5703
|
"data-cv-tooltip": labels.remove,
|
|
@@ -5687,7 +5959,7 @@ function useComposerQueue(params) {
|
|
|
5687
5959
|
}
|
|
5688
5960
|
|
|
5689
5961
|
// src/workspace/ConversationPane.tsx
|
|
5690
|
-
import { jsx as
|
|
5962
|
+
import { jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5691
5963
|
function ConversationPane({
|
|
5692
5964
|
conversation,
|
|
5693
5965
|
now,
|
|
@@ -5840,8 +6112,8 @@ function ConversationPane({
|
|
|
5840
6112
|
}
|
|
5841
6113
|
} : void 0;
|
|
5842
6114
|
const botOwnsConversation = Boolean(requireTakeoverToReply) && conversation.mode !== "human";
|
|
5843
|
-
return /* @__PURE__ */
|
|
5844
|
-
/* @__PURE__ */
|
|
6115
|
+
return /* @__PURE__ */ jsxs28("div", { className: "cv-workspace-pane", children: [
|
|
6116
|
+
/* @__PURE__ */ jsx31(
|
|
5845
6117
|
ConversationHeader,
|
|
5846
6118
|
{
|
|
5847
6119
|
conversation,
|
|
@@ -5856,10 +6128,10 @@ function ConversationPane({
|
|
|
5856
6128
|
...extraUtilities ? { extraUtilities } : {}
|
|
5857
6129
|
}
|
|
5858
6130
|
),
|
|
5859
|
-
contextEntries && contextEntries.length > 0 || flowLabel ? /* @__PURE__ */
|
|
5860
|
-
/* @__PURE__ */
|
|
6131
|
+
contextEntries && contextEntries.length > 0 || flowLabel ? /* @__PURE__ */ jsx31(ConversationContextPanel, { entries: contextEntries ?? [], ...flowLabel ? { flowLabel } : {} }) : null,
|
|
6132
|
+
/* @__PURE__ */ jsx31(ConversationDocumentsPanel, { conversationId: conversation.id, open: documentsOpen }),
|
|
5861
6133
|
renderAboveTranscript?.(conversation, conversationContext),
|
|
5862
|
-
/* @__PURE__ */
|
|
6134
|
+
/* @__PURE__ */ jsx31(
|
|
5863
6135
|
ConversationWallpaper,
|
|
5864
6136
|
{
|
|
5865
6137
|
ref: scroll.containerRef,
|
|
@@ -5868,9 +6140,9 @@ function ConversationPane({
|
|
|
5868
6140
|
children: messages.map((message, index) => {
|
|
5869
6141
|
const previous = index > 0 ? messages[index - 1] : void 0;
|
|
5870
6142
|
const startsNewDay = !previous || new Date(message.timestamp).toDateString() !== new Date(previous.timestamp).toDateString();
|
|
5871
|
-
return /* @__PURE__ */
|
|
5872
|
-
startsNewDay ? /* @__PURE__ */
|
|
5873
|
-
/* @__PURE__ */
|
|
6143
|
+
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
6144
|
+
startsNewDay ? /* @__PURE__ */ jsx31(DateDivider, { iso: message.timestamp }) : null,
|
|
6145
|
+
/* @__PURE__ */ jsx31(
|
|
5874
6146
|
MessageBubble,
|
|
5875
6147
|
{
|
|
5876
6148
|
message,
|
|
@@ -5887,10 +6159,10 @@ function ConversationPane({
|
|
|
5887
6159
|
})
|
|
5888
6160
|
}
|
|
5889
6161
|
),
|
|
5890
|
-
messageSelection && selectedMessageIds.size > 0 ? /* @__PURE__ */
|
|
5891
|
-
/* @__PURE__ */
|
|
5892
|
-
/* @__PURE__ */
|
|
5893
|
-
/* @__PURE__ */
|
|
6162
|
+
messageSelection && selectedMessageIds.size > 0 ? /* @__PURE__ */ jsxs28("div", { className: "cv-workspace-selection", children: [
|
|
6163
|
+
/* @__PURE__ */ jsx31("span", { children: labels.messagesSelected(selectedMessageIds.size) }),
|
|
6164
|
+
/* @__PURE__ */ jsxs28("div", { className: "cv-workspace-selection__actions", children: [
|
|
6165
|
+
/* @__PURE__ */ jsx31(
|
|
5894
6166
|
"button",
|
|
5895
6167
|
{
|
|
5896
6168
|
"data-cv-tooltip": labels.bulkClear,
|
|
@@ -5900,7 +6172,7 @@ function ConversationPane({
|
|
|
5900
6172
|
children: labels.bulkClear
|
|
5901
6173
|
}
|
|
5902
6174
|
),
|
|
5903
|
-
/* @__PURE__ */
|
|
6175
|
+
/* @__PURE__ */ jsx31(
|
|
5904
6176
|
"button",
|
|
5905
6177
|
{
|
|
5906
6178
|
"data-cv-tooltip": labels.copySelected,
|
|
@@ -5912,11 +6184,11 @@ function ConversationPane({
|
|
|
5912
6184
|
)
|
|
5913
6185
|
] })
|
|
5914
6186
|
] }) : null,
|
|
5915
|
-
sendFailure ? /* @__PURE__ */
|
|
5916
|
-
blocked ? /* @__PURE__ */
|
|
6187
|
+
sendFailure ? /* @__PURE__ */ jsx31("p", { role: "alert", className: "cv-workspace-alert", children: sendFailure }) : null,
|
|
6188
|
+
blocked ? /* @__PURE__ */ jsx31(WindowExpiredNotice, { disabled: busy, onSendTemplate: () => void handleSendTemplate() }) : botOwnsConversation ? (
|
|
5917
6189
|
// Responder com a conversa no bot atropelaria o fluxo automático no meio de uma pergunta.
|
|
5918
|
-
/* @__PURE__ */
|
|
5919
|
-
) : composer === "rich" ? /* @__PURE__ */
|
|
6190
|
+
/* @__PURE__ */ jsx31("p", { className: "cv-workspace-notice", children: labels.takeoverToReply })
|
|
6191
|
+
) : composer === "rich" ? /* @__PURE__ */ jsx31(
|
|
5920
6192
|
RichMessageComposer,
|
|
5921
6193
|
{
|
|
5922
6194
|
value: draft,
|
|
@@ -5937,7 +6209,7 @@ function ConversationPane({
|
|
|
5937
6209
|
isSending: busy || isSendingDraft,
|
|
5938
6210
|
hasQueuedAttachments: queue.length > 0,
|
|
5939
6211
|
...onRecordAudio ? {
|
|
5940
|
-
idleAction: /* @__PURE__ */
|
|
6212
|
+
idleAction: /* @__PURE__ */ jsx31(
|
|
5941
6213
|
AudioRecorderButton,
|
|
5942
6214
|
{
|
|
5943
6215
|
onRecorded: (file) => void runSend(() => onRecordAudio(file), labels.recordFailure),
|
|
@@ -5946,7 +6218,7 @@ function ConversationPane({
|
|
|
5946
6218
|
)
|
|
5947
6219
|
} : {},
|
|
5948
6220
|
...queue.length > 0 ? {
|
|
5949
|
-
attachmentsPreview: /* @__PURE__ */
|
|
6221
|
+
attachmentsPreview: /* @__PURE__ */ jsx31(
|
|
5950
6222
|
QueuedAttachmentsList,
|
|
5951
6223
|
{
|
|
5952
6224
|
items: queue,
|
|
@@ -5972,7 +6244,7 @@ function ConversationPane({
|
|
|
5972
6244
|
...composerVariables ? { variables: [...composerVariables] } : {},
|
|
5973
6245
|
...savedQuickReplies ? { savedQuickReplies } : {}
|
|
5974
6246
|
}
|
|
5975
|
-
) : /* @__PURE__ */
|
|
6247
|
+
) : /* @__PURE__ */ jsx31(
|
|
5976
6248
|
MessageComposer,
|
|
5977
6249
|
{
|
|
5978
6250
|
value: draft,
|
|
@@ -5989,7 +6261,7 @@ function ConversationPane({
|
|
|
5989
6261
|
}
|
|
5990
6262
|
|
|
5991
6263
|
// src/workspace/ConversationsInboxList.tsx
|
|
5992
|
-
import { jsx as
|
|
6264
|
+
import { jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5993
6265
|
function ConversationsInboxList({
|
|
5994
6266
|
inbox,
|
|
5995
6267
|
labels,
|
|
@@ -6000,13 +6272,13 @@ function ConversationsInboxList({
|
|
|
6000
6272
|
onSendTemplateToSelected
|
|
6001
6273
|
}) {
|
|
6002
6274
|
const hasSelection = inbox.selectedIds.size > 0;
|
|
6003
|
-
return /* @__PURE__ */
|
|
6004
|
-
hasSelection ? /* @__PURE__ */
|
|
6005
|
-
/* @__PURE__ */
|
|
6006
|
-
/* @__PURE__ */
|
|
6007
|
-
/* @__PURE__ */
|
|
6008
|
-
onSendTemplateToSelected ? /* @__PURE__ */
|
|
6009
|
-
inbox.canFinalize ? /* @__PURE__ */
|
|
6275
|
+
return /* @__PURE__ */ jsxs29("aside", { className, children: [
|
|
6276
|
+
hasSelection ? /* @__PURE__ */ jsxs29("div", { className: "cv-workspace-bulk", children: [
|
|
6277
|
+
/* @__PURE__ */ jsx32("span", { className: "cv-workspace-bulk__count", children: labels.bulkSelected(inbox.selectedIds.size) }),
|
|
6278
|
+
/* @__PURE__ */ jsxs29("div", { className: "cv-workspace-bulk__actions", children: [
|
|
6279
|
+
/* @__PURE__ */ jsx32("button", { "data-cv-tooltip": labels.bulkClear, "aria-label": labels.bulkClear, type: "button", onClick: inbox.clearBulkSelection, children: labels.bulkClear }),
|
|
6280
|
+
onSendTemplateToSelected ? /* @__PURE__ */ jsx32("button", { "data-cv-tooltip": labels.bulkTemplate, "aria-label": labels.bulkTemplate, type: "button", onClick: onSendTemplateToSelected, disabled: inbox.busy, children: labels.bulkTemplate }) : null,
|
|
6281
|
+
inbox.canFinalize ? /* @__PURE__ */ jsx32(
|
|
6010
6282
|
"button",
|
|
6011
6283
|
{
|
|
6012
6284
|
"data-cv-tooltip": labels.bulkFinalize,
|
|
@@ -6024,8 +6296,8 @@ function ConversationsInboxList({
|
|
|
6024
6296
|
renderBulkActions?.(inbox)
|
|
6025
6297
|
] })
|
|
6026
6298
|
] }) : null,
|
|
6027
|
-
/* @__PURE__ */
|
|
6028
|
-
/* @__PURE__ */
|
|
6299
|
+
/* @__PURE__ */ jsxs29("div", { className: "cv-workspace-filters", children: [
|
|
6300
|
+
/* @__PURE__ */ jsx32(
|
|
6029
6301
|
"input",
|
|
6030
6302
|
{
|
|
6031
6303
|
type: "search",
|
|
@@ -6035,9 +6307,9 @@ function ConversationsInboxList({
|
|
|
6035
6307
|
className: "cv-workspace-search"
|
|
6036
6308
|
}
|
|
6037
6309
|
),
|
|
6038
|
-
/* @__PURE__ */
|
|
6039
|
-
/* @__PURE__ */
|
|
6040
|
-
WINDOW_FILTERS.map((filter) => /* @__PURE__ */
|
|
6310
|
+
/* @__PURE__ */ jsxs29("div", { className: "cv-workspace-chips", children: [
|
|
6311
|
+
/* @__PURE__ */ jsx32("span", { className: "cv-workspace-chips__legend", children: labels.windowLegend }),
|
|
6312
|
+
WINDOW_FILTERS.map((filter) => /* @__PURE__ */ jsx32(
|
|
6041
6313
|
"button",
|
|
6042
6314
|
{
|
|
6043
6315
|
type: "button",
|
|
@@ -6055,9 +6327,9 @@ function ConversationsInboxList({
|
|
|
6055
6327
|
filter.value
|
|
6056
6328
|
))
|
|
6057
6329
|
] }),
|
|
6058
|
-
inbox.channelFilters.length > 0 ? /* @__PURE__ */
|
|
6059
|
-
/* @__PURE__ */
|
|
6060
|
-
inbox.channelFilters.map((filter) => /* @__PURE__ */
|
|
6330
|
+
inbox.channelFilters.length > 0 ? /* @__PURE__ */ jsxs29("div", { className: "cv-workspace-chips", children: [
|
|
6331
|
+
/* @__PURE__ */ jsx32("span", { className: "cv-workspace-chips__legend", children: labels.channelLegend }),
|
|
6332
|
+
inbox.channelFilters.map((filter) => /* @__PURE__ */ jsxs29(
|
|
6061
6333
|
"button",
|
|
6062
6334
|
{
|
|
6063
6335
|
"data-cv-tooltip": filter.label,
|
|
@@ -6067,7 +6339,7 @@ function ConversationsInboxList({
|
|
|
6067
6339
|
"aria-pressed": inbox.channelFilter === filter.value,
|
|
6068
6340
|
className: `cv-workspace-chip${inbox.channelFilter === filter.value ? " cv-workspace-chip--on" : ""}`,
|
|
6069
6341
|
children: [
|
|
6070
|
-
filter.value === CHANNEL_FILTER_ALL ? null : /* @__PURE__ */
|
|
6342
|
+
filter.value === CHANNEL_FILTER_ALL ? null : /* @__PURE__ */ jsx32(ChannelIcon, { channel: filter.value }),
|
|
6071
6343
|
filter.label
|
|
6072
6344
|
]
|
|
6073
6345
|
},
|
|
@@ -6075,14 +6347,14 @@ function ConversationsInboxList({
|
|
|
6075
6347
|
))
|
|
6076
6348
|
] }) : null,
|
|
6077
6349
|
renderFilters?.(inbox),
|
|
6078
|
-
/* @__PURE__ */
|
|
6079
|
-
/* @__PURE__ */
|
|
6350
|
+
/* @__PURE__ */ jsxs29("label", { className: "cv-workspace-selectall", children: [
|
|
6351
|
+
/* @__PURE__ */ jsx32("input", { type: "checkbox", checked: inbox.allOnPageSelected, onChange: inbox.toggleSelectAllOnPage }),
|
|
6080
6352
|
labels.selectAll
|
|
6081
6353
|
] })
|
|
6082
6354
|
] }),
|
|
6083
|
-
/* @__PURE__ */
|
|
6355
|
+
/* @__PURE__ */ jsxs29("div", { className: "cv-workspace-rows", children: [
|
|
6084
6356
|
inbox.pageConversations.map(
|
|
6085
|
-
(conversation) => renderRow ? /* @__PURE__ */
|
|
6357
|
+
(conversation) => renderRow ? /* @__PURE__ */ jsx32("div", { children: renderRow(conversation) }, conversation.id) : /* @__PURE__ */ jsx32(
|
|
6086
6358
|
ConversationRow,
|
|
6087
6359
|
{
|
|
6088
6360
|
conversation,
|
|
@@ -6097,13 +6369,13 @@ function ConversationsInboxList({
|
|
|
6097
6369
|
conversation.id
|
|
6098
6370
|
)
|
|
6099
6371
|
),
|
|
6100
|
-
!inbox.loading && inbox.filteredCount === 0 ? /* @__PURE__ */
|
|
6372
|
+
!inbox.loading && inbox.filteredCount === 0 ? /* @__PURE__ */ jsx32("p", { className: "cv-workspace-empty", children: labels.emptyList }) : null
|
|
6101
6373
|
] }),
|
|
6102
|
-
/* @__PURE__ */
|
|
6103
|
-
/* @__PURE__ */
|
|
6104
|
-
/* @__PURE__ */
|
|
6105
|
-
/* @__PURE__ */
|
|
6106
|
-
/* @__PURE__ */
|
|
6374
|
+
/* @__PURE__ */ jsxs29("div", { className: "cv-workspace-pager", children: [
|
|
6375
|
+
/* @__PURE__ */ jsx32("span", { children: labels.rangeOf(inbox.firstOnPage, inbox.lastOnPage, inbox.filteredCount) }),
|
|
6376
|
+
/* @__PURE__ */ jsxs29("div", { className: "cv-workspace-pager__buttons", children: [
|
|
6377
|
+
/* @__PURE__ */ jsx32("button", { type: "button", onClick: () => inbox.goToPage(1), disabled: inbox.page === 1, "aria-label": PAGINATION_LABELS.first, "data-cv-tooltip": PAGINATION_LABELS.first, children: "\xAB" }),
|
|
6378
|
+
/* @__PURE__ */ jsx32(
|
|
6107
6379
|
"button",
|
|
6108
6380
|
{
|
|
6109
6381
|
type: "button",
|
|
@@ -6114,8 +6386,8 @@ function ConversationsInboxList({
|
|
|
6114
6386
|
children: "\u2039"
|
|
6115
6387
|
}
|
|
6116
6388
|
),
|
|
6117
|
-
/* @__PURE__ */
|
|
6118
|
-
/* @__PURE__ */
|
|
6389
|
+
/* @__PURE__ */ jsx32("span", { children: labels.pageOf(inbox.page, inbox.pageCount) }),
|
|
6390
|
+
/* @__PURE__ */ jsx32(
|
|
6119
6391
|
"button",
|
|
6120
6392
|
{
|
|
6121
6393
|
type: "button",
|
|
@@ -6126,7 +6398,7 @@ function ConversationsInboxList({
|
|
|
6126
6398
|
children: "\u203A"
|
|
6127
6399
|
}
|
|
6128
6400
|
),
|
|
6129
|
-
/* @__PURE__ */
|
|
6401
|
+
/* @__PURE__ */ jsx32(
|
|
6130
6402
|
"button",
|
|
6131
6403
|
{
|
|
6132
6404
|
type: "button",
|
|
@@ -6372,7 +6644,7 @@ function useConversationsInbox(params = {}) {
|
|
|
6372
6644
|
}
|
|
6373
6645
|
|
|
6374
6646
|
// src/workspace/ConversationsWorkspace.tsx
|
|
6375
|
-
import { Fragment as Fragment8, jsx as
|
|
6647
|
+
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6376
6648
|
function ConversationsWorkspace({
|
|
6377
6649
|
labels: labelsOverride,
|
|
6378
6650
|
filters,
|
|
@@ -6448,50 +6720,50 @@ function ConversationsWorkspace({
|
|
|
6448
6720
|
...fromProduct,
|
|
6449
6721
|
{
|
|
6450
6722
|
key: "simulator",
|
|
6451
|
-
icon: simulator?.icon ?? /* @__PURE__ */
|
|
6723
|
+
icon: simulator?.icon ?? /* @__PURE__ */ jsx33(FlaskConical, { size: ICON_SIZE_ACTION }),
|
|
6452
6724
|
label: simulator?.label ?? "Simular cliente",
|
|
6453
6725
|
active: simulatorOpen,
|
|
6454
6726
|
run: () => setSimulatorOpen((open) => !open)
|
|
6455
6727
|
}
|
|
6456
6728
|
];
|
|
6457
6729
|
}, [selected, extraUtilitiesFor, simulatorEnabled, simulator, simulatorOpen]);
|
|
6458
|
-
return /* @__PURE__ */
|
|
6459
|
-
/* @__PURE__ */
|
|
6460
|
-
/* @__PURE__ */
|
|
6461
|
-
/* @__PURE__ */
|
|
6462
|
-
/* @__PURE__ */
|
|
6463
|
-
/* @__PURE__ */
|
|
6464
|
-
/* @__PURE__ */
|
|
6465
|
-
/* @__PURE__ */
|
|
6730
|
+
return /* @__PURE__ */ jsxs30("div", { className: `cv-workspace${className ? ` ${className}` : ""}`, children: [
|
|
6731
|
+
/* @__PURE__ */ jsx33(TooltipLayer, {}),
|
|
6732
|
+
/* @__PURE__ */ jsxs30("header", { className: "cv-workspace-header", children: [
|
|
6733
|
+
/* @__PURE__ */ jsxs30("div", { className: "cv-workspace-header__titles", children: [
|
|
6734
|
+
/* @__PURE__ */ jsx33("h1", { children: labels.title }),
|
|
6735
|
+
/* @__PURE__ */ jsxs30("p", { children: [
|
|
6736
|
+
/* @__PURE__ */ jsxs30("span", { "data-cv-tooltip": labels.conversations, className: "cv-stat", children: [
|
|
6737
|
+
/* @__PURE__ */ jsx33(MessagesSquare, { size: ICON_SIZE_INLINE, "aria-hidden": "true" }),
|
|
6466
6738
|
" ",
|
|
6467
6739
|
inbox.totalCount,
|
|
6468
|
-
/* @__PURE__ */
|
|
6740
|
+
/* @__PURE__ */ jsxs30("span", { className: "cv-only-wide", children: [
|
|
6469
6741
|
" ",
|
|
6470
6742
|
labels.conversations
|
|
6471
6743
|
] })
|
|
6472
6744
|
] }),
|
|
6473
|
-
/* @__PURE__ */
|
|
6474
|
-
/* @__PURE__ */
|
|
6745
|
+
/* @__PURE__ */ jsxs30("span", { "data-cv-tooltip": labels.waiting, className: "cv-stat cv-workspace-header__waiting", children: [
|
|
6746
|
+
/* @__PURE__ */ jsx33(Hourglass2, { size: ICON_SIZE_INLINE, "aria-hidden": "true" }),
|
|
6475
6747
|
" ",
|
|
6476
6748
|
inbox.waitingCount,
|
|
6477
|
-
/* @__PURE__ */
|
|
6749
|
+
/* @__PURE__ */ jsxs30("span", { className: "cv-only-wide", children: [
|
|
6478
6750
|
" ",
|
|
6479
6751
|
labels.waiting
|
|
6480
6752
|
] })
|
|
6481
6753
|
] }),
|
|
6482
|
-
/* @__PURE__ */
|
|
6483
|
-
/* @__PURE__ */
|
|
6754
|
+
/* @__PURE__ */ jsxs30("span", { "data-cv-tooltip": labels.unread, className: "cv-stat", children: [
|
|
6755
|
+
/* @__PURE__ */ jsx33(Mail2, { size: ICON_SIZE_INLINE, "aria-hidden": "true" }),
|
|
6484
6756
|
" ",
|
|
6485
6757
|
inbox.unreadCount,
|
|
6486
|
-
/* @__PURE__ */
|
|
6758
|
+
/* @__PURE__ */ jsxs30("span", { className: "cv-only-wide", children: [
|
|
6487
6759
|
" ",
|
|
6488
6760
|
labels.unread
|
|
6489
6761
|
] })
|
|
6490
6762
|
] })
|
|
6491
6763
|
] })
|
|
6492
6764
|
] }),
|
|
6493
|
-
/* @__PURE__ */
|
|
6494
|
-
/* @__PURE__ */
|
|
6765
|
+
/* @__PURE__ */ jsxs30("div", { className: "cv-workspace-header__actions", children: [
|
|
6766
|
+
/* @__PURE__ */ jsxs30(
|
|
6495
6767
|
"button",
|
|
6496
6768
|
{
|
|
6497
6769
|
type: "button",
|
|
@@ -6501,12 +6773,12 @@ function ConversationsWorkspace({
|
|
|
6501
6773
|
"aria-label": labels.waitingOnly,
|
|
6502
6774
|
className: inbox.waitingOnly ? "cv-workspace-toggle cv-workspace-toggle--on" : "cv-workspace-toggle",
|
|
6503
6775
|
children: [
|
|
6504
|
-
/* @__PURE__ */
|
|
6505
|
-
/* @__PURE__ */
|
|
6776
|
+
/* @__PURE__ */ jsx33(Hourglass2, { size: ICON_SIZE_ACTION, "aria-hidden": "true" }),
|
|
6777
|
+
/* @__PURE__ */ jsx33("span", { className: "cv-only-wide", children: labels.waitingOnly })
|
|
6506
6778
|
]
|
|
6507
6779
|
}
|
|
6508
6780
|
),
|
|
6509
|
-
/* @__PURE__ */
|
|
6781
|
+
/* @__PURE__ */ jsxs30(
|
|
6510
6782
|
"button",
|
|
6511
6783
|
{
|
|
6512
6784
|
type: "button",
|
|
@@ -6516,9 +6788,9 @@ function ConversationsWorkspace({
|
|
|
6516
6788
|
"aria-label": labels.markSelectedAsRead,
|
|
6517
6789
|
className: "cv-workspace-toggle",
|
|
6518
6790
|
children: [
|
|
6519
|
-
/* @__PURE__ */
|
|
6520
|
-
/* @__PURE__ */
|
|
6521
|
-
inbox.selectedIds.size > 0 ? /* @__PURE__ */
|
|
6791
|
+
/* @__PURE__ */ jsx33(Check2, { size: ICON_SIZE_ACTION, "aria-hidden": "true" }),
|
|
6792
|
+
/* @__PURE__ */ jsx33("span", { className: "cv-only-wide", children: labels.markSelectedAsRead }),
|
|
6793
|
+
inbox.selectedIds.size > 0 ? /* @__PURE__ */ jsxs30("span", { children: [
|
|
6522
6794
|
"(",
|
|
6523
6795
|
inbox.selectedIds.size,
|
|
6524
6796
|
")"
|
|
@@ -6526,7 +6798,7 @@ function ConversationsWorkspace({
|
|
|
6526
6798
|
]
|
|
6527
6799
|
}
|
|
6528
6800
|
),
|
|
6529
|
-
inbox.canMarkAllRead && inbox.unreadCount > 0 ? /* @__PURE__ */
|
|
6801
|
+
inbox.canMarkAllRead && inbox.unreadCount > 0 ? /* @__PURE__ */ jsxs30(
|
|
6530
6802
|
"button",
|
|
6531
6803
|
{
|
|
6532
6804
|
type: "button",
|
|
@@ -6536,28 +6808,28 @@ function ConversationsWorkspace({
|
|
|
6536
6808
|
"aria-label": labels.markAllAsRead,
|
|
6537
6809
|
className: "cv-workspace-toggle",
|
|
6538
6810
|
children: [
|
|
6539
|
-
/* @__PURE__ */
|
|
6540
|
-
/* @__PURE__ */
|
|
6811
|
+
/* @__PURE__ */ jsx33(CheckCheck, { size: ICON_SIZE_ACTION, "aria-hidden": "true" }),
|
|
6812
|
+
/* @__PURE__ */ jsx33("span", { className: "cv-only-wide", children: labels.markAllAsRead })
|
|
6541
6813
|
]
|
|
6542
6814
|
}
|
|
6543
6815
|
) : null,
|
|
6544
6816
|
renderHeaderActions?.(inbox)
|
|
6545
6817
|
] })
|
|
6546
6818
|
] }),
|
|
6547
|
-
inbox.loadFailure ? /* @__PURE__ */
|
|
6819
|
+
inbox.loadFailure ? /* @__PURE__ */ jsxs30("p", { role: "alert", className: "cv-workspace-failure", children: [
|
|
6548
6820
|
inbox.loadFailure,
|
|
6549
|
-
signInHref ? /* @__PURE__ */
|
|
6821
|
+
signInHref ? /* @__PURE__ */ jsxs30(Fragment8, { children: [
|
|
6550
6822
|
" ",
|
|
6551
|
-
/* @__PURE__ */
|
|
6823
|
+
/* @__PURE__ */ jsx33("a", { href: signInHref, className: "cv-workspace-failure__link", children: labels.signIn })
|
|
6552
6824
|
] }) : null
|
|
6553
6825
|
] }) : null,
|
|
6554
|
-
/* @__PURE__ */
|
|
6826
|
+
/* @__PURE__ */ jsxs30(
|
|
6555
6827
|
"div",
|
|
6556
6828
|
{
|
|
6557
6829
|
className: `cv-workspace-grid${showSimulator ? " cv-workspace-grid--with-simulator" : ""}`,
|
|
6558
6830
|
"data-detail": selected ? "open" : "closed",
|
|
6559
6831
|
children: [
|
|
6560
|
-
/* @__PURE__ */
|
|
6832
|
+
/* @__PURE__ */ jsx33(
|
|
6561
6833
|
ConversationsInboxList,
|
|
6562
6834
|
{
|
|
6563
6835
|
inbox,
|
|
@@ -6569,7 +6841,7 @@ function ConversationsWorkspace({
|
|
|
6569
6841
|
...onSendTemplateToSelected ? { onSendTemplateToSelected: () => onSendTemplateToSelected(inbox) } : inbox.canListTemplates ? { onSendTemplateToSelected: () => setTemplateModalOpen(true) } : {}
|
|
6570
6842
|
}
|
|
6571
6843
|
),
|
|
6572
|
-
/* @__PURE__ */
|
|
6844
|
+
/* @__PURE__ */ jsx33("section", { className: "cv-workspace-detail", children: selected ? /* @__PURE__ */ jsx33(
|
|
6573
6845
|
ConversationPane,
|
|
6574
6846
|
{
|
|
6575
6847
|
conversation: selected,
|
|
@@ -6599,14 +6871,14 @@ function ConversationsWorkspace({
|
|
|
6599
6871
|
...renderAboveTranscript ? { renderAboveTranscript } : {},
|
|
6600
6872
|
...onAttach ? { onAttach: (file) => onAttach(selected, file) } : {}
|
|
6601
6873
|
}
|
|
6602
|
-
) : /* @__PURE__ */
|
|
6874
|
+
) : /* @__PURE__ */ jsx33("p", { className: "cv-workspace-empty", children: labels.emptyDetail }) }),
|
|
6603
6875
|
showSimulator && selected ? (
|
|
6604
6876
|
// `min-height:0` junto do `min-width:0`: sem isso a linha do grid cresce com o conteúdo do
|
|
6605
6877
|
// painel, o scroll interno nunca ativa e quem rola passa a ser a página inteira.
|
|
6606
|
-
/* @__PURE__ */
|
|
6878
|
+
/* @__PURE__ */ jsx33("div", { className: "cv-workspace-simulator", children: simulator?.render ? simulator.render({ conversationId: selected.id, channel, close: () => setSimulatorOpen(false) }) : simulatorClient && conversations ? (
|
|
6607
6879
|
// `key` pela conversa: trocar de contato sem remontar deixaria o transcript e o campo
|
|
6608
6880
|
// de texto do contato anterior na tela.
|
|
6609
|
-
/* @__PURE__ */
|
|
6881
|
+
/* @__PURE__ */ jsx33(
|
|
6610
6882
|
ConversationSimulatorPanel,
|
|
6611
6883
|
{
|
|
6612
6884
|
client: simulatorClient,
|
|
@@ -6627,7 +6899,7 @@ function ConversationsWorkspace({
|
|
|
6627
6899
|
]
|
|
6628
6900
|
}
|
|
6629
6901
|
),
|
|
6630
|
-
templateModalOpen ? /* @__PURE__ */
|
|
6902
|
+
templateModalOpen ? /* @__PURE__ */ jsx33(
|
|
6631
6903
|
BulkTemplateModal,
|
|
6632
6904
|
{
|
|
6633
6905
|
labels,
|
|
@@ -6729,10 +7001,12 @@ export {
|
|
|
6729
7001
|
TooltipLayer,
|
|
6730
7002
|
TopicsForm,
|
|
6731
7003
|
TranscriptionSettingsForm,
|
|
7004
|
+
WHATSAPP_MARKER_BY_ACTION,
|
|
6732
7005
|
WINDOW_FILTERS,
|
|
6733
7006
|
WelcomeFarewellForm,
|
|
6734
7007
|
WhatsAppCreateTemplateForm,
|
|
6735
7008
|
WhatsAppMessageEditor,
|
|
7009
|
+
WhatsAppMessagePreview,
|
|
6736
7010
|
WhatsAppTemplateSettingsForm,
|
|
6737
7011
|
WhatsAppTemplatesSettings,
|
|
6738
7012
|
WindowExpiredNotice,
|