cozy-bar 33.0.1 → 33.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/README.md +3 -24
- package/dist/components/Bar.js +22 -93
- package/dist/components/BarComponent.js +0 -2
- package/dist/components/Elements/BarLeft.js +90 -0
- package/dist/components/Elements/BarSearch.js +38 -0
- package/dist/components/Elements/TwakeRight.js +56 -0
- package/dist/components/utils/ButtonCozyHome.js +5 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -51,10 +51,11 @@ The `BarComponent` will get default params into `data-cozy` attribute of the ele
|
|
|
51
51
|
|
|
52
52
|
There is also other parameter to adapt the bar to your app:
|
|
53
53
|
|
|
54
|
-
- `isInvertedTheme`: To make the icon of Cozy(`icon-cozy-home.svg`) compatible with an inverted theme
|
|
55
54
|
- `isPublic`: To show the public version of the Bar
|
|
56
55
|
- `onLogout`: A callback to react to the logout of the user
|
|
57
|
-
- `
|
|
56
|
+
- `appIcon`: To change the app icon
|
|
57
|
+
- `appTextIcon`: To change the app text next to the app icon
|
|
58
|
+
- `searchOptions`: To pass some props to the search engine
|
|
58
59
|
|
|
59
60
|
## Customizing the content of the bar
|
|
60
61
|
|
|
@@ -75,28 +76,6 @@ import { BarLeft, BarCenter, BarRight, BarSearch } from 'cozy-bar'
|
|
|
75
76
|
</BarLeft>
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
### Access your application store in custom components
|
|
79
|
-
|
|
80
|
-
By default, the Bar has its own redux store to fetch data and manage ui state. If you are using a Redux store into your application and you need to access it into your Bar customization you need to integrate the cozy-bar store into your own.
|
|
81
|
-
|
|
82
|
-
```js
|
|
83
|
-
import { barReducers } from 'cozy-bar'
|
|
84
|
-
|
|
85
|
-
const reducers = {
|
|
86
|
-
...baseReducers,
|
|
87
|
-
...barReducers,
|
|
88
|
-
cozy: client.reducer()
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const appReducer = combineReducers(reducers)
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
You also need to disable the internal store onto the `BarComponent` with the property `disableInternalStore`
|
|
95
|
-
|
|
96
|
-
```jsx
|
|
97
|
-
<BarComponent disableInternalStore />
|
|
98
|
-
```
|
|
99
|
-
|
|
100
79
|
## Search and AI assistant
|
|
101
80
|
|
|
102
81
|
Search and AI assistant is now proposed by the cozy-bar. They are enabled by default so you need to:
|
package/dist/components/Bar.js
CHANGED
|
@@ -13,17 +13,15 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
-
var _AppsMenu = _interopRequireDefault(require("./AppsMenu"));
|
|
17
|
-
|
|
18
16
|
var _Banner = _interopRequireDefault(require("./Banner"));
|
|
19
17
|
|
|
20
|
-
var
|
|
18
|
+
var _BarLeft = _interopRequireDefault(require("./Elements/BarLeft"));
|
|
21
19
|
|
|
22
|
-
var
|
|
20
|
+
var _BarSearch = _interopRequireDefault(require("./Elements/BarSearch"));
|
|
23
21
|
|
|
24
|
-
var
|
|
22
|
+
var _TwakeRight = _interopRequireDefault(require("./Elements/TwakeRight"));
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _helpers = require("./helpers");
|
|
27
25
|
|
|
28
26
|
var _SearchButton = _interopRequireDefault(require("./utils/SearchButton"));
|
|
29
27
|
|
|
@@ -35,18 +33,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
35
33
|
|
|
36
34
|
var _cozyClient = require("cozy-client");
|
|
37
35
|
|
|
38
|
-
var _cozyDeviceHelper = require("cozy-device-helper");
|
|
39
|
-
|
|
40
|
-
var _cozyFlags = _interopRequireDefault(require("cozy-flags"));
|
|
41
|
-
|
|
42
|
-
var _cozySearch = require("cozy-search");
|
|
43
|
-
|
|
44
|
-
var _AppTitle = _interopRequireDefault(require("cozy-ui/transpiled/react/AppTitle"));
|
|
45
|
-
|
|
46
|
-
var _Divider = _interopRequireDefault(require("cozy-ui/transpiled/react/Divider"));
|
|
47
|
-
|
|
48
|
-
var _Grid = _interopRequireDefault(require("cozy-ui/transpiled/react/Grid"));
|
|
49
|
-
|
|
50
36
|
var _Breakpoints = require("cozy-ui/transpiled/react/providers/Breakpoints");
|
|
51
37
|
|
|
52
38
|
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); }
|
|
@@ -70,14 +56,12 @@ var Bar = function Bar(_ref) {
|
|
|
70
56
|
appIcon = _ref.appIcon,
|
|
71
57
|
appTextIcon = _ref.appTextIcon,
|
|
72
58
|
searchOptions = _ref.searchOptions,
|
|
73
|
-
isInvertedTheme = _ref.isInvertedTheme,
|
|
74
59
|
appSlug = _ref.appSlug,
|
|
75
60
|
componentsProps = _ref.componentsProps;
|
|
76
61
|
|
|
77
62
|
var _useBreakpoints = (0, _Breakpoints.useBreakpoints)(),
|
|
78
63
|
isMobile = _useBreakpoints.isMobile;
|
|
79
64
|
|
|
80
|
-
var shortcuts = (0, _cozyClient.useFetchHomeShortcuts)();
|
|
81
65
|
var appsQuery = (0, _queries.buildAppsQuery)();
|
|
82
66
|
var appsResult = (0, _cozyClient.useQuery)(appsQuery.definition, _objectSpread(_objectSpread({}, appsQuery.options), {}, {
|
|
83
67
|
enabled: !isPublic
|
|
@@ -94,76 +78,6 @@ var Bar = function Bar(_ref) {
|
|
|
94
78
|
isSettingsAppInstalled = _useMemo.isSettingsAppInstalled;
|
|
95
79
|
|
|
96
80
|
var isSearchEnabled = searchOptions.enabled && !isPublic;
|
|
97
|
-
|
|
98
|
-
var renderCenter = function renderCenter() {
|
|
99
|
-
return null;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
var renderLeft = function renderLeft() {
|
|
103
|
-
if ((0, _cozyDeviceHelper.isFlagshipApp)() || (0, _cozyFlags.default)('flagship.debug')) {
|
|
104
|
-
return /*#__PURE__*/_react.default.createElement(_ButtonCozyHome.default, {
|
|
105
|
-
isInvertedTheme: isInvertedTheme
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
var homeHref = !isPublic && homeApp && homeApp.href;
|
|
110
|
-
|
|
111
|
-
if (isMobile) {
|
|
112
|
-
return /*#__PURE__*/_react.default.createElement(_ButtonCozyHome.default, {
|
|
113
|
-
homeHref: homeHref
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
var isHome = appSlug === 'home';
|
|
118
|
-
return /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
119
|
-
container: true,
|
|
120
|
-
alignItems: "center",
|
|
121
|
-
className: "u-w-auto"
|
|
122
|
-
}, !isHome && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ButtonCozyHome.default, {
|
|
123
|
-
homeHref: homeHref
|
|
124
|
-
}), /*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
125
|
-
orientation: "vertical",
|
|
126
|
-
className: "u-mr-half",
|
|
127
|
-
flexItem: true
|
|
128
|
-
})), /*#__PURE__*/_react.default.createElement(_AppTitle.default, {
|
|
129
|
-
appIcon: appIcon,
|
|
130
|
-
appTextIcon: appTextIcon
|
|
131
|
-
}));
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
var renderTwakeRight = function renderTwakeRight() {
|
|
135
|
-
// Special case because search on Drive on mobile still rely
|
|
136
|
-
// on old search UI that is injected in the cozy-bar and
|
|
137
|
-
// not in a modal as the new search UI
|
|
138
|
-
// So we need to hide these menu buttons when old search UI
|
|
139
|
-
// is injected in the cozy-bar
|
|
140
|
-
// When https://github.com/cozy/cozy-drive/pull/3320 will be merged
|
|
141
|
-
// Drive will rely on cozy-bar embedded search and we will be able
|
|
142
|
-
// to remove this special case
|
|
143
|
-
if (appSlug === 'drive' && isMobile && barSearch) return null;
|
|
144
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_HelpLink.default, null), /*#__PURE__*/_react.default.createElement(_AppsMenu.default, {
|
|
145
|
-
apps: apps,
|
|
146
|
-
homeApp: homeApp,
|
|
147
|
-
isFetchingApps: isFetchingApps,
|
|
148
|
-
shortcuts: shortcuts
|
|
149
|
-
}), /*#__PURE__*/_react.default.createElement(_UserMenu.default, {
|
|
150
|
-
onLogOut: onLogOut,
|
|
151
|
-
isSettingsAppInstalled: isSettingsAppInstalled
|
|
152
|
-
}));
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
var renderSearch = function renderSearch() {
|
|
156
|
-
return isSearchEnabled && !isMobile ? /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
-
className: "u-flex-grow u-mh-2"
|
|
158
|
-
}, /*#__PURE__*/_react.default.createElement(_cozySearch.AssistantDesktop, {
|
|
159
|
-
componentsProps: {
|
|
160
|
-
SearchBarDesktop: {
|
|
161
|
-
size: 'small'
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
})) : null;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
81
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.Wrapper, {
|
|
168
82
|
className: (0, _classnames.default)('coz-bar-wrapper', componentsProps === null || componentsProps === void 0 ? void 0 : (_componentsProps$Wrap = componentsProps.Wrapper) === null || _componentsProps$Wrap === void 0 ? void 0 : _componentsProps$Wrap.className),
|
|
169
83
|
"data-testid": "coz-bar-wrapper"
|
|
@@ -173,16 +87,31 @@ var Bar = function Bar(_ref) {
|
|
|
173
87
|
id: "cozy-bar-modal-dom-place"
|
|
174
88
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
175
89
|
className: "coz-bar-container"
|
|
176
|
-
}, barLeft ||
|
|
90
|
+
}, barLeft || /*#__PURE__*/_react.default.createElement(_BarLeft.default, (0, _extends2.default)({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.BarLeft, {
|
|
91
|
+
isPublic: isPublic,
|
|
92
|
+
homeApp: homeApp,
|
|
93
|
+
appSlug: appSlug,
|
|
94
|
+
appIcon: appIcon,
|
|
95
|
+
appTextIcon: appTextIcon
|
|
96
|
+
})), barCenter, /*#__PURE__*/_react.default.createElement("div", {
|
|
177
97
|
className: "u-flex-grow"
|
|
178
|
-
}, barSearch ||
|
|
98
|
+
}, barSearch || /*#__PURE__*/_react.default.createElement(_BarSearch.default, {
|
|
99
|
+
isSearchEnabled: isSearchEnabled
|
|
100
|
+
})), isSearchEnabled && isMobile ? /*#__PURE__*/_react.default.createElement(_SearchButton.default, null) : null, barRight, !isPublic && /*#__PURE__*/_react.default.createElement(_TwakeRight.default, {
|
|
101
|
+
apps: apps,
|
|
102
|
+
appSlug: appSlug,
|
|
103
|
+
homeApp: homeApp,
|
|
104
|
+
barSearch: barSearch,
|
|
105
|
+
isFetchingApps: isFetchingApps,
|
|
106
|
+
isSettingsAppInstalled: isSettingsAppInstalled,
|
|
107
|
+
onLogOut: onLogOut
|
|
108
|
+
})), userActionRequired && /*#__PURE__*/_react.default.createElement(_Banner.default, userActionRequired));
|
|
179
109
|
};
|
|
180
110
|
|
|
181
111
|
exports.Bar = Bar;
|
|
182
112
|
Bar.propTypes = {
|
|
183
113
|
appSlug: _propTypes.default.string,
|
|
184
114
|
isPublic: _propTypes.default.bool,
|
|
185
|
-
isInvertedTheme: _propTypes.default.bool,
|
|
186
115
|
onLogOut: _propTypes.default.func,
|
|
187
116
|
userActionRequired: _propTypes.default.object,
|
|
188
117
|
componentsProps: _propTypes.default.shape({
|
|
@@ -90,7 +90,6 @@ var BarComponent = function BarComponent(_ref2) {
|
|
|
90
90
|
appSlug = _ref2$appSlug === void 0 ? (0, _dom.getAppSlug)() : _ref2$appSlug,
|
|
91
91
|
_ref2$iconPath = _ref2.iconPath,
|
|
92
92
|
iconPath = _ref2$iconPath === void 0 ? (0, _dom.getDefaultIcon)() : _ref2$iconPath,
|
|
93
|
-
isInvertedTheme = _ref2.isInvertedTheme,
|
|
94
93
|
_ref2$isPublic = _ref2.isPublic,
|
|
95
94
|
isPublic = _ref2$isPublic === void 0 ? false : _ref2$isPublic,
|
|
96
95
|
onLogOut = _ref2.onLogOut,
|
|
@@ -120,7 +119,6 @@ var BarComponent = function BarComponent(_ref2) {
|
|
|
120
119
|
var isPublicForce = !isPublic && /^\/public/.test(window.location.pathname);
|
|
121
120
|
var options = {
|
|
122
121
|
appName: appName,
|
|
123
|
-
isInvertedTheme: isInvertedTheme,
|
|
124
122
|
appNamePrefix: appNamePrefix,
|
|
125
123
|
appSlug: appSlug,
|
|
126
124
|
cozyClient: cozyClient,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _ButtonCozyHome = _interopRequireDefault(require("../utils/ButtonCozyHome"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _cozyDeviceHelper = require("cozy-device-helper");
|
|
15
|
+
|
|
16
|
+
var _cozyFlags = _interopRequireDefault(require("cozy-flags"));
|
|
17
|
+
|
|
18
|
+
var _AppTitle = _interopRequireDefault(require("cozy-ui/transpiled/react/AppTitle"));
|
|
19
|
+
|
|
20
|
+
var _Divider = _interopRequireDefault(require("cozy-ui/transpiled/react/Divider"));
|
|
21
|
+
|
|
22
|
+
var _Grid = _interopRequireDefault(require("cozy-ui/transpiled/react/Grid"));
|
|
23
|
+
|
|
24
|
+
var _Breakpoints = require("cozy-ui/transpiled/react/providers/Breakpoints");
|
|
25
|
+
|
|
26
|
+
var BarLeft = function BarLeft(_ref) {
|
|
27
|
+
var isPublic = _ref.isPublic,
|
|
28
|
+
homeApp = _ref.homeApp,
|
|
29
|
+
appSlug = _ref.appSlug,
|
|
30
|
+
appIcon = _ref.appIcon,
|
|
31
|
+
appTextIcon = _ref.appTextIcon,
|
|
32
|
+
noCozyHome = _ref.noCozyHome;
|
|
33
|
+
|
|
34
|
+
var _useBreakpoints = (0, _Breakpoints.useBreakpoints)(),
|
|
35
|
+
isMobile = _useBreakpoints.isMobile;
|
|
36
|
+
|
|
37
|
+
if ((0, _cozyDeviceHelper.isFlagshipApp)() || (0, _cozyFlags.default)('flagship.debug')) {
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonCozyHome.default, null);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var homeHref = !isPublic && homeApp && homeApp.href;
|
|
42
|
+
|
|
43
|
+
if (isMobile) {
|
|
44
|
+
if (noCozyHome) {
|
|
45
|
+
if (homeHref) {
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement("a", {
|
|
47
|
+
className: "coz-nav-apps-btns-home u-ml-half",
|
|
48
|
+
href: homeHref
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_AppTitle.default, {
|
|
50
|
+
appIcon: appIcon,
|
|
51
|
+
appTextIcon: appTextIcon
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_AppTitle.default, {
|
|
56
|
+
appIcon: appIcon,
|
|
57
|
+
appTextIcon: appTextIcon
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonCozyHome.default, {
|
|
62
|
+
homeHref: homeHref
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var isHome = appSlug === 'home';
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
68
|
+
container: true,
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
className: "u-w-auto"
|
|
71
|
+
}, !isHome && !noCozyHome && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ButtonCozyHome.default, {
|
|
72
|
+
homeHref: homeHref
|
|
73
|
+
}), /*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
74
|
+
orientation: "vertical",
|
|
75
|
+
className: "u-mr-half",
|
|
76
|
+
flexItem: true
|
|
77
|
+
})), noCozyHome && homeHref ? /*#__PURE__*/_react.default.createElement("a", {
|
|
78
|
+
className: "coz-nav-apps-btns-home u-ml-half",
|
|
79
|
+
href: homeHref
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_AppTitle.default, {
|
|
81
|
+
appIcon: appIcon,
|
|
82
|
+
appTextIcon: appTextIcon
|
|
83
|
+
})) : /*#__PURE__*/_react.default.createElement(_AppTitle.default, {
|
|
84
|
+
appIcon: appIcon,
|
|
85
|
+
appTextIcon: appTextIcon
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var _default = BarLeft;
|
|
90
|
+
exports.default = _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _cozySearch = require("cozy-search");
|
|
13
|
+
|
|
14
|
+
var _Breakpoints = require("cozy-ui/transpiled/react/providers/Breakpoints");
|
|
15
|
+
|
|
16
|
+
var BarSearch = function BarSearch(_ref) {
|
|
17
|
+
var isSearchEnabled = _ref.isSearchEnabled;
|
|
18
|
+
|
|
19
|
+
var _useBreakpoints = (0, _Breakpoints.useBreakpoints)(),
|
|
20
|
+
isMobile = _useBreakpoints.isMobile;
|
|
21
|
+
|
|
22
|
+
if (isSearchEnabled && !isMobile) {
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
24
|
+
className: "u-flex-grow u-mh-2"
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement(_cozySearch.AssistantDesktop, {
|
|
26
|
+
componentsProps: {
|
|
27
|
+
SearchBarDesktop: {
|
|
28
|
+
size: 'small'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return null;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var _default = BarSearch;
|
|
38
|
+
exports.default = _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _AppsMenu = _interopRequireDefault(require("../AppsMenu"));
|
|
11
|
+
|
|
12
|
+
var _UserMenu = _interopRequireDefault(require("../UserMenu"));
|
|
13
|
+
|
|
14
|
+
var _HelpLink = _interopRequireDefault(require("../utils/HelpLink"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
var _cozyClient = require("cozy-client");
|
|
19
|
+
|
|
20
|
+
var _Breakpoints = require("cozy-ui/transpiled/react/providers/Breakpoints");
|
|
21
|
+
|
|
22
|
+
var TwakeRight = function TwakeRight(_ref) {
|
|
23
|
+
var apps = _ref.apps,
|
|
24
|
+
appSlug = _ref.appSlug,
|
|
25
|
+
homeApp = _ref.homeApp,
|
|
26
|
+
barSearch = _ref.barSearch,
|
|
27
|
+
isFetchingApps = _ref.isFetchingApps,
|
|
28
|
+
isSettingsAppInstalled = _ref.isSettingsAppInstalled,
|
|
29
|
+
onLogOut = _ref.onLogOut;
|
|
30
|
+
|
|
31
|
+
var _useBreakpoints = (0, _Breakpoints.useBreakpoints)(),
|
|
32
|
+
isMobile = _useBreakpoints.isMobile;
|
|
33
|
+
|
|
34
|
+
var shortcuts = (0, _cozyClient.useFetchHomeShortcuts)(); // Special case because search on Drive on mobile still rely
|
|
35
|
+
// on old search UI that is injected in the cozy-bar and
|
|
36
|
+
// not in a modal as the new search UI
|
|
37
|
+
// So we need to hide these menu buttons when old search UI
|
|
38
|
+
// is injected in the cozy-bar
|
|
39
|
+
// When https://github.com/cozy/cozy-drive/pull/3320 will be merged
|
|
40
|
+
// Drive will rely on cozy-bar embedded search and we will be able
|
|
41
|
+
// to remove this special case
|
|
42
|
+
|
|
43
|
+
if (appSlug === 'drive' && isMobile && barSearch) return null;
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_HelpLink.default, null), /*#__PURE__*/_react.default.createElement(_AppsMenu.default, {
|
|
45
|
+
apps: apps,
|
|
46
|
+
homeApp: homeApp,
|
|
47
|
+
isFetchingApps: isFetchingApps,
|
|
48
|
+
shortcuts: shortcuts
|
|
49
|
+
}), /*#__PURE__*/_react.default.createElement(_UserMenu.default, {
|
|
50
|
+
onLogOut: onLogOut,
|
|
51
|
+
isSettingsAppInstalled: isSettingsAppInstalled
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var _default = TwakeRight;
|
|
56
|
+
exports.default = _default;
|
|
@@ -20,8 +20,7 @@ var _cozyFlags = _interopRequireDefault(require("cozy-flags"));
|
|
|
20
20
|
var _cozyIntent = require("cozy-intent");
|
|
21
21
|
|
|
22
22
|
var ButtonCozyHome = function ButtonCozyHome(_ref) {
|
|
23
|
-
var homeHref = _ref.homeHref
|
|
24
|
-
isInvertedTheme = _ref.isInvertedTheme;
|
|
23
|
+
var homeHref = _ref.homeHref;
|
|
25
24
|
var webviewIntent = (0, _cozyIntent.useWebviewIntent)();
|
|
26
25
|
if ((0, _cozyDeviceHelper.isFlagshipApp)() || (0, _cozyFlags.default)('flagship.debug')) return /*#__PURE__*/_react.default.createElement("a", {
|
|
27
26
|
onClick: function onClick() {
|
|
@@ -30,8 +29,7 @@ var ButtonCozyHome = function ButtonCozyHome(_ref) {
|
|
|
30
29
|
className: "coz-nav-apps-btns-home coz-nav-apps-btns-home--is-flagship",
|
|
31
30
|
"data-testid": "buttonCozyHome"
|
|
32
31
|
}, /*#__PURE__*/_react.default.createElement(_IconCozyHome.default, {
|
|
33
|
-
className: "coz-nav-apps-btns-home-svg"
|
|
34
|
-
isInvertedTheme: isInvertedTheme
|
|
32
|
+
className: "coz-nav-apps-btns-home-svg"
|
|
35
33
|
}));
|
|
36
34
|
|
|
37
35
|
if (homeHref) {
|
|
@@ -40,8 +38,7 @@ var ButtonCozyHome = function ButtonCozyHome(_ref) {
|
|
|
40
38
|
className: "coz-nav-apps-btns-home",
|
|
41
39
|
"data-testid": "buttonCozyHome"
|
|
42
40
|
}, /*#__PURE__*/_react.default.createElement(_IconCozyHome.default, {
|
|
43
|
-
className: "coz-nav-apps-btns-home-svg"
|
|
44
|
-
isInvertedTheme: isInvertedTheme
|
|
41
|
+
className: "coz-nav-apps-btns-home-svg"
|
|
45
42
|
}));
|
|
46
43
|
}
|
|
47
44
|
|
|
@@ -49,14 +46,12 @@ var ButtonCozyHome = function ButtonCozyHome(_ref) {
|
|
|
49
46
|
className: "coz-nav-apps-btns-home",
|
|
50
47
|
"data-testid": "buttonCozyHome"
|
|
51
48
|
}, /*#__PURE__*/_react.default.createElement(_IconCozyHome.default, {
|
|
52
|
-
className: "coz-nav-apps-btns-home-svg"
|
|
53
|
-
isInvertedTheme: isInvertedTheme
|
|
49
|
+
className: "coz-nav-apps-btns-home-svg"
|
|
54
50
|
}));
|
|
55
51
|
};
|
|
56
52
|
|
|
57
53
|
ButtonCozyHome.propTypes = {
|
|
58
|
-
homeHref: _propTypes.default.string
|
|
59
|
-
isInvertedTheme: _propTypes.default.bool
|
|
54
|
+
homeHref: _propTypes.default.string
|
|
60
55
|
};
|
|
61
56
|
var _default = ButtonCozyHome;
|
|
62
57
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-bar",
|
|
3
|
-
"version": "33.
|
|
3
|
+
"version": "33.1.1",
|
|
4
4
|
"description": "cozy-bar.js library, a small lib provided by cozy-stack to inject the Cozy-bar component into each app",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy Cloud <contact@cozycloud.cc> (https://cozy.io/)",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"cozy-realtime": "^4.0.5",
|
|
44
44
|
"cozy-search": "^0.24.0",
|
|
45
45
|
"cozy-ui": "^138.1.0",
|
|
46
|
-
"cozy-ui-plus": "^6.
|
|
46
|
+
"cozy-ui-plus": "^6.1.0",
|
|
47
47
|
"identity-obj-proxy": "3.0.0",
|
|
48
48
|
"jest": "30.3.0",
|
|
49
49
|
"react": "18.0.0",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"react-router-dom": ">=6.14.2",
|
|
74
74
|
"twake-i18n": ">=0.3.0"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "0ac8873a7ba8909f3b02cb719d9fc05133bf5a1d"
|
|
77
77
|
}
|