@fluxhub/fluxhub-lib 19.0.173 → 19.0.176
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.
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { ToastrService } from 'ngx-toastr';
|
|
4
|
+
import { DialogButton, DialogBeforeCloseEvent } from '../dialog-base/dialog-base.component';
|
|
5
|
+
import { FHComboboxComponent } from '../fh-combobox';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* fh_win_translate
|
|
9
|
+
* --------------------------------------------------------------------------
|
|
10
|
+
* Dialog FluxHub (basata su fh-dialog-base) per richiamare il Translation Server LLM.
|
|
11
|
+
*
|
|
12
|
+
* Il servizio espone:
|
|
13
|
+
* POST {endpoint}/translate body: { "text": "...", "dest_lang": "it" }
|
|
14
|
+
* -> { "success": true, "translation": "...", "source_lang": "en", "dest_lang": "it" }
|
|
15
|
+
*
|
|
16
|
+
* L'URL dell'endpoint NON è cablato: si passa dall'esterno tramite MAT_DIALOG_DATA.endpoint
|
|
17
|
+
* (può cambiare a seconda del deploy). Se non passato, usa DEFAULT_ENDPOINT come fallback.
|
|
18
|
+
*
|
|
19
|
+
* Parametri (MAT_DIALOG_DATA):
|
|
20
|
+
* endpoint string URL base del Translation Server (es. https://translate.fluxhub.com)
|
|
21
|
+
* text string testo iniziale da tradurre (opzionale)
|
|
22
|
+
* dest_lang string lingua destinazione iniziale: it|es|pt|el (default 'it')
|
|
23
|
+
* title string titolo del dialog (opzionale)
|
|
24
|
+
*
|
|
25
|
+
* Apertura:
|
|
26
|
+
* this.dialog.open(fh_win_translate, {
|
|
27
|
+
* width: '680px', maxWidth: '95vw', maxHeight: '90vh',
|
|
28
|
+
* data: { endpoint: 'https://translate.fluxhub.com', text: '...', dest_lang: 'it' }
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* Ritorno (alla chiusura): { text, dest_lang, translation } se una traduzione è stata
|
|
32
|
+
* eseguita, altrimenti null.
|
|
33
|
+
*/
|
|
34
|
+
export declare class fh_win_translate {
|
|
35
|
+
dialogRef: MatDialogRef<fh_win_translate>;
|
|
36
|
+
private http;
|
|
37
|
+
private toastr;
|
|
38
|
+
data: any;
|
|
39
|
+
static DEFAULT_ENDPOINT: string;
|
|
40
|
+
langCombo?: FHComboboxComponent;
|
|
41
|
+
title: string;
|
|
42
|
+
endpoint: string;
|
|
43
|
+
text: string;
|
|
44
|
+
dest_lang: string;
|
|
45
|
+
translation: string;
|
|
46
|
+
loading: boolean;
|
|
47
|
+
lang_values: string;
|
|
48
|
+
buttons: DialogButton[];
|
|
49
|
+
constructor(dialogRef: MatDialogRef<fh_win_translate>, http: HttpClient, toastr: ToastrService, data: any);
|
|
50
|
+
private updateButtons;
|
|
51
|
+
/** Costruisce l'URL completo dell'endpoint /translate gestendo lo slash finale */
|
|
52
|
+
private get translate_url();
|
|
53
|
+
onLangChange(): void;
|
|
54
|
+
do_translate(): void;
|
|
55
|
+
copy(): void;
|
|
56
|
+
onBeforeClose(event: DialogBeforeCloseEvent): void;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<fh_win_translate, never>;
|
|
58
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<fh_win_translate, "fh-win-translate", never, {}, {}, never, never, true, never>;
|
|
59
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export { FHWinAskRichTextComponent } from './lib/controls/fh-win-ask-richtext';
|
|
|
54
54
|
export { FHWinAskTextComponent } from './lib/controls/fh-win-ask-text';
|
|
55
55
|
export { FHWinAskBigTextComponent } from './lib/controls/fh-win-ask-textbig';
|
|
56
56
|
export { DialogBaseComponent, DialogButton, DialogBeforeCloseEvent } from './lib/controls/dialog-base/dialog-base.component';
|
|
57
|
+
export { fh_win_translate } from './lib/controls/translate/fh-win-translate';
|
|
57
58
|
export { FHWinAutoComplete } from './lib/controls/fh-win-auto-complete';
|
|
58
59
|
export { FHWinComboComponent } from './lib/controls/fh-win-combo-select';
|
|
59
60
|
export { FHWinListComponent } from './lib/controls/fh-win-list-pick';
|