@fayz-ai/plugin-crm 0.16.0 → 0.17.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogActivityButton.d.ts","sourceRoot":"","sources":["../../src/components/LogActivityButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAU3D,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAA;AAczD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAYD,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IACtD,MAAM,EAAE,cAAc,CAAA;IACtB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAA;CACxC,
|
|
1
|
+
{"version":3,"file":"LogActivityButton.d.ts","sourceRoot":"","sources":["../../src/components/LogActivityButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAU3D,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAA;AAczD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAYD,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IACtD,MAAM,EAAE,cAAc,CAAA;IACtB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAA;CACxC,qBA8JA"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react'
|
|
|
2
2
|
import { tl, useTranslation, getSupabaseClientOptional, registerTranslations, registerMessageDefaults, createSafeDataProvider, getActiveTenantId, countByTenant, usePluginRuntimeOptional, useActiveTenantId, exportCSV, loadMessageOverrides, resolveMessages, useActiveUnitId } from '@fayz-ai/core';
|
|
3
3
|
import { createPluginContext, useUnitBootstrap, useUnitStore, createCrudPage, PluginSettingsPanel, registerTimelineSource, dedup, useModuleNavigation, createViewRouter, ModuleActionBar, usePermissionOptional, PageActions, useTenantPluginSettings, SettingsGroup, ToggleRow, adminNavigateTo, useLimitGuard, OrderFormSkeleton, OrderFormBlock, OrderFormView, OrderFormItemsCard, OrderFormItemRow, OrderFormAddItemStep, formatCurrency, OrderDetailSkeleton, OrderDetailBlock, OrderDetailView, PersonLink, RightRailPage, KanbanBoard, invalidateLimit, useAccessOptional, useOrganizationStore, getRailPage, ContactPicker } from '@fayz-ai/admin';
|
|
4
4
|
import { Archive, FileX2, FileCheck2, Send, FilePlus2, XCircle, Trophy, PhoneCall, MoveRight, Target, ArrowRightLeft, UserPlus, MapPin, MessageCircle, CheckSquare, FileText, Users, Mail, Phone, ArrowUp, ArrowDown, X, Plus, Filter, Lock, Pencil, Trash2, Globe, Check, ChevronRight, Settings, Tag, User, Building2, Download, Inbox, Play, Clock, Sparkles, Calendar, ArrowRight, ChevronDown, Printer, CircleCheckBig, Ban, Receipt, Package, CalendarClock, Loader2, Network, Link2, Star, MessageSquareQuote, Search, SignalHigh, CalendarRange, ChevronLeft, TrendingDown, ThumbsDown, UserCheck, AlertTriangle, Settings2, Repeat, Zap, Snowflake, Sun, Flame, Merge, Fingerprint, Paperclip, ImageOff, CircleAlert, CircleDashed, CheckCircle2, Clipboard, DollarSign, ThumbsUp } from 'lucide-react';
|
|
5
|
-
import { Badge, Checkbox, toast, defineKpiWidget, defineChartWidget, defineCustomWidget, defineTableWidget, PageTransition, ModulePage, SubpageHeader, Button, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Switch, ConfirmDialog, useIsWide, SegmentedControl, PageHeaderActions, FilterChip, MultiSelect, ListView, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, ModalFooter, useSaveBar, SearchSelect, DatePicker, DataTable, Breadcrumb, PhoneLink, SheetBody, SheetFooter, DashboardCanvas, ModalDescription, Card, CurrencyInput, HeaderTabs, Dropdown, DropdownTrigger, DropdownContent, DropdownLabel, DropdownSeparator, DropdownItem, PageToolbar, ToolbarButton, RangeControl, Popover, PopoverTrigger, PopoverContent, getLucideIcon, normalizePhone, KpiCard, ChartWidget, CardHeader, CardTitle, CardContent, TableWidget } from '@fayz-ai/ui';
|
|
5
|
+
import { Badge, Checkbox, toast, defineKpiWidget, defineChartWidget, defineCustomWidget, defineTableWidget, PageTransition, ModulePage, SubpageHeader, Button, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Switch, ConfirmDialog, useIsWide, SegmentedControl, PageHeaderActions, FilterChip, MultiSelect, ListView, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, ModalFooter, useSaveBar, SearchSelect, DatePicker, DataTable, Breadcrumb, PhoneLink, SheetBody, SheetFooter, DashboardCanvas, ModalDescription, Card, CurrencyInput, HeaderTabs, Dropdown, DropdownTrigger, DropdownContent, DropdownLabel, DropdownSeparator, DropdownItem, PageToolbar, ToolbarButton, RangeControl, Popover, PopoverTrigger, PopoverContent, getLucideIcon, DictateButton, normalizePhone, KpiCard, ChartWidget, CardHeader, CardTitle, CardContent, TableWidget } from '@fayz-ai/ui';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { createStore as createStore$1 } from 'zustand/vanilla';
|
|
@@ -3062,6 +3062,7 @@ function LogActivityButton({ target, onLogged }) {
|
|
|
3062
3062
|
const [types, setTypes] = useState(() => DEFAULT_ACTIVITY_TYPES);
|
|
3063
3063
|
const [type, setType] = useState("whatsapp");
|
|
3064
3064
|
const [note, setNote] = useState("");
|
|
3065
|
+
const [noteBase, setNoteBase] = useState("");
|
|
3065
3066
|
const [outcome, setOutcome] = useState("connected");
|
|
3066
3067
|
const [nextDate, setNextDate] = useState("");
|
|
3067
3068
|
const [saving, setSaving] = useState(false);
|
|
@@ -3110,6 +3111,7 @@ function LogActivityButton({ target, onLogged }) {
|
|
|
3110
3111
|
});
|
|
3111
3112
|
}
|
|
3112
3113
|
setNote("");
|
|
3114
|
+
setNoteBase("");
|
|
3113
3115
|
setNextDate("");
|
|
3114
3116
|
setOutcome("connected");
|
|
3115
3117
|
setOpen(false);
|
|
@@ -3141,23 +3143,40 @@ function LogActivityButton({ target, onLogged }) {
|
|
|
3141
3143
|
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-9 text-sm", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
3142
3144
|
/* @__PURE__ */ jsx(SelectContent, { children: OUTCOMES.map((o) => /* @__PURE__ */ jsx(SelectItem, { value: o, children: t2(`crm.outcome.${o}`) }, o)) })
|
|
3143
3145
|
] }),
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
e.
|
|
3154
|
-
|
|
3146
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3147
|
+
/* @__PURE__ */ jsx(
|
|
3148
|
+
"textarea",
|
|
3149
|
+
{
|
|
3150
|
+
autoFocus: true,
|
|
3151
|
+
rows: 3,
|
|
3152
|
+
value: note,
|
|
3153
|
+
onChange: (e) => {
|
|
3154
|
+
setNote(e.target.value);
|
|
3155
|
+
setNoteBase(e.target.value);
|
|
3156
|
+
},
|
|
3157
|
+
onKeyDown: (e) => {
|
|
3158
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
3159
|
+
e.preventDefault();
|
|
3160
|
+
void submit();
|
|
3161
|
+
}
|
|
3162
|
+
},
|
|
3163
|
+
placeholder: t2("crm.followUp.placeholder"),
|
|
3164
|
+
className: "w-full resize-none rounded-lg border bg-background px-3 py-2 pr-10 text-sm outline-none placeholder:text-muted-foreground/70 focus:ring-2 focus:ring-ring"
|
|
3165
|
+
}
|
|
3166
|
+
),
|
|
3167
|
+
/* @__PURE__ */ jsx(
|
|
3168
|
+
DictateButton,
|
|
3169
|
+
{
|
|
3170
|
+
className: "absolute right-1.5 top-1.5",
|
|
3171
|
+
startLabel: t2("crm.followUp.dictate"),
|
|
3172
|
+
stopLabel: t2("crm.followUp.dictateStop"),
|
|
3173
|
+
onTranscript: (texto) => {
|
|
3174
|
+
const base = noteBase.trimEnd();
|
|
3175
|
+
setNote(base ? `${base} ${texto}` : texto);
|
|
3155
3176
|
}
|
|
3156
|
-
}
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
}
|
|
3160
|
-
),
|
|
3177
|
+
}
|
|
3178
|
+
)
|
|
3179
|
+
] }),
|
|
3161
3180
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3162
3181
|
/* @__PURE__ */ jsx(CalendarClock, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3163
3182
|
/* @__PURE__ */ jsx(DatePicker, { value: nextDate, onChange: setNextDate }),
|
|
@@ -3420,18 +3439,12 @@ function DealCardModal({ dealId, open, onClose, onViewLead, onViewQuote, onViewC
|
|
|
3420
3439
|
]
|
|
3421
3440
|
}
|
|
3422
3441
|
) : null,
|
|
3423
|
-
onCreateQuote && lead && /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "outline", onClick: () =>
|
|
3424
|
-
onCreateQuote(lead.id);
|
|
3425
|
-
onClose();
|
|
3426
|
-
}, children: [
|
|
3442
|
+
onCreateQuote && lead && /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "outline", onClick: () => onCreateQuote(lead.id), children: [
|
|
3427
3443
|
/* @__PURE__ */ jsx(FileText, { className: "h-3 w-3" }),
|
|
3428
3444
|
" ",
|
|
3429
3445
|
t2("crm.leadDetail.createQuote")
|
|
3430
3446
|
] }),
|
|
3431
|
-
onViewLead && lead && /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: () =>
|
|
3432
|
-
onViewLead(lead.id);
|
|
3433
|
-
onClose();
|
|
3434
|
-
}, children: [
|
|
3447
|
+
onViewLead && lead && /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: () => onViewLead(lead.id), children: [
|
|
3435
3448
|
t2("crm.dealSidebar.viewLeadProfile"),
|
|
3436
3449
|
" ",
|
|
3437
3450
|
/* @__PURE__ */ jsx(ArrowRight, { className: "h-3 w-3" })
|
|
@@ -3517,10 +3530,7 @@ function DealCardModal({ dealId, open, onClose, onViewLead, onViewQuote, onViewC
|
|
|
3517
3530
|
"button",
|
|
3518
3531
|
{
|
|
3519
3532
|
type: "button",
|
|
3520
|
-
onClick: () =>
|
|
3521
|
-
onViewCompany?.(company.id);
|
|
3522
|
-
onClose();
|
|
3523
|
-
},
|
|
3533
|
+
onClick: () => onViewCompany?.(company.id),
|
|
3524
3534
|
disabled: !onViewCompany,
|
|
3525
3535
|
className: "flex w-full items-center gap-3 rounded-card border bg-card px-4 py-3 text-left shadow-sm transition-colors enabled:hover:bg-muted/20",
|
|
3526
3536
|
children: [
|
|
@@ -3595,10 +3605,7 @@ function DealCardModal({ dealId, open, onClose, onViewLead, onViewQuote, onViewC
|
|
|
3595
3605
|
quotes2.length > 0 && /* @__PURE__ */ jsx(Section, { title: t2("crm.dealSidebar.quotes"), children: /* @__PURE__ */ jsx("div", { className: "divide-y rounded-card border", children: quotes2.map((q) => /* @__PURE__ */ jsxs(
|
|
3596
3606
|
"div",
|
|
3597
3607
|
{
|
|
3598
|
-
onClick: () =>
|
|
3599
|
-
onViewQuote?.(q.id);
|
|
3600
|
-
onClose();
|
|
3601
|
-
},
|
|
3608
|
+
onClick: () => onViewQuote?.(q.id),
|
|
3602
3609
|
className: "flex cursor-pointer items-center justify-between px-4 py-2.5 transition-colors hover:bg-muted/20",
|
|
3603
3610
|
children: [
|
|
3604
3611
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
@@ -25332,6 +25339,8 @@ var en = {
|
|
|
25332
25339
|
"crm.funnelView.fromTop": "{{pct}}% of the top",
|
|
25333
25340
|
"crm.funnelView.fromPrev": "{{pct}}% of the previous stage",
|
|
25334
25341
|
"crm.funnelView.dropped": "{{count}} dropped off",
|
|
25342
|
+
"crm.followUp.dictate": "Dictate the note",
|
|
25343
|
+
"crm.followUp.dictateStop": "Stop dictating",
|
|
25335
25344
|
"crm.followUp.placeholder": "What happened on this touch?",
|
|
25336
25345
|
"crm.followUp.save": "Log it",
|
|
25337
25346
|
"crm.followUp.failed": "Could not log the follow-up",
|
|
@@ -26110,6 +26119,8 @@ var ptBR = {
|
|
|
26110
26119
|
"crm.funnelView.fromTop": "{{pct}}% do topo",
|
|
26111
26120
|
"crm.funnelView.fromPrev": "{{pct}}% da etapa anterior",
|
|
26112
26121
|
"crm.funnelView.dropped": "{{count}} ficaram para tr\xE1s",
|
|
26122
|
+
"crm.followUp.dictate": "Ditar a nota",
|
|
26123
|
+
"crm.followUp.dictateStop": "Parar de ditar",
|
|
26113
26124
|
"crm.followUp.placeholder": "O que aconteceu nesse contato?",
|
|
26114
26125
|
"crm.followUp.save": "Registrar",
|
|
26115
26126
|
"crm.followUp.failed": "N\xE3o foi poss\xEDvel registrar o follow-up",
|