cozy-sharing 16.15.1 → 16.16.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 CHANGED
@@ -3,6 +3,17 @@
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
+ # [16.16.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@16.15.1...cozy-sharing@16.16.0) (2024-12-12)
7
+
8
+
9
+ ### Features
10
+
11
+ * **cozy-sharing:** Add conditionnal prop to openSharingLink action ([ec2a8be](https://github.com/cozy/cozy-libs/commit/ec2a8be595215745e85ae0cc1e9b7493e2c5b8a4))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [16.15.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@16.15.0...cozy-sharing@16.15.1) (2024-12-11)
7
18
 
8
19
 
@@ -23,6 +23,8 @@ var makeComponent = function makeComponent(label, icon) {
23
23
 
24
24
  export var openSharingLink = function openSharingLink(_ref) {
25
25
  var isSharingShortcutCreated = _ref.isSharingShortcutCreated,
26
+ _ref$openSharingLinkD = _ref.openSharingLinkDisplayed,
27
+ openSharingLinkDisplayed = _ref$openSharingLinkD === void 0 ? true : _ref$openSharingLinkD,
26
28
  link = _ref.link;
27
29
 
28
30
  var _getActionsI18n = getActionsI18n(),
@@ -40,6 +42,9 @@ export var openSharingLink = function openSharingLink(_ref) {
40
42
  name: 'openSharingLink',
41
43
  label: label,
42
44
  icon: icon,
45
+ displayCondition: function displayCondition() {
46
+ return openSharingLinkDisplayed;
47
+ },
43
48
  action: function action() {
44
49
  openExternalLink(link);
45
50
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "16.15.1",
3
+ "version": "16.16.0",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -74,5 +74,5 @@
74
74
  "sideEffects": [
75
75
  "*.css"
76
76
  ],
77
- "gitHead": "af2b4b48c01544820dd385be5914f6fd42ae72e5"
77
+ "gitHead": "620313f3d90b1308f01f4e1ec5bbcd76adb64174"
78
78
  }
@@ -24,7 +24,11 @@ const makeComponent = (label, icon) => {
24
24
  return Component
25
25
  }
26
26
 
27
- export const openSharingLink = ({ isSharingShortcutCreated, link }) => {
27
+ export const openSharingLink = ({
28
+ isSharingShortcutCreated,
29
+ openSharingLinkDisplayed = true,
30
+ link
31
+ }) => {
28
32
  const { t } = getActionsI18n()
29
33
  const { icon, label } = getIconWithlabel({
30
34
  link,
@@ -36,6 +40,7 @@ export const openSharingLink = ({ isSharingShortcutCreated, link }) => {
36
40
  name: 'openSharingLink',
37
41
  label,
38
42
  icon,
43
+ displayCondition: () => openSharingLinkDisplayed,
39
44
  action: () => {
40
45
  openExternalLink(link)
41
46
  },