@enspiredigital/xlms-headless 0.0.22 → 0.0.24

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.
@@ -0,0 +1,8 @@
1
+ import { PropsComponent, SpeakingQuestionType } from '../types';
2
+ import { useSpeaking, UploadHandlerSpeaking } from '../hooks';
3
+ interface SpeakingProps extends PropsComponent<SpeakingQuestionType, ReturnType<typeof useSpeaking>> {
4
+ uploadHandler?: UploadHandlerSpeaking;
5
+ }
6
+ export declare function SpeakingQuestion({ getData, children, uploadHandler, }: SpeakingProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=Speaking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Speaking.d.ts","sourceRoot":"","sources":["../../src/components/Speaking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE9D,UAAU,aACR,SAAQ,cAAc,CAAC,oBAAoB,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;IAC5E,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,QAAQ,EACR,aAAa,GACd,EAAE,aAAa,2CAKf"}
@@ -0,0 +1,8 @@
1
+ import { PropsComponent, WritingQuestionType } from '../types';
2
+ import { useWriting, UploadHandlerWriting } from '../hooks';
3
+ interface WritingProps extends PropsComponent<WritingQuestionType, ReturnType<typeof useWriting>> {
4
+ uploadHandler?: UploadHandlerWriting;
5
+ }
6
+ export declare function WritingQuestion({ getData, children, uploadHandler, }: WritingProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=Writing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Writing.d.ts","sourceRoot":"","sources":["../../src/components/Writing.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE5D,UAAU,YACR,SAAQ,cAAc,CAAC,mBAAmB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAC1E,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,QAAQ,EACR,aAAa,GACd,EAAE,YAAY,2CAKd"}
@@ -7,4 +7,6 @@ export * from './Labeling';
7
7
  export * from './FillInBlank';
8
8
  export * from './Grouping';
9
9
  export * from './Powerpoint';
10
+ export * from './Writing';
11
+ export * from './Speaking';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -8,4 +8,6 @@ export * from './useLabeling';
8
8
  export * from './useFillInBlank';
9
9
  export * from './useGrouping';
10
10
  export * from './usePowerpoint';
11
+ export * from './useWriting';
12
+ export * from './useSpeaking';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
@@ -3,7 +3,7 @@ export declare function useBaseQuestion(): {
3
3
  isCorrect: boolean | null;
4
4
  attempts: number;
5
5
  canAnswer: boolean;
6
- submitQuestion: (isCorrect: boolean) => void;
6
+ submitQuestion: (isCorrect?: boolean) => void;
7
7
  resetQuestion: () => void;
8
8
  };
9
9
  //# sourceMappingURL=useBaseQuestion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseQuestion.d.ts","sourceRoot":"","sources":["../../src/hooks/useBaseQuestion.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe;;;;;gCAKM,OAAO;;EAwB3C"}
1
+ {"version":3,"file":"useBaseQuestion.d.ts","sourceRoot":"","sources":["../../src/hooks/useBaseQuestion.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe;;;;;iCAKO,OAAO;;EA0B5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"useMatching.d.ts","sourceRoot":"","sources":["../../src/hooks/useMatching.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,cAAc,EACf,MAAM,UAAU,CAAC;AAGlB,wBAAgB,WAAW,CAAC,QAAQ,EAAE,oBAAoB;;;;;;;;;;;oCAiFjB,MAAM;uBA9DnB,MAAM,YAAY,MAAM;uBAaxB,MAAM,YAAY,MAAM;;;;;;;EA8FnD"}
1
+ {"version":3,"file":"useMatching.d.ts","sourceRoot":"","sources":["../../src/hooks/useMatching.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,cAAc,EACf,MAAM,UAAU,CAAC;AAGlB,wBAAgB,WAAW,CAAC,QAAQ,EAAE,oBAAoB;;;;;;;;;;;oCAiFjB,MAAM;uBA9DnB,MAAM,YAAY,MAAM;uBAaxB,MAAM,YAAY,MAAM;;;;;;;EAgGnD"}
@@ -0,0 +1,34 @@
1
+ import { SpeakingQuestionType } from '../types/speaking';
2
+ export type SpeakingSubmitPayload = {
3
+ questionId: string | number;
4
+ type: 'speaking';
5
+ audioUrl?: string;
6
+ };
7
+ export type RecordingState = 'idle' | 'recording' | 'paused' | 'stopped';
8
+ export type UploadHandlerSpeaking = (audioBlob: Blob, filename?: string) => Promise<{
9
+ success: boolean;
10
+ url?: string;
11
+ error?: string;
12
+ }>;
13
+ export declare function useSpeaking(question: SpeakingQuestionType, uploadHandler?: UploadHandlerSpeaking): {
14
+ question: SpeakingQuestionType;
15
+ canAnswer: boolean;
16
+ submitted: boolean | null;
17
+ attempts: number;
18
+ audioUrl: string | undefined;
19
+ setAudioUrl: import('react').Dispatch<import('react').SetStateAction<string | undefined>>;
20
+ recordingState: RecordingState;
21
+ recordingTime: number;
22
+ isUploading: boolean;
23
+ uploadError: string | undefined;
24
+ startRecording: () => Promise<void>;
25
+ pauseRecording: () => void;
26
+ resumeRecording: () => void;
27
+ stopRecording: () => void;
28
+ uploadAudio: () => Promise<void>;
29
+ uploadFile: (file: File) => Promise<void>;
30
+ submit: () => SpeakingSubmitPayload;
31
+ reset: () => void;
32
+ payload: SpeakingSubmitPayload;
33
+ };
34
+ //# sourceMappingURL=useSpeaking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSpeaking.d.ts","sourceRoot":"","sources":["../../src/hooks/useSpeaking.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,qBAAqB,GAAG,CAClC,SAAS,EAAE,IAAI,EACf,QAAQ,CAAC,EAAE,MAAM,KACd,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEjE,wBAAgB,WAAW,CACzB,QAAQ,EAAE,oBAAoB,EAC9B,aAAa,CAAC,EAAE,qBAAqB;;;;;;;;;;;;;;;;uBAsHtB,IAAI;;;;EAiFpB"}
@@ -0,0 +1,30 @@
1
+ import { WritingQuestionType } from '../types/writing';
2
+ export type WritingSubmitPayload = {
3
+ questionId: string | number;
4
+ type: 'writing';
5
+ text: string;
6
+ fileUrl?: string;
7
+ };
8
+ export type UploadHandlerWriting = (file: File | Blob, filename?: string) => Promise<{
9
+ success: boolean;
10
+ url?: string;
11
+ error?: string;
12
+ }>;
13
+ export declare function useWriting(question: WritingQuestionType, uploadHandler?: UploadHandlerWriting): {
14
+ question: WritingQuestionType;
15
+ canAnswer: boolean;
16
+ submitted: boolean | null;
17
+ attempts: number;
18
+ text: string;
19
+ setText: import('react').Dispatch<import('react').SetStateAction<string>>;
20
+ fileUrl: string | undefined;
21
+ setFileUrl: import('react').Dispatch<import('react').SetStateAction<string | undefined>>;
22
+ isUploading: boolean;
23
+ uploadError: string | undefined;
24
+ uploadFile: (file: File) => Promise<void>;
25
+ uploadText: () => Promise<void>;
26
+ submit: () => WritingSubmitPayload;
27
+ reset: () => void;
28
+ payload: WritingSubmitPayload;
29
+ };
30
+ //# sourceMappingURL=useWriting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWriting.d.ts","sourceRoot":"","sources":["../../src/hooks/useWriting.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CACjC,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,QAAQ,CAAC,EAAE,MAAM,KACd,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEjE,wBAAgB,UAAU,CACxB,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,CAAC,EAAE,oBAAoB;;;;;;;;;;;uBAWrB,IAAI;;;;;EAgGpB"}