cozy-ui 122.12.0 → 122.12.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
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [122.12.1](https://github.com/cozy/cozy-ui/compare/v122.12.0...v122.12.1) (2025-05-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **AppLinker:** Call onAppSwitch in flagship app ([eced0d4](https://github.com/cozy/cozy-ui/commit/eced0d4))
|
|
7
|
+
|
|
1
8
|
# [122.12.0](https://github.com/cozy/cozy-ui/compare/v122.11.1...v122.12.0) (2025-05-05)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -33,7 +33,8 @@ export class AppLinker extends React.Component {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
static getOnClickHref(props, context, imgRef) {
|
|
36
|
-
const { app, client } = props
|
|
36
|
+
const { app, client, onAppSwitch } = props
|
|
37
|
+
|
|
37
38
|
let href = props.href
|
|
38
39
|
let onClick = null
|
|
39
40
|
|
|
@@ -53,6 +54,8 @@ export class AppLinker extends React.Component {
|
|
|
53
54
|
onClick: event => {
|
|
54
55
|
event.preventDefault()
|
|
55
56
|
|
|
57
|
+
onAppSwitch?.()
|
|
58
|
+
|
|
56
59
|
context
|
|
57
60
|
? context.call('openApp', href, app, imgPayload)
|
|
58
61
|
: logger.error(
|
|
@@ -70,16 +73,6 @@ export class AppLinker extends React.Component {
|
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
static onAppSwitch(onAppSwitchFn) {
|
|
74
|
-
if (typeof onAppSwitchFn === 'function') {
|
|
75
|
-
onAppSwitchFn()
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
static openWeb(props) {
|
|
80
|
-
AppLinker.onAppSwitch(props.onAppSwitch)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
76
|
render() {
|
|
84
77
|
const { children } = this.props
|
|
85
78
|
|
|
@@ -72,7 +72,8 @@ export var AppLinker = /*#__PURE__*/function (_React$Component) {
|
|
|
72
72
|
key: "getOnClickHref",
|
|
73
73
|
value: function getOnClickHref(props, context, imgRef) {
|
|
74
74
|
var app = props.app,
|
|
75
|
-
client = props.client
|
|
75
|
+
client = props.client,
|
|
76
|
+
onAppSwitch = props.onAppSwitch;
|
|
76
77
|
var href = props.href;
|
|
77
78
|
var onClick = null;
|
|
78
79
|
|
|
@@ -85,6 +86,7 @@ export var AppLinker = /*#__PURE__*/function (_React$Component) {
|
|
|
85
86
|
return {
|
|
86
87
|
onClick: function onClick(event) {
|
|
87
88
|
event.preventDefault();
|
|
89
|
+
onAppSwitch === null || onAppSwitch === void 0 ? void 0 : onAppSwitch();
|
|
88
90
|
context ? context.call('openApp', href, app, imgPayload) : logger.error("Failed to \"openApp(".concat(app, ")\". WebviewService has the following falsy value \"").concat(context, "\" in AppLinker's context."));
|
|
89
91
|
},
|
|
90
92
|
href: '#'
|
|
@@ -97,18 +99,6 @@ export var AppLinker = /*#__PURE__*/function (_React$Component) {
|
|
|
97
99
|
onClick: onClick
|
|
98
100
|
};
|
|
99
101
|
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "onAppSwitch",
|
|
102
|
-
value: function onAppSwitch(onAppSwitchFn) {
|
|
103
|
-
if (typeof onAppSwitchFn === 'function') {
|
|
104
|
-
onAppSwitchFn();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}, {
|
|
108
|
-
key: "openWeb",
|
|
109
|
-
value: function openWeb(props) {
|
|
110
|
-
AppLinker.onAppSwitch(props.onAppSwitch);
|
|
111
|
-
}
|
|
112
102
|
}]);
|
|
113
103
|
|
|
114
104
|
return AppLinker;
|