@landform.io/sdk 0.1.2
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/api/index.cjs +17 -0
- package/dist/api/index.cjs.map +1 -0
- package/dist/api/index.d.cts +48 -0
- package/dist/api/index.d.ts +48 -0
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -0
- package/dist/chunk-52W6RI6C.cjs +4 -0
- package/dist/chunk-52W6RI6C.cjs.map +1 -0
- package/dist/chunk-DASQI7IA.cjs +4 -0
- package/dist/chunk-DASQI7IA.cjs.map +1 -0
- package/dist/chunk-EL7YGOTY.js +3 -0
- package/dist/chunk-EL7YGOTY.js.map +1 -0
- package/dist/chunk-GVOTY5NG.js +3 -0
- package/dist/chunk-GVOTY5NG.js.map +1 -0
- package/dist/chunk-HUIMGLDC.js +488 -0
- package/dist/chunk-HUIMGLDC.js.map +1 -0
- package/dist/chunk-I6L5OCM3.js +1657 -0
- package/dist/chunk-I6L5OCM3.js.map +1 -0
- package/dist/chunk-IQXKFO6Q.cjs +55 -0
- package/dist/chunk-IQXKFO6Q.cjs.map +1 -0
- package/dist/chunk-P2GUKJHH.cjs +117 -0
- package/dist/chunk-P2GUKJHH.cjs.map +1 -0
- package/dist/chunk-PDUJU32P.js +687 -0
- package/dist/chunk-PDUJU32P.js.map +1 -0
- package/dist/chunk-PKHTPGWQ.js +114 -0
- package/dist/chunk-PKHTPGWQ.js.map +1 -0
- package/dist/chunk-V7WAYO2Q.js +48 -0
- package/dist/chunk-V7WAYO2Q.js.map +1 -0
- package/dist/chunk-WHV333XL.cjs +1684 -0
- package/dist/chunk-WHV333XL.cjs.map +1 -0
- package/dist/chunk-WIFNU3FA.cjs +497 -0
- package/dist/chunk-WIFNU3FA.cjs.map +1 -0
- package/dist/chunk-ZLOP4BTK.cjs +695 -0
- package/dist/chunk-ZLOP4BTK.cjs.map +1 -0
- package/dist/components/index.cjs +99 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +166 -0
- package/dist/components/index.d.ts +166 -0
- package/dist/components/index.js +6 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.cjs +35 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +75 -0
- package/dist/hooks/index.d.ts +75 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index-DoRZImTl.d.cts +590 -0
- package/dist/index-DoRZImTl.d.ts +590 -0
- package/dist/index.cjs +186 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/theme/index.cjs +61 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +65 -0
- package/dist/theme/index.d.ts +65 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/useForm-D1mB6REv.d.ts +48 -0
- package/dist/useForm-kF8xK1mJ.d.cts +48 -0
- package/package.json +101 -0
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
interface FormContent {
|
|
2
|
+
schemaVersion: number;
|
|
3
|
+
welcomeScreens: WelcomeScreen[];
|
|
4
|
+
fields: FormField[];
|
|
5
|
+
thankYouScreens: ThankYouScreen[];
|
|
6
|
+
branching: FieldBranching[];
|
|
7
|
+
logic: LogicRule[];
|
|
8
|
+
variables: FormVariables;
|
|
9
|
+
hiddenFields: HiddenField[];
|
|
10
|
+
}
|
|
11
|
+
interface WelcomeScreen {
|
|
12
|
+
ref: string;
|
|
13
|
+
title: string;
|
|
14
|
+
properties: {
|
|
15
|
+
description?: string;
|
|
16
|
+
buttonText?: string;
|
|
17
|
+
showButton: boolean;
|
|
18
|
+
};
|
|
19
|
+
attachment?: Attachment;
|
|
20
|
+
layout?: Layout;
|
|
21
|
+
position?: Position;
|
|
22
|
+
}
|
|
23
|
+
interface ThankYouScreen {
|
|
24
|
+
ref: string;
|
|
25
|
+
title: string;
|
|
26
|
+
properties: {
|
|
27
|
+
description?: string;
|
|
28
|
+
showButton?: boolean;
|
|
29
|
+
buttonText?: string;
|
|
30
|
+
buttonMode?: "reload" | "redirect" | "default";
|
|
31
|
+
redirectUrl?: string;
|
|
32
|
+
shareIcons?: boolean;
|
|
33
|
+
};
|
|
34
|
+
attachment?: Attachment;
|
|
35
|
+
layout?: Layout;
|
|
36
|
+
position?: Position;
|
|
37
|
+
}
|
|
38
|
+
type FieldType = "short_text" | "long_text" | "email" | "phone_number" | "number" | "date" | "dropdown" | "multiple_choice" | "picture_choice" | "ranking" | "rating" | "opinion_scale" | "yes_no" | "legal" | "file_upload" | "payment" | "contact_info" | "group" | "matrix" | "statement" | "website" | "nps" | "address" | "slider" | "signature";
|
|
39
|
+
interface FormFieldBase {
|
|
40
|
+
ref: string;
|
|
41
|
+
type: FieldType;
|
|
42
|
+
title: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
validations: FieldValidations;
|
|
45
|
+
attachment?: Attachment;
|
|
46
|
+
layout?: Layout;
|
|
47
|
+
position?: Position;
|
|
48
|
+
}
|
|
49
|
+
interface FieldValidations {
|
|
50
|
+
required?: boolean;
|
|
51
|
+
maxLength?: number;
|
|
52
|
+
minLength?: number;
|
|
53
|
+
minValue?: number;
|
|
54
|
+
maxValue?: number;
|
|
55
|
+
minSelection?: number;
|
|
56
|
+
maxSelection?: number;
|
|
57
|
+
}
|
|
58
|
+
interface Choice {
|
|
59
|
+
ref: string;
|
|
60
|
+
label: string;
|
|
61
|
+
attachment?: Attachment;
|
|
62
|
+
}
|
|
63
|
+
interface ChoiceFieldProperties {
|
|
64
|
+
choices: Choice[];
|
|
65
|
+
allowMultipleSelection?: boolean;
|
|
66
|
+
allowOtherChoice?: boolean;
|
|
67
|
+
randomize?: boolean;
|
|
68
|
+
verticalAlignment?: boolean;
|
|
69
|
+
showLabels?: boolean;
|
|
70
|
+
supersized?: boolean;
|
|
71
|
+
}
|
|
72
|
+
interface MultipleChoiceField extends FormFieldBase {
|
|
73
|
+
type: "multiple_choice";
|
|
74
|
+
properties: ChoiceFieldProperties;
|
|
75
|
+
}
|
|
76
|
+
interface PictureChoiceField extends FormFieldBase {
|
|
77
|
+
type: "picture_choice";
|
|
78
|
+
properties: ChoiceFieldProperties;
|
|
79
|
+
}
|
|
80
|
+
interface DropdownField extends FormFieldBase {
|
|
81
|
+
type: "dropdown";
|
|
82
|
+
properties: {
|
|
83
|
+
choices: Choice[];
|
|
84
|
+
alphabeticalOrder?: boolean;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
interface RankingField extends FormFieldBase {
|
|
88
|
+
type: "ranking";
|
|
89
|
+
properties: {
|
|
90
|
+
choices: Choice[];
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
interface RatingField extends FormFieldBase {
|
|
94
|
+
type: "rating";
|
|
95
|
+
properties: {
|
|
96
|
+
steps: number;
|
|
97
|
+
shape: "star" | "heart" | "thumbsup" | "trophy" | "crown";
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
interface OpinionScaleField extends FormFieldBase {
|
|
101
|
+
type: "opinion_scale";
|
|
102
|
+
properties: {
|
|
103
|
+
steps: number;
|
|
104
|
+
startAtOne: boolean;
|
|
105
|
+
labels: {
|
|
106
|
+
left?: string;
|
|
107
|
+
center?: string;
|
|
108
|
+
right?: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
interface NPSField extends FormFieldBase {
|
|
113
|
+
type: "nps";
|
|
114
|
+
properties: {
|
|
115
|
+
labels: {
|
|
116
|
+
left?: string;
|
|
117
|
+
right?: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
interface ShortTextField extends FormFieldBase {
|
|
122
|
+
type: "short_text";
|
|
123
|
+
properties: {
|
|
124
|
+
placeholder?: string;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
interface LongTextField extends FormFieldBase {
|
|
128
|
+
type: "long_text";
|
|
129
|
+
properties: {
|
|
130
|
+
placeholder?: string;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
interface EmailField extends FormFieldBase {
|
|
134
|
+
type: "email";
|
|
135
|
+
properties: {
|
|
136
|
+
placeholder?: string;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
interface PhoneNumberField extends FormFieldBase {
|
|
140
|
+
type: "phone_number";
|
|
141
|
+
properties: {
|
|
142
|
+
defaultCountryCode?: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
interface WebsiteField extends FormFieldBase {
|
|
146
|
+
type: "website";
|
|
147
|
+
properties: {
|
|
148
|
+
placeholder?: string;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
interface NumberField extends FormFieldBase {
|
|
152
|
+
type: "number";
|
|
153
|
+
properties: {
|
|
154
|
+
placeholder?: string;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
interface DateField extends FormFieldBase {
|
|
158
|
+
type: "date";
|
|
159
|
+
properties: {
|
|
160
|
+
structure: "DDMMYYYY" | "MMDDYYYY" | "YYYYMMDD";
|
|
161
|
+
separator: "/" | "-" | ".";
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
interface YesNoField extends FormFieldBase {
|
|
165
|
+
type: "yes_no";
|
|
166
|
+
properties: Record<string, never>;
|
|
167
|
+
}
|
|
168
|
+
interface LegalField extends FormFieldBase {
|
|
169
|
+
type: "legal";
|
|
170
|
+
properties: {
|
|
171
|
+
description: string;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
interface StatementField extends FormFieldBase {
|
|
175
|
+
type: "statement";
|
|
176
|
+
properties: {
|
|
177
|
+
buttonText: string;
|
|
178
|
+
hideMarks?: boolean;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
interface FileUploadField extends FormFieldBase {
|
|
182
|
+
type: "file_upload";
|
|
183
|
+
properties: {
|
|
184
|
+
allowedFileTypes?: string[];
|
|
185
|
+
maxFileSizeMB?: number;
|
|
186
|
+
maxFiles?: number;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
interface ContactInfoField extends FormFieldBase {
|
|
190
|
+
type: "contact_info";
|
|
191
|
+
properties: {
|
|
192
|
+
subfields: {
|
|
193
|
+
firstName: boolean;
|
|
194
|
+
lastName: boolean;
|
|
195
|
+
email: boolean;
|
|
196
|
+
phoneNumber: boolean;
|
|
197
|
+
company: boolean;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
interface PaymentField extends FormFieldBase {
|
|
202
|
+
type: "payment";
|
|
203
|
+
properties: {
|
|
204
|
+
currency: "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "BRL" | "CHF" | "DKK" | "MXN" | "NOK" | "SEK";
|
|
205
|
+
price: {
|
|
206
|
+
type: "fixed" | "variable";
|
|
207
|
+
value?: number;
|
|
208
|
+
variableRef?: string;
|
|
209
|
+
};
|
|
210
|
+
buttonText?: string;
|
|
211
|
+
emailReceipts?: boolean;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
interface GroupField extends FormFieldBase {
|
|
215
|
+
type: "group";
|
|
216
|
+
properties: {
|
|
217
|
+
fields: FormField[];
|
|
218
|
+
buttonText?: string;
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
interface MatrixField extends FormFieldBase {
|
|
222
|
+
type: "matrix";
|
|
223
|
+
properties: {
|
|
224
|
+
rows: {
|
|
225
|
+
ref: string;
|
|
226
|
+
label: string;
|
|
227
|
+
}[];
|
|
228
|
+
columns: {
|
|
229
|
+
ref: string;
|
|
230
|
+
label: string;
|
|
231
|
+
}[];
|
|
232
|
+
allowMultiplePerRow?: boolean;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
interface AddressField extends FormFieldBase {
|
|
236
|
+
type: "address";
|
|
237
|
+
properties: {
|
|
238
|
+
placeholder?: string;
|
|
239
|
+
showSecondLine?: boolean;
|
|
240
|
+
showCountry?: boolean;
|
|
241
|
+
defaultCountry?: string;
|
|
242
|
+
autocomplete?: boolean;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
interface SliderField extends FormFieldBase {
|
|
246
|
+
type: "slider";
|
|
247
|
+
properties: {
|
|
248
|
+
min: number;
|
|
249
|
+
max: number;
|
|
250
|
+
step: number;
|
|
251
|
+
defaultValue?: number;
|
|
252
|
+
showValue?: boolean;
|
|
253
|
+
showMinMaxLabels?: boolean;
|
|
254
|
+
unit?: string;
|
|
255
|
+
unitPosition?: "prefix" | "suffix";
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
interface SignatureField extends FormFieldBase {
|
|
259
|
+
type: "signature";
|
|
260
|
+
properties: {
|
|
261
|
+
width?: number;
|
|
262
|
+
height?: number;
|
|
263
|
+
strokeColor?: string;
|
|
264
|
+
strokeWidth?: number;
|
|
265
|
+
backgroundColor?: string;
|
|
266
|
+
showClearButton?: boolean;
|
|
267
|
+
showTypedSignature?: boolean;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
type FormField = ShortTextField | LongTextField | EmailField | PhoneNumberField | NumberField | DateField | DropdownField | MultipleChoiceField | PictureChoiceField | RankingField | RatingField | OpinionScaleField | NPSField | YesNoField | LegalField | StatementField | FileUploadField | ContactInfoField | PaymentField | GroupField | MatrixField | WebsiteField | AddressField | SliderField | SignatureField;
|
|
271
|
+
interface SubPage {
|
|
272
|
+
id: string;
|
|
273
|
+
triggerChoiceRefs: string[];
|
|
274
|
+
field: FormField;
|
|
275
|
+
}
|
|
276
|
+
interface FieldBranching {
|
|
277
|
+
fieldRef: string;
|
|
278
|
+
subPages: SubPage[];
|
|
279
|
+
}
|
|
280
|
+
interface LogicRule {
|
|
281
|
+
ref: string;
|
|
282
|
+
type: "field" | "hidden";
|
|
283
|
+
actions: LogicAction[];
|
|
284
|
+
}
|
|
285
|
+
interface LogicAction {
|
|
286
|
+
action: "jump" | "add" | "subtract" | "multiply" | "divide" | "set";
|
|
287
|
+
condition: LogicCondition;
|
|
288
|
+
details: LogicActionDetails;
|
|
289
|
+
}
|
|
290
|
+
interface LogicCondition {
|
|
291
|
+
op: ConditionOperator;
|
|
292
|
+
vars: LogicVariable[];
|
|
293
|
+
}
|
|
294
|
+
type ConditionOperator = "always" | "equal" | "not_equal" | "lower_than" | "lower_equal_than" | "greater_than" | "greater_equal_than" | "is" | "is_not" | "begins_with" | "ends_with" | "contains" | "not_contains" | "earlier_than" | "later_than" | "earlier_than_or_on" | "later_than_or_on" | "and" | "or";
|
|
295
|
+
interface LogicVariable {
|
|
296
|
+
type: "field" | "hidden" | "variable" | "constant" | "choice" | "end";
|
|
297
|
+
value: string | number | boolean;
|
|
298
|
+
}
|
|
299
|
+
interface LogicActionDetails {
|
|
300
|
+
to?: {
|
|
301
|
+
type: "field" | "thankyou" | "outcome";
|
|
302
|
+
value: string;
|
|
303
|
+
};
|
|
304
|
+
target?: {
|
|
305
|
+
type: "variable";
|
|
306
|
+
value: string;
|
|
307
|
+
};
|
|
308
|
+
value?: {
|
|
309
|
+
type: "constant" | "variable" | "field";
|
|
310
|
+
value: string | number;
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
interface FormVariables {
|
|
314
|
+
score?: number;
|
|
315
|
+
price?: number;
|
|
316
|
+
custom?: Record<string, {
|
|
317
|
+
type: "number" | "string";
|
|
318
|
+
defaultValue: number | string;
|
|
319
|
+
}>;
|
|
320
|
+
}
|
|
321
|
+
interface HiddenField {
|
|
322
|
+
ref: string;
|
|
323
|
+
type: "hidden";
|
|
324
|
+
defaultValue?: string;
|
|
325
|
+
}
|
|
326
|
+
interface Attachment {
|
|
327
|
+
type: "image" | "video";
|
|
328
|
+
href: string;
|
|
329
|
+
scale?: number;
|
|
330
|
+
properties?: {
|
|
331
|
+
description?: string;
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
interface Layout {
|
|
335
|
+
type: "split" | "wallpaper" | "float" | "stack";
|
|
336
|
+
placement?: "left" | "right";
|
|
337
|
+
viewportOverrides?: {
|
|
338
|
+
small?: Layout;
|
|
339
|
+
large?: Layout;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
interface Position {
|
|
343
|
+
x: number;
|
|
344
|
+
y: number;
|
|
345
|
+
}
|
|
346
|
+
interface FontConfig {
|
|
347
|
+
family: string;
|
|
348
|
+
size: string;
|
|
349
|
+
weight: string;
|
|
350
|
+
lineHeight: string;
|
|
351
|
+
letterSpacing?: string;
|
|
352
|
+
}
|
|
353
|
+
interface ThemeColors {
|
|
354
|
+
primary: string;
|
|
355
|
+
secondary: string;
|
|
356
|
+
accent: string;
|
|
357
|
+
background: string;
|
|
358
|
+
surfaceBackground: string;
|
|
359
|
+
inputBackground: string;
|
|
360
|
+
inputBorder: string;
|
|
361
|
+
questionText: string;
|
|
362
|
+
answerText: string;
|
|
363
|
+
placeholderText: string;
|
|
364
|
+
buttonBackground: string;
|
|
365
|
+
buttonText: string;
|
|
366
|
+
buttonHoverBackground: string;
|
|
367
|
+
selectedBackground: string;
|
|
368
|
+
selectedBorder: string;
|
|
369
|
+
errorColor: string;
|
|
370
|
+
successColor: string;
|
|
371
|
+
progressBackground: string;
|
|
372
|
+
progressFill: string;
|
|
373
|
+
}
|
|
374
|
+
interface ThemeTypography {
|
|
375
|
+
questionFont: FontConfig;
|
|
376
|
+
answerFont: FontConfig;
|
|
377
|
+
buttonFont: FontConfig;
|
|
378
|
+
}
|
|
379
|
+
interface ThemeSpacing {
|
|
380
|
+
questionGap: string;
|
|
381
|
+
optionGap: string;
|
|
382
|
+
containerPadding: string;
|
|
383
|
+
}
|
|
384
|
+
interface ThemeBorders {
|
|
385
|
+
inputBorderWidth: string;
|
|
386
|
+
inputBorderStyle: "solid" | "dashed" | "none";
|
|
387
|
+
radius: "none" | "small" | "medium" | "large" | "full";
|
|
388
|
+
}
|
|
389
|
+
interface ThemeAnimations {
|
|
390
|
+
transitionDuration: string;
|
|
391
|
+
transitionEasing: string;
|
|
392
|
+
enableAnimations: boolean;
|
|
393
|
+
}
|
|
394
|
+
interface ThemeBackground {
|
|
395
|
+
type: "solid" | "gradient" | "image" | "video";
|
|
396
|
+
value: string;
|
|
397
|
+
overlay?: string;
|
|
398
|
+
position?: string;
|
|
399
|
+
}
|
|
400
|
+
interface ThemeProgressBar {
|
|
401
|
+
enabled: boolean;
|
|
402
|
+
style: "bar" | "segmented" | "dots" | "percentage";
|
|
403
|
+
position: "top" | "bottom";
|
|
404
|
+
}
|
|
405
|
+
interface ThemeBranding {
|
|
406
|
+
showPoweredBy: boolean;
|
|
407
|
+
brandName?: string;
|
|
408
|
+
logoUrl?: string;
|
|
409
|
+
logoPosition?: "top-left" | "top-right" | "bottom";
|
|
410
|
+
faviconUrl?: string;
|
|
411
|
+
}
|
|
412
|
+
interface ThemeCustomJS {
|
|
413
|
+
enabled: boolean;
|
|
414
|
+
code: string;
|
|
415
|
+
executeOn: ("load" | "submit" | "navigation" | "fieldChange")[];
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Component style variants for templates
|
|
419
|
+
* These control the visual structure/layout of form components
|
|
420
|
+
*/
|
|
421
|
+
interface ThemeComponentVariants {
|
|
422
|
+
/** Choice/option rendering style */
|
|
423
|
+
choiceStyle?: "default" | "card" | "minimal";
|
|
424
|
+
/** Navigation layout style */
|
|
425
|
+
navigationLayout?: "floating" | "bottom-bar" | "inline";
|
|
426
|
+
/** Header layout style */
|
|
427
|
+
headerLayout?: "none" | "centered-logo" | "left-logo";
|
|
428
|
+
/** Progress style override */
|
|
429
|
+
progressStyle?: "bar" | "dots" | "segments" | "percentage" | "fraction";
|
|
430
|
+
/** Choice layout - single column or grid */
|
|
431
|
+
choiceLayout?: "single-column" | "two-column" | "auto-grid";
|
|
432
|
+
/** Choice indicator icon type */
|
|
433
|
+
choiceIndicator?: "checkmark" | "arrow" | "radio" | "none";
|
|
434
|
+
/** Navigation visibility control */
|
|
435
|
+
navigationVisibility?: "always" | "hidden" | "auto-advance";
|
|
436
|
+
/** Main container max width (e.g., "600px") */
|
|
437
|
+
containerMaxWidth?: string;
|
|
438
|
+
/** Choice container max width (e.g., "375px") */
|
|
439
|
+
choiceContainerMaxWidth?: string;
|
|
440
|
+
}
|
|
441
|
+
interface FormTheme {
|
|
442
|
+
id?: string;
|
|
443
|
+
name?: string;
|
|
444
|
+
description?: string;
|
|
445
|
+
author?: string;
|
|
446
|
+
version?: string;
|
|
447
|
+
isPublic?: boolean;
|
|
448
|
+
colors: ThemeColors;
|
|
449
|
+
typography: ThemeTypography;
|
|
450
|
+
spacing: ThemeSpacing;
|
|
451
|
+
borders: ThemeBorders;
|
|
452
|
+
animations: ThemeAnimations;
|
|
453
|
+
background: ThemeBackground;
|
|
454
|
+
progressBar: ThemeProgressBar;
|
|
455
|
+
branding: ThemeBranding;
|
|
456
|
+
customCSS?: string;
|
|
457
|
+
customJS?: ThemeCustomJS;
|
|
458
|
+
componentVariants?: ThemeComponentVariants;
|
|
459
|
+
}
|
|
460
|
+
interface FormSettings {
|
|
461
|
+
isPublic: boolean;
|
|
462
|
+
showProgressBar: boolean;
|
|
463
|
+
showTimeToComplete: boolean;
|
|
464
|
+
showQuestionNumber: boolean;
|
|
465
|
+
showKeyHintOnChoices: boolean;
|
|
466
|
+
hideNavigation: boolean;
|
|
467
|
+
autosaveProgress: boolean;
|
|
468
|
+
language: string;
|
|
469
|
+
systemMessages?: {
|
|
470
|
+
confirmButtonText?: string;
|
|
471
|
+
pressEnterText?: string;
|
|
472
|
+
multipleSelectionHint?: string;
|
|
473
|
+
dropdownInstruction?: string;
|
|
474
|
+
dropdownInstructionTouch?: string;
|
|
475
|
+
requiredText?: string;
|
|
476
|
+
};
|
|
477
|
+
showCookieConsent: boolean;
|
|
478
|
+
captchaEnabled: boolean;
|
|
479
|
+
duplicatePrevention?: "cookie" | "cookie_ip";
|
|
480
|
+
googleAnalyticsId?: string;
|
|
481
|
+
facebookPixelId?: string;
|
|
482
|
+
googleTagManagerId?: string;
|
|
483
|
+
meta: {
|
|
484
|
+
title?: string;
|
|
485
|
+
description?: string;
|
|
486
|
+
imageUrl?: string;
|
|
487
|
+
allowIndexing: boolean;
|
|
488
|
+
};
|
|
489
|
+
redirectAfterSubmitUrl?: string;
|
|
490
|
+
emailNotifications: {
|
|
491
|
+
enabled: boolean;
|
|
492
|
+
recipients: string[];
|
|
493
|
+
includeAnswers: boolean;
|
|
494
|
+
};
|
|
495
|
+
scheduling?: {
|
|
496
|
+
startsAt?: string;
|
|
497
|
+
endsAt?: string;
|
|
498
|
+
closedMessage?: string;
|
|
499
|
+
};
|
|
500
|
+
responseLimit?: {
|
|
501
|
+
max: number;
|
|
502
|
+
limitReachedMessage?: string;
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
type ResponseAnswers = Record<string, FieldAnswer>;
|
|
506
|
+
type FieldAnswer = string | number | boolean | string[] | Record<string, boolean> | AddressValue | SignatureValue | ContactInfoAnswer | FileUploadAnswer;
|
|
507
|
+
interface AddressValue {
|
|
508
|
+
line1?: string;
|
|
509
|
+
line2?: string;
|
|
510
|
+
city?: string;
|
|
511
|
+
state?: string;
|
|
512
|
+
postalCode?: string;
|
|
513
|
+
country?: string;
|
|
514
|
+
}
|
|
515
|
+
interface SignatureValue {
|
|
516
|
+
type: "drawn" | "typed";
|
|
517
|
+
data: string;
|
|
518
|
+
}
|
|
519
|
+
interface ContactInfoAnswer {
|
|
520
|
+
firstName?: string;
|
|
521
|
+
lastName?: string;
|
|
522
|
+
email?: string;
|
|
523
|
+
phoneNumber?: string;
|
|
524
|
+
company?: string;
|
|
525
|
+
}
|
|
526
|
+
interface FileUploadAnswer {
|
|
527
|
+
files: {
|
|
528
|
+
id: string;
|
|
529
|
+
filename: string;
|
|
530
|
+
url: string;
|
|
531
|
+
size: number;
|
|
532
|
+
mimeType: string;
|
|
533
|
+
}[];
|
|
534
|
+
}
|
|
535
|
+
interface ResponseOutcome {
|
|
536
|
+
screenRef: string;
|
|
537
|
+
label?: string;
|
|
538
|
+
score?: number;
|
|
539
|
+
variables: Record<string, number | string>;
|
|
540
|
+
}
|
|
541
|
+
interface ResponseMetadata {
|
|
542
|
+
userAgent?: string;
|
|
543
|
+
ipAddress?: string;
|
|
544
|
+
referrer?: string;
|
|
545
|
+
utmSource?: string;
|
|
546
|
+
utmMedium?: string;
|
|
547
|
+
utmCampaign?: string;
|
|
548
|
+
utmTerm?: string;
|
|
549
|
+
utmContent?: string;
|
|
550
|
+
deviceType?: "desktop" | "mobile" | "tablet";
|
|
551
|
+
browser?: string;
|
|
552
|
+
os?: string;
|
|
553
|
+
country?: string;
|
|
554
|
+
city?: string;
|
|
555
|
+
}
|
|
556
|
+
interface FormData {
|
|
557
|
+
projectId: string;
|
|
558
|
+
content: FormContent;
|
|
559
|
+
theme: FormTheme;
|
|
560
|
+
settings: FormSettings;
|
|
561
|
+
}
|
|
562
|
+
interface FormState {
|
|
563
|
+
responseId: string | null;
|
|
564
|
+
sessionId: string;
|
|
565
|
+
currentIndex: number;
|
|
566
|
+
answers: ResponseAnswers;
|
|
567
|
+
isStarted: boolean;
|
|
568
|
+
isCompleted: boolean;
|
|
569
|
+
isSubmitting: boolean;
|
|
570
|
+
errors: Record<string, string>;
|
|
571
|
+
}
|
|
572
|
+
interface FieldState {
|
|
573
|
+
value: FieldAnswer | undefined;
|
|
574
|
+
error: string | null;
|
|
575
|
+
touched: boolean;
|
|
576
|
+
isValid: boolean;
|
|
577
|
+
}
|
|
578
|
+
type ScreenItem = {
|
|
579
|
+
type: "welcome";
|
|
580
|
+
screen: WelcomeScreen;
|
|
581
|
+
} | {
|
|
582
|
+
type: "field";
|
|
583
|
+
field: FormField;
|
|
584
|
+
index: number;
|
|
585
|
+
} | {
|
|
586
|
+
type: "thankYou";
|
|
587
|
+
screen: ThankYouScreen;
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
export type { ThemeCustomJS as $, AddressField as A, Layout as B, Choice as C, DropdownField as D, EmailField as E, FormContent as F, GroupField as G, HiddenField as H, Position as I, FontConfig as J, ThemeTypography as K, LongTextField as L, MultipleChoiceField as M, NPSField as N, OpinionScaleField as O, PictureChoiceField as P, ThemeSpacing as Q, RankingField as R, ShortTextField as S, ThemeColors as T, ThemeBorders as U, ThemeAnimations as V, WebsiteField as W, ThemeBackground as X, YesNoField as Y, ThemeProgressBar as Z, ThemeBranding as _, FieldType as a, ThemeComponentVariants as a0, FormTheme as a1, FormSettings as a2, ResponseAnswers as a3, FieldAnswer as a4, AddressValue as a5, SignatureValue as a6, ContactInfoAnswer as a7, FileUploadAnswer as a8, ResponseOutcome as a9, ResponseMetadata as aa, FormData as ab, FormState as ac, FieldState as ad, ScreenItem as ae, WelcomeScreen as af, ThankYouScreen as ag, NumberField as ah, FormFieldBase as b, FieldValidations as c, ChoiceFieldProperties as d, RatingField as e, PhoneNumberField as f, DateField as g, LegalField as h, StatementField as i, FileUploadField as j, ContactInfoField as k, PaymentField as l, MatrixField as m, SliderField as n, SignatureField as o, FormField as p, SubPage as q, FieldBranching as r, LogicRule as s, LogicAction as t, LogicCondition as u, ConditionOperator as v, LogicVariable as w, LogicActionDetails as x, FormVariables as y, Attachment as z };
|