cozy-sharing 37.7.0 → 38.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 +17 -0
- package/dist/components/Recipient/DowngradePermissionConfirmDialog.js +2 -0
- package/dist/components/SharingBanner/components/PublicBanner.js +7 -2
- package/dist/components/SharingBanner/components/SharingBanner.js +6 -3
- package/dist/components/SharingBanner/index.js +6 -3
- package/package.json +5 -5
- package/src/components/Recipient/DowngradePermissionConfirmDialog.jsx +10 -2
- package/src/components/SharingBanner/components/PublicBanner.jsx +14 -8
- package/src/components/SharingBanner/components/SharingBanner.jsx +7 -3
- package/src/components/SharingBanner/index.jsx +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [38.1.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@38.0.0...cozy-sharing@38.1.0) (2026-09-16)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **sharing:** Add hideCreateCozyAction prop to SharingBannerPlugin ([946fcb7](https://github.com/cozy/cozy-libs/commit/946fcb73ce27fca02511a2b03b34affdc0584d3b))
|
|
11
|
+
|
|
12
|
+
# [38.0.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@37.7.0...cozy-sharing@38.0.0) (2026-09-16)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **cozy-sharing:** Fix invisible folder icons in downgrade dialog ([6908d83](https://github.com/cozy/cozy-libs/commit/6908d83421ad65e5d4bd34659b9a24929609e5b5))
|
|
17
|
+
- **cozy-sharing:** Upgrade packages ([e632bc8](https://github.com/cozy/cozy-libs/commit/e632bc894af136e071e8315eb25ba2c276952249))
|
|
18
|
+
|
|
19
|
+
### BREAKING CHANGES
|
|
20
|
+
|
|
21
|
+
- **cozy-sharing:** you must have `@linagora/twake-icons >= 2.9.0`
|
|
22
|
+
|
|
6
23
|
# [37.7.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@37.6.2...cozy-sharing@37.7.0) (2026-09-15)
|
|
7
24
|
|
|
8
25
|
### Bug Fixes
|
|
@@ -63,6 +63,7 @@ var DowngradePermissionConfirmDialog = function DowngradePermissionConfirmDialog
|
|
|
63
63
|
}, /*#__PURE__*/React.createElement("div", {
|
|
64
64
|
className: "u-w-1-half u-flex u-flex-justify-center"
|
|
65
65
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
66
|
+
color: "var(--iconTextColor)",
|
|
66
67
|
icon: FolderOutlined,
|
|
67
68
|
size: 24
|
|
68
69
|
}))), /*#__PURE__*/React.createElement(TimelineConnector, null)), /*#__PURE__*/React.createElement(TimelineContent, null, /*#__PURE__*/React.createElement(Typography, {
|
|
@@ -88,6 +89,7 @@ var DowngradePermissionConfirmDialog = function DowngradePermissionConfirmDialog
|
|
|
88
89
|
}, /*#__PURE__*/React.createElement("div", {
|
|
89
90
|
className: "u-w-1-half u-flex u-flex-justify-center"
|
|
90
91
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
92
|
+
color: "var(--iconTextColor)",
|
|
91
93
|
icon: FolderOutlined,
|
|
92
94
|
size: 16
|
|
93
95
|
})))), /*#__PURE__*/React.createElement(TimelineContent, null, /*#__PURE__*/React.createElement(Typography, {
|
|
@@ -124,7 +124,8 @@ var SharingBannerByLinkText = function SharingBannerByLinkText() {
|
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
var SharingBannerByLink = function SharingBannerByLink(_ref3) {
|
|
127
|
-
var onClose = _ref3.onClose
|
|
127
|
+
var onClose = _ref3.onClose,
|
|
128
|
+
hideCreateCozyAction = _ref3.hideCreateCozyAction;
|
|
128
129
|
|
|
129
130
|
var _useI18n4 = useI18n(),
|
|
130
131
|
t = _useI18n4.t;
|
|
@@ -143,7 +144,7 @@ var SharingBannerByLink = function SharingBannerByLink(_ref3) {
|
|
|
143
144
|
color: "var(--defaultBackgroundColor)",
|
|
144
145
|
square: true,
|
|
145
146
|
block: isMobile,
|
|
146
|
-
action: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
147
|
+
action: /*#__PURE__*/React.createElement(React.Fragment, null, !hideCreateCozyAction && /*#__PURE__*/React.createElement(Button, {
|
|
147
148
|
component: "a",
|
|
148
149
|
variant: "text",
|
|
149
150
|
label: t('Share.create-cozy', {
|
|
@@ -161,6 +162,10 @@ var SharingBannerByLink = function SharingBannerByLink(_ref3) {
|
|
|
161
162
|
}, /*#__PURE__*/React.createElement(SharingBannerByLinkText, null));
|
|
162
163
|
};
|
|
163
164
|
|
|
165
|
+
SharingBannerByLink.propTypes = {
|
|
166
|
+
onClose: PropTypes.func,
|
|
167
|
+
hideCreateCozyAction: PropTypes.bool
|
|
168
|
+
};
|
|
164
169
|
SharingBannerCozyToCozy.propTypes = {
|
|
165
170
|
sharing: PropTypes.object.isRequired,
|
|
166
171
|
isSharingShortcutCreated: PropTypes.bool.isRequired,
|
|
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import React, { useState, useCallback } from 'react';
|
|
4
4
|
import { SharingBannerByLink, SharingBannerCozyToCozy } from './PublicBanner';
|
|
5
5
|
export var SharingBanner = function SharingBanner(_ref) {
|
|
6
|
-
var sharingInfos = _ref.sharingInfos
|
|
6
|
+
var sharingInfos = _ref.sharingInfos,
|
|
7
|
+
hideCreateCozyAction = _ref.hideCreateCozyAction;
|
|
7
8
|
|
|
8
9
|
var _useState = useState(true),
|
|
9
10
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19,7 +20,8 @@ export var SharingBanner = function SharingBanner(_ref) {
|
|
|
19
20
|
isSharingShortcutCreated = sharingInfos.isSharingShortcutCreated;
|
|
20
21
|
if (loading) return null;
|
|
21
22
|
return isOpened && (!addSharingLink ? /*#__PURE__*/React.createElement(SharingBannerByLink, {
|
|
22
|
-
onClose: onClose
|
|
23
|
+
onClose: onClose,
|
|
24
|
+
hideCreateCozyAction: hideCreateCozyAction
|
|
23
25
|
}) : /*#__PURE__*/React.createElement(SharingBannerCozyToCozy, {
|
|
24
26
|
isSharingShortcutCreated: isSharingShortcutCreated,
|
|
25
27
|
sharing: sharing,
|
|
@@ -28,6 +30,7 @@ export var SharingBanner = function SharingBanner(_ref) {
|
|
|
28
30
|
}));
|
|
29
31
|
};
|
|
30
32
|
SharingBanner.propTypes = {
|
|
31
|
-
sharingInfos: PropTypes.object
|
|
33
|
+
sharingInfos: PropTypes.object,
|
|
34
|
+
hideCreateCozyAction: PropTypes.bool
|
|
32
35
|
};
|
|
33
36
|
export default SharingBanner;
|
|
@@ -5,14 +5,17 @@ import { useSharingInfos } from './hooks/useSharingInfos';
|
|
|
5
5
|
import withLocales from '../../hoc/withLocales';
|
|
6
6
|
|
|
7
7
|
var Plugin = function Plugin(_ref) {
|
|
8
|
-
var previewPath = _ref.previewPath
|
|
8
|
+
var previewPath = _ref.previewPath,
|
|
9
|
+
hideCreateCozyAction = _ref.hideCreateCozyAction;
|
|
9
10
|
var sharingInfos = useSharingInfos(previewPath);
|
|
10
11
|
return /*#__PURE__*/React.createElement(SharingBanner, {
|
|
11
|
-
sharingInfos: sharingInfos
|
|
12
|
+
sharingInfos: sharingInfos,
|
|
13
|
+
hideCreateCozyAction: hideCreateCozyAction
|
|
12
14
|
});
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
Plugin.propTypes = {
|
|
16
|
-
previewPath: PropTypes.string
|
|
18
|
+
previewPath: PropTypes.string,
|
|
19
|
+
hideCreateCozyAction: PropTypes.bool
|
|
17
20
|
};
|
|
18
21
|
export var SharingBannerPlugin = withLocales(Plugin);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-sharing",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "38.1.0",
|
|
4
4
|
"description": "Provides sharing login for React applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/cli": "7.16.8",
|
|
42
42
|
"@babel/core": "7.16.12",
|
|
43
|
-
"@linagora/twake-icons": "^2.
|
|
43
|
+
"@linagora/twake-icons": "^2.9.0",
|
|
44
44
|
"@storybook/addon-essentials": "7.6.0",
|
|
45
45
|
"@storybook/addon-interactions": "7.6.0",
|
|
46
46
|
"@storybook/addon-links": "7.6.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"cozy-intent": "^2.31.1",
|
|
60
60
|
"cozy-minilog": "^3.10.1",
|
|
61
61
|
"cozy-ui": "^140.5.0",
|
|
62
|
-
"cozy-ui-plus": "^13.0.
|
|
62
|
+
"cozy-ui-plus": "^13.0.4",
|
|
63
63
|
"jest": "30.3.0",
|
|
64
64
|
"jest-environment-jsdom": "30.3.0",
|
|
65
65
|
"react": "16.12.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"twake-i18n": "^0.5.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@linagora/twake-icons": ">=2.
|
|
72
|
+
"@linagora/twake-icons": ">=2.9.0",
|
|
73
73
|
"cozy-client": ">=60.28.0",
|
|
74
74
|
"cozy-device-helper": ">=4.0.0",
|
|
75
75
|
"cozy-flags": ">=4.8.1",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"sideEffects": [
|
|
86
86
|
"*.css"
|
|
87
87
|
],
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "96598a165eae6c8eef3da4b6451af1dfdb8801a0"
|
|
89
89
|
}
|
|
@@ -58,7 +58,11 @@ const DowngradePermissionConfirmDialog = ({
|
|
|
58
58
|
<TimelineSeparator>
|
|
59
59
|
<TimelineDot className="u-bg-transparent u-bdw-0 u-elevation-0 u-p-0">
|
|
60
60
|
<div className="u-w-1-half u-flex u-flex-justify-center">
|
|
61
|
-
<Icon
|
|
61
|
+
<Icon
|
|
62
|
+
color="var(--iconTextColor)"
|
|
63
|
+
icon={FolderOutlined}
|
|
64
|
+
size={24}
|
|
65
|
+
/>
|
|
62
66
|
</div>
|
|
63
67
|
</TimelineDot>
|
|
64
68
|
<TimelineConnector />
|
|
@@ -89,7 +93,11 @@ const DowngradePermissionConfirmDialog = ({
|
|
|
89
93
|
<TimelineSeparator>
|
|
90
94
|
<TimelineDot className="u-bg-transparent u-bdw-0 u-elevation-0 u-p-0">
|
|
91
95
|
<div className="u-w-1-half u-flex u-flex-justify-center">
|
|
92
|
-
<Icon
|
|
96
|
+
<Icon
|
|
97
|
+
color="var(--iconTextColor)"
|
|
98
|
+
icon={FolderOutlined}
|
|
99
|
+
size={16}
|
|
100
|
+
/>
|
|
93
101
|
</div>
|
|
94
102
|
</TimelineDot>
|
|
95
103
|
</TimelineSeparator>
|
|
@@ -115,7 +115,7 @@ const SharingBannerByLinkText = () => {
|
|
|
115
115
|
)
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
const SharingBannerByLink = ({ onClose }) => {
|
|
118
|
+
const SharingBannerByLink = ({ onClose, hideCreateCozyAction }) => {
|
|
119
119
|
const { t } = useI18n()
|
|
120
120
|
const { isMobile } = useBreakpoints()
|
|
121
121
|
|
|
@@ -135,13 +135,15 @@ const SharingBannerByLink = ({ onClose }) => {
|
|
|
135
135
|
block={isMobile}
|
|
136
136
|
action={
|
|
137
137
|
<>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
{!hideCreateCozyAction && (
|
|
139
|
+
<Button
|
|
140
|
+
component="a"
|
|
141
|
+
variant="text"
|
|
142
|
+
label={t('Share.create-cozy', { smart_count: 2 })}
|
|
143
|
+
startIcon={<Icon icon={CozyHomeLinkIcon} />}
|
|
144
|
+
href={HOME_LINK_HREF}
|
|
145
|
+
/>
|
|
146
|
+
)}
|
|
145
147
|
<Button
|
|
146
148
|
variant="text"
|
|
147
149
|
label={t('Share.banner.close')}
|
|
@@ -154,6 +156,10 @@ const SharingBannerByLink = ({ onClose }) => {
|
|
|
154
156
|
</Alert>
|
|
155
157
|
)
|
|
156
158
|
}
|
|
159
|
+
SharingBannerByLink.propTypes = {
|
|
160
|
+
onClose: PropTypes.func,
|
|
161
|
+
hideCreateCozyAction: PropTypes.bool
|
|
162
|
+
}
|
|
157
163
|
SharingBannerCozyToCozy.propTypes = {
|
|
158
164
|
sharing: PropTypes.object.isRequired,
|
|
159
165
|
isSharingShortcutCreated: PropTypes.bool.isRequired,
|
|
@@ -3,7 +3,7 @@ import React, { useState, useCallback } from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { SharingBannerByLink, SharingBannerCozyToCozy } from './PublicBanner'
|
|
5
5
|
|
|
6
|
-
export const SharingBanner = ({ sharingInfos }) => {
|
|
6
|
+
export const SharingBanner = ({ sharingInfos, hideCreateCozyAction }) => {
|
|
7
7
|
const [isOpened, setIsOpened] = useState(true)
|
|
8
8
|
const onClose = useCallback(() => setIsOpened(false), [setIsOpened])
|
|
9
9
|
|
|
@@ -14,7 +14,10 @@ export const SharingBanner = ({ sharingInfos }) => {
|
|
|
14
14
|
return (
|
|
15
15
|
isOpened &&
|
|
16
16
|
(!addSharingLink ? (
|
|
17
|
-
<SharingBannerByLink
|
|
17
|
+
<SharingBannerByLink
|
|
18
|
+
onClose={onClose}
|
|
19
|
+
hideCreateCozyAction={hideCreateCozyAction}
|
|
20
|
+
/>
|
|
18
21
|
) : (
|
|
19
22
|
<SharingBannerCozyToCozy
|
|
20
23
|
isSharingShortcutCreated={isSharingShortcutCreated}
|
|
@@ -27,7 +30,8 @@ export const SharingBanner = ({ sharingInfos }) => {
|
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
SharingBanner.propTypes = {
|
|
30
|
-
sharingInfos: PropTypes.object
|
|
33
|
+
sharingInfos: PropTypes.object,
|
|
34
|
+
hideCreateCozyAction: PropTypes.bool
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
export default SharingBanner
|
|
@@ -5,13 +5,19 @@ import { SharingBanner } from './components/SharingBanner'
|
|
|
5
5
|
import { useSharingInfos } from './hooks/useSharingInfos'
|
|
6
6
|
import withLocales from '../../hoc/withLocales'
|
|
7
7
|
|
|
8
|
-
const Plugin = ({ previewPath }) => {
|
|
8
|
+
const Plugin = ({ previewPath, hideCreateCozyAction }) => {
|
|
9
9
|
const sharingInfos = useSharingInfos(previewPath)
|
|
10
|
-
return
|
|
10
|
+
return (
|
|
11
|
+
<SharingBanner
|
|
12
|
+
sharingInfos={sharingInfos}
|
|
13
|
+
hideCreateCozyAction={hideCreateCozyAction}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
Plugin.propTypes = {
|
|
14
|
-
previewPath: PropTypes.string
|
|
19
|
+
previewPath: PropTypes.string,
|
|
20
|
+
hideCreateCozyAction: PropTypes.bool
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
export const SharingBannerPlugin = withLocales(Plugin)
|