@drawbridge/components 0.1.14 → 0.1.16
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/form-subdomain-missions.js +77 -38
- package/dist/bridge/form-subdomain-missions.mjs +76 -38
- package/dist/bridge/lib/url.js +3 -3
- package/dist/bridge/lib/url.mjs +3 -3
- package/dist/bridge/share-button.js +12 -2
- package/dist/bridge/share-button.mjs +12 -2
- package/dist/bridge/template-layout.js +1 -1
- package/dist/bridge/template-layout.mjs +1 -1
- package/dist/dashboard/answer-rows.js +77 -0
- package/dist/dashboard/answer-rows.mjs +41 -0
- package/dist/dashboard/card-campaign-switch.js +55 -43
- package/dist/dashboard/card-campaign-switch.mjs +56 -44
- package/dist/dashboard/card-order.js +248 -120
- package/dist/dashboard/card-order.mjs +248 -120
- package/dist/dashboard/connection-workflows.js +13 -4
- package/dist/dashboard/connection-workflows.mjs +13 -4
- package/dist/dashboard/form-organization-campaign-field-list.js +8 -49
- package/dist/dashboard/form-organization-campaign-field-list.mjs +8 -49
- 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-section.js +24 -4
- package/dist/dashboard/form-organization-campaign-section.mjs +24 -4
- package/dist/dashboard/form-organization-workflow.js +195 -56
- package/dist/dashboard/form-organization-workflow.mjs +191 -57
- package/dist/dashboard/item-row.js +92 -0
- package/dist/dashboard/item-row.mjs +63 -0
- package/dist/dashboard/lib/sms.js +3 -0
- package/dist/dashboard/lib/sms.mjs +2 -0
- package/dist/dashboard/order-sections.js +220 -0
- package/dist/dashboard/order-sections.mjs +185 -0
- package/dist/dashboard/preview.js +29 -2
- package/dist/dashboard/preview.mjs +28 -2
- package/dist/input-code.js +35 -53
- package/dist/input-code.mjs +26 -54
- package/dist/shared/button.js +1 -1
- package/dist/shared/button.mjs +1 -1
- package/dist/shared/lib/campaign.js +9 -3
- package/dist/shared/lib/campaign.mjs +7 -2
- package/dist/shared/lib/helpers.js +7 -0
- package/dist/shared/lib/helpers.mjs +7 -0
- package/package.json +19 -4
- package/types/bridge/form-subdomain-missions.d.ts +3 -1
- package/types/bridge/lib/url.d.ts +5 -4
- package/types/dashboard/answer-rows.d.ts +30 -0
- package/types/dashboard/card-order.d.ts +18 -3
- package/types/dashboard/form-organization-campaign-section.d.ts +2 -0
- package/types/dashboard/form-organization-workflow.d.ts +15 -0
- package/types/dashboard/item-row.d.ts +25 -0
- package/types/dashboard/order-sections.d.ts +36 -0
- package/types/shared/lib/helpers.d.ts +1 -1
|
@@ -99,46 +99,57 @@ const SwitchLock = ({ disabled, onChange, value }) => /* @__PURE__ */ (0, import
|
|
|
99
99
|
]
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
|
-
const Row = ({ description,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
102
|
+
const Row = ({ description, lock, onChange, title, value }) => {
|
|
103
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
|
+
SwitchLock,
|
|
105
|
+
{
|
|
106
|
+
...{
|
|
107
|
+
disabled: Boolean(lock),
|
|
108
|
+
onChange,
|
|
109
|
+
value
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
...{
|
|
117
|
+
className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
|
|
118
|
+
},
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
...{
|
|
124
|
+
className: "flex-1 min-w-0"
|
|
125
|
+
},
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: title }),
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
|
+
"p",
|
|
130
|
+
{
|
|
131
|
+
...{
|
|
132
|
+
className: "text-sm text-gray-dark"
|
|
133
|
+
},
|
|
134
|
+
children: description
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
136
138
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
),
|
|
140
|
+
lock ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
+
import_tooltip.default,
|
|
142
|
+
{
|
|
143
|
+
...{
|
|
144
|
+
content: lock
|
|
145
|
+
},
|
|
146
|
+
children: input
|
|
147
|
+
}
|
|
148
|
+
) : input
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
};
|
|
142
153
|
const HeaderCampaignSwitch = ({
|
|
143
154
|
campaign,
|
|
144
155
|
disabled,
|
|
@@ -153,12 +164,13 @@ const HeaderCampaignSwitch = ({
|
|
|
153
164
|
onError,
|
|
154
165
|
onSuccess
|
|
155
166
|
});
|
|
167
|
+
const lock = (0, import_campaign.switchLock)(campaign, which, disabled);
|
|
156
168
|
const input = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
169
|
import_input_switch.default,
|
|
158
170
|
{
|
|
159
171
|
...{
|
|
160
172
|
"aria-label": which === "form" ? "Form" : "Giveaway",
|
|
161
|
-
disabled,
|
|
173
|
+
disabled: Boolean(lock),
|
|
162
174
|
onChange: (value) => flip(which, value),
|
|
163
175
|
value: Boolean((_a = campaign == null ? void 0 : campaign[which]) == null ? void 0 : _a.enabled)
|
|
164
176
|
}
|
|
@@ -171,11 +183,11 @@ const HeaderCampaignSwitch = ({
|
|
|
171
183
|
className: "flex",
|
|
172
184
|
...rest
|
|
173
185
|
},
|
|
174
|
-
children:
|
|
186
|
+
children: lock ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
187
|
import_tooltip.default,
|
|
176
188
|
{
|
|
177
189
|
...{
|
|
178
|
-
content:
|
|
190
|
+
content: lock
|
|
179
191
|
},
|
|
180
192
|
children: input
|
|
181
193
|
}
|
|
@@ -241,7 +253,7 @@ const CardLeadCapture = ({
|
|
|
241
253
|
{
|
|
242
254
|
...{
|
|
243
255
|
description,
|
|
244
|
-
disabled,
|
|
256
|
+
lock: (0, import_campaign.switchLock)(campaign, key, disabled),
|
|
245
257
|
onChange: (value) => flip(key, value),
|
|
246
258
|
title,
|
|
247
259
|
value: Boolean((_a = campaign == null ? void 0 : campaign[key]) == null ? void 0 : _a.enabled)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient } from "@tanstack/react-query";
|
|
3
3
|
import { request } from "@drawbridge/drawbridge-utils/fetch";
|
|
4
|
-
import { awardingCard, campaignSwitch } from "../shared/lib/campaign.mjs";
|
|
4
|
+
import { awardingCard, campaignSwitch, switchLock } from "../shared/lib/campaign.mjs";
|
|
5
5
|
import { useModal } from "./lib/hooks.mjs";
|
|
6
6
|
import CardSection from "./card-section.mjs";
|
|
7
7
|
import CardTask from "./card-task.mjs";
|
|
@@ -66,46 +66,57 @@ const SwitchLock = ({ disabled, onChange, value }) => /* @__PURE__ */ jsxs(
|
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
|
-
const Row = ({ description,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
69
|
+
const Row = ({ description, lock, onChange, title, value }) => {
|
|
70
|
+
const input = /* @__PURE__ */ jsx(
|
|
71
|
+
SwitchLock,
|
|
72
|
+
{
|
|
73
|
+
...{
|
|
74
|
+
disabled: Boolean(lock),
|
|
75
|
+
onChange,
|
|
76
|
+
value
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
return /* @__PURE__ */ jsxs(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
...{
|
|
84
|
+
className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
|
|
85
|
+
},
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsxs(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
...{
|
|
91
|
+
className: "flex-1 min-w-0"
|
|
92
|
+
},
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsx("p", { children: title }),
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
"p",
|
|
97
|
+
{
|
|
98
|
+
...{
|
|
99
|
+
className: "text-sm text-gray-dark"
|
|
100
|
+
},
|
|
101
|
+
children: description
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
103
105
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
),
|
|
107
|
+
lock ? /* @__PURE__ */ jsx(
|
|
108
|
+
Tooltip,
|
|
109
|
+
{
|
|
110
|
+
...{
|
|
111
|
+
content: lock
|
|
112
|
+
},
|
|
113
|
+
children: input
|
|
114
|
+
}
|
|
115
|
+
) : input
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
};
|
|
109
120
|
const HeaderCampaignSwitch = ({
|
|
110
121
|
campaign,
|
|
111
122
|
disabled,
|
|
@@ -120,12 +131,13 @@ const HeaderCampaignSwitch = ({
|
|
|
120
131
|
onError,
|
|
121
132
|
onSuccess
|
|
122
133
|
});
|
|
134
|
+
const lock = switchLock(campaign, which, disabled);
|
|
123
135
|
const input = /* @__PURE__ */ jsx(
|
|
124
136
|
InputSwitch,
|
|
125
137
|
{
|
|
126
138
|
...{
|
|
127
139
|
"aria-label": which === "form" ? "Form" : "Giveaway",
|
|
128
|
-
disabled,
|
|
140
|
+
disabled: Boolean(lock),
|
|
129
141
|
onChange: (value) => flip(which, value),
|
|
130
142
|
value: Boolean((_a = campaign == null ? void 0 : campaign[which]) == null ? void 0 : _a.enabled)
|
|
131
143
|
}
|
|
@@ -138,11 +150,11 @@ const HeaderCampaignSwitch = ({
|
|
|
138
150
|
className: "flex",
|
|
139
151
|
...rest
|
|
140
152
|
},
|
|
141
|
-
children:
|
|
153
|
+
children: lock ? /* @__PURE__ */ jsx(
|
|
142
154
|
Tooltip,
|
|
143
155
|
{
|
|
144
156
|
...{
|
|
145
|
-
content:
|
|
157
|
+
content: lock
|
|
146
158
|
},
|
|
147
159
|
children: input
|
|
148
160
|
}
|
|
@@ -208,7 +220,7 @@ const CardLeadCapture = ({
|
|
|
208
220
|
{
|
|
209
221
|
...{
|
|
210
222
|
description,
|
|
211
|
-
disabled,
|
|
223
|
+
lock: switchLock(campaign, key, disabled),
|
|
212
224
|
onChange: (value) => flip(key, value),
|
|
213
225
|
title,
|
|
214
226
|
value: Boolean((_a = campaign == null ? void 0 : campaign[key]) == null ? void 0 : _a.enabled)
|