cozy-ui 79.5.0 → 80.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +4 -4
  3. package/react/Alert/index.jsx +1 -1
  4. package/react/AppLinker/index.jsx +1 -1
  5. package/react/AppLinker/native.js +21 -36
  6. package/react/AppLinker/native.spec.js +9 -4
  7. package/react/CircleButton/index.jsx +1 -1
  8. package/react/CozyDialogs/TopAnchoredDialog.jsx +2 -1
  9. package/react/DropdownText/index.jsx +1 -1
  10. package/react/FilePicker/FilePickerBodyItem.jsx +1 -1
  11. package/react/FilePicker/index.jsx +1 -1
  12. package/react/GhostFileBadge/index.jsx +2 -1
  13. package/react/Icon/Readme.md +2 -2
  14. package/react/InfosBadge/index.jsx +2 -1
  15. package/react/IntentDialogOpener/IntentDialogOpener.md +1 -1
  16. package/react/IntentIframe/Readme.md +1 -1
  17. package/react/MuiCozyTheme/Divider/index.jsx +2 -1
  18. package/react/MuiCozyTheme/List/index.js +2 -1
  19. package/react/MuiCozyTheme/Menus/index.js +3 -4
  20. package/react/MuiCozyTheme/index.jsx +3 -2
  21. package/react/MuiCozyTheme/makeOverrides.js +1 -1
  22. package/react/MuiCozyTheme/makeTheme.js +1 -1
  23. package/react/Paper/Readme.md +1 -1
  24. package/react/PieChart/index.jsx +1 -1
  25. package/react/ProgressionBanner/index.jsx +1 -1
  26. package/react/SquareAppIcon/index.jsx +1 -1
  27. package/react/UploadQueue/index.jsx +1 -1
  28. package/react/Viewer/Footer/FooterContent.jsx +1 -2
  29. package/react/Viewer/Readme.md +1 -1
  30. package/react/Viewer/components/InformationPanel.jsx +2 -1
  31. package/react/Viewer/components/Toolbar.jsx +1 -1
  32. package/react/Viewer/components/ViewerControls.jsx +1 -1
  33. package/transpiled/react/Alert/index.js +1 -1
  34. package/transpiled/react/AppLinker/native.js +20 -33
  35. package/transpiled/react/CircleButton/index.js +1 -1
  36. package/transpiled/react/CozyDialogs/TopAnchoredDialog.js +1 -1
  37. package/transpiled/react/DropdownText/index.js +1 -1
  38. package/transpiled/react/FilePicker/FilePickerBodyItem.js +1 -1
  39. package/transpiled/react/FilePicker/index.js +1 -1
  40. package/transpiled/react/GhostFileBadge/index.js +1 -1
  41. package/transpiled/react/InfosBadge/index.js +1 -1
  42. package/transpiled/react/MuiCozyTheme/Divider/index.js +1 -1
  43. package/transpiled/react/MuiCozyTheme/List/index.js +1 -1
  44. package/transpiled/react/MuiCozyTheme/Menus/index.js +2 -2
  45. package/transpiled/react/MuiCozyTheme/index.js +2 -2
  46. package/transpiled/react/MuiCozyTheme/makeOverrides.js +1 -1
  47. package/transpiled/react/MuiCozyTheme/makeTheme.js +1 -1
  48. package/transpiled/react/PieChart/index.js +1 -1
  49. package/transpiled/react/ProgressionBanner/index.js +1 -1
  50. package/transpiled/react/SquareAppIcon/index.js +1 -1
  51. package/transpiled/react/UploadQueue/index.js +1 -1
  52. package/transpiled/react/Viewer/Footer/FooterContent.js +1 -1
  53. package/transpiled/react/Viewer/components/InformationPanel.js +1 -1
  54. package/transpiled/react/Viewer/components/Toolbar.js +1 -1
  55. package/transpiled/react/Viewer/components/ViewerControls.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # [80.0.0](https://github.com/cozy/cozy-ui/compare/v79.5.0...v80.0.0) (2023-01-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * Deprecates `generateWebLink` in AppLinker ([3ab64e9](https://github.com/cozy/cozy-ui/commit/3ab64e9))
7
+ * Upgrade cozy-client from 34.4.0 to 34.8.0 ([2a40c08](https://github.com/cozy/cozy-ui/commit/2a40c08))
8
+
9
+
10
+ ### BREAKING CHANGES
11
+
12
+ * `cozy-client` must be `>=34.8.0`
13
+
1
14
  # [79.5.0](https://github.com/cozy/cozy-ui/compare/v79.4.0...v79.5.0) (2023-01-10)
2
15
 
3
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "79.5.0",
3
+ "version": "80.0.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -90,14 +90,14 @@
90
90
  "babel-preset-cozy-app": "2.0.2",
91
91
  "browserslist-config-cozy": "0.4.0",
92
92
  "copyfiles": "2.4.1",
93
- "cozy-client": "^34.4.0",
93
+ "cozy-client": "^34.8.0",
94
94
  "cozy-device-helper": "2.0.0",
95
95
  "cozy-flags": "^2.10.1",
96
96
  "cozy-harvest-lib": "^6.7.3",
97
97
  "cozy-intent": "1.16.1",
98
98
  "cozy-logger": "^1.9.0",
99
99
  "cozy-sharing": "^3.10.0",
100
- "cozy-stack-client": "^33.0.0",
100
+ "cozy-stack-client": "^34.7.3",
101
101
  "css-loader": "0.28.11",
102
102
  "cssnano": "4.1.11",
103
103
  "cssnano-preset-advanced": "4.0.8",
@@ -179,7 +179,7 @@
179
179
  "rooks": "^5.11.2"
180
180
  },
181
181
  "peerDependencies": {
182
- "cozy-client": ">=34.4.0",
182
+ "cozy-client": ">=34.8.0",
183
183
  "cozy-device-helper": "^2.0.0",
184
184
  "cozy-harvest-lib": "^6.7.3",
185
185
  "cozy-intent": ">=1.3.0",
@@ -2,8 +2,8 @@ import React, { forwardRef } from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import cx from 'classnames'
4
4
  import MuiAlert from '@material-ui/lab/Alert'
5
- import { makeStyles } from '@material-ui/core/styles'
6
5
 
6
+ import { makeStyles } from '../styles'
7
7
  import Icon from '../Icon'
8
8
  import CheckCircleIcon from '../Icons/CheckCircle'
9
9
  import WarningIcon from '../Icons/Warning'
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { withClient } from 'cozy-client'
4
3
 
4
+ import { withClient } from 'cozy-client'
5
5
  import {
6
6
  checkApp,
7
7
  startApp,
@@ -1,44 +1,19 @@
1
+ import {
2
+ generateWebLink as generateWebLinkClient,
3
+ ensureFirstSlash
4
+ } from 'cozy-client'
5
+
1
6
  import { UNIVERSAL_LINK_URL } from 'cozy-ui/transpiled/react/AppLinker/native.config.js'
2
7
 
3
8
  export const getUniversalLinkDomain = () => {
4
9
  return UNIVERSAL_LINK_URL
5
10
  }
6
11
 
7
- const ensureFirstSlash = path => {
8
- if (!path) {
9
- return '/'
10
- } else {
11
- return path.startsWith('/') ? path : '/' + path
12
- }
13
- }
14
-
15
- /**
16
- * generateWebLink - Construct a link to a web app
17
- *
18
- * @param {object} Options Object of options
19
- * @param {string} options.cozyUrl Base URL of the cozy, eg. http://cozy.localhost:8080 or https://test.mycozy.cloud:8080
20
- * @param {string} options.nativePath Path inside the app, eg. /files/test.jpg
21
- * @param {string} options.slug Slug of the app
22
- * @param {string} options.subDomainType Whether the cozy is using flat or nested subdomains. Defaults to flat.
23
- *
24
- * @return {string} Generated URL
25
- */
26
- export const generateWebLink = ({
27
- cozyUrl,
28
- nativePath,
29
- slug,
30
- subDomainType
31
- }) => {
32
- const url = new URL(cozyUrl)
33
- url.host =
34
- subDomainType === 'nested'
35
- ? `${slug}.${url.host}`
36
- : url.host
37
- .split('.')
38
- .map((x, i) => (i === 0 ? x + '-' + slug : x))
39
- .join('.')
40
- url.hash = ensureFirstSlash(nativePath)
41
- return url.toString()
12
+ export const generateWebLink = ({ nativePath, ...props }) => {
13
+ console.warn(
14
+ 'Deprecated: you should use generateWebLink from cozy-client instead'
15
+ )
16
+ return generateWebLinkClient({ pathname: '/', hash: nativePath, ...props })
42
17
  }
43
18
 
44
19
  /**
@@ -55,16 +30,26 @@ export const generateUniversalLink = options => {
55
30
  const { slug, cozyUrl, subDomainType } = options
56
31
  let { fallbackUrl, nativePath } = options
57
32
  nativePath = ensureFirstSlash(nativePath)
33
+
58
34
  if (!cozyUrl && !fallbackUrl) {
59
35
  throw new Error(
60
36
  'Must have either cozyUrl or fallbackUrl to generate universal link.'
61
37
  )
62
38
  }
39
+
63
40
  if (cozyUrl && !fallbackUrl) {
64
- fallbackUrl = generateWebLink({ cozyUrl, nativePath, slug, subDomainType })
41
+ fallbackUrl = generateWebLinkClient({
42
+ cozyUrl,
43
+ pathname: '/',
44
+ hash: nativePath,
45
+ slug,
46
+ subDomainType
47
+ })
65
48
  }
49
+
66
50
  const url = getUniversalLinkDomain(cozyUrl) + '/' + slug + nativePath
67
51
  const urlObj = new URL(url)
68
52
  urlObj.searchParams.append('fallback', fallbackUrl)
53
+
69
54
  return urlObj.toString()
70
55
  }
@@ -1,11 +1,14 @@
1
- import { generateUniversalLink, generateWebLink } from './native'
1
+ import { generateWebLink } from 'cozy-client'
2
+
3
+ import { generateUniversalLink } from './native'
2
4
 
3
5
  describe('native functions', () => {
4
6
  describe('generating a web link', () => {
5
7
  it('should generate a web link', () => {
6
8
  const webLink = generateWebLink({
7
9
  cozyUrl: 'https://test.cozy.tools:8080',
8
- nativePath: '/files/1',
10
+ pathname: '/',
11
+ hash: '/files/1',
9
12
  slug: 'drive'
10
13
  })
11
14
 
@@ -15,7 +18,8 @@ describe('native functions', () => {
15
18
  it('should handle both types of subdomains', () => {
16
19
  const flatLink = generateWebLink({
17
20
  cozyUrl: 'https://test.cozy.tools:8080',
18
- nativePath: '/files/1',
21
+ pathname: '/',
22
+ hash: '/files/1',
19
23
  slug: 'drive',
20
24
  subDomainType: 'flat'
21
25
  })
@@ -23,7 +27,8 @@ describe('native functions', () => {
23
27
 
24
28
  const nestedLink = generateWebLink({
25
29
  cozyUrl: 'https://cozy.tools:8080',
26
- nativePath: '/files/1',
30
+ pathname: '/',
31
+ hash: '/files/1',
27
32
  slug: 'drive',
28
33
  subDomainType: 'nested'
29
34
  })
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { makeStyles } from '@material-ui/core/styles'
4
3
 
4
+ import { makeStyles } from '../styles'
5
5
  import Box from '../Box'
6
6
  import IconButton from '../IconButton'
7
7
  import Typography from '../Typography'
@@ -1,5 +1,6 @@
1
1
  import React from 'react'
2
- import { withStyles } from '@material-ui/core/styles'
2
+
3
+ import { withStyles } from '../styles'
3
4
  import Dialog from '../Dialog'
4
5
 
5
6
  /**
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { makeStyles } from '@material-ui/core/styles'
4
3
 
4
+ import { makeStyles } from '../styles'
5
5
  import Typography from '../Typography'
6
6
  import Icon from '../Icon'
7
7
  import BottomIcon from '../Icons/Bottom'
@@ -2,10 +2,10 @@ import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import cx from 'classnames'
4
4
  import filesize from 'filesize'
5
- import { makeStyles } from '@material-ui/core/styles'
6
5
 
7
6
  import { models } from 'cozy-client'
8
7
 
8
+ import { makeStyles } from '../styles'
9
9
  import ListItem from '../MuiCozyTheme/ListItem'
10
10
  import ListItemIcon from '../MuiCozyTheme/ListItemIcon'
11
11
  import ListItemText from '../ListItemText'
@@ -1,7 +1,7 @@
1
1
  import React, { useState, memo } from 'react'
2
- import { makeStyles } from '@material-ui/core/styles'
3
2
  import PropTypes from 'prop-types'
4
3
 
4
+ import { makeStyles } from '../styles'
5
5
  import { FixedDialog } from '../CozyDialogs'
6
6
  import FilePickerHeader from './FilePickerHeader'
7
7
  import FilePickerFooter from './FilePickerFooter'
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
2
  import cx from 'classnames'
3
+
3
4
  import Badge from '../Badge'
4
- import { withStyles } from '@material-ui/core/styles'
5
+ import { withStyles } from '../styles'
5
6
 
6
7
  const customStyles = () => ({
7
8
  ghost: {
@@ -23,9 +23,9 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
23
23
  import Typography from 'cozy-ui/transpiled/react/Typography'
24
24
  import Dialog from 'cozy-ui/transpiled/react/CozyDialogs/Dialog'
25
25
  import { BreakpointsProvider } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
26
- import { makeStyles } from '@material-ui/styles'
27
26
  import cx from 'classnames'
28
27
 
28
+ import { makeStyles } from 'cozy-ui/transpiled/react/styles'
29
29
  import Album from 'cozy-ui/transpiled/react/Icons/Album'
30
30
  import AlbumAdd from 'cozy-ui/transpiled/react/Icons/AlbumAdd'
31
31
  import AlbumRemove from 'cozy-ui/transpiled/react/Icons/AlbumRemove'
@@ -672,9 +672,9 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
672
672
  import Typography from 'cozy-ui/transpiled/react/Typography'
673
673
  import Dialog from 'cozy-ui/transpiled/react/CozyDialogs/Dialog'
674
674
  import { BreakpointsProvider } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
675
- import { makeStyles } from '@material-ui/styles'
676
675
  import cx from 'classnames'
677
676
 
677
+ import { makeStyles } from 'cozy-ui/transpiled/react/styles';
678
678
  import Accounts from 'cozy-ui/transpiled/react/Icons/Accounts'
679
679
  import Apps from 'cozy-ui/transpiled/react/Icons/Apps'
680
680
  import BankAccounts from 'cozy-ui/transpiled/react/Icons/BankAccounts'
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
2
  import cx from 'classnames'
3
+
3
4
  import Badge from '../Badge'
4
- import { withStyles } from '@material-ui/core/styles'
5
+ import { withStyles } from '../styles'
5
6
 
6
7
  const customStyles = () => ({
7
8
  qualifier: {
@@ -1,5 +1,5 @@
1
1
  ```jsx
2
- import { withStyles } from '@material-ui/core/styles'
2
+ import { withStyles } from 'cozy-ui/transpiled/react/styles'
3
3
  import IntentDialogOpener from 'cozy-ui/transpiled/react/IntentDialogOpener'
4
4
  import { BreakpointsProvider } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
5
5
 
@@ -29,7 +29,7 @@ Sometimes you have to render an Intent inside a modal, and handle the modal open
29
29
  This method replaces deprecated `IntentModal` component.
30
30
 
31
31
  ```jsx
32
- import { withStyles } from '@material-ui/core/styles'
32
+ import { withStyles } from 'cozy-ui/transpiled/react/styles'
33
33
  import { DialogCloseButton } from 'cozy-ui/transpiled/react/CozyDialogs'
34
34
  import Dialog from 'cozy-ui/transpiled/react/Dialog'
35
35
  import IntentIframe from 'cozy-ui/transpiled/react/IntentIframe'
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
2
  import MuiDivider from '@material-ui/core/Divider'
3
- import { withStyles } from '@material-ui/core/styles'
3
+
4
+ import { withStyles } from '../../styles'
4
5
  import { normalTheme } from '../theme'
5
6
  import TextDivider from './TextDivider'
6
7
 
@@ -1,6 +1,7 @@
1
- import { withStyles } from '@material-ui/core/styles'
2
1
  import List from '@material-ui/core/List'
3
2
 
3
+ import { withStyles } from '../../styles'
4
+
4
5
  export const BorderedList = withStyles({
5
6
  root: {
6
7
  borderTop: '1px solid var(--silver)'
@@ -3,16 +3,15 @@
3
3
  // we have to recompose the Menu component ourselves with basic Mui component
4
4
 
5
5
  import React, { Component } from 'react'
6
-
7
- import MenuButton from '../../Button'
8
6
  import PropTypes from 'prop-types'
9
-
10
7
  import ClickAwayListener from '@material-ui/core/ClickAwayListener'
11
8
  import Grow from '@material-ui/core/Grow'
12
9
  import Popper from '@material-ui/core/Popper'
13
10
  import Paper from '@material-ui/core/Paper'
14
11
  import MenuList from '@material-ui/core/MenuList'
15
- import { withStyles } from '@material-ui/core/styles'
12
+
13
+ import { withStyles } from '../../styles'
14
+ import MenuButton from '../../Button'
16
15
 
17
16
  const styles = {
18
17
  root: {
@@ -1,11 +1,12 @@
1
1
  import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { MuiThemeProvider } from '@material-ui/core/styles'
3
+
4
+ import { ThemeProvider } from '../styles'
4
5
  import { getTheme } from './theme'
5
6
 
6
7
  const MuiCozyTheme = ({ variant, children }) => {
7
8
  const theme = getTheme(variant)
8
- return <MuiThemeProvider theme={theme}>{children}</MuiThemeProvider>
9
+ return <ThemeProvider theme={theme}>{children}</ThemeProvider>
9
10
  }
10
11
 
11
12
  MuiCozyTheme.propTypes = {
@@ -1,4 +1,4 @@
1
- import { alpha, lighten, darken } from '@material-ui/core/styles'
1
+ import { alpha, lighten, darken } from '../styles'
2
2
 
3
3
  const SWITCH_BAR_WIDTH = 25
4
4
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
- import { createTheme } from '@material-ui/core/styles'
3
2
 
3
+ import { createTheme } from '../styles'
4
4
  import { getCssVariableValue } from '../utils/color'
5
5
  import isTesting from '../helpers/isTesting'
6
6
  import AccordionExpandIcon from './AccordionExpandIcon'
@@ -4,7 +4,7 @@ import Variants from 'cozy-ui/docs/components/Variants';
4
4
  import Paper from 'cozy-ui/transpiled/react/Paper';
5
5
  import Stack from 'cozy-ui/transpiled/react/Stack';
6
6
  import Typography from 'cozy-ui/transpiled/react/Typography';
7
- import { withStyles } from '@material-ui/core/styles';
7
+ import { withStyles } from 'cozy-ui/transpiled/react/styles';
8
8
 
9
9
  const styles = theme => ({
10
10
  root: {
@@ -4,10 +4,10 @@ import cx from 'classnames'
4
4
  import { Chart as ChartJS, ArcElement, Tooltip } from 'chart.js'
5
5
  import { Doughnut } from 'react-chartjs-2'
6
6
  import { useTheme } from '@material-ui/core'
7
- import { makeStyles } from '@material-ui/core/styles'
8
7
  import set from 'lodash/set'
9
8
  import cloneDeep from 'lodash/cloneDeep'
10
9
 
10
+ import { makeStyles } from '../styles'
11
11
  import Typography from '../Typography'
12
12
  import isTesting from '../helpers/isTesting'
13
13
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { withStyles } from '@material-ui/core/styles'
4
3
 
4
+ import { withStyles } from '../styles'
5
5
  import Banner from '../Banner'
6
6
  import { LinearProgress } from '../Progress'
7
7
  import Typography from '../Typography'
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
2
  import cx from 'classnames'
3
3
  import PropTypes from 'prop-types'
4
- import { makeStyles } from '@material-ui/styles'
5
4
  import get from 'lodash/get'
6
5
 
6
+ import { makeStyles } from '../styles'
7
7
  import AppIcon from '../AppIcon'
8
8
  import Badge from '../Badge'
9
9
  import InfosBadge from '../InfosBadge'
@@ -1,11 +1,11 @@
1
1
  import React, { Component, useState } from 'react'
2
2
  import cx from 'classnames'
3
- import { withStyles } from '@material-ui/core/styles'
4
3
  import LinearProgress from '@material-ui/core/LinearProgress'
5
4
  import { useIntervalWhen } from 'rooks'
6
5
 
7
6
  import { splitFilename } from 'cozy-client/dist/models/file'
8
7
 
8
+ import { withStyles } from '../styles'
9
9
  import CrossIcon from '../Icons/Cross'
10
10
  import WarningIcon from '../Icons/Warning'
11
11
  import CheckIcon from '../Icons/Check'
@@ -1,10 +1,9 @@
1
1
  import React, { useMemo, Children, cloneElement, isValidElement } from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { makeStyles } from '@material-ui/core/styles'
4
3
  import cx from 'classnames'
5
4
 
6
5
  import BottomSheet, { BottomSheetHeader } from '../../BottomSheet'
7
-
6
+ import { makeStyles } from '../../styles'
8
7
  import { isValidForPanel } from '../helpers'
9
8
  import BottomSheetContent from './BottomSheetContent'
10
9
 
@@ -35,8 +35,8 @@ The `Viewer` can display an **information panel** to show additional information
35
35
  ### Demo
36
36
 
37
37
  ```jsx
38
- import { makeStyles } from '@material-ui/core/styles';
39
38
  import cx from 'classnames';
39
+ import { makeStyles } from 'cozy-ui/transpiled/react/styles';
40
40
  import Variants from 'cozy-ui/docs/components/Variants';
41
41
  import Card from 'cozy-ui/transpiled/react/Card';
42
42
  import Checkbox from 'cozy-ui/transpiled/react/Checkbox';
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import Drawer from '@material-ui/core/Drawer'
4
- import { withStyles } from '@material-ui/core/styles'
4
+
5
+ import { withStyles } from '../../styles'
5
6
 
6
7
  export const infoWidth = '22rem'
7
8
 
@@ -2,11 +2,11 @@ import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import cx from 'classnames'
4
4
  import flow from 'lodash/flow'
5
- import { makeStyles } from '@material-ui/core/styles'
6
5
 
7
6
  import { useClient } from 'cozy-client'
8
7
 
9
8
  import withBreakpoints from '../../helpers/withBreakpoints'
9
+ import { makeStyles } from '../../styles'
10
10
  import Button from '../../Button'
11
11
  import IconButton from '../../IconButton'
12
12
  import Icon from '../../Icon'
@@ -3,8 +3,8 @@ import PropTypes from 'prop-types'
3
3
  import flow from 'lodash/flow'
4
4
  import cx from 'classnames'
5
5
  import Hammer from 'hammerjs'
6
- import { withStyles } from '@material-ui/core/styles'
7
6
 
7
+ import { withStyles } from '../../styles'
8
8
  import withBreakpoints from '../../helpers/withBreakpoints'
9
9
 
10
10
  import { toolbarPropsPropType } from '../index'
@@ -5,7 +5,7 @@ import React, { forwardRef } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import cx from 'classnames';
7
7
  import MuiAlert from '@material-ui/lab/Alert';
8
- import { makeStyles } from '@material-ui/core/styles';
8
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
9
9
  import Icon from "cozy-ui/transpiled/react/Icon";
10
10
  import CheckCircleIcon from "cozy-ui/transpiled/react/Icons/CheckCircle";
11
11
  import WarningIcon from "cozy-ui/transpiled/react/Icons/Warning";
@@ -1,39 +1,25 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["nativePath"];
4
+
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
+
9
+ import { generateWebLink as generateWebLinkClient, ensureFirstSlash } from 'cozy-client';
1
10
  import { UNIVERSAL_LINK_URL } from 'cozy-ui/transpiled/react/AppLinker/native.config.js';
2
11
  export var getUniversalLinkDomain = function getUniversalLinkDomain() {
3
12
  return UNIVERSAL_LINK_URL;
4
13
  };
5
-
6
- var ensureFirstSlash = function ensureFirstSlash(path) {
7
- if (!path) {
8
- return '/';
9
- } else {
10
- return path.startsWith('/') ? path : '/' + path;
11
- }
12
- };
13
- /**
14
- * generateWebLink - Construct a link to a web app
15
- *
16
- * @param {object} Options Object of options
17
- * @param {string} options.cozyUrl Base URL of the cozy, eg. http://cozy.localhost:8080 or https://test.mycozy.cloud:8080
18
- * @param {string} options.nativePath Path inside the app, eg. /files/test.jpg
19
- * @param {string} options.slug Slug of the app
20
- * @param {string} options.subDomainType Whether the cozy is using flat or nested subdomains. Defaults to flat.
21
- *
22
- * @return {string} Generated URL
23
- */
24
-
25
-
26
14
  export var generateWebLink = function generateWebLink(_ref) {
27
- var cozyUrl = _ref.cozyUrl,
28
- nativePath = _ref.nativePath,
29
- slug = _ref.slug,
30
- subDomainType = _ref.subDomainType;
31
- var url = new URL(cozyUrl);
32
- url.host = subDomainType === 'nested' ? "".concat(slug, ".").concat(url.host) : url.host.split('.').map(function (x, i) {
33
- return i === 0 ? x + '-' + slug : x;
34
- }).join('.');
35
- url.hash = ensureFirstSlash(nativePath);
36
- return url.toString();
15
+ var nativePath = _ref.nativePath,
16
+ props = _objectWithoutProperties(_ref, _excluded);
17
+
18
+ console.warn('Deprecated: you should use generateWebLink from cozy-client instead');
19
+ return generateWebLinkClient(_objectSpread({
20
+ pathname: '/',
21
+ hash: nativePath
22
+ }, props));
37
23
  };
38
24
  /**
39
25
  * Returns a universal link for an app + native path
@@ -59,9 +45,10 @@ export var generateUniversalLink = function generateUniversalLink(options) {
59
45
  }
60
46
 
61
47
  if (cozyUrl && !fallbackUrl) {
62
- fallbackUrl = generateWebLink({
48
+ fallbackUrl = generateWebLinkClient({
63
49
  cozyUrl: cozyUrl,
64
- nativePath: nativePath,
50
+ pathname: '/',
51
+ hash: nativePath,
65
52
  slug: slug,
66
53
  subDomainType: subDomainType
67
54
  });
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["className", "label", "variant", "disabled", "fullWidth", "children"];
4
4
  import React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { makeStyles } from '@material-ui/core/styles';
6
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
7
7
  import Box from "cozy-ui/transpiled/react/Box";
8
8
  import IconButton from "cozy-ui/transpiled/react/IconButton";
9
9
  import Typography from "cozy-ui/transpiled/react/Typography";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { withStyles } from '@material-ui/core/styles';
2
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
3
3
  import Dialog from "cozy-ui/transpiled/react/Dialog";
4
4
  /**
5
5
  * A Dialog that will not be centered vertically. Useful when
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["spaceBetween", "variant", "disabled", "noWrap", "color", "children", "innerTextProps", "innerIconContainerProps", "innerIconProps"];
4
4
  import React, { forwardRef } from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { makeStyles } from '@material-ui/core/styles';
6
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
7
7
  import Typography from "cozy-ui/transpiled/react/Typography";
8
8
  import Icon from "cozy-ui/transpiled/react/Icon";
9
9
  import BottomIcon from "cozy-ui/transpiled/react/Icons/Bottom";
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import cx from 'classnames';
4
4
  import filesize from 'filesize';
5
- import { makeStyles } from '@material-ui/core/styles';
6
5
  import { models } from 'cozy-client';
6
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
7
7
  import ListItem from "cozy-ui/transpiled/react/MuiCozyTheme/ListItem";
8
8
  import ListItemIcon from "cozy-ui/transpiled/react/MuiCozyTheme/ListItemIcon";
9
9
  import ListItemText from "cozy-ui/transpiled/react/ListItemText";
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useState, memo } from 'react';
3
- import { makeStyles } from '@material-ui/core/styles';
4
3
  import PropTypes from 'prop-types';
4
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
5
5
  import { FixedDialog } from "cozy-ui/transpiled/react/CozyDialogs";
6
6
  import FilePickerHeader from "cozy-ui/transpiled/react/FilePicker/FilePickerHeader";
7
7
  import FilePickerFooter from "cozy-ui/transpiled/react/FilePicker/FilePickerFooter";
@@ -5,7 +5,7 @@ var _excluded = ["classes"],
5
5
  import React from 'react';
6
6
  import cx from 'classnames';
7
7
  import Badge from "cozy-ui/transpiled/react/Badge";
8
- import { withStyles } from '@material-ui/core/styles';
8
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
9
9
 
10
10
  var customStyles = function customStyles() {
11
11
  return {
@@ -5,7 +5,7 @@ var _excluded = ["classes"],
5
5
  import React from 'react';
6
6
  import cx from 'classnames';
7
7
  import Badge from "cozy-ui/transpiled/react/Badge";
8
- import { withStyles } from '@material-ui/core/styles';
8
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
9
9
 
10
10
  var customStyles = function customStyles() {
11
11
  return {
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
8
8
 
9
9
  import React from 'react';
10
10
  import MuiDivider from '@material-ui/core/Divider';
11
- import { withStyles } from '@material-ui/core/styles';
11
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
12
12
  import { normalTheme } from "cozy-ui/transpiled/react/MuiCozyTheme/theme";
13
13
  import TextDivider from "cozy-ui/transpiled/react/MuiCozyTheme/Divider/TextDivider";
14
14
  /**
@@ -1,5 +1,5 @@
1
- import { withStyles } from '@material-ui/core/styles';
2
1
  import List from '@material-ui/core/List';
2
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
3
3
  export var BorderedList = withStyles({
4
4
  root: {
5
5
  borderTop: '1px solid var(--silver)'
@@ -15,14 +15,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
15
15
  // Since the MuiMenu component doesn't allow another Popover positioning,
16
16
  // we have to recompose the Menu component ourselves with basic Mui component
17
17
  import React, { Component } from 'react';
18
- import MenuButton from "cozy-ui/transpiled/react/Button";
19
18
  import PropTypes from 'prop-types';
20
19
  import ClickAwayListener from '@material-ui/core/ClickAwayListener';
21
20
  import Grow from '@material-ui/core/Grow';
22
21
  import Popper from '@material-ui/core/Popper';
23
22
  import Paper from '@material-ui/core/Paper';
24
23
  import MenuList from '@material-ui/core/MenuList';
25
- import { withStyles } from '@material-ui/core/styles';
24
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
25
+ import MenuButton from "cozy-ui/transpiled/react/Button";
26
26
  var styles = {
27
27
  root: {
28
28
  position: 'relative'
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { MuiThemeProvider } from '@material-ui/core/styles';
3
+ import { ThemeProvider } from "cozy-ui/transpiled/react/styles";
4
4
  import { getTheme } from "cozy-ui/transpiled/react/MuiCozyTheme/theme";
5
5
 
6
6
  var MuiCozyTheme = function MuiCozyTheme(_ref) {
7
7
  var variant = _ref.variant,
8
8
  children = _ref.children;
9
9
  var theme = getTheme(variant);
10
- return /*#__PURE__*/React.createElement(MuiThemeProvider, {
10
+ return /*#__PURE__*/React.createElement(ThemeProvider, {
11
11
  theme: theme
12
12
  }, children);
13
13
  };
@@ -4,7 +4,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
4
4
 
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
- import { alpha, lighten, darken } from '@material-ui/core/styles';
7
+ import { alpha, lighten, darken } from "cozy-ui/transpiled/react/styles";
8
8
  var SWITCH_BAR_WIDTH = 25;
9
9
  export var makeThemeOverrides = function makeThemeOverrides(theme) {
10
10
  var createOverrides = theme.palette.type === 'dark' ? makeInvertedOverrides : makeOverrides;
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
7
  import React from 'react';
8
- import { createTheme } from '@material-ui/core/styles';
8
+ import { createTheme } from "cozy-ui/transpiled/react/styles";
9
9
  import { getCssVariableValue } from "cozy-ui/transpiled/react/utils/color";
10
10
  import isTesting from "cozy-ui/transpiled/react/helpers/isTesting";
11
11
  import AccordionExpandIcon from "cozy-ui/transpiled/react/MuiCozyTheme/AccordionExpandIcon";
@@ -13,9 +13,9 @@ import cx from 'classnames';
13
13
  import { Chart as ChartJS, ArcElement, Tooltip } from 'chart.js';
14
14
  import { Doughnut } from 'react-chartjs-2';
15
15
  import { useTheme } from '@material-ui/core';
16
- import { makeStyles } from '@material-ui/core/styles';
17
16
  import set from 'lodash/set';
18
17
  import cloneDeep from 'lodash/cloneDeep';
18
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
19
19
  import Typography from "cozy-ui/transpiled/react/Typography";
20
20
  import isTesting from "cozy-ui/transpiled/react/helpers/isTesting";
21
21
  ChartJS.register(ArcElement, Tooltip);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { withStyles } from '@material-ui/core/styles';
3
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
4
4
  import Banner from "cozy-ui/transpiled/react/Banner";
5
5
  import { LinearProgress } from "cozy-ui/transpiled/react/Progress";
6
6
  import Typography from "cozy-ui/transpiled/react/Typography";
@@ -4,8 +4,8 @@ var _excluded = ["name", "variant", "IconContent"];
4
4
  import React from 'react';
5
5
  import cx from 'classnames';
6
6
  import PropTypes from 'prop-types';
7
- import { makeStyles } from '@material-ui/styles';
8
7
  import get from 'lodash/get';
8
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
9
9
  import AppIcon from "cozy-ui/transpiled/react/AppIcon";
10
10
  import Badge from "cozy-ui/transpiled/react/Badge";
11
11
  import InfosBadge from "cozy-ui/transpiled/react/InfosBadge";
@@ -14,10 +14,10 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
14
14
 
15
15
  import React, { Component, useState } from 'react';
16
16
  import cx from 'classnames';
17
- import { withStyles } from '@material-ui/core/styles';
18
17
  import LinearProgress from '@material-ui/core/LinearProgress';
19
18
  import { useIntervalWhen } from 'rooks';
20
19
  import { splitFilename } from 'cozy-client/dist/models/file';
20
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
21
21
  import CrossIcon from "cozy-ui/transpiled/react/Icons/Cross";
22
22
  import WarningIcon from "cozy-ui/transpiled/react/Icons/Warning";
23
23
  import CheckIcon from "cozy-ui/transpiled/react/Icons/Check";
@@ -1,8 +1,8 @@
1
1
  import React, { useMemo, Children, cloneElement, isValidElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { makeStyles } from '@material-ui/core/styles';
4
3
  import cx from 'classnames';
5
4
  import BottomSheet, { BottomSheetHeader } from "cozy-ui/transpiled/react/BottomSheet";
5
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
6
6
  import { isValidForPanel } from "cozy-ui/transpiled/react/Viewer/helpers";
7
7
  import BottomSheetContent from "cozy-ui/transpiled/react/Viewer/Footer/BottomSheetContent";
8
8
  var useStyles = makeStyles(function (theme) {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Drawer from '@material-ui/core/Drawer';
4
- import { withStyles } from '@material-ui/core/styles';
4
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
5
5
  export var infoWidth = '22rem';
6
6
 
7
7
  var customStyles = function customStyles() {
@@ -3,9 +3,9 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import cx from 'classnames';
5
5
  import flow from 'lodash/flow';
6
- import { makeStyles } from '@material-ui/core/styles';
7
6
  import { useClient } from 'cozy-client';
8
7
  import withBreakpoints from "cozy-ui/transpiled/react/helpers/withBreakpoints";
8
+ import { makeStyles } from "cozy-ui/transpiled/react/styles";
9
9
  import Button from "cozy-ui/transpiled/react/Button";
10
10
  import IconButton from "cozy-ui/transpiled/react/IconButton";
11
11
  import Icon from "cozy-ui/transpiled/react/Icon";
@@ -15,7 +15,7 @@ import PropTypes from 'prop-types';
15
15
  import flow from 'lodash/flow';
16
16
  import cx from 'classnames';
17
17
  import Hammer from 'hammerjs';
18
- import { withStyles } from '@material-ui/core/styles';
18
+ import { withStyles } from "cozy-ui/transpiled/react/styles";
19
19
  import withBreakpoints from "cozy-ui/transpiled/react/helpers/withBreakpoints";
20
20
  import { toolbarPropsPropType } from "cozy-ui/transpiled/react/Viewer/index";
21
21
  import { infoWidth } from "cozy-ui/transpiled/react/Viewer/components/InformationPanel";