@digiform/builder 0.1.7 → 0.2.4
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/FormBuilder.d.ts +24 -0
- package/client.cjs +1 -1
- package/client.d.ts +18 -0
- package/client.js +1 -1
- package/component-registry/components/alert.d.ts +4 -0
- package/component-registry/components/button.d.ts +4 -0
- package/component-registry/components/checkbox.d.ts +9 -0
- package/component-registry/components/code-input/code-input.d.ts +4 -0
- package/component-registry/components/dropdown.d.ts +1 -0
- package/component-registry/components/heading.d.ts +4 -0
- package/component-registry/components/index.d.ts +35 -0
- package/component-registry/components/paragraph.d.ts +4 -0
- package/component-registry/components/progress-loader.d.ts +4 -0
- package/component-registry/components/radioGroup.d.ts +1 -0
- package/component-registry/components/text.d.ts +2 -0
- package/component-registry/components/textarea.d.ts +2 -0
- package/component-registry/createFormFieldComponent.d.ts +52 -0
- package/component-registry/index.d.ts +3 -0
- package/component-registry/types.d.ts +42 -0
- package/component-registry/utils.d.ts +33 -0
- package/component-registry/validation.d.ts +141 -0
- package/component-registry/validationBridge.d.ts +10 -0
- package/components/ConnectionErrorScreen/ConnectionErrorScreen.d.ts +10 -0
- package/components/DatabaseStatusIndicator/DatabaseStatusIndicator.d.ts +24 -0
- package/config/SecureConfigLoader.d.ts +57 -0
- package/config/hooks.d.ts +2 -0
- package/config/index.d.ts +5 -0
- package/config/types.d.ts +94 -0
- package/{configReader-BkMPr3Ju.js → configReader-C49NagAF.js} +4936 -4988
- package/configReader-C49NagAF.js.map +1 -0
- package/{configReader-CbGTKRUP.cjs → configReader-CT1_bYSZ.cjs} +7 -7
- package/configReader-CT1_bYSZ.cjs.map +1 -0
- package/design-system/components/ComponentSourceBadge/ComponentSourceBadge.d.ts +15 -0
- package/design-system/components/FormFieldWrapper/FormFieldWrapper.d.ts +18 -0
- package/design-system/custom/config/date-preset.config.d.ts +7 -0
- package/design-system/custom/config/email-preset.config.d.ts +7 -0
- package/design-system/custom/config/index.d.ts +10 -0
- package/design-system/custom/config/number-preset.config.d.ts +7 -0
- package/design-system/custom/config/tel-preset.config.d.ts +7 -0
- package/design-system/custom/index.d.ts +17 -0
- package/design-system/custom/utils/create-preset-config.d.ts +74 -0
- package/design-system/generated/rhc-catalog.generated.d.ts +9360 -0
- package/design-system/index.d.ts +15 -0
- package/design-system/rhc/components.d.ts +12 -0
- package/design-system/rhc/config/alert.config.d.ts +5 -0
- package/design-system/rhc/config/button.config.d.ts +8 -0
- package/design-system/rhc/config/checkbox.config.d.ts +4 -0
- package/design-system/rhc/config/form-builder.config.d.ts +74 -0
- package/design-system/rhc/config/heading.config.d.ts +5 -0
- package/design-system/rhc/config/index.d.ts +9 -0
- package/design-system/rhc/config/paragraph.config.d.ts +8 -0
- package/design-system/rhc/config/radio-group.config.d.ts +5 -0
- package/design-system/rhc/config/select.config.d.ts +5 -0
- package/design-system/rhc/config/text-input.config.d.ts +5 -0
- package/design-system/rhc/config/textarea.config.d.ts +4 -0
- package/design-system/rhc/index.d.ts +1 -0
- package/design-system/rhc/utils/create-config.d.ts +76 -0
- package/design-system/rhc/utils/generate-schema.d.ts +20 -0
- package/design-system/types.d.ts +22 -0
- package/error-boundaries/BaseErrorBoundary/BaseErrorBoundary.d.ts +31 -0
- package/error-boundaries/ComponentErrorBoundary/ComponentErrorBoundary.d.ts +9 -0
- package/error-boundaries/ErrorBoundaryTest/ErrorBoundaryTest.d.ts +2 -0
- package/error-boundaries/FlowBuilderErrorBoundary/FlowBuilderErrorBoundary.d.ts +7 -0
- package/error-boundaries/index.d.ts +1 -0
- package/features/condition-editor/components/ConditionEditor/ConditionEditor.d.ts +17 -0
- package/features/condition-editor/components/ConditionItem/ConditionItem.d.ts +17 -0
- package/features/condition-editor/components/ConditionOperatorSelect/ConditionOperatorSelect.d.ts +8 -0
- package/features/condition-editor/components/ConditionRow/ConditionRow.d.ts +14 -0
- package/features/condition-editor/components/ConditionSummary/ConditionSummary.d.ts +7 -0
- package/features/condition-editor/components/ConditionTargetSelect/ConditionTargetSelect.d.ts +14 -0
- package/features/condition-editor/components/ConditionValueInput/ConditionValueInput.d.ts +10 -0
- package/features/condition-editor/components/EditConditionForm/EditConditionForm.d.ts +13 -0
- package/features/condition-editor/components/ExistingCondition/ExistingCondition.d.ts +13 -0
- package/features/condition-editor/components/LogicalConnector/LogicalConnector.d.ts +8 -0
- package/features/condition-editor/components/LogicalOperatorToggle/LogicalOperatorToggle.d.ts +13 -0
- package/features/condition-editor/components/NewConditionBuilder/NewConditionBuilder.d.ts +10 -0
- package/features/condition-editor/components/NewConditionRow/NewConditionRow.d.ts +15 -0
- package/features/condition-editor/components/VisibilityConditionBuilder/VisibilityConditionBuilder.d.ts +17 -0
- package/features/condition-editor/components/hooks/useTargetComponents.d.ts +6 -0
- package/features/condition-editor/components/utils/conditionUtils.d.ts +7 -0
- package/features/condition-editor/components/visibilityHelpers.d.ts +21 -0
- package/features/condition-editor/index.d.ts +17 -0
- package/features/dialog-system/components/ConfirmDialog.d.ts +12 -0
- package/features/dialog-system/components/DialogEditor/DialogEditor.d.ts +12 -0
- package/features/dialog-system/components/ModalDialog/ModalDialog.d.ts +12 -0
- package/features/dialog-system/components/VerifyEmailDialog/VerifyEmailDialog.d.ts +10 -0
- package/features/dialog-system/index.d.ts +4 -0
- package/features/form-builder/components/actions/ActionsPanel/ActionsPanel.d.ts +3 -0
- package/features/form-builder/components/actions/SortableActionItem/SortableActionItem.d.ts +9 -0
- package/features/form-builder/components/actions/index.d.ts +4 -0
- package/features/form-builder/components/actions-menu/FormBuilderActionsMenu/FormBuilderActionsMenu.d.ts +1 -0
- package/features/form-builder/components/actions-menu/index.d.ts +3 -0
- package/features/form-builder/components/actions-menu/items/CreateTemplateMenuItem/CreateTemplateMenuItem.d.ts +2 -0
- package/features/form-builder/components/actions-menu/items/ExampleMenuItem/ExampleMenuItem.d.ts +2 -0
- package/features/form-builder/components/actions-menu/items/index.d.ts +2 -0
- package/features/form-builder/components/actions-menu/registry.d.ts +9 -0
- package/features/form-builder/components/actions-menu/types.d.ts +44 -0
- package/features/form-builder/components/buttons/PreviewButton/PreviewButton.d.ts +74 -0
- package/features/form-builder/components/buttons/SaveDropdownButton/SaveDropdownButton.d.ts +8 -0
- package/features/form-builder/components/buttons/index.d.ts +6 -0
- package/features/form-builder/components/canvas/AdminRenderCanvasItems/AdminRenderCanvasItems.d.ts +15 -0
- package/features/form-builder/components/canvas/Canvas/Canvas.d.ts +3 -0
- package/features/form-builder/components/canvas/CanvasComponent/CanvasComponent.d.ts +16 -0
- package/features/form-builder/components/canvas/SortableComponent/SortableComponent.d.ts +13 -0
- package/features/form-builder/components/canvas/index.d.ts +8 -0
- package/features/form-builder/components/components-panel/FormWizardComponentItem/FormWizardComponentItem.d.ts +7 -0
- package/features/form-builder/components/components-panel/FormWizardComponentsPanel/FormWizardComponentsPanel.d.ts +6 -0
- package/features/form-builder/components/components-panel/SortableComponentItem/SortableComponentItem.d.ts +20 -0
- package/features/form-builder/components/components-panel/index.d.ts +6 -0
- package/features/form-builder/components/core/AdminFormContent/AdminFormContent.d.ts +5 -0
- package/features/form-builder/components/core/FormBuilder/FormBuilder.d.ts +23 -0
- package/features/form-builder/components/core/index.d.ts +4 -0
- package/features/form-builder/components/editors/AdminPropertiesPanel/AdminPropertiesPanel.d.ts +3 -0
- package/features/form-builder/components/editors/ConditionsTab/ConditionsTab.d.ts +10 -0
- package/features/form-builder/components/editors/NavigationEditor/NavigationEditor.d.ts +13 -0
- package/features/form-builder/components/editors/NavigationSettings/NavigationSettings.d.ts +2 -0
- package/features/form-builder/components/editors/SectionConfigEditor/SectionConfigEditor.d.ts +8 -0
- package/features/form-builder/components/editors/index.d.ts +10 -0
- package/features/form-builder/components/fields/FieldValueButton/FieldValueButton.d.ts +7 -0
- package/features/form-builder/components/fields/FormFieldSelector/FormFieldSelector.d.ts +19 -0
- package/features/form-builder/components/fields/index.d.ts +4 -0
- package/features/form-builder/components/index.d.ts +13 -0
- package/features/form-builder/components/layout/FormFooter.d.ts +11 -0
- package/features/form-builder/components/layout/FormFooterBase.d.ts +15 -0
- package/features/form-builder/components/layout/FormHeader/FormHeader.d.ts +35 -0
- package/features/form-builder/components/layout/index.d.ts +6 -0
- package/features/form-builder/components/panels/RightPanel/RightPanel.d.ts +1 -0
- package/features/form-builder/components/panels/index.d.ts +1 -0
- package/features/form-builder/components/sections/AdminFormSection/AdminFormSection.d.ts +14 -0
- package/features/form-builder/components/sections/SectionContainer/SectionContainer.d.ts +13 -0
- package/features/form-builder/components/sections/index.d.ts +4 -0
- package/features/form-builder/components/steps/AdminStepSettings/AdminStepSettings.d.ts +7 -0
- package/features/form-builder/components/steps/SortableStepItem/SortableStepItem.d.ts +18 -0
- package/features/form-builder/components/steps/StepLockIndicator/StepLockIndicator.d.ts +18 -0
- package/features/form-builder/components/steps/StepsList/StepsList.d.ts +3 -0
- package/features/form-builder/components/steps/index.d.ts +8 -0
- package/features/form-builder/context/FormBuilderContext.d.ts +30 -0
- package/features/form-builder/context/ResolvedStepContext.d.ts +9 -0
- package/features/form-builder/hooks/useCurrentStep.d.ts +18 -0
- package/features/form-builder/hooks/useDragAndDrop.d.ts +16 -0
- package/features/form-builder/hooks/useDragFeedback.d.ts +32 -0
- package/features/form-builder/hooks/useHoldToDrag.d.ts +18 -0
- package/features/form-builder/hooks/usePreviewConfig.d.ts +23 -0
- package/features/form-builder/hooks/useSectionOperations.d.ts +7 -0
- package/features/form-builder/index.d.ts +10 -0
- package/features/form-builder/providers/DragAndDropProvider/DragAndDropProvider.d.ts +8 -0
- package/features/form-builder/utils/PropertyLockIndicator/PropertyLockIndicator.d.ts +30 -0
- package/features/form-builder/utils/bodyConversionUtils.d.ts +35 -0
- package/features/form-builder/utils/collisionDetection.d.ts +6 -0
- package/features/form-management/components/FormBuilderView/FormBuilderView.d.ts +17 -0
- package/features/form-management/components/FormExplorer/FormExplorer.d.ts +38 -0
- package/features/form-management/components/FormExplorerCore/FormExplorerCore.d.ts +67 -0
- package/features/form-management/components/FormManager/FormManager.d.ts +43 -0
- package/features/form-management/components/FormSectionList/FormSectionList.d.ts +1 -0
- package/features/form-management/components/FormsView/FormsView.d.ts +40 -0
- package/features/form-management/components/NewFormDialog/NewFormDialog.d.ts +25 -0
- package/features/form-management/components/NewProjectDialog/NewProjectDialog.d.ts +23 -0
- package/features/form-management/components/ProjectCard/ProjectCard.d.ts +9 -0
- package/features/form-management/components/ProjectsView/ProjectsView.d.ts +20 -0
- package/features/form-management/components/SearchInput/SearchInput.d.ts +9 -0
- package/features/form-management/components/ViewCard/ViewCard.d.ts +40 -0
- package/features/form-management/components/pages/FormBuilderPage.d.ts +3 -0
- package/features/form-management/components/pages/FormsPage.d.ts +3 -0
- package/features/form-management/components/pages/ProjectsPage.d.ts +16 -0
- package/features/form-management/components/pages/index.d.ts +13 -0
- package/features/form-management/hooks/index.d.ts +9 -0
- package/features/form-management/hooks/useFormActions.d.ts +20 -0
- package/features/form-management/hooks/useFormData.d.ts +13 -0
- package/features/form-management/hooks/useFormExplorerState.d.ts +26 -0
- package/features/form-management/hooks/useFormOperations.d.ts +17 -0
- package/features/form-management/hooks/useFormsQuery.d.ts +50 -0
- package/features/form-management/hooks/useProjectActions.d.ts +25 -0
- package/features/form-management/hooks/useProjectOperations.d.ts +10 -0
- package/features/form-management/hooks/useProjectsData.d.ts +13 -0
- package/features/form-management/index.d.ts +29 -0
- package/features/form-management/layout/BaseHeader/BaseHeader.d.ts +1 -0
- package/features/form-management/layout/BaseLayout/BaseLayout.d.ts +25 -0
- package/features/form-management/providers/QueryProvider.d.ts +8 -0
- package/features/form-management/types/viewTypes.d.ts +53 -0
- package/features/form-management/utils/configInitializer.d.ts +4 -0
- package/features/index.d.ts +9 -0
- package/features/property-editors/components/ComponentValidationEditor/ComponentValidationEditor.d.ts +12 -0
- package/features/property-editors/components/GenericPropertyEditor/GenericPropertyEditor.d.ts +13 -0
- package/features/property-editors/components/ProgressLoaderEditor/ProgressLoaderEditor.d.ts +12 -0
- package/features/property-editors/components/RadioGroupEditor/RadioGroupEditor.d.ts +3 -0
- package/features/property-editors/components/SelectEditor/SelectEditor.d.ts +3 -0
- package/features/property-editors/components/ValidationRuleEditor/ValidationRuleEditor.d.ts +23 -0
- package/features/property-editors/components/ValidationRuleListItem/ValidationRuleListItem.d.ts +9 -0
- package/features/property-editors/components/ValidationRuleSheet/ValidationRuleSheet.d.ts +14 -0
- package/features/property-editors/index.d.ts +5 -0
- package/features/property-editors/types/schema.d.ts +66 -0
- package/features/property-editors/types/types.d.ts +23 -0
- package/features/template-system/components/CreateTemplateDialog/CreateTemplateDialog.d.ts +17 -0
- package/features/template-system/components/DeleteTemplateDialog/DeleteTemplateDialog.d.ts +11 -0
- package/features/template-system/components/DuplicateTemplateDialog/DuplicateTemplateDialog.d.ts +11 -0
- package/features/template-system/components/EditTemplateDialog/EditTemplateDialog.d.ts +10 -0
- package/features/template-system/components/EnhancedTemplateBrowser/EnhancedTemplateBrowser.d.ts +11 -0
- package/features/template-system/components/TemplateContextMenu/TemplateContextMenu.d.ts +12 -0
- package/features/template-system/hooks/useTemplateGovernance.d.ts +46 -0
- package/features/template-system/hooks/useTemplatePermissions.d.ts +104 -0
- package/features/template-system/hooks/useTemplateStepTitle.d.ts +5 -0
- package/features/template-system/index.d.ts +17 -0
- package/features/template-system/services/TemplateStorageService.d.ts +52 -0
- package/features/template-system/utils/templateApplication.d.ts +75 -0
- package/features/template-system/utils/templateCategories.d.ts +105 -0
- package/features/template-system/utils/templateConfig.d.ts +148 -0
- package/features/template-system/utils/templateDeletion.d.ts +44 -0
- package/features/template-system/utils/templateDuplication.d.ts +65 -0
- package/features/template-system/utils/templateGovernance.d.ts +54 -0
- package/features/template-system/utils/templateLoader.d.ts +25 -0
- package/features/template-system/utils/templateMetadataOperations.d.ts +40 -0
- package/features/template-system/utils/templateUtils.d.ts +12 -0
- package/features/trigger-action-system/components/ActionConfigurationSheet/ActionConfigurationSheet.d.ts +9 -0
- package/features/trigger-action-system/components/ActionEditor/ActionEditor.d.ts +15 -0
- package/features/trigger-action-system/components/ActionsList/ActionsList.d.ts +8 -0
- package/features/trigger-action-system/components/ComponentTriggerActionEditor/ComponentTriggerActionEditor.d.ts +8 -0
- package/features/trigger-action-system/components/TriggerContextSelector/TriggerContextSelector.d.ts +9 -0
- package/features/trigger-action-system/index.d.ts +5 -0
- package/features/visual-mapping/components/ApiCallEditor/ApiCallEditor.d.ts +15 -0
- package/features/visual-mapping/components/ApiResponsePreview/ApiResponsePreview.d.ts +8 -0
- package/features/visual-mapping/components/ApiStructureTree/ApiStructureTree.d.ts +10 -0
- package/features/visual-mapping/components/CompactApiTestButton/CompactApiTestButton.d.ts +11 -0
- package/features/visual-mapping/components/ConnectionCircle/ConnectionCircle.d.ts +8 -0
- package/features/visual-mapping/components/ConnectionLines/ConnectionLines.d.ts +8 -0
- package/features/visual-mapping/components/CurrentMappingsDisplay/CurrentMappingsDisplay.d.ts +5 -0
- package/features/visual-mapping/components/EmptyFormFieldsMessage/EmptyFormFieldsMessage.d.ts +1 -0
- package/features/visual-mapping/components/FormFieldItem/FormFieldItem.d.ts +9 -0
- package/features/visual-mapping/components/FormFieldsList/FormFieldsList.d.ts +9 -0
- package/features/visual-mapping/components/KeyValueEditor/KeyValueEditor.d.ts +39 -0
- package/features/visual-mapping/components/MappingActionsDropdownMenu/MappingActionsDropdownMenu.d.ts +9 -0
- package/features/visual-mapping/components/MappingConnections/MappingConnections.d.ts +10 -0
- package/features/visual-mapping/components/RequestBodyEditor/RequestBodyEditor.d.ts +10 -0
- package/features/visual-mapping/components/SearchBar/SearchBar.d.ts +25 -0
- package/features/visual-mapping/components/VisualApiMappingInterface/VisualApiMappingInterface.d.ts +9 -0
- package/features/visual-mapping/components/index.d.ts +2 -0
- package/features/visual-mapping/components/typeCompatibility.d.ts +4 -0
- package/features/visual-mapping/components/utils/getFormFieldDataType.d.ts +2 -0
- package/features/visual-mapping/index.d.ts +18 -0
- package/features/visual-mapping/utils/apiBodyUtils.d.ts +1 -0
- package/index.cjs +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +35 -0
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/integrations/NextJSIntegration.d.ts +23 -0
- package/integrations/ReactRouterIntegration.d.ts +16 -0
- package/integrations/index.d.ts +12 -0
- package/integrations/react-router/FormBuilderPage/FormBuilderPage.d.ts +23 -0
- package/integrations/react-router/FormsPage.d.ts +18 -0
- package/integrations/react-router/index.d.ts +11 -0
- package/package.json +1 -1
- package/providers/FormSaveContext.d.ts +20 -0
- package/providers/FormSaveProvider.d.ts +93 -0
- package/providers/ThemeProvider.d.ts +2 -0
- package/providers/index.d.ts +9 -0
- package/server.d.ts +8 -0
- package/storage/FilesystemStorageProvider.d.ts +19 -0
- package/storage/NullStorageProvider.d.ts +15 -0
- package/storage/PgLiteSyncProvider.d.ts +41 -0
- package/storage/StorageProviderFactory.d.ts +77 -0
- package/storage/ZeroConfigFilesystemStorageProvider.d.ts +157 -0
- package/storage/database-schemas.d.ts +17901 -0
- package/storage/database-types.d.ts +194 -0
- package/storage/index.d.ts +17 -0
- package/storage/types.d.ts +195 -0
- package/store/formBuilderStore.d.ts +287 -0
- package/store/index.d.ts +7 -0
- package/store/initialState/templates.d.ts +22 -0
- package/styles/index.d.ts +0 -0
- package/utils/configInitializer.d.ts +11 -0
- package/utils/configReader.d.ts +13 -0
- package/utils/fieldChangeValidation.d.ts +127 -0
- package/utils/fileStorage.d.ts +253 -0
- package/utils/formSaver.d.ts +22 -0
- package/utils/formsExplorer.d.ts +128 -0
- package/utils/index.d.ts +2 -0
- package/utils/routeUtils.d.ts +85 -0
- package/configReader-BkMPr3Ju.js.map +0 -1
- package/configReader-CbGTKRUP.cjs.map +0 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database schema types for PgLite form storage
|
|
3
|
+
* Generated from PgLiteStorageProvider table definitions
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Projects table - Top-level project containers
|
|
7
|
+
*
|
|
8
|
+
* Schema:
|
|
9
|
+
* - id: SERIAL PRIMARY KEY
|
|
10
|
+
* - name: VARCHAR(255) UNIQUE NOT NULL
|
|
11
|
+
* - directory_name: VARCHAR(255) UNIQUE NOT NULL
|
|
12
|
+
* - description: TEXT
|
|
13
|
+
* - created_at: TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
|
14
|
+
* - updated_at: TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
|
15
|
+
*/
|
|
16
|
+
export interface ProjectTable {
|
|
17
|
+
id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
directory_name: string;
|
|
20
|
+
description: string | null;
|
|
21
|
+
created_at: Date;
|
|
22
|
+
updated_at: Date;
|
|
23
|
+
}
|
|
24
|
+
export interface CreateProjectInput {
|
|
25
|
+
name: string;
|
|
26
|
+
directory_name: string;
|
|
27
|
+
description?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface UpdateProjectInput {
|
|
30
|
+
name?: string;
|
|
31
|
+
directory_name?: string;
|
|
32
|
+
description?: string | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Wizards table - Form definitions within projects
|
|
36
|
+
*
|
|
37
|
+
* Schema:
|
|
38
|
+
* - id: SERIAL PRIMARY KEY
|
|
39
|
+
* - project_id: INTEGER REFERENCES projects(id) ON DELETE CASCADE
|
|
40
|
+
* - name: VARCHAR(255) NOT NULL
|
|
41
|
+
* - title: VARCHAR(255) NOT NULL
|
|
42
|
+
* - description: TEXT
|
|
43
|
+
* - created_at: TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
|
44
|
+
* - updated_at: TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
|
45
|
+
* - UNIQUE(project_id, name)
|
|
46
|
+
*/
|
|
47
|
+
export interface WizardTable {
|
|
48
|
+
id: number;
|
|
49
|
+
project_id: number;
|
|
50
|
+
name: string;
|
|
51
|
+
title: string;
|
|
52
|
+
description: string | null;
|
|
53
|
+
created_at: Date;
|
|
54
|
+
updated_at: Date;
|
|
55
|
+
}
|
|
56
|
+
export interface CreateWizardInput {
|
|
57
|
+
project_id: number;
|
|
58
|
+
name: string;
|
|
59
|
+
title: string;
|
|
60
|
+
description?: string | null;
|
|
61
|
+
}
|
|
62
|
+
export interface UpdateWizardInput {
|
|
63
|
+
name?: string;
|
|
64
|
+
title?: string;
|
|
65
|
+
description?: string | null;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Flows table - Versions/configurations of wizards
|
|
69
|
+
*
|
|
70
|
+
* Schema:
|
|
71
|
+
* - id: SERIAL PRIMARY KEY
|
|
72
|
+
* - wizard_id: INTEGER REFERENCES wizards(id) ON DELETE CASCADE
|
|
73
|
+
* - version: INTEGER NOT NULL DEFAULT 1
|
|
74
|
+
* - name: VARCHAR(255)
|
|
75
|
+
* - form_config: JSONB NOT NULL
|
|
76
|
+
* - is_active: BOOLEAN NOT NULL DEFAULT true
|
|
77
|
+
* - created_at: TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
|
78
|
+
* - updated_at: TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
|
79
|
+
* - UNIQUE(wizard_id, version)
|
|
80
|
+
*/
|
|
81
|
+
export interface FlowTable {
|
|
82
|
+
id: number;
|
|
83
|
+
wizard_id: number;
|
|
84
|
+
version: number;
|
|
85
|
+
name: string | null;
|
|
86
|
+
form_config: Record<string, unknown>;
|
|
87
|
+
is_active: boolean;
|
|
88
|
+
created_at: Date;
|
|
89
|
+
updated_at: Date;
|
|
90
|
+
}
|
|
91
|
+
export interface CreateFlowInput {
|
|
92
|
+
wizard_id: number;
|
|
93
|
+
version?: number;
|
|
94
|
+
name?: string | null;
|
|
95
|
+
form_config: Record<string, unknown>;
|
|
96
|
+
is_active?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface UpdateFlowInput {
|
|
99
|
+
version?: number;
|
|
100
|
+
name?: string | null;
|
|
101
|
+
form_config?: any;
|
|
102
|
+
is_active?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Database relationships and constraints
|
|
106
|
+
*/
|
|
107
|
+
export interface ProjectWithWizards extends ProjectTable {
|
|
108
|
+
wizards: WizardTable[];
|
|
109
|
+
}
|
|
110
|
+
export interface WizardWithFlows extends WizardTable {
|
|
111
|
+
flows: FlowTable[];
|
|
112
|
+
}
|
|
113
|
+
export interface WizardWithProject extends WizardTable {
|
|
114
|
+
project: ProjectTable;
|
|
115
|
+
}
|
|
116
|
+
export interface FlowWithWizard extends FlowTable {
|
|
117
|
+
wizard: WizardTable;
|
|
118
|
+
}
|
|
119
|
+
export interface ProjectHierarchy extends ProjectTable {
|
|
120
|
+
wizards: Array<WizardTable & {
|
|
121
|
+
flows: FlowTable[];
|
|
122
|
+
}>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Database indexes (for reference)
|
|
126
|
+
*
|
|
127
|
+
* Performance indexes created:
|
|
128
|
+
* - idx_projects_directory_name ON projects(directory_name)
|
|
129
|
+
* - idx_wizards_project_id ON wizards(project_id)
|
|
130
|
+
* - idx_wizards_name ON wizards(name)
|
|
131
|
+
* - idx_flows_wizard_id ON flows(wizard_id)
|
|
132
|
+
* - idx_flows_active ON flows(wizard_id, is_active) WHERE is_active = true
|
|
133
|
+
* - idx_flows_version ON flows(wizard_id, version)
|
|
134
|
+
*/
|
|
135
|
+
/**
|
|
136
|
+
* Query result types for common operations
|
|
137
|
+
*/
|
|
138
|
+
export interface ProjectQueryResult {
|
|
139
|
+
id: number;
|
|
140
|
+
name: string;
|
|
141
|
+
directory_name: string;
|
|
142
|
+
description: string | null;
|
|
143
|
+
created_at: string;
|
|
144
|
+
updated_at: string;
|
|
145
|
+
}
|
|
146
|
+
export interface WizardQueryResult {
|
|
147
|
+
id: number;
|
|
148
|
+
project_id: number;
|
|
149
|
+
name: string;
|
|
150
|
+
title: string;
|
|
151
|
+
description: string | null;
|
|
152
|
+
created_at: string;
|
|
153
|
+
updated_at: string;
|
|
154
|
+
}
|
|
155
|
+
export interface FlowQueryResult {
|
|
156
|
+
id: number;
|
|
157
|
+
wizard_id: number;
|
|
158
|
+
version: number;
|
|
159
|
+
name: string | null;
|
|
160
|
+
form_config: Record<string, unknown>;
|
|
161
|
+
is_active: boolean;
|
|
162
|
+
created_at: string;
|
|
163
|
+
updated_at: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Utility types for database operations
|
|
167
|
+
*/
|
|
168
|
+
export type DatabaseTable = "projects" | "wizards" | "flows";
|
|
169
|
+
export interface DatabaseTableMap {
|
|
170
|
+
projects: ProjectTable;
|
|
171
|
+
wizards: WizardTable;
|
|
172
|
+
flows: FlowTable;
|
|
173
|
+
}
|
|
174
|
+
export interface DatabaseQueryResultMap {
|
|
175
|
+
projects: ProjectQueryResult;
|
|
176
|
+
wizards: WizardQueryResult;
|
|
177
|
+
flows: FlowQueryResult;
|
|
178
|
+
}
|
|
179
|
+
export interface DatabaseCreateInputMap {
|
|
180
|
+
projects: CreateProjectInput;
|
|
181
|
+
wizards: CreateWizardInput;
|
|
182
|
+
flows: CreateFlowInput;
|
|
183
|
+
}
|
|
184
|
+
export interface DatabaseUpdateInputMap {
|
|
185
|
+
projects: UpdateProjectInput;
|
|
186
|
+
wizards: UpdateWizardInput;
|
|
187
|
+
flows: UpdateFlowInput;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Type guards for runtime type checking
|
|
191
|
+
*/
|
|
192
|
+
export declare function isProjectTable(obj: unknown): obj is ProjectTable;
|
|
193
|
+
export declare function isWizardTable(obj: unknown): obj is WizardTable;
|
|
194
|
+
export declare function isFlowTable(obj: unknown): obj is FlowTable;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form Storage System
|
|
3
|
+
* Exportable storage providers and utilities for form persistence
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: FilesystemStorageProvider is NOT exported here to prevent bundling
|
|
6
|
+
* node:fs/node:path in client-side code. Use dynamic imports in server-side code:
|
|
7
|
+
* const { FilesystemStorageProvider } = await import('@formbuilder/builder/storage/FilesystemStorageProvider')
|
|
8
|
+
*/
|
|
9
|
+
export type { FormStorageConfig } from '../config/types';
|
|
10
|
+
export * from './PgLiteSyncProvider';
|
|
11
|
+
export { PgLiteSyncProvider } from './PgLiteSyncProvider';
|
|
12
|
+
export * from './StorageProviderFactory';
|
|
13
|
+
export { StorageProviderFactory } from './StorageProviderFactory';
|
|
14
|
+
export * from './ZeroConfigFilesystemStorageProvider';
|
|
15
|
+
export { ZeroConfigFilesystemStorageProvider } from './ZeroConfigFilesystemStorageProvider';
|
|
16
|
+
export type { CreateFormRequest, CreateProjectRequest, FormMetadata, FormStorageProvider, StorageResult, } from './types';
|
|
17
|
+
export * from './types';
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { FormStorageConfig } from '../config/types';
|
|
2
|
+
export type { FormStorageConfig };
|
|
3
|
+
export interface FormMetadata {
|
|
4
|
+
project: string;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
projectName?: string;
|
|
7
|
+
projectDescription?: string;
|
|
8
|
+
wizardId: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
lastModified: string;
|
|
12
|
+
created?: string;
|
|
13
|
+
source: string;
|
|
14
|
+
}
|
|
15
|
+
export interface StorageResult<T = any> {
|
|
16
|
+
success: boolean;
|
|
17
|
+
data?: T;
|
|
18
|
+
error?: string;
|
|
19
|
+
metadata?: {
|
|
20
|
+
source?: string;
|
|
21
|
+
path?: string;
|
|
22
|
+
lastModified?: string;
|
|
23
|
+
timestamp?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface CreateProjectRequest {
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CreateFormRequest {
|
|
31
|
+
projectId: string;
|
|
32
|
+
formId: string;
|
|
33
|
+
title: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CreateWizardRequest {
|
|
37
|
+
projectId: string;
|
|
38
|
+
name: string;
|
|
39
|
+
title: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface CreateFlowRequest {
|
|
43
|
+
wizardId: number;
|
|
44
|
+
name?: string;
|
|
45
|
+
formConfig: any;
|
|
46
|
+
version?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface WizardMetadata {
|
|
49
|
+
id: number;
|
|
50
|
+
projectId: number;
|
|
51
|
+
name: string;
|
|
52
|
+
title: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
created: string;
|
|
55
|
+
lastModified: string;
|
|
56
|
+
}
|
|
57
|
+
export interface FlowMetadata {
|
|
58
|
+
id: number;
|
|
59
|
+
wizardId: number;
|
|
60
|
+
version: number;
|
|
61
|
+
name?: string;
|
|
62
|
+
isActive: boolean;
|
|
63
|
+
created: string;
|
|
64
|
+
lastModified: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Base interface for all storage providers
|
|
68
|
+
*/
|
|
69
|
+
export interface FormStorageProvider {
|
|
70
|
+
/**
|
|
71
|
+
* Initialize the storage provider
|
|
72
|
+
*/
|
|
73
|
+
initialize(config: FormStorageConfig): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* List all forms across all projects
|
|
76
|
+
*/
|
|
77
|
+
listForms(): Promise<StorageResult<FormMetadata[]>>;
|
|
78
|
+
/**
|
|
79
|
+
* Load a specific form configuration
|
|
80
|
+
*/
|
|
81
|
+
loadForm(projectId: string, wizardId: string): Promise<StorageResult<any>>;
|
|
82
|
+
/**
|
|
83
|
+
* Save a form configuration
|
|
84
|
+
*/
|
|
85
|
+
saveForm(projectId: string, wizardId: string, config: any): Promise<StorageResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Create a new project
|
|
88
|
+
*/
|
|
89
|
+
createProject(request: CreateProjectRequest): Promise<StorageResult>;
|
|
90
|
+
/**
|
|
91
|
+
* Create a new wizard within a project
|
|
92
|
+
*/
|
|
93
|
+
createWizard?(request: CreateWizardRequest): Promise<StorageResult<{
|
|
94
|
+
wizardId: number;
|
|
95
|
+
}>>;
|
|
96
|
+
/**
|
|
97
|
+
* Create a new flow within a wizard
|
|
98
|
+
*/
|
|
99
|
+
createFlow?(request: CreateFlowRequest): Promise<StorageResult<{
|
|
100
|
+
flowId: number;
|
|
101
|
+
}>>;
|
|
102
|
+
/**
|
|
103
|
+
* Get all wizards for a project
|
|
104
|
+
*/
|
|
105
|
+
getWizardsByProject?(projectId: string): Promise<StorageResult<WizardMetadata[]>>;
|
|
106
|
+
/**
|
|
107
|
+
* Get all flows for a wizard
|
|
108
|
+
*/
|
|
109
|
+
getFlowsByWizard?(wizardId: number): Promise<StorageResult<FlowMetadata[]>>;
|
|
110
|
+
/**
|
|
111
|
+
* Delete a form (optional - not all providers may support this)
|
|
112
|
+
*/
|
|
113
|
+
deleteForm?(projectId: string, wizardId: string): Promise<StorageResult>;
|
|
114
|
+
/**
|
|
115
|
+
* Delete a project and all its associated forms/wizards/flows (optional - not all providers may support this)
|
|
116
|
+
*/
|
|
117
|
+
deleteProject?(projectId: string): Promise<StorageResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Get the storage provider type
|
|
120
|
+
*/
|
|
121
|
+
getType(): string;
|
|
122
|
+
}
|
|
123
|
+
export interface TemplateStorageConfig {
|
|
124
|
+
teamTemplatesPath?: string;
|
|
125
|
+
genericTemplatesPath?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface GenericTemplate {
|
|
128
|
+
id: string;
|
|
129
|
+
name: string;
|
|
130
|
+
metadata: {
|
|
131
|
+
name: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
};
|
|
134
|
+
stepsData: any[];
|
|
135
|
+
}
|
|
136
|
+
export interface PersonalTemplate extends GenericTemplate {
|
|
137
|
+
createdBy: string;
|
|
138
|
+
}
|
|
139
|
+
export interface SharedTemplate extends GenericTemplate {
|
|
140
|
+
sharedWith: string[];
|
|
141
|
+
permissions: {
|
|
142
|
+
canEdit: boolean;
|
|
143
|
+
canDelete: boolean;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export interface TeamTemplate {
|
|
147
|
+
metadata: {
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
category: "team";
|
|
152
|
+
tags: string[];
|
|
153
|
+
createdBy: string;
|
|
154
|
+
createdAt: number;
|
|
155
|
+
lastModified: number;
|
|
156
|
+
version: string;
|
|
157
|
+
usageCount: number;
|
|
158
|
+
};
|
|
159
|
+
stepsData: any[];
|
|
160
|
+
preview: {
|
|
161
|
+
componentCount: number;
|
|
162
|
+
sectionCount: number;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
export type TemplateCategory = "team" | "generic" | "personal" | "shared";
|
|
166
|
+
export interface TemplateFile {
|
|
167
|
+
id: string;
|
|
168
|
+
name: string;
|
|
169
|
+
path: string;
|
|
170
|
+
lastModified: Date;
|
|
171
|
+
}
|
|
172
|
+
export interface TemplateDirectory {
|
|
173
|
+
path: string;
|
|
174
|
+
files: TemplateFile[];
|
|
175
|
+
}
|
|
176
|
+
export interface TemplateCategoryInfo {
|
|
177
|
+
id: string;
|
|
178
|
+
name: string;
|
|
179
|
+
directories: TemplateDirectory[];
|
|
180
|
+
}
|
|
181
|
+
export interface FileStorageError extends Error {
|
|
182
|
+
code: string;
|
|
183
|
+
}
|
|
184
|
+
export interface FormBuilderSettings {
|
|
185
|
+
templatePaths: {
|
|
186
|
+
generic: string;
|
|
187
|
+
team: string;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
export interface FormFile {
|
|
191
|
+
id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
path: string;
|
|
194
|
+
lastModified: Date;
|
|
195
|
+
}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { ActionTrigger, ComponentConfig, FormAction, FormFieldNode, FormSectionConfig, FormStepConfig, FormWizardConfig, TemplateStepConfig, VisualMapping } from '../../../core/src/index.ts';
|
|
2
|
+
export declare const generateId: (prefix?: string) => string;
|
|
3
|
+
interface FormState {
|
|
4
|
+
formConfig: FormWizardConfig;
|
|
5
|
+
hasUnsavedChanges: boolean;
|
|
6
|
+
flowData: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
interface SelectionState {
|
|
9
|
+
selectedStepId: string | null;
|
|
10
|
+
selectedCanvasItemId: string | null;
|
|
11
|
+
selectedCanvasItemType: "section" | "component" | null;
|
|
12
|
+
selectedActionId: string | null;
|
|
13
|
+
}
|
|
14
|
+
interface UIState {
|
|
15
|
+
activePropertiesTab: "step" | "section" | "component" | "action" | "conditions";
|
|
16
|
+
hasUnsavedChanges: boolean;
|
|
17
|
+
saveError: string | null;
|
|
18
|
+
isStepLocked: boolean;
|
|
19
|
+
activeComponentSubtab: "general" | "validation" | "advanced" | "conditions";
|
|
20
|
+
actionSheetOpen: boolean;
|
|
21
|
+
creatingActionTrigger: ActionTrigger | null;
|
|
22
|
+
}
|
|
23
|
+
interface TemplateState {
|
|
24
|
+
resolvedStep: FormStepConfig | null;
|
|
25
|
+
templateOrigins: Record<string, {
|
|
26
|
+
templateId: string;
|
|
27
|
+
stepIndex: number;
|
|
28
|
+
}>;
|
|
29
|
+
multiStepTemplateRanges: Array<{
|
|
30
|
+
templateId: string;
|
|
31
|
+
startIndex: number;
|
|
32
|
+
endIndex: number;
|
|
33
|
+
stepIds: string[];
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
interface HistoryState {
|
|
37
|
+
history: FormWizardConfig[];
|
|
38
|
+
}
|
|
39
|
+
interface SaveState {
|
|
40
|
+
isSaving: boolean;
|
|
41
|
+
lastSavedAt: Date | null;
|
|
42
|
+
saveError: string | null;
|
|
43
|
+
}
|
|
44
|
+
interface VisualMappingState {
|
|
45
|
+
visualMappings: VisualMapping[];
|
|
46
|
+
formFieldNodes: FormFieldNode[];
|
|
47
|
+
}
|
|
48
|
+
interface FormBuilderState extends FormState, SelectionState, UIState, TemplateState, HistoryState, SaveState, VisualMappingState {
|
|
49
|
+
}
|
|
50
|
+
interface FormActions {
|
|
51
|
+
updateFormConfig: (config: FormWizardConfig) => void;
|
|
52
|
+
updateFormTitle: (title: string) => void;
|
|
53
|
+
resetForm: () => void;
|
|
54
|
+
loadForm: (config: FormWizardConfig) => void;
|
|
55
|
+
updateFlowData: (key: string, value: unknown) => void;
|
|
56
|
+
}
|
|
57
|
+
interface SelectionActions {
|
|
58
|
+
setSelectedStepId: (stepId: string | null) => void;
|
|
59
|
+
setSelectedCanvasItem: (id: string | null, type: "section" | "component" | null) => void;
|
|
60
|
+
clearCanvasSelection: () => void;
|
|
61
|
+
setSelectedActionId: (actionId: string | null) => void;
|
|
62
|
+
}
|
|
63
|
+
interface UIActions {
|
|
64
|
+
setActivePropertiesTab: (tab: "step" | "section" | "component" | "action" | "conditions") => void;
|
|
65
|
+
setActiveComponentSubtab: (subtab: "general" | "validation" | "advanced" | "conditions") => void;
|
|
66
|
+
setActionSheetOpen: (open: boolean) => void;
|
|
67
|
+
setCreatingActionTrigger: (trigger: ActionTrigger | null) => void;
|
|
68
|
+
openActionSheet: (actionId?: string, creatingTrigger?: ActionTrigger) => void;
|
|
69
|
+
closeActionSheet: () => void;
|
|
70
|
+
}
|
|
71
|
+
interface StepActions {
|
|
72
|
+
addStep: () => void;
|
|
73
|
+
addStepFromTemplate: (templateKey: string) => Promise<void>;
|
|
74
|
+
removeStep: (stepId: string) => void;
|
|
75
|
+
updateStepTitle: (stepId: string, title: string) => void;
|
|
76
|
+
updateStep: (stepId: string, updates: Partial<FormStepConfig>) => void;
|
|
77
|
+
reorderSteps: (fromIndex: number, toIndex: number) => void;
|
|
78
|
+
duplicateStep: (stepId: string) => void;
|
|
79
|
+
}
|
|
80
|
+
interface SectionActions {
|
|
81
|
+
addSection: (stepId: string) => void;
|
|
82
|
+
removeSection: (stepId: string, sectionId: string) => void;
|
|
83
|
+
updateSection: (stepId: string, sectionId: string, updates: Partial<FormSectionConfig>) => void;
|
|
84
|
+
reorderSections: (stepId: string, fromIndex: number, toIndex: number) => void;
|
|
85
|
+
}
|
|
86
|
+
interface ComponentActions {
|
|
87
|
+
addComponent: (stepId: string, sectionId: string, component: ComponentConfig) => void;
|
|
88
|
+
removeComponent: (stepId: string, sectionId: string, componentId: string) => void;
|
|
89
|
+
updateComponent: (stepId: string, sectionId: string, componentId: string, updates: Partial<ComponentConfig>) => void;
|
|
90
|
+
reorderComponents: (stepId: string, sectionId: string, fromIndex: number, toIndex: number) => void;
|
|
91
|
+
moveComponent: (fromStepId: string, fromSectionId: string, toStepId: string, toSectionId: string, componentId: string, toIndex: number) => void;
|
|
92
|
+
moveComponentBetweenSections: (stepId: string, fromSectionId: string, toSectionId: string, componentId: string) => void;
|
|
93
|
+
updateComponentProperty: (field: string, value: unknown) => void;
|
|
94
|
+
updateComponentField: (field: string, value: unknown) => void;
|
|
95
|
+
}
|
|
96
|
+
interface TemplateActions {
|
|
97
|
+
setResolvedStep: (resolvedStep: FormStepConfig | null) => void;
|
|
98
|
+
addTemplateOrigin: (stepId: string, templateId: string, stepIndex: number) => void;
|
|
99
|
+
removeTemplateOrigin: (stepId: string) => void;
|
|
100
|
+
addStepTemplateRange: (templateId: string, stepIds: string[]) => void;
|
|
101
|
+
removeStepTemplateRange: (templateId: string) => void;
|
|
102
|
+
getTemplateOriginForStep: (stepId: string) => {
|
|
103
|
+
templateId: string;
|
|
104
|
+
stepIndex?: number;
|
|
105
|
+
} | null;
|
|
106
|
+
}
|
|
107
|
+
interface HistoryActions {
|
|
108
|
+
addToHistory: () => void;
|
|
109
|
+
undo: () => void;
|
|
110
|
+
resetHistory: () => void;
|
|
111
|
+
}
|
|
112
|
+
interface SaveActions {
|
|
113
|
+
saveForm: (projectId: string, wizardId: string) => Promise<void>;
|
|
114
|
+
clearSaveError: () => void;
|
|
115
|
+
}
|
|
116
|
+
interface ActionManagementActions {
|
|
117
|
+
addAction: (stepId: string, action: Omit<FormAction, "id">) => string;
|
|
118
|
+
removeAction: (stepId: string, actionId: string) => void;
|
|
119
|
+
updateAction: (stepId: string, actionId: string, updates: Partial<FormAction>) => void;
|
|
120
|
+
reorderActions: (stepId: string, fromIndex: number, toIndex: number) => void;
|
|
121
|
+
}
|
|
122
|
+
interface VisualMappingActions {
|
|
123
|
+
addVisualMapping: (mapping: Omit<VisualMapping, "id">) => void;
|
|
124
|
+
removeVisualMapping: (mappingId: string) => void;
|
|
125
|
+
updateVisualMapping: (mappingId: string, updates: Partial<VisualMapping>) => void;
|
|
126
|
+
clearVisualMappings: () => void;
|
|
127
|
+
refreshFormFieldNodes: () => void;
|
|
128
|
+
}
|
|
129
|
+
interface FormBuilderActions extends FormActions, SelectionActions, UIActions, StepActions, SectionActions, ComponentActions, TemplateActions, HistoryActions, SaveActions, ActionManagementActions, VisualMappingActions {
|
|
130
|
+
}
|
|
131
|
+
type FormBuilderStore = FormBuilderState & FormBuilderActions;
|
|
132
|
+
export declare const useFormBuilderStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<FormBuilderStore>, "setState" | "devtools"> & {
|
|
133
|
+
setState(partial: FormBuilderStore | Partial<FormBuilderStore> | ((state: FormBuilderStore) => FormBuilderStore | Partial<FormBuilderStore>), replace?: false | undefined, action?: (string | {
|
|
134
|
+
[x: string]: unknown;
|
|
135
|
+
[x: number]: unknown;
|
|
136
|
+
[x: symbol]: unknown;
|
|
137
|
+
type: string;
|
|
138
|
+
}) | undefined): void;
|
|
139
|
+
setState(state: FormBuilderStore | ((state: FormBuilderStore) => FormBuilderStore), replace: true, action?: (string | {
|
|
140
|
+
[x: string]: unknown;
|
|
141
|
+
[x: number]: unknown;
|
|
142
|
+
[x: symbol]: unknown;
|
|
143
|
+
type: string;
|
|
144
|
+
}) | undefined): void;
|
|
145
|
+
devtools: {
|
|
146
|
+
cleanup: () => void;
|
|
147
|
+
};
|
|
148
|
+
}>;
|
|
149
|
+
export declare const useFormSteps: () => (FormStepConfig | TemplateStepConfig)[];
|
|
150
|
+
export declare const useFormBuilderActions: () => {
|
|
151
|
+
updateFormConfig: (config: FormWizardConfig) => void;
|
|
152
|
+
updateFormTitle: (title: string) => void;
|
|
153
|
+
resetForm: () => void;
|
|
154
|
+
loadForm: (config: FormWizardConfig) => void;
|
|
155
|
+
updateFlowData: (key: string, value: unknown) => void;
|
|
156
|
+
saveForm: (projectId: string, wizardId: string) => Promise<void>;
|
|
157
|
+
clearSaveError: () => void;
|
|
158
|
+
setSelectedStepId: (stepId: string | null) => void;
|
|
159
|
+
setSelectedCanvasItem: (id: string | null, type: "section" | "component" | null) => void;
|
|
160
|
+
clearCanvasSelection: () => void;
|
|
161
|
+
setSelectedActionId: (actionId: string | null) => void;
|
|
162
|
+
setActivePropertiesTab: (tab: "step" | "section" | "component" | "action" | "conditions") => void;
|
|
163
|
+
setActiveComponentSubtab: (subtab: "general" | "validation" | "advanced" | "conditions") => void;
|
|
164
|
+
setActionSheetOpen: (open: boolean) => void;
|
|
165
|
+
setCreatingActionTrigger: (trigger: ActionTrigger | null) => void;
|
|
166
|
+
openActionSheet: (actionId?: string, creatingTrigger?: ActionTrigger) => void;
|
|
167
|
+
closeActionSheet: () => void;
|
|
168
|
+
addStep: () => void;
|
|
169
|
+
addStepFromTemplate: (templateKey: string) => Promise<void>;
|
|
170
|
+
removeStep: (stepId: string) => void;
|
|
171
|
+
updateStepTitle: (stepId: string, title: string) => void;
|
|
172
|
+
updateStep: (stepId: string, updates: Partial<FormStepConfig>) => void;
|
|
173
|
+
reorderSteps: (fromIndex: number, toIndex: number) => void;
|
|
174
|
+
duplicateStep: (stepId: string) => void;
|
|
175
|
+
addSection: (stepId: string) => void;
|
|
176
|
+
removeSection: (stepId: string, sectionId: string) => void;
|
|
177
|
+
updateSection: (stepId: string, sectionId: string, updates: Partial<FormSectionConfig>) => void;
|
|
178
|
+
reorderSections: (stepId: string, fromIndex: number, toIndex: number) => void;
|
|
179
|
+
addComponent: (stepId: string, sectionId: string, component: ComponentConfig) => void;
|
|
180
|
+
removeComponent: (stepId: string, sectionId: string, componentId: string) => void;
|
|
181
|
+
updateComponent: (stepId: string, sectionId: string, componentId: string, updates: Partial<ComponentConfig>) => void;
|
|
182
|
+
reorderComponents: (stepId: string, sectionId: string, fromIndex: number, toIndex: number) => void;
|
|
183
|
+
moveComponent: (fromStepId: string, fromSectionId: string, toStepId: string, toSectionId: string, componentId: string, toIndex: number) => void;
|
|
184
|
+
moveComponentBetweenSections: (stepId: string, fromSectionId: string, toSectionId: string, componentId: string) => void;
|
|
185
|
+
updateComponentProperty: (field: string, value: unknown) => void;
|
|
186
|
+
updateComponentField: (field: string, value: unknown) => void;
|
|
187
|
+
setResolvedStep: (resolvedStep: FormStepConfig | null) => void;
|
|
188
|
+
addTemplateOrigin: (stepId: string, templateId: string, stepIndex: number) => void;
|
|
189
|
+
removeTemplateOrigin: (stepId: string) => void;
|
|
190
|
+
addStepTemplateRange: (templateId: string, stepIds: string[]) => void;
|
|
191
|
+
removeStepTemplateRange: (templateId: string) => void;
|
|
192
|
+
getTemplateOriginForStep: (stepId: string) => {
|
|
193
|
+
templateId: string;
|
|
194
|
+
stepIndex?: number;
|
|
195
|
+
} | null;
|
|
196
|
+
addToHistory: () => void;
|
|
197
|
+
undo: () => void;
|
|
198
|
+
resetHistory: () => void;
|
|
199
|
+
addAction: (stepId: string, action: Omit<FormAction, "id">) => string;
|
|
200
|
+
removeAction: (stepId: string, actionId: string) => void;
|
|
201
|
+
updateAction: (stepId: string, actionId: string, updates: Partial<FormAction>) => void;
|
|
202
|
+
reorderActions: (stepId: string, fromIndex: number, toIndex: number) => void;
|
|
203
|
+
addVisualMapping: (mapping: Omit<VisualMapping, "id">) => void;
|
|
204
|
+
removeVisualMapping: (mappingId: string) => void;
|
|
205
|
+
updateVisualMapping: (mappingId: string, updates: Partial<VisualMapping>) => void;
|
|
206
|
+
clearVisualMappings: () => void;
|
|
207
|
+
refreshFormFieldNodes: () => void;
|
|
208
|
+
};
|
|
209
|
+
export declare const useCurrentStep: () => FormStepConfig | TemplateStepConfig | null;
|
|
210
|
+
export declare const useSelectedActionId: () => string | null;
|
|
211
|
+
export declare const useSelectedComponentId: () => string | null;
|
|
212
|
+
export declare const useSelectedSectionId: () => string | null;
|
|
213
|
+
export declare const useCurrentSection: () => FormSectionConfig | null;
|
|
214
|
+
export declare const useCurrentStepLockState: () => boolean;
|
|
215
|
+
export declare const useFormConfig: () => FormWizardConfig;
|
|
216
|
+
export declare const useFormFlowData: () => Record<string, unknown>;
|
|
217
|
+
export declare const useCanUndo: () => boolean;
|
|
218
|
+
export declare const useActionSheetOpen: () => boolean;
|
|
219
|
+
export declare const useCreatingActionTrigger: () => ActionTrigger | null;
|
|
220
|
+
export declare const useHasUnsavedChanges: () => boolean;
|
|
221
|
+
export declare const useIsSaving: () => boolean;
|
|
222
|
+
export declare const useLastSavedAt: () => Date | null;
|
|
223
|
+
export declare const useSaveError: () => string | null;
|
|
224
|
+
export declare const useSelectedStepId: () => string | null;
|
|
225
|
+
export declare const useVisualMappings: () => VisualMapping[];
|
|
226
|
+
export declare const useFormFieldNodes: () => FormFieldNode[];
|
|
227
|
+
export declare const useSteps: () => (FormStepConfig | TemplateStepConfig)[];
|
|
228
|
+
export declare const useFlowActions: () => {
|
|
229
|
+
updateFormConfig: (config: FormWizardConfig) => void;
|
|
230
|
+
updateFormTitle: (title: string) => void;
|
|
231
|
+
resetForm: () => void;
|
|
232
|
+
loadForm: (config: FormWizardConfig) => void;
|
|
233
|
+
updateFlowData: (key: string, value: unknown) => void;
|
|
234
|
+
saveForm: (projectId: string, wizardId: string) => Promise<void>;
|
|
235
|
+
clearSaveError: () => void;
|
|
236
|
+
setSelectedStepId: (stepId: string | null) => void;
|
|
237
|
+
setSelectedCanvasItem: (id: string | null, type: "section" | "component" | null) => void;
|
|
238
|
+
clearCanvasSelection: () => void;
|
|
239
|
+
setSelectedActionId: (actionId: string | null) => void;
|
|
240
|
+
setActivePropertiesTab: (tab: "step" | "section" | "component" | "action" | "conditions") => void;
|
|
241
|
+
setActiveComponentSubtab: (subtab: "general" | "validation" | "advanced" | "conditions") => void;
|
|
242
|
+
setActionSheetOpen: (open: boolean) => void;
|
|
243
|
+
setCreatingActionTrigger: (trigger: ActionTrigger | null) => void;
|
|
244
|
+
openActionSheet: (actionId?: string, creatingTrigger?: ActionTrigger) => void;
|
|
245
|
+
closeActionSheet: () => void;
|
|
246
|
+
addStep: () => void;
|
|
247
|
+
addStepFromTemplate: (templateKey: string) => Promise<void>;
|
|
248
|
+
removeStep: (stepId: string) => void;
|
|
249
|
+
updateStepTitle: (stepId: string, title: string) => void;
|
|
250
|
+
updateStep: (stepId: string, updates: Partial<FormStepConfig>) => void;
|
|
251
|
+
reorderSteps: (fromIndex: number, toIndex: number) => void;
|
|
252
|
+
duplicateStep: (stepId: string) => void;
|
|
253
|
+
addSection: (stepId: string) => void;
|
|
254
|
+
removeSection: (stepId: string, sectionId: string) => void;
|
|
255
|
+
updateSection: (stepId: string, sectionId: string, updates: Partial<FormSectionConfig>) => void;
|
|
256
|
+
reorderSections: (stepId: string, fromIndex: number, toIndex: number) => void;
|
|
257
|
+
addComponent: (stepId: string, sectionId: string, component: ComponentConfig) => void;
|
|
258
|
+
removeComponent: (stepId: string, sectionId: string, componentId: string) => void;
|
|
259
|
+
updateComponent: (stepId: string, sectionId: string, componentId: string, updates: Partial<ComponentConfig>) => void;
|
|
260
|
+
reorderComponents: (stepId: string, sectionId: string, fromIndex: number, toIndex: number) => void;
|
|
261
|
+
moveComponent: (fromStepId: string, fromSectionId: string, toStepId: string, toSectionId: string, componentId: string, toIndex: number) => void;
|
|
262
|
+
moveComponentBetweenSections: (stepId: string, fromSectionId: string, toSectionId: string, componentId: string) => void;
|
|
263
|
+
updateComponentProperty: (field: string, value: unknown) => void;
|
|
264
|
+
updateComponentField: (field: string, value: unknown) => void;
|
|
265
|
+
setResolvedStep: (resolvedStep: FormStepConfig | null) => void;
|
|
266
|
+
addTemplateOrigin: (stepId: string, templateId: string, stepIndex: number) => void;
|
|
267
|
+
removeTemplateOrigin: (stepId: string) => void;
|
|
268
|
+
addStepTemplateRange: (templateId: string, stepIds: string[]) => void;
|
|
269
|
+
removeStepTemplateRange: (templateId: string) => void;
|
|
270
|
+
getTemplateOriginForStep: (stepId: string) => {
|
|
271
|
+
templateId: string;
|
|
272
|
+
stepIndex?: number;
|
|
273
|
+
} | null;
|
|
274
|
+
addToHistory: () => void;
|
|
275
|
+
undo: () => void;
|
|
276
|
+
resetHistory: () => void;
|
|
277
|
+
addAction: (stepId: string, action: Omit<FormAction, "id">) => string;
|
|
278
|
+
removeAction: (stepId: string, actionId: string) => void;
|
|
279
|
+
updateAction: (stepId: string, actionId: string, updates: Partial<FormAction>) => void;
|
|
280
|
+
reorderActions: (stepId: string, fromIndex: number, toIndex: number) => void;
|
|
281
|
+
addVisualMapping: (mapping: Omit<VisualMapping, "id">) => void;
|
|
282
|
+
removeVisualMapping: (mappingId: string) => void;
|
|
283
|
+
updateVisualMapping: (mappingId: string, updates: Partial<VisualMapping>) => void;
|
|
284
|
+
clearVisualMappings: () => void;
|
|
285
|
+
refreshFormFieldNodes: () => void;
|
|
286
|
+
};
|
|
287
|
+
export {};
|