cozy-ui 122.12.0 → 122.13.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
@@ -1,3 +1,17 @@
1
+ # [122.13.0](https://github.com/cozy/cozy-ui/compare/v122.12.1...v122.13.0) (2025-05-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * Update isTwakeTheme condition to force it to `true` ([a1db759](https://github.com/cozy/cozy-ui/commit/a1db759))
7
+
8
+ ## [122.12.1](https://github.com/cozy/cozy-ui/compare/v122.12.0...v122.12.1) (2025-05-07)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **AppLinker:** Call onAppSwitch in flagship app ([eced0d4](https://github.com/cozy/cozy-ui/commit/eced0d4))
14
+
1
15
  # [122.12.0](https://github.com/cozy/cozy-ui/compare/v122.11.1...v122.12.0) (2025-05-05)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "122.12.0",
3
+ "version": "122.13.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -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
 
@@ -1,7 +1,5 @@
1
- import flag from 'cozy-flags'
2
-
3
1
  /**
4
- * Relies on flag and local storage to determine if the Twake theme is enabled
2
+ * Forced to `true`, we don't want to use Cozy theme anymore
5
3
  * @returns {boolean}
6
4
  */
7
5
  export const isTwakeTheme = () => {
@@ -9,8 +7,5 @@ export const isTwakeTheme = () => {
9
7
  return false
10
8
  }
11
9
 
12
- return (
13
- flag('ui.theme-twake.enabled') ||
14
- localStorage.getItem('ui-theme-name') === 'Twake'
15
- )
10
+ return true
16
11
  }
@@ -8,8 +8,6 @@ export class AppLinker extends React.Component<any, any, any> {
8
8
  href: any;
9
9
  onClick: null;
10
10
  };
11
- static onAppSwitch(onAppSwitchFn: any): void;
12
- static openWeb(props: any): void;
13
11
  constructor(props: any);
14
12
  state: {
15
13
  imgRef: null;
@@ -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;
@@ -1,13 +1,11 @@
1
- import flag from 'cozy-flags';
2
1
  /**
3
- * Relies on flag and local storage to determine if the Twake theme is enabled
2
+ * Forced to `true`, we don't want to use Cozy theme anymore
4
3
  * @returns {boolean}
5
4
  */
6
-
7
5
  export var isTwakeTheme = function isTwakeTheme() {
8
6
  if (process.env.NODE_ENV === 'test') {
9
7
  return false;
10
8
  }
11
9
 
12
- return flag('ui.theme-twake.enabled') || localStorage.getItem('ui-theme-name') === 'Twake';
10
+ return true;
13
11
  };