cozy-viewer 17.0.0 → 18.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,27 @@
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
+ # [18.0.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@17.0.0...cozy-viewer@18.0.0) (2025-02-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **Viewer:** Replace Modal by Dialog and add better click propagation ([26a49e0](https://github.com/cozy/cozy-libs/commit/26a49e0868f017634367e0a82d24d8fb4e4e6782))
12
+
13
+
14
+ ### Features
15
+
16
+ * Upgrade cozy-ui ([15e3419](https://github.com/cozy/cozy-libs/commit/15e3419eea04917239adfadedb78feed667f4a9f))
17
+
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ * You must have `cozy-ui >=117.2.2`
22
+
23
+
24
+
25
+
26
+
6
27
  # [17.0.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@16.2.1...cozy-viewer@17.0.0) (2025-02-04)
7
28
 
8
29
 
@@ -8,6 +8,8 @@ declare namespace ViewerContainerWrapper {
8
8
  namespace componentsProps {
9
9
  namespace modalProps {
10
10
  const open: boolean;
11
+ const fullScreen: boolean;
12
+ const fullWidth: boolean;
11
13
  }
12
14
  }
13
15
  }
@@ -31,7 +31,7 @@ var _permission = require("cozy-client/dist/models/permission");
31
31
 
32
32
  var _cozySharing = _interopRequireWildcard(require("cozy-sharing"));
33
33
 
34
- var _Modal = _interopRequireDefault(require("cozy-ui/transpiled/react/Modal"));
34
+ var _Dialog = _interopRequireDefault(require("cozy-ui/transpiled/react/Dialog"));
35
35
 
36
36
  var _proptypes = require("cozy-ui/transpiled/react/proptypes");
37
37
 
@@ -39,8 +39,6 @@ var _Alert = _interopRequireDefault(require("cozy-ui/transpiled/react/providers/
39
39
 
40
40
  var _Breakpoints = _interopRequireDefault(require("cozy-ui/transpiled/react/providers/Breakpoints"));
41
41
 
42
- var _CozyTheme = require("cozy-ui/transpiled/react/providers/CozyTheme");
43
-
44
42
  var _Encrypted = _interopRequireDefault(require("cozy-ui/transpiled/react/providers/Encrypted"));
45
43
 
46
44
  var _I18n = require("cozy-ui/transpiled/react/providers/I18n");
@@ -267,29 +265,27 @@ var ViewerContainerWrapper = function ViewerContainerWrapper(_ref2) {
267
265
  var disableModal = _ref2.disableModal,
268
266
  props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
269
267
 
270
- var _useCozyTheme = (0, _CozyTheme.useCozyTheme)(),
271
- type = _useCozyTheme.type,
272
- variant = _useCozyTheme.variant;
273
-
274
268
  var _ref3 = props.componentsProps || {},
275
269
  _ref3$modalProps = _ref3.modalProps,
276
270
  modalProps = _ref3$modalProps === void 0 ? {
277
- open: true
271
+ open: true,
272
+ fullScreen: true,
273
+ fullWidth: true
278
274
  } : _ref3$modalProps;
279
275
 
280
276
  if (disableModal) {
281
277
  return /*#__PURE__*/_react.default.createElement(ViewerContainer, props);
282
278
  }
283
279
 
284
- return /*#__PURE__*/_react.default.createElement(_Modal.default, (0, _extends2.default)({}, modalProps, {
285
- className: "CozyTheme--".concat(type, "-").concat(variant)
286
- }), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(ViewerContainer, props)));
280
+ return /*#__PURE__*/_react.default.createElement(_Dialog.default, modalProps, /*#__PURE__*/_react.default.createElement(ViewerContainer, props));
287
281
  };
288
282
 
289
283
  ViewerContainerWrapper.defaultProps = {
290
284
  componentsProps: {
291
285
  modalProps: {
292
- open: true
286
+ open: true,
287
+ fullScreen: true,
288
+ fullWidth: true
293
289
  }
294
290
  }
295
291
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-viewer",
3
- "version": "17.0.0",
3
+ "version": "18.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,11 +27,11 @@
27
27
  "babel-preset-cozy-app": "^2.8.1",
28
28
  "cozy-client": "^53.1.1",
29
29
  "cozy-device-helper": "2.0.0",
30
- "cozy-harvest-lib": "^32.2.31",
30
+ "cozy-harvest-lib": "^32.2.32",
31
31
  "cozy-intent": "^2.29.2",
32
32
  "cozy-logger": "^1.16.1",
33
33
  "cozy-sharing": "^21.2.2",
34
- "cozy-ui": "^117.2.0",
34
+ "cozy-ui": "^117.2.2",
35
35
  "identity-obj-proxy": "3.0.0",
36
36
  "jest": "26.6.3",
37
37
  "jest-canvas-mock": "2.3.1",
@@ -55,9 +55,9 @@
55
55
  "cozy-intent": ">=2.29.1",
56
56
  "cozy-logger": ">=1.9.0",
57
57
  "cozy-sharing": ">=21.2.2",
58
- "cozy-ui": ">=117.2.0",
58
+ "cozy-ui": ">=117.2.2",
59
59
  "react": ">=16.12.0",
60
60
  "react-dom": ">=16.12.0"
61
61
  },
62
- "gitHead": "b401142915731e066c5f2e78830f9eecb26326f8"
62
+ "gitHead": "2f737393a33f6a9d22cf22779ce86bd40eca5979"
63
63
  }
@@ -6,11 +6,10 @@ import { useClient } from 'cozy-client'
6
6
  import { isDocumentReadOnly } from 'cozy-client/dist/models/permission'
7
7
  import SharingProvider from 'cozy-sharing'
8
8
  import { useSharingContext } from 'cozy-sharing'
9
- import Modal from 'cozy-ui/transpiled/react/Modal'
9
+ import Dialog from 'cozy-ui/transpiled/react/Dialog'
10
10
  import { FileDoctype } from 'cozy-ui/transpiled/react/proptypes'
11
11
  import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert'
12
12
  import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
13
- import { useCozyTheme } from 'cozy-ui/transpiled/react/providers/CozyTheme'
14
13
  import EncryptedProvider from 'cozy-ui/transpiled/react/providers/Encrypted'
15
14
  import { useExtendI18n } from 'cozy-ui/transpiled/react/providers/I18n'
16
15
 
@@ -194,27 +193,26 @@ ViewerContainer.defaultProps = {
194
193
  }
195
194
 
196
195
  const ViewerContainerWrapper = ({ disableModal, ...props }) => {
197
- const { type, variant } = useCozyTheme()
198
- const { modalProps = { open: true } } = props.componentsProps || {}
196
+ const { modalProps = { open: true, fullScreen: true, fullWidth: true } } =
197
+ props.componentsProps || {}
199
198
 
200
199
  if (disableModal) {
201
200
  return <ViewerContainer {...props} />
202
201
  }
203
202
 
204
203
  return (
205
- <Modal {...modalProps} className={`CozyTheme--${type}-${variant}`}>
206
- {/* This div is needed for the Modal ref */}
207
- <div>
208
- <ViewerContainer {...props} />
209
- </div>
210
- </Modal>
204
+ <Dialog {...modalProps}>
205
+ <ViewerContainer {...props} />
206
+ </Dialog>
211
207
  )
212
208
  }
213
209
 
214
210
  ViewerContainerWrapper.defaultProps = {
215
211
  componentsProps: {
216
212
  modalProps: {
217
- open: true
213
+ open: true,
214
+ fullScreen: true,
215
+ fullWidth: true
218
216
  }
219
217
  }
220
218
  }