@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.
- package/dist/{KanbanLayout-DGHT9E0N.js → KanbanLayout-D5Ex3f-G.js} +1 -1
- package/dist/components/AttachmentsGalleryModal/ShakaPlayer.d.ts +5 -0
- package/dist/components/BouncingLogo/BouncingLogo.d.ts +3 -0
- package/dist/components/CommentComposer/index.d.ts +8 -10
- package/dist/components/CommentsPanel/components/CommentActionMenu.d.ts +1 -5
- package/dist/components/CommentsPanel/components/{CommentTabFilter.d.ts → CommentFilterMenu.d.ts} +1 -2
- package/dist/components/CommentsPanel/components/CommentPanelListItem.d.ts +4 -3
- package/dist/components/CommentsPanel/components/CommentsEmptyPlaceholder.d.ts +2 -5
- package/dist/components/CommentsPanel/components/CommentsListItemMenu.d.ts +1 -2
- package/dist/components/CommentsPanel/components/CommentsMultiSelectUsers.d.ts +6 -0
- package/dist/components/CommentsPanel/components/CommentsPanelList.d.ts +4 -3
- package/dist/components/CommentsPanel/components/CommentsThreadReplyControls.d.ts +1 -5
- package/dist/components/CommentsPanel/components/CommentsUploadFilesPreview.d.ts +5 -9
- package/dist/components/CommentsPanel/components/RemoveConfirmModal.d.ts +11 -0
- package/dist/components/CommentsPanel/index.d.ts +6 -10
- package/dist/components/CommentsPanel/store.d.ts +1 -7
- package/dist/components/CommentsPanel/types.d.ts +57 -157
- package/dist/components/CommentsPanel/utils.d.ts +5 -11
- package/dist/components/FormViewer/FormViewer.d.ts +8 -0
- package/dist/components/FormViewer/KeyboardNavigation.d.ts +5 -0
- package/dist/components/FormViewer/components/AllSlidesLayout.d.ts +7 -0
- package/dist/components/FormViewer/components/Container.d.ts +5 -0
- package/dist/components/FormViewer/components/ListFocusBox.d.ts +4 -0
- package/dist/components/FormViewer/components/NavControls.d.ts +4 -0
- package/dist/components/FormViewer/components/Navigation/Navigation.d.ts +1 -0
- package/dist/components/FormViewer/components/OneSlideLayput.d.ts +7 -0
- package/dist/components/FormViewer/components/Step.d.ts +5 -0
- package/dist/components/FormViewer/components/StepDescription.d.ts +5 -0
- package/dist/components/FormViewer/components/StepTitle.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/AddOptionButton.d.ts +3 -0
- package/dist/components/FormViewer/components/fields/ButtonField/ButtonField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/ButtonField/InnerButton.d.ts +8 -0
- package/dist/components/FormViewer/components/fields/ChoiceField/ChoiceCard.d.ts +11 -0
- package/dist/components/FormViewer/components/fields/ChoiceField/ChoiceField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/ChoiceField/PictureChoiceCard.d.ts +12 -0
- package/dist/components/FormViewer/components/fields/ChoiceField/PictureChoiceField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/ConfirmButton.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/ConfirmField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/DateField.d.ts +4 -0
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.d.ts +11 -0
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/EmailField.d.ts +4 -0
- package/dist/components/FormViewer/components/fields/LocationField.d.ts +4 -0
- package/dist/components/FormViewer/components/fields/LongTextField.d.ts +4 -0
- package/dist/components/FormViewer/components/fields/MultipleChoice/MultipleChoiceCard.d.ts +12 -0
- package/dist/components/FormViewer/components/fields/MultipleChoice/MultipleChoiceField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/NumberField.d.ts +4 -0
- package/dist/components/FormViewer/components/fields/PhoneField.d.ts +4 -0
- package/dist/components/FormViewer/components/fields/ProgressLine.d.ts +1 -0
- package/dist/components/FormViewer/components/fields/RatingField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/SelectableCard/PictureSelectableCard.d.ts +21 -0
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.d.ts +14 -0
- package/dist/components/FormViewer/components/fields/SliderField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/StartButton.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/StartField.d.ts +5 -0
- package/dist/components/FormViewer/components/fields/TextField.d.ts +4 -0
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts +30 -0
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.d.ts +8 -0
- package/dist/components/FormViewer/components/fields/YesNoField.d.ts +4 -0
- package/dist/components/FormViewer/helpers/conditions.d.ts +281 -0
- package/dist/components/FormViewer/helpers/controls.d.ts +6 -0
- package/dist/components/FormViewer/helpers/cssScoping.d.ts +11 -0
- package/dist/components/FormViewer/helpers/helpers.d.ts +279 -0
- package/dist/components/FormViewer/helpers/index.d.ts +7 -0
- package/dist/components/FormViewer/helpers/slides.d.ts +3 -0
- package/dist/components/FormViewer/helpers/staticClasses.d.ts +47 -0
- package/dist/components/FormViewer/helpers/steps.d.ts +294 -0
- package/dist/components/FormViewer/helpers/themeUtils.d.ts +2 -0
- package/dist/components/FormViewer/helpers/validation.d.ts +10 -0
- package/dist/components/FormViewer/hooks/index.d.ts +6 -0
- package/dist/components/FormViewer/hooks/useActiveControl.d.ts +204 -0
- package/dist/components/FormViewer/hooks/useActiveStep.d.ts +277 -0
- package/dist/components/FormViewer/hooks/useCreateFormContext.d.ts +22 -0
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +145 -0
- package/dist/components/FormViewer/hooks/useFormMobile.d.ts +4 -0
- package/dist/components/FormViewer/hooks/useInterpolateText.d.ts +2 -0
- package/dist/components/FormViewer/index.d.ts +8 -0
- package/dist/components/FormViewer/store/formStore.d.ts +149 -0
- package/dist/components/FormViewer/store/formStoreApi.d.ts +36 -0
- package/dist/components/FormViewer/store/selectors.d.ts +75757 -0
- package/dist/components/FormViewer/types/form.d.ts +58 -0
- package/dist/components/FormViewer/types/schemes.d.ts +7591 -0
- package/dist/hooks/useEvent.d.ts +1 -0
- package/dist/{index-BI1_FPl_.js → index-BVdsep1X.js} +50439 -18306
- package/dist/index.d.ts +2 -2
- package/dist/index.js +68 -4
- package/dist/index.umd.cjs +59 -59
- package/package.json +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +0 -12
- package/dist/components/CommentFilterMenu/index.d.ts +0 -9
- package/dist/components/modals/openRemoveConfirmModal.d.ts +0 -4
|
@@ -0,0 +1,149 @@
|
|
|
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?: boolean;
|
|
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?: boolean;
|
|
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
|
+
};
|
|
113
|
+
/** Глобальный стор формы, используется для редактора */
|
|
114
|
+
export declare const globalFormStore: {
|
|
115
|
+
useStore: import('zustand').UseBoundStore<import('zustand').StoreApi<FormStoreState>>;
|
|
116
|
+
api: {
|
|
117
|
+
applyTheme: (theme: ThemeData) => void;
|
|
118
|
+
setLayout: (layout: FormViewLayout) => void;
|
|
119
|
+
patchSettingsData: (v: Partial<SettingsData>) => void;
|
|
120
|
+
patchThemeData: (v: Partial<ThemeData>) => void;
|
|
121
|
+
patchContainerTheme: (v: Partial<import('../types/form').ContainerProperties>) => void;
|
|
122
|
+
patchTitleProperties: (v: Partial<import('../types/form').TextProperties>) => void;
|
|
123
|
+
patchDescriptionProperties: (v: Partial<import('../types/form').TextProperties>) => void;
|
|
124
|
+
patchCommonFontProperties: (v: Partial<import('../types/form').TextProperties>) => void;
|
|
125
|
+
setActiveStep: (v: string | null) => void;
|
|
126
|
+
setSteps: (steps: StepData[]) => void;
|
|
127
|
+
addStep: (step: StepData, index?: number) => void;
|
|
128
|
+
removeStep: (stepId: string) => void;
|
|
129
|
+
updateStep: (stepId: string, updatedStep: Partial<StepData>) => void;
|
|
130
|
+
updateControl: <CONTROL extends import('../types/form').Control>(stepId: string, controlId: string, updatedControl: Partial<CONTROL>) => void;
|
|
131
|
+
reorderSteps: (fromId: string, toId: string) => void;
|
|
132
|
+
reorderControls: (stepId: string, activeId: string, overId: string) => void;
|
|
133
|
+
addControl: (stepId: string, newControl: import('../types/form').Control) => void;
|
|
134
|
+
removeControl: (stepId: string, controlId: string) => void;
|
|
135
|
+
addCondition: (stepId: string, newCondition: import('../types/form').Condition) => void;
|
|
136
|
+
updateCondition: (stepId: string, conditionIndex: number, updatedCondition: Partial<import('../types/form').Condition>) => void;
|
|
137
|
+
removeCondition: (stepId: string, conditionIndex: number) => void;
|
|
138
|
+
setIsMobile: (isMobile: boolean) => void;
|
|
139
|
+
setFormConfig: (config: ParsedFormConfig | null, { silent }?: {
|
|
140
|
+
silent?: boolean;
|
|
141
|
+
}) => void;
|
|
142
|
+
isFormDirty: () => boolean;
|
|
143
|
+
switchToNextStep: () => void;
|
|
144
|
+
switchToPrevStep: () => void;
|
|
145
|
+
setActiveStepId: (stepId: string | null) => void;
|
|
146
|
+
setFormLayout: (layout: import('../types/form').FormLayout) => void;
|
|
147
|
+
scrollToControl: (controlId: string) => void;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
@@ -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
|
+
};
|