cozy-viewer 26.6.0 → 26.6.1

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,12 @@
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
+ ## [26.6.1](https://github.com/cozy/cozy-libs/compare/cozy-viewer@26.6.0...cozy-viewer@26.6.1) (2026-01-29)
7
+
8
+ ### Bug Fixes
9
+
10
+ - Hide summarize button in public view :bug: ([d0317a0](https://github.com/cozy/cozy-libs/commit/d0317a0a663ddfbf63414a181161fa0de006b10d))
11
+
6
12
  # [26.6.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@26.5.2...cozy-viewer@26.6.0) (2026-01-28)
7
13
 
8
14
  ### Features
package/dist/Viewer.d.ts CHANGED
@@ -23,6 +23,7 @@ declare namespace Viewer {
23
23
  showClose: PropTypes.Requireable<boolean>;
24
24
  toolbarRef: PropTypes.Requireable<object>;
25
25
  showFilePath: PropTypes.Requireable<boolean>;
26
+ hideSummarizeBtn: PropTypes.Requireable<boolean>;
26
27
  }>>;
27
28
  }>>;
28
29
  }
@@ -79,7 +79,8 @@ var Toolbar = function Toolbar(_ref) {
79
79
  isDesktop = _ref.breakpoints.isDesktop,
80
80
  children = _ref.children,
81
81
  showFilePath = _ref.showFilePath,
82
- onPaywallRedirect = _ref.onPaywallRedirect;
82
+ onPaywallRedirect = _ref.onPaywallRedirect,
83
+ hideSummarizeBtn = _ref.hideSummarizeBtn;
83
84
  var client = (0, _cozyClient.useClient)();
84
85
 
85
86
  var _useI18n = (0, _twakeI18n.useI18n)(),
@@ -149,7 +150,7 @@ var Toolbar = function Toolbar(_ref) {
149
150
  className: "u-white",
150
151
  color: "default",
151
152
  isShortLabel: true
152
- }), /*#__PURE__*/_react.default.createElement(_SummarizeByAIButton.default, {
153
+ }), !hideSummarizeBtn && /*#__PURE__*/_react.default.createElement(_SummarizeByAIButton.default, {
153
154
  onPaywallRedirect: onPaywallRedirect
154
155
  }), /*#__PURE__*/_react.default.createElement(_Buttons.default, {
155
156
  className: "u-white",
@@ -178,7 +179,8 @@ Toolbar.propTypes = {
178
179
  onMouseLeave: _propTypes.default.func.isRequired,
179
180
  onClose: _propTypes.default.func,
180
181
  showFilePath: _propTypes.default.bool,
181
- onPaywallRedirect: _propTypes.default.func
182
+ onPaywallRedirect: _propTypes.default.func,
183
+ hideSummarizeBtn: _propTypes.default.bool
182
184
  };
183
185
 
184
186
  var _default = (0, _withBreakpoints.default)()(Toolbar);
@@ -203,7 +203,8 @@ var ViewerControls = /*#__PURE__*/function (_Component) {
203
203
  showClose = toolbarProps.showClose,
204
204
  toolbarRef = toolbarProps.toolbarRef,
205
205
  showFilePath = toolbarProps.showFilePath,
206
- onPaywallRedirect = toolbarProps.onPaywallRedirect;
206
+ onPaywallRedirect = toolbarProps.onPaywallRedirect,
207
+ hideSummarizeBtn = toolbarProps.hideSummarizeBtn;
207
208
  var hidden = this.state.hidden;
208
209
  return /*#__PURE__*/_react.default.createElement("div", {
209
210
  className: (0, _classnames.default)(styles['viewer-controls'], (_cx = {}, (0, _defineProperty2.default)(_cx, styles['viewer-controls--expanded'], expanded), (0, _defineProperty2.default)(_cx, classes.viewerControlsWithInfo, showInfoPanel && !fullWidth), (0, _defineProperty2.default)(_cx, classes.viewerControlsWithoutInfo, fullWidth), _cx)),
@@ -216,7 +217,8 @@ var ViewerControls = /*#__PURE__*/function (_Component) {
216
217
  onMouseEnter: this.showControls,
217
218
  onMouseLeave: this.hideControls,
218
219
  onClose: showClose ? onClose : undefined,
219
- onPaywallRedirect: onPaywallRedirect
220
+ onPaywallRedirect: onPaywallRedirect,
221
+ hideSummarizeBtn: hideSummarizeBtn
220
222
  }, children), showNavigation && isDesktop && hasPrevious && /*#__PURE__*/_react.default.createElement(_Navigation.default, {
221
223
  className: styles['viewer-nav--previous'],
222
224
  hidden: hidden,
@@ -3,5 +3,6 @@ export namespace toolbarPropsPropType {
3
3
  let showClose: PropTypes.Requireable<boolean>;
4
4
  let toolbarRef: PropTypes.Requireable<object>;
5
5
  let showFilePath: PropTypes.Requireable<boolean>;
6
+ let hideSummarizeBtn: PropTypes.Requireable<boolean>;
6
7
  }
7
8
  import PropTypes from 'prop-types';
package/dist/proptypes.js CHANGED
@@ -20,6 +20,9 @@ var toolbarPropsPropType = {
20
20
  toolbarRef: _propTypes.default.object,
21
21
 
22
22
  /** Whether to show file path below his name */
23
- showFilePath: _propTypes.default.bool
23
+ showFilePath: _propTypes.default.bool,
24
+
25
+ /** Whether to hide summize button or not */
26
+ hideSummarizeBtn: _propTypes.default.bool
24
27
  };
25
28
  exports.toolbarPropsPropType = toolbarPropsPropType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-viewer",
3
- "version": "26.6.0",
3
+ "version": "26.6.1",
4
4
  "description": "Cozy-Viewer provides a component to show files in a viewer.",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "babel-preset-cozy-app": "^2.8.2",
32
32
  "cozy-client": "^60.20.0",
33
33
  "cozy-device-helper": "2.0.0",
34
- "cozy-harvest-lib": "^36.0.22",
34
+ "cozy-harvest-lib": "^36.0.23",
35
35
  "cozy-intent": "^2.30.1",
36
36
  "cozy-logger": "^1.17.0",
37
37
  "cozy-sharing": "^28.3.0",
@@ -70,5 +70,5 @@
70
70
  "react-router-dom": ">=6.14.2",
71
71
  "twake-i18n": ">=0.3.0"
72
72
  },
73
- "gitHead": "558b7c11e2851cf22d5563152bc071667e29cc86"
73
+ "gitHead": "6c267ecfc5f6288d2781f4a737763bc5e5e76c1f"
74
74
  }
@@ -39,7 +39,8 @@ const Toolbar = ({
39
39
  breakpoints: { isDesktop },
40
40
  children,
41
41
  showFilePath,
42
- onPaywallRedirect
42
+ onPaywallRedirect,
43
+ hideSummarizeBtn
43
44
  }) => {
44
45
  const client = useClient()
45
46
  const { t } = useI18n()
@@ -111,7 +112,9 @@ const Toolbar = ({
111
112
  isShortLabel
112
113
  />
113
114
  )}
114
- <SummarizeByAIButton onPaywallRedirect={onPaywallRedirect} />
115
+ {!hideSummarizeBtn && (
116
+ <SummarizeByAIButton onPaywallRedirect={onPaywallRedirect} />
117
+ )}
115
118
  <Button
116
119
  className="u-white"
117
120
  variant="text"
@@ -141,7 +144,8 @@ Toolbar.propTypes = {
141
144
  onMouseLeave: PropTypes.func.isRequired,
142
145
  onClose: PropTypes.func,
143
146
  showFilePath: PropTypes.bool,
144
- onPaywallRedirect: PropTypes.func
147
+ onPaywallRedirect: PropTypes.func,
148
+ hideSummarizeBtn: PropTypes.bool
145
149
  }
146
150
 
147
151
  export default withBreakpoints()(Toolbar)
@@ -129,7 +129,8 @@ class ViewerControls extends Component {
129
129
  showClose,
130
130
  toolbarRef,
131
131
  showFilePath,
132
- onPaywallRedirect
132
+ onPaywallRedirect,
133
+ hideSummarizeBtn
133
134
  } = toolbarProps
134
135
  const { hidden } = this.state
135
136
 
@@ -152,6 +153,7 @@ class ViewerControls extends Component {
152
153
  onMouseLeave={this.hideControls}
153
154
  onClose={showClose ? onClose : undefined}
154
155
  onPaywallRedirect={onPaywallRedirect}
156
+ hideSummarizeBtn={hideSummarizeBtn}
155
157
  >
156
158
  {children}
157
159
  </Toolbar>
package/src/proptypes.js CHANGED
@@ -8,5 +8,7 @@ export const toolbarPropsPropType = {
8
8
  /** React reference of the toolbar node */
9
9
  toolbarRef: PropTypes.object,
10
10
  /** Whether to show file path below his name */
11
- showFilePath: PropTypes.bool
11
+ showFilePath: PropTypes.bool,
12
+ /** Whether to hide summize button or not */
13
+ hideSummarizeBtn: PropTypes.bool
12
14
  }