@msbci/form-editor 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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, 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,12 @@ 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[]>;
50
56
  }
51
57
  /** Complete editor state */
52
58
  interface EditorState {
@@ -62,15 +68,21 @@ interface EditorState {
62
68
  /**
63
69
  * Variable templates surfaced to the "Variables" toolbox tab. Populated
64
70
  * via `setAvailableTemplates` (typically by `FormEditor` after
65
- * `adapter.loadTemplates(form.scopeId)`). Out of the undo/redo history —
66
- * this is editor-UI state, not form state.
71
+ * `adapter.loadTemplates(form.scopeIds[N])` for every linked scope).
72
+ * Out of the undo/redo history — this is editor-UI state, not form state.
67
73
  */
68
74
  availableTemplates: IVariableTemplate[];
75
+ /**
76
+ * Scopes the user can attach to a form (FormProperties picker).
77
+ * Populated via `setAvailableScopes` (typically by `FormEditor` after
78
+ * `adapter.loadScopes()`). Out of the undo/redo history.
79
+ */
80
+ availableScopes: IScope[];
69
81
  }
70
82
  /** Editor actions */
71
83
  interface EditorActions {
72
84
  setForm: (form: IFormDefinition) => void;
73
- updateFormMeta: (updates: Partial<Pick<IFormDefinition, 'name' | 'code' | 'description' | 'formTypeId' | 'version' | 'langConfig'>>) => void;
85
+ updateFormMeta: (updates: Partial<Pick<IFormDefinition, 'name' | 'code' | 'description' | 'formTypeId' | 'version' | 'langConfig' | 'scopeIds'>>) => void;
74
86
  addPage: (page: IFormPage) => void;
75
87
  updatePage: (pageCode: string, updates: Partial<IFormPage>) => void;
76
88
  removePage: (pageCode: string) => void;
@@ -120,6 +132,8 @@ interface EditorActions {
120
132
  removeFormType: (id: string) => void;
121
133
  /** Replace the variable-template list shown in the Variables tab. */
122
134
  setAvailableTemplates: (templates: IVariableTemplate[]) => void;
135
+ /** Replace the scope list shown in the FormProperties scope picker. */
136
+ setAvailableScopes: (scopes: IScope[]) => void;
123
137
  setAdapter: (adapter: IEditorAdapter) => void;
124
138
  save: () => Promise<void>;
125
139
  load: (formId: string) => Promise<void>;
@@ -147,6 +161,8 @@ interface IEditorLabels {
147
161
  formNamePlaceholder: string;
148
162
  unsaved: string;
149
163
  addPage: string;
164
+ /** Header button that opens the FormProperties panel (selection = form). */
165
+ formProperties: string;
150
166
  types: string;
151
167
  manageFormTypesTitle: string;
152
168
  undo: string;
@@ -294,6 +310,12 @@ interface IEditorLabels {
294
310
  readonly: string;
295
311
  hidden: string;
296
312
  expression: string;
313
+ scopes: string;
314
+ scopesHint: string;
315
+ noScopesAvailable: string;
316
+ moveScopeUp: string;
317
+ moveScopeDown: string;
318
+ removeScope: string;
297
319
  langConfigSection: string;
298
320
  langConfigAvailable: string;
299
321
  langConfigDefault: string;
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, 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,12 @@ 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[]>;
50
56
  }
51
57
  /** Complete editor state */
52
58
  interface EditorState {
@@ -62,15 +68,21 @@ interface EditorState {
62
68
  /**
63
69
  * Variable templates surfaced to the "Variables" toolbox tab. Populated
64
70
  * via `setAvailableTemplates` (typically by `FormEditor` after
65
- * `adapter.loadTemplates(form.scopeId)`). Out of the undo/redo history —
66
- * this is editor-UI state, not form state.
71
+ * `adapter.loadTemplates(form.scopeIds[N])` for every linked scope).
72
+ * Out of the undo/redo history — this is editor-UI state, not form state.
67
73
  */
68
74
  availableTemplates: IVariableTemplate[];
75
+ /**
76
+ * Scopes the user can attach to a form (FormProperties picker).
77
+ * Populated via `setAvailableScopes` (typically by `FormEditor` after
78
+ * `adapter.loadScopes()`). Out of the undo/redo history.
79
+ */
80
+ availableScopes: IScope[];
69
81
  }
70
82
  /** Editor actions */
71
83
  interface EditorActions {
72
84
  setForm: (form: IFormDefinition) => void;
73
- updateFormMeta: (updates: Partial<Pick<IFormDefinition, 'name' | 'code' | 'description' | 'formTypeId' | 'version' | 'langConfig'>>) => void;
85
+ updateFormMeta: (updates: Partial<Pick<IFormDefinition, 'name' | 'code' | 'description' | 'formTypeId' | 'version' | 'langConfig' | 'scopeIds'>>) => void;
74
86
  addPage: (page: IFormPage) => void;
75
87
  updatePage: (pageCode: string, updates: Partial<IFormPage>) => void;
76
88
  removePage: (pageCode: string) => void;
@@ -120,6 +132,8 @@ interface EditorActions {
120
132
  removeFormType: (id: string) => void;
121
133
  /** Replace the variable-template list shown in the Variables tab. */
122
134
  setAvailableTemplates: (templates: IVariableTemplate[]) => void;
135
+ /** Replace the scope list shown in the FormProperties scope picker. */
136
+ setAvailableScopes: (scopes: IScope[]) => void;
123
137
  setAdapter: (adapter: IEditorAdapter) => void;
124
138
  save: () => Promise<void>;
125
139
  load: (formId: string) => Promise<void>;
@@ -147,6 +161,8 @@ interface IEditorLabels {
147
161
  formNamePlaceholder: string;
148
162
  unsaved: string;
149
163
  addPage: string;
164
+ /** Header button that opens the FormProperties panel (selection = form). */
165
+ formProperties: string;
150
166
  types: string;
151
167
  manageFormTypesTitle: string;
152
168
  undo: string;
@@ -294,6 +310,12 @@ interface IEditorLabels {
294
310
  readonly: string;
295
311
  hidden: string;
296
312
  expression: string;
313
+ scopes: string;
314
+ scopesHint: string;
315
+ noScopesAvailable: string;
316
+ moveScopeUp: string;
317
+ moveScopeDown: string;
318
+ removeScope: string;
297
319
  langConfigSection: string;
298
320
  langConfigAvailable: string;
299
321
  langConfigDefault: string;