cozy-ui 130.8.0 → 130.9.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 +16 -0
- package/package.json +1 -1
- package/react/Avatar/Readme.md +1 -0
- package/react/Avatar/index.jsx +9 -1
- package/react/CozyDialogs/SpecificDialogs/Readme.md +26 -0
- package/react/CozyDialogs/SpecificDialogs/ShortcutDialog.jsx +120 -0
- package/react/CozyDialogs/SpecificDialogs/helpers/shortcuts.js +61 -0
- package/react/CozyDialogs/SpecificDialogs/index.jsx +1 -0
- package/react/CozyDialogs/SpecificDialogs/locales/en.json +14 -0
- package/react/CozyDialogs/SpecificDialogs/locales/fr.json +14 -0
- package/react/CozyDialogs/SpecificDialogs/locales/ru.json +15 -1
- package/react/CozyDialogs/SpecificDialogs/locales/vi.json +15 -1
- package/react/CozyDialogs/index.jsx +2 -1
- package/react/providers/DemoProvider.jsx +6 -3
- package/transpiled/react/Avatar/index.js +30 -17
- package/transpiled/react/CozyDialogs/SpecificDialogs/ShortcutDialog.d.ts +2 -0
- package/transpiled/react/CozyDialogs/SpecificDialogs/ShortcutDialog.js +114 -0
- package/transpiled/react/CozyDialogs/SpecificDialogs/helpers/shortcuts.d.ts +13 -0
- package/transpiled/react/CozyDialogs/SpecificDialogs/helpers/shortcuts.js +83 -0
- package/transpiled/react/CozyDialogs/SpecificDialogs/index.d.ts +1 -0
- package/transpiled/react/CozyDialogs/SpecificDialogs/index.js +2 -1
- package/transpiled/react/CozyDialogs/SpecificDialogs/withSpecificDialogsLocales.js +56 -0
- package/transpiled/react/CozyDialogs/index.d.ts +1 -1
- package/transpiled/react/CozyDialogs/index.js +1 -1
- package/transpiled/react/providers/DemoProvider.js +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# [130.9.0](https://github.com/cozy/cozy-ui/compare/v130.8.1...v130.9.0) (2025-10-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add AlertProvider to DemoProvider ([1fea901](https://github.com/cozy/cozy-ui/commit/1fea901))
|
|
7
|
+
* Add ShortcutDialog ([8c501eb](https://github.com/cozy/cozy-ui/commit/8c501eb))
|
|
8
|
+
* Remove useless forwardRef ([7b5cf9b](https://github.com/cozy/cozy-ui/commit/7b5cf9b))
|
|
9
|
+
|
|
10
|
+
## [130.8.1](https://github.com/cozy/cozy-ui/compare/v130.8.0...v130.8.1) (2025-10-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **Avatar:** Now passing a `number` to `size` prop works correctly ([c8e79f2](https://github.com/cozy/cozy-ui/commit/c8e79f2))
|
|
16
|
+
|
|
1
17
|
# [130.8.0](https://github.com/cozy/cozy-ui/compare/v130.7.2...v130.8.0) (2025-10-14)
|
|
2
18
|
|
|
3
19
|
|
package/package.json
CHANGED
package/react/Avatar/Readme.md
CHANGED
|
@@ -85,6 +85,7 @@ const initialVariants = [{ disabled: false, border: false, innerBorder: false }]
|
|
|
85
85
|
<Avatar disabled={variant.disabled} border={variant.border} innerBorder={variant.innerBorder}>AB</Avatar>
|
|
86
86
|
<Avatar color="none" disabled={variant.disabled} border={variant.border} innerBorder={variant.innerBorder}>BC</Avatar>
|
|
87
87
|
<Avatar color="sunrise" disabled={variant.disabled} border={variant.border} innerBorder={variant.innerBorder}>CD</Avatar>
|
|
88
|
+
<Avatar color="sunrise" size={94} disabled={variant.disabled} border={variant.border} innerBorder={variant.innerBorder}>DE</Avatar>
|
|
88
89
|
</div>
|
|
89
90
|
</>
|
|
90
91
|
)}
|
package/react/Avatar/index.jsx
CHANGED
|
@@ -8,6 +8,11 @@ import { makeStyles } from '../styles'
|
|
|
8
8
|
import { capitalize } from '../utils/index'
|
|
9
9
|
|
|
10
10
|
const useStyles = makeStyles(theme => ({
|
|
11
|
+
root: {
|
|
12
|
+
width: ({ size }) => size,
|
|
13
|
+
height: ({ size }) => size,
|
|
14
|
+
fontSize: ({ size }) => size / 2
|
|
15
|
+
},
|
|
11
16
|
colorDefault: {
|
|
12
17
|
color: ({ color }) => (color ? theme.palette.primary.contrastText : ''),
|
|
13
18
|
background: ({ color }) => colorMapping[color]
|
|
@@ -24,9 +29,11 @@ const Avatar = ({
|
|
|
24
29
|
display,
|
|
25
30
|
...props
|
|
26
31
|
}) => {
|
|
32
|
+
const isCustomSize = typeof size === 'number'
|
|
27
33
|
const defaultColor =
|
|
28
34
|
typeof props.children === 'string' ? nameToColor(props.children) : undefined
|
|
29
35
|
const classes = useStyles({
|
|
36
|
+
size: isCustomSize ? size : undefined,
|
|
30
37
|
color:
|
|
31
38
|
color === 'none'
|
|
32
39
|
? undefined
|
|
@@ -38,7 +45,8 @@ const Avatar = ({
|
|
|
38
45
|
return (
|
|
39
46
|
<AvatarMui
|
|
40
47
|
classes={classes}
|
|
41
|
-
className={cx(className,
|
|
48
|
+
className={cx(className, {
|
|
49
|
+
[`size-${size}`]: !isCustomSize,
|
|
42
50
|
disabled: !!disabled,
|
|
43
51
|
border: !!border,
|
|
44
52
|
[`display${capitalize(display)}`]: display !== 'initial',
|
|
@@ -102,3 +102,29 @@ const onAuthentification = () => {
|
|
|
102
102
|
)}
|
|
103
103
|
</Variants>
|
|
104
104
|
```
|
|
105
|
+
|
|
106
|
+
### ShortcutDialog dialog
|
|
107
|
+
|
|
108
|
+
⚠️ Must be used within AlertProvider.
|
|
109
|
+
|
|
110
|
+
```jsx
|
|
111
|
+
import { useState } from 'react'
|
|
112
|
+
|
|
113
|
+
import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
|
|
114
|
+
import { ShortcutDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
115
|
+
import Buttons from 'cozy-ui/transpiled/react/Buttons'
|
|
116
|
+
|
|
117
|
+
const [open, setOpen] = useState(isTesting())
|
|
118
|
+
|
|
119
|
+
;
|
|
120
|
+
|
|
121
|
+
<DemoProvider>
|
|
122
|
+
{ open && (
|
|
123
|
+
<ShortcutDialog
|
|
124
|
+
onClose={() => { setOpen(false)}}
|
|
125
|
+
onSave={(...args) => { console.log('onSave called with args', args) }}
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
128
|
+
<Buttons onClick={() => { setOpen(true) }} label="Open ShortcutDialog" />
|
|
129
|
+
</DemoProvider>
|
|
130
|
+
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
checkAndSaveShortcut,
|
|
6
|
+
makeHumanReadableFileName
|
|
7
|
+
} from './helpers/shortcuts'
|
|
8
|
+
import withSpecificDialogsLocales from './withSpecificDialogsLocales'
|
|
9
|
+
import { ConfirmDialog } from '..'
|
|
10
|
+
import Button from '../../Buttons'
|
|
11
|
+
import Stack from '../../Stack'
|
|
12
|
+
import TextField from '../../TextField'
|
|
13
|
+
import { useAlert } from '../../providers/Alert'
|
|
14
|
+
import { useI18n } from '../../providers/I18n'
|
|
15
|
+
|
|
16
|
+
const ENTER_KEY = 13
|
|
17
|
+
|
|
18
|
+
const ShortcutDialog = ({ shortcut, onSave, onClose }) => {
|
|
19
|
+
const { t } = useI18n()
|
|
20
|
+
const { showAlert } = useAlert()
|
|
21
|
+
|
|
22
|
+
const initialName = makeHumanReadableFileName(shortcut?.name || '')
|
|
23
|
+
const initialUrl = shortcut?.url || ''
|
|
24
|
+
const isEditing = !!shortcut
|
|
25
|
+
|
|
26
|
+
const [fileName, setFilename] = useState(initialName)
|
|
27
|
+
const [url, setUrl] = useState(initialUrl)
|
|
28
|
+
|
|
29
|
+
const saveShortcut = () => {
|
|
30
|
+
checkAndSaveShortcut({
|
|
31
|
+
fileName,
|
|
32
|
+
url,
|
|
33
|
+
isEditing,
|
|
34
|
+
onSave,
|
|
35
|
+
onClose,
|
|
36
|
+
showAlert,
|
|
37
|
+
t
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const handleKeyDown = e => {
|
|
42
|
+
if (e.keyCode === ENTER_KEY) {
|
|
43
|
+
saveShortcut()
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ConfirmDialog
|
|
49
|
+
open={true}
|
|
50
|
+
title={
|
|
51
|
+
isEditing
|
|
52
|
+
? t('shortcut-dialog.edit-title')
|
|
53
|
+
: t('shortcut-dialog.create-title')
|
|
54
|
+
}
|
|
55
|
+
onClose={onClose}
|
|
56
|
+
content={
|
|
57
|
+
<Stack>
|
|
58
|
+
<div>
|
|
59
|
+
<TextField
|
|
60
|
+
label={t('shortcut-dialog.url')}
|
|
61
|
+
value={url}
|
|
62
|
+
id="shortcuturl"
|
|
63
|
+
variant="outlined"
|
|
64
|
+
onChange={e => setUrl(e.target.value)}
|
|
65
|
+
onKeyDown={e => handleKeyDown(e)}
|
|
66
|
+
autoComplete="off"
|
|
67
|
+
fullWidth
|
|
68
|
+
margin="normal"
|
|
69
|
+
autoFocus
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
<div>
|
|
73
|
+
<TextField
|
|
74
|
+
label={t('shortcut-dialog.filename')}
|
|
75
|
+
value={fileName}
|
|
76
|
+
id="shortcutfilename"
|
|
77
|
+
variant="outlined"
|
|
78
|
+
onChange={e => setFilename(e.target.value)}
|
|
79
|
+
onKeyDown={e => handleKeyDown(e)}
|
|
80
|
+
autoComplete="off"
|
|
81
|
+
fullWidth
|
|
82
|
+
margin="normal"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</Stack>
|
|
86
|
+
}
|
|
87
|
+
actions={
|
|
88
|
+
<>
|
|
89
|
+
<Button
|
|
90
|
+
variant="secondary"
|
|
91
|
+
onClick={onClose}
|
|
92
|
+
label={t('shortcut-dialog.cancel')}
|
|
93
|
+
/>
|
|
94
|
+
<Button
|
|
95
|
+
variant="primary"
|
|
96
|
+
label={
|
|
97
|
+
isEditing
|
|
98
|
+
? t('shortcut-dialog.edit')
|
|
99
|
+
: t('shortcut-dialog.create')
|
|
100
|
+
}
|
|
101
|
+
onClick={saveShortcut}
|
|
102
|
+
/>
|
|
103
|
+
</>
|
|
104
|
+
}
|
|
105
|
+
/>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
ShortcutDialog.propTypes = {
|
|
110
|
+
/** An io.cozy.files.shortcut object if we want to prefill fields */
|
|
111
|
+
shortcut: PropTypes.object,
|
|
112
|
+
/** A function called when clicking the save button with filename and url */
|
|
113
|
+
onSave: PropTypes.func,
|
|
114
|
+
/** A function called when clicking the close button */
|
|
115
|
+
onClose: PropTypes.func
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
ShortcutDialog.displayName = 'ShortcutDialog'
|
|
119
|
+
|
|
120
|
+
export default withSpecificDialogsLocales(ShortcutDialog)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export const isValidURL = url => {
|
|
2
|
+
try {
|
|
3
|
+
new URL(url)
|
|
4
|
+
return true
|
|
5
|
+
} catch (e) {
|
|
6
|
+
return false
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const makeValidUrl = str => {
|
|
11
|
+
if (isValidURL(str)) return str
|
|
12
|
+
else if (isValidURL(`https://${str}`)) return `https://${str}`
|
|
13
|
+
return false
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const makeValidFileName = fileName =>
|
|
17
|
+
fileName.endsWith('.url') ? fileName : fileName + '.url'
|
|
18
|
+
|
|
19
|
+
export const makeHumanReadableFileName = fileName =>
|
|
20
|
+
fileName.endsWith('.url') ? fileName.slice(0, -4) : fileName
|
|
21
|
+
|
|
22
|
+
export const checkAndSaveShortcut = async ({
|
|
23
|
+
fileName,
|
|
24
|
+
url,
|
|
25
|
+
isEditing,
|
|
26
|
+
onSave,
|
|
27
|
+
onClose,
|
|
28
|
+
showAlert,
|
|
29
|
+
t
|
|
30
|
+
}) => {
|
|
31
|
+
if (!fileName || !url) {
|
|
32
|
+
showAlert({ message: t('shortcut-dialog.needs-info'), severity: 'error' })
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const validFileName = makeValidFileName(fileName)
|
|
37
|
+
|
|
38
|
+
const validURL = makeValidUrl(url)
|
|
39
|
+
|
|
40
|
+
if (!validURL) {
|
|
41
|
+
showAlert({
|
|
42
|
+
message: t('shortcut-dialog.url-bad-format'),
|
|
43
|
+
severity: 'error'
|
|
44
|
+
})
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
onSave(validFileName, validURL)
|
|
49
|
+
|
|
50
|
+
showAlert({
|
|
51
|
+
message: isEditing
|
|
52
|
+
? t('shortcut-dialog.edited')
|
|
53
|
+
: t('shortcut-dialog.created'),
|
|
54
|
+
severity: 'success'
|
|
55
|
+
})
|
|
56
|
+
} catch {
|
|
57
|
+
showAlert({ message: t('shortcut-dialog.errored'), severity: 'error' })
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
onClose()
|
|
61
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as AllowLocationDialog } from './AllowLocationDialog'
|
|
2
2
|
export { default as InstallFlagshipAppDialog } from './InstallFlagshipAppDialog'
|
|
3
3
|
export { default as AuthentificationDialog } from './AuthentificationDialog'
|
|
4
|
+
export { default as ShortcutDialog } from './ShortcutDialog'
|
|
@@ -23,5 +23,19 @@
|
|
|
23
23
|
"invalid_password": "Incorrect password, try again.",
|
|
24
24
|
"server_error": "Something went wrong with the server. Please, reload the page."
|
|
25
25
|
}
|
|
26
|
+
},
|
|
27
|
+
"shortcut-dialog": {
|
|
28
|
+
"create-title": "Create a shortcut",
|
|
29
|
+
"edit-title": "Modify a shortcut",
|
|
30
|
+
"filename": "Shortcut name",
|
|
31
|
+
"url": "URL",
|
|
32
|
+
"cancel": "Cancel",
|
|
33
|
+
"create": "Create",
|
|
34
|
+
"edit": "Edit",
|
|
35
|
+
"created": "The shortcut has been created",
|
|
36
|
+
"edited": "The shortcut has been modified",
|
|
37
|
+
"errored": "An error occurred",
|
|
38
|
+
"needs-info": "A shortcut needs a name and a URL",
|
|
39
|
+
"url-bad-format": "The entered URL is not in the correct format"
|
|
26
40
|
}
|
|
27
41
|
}
|
|
@@ -23,5 +23,19 @@
|
|
|
23
23
|
"invalid_password": "Mot de passe incorrect, essayer à nouveau.",
|
|
24
24
|
"server_error": "Une erreur s'est produite. Merci de recharger la page."
|
|
25
25
|
}
|
|
26
|
+
},
|
|
27
|
+
"shortcut-dialog": {
|
|
28
|
+
"create-title": "Créer un raccourci",
|
|
29
|
+
"edit-title": "Modifier un raccourci",
|
|
30
|
+
"filename": "Nom du raccourci",
|
|
31
|
+
"url": "URL",
|
|
32
|
+
"cancel": "Annuler",
|
|
33
|
+
"create": "Créer",
|
|
34
|
+
"edit": "Modifier",
|
|
35
|
+
"created": "Le raccourci a été créé",
|
|
36
|
+
"edited": "Le raccourci a été modifié",
|
|
37
|
+
"errored": "Une erreur s'est produite",
|
|
38
|
+
"needs-info": "Un raccourci a besoin d'un nom et d'une URL",
|
|
39
|
+
"url-bad-format": "L'URL saisie n'est pas dans le bon format"
|
|
26
40
|
}
|
|
27
41
|
}
|
|
@@ -23,5 +23,19 @@
|
|
|
23
23
|
"invalid_password": "Неверный пароль, попробуйте еще раз.",
|
|
24
24
|
"server_error": "Что-то пошло не так с сервером. Пожалуйста, перезагрузите страницу."
|
|
25
25
|
}
|
|
26
|
+
},
|
|
27
|
+
"shortcut-dialog": {
|
|
28
|
+
"create-title": "Создать ярлык",
|
|
29
|
+
"edit-title": "Изменить ярлык",
|
|
30
|
+
"filename": "Имя ярлыка",
|
|
31
|
+
"url": "URL",
|
|
32
|
+
"cancel": "Отменить",
|
|
33
|
+
"create": "Создать",
|
|
34
|
+
"edit": "Изменить",
|
|
35
|
+
"created": "Ярлык был создан",
|
|
36
|
+
"edited": "Ярлык был изменен",
|
|
37
|
+
"errored": "Произошла ошибка",
|
|
38
|
+
"needs-info": "Для ярлыка нужны имя и URL",
|
|
39
|
+
"url-bad-format": "Введённый URL имеет неверный формат"
|
|
26
40
|
}
|
|
27
|
-
}
|
|
41
|
+
}
|
|
@@ -23,5 +23,19 @@
|
|
|
23
23
|
"invalid_password": "Mật khẩu không chính xác, hãy thử lại.",
|
|
24
24
|
"server_error": "Có lỗi xảy ra với máy chủ. Vui lòng tải lại trang."
|
|
25
25
|
}
|
|
26
|
+
},
|
|
27
|
+
"shortcut-dialog": {
|
|
28
|
+
"create-title": "Tạo lối tắt",
|
|
29
|
+
"edit-title": "Chỉnh sửa lối tắt",
|
|
30
|
+
"filename": "Tên lối tắt",
|
|
31
|
+
"url": "URL",
|
|
32
|
+
"cancel": "Hủy",
|
|
33
|
+
"create": "Tạo",
|
|
34
|
+
"edit": "Chỉnh sửa",
|
|
35
|
+
"created": "Lối tắt đã được tạo",
|
|
36
|
+
"edited": "Lối tắt đã được chỉnh sửa",
|
|
37
|
+
"errored": "Đã xảy ra lỗi",
|
|
38
|
+
"needs-info": "Lối tắt cần có tên và URL",
|
|
39
|
+
"url-bad-format": "URL đã nhập không đúng định dạng"
|
|
26
40
|
}
|
|
27
|
-
}
|
|
41
|
+
}
|
|
@@ -4,6 +4,7 @@ import { CozyProvider } from 'cozy-client'
|
|
|
4
4
|
|
|
5
5
|
import { BreakpointsProvider } from './Breakpoints'
|
|
6
6
|
import CozyTheme from './CozyTheme'
|
|
7
|
+
import AlertProvider from '../providers/Alert'
|
|
7
8
|
import I18n from '../providers/I18n'
|
|
8
9
|
|
|
9
10
|
const defaultClient = {
|
|
@@ -29,9 +30,11 @@ const DemoProvider = ({ client, variant, dictRequire, children }) => {
|
|
|
29
30
|
return (
|
|
30
31
|
<CozyProvider client={client || defaultClient}>
|
|
31
32
|
<BreakpointsProvider>
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
33
|
+
<AlertProvider>
|
|
34
|
+
<I18n lang={lang} dictRequire={_dictRequire}>
|
|
35
|
+
<CozyTheme variant={variant}>{children}</CozyTheme>
|
|
36
|
+
</I18n>
|
|
37
|
+
</AlertProvider>
|
|
35
38
|
</BreakpointsProvider>
|
|
36
39
|
</CozyProvider>
|
|
37
40
|
)
|
|
@@ -12,41 +12,54 @@ import { makeStyles } from "cozy-ui/transpiled/react/styles";
|
|
|
12
12
|
import { capitalize } from "cozy-ui/transpiled/react/utils/index";
|
|
13
13
|
var useStyles = makeStyles(function (theme) {
|
|
14
14
|
return {
|
|
15
|
+
root: {
|
|
16
|
+
width: function width(_ref) {
|
|
17
|
+
var size = _ref.size;
|
|
18
|
+
return size;
|
|
19
|
+
},
|
|
20
|
+
height: function height(_ref2) {
|
|
21
|
+
var size = _ref2.size;
|
|
22
|
+
return size;
|
|
23
|
+
},
|
|
24
|
+
fontSize: function fontSize(_ref3) {
|
|
25
|
+
var size = _ref3.size;
|
|
26
|
+
return size / 2;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
15
29
|
colorDefault: {
|
|
16
|
-
color: function color(
|
|
17
|
-
var _color =
|
|
30
|
+
color: function color(_ref4) {
|
|
31
|
+
var _color = _ref4.color;
|
|
18
32
|
return _color ? theme.palette.primary.contrastText : '';
|
|
19
33
|
},
|
|
20
|
-
background: function background(
|
|
21
|
-
var color =
|
|
34
|
+
background: function background(_ref5) {
|
|
35
|
+
var color = _ref5.color;
|
|
22
36
|
return colorMapping[color];
|
|
23
37
|
}
|
|
24
38
|
}
|
|
25
39
|
};
|
|
26
40
|
});
|
|
27
41
|
|
|
28
|
-
var Avatar = function Avatar(
|
|
42
|
+
var Avatar = function Avatar(_ref6) {
|
|
29
43
|
var _cx;
|
|
30
44
|
|
|
31
|
-
var className =
|
|
32
|
-
color =
|
|
33
|
-
size =
|
|
34
|
-
border =
|
|
35
|
-
innerBorder =
|
|
36
|
-
disabled =
|
|
37
|
-
display =
|
|
38
|
-
props = _objectWithoutProperties(
|
|
45
|
+
var className = _ref6.className,
|
|
46
|
+
color = _ref6.color,
|
|
47
|
+
size = _ref6.size,
|
|
48
|
+
border = _ref6.border,
|
|
49
|
+
innerBorder = _ref6.innerBorder,
|
|
50
|
+
disabled = _ref6.disabled,
|
|
51
|
+
display = _ref6.display,
|
|
52
|
+
props = _objectWithoutProperties(_ref6, _excluded);
|
|
39
53
|
|
|
54
|
+
var isCustomSize = typeof size === 'number';
|
|
40
55
|
var defaultColor = typeof props.children === 'string' ? nameToColor(props.children) : undefined;
|
|
41
56
|
var classes = useStyles({
|
|
57
|
+
size: isCustomSize ? size : undefined,
|
|
42
58
|
color: color === 'none' ? undefined : supportedColors.includes(color) ? color : defaultColor
|
|
43
59
|
});
|
|
44
60
|
return /*#__PURE__*/React.createElement(AvatarMui, _extends({
|
|
45
61
|
classes: classes,
|
|
46
|
-
className: cx(className, "size-".concat(size), (_cx
|
|
47
|
-
disabled: !!disabled,
|
|
48
|
-
border: !!border
|
|
49
|
-
}, _defineProperty(_cx, "display".concat(capitalize(display)), display !== 'initial'), _defineProperty(_cx, "innerBorder", !!innerBorder), _cx))
|
|
62
|
+
className: cx(className, (_cx = {}, _defineProperty(_cx, "size-".concat(size), !isCustomSize), _defineProperty(_cx, "disabled", !!disabled), _defineProperty(_cx, "border", !!border), _defineProperty(_cx, "display".concat(capitalize(display)), display !== 'initial'), _defineProperty(_cx, "innerBorder", !!innerBorder), _cx))
|
|
50
63
|
}, props));
|
|
51
64
|
};
|
|
52
65
|
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { checkAndSaveShortcut, makeHumanReadableFileName } from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/helpers/shortcuts";
|
|
5
|
+
import withSpecificDialogsLocales from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/withSpecificDialogsLocales";
|
|
6
|
+
import { ConfirmDialog } from "cozy-ui/transpiled/react/CozyDialogs";
|
|
7
|
+
import Button from "cozy-ui/transpiled/react/Buttons";
|
|
8
|
+
import Stack from "cozy-ui/transpiled/react/Stack";
|
|
9
|
+
import TextField from "cozy-ui/transpiled/react/TextField";
|
|
10
|
+
import { useAlert } from "cozy-ui/transpiled/react/providers/Alert";
|
|
11
|
+
import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
|
|
12
|
+
var ENTER_KEY = 13;
|
|
13
|
+
|
|
14
|
+
var ShortcutDialog = function ShortcutDialog(_ref) {
|
|
15
|
+
var shortcut = _ref.shortcut,
|
|
16
|
+
onSave = _ref.onSave,
|
|
17
|
+
onClose = _ref.onClose;
|
|
18
|
+
|
|
19
|
+
var _useI18n = useI18n(),
|
|
20
|
+
t = _useI18n.t;
|
|
21
|
+
|
|
22
|
+
var _useAlert = useAlert(),
|
|
23
|
+
showAlert = _useAlert.showAlert;
|
|
24
|
+
|
|
25
|
+
var initialName = makeHumanReadableFileName((shortcut === null || shortcut === void 0 ? void 0 : shortcut.name) || '');
|
|
26
|
+
var initialUrl = (shortcut === null || shortcut === void 0 ? void 0 : shortcut.url) || '';
|
|
27
|
+
var isEditing = !!shortcut;
|
|
28
|
+
|
|
29
|
+
var _useState = useState(initialName),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
fileName = _useState2[0],
|
|
32
|
+
setFilename = _useState2[1];
|
|
33
|
+
|
|
34
|
+
var _useState3 = useState(initialUrl),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
url = _useState4[0],
|
|
37
|
+
setUrl = _useState4[1];
|
|
38
|
+
|
|
39
|
+
var saveShortcut = function saveShortcut() {
|
|
40
|
+
checkAndSaveShortcut({
|
|
41
|
+
fileName: fileName,
|
|
42
|
+
url: url,
|
|
43
|
+
isEditing: isEditing,
|
|
44
|
+
onSave: onSave,
|
|
45
|
+
onClose: onClose,
|
|
46
|
+
showAlert: showAlert,
|
|
47
|
+
t: t
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
52
|
+
if (e.keyCode === ENTER_KEY) {
|
|
53
|
+
saveShortcut();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return /*#__PURE__*/React.createElement(ConfirmDialog, {
|
|
58
|
+
open: true,
|
|
59
|
+
title: isEditing ? t('shortcut-dialog.edit-title') : t('shortcut-dialog.create-title'),
|
|
60
|
+
onClose: onClose,
|
|
61
|
+
content: /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextField, {
|
|
62
|
+
label: t('shortcut-dialog.url'),
|
|
63
|
+
value: url,
|
|
64
|
+
id: "shortcuturl",
|
|
65
|
+
variant: "outlined",
|
|
66
|
+
onChange: function onChange(e) {
|
|
67
|
+
return setUrl(e.target.value);
|
|
68
|
+
},
|
|
69
|
+
onKeyDown: function onKeyDown(e) {
|
|
70
|
+
return handleKeyDown(e);
|
|
71
|
+
},
|
|
72
|
+
autoComplete: "off",
|
|
73
|
+
fullWidth: true,
|
|
74
|
+
margin: "normal",
|
|
75
|
+
autoFocus: true
|
|
76
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextField, {
|
|
77
|
+
label: t('shortcut-dialog.filename'),
|
|
78
|
+
value: fileName,
|
|
79
|
+
id: "shortcutfilename",
|
|
80
|
+
variant: "outlined",
|
|
81
|
+
onChange: function onChange(e) {
|
|
82
|
+
return setFilename(e.target.value);
|
|
83
|
+
},
|
|
84
|
+
onKeyDown: function onKeyDown(e) {
|
|
85
|
+
return handleKeyDown(e);
|
|
86
|
+
},
|
|
87
|
+
autoComplete: "off",
|
|
88
|
+
fullWidth: true,
|
|
89
|
+
margin: "normal"
|
|
90
|
+
}))),
|
|
91
|
+
actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
92
|
+
variant: "secondary",
|
|
93
|
+
onClick: onClose,
|
|
94
|
+
label: t('shortcut-dialog.cancel')
|
|
95
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
96
|
+
variant: "primary",
|
|
97
|
+
label: isEditing ? t('shortcut-dialog.edit') : t('shortcut-dialog.create'),
|
|
98
|
+
onClick: saveShortcut
|
|
99
|
+
}))
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
ShortcutDialog.propTypes = {
|
|
104
|
+
/** An io.cozy.files.shortcut object if we want to prefill fields */
|
|
105
|
+
shortcut: PropTypes.object,
|
|
106
|
+
|
|
107
|
+
/** A function called when clicking the save button with filename and url */
|
|
108
|
+
onSave: PropTypes.func,
|
|
109
|
+
|
|
110
|
+
/** A function called when clicking the close button */
|
|
111
|
+
onClose: PropTypes.func
|
|
112
|
+
};
|
|
113
|
+
ShortcutDialog.displayName = 'ShortcutDialog';
|
|
114
|
+
export default withSpecificDialogsLocales(ShortcutDialog);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function isValidURL(url: any): boolean;
|
|
2
|
+
export function makeValidUrl(str: any): any;
|
|
3
|
+
export function makeValidFileName(fileName: any): any;
|
|
4
|
+
export function makeHumanReadableFileName(fileName: any): any;
|
|
5
|
+
export function checkAndSaveShortcut({ fileName, url, isEditing, onSave, onClose, showAlert, t }: {
|
|
6
|
+
fileName: any;
|
|
7
|
+
url: any;
|
|
8
|
+
isEditing: any;
|
|
9
|
+
onSave: any;
|
|
10
|
+
onClose: any;
|
|
11
|
+
showAlert: any;
|
|
12
|
+
t: any;
|
|
13
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
export var isValidURL = function isValidURL(url) {
|
|
4
|
+
try {
|
|
5
|
+
new URL(url);
|
|
6
|
+
return true;
|
|
7
|
+
} catch (e) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export var makeValidUrl = function makeValidUrl(str) {
|
|
12
|
+
if (isValidURL(str)) return str;else if (isValidURL("https://".concat(str))) return "https://".concat(str);
|
|
13
|
+
return false;
|
|
14
|
+
};
|
|
15
|
+
export var makeValidFileName = function makeValidFileName(fileName) {
|
|
16
|
+
return fileName.endsWith('.url') ? fileName : fileName + '.url';
|
|
17
|
+
};
|
|
18
|
+
export var makeHumanReadableFileName = function makeHumanReadableFileName(fileName) {
|
|
19
|
+
return fileName.endsWith('.url') ? fileName.slice(0, -4) : fileName;
|
|
20
|
+
};
|
|
21
|
+
export var checkAndSaveShortcut = /*#__PURE__*/function () {
|
|
22
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
23
|
+
var fileName, url, isEditing, onSave, onClose, showAlert, t, validFileName, validURL;
|
|
24
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
25
|
+
while (1) {
|
|
26
|
+
switch (_context.prev = _context.next) {
|
|
27
|
+
case 0:
|
|
28
|
+
fileName = _ref.fileName, url = _ref.url, isEditing = _ref.isEditing, onSave = _ref.onSave, onClose = _ref.onClose, showAlert = _ref.showAlert, t = _ref.t;
|
|
29
|
+
|
|
30
|
+
if (!(!fileName || !url)) {
|
|
31
|
+
_context.next = 4;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
showAlert({
|
|
36
|
+
message: t('shortcut-dialog.needs-info'),
|
|
37
|
+
severity: 'error'
|
|
38
|
+
});
|
|
39
|
+
return _context.abrupt("return");
|
|
40
|
+
|
|
41
|
+
case 4:
|
|
42
|
+
validFileName = makeValidFileName(fileName);
|
|
43
|
+
validURL = makeValidUrl(url);
|
|
44
|
+
|
|
45
|
+
if (validURL) {
|
|
46
|
+
_context.next = 9;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
showAlert({
|
|
51
|
+
message: t('shortcut-dialog.url-bad-format'),
|
|
52
|
+
severity: 'error'
|
|
53
|
+
});
|
|
54
|
+
return _context.abrupt("return");
|
|
55
|
+
|
|
56
|
+
case 9:
|
|
57
|
+
try {
|
|
58
|
+
onSave(validFileName, validURL);
|
|
59
|
+
showAlert({
|
|
60
|
+
message: isEditing ? t('shortcut-dialog.edited') : t('shortcut-dialog.created'),
|
|
61
|
+
severity: 'success'
|
|
62
|
+
});
|
|
63
|
+
} catch (_unused) {
|
|
64
|
+
showAlert({
|
|
65
|
+
message: t('shortcut-dialog.errored'),
|
|
66
|
+
severity: 'error'
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
onClose();
|
|
71
|
+
|
|
72
|
+
case 11:
|
|
73
|
+
case "end":
|
|
74
|
+
return _context.stop();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}, _callee);
|
|
78
|
+
}));
|
|
79
|
+
|
|
80
|
+
return function checkAndSaveShortcut(_x) {
|
|
81
|
+
return _ref2.apply(this, arguments);
|
|
82
|
+
};
|
|
83
|
+
}();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as AllowLocationDialog } from "./AllowLocationDialog";
|
|
2
2
|
export { default as InstallFlagshipAppDialog } from "./InstallFlagshipAppDialog";
|
|
3
3
|
export { default as AuthentificationDialog } from "./AuthentificationDialog";
|
|
4
|
+
export { default as ShortcutDialog } from "./ShortcutDialog";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as AllowLocationDialog } from './AllowLocationDialog';
|
|
2
2
|
export { default as InstallFlagshipAppDialog } from './InstallFlagshipAppDialog';
|
|
3
|
-
export { default as AuthentificationDialog } from './AuthentificationDialog';
|
|
3
|
+
export { default as AuthentificationDialog } from './AuthentificationDialog';
|
|
4
|
+
export { default as ShortcutDialog } from './ShortcutDialog';
|
|
@@ -23,6 +23,20 @@ var en = {
|
|
|
23
23
|
invalid_password: "Incorrect password, try again.",
|
|
24
24
|
server_error: "Something went wrong with the server. Please, reload the page."
|
|
25
25
|
}
|
|
26
|
+
},
|
|
27
|
+
"shortcut-dialog": {
|
|
28
|
+
"create-title": "Create a shortcut",
|
|
29
|
+
"edit-title": "Modify a shortcut",
|
|
30
|
+
filename: "Shortcut name",
|
|
31
|
+
url: "URL",
|
|
32
|
+
cancel: "Cancel",
|
|
33
|
+
create: "Create",
|
|
34
|
+
edit: "Edit",
|
|
35
|
+
created: "The shortcut has been created",
|
|
36
|
+
edited: "The shortcut has been modified",
|
|
37
|
+
errored: "An error occurred",
|
|
38
|
+
"needs-info": "A shortcut needs a name and a URL",
|
|
39
|
+
"url-bad-format": "The entered URL is not in the correct format"
|
|
26
40
|
}
|
|
27
41
|
};
|
|
28
42
|
var fr = {
|
|
@@ -50,6 +64,20 @@ var fr = {
|
|
|
50
64
|
invalid_password: "Mot de passe incorrect, essayer \xE0 nouveau.",
|
|
51
65
|
server_error: "Une erreur s'est produite. Merci de recharger la page."
|
|
52
66
|
}
|
|
67
|
+
},
|
|
68
|
+
"shortcut-dialog": {
|
|
69
|
+
"create-title": "Cr\xE9er un raccourci",
|
|
70
|
+
"edit-title": "Modifier un raccourci",
|
|
71
|
+
filename: "Nom du raccourci",
|
|
72
|
+
url: "URL",
|
|
73
|
+
cancel: "Annuler",
|
|
74
|
+
create: "Cr\xE9er",
|
|
75
|
+
edit: "Modifier",
|
|
76
|
+
created: "Le raccourci a \xE9t\xE9 cr\xE9\xE9",
|
|
77
|
+
edited: "Le raccourci a \xE9t\xE9 modifi\xE9",
|
|
78
|
+
errored: "Une erreur s'est produite",
|
|
79
|
+
"needs-info": "Un raccourci a besoin d'un nom et d'une URL",
|
|
80
|
+
"url-bad-format": "L'URL saisie n'est pas dans le bon format"
|
|
53
81
|
}
|
|
54
82
|
};
|
|
55
83
|
var ru = {
|
|
@@ -77,6 +105,20 @@ var ru = {
|
|
|
77
105
|
invalid_password: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043F\u0430\u0440\u043E\u043B\u044C, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437.",
|
|
78
106
|
server_error: "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043E\u043C. \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443."
|
|
79
107
|
}
|
|
108
|
+
},
|
|
109
|
+
"shortcut-dialog": {
|
|
110
|
+
"create-title": "\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u044F\u0440\u043B\u044B\u043A",
|
|
111
|
+
"edit-title": "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u044F\u0440\u043B\u044B\u043A",
|
|
112
|
+
filename: "\u0418\u043C\u044F \u044F\u0440\u043B\u044B\u043A\u0430",
|
|
113
|
+
url: "URL",
|
|
114
|
+
cancel: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",
|
|
115
|
+
create: "\u0421\u043E\u0437\u0434\u0430\u0442\u044C",
|
|
116
|
+
edit: "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C",
|
|
117
|
+
created: "\u042F\u0440\u043B\u044B\u043A \u0431\u044B\u043B \u0441\u043E\u0437\u0434\u0430\u043D",
|
|
118
|
+
edited: "\u042F\u0440\u043B\u044B\u043A \u0431\u044B\u043B \u0438\u0437\u043C\u0435\u043D\u0435\u043D",
|
|
119
|
+
errored: "\u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430",
|
|
120
|
+
"needs-info": "\u0414\u043B\u044F \u044F\u0440\u043B\u044B\u043A\u0430 \u043D\u0443\u0436\u043D\u044B \u0438\u043C\u044F \u0438 URL",
|
|
121
|
+
"url-bad-format": "\u0412\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0439 URL \u0438\u043C\u0435\u0435\u0442 \u043D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442"
|
|
80
122
|
}
|
|
81
123
|
};
|
|
82
124
|
var vi = {
|
|
@@ -104,6 +146,20 @@ var vi = {
|
|
|
104
146
|
invalid_password: "M\u1EADt kh\u1EA9u kh\xF4ng ch\xEDnh x\xE1c, h\xE3y th\u1EED l\u1EA1i.",
|
|
105
147
|
server_error: "C\xF3 l\u1ED7i x\u1EA3y ra v\u1EDBi m\xE1y ch\u1EE7. Vui l\xF2ng t\u1EA3i l\u1EA1i trang."
|
|
106
148
|
}
|
|
149
|
+
},
|
|
150
|
+
"shortcut-dialog": {
|
|
151
|
+
"create-title": "T\u1EA1o l\u1ED1i t\u1EAFt",
|
|
152
|
+
"edit-title": "Ch\u1EC9nh s\u1EEDa l\u1ED1i t\u1EAFt",
|
|
153
|
+
filename: "T\xEAn l\u1ED1i t\u1EAFt",
|
|
154
|
+
url: "URL",
|
|
155
|
+
cancel: "H\u1EE7y",
|
|
156
|
+
create: "T\u1EA1o",
|
|
157
|
+
edit: "Ch\u1EC9nh s\u1EEDa",
|
|
158
|
+
created: "L\u1ED1i t\u1EAFt \u0111\xE3 \u0111\u01B0\u1EE3c t\u1EA1o",
|
|
159
|
+
edited: "L\u1ED1i t\u1EAFt \u0111\xE3 \u0111\u01B0\u1EE3c ch\u1EC9nh s\u1EEDa",
|
|
160
|
+
errored: "\u0110\xE3 x\u1EA3y ra l\u1ED7i",
|
|
161
|
+
"needs-info": "L\u1ED1i t\u1EAFt c\u1EA7n c\xF3 t\xEAn v\xE0 URL",
|
|
162
|
+
"url-bad-format": "URL \u0111\xE3 nh\u1EADp kh\xF4ng \u0111\xFAng \u0111\u1ECBnh d\u1EA1ng"
|
|
107
163
|
}
|
|
108
164
|
};
|
|
109
165
|
import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
|
|
@@ -8,4 +8,4 @@ export { default as IllustrationDialog } from "./IllustrationDialog";
|
|
|
8
8
|
export { default as PermissionDialog } from "./PermissionDialog";
|
|
9
9
|
export { default as useCozyDialog } from "./useCozyDialog";
|
|
10
10
|
export { default as TopAnchoredDialog } from "./TopAnchoredDialog";
|
|
11
|
-
export { AllowLocationDialog, InstallFlagshipAppDialog, AuthentificationDialog } from "./SpecificDialogs";
|
|
11
|
+
export { AllowLocationDialog, InstallFlagshipAppDialog, AuthentificationDialog, ShortcutDialog } from "./SpecificDialogs";
|
|
@@ -8,4 +8,4 @@ export { default as IllustrationDialog } from './IllustrationDialog';
|
|
|
8
8
|
export { default as PermissionDialog } from './PermissionDialog';
|
|
9
9
|
export { default as useCozyDialog } from './useCozyDialog';
|
|
10
10
|
export { default as TopAnchoredDialog } from './TopAnchoredDialog';
|
|
11
|
-
export { AllowLocationDialog, InstallFlagshipAppDialog, AuthentificationDialog } from './SpecificDialogs';
|
|
11
|
+
export { AllowLocationDialog, InstallFlagshipAppDialog, AuthentificationDialog, ShortcutDialog } from './SpecificDialogs';
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { CozyProvider } from 'cozy-client';
|
|
3
3
|
import { BreakpointsProvider } from "cozy-ui/transpiled/react/providers/Breakpoints";
|
|
4
4
|
import CozyTheme from "cozy-ui/transpiled/react/providers/CozyTheme";
|
|
5
|
+
import AlertProvider from "cozy-ui/transpiled/react/providers/Alert";
|
|
5
6
|
import I18n from "cozy-ui/transpiled/react/providers/I18n";
|
|
6
7
|
var defaultClient = {
|
|
7
8
|
plugins: {
|
|
@@ -36,12 +37,12 @@ var DemoProvider = function DemoProvider(_ref) {
|
|
|
36
37
|
|
|
37
38
|
return /*#__PURE__*/React.createElement(CozyProvider, {
|
|
38
39
|
client: client || defaultClient
|
|
39
|
-
}, /*#__PURE__*/React.createElement(BreakpointsProvider, null, /*#__PURE__*/React.createElement(I18n, {
|
|
40
|
+
}, /*#__PURE__*/React.createElement(BreakpointsProvider, null, /*#__PURE__*/React.createElement(AlertProvider, null, /*#__PURE__*/React.createElement(I18n, {
|
|
40
41
|
lang: lang,
|
|
41
42
|
dictRequire: _dictRequire
|
|
42
43
|
}, /*#__PURE__*/React.createElement(CozyTheme, {
|
|
43
44
|
variant: variant
|
|
44
|
-
}, children))));
|
|
45
|
+
}, children)))));
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
export default DemoProvider;
|