@layers-app/shared 0.0.39-comments.2 → 0.0.39-comments.3

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 (77) hide show
  1. package/dist/{KanbanLayout-DGHT9E0N.js → KanbanLayout-C5JdVttk.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/CircleColorPicker/CircleColorPicker.d.ts +2 -2
  5. package/dist/components/CommentsPanel/types.d.ts +0 -5
  6. package/dist/components/FormViewer/FormViewer.d.ts +8 -0
  7. package/dist/components/FormViewer/KeyboardNavigation.d.ts +5 -0
  8. package/dist/components/FormViewer/components/AllSlidesLayout.d.ts +7 -0
  9. package/dist/components/FormViewer/components/Container.d.ts +5 -0
  10. package/dist/components/FormViewer/components/ListFocusBox.d.ts +4 -0
  11. package/dist/components/FormViewer/components/NavControls.d.ts +4 -0
  12. package/dist/components/FormViewer/components/Navigation/Navigation.d.ts +1 -0
  13. package/dist/components/FormViewer/components/OneSlideLayput.d.ts +7 -0
  14. package/dist/components/FormViewer/components/Step.d.ts +6 -0
  15. package/dist/components/FormViewer/components/StepDescription.d.ts +6 -0
  16. package/dist/components/FormViewer/components/StepTitle.d.ts +6 -0
  17. package/dist/components/FormViewer/components/fields/AddOptionButton.d.ts +3 -0
  18. package/dist/components/FormViewer/components/fields/ButtonField/ButtonField.d.ts +6 -0
  19. package/dist/components/FormViewer/components/fields/ButtonField/InnerButton.d.ts +9 -0
  20. package/dist/components/FormViewer/components/fields/ChoiceField/ChoiceCard.d.ts +11 -0
  21. package/dist/components/FormViewer/components/fields/ChoiceField/ChoiceField.d.ts +6 -0
  22. package/dist/components/FormViewer/components/fields/ChoiceField/PictureChoiceCard.d.ts +12 -0
  23. package/dist/components/FormViewer/components/fields/ChoiceField/PictureChoiceField.d.ts +6 -0
  24. package/dist/components/FormViewer/components/fields/ConfirmButton.d.ts +6 -0
  25. package/dist/components/FormViewer/components/fields/ConfirmField.d.ts +6 -0
  26. package/dist/components/FormViewer/components/fields/DateField.d.ts +4 -0
  27. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.d.ts +11 -0
  28. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.d.ts +6 -0
  29. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.d.ts +5 -0
  30. package/dist/components/FormViewer/components/fields/EmailField.d.ts +4 -0
  31. package/dist/components/FormViewer/components/fields/LocationField.d.ts +4 -0
  32. package/dist/components/FormViewer/components/fields/LongTextField.d.ts +4 -0
  33. package/dist/components/FormViewer/components/fields/MultipleChoice/MultipleChoiceCard.d.ts +12 -0
  34. package/dist/components/FormViewer/components/fields/MultipleChoice/MultipleChoiceField.d.ts +6 -0
  35. package/dist/components/FormViewer/components/fields/NumberField.d.ts +4 -0
  36. package/dist/components/FormViewer/components/fields/PhoneField.d.ts +4 -0
  37. package/dist/components/FormViewer/components/fields/ProgressLine.d.ts +1 -0
  38. package/dist/components/FormViewer/components/fields/RatingField.d.ts +5 -0
  39. package/dist/components/FormViewer/components/fields/SelectableCard/PictureSelectableCard.d.ts +21 -0
  40. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.d.ts +14 -0
  41. package/dist/components/FormViewer/components/fields/SliderField.d.ts +5 -0
  42. package/dist/components/FormViewer/components/fields/StartButton.d.ts +5 -0
  43. package/dist/components/FormViewer/components/fields/StartField.d.ts +6 -0
  44. package/dist/components/FormViewer/components/fields/TextField.d.ts +4 -0
  45. package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts +30 -0
  46. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.d.ts +8 -0
  47. package/dist/components/FormViewer/components/fields/YesNoField.d.ts +4 -0
  48. package/dist/components/FormViewer/constants/defaultTheme.d.ts +2 -0
  49. package/dist/components/FormViewer/helpers/conditions.d.ts +279 -0
  50. package/dist/components/FormViewer/helpers/controls.d.ts +6 -0
  51. package/dist/components/FormViewer/helpers/cssScoping.d.ts +11 -0
  52. package/dist/components/FormViewer/helpers/helpers.d.ts +277 -0
  53. package/dist/components/FormViewer/helpers/index.d.ts +7 -0
  54. package/dist/components/FormViewer/helpers/slides.d.ts +3 -0
  55. package/dist/components/FormViewer/helpers/staticClasses.d.ts +47 -0
  56. package/dist/components/FormViewer/helpers/steps.d.ts +292 -0
  57. package/dist/components/FormViewer/helpers/themeUtils.d.ts +2 -0
  58. package/dist/components/FormViewer/helpers/validation.d.ts +10 -0
  59. package/dist/components/FormViewer/hooks/index.d.ts +6 -0
  60. package/dist/components/FormViewer/hooks/useActiveControl.d.ts +204 -0
  61. package/dist/components/FormViewer/hooks/useActiveStep.d.ts +275 -0
  62. package/dist/components/FormViewer/hooks/useCreateFormContext.d.ts +22 -0
  63. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +145 -0
  64. package/dist/components/FormViewer/hooks/useFormMobile.d.ts +4 -0
  65. package/dist/components/FormViewer/hooks/useInterpolateText.d.ts +2 -0
  66. package/dist/components/FormViewer/index.d.ts +8 -0
  67. package/dist/components/FormViewer/store/formStore.d.ts +112 -0
  68. package/dist/components/FormViewer/store/formStoreApi.d.ts +36 -0
  69. package/dist/components/FormViewer/store/selectors.d.ts +75110 -0
  70. package/dist/components/FormViewer/types/form.d.ts +58 -0
  71. package/dist/components/FormViewer/types/schemes.d.ts +7475 -0
  72. package/dist/hooks/useEvent.d.ts +1 -0
  73. package/dist/{index-BI1_FPl_.js → index-CM1iBMgt.js} +44206 -11726
  74. package/dist/index.d.ts +5 -0
  75. package/dist/index.js +70 -4
  76. package/dist/index.umd.cjs +59 -59
  77. package/package.json +1 -1
@@ -0,0 +1,275 @@
1
+ export declare const useActiveStep: () => {
2
+ id: string;
3
+ controls: ({
4
+ id: string;
5
+ controlType: "text";
6
+ title?: string | undefined;
7
+ description?: string | undefined;
8
+ icon?: string | undefined;
9
+ maxLength?: number | undefined;
10
+ minLength?: number | undefined;
11
+ placeholder?: string | undefined;
12
+ required?: boolean | undefined;
13
+ variableName?: string | undefined;
14
+ } | {
15
+ id: string;
16
+ controlType: "longText";
17
+ title?: string | undefined;
18
+ description?: string | undefined;
19
+ icon?: string | undefined;
20
+ maxLength?: number | undefined;
21
+ minLength?: number | undefined;
22
+ placeholder?: string | undefined;
23
+ required?: boolean | undefined;
24
+ variableName?: string | undefined;
25
+ } | {
26
+ id: string;
27
+ controlType: "button";
28
+ label?: string | undefined;
29
+ link?: string | undefined;
30
+ title?: string | undefined;
31
+ description?: string | undefined;
32
+ buttons?: any[] | undefined;
33
+ width?: number | undefined;
34
+ orientation?: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
35
+ required?: boolean | undefined;
36
+ showIconButton?: boolean | undefined;
37
+ buttonIcon?: string | undefined;
38
+ alignButton?: "center" | "end" | "start" | undefined;
39
+ enableTooltip?: boolean | undefined;
40
+ fullWidthMobile?: boolean | undefined;
41
+ } | {
42
+ id: string;
43
+ controlType: "date";
44
+ title?: string | undefined;
45
+ description?: string | undefined;
46
+ icon?: string | undefined;
47
+ placeholder?: string | undefined;
48
+ required?: boolean | undefined;
49
+ minDate?: string | undefined;
50
+ maxDate?: string | undefined;
51
+ variableName?: string | undefined;
52
+ } | {
53
+ id: string;
54
+ controlType: "start";
55
+ label?: string | undefined;
56
+ title?: string | undefined;
57
+ description?: string | undefined;
58
+ icon?: string | undefined;
59
+ required?: boolean | undefined;
60
+ showIconButton?: boolean | undefined;
61
+ buttonIcon?: string | undefined;
62
+ showButton?: boolean | undefined;
63
+ } | {
64
+ id: string;
65
+ controlType: "confirm";
66
+ label?: string | undefined;
67
+ link?: string | undefined;
68
+ title?: string | undefined;
69
+ description?: string | undefined;
70
+ required?: boolean | undefined;
71
+ buttonIcon?: string | undefined;
72
+ showButton?: boolean | undefined;
73
+ } | {
74
+ id: string;
75
+ controlType: "number";
76
+ title?: string | undefined;
77
+ description?: string | undefined;
78
+ icon?: string | undefined;
79
+ max?: number | undefined;
80
+ min?: number | undefined;
81
+ placeholder?: string | undefined;
82
+ required?: boolean | undefined;
83
+ variableName?: string | undefined;
84
+ } | {
85
+ id: string;
86
+ options: {
87
+ label: string;
88
+ id: string;
89
+ }[];
90
+ controlType: "choice";
91
+ title?: string | undefined;
92
+ description?: string | undefined;
93
+ required?: boolean | undefined;
94
+ variableName?: string | undefined;
95
+ showInput?: boolean | undefined;
96
+ } | {
97
+ id: string;
98
+ options: {
99
+ label: string;
100
+ id: string;
101
+ }[];
102
+ controlType: "multipleChoice";
103
+ title?: string | undefined;
104
+ description?: string | undefined;
105
+ icon?: string | undefined;
106
+ required?: boolean | undefined;
107
+ variableName?: string | undefined;
108
+ showInput?: boolean | undefined;
109
+ minOptions?: number | undefined;
110
+ maxOptions?: number | undefined;
111
+ } | {
112
+ id: string;
113
+ options: {
114
+ label: string;
115
+ id: string;
116
+ image?: string | undefined;
117
+ }[];
118
+ controlType: "pictureChoice";
119
+ title?: string | undefined;
120
+ description?: string | undefined;
121
+ icon?: string | undefined;
122
+ required?: boolean | undefined;
123
+ variableName?: string | undefined;
124
+ showInput?: boolean | undefined;
125
+ } | {
126
+ id: string;
127
+ options: {
128
+ label: string;
129
+ id: string;
130
+ }[];
131
+ controlType: "dropdown";
132
+ title?: string | undefined;
133
+ description?: string | undefined;
134
+ icon?: string | undefined;
135
+ placeholder?: string | undefined;
136
+ required?: boolean | undefined;
137
+ variableName?: string | undefined;
138
+ } | {
139
+ id: string;
140
+ controlType: "email";
141
+ title?: string | undefined;
142
+ description?: string | undefined;
143
+ icon?: string | undefined;
144
+ placeholder?: string | undefined;
145
+ required?: boolean | undefined;
146
+ variableName?: string | undefined;
147
+ } | {
148
+ id: string;
149
+ controlType: "location";
150
+ title?: string | undefined;
151
+ description?: string | undefined;
152
+ icon?: string | undefined;
153
+ placeholder?: string | undefined;
154
+ required?: boolean | undefined;
155
+ variableName?: string | undefined;
156
+ } | {
157
+ id: string;
158
+ controlType: "phone";
159
+ title?: string | undefined;
160
+ description?: string | undefined;
161
+ icon?: string | undefined;
162
+ placeholder?: string | undefined;
163
+ required?: boolean | undefined;
164
+ variableName?: string | undefined;
165
+ } | {
166
+ id: string;
167
+ controlType: "slider";
168
+ title?: string | undefined;
169
+ description?: string | undefined;
170
+ icon?: string | undefined;
171
+ max?: number | undefined;
172
+ min?: number | undefined;
173
+ required?: boolean | undefined;
174
+ variableName?: string | undefined;
175
+ } | {
176
+ id: string;
177
+ controlType: "upload";
178
+ title?: string | undefined;
179
+ description?: string | undefined;
180
+ icon?: string | undefined;
181
+ multiple?: boolean | undefined;
182
+ accept?: string[] | undefined;
183
+ required?: boolean | undefined;
184
+ maxSize?: number | undefined;
185
+ maxFiles?: number | undefined;
186
+ variableName?: string | undefined;
187
+ minFiles?: number | undefined;
188
+ } | {
189
+ id: string;
190
+ controlType: "yesNo";
191
+ title?: string | undefined;
192
+ description?: string | undefined;
193
+ icon?: string | undefined;
194
+ required?: boolean | undefined;
195
+ variableName?: string | undefined;
196
+ yesLabel?: string | undefined;
197
+ noLabel?: string | undefined;
198
+ } | {
199
+ id: string;
200
+ controlType: "rating";
201
+ title?: string | undefined;
202
+ description?: string | undefined;
203
+ required?: boolean | undefined;
204
+ count?: number | undefined;
205
+ variableName?: string | undefined;
206
+ })[];
207
+ trigger: string;
208
+ media?: {
209
+ video?: string | undefined;
210
+ image?: string | undefined;
211
+ color?: string | undefined;
212
+ size?: number | undefined;
213
+ layout?: "content" | "top" | "left" | "bottom" | "right" | "background" | "fullLeft" | "fullRight" | "fullTop" | "fullBottom" | undefined;
214
+ blur?: number | undefined;
215
+ brightness?: number | undefined;
216
+ videoThumb?: string | undefined;
217
+ } | undefined;
218
+ theme?: {
219
+ input?: {
220
+ backgroundColor?: string | undefined;
221
+ borderColor?: string | undefined;
222
+ } | undefined;
223
+ title?: {
224
+ color?: string | undefined;
225
+ fontSize?: number | undefined;
226
+ fontWeight?: number | undefined;
227
+ fontFamily?: string | undefined;
228
+ } | undefined;
229
+ size?: "sm" | "md" | "lg" | undefined;
230
+ description?: {
231
+ color?: string | undefined;
232
+ fontSize?: number | undefined;
233
+ fontWeight?: number | undefined;
234
+ fontFamily?: string | undefined;
235
+ } | undefined;
236
+ align?: "center" | "end" | "start" | undefined;
237
+ background?: {
238
+ image?: string | undefined;
239
+ color?: string | undefined;
240
+ opacity?: number | undefined;
241
+ blur?: number | undefined;
242
+ brightness?: number | undefined;
243
+ fit?: string | undefined;
244
+ blendMode?: string | undefined;
245
+ } | undefined;
246
+ container?: {
247
+ color?: string | undefined;
248
+ opacity?: number | undefined;
249
+ backgroundImage?: string | undefined;
250
+ blur?: number | undefined;
251
+ shadowSize?: number | undefined;
252
+ shadowColor?: string | undefined;
253
+ } | undefined;
254
+ borderRadius?: "sm" | "md" | "lg" | undefined;
255
+ font?: {
256
+ color?: string | undefined;
257
+ fontSize?: number | undefined;
258
+ fontWeight?: number | undefined;
259
+ fontFamily?: string | undefined;
260
+ } | undefined;
261
+ listStyle?: string | undefined;
262
+ primaryColor?: string | undefined;
263
+ customCSS?: string | undefined;
264
+ } | undefined;
265
+ isStart?: boolean | undefined;
266
+ isEnd?: boolean | undefined;
267
+ autoSubmit?: boolean | undefined;
268
+ confirmLabel?: string | undefined;
269
+ conditions?: {
270
+ operator: string;
271
+ trigger: string;
272
+ controlId: string;
273
+ compareValue?: string | undefined;
274
+ }[] | undefined;
275
+ } | null;
@@ -0,0 +1,22 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { UseFormReturnType } from '@mantine/form';
3
+ import { Direction } from '../types/form';
4
+ type StepsContext = {
5
+ handleNext: () => void;
6
+ handlePrev: () => void;
7
+ anim: Direction;
8
+ form: UseFormReturnType<StepsFormValues>;
9
+ setValue: (controlId: string, value: any, trigger?: string) => void;
10
+ };
11
+ export declare const StepsContext: import('react').Context<StepsContext>;
12
+ export declare const useSteps: () => StepsContext;
13
+ export type StepsFormValues = Record<string, any> & {
14
+ submissionId: string;
15
+ };
16
+ type StepsContextProviderProps = {
17
+ onSubmit?: (values: StepsFormValues) => void;
18
+ onValuesChange?: (values: StepsFormValues) => void;
19
+ };
20
+ /** Используется для хранения данных, которые ввёл пользователь */
21
+ export declare const FormContextProvider: ({ children, ...props }: PropsWithChildren<StepsContextProviderProps>) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,145 @@
1
+ export declare const useFormGlobalTheme: ({ innerId }: {
2
+ innerId: string;
3
+ }) => {
4
+ customStyles: string;
5
+ mantineTheme: {
6
+ focusRing?: "auto" | "always" | "never" | undefined;
7
+ scale?: number | undefined;
8
+ fontSmoothing?: boolean | undefined;
9
+ white?: string | undefined;
10
+ black?: string | undefined;
11
+ colors?: {
12
+ [x: string & {}]: import('@mantine/core').MantineColorsTuple | undefined;
13
+ blue?: import('@mantine/core').MantineColorsTuple | undefined;
14
+ cyan?: import('@mantine/core').MantineColorsTuple | undefined;
15
+ gray?: import('@mantine/core').MantineColorsTuple | undefined;
16
+ green?: import('@mantine/core').MantineColorsTuple | undefined;
17
+ indigo?: import('@mantine/core').MantineColorsTuple | undefined;
18
+ lime?: import('@mantine/core').MantineColorsTuple | undefined;
19
+ orange?: import('@mantine/core').MantineColorsTuple | undefined;
20
+ pink?: import('@mantine/core').MantineColorsTuple | undefined;
21
+ red?: import('@mantine/core').MantineColorsTuple | undefined;
22
+ teal?: import('@mantine/core').MantineColorsTuple | undefined;
23
+ violet?: import('@mantine/core').MantineColorsTuple | undefined;
24
+ yellow?: import('@mantine/core').MantineColorsTuple | undefined;
25
+ dark?: import('@mantine/core').MantineColorsTuple | undefined;
26
+ grape?: import('@mantine/core').MantineColorsTuple | undefined;
27
+ } | undefined;
28
+ primaryShade?: import('@mantine/core').MantineColorShade | {
29
+ light?: import('@mantine/core').MantineColorShade | undefined;
30
+ dark?: import('@mantine/core').MantineColorShade | undefined;
31
+ } | undefined;
32
+ primaryColor?: string | undefined;
33
+ variantColorResolver?: import('@mantine/core').VariantColorsResolver | undefined;
34
+ autoContrast?: boolean | undefined;
35
+ luminanceThreshold?: number | undefined;
36
+ fontFamily?: string | undefined;
37
+ fontFamilyMonospace?: string | undefined;
38
+ headings?: {
39
+ fontFamily?: string | undefined;
40
+ fontWeight?: string | undefined;
41
+ textWrap?: "balance" | "nowrap" | "wrap" | "stable" | "pretty" | undefined;
42
+ sizes?: {
43
+ h1?: {
44
+ fontSize?: string | undefined;
45
+ fontWeight?: string | undefined;
46
+ lineHeight?: string | undefined;
47
+ } | undefined;
48
+ h2?: {
49
+ fontSize?: string | undefined;
50
+ fontWeight?: string | undefined;
51
+ lineHeight?: string | undefined;
52
+ } | undefined;
53
+ h3?: {
54
+ fontSize?: string | undefined;
55
+ fontWeight?: string | undefined;
56
+ lineHeight?: string | undefined;
57
+ } | undefined;
58
+ h4?: {
59
+ fontSize?: string | undefined;
60
+ fontWeight?: string | undefined;
61
+ lineHeight?: string | undefined;
62
+ } | undefined;
63
+ h5?: {
64
+ fontSize?: string | undefined;
65
+ fontWeight?: string | undefined;
66
+ lineHeight?: string | undefined;
67
+ } | undefined;
68
+ h6?: {
69
+ fontSize?: string | undefined;
70
+ fontWeight?: string | undefined;
71
+ lineHeight?: string | undefined;
72
+ } | undefined;
73
+ } | undefined;
74
+ } | undefined;
75
+ radius?: {
76
+ [x: string & {}]: string | undefined;
77
+ sm?: string | undefined;
78
+ xs?: string | undefined;
79
+ md?: string | undefined;
80
+ lg?: string | undefined;
81
+ xl?: string | undefined;
82
+ } | undefined;
83
+ defaultRadius?: import('@mantine/core').MantineRadius | undefined;
84
+ spacing?: {
85
+ [x: string & {}]: string | undefined;
86
+ sm?: string | undefined;
87
+ xs?: string | undefined;
88
+ md?: string | undefined;
89
+ lg?: string | undefined;
90
+ xl?: string | undefined;
91
+ } | undefined;
92
+ fontSizes?: {
93
+ [x: string & {}]: string | undefined;
94
+ sm?: string | undefined;
95
+ xs?: string | undefined;
96
+ md?: string | undefined;
97
+ lg?: string | undefined;
98
+ xl?: string | undefined;
99
+ } | undefined;
100
+ lineHeights?: {
101
+ [x: string & {}]: string | undefined;
102
+ sm?: string | undefined;
103
+ xs?: string | undefined;
104
+ md?: string | undefined;
105
+ lg?: string | undefined;
106
+ xl?: string | undefined;
107
+ } | undefined;
108
+ breakpoints?: {
109
+ [x: string & {}]: string | undefined;
110
+ sm?: string | undefined;
111
+ xs?: string | undefined;
112
+ md?: string | undefined;
113
+ lg?: string | undefined;
114
+ xl?: string | undefined;
115
+ } | undefined;
116
+ shadows?: {
117
+ [x: string & {}]: string | undefined;
118
+ sm?: string | undefined;
119
+ xs?: string | undefined;
120
+ md?: string | undefined;
121
+ lg?: string | undefined;
122
+ xl?: string | undefined;
123
+ } | undefined;
124
+ respectReducedMotion?: boolean | undefined;
125
+ cursorType?: "default" | "pointer" | undefined;
126
+ defaultGradient?: {
127
+ from?: string | undefined;
128
+ to?: string | undefined;
129
+ deg?: number | undefined;
130
+ } | undefined;
131
+ activeClassName?: string | undefined;
132
+ focusClassName?: string | undefined;
133
+ components?: {
134
+ [x: string]: {
135
+ classNames?: any;
136
+ styles?: any;
137
+ vars?: any;
138
+ defaultProps?: any;
139
+ } | undefined;
140
+ } | undefined;
141
+ other?: {
142
+ [x: string]: any;
143
+ } | undefined;
144
+ };
145
+ };
@@ -0,0 +1,4 @@
1
+ export declare const useFormMobile: () => {
2
+ ref: import('react').RefObject<any>;
3
+ isMobile: boolean;
4
+ };
@@ -0,0 +1,2 @@
1
+ export declare const useInterpolateText: (text?: string | null, disabled?: boolean) => string;
2
+ export declare const useInterpolate: () => (text?: string | null) => string;
@@ -0,0 +1,8 @@
1
+ export * from './FormViewer';
2
+ export * from './types/form';
3
+ export * from './types/schemes';
4
+ export * from './store/formStore';
5
+ export * from './store/formStoreApi';
6
+ export * from './store/selectors';
7
+ export * from './hooks';
8
+ export * from './helpers';
@@ -0,0 +1,112 @@
1
+ import { UploadFileData } from '../components/fields/UploadField/UploadField';
2
+ import { ParsedFormConfig, SettingsData, StepData, ThemeData } from '../types/form';
3
+ export type FormEditorTabType = 'steps' | 'add' | 'settings' | 'logic';
4
+ export type FormViewLayout = 'all-slides' | 'one-slide';
5
+ export type FormStoreState = {
6
+ steps: StepData[];
7
+ listStep: StepData;
8
+ activeStep: string | null;
9
+ settings: SettingsData;
10
+ theme: ThemeData;
11
+ isMobile?: boolean;
12
+ editing?: boolean;
13
+ preview?: boolean;
14
+ initialConfigSnapshot: ParsedFormConfig | null;
15
+ addEndStep?: () => StepData;
16
+ onConfigChange?: (config: ParsedFormConfig) => void;
17
+ uploadFileFn?: (file: UploadFileData) => Promise<string>;
18
+ layout?: FormViewLayout;
19
+ };
20
+ export declare const emptySettings: SettingsData;
21
+ export declare const createFormStore: (props?: {
22
+ initialState?: Partial<FormStoreState>;
23
+ }) => {
24
+ useStore: import('zustand').UseBoundStore<import('zustand').StoreApi<FormStoreState>>;
25
+ api: {
26
+ applyTheme: (theme: ThemeData) => void;
27
+ setLayout: (layout: FormViewLayout) => void;
28
+ patchSettingsData: (v: Partial<SettingsData>) => void;
29
+ patchThemeData: (v: Partial<ThemeData>) => void;
30
+ patchContainerTheme: (v: Partial<import('../types/form').ContainerProperties>) => void;
31
+ patchTitleProperties: (v: Partial<import('../types/form').TextProperties>) => void;
32
+ patchDescriptionProperties: (v: Partial<import('../types/form').TextProperties>) => void;
33
+ patchCommonFontProperties: (v: Partial<import('../types/form').TextProperties>) => void;
34
+ setActiveStep: (v: string | null) => void;
35
+ setSteps: (steps: StepData[]) => void;
36
+ addStep: (step: StepData, index?: number) => void;
37
+ removeStep: (stepId: string) => void;
38
+ updateStep: (stepId: string, updatedStep: Partial<StepData>) => void;
39
+ updateControl: <CONTROL extends import('../types/form').Control>(stepId: string, controlId: string, updatedControl: Partial<CONTROL>) => void;
40
+ reorderSteps: (fromId: string, toId: string) => void;
41
+ reorderControls: (stepId: string, activeId: string, overId: string) => void;
42
+ addControl: (stepId: string, newControl: import('../types/form').Control) => void;
43
+ removeControl: (stepId: string, controlId: string) => void;
44
+ addCondition: (stepId: string, newCondition: import('../types/form').Condition) => void;
45
+ updateCondition: (stepId: string, conditionIndex: number, updatedCondition: Partial<import('../types/form').Condition>) => void;
46
+ removeCondition: (stepId: string, conditionIndex: number) => void;
47
+ setIsMobile: (isMobile: boolean) => void;
48
+ setFormConfig: (config: ParsedFormConfig | null, { silent }?: {
49
+ silent?: boolean;
50
+ }) => void;
51
+ isFormDirty: () => boolean;
52
+ switchToNextStep: () => void;
53
+ switchToPrevStep: () => void;
54
+ setActiveStepId: (stepId: string | null) => void;
55
+ setFormLayout: (layout: import('../types/form').FormLayout) => void;
56
+ scrollToControl: (controlId: string) => void;
57
+ };
58
+ };
59
+ /** Необходимо оборачивать FormViewer в провайдер, иначе будет использоваться `globalFormStore` */
60
+ export declare const FormStoreProvider: ({ children, editing, preview, store, addEndStep, onConfigChange, uploadFileFn, layout, }: {
61
+ children: React.ReactNode;
62
+ /** Режим для редактирования */
63
+ editing?: boolean;
64
+ /** Режим для предпросмотра */
65
+ preview?: boolean;
66
+ onConfigChange?: (config: ParsedFormConfig) => void;
67
+ /** Можно создать и передать стор снаружи, в ином случае стор создается внутри провайдера */
68
+ store?: ReturnType<typeof createFormStore>;
69
+ /** Добавит конечный шаг, если его нету */
70
+ addEndStep?: () => StepData;
71
+ /** Как отображать форму */
72
+ layout?: FormViewLayout;
73
+ /** Функция для загрузки файлов пользователем */
74
+ uploadFileFn?: (file: UploadFileData) => Promise<any>;
75
+ }) => import("react/jsx-runtime").JSX.Element;
76
+ /** Возвращает ближайший стор для формы, если таких нет - вернёт слобальный стор */
77
+ export declare const useFormViewerStore: () => {
78
+ useStore: import('zustand').UseBoundStore<import('zustand').StoreApi<FormStoreState>>;
79
+ api: {
80
+ applyTheme: (theme: ThemeData) => void;
81
+ setLayout: (layout: FormViewLayout) => void;
82
+ patchSettingsData: (v: Partial<SettingsData>) => void;
83
+ patchThemeData: (v: Partial<ThemeData>) => void;
84
+ patchContainerTheme: (v: Partial<import('../types/form').ContainerProperties>) => void;
85
+ patchTitleProperties: (v: Partial<import('../types/form').TextProperties>) => void;
86
+ patchDescriptionProperties: (v: Partial<import('../types/form').TextProperties>) => void;
87
+ patchCommonFontProperties: (v: Partial<import('../types/form').TextProperties>) => void;
88
+ setActiveStep: (v: string | null) => void;
89
+ setSteps: (steps: StepData[]) => void;
90
+ addStep: (step: StepData, index?: number) => void;
91
+ removeStep: (stepId: string) => void;
92
+ updateStep: (stepId: string, updatedStep: Partial<StepData>) => void;
93
+ updateControl: <CONTROL extends import('../types/form').Control>(stepId: string, controlId: string, updatedControl: Partial<CONTROL>) => void;
94
+ reorderSteps: (fromId: string, toId: string) => void;
95
+ reorderControls: (stepId: string, activeId: string, overId: string) => void;
96
+ addControl: (stepId: string, newControl: import('../types/form').Control) => void;
97
+ removeControl: (stepId: string, controlId: string) => void;
98
+ addCondition: (stepId: string, newCondition: import('../types/form').Condition) => void;
99
+ updateCondition: (stepId: string, conditionIndex: number, updatedCondition: Partial<import('../types/form').Condition>) => void;
100
+ removeCondition: (stepId: string, conditionIndex: number) => void;
101
+ setIsMobile: (isMobile: boolean) => void;
102
+ setFormConfig: (config: ParsedFormConfig | null, { silent }?: {
103
+ silent?: boolean;
104
+ }) => void;
105
+ isFormDirty: () => boolean;
106
+ switchToNextStep: () => void;
107
+ switchToPrevStep: () => void;
108
+ setActiveStepId: (stepId: string | null) => void;
109
+ setFormLayout: (layout: import('../types/form').FormLayout) => void;
110
+ scrollToControl: (controlId: string) => void;
111
+ };
112
+ };
@@ -0,0 +1,36 @@
1
+ import { StoreApi, UseBoundStore } from 'zustand';
2
+ import { Condition, ContainerProperties, Control, FormLayout, ParsedFormConfig, SettingsData, StepData, TextProperties, ThemeData } from '../types/form';
3
+ import { FormStoreState, FormViewLayout } from './formStore';
4
+ export declare const createFormStoreApi: (store: UseBoundStore<StoreApi<FormStoreState>>) => {
5
+ applyTheme: (theme: ThemeData) => void;
6
+ setLayout: (layout: FormViewLayout) => void;
7
+ patchSettingsData: (v: Partial<SettingsData>) => void;
8
+ patchThemeData: (v: Partial<ThemeData>) => void;
9
+ patchContainerTheme: (v: Partial<ContainerProperties>) => void;
10
+ patchTitleProperties: (v: Partial<TextProperties>) => void;
11
+ patchDescriptionProperties: (v: Partial<TextProperties>) => void;
12
+ patchCommonFontProperties: (v: Partial<TextProperties>) => void;
13
+ setActiveStep: (v: string | null) => void;
14
+ setSteps: (steps: StepData[]) => void;
15
+ addStep: (step: StepData, index?: number) => void;
16
+ removeStep: (stepId: string) => void;
17
+ updateStep: (stepId: string, updatedStep: Partial<StepData>) => void;
18
+ updateControl: <CONTROL extends Control>(stepId: string, controlId: string, updatedControl: Partial<CONTROL>) => void;
19
+ reorderSteps: (fromId: string, toId: string) => void;
20
+ reorderControls: (stepId: string, activeId: string, overId: string) => void;
21
+ addControl: (stepId: string, newControl: Control) => void;
22
+ removeControl: (stepId: string, controlId: string) => void;
23
+ addCondition: (stepId: string, newCondition: Condition) => void;
24
+ updateCondition: (stepId: string, conditionIndex: number, updatedCondition: Partial<Condition>) => void;
25
+ removeCondition: (stepId: string, conditionIndex: number) => void;
26
+ setIsMobile: (isMobile: boolean) => void;
27
+ setFormConfig: (config: ParsedFormConfig | null, { silent }?: {
28
+ silent?: boolean;
29
+ }) => void;
30
+ isFormDirty: () => boolean;
31
+ switchToNextStep: () => void;
32
+ switchToPrevStep: () => void;
33
+ setActiveStepId: (stepId: string | null) => void;
34
+ setFormLayout: (layout: FormLayout) => void;
35
+ scrollToControl: (controlId: string) => void;
36
+ };