@iann29/rastro 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/agent/integration.md +23 -1
- package/agent/manifest.json +4 -4
- package/dist/client/federation.d.ts +114 -9
- package/dist/client/federation.d.ts.map +1 -1
- package/dist/client/federation.js +54 -2
- package/dist/client/federation.js.map +1 -1
- package/dist/client/index.d.ts +642 -8
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +391 -9
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +14 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +278 -1
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/_generated/server.d.ts +4 -0
- package/dist/component/_generated/server.d.ts.map +1 -1
- package/dist/component/_generated/server.js.map +1 -1
- package/dist/component/constants.d.ts +5 -0
- package/dist/component/constants.d.ts.map +1 -1
- package/dist/component/constants.js +10 -0
- package/dist/component/constants.js.map +1 -1
- package/dist/component/convex.config.d.ts +4 -0
- package/dist/component/convex.config.js +9 -0
- package/dist/component/convex.config.js.map +1 -1
- package/dist/component/errors.d.ts +1 -1
- package/dist/component/errors.d.ts.map +1 -1
- package/dist/component/errors.js.map +1 -1
- package/dist/component/leads.d.ts +69 -3
- package/dist/component/leads.d.ts.map +1 -1
- package/dist/component/leads.js +419 -16
- package/dist/component/leads.js.map +1 -1
- package/dist/component/meta.d.ts +358 -0
- package/dist/component/meta.d.ts.map +1 -0
- package/dist/component/meta.js +1295 -0
- package/dist/component/meta.js.map +1 -0
- package/dist/component/metaCapi.d.ts +162 -0
- package/dist/component/metaCapi.d.ts.map +1 -0
- package/dist/component/metaCapi.js +754 -0
- package/dist/component/metaCapi.js.map +1 -0
- package/dist/component/metaFake.d.ts +5 -0
- package/dist/component/metaFake.d.ts.map +1 -0
- package/dist/component/metaFake.js +225 -0
- package/dist/component/metaFake.js.map +1 -0
- package/dist/component/metaGraph.d.ts +165 -0
- package/dist/component/metaGraph.d.ts.map +1 -0
- package/dist/component/metaGraph.js +507 -0
- package/dist/component/metaGraph.js.map +1 -0
- package/dist/component/metaSync.d.ts +186 -0
- package/dist/component/metaSync.d.ts.map +1 -0
- package/dist/component/metaSync.js +961 -0
- package/dist/component/metaSync.js.map +1 -0
- package/dist/component/pipeline.d.ts +99 -0
- package/dist/component/pipeline.d.ts.map +1 -0
- package/dist/component/pipeline.js +337 -0
- package/dist/component/pipeline.js.map +1 -0
- package/dist/component/schema.d.ts +404 -2
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +168 -2
- package/dist/component/schema.js.map +1 -1
- package/dist/component/secrets.d.ts +15 -0
- package/dist/component/secrets.d.ts.map +1 -0
- package/dist/component/secrets.js +67 -0
- package/dist/component/secrets.js.map +1 -0
- package/dist/component/validators.d.ts +1052 -15
- package/dist/component/validators.d.ts.map +1 -1
- package/dist/component/validators.js +307 -3
- package/dist/component/validators.js.map +1 -1
- package/dist/tracker/generated.d.ts +1 -1
- package/dist/tracker/generated.d.ts.map +1 -1
- package/dist/tracker/generated.js +1 -1
- package/dist/tracker/generated.js.map +1 -1
- package/dist/ui/campaigns/CampaignsView.d.ts +48 -0
- package/dist/ui/campaigns/CampaignsView.d.ts.map +1 -0
- package/dist/ui/campaigns/CampaignsView.js +47 -0
- package/dist/ui/campaigns/CampaignsView.js.map +1 -0
- package/dist/ui/campaigns/Conversions.d.ts +16 -0
- package/dist/ui/campaigns/Conversions.d.ts.map +1 -0
- package/dist/ui/campaigns/Conversions.js +40 -0
- package/dist/ui/campaigns/Conversions.js.map +1 -0
- package/dist/ui/campaigns/Drawer.d.ts +24 -0
- package/dist/ui/campaigns/Drawer.d.ts.map +1 -0
- package/dist/ui/campaigns/Drawer.js +120 -0
- package/dist/ui/campaigns/Drawer.js.map +1 -0
- package/dist/ui/campaigns/Icons.d.ts +35 -0
- package/dist/ui/campaigns/Icons.d.ts.map +1 -0
- package/dist/ui/campaigns/Icons.js +41 -0
- package/dist/ui/campaigns/Icons.js.map +1 -0
- package/dist/ui/campaigns/Summary.d.ts +21 -0
- package/dist/ui/campaigns/Summary.d.ts.map +1 -0
- package/dist/ui/campaigns/Summary.js +56 -0
- package/dist/ui/campaigns/Summary.js.map +1 -0
- package/dist/ui/campaigns/Thumbnail.d.ts +11 -0
- package/dist/ui/campaigns/Thumbnail.d.ts.map +1 -0
- package/dist/ui/campaigns/Thumbnail.js +23 -0
- package/dist/ui/campaigns/Thumbnail.js.map +1 -0
- package/dist/ui/campaigns/Tree.d.ts +12 -0
- package/dist/ui/campaigns/Tree.d.ts.map +1 -0
- package/dist/ui/campaigns/Tree.js +105 -0
- package/dist/ui/campaigns/Tree.js.map +1 -0
- package/dist/ui/campaigns/glyphs.d.ts +20 -0
- package/dist/ui/campaigns/glyphs.d.ts.map +1 -0
- package/dist/ui/campaigns/glyphs.js +19 -0
- package/dist/ui/campaigns/glyphs.js.map +1 -0
- package/dist/ui/campaigns/index.d.ts +4 -0
- package/dist/ui/campaigns/index.d.ts.map +1 -0
- package/dist/ui/campaigns/index.js +3 -0
- package/dist/ui/campaigns/index.js.map +1 -0
- package/dist/ui/campaigns/labels.d.ts +53 -0
- package/dist/ui/campaigns/labels.d.ts.map +1 -0
- package/dist/ui/campaigns/labels.js +169 -0
- package/dist/ui/campaigns/labels.js.map +1 -0
- package/dist/ui/campaigns/model.d.ts +99 -0
- package/dist/ui/campaigns/model.d.ts.map +1 -0
- package/dist/ui/campaigns/model.js +230 -0
- package/dist/ui/campaigns/model.js.map +1 -0
- package/dist/ui/campaigns/modes.d.ts +18 -0
- package/dist/ui/campaigns/modes.d.ts.map +1 -0
- package/dist/ui/campaigns/modes.js +7 -0
- package/dist/ui/campaigns/modes.js.map +1 -0
- package/dist/ui/index.d.ts +21 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +20 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/integrations/AccountPicker.d.ts +26 -0
- package/dist/ui/integrations/AccountPicker.d.ts.map +1 -0
- package/dist/ui/integrations/AccountPicker.js +101 -0
- package/dist/ui/integrations/AccountPicker.js.map +1 -0
- package/dist/ui/integrations/ClientCards.d.ts +17 -0
- package/dist/ui/integrations/ClientCards.d.ts.map +1 -0
- package/dist/ui/integrations/ClientCards.js +42 -0
- package/dist/ui/integrations/ClientCards.js.map +1 -0
- package/dist/ui/integrations/ClientsTable.d.ts +36 -0
- package/dist/ui/integrations/ClientsTable.d.ts.map +1 -0
- package/dist/ui/integrations/ClientsTable.js +143 -0
- package/dist/ui/integrations/ClientsTable.js.map +1 -0
- package/dist/ui/integrations/Connect.d.ts +35 -0
- package/dist/ui/integrations/Connect.d.ts.map +1 -0
- package/dist/ui/integrations/Connect.js +62 -0
- package/dist/ui/integrations/Connect.js.map +1 -0
- package/dist/ui/integrations/Connection.d.ts +37 -0
- package/dist/ui/integrations/Connection.d.ts.map +1 -0
- package/dist/ui/integrations/Connection.js +108 -0
- package/dist/ui/integrations/Connection.js.map +1 -0
- package/dist/ui/integrations/Dialogs.d.ts +21 -0
- package/dist/ui/integrations/Dialogs.d.ts.map +1 -0
- package/dist/ui/integrations/Dialogs.js +34 -0
- package/dist/ui/integrations/Dialogs.js.map +1 -0
- package/dist/ui/integrations/EventsFeed.d.ts +15 -0
- package/dist/ui/integrations/EventsFeed.d.ts.map +1 -0
- package/dist/ui/integrations/EventsFeed.js +61 -0
- package/dist/ui/integrations/EventsFeed.js.map +1 -0
- package/dist/ui/integrations/EventsSheet.d.ts +34 -0
- package/dist/ui/integrations/EventsSheet.d.ts.map +1 -0
- package/dist/ui/integrations/EventsSheet.js +136 -0
- package/dist/ui/integrations/EventsSheet.js.map +1 -0
- package/dist/ui/integrations/Icons.d.ts +38 -0
- package/dist/ui/integrations/Icons.d.ts.map +1 -0
- package/dist/ui/integrations/Icons.js +40 -0
- package/dist/ui/integrations/Icons.js.map +1 -0
- package/dist/ui/integrations/IntegrationsView.d.ts +15 -0
- package/dist/ui/integrations/IntegrationsView.d.ts.map +1 -0
- package/dist/ui/integrations/IntegrationsView.js +141 -0
- package/dist/ui/integrations/IntegrationsView.js.map +1 -0
- package/dist/ui/integrations/Overlay.d.ts +18 -0
- package/dist/ui/integrations/Overlay.d.ts.map +1 -0
- package/dist/ui/integrations/Overlay.js +36 -0
- package/dist/ui/integrations/Overlay.js.map +1 -0
- package/dist/ui/integrations/Partner.d.ts +14 -0
- package/dist/ui/integrations/Partner.d.ts.map +1 -0
- package/dist/ui/integrations/Partner.js +38 -0
- package/dist/ui/integrations/Partner.js.map +1 -0
- package/dist/ui/integrations/RowMenu.d.ts +15 -0
- package/dist/ui/integrations/RowMenu.d.ts.map +1 -0
- package/dist/ui/integrations/RowMenu.js +47 -0
- package/dist/ui/integrations/RowMenu.js.map +1 -0
- package/dist/ui/integrations/UnlinkDialog.d.ts +18 -0
- package/dist/ui/integrations/UnlinkDialog.d.ts.map +1 -0
- package/dist/ui/integrations/UnlinkDialog.js +29 -0
- package/dist/ui/integrations/UnlinkDialog.js.map +1 -0
- package/dist/ui/integrations/audience.d.ts +12 -0
- package/dist/ui/integrations/audience.d.ts.map +1 -0
- package/dist/ui/integrations/audience.js +12 -0
- package/dist/ui/integrations/audience.js.map +1 -0
- package/dist/ui/integrations/format.d.ts +28 -0
- package/dist/ui/integrations/format.d.ts.map +1 -0
- package/dist/ui/integrations/format.js +101 -0
- package/dist/ui/integrations/format.js.map +1 -0
- package/dist/ui/integrations/index.d.ts +5 -0
- package/dist/ui/integrations/index.d.ts.map +1 -0
- package/dist/ui/integrations/index.js +3 -0
- package/dist/ui/integrations/index.js.map +1 -0
- package/dist/ui/integrations/modal.d.ts +10 -0
- package/dist/ui/integrations/modal.d.ts.map +1 -0
- package/dist/ui/integrations/modal.js +77 -0
- package/dist/ui/integrations/modal.js.map +1 -0
- package/dist/ui/integrations/model.d.ts +99 -0
- package/dist/ui/integrations/model.d.ts.map +1 -0
- package/dist/ui/integrations/model.js +164 -0
- package/dist/ui/integrations/model.js.map +1 -0
- package/dist/ui/integrations/parts.d.ts +36 -0
- package/dist/ui/integrations/parts.d.ts.map +1 -0
- package/dist/ui/integrations/parts.js +85 -0
- package/dist/ui/integrations/parts.js.map +1 -0
- package/dist/ui/integrations/types.d.ts +146 -0
- package/dist/ui/integrations/types.d.ts.map +1 -0
- package/dist/ui/integrations/types.js +2 -0
- package/dist/ui/integrations/types.js.map +1 -0
- package/dist/ui/metrics.d.ts +106 -0
- package/dist/ui/metrics.d.ts.map +1 -0
- package/dist/ui/metrics.js +166 -0
- package/dist/ui/metrics.js.map +1 -0
- package/dist/ui/portfolio/PortfolioView.d.ts +26 -0
- package/dist/ui/portfolio/PortfolioView.d.ts.map +1 -0
- package/dist/ui/portfolio/PortfolioView.js +216 -0
- package/dist/ui/portfolio/PortfolioView.js.map +1 -0
- package/dist/ui/portfolio/SpendChart.d.ts +10 -0
- package/dist/ui/portfolio/SpendChart.d.ts.map +1 -0
- package/dist/ui/portfolio/SpendChart.js +196 -0
- package/dist/ui/portfolio/SpendChart.js.map +1 -0
- package/dist/ui/portfolio/alerts.d.ts +74 -0
- package/dist/ui/portfolio/alerts.d.ts.map +1 -0
- package/dist/ui/portfolio/alerts.js +291 -0
- package/dist/ui/portfolio/alerts.js.map +1 -0
- package/dist/ui/portfolio/figures.d.ts +79 -0
- package/dist/ui/portfolio/figures.d.ts.map +1 -0
- package/dist/ui/portfolio/figures.js +103 -0
- package/dist/ui/portfolio/figures.js.map +1 -0
- package/dist/ui/portfolio/format.d.ts +8 -0
- package/dist/ui/portfolio/format.d.ts.map +1 -0
- package/dist/ui/portfolio/format.js +28 -0
- package/dist/ui/portfolio/format.js.map +1 -0
- package/dist/ui/sample.d.ts +536 -0
- package/dist/ui/sample.d.ts.map +1 -0
- package/dist/ui/sample.js +574 -0
- package/dist/ui/sample.js.map +1 -0
- package/dist/ui/seed.d.ts +188 -0
- package/dist/ui/seed.d.ts.map +1 -0
- package/dist/ui/seed.js +563 -0
- package/dist/ui/seed.js.map +1 -0
- package/dist/ui/ui.css +3424 -0
- package/docs/federation.md +46 -1
- package/docs/meta-ads.md +795 -0
- package/docs/upgrading.md +116 -0
- package/llms.txt +3 -0
- package/package.json +15 -3
- package/src/component/_generated/api.ts +14 -0
- package/src/component/_generated/component.ts +324 -1
- package/src/component/_generated/server.ts +4 -0
- package/src/component/constants.ts +10 -0
- package/src/component/convex.config.ts +9 -0
- package/src/component/errors.ts +5 -1
- package/src/component/leads.ts +517 -17
- package/src/component/meta.ts +1525 -0
- package/src/component/metaCapi.ts +921 -0
- package/src/component/metaFake.ts +277 -0
- package/src/component/metaGraph.ts +722 -0
- package/src/component/metaSync.ts +1164 -0
- package/src/component/pipeline.ts +410 -0
- package/src/component/schema.ts +197 -1
- package/src/component/secrets.ts +98 -0
- package/src/component/validators.ts +376 -3
- package/src/tracker/generated.ts +1 -1
- package/src/ui/seed.ts +755 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { formatMoney } from "../metrics.js";
|
|
3
|
+
import { useBusiness } from "./audience.js";
|
|
4
|
+
import { plural, sentAgo } from "./format.js";
|
|
5
|
+
import { Icon } from "./Icons.js";
|
|
6
|
+
import { Avatar, Pill } from "./parts.js";
|
|
7
|
+
/** What each Meta event is called on screen. */
|
|
8
|
+
export const EVENT_LABELS = {
|
|
9
|
+
Purchase: "Compra",
|
|
10
|
+
QualifiedLead: "Lead qualificado",
|
|
11
|
+
Lead: "Lead",
|
|
12
|
+
Schedule: "Agendamento",
|
|
13
|
+
};
|
|
14
|
+
const FEMININE = new Set(["Purchase"]);
|
|
15
|
+
/** "enviada há 18 min", "enviado há 41 min", "na fila", "falhou". */
|
|
16
|
+
export function deliveryLabel(event, now) {
|
|
17
|
+
if (event.status === "pending")
|
|
18
|
+
return "na fila";
|
|
19
|
+
if (event.status === "failed")
|
|
20
|
+
return "falhou";
|
|
21
|
+
const verb = FEMININE.has(event.eventName) ? "enviada" : "enviado";
|
|
22
|
+
return `${verb} ${sentAgo(event.sentAt ?? event.createdAt, now)}`;
|
|
23
|
+
}
|
|
24
|
+
const FEED_ROWS = 3;
|
|
25
|
+
const DAY_MS = 86_400_000;
|
|
26
|
+
const BRT_OFFSET_MS = 3 * 3_600_000;
|
|
27
|
+
/** B3, bottom: the latest events every client's pixel received. */
|
|
28
|
+
export function EventsFeed({ sites, conversions, adNames, sentBySite, currency, now, }) {
|
|
29
|
+
const business = useBusiness();
|
|
30
|
+
const slots = new Map(sites.map((site, index) => [site.siteId, index]));
|
|
31
|
+
const events = sites
|
|
32
|
+
.flatMap((site) => (conversions[site.siteId] ?? []).map((event) => ({ site, event })))
|
|
33
|
+
.sort((left, right) => right.event.createdAt - left.event.createdAt);
|
|
34
|
+
if (events.length === 0)
|
|
35
|
+
return null;
|
|
36
|
+
// Midnight in Brasília (UTC−3), where the rest of the screen tells time.
|
|
37
|
+
const startOfDay = Math.floor((now - BRT_OFFSET_MS) / DAY_MS) * DAY_MS + BRT_OFFSET_MS;
|
|
38
|
+
const today = events.filter(({ event }) => event.createdAt >= startOfDay);
|
|
39
|
+
// The host's own count of today when it sends one; else the events on hand.
|
|
40
|
+
const counted = sites.map((site) => sentBySite?.[site.siteId]?.today);
|
|
41
|
+
const known = counted.some(Boolean);
|
|
42
|
+
const sentToday = known
|
|
43
|
+
? counted.reduce((sum, day) => sum + (day?.sent ?? 0), 0)
|
|
44
|
+
: today.filter(({ event }) => event.status === "sent").length;
|
|
45
|
+
// Hosts count what Meta accepted; failures come from the events on hand
|
|
46
|
+
// unless the host counts them too.
|
|
47
|
+
const failedToday = known && counted.every((day) => day?.failed !== undefined)
|
|
48
|
+
? counted.reduce((sum, day) => sum + (day?.failed ?? 0), 0)
|
|
49
|
+
: today.filter(({ event }) => event.status === "failed").length;
|
|
50
|
+
return (_jsxs("section", { className: "rastro-integrations__card rastro-integrations__feed", "aria-labelledby": "rastro-integrations-feed", children: [_jsxs("header", { className: "rastro-integrations__section-head", children: [_jsxs("div", { children: [_jsx("h3", { id: "rastro-integrations-feed", className: "rastro-integrations__title", children: "\u00DAltimos eventos devolvidos \u00E0 Meta" }), _jsx("p", { className: "rastro-integrations__desc", children: business
|
|
51
|
+
? "Cada venda registrada vira Compra, com valor, no seu pixel"
|
|
52
|
+
: "Todos os clientes · cada venda vira Compra com valor no pixel do cliente" })] }), _jsxs(Pill, { tone: failedToday > 0 ? "bad" : "ok", icon: "check", children: [plural(sentToday, "enviado", "enviados"), " hoje \u00B7", " ", plural(failedToday, "falha", "falhas")] })] }), _jsx("table", { className: "rastro-integrations__table", "data-mode": "feed", children: _jsx("tbody", { children: events.slice(0, FEED_ROWS).map(({ site, event }) => (_jsxs("tr", { children: [_jsx("td", { "data-col": "icon", children: _jsx(Icon, { name: "send", size: 14 }) }), _jsx("td", { children: _jsxs("span", { className: "rastro-integrations__evt", children: [EVENT_LABELS[event.eventName], " ", _jsx("i", { children: event.eventName })] }) }), _jsx("td", { children: [
|
|
53
|
+
event.leadLabel,
|
|
54
|
+
event.valueCents !== null
|
|
55
|
+
? formatMoney(event.valueCents, currency)
|
|
56
|
+
: null,
|
|
57
|
+
]
|
|
58
|
+
.filter(Boolean)
|
|
59
|
+
.join(" · ") || "—" }), _jsx("td", { children: _jsxs("span", { className: "rastro-integrations__client", "data-size": "sm", children: [_jsx(Avatar, { name: site.name, slot: slots.get(site.siteId) ?? 0, size: "sm" }), site.name] }) }), _jsx("td", { "data-col": "ad", children: event.adName ?? ((event.adId && adNames?.[event.adId]) || "") }), _jsx("td", { "data-col": "when", children: deliveryLabel(event, now) })] }, `${site.siteId}:${event.eventId}`))) }) })] }));
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=EventsFeed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsFeed.js","sourceRoot":"","sources":["../../../src/ui/integrations/EventsFeed.ts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;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ClientRow } from "./model.js";
|
|
2
|
+
import type { EventMap, EventMapChoice, IntegrationConversion, IntegrationSite } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* B5/M2: which board columns send what to the client's pixel. A sale always
|
|
5
|
+
* goes as Compra with its value (fixed first row); each column may send Lead,
|
|
6
|
+
* Lead qualificado or Agendamento, once per lead.
|
|
7
|
+
*/
|
|
8
|
+
export declare function EventsSheet({ row, slot, eventMap, conversions, pages, onLoadOlder, currency, boardLabel, permitted, busy, onSave, copyTargets, onCopy, onPlanB, onClose, now, }: {
|
|
9
|
+
row: ClientRow;
|
|
10
|
+
slot: number;
|
|
11
|
+
eventMap: EventMap | undefined;
|
|
12
|
+
conversions: readonly IntegrationConversion[];
|
|
13
|
+
/** Whether the host has older events, and whether a page is loading. */
|
|
14
|
+
pages?: {
|
|
15
|
+
hasMore: boolean;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
} | undefined;
|
|
18
|
+
onLoadOlder?: (() => void) | undefined;
|
|
19
|
+
currency: string;
|
|
20
|
+
boardLabel: string;
|
|
21
|
+
permitted: boolean;
|
|
22
|
+
busy: boolean;
|
|
23
|
+
onSave: (map: EventMapChoice) => void;
|
|
24
|
+
/**
|
|
25
|
+
* The other clients the same map fits (same columns, a pixel not another
|
|
26
|
+
* owner's): "Usar o mesmo mapa nos outros 3 clientes".
|
|
27
|
+
*/
|
|
28
|
+
copyTargets?: readonly IntegrationSite[];
|
|
29
|
+
onCopy?: ((siteIds: string[], map: EventMapChoice) => void) | undefined;
|
|
30
|
+
onPlanB: () => void;
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
now: number;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=EventsSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsSheet.d.ts","sourceRoot":"","sources":["../../../src/ui/integrations/Events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
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useRef, useState } from "react";
|
|
3
|
+
import { formatMoney } from "../metrics.js";
|
|
4
|
+
import { useBusiness, useProductName } from "./audience.js";
|
|
5
|
+
import { EVENT_LABELS } from "./EventsFeed.js";
|
|
6
|
+
import { pixelDigits, pixelShort, plural, sentAgo } from "./format.js";
|
|
7
|
+
import { Icon, MetaMark } from "./Icons.js";
|
|
8
|
+
import { Overlay } from "./Overlay.js";
|
|
9
|
+
import { Avatar, Pill, TestModeNote } from "./parts.js";
|
|
10
|
+
const COLUMN_EVENTS = ["Lead", "QualifiedLead", "Schedule"];
|
|
11
|
+
const FEED_ROWS = 3;
|
|
12
|
+
const MORE_ROWS = 10;
|
|
13
|
+
/** Columns in board order, gathered under their block when they have one. */
|
|
14
|
+
function groupsOf(columns) {
|
|
15
|
+
const groups = [];
|
|
16
|
+
for (const column of columns) {
|
|
17
|
+
const name = column.group ?? null;
|
|
18
|
+
const last = groups.at(-1);
|
|
19
|
+
if (last && last.name === name)
|
|
20
|
+
last.columns.push(column);
|
|
21
|
+
else
|
|
22
|
+
groups.push({ name, columns: [column] });
|
|
23
|
+
}
|
|
24
|
+
return groups;
|
|
25
|
+
}
|
|
26
|
+
function EventSelect({ id, label, value, disabled, onChange, }) {
|
|
27
|
+
return (_jsxs("span", { className: "rastro-integrations__select", "data-tone": value ? "on" : "none", children: [_jsxs("select", { id: id, "aria-label": label, value: value ?? "", disabled: disabled, onChange: (event) => onChange((event.target.value || null)), children: [_jsx("option", { value: "", children: "N\u00E3o enviar \u00E0 Meta" }), COLUMN_EVENTS.map((name) => (_jsx("option", { value: name, children: EVENT_LABELS[name] }, name)))] }), _jsx(Icon, { name: "chevronDown", size: 14 })] }));
|
|
28
|
+
}
|
|
29
|
+
function Check({ checked, disabled, label, onChange, }) {
|
|
30
|
+
return (_jsxs("span", { className: "rastro-integrations__check", children: [_jsx("input", { type: "checkbox", checked: checked, disabled: disabled, "aria-label": label, onChange: (event) => onChange?.(event.target.checked) }), _jsx(Icon, { name: "check", size: 12 })] }));
|
|
31
|
+
}
|
|
32
|
+
/** "no outro cliente", "nos outros 3 clientes". */
|
|
33
|
+
const copyLabel = (count) => count === 1 ? "no outro cliente" : `nos outros ${count} clientes`;
|
|
34
|
+
/** "Últimos 30 dias: 41 Compras e 118 Leads qualificados enviados · 0 falhas". */
|
|
35
|
+
function sentLine(sent, { short = false } = {}) {
|
|
36
|
+
if (!sent)
|
|
37
|
+
return null;
|
|
38
|
+
const parts = [
|
|
39
|
+
sent.Purchase ? plural(sent.Purchase, "Compra", "Compras") : null,
|
|
40
|
+
sent.QualifiedLead
|
|
41
|
+
? plural(sent.QualifiedLead, short ? "qualificado" : "Lead qualificado", short ? "qualificados" : "Leads qualificados")
|
|
42
|
+
: null,
|
|
43
|
+
sent.Schedule ? plural(sent.Schedule, "Agendamento", "Agendamentos") : null,
|
|
44
|
+
sent.Lead ? plural(sent.Lead, "Lead", "Leads") : null,
|
|
45
|
+
].filter(Boolean);
|
|
46
|
+
// A host that counts what Meta accepted may not count failures: then the
|
|
47
|
+
// line says nothing about them instead of a made-up zero.
|
|
48
|
+
const failed = sent.failed === undefined
|
|
49
|
+
? ""
|
|
50
|
+
: ` · ${plural(sent.failed, "falha", "falhas")}`;
|
|
51
|
+
if (parts.length === 0)
|
|
52
|
+
return `${short ? "30 dias" : "Últimos 30 dias"}: nada enviado${failed}`;
|
|
53
|
+
const list = parts.length === 1
|
|
54
|
+
? parts[0]
|
|
55
|
+
: `${parts.slice(0, -1).join(", ")} e ${parts.at(-1)}`;
|
|
56
|
+
return `${short ? "30 dias" : "Últimos 30 dias"}: ${list}${short ? "" : " enviados"}${failed}`;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* B5/M2: which board columns send what to the client's pixel. A sale always
|
|
60
|
+
* goes as Compra with its value (fixed first row); each column may send Lead,
|
|
61
|
+
* Lead qualificado or Agendamento, once per lead.
|
|
62
|
+
*/
|
|
63
|
+
export function EventsSheet({ row, slot, eventMap, conversions, pages, onLoadOlder, currency, boardLabel, permitted, busy, onSave, copyTargets = [], onCopy, onPlanB, onClose, now, }) {
|
|
64
|
+
const id = useId();
|
|
65
|
+
const close = useRef(null);
|
|
66
|
+
const [choices, setChoices] = useState(() => Object.fromEntries((eventMap?.columns ?? []).map((column) => [column.key, column.event])));
|
|
67
|
+
const [sendLead, setSendLead] = useState(eventMap?.sendLeadEvent ?? false);
|
|
68
|
+
// The latest three, then "Ver mais" ten at a time: from what is loaded,
|
|
69
|
+
// and past it the host's next page (keyset by `createdAt` + `eventId`).
|
|
70
|
+
const [shown, setShown] = useState(FEED_ROWS);
|
|
71
|
+
const hiddenLoaded = Math.max(0, conversions.length - shown);
|
|
72
|
+
const canLoadOlder = Boolean(onLoadOlder && pages?.hasMore);
|
|
73
|
+
const showMore = () => {
|
|
74
|
+
const next = shown + MORE_ROWS;
|
|
75
|
+
setShown(next);
|
|
76
|
+
if (next > conversions.length && canLoadOlder && !pages?.loading) {
|
|
77
|
+
onLoadOlder?.();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const choose = (key, value) => setChoices((current) => ({ ...current, [key]: value }));
|
|
81
|
+
const business = useBusiness();
|
|
82
|
+
const product = useProductName();
|
|
83
|
+
// Whoever linked the pixel decides its events (another owner: CONFLICT).
|
|
84
|
+
const lockedBy = row.pixel?.owner ?? null;
|
|
85
|
+
const editable = permitted && Boolean(row.pixel) && Boolean(eventMap) && !lockedBy;
|
|
86
|
+
const [copy, setCopy] = useState(false);
|
|
87
|
+
const canCopy = !business && editable && Boolean(onCopy) && copyTargets.length > 0;
|
|
88
|
+
const columns = eventMap?.columns ?? [];
|
|
89
|
+
const sourceOf = (event) => event.eventName === "Purchase"
|
|
90
|
+
? "Venda registrada"
|
|
91
|
+
: (columns.find((column) => choices[column.key] === event.eventName)
|
|
92
|
+
?.name ?? null);
|
|
93
|
+
const latest = conversions
|
|
94
|
+
.filter((event) => event.status === "sent")
|
|
95
|
+
.sort((a, b) => (b.sentAt ?? 0) - (a.sentAt ?? 0))[0];
|
|
96
|
+
const name = row.site.name;
|
|
97
|
+
const summary = sentLine(row.sent30d);
|
|
98
|
+
return (_jsx(Overlay, { side: true, labelledBy: `${id}-title`, initialFocus: close, onClose: onClose, children: _jsxs("div", { className: "rastro-integrations__sheet", children: [_jsxs("header", { className: "rastro-integrations__sheet-bar", children: [_jsx("button", { type: "button", className: "rastro-integrations__icon-btn", "aria-label": "Voltar", onClick: onClose, children: _jsx(Icon, { name: "chevronRight", size: 20 }) }), _jsxs("strong", { children: ["Eventos \u00B7 ", name] })] }), _jsxs("div", { className: "rastro-integrations__sheet-body", children: [_jsxs("header", { className: "rastro-integrations__sheet-head", children: [_jsx(Avatar, { name: name, slot: slot, size: "lg" }), _jsxs("div", { className: "rastro-integrations__grow", children: [_jsxs("h3", { id: `${id}-title`, className: "rastro-integrations__title", "data-size": "lg", children: ["Eventos devolvidos \u00E0 Meta \u00B7 ", name] }), _jsxs("p", { className: "rastro-integrations__desc", children: ["Quando um lead muda de coluna no ", boardLabel, ", o ", product, " avisa o pixel. A Meta aprende quem compra e procura mais gente assim."] })] }), _jsx("button", { ref: close, type: "button", className: "rastro-integrations__icon-btn", "aria-label": "Fechar", onClick: onClose, children: _jsx(Icon, { name: "x" }) })] }), row.pixel ? (_jsxs("div", { className: "rastro-integrations__pixelbar", children: [_jsx(MetaMark, { size: 16 }), _jsxs("span", { className: "rastro-integrations__grow", children: ["Pixel", " ", _jsx("b", { className: "rastro-integrations__mono", "data-wide": "", children: pixelDigits(row.pixel.pixelId) }), _jsx("b", { className: "rastro-integrations__mono", "data-narrow": "", children: pixelShort(row.pixel.pixelId) }), row.pixel.name && (_jsxs("span", { "data-wide": "", children: [" \u00B7 ", row.pixel.name] }))] }), latest?.sentAt && (_jsxs(Pill, { tone: "ok", icon: "dot", children: [_jsx("span", { "data-wide": "", children: "Recebendo \u00B7 \u00FAltimo evento " }), sentAgo(latest.sentAt, now)] }))] })) : null, row.pixel && row.testMode && _jsx(TestModeNote, { variant: "callout" }), lockedBy && (_jsxs("div", { className: "rastro-integrations__callout", "data-tone": "info", role: "note", children: [_jsx(Icon, { name: "lock", size: 14 }), _jsxs("p", { children: [_jsxs("b", { children: ["Pixel ligado pelo ", lockedBy, "."] }), " Quem ligou o pixel escolhe quais colunas avisam a Meta: voc\u00EA v\u00EA o mapa aqui, mas mudar \u00E9 com ele."] })] })), row.pixel ? null : (_jsxs("div", { className: "rastro-integrations__callout", "data-tone": "warn", children: [_jsx(Icon, { name: "info", size: 14 }), _jsxs("p", { children: [name, " ainda n\u00E3o tem pixel: nada \u00E9 enviado \u00E0 Meta.", " ", business
|
|
99
|
+
? "Ligue um pixel da conexão ou use um token próprio."
|
|
100
|
+
: "Ligue um pixel da conexão na lista de clientes ou use o token próprio do cliente."] }), _jsx("button", { type: "button", className: "rastro-integrations__btn", "data-variant": "outline", "data-size": "sm", disabled: !permitted, onClick: onPlanB, children: "Pixel com token" })] })), _jsxs("div", { className: "rastro-integrations__map", role: "group", "aria-labelledby": `${id}-map`, children: [_jsxs("p", { id: `${id}-map`, className: "rastro-integrations__sec", children: ["Coluna do ", boardLabel, " \u2192 evento da Meta"] }), _jsxs("div", { className: "rastro-integrations__maprow", "data-fixed": "", children: [_jsx(Check, { checked: true, disabled: true, label: "Venda registrada (com valor) sempre envia Compra" }), _jsxs("span", { className: "rastro-integrations__stage", children: [_jsx("span", { className: "rastro-integrations__swatch", "data-fixed": "" }), "Venda registrada"] }), _jsx("span", { className: "rastro-integrations__arrow", children: _jsx(Icon, { name: "arrowRight", size: 14 }) }), _jsx("span", { className: "rastro-integrations__select", "data-tone": "on", "data-static": "", children: _jsx("span", { className: "rastro-integrations__evt", children: "Compra" }) }), _jsxs("span", { className: "rastro-integrations__meta rastro-integrations__map-note", children: [_jsx(Icon, { name: "dollar", size: 12 }), _jsx("span", { "data-wide": "", children: "com o valor da venda" }), _jsx("span", { "data-narrow": "", children: "com valor" })] })] }), !eventMap && (_jsx("div", { className: "rastro-skeleton rastro-integrations__map-skeleton" })), groupsOf(columns).map((group, index) => (_jsxs("div", { className: "rastro-integrations__map-group", children: [group.name && (_jsx("p", { className: "rastro-integrations__group", children: group.name })), group.columns.map((column) => {
|
|
101
|
+
const value = choices[column.key] ?? null;
|
|
102
|
+
return (_jsxs("div", { className: "rastro-integrations__maprow", children: [_jsx(Check, { checked: value !== null, disabled: !editable, label: `Enviar ${column.name} à Meta`, onChange: (checked) => choose(column.key, checked ? "Lead" : null) }), _jsxs("span", { className: "rastro-integrations__stage", children: [_jsx("span", { className: "rastro-integrations__swatch", style: column.color
|
|
103
|
+
? { background: column.color }
|
|
104
|
+
: undefined }), _jsx("span", { className: "rastro-integrations__stage-name", children: column.name }), column.monthCount !== null && (_jsx("span", { className: "rastro-integrations__meta rastro-num", "data-wide": "", children: column.monthCount.toLocaleString("pt-BR") }))] }), _jsx("span", { className: "rastro-integrations__arrow", children: _jsx(Icon, { name: "arrowRight", size: 14 }) }), _jsx(EventSelect, { id: `${id}-${column.key}`, label: `Evento da Meta para ${column.name}`, value: value, disabled: !editable, onChange: (next) => choose(column.key, next) }), _jsx("span", { className: "rastro-integrations__meta rastro-integrations__map-note", "data-wide": "", children: value ? "sem valor" : "" })] }, column.key));
|
|
105
|
+
})] }, `${group.name ?? "none"}:${index}`))), eventMap && columns.length === 0 && (_jsxs("p", { className: "rastro-integrations__desc", children: ["O host ainda n\u00E3o declarou as colunas do ", boardLabel, ": s\u00F3 a venda registrada vai como Compra."] }))] }), _jsxs("div", { className: "rastro-integrations__callout", "data-tone": "info", "data-wide": "", children: [_jsx(Icon, { name: "info", size: 14 }), _jsxs("p", { children: [_jsx("b", { children: "Compra" }), " vai com o valor do neg\u00F3cio em R$;", " ", _jsx("b", { children: "Lead qualificado" }), " vai sem valor. Cada lead conta uma vez por evento, mesmo se voltar e avan\u00E7ar de novo de coluna. Eventos com mais de 7 dias n\u00E3o s\u00E3o enviados."] })] }), _jsxs("label", { className: "rastro-integrations__toggle", "data-wide": "", children: [_jsx(Check, { checked: sendLead, disabled: !editable, label: "Enviar tamb\u00E9m cada contato novo como Lead", onChange: setSendLead }), _jsxs("span", { className: "rastro-integrations__grow", children: [_jsxs("span", { className: "rastro-integrations__toggle-title", children: ["Enviar tamb\u00E9m cada contato novo como", " ", _jsxs("span", { className: "rastro-integrations__evt", children: ["Lead ", _jsx("i", { children: "Lead" })] })] }), _jsx("span", { className: "rastro-integrations__meta", children: sendLead
|
|
106
|
+
? "Ligado: cada contato novo vai como Lead, além da conversa que o anúncio já conta"
|
|
107
|
+
: "Desligado: a Meta já conta a conversa iniciada pelo anúncio" })] })] }), conversions.length > 0 && (_jsxs("div", { className: "rastro-integrations__received", "data-wide": "", children: [_jsxs("p", { className: "rastro-integrations__sec", children: ["O que a Meta recebeu da ", name] }), _jsx("ul", { children: [...conversions]
|
|
108
|
+
.sort((a, b) => b.createdAt - a.createdAt)
|
|
109
|
+
.slice(0, shown)
|
|
110
|
+
.map((event) => {
|
|
111
|
+
const source = sourceOf(event);
|
|
112
|
+
return (_jsxs("li", { "data-status": event.status, children: [_jsx(Icon, { name: event.status === "failed"
|
|
113
|
+
? "alert"
|
|
114
|
+
: event.status === "pending"
|
|
115
|
+
? "clock"
|
|
116
|
+
: "check", size: 14 }), _jsxs("span", { children: [event.leadLabel ?? "Lead", source && (_jsxs("span", { className: "rastro-integrations__meta", children: [" ", "\u00B7 ", source] }))] }), _jsx("span", { children: EVENT_LABELS[event.eventName] }), _jsx("b", { className: "rastro-num", children: event.valueCents !== null
|
|
117
|
+
? formatMoney(event.valueCents, currency)
|
|
118
|
+
: "" }), _jsx("span", { className: "rastro-integrations__meta", children: event.status === "sent"
|
|
119
|
+
? sentAgo(event.sentAt ?? event.createdAt, now)
|
|
120
|
+
: event.status === "pending"
|
|
121
|
+
? "na fila"
|
|
122
|
+
: "falhou" })] }, event.eventId));
|
|
123
|
+
}) }), (hiddenLoaded > 0 || canLoadOlder) && (_jsx("button", { type: "button", className: "rastro-integrations__link rastro-integrations__meta", disabled: pages?.loading, onClick: showMore, children: pages?.loading
|
|
124
|
+
? "Carregando…"
|
|
125
|
+
: hiddenLoaded > 0
|
|
126
|
+
? `Ver mais ${Math.min(hiddenLoaded, MORE_ROWS).toLocaleString("pt-BR")}`
|
|
127
|
+
: "Ver mais antigos" }))] })), summary && (_jsxs("p", { className: "rastro-integrations__meta", "data-narrow": "", children: [_jsx(Icon, { name: "info", size: 12 }), " ", sentLine(row.sent30d, { short: true })] }))] }), _jsxs("footer", { className: "rastro-integrations__sheet-foot", children: [canCopy && (_jsxs("label", { className: "rastro-integrations__copy-map", children: [_jsx(Check, { checked: copy, label: `Usar o mesmo mapa ${copyLabel(copyTargets.length)} (mesmas colunas do ${boardLabel})`, onChange: setCopy }), _jsxs("span", { children: ["Usar o mesmo mapa ", copyLabel(copyTargets.length), " ", _jsxs("span", { className: "rastro-integrations__meta", children: ["(mesmas colunas do ", boardLabel, ")"] })] })] })), summary && (_jsx("span", { className: "rastro-integrations__meta", "data-wide": "", children: summary })), _jsxs("span", { className: "rastro-integrations__foot-actions", children: [_jsx("button", { type: "button", className: "rastro-integrations__btn", "data-variant": "outline", onClick: onClose, children: "Cancelar" }), _jsx("button", { type: "button", className: "rastro-integrations__btn", disabled: !editable || busy, onClick: () => {
|
|
128
|
+
const map = { columns: choices, sendLeadEvent: sendLead };
|
|
129
|
+
onSave(map);
|
|
130
|
+
if (canCopy && copy) {
|
|
131
|
+
onCopy?.(copyTargets.map((site) => site.siteId), map);
|
|
132
|
+
}
|
|
133
|
+
onClose();
|
|
134
|
+
}, children: busy ? "Salvando…" : "Salvar eventos" })] })] })] }) }));
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=EventsSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsSheet.js","sourceRoot":"","sources":["../../../src/ui/integrations/EventsSheet.t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AAC,KAAK,IACJ,OAAO,EAAE,IAAI,EACb,KAAK,EAAE,qBAAqB,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,uBAAuB,UAAU,GAAG,EAC7F,QAAQ,EAAE,OAAO,GACjB,EACF,iDACqB,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,EACrD,gBAAM,SAAS,EAAC,2BAA2B,oCACrB,UAAU,SACzB,IACF,IACD,CACT,EACA,OAAO,IAAI,CACV,eAAM,SAAS,EAAC,2BAA2B,eAAW,EAAE,YACrD,OAAO,GACH,CACR,EACD,gBAAM,SAAS,EAAC,mCAAmC,aACjD,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,0BAA0B,kBACvB,SAAS,EACtB,OAAO,EAAE,OAAO,yBAGT,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,0BAA0B,EACpC,QAAQ,EAAE,CAAC,QAAQ,IAAI,IAAI,EAC3B,OAAO,EAAE,GAAG,EAAE;wCACZ,MAAM,GAAG,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;wCAC1D,MAAM,CAAC,GAAG,CAAC,CAAC;wCACZ,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;4CACpB,MAAM,EAAE,CACN,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EACtC,GAAG,CACJ,CAAC;wCACJ,CAAC;wCACD,OAAO,EAAE,CAAC;oCACZ,CAAC,YAEA,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,GAC/B,IACJ,IACA,IACL,GACE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare const LINES: {
|
|
2
|
+
readonly check: import("react").JSX.Element;
|
|
3
|
+
readonly chevronDown: import("react").JSX.Element;
|
|
4
|
+
readonly chevronRight: import("react").JSX.Element;
|
|
5
|
+
readonly arrowRight: import("react").JSX.Element;
|
|
6
|
+
readonly x: import("react").JSX.Element;
|
|
7
|
+
readonly clock: import("react").JSX.Element;
|
|
8
|
+
readonly info: import("react").JSX.Element;
|
|
9
|
+
readonly alert: import("react").JSX.Element;
|
|
10
|
+
readonly refresh: import("react").JSX.Element;
|
|
11
|
+
readonly lock: import("react").JSX.Element;
|
|
12
|
+
readonly key: import("react").JSX.Element;
|
|
13
|
+
readonly trash: import("react").JSX.Element;
|
|
14
|
+
readonly unlink: import("react").JSX.Element;
|
|
15
|
+
readonly send: import("react").JSX.Element;
|
|
16
|
+
readonly dots: import("react").JSX.Element;
|
|
17
|
+
readonly plus: import("react").JSX.Element;
|
|
18
|
+
/** The partner (B2): a person with a star. */
|
|
19
|
+
readonly partner: import("react").JSX.Element;
|
|
20
|
+
readonly dollar: import("react").JSX.Element;
|
|
21
|
+
readonly settings: import("react").JSX.Element;
|
|
22
|
+
};
|
|
23
|
+
export type IconName = keyof typeof LINES;
|
|
24
|
+
/** A 16px stroke icon; `size` 12/14/20 for the artboards' xs/sm/lg. */
|
|
25
|
+
export declare function Icon({ name, size }: {
|
|
26
|
+
name: IconName;
|
|
27
|
+
size?: number;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
/** The Meta infinity mark, in Meta blue. */
|
|
30
|
+
export declare function MetaMark({ size }: {
|
|
31
|
+
size?: number;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
/** The Facebook "f", white on the Meta-blue button. */
|
|
34
|
+
export declare function FacebookMark({ size }: {
|
|
35
|
+
size?: number;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=Icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icons.d.ts","sourceRoot":"","sources":["../../../src/ui/integrations/Icons.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,KAAK;aACT,KAAK;aACL,WAAW;aACX,YAAY;aACZ,UAAU;aACV,CAAC;aACD,KAAK;aAML,IAAI;aAMJ,KAAK;aAML,OAAO;aAQP,IAAI;aAMJ,GAAG;aAMH,KAAK;aAGL,MAAM;aAGN,IAAI;aAMJ,IAAI;aAOJ,IAAI;IACJ,8CAA8C;aAC9C,OAAO;aAOP,MAAM;aAMN,QAAQ;CAMA,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,uEAAuE;AACvE,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAiB1E;AAOD,4CAA4C;AAC5C,wBAAgB,QAAQ,CAAC,EAAE,IAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAYxD;AAED,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,EAAE,IAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAY5D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Line icons in the dashboard's family (lucide strokes) and the two Meta
|
|
3
|
+
// marks, inlined so the package needs no icon library.
|
|
4
|
+
const LINES = {
|
|
5
|
+
check: _jsx("path", { d: "M20 6 9 17l-5-5" }),
|
|
6
|
+
chevronDown: _jsx("path", { d: "m6 9 6 6 6-6" }),
|
|
7
|
+
chevronRight: _jsx("path", { d: "m9 18 6-6-6-6" }),
|
|
8
|
+
arrowRight: _jsx("path", { d: "M5 12h14M12 5l7 7-7 7" }),
|
|
9
|
+
x: _jsx("path", { d: "M18 6 6 18M6 6l12 12" }),
|
|
10
|
+
clock: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M12 6v6l4 2" })] })),
|
|
11
|
+
info: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M12 16v-4M12 8h.01" })] })),
|
|
12
|
+
alert: (_jsxs(_Fragment, { children: [_jsx("path", { d: "m21.7 18-8-14a2 2 0 0 0-3.4 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.7-3Z" }), _jsx("path", { d: "M12 9v4M12 17h.01" })] })),
|
|
13
|
+
refresh: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }), _jsx("path", { d: "M21 3v5h-5" }), _jsx("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }), _jsx("path", { d: "M8 16H3v5" })] })),
|
|
14
|
+
lock: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }), _jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] })),
|
|
15
|
+
key: (_jsxs(_Fragment, { children: [_jsx("path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4M21 2l-9.6 9.6" }), _jsx("circle", { cx: "7.5", cy: "15.5", r: "5.5" })] })),
|
|
16
|
+
trash: (_jsx("path", { d: "M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })),
|
|
17
|
+
unlink: (_jsx("path", { d: "m18.84 12.25 1.72-1.71a5 5 0 0 0-7.07-7.07l-1.72 1.71M5.17 11.75l-1.71 1.71a5 5 0 0 0 7.07 7.07l1.71-1.71M8 2v3M2 8h3M16 22v-3M22 16h-3" })),
|
|
18
|
+
send: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M14.5 21.7a.5.5 0 0 0 .9 0L22 2.6a.5.5 0 0 0-.6-.6L2.3 8.6a.5.5 0 0 0 0 .9l8 3.2a2 2 0 0 1 1.1 1.1Z" }), _jsx("path", { d: "m21.9 2.1-10.9 10.9" })] })),
|
|
19
|
+
dots: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "1" }), _jsx("circle", { cx: "19", cy: "12", r: "1" }), _jsx("circle", { cx: "5", cy: "12", r: "1" })] })),
|
|
20
|
+
plus: _jsx("path", { d: "M5 12h14M12 5v14" }),
|
|
21
|
+
/** The partner (B2): a person with a star. */
|
|
22
|
+
partner: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "10", cy: "7", r: "4" }), _jsx("path", { d: "M2 21v-2a4 4 0 0 1 4-4h6" }), _jsx("path", { d: "m18 13 1.2 2.6 2.8.3-2.1 1.9.6 2.7-2.5-1.4-2.5 1.4.6-2.7-2.1-1.9 2.8-.3z" })] })),
|
|
23
|
+
dollar: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8M12 18V6" })] })),
|
|
24
|
+
settings: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M12.2 2h-.4a2 2 0 0 0-2 2v.2a2 2 0 0 1-1 1.7l-.4.3a2 2 0 0 1-2 0l-.2-.1a2 2 0 0 0-2.7.7l-.2.4a2 2 0 0 0 .7 2.7l.2.1a2 2 0 0 1 1 1.7v.5a2 2 0 0 1-1 1.7l-.2.1a2 2 0 0 0-.7 2.7l.2.4a2 2 0 0 0 2.7.7l.2-.1a2 2 0 0 1 2 0l.4.3a2 2 0 0 1 1 1.7v.2a2 2 0 0 0 2 2h.4a2 2 0 0 0 2-2v-.2a2 2 0 0 1 1-1.7l.4-.3a2 2 0 0 1 2 0l.2.1a2 2 0 0 0 2.7-.7l.2-.4a2 2 0 0 0-.7-2.7l-.2-.1a2 2 0 0 1-1-1.7v-.5a2 2 0 0 1 1-1.7l.2-.1a2 2 0 0 0 .7-2.7l-.2-.4a2 2 0 0 0-2.7-.7l-.2.1a2 2 0 0 1-2 0l-.4-.3a2 2 0 0 1-1-1.7V4a2 2 0 0 0-2-2z" }), _jsx("circle", { cx: "12", cy: "12", r: "3" })] })),
|
|
25
|
+
};
|
|
26
|
+
/** A 16px stroke icon; `size` 12/14/20 for the artboards' xs/sm/lg. */
|
|
27
|
+
export function Icon({ name, size = 16 }) {
|
|
28
|
+
return (_jsx("svg", { className: "rastro-integrations__icon", viewBox: "0 0 24 24", width: size, height: size, fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: LINES[name] }));
|
|
29
|
+
}
|
|
30
|
+
const META_PATH = "M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973a6.624 6.624 0 0 0 .265.86 5.297 5.297 0 0 0 .371.761c.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.756-1.339.186-.325c.061.1.121.196.183.3l2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843a3.743 3.743 0 0 0 .81-.973c.542-.939.861-2.127.861-3.745 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c.07-.109.141-.224.211-.327 1.12-1.667 2.118-2.602 3.358-2.602zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-.524 0-1.038-.237-1.383-.794-.263-.426-.464-1.13-.464-2.046 0-2.221.63-4.535 1.66-6.088.454-.687.964-1.226 1.533-1.533a2.264 2.264 0 0 1 1.088-.285z";
|
|
31
|
+
const FACEBOOK_PATH = "M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z";
|
|
32
|
+
/** The Meta infinity mark, in Meta blue. */
|
|
33
|
+
export function MetaMark({ size = 16 }) {
|
|
34
|
+
return (_jsx("svg", { className: "rastro-integrations__brand", viewBox: "0 0 24 24", width: size, height: size, "aria-hidden": "true", children: _jsx("path", { fill: "#0866ff", d: META_PATH }) }));
|
|
35
|
+
}
|
|
36
|
+
/** The Facebook "f", white on the Meta-blue button. */
|
|
37
|
+
export function FacebookMark({ size = 16 }) {
|
|
38
|
+
return (_jsx("svg", { className: "rastro-integrations__brand", viewBox: "0 0 24 24", width: size, height: size, "aria-hidden": "true", children: _jsx("path", { fill: "currentColor", d: FACEBOOK_PATH }) }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=Icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../../src/ui/integrations/Icons.tsx"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,uDAAuD;AAEvD,MAAM,KAAK,GAAG;IACZ,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S,EAAC,2BAA2B,EACrC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,CAAC,EACd,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAEjB,KAAK,CAAC,IAAI,CAAC,GACR,CACP,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GACb,ksCAAksC,CAAC;AACrsC,MAAM,aAAa,GACjB,gbAAgb,CAAC;AAEnb,4CAA4C;AAC5C,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,GAAG,EAAE,EAAqB;IACvD,OAAO,CACL,cACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,iBACA,MAAM,YAElB,eAAM,IAAI,EAAC,SAAS,EAAC,CAAC,EAAE,SAAS,GAAI,GACjC,CACP,CAAC;AACJ,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,GAAG,EAAE,EAAqB;IAC3D,OAAO,CACL,cACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,iBACA,MAAM,YAElB,eAAM,IAAI,EAAC,cAAc,EAAC,CAAC,EAAE,aAAa,GAAI,GAC1C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IntegrationsViewProps } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Integrações: one Meta login for the agency, each client tied to its ad
|
|
4
|
+
* account and pixel, and which board columns go back to Meta as events. With
|
|
5
|
+
* `audience="business"`, the same screen for one company connecting its own
|
|
6
|
+
* Meta ("Conexão Meta"). Pure like the other views: data in through props,
|
|
7
|
+
* every write out through a callback the host turns into its own call.
|
|
8
|
+
*/
|
|
9
|
+
export declare function IntegrationsView(props: IntegrationsViewProps): import("react").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* The header chip: "3 de 4 clientes ligados", or how many stopped; for one
|
|
12
|
+
* company, "Meta ligada" or "Meta parada".
|
|
13
|
+
*/
|
|
14
|
+
export declare function IntegrationsBadge({ connection, sites, status, audience, }: Pick<IntegrationsViewProps, "connection" | "sites" | "status" | "audience">): import("react").JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=IntegrationsView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntegrationsView.d.ts","sourceRoot":"","sources":["../../../src/ui/integrations/IntegrationsView.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAwB,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAgG9E;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,+BAS5D;AAyYD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAmB,GACpB,EAAE,IAAI,CACL,qBAAqB,EACrB,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAC/C,sCA8BA"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { ClientCards } from "./ClientCards.js";
|
|
4
|
+
import { ClientsTable, } from "./ClientsTable.js";
|
|
5
|
+
import { ConnectCard, FacebookButton, PlanBForm } from "./Connect.js";
|
|
6
|
+
import { ConnectionCard, ConnectionLine, ExpiryWarning, ReconnectPlan, RefusedBanner, } from "./Connection.js";
|
|
7
|
+
import { AudienceContext, ProductContext, useProductName } from "./audience.js";
|
|
8
|
+
import { DisconnectDialog, PlanBDialog } from "./Dialogs.js";
|
|
9
|
+
import { EventsFeed } from "./EventsFeed.js";
|
|
10
|
+
import { EventsSheet } from "./EventsSheet.js";
|
|
11
|
+
import { Icon, MetaMark } from "./Icons.js";
|
|
12
|
+
import { clientRows, eventMapCopyTargets, integrationsHeadline, suggestedAccount, } from "./model.js";
|
|
13
|
+
import { PartnerCard } from "./Partner.js";
|
|
14
|
+
import { UnlinkDialog } from "./UnlinkDialog.js";
|
|
15
|
+
function Loading() {
|
|
16
|
+
return (_jsxs("div", { className: "rastro-ui rastro-integrations", role: "status", "aria-busy": "true", "aria-label": "Carregando integra\u00E7\u00F5es", children: [_jsx("div", { className: "rastro-skeleton rastro-integrations__skeleton", "data-size": "sm" }), _jsx("div", { className: "rastro-skeleton rastro-integrations__skeleton" })] }));
|
|
17
|
+
}
|
|
18
|
+
/** The grant hint for a reader: same screen, read only, and why. */
|
|
19
|
+
function ReadOnlyNote({ business }) {
|
|
20
|
+
return (_jsxs("p", { className: "rastro-integrations__callout", "data-tone": "info", role: "note", children: [_jsx(Icon, { name: "lock", size: 14 }), business ? (_jsx("span", { children: "S\u00F3 quem gerencia a empresa conecta a Meta e muda a conta de an\u00FAncio, o pixel e os eventos. Voc\u00EA v\u00EA tudo aqui." })) : (_jsxs("span", { children: ["Esta conex\u00E3o \u00E9 somente leitura: d\u00E1 para ver tudo, mas conectar a Meta, ligar contas e mudar eventos pede ", _jsx("code", { children: "analytics:configure" }), " no grant do host."] }))] }));
|
|
21
|
+
}
|
|
22
|
+
/** "Esperando a janela da Meta…": the only part of B2 that is Rastro's. */
|
|
23
|
+
/**
|
|
24
|
+
* A manual popover sits in the top layer: `position: fixed` there means the
|
|
25
|
+
* viewport, whatever the host's ancestors transform or contain.
|
|
26
|
+
*/
|
|
27
|
+
function useTopLayer() {
|
|
28
|
+
const ref = useRef(null);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const element = ref.current;
|
|
31
|
+
if (element && typeof element.showPopover === "function")
|
|
32
|
+
element.showPopover();
|
|
33
|
+
}, []);
|
|
34
|
+
return ref;
|
|
35
|
+
}
|
|
36
|
+
/** M1/M3: the phone's action, fixed at the foot of the screen. */
|
|
37
|
+
function PhoneFoot({ children }) {
|
|
38
|
+
const ref = useTopLayer();
|
|
39
|
+
return (_jsx("div", { ref: ref, popover: "manual", className: "rastro-integrations__phone-foot", "data-narrow": "", children: children }));
|
|
40
|
+
}
|
|
41
|
+
function WaitingChip() {
|
|
42
|
+
const ref = useTopLayer();
|
|
43
|
+
const product = useProductName();
|
|
44
|
+
return (_jsxs("div", { ref: ref, popover: "manual", className: "rastro-integrations__waiting", role: "status", children: [_jsx("i", { className: "rastro-integrations__spin", "aria-hidden": "true" }), "Esperando a janela da Meta\u2026 o ", product, " valida o token e lista as contas ao voltar"] }));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Integrações: one Meta login for the agency, each client tied to its ad
|
|
48
|
+
* account and pixel, and which board columns go back to Meta as events. With
|
|
49
|
+
* `audience="business"`, the same screen for one company connecting its own
|
|
50
|
+
* Meta ("Conexão Meta"). Pure like the other views: data in through props,
|
|
51
|
+
* every write out through a callback the host turns into its own call.
|
|
52
|
+
*/
|
|
53
|
+
export function IntegrationsView(props) {
|
|
54
|
+
const audience = props.audience ?? "agency";
|
|
55
|
+
return (_jsx(AudienceContext.Provider, { value: audience, children: _jsx(ProductContext.Provider, { value: props.productName ?? "Rastro", children: _jsx(Integrations, { ...props, audience: audience }) }) }));
|
|
56
|
+
}
|
|
57
|
+
function Integrations(props) {
|
|
58
|
+
const { audience, partner = null, productName = "Rastro", connection, status, conversions, adNames, eventMaps, sentBySite, unlinkPreviews, onRequestUnlinkPreview, permitted, busy = null, error, notice, now, loading, boardLabel = "Kanban", } = props;
|
|
59
|
+
const business = audience === "business";
|
|
60
|
+
// One company: the first site, whatever else the host passes.
|
|
61
|
+
const sites = business ? props.sites.slice(0, 1) : props.sites;
|
|
62
|
+
const company = business ? (sites[0] ?? null) : null;
|
|
63
|
+
const [overlay, setOverlay] = useState(null);
|
|
64
|
+
const [filter, setFilter] = useState(null);
|
|
65
|
+
const [staged, setStaged] = useState({});
|
|
66
|
+
if (loading || connection === undefined || status === undefined)
|
|
67
|
+
return _jsx(Loading, {});
|
|
68
|
+
if (sites.length === 0 && !business)
|
|
69
|
+
return (_jsx("div", { className: "rastro-ui rastro-integrations", children: _jsxs("div", { className: "rastro-card rastro-empty", children: [_jsx("strong", { children: "Nenhum cliente nesta conex\u00E3o" }), _jsx("span", { children: "Quando a conex\u00E3o autorizar um site, ele aparece aqui para ganhar a sua conta de an\u00FAncio." })] }) }));
|
|
70
|
+
const rows = clientRows({
|
|
71
|
+
sites,
|
|
72
|
+
connection,
|
|
73
|
+
status,
|
|
74
|
+
eventMaps,
|
|
75
|
+
sentBySite,
|
|
76
|
+
otherOwnerLabel: props.otherOwnerLabel ??
|
|
77
|
+
(business && partner ? `parceiro ${partner.name}` : undefined),
|
|
78
|
+
});
|
|
79
|
+
const refused = connection?.status === "invalid";
|
|
80
|
+
const activeFilter = filter ?? "all";
|
|
81
|
+
const currency = rows.find((row) => row.account)?.account?.currency ?? "BRL";
|
|
82
|
+
const stagedFor = (siteId) => {
|
|
83
|
+
if (siteId in staged)
|
|
84
|
+
return staged[siteId] ?? null;
|
|
85
|
+
const site = sites.find((entry) => entry.siteId === siteId);
|
|
86
|
+
return site && connection
|
|
87
|
+
? suggestedAccount(site, connection.adAccounts)
|
|
88
|
+
: null;
|
|
89
|
+
};
|
|
90
|
+
const actions = {
|
|
91
|
+
permitted,
|
|
92
|
+
onPick: props.onLinkAccount,
|
|
93
|
+
onOpenEvents: (siteId) => setOverlay({ kind: "events", siteId }),
|
|
94
|
+
onUnlink: (siteId) => setOverlay({ kind: "unlink", siteId }),
|
|
95
|
+
onPlanB: (siteId) => setOverlay({ kind: "planB", siteId }),
|
|
96
|
+
onSetPixel: (siteId, pixelId) => props.onSetPixel(siteId, { pixelId }),
|
|
97
|
+
onChooseAssets: props.onChooseAssets,
|
|
98
|
+
};
|
|
99
|
+
const pickingRow = connection && !refused
|
|
100
|
+
? rows.find((row) => row.state === "unlinked" && stagedFor(row.site.siteId))
|
|
101
|
+
: undefined;
|
|
102
|
+
const pickingChoice = pickingRow ? stagedFor(pickingRow.site.siteId) : null;
|
|
103
|
+
const syncing = rows.filter((row) => row.state === "syncing" && row.account?.syncState === "backfill");
|
|
104
|
+
const planB = rows.filter((row) => row.state === "planB");
|
|
105
|
+
const overlayRow = overlay && "siteId" in overlay
|
|
106
|
+
? rows.find((row) => row.site.siteId === overlay.siteId)
|
|
107
|
+
: undefined;
|
|
108
|
+
const slotOf = (siteId) => Math.max(0, rows.findIndex((row) => row.site.siteId === siteId));
|
|
109
|
+
return (_jsxs("div", { className: "rastro-ui rastro-integrations", "data-state": !connection ? "offline" : refused ? "refused" : "connected", "data-foot": refused || pickingRow ? "" : undefined, children: [!permitted && _jsx(ReadOnlyNote, { business: business }), error && (_jsxs("p", { className: "rastro-integrations__callout", "data-tone": "bad", role: "alert", children: [_jsx(Icon, { name: "alert", size: 14 }), _jsx("span", { children: error })] })), notice && (_jsxs("p", { className: "rastro-integrations__callout", "data-tone": "ok", role: "status", children: [_jsx(Icon, { name: "check", size: 14 }), _jsx("span", { children: notice })] })), business && partner && company && (_jsx(PartnerCard, { partner: partner, row: rows[0], companyName: company.name, boardLabel: boardLabel, permitted: permitted })), connection && refused && (_jsxs(_Fragment, { children: [_jsx("div", { "data-wide": "", children: _jsx(RefusedBanner, { connection: connection, rows: rows }) }), _jsx("div", { "data-narrow": "", children: _jsx(RefusedBanner, { connection: connection, rows: rows, phone: true }) })] })), !connection ? (_jsxs("div", { className: "rastro-integrations__start", "data-single": sites.length === 0 ? "" : undefined, children: [_jsx(ConnectCard, { permitted: permitted, busy: busy === "connect", onConnect: props.onConnect, companyName: company?.name ?? null, productName: productName }), sites.length > 0 && (_jsx(PlanBForm, { sites: sites, permitted: permitted, busy: busy === "pixel", onSubmit: props.onSetPixel }))] })) : (_jsxs(_Fragment, { children: [_jsx("div", { "data-wide": "", children: _jsx(ConnectionCard, { connection: connection, permitted: permitted, busy: busy === "connect" || busy === "disconnect", onChooseAssets: props.onChooseAssets, onDisconnect: () => setOverlay({ kind: "disconnect" }), onReconnect: props.onReconnect }) }), _jsx(ExpiryWarning, { connection: connection, permitted: permitted, busy: busy === "connect", now: now, onReconnect: props.onReconnect }), !refused && (_jsx("div", { "data-narrow": "", children: _jsx(ConnectionLine, { connection: connection, permitted: permitted, onChooseAssets: props.onChooseAssets }) }))] })), sites.length === 0 ? (_jsxs("div", { className: "rastro-card rastro-empty", children: [_jsx("strong", { children: "Sua conta de an\u00FAncio aparece aqui" }), _jsx("span", { children: connection
|
|
110
|
+
? "A empresa está sendo preparada: a conta de anúncio e o pixel aparecem em instantes."
|
|
111
|
+
: "Depois de conectar, a conta de anúncio e o pixel da empresa aparecem aqui." })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { "data-wide": "", children: _jsx(ClientsTable, { rows: rows, connection: connection, filter: activeFilter, onFilter: setFilter, actions: actions, now: now }) }), _jsx("div", { "data-narrow": "", children: _jsx(ClientCards, { rows: rows, connection: connection, staged: Object.fromEntries(rows.map((row) => [
|
|
112
|
+
row.site.siteId,
|
|
113
|
+
stagedFor(row.site.siteId),
|
|
114
|
+
])), onStage: (siteId, adAccountId) => setStaged((current) => ({ ...current, [siteId]: adAccountId })), actions: actions, now: now }) })] })), !refused && syncing.length > 0 && (_jsxs("p", { className: "rastro-integrations__callout", "data-tone": "info", "data-wide": "", children: [_jsx(Icon, { name: "info", size: 14 }), _jsxs("span", { children: [syncing.map((row) => row.site.name).join(", "), " ", syncing.length === 1 ? "está" : "estão", " lendo os primeiros", " ", _jsx("b", { children: "90 dias" }), " da conta, um bloco de 30 dias por vez. At\u00E9 terminar, o gasto aparece como ", _jsx("b", { children: "\u201Csincronizando\u201D" }), ", nunca como zero, e fica fora do retorno", business ? "" : " da carteira", "."] })] })), refused && planB.length > 0 && (_jsxs("p", { className: "rastro-integrations__callout", "data-tone": "info", "data-wide": "", children: [_jsx(Icon, { name: "info", size: 14 }), _jsxs("span", { children: [planB.map((row) => row.site.name).join(", "), " ", planB.length === 1 ? "segue" : "seguem", " funcionando porque", " ", planB.length === 1 ? "usa" : "usam", " o ", _jsx("b", { children: "plano B" }), " (pixel + token da API de Convers\u00F5es pr\u00F3prio", business ? "" : " do cliente", "), que n\u00E3o depende do login", business ? "" : " da agência", "."] })] })), connection && refused && (_jsx("div", { "data-wide": "", children: _jsx(ReconnectPlan, { connection: connection, rows: rows }) })), connection && !refused && conversions && (_jsx("div", { "data-wide": "", children: _jsx(EventsFeed, { sites: sites, conversions: conversions, adNames: adNames, sentBySite: sentBySite, currency: currency, now: now }) })), (refused || pickingRow) && (_jsx(PhoneFoot, { children: refused ? (_jsx(FacebookButton, { label: "Reconectar com Facebook", disabled: !permitted || busy === "connect", onClick: props.onReconnect })) : (pickingRow &&
|
|
115
|
+
pickingChoice && (_jsxs("button", { type: "button", className: "rastro-integrations__btn", disabled: !permitted || busy === "link", onClick: () => props.onLinkAccount(pickingRow.site.siteId, pickingChoice), children: ["Ligar ", pickingRow.site.name] }))) })), busy === "connect" && _jsx(WaitingChip, {}), overlay?.kind === "events" && overlayRow && (_jsx(EventsSheet, { row: overlayRow, slot: slotOf(overlayRow.site.siteId), eventMap: overlayRow.eventMap, conversions: conversions?.[overlayRow.site.siteId] ?? [], pages: props.conversionPages?.[overlayRow.site.siteId], onLoadOlder: props.onLoadOlderConversions
|
|
116
|
+
? () => props.onLoadOlderConversions?.(overlayRow.site.siteId)
|
|
117
|
+
: undefined, currency: currency, boardLabel: boardLabel, permitted: permitted, busy: busy === "events", onSave: (map) => props.onSaveEventMap(overlayRow.site.siteId, map), copyTargets: business || !props.onCopyEventMap
|
|
118
|
+
? []
|
|
119
|
+
: eventMapCopyTargets(rows, overlayRow.site.siteId), onCopy: props.onCopyEventMap, onPlanB: () => setOverlay({ kind: "planB", siteId: overlayRow.site.siteId }), onClose: () => setOverlay(null), now: now }, `${overlayRow.site.siteId}:${overlayRow.eventMap ? 1 : 0}`)), overlay?.kind === "unlink" && overlayRow?.account && (_jsx(UnlinkDialog, { row: overlayRow, accounts: connection?.adAccounts ?? [], preview: unlinkPreviews?.[`${overlayRow.site.siteId}:${overlayRow.account.adAccountId}`], permitted: permitted, busy: busy === "unlink", onRequestPreview: () => onRequestUnlinkPreview?.(overlayRow.site.siteId, overlayRow.account.adAccountId), onConfirm: (replaceWith) => {
|
|
120
|
+
props.onUnlinkAccount(overlayRow.site.siteId, overlayRow.account.adAccountId, replaceWith);
|
|
121
|
+
setOverlay(null);
|
|
122
|
+
}, onClose: () => setOverlay(null) })), overlay?.kind === "planB" && (_jsx(PlanBDialog, { sites: sites, siteId: overlay.siteId, permitted: permitted, busy: busy === "pixel", onSubmit: props.onSetPixel, onClose: () => setOverlay(null) })), overlay?.kind === "disconnect" && (_jsx(DisconnectDialog, { linked: rows.filter((row) => row.account).length, busy: busy === "disconnect", onConfirm: props.onDisconnect, onClose: () => setOverlay(null) }))] }));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The header chip: "3 de 4 clientes ligados", or how many stopped; for one
|
|
126
|
+
* company, "Meta ligada" or "Meta parada".
|
|
127
|
+
*/
|
|
128
|
+
export function IntegrationsBadge({ connection, sites, status, audience = "agency", }) {
|
|
129
|
+
if (!connection || !status)
|
|
130
|
+
return null;
|
|
131
|
+
const headline = integrationsHeadline(clientRows({
|
|
132
|
+
sites: audience === "business" ? sites.slice(0, 1) : sites,
|
|
133
|
+
connection,
|
|
134
|
+
status,
|
|
135
|
+
eventMaps: undefined,
|
|
136
|
+
}), connection, audience);
|
|
137
|
+
if (!headline)
|
|
138
|
+
return null;
|
|
139
|
+
return (_jsxs("span", { className: "rastro-ui rastro-integrations__badge", "data-tone": headline.tone, role: "status", children: [headline.tone === "bad" ? (_jsx(Icon, { name: "alert", size: 14 })) : (_jsxs(_Fragment, { children: [_jsx("i", { className: "rastro-integrations__dot", "aria-hidden": "true" }), _jsx(MetaMark, { size: 14 })] })), headline.text] }));
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=IntegrationsView.js.map
|