reneco-advanced-input-module 0.0.23 → 0.0.25
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/dist/cjs/{index-BTSzTkSZ.js → index-BtdDZbi5.js} +11 -4
- package/dist/cjs/index-BtdDZbi5.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/ocr-file-uploader.cjs.entry.js +1 -1
- package/dist/cjs/voice-input-module.cjs.entry.js +43 -7
- package/dist/cjs/voice-input-module.cjs.entry.js.map +1 -1
- package/dist/cjs/voice-input-module.cjs.js +3 -4
- package/dist/cjs/voice-input-module.cjs.js.map +1 -1
- package/dist/cjs/voice-input-module.entry.cjs.js.map +1 -1
- package/dist/collection/components/voice-input-module/voice-input-module.css +34 -0
- package/dist/collection/components/voice-input-module/voice-input-module.js +43 -6
- package/dist/collection/components/voice-input-module/voice-input-module.js.map +1 -1
- package/dist/components/voice-input-module.js +43 -6
- package/dist/components/voice-input-module.js.map +1 -1
- package/dist/esm/{index-jmc2yzBp.js → index-a7QWC-5I.js} +11 -5
- package/dist/esm/index-a7QWC-5I.js.map +1 -0
- package/dist/esm/loader.js +3 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/ocr-file-uploader.entry.js +1 -1
- package/dist/esm/voice-input-module.entry.js +43 -7
- package/dist/esm/voice-input-module.entry.js.map +1 -1
- package/dist/esm/voice-input-module.js +3 -4
- package/dist/esm/voice-input-module.js.map +1 -1
- package/dist/types/components/voice-input-module/voice-input-module.d.ts +3 -0
- package/dist/voice-input-module/loader.esm.js.map +1 -1
- package/dist/voice-input-module/{p-920964b2.entry.js → p-334644ec.entry.js} +3 -3
- package/dist/voice-input-module/p-334644ec.entry.js.map +1 -0
- package/dist/voice-input-module/p-a7QWC-5I.js +3 -0
- package/dist/voice-input-module/p-a7QWC-5I.js.map +1 -0
- package/dist/voice-input-module/{p-a5eeaf1c.entry.js → p-ba3d83d1.entry.js} +2 -2
- package/dist/voice-input-module/voice-input-module.css +6 -0
- package/dist/voice-input-module/voice-input-module.entry.esm.js.map +1 -1
- package/dist/voice-input-module/voice-input-module.esm.js +1 -1
- package/dist/voice-input-module/voice-input-module.esm.js.map +1 -1
- package/package.json +1 -1
- package/www/build/loader.esm.js.map +1 -1
- package/www/build/{p-920964b2.entry.js → p-334644ec.entry.js} +3 -3
- package/www/build/p-334644ec.entry.js.map +1 -0
- package/www/build/p-6cd2a3a1.css +6 -0
- package/www/build/p-a7QWC-5I.js +3 -0
- package/www/build/p-a7QWC-5I.js.map +1 -0
- package/www/build/{p-a5eeaf1c.entry.js → p-ba3d83d1.entry.js} +2 -2
- package/www/build/p-dfdcd9a6.js +2 -0
- package/www/build/voice-input-module.css +6 -0
- package/www/build/voice-input-module.entry.esm.js.map +1 -1
- package/www/build/voice-input-module.esm.js +1 -1
- package/www/build/voice-input-module.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -8
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/index-BTSzTkSZ.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -6
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/index-jmc2yzBp.js.map +0 -1
- package/dist/voice-input-module/p-920964b2.entry.js.map +0 -1
- package/dist/voice-input-module/p-DQuL1Twl.js +0 -2
- package/dist/voice-input-module/p-DQuL1Twl.js.map +0 -1
- package/dist/voice-input-module/p-jmc2yzBp.js +0 -3
- package/dist/voice-input-module/p-jmc2yzBp.js.map +0 -1
- package/www/build/p-920964b2.entry.js.map +0 -1
- package/www/build/p-DQuL1Twl.js +0 -2
- package/www/build/p-DQuL1Twl.js.map +0 -1
- package/www/build/p-cbf8974a.js +0 -2
- package/www/build/p-jmc2yzBp.js +0 -3
- package/www/build/p-jmc2yzBp.js.map +0 -1
- /package/dist/voice-input-module/{p-a5eeaf1c.entry.js.map → p-ba3d83d1.entry.js.map} +0 -0
- /package/www/build/{p-a5eeaf1c.entry.js.map → p-ba3d83d1.entry.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BtdDZbi5.js');
|
|
4
4
|
|
|
5
5
|
const ocrFileUploaderCss = ".upload-container{display:inline-block;cursor:pointer}.upload-button{display:flex;align-items:center;justify-content:center;transition:transform 0.2s ease;user-select:none;width:var(--button-size, 50px);height:var(--button-size, 50px)}.upload-button svg{width:100%;height:100%;stroke:var(--button-bg, #10b981);transition:stroke 0.2s ease, transform 0.2s ease}.upload-button:hover svg{transform:scale(1.05);stroke:var(--button-hover, #059669)}";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BtdDZbi5.js');
|
|
4
4
|
|
|
5
5
|
const TRANSCRIPTION_MODELS = {
|
|
6
6
|
openai: ['gpt-4o-transcribe', 'gpt-4o-mini-transcribe', 'whisper-1'],
|
|
@@ -4327,7 +4327,7 @@ const defineCustomElements = async (win, options) => {
|
|
|
4327
4327
|
|
|
4328
4328
|
(function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a);}})();
|
|
4329
4329
|
|
|
4330
|
-
const voiceInputModuleCss = ":host{display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif}.row-audio-area{display:flex;flex-direction:row;align-items:center;gap:8px;flex-wrap:wrap;justify-content:center}.voice-recorder-container{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;background:#ffffff;margin:0 auto}.voice-recorder-container-debug{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;background:#ffffff;margin:0 auto}.upload-record-container{display:inline-flex;cursor:pointer}.upload-record-button{display:flex;align-items:center;justify-content:center;transition:transform 0.2s ease, box-shadow 0.2s ease;user-select:none}.upload-record-button svg{width:100%;height:100%;transition:transform 0.2s ease}.upload-record-container:hover .upload-record-button svg{transform:scale(1.05)}.upload-record-button svg path{}.record-button{display:flex;align-items:center;justify-content:center;border:none;border-radius:50%;background:#ee4444;color:white;cursor:pointer;transition:all 0.2s ease;position:relative;overflow:hidden;flex-shrink:0}.record-button:hover:not(:disabled){background:#dd3333;transform:scale(1.05)}.record-button:disabled{opacity:0.6;cursor:not-allowed}.record-button.recording{background:#dd3333;animation:pulse 1.5s infinite}.record-button.processing{background:#3b82f6}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(239, 68, 68, 0.7)}70%{box-shadow:0 0 0 10px rgba(239, 68, 68, 0)}100%{box-shadow:0 0 0 0 rgba(239, 68, 68, 0)}}.record-icon{width:24px;height:24px;fill:currentColor}.status-text{font-size:0.875rem;color:#6b7280;text-align:center;min-height:1.25rem}.status-text.error{color:#ee4444}.status-text.success{color:#10b981}.debug-panel{width:100%;margin-top:1rem;padding:1rem;background:#f9fafb;border:1px solid #e5e7eb;border-radius:0.375rem;font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.75rem}.debug-title{font-weight:600;margin-bottom:0.5rem;color:#374151}.debug-content{white-space:pre-wrap;word-break:break-word;color:#6b7280;max-height:200px;overflow-y:auto}.permissions-warning{padding:0.75rem;background:#fef3c7;border:1px solid #f59e0b;border-radius:0.375rem;color:#92400e;font-size:0.875rem;text-align:center}.form-preview{width:100%;margin-top:1rem;padding:1rem;background:#f8fafc;border:1px solid #e2e8f0;border-radius:0.375rem}.form-preview-title{font-weight:600;margin-bottom:0.5rem;color:#1e293b}.form-field{margin-bottom:0.5rem;font-size:0.875rem}.field-name{font-weight:500;color:#475569}.field-value{color:#64748b;margin-left:0.5rem}.field-value.filled{color:#059669;font-weight:500}.voice-filled-form{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:0.5rem;margin-top:1rem}.form-group{display:flex;flex-direction:column;gap:0.15rem}.form-group.full-width{grid-column:1 / -1}.form-header{grid-column:1 / -1;font-weight:600;font-size:1rem;color:#1e293b;margin-top:0.75rem;margin-bottom:0.25rem;padding-bottom:0.25rem;border-bottom:2px solid #e2e8f0}.form-label{font-weight:500;color:#374151;font-size:0.8rem}.required{color:#ee4444;margin-left:0.125rem}.form-input{padding:0.4rem;border:1px solid #d1d5db;border-radius:0.375rem;font-size:0.8rem;transition:border-color 0.2s ease}.form-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59, 130, 246, 0.1)}.form-checkbox{width:auto;padding:0;margin:0}select.form-input{background-color:white;cursor:pointer}input[type=\"date\"].form-input{cursor:pointer}.readonly-select{background:#f9fafb;border:1px solid #d1d5db;border-radius:0.375rem;padding:0.5rem}.select-placeholder{font-size:0.875rem;color:#6b7280;margin-bottom:0.5rem}.select-options-list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:0.25rem;max-height:150px;overflow-y:auto}.select-option{background:#e5e7eb;padding:0.25rem 0.5rem;border-radius:0.25rem;font-size:0.875rem;color:#374151}.multiselect-container{display:grid;grid-template-columns:repeat(2, 1fr);gap:0.25rem;padding:0.5rem;border:1px solid #d1d5db;border-radius:0.375rem;background:white}.multiselect-option{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;border-radius:0.25rem;cursor:pointer;transition:background 0.2s ease}.multiselect-option:hover{background:#f3f4f6}.multiselect-option input[type=\"checkbox\"]{width:18px;height:18px;cursor:pointer}.multiselect-option input[type=\"checkbox\"]:checked+.multiselect-label{font-weight:600;color:#059669}.multiselect-label{font-size:0.875rem;color:#374151;user-select:none}ocr-file-uploader{display:block;width:100% !important;height:100% !important;max-width:100% !important;max-height:100% !important}ocr-file-uploader *{max-width:100% !important;max-height:100% !important}";
|
|
4330
|
+
const voiceInputModuleCss = ":host{display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif}.row-audio-area{display:flex;flex-direction:row;align-items:center;gap:8px;flex-wrap:wrap;justify-content:center}.voice-recorder-container{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;background:#ffffff;margin:0 auto}.voice-recorder-container-debug{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;background:#ffffff;margin:0 auto}.upload-record-container{display:inline-flex;cursor:pointer}.upload-record-button{display:flex;align-items:center;justify-content:center;transition:transform 0.2s ease, box-shadow 0.2s ease;user-select:none}.upload-record-button svg{width:100%;height:100%;transition:transform 0.2s ease}.upload-record-container:hover .upload-record-button svg{transform:scale(1.05)}.upload-record-button svg path{}.record-button{display:flex;align-items:center;justify-content:center;border:none;border-radius:50%;background:#ee4444;color:white;cursor:pointer;transition:all 0.2s ease;position:relative;overflow:hidden;flex-shrink:0}.record-button:hover:not(:disabled){background:#dd3333;transform:scale(1.05)}.record-button:disabled{opacity:0.6;cursor:not-allowed}.record-button.recording{background:#dd3333;animation:pulse 1.5s infinite}.record-button.processing{background:#3b82f6}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(239, 68, 68, 0.7)}70%{box-shadow:0 0 0 10px rgba(239, 68, 68, 0)}100%{box-shadow:0 0 0 0 rgba(239, 68, 68, 0)}}.record-icon{width:24px;height:24px;fill:currentColor}.status-text{font-size:0.875rem;color:#6b7280;text-align:center;min-height:1.25rem}.status-text.error{color:#ee4444}.status-text.success{color:#10b981}.debug-panel{width:100%;margin-top:1rem;padding:1rem;background:#f9fafb;border:1px solid #e5e7eb;border-radius:0.375rem;font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.75rem}.debug-title{font-weight:600;margin-bottom:0.5rem;color:#374151}.debug-content{white-space:pre-wrap;word-break:break-word;color:#6b7280;max-height:200px;overflow-y:auto}.permissions-warning{padding:0.75rem;background:#fef3c7;border:1px solid #f59e0b;border-radius:0.375rem;color:#92400e;font-size:0.875rem;text-align:center}.form-preview{width:100%;margin-top:1rem;padding:1rem;background:#f8fafc;border:1px solid #e2e8f0;border-radius:0.375rem}.form-preview-title{font-weight:600;margin-bottom:0.5rem;color:#1e293b}.form-field{margin-bottom:0.5rem;font-size:0.875rem}.field-name{font-weight:500;color:#475569}.field-value{color:#64748b;margin-left:0.5rem}.field-value.filled{color:#059669;font-weight:500}.voice-filled-form{display:grid;grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));gap:0.5rem;margin-top:1rem}.form-group{display:flex;flex-direction:column;gap:0.15rem}.form-group.full-width{grid-column:1 / -1}.form-header{grid-column:1 / -1;font-weight:600;font-size:1rem;color:#1e293b;margin-top:0.75rem;margin-bottom:0.25rem;padding-bottom:0.25rem;border-bottom:2px solid #e2e8f0}.form-label{font-weight:500;color:#374151;font-size:0.8rem}.required{color:#ee4444;margin-left:0.125rem}.form-input{padding:0.4rem;border:1px solid #d1d5db;border-radius:0.375rem;font-size:0.8rem;transition:border-color 0.2s ease}.form-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59, 130, 246, 0.1)}.form-checkbox{width:auto;padding:0;margin:0}select.form-input{background-color:white;cursor:pointer}input[type=\"date\"].form-input{cursor:pointer}.readonly-select{background:#f9fafb;border:1px solid #d1d5db;border-radius:0.375rem;padding:0.5rem}.select-placeholder{font-size:0.875rem;color:#6b7280;margin-bottom:0.5rem}.select-options-list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:0.25rem;max-height:150px;overflow-y:auto}.select-option{background:#e5e7eb;padding:0.25rem 0.5rem;border-radius:0.25rem;font-size:0.875rem;color:#374151}.multiselect-container{display:grid;grid-template-columns:repeat(2, 1fr);gap:0.25rem;padding:0.5rem;border:1px solid #d1d5db;border-radius:0.375rem;background:white}.multiselect-option{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;border-radius:0.25rem;cursor:pointer;transition:background 0.2s ease}.multiselect-option:hover{background:#f3f4f6}.multiselect-option input[type=\"checkbox\"]{width:18px;height:18px;cursor:pointer}.multiselect-option input[type=\"checkbox\"]:checked+.multiselect-label{font-weight:600;color:#059669}.multiselect-label{font-size:0.875rem;color:#374151;user-select:none}@keyframes skeleton-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}.skeleton-circle{border-radius:50%;flex-shrink:0;background:linear-gradient(\r\n 90deg,\r\n #e2e8f0 25%,\r\n #f8fafc 50%,\r\n #e2e8f0 75%\r\n );background-size:200% 100%;animation:skeleton-shimmer 1.5s ease-in-out infinite}.skeleton-status{height:14px;border-radius:7px;width:140px;background:linear-gradient(\r\n 90deg,\r\n #e2e8f0 25%,\r\n #f8fafc 50%,\r\n #e2e8f0 75%\r\n );background-size:200% 100%;animation:skeleton-shimmer 1.5s ease-in-out infinite;animation-delay:0.15s}ocr-file-uploader{display:block;width:100% !important;height:100% !important;max-width:100% !important;max-height:100% !important}ocr-file-uploader *{max-width:100% !important;max-height:100% !important}";
|
|
4331
4331
|
|
|
4332
4332
|
// Initialize OCR
|
|
4333
4333
|
defineCustomElements();
|
|
@@ -4369,6 +4369,7 @@ const VoiceFormRecorder = class {
|
|
|
4369
4369
|
this.filledData = null;
|
|
4370
4370
|
this.debugInfo = {};
|
|
4371
4371
|
this.isReadonlyMode = true; // Start in readonly preview mode
|
|
4372
|
+
this.isInitializing = true;
|
|
4372
4373
|
this.triggerAudioRecordUpload = () => {
|
|
4373
4374
|
this.fileInputAudioRecord.click();
|
|
4374
4375
|
};
|
|
@@ -4376,6 +4377,10 @@ const VoiceFormRecorder = class {
|
|
|
4376
4377
|
const input = event.target;
|
|
4377
4378
|
if (!input.files || input.files.length === 0)
|
|
4378
4379
|
return;
|
|
4380
|
+
if (this.isProcessing || this.isRecording) {
|
|
4381
|
+
input.value = '';
|
|
4382
|
+
return;
|
|
4383
|
+
}
|
|
4379
4384
|
const file = input.files[0];
|
|
4380
4385
|
const isEn = this.language === 'en';
|
|
4381
4386
|
// Validate file type
|
|
@@ -4396,7 +4401,18 @@ const VoiceFormRecorder = class {
|
|
|
4396
4401
|
this.audioRecorder = new AudioRecorderService();
|
|
4397
4402
|
}
|
|
4398
4403
|
componentWillLoad() {
|
|
4404
|
+
// Parse theme only so the skeleton can be styled correctly on first render.
|
|
4405
|
+
// Full initialization runs in componentDidLoad() to give the skeleton time to paint.
|
|
4406
|
+
try {
|
|
4407
|
+
this.parsedTheme = this.theme ? JSON.parse(this.theme) : this.getDefaultTheme();
|
|
4408
|
+
}
|
|
4409
|
+
catch (_a) {
|
|
4410
|
+
this.parsedTheme = this.getDefaultTheme();
|
|
4411
|
+
}
|
|
4412
|
+
}
|
|
4413
|
+
componentDidLoad() {
|
|
4399
4414
|
this.initializeServices();
|
|
4415
|
+
this.isInitializing = false;
|
|
4400
4416
|
}
|
|
4401
4417
|
initializeServices() {
|
|
4402
4418
|
var _a;
|
|
@@ -4594,6 +4610,8 @@ const VoiceFormRecorder = class {
|
|
|
4594
4610
|
}
|
|
4595
4611
|
async processJsonForm(ocrData) {
|
|
4596
4612
|
var _a, _b, _c;
|
|
4613
|
+
if (this.isProcessing || this.isRecording)
|
|
4614
|
+
return;
|
|
4597
4615
|
this.isProcessing = true;
|
|
4598
4616
|
this.hasTransientError = false;
|
|
4599
4617
|
this.statusMessage = ((_a = this.parsedTheme.texts) === null || _a === void 0 ? void 0 : _a.processing) || (this.language == 'en' ? 'Processing document...' : 'Traitement du document ...');
|
|
@@ -4631,6 +4649,8 @@ const VoiceFormRecorder = class {
|
|
|
4631
4649
|
}
|
|
4632
4650
|
async processAudioContent(audioFile) {
|
|
4633
4651
|
var _a, _b, _c;
|
|
4652
|
+
if (this.isProcessing || this.isRecording)
|
|
4653
|
+
return;
|
|
4634
4654
|
this.isProcessing = true;
|
|
4635
4655
|
this.hasTransientError = false;
|
|
4636
4656
|
this.updateDebugInfo('Audio Captured', { size: audioFile.size, type: audioFile.type });
|
|
@@ -4947,7 +4967,7 @@ const VoiceFormRecorder = class {
|
|
|
4947
4967
|
textColor: ocrStyle.textColor || '#ffffff'
|
|
4948
4968
|
}
|
|
4949
4969
|
};
|
|
4950
|
-
const isDisabled = this.isProcessing || this.hasError;
|
|
4970
|
+
const isDisabled = this.isProcessing || this.hasError || this.isRecording;
|
|
4951
4971
|
return (index.h("div", { style: { width: size, height: size, flexShrink: '0', opacity: isDisabled ? '0.6' : '1', pointerEvents: isDisabled ? 'none' : 'auto' } }, index.h("ocr-file-uploader", { batch: false, "json-schema": this.convertSchemaToOcrFormat(this.parsedSchema), callback: (data) => { this.processJsonForm(data); }, theme: JSON.stringify(ocrTheme), style: { width: '100%', height: '100%' } })));
|
|
4952
4972
|
}
|
|
4953
4973
|
convertSchemaToOcrFormat(schema) {
|
|
@@ -5002,7 +5022,7 @@ const VoiceFormRecorder = class {
|
|
|
5002
5022
|
return;
|
|
5003
5023
|
const audioStyle = ((_a = this.parsedTheme.buttons) === null || _a === void 0 ? void 0 : _a.audio) || {};
|
|
5004
5024
|
const size = audioStyle.size || '50px';
|
|
5005
|
-
const isDisabled = this.isProcessing || this.hasError;
|
|
5025
|
+
const isDisabled = this.isProcessing || this.hasError || this.isRecording;
|
|
5006
5026
|
const buttonStyle = {
|
|
5007
5027
|
stroke: audioStyle.backgroundColor || '#3b82f6',
|
|
5008
5028
|
fill: audioStyle.backgroundColor || '#3b82f6',
|
|
@@ -5031,6 +5051,17 @@ const VoiceFormRecorder = class {
|
|
|
5031
5051
|
};
|
|
5032
5052
|
return (index.h("button", { class: buttonClass, style: buttonStyle, onClick: () => this.handleRecordClick(), disabled: isDisabled, "aria-label": this.isRecording ? 'Stop recording' : 'Start recording' }, this.isProcessing ? (index.h("svg", { class: "record-icon", viewBox: "0 0 24 24" }, index.h("circle", { cx: "12", cy: "12", r: "3" }, index.h("animate", { attributeName: "r", values: "3;6;3", dur: "1s", repeatCount: "indefinite" }), index.h("animate", { attributeName: "opacity", values: "1;0.3;1", dur: "1s", repeatCount: "indefinite" })))) : this.isRecording ? (index.h("svg", { class: "record-icon", viewBox: "0 0 24 24" }, index.h("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }))) : (index.h("svg", { class: "record-icon", viewBox: "0 0 24 24" }, index.h("circle", { cx: "12", cy: "12", r: "8" })))));
|
|
5033
5053
|
}
|
|
5054
|
+
renderLoadingSkeleton() {
|
|
5055
|
+
var _a;
|
|
5056
|
+
const types = this.parsedInputTypes.length > 0 ? this.parsedInputTypes : ['voice'];
|
|
5057
|
+
const containerStyle = this.getContainerStyle();
|
|
5058
|
+
const buttons = (((_a = this.parsedTheme) === null || _a === void 0 ? void 0 : _a.buttons) || {});
|
|
5059
|
+
const getSize = (type) => { var _a, _b; return ((_a = buttons[type]) === null || _a === void 0 ? void 0 : _a.size) || ((_b = buttons.voice) === null || _b === void 0 ? void 0 : _b.size) || '50px'; };
|
|
5060
|
+
return (index.h("div", null, index.h("div", { class: "voice-recorder-container" + (this.debug || this.renderForm ? "-debug" : ""), style: containerStyle }, index.h("div", { class: "row-audio-area" }, types.map(type => {
|
|
5061
|
+
const size = getSize(type);
|
|
5062
|
+
return index.h("div", { class: "skeleton-circle", style: { width: size, height: size } });
|
|
5063
|
+
})), this.displayStatus && index.h("div", { class: "skeleton-status" }))));
|
|
5064
|
+
}
|
|
5034
5065
|
renderStatusMessage() {
|
|
5035
5066
|
const hasAnyError = this.hasError || this.hasTransientError;
|
|
5036
5067
|
const statusClass = [
|
|
@@ -5192,7 +5223,8 @@ const VoiceFormRecorder = class {
|
|
|
5192
5223
|
};
|
|
5193
5224
|
}
|
|
5194
5225
|
getContainerStyle() {
|
|
5195
|
-
|
|
5226
|
+
var _a;
|
|
5227
|
+
const c = ((_a = this.parsedTheme) === null || _a === void 0 ? void 0 : _a.container) || {};
|
|
5196
5228
|
return {
|
|
5197
5229
|
width: c.width || 'auto',
|
|
5198
5230
|
height: c.height || 'auto',
|
|
@@ -5204,15 +5236,19 @@ const VoiceFormRecorder = class {
|
|
|
5204
5236
|
};
|
|
5205
5237
|
}
|
|
5206
5238
|
getStatusStyle() {
|
|
5207
|
-
|
|
5239
|
+
var _a;
|
|
5240
|
+
const s = ((_a = this.parsedTheme) === null || _a === void 0 ? void 0 : _a.statusText) || {};
|
|
5208
5241
|
return {
|
|
5209
5242
|
color: s.color || '#1e293b',
|
|
5210
5243
|
fontSize: s.fontSize || '14px'
|
|
5211
5244
|
};
|
|
5212
5245
|
}
|
|
5213
5246
|
render() {
|
|
5247
|
+
if (this.isInitializing) {
|
|
5248
|
+
return this.renderLoadingSkeleton();
|
|
5249
|
+
}
|
|
5214
5250
|
const containerStyle = this.getContainerStyle();
|
|
5215
|
-
return (index.h("div",
|
|
5251
|
+
return (index.h("div", null, index.h("div", { class: "voice-recorder-container" + (this.debug || this.renderForm ? "-debug" : ""), style: containerStyle }, index.h("div", { class: "row-audio-area" }, this.renderRecordButton(), this.renderUploadRecordButton(), this.renderUploadButton()), this.displayStatus ? this.renderStatusMessage() : "", this.renderForm ? this.renderFormPreview() : "", this.debug ? this.renderDebugPanel() : "")));
|
|
5216
5252
|
}
|
|
5217
5253
|
static get watchers() { return {
|
|
5218
5254
|
"formJson": ["initializeServices"],
|