@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.
- 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 +538 -0
- package/dist/bridge/form-subdomain-missions.mjs +502 -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 +265 -0
- package/dist/dashboard/card-campaign-switch.mjs +231 -0
- package/dist/dashboard/card-order.js +28 -11
- package/dist/dashboard/card-order.mjs +28 -11
- 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 +196 -0
- package/dist/dashboard/connection-workflows.mjs +162 -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-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 +223 -0
- package/dist/dashboard/form-organization-campaign-section.mjs +194 -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 +518 -686
- package/dist/dashboard/form-organization-workflow.mjs +517 -682
- 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 +101 -0
- package/dist/input-code.mjs +78 -0
- package/dist/input-text.js +2 -1
- package/dist/input-text.mjs +2 -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 +117 -0
- package/dist/shared/lib/campaign.mjs +91 -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 +36 -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 +11 -0
- 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 +27 -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 +43 -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
|
@@ -13,8 +13,10 @@ export interface FormOrganizationWorkflowStep {
|
|
|
13
13
|
text?: string;
|
|
14
14
|
url?: string;
|
|
15
15
|
};
|
|
16
|
+
// The workflow read's "Needs a phone field": the campaign's form lacks the address this step sends to.
|
|
17
|
+
reason?: string;
|
|
16
18
|
slug?: string;
|
|
17
|
-
// 'step.email.notify' | 'step.email.send' | 'step.
|
|
19
|
+
// 'step.email.notify' | 'step.email.send' | 'step.sms.send' | 'step.commerce.code.issue' | 'step.webhook.send' | ...
|
|
18
20
|
type?: string;
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -34,71 +36,53 @@ export interface FormOrganizationWorkflowRow {
|
|
|
34
36
|
|
|
35
37
|
interface Callbacks {
|
|
36
38
|
disabled?: boolean;
|
|
37
|
-
onClose?: () => void;
|
|
38
39
|
onError: ( error: unknown ) => void;
|
|
39
40
|
onSuccess: ( response: unknown ) => void;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
export interface
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
// A value a step's message can insert: the trigger's own (`leadLink`) or what
|
|
44
|
+
// an earlier step returns (`shopifyDiscountCode`).
|
|
45
|
+
export interface WorkflowVariable {
|
|
46
|
+
key: string;
|
|
47
|
+
label: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// One trigger's catalog entry for one campaign, as `catalog` on
|
|
51
|
+
// GET /organization/:id/campaign/:campaign/workflow/:event.
|
|
52
|
+
export interface WorkflowCatalogEntry {
|
|
53
|
+
// `reason` ("Needs a phone field"): the campaign's form lacks the address the step sends to.
|
|
54
|
+
steps?: { connectionId?: string; disabled?: boolean; key?: string; ownerOnly?: boolean; reason?: string; returns?: WorkflowVariable[]; slug?: string; value: string; [ key: string ]: unknown }[];
|
|
55
|
+
title?: string;
|
|
56
|
+
trigger: string;
|
|
57
|
+
type?: string;
|
|
58
|
+
variables?: WorkflowVariable[];
|
|
51
59
|
}
|
|
52
60
|
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
61
|
+
// One campaign's chain for one trigger, edited on the trigger page
|
|
62
|
+
// (PUT /organization/:id/campaign/:campaign/workflow/:event). Takes the
|
|
63
|
+
// trigger's catalog entry from the page; reads the accepted members and, for
|
|
64
|
+
// commerce steps, the connection; also needs the ['organization', id] query
|
|
65
|
+
// (with owner.email) loaded.
|
|
56
66
|
export interface FormOrganizationWorkflowEditProps extends Callbacks {
|
|
67
|
+
// The trigger page read's `catalog`: the steps this trigger offers.
|
|
68
|
+
catalog?: WorkflowCatalogEntry | null;
|
|
57
69
|
values: {
|
|
58
|
-
|
|
70
|
+
campaign: string;
|
|
59
71
|
// Sync's run-time issue, shown on the first step of `step`'s type.
|
|
60
72
|
issue?: { message?: string; step?: string } | null;
|
|
61
73
|
organization: string;
|
|
74
|
+
// A step type an Overview next step asked for (?step=): added unsaved.
|
|
75
|
+
step?: string | null;
|
|
62
76
|
steps?: FormOrganizationWorkflowStep[];
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
event?: string;
|
|
66
|
-
// The picked campaigns: the read hydrates them into documents in pick
|
|
67
|
-
// order; empty means every campaign. A pre-Cherry workflow may still
|
|
68
|
-
// carry one `campaign` string, which loads as a one-item list.
|
|
69
|
-
filters?: {
|
|
70
|
-
campaign?: string | { id: string } | null;
|
|
71
|
-
campaigns?: ( string | { id: string; [ key: string ]: unknown } )[];
|
|
72
|
-
segment?: string | { id: string } | null;
|
|
73
|
-
};
|
|
77
|
+
trigger: {
|
|
78
|
+
event: 'lead.insert' | 'lead.delete' | string;
|
|
74
79
|
};
|
|
75
80
|
[ key: string ]: unknown;
|
|
76
81
|
};
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
export declare const FormOrganizationWorkflow: ComponentType<FormOrganizationWorkflowProps>;
|
|
80
84
|
export declare const FormOrganizationWorkflowEdit: ComponentType<FormOrganizationWorkflowEditProps>;
|
|
81
85
|
|
|
82
|
-
// Reduces a campaign (hydrated document or id) to its id.
|
|
83
|
-
export declare const campaignFilterId: ( campaign?: string | { id?: string } | null ) => string | null;
|
|
84
|
-
|
|
85
|
-
// The picked campaigns as ids, from `filters.campaigns` (ids or documents) or
|
|
86
|
-
// a pre-Cherry `filters.campaign`.
|
|
87
|
-
export declare const campaignFilterIds: ( filters?: {
|
|
88
|
-
campaign?: string | { id?: string } | null;
|
|
89
|
-
campaigns?: ( string | { id?: string } | null )[];
|
|
90
|
-
} | null ) => string[];
|
|
91
|
-
|
|
92
|
-
// One picker row per id, in the ids' order: its document, or a bare { id }
|
|
93
|
-
// while it loads or once it is deleted.
|
|
94
|
-
export declare const filterRows: <T extends { id?: string }>( ids: string[], docs: ( T | null | undefined )[] ) => ( T | { id: string } )[];
|
|
95
|
-
|
|
96
|
-
// The document among `seeds` (the read's hydrated campaigns) for one id.
|
|
97
|
-
export declare const filterSeed: <T extends { id?: string }>( seeds: ( T | string | null )[] | null | undefined, id: string ) => T | undefined;
|
|
98
|
-
|
|
99
|
-
// A label read's catch: a 404 resolves { result : null }; anything else throws.
|
|
100
|
-
export declare const filterMissing: ( error: unknown ) => { result: null };
|
|
101
|
-
|
|
102
86
|
// The editor's validation schema (yup).
|
|
103
87
|
export declare const workflowSchema: {
|
|
104
88
|
validate: ( value: unknown, options?: Record<string, unknown> ) => Promise<unknown>;
|
|
@@ -106,3 +90,15 @@ export declare const workflowSchema: {
|
|
|
106
90
|
};
|
|
107
91
|
|
|
108
92
|
export declare const stepRow: ( step?: FormOrganizationWorkflowStep, members?: { id?: string; [ key: string ]: unknown }[] ) => FormOrganizationWorkflowRow;
|
|
93
|
+
|
|
94
|
+
// What step `index`'s message can insert: the trigger's variables, then the
|
|
95
|
+
// returns of every step before it.
|
|
96
|
+
export declare const stepVariables: ( entry: WorkflowCatalogEntry | null | undefined, steps?: { type?: string }[], index?: number ) => WorkflowVariable[];
|
|
97
|
+
|
|
98
|
+
// The row a ?step= deep link adds, or null when the chain has it already or
|
|
99
|
+
// the catalog does not offer it to this member.
|
|
100
|
+
export declare const prefillRow: ( options: { entry?: WorkflowCatalogEntry | null; step?: string | null; steps?: { type?: string }[] } ) => FormOrganizationWorkflowRow | null;
|
|
101
|
+
|
|
102
|
+
// "Needs a phone field" when the campaign's form cannot feed a step of `type`,
|
|
103
|
+
// from the catalog entry or the saved steps; null when the step can run.
|
|
104
|
+
export declare const stepReason: ( options: { entry?: WorkflowCatalogEntry | null; saved?: Array<{ reason?: string; type?: string; [ key: string ]: unknown }>; type?: string } ) => string | null;
|
|
@@ -21,7 +21,12 @@ export interface FormOrganizationSubdomainProps extends Callbacks {
|
|
|
21
21
|
values?: { domain?: string; id?: string; shortId?: string; subdomain?: string; [ key: string ]: unknown };
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// One fact per form; each PUTs only its own field to /organization/:id/business.
|
|
25
|
+
export interface FormOrganizationBusinessFieldProps extends Callbacks {
|
|
26
|
+
// The fact this form edits.
|
|
27
|
+
name: 'email' | 'name' | 'website';
|
|
28
|
+
// The owner's address, the contact email's starting value while none is saved.
|
|
29
|
+
owner?: string;
|
|
25
30
|
values?: { business?: { email?: string; name?: string; website?: string }; id?: string };
|
|
26
31
|
}
|
|
27
32
|
|
|
@@ -39,7 +44,7 @@ export interface FormOrganizationRevenueProps extends Callbacks {
|
|
|
39
44
|
values?: { currency?: string; defaultCurrency?: string; id?: string };
|
|
40
45
|
}
|
|
41
46
|
|
|
42
|
-
export declare const
|
|
47
|
+
export declare const FormOrganizationBusinessField: ComponentType<FormOrganizationBusinessFieldProps>;
|
|
43
48
|
export declare const FormOrganizationDefaults: ComponentType<FormOrganizationDefaultsProps>;
|
|
44
49
|
export declare const FormOrganizationRevenue: ComponentType<FormOrganizationRevenueProps>;
|
|
45
50
|
export declare const FormOrganizationSubdomain: ComponentType<FormOrganizationSubdomainProps>;
|
|
@@ -15,6 +15,9 @@ export interface FormStripeProps {
|
|
|
15
15
|
onSuccess: ( response: unknown ) => void | Promise<void>;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// The Add payment method dialog's body: GET /account/intent, then FormStripe.
|
|
19
|
+
export declare const FormStripeIntent: ComponentType<Pick<FormStripeProps, 'onSuccess'>>;
|
|
20
|
+
|
|
18
21
|
declare const FormStripe: ComponentType<FormStripeProps>;
|
|
19
22
|
|
|
20
23
|
export default FormStripe;
|
|
@@ -21,6 +21,8 @@ export interface InputDateRangeValue {
|
|
|
21
21
|
|
|
22
22
|
export interface InputDateRangeProps {
|
|
23
23
|
className?: string;
|
|
24
|
+
// The last day that can be picked, 'YYYY-MM-DD'; the calendar stops at its month.
|
|
25
|
+
max?: string | Date;
|
|
24
26
|
onChange: ( value: InputDateRangeValue ) => void;
|
|
25
27
|
value?: InputDateRangeValue;
|
|
26
28
|
}
|
|
@@ -11,7 +11,8 @@ interface Organization { id: string; [ key: string ]: unknown }
|
|
|
11
11
|
// yup shape builders the parent form spreads into its schema.
|
|
12
12
|
export const schemas: {
|
|
13
13
|
address: () => unknown;
|
|
14
|
-
|
|
14
|
+
// Title, and the Form and Giveaway switches.
|
|
15
|
+
campaign: () => Record<string, unknown>;
|
|
15
16
|
currency: () => Record<string, unknown>;
|
|
16
17
|
images: () => Record<string, unknown>;
|
|
17
18
|
page: () => Record<string, unknown>;
|
|
@@ -25,7 +26,7 @@ export const InputFieldsAddress: ComponentType<{ showAutocomplete?: boolean }>;
|
|
|
25
26
|
// style.heading/body fonts, colours and radii.
|
|
26
27
|
export const InputFieldsStyle: ComponentType<{ disabled?: boolean; onUpdate?: OnUpdate }>;
|
|
27
28
|
|
|
28
|
-
// title and
|
|
29
|
+
// title, and the Form and Giveaway switches ( one flip keeps the pair consistent ).
|
|
29
30
|
export const InputFieldsCampaign: ComponentType<{ onUpdate?: ( title: string ) => void }>;
|
|
30
31
|
|
|
31
32
|
// currency ( options from the cached [ 'app' ] enums ).
|
|
@@ -13,6 +13,8 @@ export interface InputFileValue {
|
|
|
13
13
|
|
|
14
14
|
export interface InputFileProps {
|
|
15
15
|
button?: { icon?: ComponentType<SVGProps<SVGSVGElement>>; text?: ReactNode };
|
|
16
|
+
// This placement's description of the image (its alt text), up to 150 characters.
|
|
17
|
+
description?: string;
|
|
16
18
|
disabled?: boolean;
|
|
17
19
|
// Base for the picker's library and upload ( /organization/:id ).
|
|
18
20
|
endpoint?: string;
|
|
@@ -20,6 +22,8 @@ export interface InputFileProps {
|
|
|
20
22
|
// false hides the remove button.
|
|
21
23
|
nullable?: boolean;
|
|
22
24
|
onChange: ( file: InputFileValue | null ) => void;
|
|
25
|
+
// With it, the row's name becomes an editable Description, the file's name as its placeholder.
|
|
26
|
+
onDescription?: ( description: string ) => void;
|
|
23
27
|
organization?: { id: string; [ key: string ]: unknown } | string;
|
|
24
28
|
type?: 'image' | 'media' | 'video' | 'all' | string;
|
|
25
29
|
value?: InputFileValue | null | '';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormOrganizationCampaignFieldListItem } from '../form-organization-campaign-field-list';
|
|
2
|
+
|
|
3
|
+
// "$22.00 CAD · Up to 6 per order": the price while prices are on, then the limit.
|
|
4
|
+
export declare const itemSummary: ( item: Partial<FormOrganizationCampaignFieldListItem> | null | undefined, prices: boolean, currency: string ) => string;
|
|
5
|
+
|
|
6
|
+
// The items as the field routes take them: image ids, explicit nulls.
|
|
7
|
+
export declare const itemsBody: ( items?: Partial<FormOrganizationCampaignFieldListItem>[] ) => Array<{
|
|
8
|
+
attributes: { max: number | null };
|
|
9
|
+
description: string | null;
|
|
10
|
+
id?: string;
|
|
11
|
+
image: string | null;
|
|
12
|
+
name?: string;
|
|
13
|
+
price: number | null;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MenuItem } from '../menu';
|
|
2
|
+
|
|
3
|
+
// Whether a menu entry is the page at `path`: the exact address for an `exact`
|
|
4
|
+
// entry, otherwise the address or anything under it. No href is never active.
|
|
5
|
+
export declare const isActive: ( item: { exact?: boolean; href?: string } | null | undefined, path?: string ) => boolean;
|
|
6
|
+
|
|
7
|
+
// A sidebar row as it draws at `path`: its children with `active`, `open` while
|
|
8
|
+
// the row or a child is active, `highlighted` on the row's own page only, and
|
|
9
|
+
// `error` (the dot) on a closed row when it or any child has one, on an open row
|
|
10
|
+
// only when it has its own.
|
|
11
|
+
export declare const menuRow: ( row?: MenuItem, path?: string ) => MenuItem & {
|
|
12
|
+
active: boolean;
|
|
13
|
+
children: ( MenuItem & { active: boolean } )[];
|
|
14
|
+
error: boolean;
|
|
15
|
+
highlighted: boolean;
|
|
16
|
+
open: boolean;
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface LockedProps {
|
|
4
|
+
// The api's reason the row can't be removed; nothing renders without one.
|
|
5
|
+
locked?: string | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare const Locked: ComponentType<LockedProps>;
|
|
9
|
+
|
|
10
|
+
export default Locked;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { ComponentType, ElementType, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
// One row of a GET /menu/* group ( drawbridge-api lib/menus.js ).
|
|
3
|
+
// One row of a GET /menu/* group ( drawbridge-api lib/menus.js ). The
|
|
4
|
+
// organization and campaign menus send dropdown rows ( an icon and the pages
|
|
5
|
+
// under the row as children ); the account and admin menus send flat rows.
|
|
4
6
|
export interface MenuItem {
|
|
5
7
|
badge?: { text?: ReactNode; type?: string };
|
|
8
|
+
// The pages under a dropdown row, listed while the row or one of them is
|
|
9
|
+
// open. A page has the row's shape without icon and children.
|
|
10
|
+
children?: MenuItem[];
|
|
6
11
|
description?: string;
|
|
7
12
|
disabled?: boolean;
|
|
8
13
|
element?: ElementType;
|
|
9
|
-
// Shows the warning dot.
|
|
14
|
+
// Shows the warning dot. A closed row also shows it when a child has one.
|
|
10
15
|
error?: boolean;
|
|
11
16
|
// Active only on an exact path match.
|
|
12
17
|
exact?: boolean;
|
|
13
18
|
// Without href the row is inert.
|
|
14
19
|
href?: string;
|
|
20
|
+
// A dropdown row's icon: chart, document, flag, home, link, queue, share,
|
|
21
|
+
// star or users. An unknown name draws no icon.
|
|
22
|
+
icon?: string;
|
|
15
23
|
key?: string;
|
|
16
24
|
locked?: boolean;
|
|
17
25
|
title: ReactNode;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
// True for a loaded balance with no AI credits left; false while it loads.
|
|
4
|
+
export declare const needsCredits: ( balance?: { ai?: number } | null ) => boolean;
|
|
5
|
+
|
|
6
|
+
export interface NoteAIProps {
|
|
7
|
+
// The ['account', 'balance'] query's data.
|
|
8
|
+
balance?: { ai?: number } | null;
|
|
9
|
+
// The drawer's close, for a note inside one.
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const NoteAI: ComponentType<NoteAIProps>;
|
|
14
|
+
|
|
15
|
+
export default NoteAI;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface PreviewStates {
|
|
4
|
+
onChange: ( value: unknown ) => void;
|
|
5
|
+
options: { key: string; value: unknown }[];
|
|
6
|
+
value: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface PreviewProps {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
// The screen still loading what it draws: the loader shows in the device instead of the children.
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
// The states dropdown, shown when there is more than one option.
|
|
14
|
+
states?: PreviewStates;
|
|
15
|
+
// The brand the iframe's body is painted in ( background and text colours ).
|
|
16
|
+
style?: Record<string, unknown> | null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PreviewPageProps {
|
|
20
|
+
states?: PreviewStates;
|
|
21
|
+
// Posted to the page as { update } whenever it changes.
|
|
22
|
+
update?: Record<string, unknown>;
|
|
23
|
+
// The share page's absolute address, in preview mode.
|
|
24
|
+
url?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare const clamp: ( value: number, limit: number ) => number;
|
|
28
|
+
export declare const fitScale: ( space: { height: number; width: number }, size: { height: number; width: number } ) => number;
|
|
29
|
+
export declare const PreviewPage: ComponentType<PreviewPageProps>;
|
|
30
|
+
|
|
31
|
+
declare const Preview: ComponentType<PreviewProps>;
|
|
32
|
+
|
|
33
|
+
export default Preview;
|
|
@@ -30,10 +30,25 @@ export interface StepsProps {
|
|
|
30
30
|
organization: { id: string; [ key: string ]: unknown };
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
//
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
// A step type's label, as the app's enums.step.type options carry it.
|
|
34
|
+
export interface StepLabel {
|
|
35
|
+
key: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 'Team notification — 4 new entries' for a window; the entrant's email for a
|
|
40
|
+
// run, or its first step's label when no entrant is named.
|
|
41
|
+
export declare const groupTitle: ( group: StepGroup, labels?: StepLabel[] ) => string;
|
|
42
|
+
// The step's label from `labels` ( its slug when none ) in a run; 'Email sent' /
|
|
43
|
+
// 'Some emails failed' / … in a window.
|
|
44
|
+
export declare const rowLabel: ( options: { item?: StepRow; kind?: string; labels?: StepLabel[] } ) => string | undefined;
|
|
45
|
+
// A row's badge ('Skipped' in amber, 'Failed' in red, …) and the sentence shown
|
|
46
|
+
// in place of its request and response: the failure, or the reason it was skipped.
|
|
47
|
+
export declare const rowState: ( row: { error?: string | null; message?: string | null; status?: StepStatus } ) => {
|
|
48
|
+
badge: { text: string; type: string };
|
|
49
|
+
error: string | null;
|
|
50
|
+
notice: string | null;
|
|
51
|
+
};
|
|
37
52
|
|
|
38
53
|
declare const Steps: ComponentType<StepsProps>;
|
|
39
54
|
|
|
@@ -12,8 +12,8 @@ export interface TableCellTitleProps {
|
|
|
12
12
|
error?: { icon?: ComponentType<SVGProps<SVGSVGElement>>; message?: string | null } | string | null;
|
|
13
13
|
// Drawn in the thumbnail's place when asset has no image ( a link's social glyph ); an image wins.
|
|
14
14
|
icon?: ComponentType<SVGProps<SVGSVGElement>> | null;
|
|
15
|
-
// A
|
|
16
|
-
//
|
|
15
|
+
// A record's dot when there is no picture, with the words it shows on hover. Table
|
|
16
|
+
// recolours it on a generating ( grey, 'Generating' ) or failed ( red ) row.
|
|
17
17
|
indicator?: { label: string; type: 'active' | 'error' | 'inactive' | 'warning' } | null;
|
|
18
18
|
// The badge beside the title, as statusBadge returns it.
|
|
19
19
|
status?: { text: string; type: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'ai' } | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BrandStyle } from './styles';
|
|
3
|
+
|
|
4
|
+
export interface InputCodeProps {
|
|
5
|
+
autoFocus?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
// How many digits; 6 by default.
|
|
9
|
+
length?: number;
|
|
10
|
+
name?: string;
|
|
11
|
+
// The digits typed so far, never anything but digits.
|
|
12
|
+
onChange?: ( value: string ) => void;
|
|
13
|
+
// Called with the code when its last digit lands.
|
|
14
|
+
onComplete?: ( value: string ) => void;
|
|
15
|
+
style?: BrandStyle;
|
|
16
|
+
value?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare const codeDigits: ( value: unknown, length?: number ) => string;
|
|
20
|
+
|
|
21
|
+
declare const InputCode: ComponentType<InputCodeProps>;
|
|
22
|
+
|
|
23
|
+
export default InputCode;
|
|
@@ -2,6 +2,8 @@ import { ComponentType, ReactNode } from 'react';
|
|
|
2
2
|
import { BrandStyle } from '../styles';
|
|
3
3
|
|
|
4
4
|
export interface InputSwitchProps {
|
|
5
|
+
/** Names a switch with no text beside it. */
|
|
6
|
+
'aria-label'?: string;
|
|
5
7
|
disabled?: boolean;
|
|
6
8
|
helper?: ReactNode;
|
|
7
9
|
onChange?: ( value: boolean ) => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// The campaign fields these helpers read, as GET /organization/:o/campaign/:c returns them.
|
|
2
|
+
export interface CampaignSwitchesRecord {
|
|
3
|
+
awarding?: boolean;
|
|
4
|
+
awardingErrors?: { message?: string }[];
|
|
5
|
+
form?: { enabled?: boolean } | null;
|
|
6
|
+
giveaway?: { enabled?: boolean } | null;
|
|
7
|
+
range?: { id?: string; title?: string } | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type CampaignSwitchKey = 'form' | 'giveaway';
|
|
11
|
+
|
|
12
|
+
export interface CampaignSwitchState {
|
|
13
|
+
form: boolean;
|
|
14
|
+
giveaway: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// The rule between the two switches: giveaway on turns the form on, form off turns the giveaway off.
|
|
18
|
+
export declare const campaignSwitches: ( current: Partial<CampaignSwitchState> | null | undefined, key: CampaignSwitchKey, on: boolean ) => CampaignSwitchState;
|
|
19
|
+
|
|
20
|
+
// The confirmation a flip asks first, and the campaign PUT body it sends.
|
|
21
|
+
export declare const campaignSwitch: ( campaign: CampaignSwitchesRecord | null | undefined, key: CampaignSwitchKey, on: boolean ) => {
|
|
22
|
+
body: Record<string, { enabled: boolean }>;
|
|
23
|
+
message: string;
|
|
24
|
+
title: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// "Form and Giveaway", "Form" or "Off".
|
|
28
|
+
export declare const leadCapture: ( campaign: CampaignSwitchesRecord | null | undefined ) => 'Form and Giveaway' | 'Form' | 'Off';
|
|
29
|
+
|
|
30
|
+
// The CardTask props for the awarding state while the giveaway is on, or null while it is off.
|
|
31
|
+
export declare const awardingCard: ( campaign: CampaignSwitchesRecord | null | undefined, page?: 'giveaway' | 'overview' ) => {
|
|
32
|
+
message: string;
|
|
33
|
+
title: string;
|
|
34
|
+
type: 'success' | 'warning';
|
|
35
|
+
} | null;
|
|
@@ -143,3 +143,6 @@ export declare const alertFor: ( record: { capped?: boolean; error?: string | nu
|
|
|
143
143
|
export declare const stripeUrl: ( label: string, id: string, ...more: string[] ) => string;
|
|
144
144
|
|
|
145
145
|
export declare const years: ( props: { current: number | string; length?: number } ) => Array<{ key: number; value: number }>;
|
|
146
|
+
|
|
147
|
+
// An image's alt text: this placement's description, else the file's name.
|
|
148
|
+
export declare const imageAlt: ( file?: { filename?: string } | null, description?: string | null ) => string;
|