@drawbridge/components 0.1.48 → 0.1.49
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/fields.js +0 -278
- package/dist/bridge/fields.mjs +1 -276
- package/dist/bridge/form-subdomain-shop-modal.js +274 -234
- package/dist/bridge/form-subdomain-shop-modal.mjs +275 -233
- package/dist/bridge/form-subdomain.js +0 -7
- package/dist/bridge/form-subdomain.mjs +2 -9
- package/dist/bridge/lib/age-gate.js +0 -12
- package/dist/bridge/lib/age-gate.mjs +0 -11
- package/dist/bridge/lib/checkout-kit.js +32 -2
- package/dist/bridge/lib/checkout-kit.mjs +32 -2
- package/dist/bridge/lib/entry.js +0 -3
- package/dist/bridge/lib/entry.mjs +0 -2
- package/dist/bridge/product-tile.js +6 -9
- package/dist/bridge/product-tile.mjs +6 -9
- package/dist/bridge/template-layout.js +122 -237
- package/dist/bridge/template-layout.mjs +122 -237
- package/dist/bridge/template-modal.js +73 -28
- package/dist/bridge/template-modal.mjs +74 -29
- package/dist/dashboard/buttons-subscription.js +1 -1
- package/dist/dashboard/buttons-subscription.mjs +1 -1
- package/dist/dashboard/campaign-form.js +2 -7
- package/dist/dashboard/campaign-form.mjs +2 -7
- package/dist/dashboard/card-order.js +4 -22
- package/dist/dashboard/card-order.mjs +4 -22
- package/dist/dashboard/document-blocks.js +17 -4
- package/dist/dashboard/document-blocks.mjs +17 -4
- package/dist/dashboard/form-admin-provider.js +17 -71
- package/dist/dashboard/form-admin-provider.mjs +17 -71
- package/dist/dashboard/form-file-upload.js +2 -3
- package/dist/dashboard/form-file-upload.mjs +3 -4
- package/dist/dashboard/form-organization-campaign-advertisements.js +6 -47
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +6 -47
- package/dist/dashboard/form-organization-campaign-agreement.js +121 -83
- package/dist/dashboard/form-organization-campaign-agreement.mjs +121 -83
- package/dist/dashboard/form-organization-campaign.js +0 -82
- package/dist/dashboard/form-organization-campaign.mjs +0 -81
- package/dist/dashboard/form-organization-connection.js +6 -48
- package/dist/dashboard/form-organization-connection.mjs +7 -48
- package/dist/dashboard/form-organization-workflow.js +1 -72
- package/dist/dashboard/form-organization-workflow.mjs +1 -69
- package/dist/dashboard/form-otc.js +5 -4
- package/dist/dashboard/form-otc.mjs +5 -4
- package/dist/dashboard/form-stripe.js +5 -12
- package/dist/dashboard/form-stripe.mjs +5 -12
- package/dist/dashboard/input-fields.js +158 -11
- package/dist/dashboard/input-fields.mjs +158 -11
- package/dist/dashboard/input-file.js +4 -21
- package/dist/dashboard/input-file.mjs +4 -21
- package/dist/dashboard/lib/connection-controls.js +2 -5
- package/dist/dashboard/lib/connection-controls.mjs +1 -3
- package/dist/dashboard/lib/form-page.js +1 -1
- package/dist/dashboard/lib/form-page.mjs +1 -1
- package/dist/dashboard/lib/uppy.js +1 -10
- package/dist/dashboard/lib/uppy.mjs +2 -11
- package/dist/dashboard/order-sections.js +6 -456
- package/dist/dashboard/order-sections.mjs +7 -453
- package/dist/dashboard/provider-ui.js +7 -9
- package/dist/dashboard/provider-ui.mjs +7 -9
- package/dist/dashboard/template-ui.js +12 -4
- package/dist/dashboard/template-ui.mjs +12 -4
- package/dist/input-checkbox.js +10 -28
- package/dist/input-checkbox.mjs +10 -28
- package/dist/product.js +24 -96
- package/dist/product.mjs +25 -97
- package/dist/shared/lib/helpers.js +6 -54
- package/dist/shared/lib/helpers.mjs +8 -53
- package/package.json +4 -74
- package/types/bridge/fields.d.ts +2 -14
- package/types/bridge/form-subdomain-shop-modal.d.ts +3 -27
- package/types/bridge/lib/age-gate.d.ts +0 -5
- package/types/bridge/lib/checkout-kit.d.ts +10 -2
- package/types/bridge/lib/entry.d.ts +0 -3
- package/types/dashboard/card-order.d.ts +0 -6
- package/types/dashboard/document-blocks.d.ts +3 -2
- package/types/dashboard/form-admin-provider.d.ts +2 -9
- package/types/dashboard/form-file-upload.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +0 -3
- package/types/dashboard/form-organization-campaign-agreement.d.ts +5 -2
- package/types/dashboard/form-organization-campaign.d.ts +0 -3
- package/types/dashboard/form-organization-connection.d.ts +0 -11
- package/types/dashboard/form-otc.d.ts +1 -5
- package/types/dashboard/form-stripe.d.ts +2 -3
- package/types/dashboard/input-file.d.ts +0 -2
- package/types/dashboard/order-sections.d.ts +1 -24
- package/types/input-checkbox.d.ts +0 -2
- package/types/shared/lib/helpers.d.ts +0 -4
- package/dist/bridge/cart-drawer.js +0 -152
- package/dist/bridge/cart-drawer.mjs +0 -123
- package/dist/bridge/form-subdomain-checkout.js +0 -687
- package/dist/bridge/form-subdomain-checkout.mjs +0 -665
- package/dist/bridge/lib/cart.js +0 -79
- package/dist/bridge/lib/cart.mjs +0 -48
- package/dist/dashboard/embed-stripe.js +0 -145
- package/dist/dashboard/embed-stripe.mjs +0 -116
- package/dist/dashboard/form-organization-campaign-field-birthday.js +0 -193
- package/dist/dashboard/form-organization-campaign-field-birthday.mjs +0 -164
- package/dist/dashboard/form-organization-campaign-field-rating.js +0 -246
- package/dist/dashboard/form-organization-campaign-field-rating.mjs +0 -217
- package/dist/dashboard/form-organization-product.js +0 -1461
- package/dist/dashboard/form-organization-product.mjs +0 -1425
- package/dist/dashboard/input-gallery.js +0 -201
- package/dist/dashboard/input-gallery.mjs +0 -172
- package/dist/dashboard/lib/products.js +0 -169
- package/dist/dashboard/lib/products.mjs +0 -135
- package/dist/dashboard/lib/settings-paths.js +0 -35
- package/dist/dashboard/lib/settings-paths.mjs +0 -11
- package/dist/dashboard/shipping-rates.js +0 -404
- package/dist/dashboard/shipping-rates.mjs +0 -371
- package/dist/dashboard/template-buyer.js +0 -301
- package/dist/dashboard/template-buyer.mjs +0 -267
- package/dist/shared/order-summary.js +0 -139
- package/dist/shared/order-summary.mjs +0 -110
- package/types/bridge/cart-drawer.d.ts +0 -31
- package/types/bridge/form-subdomain-checkout.d.ts +0 -20
- package/types/bridge/lib/cart.d.ts +0 -44
- package/types/dashboard/embed-stripe.d.ts +0 -25
- package/types/dashboard/form-organization-campaign-field-birthday.d.ts +0 -31
- package/types/dashboard/form-organization-campaign-field-rating.d.ts +0 -33
- package/types/dashboard/form-organization-product.d.ts +0 -24
- package/types/dashboard/input-gallery.d.ts +0 -14
- package/types/dashboard/lib/products.d.ts +0 -14
- package/types/dashboard/lib/settings-paths.d.ts +0 -5
- package/types/dashboard/shipping-rates.d.ts +0 -26
- package/types/dashboard/template-buyer.d.ts +0 -50
- package/types/shared/order-summary.d.ts +0 -19
|
@@ -33,7 +33,6 @@ __export(helpers_exports, {
|
|
|
33
33
|
bust: () => bust,
|
|
34
34
|
clickSummary: () => clickSummary,
|
|
35
35
|
connectionInGroup: () => connectionInGroup,
|
|
36
|
-
digitalSizeLimits: () => digitalSizeLimits,
|
|
37
36
|
fileMimes: () => fileMimes,
|
|
38
37
|
fileParts: () => fileParts,
|
|
39
38
|
fileSizeLimits: () => fileSizeLimits,
|
|
@@ -51,11 +50,9 @@ __export(helpers_exports, {
|
|
|
51
50
|
hasRestriction: () => hasRestriction,
|
|
52
51
|
imageAlt: () => imageAlt,
|
|
53
52
|
isAdmin: () => isAdmin,
|
|
54
|
-
money: () => money,
|
|
55
53
|
months: () => months,
|
|
56
54
|
organizationAlerts: () => organizationAlerts,
|
|
57
55
|
productAsset: () => productAsset,
|
|
58
|
-
setStripeKey: () => setStripeKey,
|
|
59
56
|
statusBadge: () => statusBadge,
|
|
60
57
|
stripeUrl: () => stripeUrl,
|
|
61
58
|
usageBadge: () => usageBadge,
|
|
@@ -101,9 +98,6 @@ const fileSizeLimits = {
|
|
|
101
98
|
// and if they drift the client blocks files the api would accept.
|
|
102
99
|
video: import_upload.maximumUploadBytes / import_drawbridge_utils.megabyte
|
|
103
100
|
};
|
|
104
|
-
const digitalSizeLimits = Object.fromEntries(
|
|
105
|
-
Object.keys(import_upload.digitalUploadTypes).map((type) => [type, import_upload.maximumUploadBytes / import_drawbridge_utils.megabyte])
|
|
106
|
-
);
|
|
107
101
|
const fileSizeLabel = (type, limits) => {
|
|
108
102
|
const limit = (limits || fileSizeLimits)[type];
|
|
109
103
|
return limit >= 1024 ? (0, import_drawbridge_utils.formatNumber)(limit / 1024) + "GB" : limit + "MB";
|
|
@@ -118,10 +112,6 @@ const fileSizes = (type = "media", limits) => {
|
|
|
118
112
|
video,
|
|
119
113
|
application
|
|
120
114
|
],
|
|
121
|
-
// @story products/digital-file
|
|
122
|
-
digital: [
|
|
123
|
-
fileSizeLabel("application", limits || digitalSizeLimits) + " / file"
|
|
124
|
-
],
|
|
125
115
|
media: [
|
|
126
116
|
image,
|
|
127
117
|
video
|
|
@@ -145,9 +135,6 @@ const fileGroups = (pick) => (type = "media") => {
|
|
|
145
135
|
...video,
|
|
146
136
|
...application
|
|
147
137
|
],
|
|
148
|
-
// @story products/digital-file
|
|
149
|
-
// A digital file's own list: the Library's types, a zip and an MP3.
|
|
150
|
-
digital: Object.values(import_upload.digitalUploadTypes).flatMap(pick),
|
|
151
138
|
media: [
|
|
152
139
|
...image,
|
|
153
140
|
...video
|
|
@@ -161,9 +148,8 @@ const fileTypes = fileGroups(Object.keys);
|
|
|
161
148
|
const fileMimes = fileGroups(Object.values);
|
|
162
149
|
const fileParts = (file) => {
|
|
163
150
|
var _a, _b, _c, _d;
|
|
164
|
-
const [
|
|
165
|
-
const extension = ((_b = (_a = import_upload.allowedUploadTypes) == null ? void 0 : _a[
|
|
166
|
-
const type = mime || Object.keys(import_upload.digitalUploadTypes).find((key) => import_upload.digitalUploadTypes[key][extension]) || "";
|
|
151
|
+
const [type, subtype] = ((file == null ? void 0 : file.type) || "").split("/");
|
|
152
|
+
const extension = ((_b = (_a = import_upload.allowedUploadTypes) == null ? void 0 : _a[type]) == null ? void 0 : _b[subtype]) ? subtype : (((_d = (_c = file == null ? void 0 : file.name) == null ? void 0 : _c.split(".")) == null ? void 0 : _d.pop()) || "").toLowerCase();
|
|
167
153
|
return {
|
|
168
154
|
extension,
|
|
169
155
|
type
|
|
@@ -212,21 +198,17 @@ const hasConnection = (organization, slug) => {
|
|
|
212
198
|
((organization == null ? void 0 : organization.connectionItems) || []).find((connection) => connection.slug === slug && connection.status === "active")
|
|
213
199
|
);
|
|
214
200
|
};
|
|
215
|
-
const connectionInGroup = (organization, group) => ((organization == null ? void 0 : organization.connectionItems) || []).find((connection) => connection.group === group && connection.status === "active"
|
|
201
|
+
const connectionInGroup = (organization, group) => ((organization == null ? void 0 : organization.connectionItems) || []).find((connection) => connection.group === group && connection.status === "active") || null;
|
|
216
202
|
const hasConnectionGroup = (organization, group) => Boolean(connectionInGroup(organization, group));
|
|
217
203
|
const hasRestriction = (object, key) => {
|
|
218
204
|
return Boolean(((object == null ? void 0 : object.restricted) || []).includes(key));
|
|
219
205
|
};
|
|
220
206
|
const productAsset = (product) => {
|
|
221
|
-
|
|
222
|
-
const first = ((product == null ? void 0 : product.images) || [])[0];
|
|
223
|
-
if ((_a = first == null ? void 0 : first.file) == null ? void 0 : _a.sizes) return first.file;
|
|
224
|
-
const image = (first == null ? void 0 : first.url) || (product == null ? void 0 : product.image);
|
|
225
|
-
if (!image) return null;
|
|
207
|
+
if (!(product == null ? void 0 : product.image)) return null;
|
|
226
208
|
return {
|
|
227
209
|
mimetype: "image",
|
|
228
210
|
sizes: {
|
|
229
|
-
"100x100": image
|
|
211
|
+
"100x100": product.image
|
|
230
212
|
},
|
|
231
213
|
updatedAt: product == null ? void 0 : product.updatedAt
|
|
232
214
|
};
|
|
@@ -364,28 +346,6 @@ const statuses = {
|
|
|
364
346
|
canceled: { text: "Canceled", type: "error" },
|
|
365
347
|
completed: { text: "Completed", type: "success" }
|
|
366
348
|
},
|
|
367
|
-
// @story orders/fulfill
|
|
368
|
-
// An order's fulfillment, ours or Shopify's: one set of words and colours for
|
|
369
|
-
// the Orders list's column and the drawer.
|
|
370
|
-
fulfillment: {
|
|
371
|
-
fulfilled: { text: "Fulfilled", type: "success" },
|
|
372
|
-
partially_fulfilled: { text: "Partially fulfilled", type: "warning" },
|
|
373
|
-
unfulfilled: { text: "Unfulfilled", type: "warning" }
|
|
374
|
-
},
|
|
375
|
-
// @story orders/paid-orders
|
|
376
|
-
// An order's payment, by drawbridge-utils products paymentOf: a Stripe order's
|
|
377
|
-
// and Shopify's values as Shopify spells them. A form order takes none.
|
|
378
|
-
payment: {
|
|
379
|
-
authorized: { text: "Authorized", type: "secondary" },
|
|
380
|
-
disputed: { text: "Disputed", type: "error" },
|
|
381
|
-
expired: { text: "Expired", type: "secondary" },
|
|
382
|
-
paid: { text: "Paid", type: "success" },
|
|
383
|
-
partially_paid: { text: "Partly paid", type: "warning" },
|
|
384
|
-
partially_refunded: { text: "Partly refunded", type: "warning" },
|
|
385
|
-
pending: { text: "Pending", type: "secondary" },
|
|
386
|
-
refunded: { text: "Refunded", type: "secondary" },
|
|
387
|
-
voided: { text: "Voided", type: "secondary" }
|
|
388
|
-
},
|
|
389
349
|
organization: Object.fromEntries(organizationStatuses.map((status) => [status, { text: (0, import_drawbridge_utils.capitalize)(status.replace("_", " ")), type: ["active", "unsubscribed"].includes(status) ? "success" : status === "paused" ? "warning" : "error" }])),
|
|
390
350
|
page: published,
|
|
391
351
|
prize: published,
|
|
@@ -439,13 +399,9 @@ const alertFor = (record) => {
|
|
|
439
399
|
if ((record == null ? void 0 : record.status) === "locked") return { icon: import_lock.default, message: ["Locked", error == null ? void 0 : error.toLowerCase()].filter(Boolean).join(", ") };
|
|
440
400
|
return error ? { icon: import_warning.default, message: error } : null;
|
|
441
401
|
};
|
|
442
|
-
let stripeKey = "";
|
|
443
|
-
const setStripeKey = (key) => {
|
|
444
|
-
stripeKey = key || "";
|
|
445
|
-
};
|
|
446
402
|
const stripeUrl = (label, id, ...more) => {
|
|
447
403
|
const parts = [
|
|
448
|
-
"https://dashboard.stripe.com" + (
|
|
404
|
+
"https://dashboard.stripe.com" + (process.env.NEXT_PUBLIC_STRIPE_API_KEY.includes("_test_") ? "/test" : ""),
|
|
449
405
|
label + "s",
|
|
450
406
|
id,
|
|
451
407
|
...more
|
|
@@ -466,7 +422,6 @@ const years = ({
|
|
|
466
422
|
})
|
|
467
423
|
);
|
|
468
424
|
};
|
|
469
|
-
const money = ({ code, display = "parts", value }) => typeof code === "string" && code ? (0, import_drawbridge_utils.formatCurrency)({ code, display, value }) : null;
|
|
470
425
|
// Annotate the CommonJS export names for ESM import in node:
|
|
471
426
|
0 && (module.exports = {
|
|
472
427
|
acceptingBadge,
|
|
@@ -475,7 +430,6 @@ const money = ({ code, display = "parts", value }) => typeof code === "string" &
|
|
|
475
430
|
bust,
|
|
476
431
|
clickSummary,
|
|
477
432
|
connectionInGroup,
|
|
478
|
-
digitalSizeLimits,
|
|
479
433
|
fileMimes,
|
|
480
434
|
fileParts,
|
|
481
435
|
fileSizeLimits,
|
|
@@ -493,11 +447,9 @@ const money = ({ code, display = "parts", value }) => typeof code === "string" &
|
|
|
493
447
|
hasRestriction,
|
|
494
448
|
imageAlt,
|
|
495
449
|
isAdmin,
|
|
496
|
-
money,
|
|
497
450
|
months,
|
|
498
451
|
organizationAlerts,
|
|
499
452
|
productAsset,
|
|
500
|
-
setStripeKey,
|
|
501
453
|
statusBadge,
|
|
502
454
|
stripeUrl,
|
|
503
455
|
usageBadge,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { allowedUploadTypes,
|
|
2
|
-
import { capitalize,
|
|
1
|
+
import { allowedUploadTypes, maximumUploadBytes } from "@drawbridge/drawbridge-utils/upload";
|
|
2
|
+
import { capitalize, formatNumber, megabyte } from "@drawbridge/drawbridge-utils";
|
|
3
3
|
import Lock from "../../icons/lock.mjs";
|
|
4
4
|
import Warning from "../../icons/warning.mjs";
|
|
5
5
|
const advertisementPreview = (values, options) => {
|
|
@@ -36,9 +36,6 @@ const fileSizeLimits = {
|
|
|
36
36
|
// and if they drift the client blocks files the api would accept.
|
|
37
37
|
video: maximumUploadBytes / megabyte
|
|
38
38
|
};
|
|
39
|
-
const digitalSizeLimits = Object.fromEntries(
|
|
40
|
-
Object.keys(digitalUploadTypes).map((type) => [type, maximumUploadBytes / megabyte])
|
|
41
|
-
);
|
|
42
39
|
const fileSizeLabel = (type, limits) => {
|
|
43
40
|
const limit = (limits || fileSizeLimits)[type];
|
|
44
41
|
return limit >= 1024 ? formatNumber(limit / 1024) + "GB" : limit + "MB";
|
|
@@ -53,10 +50,6 @@ const fileSizes = (type = "media", limits) => {
|
|
|
53
50
|
video,
|
|
54
51
|
application
|
|
55
52
|
],
|
|
56
|
-
// @story products/digital-file
|
|
57
|
-
digital: [
|
|
58
|
-
fileSizeLabel("application", limits || digitalSizeLimits) + " / file"
|
|
59
|
-
],
|
|
60
53
|
media: [
|
|
61
54
|
image,
|
|
62
55
|
video
|
|
@@ -80,9 +73,6 @@ const fileGroups = (pick) => (type = "media") => {
|
|
|
80
73
|
...video,
|
|
81
74
|
...application
|
|
82
75
|
],
|
|
83
|
-
// @story products/digital-file
|
|
84
|
-
// A digital file's own list: the Library's types, a zip and an MP3.
|
|
85
|
-
digital: Object.values(digitalUploadTypes).flatMap(pick),
|
|
86
76
|
media: [
|
|
87
77
|
...image,
|
|
88
78
|
...video
|
|
@@ -96,9 +86,8 @@ const fileTypes = fileGroups(Object.keys);
|
|
|
96
86
|
const fileMimes = fileGroups(Object.values);
|
|
97
87
|
const fileParts = (file) => {
|
|
98
88
|
var _a, _b, _c, _d;
|
|
99
|
-
const [
|
|
100
|
-
const extension = ((_b = (_a = allowedUploadTypes) == null ? void 0 : _a[
|
|
101
|
-
const type = mime || Object.keys(digitalUploadTypes).find((key) => digitalUploadTypes[key][extension]) || "";
|
|
89
|
+
const [type, subtype] = ((file == null ? void 0 : file.type) || "").split("/");
|
|
90
|
+
const extension = ((_b = (_a = allowedUploadTypes) == null ? void 0 : _a[type]) == null ? void 0 : _b[subtype]) ? subtype : (((_d = (_c = file == null ? void 0 : file.name) == null ? void 0 : _c.split(".")) == null ? void 0 : _d.pop()) || "").toLowerCase();
|
|
102
91
|
return {
|
|
103
92
|
extension,
|
|
104
93
|
type
|
|
@@ -147,21 +136,17 @@ const hasConnection = (organization, slug) => {
|
|
|
147
136
|
((organization == null ? void 0 : organization.connectionItems) || []).find((connection) => connection.slug === slug && connection.status === "active")
|
|
148
137
|
);
|
|
149
138
|
};
|
|
150
|
-
const connectionInGroup = (organization, group) => ((organization == null ? void 0 : organization.connectionItems) || []).find((connection) => connection.group === group && connection.status === "active"
|
|
139
|
+
const connectionInGroup = (organization, group) => ((organization == null ? void 0 : organization.connectionItems) || []).find((connection) => connection.group === group && connection.status === "active") || null;
|
|
151
140
|
const hasConnectionGroup = (organization, group) => Boolean(connectionInGroup(organization, group));
|
|
152
141
|
const hasRestriction = (object, key) => {
|
|
153
142
|
return Boolean(((object == null ? void 0 : object.restricted) || []).includes(key));
|
|
154
143
|
};
|
|
155
144
|
const productAsset = (product) => {
|
|
156
|
-
|
|
157
|
-
const first = ((product == null ? void 0 : product.images) || [])[0];
|
|
158
|
-
if ((_a = first == null ? void 0 : first.file) == null ? void 0 : _a.sizes) return first.file;
|
|
159
|
-
const image = (first == null ? void 0 : first.url) || (product == null ? void 0 : product.image);
|
|
160
|
-
if (!image) return null;
|
|
145
|
+
if (!(product == null ? void 0 : product.image)) return null;
|
|
161
146
|
return {
|
|
162
147
|
mimetype: "image",
|
|
163
148
|
sizes: {
|
|
164
|
-
"100x100": image
|
|
149
|
+
"100x100": product.image
|
|
165
150
|
},
|
|
166
151
|
updatedAt: product == null ? void 0 : product.updatedAt
|
|
167
152
|
};
|
|
@@ -299,28 +284,6 @@ const statuses = {
|
|
|
299
284
|
canceled: { text: "Canceled", type: "error" },
|
|
300
285
|
completed: { text: "Completed", type: "success" }
|
|
301
286
|
},
|
|
302
|
-
// @story orders/fulfill
|
|
303
|
-
// An order's fulfillment, ours or Shopify's: one set of words and colours for
|
|
304
|
-
// the Orders list's column and the drawer.
|
|
305
|
-
fulfillment: {
|
|
306
|
-
fulfilled: { text: "Fulfilled", type: "success" },
|
|
307
|
-
partially_fulfilled: { text: "Partially fulfilled", type: "warning" },
|
|
308
|
-
unfulfilled: { text: "Unfulfilled", type: "warning" }
|
|
309
|
-
},
|
|
310
|
-
// @story orders/paid-orders
|
|
311
|
-
// An order's payment, by drawbridge-utils products paymentOf: a Stripe order's
|
|
312
|
-
// and Shopify's values as Shopify spells them. A form order takes none.
|
|
313
|
-
payment: {
|
|
314
|
-
authorized: { text: "Authorized", type: "secondary" },
|
|
315
|
-
disputed: { text: "Disputed", type: "error" },
|
|
316
|
-
expired: { text: "Expired", type: "secondary" },
|
|
317
|
-
paid: { text: "Paid", type: "success" },
|
|
318
|
-
partially_paid: { text: "Partly paid", type: "warning" },
|
|
319
|
-
partially_refunded: { text: "Partly refunded", type: "warning" },
|
|
320
|
-
pending: { text: "Pending", type: "secondary" },
|
|
321
|
-
refunded: { text: "Refunded", type: "secondary" },
|
|
322
|
-
voided: { text: "Voided", type: "secondary" }
|
|
323
|
-
},
|
|
324
287
|
organization: Object.fromEntries(organizationStatuses.map((status) => [status, { text: capitalize(status.replace("_", " ")), type: ["active", "unsubscribed"].includes(status) ? "success" : status === "paused" ? "warning" : "error" }])),
|
|
325
288
|
page: published,
|
|
326
289
|
prize: published,
|
|
@@ -374,13 +337,9 @@ const alertFor = (record) => {
|
|
|
374
337
|
if ((record == null ? void 0 : record.status) === "locked") return { icon: Lock, message: ["Locked", error == null ? void 0 : error.toLowerCase()].filter(Boolean).join(", ") };
|
|
375
338
|
return error ? { icon: Warning, message: error } : null;
|
|
376
339
|
};
|
|
377
|
-
let stripeKey = "";
|
|
378
|
-
const setStripeKey = (key) => {
|
|
379
|
-
stripeKey = key || "";
|
|
380
|
-
};
|
|
381
340
|
const stripeUrl = (label, id, ...more) => {
|
|
382
341
|
const parts = [
|
|
383
|
-
"https://dashboard.stripe.com" + (
|
|
342
|
+
"https://dashboard.stripe.com" + (process.env.NEXT_PUBLIC_STRIPE_API_KEY.includes("_test_") ? "/test" : ""),
|
|
384
343
|
label + "s",
|
|
385
344
|
id,
|
|
386
345
|
...more
|
|
@@ -401,7 +360,6 @@ const years = ({
|
|
|
401
360
|
})
|
|
402
361
|
);
|
|
403
362
|
};
|
|
404
|
-
const money = ({ code, display = "parts", value }) => typeof code === "string" && code ? formatCurrency({ code, display, value }) : null;
|
|
405
363
|
export {
|
|
406
364
|
acceptingBadge,
|
|
407
365
|
advertisementPreview,
|
|
@@ -409,7 +367,6 @@ export {
|
|
|
409
367
|
bust,
|
|
410
368
|
clickSummary,
|
|
411
369
|
connectionInGroup,
|
|
412
|
-
digitalSizeLimits,
|
|
413
370
|
fileMimes,
|
|
414
371
|
fileParts,
|
|
415
372
|
fileSizeLimits,
|
|
@@ -427,11 +384,9 @@ export {
|
|
|
427
384
|
hasRestriction,
|
|
428
385
|
imageAlt,
|
|
429
386
|
isAdmin,
|
|
430
|
-
money,
|
|
431
387
|
months,
|
|
432
388
|
organizationAlerts,
|
|
433
389
|
productAsset,
|
|
434
|
-
setStripeKey,
|
|
435
390
|
statusBadge,
|
|
436
391
|
stripeUrl,
|
|
437
392
|
usageBadge,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drawbridge/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.49",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./advertisement": {
|
|
6
6
|
"types": "./types/advertisement.d.ts",
|
|
@@ -12,11 +12,6 @@
|
|
|
12
12
|
"import": "./dist/bridge/advertisements.mjs",
|
|
13
13
|
"default": "./dist/bridge/advertisements.js"
|
|
14
14
|
},
|
|
15
|
-
"./bridge/cart-drawer": {
|
|
16
|
-
"types": "./types/bridge/cart-drawer.d.ts",
|
|
17
|
-
"import": "./dist/bridge/cart-drawer.mjs",
|
|
18
|
-
"default": "./dist/bridge/cart-drawer.js"
|
|
19
|
-
},
|
|
20
15
|
"./bridge/countdown": {
|
|
21
16
|
"types": "./types/bridge/countdown.d.ts",
|
|
22
17
|
"import": "./dist/bridge/countdown.mjs",
|
|
@@ -32,11 +27,6 @@
|
|
|
32
27
|
"import": "./dist/bridge/form-subdomain-agreement.mjs",
|
|
33
28
|
"default": "./dist/bridge/form-subdomain-agreement.js"
|
|
34
29
|
},
|
|
35
|
-
"./bridge/form-subdomain-checkout": {
|
|
36
|
-
"types": "./types/bridge/form-subdomain-checkout.d.ts",
|
|
37
|
-
"import": "./dist/bridge/form-subdomain-checkout.mjs",
|
|
38
|
-
"default": "./dist/bridge/form-subdomain-checkout.js"
|
|
39
|
-
},
|
|
40
30
|
"./bridge/form-subdomain-embed": {
|
|
41
31
|
"types": "./types/bridge/form-subdomain-embed.d.ts",
|
|
42
32
|
"import": "./dist/bridge/form-subdomain-embed.mjs",
|
|
@@ -82,11 +72,6 @@
|
|
|
82
72
|
"import": "./dist/bridge/lib/age-gate.mjs",
|
|
83
73
|
"default": "./dist/bridge/lib/age-gate.js"
|
|
84
74
|
},
|
|
85
|
-
"./bridge/lib/cart": {
|
|
86
|
-
"types": "./types/bridge/lib/cart.d.ts",
|
|
87
|
-
"import": "./dist/bridge/lib/cart.mjs",
|
|
88
|
-
"default": "./dist/bridge/lib/cart.js"
|
|
89
|
-
},
|
|
90
75
|
"./bridge/lib/checkout-kit": {
|
|
91
76
|
"types": "./types/bridge/lib/checkout-kit.d.ts",
|
|
92
77
|
"import": "./dist/bridge/lib/checkout-kit.mjs",
|
|
@@ -347,11 +332,6 @@
|
|
|
347
332
|
"import": "./dist/dashboard/dropdown.mjs",
|
|
348
333
|
"default": "./dist/dashboard/dropdown.js"
|
|
349
334
|
},
|
|
350
|
-
"./dashboard/embed-stripe": {
|
|
351
|
-
"types": "./types/dashboard/embed-stripe.d.ts",
|
|
352
|
-
"import": "./dist/dashboard/embed-stripe.mjs",
|
|
353
|
-
"default": "./dist/dashboard/embed-stripe.js"
|
|
354
|
-
},
|
|
355
335
|
"./dashboard/form-action": {
|
|
356
336
|
"types": "./types/dashboard/form-action.d.ts",
|
|
357
337
|
"import": "./dist/dashboard/form-action.mjs",
|
|
@@ -502,11 +482,6 @@
|
|
|
502
482
|
"import": "./dist/dashboard/form-organization-campaign-draw.mjs",
|
|
503
483
|
"default": "./dist/dashboard/form-organization-campaign-draw.js"
|
|
504
484
|
},
|
|
505
|
-
"./dashboard/form-organization-campaign-field-birthday": {
|
|
506
|
-
"types": "./types/dashboard/form-organization-campaign-field-birthday.d.ts",
|
|
507
|
-
"import": "./dist/dashboard/form-organization-campaign-field-birthday.mjs",
|
|
508
|
-
"default": "./dist/dashboard/form-organization-campaign-field-birthday.js"
|
|
509
|
-
},
|
|
510
485
|
"./dashboard/form-organization-campaign-field-email": {
|
|
511
486
|
"types": "./types/dashboard/form-organization-campaign-field-email.d.ts",
|
|
512
487
|
"import": "./dist/dashboard/form-organization-campaign-field-email.mjs",
|
|
@@ -532,11 +507,6 @@
|
|
|
532
507
|
"import": "./dist/dashboard/form-organization-campaign-field-phone.mjs",
|
|
533
508
|
"default": "./dist/dashboard/form-organization-campaign-field-phone.js"
|
|
534
509
|
},
|
|
535
|
-
"./dashboard/form-organization-campaign-field-rating": {
|
|
536
|
-
"types": "./types/dashboard/form-organization-campaign-field-rating.d.ts",
|
|
537
|
-
"import": "./dist/dashboard/form-organization-campaign-field-rating.mjs",
|
|
538
|
-
"default": "./dist/dashboard/form-organization-campaign-field-rating.js"
|
|
539
|
-
},
|
|
540
510
|
"./dashboard/form-organization-campaign-field-remove": {
|
|
541
511
|
"types": "./types/dashboard/form-organization-campaign-field-remove.d.ts",
|
|
542
512
|
"import": "./dist/dashboard/form-organization-campaign-field-remove.mjs",
|
|
@@ -692,11 +662,6 @@
|
|
|
692
662
|
"import": "./dist/dashboard/form-organization-member.mjs",
|
|
693
663
|
"default": "./dist/dashboard/form-organization-member.js"
|
|
694
664
|
},
|
|
695
|
-
"./dashboard/form-organization-product": {
|
|
696
|
-
"types": "./types/dashboard/form-organization-product.d.ts",
|
|
697
|
-
"import": "./dist/dashboard/form-organization-product.mjs",
|
|
698
|
-
"default": "./dist/dashboard/form-organization-product.js"
|
|
699
|
-
},
|
|
700
665
|
"./dashboard/form-organization-segment": {
|
|
701
666
|
"types": "./types/dashboard/form-organization-segment.d.ts",
|
|
702
667
|
"import": "./dist/dashboard/form-organization-segment.mjs",
|
|
@@ -812,11 +777,6 @@
|
|
|
812
777
|
"import": "./dist/dashboard/input-font.mjs",
|
|
813
778
|
"default": "./dist/dashboard/input-font.js"
|
|
814
779
|
},
|
|
815
|
-
"./dashboard/input-gallery": {
|
|
816
|
-
"types": "./types/dashboard/input-gallery.d.ts",
|
|
817
|
-
"import": "./dist/dashboard/input-gallery.mjs",
|
|
818
|
-
"default": "./dist/dashboard/input-gallery.js"
|
|
819
|
-
},
|
|
820
780
|
"./dashboard/input-group-ai": {
|
|
821
781
|
"types": "./types/dashboard/input-group-ai.d.ts",
|
|
822
782
|
"import": "./dist/dashboard/input-group-ai.mjs",
|
|
@@ -917,21 +877,11 @@
|
|
|
917
877
|
"import": "./dist/dashboard/lib/overage.mjs",
|
|
918
878
|
"default": "./dist/dashboard/lib/overage.js"
|
|
919
879
|
},
|
|
920
|
-
"./dashboard/lib/products": {
|
|
921
|
-
"types": "./types/dashboard/lib/products.d.ts",
|
|
922
|
-
"import": "./dist/dashboard/lib/products.mjs",
|
|
923
|
-
"default": "./dist/dashboard/lib/products.js"
|
|
924
|
-
},
|
|
925
880
|
"./dashboard/lib/rail": {
|
|
926
881
|
"types": "./types/dashboard/lib/rail.d.ts",
|
|
927
882
|
"import": "./dist/dashboard/lib/rail.mjs",
|
|
928
883
|
"default": "./dist/dashboard/lib/rail.js"
|
|
929
884
|
},
|
|
930
|
-
"./dashboard/lib/settings-paths": {
|
|
931
|
-
"types": "./types/dashboard/lib/settings-paths.d.ts",
|
|
932
|
-
"import": "./dist/dashboard/lib/settings-paths.mjs",
|
|
933
|
-
"default": "./dist/dashboard/lib/settings-paths.js"
|
|
934
|
-
},
|
|
935
885
|
"./dashboard/lib/sms": {
|
|
936
886
|
"types": "./types/dashboard/lib/sms.d.ts",
|
|
937
887
|
"import": "./dist/dashboard/lib/sms.mjs",
|
|
@@ -1052,11 +1002,6 @@
|
|
|
1052
1002
|
"import": "./dist/dashboard/recharts.mjs",
|
|
1053
1003
|
"default": "./dist/dashboard/recharts.js"
|
|
1054
1004
|
},
|
|
1055
|
-
"./dashboard/shipping-rates": {
|
|
1056
|
-
"types": "./types/dashboard/shipping-rates.d.ts",
|
|
1057
|
-
"import": "./dist/dashboard/shipping-rates.mjs",
|
|
1058
|
-
"default": "./dist/dashboard/shipping-rates.js"
|
|
1059
|
-
},
|
|
1060
1005
|
"./dashboard/steps": {
|
|
1061
1006
|
"types": "./types/dashboard/steps.d.ts",
|
|
1062
1007
|
"import": "./dist/dashboard/steps.mjs",
|
|
@@ -1082,11 +1027,6 @@
|
|
|
1082
1027
|
"import": "./dist/dashboard/table.mjs",
|
|
1083
1028
|
"default": "./dist/dashboard/table.js"
|
|
1084
1029
|
},
|
|
1085
|
-
"./dashboard/template-buyer": {
|
|
1086
|
-
"types": "./types/dashboard/template-buyer.d.ts",
|
|
1087
|
-
"import": "./dist/dashboard/template-buyer.mjs",
|
|
1088
|
-
"default": "./dist/dashboard/template-buyer.js"
|
|
1089
|
-
},
|
|
1090
1030
|
"./dashboard/template-dashboard": {
|
|
1091
1031
|
"types": "./types/dashboard/template-dashboard.d.ts",
|
|
1092
1032
|
"import": "./dist/dashboard/template-dashboard.mjs",
|
|
@@ -1837,11 +1777,6 @@
|
|
|
1837
1777
|
"import": "./dist/shared/loader.mjs",
|
|
1838
1778
|
"default": "./dist/shared/loader.js"
|
|
1839
1779
|
},
|
|
1840
|
-
"./shared/order-summary": {
|
|
1841
|
-
"types": "./types/shared/order-summary.d.ts",
|
|
1842
|
-
"import": "./dist/shared/order-summary.mjs",
|
|
1843
|
-
"default": "./dist/shared/order-summary.js"
|
|
1844
|
-
},
|
|
1845
1780
|
"./shared/overlay": {
|
|
1846
1781
|
"types": "./types/shared/overlay.d.ts",
|
|
1847
1782
|
"import": "./dist/shared/overlay.mjs",
|
|
@@ -1918,7 +1853,6 @@
|
|
|
1918
1853
|
"@hookform/resolvers": ">=3.1.1",
|
|
1919
1854
|
"@sentry/nextjs": ">=10.58.0",
|
|
1920
1855
|
"@shopify/checkout-kit": ">=4.0.0-alpha.4",
|
|
1921
|
-
"@stripe/connect-js": ">=3.5.0",
|
|
1922
1856
|
"@stripe/react-stripe-js": ">=3.9.0",
|
|
1923
1857
|
"@stripe/stripe-js": ">=3.3.0",
|
|
1924
1858
|
"@tanstack/react-query": ">=5.54.1",
|
|
@@ -1962,9 +1896,6 @@
|
|
|
1962
1896
|
"@shopify/checkout-kit": {
|
|
1963
1897
|
"optional": true
|
|
1964
1898
|
},
|
|
1965
|
-
"@stripe/connect-js": {
|
|
1966
|
-
"optional": true
|
|
1967
|
-
},
|
|
1968
1899
|
"@stripe/react-stripe-js": {
|
|
1969
1900
|
"optional": true
|
|
1970
1901
|
},
|
|
@@ -2033,7 +1964,7 @@
|
|
|
2033
1964
|
"@analytics/google-tag-manager": "0.5.5",
|
|
2034
1965
|
"@drawbridge/drawbridge-agents": "0.1.104",
|
|
2035
1966
|
"@drawbridge/drawbridge-telemetry": "0.0.19",
|
|
2036
|
-
"@drawbridge/drawbridge-utils": "0.0.
|
|
1967
|
+
"@drawbridge/drawbridge-utils": "0.0.238",
|
|
2037
1968
|
"@headlessui/react": "2.2.9",
|
|
2038
1969
|
"@hookform/resolvers": "3.1.1",
|
|
2039
1970
|
"@sentry/nextjs": "10.58.0",
|
|
@@ -2041,9 +1972,8 @@
|
|
|
2041
1972
|
"@storybook/addon-docs": "10.6.2",
|
|
2042
1973
|
"@storybook/addon-vitest": "10.6.2",
|
|
2043
1974
|
"@storybook/nextjs-vite": "10.6.2",
|
|
2044
|
-
"@stripe/
|
|
2045
|
-
"@stripe/
|
|
2046
|
-
"@stripe/stripe-js": "10.2.1",
|
|
1975
|
+
"@stripe/react-stripe-js": "3.9.0",
|
|
1976
|
+
"@stripe/stripe-js": "3.3.0",
|
|
2047
1977
|
"@tailwindcss/vite": "4.3.3",
|
|
2048
1978
|
"@tanstack/react-query": "5.54.1",
|
|
2049
1979
|
"@tanstack/react-query-devtools": "5.54.1",
|
package/types/bridge/fields.d.ts
CHANGED
|
@@ -27,20 +27,8 @@ export interface FieldProps {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// A Section asks nothing; a skill testing question is its question with a
|
|
30
|
-
// number input ( Pistachio ).
|
|
31
|
-
|
|
32
|
-
// Multiple choice ( radio ), Multi-select ( checkbox, answering the ticked
|
|
33
|
-
// options' text ) and Rating ( a number from 1 to attributes.max ).
|
|
34
|
-
export declare const components: Record<'birthday' | 'checkbox' | 'email' | 'name' | 'number' | 'phone' | 'radio' | 'rating' | 'section' | 'select' | 'skill' | 'text' | 'textarea', ComponentType<FieldProps>>;
|
|
35
|
-
|
|
36
|
-
// A Multi-select's ticked options after ticking or unticking `option`, in the
|
|
37
|
-
// field's own order.
|
|
38
|
-
export declare const tick: ( options: Array<{ option?: string }> | undefined, value: unknown, option: string ) => string[];
|
|
39
|
-
|
|
40
|
-
// The Birthday field's boxes into its answer, "1990-05-14" ( '' when all are
|
|
41
|
-
// blank ), and an answer back into the boxes.
|
|
42
|
-
export declare const birthdayValue: ( parts?: { day?: string; month?: string; year?: string } ) => string;
|
|
43
|
-
export declare const birthdayInputs: ( value?: string | null ) => { day: string; month: string; year: string };
|
|
30
|
+
// number input ( Pistachio ).
|
|
31
|
+
export declare const components: Record<'email' | 'name' | 'number' | 'phone' | 'section' | 'select' | 'skill' | 'text' | 'textarea', ComponentType<FieldProps>>;
|
|
44
32
|
|
|
45
33
|
// The label with " *" after it, unless attributes.required is false.
|
|
46
34
|
export declare const starred: ( field?: Field ) => string | undefined;
|
|
@@ -7,7 +7,6 @@ export interface CartLine {
|
|
|
7
7
|
currency?: string;
|
|
8
8
|
id: string;
|
|
9
9
|
image?: string;
|
|
10
|
-
left?: number | null;
|
|
11
10
|
price?: number | string;
|
|
12
11
|
productTitle?: string;
|
|
13
12
|
quantity?: number;
|
|
@@ -28,13 +27,11 @@ export interface FormSubdomainProductProps {
|
|
|
28
27
|
|
|
29
28
|
export interface FormSubdomainCartProps {
|
|
30
29
|
button?: ReactNode;
|
|
31
|
-
cart?: {
|
|
32
|
-
//
|
|
33
|
-
|
|
30
|
+
cart?: { checkoutUrl?: string; lines?: CartLine[]; [ key: string ]: unknown };
|
|
31
|
+
// Render prop: the page behind the drawer, handed the drawer's open/close setter.
|
|
32
|
+
children?: ( setShow: ( show: boolean ) => void ) => ReactNode;
|
|
34
33
|
onLineRemove?: ( id: string ) => unknown;
|
|
35
34
|
onLineUpdate?: ( id: string, quantity: number ) => unknown;
|
|
36
|
-
// A Recommended row opens its product over the cart.
|
|
37
|
-
onOpenProduct?: ( product: any ) => void;
|
|
38
35
|
onSuccess?: ( response: { result: unknown } ) => void;
|
|
39
36
|
style?: BrandStyle;
|
|
40
37
|
tracking?: Tracking;
|
|
@@ -42,24 +39,3 @@ export interface FormSubdomainCartProps {
|
|
|
42
39
|
|
|
43
40
|
export declare const FormSubdomainProduct: ComponentType<FormSubdomainProductProps>;
|
|
44
41
|
export declare const FormSubdomainCart: ComponentType<FormSubdomainCartProps>;
|
|
45
|
-
|
|
46
|
-
// One item as the cart draws it: a line or a recommended product.
|
|
47
|
-
export interface CartItemProps {
|
|
48
|
-
aside?: ReactNode;
|
|
49
|
-
children?: ReactNode;
|
|
50
|
-
currency?: string | null;
|
|
51
|
-
image?: string | null;
|
|
52
|
-
price?: number | string | null;
|
|
53
|
-
subtitle?: string | null;
|
|
54
|
-
title?: string | null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export declare const CartItem: ComponentType<CartItemProps>;
|
|
58
|
-
|
|
59
|
-
export interface CartRecommendedProps {
|
|
60
|
-
items?: any[];
|
|
61
|
-
onOpen?: ( product: any ) => void;
|
|
62
|
-
style?: BrandStyle;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export declare const CartRecommended: ComponentType<CartRecommendedProps>;
|
|
@@ -9,8 +9,3 @@ export declare const ageFor: ( year: string | number | null | undefined, current
|
|
|
9
9
|
// Left as `any` — a yup schema is a chain object this package cannot type
|
|
10
10
|
// without the real 'yup' library's types (see ../../shared/lib/yup.d.ts).
|
|
11
11
|
export declare const ageGateSchema: ( values: { min?: number; max?: number } | null | undefined, currentYear?: number ) => any;
|
|
12
|
-
|
|
13
|
-
// @story fields/birthday
|
|
14
|
-
// The form's answers with the age step's date ( "5/14/1990" ) under the
|
|
15
|
-
// Birthday field's id as "1990-05-14", unless it is already answered.
|
|
16
|
-
export declare const ageBirthday: ( fields: { sections?: Array<{ fields?: Array<{ id?: string; slug?: string }> }> } | null | undefined, answers: Record<string, unknown> | undefined, birthday?: string ) => Record<string, unknown>;
|
|
@@ -2,18 +2,26 @@
|
|
|
2
2
|
// the server, where both calls refuse or do nothing.
|
|
3
3
|
|
|
4
4
|
export interface CheckoutArgs {
|
|
5
|
+
advertisement?: string;
|
|
6
|
+
affiliate?: string | null;
|
|
7
|
+
campaign?: string;
|
|
5
8
|
checkoutUrl?: string;
|
|
9
|
+
lines?: { merchandiseId: string; quantity: number }[];
|
|
6
10
|
onClose?: () => void;
|
|
7
11
|
onComplete?: ( detail?: unknown ) => void;
|
|
8
12
|
onOpen?: () => void;
|
|
9
13
|
// Same-window fallback when no popup can open; defaults to window.location.assign.
|
|
10
14
|
onRedirect?: ( url: string ) => void;
|
|
15
|
+
organization?: string;
|
|
16
|
+
page?: string;
|
|
17
|
+
slug?: string;
|
|
18
|
+
subdomain?: string;
|
|
11
19
|
[ key: string ]: unknown;
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
// Preloads and registers the element; rejects on the server or if the package fails to load.
|
|
15
23
|
export declare const ensureCheckoutKit: () => Promise<void>;
|
|
16
24
|
|
|
17
|
-
//
|
|
18
|
-
// checkout url, or null when there is none.
|
|
25
|
+
// Creates the cart from `lines` (or takes `checkoutUrl`) and opens checkout in a
|
|
26
|
+
// popup, else redirects. Resolves to the checkout url, or null when there is none.
|
|
19
27
|
export declare const checkout: ( args: CheckoutArgs ) => Promise<string | null>;
|
|
@@ -68,6 +68,3 @@ export declare const menuAgreements: ( data?: { agreements?: Record<string, any>
|
|
|
68
68
|
|
|
69
69
|
// The payload's agreements with the locale endpoint's content over them.
|
|
70
70
|
export declare const withLocale: ( agreements?: Record<string, any>, locale?: Record<string, any> ) => Record<string, any>;
|
|
71
|
-
|
|
72
|
-
// The line under a linked Terms checkbox; null while the giveaway is off.
|
|
73
|
-
export declare const termsOptOut: ( values?: { giveaway?: boolean; sms?: boolean } ) => string | null;
|
|
@@ -3,10 +3,6 @@ import { Answer, AnswerField } from './answer-rows';
|
|
|
3
3
|
import { CardShortcutFile } from './card-shortcut';
|
|
4
4
|
|
|
5
5
|
export interface CardOrderLine {
|
|
6
|
-
// A digital line: how many times the buyer downloaded it.
|
|
7
|
-
downloads?: number;
|
|
8
|
-
// A digital line's file id; the line then reads its downloads.
|
|
9
|
-
file?: string | null;
|
|
10
6
|
// A form line's item file, or a store line's product image url.
|
|
11
7
|
image?: CardShortcutFile | string | null;
|
|
12
8
|
price?: number;
|
|
@@ -39,8 +35,6 @@ export interface CardOrderProps {
|
|
|
39
35
|
gross?: number;
|
|
40
36
|
lines?: CardOrderLine[];
|
|
41
37
|
net?: number;
|
|
42
|
-
// Resend download on each digital line; emails the buyer their links again.
|
|
43
|
-
onResend?: () => void;
|
|
44
38
|
provider?: CardOrderProvider;
|
|
45
39
|
purchasedAt?: string | number | Date;
|
|
46
40
|
// Fee rate in percent; not shown for a redemption.
|
|
@@ -2,13 +2,14 @@ import { Node } from '@tiptap/core';
|
|
|
2
2
|
import { DocumentData } from '../shared/document-pieces';
|
|
3
3
|
import { InputEditorBlocks } from './input-editor';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// `locked`: piece keys with no close button, which no edit removes.
|
|
6
|
+
export declare const documentNodes: ( options: { data?: DocumentData; locked?: string[]; onClaim?: ( days: number ) => void } ) => Node[];
|
|
6
7
|
|
|
7
8
|
export declare const present: ( editor: any ) => Set<string>;
|
|
8
9
|
|
|
9
10
|
export declare const insertPiece: ( editor: any, key: string ) => void;
|
|
10
11
|
|
|
11
12
|
// What InputEditor takes as `blocks`: the grey blocks, H1 to H3, List and Insert.
|
|
12
|
-
declare const documentBlocks: ( options: { data?: DocumentData; insertable?: string[]; onClaim?: ( days: number ) => void } ) => InputEditorBlocks;
|
|
13
|
+
declare const documentBlocks: ( options: { data?: DocumentData; insertable?: string[]; locked?: string[]; onClaim?: ( days: number ) => void } ) => InputEditorBlocks;
|
|
13
14
|
|
|
14
15
|
export default documentBlocks;
|