@esheet/renderer 0.0.2-0 → 0.0.3-0
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.ts +15 -11
- package/dist/index.js +7500 -3155
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
|
-
import { FormDefinition } from '@esheet/core';
|
|
3
2
|
import { FormResponse } from '@esheet/core';
|
|
4
3
|
import { FormStore } from '@esheet/core';
|
|
5
4
|
import { JSX } from 'react/jsx-runtime';
|
|
@@ -43,12 +42,19 @@ export declare interface EsheetRendererHandle {
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
export declare interface EsheetRendererProps {
|
|
46
|
-
/** Form definition
|
|
47
|
-
|
|
45
|
+
/** Form definition — accepts FormDefinition, SurveyJS schema, MCP elicitation envelope,
|
|
46
|
+
* or any of the above as a JSON/YAML string. Auto-detected and converted internally.
|
|
47
|
+
* Set `strict` to disable auto-conversion and require a valid FormDefinition directly. */
|
|
48
|
+
formDataInput: unknown;
|
|
48
49
|
/** Additional CSS classes for root container */
|
|
49
50
|
className?: string;
|
|
50
51
|
/** Initial form responses (pre-fill data) */
|
|
51
52
|
initialResponses?: FormResponse;
|
|
53
|
+
/** When true, disables auto-detection of MCP/SurveyJS formats.
|
|
54
|
+
* Only accepts a valid eSheet FormDefinition (or JSON/YAML string thereof). */
|
|
55
|
+
strict?: boolean;
|
|
56
|
+
/** Called after the form definition has been parsed and loaded into the store. */
|
|
57
|
+
onReady?: () => void;
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
/**
|
|
@@ -82,16 +88,14 @@ declare interface RendererBodyProps {
|
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
/**
|
|
85
|
-
* Initialize renderer with form definition
|
|
91
|
+
* Initialize renderer with form definition.
|
|
86
92
|
*
|
|
87
|
-
* -
|
|
88
|
-
* -
|
|
89
|
-
* -
|
|
90
|
-
* -
|
|
91
|
-
* - Applies initial responses if provided
|
|
92
|
-
* - Calls onValidationError with schema validation issues if validation fails
|
|
93
|
+
* Auto-detects and converts the following input formats:
|
|
94
|
+
* - eSheet FormDefinition (object or JSON/YAML string)
|
|
95
|
+
* - MCP elicitation/create envelope
|
|
96
|
+
* - SurveyJS schema (has top-level `pages` or `elements` array)
|
|
93
97
|
*/
|
|
94
|
-
export declare function useRendererInit(form: FormStore, ui: UIStore, formData:
|
|
98
|
+
export declare function useRendererInit(form: FormStore, ui: UIStore, formData: unknown, initialResponses?: FormResponse, onValidationError?: (errors: string[]) => void, strict?: boolean, onReady?: () => void): void;
|
|
95
99
|
|
|
96
100
|
export { ValidationError }
|
|
97
101
|
|