@harshshahcg/survey-render 1.0.8 → 1.1.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/README.md +3 -1
- package/dist/components/custom/DocumentResponse.d.ts +12 -0
- package/dist/components/custom/MediaUpload.d.ts +4 -3
- package/dist/components/custom/PdfResponse.d.ts +12 -0
- package/dist/surveyRender.js +1439 -1315
- package/dist/surveyRender.js.map +1 -1
- package/dist/surveyRender.umd.cjs +30 -30
- package/dist/surveyRender.umd.cjs.map +1 -1
- package/dist/types/survey.types.d.ts +1 -1
- package/dist/utils/fileUtils.d.ts +6 -3
- package/package.json +5 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Survey Render Library - Type definitions
|
|
3
3
|
* Matches FMB/Offline Mini App question and config structure.
|
|
4
4
|
*/
|
|
5
|
-
export type SupportedQuestionType = "single-select" | "multi-select" | "drop-down" | "dropdown" | "text-response" | "calendar" | "video-response" | "voice-response" | "image-response" | "tabular-text-input" | "tabular-drop-down" | "tabular-check-box";
|
|
5
|
+
export type SupportedQuestionType = "single-select" | "multi-select" | "drop-down" | "dropdown" | "text-response" | "calendar" | "video-response" | "voice-response" | "image-response" | "document-response" | "pdf-response" | "tabular-text-input" | "tabular-drop-down" | "tabular-check-box";
|
|
6
6
|
export interface SurveyQuestion {
|
|
7
7
|
surveyId: string;
|
|
8
8
|
questionId: string;
|
|
@@ -11,6 +11,8 @@ export interface EffectiveMediaConfig {
|
|
|
11
11
|
allowedTypes: Record<string, string[]>;
|
|
12
12
|
maxSizeBytes: Record<string, number>;
|
|
13
13
|
}
|
|
14
|
+
declare const MEDIA_QUESTION_TYPES: readonly ["image-response", "video-response", "voice-response", "document-response", "pdf-response"];
|
|
15
|
+
export type MediaQuestionType = (typeof MEDIA_QUESTION_TYPES)[number];
|
|
14
16
|
/**
|
|
15
17
|
* Build effective media config from survey data.config (supportedSize in MB).
|
|
16
18
|
* Falls back to static defaults when config or per-type settings are missing.
|
|
@@ -21,9 +23,9 @@ export interface FileValidationResult {
|
|
|
21
23
|
valid: boolean;
|
|
22
24
|
error?: string;
|
|
23
25
|
}
|
|
24
|
-
export declare function validateFileType(file: File, questionType:
|
|
25
|
-
export declare function validateFileSize(file: File, questionType:
|
|
26
|
-
export declare function validateFile(file: File, questionType:
|
|
26
|
+
export declare function validateFileType(file: File, questionType: MediaQuestionType, mediaConfig?: EffectiveMediaConfig | null): FileValidationResult;
|
|
27
|
+
export declare function validateFileSize(file: File, questionType: MediaQuestionType, mediaConfig?: EffectiveMediaConfig | null): FileValidationResult;
|
|
28
|
+
export declare function validateFile(file: File, questionType: MediaQuestionType, mediaConfig?: EffectiveMediaConfig | null): FileValidationResult;
|
|
27
29
|
/**
|
|
28
30
|
* Convert File to base64 and return { fileName, fileType, binary }.
|
|
29
31
|
*/
|
|
@@ -32,3 +34,4 @@ export declare function fileToFileObject(file: File): Promise<{
|
|
|
32
34
|
fileType: string;
|
|
33
35
|
binary: string;
|
|
34
36
|
}>;
|
|
37
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harshshahcg/survey-render",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://gitlab.battleofminds.net/harsh.shah/survey-render-lib.git"
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
"file-upload"
|
|
38
38
|
],
|
|
39
39
|
"license": "MIT",
|
|
40
|
-
"sideEffects": [
|
|
40
|
+
"sideEffects": [
|
|
41
|
+
"./dist/surveyRender.js",
|
|
42
|
+
"./dist/surveyRender.umd.cjs"
|
|
43
|
+
],
|
|
41
44
|
"peerDependencies": {
|
|
42
45
|
"react": ">=18.0.0",
|
|
43
46
|
"react-dom": ">=18.0.0"
|