@drawbridge/components 0.1.37 → 0.1.38
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 +68 -355
- package/dist/advertisement.js +15 -20
- package/dist/advertisement.mjs +15 -20
- package/dist/bridge/advertisements.js +4 -2
- package/dist/bridge/advertisements.mjs +5 -3
- package/dist/bridge/fields.js +89 -6
- package/dist/bridge/fields.mjs +89 -7
- package/dist/bridge/form-subdomain-agreement.js +165 -0
- package/dist/bridge/form-subdomain-agreement.mjs +132 -0
- package/dist/bridge/form-subdomain-embed.js +5 -1
- package/dist/bridge/form-subdomain-embed.mjs +5 -1
- package/dist/bridge/form-subdomain-header.js +21 -14
- package/dist/bridge/form-subdomain-header.mjs +20 -14
- package/dist/bridge/form-subdomain-issue.js +17 -8
- package/dist/bridge/form-subdomain-issue.mjs +17 -8
- package/dist/bridge/form-subdomain-missions.js +58 -52
- package/dist/bridge/form-subdomain-missions.mjs +60 -54
- package/dist/bridge/form-subdomain.js +223 -94
- package/dist/bridge/form-subdomain.mjs +222 -96
- package/dist/bridge/lib/entry.js +61 -6
- package/dist/bridge/lib/entry.mjs +51 -5
- package/dist/bridge/lib/order.js +23 -0
- package/dist/bridge/lib/order.mjs +20 -0
- package/dist/bridge/template-layout.js +5 -2
- package/dist/bridge/template-layout.mjs +6 -3
- package/dist/bridge/template-modal.js +82 -15
- package/dist/bridge/template-modal.mjs +83 -16
- package/dist/bridge/template-subdomain-gallery.js +126 -75
- package/dist/bridge/template-subdomain-gallery.mjs +122 -75
- package/dist/bridge/template-subdomain.js +16 -14
- package/dist/bridge/template-subdomain.mjs +17 -15
- package/dist/dashboard/avatar.js +5 -0
- package/dist/dashboard/avatar.mjs +5 -0
- package/dist/dashboard/campaign-form.js +1798 -0
- package/dist/dashboard/campaign-form.mjs +1769 -0
- package/dist/dashboard/card-affiliate.js +3 -2
- package/dist/dashboard/card-affiliate.mjs +3 -2
- package/dist/dashboard/card-campaign-agreement.js +172 -0
- package/dist/dashboard/card-campaign-agreement.mjs +139 -0
- package/dist/dashboard/card-campaign-switch.js +34 -9
- package/dist/dashboard/card-campaign-switch.mjs +32 -8
- package/dist/dashboard/card-order.js +6 -14
- package/dist/dashboard/card-order.mjs +6 -14
- package/dist/dashboard/card-section.js +69 -26
- package/dist/dashboard/card-section.mjs +65 -26
- package/dist/dashboard/card-shortcut.js +181 -0
- package/dist/dashboard/card-shortcut.mjs +152 -0
- package/dist/dashboard/card-tile.js +3 -35
- package/dist/dashboard/card-tile.mjs +3 -34
- package/dist/dashboard/document-blocks.js +305 -0
- package/dist/dashboard/document-blocks.mjs +270 -0
- package/dist/dashboard/drawer-subscription.js +52 -14
- package/dist/dashboard/drawer-subscription.mjs +52 -14
- package/dist/dashboard/drawer.js +20 -3
- package/dist/dashboard/drawer.mjs +21 -4
- package/dist/dashboard/dropdown.js +6 -2
- package/dist/dashboard/dropdown.mjs +6 -2
- package/dist/dashboard/form-admin-subscription-custom.js +72 -8
- package/dist/dashboard/form-admin-subscription-custom.mjs +72 -8
- package/dist/dashboard/form-ai.js +0 -148
- package/dist/dashboard/form-ai.mjs +1 -148
- package/dist/dashboard/form-filters-analytics.js +86 -38
- package/dist/dashboard/form-filters-analytics.mjs +85 -38
- package/dist/dashboard/form-organization-brand.js +30 -13
- package/dist/dashboard/form-organization-brand.mjs +30 -13
- package/dist/dashboard/form-organization-campaign-advertisement.js +38 -112
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +38 -112
- package/dist/dashboard/form-organization-campaign-advertisements.js +374 -0
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +345 -0
- package/dist/dashboard/form-organization-campaign-agreement.js +402 -210
- package/dist/dashboard/form-organization-campaign-agreement.mjs +398 -211
- package/dist/dashboard/form-organization-campaign-design.js +258 -0
- package/dist/dashboard/form-organization-campaign-design.mjs +223 -0
- package/dist/dashboard/form-organization-campaign-field-item.js +585 -0
- package/dist/dashboard/form-organization-campaign-field-item.mjs +552 -0
- package/dist/dashboard/form-organization-campaign-field-number.js +48 -7
- package/dist/dashboard/form-organization-campaign-field-number.mjs +48 -7
- package/dist/dashboard/form-organization-campaign-field-select.js +15 -4
- package/dist/dashboard/form-organization-campaign-field-select.mjs +15 -4
- package/dist/dashboard/form-organization-campaign-field-skill.js +359 -0
- package/dist/dashboard/form-organization-campaign-field-skill.mjs +330 -0
- package/dist/dashboard/form-organization-campaign-field-text.js +46 -6
- package/dist/dashboard/form-organization-campaign-field-text.mjs +46 -6
- package/dist/dashboard/form-organization-campaign-field-textarea.js +22 -13
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +22 -13
- package/dist/dashboard/form-organization-campaign-footer.js +178 -0
- package/dist/dashboard/form-organization-campaign-footer.mjs +149 -0
- package/dist/dashboard/form-organization-campaign-integration-age.js +2 -35
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +2 -35
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +4 -1
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +4 -1
- package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
- package/dist/dashboard/form-organization-campaign-page-preview.js +1 -2
- package/dist/dashboard/form-organization-campaign-page-preview.mjs +1 -2
- package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
- package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
- package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
- package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
- package/dist/dashboard/form-organization-campaign-page-slug.js +2 -3
- package/dist/dashboard/form-organization-campaign-page-slug.mjs +2 -3
- package/dist/dashboard/form-organization-campaign-page.js +168 -265
- package/dist/dashboard/form-organization-campaign-page.mjs +170 -266
- package/dist/dashboard/form-organization-campaign-section.js +125 -107
- package/dist/dashboard/form-organization-campaign-section.mjs +121 -107
- package/dist/dashboard/form-organization-campaign.js +119 -9
- package/dist/dashboard/form-organization-campaign.mjs +118 -9
- package/dist/dashboard/form-organization-file-frame.js +7 -1
- package/dist/dashboard/form-organization-file-frame.mjs +7 -1
- package/dist/dashboard/form-organization-workflow.js +587 -530
- package/dist/dashboard/form-organization-workflow.mjs +588 -531
- package/dist/dashboard/form-organization.js +22 -0
- package/dist/dashboard/form-organization.mjs +22 -0
- package/dist/dashboard/form-reposition.js +396 -0
- package/dist/dashboard/form-reposition.mjs +359 -0
- package/dist/dashboard/form-support.js +189 -0
- package/dist/dashboard/form-support.mjs +160 -0
- package/dist/dashboard/form-tests.js +683 -0
- package/dist/dashboard/form-tests.mjs +646 -0
- package/dist/dashboard/form-verify-prize.js +114 -34
- package/dist/dashboard/form-verify-prize.mjs +111 -34
- package/dist/dashboard/google.js +8 -1
- package/dist/dashboard/google.mjs +8 -1
- package/dist/dashboard/input-array.js +2 -0
- package/dist/dashboard/input-array.mjs +2 -0
- package/dist/dashboard/input-editor.js +17 -6
- package/dist/dashboard/input-editor.mjs +17 -6
- package/dist/dashboard/input-fields.js +287 -437
- package/dist/dashboard/input-fields.mjs +287 -436
- package/dist/dashboard/input-file.js +70 -2
- package/dist/dashboard/input-file.mjs +70 -2
- package/dist/dashboard/input-font.js +64 -55
- package/dist/dashboard/input-font.mjs +64 -55
- package/dist/dashboard/input-resource.js +4 -1
- package/dist/dashboard/input-resource.mjs +4 -1
- package/dist/dashboard/lib/ab-tests.js +130 -0
- package/dist/dashboard/lib/ab-tests.mjs +94 -0
- package/dist/dashboard/lib/features.js +1 -1
- package/dist/dashboard/lib/features.mjs +1 -1
- package/dist/dashboard/lib/focus.js +93 -0
- package/dist/dashboard/lib/focus.mjs +69 -0
- package/dist/dashboard/lib/form-page.js +203 -0
- package/dist/dashboard/lib/form-page.mjs +155 -0
- package/dist/dashboard/lib/item-list.js +0 -15
- package/dist/dashboard/lib/item-list.mjs +0 -14
- package/dist/dashboard/lib/rail.js +16 -17
- package/dist/dashboard/lib/rail.mjs +15 -16
- package/dist/dashboard/lib/sms.js +8 -2
- package/dist/dashboard/lib/sms.mjs +6 -1
- package/dist/dashboard/list-resource.js +2 -0
- package/dist/dashboard/list-resource.mjs +2 -0
- package/dist/dashboard/menu.js +54 -5
- package/dist/dashboard/menu.mjs +53 -5
- package/dist/dashboard/modal.js +19 -4
- package/dist/dashboard/modal.mjs +20 -5
- package/dist/dashboard/order-sections.js +4 -0
- package/dist/dashboard/order-sections.mjs +4 -0
- package/dist/dashboard/preview.js +838 -324
- package/dist/dashboard/preview.mjs +826 -324
- package/dist/dashboard/provider-ui.js +20 -12
- package/dist/dashboard/provider-ui.mjs +21 -13
- package/dist/dashboard/recharts.js +53 -28
- package/dist/dashboard/recharts.mjs +53 -28
- package/dist/dashboard/swatch.js +35 -0
- package/dist/dashboard/swatch.mjs +31 -0
- package/dist/dashboard/table-contacts.js +6 -10
- package/dist/dashboard/table-contacts.mjs +6 -10
- package/dist/dashboard/table.js +10 -3
- package/dist/dashboard/table.mjs +9 -3
- package/dist/dashboard/template-dashboard.js +12 -7
- package/dist/dashboard/template-dashboard.mjs +11 -7
- package/dist/dashboard/template-design.js +564 -0
- package/dist/dashboard/template-design.mjs +531 -0
- package/dist/dashboard/template-rail.js +198 -126
- package/dist/dashboard/template-rail.mjs +196 -125
- package/dist/dashboard/template-socket.js +0 -3
- package/dist/dashboard/template-socket.mjs +0 -3
- package/dist/dashboard/template-test-page.js +436 -0
- package/dist/dashboard/template-test-page.mjs +407 -0
- package/dist/dashboard/template-tests.js +141 -0
- package/dist/dashboard/template-tests.mjs +112 -0
- package/dist/dashboard/template-ui.js +20 -11
- package/dist/dashboard/template-ui.mjs +22 -13
- package/dist/dashboard/template-variant.js +185 -0
- package/dist/dashboard/template-variant.mjs +156 -0
- package/dist/icons/arrow-down-long.js +47 -0
- package/dist/icons/arrow-down-long.mjs +28 -0
- package/dist/icons/arrows-pointing-out.js +46 -0
- package/dist/icons/arrows-pointing-out.mjs +27 -0
- package/dist/icons/beaker.js +46 -0
- package/dist/icons/beaker.mjs +27 -0
- package/dist/icons/identification.js +46 -0
- package/dist/icons/identification.mjs +27 -0
- package/dist/icons/lifebuoy.js +46 -0
- package/dist/icons/lifebuoy.mjs +27 -0
- package/dist/icons/rectangle-group.js +46 -0
- package/dist/icons/rectangle-group.mjs +27 -0
- package/dist/icons/rectangle-stack.js +46 -0
- package/dist/icons/rectangle-stack.mjs +27 -0
- package/dist/icons/shopping-bag.js +46 -0
- package/dist/icons/shopping-bag.mjs +27 -0
- package/dist/icons/swatch.js +46 -0
- package/dist/icons/swatch.mjs +27 -0
- package/dist/icons/window.js +46 -0
- package/dist/icons/window.mjs +27 -0
- package/dist/icons/zoom-in.js +46 -0
- package/dist/icons/zoom-in.mjs +27 -0
- package/dist/input-answer.js +60 -0
- package/dist/input-answer.mjs +27 -0
- package/dist/input-checkbox.js +7 -1
- package/dist/input-checkbox.mjs +7 -1
- package/dist/input-name.js +3 -3
- package/dist/input-name.mjs +3 -3
- package/dist/input-select.js +3 -1
- package/dist/input-select.mjs +3 -1
- package/dist/provider-font.js +4 -3
- package/dist/provider-font.mjs +4 -3
- package/dist/shared/badge.js +15 -0
- package/dist/shared/badge.mjs +11 -0
- package/dist/shared/carousel.js +11 -7
- package/dist/shared/carousel.mjs +11 -7
- package/dist/shared/document-pieces.js +295 -0
- package/dist/shared/document-pieces.mjs +260 -0
- package/dist/shared/lib/campaign.js +3 -9
- package/dist/shared/lib/campaign.mjs +3 -9
- package/dist/shared/lib/helpers.js +24 -0
- package/dist/shared/lib/helpers.mjs +22 -0
- package/dist/shared/lib/video.js +6 -0
- package/dist/shared/lib/video.mjs +5 -0
- package/dist/shared/sortable.js +27 -10
- package/dist/shared/sortable.mjs +27 -10
- package/dist/shared/tabs.js +1 -1
- package/dist/shared/tabs.mjs +1 -1
- package/dist/video.js +127 -9
- package/dist/video.mjs +125 -11
- package/package.json +176 -20
- package/types/bridge/fields.d.ts +6 -1
- package/types/bridge/form-subdomain-agreement.d.ts +27 -0
- package/types/bridge/form-subdomain-missions.d.ts +2 -0
- package/types/bridge/form-subdomain.d.ts +62 -3
- package/types/bridge/lib/entry.d.ts +44 -7
- package/types/bridge/lib/order.d.ts +13 -2
- package/types/bridge/subdomain-content.d.ts +1 -0
- package/types/bridge/template-subdomain-gallery.d.ts +13 -1
- package/types/dashboard/campaign-form.d.ts +42 -0
- package/types/dashboard/card-campaign-agreement.d.ts +26 -0
- package/types/dashboard/card-campaign-switch.d.ts +20 -1
- package/types/dashboard/card-order.d.ts +2 -2
- package/types/dashboard/card-section.d.ts +9 -1
- package/types/dashboard/card-shortcut.d.ts +38 -0
- package/types/dashboard/card-tile.d.ts +4 -9
- package/types/dashboard/document-blocks.d.ts +14 -0
- package/types/dashboard/drawer.d.ts +3 -0
- package/types/dashboard/form-ai.d.ts +0 -17
- package/types/dashboard/form-organization-brand.d.ts +3 -0
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +15 -0
- package/types/dashboard/form-organization-campaign-agreement.d.ts +53 -10
- package/types/dashboard/form-organization-campaign-design.d.ts +46 -0
- package/types/dashboard/form-organization-campaign-field-item.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-number.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-field-select.d.ts +6 -1
- package/types/dashboard/form-organization-campaign-field-skill.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-text.d.ts +5 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-footer.d.ts +23 -0
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +2 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +9 -15
- package/types/dashboard/form-organization-campaign-section.d.ts +24 -8
- package/types/dashboard/form-organization-campaign.d.ts +3 -0
- package/types/dashboard/form-organization-workflow.d.ts +3 -0
- package/types/dashboard/form-organization.d.ts +2 -2
- package/types/dashboard/form-reposition.d.ts +29 -0
- package/types/dashboard/form-support.d.ts +14 -0
- package/types/dashboard/form-tests.d.ts +78 -0
- package/types/dashboard/form-verify-prize.d.ts +30 -3
- package/types/dashboard/input-editor.d.ts +9 -0
- package/types/dashboard/input-fields.d.ts +8 -5
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/input-resource.d.ts +1 -0
- package/types/dashboard/lib/ab-tests.d.ts +50 -0
- package/types/dashboard/lib/escape.d.ts +4 -0
- package/types/dashboard/lib/focus.d.ts +16 -0
- package/types/dashboard/lib/form-page.d.ts +25 -0
- package/types/dashboard/lib/item-list.d.ts +10 -5
- package/types/dashboard/lib/rail.d.ts +0 -1
- package/types/dashboard/lib/sms.d.ts +7 -0
- package/types/dashboard/modal.d.ts +3 -1
- package/types/dashboard/preview.d.ts +65 -10
- package/types/dashboard/recharts.d.ts +3 -0
- package/types/dashboard/swatch.d.ts +4 -0
- package/types/dashboard/template-dashboard.d.ts +3 -0
- package/types/dashboard/template-design.d.ts +30 -0
- package/types/dashboard/template-test-page.d.ts +69 -0
- package/types/dashboard/template-tests.d.ts +30 -0
- package/types/dashboard/template-variant.d.ts +18 -0
- package/types/icons/arrow-down-long.d.ts +5 -0
- package/types/icons/arrows-pointing-out.d.ts +5 -0
- package/types/icons/beaker.d.ts +5 -0
- package/types/icons/identification.d.ts +5 -0
- package/types/icons/lifebuoy.d.ts +5 -0
- package/types/icons/rectangle-group.d.ts +5 -0
- package/types/icons/rectangle-stack.d.ts +5 -0
- package/types/icons/shopping-bag.d.ts +5 -0
- package/types/icons/swatch.d.ts +5 -0
- package/types/icons/window.d.ts +5 -0
- package/types/icons/zoom-in.d.ts +5 -0
- package/types/input-answer.d.ts +15 -0
- package/types/input-select.d.ts +2 -0
- package/types/shared/button.d.ts +1 -1
- package/types/shared/document-pieces.d.ts +34 -0
- package/types/shared/lib/helpers.d.ts +22 -1
- package/types/shared/lib/motion.d.ts +2 -0
- package/types/shared/lib/video.d.ts +3 -0
- package/types/shared/sortable.d.ts +6 -0
- package/types/video.d.ts +18 -2
- package/dist/bridge/template-preview.js +0 -208
- package/dist/bridge/template-preview.mjs +0 -173
- package/dist/dashboard/device.js +0 -95
- package/dist/dashboard/device.mjs +0 -72
- package/dist/dashboard/form-organization-campaign-field-list.js +0 -425
- package/dist/dashboard/form-organization-campaign-field-list.mjs +0 -396
- package/dist/dashboard/item-row.js +0 -92
- package/dist/dashboard/item-row.mjs +0 -63
- package/types/bridge/template-preview.d.ts +0 -10
- package/types/dashboard/device.d.ts +0 -12
- package/types/dashboard/form-organization-campaign-field-list.d.ts +0 -36
- package/types/dashboard/item-row.d.ts +0 -25
|
@@ -1,15 +1,43 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { useForm, useWatch, Controller } from "../shared/lib/form.mjs";
|
|
4
|
-
import { capitalize } from "@drawbridge/drawbridge-utils";
|
|
4
|
+
import { capitalize, getPlanFeature } from "@drawbridge/drawbridge-utils";
|
|
5
|
+
import { organization as organizationFeatures } from "@drawbridge/drawbridge-utils/features";
|
|
5
6
|
import Form from "../shared/form.mjs";
|
|
6
7
|
import Fieldset from "../shared/fieldset.mjs";
|
|
7
8
|
import InputGroup from "../input-group.mjs";
|
|
8
9
|
import InputDate, { InputDateRange } from "./input-date.mjs";
|
|
9
10
|
import InputResource from "./input-resource.mjs";
|
|
10
11
|
import InputCombobox from "./input-combobox.mjs";
|
|
12
|
+
import CardTask from "./card-task.mjs";
|
|
11
13
|
import Tabs from "../shared/tabs.mjs";
|
|
12
14
|
import Button from "../shared/button.mjs";
|
|
15
|
+
import { hasCapability } from "../shared/lib/helpers.mjs";
|
|
16
|
+
const variantResource = ({ endpoint, organization }) => {
|
|
17
|
+
const feature = getPlanFeature(organization == null ? void 0 : organization.plan, organizationFeatures.tests.key);
|
|
18
|
+
return {
|
|
19
|
+
endpoint,
|
|
20
|
+
key: "variant",
|
|
21
|
+
// Named for what people know, their tests (Darren, 2026-11-14).
|
|
22
|
+
label: "A/B test",
|
|
23
|
+
// "Select an A/B test page", "No A/B test pages found".
|
|
24
|
+
model: "A/B test page",
|
|
25
|
+
// The api's name for the variant: its test and its own title, "Summer
|
|
26
|
+
// hero · Video first", a test variant the only kind the list holds.
|
|
27
|
+
render: (item) => item == null ? void 0 : item.name,
|
|
28
|
+
...!(feature == null ? void 0 : feature.granted) && {
|
|
29
|
+
upgrade: {
|
|
30
|
+
...hasCapability(organization, "billing") && {
|
|
31
|
+
button: {
|
|
32
|
+
href: "/organizations/" + (organization == null ? void 0 : organization.id) + "/billing",
|
|
33
|
+
text: "Upgrade"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
message: (feature == null ? void 0 : feature.message) || organizationFeatures.tests.error
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
};
|
|
13
41
|
const pad = (number) => String(number).padStart(2, "0");
|
|
14
42
|
const analyticsFloor = (show, now = /* @__PURE__ */ new Date()) => {
|
|
15
43
|
if (!show) return null;
|
|
@@ -68,8 +96,8 @@ const FormFiltersAnalytics = ({
|
|
|
68
96
|
const dateRangeEnd = useWatch({ control, name: "filters.end", defaultValue: filters == null ? void 0 : filters.end }) || "";
|
|
69
97
|
const campaign = useWatch({ control, name: "filters.campaign", defaultValue: filters == null ? void 0 : filters.campaign }) || null;
|
|
70
98
|
const campaignId = campaign && typeof campaign === "object" ? campaign.id : campaign;
|
|
71
|
-
const
|
|
72
|
-
const
|
|
99
|
+
const variant = useWatch({ control, name: "filters.variant", defaultValue: filters == null ? void 0 : filters.variant }) || null;
|
|
100
|
+
const variantCampaign = variant && typeof variant === "object" && variant.campaign || null;
|
|
73
101
|
const affiliate = useWatch({ control, name: "filters.affiliate", defaultValue: filters == null ? void 0 : filters.affiliate }) || null;
|
|
74
102
|
const affiliateCampaigns = affiliate && typeof affiliate === "object" && Array.isArray(affiliate.campaigns) ? affiliate.campaigns : null;
|
|
75
103
|
const onSubmit = async ({
|
|
@@ -138,7 +166,7 @@ const FormFiltersAnalytics = ({
|
|
|
138
166
|
},
|
|
139
167
|
key
|
|
140
168
|
));
|
|
141
|
-
const renderResources = (fields) => fields.map(({ key, label, endpoint, model, multiple, params, render: renderItem }) => /* @__PURE__ */ jsx(
|
|
169
|
+
const renderResources = (fields) => fields.map(({ key, label, endpoint, model, multiple, params, render: renderItem, upgrade }) => /* @__PURE__ */ jsx(
|
|
142
170
|
Controller,
|
|
143
171
|
{
|
|
144
172
|
...{
|
|
@@ -149,43 +177,61 @@ const FormFiltersAnalytics = ({
|
|
|
149
177
|
{
|
|
150
178
|
...{
|
|
151
179
|
label: capitalize(label),
|
|
152
|
-
input: /* @__PURE__ */
|
|
153
|
-
|
|
180
|
+
input: /* @__PURE__ */ jsxs(
|
|
181
|
+
"div",
|
|
154
182
|
{
|
|
155
183
|
...{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
className: "space-y-2"
|
|
185
|
+
},
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ jsx(
|
|
188
|
+
InputResource,
|
|
189
|
+
{
|
|
190
|
+
...{
|
|
191
|
+
// A filter the plan leaves out cannot be picked.
|
|
192
|
+
disabled: Boolean(upgrade),
|
|
193
|
+
endpoint,
|
|
194
|
+
model,
|
|
195
|
+
multiple: Boolean(multiple),
|
|
196
|
+
onChange: (item) => {
|
|
197
|
+
onChange(item);
|
|
198
|
+
if (key === "campaign" && item && variantCampaign !== item.id) {
|
|
199
|
+
setValue("filters.variant", null);
|
|
200
|
+
}
|
|
201
|
+
;
|
|
202
|
+
},
|
|
203
|
+
params: {
|
|
204
|
+
...params,
|
|
205
|
+
...key === "variant" && campaignId && {
|
|
206
|
+
filters: {
|
|
207
|
+
campaign: campaignId
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
...key === "campaign" && variantCampaign && {
|
|
211
|
+
filters: {
|
|
212
|
+
id: variantCampaign
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
...key === "campaign" && !variantCampaign && affiliateCampaigns && {
|
|
216
|
+
filters: {
|
|
217
|
+
id: {
|
|
218
|
+
$in: affiliateCampaigns
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
render: renderItem,
|
|
224
|
+
value: upgrade ? null : multiple ? value || [] : value || null
|
|
183
225
|
}
|
|
184
226
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
227
|
+
),
|
|
228
|
+
upgrade && /* @__PURE__ */ jsx(
|
|
229
|
+
CardTask,
|
|
230
|
+
{
|
|
231
|
+
...upgrade
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
]
|
|
189
235
|
}
|
|
190
236
|
)
|
|
191
237
|
}
|
|
@@ -298,5 +344,6 @@ var form_filters_analytics_default = FormFiltersAnalytics;
|
|
|
298
344
|
export {
|
|
299
345
|
analyticsFloor,
|
|
300
346
|
form_filters_analytics_default as default,
|
|
301
|
-
periodOptions
|
|
347
|
+
periodOptions,
|
|
348
|
+
variantResource
|
|
302
349
|
};
|
|
@@ -36,6 +36,7 @@ var import_fetch = require("@drawbridge/drawbridge-utils/fetch");
|
|
|
36
36
|
var import_form = require("../shared/lib/form");
|
|
37
37
|
var import_yup = __toESM(require("../shared/lib/yup"));
|
|
38
38
|
var import_accordion = __toESM(require("./accordion"));
|
|
39
|
+
var import_card_task = __toESM(require("./card-task"));
|
|
39
40
|
var import_form2 = __toESM(require("../shared/form"));
|
|
40
41
|
var import_fieldset = __toESM(require("../shared/fieldset"));
|
|
41
42
|
var import_input_group = __toESM(require("../input-group"));
|
|
@@ -143,6 +144,7 @@ const FormOrganizationBrand = ({
|
|
|
143
144
|
);
|
|
144
145
|
};
|
|
145
146
|
const FormOrganizationBrandEdit = ({
|
|
147
|
+
connected = 0,
|
|
146
148
|
disabled,
|
|
147
149
|
onError,
|
|
148
150
|
onSuccess,
|
|
@@ -293,31 +295,46 @@ const FormOrganizationBrandEdit = ({
|
|
|
293
295
|
title: "Style"
|
|
294
296
|
},
|
|
295
297
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
296
|
-
|
|
298
|
+
import_fieldset.default,
|
|
297
299
|
{
|
|
298
300
|
...{
|
|
299
301
|
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
300
|
-
}
|
|
302
|
+
},
|
|
303
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input_fields.InputFieldsStyle, {})
|
|
301
304
|
}
|
|
302
305
|
)
|
|
303
306
|
}
|
|
304
307
|
),
|
|
305
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
308
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
306
309
|
import_fieldset.default,
|
|
307
310
|
{
|
|
308
311
|
...{
|
|
309
312
|
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
310
313
|
},
|
|
311
|
-
children:
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
314
|
+
children: [
|
|
315
|
+
connected > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
316
|
+
import_card_task.default,
|
|
317
|
+
{
|
|
318
|
+
...{
|
|
319
|
+
// @story brands/edit
|
|
320
|
+
// Saving a brand updates every campaign linked to it, so the form
|
|
321
|
+
// says how many before Save ( Darren, 2026-11-13 ).
|
|
322
|
+
title: "Changes update " + connected + " connected " + (connected === 1 ? "campaign" : "campaigns"),
|
|
323
|
+
type: "warning"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
),
|
|
327
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
328
|
+
import_button.default,
|
|
329
|
+
{
|
|
330
|
+
...{
|
|
331
|
+
loading: formState == null ? void 0 : formState.isSubmitting,
|
|
332
|
+
type: "submit"
|
|
333
|
+
},
|
|
334
|
+
children: "Save"
|
|
335
|
+
}
|
|
336
|
+
)
|
|
337
|
+
]
|
|
321
338
|
}
|
|
322
339
|
)
|
|
323
340
|
]
|
|
@@ -3,6 +3,7 @@ import { request } from "@drawbridge/drawbridge-utils/fetch";
|
|
|
3
3
|
import { useForm, FormProvider, Controller } from "../shared/lib/form.mjs";
|
|
4
4
|
import yup, { resolver } from "../shared/lib/yup.mjs";
|
|
5
5
|
import Accordion from "./accordion.mjs";
|
|
6
|
+
import CardTask from "./card-task.mjs";
|
|
6
7
|
import Form from "../shared/form.mjs";
|
|
7
8
|
import Fieldset from "../shared/fieldset.mjs";
|
|
8
9
|
import InputGroup from "../input-group.mjs";
|
|
@@ -110,6 +111,7 @@ const FormOrganizationBrand = ({
|
|
|
110
111
|
);
|
|
111
112
|
};
|
|
112
113
|
const FormOrganizationBrandEdit = ({
|
|
114
|
+
connected = 0,
|
|
113
115
|
disabled,
|
|
114
116
|
onError,
|
|
115
117
|
onSuccess,
|
|
@@ -260,31 +262,46 @@ const FormOrganizationBrandEdit = ({
|
|
|
260
262
|
title: "Style"
|
|
261
263
|
},
|
|
262
264
|
children: /* @__PURE__ */ jsx(
|
|
263
|
-
|
|
265
|
+
Fieldset,
|
|
264
266
|
{
|
|
265
267
|
...{
|
|
266
268
|
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
267
|
-
}
|
|
269
|
+
},
|
|
270
|
+
children: /* @__PURE__ */ jsx(InputFieldsStyle, {})
|
|
268
271
|
}
|
|
269
272
|
)
|
|
270
273
|
}
|
|
271
274
|
),
|
|
272
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ jsxs(
|
|
273
276
|
Fieldset,
|
|
274
277
|
{
|
|
275
278
|
...{
|
|
276
279
|
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
277
280
|
},
|
|
278
|
-
children:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
281
|
+
children: [
|
|
282
|
+
connected > 0 && /* @__PURE__ */ jsx(
|
|
283
|
+
CardTask,
|
|
284
|
+
{
|
|
285
|
+
...{
|
|
286
|
+
// @story brands/edit
|
|
287
|
+
// Saving a brand updates every campaign linked to it, so the form
|
|
288
|
+
// says how many before Save ( Darren, 2026-11-13 ).
|
|
289
|
+
title: "Changes update " + connected + " connected " + (connected === 1 ? "campaign" : "campaigns"),
|
|
290
|
+
type: "warning"
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
),
|
|
294
|
+
/* @__PURE__ */ jsx(
|
|
295
|
+
Button,
|
|
296
|
+
{
|
|
297
|
+
...{
|
|
298
|
+
loading: formState == null ? void 0 : formState.isSubmitting,
|
|
299
|
+
type: "submit"
|
|
300
|
+
},
|
|
301
|
+
children: "Save"
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
]
|
|
288
305
|
}
|
|
289
306
|
)
|
|
290
307
|
]
|
|
@@ -51,9 +51,11 @@ var import_badge = __toESM(require("../shared/badge"));
|
|
|
51
51
|
var import_button = __toESM(require("../shared/button"));
|
|
52
52
|
const FormOrganizationCampaignAdvertisementEdit = ({
|
|
53
53
|
disabled,
|
|
54
|
+
onDelete,
|
|
54
55
|
onError,
|
|
55
56
|
onSuccess,
|
|
56
|
-
onUpdate
|
|
57
|
+
onUpdate = () => {
|
|
58
|
+
},
|
|
57
59
|
organization,
|
|
58
60
|
values
|
|
59
61
|
}) => {
|
|
@@ -67,8 +69,8 @@ const FormOrganizationCampaignAdvertisementEdit = ({
|
|
|
67
69
|
};
|
|
68
70
|
schema.action = isVendorProduct ? import_yup.default.string().label("Call to action").nullable() : import_yup.default.string().label("Call to action").required().oneOf(app.enums.advertisement.action.enum);
|
|
69
71
|
if (!(values == null ? void 0 : values.product)) {
|
|
70
|
-
schema.file = import_yup.default.object().label("
|
|
71
|
-
schema.url = import_yup.default.string().label("
|
|
72
|
+
schema.file = import_yup.default.object().label("Image or video").required();
|
|
73
|
+
schema.url = import_yup.default.string().label("URL").max(150).matches(import_drawbridge_utils.regex.url, "URL must start with https").required().url();
|
|
72
74
|
}
|
|
73
75
|
;
|
|
74
76
|
const { control, handleSubmit, formState, getValues, setValue } = (0, import_form.useForm)({
|
|
@@ -102,10 +104,12 @@ const FormOrganizationCampaignAdvertisementEdit = ({
|
|
|
102
104
|
status,
|
|
103
105
|
title,
|
|
104
106
|
url,
|
|
105
|
-
|
|
107
|
+
...(values == null ? void 0 : values.id) && {
|
|
108
|
+
video: video == null ? void 0 : video.id
|
|
109
|
+
}
|
|
106
110
|
},
|
|
107
|
-
endpoint: "/organization/" + values.organization + "/campaign/" + values.campaign + "/advertisement/" + values.id,
|
|
108
|
-
method: "PUT"
|
|
111
|
+
endpoint: "/organization/" + values.organization + "/campaign/" + values.campaign + "/advertisement" + ((values == null ? void 0 : values.id) ? "/" + values.id : ""),
|
|
112
|
+
method: (values == null ? void 0 : values.id) ? "PUT" : "POST"
|
|
109
113
|
});
|
|
110
114
|
onSuccess(response);
|
|
111
115
|
} catch (error) {
|
|
@@ -347,118 +351,40 @@ const FormOrganizationCampaignAdvertisementEdit = ({
|
|
|
347
351
|
]
|
|
348
352
|
}
|
|
349
353
|
),
|
|
350
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
354
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
351
355
|
import_fieldset.default,
|
|
352
356
|
{
|
|
353
357
|
...{
|
|
354
|
-
disabled:
|
|
358
|
+
disabled: formState == null ? void 0 : formState.isSubmitting
|
|
355
359
|
},
|
|
356
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
357
|
-
|
|
360
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
361
|
+
"div",
|
|
358
362
|
{
|
|
359
363
|
...{
|
|
360
|
-
|
|
361
|
-
type: "submit"
|
|
364
|
+
className: (values == null ? void 0 : values.id) && onDelete ? "grid grid-cols-2 gap-3" : ""
|
|
362
365
|
},
|
|
363
|
-
children:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
});
|
|
386
|
-
const onSubmit = async ({
|
|
387
|
-
title
|
|
388
|
-
}) => {
|
|
389
|
-
try {
|
|
390
|
-
const response = await (0, import_fetch.request)({
|
|
391
|
-
body: {
|
|
392
|
-
title
|
|
393
|
-
},
|
|
394
|
-
endpoint: "/organization/" + values.organization + "/campaign/" + values.campaign + "/advertisement",
|
|
395
|
-
method: "POST"
|
|
396
|
-
});
|
|
397
|
-
onSuccess(response);
|
|
398
|
-
} catch (error) {
|
|
399
|
-
onError(error);
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
403
|
-
import_form2.default,
|
|
404
|
-
{
|
|
405
|
-
...{
|
|
406
|
-
className: "relative w-full space-y-8",
|
|
407
|
-
onSubmit: handleSubmit(onSubmit)
|
|
408
|
-
},
|
|
409
|
-
children: [
|
|
410
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
411
|
-
import_fieldset.default,
|
|
412
|
-
{
|
|
413
|
-
...{
|
|
414
|
-
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
415
|
-
},
|
|
416
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
417
|
-
import_form.Controller,
|
|
418
|
-
{
|
|
419
|
-
...{
|
|
420
|
-
control,
|
|
421
|
-
name: "title",
|
|
422
|
-
render: ({ field: { value, onChange } }) => {
|
|
423
|
-
var _a, _b;
|
|
424
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
425
|
-
import_input_group.default,
|
|
426
|
-
{
|
|
427
|
-
...{
|
|
428
|
-
error: (_b = (_a = formState == null ? void 0 : formState.errors) == null ? void 0 : _a.title) == null ? void 0 : _b.message,
|
|
429
|
-
input: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
430
|
-
import_input_text.default,
|
|
431
|
-
{
|
|
432
|
-
...{
|
|
433
|
-
onChange,
|
|
434
|
-
value: value || ""
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
),
|
|
438
|
-
label: "Title"
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
)
|
|
446
|
-
}
|
|
447
|
-
),
|
|
448
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
449
|
-
import_fieldset.default,
|
|
450
|
-
{
|
|
451
|
-
...{
|
|
452
|
-
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
453
|
-
},
|
|
454
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
455
|
-
import_button.default,
|
|
456
|
-
{
|
|
457
|
-
...{
|
|
458
|
-
loading: formState == null ? void 0 : formState.isSubmitting,
|
|
459
|
-
type: "submit"
|
|
460
|
-
},
|
|
461
|
-
children: "Submit"
|
|
366
|
+
children: [
|
|
367
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
368
|
+
import_button.default,
|
|
369
|
+
{
|
|
370
|
+
...{
|
|
371
|
+
loading: formState == null ? void 0 : formState.isSubmitting,
|
|
372
|
+
type: "submit"
|
|
373
|
+
},
|
|
374
|
+
children: "Save"
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
(values == null ? void 0 : values.id) && onDelete && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
378
|
+
import_button.default,
|
|
379
|
+
{
|
|
380
|
+
...{
|
|
381
|
+
onClick: onDelete,
|
|
382
|
+
variant: "error"
|
|
383
|
+
},
|
|
384
|
+
children: "Delete"
|
|
385
|
+
}
|
|
386
|
+
)
|
|
387
|
+
]
|
|
462
388
|
}
|
|
463
389
|
)
|
|
464
390
|
}
|
|
@@ -467,7 +393,7 @@ const FormOrganizationCampaignAdvertisement = ({
|
|
|
467
393
|
}
|
|
468
394
|
);
|
|
469
395
|
};
|
|
470
|
-
var form_organization_campaign_advertisement_default =
|
|
396
|
+
var form_organization_campaign_advertisement_default = FormOrganizationCampaignAdvertisementEdit;
|
|
471
397
|
// Annotate the CommonJS export names for ESM import in node:
|
|
472
398
|
0 && (module.exports = {
|
|
473
399
|
FormOrganizationCampaignAdvertisementEdit
|