@seniorsistemas/angular-components 17.26.8 → 17.26.9-bugfix-sds-309-cfd66723
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/bundles/seniorsistemas-angular-components.umd.js +174 -75
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/dynamic-form/configurations/fields/text-area-field.d.ts +8 -6
- package/components/dynamic-form/configurations/fields/text-area-ia-field.d.ts +6 -0
- package/components/speech-recognition/speech-recognition/speech-recognition.component.d.ts +3 -0
- package/components/speech-recognition/speech-recognition.service.d.ts +6 -1
- package/components/text-area/text-area/text-area.component.d.ts +3 -0
- package/components/text-area-ia/text-area-ia.component.d.ts +2 -0
- package/esm2015/components/dynamic-form/components/fields/text-area/text-area-field.component.js +2 -2
- package/esm2015/components/dynamic-form/components/fields/text-area-ia/text-area-ia-field.component.js +6 -4
- package/esm2015/components/dynamic-form/configurations/fields/text-area-field.js +9 -3
- package/esm2015/components/dynamic-form/configurations/fields/text-area-ia-field.js +5 -2
- package/esm2015/components/speech-recognition/speech-recognition/speech-recognition.component.js +32 -10
- package/esm2015/components/speech-recognition/speech-recognition.service.js +96 -57
- package/esm2015/components/text-area/text-area/text-area.component.js +14 -3
- package/esm2015/components/text-area-ia/text-area-ia.component.js +10 -2
- package/esm2015/locale/fallback.js +3 -2
- package/esm5/components/dynamic-form/components/fields/text-area/text-area-field.component.js +2 -2
- package/esm5/components/dynamic-form/components/fields/text-area-ia/text-area-ia-field.component.js +6 -4
- package/esm5/components/dynamic-form/configurations/fields/text-area-field.js +10 -4
- package/esm5/components/dynamic-form/configurations/fields/text-area-ia-field.js +5 -2
- package/esm5/components/speech-recognition/speech-recognition/speech-recognition.component.js +33 -10
- package/esm5/components/speech-recognition/speech-recognition.service.js +106 -57
- package/esm5/components/text-area/text-area/text-area.component.js +14 -3
- package/esm5/components/text-area-ia/text-area-ia.component.js +10 -2
- package/esm5/locale/fallback.js +3 -2
- package/fesm2015/seniorsistemas-angular-components.js +163 -75
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +174 -75
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -7086,14 +7086,20 @@ var SliderField = /** @class */ (function (_super) {
|
|
|
7086
7086
|
var TextAreaField = /** @class */ (function (_super) {
|
|
7087
7087
|
__extends(TextAreaField, _super);
|
|
7088
7088
|
function TextAreaField(config) {
|
|
7089
|
-
var _a;
|
|
7089
|
+
var _a, _b, _c;
|
|
7090
7090
|
var _this = _super.call(this, config) || this;
|
|
7091
|
+
_this.style = {
|
|
7092
|
+
resize: 'vertical'
|
|
7093
|
+
};
|
|
7091
7094
|
_this.cols = config.cols;
|
|
7092
7095
|
_this.rows = config.rows;
|
|
7093
7096
|
_this.keyFilter = config.keyFilter;
|
|
7094
|
-
_this.style = config.style;
|
|
7097
|
+
_this.style = __assign(__assign({}, config.style), _this.style);
|
|
7095
7098
|
_this.readonly = config.readonly;
|
|
7096
7099
|
_this.speechRecognition = (_a = config.speechRecognition) !== null && _a !== void 0 ? _a : false;
|
|
7100
|
+
_this.keepContext = (_b = config.keepContext) !== null && _b !== void 0 ? _b : false;
|
|
7101
|
+
_this.speechRecognitionPlaceholder = (_c = config.speechRecognitionPlaceholder) !== null && _c !== void 0 ? _c : '';
|
|
7102
|
+
_this.maxLength = config.maxLength;
|
|
7097
7103
|
return _this;
|
|
7098
7104
|
}
|
|
7099
7105
|
return TextAreaField;
|
|
@@ -7102,7 +7108,7 @@ var TextAreaField = /** @class */ (function (_super) {
|
|
|
7102
7108
|
var TextAreaIAField = /** @class */ (function (_super) {
|
|
7103
7109
|
__extends(TextAreaIAField, _super);
|
|
7104
7110
|
function TextAreaIAField(config) {
|
|
7105
|
-
var _a;
|
|
7111
|
+
var _a, _b, _c;
|
|
7106
7112
|
var _this = _super.call(this, config) || this;
|
|
7107
7113
|
_this.style = {
|
|
7108
7114
|
resize: 'vertical'
|
|
@@ -7114,6 +7120,9 @@ var TextAreaIAField = /** @class */ (function (_super) {
|
|
|
7114
7120
|
_this.prompt = config.prompt;
|
|
7115
7121
|
_this.readonly = config.readonly;
|
|
7116
7122
|
_this.speechRecognition = (_a = config.speechRecognition) !== null && _a !== void 0 ? _a : false;
|
|
7123
|
+
_this.keepContext = (_b = config.keepContext) !== null && _b !== void 0 ? _b : false;
|
|
7124
|
+
_this.speechRecognitionPlaceholder = (_c = config.speechRecognitionPlaceholder) !== null && _c !== void 0 ? _c : '';
|
|
7125
|
+
_this.maxLength = config.maxLength;
|
|
7117
7126
|
return _this;
|
|
7118
7127
|
}
|
|
7119
7128
|
return TextAreaIAField;
|
|
@@ -11343,9 +11352,11 @@ var SliderFieldComponent = /** @class */ (function (_super) {
|
|
|
11343
11352
|
}(BaseFieldComponent));
|
|
11344
11353
|
|
|
11345
11354
|
var SpeechRecognitionService = /** @class */ (function () {
|
|
11346
|
-
function SpeechRecognitionService(localeService, ngZone) {
|
|
11355
|
+
function SpeechRecognitionService(localeService, ngZone, toastService, translateService) {
|
|
11347
11356
|
this.localeService = localeService;
|
|
11348
11357
|
this.ngZone = ngZone;
|
|
11358
|
+
this.toastService = toastService;
|
|
11359
|
+
this.translateService = translateService;
|
|
11349
11360
|
this.hasSupportSpeechRecognition = false;
|
|
11350
11361
|
this.isListening = false;
|
|
11351
11362
|
this.TIMEOUT_NO_MESSAGE = 3000;
|
|
@@ -11353,65 +11364,69 @@ var SpeechRecognitionService = /** @class */ (function () {
|
|
|
11353
11364
|
}
|
|
11354
11365
|
SpeechRecognitionService.prototype.listen = function () {
|
|
11355
11366
|
var _this = this;
|
|
11367
|
+
var speechSubject = new Subject();
|
|
11356
11368
|
if (this.isListening) {
|
|
11357
|
-
|
|
11369
|
+
speechSubject.error('Already listening');
|
|
11358
11370
|
}
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
var silenceTimer;
|
|
11365
|
-
var restartSilenceTimer = function () {
|
|
11366
|
-
if (silenceTimer !== undefined) {
|
|
11367
|
-
clearTimeout(silenceTimer);
|
|
11371
|
+
this.hasMicrophoneAccess().then(function (hasAccess) {
|
|
11372
|
+
if (!hasAccess) {
|
|
11373
|
+
_this.toastService.show({ severity: 'error', text: _this.translateService.instant('platform.angular_components.no_microphone_permission') });
|
|
11374
|
+
speechSubject.error('Microphone access is disabled');
|
|
11375
|
+
return;
|
|
11368
11376
|
}
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
this.recognition.onresult = function (event) {
|
|
11376
|
-
_this.ngZone.run(function () {
|
|
11377
|
-
restartSilenceTimer();
|
|
11378
|
-
var interimTranscript = '';
|
|
11379
|
-
for (var i = event.resultIndex; i < event.results.length; ++i) {
|
|
11380
|
-
var transcript = event.results[i][0].transcript;
|
|
11381
|
-
if (event.results[i].isFinal) {
|
|
11382
|
-
fullTranscript += transcript + '\n';
|
|
11383
|
-
}
|
|
11384
|
-
else {
|
|
11385
|
-
interimTranscript += transcript;
|
|
11386
|
-
}
|
|
11387
|
-
}
|
|
11388
|
-
interimTranscript = interimTranscript;
|
|
11389
|
-
speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: false });
|
|
11390
|
-
});
|
|
11391
|
-
};
|
|
11392
|
-
this.recognition.onerror = function () {
|
|
11393
|
-
_this.ngZone.run(function () {
|
|
11377
|
+
_this.isListening = true;
|
|
11378
|
+
_this.recognition.continuous = true;
|
|
11379
|
+
_this.recognition.interimResults = true;
|
|
11380
|
+
_this.recognition.maxAlternatives = 1;
|
|
11381
|
+
var silenceTimer;
|
|
11382
|
+
var restartSilenceTimer = function () {
|
|
11394
11383
|
if (silenceTimer !== undefined) {
|
|
11395
11384
|
clearTimeout(silenceTimer);
|
|
11396
11385
|
}
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11386
|
+
silenceTimer = setTimeout(function () {
|
|
11387
|
+
_this.recognition.stop();
|
|
11388
|
+
}, _this.TIMEOUT_NO_MESSAGE);
|
|
11389
|
+
};
|
|
11390
|
+
var fullTranscript = '';
|
|
11391
|
+
var interimTranscript = '';
|
|
11392
|
+
_this.recognition.onresult = function (event) {
|
|
11393
|
+
_this.ngZone.run(function () {
|
|
11394
|
+
restartSilenceTimer();
|
|
11395
|
+
var interimTranscript = '';
|
|
11396
|
+
for (var i = event.resultIndex; i < event.results.length; ++i) {
|
|
11397
|
+
var transcript = event.results[i][0].transcript;
|
|
11398
|
+
if (event.results[i].isFinal) {
|
|
11399
|
+
fullTranscript += transcript + '\n';
|
|
11400
|
+
}
|
|
11401
|
+
else {
|
|
11402
|
+
interimTranscript += transcript;
|
|
11403
|
+
}
|
|
11404
|
+
}
|
|
11405
|
+
interimTranscript = interimTranscript;
|
|
11406
|
+
speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: false });
|
|
11401
11407
|
});
|
|
11402
|
-
}
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11408
|
+
};
|
|
11409
|
+
_this.recognition.onerror = function () {
|
|
11410
|
+
_this.ngZone.run(function () {
|
|
11411
|
+
if (silenceTimer !== undefined) {
|
|
11412
|
+
clearTimeout(silenceTimer);
|
|
11413
|
+
}
|
|
11414
|
+
_this.isListening = false;
|
|
11415
|
+
speechSubject.error('Speech recognition error');
|
|
11416
|
+
});
|
|
11417
|
+
};
|
|
11418
|
+
_this.recognition.onend = function () {
|
|
11419
|
+
_this.ngZone.run(function () {
|
|
11420
|
+
if (silenceTimer !== undefined) {
|
|
11421
|
+
clearTimeout(silenceTimer);
|
|
11422
|
+
}
|
|
11423
|
+
speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: true });
|
|
11424
|
+
_this.isListening = false;
|
|
11425
|
+
speechSubject.complete();
|
|
11426
|
+
});
|
|
11427
|
+
};
|
|
11428
|
+
_this.recognition.start();
|
|
11429
|
+
});
|
|
11415
11430
|
return speechSubject;
|
|
11416
11431
|
};
|
|
11417
11432
|
SpeechRecognitionService.prototype.stop = function () {
|
|
@@ -11432,11 +11447,50 @@ var SpeechRecognitionService = /** @class */ (function () {
|
|
|
11432
11447
|
this.recognition.maxAlternatives = 1;
|
|
11433
11448
|
this.localeService.getLocale().subscribe(function (locale) { return _this.recognition.lang = locale; });
|
|
11434
11449
|
};
|
|
11450
|
+
SpeechRecognitionService.prototype.hasMicrophoneAccess = function () {
|
|
11451
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11452
|
+
var permission, stream, _a, _b;
|
|
11453
|
+
return __generator(this, function (_c) {
|
|
11454
|
+
switch (_c.label) {
|
|
11455
|
+
case 0:
|
|
11456
|
+
_c.trys.push([0, 6, , 7]);
|
|
11457
|
+
return [4 /*yield*/, navigator.permissions.query({ name: 'microphone' })];
|
|
11458
|
+
case 1:
|
|
11459
|
+
permission = _c.sent();
|
|
11460
|
+
if (permission.state === 'denied') {
|
|
11461
|
+
return [2 /*return*/, false];
|
|
11462
|
+
}
|
|
11463
|
+
if (permission.state === 'granted') {
|
|
11464
|
+
return [2 /*return*/, true];
|
|
11465
|
+
}
|
|
11466
|
+
if (!(permission.state === 'prompt')) return [3 /*break*/, 5];
|
|
11467
|
+
_c.label = 2;
|
|
11468
|
+
case 2:
|
|
11469
|
+
_c.trys.push([2, 4, , 5]);
|
|
11470
|
+
return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ audio: true })];
|
|
11471
|
+
case 3:
|
|
11472
|
+
stream = _c.sent();
|
|
11473
|
+
stream.getTracks().forEach(function (t) { return t.stop(); });
|
|
11474
|
+
return [2 /*return*/, true];
|
|
11475
|
+
case 4:
|
|
11476
|
+
_a = _c.sent();
|
|
11477
|
+
return [2 /*return*/, false];
|
|
11478
|
+
case 5: return [2 /*return*/, false];
|
|
11479
|
+
case 6:
|
|
11480
|
+
_b = _c.sent();
|
|
11481
|
+
return [2 /*return*/, false];
|
|
11482
|
+
case 7: return [2 /*return*/];
|
|
11483
|
+
}
|
|
11484
|
+
});
|
|
11485
|
+
});
|
|
11486
|
+
};
|
|
11435
11487
|
SpeechRecognitionService.ctorParameters = function () { return [
|
|
11436
11488
|
{ type: LocaleService },
|
|
11437
|
-
{ type: NgZone }
|
|
11489
|
+
{ type: NgZone },
|
|
11490
|
+
{ type: ToastService },
|
|
11491
|
+
{ type: TranslateService }
|
|
11438
11492
|
]; };
|
|
11439
|
-
SpeechRecognitionService.ɵprov = ɵɵdefineInjectable({ factory: function SpeechRecognitionService_Factory() { return new SpeechRecognitionService(ɵɵinject(LocaleService), ɵɵinject(NgZone)); }, token: SpeechRecognitionService, providedIn: "root" });
|
|
11493
|
+
SpeechRecognitionService.ɵprov = ɵɵdefineInjectable({ factory: function SpeechRecognitionService_Factory() { return new SpeechRecognitionService(ɵɵinject(LocaleService), ɵɵinject(NgZone), ɵɵinject(ToastService), ɵɵinject(TranslateService)); }, token: SpeechRecognitionService, providedIn: "root" });
|
|
11440
11494
|
SpeechRecognitionService = __decorate([
|
|
11441
11495
|
Injectable({
|
|
11442
11496
|
providedIn: 'root'
|
|
@@ -11489,14 +11543,16 @@ var TextAreaIAFieldComponent = /** @class */ (function () {
|
|
|
11489
11543
|
this.hideDialog();
|
|
11490
11544
|
};
|
|
11491
11545
|
TextAreaIAFieldComponent.prototype._createDialogFields = function () {
|
|
11492
|
-
var _a;
|
|
11546
|
+
var _a, _b;
|
|
11493
11547
|
this.fields = [
|
|
11494
11548
|
new FormField({
|
|
11495
11549
|
name: "context",
|
|
11496
11550
|
type: FieldType.Text,
|
|
11497
11551
|
label: this._translateService.instant("platform.angular_components.context"),
|
|
11498
11552
|
size: { sm: 12, md: 12, lg: 12, xl: 12 },
|
|
11499
|
-
speechRecognition: (_a = this.field.speechRecognition) !== null && _a !== void 0 ? _a : false
|
|
11553
|
+
speechRecognition: (_a = this.field.speechRecognition) !== null && _a !== void 0 ? _a : false,
|
|
11554
|
+
keepContext: (_b = this.field.keepContext) !== null && _b !== void 0 ? _b : false,
|
|
11555
|
+
maxLength: this.field.maxLength,
|
|
11500
11556
|
}),
|
|
11501
11557
|
];
|
|
11502
11558
|
};
|
|
@@ -11519,7 +11575,7 @@ var TextAreaIAFieldComponent = /** @class */ (function () {
|
|
|
11519
11575
|
], TextAreaIAFieldComponent.prototype, "formControl", void 0);
|
|
11520
11576
|
TextAreaIAFieldComponent = __decorate([
|
|
11521
11577
|
Component({
|
|
11522
|
-
template: "<s-field-label [field]=\"field\"\n *ngIf=\"textArea.renderTextArea\"\n [fieldContainerRef]=\"textArea.textAreaElement?.nativeElement\"></s-field-label>\n\n<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\">\n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n IAssist - Content Generator\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <s-textarea\n #textArea\n [inputId]=\"(field.id || field.name)\"\n [rows]=\"field.rows\"\n [formControl]=\"formControl\"\n [inputStyle]=\"field.style\"\n [readOnly]=\"field.readonly ? field.readonly() : false\"\n [speechRecognition]=\"field.speechRecognition\"\n [placeholder]=\"field.placeholder\"\n ></s-textarea>\n <button\n class=\"iassist-button\"\n [class.speech-recognition]=\"field.speechRecognition && speechRecognitionService.hasSupportSpeechRecognition\"\n (click)=\"showDialog()\"\n sTooltip=\"IAssist - Content Generator\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>\n",
|
|
11578
|
+
template: "<s-field-label [field]=\"field\"\n *ngIf=\"textArea.renderTextArea\"\n [fieldContainerRef]=\"textArea.textAreaElement?.nativeElement\"></s-field-label>\n\n<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\">\n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n IAssist - Content Generator\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <s-textarea\n #textArea\n [inputId]=\"(field.id || field.name)\"\n [rows]=\"field.rows\"\n [formControl]=\"formControl\"\n [inputStyle]=\"field.style\"\n [readOnly]=\"field.readonly ? field.readonly() : false\"\n [speechRecognition]=\"field.speechRecognition\"\n [placeholder]=\"field.placeholder\"\n [keepContext]=\"field.keepContext\"\n [speechRecognitionPlaceholder]=\"field.speechRecognitionPlaceholder\"\n [maxLength]=\"field.maxLength\"\n ></s-textarea>\n <button\n class=\"iassist-button\"\n [class.speech-recognition]=\"field.speechRecognition && speechRecognitionService.hasSupportSpeechRecognition\"\n (click)=\"showDialog()\"\n sTooltip=\"IAssist - Content Generator\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>\n",
|
|
11523
11579
|
styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.textarea-ia s-textarea{width:100%}.iassist-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:none;border-radius:50%;box-shadow:none;cursor:pointer;height:32px;width:32px}.dialog-header{display:-ms-flexbox;display:flex;gap:12px}.dialog-header .iassist-icon{display:block;height:24px;width:24px}.speech-recognition{margin-bottom:12.5px}"]
|
|
11524
11580
|
})
|
|
11525
11581
|
], TextAreaIAFieldComponent);
|
|
@@ -11547,7 +11603,7 @@ var TextAreaFieldComponent = /** @class */ (function () {
|
|
|
11547
11603
|
], TextAreaFieldComponent.prototype, "inputRef", void 0);
|
|
11548
11604
|
TextAreaFieldComponent = __decorate([
|
|
11549
11605
|
Component({
|
|
11550
|
-
template: "<s-field-label *ngIf=\"textArea\" [field]=\"field\"\n [fieldContainerRef]=\"textArea.textAreaElement?.nativeElement\"></s-field-label>\n\n<s-textarea\n #textArea\n [inputId]=\"(field.id || field.name)\"\n [rows]=\"field.rows\"\n [formControl]=\"formControl\"\n [inputStyle]=\"field.style\"\n [readOnly]=\"field.readonly ? field.readonly() : false\"\n [keyFilter]=\"field.keyFilter\"\n [placeholder]=\"field.placeholder\"\n [speechRecognition]=\"field.speechRecognition\">\n</s-textarea>\n"
|
|
11606
|
+
template: "<s-field-label *ngIf=\"textArea\" [field]=\"field\"\n [fieldContainerRef]=\"textArea.textAreaElement?.nativeElement\"></s-field-label>\n\n<s-textarea\n #textArea\n [inputId]=\"(field.id || field.name)\"\n [rows]=\"field.rows\"\n [formControl]=\"formControl\"\n [inputStyle]=\"field.style\"\n [readOnly]=\"field.readonly ? field.readonly() : false\"\n [keyFilter]=\"field.keyFilter\"\n [placeholder]=\"field.placeholder\"\n [keepContext]=\"field.keepContext\"\n [speechRecognitionPlaceholder]=\"field.speechRecognitionPlaceholder\"\n [maxLength]=\"field.maxLength\"\n [speechRecognition]=\"field.speechRecognition\">\n</s-textarea>\n"
|
|
11551
11607
|
})
|
|
11552
11608
|
], TextAreaFieldComponent);
|
|
11553
11609
|
return TextAreaFieldComponent;
|
|
@@ -13421,6 +13477,8 @@ var TextAreaComponent = /** @class */ (function () {
|
|
|
13421
13477
|
this.inputId = "textarea-" + Math.random();
|
|
13422
13478
|
this.rows = 5;
|
|
13423
13479
|
this.speechRecognition = false;
|
|
13480
|
+
this.keepContext = false;
|
|
13481
|
+
this.speechRecognitionPlaceholder = '';
|
|
13424
13482
|
this._inputStyle = {
|
|
13425
13483
|
resize: 'vertical'
|
|
13426
13484
|
};
|
|
@@ -13511,6 +13569,15 @@ var TextAreaComponent = /** @class */ (function () {
|
|
|
13511
13569
|
__decorate([
|
|
13512
13570
|
Input()
|
|
13513
13571
|
], TextAreaComponent.prototype, "keyFilter", void 0);
|
|
13572
|
+
__decorate([
|
|
13573
|
+
Input()
|
|
13574
|
+
], TextAreaComponent.prototype, "keepContext", void 0);
|
|
13575
|
+
__decorate([
|
|
13576
|
+
Input()
|
|
13577
|
+
], TextAreaComponent.prototype, "speechRecognitionPlaceholder", void 0);
|
|
13578
|
+
__decorate([
|
|
13579
|
+
Input()
|
|
13580
|
+
], TextAreaComponent.prototype, "maxLength", void 0);
|
|
13514
13581
|
__decorate([
|
|
13515
13582
|
Input()
|
|
13516
13583
|
], TextAreaComponent.prototype, "placeholder", null);
|
|
@@ -13523,7 +13590,7 @@ var TextAreaComponent = /** @class */ (function () {
|
|
|
13523
13590
|
TextAreaComponent = TextAreaComponent_1 = __decorate([
|
|
13524
13591
|
Component({
|
|
13525
13592
|
selector: 's-textarea',
|
|
13526
|
-
template: "<textarea\n *ngIf=\"keyFilter\"\n #textArea\n class=\"textarea\"\n [pKeyFilter]=\"keyFilter\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<textarea\n *ngIf=\"!keyFilter\"\n #textArea\n class=\"textarea\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<s-speech-recognition\n *ngIf=\"speechRecognition && renderTextArea\"\n [textAreaElement]=\"textAreaElement.nativeElement\"\n (recognizedText)=\"handleRecognizedText($event)\">\n</s-speech-recognition>\n",
|
|
13593
|
+
template: "<textarea\n *ngIf=\"keyFilter\"\n #textArea\n class=\"textarea\"\n [pKeyFilter]=\"keyFilter\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<textarea\n *ngIf=\"!keyFilter\"\n #textArea\n class=\"textarea\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<s-speech-recognition\n *ngIf=\"speechRecognition && renderTextArea\"\n [textAreaElement]=\"textAreaElement.nativeElement\"\n [keepContext]=\"keepContext\"\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\n (recognizedText)=\"handleRecognizedText($event)\">\n</s-speech-recognition>\n",
|
|
13527
13594
|
providers: [
|
|
13528
13595
|
{
|
|
13529
13596
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -13531,7 +13598,7 @@ var TextAreaComponent = /** @class */ (function () {
|
|
|
13531
13598
|
multi: true,
|
|
13532
13599
|
},
|
|
13533
13600
|
],
|
|
13534
|
-
styles: [".textarea{border-radius:3px;border:1px solid #c1c1cc;background:#fff;width:100%;max-width:100%;min-height:4em;min-width:10em;outline:0;padding:8px;display:block}.textarea:disabled{opacity:.5}"]
|
|
13601
|
+
styles: [".textarea{border-radius:3px;border:1px solid #c1c1cc;background:#fff;width:100%;max-width:100%;min-height:4em;min-width:10em;outline:0;padding:8px;display:block}.textarea:disabled{opacity:.5}:host.ng-invalid.ng-dirty .textarea{border-color:#c13018}"]
|
|
13535
13602
|
})
|
|
13536
13603
|
], TextAreaComponent);
|
|
13537
13604
|
return TextAreaComponent;
|
|
@@ -13629,6 +13696,8 @@ var SpeechRecognitionComponent = /** @class */ (function () {
|
|
|
13629
13696
|
this.speechRecognitionService = speechRecognitionService;
|
|
13630
13697
|
this.textToSpeechService = textToSpeechService;
|
|
13631
13698
|
this.translateService = translateService;
|
|
13699
|
+
this.keepContext = false;
|
|
13700
|
+
this.speechRecognitionPlaceholder = '';
|
|
13632
13701
|
this._recognizedText = '';
|
|
13633
13702
|
this.originalTextAreaElementText = '';
|
|
13634
13703
|
this.isDoneSpeaking = false;
|
|
@@ -13659,7 +13728,7 @@ var SpeechRecognitionComponent = /** @class */ (function () {
|
|
|
13659
13728
|
if (!this.textAreaElement) {
|
|
13660
13729
|
throw new Error('textAreaElement is required');
|
|
13661
13730
|
}
|
|
13662
|
-
this.textAreaElement.placeholder = this.translateService.instant("platform.angular_components.text_area_speech_recognition_placeholder");
|
|
13731
|
+
this.textAreaElement.placeholder = this.speechRecognitionPlaceholder ? this.speechRecognitionPlaceholder : this.translateService.instant("platform.angular_components.text_area_speech_recognition_placeholder");
|
|
13663
13732
|
this.textAreaElement.addEventListener('keydown', this.keydownEventListener);
|
|
13664
13733
|
};
|
|
13665
13734
|
SpeechRecognitionComponent.prototype.onListen = function () {
|
|
@@ -13670,9 +13739,7 @@ var SpeechRecognitionComponent = /** @class */ (function () {
|
|
|
13670
13739
|
this.disabled = true;
|
|
13671
13740
|
this.canRenderMicrophone = false;
|
|
13672
13741
|
this.canRenderListeningText = true;
|
|
13673
|
-
|
|
13674
|
-
this.originalTextAreaElementText = this.textAreaElement.value;
|
|
13675
|
-
}
|
|
13742
|
+
this.originalTextAreaElementText = this.textAreaElement.value;
|
|
13676
13743
|
this.textAreaElement.value = '';
|
|
13677
13744
|
this.isSpeaking = true;
|
|
13678
13745
|
this.speechRecognitionService.listen()
|
|
@@ -13681,17 +13748,27 @@ var SpeechRecognitionComponent = /** @class */ (function () {
|
|
|
13681
13748
|
var text = _a.text, isFinal = _a.isFinal;
|
|
13682
13749
|
_this._recognizedText = text;
|
|
13683
13750
|
_this.setTextAreaValue(text);
|
|
13684
|
-
|
|
13685
|
-
_this.textAreaElement.scrollTop = _this.textAreaElement.scrollHeight;
|
|
13686
|
-
}, 120);
|
|
13751
|
+
_this.scrollTextAreaBottom();
|
|
13687
13752
|
if (isFinal) {
|
|
13688
13753
|
_this.canRenderAprove = true;
|
|
13689
13754
|
_this.canRenderDiscard = true;
|
|
13690
13755
|
_this.canRenderListeningText = false;
|
|
13691
13756
|
_this.isSpeaking = false;
|
|
13692
13757
|
}
|
|
13758
|
+
}, function () {
|
|
13759
|
+
_this.isSpeaking = false;
|
|
13760
|
+
_this.canRenderMicrophone = true;
|
|
13761
|
+
_this.isDisabledMicrophone = false;
|
|
13762
|
+
_this.canRenderListeningText = false;
|
|
13763
|
+
_this.disabled = false;
|
|
13693
13764
|
});
|
|
13694
13765
|
};
|
|
13766
|
+
SpeechRecognitionComponent.prototype.scrollTextAreaBottom = function () {
|
|
13767
|
+
var _this = this;
|
|
13768
|
+
setTimeout(function () {
|
|
13769
|
+
_this.textAreaElement.scrollTop = _this.textAreaElement.scrollHeight;
|
|
13770
|
+
}, 120);
|
|
13771
|
+
};
|
|
13695
13772
|
SpeechRecognitionComponent.prototype.onOpenToolbar = function () {
|
|
13696
13773
|
if (this.isDisabledTextToSpeech) {
|
|
13697
13774
|
return;
|
|
@@ -13725,8 +13802,15 @@ var SpeechRecognitionComponent = /** @class */ (function () {
|
|
|
13725
13802
|
this.canRenderMicrophone = true;
|
|
13726
13803
|
this.canRenderTextToSpeechToolbar = false;
|
|
13727
13804
|
this.canRenderTextToSpeech = true;
|
|
13728
|
-
this.
|
|
13729
|
-
|
|
13805
|
+
if (this.keepContext) {
|
|
13806
|
+
var breakLine = this.originalTextAreaElementText.length > 0 ? '\n' : '';
|
|
13807
|
+
this.originalTextAreaElementText += "" + breakLine + this._recognizedText;
|
|
13808
|
+
}
|
|
13809
|
+
else {
|
|
13810
|
+
this.originalTextAreaElementText = this._recognizedText;
|
|
13811
|
+
}
|
|
13812
|
+
this.recognizedText.emit(this.keepContext ? this.originalTextAreaElementText : this._recognizedText);
|
|
13813
|
+
this.scrollTextAreaBottom();
|
|
13730
13814
|
this._recognizedText = '';
|
|
13731
13815
|
this.disabled = false;
|
|
13732
13816
|
this.textToSpeechService.cancel();
|
|
@@ -13805,6 +13889,12 @@ var SpeechRecognitionComponent = /** @class */ (function () {
|
|
|
13805
13889
|
__decorate([
|
|
13806
13890
|
Input()
|
|
13807
13891
|
], SpeechRecognitionComponent.prototype, "textAreaElement", void 0);
|
|
13892
|
+
__decorate([
|
|
13893
|
+
Input()
|
|
13894
|
+
], SpeechRecognitionComponent.prototype, "keepContext", void 0);
|
|
13895
|
+
__decorate([
|
|
13896
|
+
Input()
|
|
13897
|
+
], SpeechRecognitionComponent.prototype, "speechRecognitionPlaceholder", void 0);
|
|
13808
13898
|
__decorate([
|
|
13809
13899
|
Output()
|
|
13810
13900
|
], SpeechRecognitionComponent.prototype, "recognizedText", void 0);
|
|
@@ -17786,6 +17876,8 @@ var TextAreaIAComponent = /** @class */ (function () {
|
|
|
17786
17876
|
this._translateService = _translateService;
|
|
17787
17877
|
this.speechRecognitionService = speechRecognitionService;
|
|
17788
17878
|
this.speechRecognition = false;
|
|
17879
|
+
this.keepContext = false;
|
|
17880
|
+
this.speechRecognitionPlaceholder = '';
|
|
17789
17881
|
this.isVisible = false;
|
|
17790
17882
|
this.isLoading = false;
|
|
17791
17883
|
}
|
|
@@ -17890,10 +17982,16 @@ var TextAreaIAComponent = /** @class */ (function () {
|
|
|
17890
17982
|
__decorate([
|
|
17891
17983
|
Input()
|
|
17892
17984
|
], TextAreaIAComponent.prototype, "speechRecognition", void 0);
|
|
17985
|
+
__decorate([
|
|
17986
|
+
Input()
|
|
17987
|
+
], TextAreaIAComponent.prototype, "keepContext", void 0);
|
|
17988
|
+
__decorate([
|
|
17989
|
+
Input()
|
|
17990
|
+
], TextAreaIAComponent.prototype, "speechRecognitionPlaceholder", void 0);
|
|
17893
17991
|
TextAreaIAComponent = TextAreaIAComponent_1 = __decorate([
|
|
17894
17992
|
Component({
|
|
17895
17993
|
selector: "s-text-area-ia",
|
|
17896
|
-
template: "<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\">\n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n IAssist - Content Generator\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <s-textarea\n [inputId]=\"id\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n [readOnly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [speechRecognition]=\"speechRecognition\"\n ></s-textarea>\n <button\n class=\"iassist-button\"\n [class.speech-recognition]=\"speechRecognition && speechRecognitionService.hasSupportSpeechRecognition\"\n (click)=\"showDialog()\"\n sTooltip=\"IAssist - Content Generator\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>\n",
|
|
17994
|
+
template: "<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\">\n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n IAssist - Content Generator\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <s-textarea\n [inputId]=\"id\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n [readOnly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [speechRecognition]=\"speechRecognition\"\n [keepContext]=\"keepContext\"\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\n ></s-textarea>\n <button\n class=\"iassist-button\"\n [class.speech-recognition]=\"speechRecognition && speechRecognitionService.hasSupportSpeechRecognition\"\n (click)=\"showDialog()\"\n sTooltip=\"IAssist - Content Generator\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>\n",
|
|
17897
17995
|
providers: [
|
|
17898
17996
|
{
|
|
17899
17997
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -23118,7 +23216,8 @@ var fallback = {
|
|
|
23118
23216
|
"platform.angular_components.text_area_speech_recognition_placeholder": "Preencha o campo com, pelo menos, uma frase",
|
|
23119
23217
|
"platform.angular_components.text_area_before_speech": "Grave ou ouça o texto clicando nos ícones",
|
|
23120
23218
|
"platform.angular_components.text_area_while_speech": "Clique novamente no ícone para finalizar",
|
|
23121
|
-
"platform.angular_components.text_area_end_speech": "Gravação finalizada"
|
|
23219
|
+
"platform.angular_components.text_area_end_speech": "Gravação finalizada",
|
|
23220
|
+
"platform.angular_components.no_microphone_permission": "O acesso ao microfone está bloqueado. Ative a permissão nas configurações do navegador para continuar usando este recurso."
|
|
23122
23221
|
};
|
|
23123
23222
|
|
|
23124
23223
|
/**
|