@layers-app/shared 0.0.39-comments.2 → 0.0.39-froms-01

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 (92) hide show
  1. package/dist/{KanbanLayout-DGHT9E0N.js → KanbanLayout-D5Ex3f-G.js} +1 -1
  2. package/dist/components/AttachmentsGalleryModal/ShakaPlayer.d.ts +5 -0
  3. package/dist/components/BouncingLogo/BouncingLogo.d.ts +3 -0
  4. package/dist/components/CommentComposer/index.d.ts +8 -10
  5. package/dist/components/CommentsPanel/components/CommentActionMenu.d.ts +1 -5
  6. package/dist/components/CommentsPanel/components/{CommentTabFilter.d.ts → CommentFilterMenu.d.ts} +1 -2
  7. package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +4 -3
  8. package/dist/components/CommentsPanel/components/CommentsEmptyPlaceholder.d.ts +2 -5
  9. package/dist/components/CommentsPanel/components/CommentsListItemMenu.d.ts +1 -2
  10. package/dist/components/CommentsPanel/components/CommentsMultiSelectUsers.d.ts +6 -0
  11. package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +4 -3
  12. package/dist/components/CommentsPanel/components/CommentsThreadReplyControls.d.ts +1 -5
  13. package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +5 -9
  14. package/dist/components/CommentsPanel/components/RemoveConfirmModal.d.ts +11 -0
  15. package/dist/components/CommentsPanel/index.d.ts +6 -10
  16. package/dist/components/CommentsPanel/store.d.ts +1 -7
  17. package/dist/components/CommentsPanel/types.d.ts +57 -157
  18. package/dist/components/CommentsPanel/utils.d.ts +5 -11
  19. package/dist/components/FormViewer/FormViewer.d.ts +8 -0
  20. package/dist/components/FormViewer/KeyboardNavigation.d.ts +5 -0
  21. package/dist/components/FormViewer/components/AllSlidesLayout.d.ts +7 -0
  22. package/dist/components/FormViewer/components/Container.d.ts +5 -0
  23. package/dist/components/FormViewer/components/ListFocusBox.d.ts +4 -0
  24. package/dist/components/FormViewer/components/NavControls.d.ts +4 -0
  25. package/dist/components/FormViewer/components/Navigation/Navigation.d.ts +1 -0
  26. package/dist/components/FormViewer/components/OneSlideLayput.d.ts +7 -0
  27. package/dist/components/FormViewer/components/Step.d.ts +5 -0
  28. package/dist/components/FormViewer/components/StepDescription.d.ts +5 -0
  29. package/dist/components/FormViewer/components/StepTitle.d.ts +5 -0
  30. package/dist/components/FormViewer/components/fields/AddOptionButton.d.ts +3 -0
  31. package/dist/components/FormViewer/components/fields/ButtonField/ButtonField.d.ts +5 -0
  32. package/dist/components/FormViewer/components/fields/ButtonField/InnerButton.d.ts +8 -0
  33. package/dist/components/FormViewer/components/fields/ChoiceField/ChoiceCard.d.ts +11 -0
  34. package/dist/components/FormViewer/components/fields/ChoiceField/ChoiceField.d.ts +5 -0
  35. package/dist/components/FormViewer/components/fields/ChoiceField/PictureChoiceCard.d.ts +12 -0
  36. package/dist/components/FormViewer/components/fields/ChoiceField/PictureChoiceField.d.ts +5 -0
  37. package/dist/components/FormViewer/components/fields/ConfirmButton.d.ts +5 -0
  38. package/dist/components/FormViewer/components/fields/ConfirmField.d.ts +5 -0
  39. package/dist/components/FormViewer/components/fields/DateField.d.ts +4 -0
  40. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.d.ts +11 -0
  41. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.d.ts +5 -0
  42. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.d.ts +5 -0
  43. package/dist/components/FormViewer/components/fields/EmailField.d.ts +4 -0
  44. package/dist/components/FormViewer/components/fields/LocationField.d.ts +4 -0
  45. package/dist/components/FormViewer/components/fields/LongTextField.d.ts +4 -0
  46. package/dist/components/FormViewer/components/fields/MultipleChoice/MultipleChoiceCard.d.ts +12 -0
  47. package/dist/components/FormViewer/components/fields/MultipleChoice/MultipleChoiceField.d.ts +5 -0
  48. package/dist/components/FormViewer/components/fields/NumberField.d.ts +4 -0
  49. package/dist/components/FormViewer/components/fields/PhoneField.d.ts +4 -0
  50. package/dist/components/FormViewer/components/fields/ProgressLine.d.ts +1 -0
  51. package/dist/components/FormViewer/components/fields/RatingField.d.ts +5 -0
  52. package/dist/components/FormViewer/components/fields/SelectableCard/PictureSelectableCard.d.ts +21 -0
  53. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.d.ts +14 -0
  54. package/dist/components/FormViewer/components/fields/SliderField.d.ts +5 -0
  55. package/dist/components/FormViewer/components/fields/StartButton.d.ts +5 -0
  56. package/dist/components/FormViewer/components/fields/StartField.d.ts +5 -0
  57. package/dist/components/FormViewer/components/fields/TextField.d.ts +4 -0
  58. package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts +30 -0
  59. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.d.ts +8 -0
  60. package/dist/components/FormViewer/components/fields/YesNoField.d.ts +4 -0
  61. package/dist/components/FormViewer/helpers/conditions.d.ts +281 -0
  62. package/dist/components/FormViewer/helpers/controls.d.ts +6 -0
  63. package/dist/components/FormViewer/helpers/cssScoping.d.ts +11 -0
  64. package/dist/components/FormViewer/helpers/helpers.d.ts +279 -0
  65. package/dist/components/FormViewer/helpers/index.d.ts +7 -0
  66. package/dist/components/FormViewer/helpers/slides.d.ts +3 -0
  67. package/dist/components/FormViewer/helpers/staticClasses.d.ts +47 -0
  68. package/dist/components/FormViewer/helpers/steps.d.ts +294 -0
  69. package/dist/components/FormViewer/helpers/themeUtils.d.ts +2 -0
  70. package/dist/components/FormViewer/helpers/validation.d.ts +10 -0
  71. package/dist/components/FormViewer/hooks/index.d.ts +6 -0
  72. package/dist/components/FormViewer/hooks/useActiveControl.d.ts +204 -0
  73. package/dist/components/FormViewer/hooks/useActiveStep.d.ts +277 -0
  74. package/dist/components/FormViewer/hooks/useCreateFormContext.d.ts +22 -0
  75. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +145 -0
  76. package/dist/components/FormViewer/hooks/useFormMobile.d.ts +4 -0
  77. package/dist/components/FormViewer/hooks/useInterpolateText.d.ts +2 -0
  78. package/dist/components/FormViewer/index.d.ts +8 -0
  79. package/dist/components/FormViewer/store/formStore.d.ts +149 -0
  80. package/dist/components/FormViewer/store/formStoreApi.d.ts +36 -0
  81. package/dist/components/FormViewer/store/selectors.d.ts +75757 -0
  82. package/dist/components/FormViewer/types/form.d.ts +58 -0
  83. package/dist/components/FormViewer/types/schemes.d.ts +7591 -0
  84. package/dist/hooks/useEvent.d.ts +1 -0
  85. package/dist/{index-BI1_FPl_.js → index-BVdsep1X.js} +50439 -18306
  86. package/dist/index.d.ts +2 -2
  87. package/dist/index.js +68 -4
  88. package/dist/index.umd.cjs +59 -59
  89. package/package.json +1 -1
  90. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +0 -12
  91. package/dist/components/CommentFilterMenu/index.d.ts +0 -9
  92. package/dist/components/modals/openRemoveConfirmModal.d.ts +0 -4
@@ -0,0 +1,279 @@
1
+ import { StepData, ThemeData } from '../types/form';
2
+ export declare const mergeTheme: (theme: Partial<ThemeData>, updatedTheme: Partial<ThemeData>) => Partial<ThemeData>;
3
+ export declare const sortSteps: (steps: StepData[]) => {
4
+ id: string;
5
+ controls: ({
6
+ id: string;
7
+ controlType: "text";
8
+ title?: string | undefined;
9
+ description?: string | undefined;
10
+ icon?: string | undefined;
11
+ maxLength?: number | undefined;
12
+ minLength?: number | undefined;
13
+ placeholder?: string | undefined;
14
+ required?: boolean | undefined;
15
+ variableName?: string | undefined;
16
+ } | {
17
+ id: string;
18
+ controlType: "longText";
19
+ title?: string | undefined;
20
+ description?: string | undefined;
21
+ icon?: string | undefined;
22
+ maxLength?: number | undefined;
23
+ minLength?: number | undefined;
24
+ placeholder?: string | undefined;
25
+ required?: boolean | undefined;
26
+ variableName?: string | undefined;
27
+ } | {
28
+ id: string;
29
+ controlType: "button";
30
+ label?: string | undefined;
31
+ link?: string | undefined;
32
+ title?: string | undefined;
33
+ description?: string | undefined;
34
+ buttons?: any[] | undefined;
35
+ width?: number | undefined;
36
+ orientation?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
37
+ required?: boolean | undefined;
38
+ showIconButton?: boolean | undefined;
39
+ buttonIcon?: string | undefined;
40
+ alignButton?: "center" | "end" | "start" | undefined;
41
+ enableTooltip?: boolean | undefined;
42
+ fullWidthMobile?: boolean | undefined;
43
+ } | {
44
+ id: string;
45
+ controlType: "date";
46
+ title?: string | undefined;
47
+ description?: string | undefined;
48
+ icon?: string | undefined;
49
+ placeholder?: string | undefined;
50
+ required?: boolean | undefined;
51
+ minDate?: string | undefined;
52
+ maxDate?: string | undefined;
53
+ variableName?: string | undefined;
54
+ } | {
55
+ id: string;
56
+ controlType: "start";
57
+ label?: string | undefined;
58
+ title?: string | undefined;
59
+ description?: string | undefined;
60
+ icon?: string | undefined;
61
+ required?: boolean | undefined;
62
+ showIconButton?: boolean | undefined;
63
+ buttonIcon?: string | undefined;
64
+ showButton?: boolean | undefined;
65
+ } | {
66
+ id: string;
67
+ controlType: "confirm";
68
+ label?: string | undefined;
69
+ link?: string | undefined;
70
+ title?: string | undefined;
71
+ description?: string | undefined;
72
+ required?: boolean | undefined;
73
+ buttonIcon?: string | undefined;
74
+ showButton?: boolean | undefined;
75
+ } | {
76
+ id: string;
77
+ controlType: "number";
78
+ title?: string | undefined;
79
+ description?: string | undefined;
80
+ icon?: string | undefined;
81
+ max?: number | undefined;
82
+ min?: number | undefined;
83
+ placeholder?: string | undefined;
84
+ required?: boolean | undefined;
85
+ variableName?: string | undefined;
86
+ } | {
87
+ id: string;
88
+ options: {
89
+ label: string;
90
+ id: string;
91
+ }[];
92
+ controlType: "choice";
93
+ title?: string | undefined;
94
+ description?: string | undefined;
95
+ required?: boolean | undefined;
96
+ variableName?: string | undefined;
97
+ showInput?: boolean | undefined;
98
+ } | {
99
+ id: string;
100
+ options: {
101
+ label: string;
102
+ id: string;
103
+ }[];
104
+ controlType: "multipleChoice";
105
+ title?: string | undefined;
106
+ description?: string | undefined;
107
+ icon?: string | undefined;
108
+ required?: boolean | undefined;
109
+ variableName?: string | undefined;
110
+ showInput?: boolean | undefined;
111
+ minOptions?: number | undefined;
112
+ maxOptions?: number | undefined;
113
+ } | {
114
+ id: string;
115
+ options: {
116
+ label: string;
117
+ id: string;
118
+ image?: string | undefined;
119
+ }[];
120
+ controlType: "pictureChoice";
121
+ title?: string | undefined;
122
+ description?: string | undefined;
123
+ icon?: string | undefined;
124
+ required?: boolean | undefined;
125
+ variableName?: string | undefined;
126
+ showInput?: boolean | undefined;
127
+ } | {
128
+ id: string;
129
+ options: {
130
+ label: string;
131
+ id: string;
132
+ }[];
133
+ controlType: "dropdown";
134
+ title?: string | undefined;
135
+ description?: string | undefined;
136
+ icon?: string | undefined;
137
+ placeholder?: string | undefined;
138
+ required?: boolean | undefined;
139
+ variableName?: string | undefined;
140
+ } | {
141
+ id: string;
142
+ controlType: "email";
143
+ title?: string | undefined;
144
+ description?: string | undefined;
145
+ icon?: string | undefined;
146
+ placeholder?: string | undefined;
147
+ required?: boolean | undefined;
148
+ variableName?: string | undefined;
149
+ } | {
150
+ id: string;
151
+ controlType: "location";
152
+ title?: string | undefined;
153
+ description?: string | undefined;
154
+ icon?: string | undefined;
155
+ placeholder?: string | undefined;
156
+ required?: boolean | undefined;
157
+ variableName?: string | undefined;
158
+ } | {
159
+ id: string;
160
+ controlType: "phone";
161
+ title?: string | undefined;
162
+ description?: string | undefined;
163
+ icon?: string | undefined;
164
+ placeholder?: string | undefined;
165
+ required?: boolean | undefined;
166
+ variableName?: string | undefined;
167
+ } | {
168
+ id: string;
169
+ controlType: "slider";
170
+ title?: string | undefined;
171
+ description?: string | undefined;
172
+ icon?: string | undefined;
173
+ max?: number | undefined;
174
+ min?: number | undefined;
175
+ required?: boolean | undefined;
176
+ variableName?: string | undefined;
177
+ } | {
178
+ id: string;
179
+ controlType: "upload";
180
+ title?: string | undefined;
181
+ description?: string | undefined;
182
+ icon?: string | undefined;
183
+ multiple?: boolean | undefined;
184
+ accept?: string[] | undefined;
185
+ required?: boolean | undefined;
186
+ maxSize?: number | undefined;
187
+ maxFiles?: number | undefined;
188
+ variableName?: string | undefined;
189
+ minFiles?: number | undefined;
190
+ } | {
191
+ id: string;
192
+ controlType: "yesNo";
193
+ title?: string | undefined;
194
+ description?: string | undefined;
195
+ icon?: string | undefined;
196
+ required?: boolean | undefined;
197
+ variableName?: string | undefined;
198
+ yesLabel?: string | undefined;
199
+ noLabel?: string | undefined;
200
+ } | {
201
+ id: string;
202
+ controlType: "rating";
203
+ title?: string | undefined;
204
+ description?: string | undefined;
205
+ required?: boolean | undefined;
206
+ count?: number | undefined;
207
+ variableName?: string | undefined;
208
+ })[];
209
+ trigger: string;
210
+ media?: {
211
+ video?: string | undefined;
212
+ image?: string | undefined;
213
+ color?: string | undefined;
214
+ size?: number | undefined;
215
+ layout?: "content" | "top" | "left" | "bottom" | "right" | "background" | "fullLeft" | "fullRight" | "fullTop" | "fullBottom" | undefined;
216
+ blur?: number | undefined;
217
+ brightness?: number | undefined;
218
+ videoThumb?: string | undefined;
219
+ } | undefined;
220
+ theme?: {
221
+ input?: {
222
+ backgroundColor?: string | undefined;
223
+ borderColor?: string | undefined;
224
+ } | undefined;
225
+ title?: {
226
+ color?: string | undefined;
227
+ fontSize?: number | undefined;
228
+ fontWeight?: number | undefined;
229
+ fontFamily?: string | undefined;
230
+ } | undefined;
231
+ size?: "sm" | "md" | "lg" | undefined;
232
+ description?: {
233
+ color?: string | undefined;
234
+ fontSize?: number | undefined;
235
+ fontWeight?: number | undefined;
236
+ fontFamily?: string | undefined;
237
+ } | undefined;
238
+ align?: "center" | "end" | "start" | undefined;
239
+ background?: {
240
+ image?: string | undefined;
241
+ color?: string | undefined;
242
+ opacity?: number | undefined;
243
+ blur?: number | undefined;
244
+ brightness?: number | undefined;
245
+ fit?: string | undefined;
246
+ blendMode?: string | undefined;
247
+ } | undefined;
248
+ container?: {
249
+ color?: string | undefined;
250
+ opacity?: number | undefined;
251
+ backgroundImage?: string | undefined;
252
+ shadow?: {
253
+ color?: string | undefined;
254
+ size?: number | undefined;
255
+ } | undefined;
256
+ blur?: number | undefined;
257
+ } | undefined;
258
+ borderRadius?: "sm" | "md" | "lg" | undefined;
259
+ font?: {
260
+ color?: string | undefined;
261
+ fontSize?: number | undefined;
262
+ fontWeight?: number | undefined;
263
+ fontFamily?: string | undefined;
264
+ } | undefined;
265
+ listStyle?: string | undefined;
266
+ primaryColor?: string | undefined;
267
+ customCSS?: string | undefined;
268
+ } | undefined;
269
+ confirmLabel?: string | undefined;
270
+ isStart?: boolean | undefined;
271
+ isEnd?: boolean | undefined;
272
+ autoSubmit?: boolean | undefined;
273
+ conditions?: {
274
+ operator: string;
275
+ trigger: string;
276
+ controlId: string;
277
+ compareValue?: string | undefined;
278
+ }[] | undefined;
279
+ }[];
@@ -0,0 +1,7 @@
1
+ export * from './controls';
2
+ export * from './steps';
3
+ export * from './staticClasses';
4
+ export * from './validation';
5
+ export * from './conditions';
6
+ export * from './helpers';
7
+ export * from './themeUtils';
@@ -0,0 +1,3 @@
1
+ import { MotionProps } from 'framer-motion';
2
+ import { Direction, SlideAnimation } from '../types/form';
3
+ export declare const animations: Record<SlideAnimation, Record<Direction, MotionProps>>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Static class names for form components
3
+ * Following Mantine pattern but with "layers-" prefix
4
+ * Only includes classes that are actually implemented in components
5
+ */
6
+ export declare const STATIC_CLASSES: {
7
+ readonly PAGE: "layers-page";
8
+ readonly START: "layers-start";
9
+ readonly END: "layers-end";
10
+ readonly SUBMIT_BUTTON: "layers-submit-button";
11
+ readonly REQUIRED_INDICATOR: "layers-required-indicator";
12
+ readonly VALIDATION_ERROR: "layers-validation-error";
13
+ readonly BLOCK: "layers-block";
14
+ readonly BLOCK_TEXT: "layers-block-text";
15
+ readonly BLOCK_TITLE: "layers-block-title";
16
+ readonly BLOCK_IMAGE: "layers-block-image";
17
+ readonly MEDIA_LAYOUT_CONTENT: "layers-media-layout-content";
18
+ readonly MEDIA_LAYOUT_LEFT: "layers-media-layout-left";
19
+ readonly MEDIA_LAYOUT_RIGHT: "layers-media-layout-right";
20
+ readonly MEDIA_LAYOUT_FULL_LEFT: "layers-media-layout-full-left";
21
+ readonly MEDIA_LAYOUT_FULL_RIGHT: "layers-media-layout-full-right";
22
+ readonly MEDIA_LAYOUT_BACKGROUND: "layers-media-layout-background";
23
+ readonly MEDIA_LAYOUT_TOP: "layers-media-layout-top";
24
+ readonly MEDIA_LAYOUT_BOTTOM: "layers-media-layout-bottom";
25
+ readonly MEDIA_LAYOUT_FULL_TOP: "layers-media-layout-full-top";
26
+ readonly MEDIA_LAYOUT_FULL_BOTTOM: "layers-media-layout-full-bottom";
27
+ readonly BLOCK_MULTIPLE_CHOICE: "layers-block-multiple-choice";
28
+ readonly MULTIPLE_CHOICE_OPTION: "layers-multiple-choice-option";
29
+ readonly MULTIPLE_CHOICE_OPTION_SELECTED: "layers-multiple-choice-option-selected";
30
+ readonly NUMBER_BADGE: "layers-number-badge";
31
+ readonly CHECKBOX: "layers-checkbox";
32
+ readonly CHECKBOX_SELECTED: "layers-checkbox-selected";
33
+ readonly RADIO: "layers-radio";
34
+ readonly RADIO_SELECTED: "layers-radio-selected";
35
+ readonly BLOCK_INPUT_TEXT: "layers-block-input-text";
36
+ readonly BLOCK_INPUT_NUMBER: "layers-block-input-number";
37
+ readonly BLOCK_INPUT_EMAIL: "layers-block-input-email";
38
+ readonly BLOCK_TEXTAREA: "layers-block-textarea";
39
+ };
40
+ /**
41
+ * Generate page number class
42
+ */
43
+ export declare const getPageNumberClass: (pageNumber: number) => string;
44
+ /**
45
+ * Utility function to combine static classes with existing classes
46
+ */
47
+ export declare const combineClasses: (...classes: (string | undefined | null)[]) => string;
@@ -0,0 +1,294 @@
1
+ import { TFunction } from 'i18next';
2
+ import { StepData } from '../types/form';
3
+ export declare const getFirstStep: (steps: StepData[]) => {
4
+ id: string;
5
+ controls: ({
6
+ id: string;
7
+ controlType: "text";
8
+ title?: string | undefined;
9
+ description?: string | undefined;
10
+ icon?: string | undefined;
11
+ maxLength?: number | undefined;
12
+ minLength?: number | undefined;
13
+ placeholder?: string | undefined;
14
+ required?: boolean | undefined;
15
+ variableName?: string | undefined;
16
+ } | {
17
+ id: string;
18
+ controlType: "longText";
19
+ title?: string | undefined;
20
+ description?: string | undefined;
21
+ icon?: string | undefined;
22
+ maxLength?: number | undefined;
23
+ minLength?: number | undefined;
24
+ placeholder?: string | undefined;
25
+ required?: boolean | undefined;
26
+ variableName?: string | undefined;
27
+ } | {
28
+ id: string;
29
+ controlType: "button";
30
+ label?: string | undefined;
31
+ link?: string | undefined;
32
+ title?: string | undefined;
33
+ description?: string | undefined;
34
+ buttons?: any[] | undefined;
35
+ width?: number | undefined;
36
+ orientation?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
37
+ required?: boolean | undefined;
38
+ showIconButton?: boolean | undefined;
39
+ buttonIcon?: string | undefined;
40
+ alignButton?: "center" | "end" | "start" | undefined;
41
+ enableTooltip?: boolean | undefined;
42
+ fullWidthMobile?: boolean | undefined;
43
+ } | {
44
+ id: string;
45
+ controlType: "date";
46
+ title?: string | undefined;
47
+ description?: string | undefined;
48
+ icon?: string | undefined;
49
+ placeholder?: string | undefined;
50
+ required?: boolean | undefined;
51
+ minDate?: string | undefined;
52
+ maxDate?: string | undefined;
53
+ variableName?: string | undefined;
54
+ } | {
55
+ id: string;
56
+ controlType: "start";
57
+ label?: string | undefined;
58
+ title?: string | undefined;
59
+ description?: string | undefined;
60
+ icon?: string | undefined;
61
+ required?: boolean | undefined;
62
+ showIconButton?: boolean | undefined;
63
+ buttonIcon?: string | undefined;
64
+ showButton?: boolean | undefined;
65
+ } | {
66
+ id: string;
67
+ controlType: "confirm";
68
+ label?: string | undefined;
69
+ link?: string | undefined;
70
+ title?: string | undefined;
71
+ description?: string | undefined;
72
+ required?: boolean | undefined;
73
+ buttonIcon?: string | undefined;
74
+ showButton?: boolean | undefined;
75
+ } | {
76
+ id: string;
77
+ controlType: "number";
78
+ title?: string | undefined;
79
+ description?: string | undefined;
80
+ icon?: string | undefined;
81
+ max?: number | undefined;
82
+ min?: number | undefined;
83
+ placeholder?: string | undefined;
84
+ required?: boolean | undefined;
85
+ variableName?: string | undefined;
86
+ } | {
87
+ id: string;
88
+ options: {
89
+ label: string;
90
+ id: string;
91
+ }[];
92
+ controlType: "choice";
93
+ title?: string | undefined;
94
+ description?: string | undefined;
95
+ required?: boolean | undefined;
96
+ variableName?: string | undefined;
97
+ showInput?: boolean | undefined;
98
+ } | {
99
+ id: string;
100
+ options: {
101
+ label: string;
102
+ id: string;
103
+ }[];
104
+ controlType: "multipleChoice";
105
+ title?: string | undefined;
106
+ description?: string | undefined;
107
+ icon?: string | undefined;
108
+ required?: boolean | undefined;
109
+ variableName?: string | undefined;
110
+ showInput?: boolean | undefined;
111
+ minOptions?: number | undefined;
112
+ maxOptions?: number | undefined;
113
+ } | {
114
+ id: string;
115
+ options: {
116
+ label: string;
117
+ id: string;
118
+ image?: string | undefined;
119
+ }[];
120
+ controlType: "pictureChoice";
121
+ title?: string | undefined;
122
+ description?: string | undefined;
123
+ icon?: string | undefined;
124
+ required?: boolean | undefined;
125
+ variableName?: string | undefined;
126
+ showInput?: boolean | undefined;
127
+ } | {
128
+ id: string;
129
+ options: {
130
+ label: string;
131
+ id: string;
132
+ }[];
133
+ controlType: "dropdown";
134
+ title?: string | undefined;
135
+ description?: string | undefined;
136
+ icon?: string | undefined;
137
+ placeholder?: string | undefined;
138
+ required?: boolean | undefined;
139
+ variableName?: string | undefined;
140
+ } | {
141
+ id: string;
142
+ controlType: "email";
143
+ title?: string | undefined;
144
+ description?: string | undefined;
145
+ icon?: string | undefined;
146
+ placeholder?: string | undefined;
147
+ required?: boolean | undefined;
148
+ variableName?: string | undefined;
149
+ } | {
150
+ id: string;
151
+ controlType: "location";
152
+ title?: string | undefined;
153
+ description?: string | undefined;
154
+ icon?: string | undefined;
155
+ placeholder?: string | undefined;
156
+ required?: boolean | undefined;
157
+ variableName?: string | undefined;
158
+ } | {
159
+ id: string;
160
+ controlType: "phone";
161
+ title?: string | undefined;
162
+ description?: string | undefined;
163
+ icon?: string | undefined;
164
+ placeholder?: string | undefined;
165
+ required?: boolean | undefined;
166
+ variableName?: string | undefined;
167
+ } | {
168
+ id: string;
169
+ controlType: "slider";
170
+ title?: string | undefined;
171
+ description?: string | undefined;
172
+ icon?: string | undefined;
173
+ max?: number | undefined;
174
+ min?: number | undefined;
175
+ required?: boolean | undefined;
176
+ variableName?: string | undefined;
177
+ } | {
178
+ id: string;
179
+ controlType: "upload";
180
+ title?: string | undefined;
181
+ description?: string | undefined;
182
+ icon?: string | undefined;
183
+ multiple?: boolean | undefined;
184
+ accept?: string[] | undefined;
185
+ required?: boolean | undefined;
186
+ maxSize?: number | undefined;
187
+ maxFiles?: number | undefined;
188
+ variableName?: string | undefined;
189
+ minFiles?: number | undefined;
190
+ } | {
191
+ id: string;
192
+ controlType: "yesNo";
193
+ title?: string | undefined;
194
+ description?: string | undefined;
195
+ icon?: string | undefined;
196
+ required?: boolean | undefined;
197
+ variableName?: string | undefined;
198
+ yesLabel?: string | undefined;
199
+ noLabel?: string | undefined;
200
+ } | {
201
+ id: string;
202
+ controlType: "rating";
203
+ title?: string | undefined;
204
+ description?: string | undefined;
205
+ required?: boolean | undefined;
206
+ count?: number | undefined;
207
+ variableName?: string | undefined;
208
+ })[];
209
+ trigger: string;
210
+ media?: {
211
+ video?: string | undefined;
212
+ image?: string | undefined;
213
+ color?: string | undefined;
214
+ size?: number | undefined;
215
+ layout?: "content" | "top" | "left" | "bottom" | "right" | "background" | "fullLeft" | "fullRight" | "fullTop" | "fullBottom" | undefined;
216
+ blur?: number | undefined;
217
+ brightness?: number | undefined;
218
+ videoThumb?: string | undefined;
219
+ } | undefined;
220
+ theme?: {
221
+ input?: {
222
+ backgroundColor?: string | undefined;
223
+ borderColor?: string | undefined;
224
+ } | undefined;
225
+ title?: {
226
+ color?: string | undefined;
227
+ fontSize?: number | undefined;
228
+ fontWeight?: number | undefined;
229
+ fontFamily?: string | undefined;
230
+ } | undefined;
231
+ size?: "sm" | "md" | "lg" | undefined;
232
+ description?: {
233
+ color?: string | undefined;
234
+ fontSize?: number | undefined;
235
+ fontWeight?: number | undefined;
236
+ fontFamily?: string | undefined;
237
+ } | undefined;
238
+ align?: "center" | "end" | "start" | undefined;
239
+ background?: {
240
+ image?: string | undefined;
241
+ color?: string | undefined;
242
+ opacity?: number | undefined;
243
+ blur?: number | undefined;
244
+ brightness?: number | undefined;
245
+ fit?: string | undefined;
246
+ blendMode?: string | undefined;
247
+ } | undefined;
248
+ container?: {
249
+ color?: string | undefined;
250
+ opacity?: number | undefined;
251
+ backgroundImage?: string | undefined;
252
+ shadow?: {
253
+ color?: string | undefined;
254
+ size?: number | undefined;
255
+ } | undefined;
256
+ blur?: number | undefined;
257
+ } | undefined;
258
+ borderRadius?: "sm" | "md" | "lg" | undefined;
259
+ font?: {
260
+ color?: string | undefined;
261
+ fontSize?: number | undefined;
262
+ fontWeight?: number | undefined;
263
+ fontFamily?: string | undefined;
264
+ } | undefined;
265
+ listStyle?: string | undefined;
266
+ primaryColor?: string | undefined;
267
+ customCSS?: string | undefined;
268
+ } | undefined;
269
+ confirmLabel?: string | undefined;
270
+ isStart?: boolean | undefined;
271
+ isEnd?: boolean | undefined;
272
+ autoSubmit?: boolean | undefined;
273
+ conditions?: {
274
+ operator: string;
275
+ trigger: string;
276
+ controlId: string;
277
+ compareValue?: string | undefined;
278
+ }[] | undefined;
279
+ } | undefined;
280
+ export declare const DEFAULT_END_STEP_ID = "__end_step__";
281
+ export declare const DEFAULT_START_STEP_ID = "__start_step__";
282
+ export declare const getDefaultStartStep: (t: TFunction) => StepData;
283
+ export declare const getDefaultEndStep: (t: TFunction) => StepData;
284
+ export declare const DEFAULT_MIN = 0;
285
+ export declare const DEFAULT_OPTIONS_MIN = 1;
286
+ export declare const DEFAULT_MAX = 9999;
287
+ export declare const DEFAULT_OPTION_MAX_LENGTH = 99;
288
+ export declare const CREATE_CONDITION_FORM_ID = "CREATE_CONDITION_FORM";
289
+ export declare const EDIT_CONDITION_FORM_ID = "EDIT_CONDITION_FORM";
290
+ export declare const MAX_OPTIONS_COUNT = 20;
291
+ export declare const getDefaultDropdownOptions: (t: TFunction) => string;
292
+ export declare const getRandomId: () => string;
293
+ export declare const DEFAULT_MEDIA_BRIGHTNESS = 100;
294
+ export declare const DEFAULT_MEDIA_SIZE = 100;
@@ -0,0 +1,2 @@
1
+ import { Align } from '../types/form';
2
+ export declare const alignRelation: Record<Align, string>;
@@ -0,0 +1,10 @@
1
+ import { FileWithPath } from '@mantine/dropzone';
2
+ import { TFunction } from 'i18next';
3
+ import { Control, LongTextControl, TextControl } from '../types/form';
4
+ export declare const useValidation: () => {
5
+ getValidation: (c: Control) => ((v: string) => string | null) | ((v: (string | number)[]) => string | null) | ((v: boolean) => string | null) | ((v: FileWithPath[]) => string | null) | undefined;
6
+ };
7
+ export declare const getTextValidation: (props: Partial<TextControl> | Partial<LongTextControl>, t: TFunction) => (v: string) => string | null;
8
+ export declare const isValidEmail: (v: string) => boolean;
9
+ export declare const isImageUrl: (url: string) => Promise<unknown>;
10
+ export declare const isValidUrl: (urlString: string) => boolean;
@@ -0,0 +1,6 @@
1
+ export * from './useCreateFormContext';
2
+ export * from './useActiveControl';
3
+ export * from './useActiveStep';
4
+ export * from './useCreateFormContext';
5
+ export * from './useFormMobile';
6
+ export * from './useInterpolateText';