tycho-components 0.23.1 → 0.23.2

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.
@@ -1,15 +1,9 @@
1
1
  declare function getActiveCorpus(): string | null;
2
2
  declare function setActiveCorpus(corpus: string): void;
3
3
  declare function removeActiveCorpus(): void;
4
- declare function getTourAutoOpen(): boolean;
5
- declare function setTourAutoOpen(value: boolean): void;
6
- declare function removeTourAutoOpen(): void;
7
4
  declare const Storage: {
8
5
  getActiveCorpus: typeof getActiveCorpus;
9
6
  setActiveCorpus: typeof setActiveCorpus;
10
7
  removeActiveCorpus: typeof removeActiveCorpus;
11
- getTourAutoOpen: typeof getTourAutoOpen;
12
- setTourAutoOpen: typeof setTourAutoOpen;
13
- removeTourAutoOpen: typeof removeTourAutoOpen;
14
8
  };
15
9
  export default Storage;
@@ -1,5 +1,4 @@
1
1
  const ACTIVE_CORPUS = '@Tycho:corpus';
2
- const TOUR_AUTO_OPEN = '@Tycho:tourAutoOpen';
3
2
  function getActiveCorpus() {
4
3
  return localStorage.getItem(ACTIVE_CORPUS);
5
4
  }
@@ -9,21 +8,9 @@ function setActiveCorpus(corpus) {
9
8
  function removeActiveCorpus() {
10
9
  localStorage.removeItem(ACTIVE_CORPUS);
11
10
  }
12
- function getTourAutoOpen() {
13
- return localStorage.getItem(TOUR_AUTO_OPEN) === 'true';
14
- }
15
- function setTourAutoOpen(value) {
16
- localStorage.setItem(TOUR_AUTO_OPEN, String(value));
17
- }
18
- function removeTourAutoOpen() {
19
- localStorage.removeItem(TOUR_AUTO_OPEN);
20
- }
21
11
  const Storage = {
22
12
  getActiveCorpus,
23
13
  setActiveCorpus,
24
14
  removeActiveCorpus,
25
- getTourAutoOpen,
26
- setTourAutoOpen,
27
- removeTourAutoOpen,
28
15
  };
29
16
  export default Storage;
@@ -4,6 +4,7 @@ export { default as CookieStorage } from './CookieStorage';
4
4
  export { commonResources, featureResources, mergeResources, commonLocalization, } from './Localization';
5
5
  export { default as LexiconListService } from './services/LexiconListService';
6
6
  export { default as ParserListService } from './services/ParserListService';
7
+ export { default as ProfileService } from './services/ProfileService';
7
8
  export type { Corpus, CorpusRequest, Github } from './types/Corpus';
8
9
  export { CorpusStatusNames } from './types/CorpusStatus';
9
10
  export type { CorpusStatus } from './types/CorpusStatus';
@@ -4,6 +4,7 @@ export { default as CookieStorage } from './CookieStorage';
4
4
  export { commonResources, featureResources, mergeResources, commonLocalization, } from './Localization';
5
5
  export { default as LexiconListService } from './services/LexiconListService';
6
6
  export { default as ParserListService } from './services/ParserListService';
7
+ export { default as ProfileService } from './services/ProfileService';
7
8
  export { CorpusStatusNames } from './types/CorpusStatus';
8
9
  export { DocumentStatusNames } from './types/Document';
9
10
  export { CorpusImageTypeNames } from './types/CorpusImage';
@@ -4,6 +4,7 @@ export declare const HelpTexts: {
4
4
  'title.tutorials': string;
5
5
  'title.tour': string;
6
6
  'title.autoOpen': string;
7
+ 'button.tour': string;
7
8
  'description.tutorials': string;
8
9
  'description.tour': string;
9
10
  'checkbox.autoOpen': string;
@@ -14,6 +15,7 @@ export declare const HelpTexts: {
14
15
  'title.tutorials': string;
15
16
  'title.tour': string;
16
17
  'title.autoOpen': string;
18
+ 'button.tour': string;
17
19
  'description.tutorials': string;
18
20
  'description.tour': string;
19
21
  'checkbox.autoOpen': string;
@@ -22,6 +24,7 @@ export declare const HelpTexts: {
22
24
  it: {
23
25
  'modal.title': string;
24
26
  'title.tutorials': string;
27
+ 'button.tour': string;
25
28
  'title.tour': string;
26
29
  'title.autoOpen': string;
27
30
  'description.tutorials': string;
@@ -4,6 +4,7 @@ export const HelpTexts = {
4
4
  'title.tutorials': 'Tutorials',
5
5
  'title.tour': 'Live Tour',
6
6
  'title.autoOpen': 'Enable Auto-Open',
7
+ 'button.tour': 'Start Live Tour',
7
8
  'description.tutorials': 'Access our comprehensive tutorials and documentation',
8
9
  'description.tour': 'Start an interactive tour of the platform or enable it to open automatically',
9
10
  'checkbox.autoOpen': 'Enable Auto-Open',
@@ -14,6 +15,7 @@ export const HelpTexts = {
14
15
  'title.tutorials': 'Tutoriais',
15
16
  'title.tour': 'Tour ao Vivo',
16
17
  'title.autoOpen': 'Ativar Abertura Automática',
18
+ 'button.tour': 'Iniciar Tour ao Vivo',
17
19
  'description.tutorials': 'Acesse nossos tutoriais abrangentes e documentação',
18
20
  'description.tour': 'Inicie um tour interativo da plataforma ou ative para abrir automaticamente',
19
21
  'checkbox.autoOpen': 'Ativar Abertura Automática',
@@ -22,6 +24,7 @@ export const HelpTexts = {
22
24
  it: {
23
25
  'modal.title': 'Centro Assistenza',
24
26
  'title.tutorials': 'Tutorial',
27
+ 'button.tour': 'Avvia Tour Interattivo',
25
28
  'title.tour': 'Tour Interattivo',
26
29
  'title.autoOpen': 'Abilita Apertura Automatica',
27
30
  'description.tutorials': 'Accedi ai nostri tutorial completi e alla documentazione',
@@ -0,0 +1,5 @@
1
+ declare function updateLiveTour(liveTour: boolean): Promise<import("axios").AxiosResponse<string, any, {}>>;
2
+ declare const ProfileService: {
3
+ updateLiveTour: typeof updateLiveTour;
4
+ };
5
+ export default ProfileService;
@@ -0,0 +1,8 @@
1
+ import api from '../api';
2
+ function updateLiveTour(liveTour) {
3
+ return api.patch(`${import.meta.env.VITE_APP_AUTH_API}/profile/live-tour`, { liveTour });
4
+ }
5
+ const ProfileService = {
6
+ updateLiveTour,
7
+ };
8
+ export default ProfileService;
@@ -2,7 +2,6 @@ import { useContext, useEffect, useRef, useState } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useLocation } from 'react-router-dom';
4
4
  import CommonContext from '../CommonContext';
5
- import Storage from '../Storage';
6
5
  import { useTourUtils } from '../useTourUtils';
7
6
  import { waitForSelector } from './anchorResolver';
8
7
  import { buildDriveSteps, createTourDriver, hasMatchingWorkflow, } from './driverTour';
@@ -52,13 +51,13 @@ export function useDriverTour(options) {
52
51
  if (!knowledgeBase || autoOpenTriggered.current)
53
52
  return;
54
53
  const matchPathnames = (optionsRef.current.getMatchPathnames ?? defaultMatchPathnames)(pathname);
55
- if (!Storage.getTourAutoOpen() ||
54
+ if (state.logged?.liveTour !== true ||
56
55
  !hasMatchingWorkflow(knowledgeBase, matchPathnames)) {
57
56
  return;
58
57
  }
59
58
  autoOpenTriggered.current = true;
60
59
  turnOn();
61
- }, [knowledgeBase, pathname, turnOn]);
60
+ }, [knowledgeBase, pathname, state.logged?.liveTour, turnOn]);
62
61
  useEffect(() => {
63
62
  if (!state.tour || !knowledgeBase)
64
63
  return;
@@ -19,4 +19,5 @@ export type User = {
19
19
  status: UserStatus;
20
20
  permissions: string[];
21
21
  login?: string;
22
+ liveTour?: boolean;
22
23
  };
@@ -6,8 +6,8 @@ export var UserStatus;
6
6
  UserStatus["VISITOR"] = "VISITOR";
7
7
  })(UserStatus || (UserStatus = {}));
8
8
  export const UserStatusNames = {
9
- ACTIVE: "user.status.active",
10
- INACTIVE: "user.status.inactive",
11
- SUPER: "user.status.super",
12
- VISITOR: "user.status.visitor",
9
+ ACTIVE: 'user.status.active',
10
+ INACTIVE: 'user.status.inactive',
11
+ SUPER: 'user.status.super',
12
+ VISITOR: 'user.status.visitor',
13
13
  };
@@ -1,74 +1,74 @@
1
1
  export declare const ExportTexts: {
2
2
  en: {
3
- 'export.label.title': string;
4
- 'export.label.tycho': string;
5
- 'export.desc.tycho': string;
6
- 'export.label.psd': string;
7
- 'export.desc.psd': string;
8
- 'export.label.pos': string;
9
- 'export.desc.pos': string;
10
- 'export.label.csv': string;
11
- 'export.desc.csv': string;
12
- 'export.label.text': string;
13
- 'export.desc.text': string;
14
- 'modal.title.txt.tier': string;
15
- 'modal.desc.txt.tier': string;
16
- 'modal.txt.tier.diplomatic': string;
17
- 'modal.txt.tier.semiDiplomatic': string;
18
- 'modal.txt.tier.modernized': string;
19
- 'export.label.chat': string;
20
- 'export.desc.chat': string;
21
- 'export.label.conllu': string;
22
- 'export.desc.conllu': string;
23
- 'modal.title.invalid.sentences': string;
24
- 'modal.desc.invalid.sentences': string;
3
+ "export.label.title": string;
4
+ "export.label.tycho": string;
5
+ "export.desc.tycho": string;
6
+ "export.label.psd": string;
7
+ "export.desc.psd": string;
8
+ "export.label.pos": string;
9
+ "export.desc.pos": string;
10
+ "export.label.csv": string;
11
+ "export.desc.csv": string;
12
+ "export.label.text": string;
13
+ "export.desc.text": string;
14
+ "modal.title.txt.tier": string;
15
+ "modal.desc.txt.tier": string;
16
+ "modal.txt.tier.diplomatic": string;
17
+ "modal.txt.tier.semiDiplomatic": string;
18
+ "modal.txt.tier.modernized": string;
19
+ "export.label.chat": string;
20
+ "export.desc.chat": string;
21
+ "export.label.conllu": string;
22
+ "export.desc.conllu": string;
23
+ "modal.title.invalid.sentences": string;
24
+ "modal.desc.invalid.sentences": string;
25
25
  };
26
- 'pt-BR': {
27
- 'export.label.title': string;
28
- 'export.label.tycho': string;
29
- 'export.desc.tycho': string;
30
- 'export.label.psd': string;
31
- 'export.desc.psd': string;
32
- 'export.label.pos': string;
33
- 'export.desc.pos': string;
34
- 'export.label.csv': string;
35
- 'export.desc.csv': string;
36
- 'export.label.text': string;
37
- 'export.desc.text': string;
38
- 'modal.title.txt.tier': string;
39
- 'modal.desc.txt.tier': string;
40
- 'modal.txt.tier.diplomatic': string;
41
- 'modal.txt.tier.semiDiplomatic': string;
42
- 'modal.txt.tier.modernized': string;
43
- 'export.label.chat': string;
44
- 'export.desc.chat': string;
45
- 'export.label.conllu': string;
46
- 'export.desc.conllu': string;
47
- 'modal.title.invalid.sentences': string;
48
- 'modal.desc.invalid.sentences': string;
26
+ "pt-BR": {
27
+ "export.label.title": string;
28
+ "export.label.tycho": string;
29
+ "export.desc.tycho": string;
30
+ "export.label.psd": string;
31
+ "export.desc.psd": string;
32
+ "export.label.pos": string;
33
+ "export.desc.pos": string;
34
+ "export.label.csv": string;
35
+ "export.desc.csv": string;
36
+ "export.label.text": string;
37
+ "export.desc.text": string;
38
+ "modal.title.txt.tier": string;
39
+ "modal.desc.txt.tier": string;
40
+ "modal.txt.tier.diplomatic": string;
41
+ "modal.txt.tier.semiDiplomatic": string;
42
+ "modal.txt.tier.modernized": string;
43
+ "export.label.chat": string;
44
+ "export.desc.chat": string;
45
+ "export.label.conllu": string;
46
+ "export.desc.conllu": string;
47
+ "modal.title.invalid.sentences": string;
48
+ "modal.desc.invalid.sentences": string;
49
49
  };
50
50
  it: {
51
- 'export.label.title': string;
52
- 'export.label.tycho': string;
53
- 'export.desc.tycho': string;
54
- 'export.label.psd': string;
55
- 'export.desc.psd': string;
56
- 'export.label.pos': string;
57
- 'export.desc.pos': string;
58
- 'export.label.csv': string;
59
- 'export.desc.csv': string;
60
- 'export.label.text': string;
61
- 'export.desc.text': string;
62
- 'modal.title.txt.tier': string;
63
- 'modal.desc.txt.tier': string;
64
- 'modal.txt.tier.diplomatic': string;
65
- 'modal.txt.tier.semiDiplomatic': string;
66
- 'modal.txt.tier.modernized': string;
67
- 'export.label.chat': string;
68
- 'export.desc.chat': string;
69
- 'export.label.conllu': string;
70
- 'export.desc.conllu': string;
71
- 'modal.title.invalid.sentences': string;
72
- 'modal.desc.invalid.sentences': string;
51
+ "export.label.title": string;
52
+ "export.label.tycho": string;
53
+ "export.desc.tycho": string;
54
+ "export.label.psd": string;
55
+ "export.desc.psd": string;
56
+ "export.label.pos": string;
57
+ "export.desc.pos": string;
58
+ "export.label.csv": string;
59
+ "export.desc.csv": string;
60
+ "export.label.text": string;
61
+ "export.desc.text": string;
62
+ "modal.title.txt.tier": string;
63
+ "modal.desc.txt.tier": string;
64
+ "modal.txt.tier.diplomatic": string;
65
+ "modal.txt.tier.semiDiplomatic": string;
66
+ "modal.txt.tier.modernized": string;
67
+ "export.label.chat": string;
68
+ "export.desc.chat": string;
69
+ "export.label.conllu": string;
70
+ "export.desc.conllu": string;
71
+ "modal.title.invalid.sentences": string;
72
+ "modal.desc.invalid.sentences": string;
73
73
  };
74
74
  };
@@ -1,74 +1,74 @@
1
1
  export const ExportTexts = {
2
2
  en: {
3
- 'export.label.title': 'Export',
4
- 'export.label.tycho': 'Tycho Platform',
5
- 'export.desc.tycho': 'Generates a json file containing all data related to this document.',
6
- 'export.label.psd': 'PSD',
7
- 'export.desc.psd': 'Generates a text file with parenthesized structured syntactic sentences.',
8
- 'export.label.pos': 'Part Of Speech (POS)',
9
- 'export.desc.pos': 'Generates a text file with sentences with slash separated values for words and POS tags.',
10
- 'export.label.csv': 'CSV',
11
- 'export.desc.csv': 'Generates a text file with comma separated values (CSV), ready to be imported to Microsoft Excel.',
12
- 'export.label.text': 'Text file',
13
- 'export.desc.text': 'Generates a plain text file with the document sentences at the chosen transcription layer.',
14
- 'modal.title.txt.tier': 'Choose export type',
15
- 'modal.desc.txt.tier': 'Select which transcription layer to use for the text export.',
16
- 'modal.txt.tier.diplomatic': 'Diplomatic',
17
- 'modal.txt.tier.semiDiplomatic': 'Semi-diplomatic',
18
- 'modal.txt.tier.modernized': 'Modernized',
19
- 'export.label.chat': 'CHAT file',
20
- 'export.desc.chat': 'CHAT file',
21
- 'export.label.conllu': 'CoNNL-U file',
22
- 'export.desc.conllu': 'Standardized format for annotating and representing linguistic data, particularly for dependency parsing.',
23
- 'modal.title.invalid.sentences': 'Exporting failed',
24
- 'modal.desc.invalid.sentences': 'Some sentences are invalid and cannot be exported. Please fix them before retrying.',
3
+ "export.label.title": "Export",
4
+ "export.label.tycho": "Tycho Platform",
5
+ "export.desc.tycho": "Generates a json file containing all data related to this document.",
6
+ "export.label.psd": "PSD",
7
+ "export.desc.psd": "Generates a text file with parenthesized structured syntactic sentences.",
8
+ "export.label.pos": "Part Of Speech (POS)",
9
+ "export.desc.pos": "Generates a text file with sentences with slash separated values for words and POS tags.",
10
+ "export.label.csv": "CSV",
11
+ "export.desc.csv": "Generates a text file with comma separated values (CSV), ready to be imported to Microsoft Excel.",
12
+ "export.label.text": "Text file",
13
+ "export.desc.text": "Generates a plain text file with the document sentences at the chosen transcription layer.",
14
+ "modal.title.txt.tier": "Choose export type",
15
+ "modal.desc.txt.tier": "Select which transcription layer to use for the text export.",
16
+ "modal.txt.tier.diplomatic": "Diplomatic",
17
+ "modal.txt.tier.semiDiplomatic": "Semi-diplomatic",
18
+ "modal.txt.tier.modernized": "Modernized",
19
+ "export.label.chat": "CHAT file",
20
+ "export.desc.chat": "CHAT file",
21
+ "export.label.conllu": "CoNNL-U file",
22
+ "export.desc.conllu": "Standardized format for annotating and representing linguistic data, particularly for dependency parsing.",
23
+ "modal.title.invalid.sentences": "Exporting failed",
24
+ "modal.desc.invalid.sentences": "Some sentences are invalid and cannot be exported. Please fix them before retrying.",
25
25
  },
26
- 'pt-BR': {
27
- 'export.label.title': 'Exportar',
28
- 'export.label.tycho': 'Plataforma Tycho',
29
- 'export.desc.tycho': 'Gera um arquivo json contendo todos os dados relacionados a este documento.',
30
- 'export.label.psd': 'PSD',
31
- 'export.desc.psd': 'Gera um arquivo de texto com frases sintáticas estruturadas entre parênteses.',
32
- 'export.label.pos': 'Parte do Discurso (POS)',
33
- 'export.desc.pos': 'Gera um arquivo de texto com sentenças contendo valores de palavras e tags de POS separados por barras.',
34
- 'export.label.csv': 'CSV',
35
- 'export.desc.csv': 'Gera um arquivo de texto com valores separados por vírgula (CSV), pronto para ser importado para o Microsoft Excel.',
36
- 'export.label.text': 'Arquivo de texto',
37
- 'export.desc.text': 'Gera um arquivo de texto simples com as sentenças do documento na camada de transcrição escolhida.',
38
- 'modal.title.txt.tier': 'Escolha o tipo de exportação',
39
- 'modal.desc.txt.tier': 'Selecione qual camada de transcrição usar na exportação de texto.',
40
- 'modal.txt.tier.diplomatic': 'Diplomática',
41
- 'modal.txt.tier.semiDiplomatic': 'Semidiplomática',
42
- 'modal.txt.tier.modernized': 'Modernizada',
43
- 'export.label.chat': 'Arquivo CHAT',
44
- 'export.desc.chat': 'Arquivo CHAT',
45
- 'export.label.conllu': 'Arquivo CoNNL-U',
46
- 'export.desc.conllu': 'Padrão para anotar e representar dados linguísticos, especialmente para análise de dependências.',
47
- 'modal.title.invalid.sentences': 'Falha na exportação',
48
- 'modal.desc.invalid.sentences': 'Algumas sentenças estão inválidas e não podem ser exportadas. Corrija-as antes de tentar novamente.',
26
+ "pt-BR": {
27
+ "export.label.title": "Exportar",
28
+ "export.label.tycho": "Plataforma Tycho",
29
+ "export.desc.tycho": "Gera um arquivo json contendo todos os dados relacionados a este documento.",
30
+ "export.label.psd": "PSD",
31
+ "export.desc.psd": "Gera um arquivo de texto com frases sintáticas estruturadas entre parênteses.",
32
+ "export.label.pos": "Parte do Discurso (POS)",
33
+ "export.desc.pos": "Gera um arquivo de texto com sentenças contendo valores de palavras e tags de POS separados por barras.",
34
+ "export.label.csv": "CSV",
35
+ "export.desc.csv": "Gera um arquivo de texto com valores separados por vírgula (CSV), pronto para ser importado para o Microsoft Excel.",
36
+ "export.label.text": "Arquivo de texto",
37
+ "export.desc.text": "Gera um arquivo de texto simples com as sentenças do documento na camada de transcrição escolhida.",
38
+ "modal.title.txt.tier": "Escolha o tipo de exportação",
39
+ "modal.desc.txt.tier": "Selecione qual camada de transcrição usar na exportação de texto.",
40
+ "modal.txt.tier.diplomatic": "Diplomática",
41
+ "modal.txt.tier.semiDiplomatic": "Semi-diplomática",
42
+ "modal.txt.tier.modernized": "Modernizada",
43
+ "export.label.chat": "Arquivo CHAT",
44
+ "export.desc.chat": "Arquivo CHAT",
45
+ "export.label.conllu": "Arquivo CoNNL-U",
46
+ "export.desc.conllu": "Padrão para anotar e representar dados linguísticos, especialmente para análise de dependências.",
47
+ "modal.title.invalid.sentences": "Falha na exportação",
48
+ "modal.desc.invalid.sentences": "Algumas sentenças estão inválidas e não podem ser exportadas. Corrija-as antes de tentar novamente.",
49
49
  },
50
50
  it: {
51
- 'export.label.title': 'Esporta',
52
- 'export.label.tycho': 'Piattaforma Tycho',
53
- 'export.desc.tycho': 'Genera un file json contenente tutti i dati relativi a questo documento.',
54
- 'export.label.psd': 'PSD',
55
- 'export.desc.psd': 'Genera un file di testo con frasi sintattiche strutturate tra parentesi.',
56
- 'export.label.pos': 'Parte del discorso (POS)',
57
- 'export.desc.pos': 'Genera un file di testo con frasi con valori di parole e tag POS separati da barre.',
58
- 'export.label.csv': 'CSV',
59
- 'export.desc.csv': 'Genera un file di testo con valori separati da virgola (CSV), pronto per essere importato in Microsoft Excel.',
60
- 'export.label.text': 'File di testo',
61
- 'export.desc.text': 'Genera un file di testo semplice con le frasi del documento al livello di trascrizione scelto.',
62
- 'modal.title.txt.tier': 'Scegli il tipo di esportazione',
63
- 'modal.desc.txt.tier': 'Seleziona quale livello di trascrizione usare per l\'esportazione del testo.',
64
- 'modal.txt.tier.diplomatic': 'Diplomatica',
65
- 'modal.txt.tier.semiDiplomatic': 'Semidiplomatica',
66
- 'modal.txt.tier.modernized': 'Modernizzata',
67
- 'export.label.chat': 'File CHAT',
68
- 'export.desc.chat': 'File CHAT',
69
- 'export.label.conllu': 'File CoNLL-U',
70
- 'export.desc.conllu': 'Formato standardizzato per annotare e rappresentare dati linguistici, in particolare per il parsing delle dipendenze.',
71
- 'modal.title.invalid.sentences': 'Esportazione non riuscita',
72
- 'modal.desc.invalid.sentences': 'Alcune frasi non sono valide e non possono essere esportate. Correggile prima di riprovare.',
51
+ "export.label.title": "Esporta",
52
+ "export.label.tycho": "Piattaforma Tycho",
53
+ "export.desc.tycho": "Genera un file json contenente tutti i dati relativi a questo documento.",
54
+ "export.label.psd": "PSD",
55
+ "export.desc.psd": "Genera un file di testo con frasi sintattiche strutturate tra parentesi.",
56
+ "export.label.pos": "Parte del discorso (POS)",
57
+ "export.desc.pos": "Genera un file di testo con frasi con valori di parole e tag POS separati da barre.",
58
+ "export.label.csv": "CSV",
59
+ "export.desc.csv": "Genera un file di testo con valori separati da virgola (CSV), pronto per essere importato in Microsoft Excel.",
60
+ "export.label.text": "File di testo",
61
+ "export.desc.text": "Genera un file di testo semplice con le frasi del documento al livello di trascrizione scelto.",
62
+ "modal.title.txt.tier": "Scegli il tipo di esportazione",
63
+ "modal.desc.txt.tier": "Seleziona quale livello di trascrizione usare per l'esportazione del testo.",
64
+ "modal.txt.tier.diplomatic": "Diplomatica",
65
+ "modal.txt.tier.semiDiplomatic": "Semidiplomatica",
66
+ "modal.txt.tier.modernized": "Modernizzata",
67
+ "export.label.chat": "File CHAT",
68
+ "export.desc.chat": "File CHAT",
69
+ "export.label.conllu": "File CoNLL-U",
70
+ "export.desc.conllu": "Formato standardizzato per annotare e rappresentare dati linguistici, in particolare per il parsing delle dipendenze.",
71
+ "modal.title.invalid.sentences": "Esportazione non riuscita",
72
+ "modal.desc.invalid.sentences": "Alcune frasi non sono valide e non possono essere esportate. Correggile prima di riprovare.",
73
73
  },
74
74
  };
@@ -1,19 +1,26 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
4
  import { Button } from 'tycho-storybook';
5
+ import { AppPicture } from '../../../common';
4
6
  import AppModal from '../../../common/AppModal/AppModal';
5
- import Storage from '../../../configs/Storage';
7
+ import CookieStorage from '../../../configs/CookieStorage';
8
+ import ProfileService from '../../../configs/services/ProfileService';
9
+ import { useLoggedUtils } from '../../../configs/useLoggedUtils';
6
10
  import { useTourUtils } from '../../../configs/useTourUtils';
11
+ import SecurityUtils from '../../../functions/SecurityUtils';
12
+ import liveTour from './live-tour.png';
7
13
  import './style.scss';
8
14
  export default function HelpModal({ onClose, helpActions = [] }) {
9
15
  const { t } = useTranslation('help');
10
16
  const { turnOn, turnOff, status } = useTourUtils();
17
+ const { getLogged, setLogged } = useLoggedUtils();
18
+ const [updatingLiveTour, setUpdatingLiveTour] = useState(false);
11
19
  const isTourActive = status();
12
- const isAutoOpenEnabled = Storage.getTourAutoOpen();
20
+ const isAutoOpenEnabled = getLogged()?.liveTour ?? false;
13
21
  const handleTutorials = () => {
14
22
  const origin = (import.meta.env.VITE_APP_ORIGIN ?? '').replace(/\/+$/, '');
15
23
  window.open(`${origin}/home/tutorials`, '_blank');
16
- onClose();
17
24
  };
18
25
  const handleTourToggle = () => {
19
26
  if (isTourActive) {
@@ -29,7 +36,27 @@ export default function HelpModal({ onClose, helpActions = [] }) {
29
36
  onClose();
30
37
  };
31
38
  const handleAutoOpenToggle = (event) => {
32
- Storage.setTourAutoOpen(event.target.checked);
39
+ const checked = event.target.checked;
40
+ setUpdatingLiveTour(true);
41
+ ProfileService.updateLiveTour(checked)
42
+ .then((response) => {
43
+ CookieStorage.setJwtToken(response.data);
44
+ setLogged(SecurityUtils.parseJwt(response.data));
45
+ })
46
+ .catch((error) => {
47
+ console.error(error);
48
+ })
49
+ .finally(() => {
50
+ setUpdatingLiveTour(false);
51
+ });
33
52
  };
34
- return (_jsxs(AppModal, { title: t('modal.title'), close: onClose, hideFooter: true, className: "help-modal", children: [_jsxs("div", { className: "item", children: [_jsx("div", { className: "title", children: t('title.tutorials') }), _jsx("div", { className: "desc", children: t('description.tutorials') }), _jsx(Button, { text: t('button.open', { title: t('title.tutorials') }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: handleTutorials })] }), _jsxs("div", { className: "item", children: [_jsx("div", { className: "title", children: t('title.tour') }), _jsx("div", { className: "desc", children: t('description.tour') }), _jsxs("label", { className: "help-checkbox-label", children: [_jsx("input", { type: "checkbox", checked: isAutoOpenEnabled, onChange: handleAutoOpenToggle, className: "help-checkbox" }), _jsx("span", { children: t('checkbox.autoOpen') })] }), _jsx(Button, { text: t('button.open', { title: t('title.tour') }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: handleTourToggle })] }), helpActions.map((item, idx) => (_jsxs("div", { className: "item", children: [_jsx("div", { className: "title", children: item.title }), _jsx("div", { className: "desc", children: item.desc }), _jsx(Button, { text: t('button.open', { title: item.title }), size: "small", mode: "outlined", icon: "keyboard_arrow_right", onClick: () => handleCustomAction(item) })] }, idx)))] }));
53
+ const actionItems = [
54
+ {
55
+ title: t('title.tutorials'),
56
+ desc: t('description.tutorials'),
57
+ action: handleTutorials,
58
+ },
59
+ ...helpActions,
60
+ ];
61
+ return (_jsxs(AppModal, { title: t('modal.title'), close: onClose, hideFooter: true, className: "help-modal", children: [_jsxs("div", { className: "live-tour", children: [_jsx(AppPicture, { src: liveTour }), _jsxs("div", { className: "tour-content", children: [_jsx("div", { className: "title", children: t('title.tour') }), _jsx("div", { className: "desc", children: t('description.tour') }), _jsxs("label", { className: "help-checkbox-label", children: [_jsx("input", { type: "checkbox", checked: isAutoOpenEnabled, onChange: handleAutoOpenToggle, disabled: updatingLiveTour, className: "help-checkbox" }), _jsx("span", { children: t('checkbox.autoOpen') })] }), _jsx(Button, { text: t('button.tour'), size: "small", icon: "keyboard_arrow_right", onClick: handleTourToggle })] })] }), _jsx("div", { className: "other-actions", children: actionItems.map((item, idx) => (_jsxs("div", { className: "item", children: [_jsx("div", { className: "title", children: item.title }), _jsx("div", { className: "desc", children: item.desc }), _jsx(Button, { text: t('button.open'), size: "x-small", mode: "outlined", icon: "keyboard_arrow_right", onClick: () => handleCustomAction(item) })] }, idx))) })] }));
35
62
  }
@@ -4,37 +4,36 @@
4
4
 
5
5
  .body {
6
6
  display: flex;
7
- flex-direction: row;
8
- flex-wrap: wrap;
7
+ flex-direction: column;
9
8
  gap: 16px;
10
- padding: var(--spacing-300) var(--spacing-200);
11
- max-height: 60vh;
12
- width: 60vw;
13
- overflow-y: auto;
14
9
 
15
- .item {
10
+ .live-tour {
16
11
  display: flex;
17
- flex-direction: column;
18
- flex: 0 0 calc(33.333% - 11px);
19
- min-height: 24vh;
20
12
  padding: 24px 24px 16px;
21
13
  border: 1px solid var(--border-subtle-2);
22
14
  border-radius: var(--radius-100);
15
+ background-color: #ebeff8;
16
+ gap: 48px;
23
17
 
24
- > .title {
25
- @include subtitle-small-2;
26
- color: var(--text-primary);
27
- margin-bottom: 4px;
28
- }
18
+ .tour-content {
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: 8px;
22
+ max-width: 50%;
23
+
24
+ > .title {
25
+ @include subtitle-medium-2;
26
+ }
29
27
 
30
- > .desc {
31
- @include body-medium-1;
32
- color: var(--text-secondary);
33
- margin-bottom: 8px;
28
+ > .desc {
29
+ @include body-medium-1;
30
+ color: var(--text-secondary);
31
+ }
34
32
  }
35
33
 
36
- > .ds-button {
37
- margin-top: auto;
34
+ .app-picture-container > img {
35
+ width: 240px;
36
+ height: 180px;
38
37
  }
39
38
 
40
39
  .help-checkbox-label {
@@ -51,5 +50,36 @@
51
50
  }
52
51
  }
53
52
  }
53
+
54
+ .other-actions {
55
+ display: grid;
56
+ grid-template-columns: repeat(3, minmax(0, 1fr));
57
+ gap: var(--spacing-200);
58
+
59
+ .item {
60
+ display: flex;
61
+ flex-direction: column;
62
+ min-width: 0;
63
+ padding: 24px 24px 16px;
64
+ border: 1px solid var(--border-subtle-2);
65
+ border-radius: var(--radius-100);
66
+
67
+ > .title {
68
+ @include subtitle-small-2;
69
+ color: var(--text-primary);
70
+ margin-bottom: 4px;
71
+ }
72
+
73
+ > .desc {
74
+ @include body-medium-1;
75
+ color: var(--text-secondary);
76
+ margin-bottom: 24px;
77
+ }
78
+
79
+ > .ds-button {
80
+ margin-top: auto;
81
+ }
82
+ }
83
+ }
54
84
  }
55
85
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.23.1",
4
+ "version": "0.23.2",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {