cozy-ui 70.7.0 → 72.1.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 +51 -0
- package/package.json +1 -1
- package/react/Viewer/Footer/FooterContent.jsx +2 -1
- package/react/Viewer/Footer/ForwardOrDownloadButton.jsx +5 -1
- package/react/Viewer/Footer/Sharing.jsx +0 -1
- package/react/Viewer/Readme.md +1 -1
- package/react/Viewer/ViewerControls.jsx +12 -13
- package/react/styles/index.js +1 -0
- package/transpiled/react/Viewer/Footer/FooterContent.js +2 -1
- package/transpiled/react/Viewer/Footer/ForwardOrDownloadButton.js +6 -2
- package/transpiled/react/Viewer/Footer/Sharing.js +0 -1
- package/transpiled/react/Viewer/ViewerControls.js +6 -11
- package/transpiled/react/styles/index.js +1 -0
- package/react/helpers/makeStyles.js +0 -2
- package/react/helpers/useTheme.js +0 -2
- package/react/helpers/withStyles.js +0 -2
- package/transpiled/react/helpers/makeStyles.js +0 -2
- package/transpiled/react/helpers/useTheme.js +0 -2
- package/transpiled/react/helpers/withStyles.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
# [72.1.0](https://github.com/cozy/cozy-ui/compare/v72.0.0...v72.1.0) (2022-08-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Let the user able to select content ([7efff3d](https://github.com/cozy/cozy-ui/commit/7efff3d))
|
|
7
|
+
|
|
8
|
+
# [72.0.0](https://github.com/cozy/cozy-ui/compare/v71.0.0...v72.0.0) (2022-08-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Do not display Viewer's Download button on iOS Flagship app ([db2303d](https://github.com/cozy/cozy-ui/commit/db2303d))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Code Refactoring
|
|
17
|
+
|
|
18
|
+
* Handle footer items' gap in `FooterContent` container ([22776e2](https://github.com/cozy/cozy-ui/commit/22776e2))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### BREAKING CHANGES
|
|
22
|
+
|
|
23
|
+
* Items inside of `FooterActionButtons` should not have
|
|
24
|
+
specified margins anymore as those are now handled by its container.
|
|
25
|
+
Remove them to avoid duplicate margins
|
|
26
|
+
|
|
27
|
+
# [71.0.0](https://github.com/cozy/cozy-ui/compare/v70.7.0...v71.0.0) (2022-08-24)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* Exports all MUI styles functions ([8e9228c](https://github.com/cozy/cozy-ui/commit/8e9228c))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### BREAKING CHANGES
|
|
36
|
+
|
|
37
|
+
* Imports of `makeStyles`, `useTheme` and `withStyles`
|
|
38
|
+
are no longer done like this
|
|
39
|
+
`import ... from cozy-ui/transpiled/react/helpers/[makeStyles|useTheme|withStyles]`
|
|
40
|
+
but instead
|
|
41
|
+
`import { ... } from cozy-ui/transpiled/react/styles`
|
|
42
|
+
|
|
43
|
+
You can use a codemods `transform-mui-styles-imports.js`
|
|
44
|
+
to automatically handle this breaking change.
|
|
45
|
+
[See the codemods documentation](https://github.com/cozy/cozy-libs/tree/master/packages/cozy-codemods).
|
|
46
|
+
Using linter js auto-correction can be a good idea after that.
|
|
47
|
+
Here a common example (don't forget to change `src` value):
|
|
48
|
+
```
|
|
49
|
+
jscodeshift -t $(yarn global dir)/node_modules/@cozy/codemods/src/transforms/transform-mui-styles-imports.js src --parser babel --extensions js,jsx && yarn lint:js --fix
|
|
50
|
+
```
|
|
51
|
+
|
|
1
52
|
# [70.7.0](https://github.com/cozy/cozy-ui/compare/v70.6.2...v70.7.0) (2022-08-23)
|
|
2
53
|
|
|
3
54
|
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
|
|
4
4
|
import { useClient } from 'cozy-client'
|
|
5
|
+
import { isFlagshipApp, isIOS } from 'cozy-device-helper'
|
|
5
6
|
|
|
6
7
|
import ForwardButton from './ForwardButton'
|
|
7
8
|
import DownloadButton from './DownloadButton'
|
|
@@ -14,7 +15,10 @@ const ForwardOrDownloadButton = ({ file }) => {
|
|
|
14
15
|
? ForwardButton
|
|
15
16
|
: DownloadButton
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
// Temporarily disable Download button on iOS Flagship app until
|
|
19
|
+
// the download feature is fixed on this platform
|
|
20
|
+
// When fixed on this platform, revert this commit from PR #2215
|
|
21
|
+
return isFlagshipApp() && isIOS() ? null : <FileActionButton file={file} />
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
ForwardOrDownloadButton.propTypes = {
|
package/react/Viewer/Readme.md
CHANGED
|
@@ -47,11 +47,6 @@ class ViewerControls extends Component {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
onTap = () => {
|
|
51
|
-
if (this.state.hidden) this.showControls()
|
|
52
|
-
else this.hideAfterDelay()
|
|
53
|
-
}
|
|
54
|
-
|
|
55
50
|
hideAfterDelay = () => {
|
|
56
51
|
clearTimeout(this.hideTimeout)
|
|
57
52
|
this.hideTimeout = setTimeout(() => {
|
|
@@ -65,13 +60,18 @@ class ViewerControls extends Component {
|
|
|
65
60
|
}
|
|
66
61
|
|
|
67
62
|
initGestures = () => {
|
|
68
|
-
const gestures = new Hammer(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
const gestures = new Hammer(
|
|
64
|
+
this.wrapped,
|
|
65
|
+
this.props.breakpoints.isDesktop
|
|
66
|
+
? {
|
|
67
|
+
cssProps: {
|
|
68
|
+
userSelect: 'auto'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
: {}
|
|
72
|
+
)
|
|
73
|
+
if (!this.props.breakpoints.isDesktop) gestures.on('swipe', this.onSwipe)
|
|
74
|
+
|
|
75
75
|
return gestures
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -116,7 +116,6 @@ class ViewerControls extends Component {
|
|
|
116
116
|
} = this.props
|
|
117
117
|
const { showToolbar, showClose, toolbarRef } = toolbarProps
|
|
118
118
|
const { hidden } = this.state
|
|
119
|
-
|
|
120
119
|
return (
|
|
121
120
|
<div
|
|
122
121
|
className={cx(styles['viewer-controls'], {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@material-ui/core/styles'
|
|
@@ -14,7 +14,8 @@ var useStyles = makeStyles(function (theme) {
|
|
|
14
14
|
height: '100%',
|
|
15
15
|
paddingLeft: '1rem',
|
|
16
16
|
paddingRight: '1rem',
|
|
17
|
-
borderTop: "1px solid ".concat(theme.palette.divider)
|
|
17
|
+
borderTop: "1px solid ".concat(theme.palette.divider),
|
|
18
|
+
columnGap: '0.5rem'
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useClient } from 'cozy-client';
|
|
4
|
+
import { isFlagshipApp, isIOS } from 'cozy-device-helper';
|
|
4
5
|
import ForwardButton from "cozy-ui/transpiled/react/Viewer/Footer/ForwardButton";
|
|
5
6
|
import DownloadButton from "cozy-ui/transpiled/react/Viewer/Footer/DownloadButton";
|
|
6
7
|
import { shouldBeForwardButton } from "cozy-ui/transpiled/react/Viewer/Footer/helpers";
|
|
@@ -8,8 +9,11 @@ import { shouldBeForwardButton } from "cozy-ui/transpiled/react/Viewer/Footer/he
|
|
|
8
9
|
var ForwardOrDownloadButton = function ForwardOrDownloadButton(_ref) {
|
|
9
10
|
var file = _ref.file;
|
|
10
11
|
var client = useClient();
|
|
11
|
-
var FileActionButton = shouldBeForwardButton(client) ? ForwardButton : DownloadButton;
|
|
12
|
-
|
|
12
|
+
var FileActionButton = shouldBeForwardButton(client) ? ForwardButton : DownloadButton; // Temporarily disable Download button on iOS Flagship app until
|
|
13
|
+
// the download feature is fixed on this platform
|
|
14
|
+
// When fixed on this platform, revert this commit from PR #2215
|
|
15
|
+
|
|
16
|
+
return isFlagshipApp() && isIOS() ? null : /*#__PURE__*/React.createElement(FileActionButton, {
|
|
13
17
|
file: file
|
|
14
18
|
});
|
|
15
19
|
};
|
|
@@ -108,10 +108,6 @@ var ViewerControls = /*#__PURE__*/function (_Component) {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
_defineProperty(_assertThisInitialized(_this), "onTap", function () {
|
|
112
|
-
if (_this.state.hidden) _this.showControls();else _this.hideAfterDelay();
|
|
113
|
-
});
|
|
114
|
-
|
|
115
111
|
_defineProperty(_assertThisInitialized(_this), "hideAfterDelay", function () {
|
|
116
112
|
clearTimeout(_this.hideTimeout);
|
|
117
113
|
_this.hideTimeout = setTimeout(function () {
|
|
@@ -124,13 +120,12 @@ var ViewerControls = /*#__PURE__*/function (_Component) {
|
|
|
124
120
|
});
|
|
125
121
|
|
|
126
122
|
_defineProperty(_assertThisInitialized(_this), "initGestures", function () {
|
|
127
|
-
var gestures = new Hammer(_this.wrapped
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
tap.requireFailure(doubleTap);
|
|
123
|
+
var gestures = new Hammer(_this.wrapped, _this.props.breakpoints.isDesktop ? {
|
|
124
|
+
cssProps: {
|
|
125
|
+
userSelect: 'auto'
|
|
126
|
+
}
|
|
127
|
+
} : {});
|
|
128
|
+
if (!_this.props.breakpoints.isDesktop) gestures.on('swipe', _this.onSwipe);
|
|
134
129
|
return gestures;
|
|
135
130
|
});
|
|
136
131
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@material-ui/core/styles';
|