@fayz-ai/plugin-crm 0.35.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.
- package/dist/{CrmPage-Z5OYCBKA.js → CrmPage-H3FQDF53.js} +92 -127
- package/dist/CrmPage-H3FQDF53.js.map +1 -0
- package/dist/SegmentsView-JTFU6XWD.js +514 -0
- package/dist/SegmentsView-JTFU6XWD.js.map +1 -0
- package/dist/chunk-EHGAPCZF.js +264 -0
- package/dist/chunk-EHGAPCZF.js.map +1 -0
- package/dist/{chunk-LDBCC67C.js → chunk-J6LYFSFJ.js} +24 -130
- package/dist/chunk-J6LYFSFJ.js.map +1 -0
- package/dist/chunk-VFLS65NL.js +51 -0
- package/dist/chunk-VFLS65NL.js.map +1 -0
- package/dist/components/SegmentEditorDialog.d.ts.map +1 -1
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/supabase.d.ts.map +1 -1
- package/dist/data/types.d.ts +7 -1
- package/dist/data/types.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +212 -20
- package/dist/index.js.map +1 -1
- package/dist/lib/segments.d.ts +13 -6
- package/dist/lib/segments.d.ts.map +1 -1
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/migrations/index.d.ts +3 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/main.browser.js +4 -1
- package/dist/migrations/main.browser.js.map +1 -1
- package/dist/migrations/main.js +428 -2
- package/dist/migrations/main.js.map +1 -1
- package/dist/types.d.ts +29 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/views/DealListView.d.ts.map +1 -1
- package/dist/views/SegmentsView.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/CrmPage-Z5OYCBKA.js.map +0 -1
- package/dist/SegmentsView-PHLN2MOW.js +0 -385
- package/dist/SegmentsView-PHLN2MOW.js.map +0 -1
- package/dist/chunk-LDBCC67C.js.map +0 -1
- package/dist/chunk-QJOLAGGN.js +0 -129
- package/dist/chunk-QJOLAGGN.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { documentKind, formatDocument, DEFAULT_ACTIVITY_TYPES, buildCrmRegistries,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { documentKind, formatDocument, DEFAULT_ACTIVITY_TYPES, buildCrmRegistries, T, localPhoneKey, normalizeDocument, isValidDocument, documentRoot } from './chunk-J6LYFSFJ.js';
|
|
2
|
+
import { getCrmTenantId, resolveSourceView, loadMyUserId, evaluateSegment, DEAL_VIEW } from './chunk-EHGAPCZF.js';
|
|
3
|
+
export { TagChips, humanizeTag } from './chunk-EHGAPCZF.js';
|
|
4
4
|
import { CrmContextProvider, useCrmConfig, useCrmStore, formatCurrency, useCrmProvider } from './chunk-7V46TYYX.js';
|
|
5
|
-
import
|
|
5
|
+
import React2, { useEffect } from 'react';
|
|
6
6
|
import { tl, lazyComponent, RECORD_GROUP, recordRailFields, activeFacet, registerTranslations, registerMessageDefaults, createSafeDataProvider, getSupabaseClientOptional, getActiveTenantId, countByTenant, getActiveUnitId, useTranslation } from '@fayz-ai/core';
|
|
7
7
|
import { defineSettingsTab, registrySettingsParent, createCrudPage, PluginSettingsPanel, registerTimelineSource, dedup } from '@fayz-ai/admin';
|
|
8
8
|
import { toast, defineKpiWidget, defineChartWidget, defineCustomWidget, defineTableWidget, KpiCard, ChartWidget, Card, CardHeader, CardTitle, CardContent, TableWidget } from '@fayz-ai/ui';
|
|
@@ -343,7 +343,7 @@ function PerformancePanel() {
|
|
|
343
343
|
}
|
|
344
344
|
function NpsKpi() {
|
|
345
345
|
const provider = useCrmProvider();
|
|
346
|
-
const [stats, setStats] =
|
|
346
|
+
const [stats, setStats] = React2.useState(null);
|
|
347
347
|
useEffect(() => {
|
|
348
348
|
let cancelled = false;
|
|
349
349
|
void provider.getSurveyStats().then((s) => {
|
|
@@ -377,8 +377,8 @@ function NpsKpi() {
|
|
|
377
377
|
}
|
|
378
378
|
function useEngagement() {
|
|
379
379
|
const provider = useCrmProvider();
|
|
380
|
-
const [data, setData] =
|
|
381
|
-
|
|
380
|
+
const [data, setData] = React2.useState(null);
|
|
381
|
+
React2.useEffect(() => {
|
|
382
382
|
let alive = true;
|
|
383
383
|
provider.getEngagementSummary().then((d) => {
|
|
384
384
|
if (alive) setData(d);
|
|
@@ -509,8 +509,8 @@ function ActiveCustomersKpi() {
|
|
|
509
509
|
function SourceConversionChart() {
|
|
510
510
|
const t = useTranslation();
|
|
511
511
|
const provider = useCrmProvider();
|
|
512
|
-
const [rows, setRows] =
|
|
513
|
-
|
|
512
|
+
const [rows, setRows] = React2.useState([]);
|
|
513
|
+
React2.useEffect(() => {
|
|
514
514
|
let alive = true;
|
|
515
515
|
provider.getSourceConversion(90).then((r) => {
|
|
516
516
|
if (alive) setRows(r);
|
|
@@ -538,8 +538,8 @@ function SourceConversionChart() {
|
|
|
538
538
|
function MonthlyTrendChart() {
|
|
539
539
|
const t = useTranslation();
|
|
540
540
|
const provider = useCrmProvider();
|
|
541
|
-
const [rows, setRows] =
|
|
542
|
-
|
|
541
|
+
const [rows, setRows] = React2.useState([]);
|
|
542
|
+
React2.useEffect(() => {
|
|
543
543
|
let alive = true;
|
|
544
544
|
provider.getMonthlySeries(6).then((r) => {
|
|
545
545
|
if (alive) setRows(r);
|
|
@@ -1746,6 +1746,63 @@ function createMockCrmProvider(options) {
|
|
|
1746
1746
|
if (i >= 0 && mockSegments[i].isSystem) throw new Error("Segmento do sistema n\xE3o pode ser apagado.");
|
|
1747
1747
|
if (i >= 0) mockSegments.splice(i, 1);
|
|
1748
1748
|
},
|
|
1749
|
+
async previewSegment(sourceView, rules) {
|
|
1750
|
+
const seg = { kind: "rule", sourceView, rules };
|
|
1751
|
+
if (sourceView === DEAL_VIEW) {
|
|
1752
|
+
const rows = store.deals.map((d) => ({
|
|
1753
|
+
id: d.id,
|
|
1754
|
+
person_id: d.contactId,
|
|
1755
|
+
stage_name: d.stageName,
|
|
1756
|
+
deal_status: d.status,
|
|
1757
|
+
unit_id: d.unitId,
|
|
1758
|
+
tags: d.tags,
|
|
1759
|
+
owner_id: d.assignedToId,
|
|
1760
|
+
value: d.value,
|
|
1761
|
+
created_at: d.createdAt,
|
|
1762
|
+
updated_at: d.updatedAt
|
|
1763
|
+
}));
|
|
1764
|
+
const ids = new Set(evaluateSegment(seg, rows));
|
|
1765
|
+
return { rows: ids.size, people: new Set(rows.filter((r) => ids.has(r.id)).map((r) => r.person_id)).size };
|
|
1766
|
+
}
|
|
1767
|
+
const n = evaluateSegment(seg, mockPeopleRows()).length;
|
|
1768
|
+
return { rows: n, people: n };
|
|
1769
|
+
},
|
|
1770
|
+
async previewSegmentRows(sourceView, rules) {
|
|
1771
|
+
const seg = { kind: "rule", sourceView, rules };
|
|
1772
|
+
if (sourceView === DEAL_VIEW) {
|
|
1773
|
+
const rows = store.deals.map((d) => ({
|
|
1774
|
+
id: d.id,
|
|
1775
|
+
stage_name: d.stageName,
|
|
1776
|
+
deal_status: d.status,
|
|
1777
|
+
unit_id: d.unitId,
|
|
1778
|
+
tags: d.tags,
|
|
1779
|
+
owner_id: d.assignedToId,
|
|
1780
|
+
value: d.value,
|
|
1781
|
+
created_at: d.createdAt,
|
|
1782
|
+
updated_at: d.updatedAt
|
|
1783
|
+
}));
|
|
1784
|
+
const ids2 = new Set(evaluateSegment(seg, rows));
|
|
1785
|
+
return store.deals.filter((d) => ids2.has(d.id)).map((d) => ({ id: d.id, title: d.title, subtitle: d.contactName, stage: d.stageName }));
|
|
1786
|
+
}
|
|
1787
|
+
const ids = new Set(evaluateSegment(seg, mockPeopleRows()));
|
|
1788
|
+
return mockPeopleRows().filter((p) => ids.has(p.id)).map((p) => ({ id: p.id, title: String(p.name ?? "\u2014") }));
|
|
1789
|
+
},
|
|
1790
|
+
async resolveSegmentDeals(id) {
|
|
1791
|
+
const seg = (await provider.getSegments()).find((s) => s.id === id);
|
|
1792
|
+
if (!seg || seg.sourceView !== DEAL_VIEW) return [];
|
|
1793
|
+
const rows = store.deals.map((d) => ({
|
|
1794
|
+
id: d.id,
|
|
1795
|
+
stage_name: d.stageName,
|
|
1796
|
+
deal_status: d.status,
|
|
1797
|
+
unit_id: d.unitId,
|
|
1798
|
+
tags: d.tags,
|
|
1799
|
+
owner_id: d.assignedToId,
|
|
1800
|
+
value: d.value,
|
|
1801
|
+
created_at: d.createdAt,
|
|
1802
|
+
updated_at: d.updatedAt
|
|
1803
|
+
}));
|
|
1804
|
+
return evaluateSegment(seg, rows);
|
|
1805
|
+
},
|
|
1749
1806
|
async resolveSegment(id) {
|
|
1750
1807
|
const segs = await provider.getSegments();
|
|
1751
1808
|
const seg = segs.find((s) => s.id === id);
|
|
@@ -2220,7 +2277,11 @@ function toSegment(row) {
|
|
|
2220
2277
|
description: row.description ?? void 0,
|
|
2221
2278
|
kind: row.kind === "list" ? "list" : "rule",
|
|
2222
2279
|
sourceView: row.source_view ?? "people",
|
|
2223
|
-
rules: {
|
|
2280
|
+
rules: {
|
|
2281
|
+
where: Array.isArray(rules?.where) ? rules.where : [],
|
|
2282
|
+
...Array.isArray(rules?.any) && rules.any.length ? { any: rules.any } : {},
|
|
2283
|
+
...Array.isArray(rules?.none) && rules.none.length ? { none: rules.none } : {}
|
|
2284
|
+
},
|
|
2224
2285
|
color: row.color ?? void 0,
|
|
2225
2286
|
icon: row.icon ?? void 0,
|
|
2226
2287
|
isSystem: row.is_system === true,
|
|
@@ -3779,6 +3840,55 @@ function createSupabaseCrmProvider(options) {
|
|
|
3779
3840
|
const { error } = await pub.from(T.segments).delete().eq("id", id);
|
|
3780
3841
|
if (error) throw new Error(error.message);
|
|
3781
3842
|
},
|
|
3843
|
+
async previewSegment(sourceView, rules, unitId) {
|
|
3844
|
+
const { pub } = getClients();
|
|
3845
|
+
const { data, error } = await pub.rpc("crm_segment_preview", {
|
|
3846
|
+
p_source_view: sourceView,
|
|
3847
|
+
p_rules: rules,
|
|
3848
|
+
p_unit: unitId ?? null
|
|
3849
|
+
});
|
|
3850
|
+
if (error) throw new Error(error.message);
|
|
3851
|
+
const r = Array.isArray(data) ? data[0] : data;
|
|
3852
|
+
return { rows: Number(r?.rows_count ?? 0), people: Number(r?.people_count ?? 0) };
|
|
3853
|
+
},
|
|
3854
|
+
async previewSegmentRows(sourceView, rules, unitId) {
|
|
3855
|
+
const { pub } = getClients();
|
|
3856
|
+
const { data, error } = await pub.rpc("crm_segment_preview_rows", {
|
|
3857
|
+
p_source_view: sourceView,
|
|
3858
|
+
p_rules: rules,
|
|
3859
|
+
p_unit: unitId ?? null,
|
|
3860
|
+
p_limit: 500
|
|
3861
|
+
});
|
|
3862
|
+
if (error) throw new Error(error.message);
|
|
3863
|
+
const ids = (data ?? []).map((r) => String(r.id));
|
|
3864
|
+
if (!ids.length) return [];
|
|
3865
|
+
const out = [];
|
|
3866
|
+
for (let i = 0; i < ids.length; i += 200) {
|
|
3867
|
+
const chunk = ids.slice(i, i + 200);
|
|
3868
|
+
if (sourceView === "v_crm_deal_audience") {
|
|
3869
|
+
const { data: rows } = await pub.from("v_deals").select("id, title, company_name, group_name, contact_name, stage_name, stage_color").in("id", chunk);
|
|
3870
|
+
for (const d of rows ?? []) {
|
|
3871
|
+
out.push({
|
|
3872
|
+
id: d.id,
|
|
3873
|
+
title: d.group_name ?? d.company_name ?? d.title ?? "\u2014",
|
|
3874
|
+
subtitle: d.contact_name ?? void 0,
|
|
3875
|
+
stage: d.stage_name ?? void 0,
|
|
3876
|
+
stageColor: d.stage_color ?? void 0
|
|
3877
|
+
});
|
|
3878
|
+
}
|
|
3879
|
+
} else {
|
|
3880
|
+
const { data: rows } = await pub.from("people").select("id, name, phone, email").in("id", chunk);
|
|
3881
|
+
for (const p of rows ?? []) out.push({ id: p.id, title: p.name ?? "\u2014", subtitle: p.phone ?? p.email ?? void 0 });
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3884
|
+
return out.sort((a, b) => a.title.localeCompare(b.title));
|
|
3885
|
+
},
|
|
3886
|
+
async resolveSegmentDeals(id) {
|
|
3887
|
+
const { pub } = getClients();
|
|
3888
|
+
const { data, error } = await pub.rpc("crm_resolve_segment_deals", { p_segment_id: id });
|
|
3889
|
+
if (error) throw new Error(error.message);
|
|
3890
|
+
return (data ?? []).map((r) => typeof r === "string" ? r : r.deal_id);
|
|
3891
|
+
},
|
|
3782
3892
|
async resolveSegment(id) {
|
|
3783
3893
|
const { pub } = getClients();
|
|
3784
3894
|
const { data, error } = await pub.rpc("crm_resolve_segment", { p_segment_id: id });
|
|
@@ -6129,6 +6239,44 @@ var en = {
|
|
|
6129
6239
|
"crm.partners.allUnits": "All",
|
|
6130
6240
|
"crm.partners.unitCount": "{{count}} unit(s)",
|
|
6131
6241
|
"crm.partners.noUnits": "No units registered. The partnership applies network-wide.",
|
|
6242
|
+
"crm.segments.editorDescriptionGroups": "Build the segment from conditions in three groups: all must match, any one is enough, and exclusions.",
|
|
6243
|
+
"crm.segments.audience.label": "Who the segment is about",
|
|
6244
|
+
"crm.segments.audience.people": "People",
|
|
6245
|
+
"crm.segments.audience.deals": "Deals",
|
|
6246
|
+
"crm.segments.audience.peopleHint": "The person's record: type, tags, city, birthday, purchases.",
|
|
6247
|
+
"crm.segments.audience.dealsHint": "The funnel: stage, unit, status, owner and the deal's tags. A campaign talks to each deal's contacts.",
|
|
6248
|
+
"crm.segments.group.where": "Must match ALL",
|
|
6249
|
+
"crm.segments.group.whereHint": "AND",
|
|
6250
|
+
"crm.segments.group.any": "Match ANY ONE of these",
|
|
6251
|
+
"crm.segments.group.anyHint": "OR \u2014 leave empty if not needed",
|
|
6252
|
+
"crm.segments.group.none": "Must match NONE of these",
|
|
6253
|
+
"crm.segments.group.noneHint": "exclusion",
|
|
6254
|
+
"crm.segments.group.anyShort": "any of",
|
|
6255
|
+
"crm.segments.group.noneShort": "except",
|
|
6256
|
+
"crm.segments.pick": "Choose\u2026",
|
|
6257
|
+
"crm.segments.search": "Search\u2026",
|
|
6258
|
+
"crm.segments.noOptions": "Nothing found",
|
|
6259
|
+
"crm.segments.previewIncomplete": "Complete the conditions to see how many match.",
|
|
6260
|
+
"crm.segments.previewDeals": "{{deals}} deals now \xB7 {{people}} people",
|
|
6261
|
+
"crm.segments.previewPeople": "{{count}} people now",
|
|
6262
|
+
"crm.segments.field.stage": "Funnel stage",
|
|
6263
|
+
"crm.segments.field.dealStatus": "Deal status",
|
|
6264
|
+
"crm.segments.field.unit": "Unit",
|
|
6265
|
+
"crm.segments.field.owner": "Owner",
|
|
6266
|
+
"crm.segments.field.value": "Value",
|
|
6267
|
+
"crm.segments.field.dealCreatedAt": "Deal created",
|
|
6268
|
+
"crm.segments.field.dealUpdatedAt": "Deal touched",
|
|
6269
|
+
"crm.segments.op.has_any_tag": "has any of the tags",
|
|
6270
|
+
"crm.segments.rule.hasAnyTag": "has any of: {{value}}",
|
|
6271
|
+
"crm.segments.dealStatus.open": "Open",
|
|
6272
|
+
"crm.segments.dealStatus.won": "Won",
|
|
6273
|
+
"crm.segments.dealStatus.lost": "Lost",
|
|
6274
|
+
"crm.segments.dealStatus.archived": "Archived",
|
|
6275
|
+
"crm.segments.kind.lead": "Lead",
|
|
6276
|
+
"crm.segments.kind.customer": "Customer",
|
|
6277
|
+
"crm.segments.showList": "Show list",
|
|
6278
|
+
"crm.segments.hideList": "Hide list",
|
|
6279
|
+
"crm.segments.listCapped": "Showing the first {{shown}}.",
|
|
6132
6280
|
"crm.segments.title": "Segments",
|
|
6133
6281
|
"crm.segments.subtitle": "Named cuts of people \u2014 what a campaign points at, instead of a filter in the URL.",
|
|
6134
6282
|
"crm.segments.new": "New segment",
|
|
@@ -7160,6 +7308,44 @@ var ptBR = {
|
|
|
7160
7308
|
"crm.partners.allUnits": "Todas",
|
|
7161
7309
|
"crm.partners.unitCount": "{{count}} unidade(s)",
|
|
7162
7310
|
"crm.partners.noUnits": "Nenhuma unidade cadastrada. A parceria vale na rede inteira.",
|
|
7311
|
+
"crm.segments.editorDescriptionGroups": "Monte o recorte com condi\xE7\xF5es em tr\xEAs grupos: as que todos precisam atender, as que basta atender uma, e as que excluem.",
|
|
7312
|
+
"crm.segments.audience.label": "Sobre quem \xE9 o recorte",
|
|
7313
|
+
"crm.segments.audience.people": "Pessoas",
|
|
7314
|
+
"crm.segments.audience.deals": "Neg\xF3cios",
|
|
7315
|
+
"crm.segments.audience.peopleHint": "Cadastro da pessoa: tipo, etiquetas, cidade, anivers\xE1rio, compras.",
|
|
7316
|
+
"crm.segments.audience.dealsHint": "O funil: etapa, unidade, status, respons\xE1vel e etiquetas do neg\xF3cio. A campanha fala com os contatos de cada neg\xF3cio.",
|
|
7317
|
+
"crm.segments.group.where": "Precisa atender TODAS",
|
|
7318
|
+
"crm.segments.group.whereHint": "E",
|
|
7319
|
+
"crm.segments.group.any": "Basta atender UMA destas",
|
|
7320
|
+
"crm.segments.group.anyHint": "OU \u2014 deixe vazio se n\xE3o precisar",
|
|
7321
|
+
"crm.segments.group.none": "N\xC3O pode atender nenhuma destas",
|
|
7322
|
+
"crm.segments.group.noneHint": "exclus\xE3o",
|
|
7323
|
+
"crm.segments.group.anyShort": "uma de",
|
|
7324
|
+
"crm.segments.group.noneShort": "exceto",
|
|
7325
|
+
"crm.segments.pick": "Escolher\u2026",
|
|
7326
|
+
"crm.segments.search": "Buscar\u2026",
|
|
7327
|
+
"crm.segments.noOptions": "Nada encontrado",
|
|
7328
|
+
"crm.segments.previewIncomplete": "Complete as condi\xE7\xF5es para ver quantos entram.",
|
|
7329
|
+
"crm.segments.previewDeals": "{{deals}} neg\xF3cios agora \xB7 {{people}} pessoas",
|
|
7330
|
+
"crm.segments.previewPeople": "{{count}} pessoas agora",
|
|
7331
|
+
"crm.segments.field.stage": "Etapa do funil",
|
|
7332
|
+
"crm.segments.field.dealStatus": "Situa\xE7\xE3o do neg\xF3cio",
|
|
7333
|
+
"crm.segments.field.unit": "Unidade",
|
|
7334
|
+
"crm.segments.field.owner": "Respons\xE1vel",
|
|
7335
|
+
"crm.segments.field.value": "Valor",
|
|
7336
|
+
"crm.segments.field.dealCreatedAt": "Neg\xF3cio criado",
|
|
7337
|
+
"crm.segments.field.dealUpdatedAt": "Neg\xF3cio mexido",
|
|
7338
|
+
"crm.segments.op.has_any_tag": "tem alguma das etiquetas",
|
|
7339
|
+
"crm.segments.rule.hasAnyTag": "tem alguma de: {{value}}",
|
|
7340
|
+
"crm.segments.dealStatus.open": "Aberto",
|
|
7341
|
+
"crm.segments.dealStatus.won": "Ganho",
|
|
7342
|
+
"crm.segments.dealStatus.lost": "Perdido",
|
|
7343
|
+
"crm.segments.dealStatus.archived": "Arquivado",
|
|
7344
|
+
"crm.segments.kind.lead": "Lead",
|
|
7345
|
+
"crm.segments.kind.customer": "Cliente",
|
|
7346
|
+
"crm.segments.showList": "Ver lista",
|
|
7347
|
+
"crm.segments.hideList": "Ocultar lista",
|
|
7348
|
+
"crm.segments.listCapped": "Mostrando os primeiros {{shown}}.",
|
|
7163
7349
|
"crm.segments.title": "Segmentos",
|
|
7164
7350
|
"crm.segments.subtitle": "Recortes de pessoas com nome \u2014 o que uma campanha aponta, em vez de um filtro no endere\xE7o.",
|
|
7165
7351
|
"crm.segments.new": "Novo segmento",
|
|
@@ -7834,9 +8020,9 @@ var crmV1SettingsTabs = [
|
|
|
7834
8020
|
];
|
|
7835
8021
|
|
|
7836
8022
|
// src/index.ts
|
|
7837
|
-
var CrmPage =
|
|
8023
|
+
var CrmPage = React2.lazy(() => import('./CrmPage-H3FQDF53.js').then((m) => ({ default: m.CrmPage })));
|
|
7838
8024
|
var CrmGeneralSettings = lazyComponent(() => import('./CrmGeneralSettings-6XPS3L42.js').then((m) => m.CrmGeneralSettings));
|
|
7839
|
-
var SegmentsView = lazyComponent(() => import('./SegmentsView-
|
|
8025
|
+
var SegmentsView = lazyComponent(() => import('./SegmentsView-JTFU6XWD.js').then((m) => m.SegmentsView));
|
|
7840
8026
|
var DEFAULT_LABELS = {
|
|
7841
8027
|
pageTitle: "Sales",
|
|
7842
8028
|
pageSubtitle: "CRM, leads, deals, and pipeline management"
|
|
@@ -7879,6 +8065,11 @@ function resolveConfig(options) {
|
|
|
7879
8065
|
talkChannel: options?.talkChannel ?? "whatsapp"
|
|
7880
8066
|
};
|
|
7881
8067
|
}
|
|
8068
|
+
var segmentsSurface = null;
|
|
8069
|
+
function CrmSegmentsSurface() {
|
|
8070
|
+
const Surface = segmentsSurface;
|
|
8071
|
+
return Surface ? React2.createElement(Surface) : null;
|
|
8072
|
+
}
|
|
7882
8073
|
function createCrmPlugin(options) {
|
|
7883
8074
|
const config = resolveConfig(options);
|
|
7884
8075
|
registerTranslations(crmLocales);
|
|
@@ -7891,7 +8082,8 @@ function createCrmPlugin(options) {
|
|
|
7891
8082
|
() => createMockCrmProvider({ activityTypes })
|
|
7892
8083
|
);
|
|
7893
8084
|
const store = createCrmStore(provider);
|
|
7894
|
-
|
|
8085
|
+
segmentsSurface = () => React2.createElement(CrmContextProvider, { config, provider, store }, React2.createElement(SegmentsView));
|
|
8086
|
+
const PageComponent = () => React2.createElement(CrmPage, { config, provider, store, registries: crmRegistries });
|
|
7895
8087
|
const dashboardWidgets = createCrmDashboardWidgets({ config, provider, store });
|
|
7896
8088
|
const vocab = customerVocabulary(options?.tenantVerticalId);
|
|
7897
8089
|
const customerOne = config.labels.customersSingular ?? vocab.one;
|
|
@@ -8416,12 +8608,12 @@ function createCrmPlugin(options) {
|
|
|
8416
8608
|
label: "Sales & CRM",
|
|
8417
8609
|
icon: "Filter",
|
|
8418
8610
|
component: (() => {
|
|
8419
|
-
const Tab = () =>
|
|
8611
|
+
const Tab = () => React2.createElement(
|
|
8420
8612
|
CrmContextProvider,
|
|
8421
8613
|
{ config, provider, store },
|
|
8422
|
-
|
|
8614
|
+
React2.createElement(PluginSettingsPanel, {
|
|
8423
8615
|
title: "Sales & CRM",
|
|
8424
|
-
generalSettings:
|
|
8616
|
+
generalSettings: React2.createElement(CrmGeneralSettings),
|
|
8425
8617
|
// Segmento é CADASTRO, e mora onde os outros moram. Etapas do
|
|
8426
8618
|
// funil, origens, parcerias e tags já estão aqui; ter o recorte
|
|
8427
8619
|
// fora, no rail de trabalho diário, era a inconsistência.
|
|
@@ -8429,7 +8621,7 @@ function createCrmPlugin(options) {
|
|
|
8429
8621
|
id: "segments",
|
|
8430
8622
|
label: "Segmentos",
|
|
8431
8623
|
icon: "Filter",
|
|
8432
|
-
content:
|
|
8624
|
+
content: React2.createElement(SegmentsView)
|
|
8433
8625
|
}],
|
|
8434
8626
|
registries: crmRegistries,
|
|
8435
8627
|
hostPluginId: "crm",
|
|
@@ -8462,6 +8654,6 @@ function createCrmPlugin(options) {
|
|
|
8462
8654
|
};
|
|
8463
8655
|
}
|
|
8464
8656
|
|
|
8465
|
-
export { buildCrmCustomerEntity, buildCrmDomainEvents, buildCrmMessageDefaults, createCrmPlugin, customerVocabulary };
|
|
8657
|
+
export { CrmSegmentsSurface, buildCrmCustomerEntity, buildCrmDomainEvents, buildCrmMessageDefaults, createCrmPlugin, customerVocabulary };
|
|
8466
8658
|
//# sourceMappingURL=index.js.map
|
|
8467
8659
|
//# sourceMappingURL=index.js.map
|