cozy-bar 8.2.0 → 8.4.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 +23 -31
- package/dist/cozy-bar.min.js +36 -22
- package/dist/cozy-bar.min.js.map +1 -1
- package/package.json +9 -6
- package/src/components/Apps/AppNavButtons.jsx +8 -14
- package/src/components/Apps/ButtonCozyHome.jsx +30 -0
- package/src/components/Apps/ButtonCozyHome.spec.jsx +53 -0
- package/src/components/Bar.jsx +12 -3
- package/src/components/Bar.spec.jsx +4 -2
- package/src/components/Settings/index.jsx +3 -1
- package/src/components/__snapshots__/Bar.spec.jsx.snap +1 -0
- package/src/index.jsx +3 -1
- package/src/index.spec.jsx +6 -0
- package/src/lib/api/index.jsx +12 -2
- package/src/lib/reducers/index.js +11 -3
- package/src/lib/reducers/unserializable.js +26 -0
- package/src/styles/apps.css +7 -2
- package/transpiled/components/Apps/AppNavButtons.js +7 -14
- package/transpiled/components/Apps/ButtonCozyHome.js +25 -0
- package/transpiled/components/Apps/ButtonCozyHome.spec.jsx +53 -0
- package/transpiled/components/Bar.js +14 -4
- package/transpiled/components/Bar.spec.jsx +4 -2
- package/transpiled/components/Settings/index.js +2 -1
- package/transpiled/components/__snapshots__/Bar.spec.jsx.snap +1 -0
- package/transpiled/cozy-bar.css +130 -172
- package/transpiled/index.js +3 -2
- package/transpiled/index.spec.jsx +6 -0
- package/transpiled/lib/api/index.js +6 -2
- package/transpiled/lib/reducers/index.js +9 -5
- package/transpiled/lib/reducers/unserializable.js +31 -0
- package/transpiled/styles/apps.css +7 -2
package/README.md
CHANGED
|
@@ -3,26 +3,21 @@
|
|
|
3
3
|
[](https://github.com/cozy/cozy-bar/blob/master/LICENSE)
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
[Cozy] Bar Library
|
|
7
|
-
==================
|
|
6
|
+
# [Cozy] Bar Library
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
What's Cozy?
|
|
11
|
-
------------
|
|
8
|
+
## What's Cozy?
|
|
12
9
|
|
|
13
10
|

|
|
14
11
|
|
|
15
12
|
[Cozy] is a platform that brings all your web services in the same private space. With it, your webapps and your devices can share data easily, providing you with a new experience. You can install Cozy on your own hardware where no one's tracking you.
|
|
16
13
|
|
|
17
14
|
|
|
18
|
-
What's cozy-bar.js?
|
|
19
|
-
----------------
|
|
15
|
+
## What's cozy-bar.js?
|
|
20
16
|
|
|
21
17
|
`cozy-bar.js` is a javascript library made by Cozy. It enables the _CozyBar_ component in your application. This component is a banner on the top of your application, responsible of cross-apps navigation, user facilities, intents, etc.
|
|
22
18
|
|
|
23
19
|
|
|
24
|
-
Use
|
|
25
|
-
---
|
|
20
|
+
## Use
|
|
26
21
|
|
|
27
22
|
`cozy-bar.js` is an asset directly served by the [cozy-stack](https://github.com/cozy/cozy-stack). To use it, simply add `<script src="/js/cozy-bar.js" defer></script>` in the `<head>` section of the `index.html` of your application. It exposes an API behind the `window.cozy.bar` namespace, that let you interact with the _CozyBar_ itself.
|
|
28
23
|
|
|
@@ -46,21 +41,21 @@ window.cozy.bar.init({
|
|
|
46
41
|
- `lang` is extracted from the `lang` attribute of the `<html>` tag. Defaults to 'en'
|
|
47
42
|
- `iconPath` uses the favicon 32px. Defaults to a blank GIF
|
|
48
43
|
|
|
49
|
-
Help link
|
|
50
|
-
|
|
44
|
+
## Help link
|
|
45
|
+
|
|
51
46
|
Help link is defined in your Cozy's [configuration file](https://github.com/cozy/cozy-stack/blob/master/docs/config.md#main-configuration-file), in the `context` section. See the `cozy.example.yaml` file [provided by the stack](https://github.com/cozy/cozy-stack/blob/master/cozy.example.yaml#L80).
|
|
52
47
|
|
|
53
|
-
Coming Soon application
|
|
54
|
-
|
|
48
|
+
## Coming Soon application
|
|
49
|
+
|
|
55
50
|
Coming Soon applications (or apps) are defined in your Cozy's [configuration file](https://github.com/cozy/cozy-stack/blob/master/docs/config.md#main-configuration-file). See the `cozy.example.yaml` file [provided by the stack](https://github.com/cozy/cozy-stack/blob/master/cozy.example.yaml#L80).
|
|
56
51
|
|
|
57
|
-
Claudy actions list
|
|
58
|
-
|
|
52
|
+
## Claudy actions list
|
|
53
|
+
|
|
59
54
|
Claudy actions are declared in `src/config/claudy.yaml` with a slug as property name and some options (icon name and link options for example). The slugs list that will be used for Claudy is defined in your Cozy's [configuration file](https://github.com/cozy/cozy-stack/blob/master/docs/config.md#main-configuration-file). See the `cozy.example.yaml` file [provided by the stack](https://github.com/cozy/cozy-stack/blob/master/cozy.example.yaml#L101).
|
|
60
55
|
If no `claudy_actions` property is defined in the configuration, Claudy won't be displayed.
|
|
61
56
|
|
|
62
|
-
Customizing the content of the bar
|
|
63
|
-
|
|
57
|
+
## Customizing the content of the bar
|
|
58
|
+
|
|
64
59
|
From within your app, you can decide to take over certain areas of the cozy-bar. This might especially be useful on mobile where the area it occupies is prime real estate — we generally don't recommend to use this option on larger screen resolutions.
|
|
65
60
|
|
|
66
61
|
The bar is divided in 3 areas that you can control individually : left, center and right:
|
|
@@ -86,7 +81,9 @@ const { BarLeft, BarCenter, BarRight } = cozy.bar
|
|
|
86
81
|
</BarLeft>
|
|
87
82
|
```
|
|
88
83
|
|
|
89
|
-
|
|
84
|
+
### Using a context in the bar
|
|
85
|
+
|
|
86
|
+
If you're using Redux or React Context and include a connected component or a Provider in the bar, it might not work as expected since inside `<BarLeft>` and friends, the redux store and context are different.
|
|
90
87
|
|
|
91
88
|
```jsx
|
|
92
89
|
const MyConnectedComponent = connect(mapStateToProps, mapDispatchToProps, MyComponent)
|
|
@@ -97,7 +94,7 @@ const MyConnectedComponent = connect(mapStateToProps, mapDispatchToProps, MyComp
|
|
|
97
94
|
</BarLeft>
|
|
98
95
|
```
|
|
99
96
|
|
|
100
|
-
Instead, you can do something like this:
|
|
97
|
+
Instead, you can do something like this (for Context you can pass the values as prop):
|
|
101
98
|
|
|
102
99
|
```jsx
|
|
103
100
|
const MyWrappedComponent = (props) => (
|
|
@@ -112,8 +109,7 @@ const MyConnectedComponent = connect(mapStateToProps, mapDispatchToProps, MyWrap
|
|
|
112
109
|
<MyConnectedComponent />
|
|
113
110
|
```
|
|
114
111
|
|
|
115
|
-
Change theme bar
|
|
116
|
-
---
|
|
112
|
+
## Change theme bar
|
|
117
113
|
|
|
118
114
|
It's possible to update theme on the cozy-bar with `setTheme` function.
|
|
119
115
|
|
|
@@ -124,8 +120,7 @@ setTheme('default')
|
|
|
124
120
|
setTheme('primary')
|
|
125
121
|
```
|
|
126
122
|
|
|
127
|
-
Debugging
|
|
128
|
-
---
|
|
123
|
+
## Debugging
|
|
129
124
|
|
|
130
125
|
It is possible to activate the logger from the bar by activating the flag 'bar.debug'.
|
|
131
126
|
Then you have to reload the page.
|
|
@@ -134,14 +129,12 @@ Then you have to reload the page.
|
|
|
134
129
|
flag(bar.debug, true)
|
|
135
130
|
```
|
|
136
131
|
|
|
137
|
-
Contribute
|
|
138
|
-
----------
|
|
132
|
+
## Contribute
|
|
139
133
|
|
|
140
134
|
If you want to work on cozy-client-js itself and submit code modifications, feel free to open pull-requests! See the [contributing guide][contribute] for more information about this repository structure, testing, linting and how to properly open pull-requests.
|
|
141
135
|
|
|
142
136
|
|
|
143
|
-
Community
|
|
144
|
-
---------
|
|
137
|
+
## Community
|
|
145
138
|
|
|
146
139
|
### Maintainer
|
|
147
140
|
|
|
@@ -152,14 +145,13 @@ The lead maintainer for cozy-bar.js is [@CPatchane](https://github.com/CPatchane
|
|
|
152
145
|
|
|
153
146
|
You can reach the Cozy Community by:
|
|
154
147
|
|
|
155
|
-
- Chatting with us on IRC [#cozycloud on
|
|
148
|
+
- Chatting with us on IRC [#cozycloud on Libera.Chat][libera]
|
|
156
149
|
- Posting on our [Forum][forum]
|
|
157
150
|
- Posting issues on the [Github repos][github]
|
|
158
151
|
- Say Hi! on [Twitter][twitter]
|
|
159
152
|
|
|
160
153
|
|
|
161
|
-
Licence
|
|
162
|
-
-------
|
|
154
|
+
## Licence
|
|
163
155
|
|
|
164
156
|
cozy-bar.js is developed by Cozy Cloud and distributed under the [MIT].
|
|
165
157
|
|
|
@@ -173,7 +165,7 @@ cozy-bar.js is developed by Cozy Cloud and distributed under the [MIT].
|
|
|
173
165
|
[konnectors]: https://github.com/cozy-labs/konnectors
|
|
174
166
|
[MIT]: https://opensource.org/licenses/MIT
|
|
175
167
|
[contribute]: CONTRIBUTING.md
|
|
176
|
-
[
|
|
168
|
+
[libera]: https://web.libera.chat/#cozycloud
|
|
177
169
|
[forum]: https://forum.cozy.io/
|
|
178
170
|
[github]: https://github.com/cozy/
|
|
179
171
|
[twitter]: https://twitter.com/cozycloud
|