cozy-bar 8.4.2 → 8.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-bar",
3
- "version": "8.4.2",
3
+ "version": "8.5.0",
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/cozy-bar.js",
6
6
  "author": "Cozy Cloud <contact@cozycloud.cc> (https://cozy.io/)",
@@ -96,7 +96,7 @@
96
96
  },
97
97
  "dependencies": {
98
98
  "@cozy/minilog": "^1.0.0",
99
- "cozy-client": "^27.14.4",
99
+ "cozy-client": "^27.17.0",
100
100
  "cozy-device-helper": "^1.16.1",
101
101
  "cozy-flags": "2.4.1",
102
102
  "cozy-interapp": "0.4.9",
@@ -120,7 +120,7 @@
120
120
  "bundlesize": [
121
121
  {
122
122
  "path": "./dist/cozy-bar.min.js",
123
- "maxSize": "300 KB"
123
+ "maxSize": "350 KB"
124
124
  }
125
125
  ],
126
126
  "jest": {
@@ -5,14 +5,14 @@ import IconCozyHome from './IconCozyHome'
5
5
  export const ButtonCozyHome = ({ webviewContext, homeHref }) => {
6
6
  if (webviewContext)
7
7
  return (
8
- <button
8
+ <a
9
9
  onClick={() => {
10
10
  webviewContext.call('backToHome')
11
11
  }}
12
- className="coz-nav-apps-btns-home --flagship"
12
+ className="coz-nav-apps-btns-home"
13
13
  >
14
14
  <IconCozyHome className="coz-nav-apps-btns-home-svg" />
15
- </button>
15
+ </a>
16
16
  )
17
17
 
18
18
  if (homeHref)
@@ -25,20 +25,20 @@ describe('ButtonCozyHome', () => {
25
25
  expect(element.props.href).toBe(homeHref)
26
26
  })
27
27
 
28
- it('should render a button when webviewContext', () => {
28
+ it('should render an anchor when webviewContext', () => {
29
29
  const render = shallow(<ButtonCozyHome webviewContext={webviewContext} />)
30
30
  const element = render.getElement()
31
31
 
32
- expect(element.type).toBe('button')
32
+ expect(element.type).toBe('a')
33
33
  })
34
34
 
35
- it('should give priority to button if both webviewContext and homeHref are present', () => {
35
+ it('should give priority to anchor if both webviewContext and homeHref are present', () => {
36
36
  const render = shallow(
37
37
  <ButtonCozyHome homeHref={homeHref} webviewContext={webviewContext} />
38
38
  )
39
39
  const element = render.getElement()
40
40
 
41
- expect(element.type).toBe('button')
41
+ expect(element.type).toBe('a')
42
42
  })
43
43
 
44
44
  it('should call the correct context method on click', () => {
@@ -50,11 +50,6 @@
50
50
  margin-right: .75rem;
51
51
  }
52
52
 
53
- [role=banner] .coz-nav-apps-btns-home.--flagship {
54
- background: none;
55
- border: 0;
56
- height: 100%;
57
- }
58
53
 
59
54
  [role=banner] .coz-nav-apps-btns-home-svg {
60
55
  max-width: 2rem;
@@ -88,7 +83,7 @@
88
83
  transform-origin: 10% 0%;
89
84
  }
90
85
 
91
- [role=banner] .coz-nav .--currentHome + .coz-nav-pop--apps {
86
+ [role=banner] .coz-nav .--currentHome+.coz-nav-pop--apps {
92
87
  left: 0;
93
88
  }
94
89
 
@@ -180,40 +175,52 @@
180
175
  align-items: center;
181
176
  }
182
177
 
183
- [role=banner] [role=menuitem].coz-apps-home-btn.--mobile > span {
178
+ [role=banner] [role=menuitem].coz-apps-home-btn.--mobile>span {
184
179
  display: flex;
185
180
  justify-content: flex-start;
186
181
  }
187
- [role=banner] [role=menuitem].coz-apps-home-btn img, .coz-apps-home-btn svg {
182
+
183
+ [role=banner] [role=menuitem].coz-apps-home-btn img {
188
184
  width: 1rem;
189
185
  height: 1rem;
190
186
  margin-right: .5rem;
191
187
  }
192
188
 
193
189
  @keyframes barPlaceHolderShimmer {
194
- 0% { background-position: -20rem 0; }
195
- 80% { background-position: 20rem 0; }
196
- 80.1% { background-position: -20rem 0; }
197
- 100% { background-position: -20rem 0; }
190
+ 0% {
191
+ background-position: -20rem 0;
192
+ }
193
+
194
+ 80% {
195
+ background-position: 20rem 0;
196
+ }
197
+
198
+ 80.1% {
199
+ background-position: -20rem 0;
200
+ }
201
+
202
+ 100% {
203
+ background-position: -20rem 0;
204
+ }
198
205
  }
199
206
 
200
207
  [role=banner] .coz-loading-placeholder {
201
- display: inline-block;
202
- width: 100%;
203
- height: 100%;
204
- min-height: 1em;
205
- animation: barPlaceHolderShimmer 1s linear infinite;
206
- animation-delay: .1s;
207
- animation-duration: 2s;
208
- animation-iteration-count: infinite;
209
- animation-timing-function: linear;
210
- background-position: -20rem 0;
211
- background-image: linear-gradient(to right, var(--silver) 0, var(--paleGrey) 50%, var(--silver) 100%);
212
- background-size: 20rem 10rem;
213
- background-repeat: no-repeat;
214
- background-color: var(--silver);
215
- border-radius: .15rem;
216
- margin: .1rem 0;
208
+ display: inline-block;
209
+ width: 100%;
210
+ height: 100%;
211
+ min-height: 1em;
212
+ animation: barPlaceHolderShimmer 1s linear infinite;
213
+ animation-delay: .1s;
214
+ animation-duration: 2s;
215
+ animation-iteration-count: infinite;
216
+ animation-timing-function: linear;
217
+ background-position: -20rem 0;
218
+ background-image: linear-gradient(to right, var(--silver) 0, var(--paleGrey) 50%, var(--silver) 100%);
219
+ background-size: 20rem 10rem;
220
+ background-repeat: no-repeat;
221
+ background-color: var(--silver);
222
+ border-radius: .15rem;
223
+ margin: .1rem 0;
217
224
  }
218
225
 
219
226
 
@@ -245,4 +252,4 @@
245
252
  height: 1.5rem;
246
253
  margin: 0;
247
254
  background-color: var(--silver);
248
- }
255
+ }
@@ -3,11 +3,11 @@ import IconCozyHome from "./IconCozyHome";
3
3
  export var ButtonCozyHome = function ButtonCozyHome(_ref) {
4
4
  var webviewContext = _ref.webviewContext,
5
5
  homeHref = _ref.homeHref;
6
- if (webviewContext) return /*#__PURE__*/React.createElement("button", {
6
+ if (webviewContext) return /*#__PURE__*/React.createElement("a", {
7
7
  onClick: function onClick() {
8
8
  webviewContext.call('backToHome');
9
9
  },
10
- className: "coz-nav-apps-btns-home --flagship"
10
+ className: "coz-nav-apps-btns-home"
11
11
  }, /*#__PURE__*/React.createElement(IconCozyHome, {
12
12
  className: "coz-nav-apps-btns-home-svg"
13
13
  }));
@@ -25,20 +25,20 @@ describe('ButtonCozyHome', () => {
25
25
  expect(element.props.href).toBe(homeHref)
26
26
  })
27
27
 
28
- it('should render a button when webviewContext', () => {
28
+ it('should render an anchor when webviewContext', () => {
29
29
  const render = shallow(<ButtonCozyHome webviewContext={webviewContext} />)
30
30
  const element = render.getElement()
31
31
 
32
- expect(element.type).toBe('button')
32
+ expect(element.type).toBe('a')
33
33
  })
34
34
 
35
- it('should give priority to button if both webviewContext and homeHref are present', () => {
35
+ it('should give priority to anchor if both webviewContext and homeHref are present', () => {
36
36
  const render = shallow(
37
37
  <ButtonCozyHome homeHref={homeHref} webviewContext={webviewContext} />
38
38
  )
39
39
  const element = render.getElement()
40
40
 
41
- expect(element.type).toBe('button')
41
+ expect(element.type).toBe('a')
42
42
  })
43
43
 
44
44
  it('should call the correct context method on click', () => {
@@ -420,11 +420,6 @@
420
420
  margin-right: .75rem;
421
421
  }
422
422
 
423
- [role=banner] .coz-nav-apps-btns-home.--flagship {
424
- background: none;
425
- border: 0;
426
- height: 100%;
427
- }
428
423
 
429
424
  [role=banner] .coz-nav-apps-btns-home-svg {
430
425
  max-width: 2rem;
@@ -458,7 +453,7 @@
458
453
  transform-origin: 10% 0%;
459
454
  }
460
455
 
461
- [role=banner] .coz-nav .--currentHome + .coz-nav-pop--apps {
456
+ [role=banner] .coz-nav .--currentHome+.coz-nav-pop--apps {
462
457
  left: 0;
463
458
  }
464
459
 
@@ -550,40 +545,52 @@
550
545
  align-items: center;
551
546
  }
552
547
 
553
- [role=banner] [role=menuitem].coz-apps-home-btn.--mobile > span {
548
+ [role=banner] [role=menuitem].coz-apps-home-btn.--mobile>span {
554
549
  display: flex;
555
550
  justify-content: flex-start;
556
551
  }
557
- [role=banner] [role=menuitem].coz-apps-home-btn img, .coz-apps-home-btn svg {
552
+
553
+ [role=banner] [role=menuitem].coz-apps-home-btn img {
558
554
  width: 1rem;
559
555
  height: 1rem;
560
556
  margin-right: .5rem;
561
557
  }
562
558
 
563
559
  @keyframes barPlaceHolderShimmer {
564
- 0% { background-position: -20rem 0; }
565
- 80% { background-position: 20rem 0; }
566
- 80.1% { background-position: -20rem 0; }
567
- 100% { background-position: -20rem 0; }
560
+ 0% {
561
+ background-position: -20rem 0;
562
+ }
563
+
564
+ 80% {
565
+ background-position: 20rem 0;
566
+ }
567
+
568
+ 80.1% {
569
+ background-position: -20rem 0;
570
+ }
571
+
572
+ 100% {
573
+ background-position: -20rem 0;
574
+ }
568
575
  }
569
576
 
570
577
  [role=banner] .coz-loading-placeholder {
571
- display: inline-block;
572
- width: 100%;
573
- height: 100%;
574
- min-height: 1em;
575
- animation: barPlaceHolderShimmer 1s linear infinite;
576
- animation-delay: .1s;
577
- animation-duration: 2s;
578
- animation-iteration-count: infinite;
579
- animation-timing-function: linear;
580
- background-position: -20rem 0;
581
- background-image: linear-gradient(to right, var(--silver) 0, var(--paleGrey) 50%, var(--silver) 100%);
582
- background-size: 20rem 10rem;
583
- background-repeat: no-repeat;
584
- background-color: var(--silver);
585
- border-radius: .15rem;
586
- margin: .1rem 0;
578
+ display: inline-block;
579
+ width: 100%;
580
+ height: 100%;
581
+ min-height: 1em;
582
+ animation: barPlaceHolderShimmer 1s linear infinite;
583
+ animation-delay: .1s;
584
+ animation-duration: 2s;
585
+ animation-iteration-count: infinite;
586
+ animation-timing-function: linear;
587
+ background-position: -20rem 0;
588
+ background-image: linear-gradient(to right, var(--silver) 0, var(--paleGrey) 50%, var(--silver) 100%);
589
+ background-size: 20rem 10rem;
590
+ background-repeat: no-repeat;
591
+ background-color: var(--silver);
592
+ border-radius: .15rem;
593
+ margin: .1rem 0;
587
594
  }
588
595
 
589
596
 
@@ -616,7 +623,6 @@
616
623
  margin: 0;
617
624
  background-color: var(--silver);
618
625
  }
619
-
620
626
  [role=banner] .coz-nav-settings-btn {
621
627
  color: var(--slateGrey);
622
628
  }
@@ -50,11 +50,6 @@
50
50
  margin-right: .75rem;
51
51
  }
52
52
 
53
- [role=banner] .coz-nav-apps-btns-home.--flagship {
54
- background: none;
55
- border: 0;
56
- height: 100%;
57
- }
58
53
 
59
54
  [role=banner] .coz-nav-apps-btns-home-svg {
60
55
  max-width: 2rem;
@@ -88,7 +83,7 @@
88
83
  transform-origin: 10% 0%;
89
84
  }
90
85
 
91
- [role=banner] .coz-nav .--currentHome + .coz-nav-pop--apps {
86
+ [role=banner] .coz-nav .--currentHome+.coz-nav-pop--apps {
92
87
  left: 0;
93
88
  }
94
89
 
@@ -180,40 +175,52 @@
180
175
  align-items: center;
181
176
  }
182
177
 
183
- [role=banner] [role=menuitem].coz-apps-home-btn.--mobile > span {
178
+ [role=banner] [role=menuitem].coz-apps-home-btn.--mobile>span {
184
179
  display: flex;
185
180
  justify-content: flex-start;
186
181
  }
187
- [role=banner] [role=menuitem].coz-apps-home-btn img, .coz-apps-home-btn svg {
182
+
183
+ [role=banner] [role=menuitem].coz-apps-home-btn img {
188
184
  width: 1rem;
189
185
  height: 1rem;
190
186
  margin-right: .5rem;
191
187
  }
192
188
 
193
189
  @keyframes barPlaceHolderShimmer {
194
- 0% { background-position: -20rem 0; }
195
- 80% { background-position: 20rem 0; }
196
- 80.1% { background-position: -20rem 0; }
197
- 100% { background-position: -20rem 0; }
190
+ 0% {
191
+ background-position: -20rem 0;
192
+ }
193
+
194
+ 80% {
195
+ background-position: 20rem 0;
196
+ }
197
+
198
+ 80.1% {
199
+ background-position: -20rem 0;
200
+ }
201
+
202
+ 100% {
203
+ background-position: -20rem 0;
204
+ }
198
205
  }
199
206
 
200
207
  [role=banner] .coz-loading-placeholder {
201
- display: inline-block;
202
- width: 100%;
203
- height: 100%;
204
- min-height: 1em;
205
- animation: barPlaceHolderShimmer 1s linear infinite;
206
- animation-delay: .1s;
207
- animation-duration: 2s;
208
- animation-iteration-count: infinite;
209
- animation-timing-function: linear;
210
- background-position: -20rem 0;
211
- background-image: linear-gradient(to right, var(--silver) 0, var(--paleGrey) 50%, var(--silver) 100%);
212
- background-size: 20rem 10rem;
213
- background-repeat: no-repeat;
214
- background-color: var(--silver);
215
- border-radius: .15rem;
216
- margin: .1rem 0;
208
+ display: inline-block;
209
+ width: 100%;
210
+ height: 100%;
211
+ min-height: 1em;
212
+ animation: barPlaceHolderShimmer 1s linear infinite;
213
+ animation-delay: .1s;
214
+ animation-duration: 2s;
215
+ animation-iteration-count: infinite;
216
+ animation-timing-function: linear;
217
+ background-position: -20rem 0;
218
+ background-image: linear-gradient(to right, var(--silver) 0, var(--paleGrey) 50%, var(--silver) 100%);
219
+ background-size: 20rem 10rem;
220
+ background-repeat: no-repeat;
221
+ background-color: var(--silver);
222
+ border-radius: .15rem;
223
+ margin: .1rem 0;
217
224
  }
218
225
 
219
226
 
@@ -245,4 +252,4 @@
245
252
  height: 1.5rem;
246
253
  margin: 0;
247
254
  background-color: var(--silver);
248
- }
255
+ }