reneco-advanced-input-module 0.0.1-beta.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/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/ocr-file-uploader.voice-input-module.entry.cjs.js.map +1 -0
- package/dist/cjs/ocr-file-uploader_2.cjs.entry.js +1340 -0
- package/dist/cjs/ocr-file-uploader_2.cjs.entry.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/ocr-file-uploader/ocr-file-uploader.css +26 -0
- package/dist/collection/components/ocr-file-uploader/ocr-file-uploader.js +130 -0
- package/dist/collection/components/ocr-file-uploader/ocr-file-uploader.js.map +1 -0
- package/dist/collection/components/voice-input-module/voice-input-module.css +286 -0
- package/dist/collection/components/voice-input-module/voice-input-module.js +897 -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 +60 -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/index.d.ts +33 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/ocr-file-uploader.d.ts +11 -0
- package/dist/components/ocr-file-uploader.js +9 -0
- package/dist/components/ocr-file-uploader.js.map +1 -0
- package/dist/components/ocr-file-uploader2.js +98 -0
- package/dist/components/ocr-file-uploader2.js.map +1 -0
- package/dist/components/voice-input-module.d.ts +11 -0
- package/dist/components/voice-input-module.js +1313 -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/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/ocr-file-uploader.voice-input-module.entry.js.map +1 -0
- package/dist/esm/ocr-file-uploader_2.entry.js +1337 -0
- package/dist/esm/ocr-file-uploader_2.entry.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/ocr-file-uploader/ocr-file-uploader.d.ts +8 -0
- package/dist/types/components/voice-input-module/voice-input-module.d.ts +60 -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/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/ocr-file-uploader.voice-input-module.entry.esm.js.map +1 -0
- package/dist/voice-input-module/p-52e59129.entry.js +2 -0
- package/dist/voice-input-module/p-52e59129.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/ocr-file-uploader/ocr-file-uploader.css +26 -0
- package/src/components/ocr-file-uploader/ocr-file-uploader.tsx +100 -0
- package/src/components/ocr-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 +286 -0
- package/src/components/voice-input-module/voice-input-module.tsx +778 -0
- package/src/components.d.ts +158 -0
- package/src/index.html +1015 -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 +70 -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
package/.editorconfig
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# http://editorconfig.org
|
|
2
|
+
|
|
3
|
+
root = true
|
|
4
|
+
|
|
5
|
+
[*]
|
|
6
|
+
charset = utf-8
|
|
7
|
+
indent_style = space
|
|
8
|
+
indent_size = 2
|
|
9
|
+
end_of_line = lf
|
|
10
|
+
insert_final_newline = true
|
|
11
|
+
trim_trailing_whitespace = true
|
|
12
|
+
|
|
13
|
+
[*.md]
|
|
14
|
+
insert_final_newline = false
|
|
15
|
+
trim_trailing_whitespace = false
|
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"arrowParens": "avoid",
|
|
3
|
+
"bracketSpacing": true,
|
|
4
|
+
"jsxBracketSameLine": false,
|
|
5
|
+
"jsxSingleQuote": false,
|
|
6
|
+
"quoteProps": "consistent",
|
|
7
|
+
"printWidth": 180,
|
|
8
|
+
"semi": true,
|
|
9
|
+
"singleQuote": true,
|
|
10
|
+
"tabWidth": 2,
|
|
11
|
+
"trailingComma": "all",
|
|
12
|
+
"useTabs": false
|
|
13
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// This script injects the API key from server environment into the client
|
|
2
|
+
// This would normally be handled by a server-side framework, but for demo purposes
|
|
3
|
+
// we'll create a simple endpoint to fetch the key
|
|
4
|
+
|
|
5
|
+
async function getApiKey() {
|
|
6
|
+
try {
|
|
7
|
+
// In a real application, you'd have a secure endpoint that provides the API key
|
|
8
|
+
// For this demo, we'll check if it's available in some global scope
|
|
9
|
+
if (typeof process !== 'undefined' && process.env && process.env.OPENAI_API_KEY) {
|
|
10
|
+
return process.env.OPENAI_API_KEY;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Check if Replit has exposed it as a global variable
|
|
14
|
+
if (window.REPLIT_ENV && window.REPLIT_ENV.OPENAI_API_KEY) {
|
|
15
|
+
return window.REPLIT_ENV.OPENAI_API_KEY;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// For demo purposes, we'll show a prompt to enter the API key
|
|
19
|
+
return null;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error('Error getting API key:', error);
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Function to inject API key into components
|
|
27
|
+
async function injectApiKey() {
|
|
28
|
+
const apiKey = await getApiKey();
|
|
29
|
+
|
|
30
|
+
if (apiKey) {
|
|
31
|
+
// Find all voice-input-module components and set their API key
|
|
32
|
+
const components = document.querySelectorAll('voice-input-module');
|
|
33
|
+
components.forEach(component => {
|
|
34
|
+
component.setAttribute('api-key', apiKey);
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
console.warn('No API key found. Components will show initialization error until API key is provided.');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Run when DOM is loaded
|
|
42
|
+
if (document.readyState === 'loading') {
|
|
43
|
+
document.addEventListener('DOMContentLoaded', injectApiKey);
|
|
44
|
+
} else {
|
|
45
|
+
injectApiKey();
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-globals-V2Kpy_OQ.js","sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\nexport const globalStyles = \"\";\n"],"names":[],"mappings":";;AAAY,MAAC,aAAa,GAAG,MAAM;;;;"}
|