@digiform/builder 0.1.7 → 0.2.1
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.d.ts +18 -0
- 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.map +1 -1
- package/configReader-CbGTKRUP.cjs.map +1 -1
- 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.d.ts +35 -0
- 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/FormBuilder.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form Builder Component - Main export for @libs/form-builder-component
|
|
3
|
+
*
|
|
4
|
+
* This is a publishable React component that provides a complete form building interface.
|
|
5
|
+
* It includes drag-and-drop functionality, property editing, and form configuration.
|
|
6
|
+
*/
|
|
7
|
+
export * from './features/condition-editor';
|
|
8
|
+
export * from './features/dialog-system';
|
|
9
|
+
export * from './features/form-builder';
|
|
10
|
+
export { Canvas } from './features/form-builder/components/canvas/Canvas/Canvas';
|
|
11
|
+
export { FormWizardComponentsPanel } from './features/form-builder/components/components-panel/FormWizardComponentsPanel/FormWizardComponentsPanel';
|
|
12
|
+
export type { FormBuilderProps } from './features/form-builder/components/core/FormBuilder/FormBuilder';
|
|
13
|
+
export { default as FormBuilder } from './features/form-builder/components/core/FormBuilder/FormBuilder';
|
|
14
|
+
export { AdminPropertiesPanel } from './features/form-builder/components/editors/AdminPropertiesPanel/AdminPropertiesPanel';
|
|
15
|
+
export * from './features/form-management';
|
|
16
|
+
export type { FormExplorerProps } from './features/form-management/components/FormExplorer/FormExplorer';
|
|
17
|
+
export { FormExplorer } from './features/form-management/components/FormExplorer/FormExplorer';
|
|
18
|
+
export * from './features/property-editors';
|
|
19
|
+
export * from './features/template-system';
|
|
20
|
+
export { getAvailableGenericTemplatesSync, getTemplateInfo, validateTemplateReferences, } from './features/template-system/utils/templateUtils';
|
|
21
|
+
export * from './features/trigger-action-system';
|
|
22
|
+
export * from './features/visual-mapping';
|
|
23
|
+
export * from './providers/FormSaveContext';
|
|
24
|
+
export * from './utils/fileStorage';
|
package/client.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { isFormFieldComponent, renderComponent, } from './component-registry/components';
|
|
2
|
+
export type { ComponentValue } from './component-registry/types';
|
|
3
|
+
export { DEFAULT_FORM_CONFIG, type FormConfig, type FormStorageConfig, useFormConfiguration, } from './config';
|
|
4
|
+
export { FlowBuilderErrorBoundary } from './error-boundaries';
|
|
5
|
+
export * from './features/condition-editor';
|
|
6
|
+
export * from './features/dialog-system';
|
|
7
|
+
export * from './features/form-builder';
|
|
8
|
+
export * from './features/property-editors';
|
|
9
|
+
export * from './features/template-system';
|
|
10
|
+
export { TemplateStorageService } from './features/template-system/services/TemplateStorageService';
|
|
11
|
+
export * from './features/trigger-action-system';
|
|
12
|
+
export * from './features/visual-mapping';
|
|
13
|
+
export * from './providers';
|
|
14
|
+
export type { CreateFormRequest, CreateProjectRequest, FileStorageError, FormBuilderSettings, FormFile, FormMetadata, FormStorageProvider, GenericTemplate, PersonalTemplate, SharedTemplate, StorageResult, TeamTemplate, TemplateCategory, TemplateCategoryInfo, TemplateDirectory, TemplateFile, TemplateStorageConfig, } from './storage/types';
|
|
15
|
+
export type { ComponentConfig, FormSectionConfig, FormStepConfig, FormWizardConfig, StepNavigation, StepNavigationItem, StepTemplate, TemplateHistoryEntry, } from './store';
|
|
16
|
+
export { useCanUndo, useCurrentSection, useFormBuilderActions, useFormBuilderStore, useFormConfig, useFormSteps, useHasUnsavedChanges, useIsSaving, useLastSavedAt, useSaveError, useSelectedSectionId, useSelectedStepId, } from './store';
|
|
17
|
+
export * from './utils';
|
|
18
|
+
export { getDatabaseConfig, resolveConfigVariables, } from './utils/configReader';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox Component - RHC Design System
|
|
3
|
+
*
|
|
4
|
+
* Uses FormFieldCheckboxGroup + FormFieldCheckboxOption pattern.
|
|
5
|
+
* This component uses customRenderComponent because the Group+Option pattern
|
|
6
|
+
* doesn't fit the standard FormFieldWrapper template used by other components.
|
|
7
|
+
*/
|
|
8
|
+
export declare const checkboxComponent: import('../types').ComponentDefinition;
|
|
9
|
+
export declare const checkboxPropertySchema: import('../..').PropertyEditorSchema | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PropertyEditorSchema } from '../../../features/property-editors/types/schema';
|
|
2
|
+
import { ComponentDefinition } from '../../types';
|
|
3
|
+
export declare const codeInputPropertySchema: PropertyEditorSchema;
|
|
4
|
+
export declare const codeInputComponent: ComponentDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dropdownComponent: import('..').ComponentDefinition;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ComponentConfig } from '../../../../core/src/index.ts';
|
|
2
|
+
import { ComponentDefinition, ComponentRegistry, ComponentValue } from '../types';
|
|
3
|
+
export { alertComponent, alertPropertySchema } from './alert';
|
|
4
|
+
export { buttonComponent, buttonPropertySchema } from './button';
|
|
5
|
+
export { checkboxComponent, checkboxPropertySchema } from './checkbox';
|
|
6
|
+
export { codeInputComponent, codeInputPropertySchema } from './code-input/code-input';
|
|
7
|
+
export { dropdownComponent } from './dropdown';
|
|
8
|
+
export { headingComponent, headingPropertySchema } from './heading';
|
|
9
|
+
export { paragraphComponent, paragraphPropertySchema } from './paragraph';
|
|
10
|
+
export { progressLoaderComponent, progressLoaderPropertySchema, } from './progress-loader';
|
|
11
|
+
export { radioGroupComponent } from './radioGroup';
|
|
12
|
+
export { textComponent, textInputPropertySchema } from './text';
|
|
13
|
+
export { textareaComponent, textareaPropertySchema } from './textarea';
|
|
14
|
+
declare const emailComponent: ComponentDefinition;
|
|
15
|
+
declare const telComponent: ComponentDefinition;
|
|
16
|
+
declare const numberComponent: ComponentDefinition;
|
|
17
|
+
declare const dateComponent: ComponentDefinition;
|
|
18
|
+
export { emailComponent, telComponent, numberComponent, dateComponent };
|
|
19
|
+
export { createComponentDefinition, createGenericPropertyEditor, } from '../utils';
|
|
20
|
+
export declare const componentRegistry: ComponentRegistry;
|
|
21
|
+
export declare const getComponentDefinition: (type: string) => ComponentDefinition;
|
|
22
|
+
export declare const getAllComponentDefinitions: () => ComponentDefinition[];
|
|
23
|
+
export declare const renderComponentEditor: (props: {
|
|
24
|
+
component: ComponentConfig;
|
|
25
|
+
stepId: string;
|
|
26
|
+
handlePropertyChange: (field: string, value: ComponentValue) => void;
|
|
27
|
+
handleChange: (field: string, value: ComponentValue) => void;
|
|
28
|
+
}) => string | number | boolean | Iterable<import('react').ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
29
|
+
export declare const renderComponent: (props: {
|
|
30
|
+
component: ComponentConfig;
|
|
31
|
+
value: ComponentValue;
|
|
32
|
+
onChange: (value: ComponentValue) => void;
|
|
33
|
+
isFormView: boolean;
|
|
34
|
+
}) => string | number | boolean | Iterable<import('react').ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
35
|
+
export declare const isFormFieldComponent: (componentType: string) => boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PropertyEditorSchema } from '../../features/property-editors/types/schema';
|
|
2
|
+
import { ComponentDefinition } from '../types';
|
|
3
|
+
export declare const progressLoaderPropertySchema: PropertyEditorSchema;
|
|
4
|
+
export declare const progressLoaderComponent: ComponentDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const radioGroupComponent: import('..').ComponentDefinition;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ComponentConfig, ComponentType } from '../../../core/src/index.ts';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ComponentPropsConfig } from '../design-system/rhc/utils/create-config';
|
|
4
|
+
import { ComponentDefinition, ComponentEditorProps, ComponentRendererProps } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for creating a form field component
|
|
7
|
+
*/
|
|
8
|
+
export interface FormFieldComponentConfig {
|
|
9
|
+
type: ComponentType;
|
|
10
|
+
label: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
designSystemComponent: string;
|
|
13
|
+
propsConfig: ComponentPropsConfig;
|
|
14
|
+
defaultConfig: Omit<ComponentConfig, "id">;
|
|
15
|
+
RHCComponent: React.ComponentType<any>;
|
|
16
|
+
valueConfig: {
|
|
17
|
+
type: "string" | "boolean" | "string-or-number";
|
|
18
|
+
defaultValue: string | boolean | number;
|
|
19
|
+
onChangeExtractor: "event-target-value" | "event-target-checked" | "direct";
|
|
20
|
+
};
|
|
21
|
+
transformProps?: (rhcProps: Record<string, unknown>, context: {
|
|
22
|
+
component: ComponentConfig;
|
|
23
|
+
isFormView: boolean;
|
|
24
|
+
}) => Record<string, unknown>;
|
|
25
|
+
customRenderComponent?: (props: ComponentRendererProps) => ReactNode;
|
|
26
|
+
customEditor?: (props: ComponentEditorProps) => ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Factory function that creates a complete ComponentDefinition from RHC config
|
|
30
|
+
*
|
|
31
|
+
* This is the central piece that eliminates manual prop mapping and scattered type casts.
|
|
32
|
+
* By iterating propsConfig.props to build mapProps, adding new RHC props becomes a
|
|
33
|
+
* config-only change. The centralized `as any` cast in the factory replaces 5 scattered casts.
|
|
34
|
+
*
|
|
35
|
+
* @param config - Form field component configuration
|
|
36
|
+
* @returns Complete ComponentDefinition compatible with the existing registry
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const textComponent = createFormFieldComponent({
|
|
41
|
+
* type: "text",
|
|
42
|
+
* label: "Tekst invoer",
|
|
43
|
+
* icon: "text-input",
|
|
44
|
+
* designSystemComponent: "FormFieldTextInput",
|
|
45
|
+
* propsConfig: textInputConfig,
|
|
46
|
+
* defaultConfig: { ... },
|
|
47
|
+
* RHCComponent: FormFieldTextInput,
|
|
48
|
+
* valueConfig: { type: "string", defaultValue: "", onChangeExtractor: "event-target-value" }
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function createFormFieldComponent(config: FormFieldComponentConfig): ComponentDefinition;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PropertyEditorSchema } from '../features/property-editors/types/schema';
|
|
2
|
+
import { ComponentConfig, ComponentType } from '../../../core/src/index.ts';
|
|
3
|
+
import { ComponentSource } from '../../../ui/src/design-system/index.ts';
|
|
4
|
+
import { ChangeEvent, ReactNode } from 'react';
|
|
5
|
+
import { ComponentValidationCapabilities } from './validation';
|
|
6
|
+
export interface DesignSystemBaseProps {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export type InputChangeEvent = ChangeEvent<HTMLInputElement>;
|
|
10
|
+
export type TextareaChangeEvent = ChangeEvent<HTMLTextAreaElement>;
|
|
11
|
+
export type SelectChangeEvent = ChangeEvent<HTMLSelectElement>;
|
|
12
|
+
export type ComponentValue = string | boolean | number | null | undefined | unknown[];
|
|
13
|
+
export interface ComponentEditorProps {
|
|
14
|
+
component: ComponentConfig;
|
|
15
|
+
stepId: string;
|
|
16
|
+
handlePropertyChange: (field: string, value: ComponentValue) => void;
|
|
17
|
+
handleChange: (field: string, value: ComponentValue) => void;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ComponentRendererProps {
|
|
21
|
+
component: ComponentConfig;
|
|
22
|
+
value: ComponentValue;
|
|
23
|
+
onChange: (value: ComponentValue) => void;
|
|
24
|
+
isFormView: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ComponentDefinition {
|
|
27
|
+
type: ComponentType;
|
|
28
|
+
label: string;
|
|
29
|
+
icon: string;
|
|
30
|
+
category: "formFields" | "typography" | "feedback";
|
|
31
|
+
source: ComponentSource;
|
|
32
|
+
defaultConfig: Omit<ComponentConfig, "id">;
|
|
33
|
+
designSystemComponent: string;
|
|
34
|
+
propertyEditorSchema?: PropertyEditorSchema;
|
|
35
|
+
validationCapabilities?: ComponentValidationCapabilities;
|
|
36
|
+
mapProps: (component: ComponentConfig, value?: ComponentValue) => DesignSystemBaseProps;
|
|
37
|
+
renderEditor: (props: ComponentEditorProps) => ReactNode;
|
|
38
|
+
renderComponent: (props: ComponentRendererProps) => ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export interface ComponentRegistry {
|
|
41
|
+
[key: string]: ComponentDefinition;
|
|
42
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PropertyEditorSchema } from '../features/property-editors/types/schema';
|
|
2
|
+
import { ComponentConfig, ComponentType } from '../../../core/src/index.ts';
|
|
3
|
+
import { ComponentSource } from '../../../ui/src/design-system/index.ts';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { ComponentDefinition, ComponentEditorProps, ComponentValue } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Helper function to create a generic property editor from a schema
|
|
8
|
+
* @param schema The property editor schema
|
|
9
|
+
* @returns A React component that renders the property editor
|
|
10
|
+
*/
|
|
11
|
+
export declare const createGenericPropertyEditor: (schema: PropertyEditorSchema) => (props: ComponentEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Automatically creates a component definition with generic property editor
|
|
14
|
+
* @param config Component configuration
|
|
15
|
+
* @returns Complete component definition
|
|
16
|
+
*/
|
|
17
|
+
export declare const createComponentDefinition: (config: {
|
|
18
|
+
type: ComponentType;
|
|
19
|
+
label: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
category: "formFields" | "typography" | "feedback";
|
|
22
|
+
source?: ComponentSource;
|
|
23
|
+
designSystemComponent?: string;
|
|
24
|
+
defaultConfig: Omit<ComponentConfig, "id">;
|
|
25
|
+
propertyEditorSchema: PropertyEditorSchema;
|
|
26
|
+
mapProps?: (component: ComponentConfig, value?: ComponentValue) => Record<string, unknown>;
|
|
27
|
+
renderComponent: (props: {
|
|
28
|
+
component: ComponentConfig;
|
|
29
|
+
value: ComponentValue;
|
|
30
|
+
onChange: (value: ComponentValue) => void;
|
|
31
|
+
isFormView: boolean;
|
|
32
|
+
}) => ReactNode;
|
|
33
|
+
}) => ComponentDefinition;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation Rule Configuration System
|
|
3
|
+
*
|
|
4
|
+
* This module defines the comprehensive validation rule system for the form builder,
|
|
5
|
+
* including validation rule definitions, component validation capabilities, and
|
|
6
|
+
* runtime validation configuration.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Defines the parameter types that validation rules can accept
|
|
10
|
+
*/
|
|
11
|
+
export type ValidationParameterType = "boolean" | "number" | "string" | "array" | "object";
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for validation rule parameters
|
|
14
|
+
*/
|
|
15
|
+
export interface ValidationRuleParameter {
|
|
16
|
+
/** Parameter name (e.g., 'value', 'message') */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Parameter type for UI rendering */
|
|
19
|
+
type: ValidationParameterType;
|
|
20
|
+
/** Display label for the parameter */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Help text describing the parameter */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** Whether this parameter is required */
|
|
25
|
+
required: boolean;
|
|
26
|
+
/** Default value for the parameter */
|
|
27
|
+
defaultValue?: string | number | boolean;
|
|
28
|
+
/** Minimum value (for number type) */
|
|
29
|
+
min?: number;
|
|
30
|
+
/** Maximum value (for number type) */
|
|
31
|
+
max?: number;
|
|
32
|
+
/** Placeholder text (for string type) */
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
/** Predefined options (for select-style inputs) */
|
|
35
|
+
options?: Array<{
|
|
36
|
+
label: string;
|
|
37
|
+
value: string | number | boolean;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Complete validation rule definition
|
|
42
|
+
*/
|
|
43
|
+
export interface ValidationRuleDefinition {
|
|
44
|
+
/** Unique identifier for the rule */
|
|
45
|
+
id: string;
|
|
46
|
+
/** Display name for the rule */
|
|
47
|
+
label: string;
|
|
48
|
+
/** Detailed description of what this rule validates */
|
|
49
|
+
description: string;
|
|
50
|
+
/** Category for grouping rules in UI */
|
|
51
|
+
category: "basic" | "length" | "format" | "numeric" | "selection" | "custom";
|
|
52
|
+
/** Parameters that can be configured for this rule */
|
|
53
|
+
parameters: ValidationRuleParameter[];
|
|
54
|
+
/** Default error message template */
|
|
55
|
+
defaultMessage: string;
|
|
56
|
+
/** Whether this rule can be combined with others */
|
|
57
|
+
combinable: boolean;
|
|
58
|
+
/** Priority for rule execution order (lower = higher priority) */
|
|
59
|
+
priority: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Runtime configuration for a specific validation rule instance
|
|
63
|
+
*/
|
|
64
|
+
export interface ValidationRuleInstance {
|
|
65
|
+
/** Reference to the rule definition */
|
|
66
|
+
ruleId: string;
|
|
67
|
+
/** Whether this rule is enabled */
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
/** Configured parameters for this rule instance */
|
|
70
|
+
parameters: Record<string, string | number | boolean>;
|
|
71
|
+
/** Custom error message (overrides default) */
|
|
72
|
+
customMessage?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Component's validation configuration
|
|
76
|
+
*/
|
|
77
|
+
export interface ComponentValidationConfig {
|
|
78
|
+
/** All configured validation rule instances */
|
|
79
|
+
rules: ValidationRuleInstance[];
|
|
80
|
+
/** Overall validation enabled/disabled */
|
|
81
|
+
enabled: boolean;
|
|
82
|
+
/** Validation timing preferences */
|
|
83
|
+
timing?: {
|
|
84
|
+
/** Validate on blur */
|
|
85
|
+
onBlur?: boolean;
|
|
86
|
+
/** Validate on change */
|
|
87
|
+
onChange?: boolean;
|
|
88
|
+
/** Validate on submit */
|
|
89
|
+
onSubmit?: boolean;
|
|
90
|
+
};
|
|
91
|
+
/** Message display style */
|
|
92
|
+
messageStyle?: "withLabel" | "simple";
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Defines which validation rules a component type supports
|
|
96
|
+
*/
|
|
97
|
+
export interface ComponentValidationCapabilities {
|
|
98
|
+
/** Component type this applies to */
|
|
99
|
+
componentType: string;
|
|
100
|
+
/** List of supported validation rule IDs */
|
|
101
|
+
supportedRules: string[];
|
|
102
|
+
/** Default rules that should be enabled for new components */
|
|
103
|
+
defaultRules?: string[];
|
|
104
|
+
/** Custom validation rule definitions specific to this component */
|
|
105
|
+
customRules?: ValidationRuleDefinition[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Comprehensive catalog of all available validation rules
|
|
109
|
+
*/
|
|
110
|
+
export declare const VALIDATION_RULES: ValidationRuleDefinition[];
|
|
111
|
+
/**
|
|
112
|
+
* Defines validation capabilities for each component type
|
|
113
|
+
*/
|
|
114
|
+
export declare const COMPONENT_VALIDATION_CAPABILITIES: ComponentValidationCapabilities[];
|
|
115
|
+
/**
|
|
116
|
+
* Gets validation rule definition by ID
|
|
117
|
+
*/
|
|
118
|
+
export declare const getValidationRuleDefinition: (ruleId: string) => ValidationRuleDefinition | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Gets validation capabilities for a component type
|
|
121
|
+
*/
|
|
122
|
+
export declare const getComponentValidationCapabilities: (componentType: string) => ComponentValidationCapabilities | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Creates a default validation configuration for a component type
|
|
125
|
+
*/
|
|
126
|
+
export declare const createDefaultValidationConfig: (componentType: string) => ComponentValidationConfig;
|
|
127
|
+
/**
|
|
128
|
+
* Gets default parameters for a validation rule
|
|
129
|
+
*/
|
|
130
|
+
export declare const getDefaultRuleParameters: (ruleId: string) => Record<string, string | number | boolean>;
|
|
131
|
+
/**
|
|
132
|
+
* Validates a validation configuration against component capabilities
|
|
133
|
+
*/
|
|
134
|
+
export declare const validateValidationConfig: (componentType: string, config: ComponentValidationConfig) => {
|
|
135
|
+
isValid: boolean;
|
|
136
|
+
errors: string[];
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Groups validation rules by category for UI display
|
|
140
|
+
*/
|
|
141
|
+
export declare const getValidationRulesByCategory: () => Record<string, ValidationRuleDefinition[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentValidation } from '../../../core/src/index.ts';
|
|
2
|
+
import { ComponentValidationConfig } from './validation';
|
|
3
|
+
/**
|
|
4
|
+
* Converts from admin validation config (ComponentValidationConfig) to user validation format (ComponentValidation)
|
|
5
|
+
*/
|
|
6
|
+
export declare function convertToUserValidation(adminConfig: ComponentValidationConfig): ComponentValidation | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Converts from user validation format (ComponentValidation) to admin validation config (ComponentValidationConfig)
|
|
9
|
+
*/
|
|
10
|
+
export declare function convertFromUserValidation(userValidation: ComponentValidation | undefined): ComponentValidationConfig;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConnectionErrorScreen - Shows when database is not available
|
|
3
|
+
* Blocks UI to prevent user actions that won't work without database connection
|
|
4
|
+
*/
|
|
5
|
+
interface ConnectionErrorScreenProps {
|
|
6
|
+
onRetry?: () => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ConnectionErrorScreen: React.FC<ConnectionErrorScreenProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface SyncStatus {
|
|
2
|
+
online: boolean;
|
|
3
|
+
connected: boolean;
|
|
4
|
+
connectionStatus: "connected" | "disconnected" | "connecting" | "retrying";
|
|
5
|
+
lastSync: string | null;
|
|
6
|
+
syncing: boolean;
|
|
7
|
+
retryCount?: number;
|
|
8
|
+
maxRetries?: number;
|
|
9
|
+
lastConnectionError?: string | null;
|
|
10
|
+
pendingOperations?: number;
|
|
11
|
+
reconciling?: boolean;
|
|
12
|
+
integrityStatus?: "consistent" | "inconsistent" | "unknown";
|
|
13
|
+
}
|
|
14
|
+
interface DatabaseStatusIndicatorProps {
|
|
15
|
+
className?: string;
|
|
16
|
+
getSyncStatus?: () => SyncStatus;
|
|
17
|
+
onForceSync?: () => Promise<void>;
|
|
18
|
+
onReconnect?: () => Promise<boolean>;
|
|
19
|
+
onValidateConsistency?: () => Promise<boolean>;
|
|
20
|
+
onResetLocalData?: () => Promise<boolean>;
|
|
21
|
+
onReconcileConflicts?: () => Promise<boolean>;
|
|
22
|
+
}
|
|
23
|
+
export declare const DatabaseStatusIndicator: ({ className, getSyncStatus, onForceSync, onReconnect, onValidateConsistency, onResetLocalData, onReconcileConflicts, }: DatabaseStatusIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FormConfig } from './types';
|
|
2
|
+
export interface VaultConfig {
|
|
3
|
+
address: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
namespace?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SecureConfigOptions {
|
|
8
|
+
vault?: VaultConfig;
|
|
9
|
+
enableVault?: boolean;
|
|
10
|
+
envPrefix?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class SecureConfigLoader {
|
|
13
|
+
private vaultConfig?;
|
|
14
|
+
private enableVault;
|
|
15
|
+
private envPrefix;
|
|
16
|
+
constructor(options?: SecureConfigOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Load and process configuration with secure credential handling
|
|
19
|
+
*/
|
|
20
|
+
loadSecureConfig(configPath: string): Promise<FormConfig>;
|
|
21
|
+
/**
|
|
22
|
+
* Process configuration object with secure substitutions
|
|
23
|
+
*/
|
|
24
|
+
processSecureConfig(config: any): Promise<FormConfig>;
|
|
25
|
+
/**
|
|
26
|
+
* Read configuration file (in browser, this would come from the server)
|
|
27
|
+
*/
|
|
28
|
+
private readConfigFile;
|
|
29
|
+
/**
|
|
30
|
+
* Substitute secure values in configuration string
|
|
31
|
+
*/
|
|
32
|
+
private substituteSecureValues;
|
|
33
|
+
/**
|
|
34
|
+
* Substitute environment variables
|
|
35
|
+
*/
|
|
36
|
+
private substituteEnvironmentVariables;
|
|
37
|
+
/**
|
|
38
|
+
* Substitute Vault values (CI/CD environment)
|
|
39
|
+
*/
|
|
40
|
+
private substituteVaultValues;
|
|
41
|
+
/**
|
|
42
|
+
* Fetch secret from Vault
|
|
43
|
+
*/
|
|
44
|
+
private fetchFromVault;
|
|
45
|
+
/**
|
|
46
|
+
* Validate database connection configuration
|
|
47
|
+
*/
|
|
48
|
+
validateDatabaseConfig(config: FormConfig): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Create configuration for different environments
|
|
51
|
+
*/
|
|
52
|
+
static createForEnvironment(): SecureConfigLoader;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Simple helper for loading configuration in applications
|
|
56
|
+
*/
|
|
57
|
+
export declare function loadSecureFormConfig(configPath: string): Promise<FormConfig>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useFormConfiguration } from './hooks';
|
|
2
|
+
export type { SecureConfigOptions, VaultConfig } from './SecureConfigLoader';
|
|
3
|
+
export { loadSecureFormConfig, SecureConfigLoader } from './SecureConfigLoader';
|
|
4
|
+
export type { DatabaseConfig, FormConfig, FormStorageConfig, } from './types';
|
|
5
|
+
export { createConfigFromEnvironment, DEFAULT_FORM_CONFIG } from './types';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified configuration types for the form builder system
|
|
3
|
+
* Single source of truth for all form configuration needs
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Database configuration for database storage strategy
|
|
7
|
+
* Simplified configuration - always uses PgLite with local-first approach and mandatory sync
|
|
8
|
+
*/
|
|
9
|
+
export interface DatabaseConfig {
|
|
10
|
+
/** Database connection string (required for database strategy) */
|
|
11
|
+
connectionString: string;
|
|
12
|
+
/** Optional service role key for authentication (only needed for some providers like Supabase) */
|
|
13
|
+
serviceRoleKey?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Unified form storage configuration
|
|
17
|
+
* Supports filesystem and database (PgLite-based) storage strategies
|
|
18
|
+
*/
|
|
19
|
+
export interface FormStorageConfig {
|
|
20
|
+
/** Storage strategy to use. Use "none" when the app handles persistence externally. */
|
|
21
|
+
strategy: "filesystem" | "database" | "none";
|
|
22
|
+
/** Path configuration for filesystem storage */
|
|
23
|
+
paths?: {
|
|
24
|
+
/** Primary storage directory for forms */
|
|
25
|
+
primaryStorage: string;
|
|
26
|
+
/** Template directories */
|
|
27
|
+
templates?: {
|
|
28
|
+
/** Team templates directory */
|
|
29
|
+
team?: string;
|
|
30
|
+
/** Generic templates directory */
|
|
31
|
+
generic?: string;
|
|
32
|
+
};
|
|
33
|
+
/** Fallback paths for form loading */
|
|
34
|
+
fallbackPaths?: string[];
|
|
35
|
+
/** Static assets directory */
|
|
36
|
+
staticAssets?: string;
|
|
37
|
+
};
|
|
38
|
+
/** Database configuration (required when strategy is "database") */
|
|
39
|
+
databaseConfig?: DatabaseConfig;
|
|
40
|
+
/** File extension for form files (filesystem strategy) */
|
|
41
|
+
fileExtension?: string;
|
|
42
|
+
/** Whether to automatically create directories (filesystem strategy) */
|
|
43
|
+
createDirectories?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Route configuration for form builder navigation
|
|
47
|
+
* Supports URL patterns with parameters like :project and :wizardId
|
|
48
|
+
*/
|
|
49
|
+
export interface RouteConfig {
|
|
50
|
+
/** Projects page route (e.g., "/forms", "/projects") */
|
|
51
|
+
projects?: string;
|
|
52
|
+
/** Forms list page route (e.g., "/forms/:project", "/projects/:project/forms") */
|
|
53
|
+
forms?: string;
|
|
54
|
+
/** Form builder page route (e.g., "/forms/:project/:wizardId", "/builder/:project/:wizardId") */
|
|
55
|
+
builder?: string;
|
|
56
|
+
/** Form preview page route (e.g., "/forms/:project/:wizardId/preview") */
|
|
57
|
+
preview?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Complete form configuration with storage, URLs, metadata, and theme support
|
|
61
|
+
*/
|
|
62
|
+
export interface FormConfig {
|
|
63
|
+
/** Storage configuration */
|
|
64
|
+
storage: FormStorageConfig;
|
|
65
|
+
/** URL configuration for previews and navigation */
|
|
66
|
+
urls?: {
|
|
67
|
+
/** Base URL for form previews */
|
|
68
|
+
previewBase?: string;
|
|
69
|
+
/** Preview path template */
|
|
70
|
+
previewPath?: string;
|
|
71
|
+
};
|
|
72
|
+
/** Route configuration for navigation */
|
|
73
|
+
routes?: RouteConfig;
|
|
74
|
+
/** Configuration metadata */
|
|
75
|
+
metadata?: {
|
|
76
|
+
/** Configuration version */
|
|
77
|
+
version?: string;
|
|
78
|
+
/** Last update timestamp */
|
|
79
|
+
lastUpdated?: string;
|
|
80
|
+
};
|
|
81
|
+
/** Theme configuration */
|
|
82
|
+
theme?: {
|
|
83
|
+
/** Theme name */
|
|
84
|
+
name?: string;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Default configuration values
|
|
89
|
+
*/
|
|
90
|
+
export declare const DEFAULT_FORM_CONFIG: FormConfig;
|
|
91
|
+
/**
|
|
92
|
+
* Creates configuration from environment variables
|
|
93
|
+
*/
|
|
94
|
+
export declare const createConfigFromEnvironment: () => FormConfig;
|