@myinterview/chatbot 0.1.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/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
+
14
+ - Configure the top-level `parserOptions` property like this:
15
+
16
+ ```js
17
+ export default {
18
+ // other rules...
19
+ parserOptions: {
20
+ ecmaVersion: 'latest',
21
+ sourceType: 'module',
22
+ project: ['./tsconfig.json', './tsconfig.node.json'],
23
+ tsconfigRootDir: __dirname,
24
+ },
25
+ }
26
+ ```
27
+
28
+ - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29
+ - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30
+ - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audioVisualizer.worker-Kw1C10xA.js","sources":["../src/interfaces/audioVisualizerInterface.ts","../src/workers/audioVisualizer.worker.ts"],"sourcesContent":["export const enum AudioVisualizerMessageAction {\n INIT = 'init',\n SET = 'set',\n CLEAR = 'clear',\n}\n\nexport type AudioVisualizerMessageParams = { action: AudioVisualizerMessageAction, payload: { canvas?: OffscreenCanvas, data?: Uint8Array } };\nexport type AudioVisualizerMessage = MessageEvent<AudioVisualizerMessageParams>;\n","/* eslint-disable no-plusplus */\nimport { AudioVisualizerMessage, AudioVisualizerMessageAction } from '../interfaces/audioVisualizerInterface';\n\ntype MessagePayload = AudioVisualizerMessage['data']['payload'];\n\nlet canvas: OffscreenCanvas | null = null;\nlet ctx: OffscreenCanvasRenderingContext2D | null = null;\nlet baseRadius = 40;\nconst MARGIN = 20;\n\nconst actions: { [K in AudioVisualizerMessageAction]: (payload: MessagePayload) => void } = {\n [AudioVisualizerMessageAction.INIT]: (payload: MessagePayload) => {\n if (!payload.canvas) return;\n canvas = payload.canvas;\n baseRadius = Math.min(canvas.width, canvas.height) / 5;\n ctx = canvas.getContext('2d');\n ctx!.fillStyle = '#6690ff';\n ctx!.scale(1, 1);\n },\n [AudioVisualizerMessageAction.SET]: ({ data }: MessagePayload) => {\n if (!canvas || !ctx || !data) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n const arraySum = data.reduce((a:number, value:number) => a + value, 0);\n const average = arraySum / data.length;\n const percentage = Math.round((average / 255) * 100);\n ctx.beginPath();\n ctx.arc(canvas.width / 2, canvas.height / 2, Math.min(baseRadius + percentage / 2, canvas.width / 2 - MARGIN), 0, 2 * Math.PI);\n ctx.fill();\n },\n [AudioVisualizerMessageAction.CLEAR]: () => {\n if (!canvas || !ctx) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n },\n};\n\nonmessage = (event: AudioVisualizerMessage) => {\n const { action, payload } = event.data;\n actions[action](payload);\n};\n"],"names":["AudioVisualizerMessageAction","canvas","ctx","baseRadius","MARGIN","actions","payload","data","average","a","value","percentage","event","action"],"mappings":"yBAAkB,IAAAA,GAAAA,IAChBA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,MAAQ,QAHQA,IAAAA,GAAA,CAAA,CAAA,ECKlB,IAAIC,EAAiC,KACjCC,EAAgD,KAChDC,EAAa,GACjB,MAAMC,EAAS,GAETC,EAAsF,CAC1F,CAACL,EAA6B,IAAI,EAAIM,GAA4B,CAC3DA,EAAQ,SACbL,EAASK,EAAQ,OACjBH,EAAa,KAAK,IAAIF,EAAO,MAAOA,EAAO,MAAM,EAAI,EAC/CC,EAAAD,EAAO,WAAW,IAAI,EAC5BC,EAAK,UAAY,UACZA,EAAA,MAAM,EAAG,CAAC,EACjB,EACA,CAACF,EAA6B,GAAG,EAAG,CAAC,CAAE,KAAAO,KAA2B,CAChE,GAAI,CAACN,GAAU,CAACC,GAAO,CAACK,EAAM,OAC9BL,EAAI,UAAU,EAAG,EAAGD,EAAO,MAAOA,EAAO,MAAM,EAEzC,MAAAO,EADWD,EAAK,OAAO,CAACE,EAAUC,IAAiBD,EAAIC,EAAO,CAAC,EAC1CH,EAAK,OAC1BI,EAAa,KAAK,MAAOH,EAAU,IAAO,GAAG,EACnDN,EAAI,UAAU,EACVA,EAAA,IAAID,EAAO,MAAQ,EAAGA,EAAO,OAAS,EAAG,KAAK,IAAIE,EAAaQ,EAAa,EAAGV,EAAO,MAAQ,EAAIG,CAAM,EAAG,EAAG,EAAI,KAAK,EAAE,EAC7HF,EAAI,KAAK,CACX,EACA,CAACF,EAA6B,KAAK,EAAG,IAAM,CACtC,CAACC,GAAU,CAACC,GAChBA,EAAI,UAAU,EAAG,EAAGD,EAAO,MAAOA,EAAO,MAAM,CACjD,CACF,EAEA,UAAaW,GAAkC,CAC7C,KAAM,CAAE,OAAAC,EAAQ,QAAAP,GAAYM,EAAM,KAC1BP,EAAAQ,CAAM,EAAEP,CAAO,CACzB"}
@@ -0,0 +1,80 @@
1
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
2
+
3
+ export declare const ChatbotClient: (clientConfig?: IChatbotClient) => JSX_2.Element;
4
+
5
+ declare interface IChatbot {
6
+ config: IConfig;
7
+ job_id: string;
8
+ company_id: string;
9
+ }
10
+
11
+ export declare type IChatbotClient = Partial<Omit<IChatbot, 'config'> & {
12
+ config: IConfigClient;
13
+ }>;
14
+
15
+ declare interface IConfig {
16
+ isReady: boolean;
17
+ auth: string;
18
+ useInbox?: boolean;
19
+ usePopup?: boolean;
20
+ autoOpen?: boolean;
21
+ position?: IPosition;
22
+ offsetX?: string;
23
+ offsetY?: string;
24
+ suggestedHeight?: number;
25
+ env?: IEnv;
26
+ debug?: boolean;
27
+ timeFormat?: ITimeFormat;
28
+ theme: ITheme;
29
+ colors: {
30
+ primaryColor: string;
31
+ secondaryColor: string;
32
+ primaryDarkColor: string;
33
+ secondaryDarkColor: string;
34
+ };
35
+ onOpen?: () => void;
36
+ onClose?: () => void;
37
+ onConversationCreated?: (candidate_id: string) => void;
38
+ onFinish?: (data: IOnFinishData) => void;
39
+ onError?: (data: IOnErrorData) => void;
40
+ }
41
+
42
+ declare type IConfigClient = Partial<Omit<IConfig, 'usePopup' | 'isReady'>>;
43
+
44
+ declare type IEnv = 'development' | 'staging' | 'production';
45
+
46
+ declare interface IOnErrorData {
47
+ errorMessage: string;
48
+ }
49
+
50
+ declare interface IOnFinishData {
51
+ video_id: string;
52
+ }
53
+
54
+ declare type IPosition = 'left' | 'right';
55
+
56
+ declare type ITheme = 'light' | 'dark' | 'deviceDefault';
57
+
58
+ declare type ITimeFormat = '12h' | '24h' | 'deviceDefault';
59
+
60
+ export declare const usePopupChatbot: () => {
61
+ init: (clientConfig: Partial<Omit<IChatbot, "config"> & {
62
+ config: Partial<Omit<IConfig, "usePopup" | "isReady">>;
63
+ }>) => void;
64
+ update: (clientConfig?: Partial<Omit<IChatbot, "config"> & {
65
+ config: Partial<Omit<IConfig, "usePopup" | "isReady">>;
66
+ }>) => void;
67
+ shutdown: () => void;
68
+ };
69
+
70
+ export { }
71
+
72
+
73
+ declare global {
74
+ interface Window {
75
+ myInterview: {
76
+ chatbot: typeof popupChatbotFn;
77
+ };
78
+ }
79
+ }
80
+