@msbci/form-editor 1.3.2 → 1.3.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/README.md +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +138 -6
- package/dist/index.d.ts +138 -6
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React, { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { IFormDefinition, IFormPage, IFormRoster, IFormVariable, IVariableTemplate, IVariableTemplateOverrides, IFormType, IDataSourceConnector, VariableType, RosterType, IConditionRule, IRosterVariableRef } from '@msbci/form-core';
|
|
3
|
+
import { IFormDefinition, IFormPage, IFormRoster, IFormVariable, IVariableTemplate, IVariableTemplateOverrides, IFormType, IScope, IDataSourceConfig, IDataSourceConnector, VariableType, RosterType, IConditionRule, IRosterVariableRef } from '@msbci/form-core';
|
|
4
4
|
export { IDataSourceConnector, IFormDefinition, IFormPage, IFormRoster, IFormVariable, IMosobiThemeBase } from '@msbci/form-core';
|
|
5
5
|
import * as zustand from 'zustand';
|
|
6
6
|
import { DragEndEvent } from '@dnd-kit/core';
|
|
@@ -47,6 +47,25 @@ interface IEditorAdapter {
|
|
|
47
47
|
* shows the {@link IEditorLabels.toolbox.noTemplates} message.
|
|
48
48
|
*/
|
|
49
49
|
loadTemplates?: (scopeId: string) => Promise<IVariableTemplate[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Optional — fetch every scope the user can attach to a form.
|
|
52
|
+
* When absent, the FormProperties scope selector shows a static
|
|
53
|
+
* empty list (the user can no longer pick from existing scopes).
|
|
54
|
+
*/
|
|
55
|
+
loadScopes?: () => Promise<IScope[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Optional — fetch the {@link IDataSourceConfig} list of a scope.
|
|
58
|
+
* Called once per scope when `FormEditor` mounts and whenever
|
|
59
|
+
* `form.scopeIds` changes. The editor merges results across scopes
|
|
60
|
+
* (first scope wins on `code` conflicts).
|
|
61
|
+
*/
|
|
62
|
+
loadDataSources?: (scopeId: string) => Promise<IDataSourceConfig[]>;
|
|
63
|
+
/** Optional — create a {@link IDataSourceConfig} within a scope. */
|
|
64
|
+
createDataSource?: (scopeId: string, data: Omit<IDataSourceConfig, 'id' | 'scopeId' | 'createdAt' | 'updatedAt'>) => Promise<IDataSourceConfig>;
|
|
65
|
+
/** Optional — update an existing {@link IDataSourceConfig}. */
|
|
66
|
+
updateDataSource?: (id: string, data: Partial<Omit<IDataSourceConfig, 'id' | 'scopeId' | 'createdAt' | 'updatedAt'>>) => Promise<IDataSourceConfig>;
|
|
67
|
+
/** Optional — hard-delete a {@link IDataSourceConfig}. */
|
|
68
|
+
deleteDataSource?: (id: string) => Promise<void>;
|
|
50
69
|
}
|
|
51
70
|
/** Complete editor state */
|
|
52
71
|
interface EditorState {
|
|
@@ -62,15 +81,28 @@ interface EditorState {
|
|
|
62
81
|
/**
|
|
63
82
|
* Variable templates surfaced to the "Variables" toolbox tab. Populated
|
|
64
83
|
* via `setAvailableTemplates` (typically by `FormEditor` after
|
|
65
|
-
* `adapter.loadTemplates(form.
|
|
66
|
-
* this is editor-UI state, not form state.
|
|
84
|
+
* `adapter.loadTemplates(form.scopeIds[N])` for every linked scope).
|
|
85
|
+
* Out of the undo/redo history — this is editor-UI state, not form state.
|
|
67
86
|
*/
|
|
68
87
|
availableTemplates: IVariableTemplate[];
|
|
88
|
+
/**
|
|
89
|
+
* Scopes the user can attach to a form (FormProperties picker).
|
|
90
|
+
* Populated via `setAvailableScopes` (typically by `FormEditor` after
|
|
91
|
+
* `adapter.loadScopes()`). Out of the undo/redo history.
|
|
92
|
+
*/
|
|
93
|
+
availableScopes: IScope[];
|
|
94
|
+
/**
|
|
95
|
+
* Data source configs available for the current form's scopes.
|
|
96
|
+
* Each entry keeps its `scopeId` so the manager can surface provenance.
|
|
97
|
+
* Deduplicated by `code` (first scope of `form.scopeIds` wins) when
|
|
98
|
+
* populated by `FormEditor`. Out of the undo/redo history.
|
|
99
|
+
*/
|
|
100
|
+
availableDataSources: IDataSourceConfig[];
|
|
69
101
|
}
|
|
70
102
|
/** Editor actions */
|
|
71
103
|
interface EditorActions {
|
|
72
104
|
setForm: (form: IFormDefinition) => void;
|
|
73
|
-
updateFormMeta: (updates: Partial<Pick<IFormDefinition, 'name' | 'code' | 'description' | 'formTypeId' | 'version' | 'langConfig'>>) => void;
|
|
105
|
+
updateFormMeta: (updates: Partial<Pick<IFormDefinition, 'name' | 'code' | 'description' | 'formTypeId' | 'version' | 'langConfig' | 'scopeIds'>>) => void;
|
|
74
106
|
addPage: (page: IFormPage) => void;
|
|
75
107
|
updatePage: (pageCode: string, updates: Partial<IFormPage>) => void;
|
|
76
108
|
removePage: (pageCode: string) => void;
|
|
@@ -120,6 +152,10 @@ interface EditorActions {
|
|
|
120
152
|
removeFormType: (id: string) => void;
|
|
121
153
|
/** Replace the variable-template list shown in the Variables tab. */
|
|
122
154
|
setAvailableTemplates: (templates: IVariableTemplate[]) => void;
|
|
155
|
+
/** Replace the scope list shown in the FormProperties scope picker. */
|
|
156
|
+
setAvailableScopes: (scopes: IScope[]) => void;
|
|
157
|
+
/** Replace the data-source list surfaced to the DataSourceConfigManager. */
|
|
158
|
+
setAvailableDataSources: (configs: IDataSourceConfig[]) => void;
|
|
123
159
|
setAdapter: (adapter: IEditorAdapter) => void;
|
|
124
160
|
save: () => Promise<void>;
|
|
125
161
|
load: (formId: string) => Promise<void>;
|
|
@@ -147,8 +183,14 @@ interface IEditorLabels {
|
|
|
147
183
|
formNamePlaceholder: string;
|
|
148
184
|
unsaved: string;
|
|
149
185
|
addPage: string;
|
|
186
|
+
/** Header button that opens the FormProperties panel (selection = form). */
|
|
187
|
+
formProperties: string;
|
|
150
188
|
types: string;
|
|
151
189
|
manageFormTypesTitle: string;
|
|
190
|
+
/** Header button that opens the DataSourceConfigManager dialog. */
|
|
191
|
+
dataSources: string;
|
|
192
|
+
/** Tooltip on the DataSources header button. */
|
|
193
|
+
manageDataSourcesTitle: string;
|
|
152
194
|
undo: string;
|
|
153
195
|
redo: string;
|
|
154
196
|
save: string;
|
|
@@ -294,6 +336,12 @@ interface IEditorLabels {
|
|
|
294
336
|
readonly: string;
|
|
295
337
|
hidden: string;
|
|
296
338
|
expression: string;
|
|
339
|
+
scopes: string;
|
|
340
|
+
scopesHint: string;
|
|
341
|
+
noScopesAvailable: string;
|
|
342
|
+
moveScopeUp: string;
|
|
343
|
+
moveScopeDown: string;
|
|
344
|
+
removeScope: string;
|
|
297
345
|
langConfigSection: string;
|
|
298
346
|
langConfigAvailable: string;
|
|
299
347
|
langConfigDefault: string;
|
|
@@ -391,6 +439,64 @@ interface IEditorLabels {
|
|
|
391
439
|
dependencyKeyPlaceholder: string;
|
|
392
440
|
addDependency: string;
|
|
393
441
|
};
|
|
442
|
+
dataSourceManager: {
|
|
443
|
+
/** ARIA label of the dialog root. */
|
|
444
|
+
dialogAriaLabel: string;
|
|
445
|
+
/** Visible dialog title. */
|
|
446
|
+
title: string;
|
|
447
|
+
/** Close button aria-label. */
|
|
448
|
+
closeAriaLabel: string;
|
|
449
|
+
/** "+ Ajouter une source" CTA. */
|
|
450
|
+
addButton: string;
|
|
451
|
+
/** Empty-state message when the scope has no sources yet. */
|
|
452
|
+
noSources: string;
|
|
453
|
+
/** Empty-state message when the form has no scope at all. */
|
|
454
|
+
noScope: string;
|
|
455
|
+
/** Filter label when multiple scopes are linked to the form. */
|
|
456
|
+
scopeFilterLabel: string;
|
|
457
|
+
/** Inline form: code field label. */
|
|
458
|
+
fieldCode: string;
|
|
459
|
+
/** Inline form: name field label. */
|
|
460
|
+
fieldName: string;
|
|
461
|
+
/** Inline form: url field label. */
|
|
462
|
+
fieldUrl: string;
|
|
463
|
+
/** Inline form: method field label. */
|
|
464
|
+
fieldMethod: string;
|
|
465
|
+
/** Inline form: queryParam field label. */
|
|
466
|
+
fieldQueryParam: string;
|
|
467
|
+
/** Inline form: valueField label. */
|
|
468
|
+
fieldValueField: string;
|
|
469
|
+
/** Inline form: labelField label. */
|
|
470
|
+
fieldLabelField: string;
|
|
471
|
+
/** Inline form: headers section label. */
|
|
472
|
+
fieldHeaders: string;
|
|
473
|
+
/** Header row: key placeholder. */
|
|
474
|
+
headerKeyPlaceholder: string;
|
|
475
|
+
/** Header row: value placeholder. */
|
|
476
|
+
headerValuePlaceholder: string;
|
|
477
|
+
/** Add-header button. */
|
|
478
|
+
addHeader: string;
|
|
479
|
+
/** Inline form: dependencies section label. */
|
|
480
|
+
fieldDependencies: string;
|
|
481
|
+
/** Dep row: url param placeholder. */
|
|
482
|
+
dependencyParamPlaceholder: string;
|
|
483
|
+
/** Dep row: variable code placeholder. */
|
|
484
|
+
dependencyVarPlaceholder: string;
|
|
485
|
+
/** Add-dependency button. */
|
|
486
|
+
addDependency: string;
|
|
487
|
+
/** Submit button (create or update). */
|
|
488
|
+
save: string;
|
|
489
|
+
/** Cancel button. */
|
|
490
|
+
cancel: string;
|
|
491
|
+
/** Edit row pencil button aria-label. */
|
|
492
|
+
editAria: (code: string) => string;
|
|
493
|
+
/** Delete row × button aria-label. */
|
|
494
|
+
deleteAria: (code: string) => string;
|
|
495
|
+
/** Provenance badge: which scope the source belongs to. */
|
|
496
|
+
scopeBadge: (scopeCode: string) => string;
|
|
497
|
+
/** Confirm message before deletion. */
|
|
498
|
+
confirmDelete: (code: string) => string;
|
|
499
|
+
};
|
|
394
500
|
formTypesDialog: {
|
|
395
501
|
dialogAriaLabel: string;
|
|
396
502
|
title: string;
|
|
@@ -604,7 +710,11 @@ interface DataSourceSelectorProps {
|
|
|
604
710
|
dataSourceId?: string;
|
|
605
711
|
/** Current dependency mapping: { depKey: variableCode } */
|
|
606
712
|
dependencies?: Record<string, string>;
|
|
607
|
-
/**
|
|
713
|
+
/**
|
|
714
|
+
* Legacy connectors injected by the host code. Merged with the
|
|
715
|
+
* admin-managed configs from the store (the store wins on `id` clash —
|
|
716
|
+
* the editor surfaces what admins actually configured).
|
|
717
|
+
*/
|
|
608
718
|
availableConnectors: IDataSourceConnector[];
|
|
609
719
|
/** All variable codes available for dependency mapping */
|
|
610
720
|
availableVariables: Array<{
|
|
@@ -618,4 +728,26 @@ interface DataSourceSelectorProps {
|
|
|
618
728
|
}
|
|
619
729
|
declare function DataSourceSelector({ dataSourceId, dependencies, availableConnectors, availableVariables, onConnectorChange, onDependenciesChange, }: DataSourceSelectorProps): react_jsx_runtime.JSX.Element;
|
|
620
730
|
|
|
621
|
-
|
|
731
|
+
/**
|
|
732
|
+
* DataSourceConfigManager — admin CRUD for IDataSourceConfig within
|
|
733
|
+
* the scope(s) linked to the current form.
|
|
734
|
+
*
|
|
735
|
+
* Renders a native React modal (same pattern as FormTypesDialog) with:
|
|
736
|
+
* - A scope filter (visible only when the form has more than one scope)
|
|
737
|
+
* - The list of `availableDataSources` filtered by selected scope
|
|
738
|
+
* - An inline add/edit form for code, name, url, method, queryParam,
|
|
739
|
+
* value/label fields, headers (key/value rows), and dependencies
|
|
740
|
+
* (urlParam → variable code rows)
|
|
741
|
+
*
|
|
742
|
+
* Persistence goes through the adapter's CRUD methods; the store is
|
|
743
|
+
* refreshed by mutating `availableDataSources` locally (optimistic — the
|
|
744
|
+
* server is the source of truth). FormEditor's effect will re-load on
|
|
745
|
+
* the next scope change.
|
|
746
|
+
*/
|
|
747
|
+
interface DataSourceConfigManagerProps {
|
|
748
|
+
open: boolean;
|
|
749
|
+
onClose: () => void;
|
|
750
|
+
}
|
|
751
|
+
declare function DataSourceConfigManager({ open, onClose }: DataSourceConfigManagerProps): react_jsx_runtime.JSX.Element | null;
|
|
752
|
+
|
|
753
|
+
export { type ActiveDragData, Canvas, Canvas as CanvasDnd, CanvasSimple, ConditionBuilder, type ConditionBuilderProps, DataSourceConfigManager, type DataSourceConfigManagerProps, DataSourceSelector, type DataSourceSelectorProps, type DeepPartial, DndManager, type DragEndActions, type EditorActions, EditorLabelsProvider, type EditorSelection, type EditorState, type EditorStore, EditorToolbar, type EditorView, FormEditor, type FormEditorProps, type HistoryEntry, type IEditorAdapter, type IEditorLabels, type OverDropData, PropertiesPanel, Toolbox, Toolbox as ToolboxDnd, ToolboxSimple, createDragEndHandler, frLabels as defaultLabels, enLabels, frLabels, mergeLabels, useEditorStore, useLabels };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React, { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { IFormDefinition, IFormPage, IFormRoster, IFormVariable, IVariableTemplate, IVariableTemplateOverrides, IFormType, IDataSourceConnector, VariableType, RosterType, IConditionRule, IRosterVariableRef } from '@msbci/form-core';
|
|
3
|
+
import { IFormDefinition, IFormPage, IFormRoster, IFormVariable, IVariableTemplate, IVariableTemplateOverrides, IFormType, IScope, IDataSourceConfig, IDataSourceConnector, VariableType, RosterType, IConditionRule, IRosterVariableRef } from '@msbci/form-core';
|
|
4
4
|
export { IDataSourceConnector, IFormDefinition, IFormPage, IFormRoster, IFormVariable, IMosobiThemeBase } from '@msbci/form-core';
|
|
5
5
|
import * as zustand from 'zustand';
|
|
6
6
|
import { DragEndEvent } from '@dnd-kit/core';
|
|
@@ -47,6 +47,25 @@ interface IEditorAdapter {
|
|
|
47
47
|
* shows the {@link IEditorLabels.toolbox.noTemplates} message.
|
|
48
48
|
*/
|
|
49
49
|
loadTemplates?: (scopeId: string) => Promise<IVariableTemplate[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Optional — fetch every scope the user can attach to a form.
|
|
52
|
+
* When absent, the FormProperties scope selector shows a static
|
|
53
|
+
* empty list (the user can no longer pick from existing scopes).
|
|
54
|
+
*/
|
|
55
|
+
loadScopes?: () => Promise<IScope[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Optional — fetch the {@link IDataSourceConfig} list of a scope.
|
|
58
|
+
* Called once per scope when `FormEditor` mounts and whenever
|
|
59
|
+
* `form.scopeIds` changes. The editor merges results across scopes
|
|
60
|
+
* (first scope wins on `code` conflicts).
|
|
61
|
+
*/
|
|
62
|
+
loadDataSources?: (scopeId: string) => Promise<IDataSourceConfig[]>;
|
|
63
|
+
/** Optional — create a {@link IDataSourceConfig} within a scope. */
|
|
64
|
+
createDataSource?: (scopeId: string, data: Omit<IDataSourceConfig, 'id' | 'scopeId' | 'createdAt' | 'updatedAt'>) => Promise<IDataSourceConfig>;
|
|
65
|
+
/** Optional — update an existing {@link IDataSourceConfig}. */
|
|
66
|
+
updateDataSource?: (id: string, data: Partial<Omit<IDataSourceConfig, 'id' | 'scopeId' | 'createdAt' | 'updatedAt'>>) => Promise<IDataSourceConfig>;
|
|
67
|
+
/** Optional — hard-delete a {@link IDataSourceConfig}. */
|
|
68
|
+
deleteDataSource?: (id: string) => Promise<void>;
|
|
50
69
|
}
|
|
51
70
|
/** Complete editor state */
|
|
52
71
|
interface EditorState {
|
|
@@ -62,15 +81,28 @@ interface EditorState {
|
|
|
62
81
|
/**
|
|
63
82
|
* Variable templates surfaced to the "Variables" toolbox tab. Populated
|
|
64
83
|
* via `setAvailableTemplates` (typically by `FormEditor` after
|
|
65
|
-
* `adapter.loadTemplates(form.
|
|
66
|
-
* this is editor-UI state, not form state.
|
|
84
|
+
* `adapter.loadTemplates(form.scopeIds[N])` for every linked scope).
|
|
85
|
+
* Out of the undo/redo history — this is editor-UI state, not form state.
|
|
67
86
|
*/
|
|
68
87
|
availableTemplates: IVariableTemplate[];
|
|
88
|
+
/**
|
|
89
|
+
* Scopes the user can attach to a form (FormProperties picker).
|
|
90
|
+
* Populated via `setAvailableScopes` (typically by `FormEditor` after
|
|
91
|
+
* `adapter.loadScopes()`). Out of the undo/redo history.
|
|
92
|
+
*/
|
|
93
|
+
availableScopes: IScope[];
|
|
94
|
+
/**
|
|
95
|
+
* Data source configs available for the current form's scopes.
|
|
96
|
+
* Each entry keeps its `scopeId` so the manager can surface provenance.
|
|
97
|
+
* Deduplicated by `code` (first scope of `form.scopeIds` wins) when
|
|
98
|
+
* populated by `FormEditor`. Out of the undo/redo history.
|
|
99
|
+
*/
|
|
100
|
+
availableDataSources: IDataSourceConfig[];
|
|
69
101
|
}
|
|
70
102
|
/** Editor actions */
|
|
71
103
|
interface EditorActions {
|
|
72
104
|
setForm: (form: IFormDefinition) => void;
|
|
73
|
-
updateFormMeta: (updates: Partial<Pick<IFormDefinition, 'name' | 'code' | 'description' | 'formTypeId' | 'version' | 'langConfig'>>) => void;
|
|
105
|
+
updateFormMeta: (updates: Partial<Pick<IFormDefinition, 'name' | 'code' | 'description' | 'formTypeId' | 'version' | 'langConfig' | 'scopeIds'>>) => void;
|
|
74
106
|
addPage: (page: IFormPage) => void;
|
|
75
107
|
updatePage: (pageCode: string, updates: Partial<IFormPage>) => void;
|
|
76
108
|
removePage: (pageCode: string) => void;
|
|
@@ -120,6 +152,10 @@ interface EditorActions {
|
|
|
120
152
|
removeFormType: (id: string) => void;
|
|
121
153
|
/** Replace the variable-template list shown in the Variables tab. */
|
|
122
154
|
setAvailableTemplates: (templates: IVariableTemplate[]) => void;
|
|
155
|
+
/** Replace the scope list shown in the FormProperties scope picker. */
|
|
156
|
+
setAvailableScopes: (scopes: IScope[]) => void;
|
|
157
|
+
/** Replace the data-source list surfaced to the DataSourceConfigManager. */
|
|
158
|
+
setAvailableDataSources: (configs: IDataSourceConfig[]) => void;
|
|
123
159
|
setAdapter: (adapter: IEditorAdapter) => void;
|
|
124
160
|
save: () => Promise<void>;
|
|
125
161
|
load: (formId: string) => Promise<void>;
|
|
@@ -147,8 +183,14 @@ interface IEditorLabels {
|
|
|
147
183
|
formNamePlaceholder: string;
|
|
148
184
|
unsaved: string;
|
|
149
185
|
addPage: string;
|
|
186
|
+
/** Header button that opens the FormProperties panel (selection = form). */
|
|
187
|
+
formProperties: string;
|
|
150
188
|
types: string;
|
|
151
189
|
manageFormTypesTitle: string;
|
|
190
|
+
/** Header button that opens the DataSourceConfigManager dialog. */
|
|
191
|
+
dataSources: string;
|
|
192
|
+
/** Tooltip on the DataSources header button. */
|
|
193
|
+
manageDataSourcesTitle: string;
|
|
152
194
|
undo: string;
|
|
153
195
|
redo: string;
|
|
154
196
|
save: string;
|
|
@@ -294,6 +336,12 @@ interface IEditorLabels {
|
|
|
294
336
|
readonly: string;
|
|
295
337
|
hidden: string;
|
|
296
338
|
expression: string;
|
|
339
|
+
scopes: string;
|
|
340
|
+
scopesHint: string;
|
|
341
|
+
noScopesAvailable: string;
|
|
342
|
+
moveScopeUp: string;
|
|
343
|
+
moveScopeDown: string;
|
|
344
|
+
removeScope: string;
|
|
297
345
|
langConfigSection: string;
|
|
298
346
|
langConfigAvailable: string;
|
|
299
347
|
langConfigDefault: string;
|
|
@@ -391,6 +439,64 @@ interface IEditorLabels {
|
|
|
391
439
|
dependencyKeyPlaceholder: string;
|
|
392
440
|
addDependency: string;
|
|
393
441
|
};
|
|
442
|
+
dataSourceManager: {
|
|
443
|
+
/** ARIA label of the dialog root. */
|
|
444
|
+
dialogAriaLabel: string;
|
|
445
|
+
/** Visible dialog title. */
|
|
446
|
+
title: string;
|
|
447
|
+
/** Close button aria-label. */
|
|
448
|
+
closeAriaLabel: string;
|
|
449
|
+
/** "+ Ajouter une source" CTA. */
|
|
450
|
+
addButton: string;
|
|
451
|
+
/** Empty-state message when the scope has no sources yet. */
|
|
452
|
+
noSources: string;
|
|
453
|
+
/** Empty-state message when the form has no scope at all. */
|
|
454
|
+
noScope: string;
|
|
455
|
+
/** Filter label when multiple scopes are linked to the form. */
|
|
456
|
+
scopeFilterLabel: string;
|
|
457
|
+
/** Inline form: code field label. */
|
|
458
|
+
fieldCode: string;
|
|
459
|
+
/** Inline form: name field label. */
|
|
460
|
+
fieldName: string;
|
|
461
|
+
/** Inline form: url field label. */
|
|
462
|
+
fieldUrl: string;
|
|
463
|
+
/** Inline form: method field label. */
|
|
464
|
+
fieldMethod: string;
|
|
465
|
+
/** Inline form: queryParam field label. */
|
|
466
|
+
fieldQueryParam: string;
|
|
467
|
+
/** Inline form: valueField label. */
|
|
468
|
+
fieldValueField: string;
|
|
469
|
+
/** Inline form: labelField label. */
|
|
470
|
+
fieldLabelField: string;
|
|
471
|
+
/** Inline form: headers section label. */
|
|
472
|
+
fieldHeaders: string;
|
|
473
|
+
/** Header row: key placeholder. */
|
|
474
|
+
headerKeyPlaceholder: string;
|
|
475
|
+
/** Header row: value placeholder. */
|
|
476
|
+
headerValuePlaceholder: string;
|
|
477
|
+
/** Add-header button. */
|
|
478
|
+
addHeader: string;
|
|
479
|
+
/** Inline form: dependencies section label. */
|
|
480
|
+
fieldDependencies: string;
|
|
481
|
+
/** Dep row: url param placeholder. */
|
|
482
|
+
dependencyParamPlaceholder: string;
|
|
483
|
+
/** Dep row: variable code placeholder. */
|
|
484
|
+
dependencyVarPlaceholder: string;
|
|
485
|
+
/** Add-dependency button. */
|
|
486
|
+
addDependency: string;
|
|
487
|
+
/** Submit button (create or update). */
|
|
488
|
+
save: string;
|
|
489
|
+
/** Cancel button. */
|
|
490
|
+
cancel: string;
|
|
491
|
+
/** Edit row pencil button aria-label. */
|
|
492
|
+
editAria: (code: string) => string;
|
|
493
|
+
/** Delete row × button aria-label. */
|
|
494
|
+
deleteAria: (code: string) => string;
|
|
495
|
+
/** Provenance badge: which scope the source belongs to. */
|
|
496
|
+
scopeBadge: (scopeCode: string) => string;
|
|
497
|
+
/** Confirm message before deletion. */
|
|
498
|
+
confirmDelete: (code: string) => string;
|
|
499
|
+
};
|
|
394
500
|
formTypesDialog: {
|
|
395
501
|
dialogAriaLabel: string;
|
|
396
502
|
title: string;
|
|
@@ -604,7 +710,11 @@ interface DataSourceSelectorProps {
|
|
|
604
710
|
dataSourceId?: string;
|
|
605
711
|
/** Current dependency mapping: { depKey: variableCode } */
|
|
606
712
|
dependencies?: Record<string, string>;
|
|
607
|
-
/**
|
|
713
|
+
/**
|
|
714
|
+
* Legacy connectors injected by the host code. Merged with the
|
|
715
|
+
* admin-managed configs from the store (the store wins on `id` clash —
|
|
716
|
+
* the editor surfaces what admins actually configured).
|
|
717
|
+
*/
|
|
608
718
|
availableConnectors: IDataSourceConnector[];
|
|
609
719
|
/** All variable codes available for dependency mapping */
|
|
610
720
|
availableVariables: Array<{
|
|
@@ -618,4 +728,26 @@ interface DataSourceSelectorProps {
|
|
|
618
728
|
}
|
|
619
729
|
declare function DataSourceSelector({ dataSourceId, dependencies, availableConnectors, availableVariables, onConnectorChange, onDependenciesChange, }: DataSourceSelectorProps): react_jsx_runtime.JSX.Element;
|
|
620
730
|
|
|
621
|
-
|
|
731
|
+
/**
|
|
732
|
+
* DataSourceConfigManager — admin CRUD for IDataSourceConfig within
|
|
733
|
+
* the scope(s) linked to the current form.
|
|
734
|
+
*
|
|
735
|
+
* Renders a native React modal (same pattern as FormTypesDialog) with:
|
|
736
|
+
* - A scope filter (visible only when the form has more than one scope)
|
|
737
|
+
* - The list of `availableDataSources` filtered by selected scope
|
|
738
|
+
* - An inline add/edit form for code, name, url, method, queryParam,
|
|
739
|
+
* value/label fields, headers (key/value rows), and dependencies
|
|
740
|
+
* (urlParam → variable code rows)
|
|
741
|
+
*
|
|
742
|
+
* Persistence goes through the adapter's CRUD methods; the store is
|
|
743
|
+
* refreshed by mutating `availableDataSources` locally (optimistic — the
|
|
744
|
+
* server is the source of truth). FormEditor's effect will re-load on
|
|
745
|
+
* the next scope change.
|
|
746
|
+
*/
|
|
747
|
+
interface DataSourceConfigManagerProps {
|
|
748
|
+
open: boolean;
|
|
749
|
+
onClose: () => void;
|
|
750
|
+
}
|
|
751
|
+
declare function DataSourceConfigManager({ open, onClose }: DataSourceConfigManagerProps): react_jsx_runtime.JSX.Element | null;
|
|
752
|
+
|
|
753
|
+
export { type ActiveDragData, Canvas, Canvas as CanvasDnd, CanvasSimple, ConditionBuilder, type ConditionBuilderProps, DataSourceConfigManager, type DataSourceConfigManagerProps, DataSourceSelector, type DataSourceSelectorProps, type DeepPartial, DndManager, type DragEndActions, type EditorActions, EditorLabelsProvider, type EditorSelection, type EditorState, type EditorStore, EditorToolbar, type EditorView, FormEditor, type FormEditorProps, type HistoryEntry, type IEditorAdapter, type IEditorLabels, type OverDropData, PropertiesPanel, Toolbox, Toolbox as ToolboxDnd, ToolboxSimple, createDragEndHandler, frLabels as defaultLabels, enLabels, frLabels, mergeLabels, useEditorStore, useLabels };
|