cozy-viewer 12.0.0 → 12.0.2

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,25 @@
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
+ ## [12.0.2](https://github.com/cozy/cozy-libs/compare/cozy-viewer@12.0.1...cozy-viewer@12.0.2) (2025-01-08)
7
+
8
+ **Note:** Version bump only for package cozy-viewer
9
+
10
+
11
+
12
+
13
+
14
+ ## [12.0.1](https://github.com/cozy/cozy-libs/compare/cozy-viewer@12.0.0...cozy-viewer@12.0.1) (2025-01-07)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **Viewer:** Now use intent inner dialog backdrop instead of custom one ([e0c8882](https://github.com/cozy/cozy-libs/commit/e0c8882ba7f80cde51dd7398216f9c137a99479f))
20
+
21
+
22
+
23
+
24
+
6
25
  # [12.0.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@11.4.0...cozy-viewer@12.0.0) (2025-01-07)
7
26
 
8
27
 
@@ -9,47 +9,23 @@ exports.default = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
13
 
16
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
17
15
 
18
- var _react = _interopRequireWildcard(require("react"));
19
-
20
- var _Backdrop = _interopRequireDefault(require("cozy-ui/transpiled/react/Backdrop"));
16
+ var _react = _interopRequireDefault(require("react"));
21
17
 
22
18
  var _IntentDialogOpener = _interopRequireDefault(require("cozy-ui/transpiled/react/IntentDialogOpener"));
23
19
 
24
- var _Portal = _interopRequireDefault(require("cozy-ui/transpiled/react/Portal"));
25
-
26
- var _excluded = ["children"],
27
- _excluded2 = ["action", "doctype", "options", "disabled", "children"];
28
-
29
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ var _excluded = ["action", "doctype", "options", "disabled", "children"];
30
21
 
31
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
32
-
33
- var PortalBackdrop = function PortalBackdrop(_ref) {
34
- var children = _ref.children,
22
+ var IntentOpener = function IntentOpener(_ref) {
23
+ var action = _ref.action,
24
+ doctype = _ref.doctype,
25
+ options = _ref.options,
26
+ disabled = _ref.disabled,
27
+ children = _ref.children,
35
28
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
36
- return /*#__PURE__*/_react.default.createElement(_Portal.default, {
37
- into: "body"
38
- }, /*#__PURE__*/_react.default.createElement(_Backdrop.default, props, children));
39
- };
40
-
41
- var IntentOpener = function IntentOpener(_ref2) {
42
- var action = _ref2.action,
43
- doctype = _ref2.doctype,
44
- options = _ref2.options,
45
- disabled = _ref2.disabled,
46
- children = _ref2.children,
47
- props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
48
-
49
- var _useState = (0, _react.useState)(true),
50
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
51
- isLoading = _useState2[0],
52
- setIsLoading = _useState2[1];
53
29
 
54
30
  if (disabled) {
55
31
  return children;
@@ -59,18 +35,17 @@ var IntentOpener = function IntentOpener(_ref2) {
59
35
  action: action,
60
36
  doctype: doctype,
61
37
  options: options,
62
- Component: PortalBackdrop,
63
- invisible: !isLoading,
64
- isOver: true,
65
38
  showCloseButton: false,
66
39
  iframeProps: {
67
40
  spinnerProps: {
68
41
  className: 'u-m-0',
69
42
  middle: true,
70
43
  color: 'white'
71
- },
72
- setIsLoading: setIsLoading
73
- }
44
+ }
45
+ },
46
+ fullScreen: true,
47
+ fullWidth: true,
48
+ PaperComponent: "div"
74
49
  }), children);
75
50
  };
76
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-viewer",
3
- "version": "12.0.0",
3
+ "version": "12.0.2",
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": "^52.1.0",
29
29
  "cozy-device-helper": "2.0.0",
30
- "cozy-harvest-lib": "^32.2.2",
30
+ "cozy-harvest-lib": "^32.2.4",
31
31
  "cozy-intent": "^2.29.1",
32
32
  "cozy-logger": "^1.16.1",
33
- "cozy-sharing": "^18.0.0",
33
+ "cozy-sharing": "^19.0.0",
34
34
  "cozy-ui": "^116.0.0",
35
35
  "identity-obj-proxy": "3.0.0",
36
36
  "jest": "26.6.3",
@@ -59,5 +59,5 @@
59
59
  "react": ">=16.12.0",
60
60
  "react-dom": ">=16.12.0"
61
61
  },
62
- "gitHead": "e8122fd96a5dbfda7f6b445c60bb34c4b14004d8"
62
+ "gitHead": "74889d160e15166c4aa132e4fc8c77ebe95c62ae"
63
63
  }
@@ -1,17 +1,7 @@
1
1
  import PropTypes from 'prop-types'
2
- import React, { useState } from 'react'
2
+ import React from 'react'
3
3
 
4
- import Backdrop from 'cozy-ui/transpiled/react/Backdrop'
5
4
  import IntentDialogOpener from 'cozy-ui/transpiled/react/IntentDialogOpener'
6
- import Portal from 'cozy-ui/transpiled/react/Portal'
7
-
8
- const PortalBackdrop = ({ children, ...props }) => {
9
- return (
10
- <Portal into="body">
11
- <Backdrop {...props}>{children}</Backdrop>
12
- </Portal>
13
- )
14
- }
15
5
 
16
6
  const IntentOpener = ({
17
7
  action,
@@ -21,8 +11,6 @@ const IntentOpener = ({
21
11
  children,
22
12
  ...props
23
13
  }) => {
24
- const [isLoading, setIsLoading] = useState(true)
25
-
26
14
  if (disabled) {
27
15
  return children
28
16
  }
@@ -33,14 +21,13 @@ const IntentOpener = ({
33
21
  action={action}
34
22
  doctype={doctype}
35
23
  options={options}
36
- Component={PortalBackdrop}
37
- invisible={!isLoading}
38
- isOver
39
24
  showCloseButton={false}
40
25
  iframeProps={{
41
- spinnerProps: { className: 'u-m-0', middle: true, color: 'white' },
42
- setIsLoading
26
+ spinnerProps: { className: 'u-m-0', middle: true, color: 'white' }
43
27
  }}
28
+ fullScreen
29
+ fullWidth
30
+ PaperComponent="div"
44
31
  >
45
32
  {children}
46
33
  </IntentDialogOpener>