@drawbridge/components 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bridge/form-subdomain-missions.js +54 -47
- package/dist/bridge/form-subdomain-missions.mjs +54 -47
- package/dist/bridge/template-layout.js +1 -1
- package/dist/bridge/template-layout.mjs +1 -1
- package/dist/bridge/template-modal.js +1 -1
- package/dist/bridge/template-modal.mjs +1 -1
- package/dist/dashboard/form-organization-campaign-agreement.js +2 -2
- package/dist/dashboard/form-organization-campaign-agreement.mjs +2 -2
- package/dist/dashboard/form-organization-workflow.js +548 -54
- package/dist/dashboard/form-organization-workflow.mjs +539 -54
- package/dist/dashboard/form-otc.js +7 -4
- package/dist/dashboard/form-otc.mjs +8 -5
- package/dist/dashboard/input-editor.js +56 -12
- package/dist/dashboard/input-editor.mjs +53 -11
- package/dist/dashboard/order-sections.js +23 -12
- package/dist/dashboard/order-sections.mjs +23 -12
- package/dist/dashboard/steps.js +5 -0
- package/dist/dashboard/steps.mjs +5 -0
- package/dist/dashboard/template-socket.js +6 -0
- package/dist/dashboard/template-socket.mjs +6 -0
- package/dist/input-code.js +2 -8
- package/dist/input-code.mjs +2 -8
- package/package.json +3 -3
- package/types/bridge/form-subdomain-missions.d.ts +1 -1
- package/types/dashboard/form-organization-workflow.d.ts +44 -0
- package/types/dashboard/input-editor.d.ts +9 -1
- package/types/dashboard/steps.d.ts +2 -0
- package/types/input-code.d.ts +0 -2
|
@@ -9,6 +9,9 @@ export interface FormOrganizationWorkflowStep {
|
|
|
9
9
|
enabled?: boolean;
|
|
10
10
|
settings?: {
|
|
11
11
|
discount?: { id: string; title?: string; [ key: string ]: unknown } | null;
|
|
12
|
+
// Auto response's two parts ( step.response.send ).
|
|
13
|
+
email?: { enabled: boolean; message?: string; score?: Record<string, unknown> | null; subject?: string; text?: string };
|
|
14
|
+
sms?: { enabled: boolean; message?: string };
|
|
12
15
|
// Member ids; the owner is always a recipient and is never stored.
|
|
13
16
|
members?: string[];
|
|
14
17
|
message?: string;
|
|
@@ -24,6 +27,27 @@ export interface FormOrganizationWorkflowStep {
|
|
|
24
27
|
type?: string;
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
// Auto response's two parts, as a row holds them.
|
|
31
|
+
export interface ResponseSettings {
|
|
32
|
+
email: { enabled: boolean; message: string; score: Record<string, unknown> | null; subject: string; text: string };
|
|
33
|
+
sms: { enabled: boolean; message: string };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// What the trigger page's read carries for the Auto response card, on When a lead enters.
|
|
37
|
+
export interface AutoResponseFacts {
|
|
38
|
+
fields: { email: boolean; phone: boolean };
|
|
39
|
+
number: null | 'pending' | 'verifying' | 'verified' | 'error';
|
|
40
|
+
placeholders: null | { missions?: string; order?: string };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// What one part can do on this campaign, and the card under its switch.
|
|
44
|
+
export interface ResponsePart {
|
|
45
|
+
can: boolean;
|
|
46
|
+
hidden: boolean;
|
|
47
|
+
on: boolean;
|
|
48
|
+
task: { button?: { href: string; text: string }; message: string; type?: 'warning' | 'error' } | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
27
51
|
// The row shape the editor seeds each step with.
|
|
28
52
|
export interface FormOrganizationWorkflowRow {
|
|
29
53
|
confirmation: boolean;
|
|
@@ -33,6 +57,8 @@ export interface FormOrganizationWorkflowRow {
|
|
|
33
57
|
members: Record<string, unknown>[];
|
|
34
58
|
message: string;
|
|
35
59
|
score: Record<string, unknown> | null;
|
|
60
|
+
// Auto response's parts; null on every other row.
|
|
61
|
+
settings: ResponseSettings | null;
|
|
36
62
|
slug: string;
|
|
37
63
|
subject: string;
|
|
38
64
|
text: string;
|
|
@@ -73,6 +99,7 @@ export interface FormOrganizationWorkflowEditProps extends Callbacks {
|
|
|
73
99
|
// The trigger page read's `catalog`: the steps this trigger offers.
|
|
74
100
|
catalog?: WorkflowCatalogEntry | null;
|
|
75
101
|
values: {
|
|
102
|
+
autoResponse?: AutoResponseFacts;
|
|
76
103
|
campaign: string;
|
|
77
104
|
// Sync's run-time issue, shown on the first step of `step`'s type.
|
|
78
105
|
issue?: { message?: string; step?: string } | null;
|
|
@@ -109,6 +136,23 @@ export declare const prefillRow: ( options: { entry?: WorkflowCatalogEntry | nul
|
|
|
109
136
|
// from the catalog entry or the saved steps; null when the step can run.
|
|
110
137
|
export declare const stepReason: ( options: { entry?: WorkflowCatalogEntry | null; saved?: Array<{ reason?: string; type?: string; [ key: string ]: unknown }>; type?: string } ) => string | null;
|
|
111
138
|
|
|
139
|
+
// The stored type of Auto response.
|
|
140
|
+
export declare const RESPONSE: 'step.response.send';
|
|
141
|
+
// Auto response's settings as on a new campaign: `number` is the number's status.
|
|
142
|
+
export declare const responseStart: ( number?: AutoResponseFacts[ 'number' ] ) => ResponseSettings;
|
|
143
|
+
// What each part can do on this campaign, and whether any can.
|
|
144
|
+
export declare const responseParts: ( options: { autoResponse?: AutoResponseFacts; campaign: string; organization: string; settings?: ResponseSettings | null } ) => { can: boolean; email: ResponsePart; sms: ResponsePart };
|
|
145
|
+
// What the save sends for an Auto response: both parts whole.
|
|
146
|
+
export declare const responseSave: ( settings: ResponseSettings ) => FormOrganizationWorkflowStep[ 'settings' ];
|
|
147
|
+
// The plain text as editor html, a bracketed line as the variable chip.
|
|
148
|
+
export declare const plainHtml: ( text?: string ) => string;
|
|
149
|
+
// The step's own switch after a part's switch moves.
|
|
150
|
+
export declare const stepAfterPart: ( args: { enabled?: boolean; next: boolean; other?: boolean } ) => boolean;
|
|
151
|
+
// The part the step's own switch turns on, or null when a part already sends.
|
|
152
|
+
export declare const partToStart: ( parts: ReturnType<typeof responseParts> ) => 'email' | 'sms' | null;
|
|
153
|
+
// The row a run-time issue sits under, or -1.
|
|
154
|
+
export declare const issueRow: ( args: { issue?: { step?: string } | null; steps?: Array<{ type?: string }> } ) => number;
|
|
155
|
+
|
|
112
156
|
// The sample lead every step preview draws from.
|
|
113
157
|
export declare const SAMPLE: { email: string; name: string; order: string; phone: string };
|
|
114
158
|
// The JSON a Send webhook posts, for the sample lead.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import { Node } from '@tiptap/core';
|
|
3
3
|
|
|
4
4
|
export interface InputEditorVariable {
|
|
@@ -9,6 +9,11 @@ export interface InputEditorVariable {
|
|
|
9
9
|
|
|
10
10
|
export interface InputEditorProps {
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
// Sits under what is typed, outside the document, so it cannot be removed.
|
|
13
|
+
locked?: ReactNode;
|
|
14
|
+
// No formatting tools, only the Variables menu while there is something to
|
|
15
|
+
// insert; `value` and the emitted `text` are plain text, a variable as {{key}}.
|
|
16
|
+
plain?: boolean;
|
|
12
17
|
// Both renderings; pass `html` to a react-hook-form field, not the object.
|
|
13
18
|
onChange?: ( value: { html: string; text: string } ) => void;
|
|
14
19
|
// HTML.
|
|
@@ -25,6 +30,9 @@ export declare const Variable: Node;
|
|
|
25
30
|
// The text serializer that keeps a link's address in the plain rendering.
|
|
26
31
|
export declare const linkText: ( props: { node: any; parent: any; index: number } ) => string;
|
|
27
32
|
|
|
33
|
+
export declare const plainLine: ( line: string, variables?: { key: string; label?: string }[] ) => string;
|
|
34
|
+
export declare const plainContent: ( value?: string, variables?: { key: string; label?: string }[] ) => string;
|
|
35
|
+
|
|
28
36
|
export declare const EditorView: ComponentType<EditorViewProps>;
|
|
29
37
|
|
|
30
38
|
declare const InputEditor: ComponentType<InputEditorProps>;
|
|
@@ -5,6 +5,8 @@ export type StepStatus = 'cancelled' | 'failed' | 'partial' | 'processing' | 'sk
|
|
|
5
5
|
export interface StepRow {
|
|
6
6
|
error?: string | null;
|
|
7
7
|
message?: string | null;
|
|
8
|
+
// An Auto response's part: its row names the part.
|
|
9
|
+
part?: 'email' | 'sms' | null;
|
|
8
10
|
request?: unknown;
|
|
9
11
|
response?: unknown;
|
|
10
12
|
slug?: string;
|
package/types/input-code.d.ts
CHANGED
|
@@ -10,8 +10,6 @@ export interface InputCodeProps {
|
|
|
10
10
|
name?: string;
|
|
11
11
|
// The digits typed so far, never anything but digits.
|
|
12
12
|
onChange?: ( value: string ) => void;
|
|
13
|
-
// Called with the code when its last digit lands.
|
|
14
|
-
onComplete?: ( value: string ) => void;
|
|
15
13
|
style?: BrandStyle;
|
|
16
14
|
value?: string;
|
|
17
15
|
}
|