cozy-viewer 14.0.1 → 15.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
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
+ # [15.0.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@14.0.2...cozy-viewer@15.0.0) (2025-01-23)
7
+
8
+
9
+ ### Features
10
+
11
+ * **viewer:** Upgrade cozy-sharing & apply BC ([215c25f](https://github.com/cozy/cozy-libs/commit/215c25f1fcf42d130310c43437b8bf68ec9f8618))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * **viewer:** You must have `cozy-sharing >= 21.0.0`
17
+
18
+
19
+
20
+
21
+
22
+ ## [14.0.2](https://github.com/cozy/cozy-libs/compare/cozy-viewer@14.0.1...cozy-viewer@14.0.2) (2025-01-23)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **Viewer:** FooterContent wasn't using component correctly ([ab878f5](https://github.com/cozy/cozy-libs/commit/ab878f56c5b71d8bb12116adb062c47edd9ce056))
28
+
29
+
30
+
31
+
32
+
6
33
  ## [14.0.1](https://github.com/cozy/cozy-libs/compare/cozy-viewer@14.0.0...cozy-viewer@14.0.1) (2025-01-23)
7
34
 
8
35
  **Note:** Version bump only for package cozy-viewer
@@ -76,7 +76,7 @@ var FooterContent = function FooterContent(_ref) {
76
76
  settings: bottomSheetSettings
77
77
  }, /*#__PURE__*/_react.default.createElement(_BottomSheet.BottomSheetHeader, {
78
78
  className: (0, _classnames.default)('u-ph-1 u-pb-1', styles.bottomSheetHeader)
79
- }, /*#__PURE__*/_react.default.createElement(FooterActionButtonsWithFile, null)), /*#__PURE__*/_react.default.createElement(_BottomSheetContent.default, null));
79
+ }, FooterActionButtonsWithFile), /*#__PURE__*/_react.default.createElement(_BottomSheetContent.default, null));
80
80
  };
81
81
 
82
82
  FooterContent.propTypes = {
@@ -85,7 +85,7 @@ var Toolbar = function Toolbar(_ref) {
85
85
 
86
86
  var _useSharingInfos = (0, _cozySharing.useSharingInfos)(),
87
87
  isSharingShortcutCreated = _useSharingInfos.isSharingShortcutCreated,
88
- discoveryLink = _useSharingInfos.discoveryLink,
88
+ addSharingLink = _useSharingInfos.addSharingLink,
89
89
  loading = _useSharingInfos.loading;
90
90
 
91
91
  var _useSharingContext = (0, _cozySharing.useSharingContext)(),
@@ -133,7 +133,7 @@ var Toolbar = function Toolbar(_ref) {
133
133
  return setShowShareModal(true);
134
134
  }
135
135
  }), isCozySharing && isShareNotAdded && /*#__PURE__*/_react.default.createElement(_cozySharing.OpenSharingLinkButton, {
136
- link: discoveryLink,
136
+ link: addSharingLink,
137
137
  isSharingShortcutCreated: isSharingShortcutCreated,
138
138
  variant: "text",
139
139
  className: "u-white",
@@ -70,7 +70,8 @@ var ToolbarMoreMenu = function ToolbarMoreMenu() {
70
70
 
71
71
  var _useSharingInfos = (0, _cozySharing.useSharingInfos)(),
72
72
  isSharingShortcutCreated = _useSharingInfos.isSharingShortcutCreated,
73
- discoveryLink = _useSharingInfos.discoveryLink;
73
+ addSharingLink = _useSharingInfos.addSharingLink,
74
+ syncSharingLink = _useSharingInfos.syncSharingLink;
74
75
 
75
76
  var _useSharingContext = (0, _cozySharing.useSharingContext)(),
76
77
  hasWriteAccess = _useSharingContext.hasWriteAccess,
@@ -84,12 +85,13 @@ var ToolbarMoreMenu = function ToolbarMoreMenu() {
84
85
  var isPDFDoc = file.mime === 'application/pdf';
85
86
  var showPrintAction = isPDFDoc && isPrintAvailable;
86
87
  var isCozySharing = window.location.pathname === '/preview';
87
- var actions = (0, _Actions.makeActions)([_share.share, _cozySharing.openSharingLink, _Actions.download, showPrintAction && _Actions.print], {
88
+ var actions = (0, _Actions.makeActions)([_share.share, isCozySharing && _cozySharing.addToCozySharingLink, isCozySharing && _cozySharing.syncToCozySharingLink, isCozySharing && _Actions.divider, _Actions.download, showPrintAction && _Actions.print], {
88
89
  isSharingShortcutCreated: isSharingShortcutCreated,
89
90
  allLoaded: allLoaded,
90
91
  isPublic: isPublic,
91
92
  hasWriteAccess: hasWriteAccess,
92
- link: discoveryLink,
93
+ addSharingLink: addSharingLink,
94
+ syncSharingLink: syncSharingLink,
93
95
  openSharingLinkDisplayed: isCozySharing,
94
96
  setShowShareModal: setShowShareModal,
95
97
  encryptedUrl: url
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-viewer",
3
- "version": "14.0.1",
3
+ "version": "15.0.0",
4
4
  "description": "Cozy-Viewer provides a component to show files in a viewer.",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -27,10 +27,10 @@
27
27
  "babel-preset-cozy-app": "^2.8.1",
28
28
  "cozy-client": "^53.1.0",
29
29
  "cozy-device-helper": "2.0.0",
30
- "cozy-harvest-lib": "^32.2.21",
30
+ "cozy-harvest-lib": "^32.2.23",
31
31
  "cozy-intent": "^2.29.1",
32
32
  "cozy-logger": "^1.16.1",
33
- "cozy-sharing": "^21.0.0",
33
+ "cozy-sharing": "^21.1.0",
34
34
  "cozy-ui": "^117.1.0",
35
35
  "identity-obj-proxy": "3.0.0",
36
36
  "jest": "26.6.3",
@@ -54,10 +54,10 @@
54
54
  "cozy-harvest-lib": ">=32.2.5",
55
55
  "cozy-intent": ">=2.29.1",
56
56
  "cozy-logger": ">=1.9.0",
57
- "cozy-sharing": ">=20.0.0",
57
+ "cozy-sharing": ">=21.0.0",
58
58
  "cozy-ui": ">=117.1.0",
59
59
  "react": ">=16.12.0",
60
60
  "react-dom": ">=16.12.0"
61
61
  },
62
- "gitHead": "0c51f40c510be568da5c63ae617ec7493801161a"
62
+ "gitHead": "19590cbf95929995b0a626d3623983ec8c83a93a"
63
63
  }
@@ -53,7 +53,7 @@ const FooterContent = ({ toolbarRef, children }) => {
53
53
  <BottomSheetHeader
54
54
  className={cx('u-ph-1 u-pb-1', styles.bottomSheetHeader)}
55
55
  >
56
- <FooterActionButtonsWithFile />
56
+ {FooterActionButtonsWithFile}
57
57
  </BottomSheetHeader>
58
58
  <BottomSheetContent />
59
59
  </BottomSheet>
@@ -42,7 +42,8 @@ const Toolbar = ({
42
42
  const { t } = useI18n()
43
43
  const webviewIntent = useWebviewIntent()
44
44
  const { file } = useViewer()
45
- const { isSharingShortcutCreated, discoveryLink, loading } = useSharingInfos()
45
+ const { isSharingShortcutCreated, addSharingLink, loading } =
46
+ useSharingInfos()
46
47
  const { isOwner } = useSharingContext()
47
48
  const { setShowShareModal } = useShareModal()
48
49
 
@@ -94,7 +95,7 @@ const Toolbar = ({
94
95
  )}
95
96
  {isCozySharing && isShareNotAdded && (
96
97
  <OpenSharingLinkButton
97
- link={discoveryLink}
98
+ link={addSharingLink}
98
99
  isSharingShortcutCreated={isSharingShortcutCreated}
99
100
  variant="text"
100
101
  className="u-white"
@@ -3,7 +3,8 @@ import React, { useState, useRef, useEffect } from 'react'
3
3
 
4
4
  import { useWebviewIntent } from 'cozy-intent'
5
5
  import {
6
- openSharingLink,
6
+ addToCozySharingLink,
7
+ syncToCozySharingLink,
7
8
  useSharingInfos,
8
9
  useSharingContext
9
10
  } from 'cozy-sharing'
@@ -11,6 +12,7 @@ import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu'
11
12
  import {
12
13
  makeActions,
13
14
  download,
15
+ divider,
14
16
  print
15
17
  } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
16
18
  import Icon from 'cozy-ui/transpiled/react/Icon'
@@ -30,7 +32,8 @@ const ToolbarMoreMenu = () => {
30
32
  const { isDesktop } = useBreakpoints()
31
33
  const { url } = useEncrypted()
32
34
  const anchorRef = useRef()
33
- const { isSharingShortcutCreated, discoveryLink } = useSharingInfos()
35
+ const { isSharingShortcutCreated, addSharingLink, syncSharingLink } =
36
+ useSharingInfos()
34
37
  const { hasWriteAccess, allLoaded } = useSharingContext()
35
38
  const webviewIntent = useWebviewIntent()
36
39
  const { setShowShareModal } = useShareModal()
@@ -41,13 +44,21 @@ const ToolbarMoreMenu = () => {
41
44
  const isCozySharing = window.location.pathname === '/preview'
42
45
 
43
46
  const actions = makeActions(
44
- [share, openSharingLink, download, showPrintAction && print],
47
+ [
48
+ share,
49
+ isCozySharing && addToCozySharingLink,
50
+ isCozySharing && syncToCozySharingLink,
51
+ isCozySharing && divider,
52
+ download,
53
+ showPrintAction && print
54
+ ],
45
55
  {
46
56
  isSharingShortcutCreated,
47
57
  allLoaded,
48
58
  isPublic,
49
59
  hasWriteAccess,
50
- link: discoveryLink,
60
+ addSharingLink,
61
+ syncSharingLink,
51
62
  openSharingLinkDisplayed: isCozySharing,
52
63
  setShowShareModal: setShowShareModal,
53
64
  encryptedUrl: url