@linagora/twake-mui 10.5.0 → 11.0.0
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/CHANGELOG.md +27 -0
- package/dist/components/ActionsMenu/Actions/call.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/call.js +16 -0
- package/dist/components/ActionsMenu/Actions/copyToClipboard.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/copyToClipboard.js +32 -0
- package/dist/components/ActionsMenu/Actions/divider.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/divider.js +7 -0
- package/dist/components/ActionsMenu/Actions/download.d.ts +15 -0
- package/dist/components/ActionsMenu/Actions/download.js +18 -0
- package/dist/components/ActionsMenu/Actions/editAttribute.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/editAttribute.js +12 -0
- package/dist/components/ActionsMenu/Actions/emailTo.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/emailTo.js +16 -0
- package/dist/components/ActionsMenu/Actions/exportToText.d.ts +6 -0
- package/dist/components/ActionsMenu/Actions/exportToText.js +28 -0
- package/dist/components/ActionsMenu/Actions/favorites.d.ts +12 -0
- package/dist/components/ActionsMenu/Actions/favorites.js +44 -0
- package/dist/components/ActionsMenu/Actions/helpers.d.ts +24 -0
- package/dist/components/ActionsMenu/Actions/helpers.js +128 -0
- package/dist/components/ActionsMenu/Actions/logger.d.ts +3 -0
- package/dist/components/ActionsMenu/Actions/logger.js +2 -0
- package/dist/components/ActionsMenu/Actions/makeAction.d.ts +11 -0
- package/dist/components/ActionsMenu/Actions/makeAction.js +19 -0
- package/dist/components/ActionsMenu/Actions/modify.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/modify.js +21 -0
- package/dist/components/ActionsMenu/Actions/others.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/others.js +11 -0
- package/dist/components/ActionsMenu/Actions/pdfHelpers.d.ts +35 -0
- package/dist/components/ActionsMenu/Actions/pdfHelpers.js +85 -0
- package/dist/components/ActionsMenu/Actions/print.d.ts +13 -0
- package/dist/components/ActionsMenu/Actions/print.js +42 -0
- package/dist/components/ActionsMenu/Actions/smsTo.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/smsTo.js +16 -0
- package/dist/components/ActionsMenu/Actions/viewInContacts.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/viewInContacts.js +21 -0
- package/dist/components/ActionsMenu/Actions/viewInDrive.d.ts +2 -0
- package/dist/components/ActionsMenu/Actions/viewInDrive.js +22 -0
- package/dist/components/ActionsMenu/ActionsItems.d.ts +17 -0
- package/dist/components/ActionsMenu/ActionsItems.js +27 -0
- package/dist/components/ActionsMenu/ActionsMenu.stories.d.ts +16 -0
- package/dist/components/ActionsMenu/ActionsMenu.stories.js +168 -0
- package/dist/components/ActionsMenu/ActionsMenuButton.d.ts +8 -0
- package/dist/components/ActionsMenu/ActionsMenuButton.js +18 -0
- package/dist/components/ActionsMenu/ActionsMenuItem.d.ts +16 -0
- package/dist/components/ActionsMenu/ActionsMenuItem.js +23 -0
- package/dist/components/ActionsMenu/ActionsMenuMobileHeader.d.ts +6 -0
- package/dist/components/ActionsMenu/ActionsMenuMobileHeader.js +15 -0
- package/dist/components/ActionsMenu/ActionsMenuWrapper.d.ts +11 -0
- package/dist/components/ActionsMenu/ActionsMenuWrapper.js +41 -0
- package/dist/components/ActionsMenu/helpers.d.ts +8 -0
- package/dist/components/ActionsMenu/helpers.js +21 -0
- package/dist/components/ActionsMenu/index.d.ts +21 -0
- package/dist/components/ActionsMenu/index.js +30 -0
- package/dist/components/ActionsMenu/locales/de.json +32 -0
- package/dist/components/ActionsMenu/locales/en.json +32 -0
- package/dist/components/ActionsMenu/locales/es.json +32 -0
- package/dist/components/ActionsMenu/locales/fr.json +32 -0
- package/dist/components/ActionsMenu/locales/index.d.ts +231 -0
- package/dist/components/ActionsMenu/locales/index.js +15 -0
- package/dist/components/ActionsMenu/locales/it.json +32 -0
- package/dist/components/ActionsMenu/locales/ru.json +32 -0
- package/dist/components/ActionsMenu/locales/vi.json +32 -0
- package/dist/components/ActionsMenu/types.d.ts +85 -0
- package/dist/components/ActionsMenu/types.js +1 -0
- package/dist/components/BottomSheet/index.js +5 -2
- package/dist/components/SpaceOverlay/SpaceOverlay.d.ts +1 -1
- package/dist/index.d.ts +40 -2
- package/dist/index.js +25 -1
- package/package.json +5 -1
- /package/dist/components/SpaceOverlay/{spaceOverlay.d.ts → connectSpaceOverlay.d.ts} +0 -0
- /package/dist/components/SpaceOverlay/{spaceOverlay.js → connectSpaceOverlay.js} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ActionsMenu": {
|
|
3
|
+
"menu": "Menu",
|
|
4
|
+
"viewInContacts": "View in Cozy Contacts",
|
|
5
|
+
"viewInDrive": "Open",
|
|
6
|
+
"modify": "Modify",
|
|
7
|
+
"emailTo": "Send an email",
|
|
8
|
+
"smsTo": "Send a message",
|
|
9
|
+
"print": "Print",
|
|
10
|
+
"download": "Download",
|
|
11
|
+
"favorites": {
|
|
12
|
+
"add": {
|
|
13
|
+
"label": "Add to favorites",
|
|
14
|
+
"success": "%{filename} has been added to favorites |||| These items have been added to favorites"
|
|
15
|
+
},
|
|
16
|
+
"remove": {
|
|
17
|
+
"label": "Remove from favorites",
|
|
18
|
+
"success": "%{filename} has been removed from favorites |||| These items have been removed from favorites"
|
|
19
|
+
},
|
|
20
|
+
"error": "An error occurred, please try again."
|
|
21
|
+
},
|
|
22
|
+
"others": "Others",
|
|
23
|
+
"editAttribute": "Edit attribute",
|
|
24
|
+
"copyToClipboard": {
|
|
25
|
+
"copy": "Copy",
|
|
26
|
+
"success": "Copied to clipboard",
|
|
27
|
+
"error": "Cannot copy to clipboard"
|
|
28
|
+
},
|
|
29
|
+
"call": "Call",
|
|
30
|
+
"exportToText": "Export as text"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ActionsMenu": {
|
|
3
|
+
"menu": "Menú",
|
|
4
|
+
"viewInContacts": "Ver en Cozy Contacts",
|
|
5
|
+
"viewInDrive": "Abrir",
|
|
6
|
+
"modify": "Modificar",
|
|
7
|
+
"emailTo": "Enviar un correo",
|
|
8
|
+
"smsTo": "Enviar un mensaje",
|
|
9
|
+
"print": "Imprimir",
|
|
10
|
+
"download": "Descargar",
|
|
11
|
+
"favorites": {
|
|
12
|
+
"add": {
|
|
13
|
+
"label": "Añadir a favoritos",
|
|
14
|
+
"success": "%{filename} se ha añadido a favoritos |||| Estos elementos se han añadido a favoritos"
|
|
15
|
+
},
|
|
16
|
+
"remove": {
|
|
17
|
+
"label": "Quitar de favoritos",
|
|
18
|
+
"success": "%{filename} se ha quitado de favoritos |||| Estos elementos se han quitado de favoritos"
|
|
19
|
+
},
|
|
20
|
+
"error": "Se ha producido un error. Inténtelo de nuevo."
|
|
21
|
+
},
|
|
22
|
+
"others": "Otros",
|
|
23
|
+
"editAttribute": "Editar atributo",
|
|
24
|
+
"copyToClipboard": {
|
|
25
|
+
"copy": "Copiar",
|
|
26
|
+
"success": "Copiado al portapapeles",
|
|
27
|
+
"error": "No se puede copiar al portapapeles"
|
|
28
|
+
},
|
|
29
|
+
"call": "Llamar",
|
|
30
|
+
"exportToText": "Exportar como texto"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ActionsMenu": {
|
|
3
|
+
"menu": "Menu",
|
|
4
|
+
"viewInContacts": "Voir dans Cozy Contacts",
|
|
5
|
+
"viewInDrive": "Ouvrir",
|
|
6
|
+
"modify": "Modifier",
|
|
7
|
+
"emailTo": "Envoyer un e-mail",
|
|
8
|
+
"smsTo": "Envoyer un message",
|
|
9
|
+
"print": "Imprimer",
|
|
10
|
+
"download": "Télécharger",
|
|
11
|
+
"favorites": {
|
|
12
|
+
"add": {
|
|
13
|
+
"label": "Ajouter aux favoris",
|
|
14
|
+
"success": "%{filename} a été ajouté aux favoris |||| Ces éléments ont été ajoutés aux favoris"
|
|
15
|
+
},
|
|
16
|
+
"remove": {
|
|
17
|
+
"label": "Retirer des favoris",
|
|
18
|
+
"success": "%{filename} a été retiré des favoris |||| Ces éléments ont été retirés des favoris"
|
|
19
|
+
},
|
|
20
|
+
"error": "Une erreur est survenue, merci de réessayer."
|
|
21
|
+
},
|
|
22
|
+
"others": "Autres",
|
|
23
|
+
"editAttribute": "Editer l'attribut",
|
|
24
|
+
"copyToClipboard": {
|
|
25
|
+
"copy": "Copier",
|
|
26
|
+
"success": "Copié dans le presse-papier",
|
|
27
|
+
"error": "Impossible de copier dans le presse-papier"
|
|
28
|
+
},
|
|
29
|
+
"call": "Appeler",
|
|
30
|
+
"exportToText": "Exporter en texte"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
export declare const locales: {
|
|
2
|
+
de: {
|
|
3
|
+
ActionsMenu: {
|
|
4
|
+
menu: string;
|
|
5
|
+
viewInContacts: string;
|
|
6
|
+
viewInDrive: string;
|
|
7
|
+
modify: string;
|
|
8
|
+
emailTo: string;
|
|
9
|
+
smsTo: string;
|
|
10
|
+
print: string;
|
|
11
|
+
download: string;
|
|
12
|
+
favorites: {
|
|
13
|
+
add: {
|
|
14
|
+
label: string;
|
|
15
|
+
success: string;
|
|
16
|
+
};
|
|
17
|
+
remove: {
|
|
18
|
+
label: string;
|
|
19
|
+
success: string;
|
|
20
|
+
};
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
23
|
+
others: string;
|
|
24
|
+
editAttribute: string;
|
|
25
|
+
copyToClipboard: {
|
|
26
|
+
copy: string;
|
|
27
|
+
success: string;
|
|
28
|
+
error: string;
|
|
29
|
+
};
|
|
30
|
+
call: string;
|
|
31
|
+
exportToText: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
en: {
|
|
35
|
+
ActionsMenu: {
|
|
36
|
+
menu: string;
|
|
37
|
+
viewInContacts: string;
|
|
38
|
+
viewInDrive: string;
|
|
39
|
+
modify: string;
|
|
40
|
+
emailTo: string;
|
|
41
|
+
smsTo: string;
|
|
42
|
+
print: string;
|
|
43
|
+
download: string;
|
|
44
|
+
favorites: {
|
|
45
|
+
add: {
|
|
46
|
+
label: string;
|
|
47
|
+
success: string;
|
|
48
|
+
};
|
|
49
|
+
remove: {
|
|
50
|
+
label: string;
|
|
51
|
+
success: string;
|
|
52
|
+
};
|
|
53
|
+
error: string;
|
|
54
|
+
};
|
|
55
|
+
others: string;
|
|
56
|
+
editAttribute: string;
|
|
57
|
+
copyToClipboard: {
|
|
58
|
+
copy: string;
|
|
59
|
+
success: string;
|
|
60
|
+
error: string;
|
|
61
|
+
};
|
|
62
|
+
call: string;
|
|
63
|
+
exportToText: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
es: {
|
|
67
|
+
ActionsMenu: {
|
|
68
|
+
menu: string;
|
|
69
|
+
viewInContacts: string;
|
|
70
|
+
viewInDrive: string;
|
|
71
|
+
modify: string;
|
|
72
|
+
emailTo: string;
|
|
73
|
+
smsTo: string;
|
|
74
|
+
print: string;
|
|
75
|
+
download: string;
|
|
76
|
+
favorites: {
|
|
77
|
+
add: {
|
|
78
|
+
label: string;
|
|
79
|
+
success: string;
|
|
80
|
+
};
|
|
81
|
+
remove: {
|
|
82
|
+
label: string;
|
|
83
|
+
success: string;
|
|
84
|
+
};
|
|
85
|
+
error: string;
|
|
86
|
+
};
|
|
87
|
+
others: string;
|
|
88
|
+
editAttribute: string;
|
|
89
|
+
copyToClipboard: {
|
|
90
|
+
copy: string;
|
|
91
|
+
success: string;
|
|
92
|
+
error: string;
|
|
93
|
+
};
|
|
94
|
+
call: string;
|
|
95
|
+
exportToText: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
fr: {
|
|
99
|
+
ActionsMenu: {
|
|
100
|
+
menu: string;
|
|
101
|
+
viewInContacts: string;
|
|
102
|
+
viewInDrive: string;
|
|
103
|
+
modify: string;
|
|
104
|
+
emailTo: string;
|
|
105
|
+
smsTo: string;
|
|
106
|
+
print: string;
|
|
107
|
+
download: string;
|
|
108
|
+
favorites: {
|
|
109
|
+
add: {
|
|
110
|
+
label: string;
|
|
111
|
+
success: string;
|
|
112
|
+
};
|
|
113
|
+
remove: {
|
|
114
|
+
label: string;
|
|
115
|
+
success: string;
|
|
116
|
+
};
|
|
117
|
+
error: string;
|
|
118
|
+
};
|
|
119
|
+
others: string;
|
|
120
|
+
editAttribute: string;
|
|
121
|
+
copyToClipboard: {
|
|
122
|
+
copy: string;
|
|
123
|
+
success: string;
|
|
124
|
+
error: string;
|
|
125
|
+
};
|
|
126
|
+
call: string;
|
|
127
|
+
exportToText: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
it: {
|
|
131
|
+
ActionsMenu: {
|
|
132
|
+
menu: string;
|
|
133
|
+
viewInContacts: string;
|
|
134
|
+
viewInDrive: string;
|
|
135
|
+
modify: string;
|
|
136
|
+
emailTo: string;
|
|
137
|
+
smsTo: string;
|
|
138
|
+
print: string;
|
|
139
|
+
download: string;
|
|
140
|
+
favorites: {
|
|
141
|
+
add: {
|
|
142
|
+
label: string;
|
|
143
|
+
success: string;
|
|
144
|
+
};
|
|
145
|
+
remove: {
|
|
146
|
+
label: string;
|
|
147
|
+
success: string;
|
|
148
|
+
};
|
|
149
|
+
error: string;
|
|
150
|
+
};
|
|
151
|
+
others: string;
|
|
152
|
+
editAttribute: string;
|
|
153
|
+
copyToClipboard: {
|
|
154
|
+
copy: string;
|
|
155
|
+
success: string;
|
|
156
|
+
error: string;
|
|
157
|
+
};
|
|
158
|
+
call: string;
|
|
159
|
+
exportToText: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
ru: {
|
|
163
|
+
ActionsMenu: {
|
|
164
|
+
menu: string;
|
|
165
|
+
viewInContacts: string;
|
|
166
|
+
viewInDrive: string;
|
|
167
|
+
modify: string;
|
|
168
|
+
emailTo: string;
|
|
169
|
+
smsTo: string;
|
|
170
|
+
print: string;
|
|
171
|
+
download: string;
|
|
172
|
+
favorites: {
|
|
173
|
+
add: {
|
|
174
|
+
label: string;
|
|
175
|
+
success: string;
|
|
176
|
+
};
|
|
177
|
+
remove: {
|
|
178
|
+
label: string;
|
|
179
|
+
success: string;
|
|
180
|
+
};
|
|
181
|
+
error: string;
|
|
182
|
+
};
|
|
183
|
+
others: string;
|
|
184
|
+
editAttribute: string;
|
|
185
|
+
copyToClipboard: {
|
|
186
|
+
copy: string;
|
|
187
|
+
success: string;
|
|
188
|
+
error: string;
|
|
189
|
+
};
|
|
190
|
+
call: string;
|
|
191
|
+
exportToText: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
vi: {
|
|
195
|
+
ActionsMenu: {
|
|
196
|
+
menu: string;
|
|
197
|
+
viewInContacts: string;
|
|
198
|
+
viewInDrive: string;
|
|
199
|
+
modify: string;
|
|
200
|
+
emailTo: string;
|
|
201
|
+
smsTo: string;
|
|
202
|
+
print: string;
|
|
203
|
+
download: string;
|
|
204
|
+
favorites: {
|
|
205
|
+
add: {
|
|
206
|
+
label: string;
|
|
207
|
+
success: string;
|
|
208
|
+
};
|
|
209
|
+
remove: {
|
|
210
|
+
label: string;
|
|
211
|
+
success: string;
|
|
212
|
+
};
|
|
213
|
+
error: string;
|
|
214
|
+
};
|
|
215
|
+
others: string;
|
|
216
|
+
editAttribute: string;
|
|
217
|
+
copyToClipboard: {
|
|
218
|
+
copy: string;
|
|
219
|
+
success: string;
|
|
220
|
+
error: string;
|
|
221
|
+
};
|
|
222
|
+
call: string;
|
|
223
|
+
exportToText: string;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
export type ActionTranslate = (key: string, options?: Record<string, unknown>) => string;
|
|
228
|
+
/** Translates outside React, since actions are built before being rendered */
|
|
229
|
+
export declare const getActionsI18n: () => {
|
|
230
|
+
t: ActionTranslate;
|
|
231
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getI18n } from 'twake-i18n';
|
|
2
|
+
import de from './de.json';
|
|
3
|
+
import en from './en.json';
|
|
4
|
+
import es from './es.json';
|
|
5
|
+
import fr from './fr.json';
|
|
6
|
+
import it from './it.json';
|
|
7
|
+
import ru from './ru.json';
|
|
8
|
+
import vi from './vi.json';
|
|
9
|
+
export const locales = { de, en, es, fr, it, ru, vi };
|
|
10
|
+
const isLang = (lang) => lang in locales;
|
|
11
|
+
/** Translates outside React, since actions are built before being rendered */
|
|
12
|
+
export const getActionsI18n = () => {
|
|
13
|
+
const i18n = getI18n(undefined, (lang) => (isLang(lang) ? locales[lang] : locales.en), undefined);
|
|
14
|
+
return { t: i18n.t };
|
|
15
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ActionsMenu": {
|
|
3
|
+
"menu": "Menu",
|
|
4
|
+
"viewInContacts": "Visualizza in Cozy Contacts",
|
|
5
|
+
"viewInDrive": "Apri",
|
|
6
|
+
"modify": "Modifica",
|
|
7
|
+
"emailTo": "Invia un'email",
|
|
8
|
+
"smsTo": "Invia un messaggio",
|
|
9
|
+
"print": "Stampa",
|
|
10
|
+
"download": "Scarica",
|
|
11
|
+
"favorites": {
|
|
12
|
+
"add": {
|
|
13
|
+
"label": "Aggiungi ai preferiti",
|
|
14
|
+
"success": "%{filename} è stato aggiunto ai preferiti |||| Questi elementi sono stati aggiunti ai preferiti"
|
|
15
|
+
},
|
|
16
|
+
"remove": {
|
|
17
|
+
"label": "Rimuovi dai preferiti",
|
|
18
|
+
"success": "%{filename} è stato rimosso dai preferiti |||| Questi elementi sono stati rimossi dai preferiti"
|
|
19
|
+
},
|
|
20
|
+
"error": "Si è verificato un errore, riprova."
|
|
21
|
+
},
|
|
22
|
+
"others": "Altro",
|
|
23
|
+
"editAttribute": "Modifica attributo",
|
|
24
|
+
"copyToClipboard": {
|
|
25
|
+
"copy": "Copia",
|
|
26
|
+
"success": "Copiato negli appunti",
|
|
27
|
+
"error": "Impossibile copiare negli appunti"
|
|
28
|
+
},
|
|
29
|
+
"call": "Chiama",
|
|
30
|
+
"exportToText": "Esporta come testo"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ActionsMenu": {
|
|
3
|
+
"menu": "Меню",
|
|
4
|
+
"viewInContacts": "Просмотреть в Cozy Контакты",
|
|
5
|
+
"viewInDrive": "Открыть",
|
|
6
|
+
"modify": "Изменить",
|
|
7
|
+
"emailTo": "Отправить email",
|
|
8
|
+
"smsTo": "Отправить сообщение",
|
|
9
|
+
"print": "Печать",
|
|
10
|
+
"download": "Скачать",
|
|
11
|
+
"favorites": {
|
|
12
|
+
"add": {
|
|
13
|
+
"label": "Добавить в избранное",
|
|
14
|
+
"success": "%{filename} был добавлен в избранное |||| Эти элементы были добавлены в избранное"
|
|
15
|
+
},
|
|
16
|
+
"remove": {
|
|
17
|
+
"label": "Удалить из избранного",
|
|
18
|
+
"success": "%{filename} был удален из избранного |||| Эти элементы были удалены из избранного"
|
|
19
|
+
},
|
|
20
|
+
"error": "Произошла ошибка, попробуйте еще раз."
|
|
21
|
+
},
|
|
22
|
+
"others": "Прочее",
|
|
23
|
+
"editAttribute": "Редактировать атрибут",
|
|
24
|
+
"copyToClipboard": {
|
|
25
|
+
"copy": "Копировать",
|
|
26
|
+
"success": "Скопировано в буфер обмена",
|
|
27
|
+
"error": "Не удается скопировать в буфер обмена"
|
|
28
|
+
},
|
|
29
|
+
"call": "Звонить",
|
|
30
|
+
"exportToText": "Экспортировать как текст"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ActionsMenu": {
|
|
3
|
+
"menu": "Menu",
|
|
4
|
+
"viewInContacts": "Xem trong Cozy Contacts",
|
|
5
|
+
"viewInDrive": "Mở",
|
|
6
|
+
"modify": "Chỉnh sửa",
|
|
7
|
+
"emailTo": "Gửi email",
|
|
8
|
+
"smsTo": "Gửi tin nhắn",
|
|
9
|
+
"print": "In",
|
|
10
|
+
"download": "Tải xuống",
|
|
11
|
+
"favorites": {
|
|
12
|
+
"add": {
|
|
13
|
+
"label": "Thêm vào yêu thích",
|
|
14
|
+
"success": "%{filename} đã được thêm vào yêu thích |||| Các mục này đã được thêm vào yêu thích"
|
|
15
|
+
},
|
|
16
|
+
"remove": {
|
|
17
|
+
"label": "Xóa khỏi yêu thích",
|
|
18
|
+
"success": "%{filename} đã được xóa khỏi yêu thích |||| Các mục này đã được xóa khỏi yêu thích"
|
|
19
|
+
},
|
|
20
|
+
"error": "Có lỗi xảy ra, vui lòng thử lại."
|
|
21
|
+
},
|
|
22
|
+
"others": "Khác",
|
|
23
|
+
"editAttribute": "Chỉnh sửa thuộc tính",
|
|
24
|
+
"copyToClipboard": {
|
|
25
|
+
"copy": "Sao chép",
|
|
26
|
+
"success": "Đã sao chép vào clipboard",
|
|
27
|
+
"error": "Không thể sao chép vào clipboard"
|
|
28
|
+
},
|
|
29
|
+
"call": "Gọi",
|
|
30
|
+
"exportToText": "Xuất dưới dạng văn bản"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { IconProps } from '@linagora/twake-icons';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { WebviewService } from 'cozy-intent';
|
|
4
|
+
import { ListItemSize } from '../ListItem';
|
|
5
|
+
import { ActionTranslate } from './locales';
|
|
6
|
+
export type { ActionTranslate };
|
|
7
|
+
export interface ActionDocument {
|
|
8
|
+
_id: string;
|
|
9
|
+
_type?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
dir_id?: string;
|
|
12
|
+
driveId?: string;
|
|
13
|
+
phone?: {
|
|
14
|
+
number?: string;
|
|
15
|
+
}[];
|
|
16
|
+
email?: {
|
|
17
|
+
address?: string;
|
|
18
|
+
}[];
|
|
19
|
+
cozyMetadata?: {
|
|
20
|
+
favorite?: boolean;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface ActionCallbackOptions {
|
|
26
|
+
t: ActionTranslate;
|
|
27
|
+
/** Bridge to the native app, when the page runs inside it */
|
|
28
|
+
webviewIntent?: WebviewService;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface ActionComponentProps {
|
|
32
|
+
action: Action;
|
|
33
|
+
docs: ActionDocument[];
|
|
34
|
+
autoFocus?: boolean;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
onClick: (clickProps?: object) => void;
|
|
37
|
+
isListItem?: boolean;
|
|
38
|
+
size?: ListItemSize;
|
|
39
|
+
}
|
|
40
|
+
export type ActionComponent = React.ComponentType<ActionComponentProps & React.RefAttributes<HTMLElement>>;
|
|
41
|
+
export interface ActionComponentSlotProps {
|
|
42
|
+
Icon?: Partial<IconProps>;
|
|
43
|
+
ListItemText?: object;
|
|
44
|
+
}
|
|
45
|
+
export interface Action<Options extends object = ActionCallbackOptions> {
|
|
46
|
+
name: string;
|
|
47
|
+
icon?: IconProps['icon'];
|
|
48
|
+
label?: string;
|
|
49
|
+
/** Greys the action out, while still displaying it */
|
|
50
|
+
disabled?: (docs: ActionDocument[]) => boolean;
|
|
51
|
+
displayCondition?: (docs: ActionDocument[]) => boolean;
|
|
52
|
+
componentProps?: ActionComponentSlotProps;
|
|
53
|
+
Component: ActionComponent;
|
|
54
|
+
/** Method syntax keeps each action free to narrow its own options */
|
|
55
|
+
action?(docs: ActionDocument[], options: Options): unknown;
|
|
56
|
+
}
|
|
57
|
+
/** An action keyed by its name, as built by `makeActions` */
|
|
58
|
+
export type ActionObject = Record<string, Action>;
|
|
59
|
+
export type ActionFactory<FactoryOptions extends object = object> = (options: FactoryOptions) => Action;
|
|
60
|
+
export interface ShowAlertOptions {
|
|
61
|
+
message: string;
|
|
62
|
+
severity: 'success' | 'error' | 'info' | 'warning';
|
|
63
|
+
variant?: 'filled' | 'outlined' | 'standard';
|
|
64
|
+
}
|
|
65
|
+
export type ShowAlert = (options: ShowAlertOptions) => void;
|
|
66
|
+
export interface WebLinkOptions {
|
|
67
|
+
slug: string;
|
|
68
|
+
cozyUrl: string;
|
|
69
|
+
subDomainType: string;
|
|
70
|
+
pathname: string;
|
|
71
|
+
hash: string;
|
|
72
|
+
}
|
|
73
|
+
export type GenerateWebLink = (options: WebLinkOptions) => string;
|
|
74
|
+
export interface WebLinkClient {
|
|
75
|
+
getStackClient: () => {
|
|
76
|
+
uri: string;
|
|
77
|
+
};
|
|
78
|
+
getInstanceOptions: () => {
|
|
79
|
+
subdomain: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export interface WebLinkActionOptions {
|
|
83
|
+
client: WebLinkClient;
|
|
84
|
+
generateWebLink: GenerateWebLink;
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Backdrop, Portal } from '@mui/material';
|
|
2
2
|
import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { useMutationObserver, useTimeoutWhen } from 'rooks';
|
|
3
|
+
import { useMutationObserver, useTimeoutWhen, useWindowSize } from 'rooks';
|
|
4
4
|
import { ANIMATION_DURATION, computeBottomSpacer, computeMaxHeight, computeMediumHeight, computeMinHeight, getCssValue, makeOverriddenChildren, minimizeAndClose, setBottomPosition, setTopPosition } from './helpers';
|
|
5
5
|
import { BORDER_RADIUS, BottomSheetBounceSafer, BottomSheetContainer, BottomSheetHandleBar, BottomSheetIndicator, BottomSheetOffsetSafer, BottomSheetRenderSafer, BottomSheetRenderSaferFill, BottomSheetRoot, BottomSheetSpacer, BottomSheetStack } from './styles';
|
|
6
6
|
/** Shared default, so that effects depending on it do not run on every render */
|
|
@@ -26,6 +26,8 @@ const BottomSheetContent = memo(function BottomSheetContent({ toolbarProps = NO_
|
|
|
26
26
|
const [initPos, setInitPos] = useState(0);
|
|
27
27
|
const prevInitPos = useRef(0);
|
|
28
28
|
const [forceRender, setForceRender] = useState(0);
|
|
29
|
+
// Stops are positions from the window top, so they follow its height (rotation, browser bars)
|
|
30
|
+
const { innerHeight } = useWindowSize();
|
|
29
31
|
const hasToolbarProps = Object.keys(toolbarProps).length > 0;
|
|
30
32
|
const isClosable = !!onClose || backdrop;
|
|
31
33
|
const renderSaferHeight = initPos < prevInitPos.current ? prevInitPos.current - BORDER_RADIUS : 0;
|
|
@@ -133,7 +135,8 @@ const BottomSheetContent = memo(function BottomSheetContent({ toolbarProps = NO_
|
|
|
133
135
|
backdrop,
|
|
134
136
|
isClosable,
|
|
135
137
|
offset,
|
|
136
|
-
forceRender
|
|
138
|
+
forceRender,
|
|
139
|
+
innerHeight
|
|
137
140
|
]);
|
|
138
141
|
const content = (React.createElement(React.Fragment, null,
|
|
139
142
|
showBackdrop && React.createElement(Backdrop, { open: true, onClick: handleBackdropClick }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ThemeOptions } from '@mui/material/styles';
|
|
2
2
|
import { type FC, type ReactNode } from 'react';
|
|
3
|
-
import type { SpaceOverlay } from './
|
|
3
|
+
import type { SpaceOverlay } from './connectSpaceOverlay';
|
|
4
4
|
export interface SpaceOverlayProviderProps {
|
|
5
5
|
/** From `connectSpaceOverlay`, null outside TwakeSpace */
|
|
6
6
|
overlay: SpaceOverlay | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,30 @@ export { makePalette } from './lib/makePalette';
|
|
|
6
6
|
export { theme } from './lib/theme';
|
|
7
7
|
export { radius } from './lib/radius';
|
|
8
8
|
export { TwakeMuiThemeProvider } from './components/ThemeProvider';
|
|
9
|
+
export { default as ActionsMenu } from './components/ActionsMenu';
|
|
10
|
+
export { default as ActionsMenuWrapper } from './components/ActionsMenu/ActionsMenuWrapper';
|
|
11
|
+
export { default as ActionsMenuItem } from './components/ActionsMenu/ActionsMenuItem';
|
|
12
|
+
export { default as ActionsMenuMobileHeader } from './components/ActionsMenu/ActionsMenuMobileHeader';
|
|
13
|
+
export { default as ActionsMenuButton } from './components/ActionsMenu/ActionsMenuButton';
|
|
14
|
+
export { default as ActionsItems } from './components/ActionsMenu/ActionsItems';
|
|
15
|
+
export { getActionName, getOnlyNeededActions } from './components/ActionsMenu/helpers';
|
|
16
|
+
export { makeActions, makeAppWebLink, makeBase64FromFile, fileToArrayBuffer, addFileToPdf, makePdfBlob, downloadBlob } from './components/ActionsMenu/Actions/helpers';
|
|
17
|
+
export { wrapTextToLines, pushNewPageIfNeeded, drawWrappedText, makePdfBlobFromText } from './components/ActionsMenu/Actions/pdfHelpers';
|
|
18
|
+
export { makeAction, makeActionComponent } from './components/ActionsMenu/Actions/makeAction';
|
|
19
|
+
export { divider } from './components/ActionsMenu/Actions/divider';
|
|
20
|
+
export { modify } from './components/ActionsMenu/Actions/modify';
|
|
21
|
+
export { smsTo } from './components/ActionsMenu/Actions/smsTo';
|
|
22
|
+
export { call } from './components/ActionsMenu/Actions/call';
|
|
23
|
+
export { emailTo } from './components/ActionsMenu/Actions/emailTo';
|
|
24
|
+
export { print } from './components/ActionsMenu/Actions/print';
|
|
25
|
+
export { download } from './components/ActionsMenu/Actions/download';
|
|
26
|
+
export { addToFavorites, removeFromFavorites } from './components/ActionsMenu/Actions/favorites';
|
|
27
|
+
export { viewInContacts } from './components/ActionsMenu/Actions/viewInContacts';
|
|
28
|
+
export { viewInDrive } from './components/ActionsMenu/Actions/viewInDrive';
|
|
29
|
+
export { copyToClipboard } from './components/ActionsMenu/Actions/copyToClipboard';
|
|
30
|
+
export { editAttribute } from './components/ActionsMenu/Actions/editAttribute';
|
|
31
|
+
export { others } from './components/ActionsMenu/Actions/others';
|
|
32
|
+
export { exportToText } from './components/ActionsMenu/Actions/exportToText';
|
|
9
33
|
export { Avatar, default as AvatarDefault } from './components/Avatar';
|
|
10
34
|
export { Button, default as ButtonDefault } from './components/Button';
|
|
11
35
|
export { default as BottomSheet } from './components/BottomSheet';
|
|
@@ -45,12 +69,26 @@ export { default as AccordionExpandIcon } from './components/AccordionExpandIcon
|
|
|
45
69
|
export { default as VirtualizedTable } from './components/VirtualizedTable';
|
|
46
70
|
export { VirtuosoMockContext } from 'react-virtuoso';
|
|
47
71
|
export { useBreakpoints } from './hooks/useBreakpoints';
|
|
48
|
-
export { connectSpaceOverlay, computeOverlayRegion } from './components/SpaceOverlay/
|
|
72
|
+
export { connectSpaceOverlay, computeOverlayRegion } from './components/SpaceOverlay/connectSpaceOverlay';
|
|
49
73
|
export { OverlayPortal, SpaceOverlayProvider, overlayThemeOptions, useOverlayWindow } from './components/SpaceOverlay/SpaceOverlay';
|
|
50
74
|
export { overlayClipPath, overlayRegionMessage, parseOverlayRegion, parseOverlayRegionMessage } from './components/SpaceOverlay/region';
|
|
51
75
|
export { OverlayFrame } from './components/SpaceOverlay/OverlayFrame';
|
|
52
76
|
export type { TwakeTheme } from './lib/theme';
|
|
53
77
|
export type { PaletteJson } from './lib/types';
|
|
78
|
+
export type { ActionsMenuProps, ActionsMenuComponentsProps } from './components/ActionsMenu';
|
|
79
|
+
export type { ActionsMenuWrapperProps } from './components/ActionsMenu/ActionsMenuWrapper';
|
|
80
|
+
export type { ActionsMenuItemProps } from './components/ActionsMenu/ActionsMenuItem';
|
|
81
|
+
export type { ActionsMenuMobileHeaderProps } from './components/ActionsMenu/ActionsMenuMobileHeader';
|
|
82
|
+
export type { ActionsMenuButtonProps } from './components/ActionsMenu/ActionsMenuButton';
|
|
83
|
+
export type { ActionsItemsProps } from './components/ActionsMenu/ActionsItems';
|
|
84
|
+
export type { Action, ActionCallbackOptions, ActionComponent, ActionComponentProps, ActionComponentSlotProps, ActionDocument, ActionFactory, ActionObject, ActionTranslate, GenerateWebLink, ShowAlert, ShowAlertOptions, WebLinkActionOptions, WebLinkClient, WebLinkOptions } from './components/ActionsMenu/types';
|
|
85
|
+
export type { MakeActionComponentOptions, MakeActionOptions } from './components/ActionsMenu/Actions/makeAction';
|
|
86
|
+
export type { AppWebLinkOptions, FetchBlobFileById, MakePdfBlobOptions } from './components/ActionsMenu/Actions/helpers';
|
|
87
|
+
export type { WrapTextToLinesOptions, PdfCursor, PushNewPageIfNeededOptions, DrawWrappedTextOptions } from './components/ActionsMenu/Actions/pdfHelpers';
|
|
88
|
+
export type { FavoritesActionOptions } from './components/ActionsMenu/Actions/favorites';
|
|
89
|
+
export type { DownloadActionOptions, DownloadFileOptions } from './components/ActionsMenu/Actions/download';
|
|
90
|
+
export type { PrintActionOptions, PrintClient } from './components/ActionsMenu/Actions/print';
|
|
91
|
+
export type { ExportToTextActionOptions } from './components/ActionsMenu/Actions/exportToText';
|
|
54
92
|
export type { AvatarProps } from './components/Avatar';
|
|
55
93
|
export type { ButtonProps } from './components/Button';
|
|
56
94
|
export type { BottomSheetProps, BottomSheetSettings, BottomSheetToolbarProps } from './components/BottomSheet/types';
|
|
@@ -65,7 +103,7 @@ export type { ContactPopoverVideoActionProps } from './components/ContactPopover
|
|
|
65
103
|
export type { ContactPopoverCalendarActionProps } from './components/ContactPopover/ContactPopoverCalendarAction';
|
|
66
104
|
export type { ContactPopoverEmailActionProps } from './components/ContactPopover/ContactPopoverEmailAction';
|
|
67
105
|
export type { ChipProps } from './components/Chip';
|
|
68
|
-
export type { SpaceOverlay, SpaceOverlayStatus } from './components/SpaceOverlay/
|
|
106
|
+
export type { SpaceOverlay, SpaceOverlayStatus } from './components/SpaceOverlay/connectSpaceOverlay';
|
|
69
107
|
export type { SpaceOverlayProviderProps } from './components/SpaceOverlay/SpaceOverlay';
|
|
70
108
|
export type { OverlayBox, OverlayRegion } from './components/SpaceOverlay/region';
|
|
71
109
|
export type { OverlayFrameProps } from './components/SpaceOverlay/OverlayFrame';
|