@drawbridge/components 0.1.13 → 0.1.15
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 +577 -0
- package/dist/bridge/form-subdomain-missions.mjs +540 -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 +277 -0
- package/dist/dashboard/card-campaign-switch.mjs +243 -0
- package/dist/dashboard/card-order.js +231 -29
- package/dist/dashboard/card-order.mjs +231 -29
- 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 +205 -0
- package/dist/dashboard/connection-workflows.mjs +171 -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-field-select.js +51 -5
- package/dist/dashboard/form-organization-campaign-field-select.mjs +51 -5
- package/dist/dashboard/form-organization-campaign-field-textarea.js +46 -8
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +46 -8
- 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 +243 -0
- package/dist/dashboard/form-organization-campaign-section.mjs +214 -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 +708 -687
- package/dist/dashboard/form-organization-workflow.mjs +704 -683
- 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 +83 -0
- package/dist/input-code.mjs +50 -0
- package/dist/input-text.js +2 -1
- package/dist/input-text.mjs +2 -1
- package/dist/shared/button.js +1 -1
- package/dist/shared/button.mjs +1 -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 +123 -0
- package/dist/shared/lib/campaign.mjs +96 -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 +38 -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 +25 -1
- 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 +29 -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 +56 -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,59 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var entry_exports = {};
|
|
19
|
+
__export(entry_exports, {
|
|
20
|
+
agreementWording: () => agreementWording,
|
|
21
|
+
awardingOn: () => awardingOn,
|
|
22
|
+
buttonText: () => buttonText,
|
|
23
|
+
copy: () => copy,
|
|
24
|
+
formOn: () => formOn,
|
|
25
|
+
giveawayOn: () => giveawayOn,
|
|
26
|
+
panelMissions: () => panelMissions,
|
|
27
|
+
panelTitle: () => panelTitle
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(entry_exports);
|
|
30
|
+
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
31
|
+
const copy = (data, key) => {
|
|
32
|
+
var _a, _b, _c, _d, _e;
|
|
33
|
+
return ((_a = data == null ? void 0 : data.defaults) == null ? void 0 : _a[key]) || ((_e = (_d = (_c = (_b = import_drawbridge_utils.constants) == null ? void 0 : _b.campaign) == null ? void 0 : _c.form) == null ? void 0 : _d.copy) == null ? void 0 : _e[key === "purchase" ? "order" : key]);
|
|
34
|
+
};
|
|
35
|
+
const agreementWording = {
|
|
36
|
+
marketing: "I agree to receive marketing emails about this campaign. Unsubscribe any time.",
|
|
37
|
+
// The default wording carrier reviewers look for: explicit texts, rates, and STOP.
|
|
38
|
+
sms: "I agree to receive text messages about this campaign. Message and data rates may apply. Reply STOP to opt out."
|
|
39
|
+
};
|
|
40
|
+
const buttonText = (data, open) => copy(data, !open ? "inactive" : (data == null ? void 0 : data.awarding) === false ? "button" : "active");
|
|
41
|
+
const formOn = (data) => (data == null ? void 0 : data.form) !== false;
|
|
42
|
+
const giveawayOn = (data) => (data == null ? void 0 : data.giveaway) !== false;
|
|
43
|
+
const awardingOn = (data) => giveawayOn(data) && (data == null ? void 0 : data.awarding) !== false;
|
|
44
|
+
const panelTitle = (data, awarding = awardingOn(data)) => {
|
|
45
|
+
var _a, _b, _c, _d, _e, _f;
|
|
46
|
+
return ((_a = data == null ? void 0 : data.defaults) == null ? void 0 : _a.title) || ((_f = (_e = (_d = (_c = (_b = import_drawbridge_utils.constants) == null ? void 0 : _b.campaign) == null ? void 0 : _c.form) == null ? void 0 : _d.copy) == null ? void 0 : _e.title) == null ? void 0 : _f[awarding ? "awarding" : "open"]);
|
|
47
|
+
};
|
|
48
|
+
const panelMissions = (missions = [], repeat = false) => repeat ? (missions || []).filter((item) => (item == null ? void 0 : item.type) !== "form") : missions;
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
agreementWording,
|
|
52
|
+
awardingOn,
|
|
53
|
+
buttonText,
|
|
54
|
+
copy,
|
|
55
|
+
formOn,
|
|
56
|
+
giveawayOn,
|
|
57
|
+
panelMissions,
|
|
58
|
+
panelTitle
|
|
59
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { constants } from "@drawbridge/drawbridge-utils";
|
|
2
|
+
const copy = (data, key) => {
|
|
3
|
+
var _a, _b, _c, _d, _e;
|
|
4
|
+
return ((_a = data == null ? void 0 : data.defaults) == null ? void 0 : _a[key]) || ((_e = (_d = (_c = (_b = constants) == null ? void 0 : _b.campaign) == null ? void 0 : _c.form) == null ? void 0 : _d.copy) == null ? void 0 : _e[key === "purchase" ? "order" : key]);
|
|
5
|
+
};
|
|
6
|
+
const agreementWording = {
|
|
7
|
+
marketing: "I agree to receive marketing emails about this campaign. Unsubscribe any time.",
|
|
8
|
+
// The default wording carrier reviewers look for: explicit texts, rates, and STOP.
|
|
9
|
+
sms: "I agree to receive text messages about this campaign. Message and data rates may apply. Reply STOP to opt out."
|
|
10
|
+
};
|
|
11
|
+
const buttonText = (data, open) => copy(data, !open ? "inactive" : (data == null ? void 0 : data.awarding) === false ? "button" : "active");
|
|
12
|
+
const formOn = (data) => (data == null ? void 0 : data.form) !== false;
|
|
13
|
+
const giveawayOn = (data) => (data == null ? void 0 : data.giveaway) !== false;
|
|
14
|
+
const awardingOn = (data) => giveawayOn(data) && (data == null ? void 0 : data.awarding) !== false;
|
|
15
|
+
const panelTitle = (data, awarding = awardingOn(data)) => {
|
|
16
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17
|
+
return ((_a = data == null ? void 0 : data.defaults) == null ? void 0 : _a.title) || ((_f = (_e = (_d = (_c = (_b = constants) == null ? void 0 : _b.campaign) == null ? void 0 : _c.form) == null ? void 0 : _d.copy) == null ? void 0 : _e.title) == null ? void 0 : _f[awarding ? "awarding" : "open"]);
|
|
18
|
+
};
|
|
19
|
+
const panelMissions = (missions = [], repeat = false) => repeat ? (missions || []).filter((item) => (item == null ? void 0 : item.type) !== "form") : missions;
|
|
20
|
+
export {
|
|
21
|
+
agreementWording,
|
|
22
|
+
awardingOn,
|
|
23
|
+
buttonText,
|
|
24
|
+
copy,
|
|
25
|
+
formOn,
|
|
26
|
+
giveawayOn,
|
|
27
|
+
panelMissions,
|
|
28
|
+
panelTitle
|
|
29
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var location_exports = {};
|
|
19
|
+
__export(location_exports, {
|
|
20
|
+
LOCATION_TIMEOUT: () => LOCATION_TIMEOUT,
|
|
21
|
+
locationCopy: () => locationCopy,
|
|
22
|
+
locationStatus: () => locationStatus
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(location_exports);
|
|
25
|
+
const LOCATION_TIMEOUT = 15e3;
|
|
26
|
+
const locationCopy = {
|
|
27
|
+
asking: "Allow location access in your browser to continue.",
|
|
28
|
+
denied: "Location access is off for this page. Turn it on in your browser settings, then try again.",
|
|
29
|
+
missing: "We couldn't find your location.",
|
|
30
|
+
unsupported: "Your browser or device does not support location."
|
|
31
|
+
};
|
|
32
|
+
const locationStatus = (error) => (error == null ? void 0 : error.code) === 1 ? "denied" : "missing";
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
LOCATION_TIMEOUT,
|
|
36
|
+
locationCopy,
|
|
37
|
+
locationStatus
|
|
38
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const LOCATION_TIMEOUT = 15e3;
|
|
2
|
+
const locationCopy = {
|
|
3
|
+
asking: "Allow location access in your browser to continue.",
|
|
4
|
+
denied: "Location access is off for this page. Turn it on in your browser settings, then try again.",
|
|
5
|
+
missing: "We couldn't find your location.",
|
|
6
|
+
unsupported: "Your browser or device does not support location."
|
|
7
|
+
};
|
|
8
|
+
const locationStatus = (error) => (error == null ? void 0 : error.code) === 1 ? "denied" : "missing";
|
|
9
|
+
export {
|
|
10
|
+
LOCATION_TIMEOUT,
|
|
11
|
+
locationCopy,
|
|
12
|
+
locationStatus
|
|
13
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var order_exports = {};
|
|
19
|
+
__export(order_exports, {
|
|
20
|
+
isLastList: () => isLastList,
|
|
21
|
+
itemCount: () => itemCount,
|
|
22
|
+
limitMessage: () => limitMessage,
|
|
23
|
+
orderTotal: () => orderTotal,
|
|
24
|
+
sectionsOf: () => sectionsOf
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(order_exports);
|
|
27
|
+
var import_fields_validate = require("@drawbridge/drawbridge-utils/fields-validate");
|
|
28
|
+
const sectionsOf = (fields) => Array.isArray(fields == null ? void 0 : fields.sections) && fields.sections.length > 0 ? fields.sections : [
|
|
29
|
+
{
|
|
30
|
+
fields: [
|
|
31
|
+
...(fields == null ? void 0 : fields.lead) || [],
|
|
32
|
+
...(fields == null ? void 0 : fields.additional) || []
|
|
33
|
+
],
|
|
34
|
+
id: "information",
|
|
35
|
+
title: "Your information",
|
|
36
|
+
type: "information"
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
const lists = (fields = []) => fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
|
|
40
|
+
const lines = (fields, answers = {}) => lists(fields).flatMap((field) => {
|
|
41
|
+
var _a;
|
|
42
|
+
return (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).map((item) => {
|
|
43
|
+
var _a2;
|
|
44
|
+
return {
|
|
45
|
+
item,
|
|
46
|
+
quantity: Number((_a2 = answers == null ? void 0 : answers[field.id]) == null ? void 0 : _a2[item.id]) || 0
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
const orderTotal = (fields, answers) => Math.round(lines(fields, answers).reduce(
|
|
51
|
+
(sum, { item, quantity }) => sum + (typeof (item == null ? void 0 : item.price) === "number" ? item.price * quantity : 0),
|
|
52
|
+
0
|
|
53
|
+
) * 100) / 100;
|
|
54
|
+
const itemCount = (fields, answers) => lines(fields, answers).reduce((sum, { quantity }) => sum + quantity, 0);
|
|
55
|
+
const isLastList = (fields, id) => {
|
|
56
|
+
var _a;
|
|
57
|
+
return Boolean(id) && ((_a = lists(fields).at(-1)) == null ? void 0 : _a.id) === id;
|
|
58
|
+
};
|
|
59
|
+
const limitMessage = (item, quantity) => {
|
|
60
|
+
var _a;
|
|
61
|
+
const max = (_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max;
|
|
62
|
+
return max && Number(quantity) >= max ? import_fields_validate.errors.limit(max) : null;
|
|
63
|
+
};
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
isLastList,
|
|
67
|
+
itemCount,
|
|
68
|
+
limitMessage,
|
|
69
|
+
orderTotal,
|
|
70
|
+
sectionsOf
|
|
71
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { errors } from "@drawbridge/drawbridge-utils/fields-validate";
|
|
2
|
+
const sectionsOf = (fields) => Array.isArray(fields == null ? void 0 : fields.sections) && fields.sections.length > 0 ? fields.sections : [
|
|
3
|
+
{
|
|
4
|
+
fields: [
|
|
5
|
+
...(fields == null ? void 0 : fields.lead) || [],
|
|
6
|
+
...(fields == null ? void 0 : fields.additional) || []
|
|
7
|
+
],
|
|
8
|
+
id: "information",
|
|
9
|
+
title: "Your information",
|
|
10
|
+
type: "information"
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
const lists = (fields = []) => fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
|
|
14
|
+
const lines = (fields, answers = {}) => lists(fields).flatMap((field) => {
|
|
15
|
+
var _a;
|
|
16
|
+
return (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).map((item) => {
|
|
17
|
+
var _a2;
|
|
18
|
+
return {
|
|
19
|
+
item,
|
|
20
|
+
quantity: Number((_a2 = answers == null ? void 0 : answers[field.id]) == null ? void 0 : _a2[item.id]) || 0
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
const orderTotal = (fields, answers) => Math.round(lines(fields, answers).reduce(
|
|
25
|
+
(sum, { item, quantity }) => sum + (typeof (item == null ? void 0 : item.price) === "number" ? item.price * quantity : 0),
|
|
26
|
+
0
|
|
27
|
+
) * 100) / 100;
|
|
28
|
+
const itemCount = (fields, answers) => lines(fields, answers).reduce((sum, { quantity }) => sum + quantity, 0);
|
|
29
|
+
const isLastList = (fields, id) => {
|
|
30
|
+
var _a;
|
|
31
|
+
return Boolean(id) && ((_a = lists(fields).at(-1)) == null ? void 0 : _a.id) === id;
|
|
32
|
+
};
|
|
33
|
+
const limitMessage = (item, quantity) => {
|
|
34
|
+
var _a;
|
|
35
|
+
const max = (_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max;
|
|
36
|
+
return max && Number(quantity) >= max ? errors.limit(max) : null;
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
isLastList,
|
|
40
|
+
itemCount,
|
|
41
|
+
limitMessage,
|
|
42
|
+
orderTotal,
|
|
43
|
+
sectionsOf
|
|
44
|
+
};
|
package/dist/bridge/lib/url.js
CHANGED
|
@@ -18,6 +18,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
18
18
|
var url_exports = {};
|
|
19
19
|
__export(url_exports, {
|
|
20
20
|
isSafeRedirect: () => isSafeRedirect,
|
|
21
|
+
leadEndpoint: () => leadEndpoint,
|
|
22
|
+
missionEndpoint: () => missionEndpoint,
|
|
21
23
|
safeHref: () => safeHref,
|
|
22
24
|
submissionEndpoint: () => submissionEndpoint
|
|
23
25
|
});
|
|
@@ -56,9 +58,16 @@ const submissionEndpoint = ({ affiliate, id, slug, subdomain, token }) => {
|
|
|
56
58
|
const query = params.toString();
|
|
57
59
|
return "/subdomain/" + subdomain + "/page/" + slug + "/submission/" + encodeURIComponent(id) + (query ? "?" + query : "");
|
|
58
60
|
};
|
|
61
|
+
const leadEndpoint = ({ lead, slug, subdomain, token }) => {
|
|
62
|
+
if (typeof lead !== "string" || !/^[\w-]+\.[\w-]+$/.test(lead)) return null;
|
|
63
|
+
return "/subdomain/" + subdomain + "/page/" + slug + "/lead/" + lead + (token ? "?drwbrdg_pre=" + encodeURIComponent(token) : "");
|
|
64
|
+
};
|
|
65
|
+
const missionEndpoint = ({ action, slug, subdomain, type }) => "/subdomain/" + subdomain + "/page/" + slug + "/mission/" + type + "/" + action;
|
|
59
66
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
67
|
0 && (module.exports = {
|
|
61
68
|
isSafeRedirect,
|
|
69
|
+
leadEndpoint,
|
|
70
|
+
missionEndpoint,
|
|
62
71
|
safeHref,
|
|
63
72
|
submissionEndpoint
|
|
64
73
|
});
|
package/dist/bridge/lib/url.mjs
CHANGED
|
@@ -32,8 +32,15 @@ const submissionEndpoint = ({ affiliate, id, slug, subdomain, token }) => {
|
|
|
32
32
|
const query = params.toString();
|
|
33
33
|
return "/subdomain/" + subdomain + "/page/" + slug + "/submission/" + encodeURIComponent(id) + (query ? "?" + query : "");
|
|
34
34
|
};
|
|
35
|
+
const leadEndpoint = ({ lead, slug, subdomain, token }) => {
|
|
36
|
+
if (typeof lead !== "string" || !/^[\w-]+\.[\w-]+$/.test(lead)) return null;
|
|
37
|
+
return "/subdomain/" + subdomain + "/page/" + slug + "/lead/" + lead + (token ? "?drwbrdg_pre=" + encodeURIComponent(token) : "");
|
|
38
|
+
};
|
|
39
|
+
const missionEndpoint = ({ action, slug, subdomain, type }) => "/subdomain/" + subdomain + "/page/" + slug + "/mission/" + type + "/" + action;
|
|
35
40
|
export {
|
|
36
41
|
isSafeRedirect,
|
|
42
|
+
leadEndpoint,
|
|
43
|
+
missionEndpoint,
|
|
37
44
|
safeHref,
|
|
38
45
|
submissionEndpoint
|
|
39
46
|
};
|
|
@@ -35,6 +35,7 @@ var import_react = require("react");
|
|
|
35
35
|
var import_image = __toESM(require("next/image"));
|
|
36
36
|
var import_cdn = require("@drawbridge/drawbridge-utils/cdn");
|
|
37
37
|
var import_styles = require("../styles");
|
|
38
|
+
var import_helpers = require("../shared/lib/helpers");
|
|
38
39
|
var import_react_share = require("react-share");
|
|
39
40
|
const iconSize = 40;
|
|
40
41
|
const ShareButton = ({
|
|
@@ -44,7 +45,7 @@ const ShareButton = ({
|
|
|
44
45
|
style,
|
|
45
46
|
values
|
|
46
47
|
}) => {
|
|
47
|
-
var _a, _b
|
|
48
|
+
var _a, _b;
|
|
48
49
|
const src = (0, import_cdn.cdnSrc)(values == null ? void 0 : values.image, "1200x630", (_a = values == null ? void 0 : values.image) == null ? void 0 : _a.updatedAt);
|
|
49
50
|
const brandButton = style && (0, import_styles.buttonStyle)(style);
|
|
50
51
|
const icon = {
|
|
@@ -212,7 +213,7 @@ const ShareButton = ({
|
|
|
212
213
|
import_image.default,
|
|
213
214
|
{
|
|
214
215
|
...{
|
|
215
|
-
alt:
|
|
216
|
+
alt: (0, import_helpers.imageAlt)(values == null ? void 0 : values.image, values == null ? void 0 : values.alt),
|
|
216
217
|
className: "object-cover object-center",
|
|
217
218
|
fill: true,
|
|
218
219
|
sizes: "448px",
|
|
@@ -227,7 +228,8 @@ const ShareButton = ({
|
|
|
227
228
|
"div",
|
|
228
229
|
{
|
|
229
230
|
...{
|
|
230
|
-
|
|
231
|
+
// Eight 40px buttons fit a 400px panel at 11px (11.5px overflowed by half a pixel and clipped the last); narrower, the row scrolls.
|
|
232
|
+
className: "flex items-center flex-nowrap gap-[11px] overflow-x-auto hide-scrollbar"
|
|
231
233
|
},
|
|
232
234
|
children: icons
|
|
233
235
|
}
|
|
@@ -3,6 +3,7 @@ import { Fragment } from "react";
|
|
|
3
3
|
import Image from "next/image";
|
|
4
4
|
import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
|
|
5
5
|
import { buttonStyle } from "../styles.mjs";
|
|
6
|
+
import { imageAlt } from "../shared/lib/helpers.mjs";
|
|
6
7
|
import {
|
|
7
8
|
EmailIcon,
|
|
8
9
|
EmailShareButton,
|
|
@@ -29,7 +30,7 @@ const ShareButton = ({
|
|
|
29
30
|
style,
|
|
30
31
|
values
|
|
31
32
|
}) => {
|
|
32
|
-
var _a, _b
|
|
33
|
+
var _a, _b;
|
|
33
34
|
const src = cdnSrc(values == null ? void 0 : values.image, "1200x630", (_a = values == null ? void 0 : values.image) == null ? void 0 : _a.updatedAt);
|
|
34
35
|
const brandButton = style && buttonStyle(style);
|
|
35
36
|
const icon = {
|
|
@@ -197,7 +198,7 @@ const ShareButton = ({
|
|
|
197
198
|
Image,
|
|
198
199
|
{
|
|
199
200
|
...{
|
|
200
|
-
alt:
|
|
201
|
+
alt: imageAlt(values == null ? void 0 : values.image, values == null ? void 0 : values.alt),
|
|
201
202
|
className: "object-cover object-center",
|
|
202
203
|
fill: true,
|
|
203
204
|
sizes: "448px",
|
|
@@ -212,7 +213,8 @@ const ShareButton = ({
|
|
|
212
213
|
"div",
|
|
213
214
|
{
|
|
214
215
|
...{
|
|
215
|
-
|
|
216
|
+
// Eight 40px buttons fit a 400px panel at 11px (11.5px overflowed by half a pixel and clipped the last); narrower, the row scrolls.
|
|
217
|
+
className: "flex items-center flex-nowrap gap-[11px] overflow-x-auto hide-scrollbar"
|
|
216
218
|
},
|
|
217
219
|
children: icons
|
|
218
220
|
}
|
|
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(subdomain_content_exports);
|
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_cdn = require("@drawbridge/drawbridge-utils/cdn");
|
|
36
36
|
var import_image = __toESM(require("next/image"));
|
|
37
|
+
var import_helpers = require("../shared/lib/helpers");
|
|
37
38
|
const SubdomainContent = ({
|
|
38
39
|
action,
|
|
39
40
|
countdown,
|
|
@@ -46,7 +47,7 @@ const SubdomainContent = ({
|
|
|
46
47
|
productsSection,
|
|
47
48
|
style
|
|
48
49
|
}) => {
|
|
49
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
50
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
50
51
|
const logo = (_a = data == null ? void 0 : data.images) == null ? void 0 : _a.logo;
|
|
51
52
|
const opacity = (_d = (_c = (_b = style == null ? void 0 : style.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) == null ? void 0 : _d.replace(")", ",.9)");
|
|
52
53
|
const defaultHeaderClassName = gallery.length > 0 ? "hidden lg:block w-full " : "max-w-lg m-auto block pt-20 lg:pt-20 space-y-3";
|
|
@@ -89,7 +90,7 @@ const SubdomainContent = ({
|
|
|
89
90
|
import_image.default,
|
|
90
91
|
{
|
|
91
92
|
...{
|
|
92
|
-
alt:
|
|
93
|
+
alt: (0, import_helpers.imageAlt)(logo, (_g = data == null ? void 0 : data.descriptions) == null ? void 0 : _g.logo),
|
|
93
94
|
className: "object-cover object-center rounded-full overflow-hidden",
|
|
94
95
|
fill: true,
|
|
95
96
|
priority: true,
|
|
@@ -120,25 +121,25 @@ const SubdomainContent = ({
|
|
|
120
121
|
children: data.description
|
|
121
122
|
}
|
|
122
123
|
),
|
|
123
|
-
gallery.length === 0 && ((
|
|
124
|
+
gallery.length === 0 && ((_i = (_h = data == null ? void 0 : data.images) == null ? void 0 : _h.preview) == null ? void 0 : _i.id) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
124
125
|
"div",
|
|
125
126
|
{
|
|
126
127
|
...{
|
|
127
128
|
className: "w-full relative aspect-[40/21] overflow-hidden mt-6",
|
|
128
129
|
style: {
|
|
129
|
-
borderRadius: ((
|
|
130
|
+
borderRadius: ((_j = style == null ? void 0 : style.image) == null ? void 0 : _j.radius) != null ? style.image.radius + "px" : "12px"
|
|
130
131
|
}
|
|
131
132
|
},
|
|
132
133
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
134
|
import_image.default,
|
|
134
135
|
{
|
|
135
136
|
...{
|
|
136
|
-
alt:
|
|
137
|
+
alt: (0, import_helpers.imageAlt)((_k = data == null ? void 0 : data.images) == null ? void 0 : _k.preview, (_l = data == null ? void 0 : data.descriptions) == null ? void 0 : _l.preview),
|
|
137
138
|
className: "object-cover object-center",
|
|
138
139
|
fill: true,
|
|
139
140
|
priority: true,
|
|
140
141
|
sizes: "(min-width: 576px) 528px, 100vw",
|
|
141
|
-
src: (0, import_cdn.cdnSrc)((
|
|
142
|
+
src: (0, import_cdn.cdnSrc)((_m = data == null ? void 0 : data.images) == null ? void 0 : _m.preview, "1200x630", (_o = (_n = data == null ? void 0 : data.images) == null ? void 0 : _n.preview) == null ? void 0 : _o.updatedAt),
|
|
142
143
|
unoptimized: true
|
|
143
144
|
}
|
|
144
145
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
|
|
4
4
|
import Image from "next/image";
|
|
5
|
+
import { imageAlt } from "../shared/lib/helpers.mjs";
|
|
5
6
|
const SubdomainContent = ({
|
|
6
7
|
action,
|
|
7
8
|
countdown,
|
|
@@ -14,7 +15,7 @@ const SubdomainContent = ({
|
|
|
14
15
|
productsSection,
|
|
15
16
|
style
|
|
16
17
|
}) => {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
18
19
|
const logo = (_a = data == null ? void 0 : data.images) == null ? void 0 : _a.logo;
|
|
19
20
|
const opacity = (_d = (_c = (_b = style == null ? void 0 : style.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) == null ? void 0 : _d.replace(")", ",.9)");
|
|
20
21
|
const defaultHeaderClassName = gallery.length > 0 ? "hidden lg:block w-full " : "max-w-lg m-auto block pt-20 lg:pt-20 space-y-3";
|
|
@@ -57,7 +58,7 @@ const SubdomainContent = ({
|
|
|
57
58
|
Image,
|
|
58
59
|
{
|
|
59
60
|
...{
|
|
60
|
-
alt: data
|
|
61
|
+
alt: imageAlt(logo, (_g = data == null ? void 0 : data.descriptions) == null ? void 0 : _g.logo),
|
|
61
62
|
className: "object-cover object-center rounded-full overflow-hidden",
|
|
62
63
|
fill: true,
|
|
63
64
|
priority: true,
|
|
@@ -88,25 +89,25 @@ const SubdomainContent = ({
|
|
|
88
89
|
children: data.description
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
|
-
gallery.length === 0 && ((
|
|
92
|
+
gallery.length === 0 && ((_i = (_h = data == null ? void 0 : data.images) == null ? void 0 : _h.preview) == null ? void 0 : _i.id) && /* @__PURE__ */ jsx(
|
|
92
93
|
"div",
|
|
93
94
|
{
|
|
94
95
|
...{
|
|
95
96
|
className: "w-full relative aspect-[40/21] overflow-hidden mt-6",
|
|
96
97
|
style: {
|
|
97
|
-
borderRadius: ((
|
|
98
|
+
borderRadius: ((_j = style == null ? void 0 : style.image) == null ? void 0 : _j.radius) != null ? style.image.radius + "px" : "12px"
|
|
98
99
|
}
|
|
99
100
|
},
|
|
100
101
|
children: /* @__PURE__ */ jsx(
|
|
101
102
|
Image,
|
|
102
103
|
{
|
|
103
104
|
...{
|
|
104
|
-
alt:
|
|
105
|
+
alt: imageAlt((_k = data == null ? void 0 : data.images) == null ? void 0 : _k.preview, (_l = data == null ? void 0 : data.descriptions) == null ? void 0 : _l.preview),
|
|
105
106
|
className: "object-cover object-center",
|
|
106
107
|
fill: true,
|
|
107
108
|
priority: true,
|
|
108
109
|
sizes: "(min-width: 576px) 528px, 100vw",
|
|
109
|
-
src: cdnSrc((
|
|
110
|
+
src: cdnSrc((_m = data == null ? void 0 : data.images) == null ? void 0 : _m.preview, "1200x630", (_o = (_n = data == null ? void 0 : data.images) == null ? void 0 : _n.preview) == null ? void 0 : _o.updatedAt),
|
|
110
111
|
unoptimized: true
|
|
111
112
|
}
|
|
112
113
|
}
|