@drawbridge/components 0.1.46 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bridge/cart-drawer.js +152 -0
- package/dist/bridge/cart-drawer.mjs +123 -0
- package/dist/bridge/fields.js +278 -0
- package/dist/bridge/fields.mjs +276 -1
- package/dist/bridge/form-subdomain-checkout.js +687 -0
- package/dist/bridge/form-subdomain-checkout.mjs +665 -0
- package/dist/bridge/form-subdomain-shop-modal.js +234 -274
- package/dist/bridge/form-subdomain-shop-modal.mjs +233 -275
- package/dist/bridge/form-subdomain-shop.js +4 -1
- package/dist/bridge/form-subdomain-shop.mjs +4 -1
- package/dist/bridge/form-subdomain.js +24 -5
- package/dist/bridge/form-subdomain.mjs +25 -6
- package/dist/bridge/lib/age-gate.js +12 -0
- package/dist/bridge/lib/age-gate.mjs +11 -0
- package/dist/bridge/lib/cart.js +79 -0
- package/dist/bridge/lib/cart.mjs +48 -0
- package/dist/bridge/lib/checkout-kit.js +2 -32
- package/dist/bridge/lib/checkout-kit.mjs +2 -32
- package/dist/bridge/lib/entry.js +41 -0
- package/dist/bridge/lib/entry.mjs +40 -0
- package/dist/bridge/product-tile.js +13 -6
- package/dist/bridge/product-tile.mjs +13 -6
- package/dist/bridge/template-layout.js +263 -129
- package/dist/bridge/template-layout.mjs +264 -130
- package/dist/bridge/template-modal.js +39 -74
- package/dist/bridge/template-modal.mjs +40 -75
- package/dist/dashboard/avatar.js +2 -3
- package/dist/dashboard/avatar.mjs +2 -3
- package/dist/dashboard/buttons-subscription.js +1 -1
- package/dist/dashboard/buttons-subscription.mjs +1 -1
- package/dist/dashboard/campaign-form.js +179 -155
- package/dist/dashboard/campaign-form.mjs +179 -155
- package/dist/dashboard/campaign-share.js +347 -0
- package/dist/dashboard/campaign-share.mjs +314 -0
- package/dist/dashboard/card-affiliate.js +1 -1
- package/dist/dashboard/card-affiliate.mjs +1 -1
- package/dist/dashboard/card-campaign-switch.js +4 -1
- package/dist/dashboard/card-campaign-switch.mjs +4 -1
- package/dist/dashboard/card-order.js +22 -4
- package/dist/dashboard/card-order.mjs +22 -4
- package/dist/dashboard/embed-stripe.js +145 -0
- package/dist/dashboard/embed-stripe.mjs +116 -0
- package/dist/dashboard/form-admin-provider.js +71 -17
- package/dist/dashboard/form-admin-provider.mjs +71 -17
- package/dist/dashboard/form-file-upload.js +3 -2
- package/dist/dashboard/form-file-upload.mjs +4 -3
- package/dist/dashboard/form-organization-campaign-advertisements.js +47 -6
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +47 -6
- package/dist/dashboard/form-organization-campaign-field-birthday.js +193 -0
- package/dist/dashboard/form-organization-campaign-field-birthday.mjs +164 -0
- package/dist/dashboard/form-organization-campaign-field-rating.js +246 -0
- package/dist/dashboard/form-organization-campaign-field-rating.mjs +217 -0
- package/dist/dashboard/form-organization-campaign-page.js +73 -39
- package/dist/dashboard/form-organization-campaign-page.mjs +73 -39
- package/dist/dashboard/form-organization-campaign.js +82 -0
- package/dist/dashboard/form-organization-campaign.mjs +81 -0
- package/dist/dashboard/form-organization-connection.js +48 -6
- package/dist/dashboard/form-organization-connection.mjs +48 -7
- package/dist/dashboard/form-organization-product.js +1461 -0
- package/dist/dashboard/form-organization-product.mjs +1425 -0
- package/dist/dashboard/form-organization-workflow.js +72 -1
- package/dist/dashboard/form-organization-workflow.mjs +69 -1
- package/dist/dashboard/form-otc.js +4 -5
- package/dist/dashboard/form-otc.mjs +4 -5
- package/dist/dashboard/form-stripe.js +12 -5
- package/dist/dashboard/form-stripe.mjs +12 -5
- package/dist/dashboard/input-combobox.js +6 -0
- package/dist/dashboard/input-combobox.mjs +6 -0
- package/dist/dashboard/input-fields.js +37 -161
- package/dist/dashboard/input-fields.mjs +37 -161
- package/dist/dashboard/input-file.js +21 -4
- package/dist/dashboard/input-file.mjs +21 -4
- package/dist/dashboard/input-font.js +2 -0
- package/dist/dashboard/input-font.mjs +2 -0
- package/dist/dashboard/input-gallery.js +201 -0
- package/dist/dashboard/input-gallery.mjs +172 -0
- package/dist/dashboard/input-group-ai.js +15 -3
- package/dist/dashboard/input-group-ai.mjs +15 -3
- package/dist/dashboard/lib/ab-tests.js +2 -2
- package/dist/dashboard/lib/ab-tests.mjs +2 -2
- package/dist/dashboard/lib/connection-controls.js +5 -2
- package/dist/dashboard/lib/connection-controls.mjs +3 -1
- package/dist/dashboard/lib/form-page.js +1 -1
- package/dist/dashboard/lib/form-page.mjs +1 -1
- package/dist/dashboard/lib/menu.js +19 -0
- package/dist/dashboard/lib/menu.mjs +18 -0
- package/dist/dashboard/lib/products.js +169 -0
- package/dist/dashboard/lib/products.mjs +135 -0
- package/dist/dashboard/lib/settings-paths.js +35 -0
- package/dist/dashboard/lib/settings-paths.mjs +11 -0
- package/dist/dashboard/lib/uppy.js +10 -1
- package/dist/dashboard/lib/uppy.mjs +11 -2
- package/dist/dashboard/menu.js +13 -2
- package/dist/dashboard/menu.mjs +13 -2
- package/dist/dashboard/order-sections.js +456 -6
- package/dist/dashboard/order-sections.mjs +453 -7
- package/dist/dashboard/preview.js +119 -52
- package/dist/dashboard/preview.mjs +119 -52
- package/dist/dashboard/provider-ui.js +9 -7
- package/dist/dashboard/provider-ui.mjs +9 -7
- package/dist/dashboard/recharts.js +10 -4
- package/dist/dashboard/recharts.mjs +10 -4
- package/dist/dashboard/shipping-rates.js +404 -0
- package/dist/dashboard/shipping-rates.mjs +371 -0
- package/dist/dashboard/template-buyer.js +301 -0
- package/dist/dashboard/template-buyer.mjs +267 -0
- package/dist/dashboard/template-dashboard.js +11 -1
- package/dist/dashboard/template-dashboard.mjs +11 -1
- package/dist/dashboard/template-design.js +209 -130
- package/dist/dashboard/template-design.mjs +210 -131
- package/dist/dashboard/template-ui.js +157 -55
- package/dist/dashboard/template-ui.mjs +158 -56
- package/dist/icons/flags.js +134 -0
- package/dist/icons/flags.mjs +115 -0
- package/dist/input-checkbox.js +28 -10
- package/dist/input-checkbox.mjs +28 -10
- package/dist/product.js +96 -24
- package/dist/product.mjs +97 -25
- package/dist/shared/carousel.js +14 -5
- package/dist/shared/carousel.mjs +14 -5
- package/dist/shared/lib/helpers.js +54 -6
- package/dist/shared/lib/helpers.mjs +53 -8
- package/dist/shared/order-summary.js +139 -0
- package/dist/shared/order-summary.mjs +110 -0
- package/package.json +84 -4
- package/types/bridge/cart-drawer.d.ts +31 -0
- package/types/bridge/fields.d.ts +14 -2
- package/types/bridge/form-subdomain-checkout.d.ts +20 -0
- package/types/bridge/form-subdomain-shop-modal.d.ts +27 -3
- package/types/bridge/form-subdomain.d.ts +13 -0
- package/types/bridge/lib/age-gate.d.ts +5 -0
- package/types/bridge/lib/cart.d.ts +44 -0
- package/types/bridge/lib/checkout-kit.d.ts +2 -10
- package/types/bridge/lib/entry.d.ts +5 -0
- package/types/bridge/product-tile.d.ts +2 -0
- package/types/dashboard/campaign-share.d.ts +16 -0
- package/types/dashboard/card-order.d.ts +6 -0
- package/types/dashboard/embed-stripe.d.ts +25 -0
- package/types/dashboard/form-admin-provider.d.ts +9 -2
- package/types/dashboard/form-file-upload.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +3 -0
- package/types/dashboard/form-organization-campaign-field-birthday.d.ts +31 -0
- package/types/dashboard/form-organization-campaign-field-rating.d.ts +33 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +8 -1
- package/types/dashboard/form-organization-campaign.d.ts +3 -0
- package/types/dashboard/form-organization-connection.d.ts +11 -0
- package/types/dashboard/form-organization-product.d.ts +24 -0
- package/types/dashboard/form-otc.d.ts +5 -1
- package/types/dashboard/form-stripe.d.ts +3 -2
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/input-file.d.ts +2 -0
- package/types/dashboard/input-gallery.d.ts +14 -0
- package/types/dashboard/lib/products.d.ts +14 -0
- package/types/dashboard/lib/settings-paths.d.ts +5 -0
- package/types/dashboard/order-sections.d.ts +24 -1
- package/types/dashboard/preview.d.ts +11 -3
- package/types/dashboard/shipping-rates.d.ts +26 -0
- package/types/dashboard/template-buyer.d.ts +50 -0
- package/types/icons/flags.d.ts +5 -0
- package/types/input-checkbox.d.ts +2 -0
- package/types/shared/lib/helpers.d.ts +4 -0
- package/types/shared/order-summary.d.ts +19 -0
|
@@ -45,7 +45,7 @@ var import_tabs = __toESM(require("../shared/tabs"));
|
|
|
45
45
|
var import_input_fields = require("./input-fields");
|
|
46
46
|
var import_form_organization_campaign_design = require("./form-organization-campaign-design");
|
|
47
47
|
var import_helpers = require("../shared/lib/helpers");
|
|
48
|
-
const DESIGN = ["
|
|
48
|
+
const DESIGN = ["style"];
|
|
49
49
|
const FormOrganizationCampaignPageEdit = ({
|
|
50
50
|
disabled,
|
|
51
51
|
onError,
|
|
@@ -53,6 +53,15 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
53
53
|
onUpdate,
|
|
54
54
|
organization,
|
|
55
55
|
tabs,
|
|
56
|
+
// @story campaigns/design
|
|
57
|
+
// The Design page ( Darren, 2026-11-20 ): the main page's Logo and Preview
|
|
58
|
+
// image under its Gallery, saved to the campaign's design. With `tabs` too, its
|
|
59
|
+
// Style tab is in this form, so one Save sends both tabs ( Darren, 2026-11-21 ).
|
|
60
|
+
// `brand`, the linked one, sets the images and the style: the images lock and
|
|
61
|
+
// the Style tab shows `linked` in place of its fields.
|
|
62
|
+
brand,
|
|
63
|
+
images,
|
|
64
|
+
linked,
|
|
56
65
|
values = {}
|
|
57
66
|
}) => {
|
|
58
67
|
var _a;
|
|
@@ -73,9 +82,11 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
73
82
|
})
|
|
74
83
|
),
|
|
75
84
|
headline: import_yup.default.string().label("Headline").required().max(150),
|
|
85
|
+
// Code review, 2026-11-21: no style to check while a linked brand sets
|
|
86
|
+
// it, so a refused Save never opens a Style tab with nothing to fix.
|
|
76
87
|
...tabs && {
|
|
77
88
|
...import_input_fields.schemas.images(),
|
|
78
|
-
|
|
89
|
+
...!(images && brand) && import_input_fields.schemas.style()
|
|
79
90
|
},
|
|
80
91
|
// @story ab-tests/variants
|
|
81
92
|
// A variant's Title renames it in its test; a page has none of its own.
|
|
@@ -100,7 +111,7 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
100
111
|
title
|
|
101
112
|
} = form;
|
|
102
113
|
try {
|
|
103
|
-
const own = tabs ? (0, import_form_organization_campaign_design.designBody)(form) : null;
|
|
114
|
+
const own = tabs && !images ? (0, import_form_organization_campaign_design.designBody)(form) : null;
|
|
104
115
|
const args = {
|
|
105
116
|
body: {
|
|
106
117
|
description,
|
|
@@ -127,8 +138,28 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
127
138
|
method: "PUT"
|
|
128
139
|
};
|
|
129
140
|
const response = await (0, import_fetch.request)(args);
|
|
141
|
+
let designed = null;
|
|
142
|
+
if (images && !brand) {
|
|
143
|
+
try {
|
|
144
|
+
designed = await (0, import_fetch.request)({
|
|
145
|
+
body: (0, import_form_organization_campaign_design.designBody)({
|
|
146
|
+
descriptions: form.descriptions,
|
|
147
|
+
images: form.images,
|
|
148
|
+
style: tabs ? form.style : values == null ? void 0 : values.style
|
|
149
|
+
}),
|
|
150
|
+
endpoint: "/organization/" + (values == null ? void 0 : values.organization) + "/campaign/" + (values == null ? void 0 : values.campaign) + "/design",
|
|
151
|
+
method: "PUT"
|
|
152
|
+
});
|
|
153
|
+
} catch (error) {
|
|
154
|
+
onSuccess(response);
|
|
155
|
+
onError(error);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
;
|
|
159
|
+
}
|
|
160
|
+
;
|
|
130
161
|
reset(getValues());
|
|
131
|
-
onSuccess(response);
|
|
162
|
+
onSuccess(designed || response);
|
|
132
163
|
} catch (error) {
|
|
133
164
|
onError(error);
|
|
134
165
|
}
|
|
@@ -151,55 +182,56 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
151
182
|
)
|
|
152
183
|
}
|
|
153
184
|
),
|
|
154
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
155
186
|
import_fieldset.default,
|
|
156
187
|
{
|
|
157
188
|
...{
|
|
158
189
|
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
159
190
|
},
|
|
160
|
-
children:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
193
|
+
import_input_fields.InputFieldsMedia,
|
|
194
|
+
{
|
|
195
|
+
...{
|
|
196
|
+
onUpdate,
|
|
197
|
+
organization,
|
|
198
|
+
values
|
|
199
|
+
}
|
|
167
200
|
}
|
|
168
|
-
|
|
169
|
-
|
|
201
|
+
),
|
|
202
|
+
(tabs || images) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
203
|
+
import_input_fields.InputFieldsImages,
|
|
204
|
+
{
|
|
205
|
+
...{
|
|
206
|
+
described: true,
|
|
207
|
+
locked: images ? brand : void 0,
|
|
208
|
+
onUpdate,
|
|
209
|
+
organization,
|
|
210
|
+
preview: Boolean(images),
|
|
211
|
+
values
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
]
|
|
170
216
|
}
|
|
171
217
|
)
|
|
172
218
|
] });
|
|
173
|
-
const look = tabs && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
219
|
+
const look = tabs && (images && brand ? linked : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
174
220
|
import_fieldset.default,
|
|
175
221
|
{
|
|
176
222
|
...{
|
|
177
223
|
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
178
224
|
},
|
|
179
|
-
children:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
{
|
|
183
|
-
|
|
184
|
-
described: true,
|
|
185
|
-
onUpdate,
|
|
186
|
-
organization,
|
|
187
|
-
preview: false,
|
|
188
|
-
values
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
),
|
|
192
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
193
|
-
import_input_fields.InputFieldsStyle,
|
|
194
|
-
{
|
|
195
|
-
...{
|
|
196
|
-
onUpdate
|
|
197
|
-
}
|
|
225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
226
|
+
import_input_fields.InputFieldsStyle,
|
|
227
|
+
{
|
|
228
|
+
...{
|
|
229
|
+
onUpdate
|
|
198
230
|
}
|
|
199
|
-
|
|
200
|
-
|
|
231
|
+
}
|
|
232
|
+
)
|
|
201
233
|
}
|
|
202
|
-
) });
|
|
234
|
+
) }));
|
|
203
235
|
const refocus = (0, import_react.useRef)(false);
|
|
204
236
|
(0, import_react.useEffect)(() => {
|
|
205
237
|
var _a2, _b;
|
|
@@ -271,8 +303,10 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
271
303
|
{
|
|
272
304
|
title: "Content"
|
|
273
305
|
},
|
|
306
|
+
// Style, not Design: the campaign's page that holds these tabs is
|
|
307
|
+
// called Design ( Darren, 2026-11-20 ).
|
|
274
308
|
{
|
|
275
|
-
title: "
|
|
309
|
+
title: "Style"
|
|
276
310
|
}
|
|
277
311
|
],
|
|
278
312
|
onChange: setTab,
|
|
@@ -282,7 +316,7 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
282
316
|
}
|
|
283
317
|
}
|
|
284
318
|
) : content,
|
|
285
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
319
|
+
!(images && brand && tab === 1) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
286
320
|
import_fieldset.default,
|
|
287
321
|
{
|
|
288
322
|
...{
|
|
@@ -13,7 +13,7 @@ import Tabs from "../shared/tabs.mjs";
|
|
|
13
13
|
import { InputFieldsDetails, InputFieldsImages, InputFieldsMedia, InputFieldsStyle, schemas } from "./input-fields.mjs";
|
|
14
14
|
import { designBody } from "./form-organization-campaign-design.mjs";
|
|
15
15
|
import { galleryItems, galleryValue } from "../shared/lib/helpers.mjs";
|
|
16
|
-
const DESIGN = ["
|
|
16
|
+
const DESIGN = ["style"];
|
|
17
17
|
const FormOrganizationCampaignPageEdit = ({
|
|
18
18
|
disabled,
|
|
19
19
|
onError,
|
|
@@ -21,6 +21,15 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
21
21
|
onUpdate,
|
|
22
22
|
organization,
|
|
23
23
|
tabs,
|
|
24
|
+
// @story campaigns/design
|
|
25
|
+
// The Design page ( Darren, 2026-11-20 ): the main page's Logo and Preview
|
|
26
|
+
// image under its Gallery, saved to the campaign's design. With `tabs` too, its
|
|
27
|
+
// Style tab is in this form, so one Save sends both tabs ( Darren, 2026-11-21 ).
|
|
28
|
+
// `brand`, the linked one, sets the images and the style: the images lock and
|
|
29
|
+
// the Style tab shows `linked` in place of its fields.
|
|
30
|
+
brand,
|
|
31
|
+
images,
|
|
32
|
+
linked,
|
|
24
33
|
values = {}
|
|
25
34
|
}) => {
|
|
26
35
|
var _a;
|
|
@@ -41,9 +50,11 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
41
50
|
})
|
|
42
51
|
),
|
|
43
52
|
headline: yup.string().label("Headline").required().max(150),
|
|
53
|
+
// Code review, 2026-11-21: no style to check while a linked brand sets
|
|
54
|
+
// it, so a refused Save never opens a Style tab with nothing to fix.
|
|
44
55
|
...tabs && {
|
|
45
56
|
...schemas.images(),
|
|
46
|
-
|
|
57
|
+
...!(images && brand) && schemas.style()
|
|
47
58
|
},
|
|
48
59
|
// @story ab-tests/variants
|
|
49
60
|
// A variant's Title renames it in its test; a page has none of its own.
|
|
@@ -68,7 +79,7 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
68
79
|
title
|
|
69
80
|
} = form;
|
|
70
81
|
try {
|
|
71
|
-
const own = tabs ? designBody(form) : null;
|
|
82
|
+
const own = tabs && !images ? designBody(form) : null;
|
|
72
83
|
const args = {
|
|
73
84
|
body: {
|
|
74
85
|
description,
|
|
@@ -95,8 +106,28 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
95
106
|
method: "PUT"
|
|
96
107
|
};
|
|
97
108
|
const response = await request(args);
|
|
109
|
+
let designed = null;
|
|
110
|
+
if (images && !brand) {
|
|
111
|
+
try {
|
|
112
|
+
designed = await request({
|
|
113
|
+
body: designBody({
|
|
114
|
+
descriptions: form.descriptions,
|
|
115
|
+
images: form.images,
|
|
116
|
+
style: tabs ? form.style : values == null ? void 0 : values.style
|
|
117
|
+
}),
|
|
118
|
+
endpoint: "/organization/" + (values == null ? void 0 : values.organization) + "/campaign/" + (values == null ? void 0 : values.campaign) + "/design",
|
|
119
|
+
method: "PUT"
|
|
120
|
+
});
|
|
121
|
+
} catch (error) {
|
|
122
|
+
onSuccess(response);
|
|
123
|
+
onError(error);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
;
|
|
127
|
+
}
|
|
128
|
+
;
|
|
98
129
|
reset(getValues());
|
|
99
|
-
onSuccess(response);
|
|
130
|
+
onSuccess(designed || response);
|
|
100
131
|
} catch (error) {
|
|
101
132
|
onError(error);
|
|
102
133
|
}
|
|
@@ -119,55 +150,56 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
119
150
|
)
|
|
120
151
|
}
|
|
121
152
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ jsxs(
|
|
123
154
|
Fieldset,
|
|
124
155
|
{
|
|
125
156
|
...{
|
|
126
157
|
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
127
158
|
},
|
|
128
|
-
children:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ jsx(
|
|
161
|
+
InputFieldsMedia,
|
|
162
|
+
{
|
|
163
|
+
...{
|
|
164
|
+
onUpdate,
|
|
165
|
+
organization,
|
|
166
|
+
values
|
|
167
|
+
}
|
|
135
168
|
}
|
|
136
|
-
|
|
137
|
-
|
|
169
|
+
),
|
|
170
|
+
(tabs || images) && /* @__PURE__ */ jsx(
|
|
171
|
+
InputFieldsImages,
|
|
172
|
+
{
|
|
173
|
+
...{
|
|
174
|
+
described: true,
|
|
175
|
+
locked: images ? brand : void 0,
|
|
176
|
+
onUpdate,
|
|
177
|
+
organization,
|
|
178
|
+
preview: Boolean(images),
|
|
179
|
+
values
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
]
|
|
138
184
|
}
|
|
139
185
|
)
|
|
140
186
|
] });
|
|
141
|
-
const look = tabs && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */
|
|
187
|
+
const look = tabs && (images && brand ? linked : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
142
188
|
Fieldset,
|
|
143
189
|
{
|
|
144
190
|
...{
|
|
145
191
|
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
146
192
|
},
|
|
147
|
-
children:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
described: true,
|
|
153
|
-
onUpdate,
|
|
154
|
-
organization,
|
|
155
|
-
preview: false,
|
|
156
|
-
values
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
),
|
|
160
|
-
/* @__PURE__ */ jsx(
|
|
161
|
-
InputFieldsStyle,
|
|
162
|
-
{
|
|
163
|
-
...{
|
|
164
|
-
onUpdate
|
|
165
|
-
}
|
|
193
|
+
children: /* @__PURE__ */ jsx(
|
|
194
|
+
InputFieldsStyle,
|
|
195
|
+
{
|
|
196
|
+
...{
|
|
197
|
+
onUpdate
|
|
166
198
|
}
|
|
167
|
-
|
|
168
|
-
|
|
199
|
+
}
|
|
200
|
+
)
|
|
169
201
|
}
|
|
170
|
-
) });
|
|
202
|
+
) }));
|
|
171
203
|
const refocus = useRef(false);
|
|
172
204
|
useEffect(() => {
|
|
173
205
|
var _a2, _b;
|
|
@@ -239,8 +271,10 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
239
271
|
{
|
|
240
272
|
title: "Content"
|
|
241
273
|
},
|
|
274
|
+
// Style, not Design: the campaign's page that holds these tabs is
|
|
275
|
+
// called Design ( Darren, 2026-11-20 ).
|
|
242
276
|
{
|
|
243
|
-
title: "
|
|
277
|
+
title: "Style"
|
|
244
278
|
}
|
|
245
279
|
],
|
|
246
280
|
onChange: setTab,
|
|
@@ -250,7 +284,7 @@ const FormOrganizationCampaignPageEdit = ({
|
|
|
250
284
|
}
|
|
251
285
|
}
|
|
252
286
|
) : content,
|
|
253
|
-
/* @__PURE__ */ jsx(
|
|
287
|
+
!(images && brand && tab === 1) && /* @__PURE__ */ jsx(
|
|
254
288
|
Fieldset,
|
|
255
289
|
{
|
|
256
290
|
...{
|
|
@@ -28,6 +28,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
28
28
|
var form_organization_campaign_exports = {};
|
|
29
29
|
__export(form_organization_campaign_exports, {
|
|
30
30
|
FormOrganizationCampaign: () => FormOrganizationCampaign,
|
|
31
|
+
FormOrganizationCampaignCheckout: () => FormOrganizationCampaignCheckout,
|
|
31
32
|
FormOrganizationCampaignClaimWindow: () => FormOrganizationCampaignClaimWindow,
|
|
32
33
|
FormOrganizationCampaignCopy: () => FormOrganizationCampaignCopy,
|
|
33
34
|
FormOrganizationCampaignNotifications: () => FormOrganizationCampaignNotifications,
|
|
@@ -44,6 +45,7 @@ var import_react_query = require("@tanstack/react-query");
|
|
|
44
45
|
var import_form = require("../shared/lib/form");
|
|
45
46
|
var import_yup = __toESM(require("../shared/lib/yup"));
|
|
46
47
|
var import_input_fields = require("./input-fields");
|
|
48
|
+
var import_products = require("./lib/products");
|
|
47
49
|
var import_form2 = __toESM(require("../shared/form"));
|
|
48
50
|
var import_fieldset = __toESM(require("../shared/fieldset"));
|
|
49
51
|
var import_input_group = __toESM(require("../input-group"));
|
|
@@ -228,6 +230,10 @@ const copyFields = {
|
|
|
228
230
|
// The form's one Submit text, on its last step ( the Footer's Button text ).
|
|
229
231
|
submit: ["Button text"]
|
|
230
232
|
};
|
|
233
|
+
const CHECKOUT_OPTIONS = Object.entries(import_products.CHECKOUT_LABELS).map(([value, key]) => ({
|
|
234
|
+
key,
|
|
235
|
+
value
|
|
236
|
+
}));
|
|
231
237
|
const copyPlaceholder = (key) => {
|
|
232
238
|
var _a, _b, _c, _d;
|
|
233
239
|
return ((_d = (_c = (_b = (_a = import_drawbridge_utils.constants) == null ? void 0 : _a.campaign) == null ? void 0 : _b.form) == null ? void 0 : _c.copy) == null ? void 0 : _d[key]) || (key === "submit" ? "Submit" : void 0);
|
|
@@ -849,9 +855,85 @@ const FormOrganizationCampaignSettingsShop = ({
|
|
|
849
855
|
}
|
|
850
856
|
);
|
|
851
857
|
};
|
|
858
|
+
const FormOrganizationCampaignCheckout = ({
|
|
859
|
+
disabled,
|
|
860
|
+
onSubmit,
|
|
861
|
+
values
|
|
862
|
+
}) => {
|
|
863
|
+
const { control, formState, handleSubmit } = (0, import_form.useForm)({
|
|
864
|
+
defaultValues: {
|
|
865
|
+
checkout: (values == null ? void 0 : values.checkout) || "stripe"
|
|
866
|
+
},
|
|
867
|
+
guard: false
|
|
868
|
+
});
|
|
869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
870
|
+
import_form2.default,
|
|
871
|
+
{
|
|
872
|
+
...{
|
|
873
|
+
className: "relative w-full space-y-6",
|
|
874
|
+
onSubmit: handleSubmit(({ checkout }) => onSubmit(checkout))
|
|
875
|
+
},
|
|
876
|
+
children: [
|
|
877
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
878
|
+
import_fieldset.default,
|
|
879
|
+
{
|
|
880
|
+
...{
|
|
881
|
+
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
882
|
+
},
|
|
883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
884
|
+
import_form.Controller,
|
|
885
|
+
{
|
|
886
|
+
...{
|
|
887
|
+
control,
|
|
888
|
+
name: "checkout",
|
|
889
|
+
render: ({ field: { onChange, value } }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
890
|
+
import_input_group.default,
|
|
891
|
+
{
|
|
892
|
+
...{
|
|
893
|
+
input: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
894
|
+
import_input_combobox.default,
|
|
895
|
+
{
|
|
896
|
+
...{
|
|
897
|
+
onChange,
|
|
898
|
+
options: CHECKOUT_OPTIONS,
|
|
899
|
+
value
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
),
|
|
903
|
+
label: "Products and checkout"
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
)
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
)
|
|
910
|
+
}
|
|
911
|
+
),
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
913
|
+
import_fieldset.default,
|
|
914
|
+
{
|
|
915
|
+
...{
|
|
916
|
+
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
917
|
+
},
|
|
918
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
919
|
+
import_button.default,
|
|
920
|
+
{
|
|
921
|
+
...{
|
|
922
|
+
type: "submit"
|
|
923
|
+
},
|
|
924
|
+
children: "Save"
|
|
925
|
+
}
|
|
926
|
+
)
|
|
927
|
+
}
|
|
928
|
+
)
|
|
929
|
+
]
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
};
|
|
852
933
|
// Annotate the CommonJS export names for ESM import in node:
|
|
853
934
|
0 && (module.exports = {
|
|
854
935
|
FormOrganizationCampaign,
|
|
936
|
+
FormOrganizationCampaignCheckout,
|
|
855
937
|
FormOrganizationCampaignClaimWindow,
|
|
856
938
|
FormOrganizationCampaignCopy,
|
|
857
939
|
FormOrganizationCampaignNotifications,
|
|
@@ -6,6 +6,7 @@ import { useQueryClient } from "@tanstack/react-query";
|
|
|
6
6
|
import { useForm, useWatch, FormProvider, Controller } from "../shared/lib/form.mjs";
|
|
7
7
|
import yup, { resolver } from "../shared/lib/yup.mjs";
|
|
8
8
|
import { InputFieldsCampaign, schemas } from "./input-fields.mjs";
|
|
9
|
+
import { CHECKOUT_LABELS } from "./lib/products.mjs";
|
|
9
10
|
import Form from "../shared/form.mjs";
|
|
10
11
|
import Fieldset from "../shared/fieldset.mjs";
|
|
11
12
|
import InputGroup from "../input-group.mjs";
|
|
@@ -190,6 +191,10 @@ const copyFields = {
|
|
|
190
191
|
// The form's one Submit text, on its last step ( the Footer's Button text ).
|
|
191
192
|
submit: ["Button text"]
|
|
192
193
|
};
|
|
194
|
+
const CHECKOUT_OPTIONS = Object.entries(CHECKOUT_LABELS).map(([value, key]) => ({
|
|
195
|
+
key,
|
|
196
|
+
value
|
|
197
|
+
}));
|
|
193
198
|
const copyPlaceholder = (key) => {
|
|
194
199
|
var _a, _b, _c, _d;
|
|
195
200
|
return ((_d = (_c = (_b = (_a = constants) == null ? void 0 : _a.campaign) == null ? void 0 : _b.form) == null ? void 0 : _c.copy) == null ? void 0 : _d[key]) || (key === "submit" ? "Submit" : void 0);
|
|
@@ -811,8 +816,84 @@ const FormOrganizationCampaignSettingsShop = ({
|
|
|
811
816
|
}
|
|
812
817
|
);
|
|
813
818
|
};
|
|
819
|
+
const FormOrganizationCampaignCheckout = ({
|
|
820
|
+
disabled,
|
|
821
|
+
onSubmit,
|
|
822
|
+
values
|
|
823
|
+
}) => {
|
|
824
|
+
const { control, formState, handleSubmit } = useForm({
|
|
825
|
+
defaultValues: {
|
|
826
|
+
checkout: (values == null ? void 0 : values.checkout) || "stripe"
|
|
827
|
+
},
|
|
828
|
+
guard: false
|
|
829
|
+
});
|
|
830
|
+
return /* @__PURE__ */ jsxs(
|
|
831
|
+
Form,
|
|
832
|
+
{
|
|
833
|
+
...{
|
|
834
|
+
className: "relative w-full space-y-6",
|
|
835
|
+
onSubmit: handleSubmit(({ checkout }) => onSubmit(checkout))
|
|
836
|
+
},
|
|
837
|
+
children: [
|
|
838
|
+
/* @__PURE__ */ jsx(
|
|
839
|
+
Fieldset,
|
|
840
|
+
{
|
|
841
|
+
...{
|
|
842
|
+
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
843
|
+
},
|
|
844
|
+
children: /* @__PURE__ */ jsx(
|
|
845
|
+
Controller,
|
|
846
|
+
{
|
|
847
|
+
...{
|
|
848
|
+
control,
|
|
849
|
+
name: "checkout",
|
|
850
|
+
render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsx(
|
|
851
|
+
InputGroup,
|
|
852
|
+
{
|
|
853
|
+
...{
|
|
854
|
+
input: /* @__PURE__ */ jsx(
|
|
855
|
+
InputCombobox,
|
|
856
|
+
{
|
|
857
|
+
...{
|
|
858
|
+
onChange,
|
|
859
|
+
options: CHECKOUT_OPTIONS,
|
|
860
|
+
value
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
),
|
|
864
|
+
label: "Products and checkout"
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
)
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
)
|
|
871
|
+
}
|
|
872
|
+
),
|
|
873
|
+
/* @__PURE__ */ jsx(
|
|
874
|
+
Fieldset,
|
|
875
|
+
{
|
|
876
|
+
...{
|
|
877
|
+
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
878
|
+
},
|
|
879
|
+
children: /* @__PURE__ */ jsx(
|
|
880
|
+
Button,
|
|
881
|
+
{
|
|
882
|
+
...{
|
|
883
|
+
type: "submit"
|
|
884
|
+
},
|
|
885
|
+
children: "Save"
|
|
886
|
+
}
|
|
887
|
+
)
|
|
888
|
+
}
|
|
889
|
+
)
|
|
890
|
+
]
|
|
891
|
+
}
|
|
892
|
+
);
|
|
893
|
+
};
|
|
814
894
|
export {
|
|
815
895
|
FormOrganizationCampaign,
|
|
896
|
+
FormOrganizationCampaignCheckout,
|
|
816
897
|
FormOrganizationCampaignClaimWindow,
|
|
817
898
|
FormOrganizationCampaignCopy,
|
|
818
899
|
FormOrganizationCampaignNotifications,
|