reneco-advanced-input-module 0.0.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/.editorconfig +15 -0
- package/.prettierrc.json +13 -0
- package/LICENSE +21 -0
- package/api-key-inject.js +46 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/file-uploader.voice-input-module.entry.cjs.js.map +1 -0
- package/dist/cjs/file-uploader_2.cjs.entry.js +1319 -0
- package/dist/cjs/file-uploader_2.cjs.entry.js.map +1 -0
- package/dist/cjs/index-BTSzTkSZ.js +1494 -0
- package/dist/cjs/index-BTSzTkSZ.js.map +1 -0
- package/dist/cjs/index.cjs.js +5 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +16 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/voice-input-module.cjs.js +28 -0
- package/dist/cjs/voice-input-module.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +13 -0
- package/dist/collection/components/file-uploader/file-uploader.css +26 -0
- package/dist/collection/components/file-uploader/file-uploader.js +130 -0
- package/dist/collection/components/file-uploader/file-uploader.js.map +1 -0
- package/dist/collection/components/voice-input-module/voice-input-module.css +251 -0
- package/dist/collection/components/voice-input-module/voice-input-module.js +875 -0
- package/dist/collection/components/voice-input-module/voice-input-module.js.map +1 -0
- package/dist/collection/index.js +12 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/services/audio-recorder.service.js +66 -0
- package/dist/collection/services/audio-recorder.service.js.map +1 -0
- package/dist/collection/services/llm.service.js +193 -0
- package/dist/collection/services/llm.service.js.map +1 -0
- package/dist/collection/services/speech-to-text.service.js +62 -0
- package/dist/collection/services/speech-to-text.service.js.map +1 -0
- package/dist/collection/types/form-schema.types.js +2 -0
- package/dist/collection/types/form-schema.types.js.map +1 -0
- package/dist/collection/types/service-providers.types.js +2 -0
- package/dist/collection/types/service-providers.types.js.map +1 -0
- package/dist/collection/utils/schema-converter.js +422 -0
- package/dist/collection/utils/schema-converter.js.map +1 -0
- package/dist/components/file-uploader.d.ts +11 -0
- package/dist/components/file-uploader.js +9 -0
- package/dist/components/file-uploader.js.map +1 -0
- package/dist/components/file-uploader2.js +98 -0
- package/dist/components/file-uploader2.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/voice-input-module.d.ts +11 -0
- package/dist/components/voice-input-module.js +1292 -0
- package/dist/components/voice-input-module.js.map +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/file-uploader.voice-input-module.entry.js.map +1 -0
- package/dist/esm/file-uploader_2.entry.js +1316 -0
- package/dist/esm/file-uploader_2.entry.js.map +1 -0
- package/dist/esm/index-jmc2yzBp.js +1487 -0
- package/dist/esm/index-jmc2yzBp.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +14 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/voice-input-module.js +24 -0
- package/dist/esm/voice-input-module.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/file-uploader/file-uploader.d.ts +8 -0
- package/dist/types/components/voice-input-module/voice-input-module.d.ts +55 -0
- package/dist/types/components.d.ts +158 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/services/audio-recorder.service.d.ts +9 -0
- package/dist/types/services/llm.service.d.ts +15 -0
- package/dist/types/services/speech-to-text.service.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1709 -0
- package/dist/types/types/form-schema.types.d.ts +70 -0
- package/dist/types/types/service-providers.types.d.ts +20 -0
- package/dist/types/utils/schema-converter.d.ts +22 -0
- package/dist/voice-input-module/file-uploader.voice-input-module.entry.esm.js.map +1 -0
- package/dist/voice-input-module/index.esm.js +2 -0
- package/dist/voice-input-module/index.esm.js.map +1 -0
- package/dist/voice-input-module/loader.esm.js.map +1 -0
- package/dist/voice-input-module/p-7b4f33ba.entry.js +2 -0
- package/dist/voice-input-module/p-7b4f33ba.entry.js.map +1 -0
- package/dist/voice-input-module/p-DQuL1Twl.js +2 -0
- package/dist/voice-input-module/p-DQuL1Twl.js.map +1 -0
- package/dist/voice-input-module/p-jmc2yzBp.js +3 -0
- package/dist/voice-input-module/p-jmc2yzBp.js.map +1 -0
- package/dist/voice-input-module/voice-input-module.esm.js +2 -0
- package/dist/voice-input-module/voice-input-module.esm.js.map +1 -0
- package/env-config.js +4 -0
- package/inject-env.js +20 -0
- package/package.json +37 -0
- package/readme.md +111 -0
- package/src/components/file-uploader/file-uploader.css +26 -0
- package/src/components/file-uploader/file-uploader.tsx +100 -0
- package/src/components/file-uploader/readme.md +31 -0
- package/src/components/voice-input-module/readme.md +114 -0
- package/src/components/voice-input-module/voice-input-module.css +251 -0
- package/src/components/voice-input-module/voice-input-module.tsx +731 -0
- package/src/components.d.ts +158 -0
- package/src/index.html +663 -0
- package/src/index.ts +12 -0
- package/src/services/audio-recorder.service.ts +74 -0
- package/src/services/llm.service.ts +221 -0
- package/src/services/speech-to-text.service.ts +72 -0
- package/src/types/form-schema.types.ts +78 -0
- package/src/types/service-providers.types.ts +22 -0
- package/src/utils/schema-converter.ts +494 -0
- package/stencil.config.ts +24 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"file-uploader2.js","mappings":";;AAAA,MAAM,eAAe,GAAG,kVAAkV;;MCO7V,YAAY,iBAAAA,kBAAA,CAAA,MAAA,YAAA,SAAA,WAAA,CAAA;AALzB,IAAA,WAAA,GAAA;;;;AAMY,QAAA,IAAK,CAAA,KAAA,GAAY,KAAK;AAKtB,QAAA,IAAa,CAAA,aAAA,GAAG,MAAK;AACzB,YAAA,IAAI,CAAC,SAAS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B,EAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAA,EACrD,CAAA,CAAA,OAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACI,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,SAAS,GAAG,EAAG,CAAC,EACjC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAC/B,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC5B,CAAA,EACF,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,eAAe,EAAA,EACtB,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,EAAA,EACvE,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAC,EAAC,6JAA6J,EAAA,cAAA,EAAc,GAAG,EAAgB,gBAAA,EAAA,OAAO,EAAiB,iBAAA,EAAA,OAAO,EAAE,CAAA,EACvO,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,CAAC,EAAC,kDAAkD,EAAA,cAAA,EAAc,GAAG,EAAgB,gBAAA,EAAA,OAAO,EAAiB,iBAAA,EAAA,OAAO,EAAE,CAAA,CACtH,CACJ,CACJ;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"sources":["src/components/file-uploader/file-uploader.css?tag=file-uploader&encapsulation=shadow","src/components/file-uploader/file-uploader.tsx"],"sourcesContent":["\r\n.upload-container {\r\n display: inline-block;\r\n cursor: pointer;\r\n width: 50px;\r\n height: 50px;\r\n}\r\n\r\n.upload-button {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n transition: transform 0.2s ease, box-shadow 0.2s ease;\r\n user-select: none;\r\n}\r\n\r\n.upload-button svg {\r\n width: 50px;\r\n height: 50px;\r\n stroke: #44ee44;\r\n}\r\n\r\n.upload-button:hover svg{\r\n transform: scale(1.05);\r\n stroke: #33dd33;\r\n}","import { Component, h, Prop } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'file-uploader',\r\n styleUrl: 'file-uploader.css',\r\n shadow: true\r\n})\r\nexport class FileUploader {\r\n @Prop() batch: boolean = false;\r\n @Prop() callback: Function;\r\n\r\n private fileInput!: HTMLInputElement;\r\n\r\n private triggerUpload = () => {\r\n this.fileInput.click();\r\n };\r\n\r\n private handleFileChange = async (event: Event) => {\r\n const input = event.target as HTMLInputElement;\r\n if (!input.files || input.files.length === 0) return;\r\n\r\n const file = input.files[0];\r\n\r\n // Here you can handle the file upload to your API\r\n console.log('Selected file:', file);\r\n\r\n const formData = new FormData();\r\n formData.append('file', file);\r\n\r\n if (this.batch) {\r\n try {\r\n const response = await fetch('http://127.0.0.1:5001/api/convert-to-xml', {\r\n method: 'POST',\r\n body: formData\r\n });\r\n\r\n if (!response.ok) {\r\n console.error(\"There has been an error!:\", response);\r\n throw new Error(`HTTP error! status: ${response.status}`);\r\n }\r\n // get the file as a blob\r\n const blob = await response.blob();\r\n // create a download link\r\n const url = window.URL.createObjectURL(blob);\r\n const a = document.createElement('a');\r\n a.href = url;\r\n a.download = 'result-'+Date.now().toString()+'.xlsx'; // filename\r\n document.body.appendChild(a);\r\n a.click();\r\n a.remove();\r\n window.URL.revokeObjectURL(url);\r\n } catch (err) {\r\n console.error(err);\r\n alert('Error uploading file');\r\n }\r\n }\r\n else {\r\n try {\r\n const response = await fetch('http://127.0.0.1:5001/api/convert-to-json', {\r\n method: 'POST',\r\n body: formData\r\n });\r\n\r\n if (!response.ok) {\r\n console.error(\"There has been an error!:\", response);\r\n throw new Error(`HTTP error! status: ${response.status}`);\r\n }\r\n const data = await response.json();\r\n console.log('Upload successful:', data);\r\n \r\n if (this.callback && data[0] && data[0].content){\r\n this.callback(data[0].content);\r\n }\r\n } catch (err) {\r\n console.error(err);\r\n alert('Error uploading file');\r\n }\r\n }\r\n \r\n };\r\n\r\n render() {\r\n return (\r\n <div class=\"upload-container\" onClick={this.triggerUpload}>\r\n <input\r\n type=\"file\"\r\n ref={el => (this.fileInput = el!)}\r\n onChange={this.handleFileChange}\r\n style={{ display: 'none' }}\r\n />\r\n <div class=\"upload-button\">\r\n <svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M13.5 3H12H8C6.34315 3 5 4.34315 5 6V18C5 19.6569 6.34315 21 8 21H12M13.5 3L19 8.625M13.5 3V7.625C13.5 8.17728 13.9477 8.625 14.5 8.625H19M19 8.625V11.8125\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n <path d=\"M17.5 21L17.5 15M17.5 15L20 17.5M17.5 15L15 17.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"],"version":3}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
|
3
|
+
* if the path needs to be customized.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAssetPath: (path: string) => string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to manually set the base path where assets can be found.
|
|
9
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
10
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
11
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
12
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
13
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
14
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
15
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
16
|
+
*/
|
|
17
|
+
export declare const setAssetPath: (path: string) => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
21
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
22
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
23
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
24
|
+
* will result in the same behavior.
|
|
25
|
+
*/
|
|
26
|
+
export declare const setNonce: (nonce: string) => void
|
|
27
|
+
|
|
28
|
+
export interface SetPlatformOptions {
|
|
29
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
30
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
31
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index.js","mappings":"","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VoiceInputModule extends Components.VoiceInputModule, HTMLElement {}
|
|
4
|
+
export const VoiceInputModule: {
|
|
5
|
+
prototype: VoiceInputModule;
|
|
6
|
+
new (): VoiceInputModule;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|