@drawbridge/components 0.1.13 → 0.1.14
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/components/styles.css +364 -2
- package/dist/advertisement.js +3 -1
- package/dist/advertisement.mjs +3 -1
- package/dist/bridge/advertisements.js +2 -0
- package/dist/bridge/advertisements.mjs +2 -0
- package/dist/bridge/countdown.js +2 -1
- package/dist/bridge/countdown.mjs +2 -1
- package/dist/bridge/form-subdomain-embed.js +18 -20
- package/dist/bridge/form-subdomain-embed.mjs +18 -20
- package/dist/bridge/form-subdomain-header.js +24 -1
- package/dist/bridge/form-subdomain-header.mjs +24 -1
- package/dist/bridge/form-subdomain-missions.js +538 -0
- package/dist/bridge/form-subdomain-missions.mjs +502 -0
- package/dist/bridge/form-subdomain.js +530 -220
- package/dist/bridge/form-subdomain.mjs +533 -222
- package/dist/bridge/lib/entry.js +59 -0
- package/dist/bridge/lib/entry.mjs +29 -0
- package/dist/bridge/lib/location.js +38 -0
- package/dist/bridge/lib/location.mjs +13 -0
- package/dist/bridge/lib/order.js +71 -0
- package/dist/bridge/lib/order.mjs +44 -0
- package/dist/bridge/lib/url.js +9 -0
- package/dist/bridge/lib/url.mjs +7 -0
- package/dist/bridge/share-button.js +5 -3
- package/dist/bridge/share-button.mjs +5 -3
- package/dist/bridge/subdomain-content.js +7 -6
- package/dist/bridge/subdomain-content.mjs +7 -6
- package/dist/bridge/template-layout.js +59 -21
- package/dist/bridge/template-layout.mjs +59 -21
- package/dist/bridge/template-modal.js +42 -76
- package/dist/bridge/template-modal.mjs +39 -73
- package/dist/bridge/template-preview.js +208 -0
- package/dist/bridge/template-preview.mjs +173 -0
- package/dist/bridge/template-subdomain-gallery.js +6 -2
- package/dist/bridge/template-subdomain-gallery.mjs +6 -2
- package/dist/bridge/template-subdomain-link.js +6 -1
- package/dist/bridge/template-subdomain-link.mjs +6 -1
- package/dist/bridge/template-subdomain.js +20 -15
- package/dist/bridge/template-subdomain.mjs +20 -15
- package/dist/dashboard/accordion.js +74 -39
- package/dist/dashboard/accordion.mjs +74 -39
- package/dist/dashboard/avatar.js +109 -3
- package/dist/dashboard/avatar.mjs +106 -4
- package/dist/dashboard/buttons-subscription.js +384 -0
- package/dist/dashboard/buttons-subscription.mjs +349 -0
- package/dist/dashboard/card-campaign-switch.js +265 -0
- package/dist/dashboard/card-campaign-switch.mjs +231 -0
- package/dist/dashboard/card-order.js +28 -11
- package/dist/dashboard/card-order.mjs +28 -11
- package/dist/dashboard/card-section.js +26 -2
- package/dist/dashboard/card-section.mjs +26 -2
- package/dist/dashboard/card-tile.js +6 -7
- package/dist/dashboard/card-tile.mjs +6 -7
- package/dist/dashboard/connection-workflows.js +196 -0
- package/dist/dashboard/connection-workflows.mjs +162 -0
- package/dist/dashboard/device.js +95 -0
- package/dist/dashboard/device.mjs +72 -0
- package/dist/dashboard/form-admin-campaign.js +19 -50
- package/dist/dashboard/form-admin-campaign.mjs +20 -51
- package/dist/dashboard/form-ai.js +9 -6
- package/dist/dashboard/form-ai.mjs +9 -6
- package/dist/dashboard/form-auth.js +35 -25
- package/dist/dashboard/form-auth.mjs +36 -26
- package/dist/dashboard/form-file.js +10 -1
- package/dist/dashboard/form-file.mjs +10 -1
- package/dist/dashboard/form-filters-analytics.js +14 -1
- package/dist/dashboard/form-filters-analytics.mjs +15 -2
- package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
- package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
- package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
- package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
- package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
- package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
- package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
- package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
- package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-link.js +7 -1
- package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
- package/dist/dashboard/form-organization-campaign-mission.js +291 -0
- package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
- package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-page.js +20 -11
- package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
- package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
- package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-section.js +223 -0
- package/dist/dashboard/form-organization-campaign-section.mjs +194 -0
- package/dist/dashboard/form-organization-campaign.js +114 -469
- package/dist/dashboard/form-organization-campaign.mjs +113 -467
- package/dist/dashboard/form-organization-export.js +4 -7
- package/dist/dashboard/form-organization-export.mjs +4 -7
- package/dist/dashboard/form-organization-identity.js +46 -51
- package/dist/dashboard/form-organization-identity.mjs +46 -51
- package/dist/dashboard/form-organization-workflow.js +518 -686
- package/dist/dashboard/form-organization-workflow.mjs +517 -682
- package/dist/dashboard/form-organization.js +82 -110
- package/dist/dashboard/form-organization.mjs +81 -109
- package/dist/dashboard/form-otc.js +4 -5
- package/dist/dashboard/form-otc.mjs +4 -5
- package/dist/dashboard/form-payment-methods.js +20 -9
- package/dist/dashboard/form-payment-methods.mjs +20 -9
- package/dist/dashboard/form-stripe.js +30 -0
- package/dist/dashboard/form-stripe.mjs +26 -0
- package/dist/dashboard/input-array.js +4 -2
- package/dist/dashboard/input-array.mjs +4 -2
- package/dist/dashboard/input-combobox.js +7 -3
- package/dist/dashboard/input-combobox.mjs +7 -3
- package/dist/dashboard/input-date.js +7 -0
- package/dist/dashboard/input-date.mjs +7 -0
- package/dist/dashboard/input-fields.js +80 -20
- package/dist/dashboard/input-fields.mjs +80 -20
- package/dist/dashboard/input-file.js +21 -1
- package/dist/dashboard/input-file.mjs +21 -1
- package/dist/dashboard/input-font.js +10 -1
- package/dist/dashboard/input-font.mjs +10 -1
- package/dist/dashboard/lib/item-list.js +57 -0
- package/dist/dashboard/lib/item-list.mjs +33 -0
- package/dist/dashboard/lib/menu.js +50 -0
- package/dist/dashboard/lib/menu.mjs +26 -0
- package/dist/dashboard/locked.js +82 -0
- package/dist/dashboard/locked.mjs +53 -0
- package/dist/dashboard/menu.js +72 -19
- package/dist/dashboard/menu.mjs +72 -19
- package/dist/dashboard/note-ai.js +69 -0
- package/dist/dashboard/note-ai.mjs +36 -0
- package/dist/dashboard/preview.js +419 -0
- package/dist/dashboard/preview.mjs +384 -0
- package/dist/dashboard/steps.js +39 -13
- package/dist/dashboard/steps.mjs +37 -12
- package/dist/dashboard/table-contacts.js +136 -0
- package/dist/dashboard/table-contacts.mjs +103 -0
- package/dist/dashboard/template-not-found.js +4 -2
- package/dist/dashboard/template-not-found.mjs +4 -2
- package/dist/dashboard/template-socket.js +20 -7
- package/dist/dashboard/template-socket.mjs +20 -7
- package/dist/icons/desktop.js +46 -0
- package/dist/icons/desktop.mjs +27 -0
- package/dist/icons/phone.js +46 -0
- package/dist/icons/phone.mjs +27 -0
- package/dist/icons/puzzle-piece.js +46 -0
- package/dist/icons/puzzle-piece.mjs +27 -0
- package/dist/icons/tablet.js +46 -0
- package/dist/icons/tablet.mjs +27 -0
- package/dist/icons/users.js +46 -0
- package/dist/icons/users.mjs +27 -0
- package/dist/input-checkbox.js +1 -0
- package/dist/input-checkbox.mjs +1 -0
- package/dist/input-code.js +101 -0
- package/dist/input-code.mjs +78 -0
- package/dist/input-text.js +2 -1
- package/dist/input-text.mjs +2 -1
- package/dist/shared/input-checkbox-list.js +0 -1
- package/dist/shared/input-checkbox-list.mjs +0 -1
- package/dist/shared/input-switch.js +6 -1
- package/dist/shared/input-switch.mjs +6 -1
- package/dist/shared/lib/campaign.js +117 -0
- package/dist/shared/lib/campaign.mjs +91 -0
- package/dist/shared/lib/helpers.js +14 -2
- package/dist/shared/lib/helpers.mjs +13 -2
- package/package.json +133 -13
- package/types/bridge/form-subdomain-header.d.ts +2 -0
- package/types/bridge/form-subdomain-missions.d.ts +36 -0
- package/types/bridge/form-subdomain.d.ts +23 -1
- package/types/bridge/lib/entry.d.ts +26 -0
- package/types/bridge/lib/location.d.ts +13 -0
- package/types/bridge/lib/order.d.ts +30 -0
- package/types/bridge/lib/url.d.ts +19 -0
- package/types/bridge/template-modal.d.ts +1 -1
- package/types/bridge/template-preview.d.ts +10 -0
- package/types/bridge/template-subdomain-link.d.ts +2 -0
- package/types/dashboard/accordion.d.ts +2 -0
- package/types/dashboard/avatar.d.ts +18 -2
- package/types/dashboard/buttons-subscription.d.ts +22 -0
- package/types/dashboard/card-campaign-switch.d.ts +32 -0
- package/types/dashboard/card-order.d.ts +11 -0
- package/types/dashboard/card-section.d.ts +2 -0
- package/types/dashboard/connection-workflows.d.ts +33 -0
- package/types/dashboard/device.d.ts +12 -0
- package/types/dashboard/form-admin-campaign.d.ts +3 -2
- package/types/dashboard/form-ai.d.ts +2 -2
- package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
- package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
- package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
- package/types/dashboard/form-organization-campaign-section.d.ts +27 -0
- package/types/dashboard/form-organization-campaign.d.ts +27 -17
- package/types/dashboard/form-organization-identity.d.ts +2 -0
- package/types/dashboard/form-organization-workflow.d.ts +43 -47
- package/types/dashboard/form-organization.d.ts +7 -2
- package/types/dashboard/form-stripe.d.ts +3 -0
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/input-date.d.ts +2 -0
- package/types/dashboard/input-fields.d.ts +3 -2
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/lib/item-list.d.ts +14 -0
- package/types/dashboard/lib/menu.d.ts +17 -0
- package/types/dashboard/locked.d.ts +10 -0
- package/types/dashboard/menu.d.ts +10 -2
- package/types/dashboard/note-ai.d.ts +15 -0
- package/types/dashboard/preview.d.ts +33 -0
- package/types/dashboard/steps.d.ts +19 -4
- package/types/dashboard/table-cell-title.d.ts +2 -2
- package/types/dashboard/table-contacts.d.ts +2 -0
- package/types/icons/desktop.d.ts +5 -0
- package/types/icons/phone.d.ts +5 -0
- package/types/icons/puzzle-piece.d.ts +5 -0
- package/types/icons/tablet.d.ts +5 -0
- package/types/icons/users.d.ts +5 -0
- package/types/input-code.d.ts +23 -0
- package/types/shared/input-switch.d.ts +2 -0
- package/types/shared/lib/campaign.d.ts +35 -0
- package/types/shared/lib/helpers.d.ts +3 -0
- package/dist/dashboard/card-integration.js +0 -187
- package/dist/dashboard/card-integration.mjs +0 -158
- package/dist/dashboard/iframe.js +0 -159
- package/dist/dashboard/iframe.mjs +0 -130
- package/types/dashboard/card-integration.d.ts +0 -24
- package/types/dashboard/iframe.d.ts +0 -18
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { request } from "@drawbridge/drawbridge-utils/fetch";
|
|
4
|
+
import { awardingCard, campaignSwitch } from "../shared/lib/campaign.mjs";
|
|
5
|
+
import { useModal } from "./lib/hooks.mjs";
|
|
6
|
+
import CardSection from "./card-section.mjs";
|
|
7
|
+
import CardTask from "./card-task.mjs";
|
|
8
|
+
import FormAction from "./form-action.mjs";
|
|
9
|
+
import InputSwitch from "../shared/input-switch.mjs";
|
|
10
|
+
import Tooltip from "../shared/tooltip.mjs";
|
|
11
|
+
import Lock from "../icons/lock.mjs";
|
|
12
|
+
const useCampaignSwitch = ({ campaign, onError, onSuccess }) => {
|
|
13
|
+
const queryClient = useQueryClient();
|
|
14
|
+
const modal = useModal({
|
|
15
|
+
queryClient
|
|
16
|
+
});
|
|
17
|
+
return (key, on) => {
|
|
18
|
+
const { body, message, title } = campaignSwitch(campaign, key, on);
|
|
19
|
+
modal.open({
|
|
20
|
+
message: /* @__PURE__ */ jsx(
|
|
21
|
+
FormAction,
|
|
22
|
+
{
|
|
23
|
+
...{
|
|
24
|
+
callback: () => request({
|
|
25
|
+
body,
|
|
26
|
+
endpoint: "/organization/" + (campaign == null ? void 0 : campaign.organization) + "/campaign/" + (campaign == null ? void 0 : campaign.id),
|
|
27
|
+
method: "PUT"
|
|
28
|
+
}),
|
|
29
|
+
onError,
|
|
30
|
+
onSuccess
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ jsx("p", { children: message })
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
title
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const SwitchLock = ({ disabled, onChange, value }) => /* @__PURE__ */ jsxs(
|
|
40
|
+
"span",
|
|
41
|
+
{
|
|
42
|
+
...{
|
|
43
|
+
className: "flex items-center gap-2 shrink-0"
|
|
44
|
+
},
|
|
45
|
+
children: [
|
|
46
|
+
disabled && /* @__PURE__ */ jsx(
|
|
47
|
+
Lock,
|
|
48
|
+
{
|
|
49
|
+
...{
|
|
50
|
+
"aria-label": "Locked",
|
|
51
|
+
className: "w-5 h-5 text-gray-dark",
|
|
52
|
+
role: "img"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
InputSwitch,
|
|
58
|
+
{
|
|
59
|
+
...{
|
|
60
|
+
disabled,
|
|
61
|
+
onChange,
|
|
62
|
+
value
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
const Row = ({ description, disabled, onChange, title, value }) => /* @__PURE__ */ jsxs(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
...{
|
|
73
|
+
className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsxs(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
...{
|
|
80
|
+
className: "flex-1 min-w-0"
|
|
81
|
+
},
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsx("p", { children: title }),
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
"p",
|
|
86
|
+
{
|
|
87
|
+
...{
|
|
88
|
+
className: "text-sm text-gray-dark"
|
|
89
|
+
},
|
|
90
|
+
children: description
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
SwitchLock,
|
|
98
|
+
{
|
|
99
|
+
...{
|
|
100
|
+
disabled,
|
|
101
|
+
onChange,
|
|
102
|
+
value
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
const HeaderCampaignSwitch = ({
|
|
110
|
+
campaign,
|
|
111
|
+
disabled,
|
|
112
|
+
onError,
|
|
113
|
+
onSuccess,
|
|
114
|
+
which,
|
|
115
|
+
...rest
|
|
116
|
+
}) => {
|
|
117
|
+
var _a;
|
|
118
|
+
const flip = useCampaignSwitch({
|
|
119
|
+
campaign,
|
|
120
|
+
onError,
|
|
121
|
+
onSuccess
|
|
122
|
+
});
|
|
123
|
+
const input = /* @__PURE__ */ jsx(
|
|
124
|
+
InputSwitch,
|
|
125
|
+
{
|
|
126
|
+
...{
|
|
127
|
+
"aria-label": which === "form" ? "Form" : "Giveaway",
|
|
128
|
+
disabled,
|
|
129
|
+
onChange: (value) => flip(which, value),
|
|
130
|
+
value: Boolean((_a = campaign == null ? void 0 : campaign[which]) == null ? void 0 : _a.enabled)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
...{
|
|
138
|
+
className: "flex",
|
|
139
|
+
...rest
|
|
140
|
+
},
|
|
141
|
+
children: disabled ? /* @__PURE__ */ jsx(
|
|
142
|
+
Tooltip,
|
|
143
|
+
{
|
|
144
|
+
...{
|
|
145
|
+
content: "You need Manage on Campaigns to change this"
|
|
146
|
+
},
|
|
147
|
+
children: input
|
|
148
|
+
}
|
|
149
|
+
) : input
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
const CardLeadCapture = ({
|
|
154
|
+
campaign,
|
|
155
|
+
disabled,
|
|
156
|
+
onError,
|
|
157
|
+
onSuccess
|
|
158
|
+
}) => {
|
|
159
|
+
const flip = useCampaignSwitch({
|
|
160
|
+
campaign,
|
|
161
|
+
onError,
|
|
162
|
+
onSuccess
|
|
163
|
+
});
|
|
164
|
+
const card = awardingCard(campaign);
|
|
165
|
+
const rows = [
|
|
166
|
+
{
|
|
167
|
+
description: "Collect leads with the entry form on your pages",
|
|
168
|
+
key: "form",
|
|
169
|
+
title: "Form"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
description: "Award entries for prizes while a range is running",
|
|
173
|
+
key: "giveaway",
|
|
174
|
+
title: "Giveaway"
|
|
175
|
+
}
|
|
176
|
+
];
|
|
177
|
+
return /* @__PURE__ */ jsx(
|
|
178
|
+
CardSection,
|
|
179
|
+
{
|
|
180
|
+
...{
|
|
181
|
+
className: "shrink-0",
|
|
182
|
+
"data-guide": "section-lead-capture",
|
|
183
|
+
title: "Lead capture"
|
|
184
|
+
},
|
|
185
|
+
children: /* @__PURE__ */ jsxs(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
...{
|
|
189
|
+
className: "space-y-4"
|
|
190
|
+
},
|
|
191
|
+
children: [
|
|
192
|
+
card && /* @__PURE__ */ jsx(
|
|
193
|
+
CardTask,
|
|
194
|
+
{
|
|
195
|
+
...card
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ jsx(
|
|
199
|
+
"div",
|
|
200
|
+
{
|
|
201
|
+
...{
|
|
202
|
+
className: "divide-y divide-gray"
|
|
203
|
+
},
|
|
204
|
+
children: rows.map(({ description, key, title }) => {
|
|
205
|
+
var _a;
|
|
206
|
+
return /* @__PURE__ */ jsx(
|
|
207
|
+
Row,
|
|
208
|
+
{
|
|
209
|
+
...{
|
|
210
|
+
description,
|
|
211
|
+
disabled,
|
|
212
|
+
onChange: (value) => flip(key, value),
|
|
213
|
+
title,
|
|
214
|
+
value: Boolean((_a = campaign == null ? void 0 : campaign[key]) == null ? void 0 : _a.enabled)
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
key
|
|
218
|
+
);
|
|
219
|
+
})
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
export {
|
|
229
|
+
CardLeadCapture,
|
|
230
|
+
HeaderCampaignSwitch
|
|
231
|
+
};
|
|
@@ -34,12 +34,17 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
34
34
|
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
35
35
|
var import_card_data_item = __toESM(require("./card-data-item"));
|
|
36
36
|
const className = "p-3 bg-white rounded shadow-[0_1px_3px_0_rgb(0_0_0/0.1),0_1px_2px_-1px_rgb(0_0_0/0.1)]";
|
|
37
|
+
const attributions = {
|
|
38
|
+
conversion: "A campaign link brought the buyer to checkout, so the conversion fee applies.",
|
|
39
|
+
redemption: "The buyer used one of your discount codes, so no fee applies."
|
|
40
|
+
};
|
|
37
41
|
const CardOrder = ({
|
|
38
42
|
currency,
|
|
39
43
|
fee = 0,
|
|
40
44
|
gross = 0,
|
|
41
45
|
lines = [],
|
|
42
46
|
net = 0,
|
|
47
|
+
provider,
|
|
43
48
|
purchasedAt,
|
|
44
49
|
rate,
|
|
45
50
|
type
|
|
@@ -52,6 +57,7 @@ const CardOrder = ({
|
|
|
52
57
|
className: "space-y-6"
|
|
53
58
|
},
|
|
54
59
|
children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: attributions[type] || attributions.conversion }),
|
|
55
61
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
56
62
|
"div",
|
|
57
63
|
{
|
|
@@ -65,15 +71,19 @@ const CardOrder = ({
|
|
|
65
71
|
...{
|
|
66
72
|
className: ["flex flex-col", className].join(" "),
|
|
67
73
|
classNameSlotLeft: "text-sm disabled",
|
|
68
|
-
label: "
|
|
69
|
-
value:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
label: "Order number",
|
|
75
|
+
value: (provider == null ? void 0 : provider.name) || "\u2014"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
import_card_data_item.default,
|
|
81
|
+
{
|
|
82
|
+
...{
|
|
83
|
+
className: ["flex flex-col", className].join(" "),
|
|
84
|
+
classNameSlotLeft: "text-sm disabled",
|
|
85
|
+
label: "Order ID",
|
|
86
|
+
value: (provider == null ? void 0 : provider.id) || "\u2014"
|
|
77
87
|
}
|
|
78
88
|
}
|
|
79
89
|
),
|
|
@@ -83,8 +93,15 @@ const CardOrder = ({
|
|
|
83
93
|
...{
|
|
84
94
|
className: ["flex flex-col", className].join(" "),
|
|
85
95
|
classNameSlotLeft: "text-sm disabled",
|
|
86
|
-
label: "
|
|
87
|
-
value:
|
|
96
|
+
label: "Date",
|
|
97
|
+
value: purchasedAt ? (0, import_drawbridge_utils.formatDateString)({
|
|
98
|
+
date: purchasedAt,
|
|
99
|
+
options: {
|
|
100
|
+
day: "numeric",
|
|
101
|
+
month: "short",
|
|
102
|
+
year: "numeric"
|
|
103
|
+
}
|
|
104
|
+
}) : "\u2014"
|
|
88
105
|
}
|
|
89
106
|
}
|
|
90
107
|
),
|
|
@@ -2,12 +2,17 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { formatCurrency, formatDateString, formatNumber } from "@drawbridge/drawbridge-utils";
|
|
3
3
|
import CardDataItem from "./card-data-item.mjs";
|
|
4
4
|
const className = "p-3 bg-white rounded shadow-[0_1px_3px_0_rgb(0_0_0/0.1),0_1px_2px_-1px_rgb(0_0_0/0.1)]";
|
|
5
|
+
const attributions = {
|
|
6
|
+
conversion: "A campaign link brought the buyer to checkout, so the conversion fee applies.",
|
|
7
|
+
redemption: "The buyer used one of your discount codes, so no fee applies."
|
|
8
|
+
};
|
|
5
9
|
const CardOrder = ({
|
|
6
10
|
currency,
|
|
7
11
|
fee = 0,
|
|
8
12
|
gross = 0,
|
|
9
13
|
lines = [],
|
|
10
14
|
net = 0,
|
|
15
|
+
provider,
|
|
11
16
|
purchasedAt,
|
|
12
17
|
rate,
|
|
13
18
|
type
|
|
@@ -20,6 +25,7 @@ const CardOrder = ({
|
|
|
20
25
|
className: "space-y-6"
|
|
21
26
|
},
|
|
22
27
|
children: [
|
|
28
|
+
/* @__PURE__ */ jsx("p", { children: attributions[type] || attributions.conversion }),
|
|
23
29
|
/* @__PURE__ */ jsxs(
|
|
24
30
|
"div",
|
|
25
31
|
{
|
|
@@ -33,15 +39,19 @@ const CardOrder = ({
|
|
|
33
39
|
...{
|
|
34
40
|
className: ["flex flex-col", className].join(" "),
|
|
35
41
|
classNameSlotLeft: "text-sm disabled",
|
|
36
|
-
label: "
|
|
37
|
-
value:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
label: "Order number",
|
|
43
|
+
value: (provider == null ? void 0 : provider.name) || "\u2014"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
CardDataItem,
|
|
49
|
+
{
|
|
50
|
+
...{
|
|
51
|
+
className: ["flex flex-col", className].join(" "),
|
|
52
|
+
classNameSlotLeft: "text-sm disabled",
|
|
53
|
+
label: "Order ID",
|
|
54
|
+
value: (provider == null ? void 0 : provider.id) || "\u2014"
|
|
45
55
|
}
|
|
46
56
|
}
|
|
47
57
|
),
|
|
@@ -51,8 +61,15 @@ const CardOrder = ({
|
|
|
51
61
|
...{
|
|
52
62
|
className: ["flex flex-col", className].join(" "),
|
|
53
63
|
classNameSlotLeft: "text-sm disabled",
|
|
54
|
-
label: "
|
|
55
|
-
value:
|
|
64
|
+
label: "Date",
|
|
65
|
+
value: purchasedAt ? formatDateString({
|
|
66
|
+
date: purchasedAt,
|
|
67
|
+
options: {
|
|
68
|
+
day: "numeric",
|
|
69
|
+
month: "short",
|
|
70
|
+
year: "numeric"
|
|
71
|
+
}
|
|
72
|
+
}) : "\u2014"
|
|
56
73
|
}
|
|
57
74
|
}
|
|
58
75
|
),
|
|
@@ -21,15 +21,20 @@ __export(card_section_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(card_section_exports);
|
|
23
23
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_react = require("react");
|
|
24
25
|
const CardSection = ({
|
|
25
26
|
children,
|
|
26
27
|
className,
|
|
28
|
+
columns = 1,
|
|
27
29
|
cta,
|
|
28
30
|
title,
|
|
29
31
|
...rest
|
|
30
32
|
}) => {
|
|
31
33
|
const classes = [
|
|
32
|
-
"flex flex-col w-full bg-white rounded border border-gray
|
|
34
|
+
"flex flex-col w-full bg-white rounded border border-gray",
|
|
35
|
+
// In columns the card does not clip, so a column can stay in view as the
|
|
36
|
+
// page scrolls; and it never shrinks in the page's column.
|
|
37
|
+
columns > 1 ? "shrink-0" : "overflow-hidden"
|
|
33
38
|
];
|
|
34
39
|
const hasHeader = Boolean(title || cta);
|
|
35
40
|
if (className) {
|
|
@@ -72,7 +77,26 @@ const CardSection = ({
|
|
|
72
77
|
// overlay) anchors to the content area, not a distant ancestor.
|
|
73
78
|
className: "relative flex-1 min-h-0 p-6" + (hasHeader ? " pt-0" : "")
|
|
74
79
|
},
|
|
75
|
-
children
|
|
80
|
+
children: columns > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
...{
|
|
84
|
+
className: "grid grid-cols-1 gap-6 items-start xl:grid-cols-2"
|
|
85
|
+
},
|
|
86
|
+
children: import_react.Children.toArray(children).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
...{
|
|
90
|
+
// The first column ( the form ) runs with the page; the others
|
|
91
|
+
// stay in view beside it while it scrolls.
|
|
92
|
+
className: "min-w-0" + (index ? " xl:sticky xl:top-6" : "")
|
|
93
|
+
},
|
|
94
|
+
children: child
|
|
95
|
+
},
|
|
96
|
+
index
|
|
97
|
+
))
|
|
98
|
+
}
|
|
99
|
+
) : children
|
|
76
100
|
}
|
|
77
101
|
)
|
|
78
102
|
]
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children } from "react";
|
|
2
3
|
const CardSection = ({
|
|
3
4
|
children,
|
|
4
5
|
className,
|
|
6
|
+
columns = 1,
|
|
5
7
|
cta,
|
|
6
8
|
title,
|
|
7
9
|
...rest
|
|
8
10
|
}) => {
|
|
9
11
|
const classes = [
|
|
10
|
-
"flex flex-col w-full bg-white rounded border border-gray
|
|
12
|
+
"flex flex-col w-full bg-white rounded border border-gray",
|
|
13
|
+
// In columns the card does not clip, so a column can stay in view as the
|
|
14
|
+
// page scrolls; and it never shrinks in the page's column.
|
|
15
|
+
columns > 1 ? "shrink-0" : "overflow-hidden"
|
|
11
16
|
];
|
|
12
17
|
const hasHeader = Boolean(title || cta);
|
|
13
18
|
if (className) {
|
|
@@ -50,7 +55,26 @@ const CardSection = ({
|
|
|
50
55
|
// overlay) anchors to the content area, not a distant ancestor.
|
|
51
56
|
className: "relative flex-1 min-h-0 p-6" + (hasHeader ? " pt-0" : "")
|
|
52
57
|
},
|
|
53
|
-
children
|
|
58
|
+
children: columns > 1 ? /* @__PURE__ */ jsx(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
...{
|
|
62
|
+
className: "grid grid-cols-1 gap-6 items-start xl:grid-cols-2"
|
|
63
|
+
},
|
|
64
|
+
children: Children.toArray(children).map((child, index) => /* @__PURE__ */ jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
...{
|
|
68
|
+
// The first column ( the form ) runs with the page; the others
|
|
69
|
+
// stay in view beside it while it scrolls.
|
|
70
|
+
className: "min-w-0" + (index ? " xl:sticky xl:top-6" : "")
|
|
71
|
+
},
|
|
72
|
+
children: child
|
|
73
|
+
},
|
|
74
|
+
index
|
|
75
|
+
))
|
|
76
|
+
}
|
|
77
|
+
) : children
|
|
54
78
|
}
|
|
55
79
|
)
|
|
56
80
|
]
|
|
@@ -42,6 +42,7 @@ var import_link = __toESM(require("./link"));
|
|
|
42
42
|
var import_button = __toESM(require("../shared/button"));
|
|
43
43
|
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
44
44
|
var import_cdn = require("@drawbridge/drawbridge-utils/cdn");
|
|
45
|
+
var import_campaign = require("../shared/lib/campaign");
|
|
45
46
|
const classes = {
|
|
46
47
|
container: [
|
|
47
48
|
"group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in xl:aspect-video 2xl:space-x-12"
|
|
@@ -388,13 +389,11 @@ const TileCampaign = ({
|
|
|
388
389
|
page,
|
|
389
390
|
updatedAt
|
|
390
391
|
}) => {
|
|
391
|
-
var _a, _b, _c, _d, _e, _f
|
|
392
|
+
var _a, _b, _c, _d, _e, _f;
|
|
392
393
|
const generating = ((_b = (_a = campaign == null ? void 0 : campaign.process) == null ? void 0 : _a.ai) == null ? void 0 : _b.status) === "pending";
|
|
393
|
-
const status = (campaign == null ? void 0 : campaign.status) || "drafted";
|
|
394
394
|
const touched = updatedAt || (campaign == null ? void 0 : campaign.updatedAt);
|
|
395
395
|
const description = [
|
|
396
|
-
(0,
|
|
397
|
-
(_c = campaign == null ? void 0 : campaign.type) == null ? void 0 : _c.key,
|
|
396
|
+
(0, import_campaign.leadCapture)(campaign),
|
|
398
397
|
tileDate(touched)
|
|
399
398
|
].filter(Boolean).join(" \xB7 ");
|
|
400
399
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -406,7 +405,7 @@ const TileCampaign = ({
|
|
|
406
405
|
generating,
|
|
407
406
|
image: tileImage(page),
|
|
408
407
|
manage: "/organizations/" + organization + "/campaigns/" + (campaign == null ? void 0 : campaign.id),
|
|
409
|
-
percentage: tilePercentage((
|
|
408
|
+
percentage: tilePercentage((_d = (_c = campaign == null ? void 0 : campaign.process) == null ? void 0 : _c.ai) == null ? void 0 : _d.progress),
|
|
410
409
|
// Same asset, same bg-contain-on-bg-green treatment CardTile's own
|
|
411
410
|
// default placeholder above already uses for the API's promo-tile
|
|
412
411
|
// icons — just pointed at drawbridge-api's public/images/. It stands
|
|
@@ -415,8 +414,8 @@ const TileCampaign = ({
|
|
|
415
414
|
// a gallery photo nor a preview image — that case dropped the image
|
|
416
415
|
// slot entirely and left the slide as text against white.
|
|
417
416
|
placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.png",
|
|
418
|
-
title: generating ? (
|
|
419
|
-
view: (
|
|
417
|
+
title: generating ? (_e = campaign == null ? void 0 : campaign.source) == null ? void 0 : _e.url : campaign == null ? void 0 : campaign.title,
|
|
418
|
+
view: (_f = page == null ? void 0 : page.share) == null ? void 0 : _f.url
|
|
420
419
|
}
|
|
421
420
|
}
|
|
422
421
|
);
|
|
@@ -8,6 +8,7 @@ import Link from "./link.mjs";
|
|
|
8
8
|
import Button from "../shared/button.mjs";
|
|
9
9
|
import { capitalize, formatDateString } from "@drawbridge/drawbridge-utils";
|
|
10
10
|
import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
|
|
11
|
+
import { leadCapture } from "../shared/lib/campaign.mjs";
|
|
11
12
|
const classes = {
|
|
12
13
|
container: [
|
|
13
14
|
"group relative flex w-full h-full p-6 space-x-6 transition duration-200 ease-in xl:aspect-video 2xl:space-x-12"
|
|
@@ -354,13 +355,11 @@ const TileCampaign = ({
|
|
|
354
355
|
page,
|
|
355
356
|
updatedAt
|
|
356
357
|
}) => {
|
|
357
|
-
var _a, _b, _c, _d, _e, _f
|
|
358
|
+
var _a, _b, _c, _d, _e, _f;
|
|
358
359
|
const generating = ((_b = (_a = campaign == null ? void 0 : campaign.process) == null ? void 0 : _a.ai) == null ? void 0 : _b.status) === "pending";
|
|
359
|
-
const status = (campaign == null ? void 0 : campaign.status) || "drafted";
|
|
360
360
|
const touched = updatedAt || (campaign == null ? void 0 : campaign.updatedAt);
|
|
361
361
|
const description = [
|
|
362
|
-
|
|
363
|
-
(_c = campaign == null ? void 0 : campaign.type) == null ? void 0 : _c.key,
|
|
362
|
+
leadCapture(campaign),
|
|
364
363
|
tileDate(touched)
|
|
365
364
|
].filter(Boolean).join(" \xB7 ");
|
|
366
365
|
return /* @__PURE__ */ jsx(
|
|
@@ -372,7 +371,7 @@ const TileCampaign = ({
|
|
|
372
371
|
generating,
|
|
373
372
|
image: tileImage(page),
|
|
374
373
|
manage: "/organizations/" + organization + "/campaigns/" + (campaign == null ? void 0 : campaign.id),
|
|
375
|
-
percentage: tilePercentage((
|
|
374
|
+
percentage: tilePercentage((_d = (_c = campaign == null ? void 0 : campaign.process) == null ? void 0 : _c.ai) == null ? void 0 : _d.progress),
|
|
376
375
|
// Same asset, same bg-contain-on-bg-green treatment CardTile's own
|
|
377
376
|
// default placeholder above already uses for the API's promo-tile
|
|
378
377
|
// icons — just pointed at drawbridge-api's public/images/. It stands
|
|
@@ -381,8 +380,8 @@ const TileCampaign = ({
|
|
|
381
380
|
// a gallery photo nor a preview image — that case dropped the image
|
|
382
381
|
// slot entirely and left the slide as text against white.
|
|
383
382
|
placeholder: process.env.NEXT_PUBLIC_API_URI + "/images/campaigns.png",
|
|
384
|
-
title: generating ? (
|
|
385
|
-
view: (
|
|
383
|
+
title: generating ? (_e = campaign == null ? void 0 : campaign.source) == null ? void 0 : _e.url : campaign == null ? void 0 : campaign.title,
|
|
384
|
+
view: (_f = page == null ? void 0 : page.share) == null ? void 0 : _f.url
|
|
386
385
|
}
|
|
387
386
|
}
|
|
388
387
|
);
|