@drawbridge/components 0.1.13 → 0.1.14

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.
Files changed (236) hide show
  1. package/components/styles.css +364 -2
  2. package/dist/advertisement.js +3 -1
  3. package/dist/advertisement.mjs +3 -1
  4. package/dist/bridge/advertisements.js +2 -0
  5. package/dist/bridge/advertisements.mjs +2 -0
  6. package/dist/bridge/countdown.js +2 -1
  7. package/dist/bridge/countdown.mjs +2 -1
  8. package/dist/bridge/form-subdomain-embed.js +18 -20
  9. package/dist/bridge/form-subdomain-embed.mjs +18 -20
  10. package/dist/bridge/form-subdomain-header.js +24 -1
  11. package/dist/bridge/form-subdomain-header.mjs +24 -1
  12. package/dist/bridge/form-subdomain-missions.js +538 -0
  13. package/dist/bridge/form-subdomain-missions.mjs +502 -0
  14. package/dist/bridge/form-subdomain.js +530 -220
  15. package/dist/bridge/form-subdomain.mjs +533 -222
  16. package/dist/bridge/lib/entry.js +59 -0
  17. package/dist/bridge/lib/entry.mjs +29 -0
  18. package/dist/bridge/lib/location.js +38 -0
  19. package/dist/bridge/lib/location.mjs +13 -0
  20. package/dist/bridge/lib/order.js +71 -0
  21. package/dist/bridge/lib/order.mjs +44 -0
  22. package/dist/bridge/lib/url.js +9 -0
  23. package/dist/bridge/lib/url.mjs +7 -0
  24. package/dist/bridge/share-button.js +5 -3
  25. package/dist/bridge/share-button.mjs +5 -3
  26. package/dist/bridge/subdomain-content.js +7 -6
  27. package/dist/bridge/subdomain-content.mjs +7 -6
  28. package/dist/bridge/template-layout.js +59 -21
  29. package/dist/bridge/template-layout.mjs +59 -21
  30. package/dist/bridge/template-modal.js +42 -76
  31. package/dist/bridge/template-modal.mjs +39 -73
  32. package/dist/bridge/template-preview.js +208 -0
  33. package/dist/bridge/template-preview.mjs +173 -0
  34. package/dist/bridge/template-subdomain-gallery.js +6 -2
  35. package/dist/bridge/template-subdomain-gallery.mjs +6 -2
  36. package/dist/bridge/template-subdomain-link.js +6 -1
  37. package/dist/bridge/template-subdomain-link.mjs +6 -1
  38. package/dist/bridge/template-subdomain.js +20 -15
  39. package/dist/bridge/template-subdomain.mjs +20 -15
  40. package/dist/dashboard/accordion.js +74 -39
  41. package/dist/dashboard/accordion.mjs +74 -39
  42. package/dist/dashboard/avatar.js +109 -3
  43. package/dist/dashboard/avatar.mjs +106 -4
  44. package/dist/dashboard/buttons-subscription.js +384 -0
  45. package/dist/dashboard/buttons-subscription.mjs +349 -0
  46. package/dist/dashboard/card-campaign-switch.js +265 -0
  47. package/dist/dashboard/card-campaign-switch.mjs +231 -0
  48. package/dist/dashboard/card-order.js +28 -11
  49. package/dist/dashboard/card-order.mjs +28 -11
  50. package/dist/dashboard/card-section.js +26 -2
  51. package/dist/dashboard/card-section.mjs +26 -2
  52. package/dist/dashboard/card-tile.js +6 -7
  53. package/dist/dashboard/card-tile.mjs +6 -7
  54. package/dist/dashboard/connection-workflows.js +196 -0
  55. package/dist/dashboard/connection-workflows.mjs +162 -0
  56. package/dist/dashboard/device.js +95 -0
  57. package/dist/dashboard/device.mjs +72 -0
  58. package/dist/dashboard/form-admin-campaign.js +19 -50
  59. package/dist/dashboard/form-admin-campaign.mjs +20 -51
  60. package/dist/dashboard/form-ai.js +9 -6
  61. package/dist/dashboard/form-ai.mjs +9 -6
  62. package/dist/dashboard/form-auth.js +35 -25
  63. package/dist/dashboard/form-auth.mjs +36 -26
  64. package/dist/dashboard/form-file.js +10 -1
  65. package/dist/dashboard/form-file.mjs +10 -1
  66. package/dist/dashboard/form-filters-analytics.js +14 -1
  67. package/dist/dashboard/form-filters-analytics.mjs +15 -2
  68. package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
  69. package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
  70. package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
  71. package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
  72. package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
  73. package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
  74. package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
  75. package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
  76. package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
  77. package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
  78. package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
  79. package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
  80. package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
  81. package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
  82. package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
  83. package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
  84. package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
  85. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
  86. package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
  87. package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
  88. package/dist/dashboard/form-organization-campaign-link.js +7 -1
  89. package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
  90. package/dist/dashboard/form-organization-campaign-mission.js +291 -0
  91. package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
  92. package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
  93. package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
  94. package/dist/dashboard/form-organization-campaign-page.js +20 -11
  95. package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
  96. package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
  97. package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
  98. package/dist/dashboard/form-organization-campaign-section.js +223 -0
  99. package/dist/dashboard/form-organization-campaign-section.mjs +194 -0
  100. package/dist/dashboard/form-organization-campaign.js +114 -469
  101. package/dist/dashboard/form-organization-campaign.mjs +113 -467
  102. package/dist/dashboard/form-organization-export.js +4 -7
  103. package/dist/dashboard/form-organization-export.mjs +4 -7
  104. package/dist/dashboard/form-organization-identity.js +46 -51
  105. package/dist/dashboard/form-organization-identity.mjs +46 -51
  106. package/dist/dashboard/form-organization-workflow.js +518 -686
  107. package/dist/dashboard/form-organization-workflow.mjs +517 -682
  108. package/dist/dashboard/form-organization.js +82 -110
  109. package/dist/dashboard/form-organization.mjs +81 -109
  110. package/dist/dashboard/form-otc.js +4 -5
  111. package/dist/dashboard/form-otc.mjs +4 -5
  112. package/dist/dashboard/form-payment-methods.js +20 -9
  113. package/dist/dashboard/form-payment-methods.mjs +20 -9
  114. package/dist/dashboard/form-stripe.js +30 -0
  115. package/dist/dashboard/form-stripe.mjs +26 -0
  116. package/dist/dashboard/input-array.js +4 -2
  117. package/dist/dashboard/input-array.mjs +4 -2
  118. package/dist/dashboard/input-combobox.js +7 -3
  119. package/dist/dashboard/input-combobox.mjs +7 -3
  120. package/dist/dashboard/input-date.js +7 -0
  121. package/dist/dashboard/input-date.mjs +7 -0
  122. package/dist/dashboard/input-fields.js +80 -20
  123. package/dist/dashboard/input-fields.mjs +80 -20
  124. package/dist/dashboard/input-file.js +21 -1
  125. package/dist/dashboard/input-file.mjs +21 -1
  126. package/dist/dashboard/input-font.js +10 -1
  127. package/dist/dashboard/input-font.mjs +10 -1
  128. package/dist/dashboard/lib/item-list.js +57 -0
  129. package/dist/dashboard/lib/item-list.mjs +33 -0
  130. package/dist/dashboard/lib/menu.js +50 -0
  131. package/dist/dashboard/lib/menu.mjs +26 -0
  132. package/dist/dashboard/locked.js +82 -0
  133. package/dist/dashboard/locked.mjs +53 -0
  134. package/dist/dashboard/menu.js +72 -19
  135. package/dist/dashboard/menu.mjs +72 -19
  136. package/dist/dashboard/note-ai.js +69 -0
  137. package/dist/dashboard/note-ai.mjs +36 -0
  138. package/dist/dashboard/preview.js +419 -0
  139. package/dist/dashboard/preview.mjs +384 -0
  140. package/dist/dashboard/steps.js +39 -13
  141. package/dist/dashboard/steps.mjs +37 -12
  142. package/dist/dashboard/table-contacts.js +136 -0
  143. package/dist/dashboard/table-contacts.mjs +103 -0
  144. package/dist/dashboard/template-not-found.js +4 -2
  145. package/dist/dashboard/template-not-found.mjs +4 -2
  146. package/dist/dashboard/template-socket.js +20 -7
  147. package/dist/dashboard/template-socket.mjs +20 -7
  148. package/dist/icons/desktop.js +46 -0
  149. package/dist/icons/desktop.mjs +27 -0
  150. package/dist/icons/phone.js +46 -0
  151. package/dist/icons/phone.mjs +27 -0
  152. package/dist/icons/puzzle-piece.js +46 -0
  153. package/dist/icons/puzzle-piece.mjs +27 -0
  154. package/dist/icons/tablet.js +46 -0
  155. package/dist/icons/tablet.mjs +27 -0
  156. package/dist/icons/users.js +46 -0
  157. package/dist/icons/users.mjs +27 -0
  158. package/dist/input-checkbox.js +1 -0
  159. package/dist/input-checkbox.mjs +1 -0
  160. package/dist/input-code.js +101 -0
  161. package/dist/input-code.mjs +78 -0
  162. package/dist/input-text.js +2 -1
  163. package/dist/input-text.mjs +2 -1
  164. package/dist/shared/input-checkbox-list.js +0 -1
  165. package/dist/shared/input-checkbox-list.mjs +0 -1
  166. package/dist/shared/input-switch.js +6 -1
  167. package/dist/shared/input-switch.mjs +6 -1
  168. package/dist/shared/lib/campaign.js +117 -0
  169. package/dist/shared/lib/campaign.mjs +91 -0
  170. package/dist/shared/lib/helpers.js +14 -2
  171. package/dist/shared/lib/helpers.mjs +13 -2
  172. package/package.json +133 -13
  173. package/types/bridge/form-subdomain-header.d.ts +2 -0
  174. package/types/bridge/form-subdomain-missions.d.ts +36 -0
  175. package/types/bridge/form-subdomain.d.ts +23 -1
  176. package/types/bridge/lib/entry.d.ts +26 -0
  177. package/types/bridge/lib/location.d.ts +13 -0
  178. package/types/bridge/lib/order.d.ts +30 -0
  179. package/types/bridge/lib/url.d.ts +19 -0
  180. package/types/bridge/template-modal.d.ts +1 -1
  181. package/types/bridge/template-preview.d.ts +10 -0
  182. package/types/bridge/template-subdomain-link.d.ts +2 -0
  183. package/types/dashboard/accordion.d.ts +2 -0
  184. package/types/dashboard/avatar.d.ts +18 -2
  185. package/types/dashboard/buttons-subscription.d.ts +22 -0
  186. package/types/dashboard/card-campaign-switch.d.ts +32 -0
  187. package/types/dashboard/card-order.d.ts +11 -0
  188. package/types/dashboard/card-section.d.ts +2 -0
  189. package/types/dashboard/connection-workflows.d.ts +33 -0
  190. package/types/dashboard/device.d.ts +12 -0
  191. package/types/dashboard/form-admin-campaign.d.ts +3 -2
  192. package/types/dashboard/form-ai.d.ts +2 -2
  193. package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
  194. package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
  195. package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
  196. package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
  197. package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
  198. package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
  199. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
  200. package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
  201. package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
  202. package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
  203. package/types/dashboard/form-organization-campaign-section.d.ts +27 -0
  204. package/types/dashboard/form-organization-campaign.d.ts +27 -17
  205. package/types/dashboard/form-organization-identity.d.ts +2 -0
  206. package/types/dashboard/form-organization-workflow.d.ts +43 -47
  207. package/types/dashboard/form-organization.d.ts +7 -2
  208. package/types/dashboard/form-stripe.d.ts +3 -0
  209. package/types/dashboard/input-combobox.d.ts +2 -0
  210. package/types/dashboard/input-date.d.ts +2 -0
  211. package/types/dashboard/input-fields.d.ts +3 -2
  212. package/types/dashboard/input-file.d.ts +4 -0
  213. package/types/dashboard/lib/item-list.d.ts +14 -0
  214. package/types/dashboard/lib/menu.d.ts +17 -0
  215. package/types/dashboard/locked.d.ts +10 -0
  216. package/types/dashboard/menu.d.ts +10 -2
  217. package/types/dashboard/note-ai.d.ts +15 -0
  218. package/types/dashboard/preview.d.ts +33 -0
  219. package/types/dashboard/steps.d.ts +19 -4
  220. package/types/dashboard/table-cell-title.d.ts +2 -2
  221. package/types/dashboard/table-contacts.d.ts +2 -0
  222. package/types/icons/desktop.d.ts +5 -0
  223. package/types/icons/phone.d.ts +5 -0
  224. package/types/icons/puzzle-piece.d.ts +5 -0
  225. package/types/icons/tablet.d.ts +5 -0
  226. package/types/icons/users.d.ts +5 -0
  227. package/types/input-code.d.ts +23 -0
  228. package/types/shared/input-switch.d.ts +2 -0
  229. package/types/shared/lib/campaign.d.ts +35 -0
  230. package/types/shared/lib/helpers.d.ts +3 -0
  231. package/dist/dashboard/card-integration.js +0 -187
  232. package/dist/dashboard/card-integration.mjs +0 -158
  233. package/dist/dashboard/iframe.js +0 -159
  234. package/dist/dashboard/iframe.mjs +0 -130
  235. package/types/dashboard/card-integration.d.ts +0 -24
  236. package/types/dashboard/iframe.d.ts +0 -18
@@ -3,8 +3,9 @@ import { ComponentType } from 'react';
3
3
  export interface AvatarProps {
4
4
  // Its first letter shows when there is no name.
5
5
  email?: string | null;
6
- // A file record: its 100x100 ( 200x200 when large ) shows, cache-busted by its updatedAt.
7
- image?: { sizes?: Record<string, string>; updatedAt?: string | number | Date } | null;
6
+ // A file record: its 100x100 ( 200x200 when large ) shows, cache-busted by its
7
+ // updatedAt. A plain url ( a vendor's logo ) is drawn as it is, on white.
8
+ image?: string | { sizes?: Record<string, string>; updatedAt?: string | number | Date } | null;
8
9
  // A person's name: its first and last words' letters show with no image.
9
10
  name?: string | null;
10
11
  size?: 'small' | 'default' | 'large';
@@ -12,6 +13,21 @@ export interface AvatarProps {
12
13
  title?: string | null;
13
14
  }
14
15
 
16
+ // Overlapping small circles: up to `max` avatars, then one black circle counting the rest.
17
+ export interface AvatarsProps {
18
+ // Links every circle.
19
+ href?: string;
20
+ // Each item is Avatar's props; its `title` is the circle's hover name.
21
+ items?: Omit<AvatarProps, 'size'>[];
22
+ max?: number;
23
+ // The count of the rest when the caller has counted already ( the api sends only the first few ).
24
+ more?: number | null;
25
+ // With nothing more, draws a plus in the last circle instead.
26
+ plus?: boolean;
27
+ }
28
+
29
+ export declare const Avatars: ComponentType<AvatarsProps>;
30
+
15
31
  declare const Avatar: ComponentType<AvatarProps>;
16
32
 
17
33
  export default Avatar;
@@ -0,0 +1,22 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ export interface SubscriptionActions {
4
+ cancel: () => void;
5
+ confirm: ( options: { body?: Record<string, unknown>; children?: unknown; defaultValues?: Record<string, unknown>; endpoint: string; method?: string; title: string } ) => void;
6
+ // Opens Add payment method; the callback receives the saved method.
7
+ method: ( callback: ( method: unknown ) => void ) => void;
8
+ methods: ( subscription: unknown ) => void;
9
+ resume: () => void;
10
+ subscribe: () => void;
11
+ }
12
+
13
+ // The plan, with a pending downgrade or cancellation and its date.
14
+ export declare const SubscriptionBadge: ComponentType<{ plan?: { title?: string }; subscription?: Record<string, unknown> | null }>;
15
+
16
+ // The Billing page's and the Dashboard's subscription dialogs, off the ['organization', id] query.
17
+ export declare const useSubscriptionActions: ( params: { organization: string } ) => SubscriptionActions;
18
+
19
+ // Start or Change subscription, then Manage payment method.
20
+ export declare const SubscriptionButtons: ComponentType<{ actions: Pick<SubscriptionActions, 'methods' | 'subscribe'>; organization?: Record<string, unknown> }>;
21
+
22
+ export default SubscriptionButtons;
@@ -0,0 +1,32 @@
1
+ import { ComponentType } from 'react';
2
+ import { CampaignSwitchesRecord } from '../shared/lib/campaign';
3
+
4
+ export interface CardCampaignSwitchCampaign extends CampaignSwitchesRecord {
5
+ id?: string;
6
+ organization?: string;
7
+ }
8
+
9
+ export interface CardLeadCaptureProps {
10
+ // The campaign as GET /organization/:o/campaign/:c returns it; the switches draw its state.
11
+ campaign?: CardCampaignSwitchCampaign | null;
12
+ // Without Manage on campaigns.settings: the switches are disabled with a lock.
13
+ disabled?: boolean;
14
+ // Called with the campaign PUT's answer or refusal once the confirmation is sent.
15
+ onError?: ( error: Error ) => void;
16
+ onSuccess?: ( response: unknown ) => void;
17
+ }
18
+
19
+ export interface HeaderCampaignSwitchProps extends CardLeadCaptureProps {
20
+ // Without Manage on campaigns.settings: disabled, with a tooltip saying why ( no lock ).
21
+ disabled?: boolean;
22
+ // Which switch: the Form page's or the Giveaway page's.
23
+ which: 'form' | 'giveaway';
24
+ // Any other attribute ( a `data-guide` ) lands on the switch's wrapper.
25
+ [ attribute: string ]: unknown;
26
+ }
27
+
28
+ // The Form and Giveaway pages' switch, for the page header's controls.
29
+ export declare const HeaderCampaignSwitch: ComponentType<HeaderCampaignSwitchProps>;
30
+
31
+ // The Overview's Lead capture panel.
32
+ export declare const CardLeadCapture: ComponentType<CardLeadCaptureProps>;
@@ -7,6 +7,15 @@ export interface CardOrderLine {
7
7
  variantTitle?: string;
8
8
  }
9
9
 
10
+ export interface CardOrderProvider {
11
+ // The store's API id for the order.
12
+ id?: string;
13
+ // The store's order number as the merchant sees it, e.g. "#1001". Absent on
14
+ // orders recorded before it was stored.
15
+ name?: string | null;
16
+ slug?: string;
17
+ }
18
+
10
19
  export interface CardOrderProps {
11
20
  // ISO code, lower or upper case; defaults to usd.
12
21
  currency?: string;
@@ -14,9 +23,11 @@ export interface CardOrderProps {
14
23
  gross?: number;
15
24
  lines?: CardOrderLine[];
16
25
  net?: number;
26
+ provider?: CardOrderProvider;
17
27
  purchasedAt?: string | number | Date;
18
28
  // Fee rate in percent; not shown for a redemption.
19
29
  rate?: number | null;
30
+ // Picks the attribution sentence; anything but 'redemption' reads as a campaign order.
20
31
  type?: 'conversion' | 'redemption' | string;
21
32
  }
22
33
 
@@ -3,6 +3,8 @@ import { ComponentType, ReactNode } from 'react';
3
3
  export interface CardSectionProps {
4
4
  children?: ReactNode;
5
5
  className?: string | null;
6
+ // Each child a column, side by side from 1280 px; past the first, sticky. 1 by default.
7
+ columns?: 1 | 2;
6
8
  cta?: ReactNode;
7
9
  title?: ReactNode;
8
10
  [ key: string ]: unknown;
@@ -0,0 +1,33 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ // One row of GET /organization/:id/connection/:idOrSlug/workflows.
4
+ export interface ConnectionWorkflowRow {
5
+ campaign?: { id: string; title?: string } | null;
6
+ id: string;
7
+ // Drawbridge's own chain: no trigger page to open.
8
+ locked?: boolean;
9
+ status?: 'active' | 'error' | 'paused' | string;
10
+ // The labels of the steps that use this connection.
11
+ steps?: string[];
12
+ title?: string;
13
+ trigger?: { event?: string | null; title?: string | null; type?: string | null };
14
+ }
15
+
16
+ export interface ConnectionWorkflowsProps {
17
+ // The connection's workflows endpoint.
18
+ endpoint: string;
19
+ organization: string;
20
+ queryKey: unknown[];
21
+ // False for a member who cannot read workflows: no View.
22
+ view?: boolean;
23
+ }
24
+
25
+ // "When a lead enters · Send webhook, Send email".
26
+ export declare const workflowLine: ( row?: ConnectionWorkflowRow | null ) => string;
27
+
28
+ // The red card's title and message for the chains in Error, or null.
29
+ export declare const workflowsNotRunning: ( items?: ConnectionWorkflowRow[] ) => { message: string; title: string } | null;
30
+
31
+ declare const ConnectionWorkflows: ComponentType<ConnectionWorkflowsProps>;
32
+
33
+ export default ConnectionWorkflows;
@@ -0,0 +1,12 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+
3
+ export interface DeviceProps {
4
+ children?: ReactNode;
5
+ type?: 'desktop' | 'tablet' | 'phone';
6
+ }
7
+
8
+ export declare const DEVICE_TYPES: Record<'desktop' | 'tablet' | 'phone', { model: string; safe?: number; screen: { height: number; width: number }; viewport: number }>;
9
+
10
+ declare const Device: ComponentType<DeviceProps>;
11
+
12
+ export default Device;
@@ -5,11 +5,12 @@ export interface FormAdminCampaignProps {
5
5
  onError: ( error: Error ) => void;
6
6
  onSuccess: ( response: unknown ) => void;
7
7
  values?: {
8
+ // The two switches, as the campaign carries them.
9
+ form?: { enabled?: boolean };
10
+ giveaway?: { enabled?: boolean };
8
11
  id?: string;
9
12
  organization?: string;
10
- status?: string;
11
13
  title?: string;
12
- type?: { key?: string; value?: string };
13
14
  [ key: string ]: unknown;
14
15
  };
15
16
  }
@@ -13,8 +13,8 @@ export interface FormAiCampaignProps {
13
13
  disabled?: boolean;
14
14
  onError: ( error: ApiError ) => void;
15
15
  onSuccess: ( response: unknown ) => void;
16
- // type defaults to 'giveaway'; the options come from the cached [ 'app' ] enums.
17
- values?: { organization?: string; title?: string | null; type?: string; url?: string; [ key: string ]: unknown };
16
+ // form and giveaway are the two switches, both on by default.
17
+ values?: { form?: boolean; giveaway?: boolean; organization?: string; title?: string | null; url?: string; [ key: string ]: unknown };
18
18
  }
19
19
 
20
20
  export interface FormAiImageProps {
@@ -1,23 +1,29 @@
1
1
  import { ComponentType } from 'react';
2
2
 
3
- export interface FormOrganizationCampaignAgreementValues {
4
- campaign: string;
5
- enabled?: boolean;
6
- // The agreement's key on the campaign: terms, marketing or sms.
7
- id: string;
8
- label?: string;
9
- link?: string | null;
10
- organization: string;
11
- [ key: string ]: unknown;
3
+ export interface Agreement {
4
+ // False: Drawbridge marks it inactive, and it can't be changed.
5
+ active?: boolean;
6
+ // Requires a link while enabled (the terms agreement); otherwise one is optional.
7
+ enforceLink?: boolean;
8
+ title: string;
9
+ values?: { enabled?: boolean; label?: string; link?: string | null };
10
+ // Shows the Required badge.
11
+ warning?: boolean;
12
12
  }
13
13
 
14
14
  export interface FormOrganizationCampaignAgreementProps {
15
+ // The campaign's agreements, as GET .../campaign answers them, keyed terms, marketing, sms.
16
+ agreements: Record<string, Agreement>;
17
+ // The wording shown, disabled, in an agreement's Label while it is off.
18
+ defaultLabels?: Record<string, string>;
15
19
  disabled?: boolean;
20
+ // What is typed, as it is typed: { [ id ] : { enabled, label, link } }.
21
+ onChange?: ( values: Record<string, Agreement[ 'values' ]> ) => void;
16
22
  onError: ( error: Error ) => void;
23
+ // The agreement being edited.
24
+ onFocus?: ( id: string ) => void;
17
25
  onSuccess: ( response: unknown ) => void;
18
- // Requires a link while enabled (the terms agreement); otherwise one is optional.
19
- enforceLink?: boolean;
20
- values: FormOrganizationCampaignAgreementValues;
26
+ params: { campaign: string; organization: string };
21
27
  }
22
28
 
23
29
  declare const FormOrganizationCampaignAgreement: ComponentType<FormOrganizationCampaignAgreementProps>;
@@ -6,12 +6,11 @@ import { ComponentType } from 'react';
6
6
  export interface FormOrganizationCampaignFieldEmailValues {
7
7
  campaign: string;
8
8
  id?: string;
9
- inputs?: Array<'label' | 'primary' | 'settings'>;
9
+ inputs?: Array<'label' | 'settings'>;
10
10
  organization: string;
11
11
  slug?: string;
12
12
  type?: 'lead' | 'additional';
13
13
  label?: string;
14
- primary?: boolean;
15
14
  settings?: {
16
15
  blacklist?: Array<{ domain: string }>;
17
16
  whitelist?: Array<{ domain: string }>;
@@ -0,0 +1,36 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ // One item of an Item list field. `image` is the resolved file on read; the
4
+ // dialog sends its id.
5
+ export interface FormOrganizationCampaignFieldListItem {
6
+ attributes?: { max?: number | null };
7
+ description?: string | null;
8
+ id?: string;
9
+ image?: { filename?: string; id: string; mimetype?: string; sizes?: Record<string, string>; updatedAt?: string } | string | null;
10
+ name: string;
11
+ price?: number | null;
12
+ }
13
+
14
+ // What the Form page passes: the saved field when editing, the route ids,
15
+ // Your order's Show prices and the organization's currency.
16
+ export interface FormOrganizationCampaignFieldListValues {
17
+ campaign: string;
18
+ currency?: string;
19
+ id?: string;
20
+ label?: string;
21
+ organization: string;
22
+ prices?: boolean;
23
+ settings?: { items?: FormOrganizationCampaignFieldListItem[] };
24
+ [ key: string ]: unknown;
25
+ }
26
+
27
+ export interface FormOrganizationCampaignFieldListProps {
28
+ disabled?: boolean;
29
+ onError: ( error: Error ) => void;
30
+ onSuccess: ( response: unknown ) => void;
31
+ values: FormOrganizationCampaignFieldListValues;
32
+ }
33
+
34
+ declare const FormOrganizationCampaignFieldList: ComponentType<FormOrganizationCampaignFieldListProps>;
35
+
36
+ export default FormOrganizationCampaignFieldList;
@@ -6,12 +6,11 @@ import { ComponentType } from 'react';
6
6
  export interface FormOrganizationCampaignFieldPhoneValues {
7
7
  campaign: string;
8
8
  id?: string;
9
- inputs?: Array<'label' | 'primary' | 'settings'>;
9
+ inputs?: Array<'label' | 'settings'>;
10
10
  organization: string;
11
11
  slug?: string;
12
12
  type?: 'lead' | 'additional';
13
13
  label?: string;
14
- primary?: boolean;
15
14
  // Country codes from the [ 'countries' ] query (GET /app/countries).
16
15
  settings?: { countries?: string[] };
17
16
  [ key: string ]: unknown;
@@ -0,0 +1,22 @@
1
+ import { ComponentType } from 'react';
2
+ import { FormActionProps } from './form-action';
3
+
4
+ // A field as the api's fields read returns it. `workflows` names each step of
5
+ // this campaign that sends to the field, by its chain's and its own title.
6
+ export interface FormOrganizationCampaignFieldRemoveField {
7
+ id?: string;
8
+ slug?: string;
9
+ workflows?: Array<{ chain: string; step: string }>;
10
+ [ key: string ]: unknown;
11
+ }
12
+
13
+ export interface FormOrganizationCampaignFieldRemoveProps extends Omit<FormActionProps, 'children'> {
14
+ field?: FormOrganizationCampaignFieldRemoveField;
15
+ }
16
+
17
+ // "Send SMS in When a lead enters uses this field. It won't run until you add a phone field again.", one per step.
18
+ export declare const fieldRemoveWarnings: ( field?: FormOrganizationCampaignFieldRemoveField | null ) => string[];
19
+
20
+ declare const FormOrganizationCampaignFieldRemove: ComponentType<FormOrganizationCampaignFieldRemoveProps>;
21
+
22
+ export default FormOrganizationCampaignFieldRemove;
@@ -11,7 +11,8 @@ export interface FormOrganizationCampaignFieldSelectValues {
11
11
  // Set for a prize question: posts to the prize's field route, without `type`.
12
12
  prize?: string;
13
13
  slug?: string;
14
- type?: 'lead' | 'additional';
14
+ // 'order' with slug 'pickup': a Pickup field on Your order.
15
+ type?: 'lead' | 'additional' | 'order';
15
16
  label?: string;
16
17
  settings?: { options?: Array<{ option: string }> };
17
18
  [ key: string ]: unknown;
@@ -9,7 +9,8 @@ export interface FormOrganizationCampaignFieldTextareaValues {
9
9
  inputs?: Array<'attributes' | 'label'>;
10
10
  organization: string;
11
11
  slug?: string;
12
- type?: 'lead' | 'additional';
12
+ // 'order' with slug 'note': an Order note field on Your order.
13
+ type?: 'lead' | 'additional' | 'order';
13
14
  // Defaults to a max length of 300 (the ceiling) and 3 rows (1 to 6).
14
15
  attributes?: { max?: number; rows?: number };
15
16
  label?: string;
@@ -1,11 +1,11 @@
1
1
  import { ComponentType } from 'react';
2
2
 
3
- // What the integrations page passes: the saved integration (if any) plus the
4
- // route ids and its slug. Without `id` the button reads Add and posts.
3
+ // What the Form page passes: the campaign's saved age gate (if any) plus the
4
+ // route ids and its slug. Without `added` the button reads Add; either way it PUTs to /integration/:slug.
5
5
  export interface FormOrganizationCampaignIntegrationAgeValues {
6
6
  campaign: string;
7
7
  enabled?: boolean;
8
- id?: string;
8
+ added?: boolean;
9
9
  organization: string;
10
10
  settings?: { max?: number | null; min?: number };
11
11
  slug: string;
@@ -3,11 +3,11 @@ import { ComponentType } from 'react';
3
3
  export interface FormOrganizationCampaignIntegrationValues {
4
4
  campaign: string;
5
5
  enabled?: boolean;
6
- // Present once the integration is on the campaign: the form PUTs to it instead of POSTing.
7
- id?: string;
6
+ // True once the tool is on the campaign: the button reads Save instead of Add.
7
+ added?: boolean;
8
8
  organization: string;
9
9
  settings?: object;
10
- // The integration's slug, e.g. 'recaptcha', 'gtm', 'geocode'.
10
+ // The tool's slug, e.g. 'recaptcha', 'gtm', 'geocode': the form PUTs to /integration/:slug.
11
11
  slug: string;
12
12
  [ key: string ]: unknown;
13
13
  }
@@ -0,0 +1,40 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ // A mission as GET /organization/:o/campaign/:c/missions lists it, plus the route ids.
4
+ export interface FormOrganizationCampaignMissionValues {
5
+ campaign: string;
6
+ enabled?: boolean;
7
+ // Entries per completion, 0 to 50.
8
+ entries?: number;
9
+ id: string;
10
+ // Maximum completions, 1 to 50, counted per the mission's own Count
11
+ // completions per (a mission without one counts per campaign). A once-only
12
+ // mission (Verify email, Verify phone) has none.
13
+ limit?: { count?: number; per?: 'campaign' | 'day' | 'range' };
14
+ // Why the mission can't be turned on ("Needs an active SMS number"): the
15
+ // dialog's Status is off and disabled, reading it. A row already on can
16
+ // still be turned off.
17
+ locked?: string;
18
+ organization: string;
19
+ // Why the mission is not offered as it stands, shown on its row.
20
+ reason?: string;
21
+ // Whether the mission repeats ( its manifest's ); a once-only mission has no limit.
22
+ repeats?: boolean;
23
+ type?: 'form' | 'email' | 'phone' | 'share';
24
+ [ key: string ]: unknown;
25
+ }
26
+
27
+ export interface FormOrganizationCampaignMissionProps {
28
+ // Without Manage on campaigns.missions.
29
+ disabled?: boolean;
30
+ onError: ( error: Error ) => void;
31
+ onSuccess: ( response: unknown ) => void;
32
+ values: FormOrganizationCampaignMissionValues;
33
+ }
34
+
35
+ // Whether the mission repeats (its manifest): the dialog draws the limit only then.
36
+ export declare const repeats: ( values?: { type?: string } ) => boolean;
37
+
38
+ declare const FormOrganizationCampaignMission: ComponentType<FormOrganizationCampaignMissionProps>;
39
+
40
+ export default FormOrganizationCampaignMission;
@@ -0,0 +1,27 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ // A section as GET .../sections returns it, plus the route ids.
4
+ export interface FormOrganizationCampaignSectionValues {
5
+ campaign: string;
6
+ description?: string | null;
7
+ // Your order's Take orders.
8
+ enabled?: boolean;
9
+ id: 'information' | 'order';
10
+ organization: string;
11
+ // Your order's Show prices.
12
+ settings?: { prices?: boolean };
13
+ title?: string;
14
+ type: 'information' | 'order';
15
+ [ key: string ]: unknown;
16
+ }
17
+
18
+ export interface FormOrganizationCampaignSectionProps {
19
+ disabled?: boolean;
20
+ onError: ( error: Error ) => void;
21
+ onSuccess: ( response: unknown ) => void;
22
+ values: FormOrganizationCampaignSectionValues;
23
+ }
24
+
25
+ declare const FormOrganizationCampaignSection: ComponentType<FormOrganizationCampaignSectionProps>;
26
+
27
+ export default FormOrganizationCampaignSection;
@@ -2,28 +2,26 @@ import { ComponentType } from 'react';
2
2
 
3
3
  type OnError = ( error: Error & { status?: number; data?: unknown } ) => void;
4
4
 
5
+ export type FormOrganizationCampaignCopyKey = 'active' | 'button' | 'confirmation' | 'inactive' | 'order' | 'rejection' | 'title';
6
+
5
7
  export interface FormOrganizationCampaignValues {
6
8
  brand?: { id: string; title?: string; [ key: string ]: unknown } | null;
7
- defaults?: {
8
- active?: string | null;
9
- confirmation?: string | null;
10
- inactive?: string | null;
11
- purchase?: string | null;
12
- rejection?: string | null;
9
+ // Create: the two switches, both on by default. An existing campaign carries
10
+ // { enabled, copy }; a blank copy text is null and falls back to the default.
11
+ form?: boolean | { copy?: Partial<Record<FormOrganizationCampaignCopyKey, string | null>>; enabled?: boolean; [ key: string ]: unknown };
12
+ // An existing campaign's giveaway carries the winner's message, sent as giveaway.notifications.
13
+ giveaway?: boolean | {
14
+ enabled?: boolean;
15
+ notifications?: { draw?: { message?: string; score?: Record<string, unknown> | null; subject?: string; text?: string } };
16
+ [ key: string ]: unknown;
13
17
  };
14
18
  id?: string;
15
19
  industry?: string | null;
16
- notifications?: {
17
- draw?: { message?: string; score?: Record<string, unknown> | null; subject?: string; text?: string };
18
- };
19
20
  organization?: string;
20
- settings?: { submissionEntryFilter?: 'campaign' | 'day' | 'range'; submissionEntryLimit?: number };
21
21
  shop?: { productColumns?: 1 | 2 };
22
- status?: string;
23
22
  // A template id: the new campaign copies it and the industry is not asked.
24
23
  template?: string | null;
25
24
  title?: string | null;
26
- type?: 'default' | 'giveaway' | string;
27
25
  [ key: string ]: unknown;
28
26
  }
29
27
 
@@ -34,16 +32,28 @@ export interface FormOrganizationCampaignFormProps {
34
32
  values?: FormOrganizationCampaignValues;
35
33
  }
36
34
 
37
- // Create. Reads the campaign enums from [ 'app' ] in the query cache.
35
+ // Create: title, the Form and Giveaway switches, industry and brand. Reads the industries from [ 'app' ] in the query cache.
38
36
  export interface FormOrganizationCampaignProps extends FormOrganizationCampaignFormProps {
39
37
  canManageBrands?: boolean;
40
38
  }
41
39
 
42
40
  export declare const FormOrganizationCampaign: ComponentType<FormOrganizationCampaignProps>;
43
- export declare const FormOrganizationCampaignDefaults: ComponentType<FormOrganizationCampaignFormProps>;
41
+ // The Content page's form: `sections` of texts under headings, one Save, sent as form.copy.
42
+ export interface FormOrganizationCampaignCopyProps extends FormOrganizationCampaignFormProps {
43
+ // Entries are being awarded right now: the Panel title's placeholder.
44
+ awarding?: boolean;
45
+ // What is typed, as it is typed.
46
+ onChange?: ( copy: Partial<Record<FormOrganizationCampaignCopyKey, string>> ) => void;
47
+ // The text being edited.
48
+ onFocus?: ( key: FormOrganizationCampaignCopyKey ) => void;
49
+ // [ [ heading, keys ] ].
50
+ sections: [ string, FormOrganizationCampaignCopyKey[] ][];
51
+ }
52
+
53
+ // A blank text's placeholder, its fallback; the Panel title's follows `awarding`.
54
+ export declare const copyPlaceholder: ( key: FormOrganizationCampaignCopyKey, awarding?: boolean ) => string | undefined;
55
+
56
+ export declare const FormOrganizationCampaignCopy: ComponentType<FormOrganizationCampaignCopyProps>;
44
57
  export declare const FormOrganizationCampaignNotifications: ComponentType<FormOrganizationCampaignFormProps>;
45
58
  export declare const FormOrganizationCampaignTitle: ComponentType<FormOrganizationCampaignFormProps>;
46
- // Reads the status enum from [ 'app' ] in the query cache.
47
- export declare const FormOrganizationCampaignStatus: ComponentType<FormOrganizationCampaignFormProps>;
48
59
  export declare const FormOrganizationCampaignSettingsShop: ComponentType<FormOrganizationCampaignFormProps>;
49
- export declare const FormOrganizationCampaignSettingsLimits: ComponentType<FormOrganizationCampaignFormProps>;
@@ -36,6 +36,8 @@ export interface FormOrganizationIdentityEmailProps {
36
36
  values?: {
37
37
  address?: { address?: string; [ key: string ]: unknown } | null;
38
38
  domain?: string;
39
+ // The organization's business.website; a new sending domain is its domain.
40
+ website?: string | null;
39
41
  errors?: { message?: string }[];
40
42
  from?: string;
41
43
  id?: string;