reneco-advanced-input-module 0.0.11 → 0.0.12
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/voice-input-module.cjs.entry.js +31 -20
- package/dist/cjs/voice-input-module.cjs.entry.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 +11 -0
- package/dist/collection/components/voice-input-module/voice-input-module.js +27 -17
- package/dist/collection/components/voice-input-module/voice-input-module.js.map +1 -1
- package/dist/collection/utils/schema-converter.js +3 -3
- package/dist/collection/utils/schema-converter.js.map +1 -1
- package/dist/components/voice-input-module.js +31 -20
- package/dist/components/voice-input-module.js.map +1 -1
- package/dist/esm/voice-input-module.entry.js +31 -20
- package/dist/esm/voice-input-module.entry.js.map +1 -1
- package/dist/voice-input-module/{p-b3da90f6.entry.js → p-da21f9a4.entry.js} +3 -3
- package/dist/voice-input-module/p-da21f9a4.entry.js.map +1 -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/package.json +1 -1
- package/www/build/{p-07061ee7.js → p-0c467c9a.js} +1 -1
- package/www/build/{p-b3da90f6.entry.js → p-da21f9a4.entry.js} +3 -3
- package/www/build/p-da21f9a4.entry.js.map +1 -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/index.html +7 -6
- package/dist/voice-input-module/p-b3da90f6.entry.js.map +0 -1
- package/www/build/p-b3da90f6.entry.js.map +0 -1
|
@@ -1013,7 +1013,6 @@ class SchemaConverter {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
static mapControlTypeToJsonType(controlType) {
|
|
1016
|
-
// Map your ControlType XML field to JSON field types
|
|
1017
1016
|
switch (controlType.toLowerCase()) {
|
|
1018
1017
|
case 'textbox':
|
|
1019
1018
|
case 'text':
|
|
@@ -1025,9 +1024,10 @@ class SchemaConverter {
|
|
|
1025
1024
|
case 'termpicker':
|
|
1026
1025
|
return 'select';
|
|
1027
1026
|
case 'dbpicker':
|
|
1028
|
-
return 'dbpicker';
|
|
1027
|
+
return 'dbpicker';
|
|
1029
1028
|
case 'header':
|
|
1030
|
-
|
|
1029
|
+
case 'biglabel':
|
|
1030
|
+
return 'header';
|
|
1031
1031
|
case 'checkbox':
|
|
1032
1032
|
return 'boolean';
|
|
1033
1033
|
case 'realpicker':
|
|
@@ -4106,7 +4106,7 @@ const defineCustomElements = async (win, options) => {
|
|
|
4106
4106
|
|
|
4107
4107
|
(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);}})();
|
|
4108
4108
|
|
|
4109
|
-
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-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}";
|
|
4109
|
+
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}";
|
|
4110
4110
|
|
|
4111
4111
|
// Initialize OCR
|
|
4112
4112
|
defineCustomElements();
|
|
@@ -4407,21 +4407,29 @@ const VoiceFormRecorder = class {
|
|
|
4407
4407
|
break;
|
|
4408
4408
|
case "track":
|
|
4409
4409
|
default:
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
schemaField
|
|
4420
|
-
|
|
4410
|
+
if (filledData === null || filledData === void 0 ? void 0 : filledData.fields) {
|
|
4411
|
+
const nameOccurrences = {};
|
|
4412
|
+
Object.entries(filledData.fields).forEach(([fieldID, field]) => {
|
|
4413
|
+
if (field.value !== undefined && field.value !== null && field.value !== '') {
|
|
4414
|
+
const fieldName = field.name;
|
|
4415
|
+
if (!nameOccurrences[fieldName])
|
|
4416
|
+
nameOccurrences[fieldName] = 0;
|
|
4417
|
+
let matchCount = 0;
|
|
4418
|
+
for (const key in updatedSchema.fields) {
|
|
4419
|
+
const schemaField = updatedSchema.fields[key];
|
|
4420
|
+
if (schemaField.title === fieldName) {
|
|
4421
|
+
if (matchCount === nameOccurrences[fieldName]) {
|
|
4422
|
+
schemaField.value = field.value;
|
|
4423
|
+
schemaField.default = field.value;
|
|
4424
|
+
nameOccurrences[fieldName]++;
|
|
4425
|
+
break;
|
|
4426
|
+
}
|
|
4427
|
+
matchCount++;
|
|
4428
|
+
}
|
|
4421
4429
|
}
|
|
4422
4430
|
}
|
|
4423
|
-
}
|
|
4424
|
-
}
|
|
4431
|
+
});
|
|
4432
|
+
}
|
|
4425
4433
|
break;
|
|
4426
4434
|
}
|
|
4427
4435
|
// console.log("extractFilledData result", updatedSchema);
|
|
@@ -4503,7 +4511,6 @@ const VoiceFormRecorder = class {
|
|
|
4503
4511
|
}
|
|
4504
4512
|
case "track":
|
|
4505
4513
|
default:
|
|
4506
|
-
// Handle simple schema format (backward compatibility)
|
|
4507
4514
|
if ((_a = schema === null || schema === void 0 ? void 0 : schema.schema) !== null && _a !== void 0 ? _a : schema === null || schema === void 0 ? void 0 : schema.fields) {
|
|
4508
4515
|
const trimmedSchema = {
|
|
4509
4516
|
title: schema.title,
|
|
@@ -4512,6 +4519,8 @@ const VoiceFormRecorder = class {
|
|
|
4512
4519
|
};
|
|
4513
4520
|
const finalSchema = (_b = schema === null || schema === void 0 ? void 0 : schema.schema) !== null && _b !== void 0 ? _b : schema === null || schema === void 0 ? void 0 : schema.fields;
|
|
4514
4521
|
Object.entries(finalSchema).forEach(([fieldName, field]) => {
|
|
4522
|
+
if (field.type === 'header')
|
|
4523
|
+
return;
|
|
4515
4524
|
trimmedSchema.schema[fieldName] = {
|
|
4516
4525
|
type: field.type,
|
|
4517
4526
|
title: field.title,
|
|
@@ -4523,7 +4532,6 @@ const VoiceFormRecorder = class {
|
|
|
4523
4532
|
max: field.ValidationMax
|
|
4524
4533
|
};
|
|
4525
4534
|
});
|
|
4526
|
-
// console.log("Schema apres transformation, contexte Track:", trimmedSchema);
|
|
4527
4535
|
return trimmedSchema;
|
|
4528
4536
|
}
|
|
4529
4537
|
break;
|
|
@@ -4747,6 +4755,9 @@ const VoiceFormRecorder = class {
|
|
|
4747
4755
|
default:
|
|
4748
4756
|
return Object.entries(this.parsedSchema.fields).map(([fieldName, field]) => {
|
|
4749
4757
|
var _a, _b;
|
|
4758
|
+
if (field.type === 'header') {
|
|
4759
|
+
return (index.h("div", { class: "form-header", key: fieldName }, field.title || fieldName));
|
|
4760
|
+
}
|
|
4750
4761
|
return (index.h("div", { class: "form-group", key: fieldName }, index.h("label", { htmlFor: fieldName, class: "form-label" }, field.title || fieldName, field.required && index.h("span", { class: "required" }, "*")), this.renderFormField(fieldName, field, ((_b = (_a = this.filledData) === null || _a === void 0 ? void 0 : _a[fieldName]) !== null && _b !== void 0 ? _b : field.value))));
|
|
4751
4762
|
});
|
|
4752
4763
|
}
|
|
@@ -4844,7 +4855,7 @@ const VoiceFormRecorder = class {
|
|
|
4844
4855
|
render() {
|
|
4845
4856
|
const containerStyle = this.getContainerStyle();
|
|
4846
4857
|
const statusStyle = this.getStatusStyle();
|
|
4847
|
-
return (index.h("div", { key: '
|
|
4858
|
+
return (index.h("div", { key: 'd30cc9c267afa2890f2df40c1a892ce1b63b1e11' }, index.h("div", { key: '190d7a363097928283f901554c97275ad68f9f78', class: "voice-recorder-container" + (this.debug || this.renderForm ? "-debug" : ""), style: containerStyle }, index.h("div", { key: 'be008f255d80a8d434c02330dbf5a1c0fe3280fd', class: "row-audio-area" }, this.renderRecordButton(), this.renderUploadRecordButton(), this.renderUploadButton()), this.displayStatus ? index.h("div", { class: "status-text", style: statusStyle }, this.statusMessage) : "", this.renderForm ? this.renderFormPreview() : "", this.debug ? this.renderDebugPanel() : "")));
|
|
4848
4859
|
}
|
|
4849
4860
|
static get watchers() { return {
|
|
4850
4861
|
"formJson": ["initializeServices"],
|