cozy-ui-plus 12.0.3 → 12.1.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 +10 -0
- package/dist/Intent/IntentDialogOpener/index.js +6 -1
- package/dist/Intent/IntentIframe/index.js +8 -2
- package/dist/src/Intent/IntentDialogOpener/index.d.ts +1 -0
- package/package.json +4 -4
- package/src/Intent/IntentDialogOpener/index.jsx +4 -0
- package/src/Intent/IntentIframe/index.jsx +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.1.1](https://github.com/cozy/cozy-libs/compare/cozy-ui-plus@12.1.0...cozy-ui-plus@12.1.1) (2026-07-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package cozy-ui-plus
|
|
9
|
+
|
|
10
|
+
# [12.1.0](https://github.com/cozy/cozy-libs/compare/cozy-ui-plus@12.0.3...cozy-ui-plus@12.1.0) (2026-07-21)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **cozy-ui-plus:** Thread onReadyToUse through IntentDialogOpener ([7598656](https://github.com/cozy/cozy-libs/commit/75986568d5fb3b4a5304bc21291a69a093705534))
|
|
15
|
+
|
|
6
16
|
## [12.0.3](https://github.com/cozy/cozy-libs/compare/cozy-ui-plus@12.0.2...cozy-ui-plus@12.0.3) (2026-07-17)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package cozy-ui-plus
|
|
@@ -23,7 +23,7 @@ var _Dialog = _interopRequireDefault(require("cozy-ui/transpiled/react/Dialog"))
|
|
|
23
23
|
|
|
24
24
|
var _IntentIframe = _interopRequireWildcard(require("../IntentIframe"));
|
|
25
25
|
|
|
26
|
-
var _excluded = ["options", "action", "doctype", "children", "closable", "showCloseButton", "create", "tag", "onComplete", "onDismiss", "iframeProps", "Component"];
|
|
26
|
+
var _excluded = ["options", "action", "doctype", "children", "closable", "showCloseButton", "create", "tag", "onComplete", "onDismiss", "onReadyToUse", "iframeProps", "Component"];
|
|
27
27
|
|
|
28
28
|
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); }
|
|
29
29
|
|
|
@@ -44,6 +44,7 @@ var IntentDialogOpener = function IntentDialogOpener(props) {
|
|
|
44
44
|
tag = props.tag,
|
|
45
45
|
onComplete = props.onComplete,
|
|
46
46
|
onDismiss = props.onDismiss,
|
|
47
|
+
onReadyToUse = props.onReadyToUse,
|
|
47
48
|
iframeProps = props.iframeProps,
|
|
48
49
|
Component = props.Component,
|
|
49
50
|
componentProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
@@ -94,6 +95,7 @@ var IntentDialogOpener = function IntentDialogOpener(props) {
|
|
|
94
95
|
create: create,
|
|
95
96
|
onCancel: handleDismiss,
|
|
96
97
|
onTerminate: handleComplete,
|
|
98
|
+
onReadyToUse: onReadyToUse,
|
|
97
99
|
iframeProps: iframeProps
|
|
98
100
|
})));
|
|
99
101
|
}
|
|
@@ -111,6 +113,9 @@ IntentDialogOpener.propTypes = {
|
|
|
111
113
|
/** What should happen when the intent has dismissed */
|
|
112
114
|
onDismiss: _propTypes.default.func,
|
|
113
115
|
|
|
116
|
+
/** Called when the intent service signals it is ready to use */
|
|
117
|
+
onReadyToUse: _propTypes.default.func,
|
|
118
|
+
|
|
114
119
|
/** Action you want to execute */
|
|
115
120
|
action: _propTypes.default.string.isRequired,
|
|
116
121
|
|
|
@@ -113,7 +113,12 @@ var IntentIframe = /*#__PURE__*/function (_React$Component) {
|
|
|
113
113
|
this.setState({
|
|
114
114
|
loading: true
|
|
115
115
|
});
|
|
116
|
-
create(action, type, _objectSpread(_objectSpread({}, DEFAULT_DATA), data)).start(this.intentViewer,
|
|
116
|
+
create(action, type, _objectSpread(_objectSpread({}, DEFAULT_DATA), data)).start(this.intentViewer, {
|
|
117
|
+
onReady: this.onFrameLoaded,
|
|
118
|
+
onHideCross: this.props.onHideCross,
|
|
119
|
+
onShowCross: this.props.onShowCross,
|
|
120
|
+
onReadyToUse: this.props.onReadyToUse
|
|
121
|
+
}).then(function (result) {
|
|
117
122
|
// eslint-disable-next-line promise/always-return
|
|
118
123
|
result ? onTerminate && onTerminate(result) : onCancel();
|
|
119
124
|
}).catch(function (error) {
|
|
@@ -171,7 +176,8 @@ IntentIframe.propTypes = {
|
|
|
171
176
|
onTerminate: _propTypes.default.func.isRequired,
|
|
172
177
|
iframeProps: iframeProps,
|
|
173
178
|
onHideCross: _propTypes.default.func,
|
|
174
|
-
onShowCross: _propTypes.default.func
|
|
179
|
+
onShowCross: _propTypes.default.func,
|
|
180
|
+
onReadyToUse: _propTypes.default.func
|
|
175
181
|
};
|
|
176
182
|
IntentIframe.defaultProps = {
|
|
177
183
|
data: {}
|
|
@@ -9,6 +9,7 @@ declare namespace IntentDialogOpener {
|
|
|
9
9
|
export let children: PropTypes.Validator<PropTypes.ReactElementLike>;
|
|
10
10
|
export let onComplete: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
11
|
export let onDismiss: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
+
export let onReadyToUse: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
13
|
export let action: PropTypes.Validator<string>;
|
|
13
14
|
export let doctype: PropTypes.Validator<string>;
|
|
14
15
|
export let closable: PropTypes.Validator<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-ui-plus",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.1",
|
|
4
4
|
"description": "Cozy-ui-plus is an extension of cozy-ui and provides components based on cozy-client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"cozy-client": "^60.21.3",
|
|
37
37
|
"cozy-device-helper": "2.0.0",
|
|
38
38
|
"cozy-intent": "^2.31.1",
|
|
39
|
-
"cozy-interapp": "^0.
|
|
39
|
+
"cozy-interapp": "^0.18.0",
|
|
40
40
|
"cozy-logger": "^1.18.1",
|
|
41
|
-
"cozy-sharing": "^37.0
|
|
41
|
+
"cozy-sharing": "^37.1.0",
|
|
42
42
|
"cozy-stack-client": "^60.21.1",
|
|
43
43
|
"cozy-ui": "^138.1.0",
|
|
44
44
|
"jest": "30.3.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"react-dom": "^16 || ^17 || ^18",
|
|
79
79
|
"twake-i18n": ">=0.3.0"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "bcee49f770c0e868d6f8d84a73211559cf67c40d"
|
|
82
82
|
}
|
|
@@ -22,6 +22,7 @@ const IntentDialogOpener = props => {
|
|
|
22
22
|
tag,
|
|
23
23
|
onComplete,
|
|
24
24
|
onDismiss,
|
|
25
|
+
onReadyToUse,
|
|
25
26
|
iframeProps,
|
|
26
27
|
Component,
|
|
27
28
|
...componentProps
|
|
@@ -68,6 +69,7 @@ const IntentDialogOpener = props => {
|
|
|
68
69
|
create={create}
|
|
69
70
|
onCancel={handleDismiss}
|
|
70
71
|
onTerminate={handleComplete}
|
|
72
|
+
onReadyToUse={onReadyToUse}
|
|
71
73
|
iframeProps={iframeProps}
|
|
72
74
|
/>
|
|
73
75
|
</Component>
|
|
@@ -84,6 +86,8 @@ IntentDialogOpener.propTypes = {
|
|
|
84
86
|
onComplete: PropTypes.func,
|
|
85
87
|
/** What should happen when the intent has dismissed */
|
|
86
88
|
onDismiss: PropTypes.func,
|
|
89
|
+
/** Called when the intent service signals it is ready to use */
|
|
90
|
+
onReadyToUse: PropTypes.func,
|
|
87
91
|
/** Action you want to execute */
|
|
88
92
|
action: PropTypes.string.isRequired,
|
|
89
93
|
/** Doctype on which you want to execute the action */
|
|
@@ -41,12 +41,12 @@ class IntentIframe extends React.Component {
|
|
|
41
41
|
...DEFAULT_DATA,
|
|
42
42
|
...data
|
|
43
43
|
})
|
|
44
|
-
.start(
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
this.props.
|
|
48
|
-
this.props.
|
|
49
|
-
)
|
|
44
|
+
.start(this.intentViewer, {
|
|
45
|
+
onReady: this.onFrameLoaded,
|
|
46
|
+
onHideCross: this.props.onHideCross,
|
|
47
|
+
onShowCross: this.props.onShowCross,
|
|
48
|
+
onReadyToUse: this.props.onReadyToUse
|
|
49
|
+
})
|
|
50
50
|
.then(result => {
|
|
51
51
|
// eslint-disable-next-line promise/always-return
|
|
52
52
|
result ? onTerminate && onTerminate(result) : onCancel()
|
|
@@ -102,7 +102,8 @@ IntentIframe.propTypes = {
|
|
|
102
102
|
onTerminate: PropTypes.func.isRequired,
|
|
103
103
|
iframeProps: iframeProps,
|
|
104
104
|
onHideCross: PropTypes.func,
|
|
105
|
-
onShowCross: PropTypes.func
|
|
105
|
+
onShowCross: PropTypes.func,
|
|
106
|
+
onReadyToUse: PropTypes.func
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
IntentIframe.defaultProps = {
|