@fayz-ai/plugin-conversations 0.36.1 → 0.37.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.
@@ -1,8 +1,8 @@
1
- import { ConversationsContextProvider, useConversationsStore, assinarChegada, useConversationsConfig, CHANNEL_LABELS, currentUserId, isWaitingOnUs, MessagePreview, mediaPreviewKind } from './chunk-FVT2QFNI.js';
1
+ import { ConversationsContextProvider, useConversationsStore, assinarChegada, useConversationsConfig, CHANNEL_LABELS, currentUserId, isWaitingOnUs, MessagePreview, mediaPreviewKind } from './chunk-GYEAIN3O.js';
2
2
  import { providersApi } from './chunk-HMWUU5O7.js';
3
3
  import * as React7 from 'react';
4
4
  import React7__default from 'react';
5
- import { SquarePen, MessageSquare, LifeBuoy, Globe, Mail, Instagram, Phone, Search, Inbox, User, Archive, CheckCheck, ChevronLeft, MoreHorizontal, ArchiveRestore, X, Building2, MoreVertical, Loader2, Forward, AlertTriangle, Check, Clock, ExternalLink, Reply, FileText, Trash2, Paperclip, Square, Mic, Send, Snowflake, Sun, Flame, Ban, BarChart3, MapPin, UserRound, Copy, Download } from 'lucide-react';
5
+ import { SquarePen, MessageSquare, LifeBuoy, Globe, Mail, Instagram, Phone, Search, Inbox, User, Archive, CheckCheck, ChevronLeft, MoreHorizontal, MailWarning, ArchiveRestore, X, Building2, MoreVertical, Loader2, Forward, AlertTriangle, Check, Clock, ExternalLink, Reply, FileText, Trash2, Paperclip, Square, Mic, Send, Snowflake, Sun, Flame, Ban, BarChart3, MapPin, UserRound, Copy, Download } from 'lucide-react';
6
6
  import { PageHeaderActions, cn, Button, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, Textarea, ModalFooter, Input, FilterChip, Skeleton, Dropdown, DropdownTrigger, DropdownContent, DropdownItem, toast } from '@fayz-ai/ui';
7
7
  import { useRightRailStore, PageActions, useLimitGuard, ContactPicker, invalidateLimit, useConnectors } from '@fayz-ai/admin';
8
8
  import { currentAppPath, appHref, onAppPathChange, replaceApp, useTranslation, useActiveTenantId, errorMessage, getSupabaseClientOptional, getActiveTenantId } from '@fayz-ai/core';
@@ -1171,7 +1171,7 @@ function buildRows(messages) {
1171
1171
  }
1172
1172
  function MessageThread({ selected, onTogglePanel, panelOpen, onBack, backAlways, className }) {
1173
1173
  const t = useTranslation();
1174
- const { messages, sending, send, sendMedia, setStatus, refreshMessages } = useConversationsStore((s) => s);
1174
+ const { messages, sending, send, sendMedia, setStatus, refreshMessages, markUnread } = useConversationsStore((s) => s);
1175
1175
  const win = useSendWindow(selected.id, selected.channel === "whatsapp" ? selected.contactHandle : void 0);
1176
1176
  const canType = win.mode.kind === "free";
1177
1177
  const threadRef = React7__default.useRef(null);
@@ -1254,15 +1254,21 @@ function MessageThread({ selected, onTogglePanel, panelOpen, onBack, backAlways,
1254
1254
  ] }),
1255
1255
  /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-1.5", onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxs(Dropdown, { children: [
1256
1256
  /* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", "aria-label": t("conversations.thread.more"), children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
1257
- /* @__PURE__ */ jsx(DropdownContent, { align: "end", children: selected.status === "closed" ? /* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => setStatus("open"), children: [
1258
- /* @__PURE__ */ jsx(ArchiveRestore, { className: "mr-2 h-3.5 w-3.5" }),
1259
- " ",
1260
- t("conversations.thread.unarchive")
1261
- ] }) : /* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => setStatus("closed"), children: [
1262
- /* @__PURE__ */ jsx(Archive, { className: "mr-2 h-3.5 w-3.5" }),
1263
- " ",
1264
- t("conversations.thread.archive")
1265
- ] }) })
1257
+ /* @__PURE__ */ jsxs(DropdownContent, { align: "end", children: [
1258
+ /* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => void markUnread(selected.id), children: [
1259
+ /* @__PURE__ */ jsx(MailWarning, { className: "mr-2 h-3.5 w-3.5" }),
1260
+ " Marcar como n\xE3o lida"
1261
+ ] }),
1262
+ selected.status === "closed" ? /* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => setStatus("open"), children: [
1263
+ /* @__PURE__ */ jsx(ArchiveRestore, { className: "mr-2 h-3.5 w-3.5" }),
1264
+ " ",
1265
+ t("conversations.thread.unarchive")
1266
+ ] }) : /* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => setStatus("closed"), children: [
1267
+ /* @__PURE__ */ jsx(Archive, { className: "mr-2 h-3.5 w-3.5" }),
1268
+ " ",
1269
+ t("conversations.thread.archive")
1270
+ ] })
1271
+ ] })
1266
1272
  ] }) })
1267
1273
  ]
1268
1274
  }
@@ -1748,7 +1754,7 @@ function useCaixaAoVivo() {
1748
1754
  React7.useEffect(() => {
1749
1755
  if (!tenantId) return;
1750
1756
  return assinarChegada(tenantId, ({ conversationId }) => {
1751
- void load();
1757
+ void load({ autoSelect: false });
1752
1758
  if (conversationId && conversationId === abertoRef.current) {
1753
1759
  void refreshMessages();
1754
1760
  }
@@ -1895,5 +1901,5 @@ function ConversationsPage({ store, config }) {
1895
1901
  }
1896
1902
 
1897
1903
  export { ConversationsPage, conversationIdFromPath };
1898
- //# sourceMappingURL=ConversationsPage-WK2IR3GQ.js.map
1899
- //# sourceMappingURL=ConversationsPage-WK2IR3GQ.js.map
1904
+ //# sourceMappingURL=ConversationsPage-KCKQMEVL.js.map
1905
+ //# sourceMappingURL=ConversationsPage-KCKQMEVL.js.map