@digigov/ui 0.7.0 → 0.8.4

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/api/APIErrors.js +1 -1
  3. package/api/fetchAPI.js +1 -1
  4. package/api/index.js +1 -1
  5. package/api/index.spec.js +112 -212
  6. package/api/useResourceQuery.js +1 -1
  7. package/api/utils.js +2 -2
  8. package/app/App.js +1 -1
  9. package/app/Header/HeaderLogo.js +1 -1
  10. package/app/Header/HeaderSection.js +1 -1
  11. package/app/Header/HeaderTitle.js +1 -1
  12. package/app/Header/index.js +1 -1
  13. package/app/PageTitle.js +1 -1
  14. package/app/i18n.js +1 -1
  15. package/core/Accordion/index.js +1 -1
  16. package/core/Blockquote/index.js +1 -1
  17. package/core/Button/index.js +1 -1
  18. package/core/Details/index.js +1 -1
  19. package/core/ErrorSummary/index.js +1 -1
  20. package/core/List/List.js +1 -1
  21. package/core/List/ListItem.js +1 -1
  22. package/core/List/ListItemContent.js +1 -1
  23. package/core/List/ListItemIcon.js +1 -1
  24. package/core/List/ListItemText.js +1 -1
  25. package/core/List/ListItemTitle.js +1 -1
  26. package/core/NavList/NavList.js +1 -1
  27. package/core/NavList/NavListItem.js +1 -1
  28. package/core/NavList/NavListItemBase.js +1 -1
  29. package/core/SummaryList/index.js +1 -1
  30. package/core/Tabs/index.js +1 -1
  31. package/core/WarningText/index.js +1 -1
  32. package/es/api/index.spec.js +112 -209
  33. package/es/govgr/Footer/Copyright.js +16 -0
  34. package/es/govgr/Footer/HellenicRepublicLogo.js +2 -0
  35. package/es/govgr/Footer/index.js +13 -9
  36. package/es/locales/el.js +1 -0
  37. package/es/locales/en.js +1 -0
  38. package/esm/api/index.spec.js +112 -209
  39. package/esm/govgr/Footer/Copyright.js +16 -0
  40. package/esm/govgr/Footer/HellenicRepublicLogo.js +2 -0
  41. package/esm/govgr/Footer/index.js +13 -9
  42. package/esm/index.js +1 -1
  43. package/esm/locales/el.js +1 -0
  44. package/esm/locales/en.js +1 -0
  45. package/govgr/Footer/Copyright.d.ts +1 -0
  46. package/govgr/Footer/Copyright.js +20 -1
  47. package/govgr/Footer/HellenicRepublicLogo.js +2 -0
  48. package/govgr/Footer/index.d.ts +1 -0
  49. package/govgr/Footer/index.js +21 -10
  50. package/hooks/useDebounce.js +1 -1
  51. package/hooks/useOutdatedBrowserCheck.js +1 -1
  52. package/hooks/useSearch.js +2 -2
  53. package/layouts/Basic/index.js +1 -1
  54. package/locales/el.d.ts +1 -0
  55. package/locales/el.js +1 -0
  56. package/locales/en.d.ts +1 -0
  57. package/locales/en.js +1 -0
  58. package/package.json +1 -1
  59. package/router/index.js +1 -1
  60. package/test-utils/delay.js +1 -1
  61. package/themes/index.js +4 -4
  62. package/typography/Paragraph.js +1 -1
  63. package/typography/index.js +8 -8
  64. package/utils/evaluateBrowserVersion.js +2 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,32 @@
1
1
  # Change Log - @digigov/ui
2
2
 
3
- This log was last generated on Tue, 12 Oct 2021 09:13:08 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 02 Nov 2021 13:03:39 GMT and should not be manually modified.
4
+
5
+ ## 0.8.4
6
+ Tue, 02 Nov 2021 13:03:39 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 0.8.3
11
+ Tue, 02 Nov 2021 12:05:42 GMT
12
+
13
+ ### Patches
14
+
15
+ - Fix versions released by mistakes
16
+
17
+ ## 0.8.1
18
+ Tue, 02 Nov 2021 08:25:41 GMT
19
+
20
+ ### Patches
21
+
22
+ - fix api tests
23
+
24
+ ## 0.8.0
25
+ Wed, 20 Oct 2021 12:45:51 GMT
26
+
27
+ ### Minor changes
28
+
29
+ - Add new MinDigitalCopyright component to use as a copyright message for websites that we build for MinDigital
4
30
 
5
31
  ## 0.7.0
6
32
  Tue, 12 Oct 2021 09:13:08 GMT
package/api/APIErrors.js CHANGED
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.APIError = exports["default"] = exports.APIErrors = void 0;
8
+ exports["default"] = exports.APIErrors = exports.APIError = void 0;
9
9
 
10
10
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
11
 
package/api/fetchAPI.js CHANGED
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.fetchAPI = fetchAPI;
9
8
  exports["default"] = void 0;
9
+ exports.fetchAPI = fetchAPI;
10
10
 
11
11
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
12
12
 
package/api/index.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  var _exportNames = {
7
7
  useAPI: true
8
8
  };
9
- exports["default"] = exports.useAPI = void 0;
9
+ exports.useAPI = exports["default"] = void 0;
10
10
 
11
11
  var _react = require("react");
12
12
 
package/api/index.spec.js CHANGED
@@ -20,7 +20,7 @@ var _fetchMock = _interopRequireDefault(require("fetch-mock"));
20
20
 
21
21
  var _index = require("@digigov/ui/api/index");
22
22
 
23
- var _delay = _interopRequireDefault(require("../test-utils/delay"));
23
+ var _delay = _interopRequireDefault(require("@digigov/ui/test-utils/delay"));
24
24
 
25
25
  var _fetchAPI = _interopRequireDefault(require("@digigov/ui/api/fetchAPI"));
26
26
 
@@ -125,7 +125,7 @@ describe('fetchAPI', function () {
125
125
  path = 'some_id';
126
126
 
127
127
  _fetchMock["default"].mock.apply(_fetchMock["default"], (0, _toConsumableArray2["default"])(buildMockOptions({
128
- resource: "".concat(resource, "/").concat(path),
128
+ resource: "".concat(resource, "/").concat(path, "/"),
129
129
  response: {
130
130
  value: 'SWR'
131
131
  }
@@ -158,7 +158,7 @@ describe('useResource', function () {
158
158
  beforeEach(_fetchMock["default"].resetBehavior);
159
159
  beforeEach(_fetchMock["default"].resetHistory);
160
160
  it('useResource should return data', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
161
- var resource, Page, _render, container;
161
+ var resource, Page, _render, container, _container$firstChild, _container$firstChild2;
162
162
 
163
163
  return _regenerator["default"].wrap(function _callee2$(_context2) {
164
164
  while (1) {
@@ -190,12 +190,12 @@ describe('useResource', function () {
190
190
  break;
191
191
  }
192
192
 
193
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
193
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild = container.firstChild) === null || _container$firstChild === void 0 ? void 0 : _container$firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
194
194
  _context2.next = 9;
195
195
  return (0, _delay["default"])(DELAY);
196
196
 
197
197
  case 9:
198
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
198
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild2 = container.firstChild) === null || _container$firstChild2 === void 0 ? void 0 : _container$firstChild2.textContent).toMatchInlineSnapshot("\"hello, SWR\"");
199
199
 
200
200
  case 10:
201
201
  expect(_fetchMock["default"].calls()).toHaveLength(1);
@@ -207,83 +207,20 @@ describe('useResource', function () {
207
207
  }
208
208
  }, _callee2);
209
209
  })));
210
- it('useResource should run requests sequentially with dependent data', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
211
- var resource, resource2, Page, _render2, container;
210
+ it('should run duplicate request once', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
211
+ var _container$firstChild3, _container$firstChild4;
212
+
213
+ var resource, Page, _render2, container;
212
214
 
213
215
  return _regenerator["default"].wrap(function _callee3$(_context3) {
214
216
  while (1) {
215
217
  switch (_context3.prev = _context3.next) {
216
218
  case 0:
217
219
  Page = function _Page2() {
218
- var _useResource2 = (0, _index.useResource)(resource),
219
- data = _useResource2.data; // eslint-disable-next-line
220
- // @ts-ignore
221
-
222
-
223
- var _useResource3 = (0, _index.useResource)(resource2, function () {
224
- return data.id;
225
- }),
226
- finalData = _useResource3.data;
227
-
228
- return /*#__PURE__*/_react["default"].createElement("div", null, "hello, ", finalData === null || finalData === void 0 ? void 0 : finalData.value);
229
- };
230
-
231
- resource = 'resource1';
232
- resource2 = 'resource2';
233
-
234
- _fetchMock["default"].mock.apply(_fetchMock["default"], (0, _toConsumableArray2["default"])(buildMockOptions({
235
- resource: resource,
236
- response: {
237
- id: 'myid'
238
- }
239
- })));
240
-
241
- _fetchMock["default"].mock.apply(_fetchMock["default"], (0, _toConsumableArray2["default"])(buildMockOptions({
242
- resource: "".concat(resource2, "/myid"),
243
- response: {
244
- value: 'MyFriend'
245
- }
246
- })));
247
-
248
- _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
249
- wrapper: wrapper
250
- }), container = _render2.container;
251
- expect(container.firstChild).not.toBe(null);
252
-
253
- if (!container.firstChild) {
254
- _context3.next = 12;
255
- break;
256
- }
257
-
258
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"something went wrong\"");
259
- _context3.next = 11;
260
- return (0, _delay["default"])(DELAY * 2);
261
-
262
- case 11:
263
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"something went wrong\"");
264
-
265
- case 12:
266
- expect(_fetchMock["default"].calls()).toHaveLength(2);
267
-
268
- case 13:
269
- case "end":
270
- return _context3.stop();
271
- }
272
- }
273
- }, _callee3);
274
- })));
275
- it('should run duplicate request once', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
276
- var resource, Page, _render3, container;
277
-
278
- return _regenerator["default"].wrap(function _callee4$(_context4) {
279
- while (1) {
280
- switch (_context4.prev = _context4.next) {
281
- case 0:
282
- Page = function _Page3() {
283
220
  (0, _index.useResource)(resource);
284
221
 
285
- var _useResource4 = (0, _index.useResource)(resource),
286
- duplData = _useResource4.data;
222
+ var _useResource2 = (0, _index.useResource)(resource),
223
+ duplData = _useResource2.data;
287
224
 
288
225
  return /*#__PURE__*/_react["default"].createElement("div", null, "hello, ", duplData === null || duplData === void 0 ? void 0 : duplData.value);
289
226
  };
@@ -297,32 +234,24 @@ describe('useResource', function () {
297
234
  }
298
235
  })));
299
236
 
300
- _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
237
+ _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
301
238
  wrapper: wrapper
302
- }), container = _render3.container;
239
+ }), container = _render2.container;
303
240
  expect(container.firstChild).not.toBe(null);
304
-
305
- if (!container.firstChild) {
306
- _context4.next = 10;
307
- break;
308
- }
309
-
310
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
311
- _context4.next = 9;
241
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild3 = container.firstChild) === null || _container$firstChild3 === void 0 ? void 0 : _container$firstChild3.textContent).toMatchInlineSnapshot("\"hello, \"");
242
+ _context3.next = 8;
312
243
  return (0, _delay["default"])(DELAY);
313
244
 
314
- case 9:
315
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
316
-
317
- case 10:
245
+ case 8:
246
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild4 = container.firstChild) === null || _container$firstChild4 === void 0 ? void 0 : _container$firstChild4.textContent).toMatchInlineSnapshot("\"hello, myvalue\"");
318
247
  expect(_fetchMock["default"].calls()).toHaveLength(1);
319
248
 
320
- case 11:
249
+ case 10:
321
250
  case "end":
322
- return _context4.stop();
251
+ return _context3.stop();
323
252
  }
324
253
  }
325
- }, _callee4);
254
+ }, _callee3);
326
255
  })));
327
256
  });
328
257
  describe('useResourceAction', function () {
@@ -332,14 +261,16 @@ describe('useResourceAction', function () {
332
261
  });
333
262
  beforeEach(_fetchMock["default"].resetBehavior);
334
263
  beforeEach(_fetchMock["default"].resetHistory);
335
- it('useResourceAction should return result ', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
336
- var resource, Page, _render4, container;
264
+ it('useResourceAction should return result ', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
265
+ var _container$firstChild5, _container$firstChild6;
337
266
 
338
- return _regenerator["default"].wrap(function _callee5$(_context5) {
267
+ var resource, Page, _render3, container;
268
+
269
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
339
270
  while (1) {
340
- switch (_context5.prev = _context5.next) {
271
+ switch (_context4.prev = _context4.next) {
341
272
  case 0:
342
- Page = function _Page4() {
273
+ Page = function _Page3() {
343
274
  var _useResourceAction = (0, _index.useResourceAction)(resource, undefined, 'POST', {
344
275
  some: 'data'
345
276
  }, undefined),
@@ -362,41 +293,35 @@ describe('useResourceAction', function () {
362
293
  method: 'POST'
363
294
  })));
364
295
 
365
- _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
296
+ _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
366
297
  wrapper: wrapper
367
- }), container = _render4.container;
298
+ }), container = _render3.container;
368
299
  expect(container.firstChild).not.toBe(null);
369
-
370
- if (!container.firstChild) {
371
- _context5.next = 10;
372
- break;
373
- }
374
-
375
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
376
- _context5.next = 9;
300
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild5 = container.firstChild) === null || _container$firstChild5 === void 0 ? void 0 : _container$firstChild5.textContent).toMatchInlineSnapshot("\"hello, \"");
301
+ _context4.next = 8;
377
302
  return (0, _delay["default"])(DELAY * 2);
378
303
 
379
- case 9:
380
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
381
-
382
- case 10:
304
+ case 8:
305
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild6 = container.firstChild) === null || _container$firstChild6 === void 0 ? void 0 : _container$firstChild6.textContent).toMatchInlineSnapshot("\"hello, myvalue\"");
383
306
  expect(_fetchMock["default"].calls()).toHaveLength(1);
384
307
 
385
- case 11:
308
+ case 10:
386
309
  case "end":
387
- return _context5.stop();
310
+ return _context4.stop();
388
311
  }
389
312
  }
390
- }, _callee5);
313
+ }, _callee4);
391
314
  })));
392
- it('useResourceAction should be invalidated and run twice', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
393
- var resource, Page, _render5, container;
315
+ it('useResourceAction should be invalidated and run twice', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
316
+ var _container$firstChild7, _container$firstChild8, _container$firstChild9, _container$firstChild10;
394
317
 
395
- return _regenerator["default"].wrap(function _callee6$(_context6) {
318
+ var resource, Page, _render4, container;
319
+
320
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
396
321
  while (1) {
397
- switch (_context6.prev = _context6.next) {
322
+ switch (_context5.prev = _context5.next) {
398
323
  case 0:
399
- Page = function _Page5() {
324
+ Page = function _Page4() {
400
325
  var _useResourceAction2 = (0, _index.useResourceAction)(resource, undefined, 'POST', {
401
326
  some: 'data'
402
327
  }, undefined),
@@ -428,42 +353,34 @@ describe('useResourceAction', function () {
428
353
  method: 'POST'
429
354
  })));
430
355
 
431
- _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
356
+ _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
432
357
  wrapper: wrapper
433
- }), container = _render5.container;
358
+ }), container = _render4.container;
434
359
  expect(container.firstChild).not.toBe(null);
435
-
436
- if (!container.firstChild) {
437
- _context6.next = 16;
438
- break;
439
- }
440
-
441
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
442
- _context6.next = 9;
360
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild7 = container.firstChild) === null || _container$firstChild7 === void 0 ? void 0 : _container$firstChild7.textContent).toMatchInlineSnapshot("\"hello, \"");
361
+ _context5.next = 8;
443
362
  return (0, _delay["default"])(DELAY);
444
363
 
445
- case 9:
446
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
447
- _context6.next = 12;
364
+ case 8:
365
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild8 = container.firstChild) === null || _container$firstChild8 === void 0 ? void 0 : _container$firstChild8.textContent).toMatchInlineSnapshot("\"hello, myvalue\"");
366
+ _context5.next = 11;
448
367
  return (0, _delay["default"])(DELAY);
449
368
 
450
- case 12:
451
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
452
- _context6.next = 15;
369
+ case 11:
370
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild9 = container.firstChild) === null || _container$firstChild9 === void 0 ? void 0 : _container$firstChild9.textContent).toMatchInlineSnapshot("\"hello, \"");
371
+ _context5.next = 14;
453
372
  return (0, _delay["default"])(DELAY * 2);
454
373
 
455
- case 15:
456
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, \"");
457
-
458
- case 16:
374
+ case 14:
375
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild10 = container.firstChild) === null || _container$firstChild10 === void 0 ? void 0 : _container$firstChild10.textContent).toMatchInlineSnapshot("\"hello, myvalue\"");
459
376
  expect(_fetchMock["default"].calls()).toHaveLength(2);
460
377
 
461
- case 17:
378
+ case 16:
462
379
  case "end":
463
- return _context6.stop();
380
+ return _context5.stop();
464
381
  }
465
382
  }
466
- }, _callee6);
383
+ }, _callee5);
467
384
  })));
468
385
  });
469
386
  describe('useResourceMany', function () {
@@ -472,15 +389,18 @@ describe('useResourceMany', function () {
472
389
  _fetchMock["default"].restore();
473
390
  });
474
391
  beforeEach(_fetchMock["default"].resetBehavior);
475
- beforeEach(_fetchMock["default"].resetHistory);
476
- it('useResourceMany should return data', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
477
- var resource, Page, _render6, container;
392
+ beforeEach(_fetchMock["default"].resetHistory); //check this test again (loading/hello)
478
393
 
479
- return _regenerator["default"].wrap(function _callee7$(_context7) {
394
+ it('useResourceMany should return data', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
395
+ var _container$firstChild11, _container$firstChild12;
396
+
397
+ var resource, Page, _render5, container;
398
+
399
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
480
400
  while (1) {
481
- switch (_context7.prev = _context7.next) {
401
+ switch (_context6.prev = _context6.next) {
482
402
  case 0:
483
- Page = function _Page6() {
403
+ Page = function _Page5() {
484
404
  var _useResourceMany = (0, _index.useResourceMany)(resource),
485
405
  data = _useResourceMany.data;
486
406
 
@@ -504,41 +424,35 @@ describe('useResourceMany', function () {
504
424
  }
505
425
  })));
506
426
 
507
- _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
427
+ _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
508
428
  wrapper: wrapper
509
- }), container = _render6.container;
429
+ }), container = _render5.container;
510
430
  expect(container.firstChild).not.toBe(null);
511
-
512
- if (!container.firstChild) {
513
- _context7.next = 10;
514
- break;
515
- }
516
-
517
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"Loading\"");
518
- _context7.next = 9;
431
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild11 = container.firstChild) === null || _container$firstChild11 === void 0 ? void 0 : _container$firstChild11.textContent).toMatchInlineSnapshot("\"Loading\"");
432
+ _context6.next = 8;
519
433
  return (0, _delay["default"])(DELAY * 2);
520
434
 
521
- case 9:
522
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"Loading\"");
523
-
524
- case 10:
435
+ case 8:
436
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild12 = container.firstChild) === null || _container$firstChild12 === void 0 ? void 0 : _container$firstChild12.textContent).toMatchInlineSnapshot("\"hello, SWR\"");
525
437
  expect(_fetchMock["default"].calls()).toHaveLength(1);
526
438
 
527
- case 11:
439
+ case 10:
528
440
  case "end":
529
- return _context7.stop();
441
+ return _context6.stop();
530
442
  }
531
443
  }
532
- }, _callee7);
444
+ }, _callee6);
533
445
  })));
534
- it('useResourceMany should handle hasNext, hasPrevious', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
535
- var resource, Page, _render7, container;
446
+ it('useResourceMany should handle hasNext, hasPrevious', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
447
+ var _container$firstChild13, _container$firstChild14;
536
448
 
537
- return _regenerator["default"].wrap(function _callee8$(_context8) {
449
+ var resource, Page, _render6, container;
450
+
451
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
538
452
  while (1) {
539
- switch (_context8.prev = _context8.next) {
453
+ switch (_context7.prev = _context7.next) {
540
454
  case 0:
541
- Page = function _Page7() {
455
+ Page = function _Page6() {
542
456
  var _useResourceMany2 = (0, _index.useResourceMany)(resource),
543
457
  hasNext = _useResourceMany2.hasNext,
544
458
  hasPrevious = _useResourceMany2.hasPrevious;
@@ -563,41 +477,35 @@ describe('useResourceMany', function () {
563
477
  }
564
478
  })));
565
479
 
566
- _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
480
+ _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
567
481
  wrapper: wrapper
568
- }), container = _render7.container;
482
+ }), container = _render6.container;
569
483
  expect(container.firstChild).not.toBe(null);
570
-
571
- if (!container.firstChild) {
572
- _context8.next = 10;
573
- break;
574
- }
575
-
576
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"Loading\"");
577
- _context8.next = 9;
484
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild13 = container.firstChild) === null || _container$firstChild13 === void 0 ? void 0 : _container$firstChild13.textContent).toMatchInlineSnapshot("\"Loading\"");
485
+ _context7.next = 8;
578
486
  return (0, _delay["default"])(DELAY);
579
487
 
580
- case 9:
581
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"Loading\"");
582
-
583
- case 10:
488
+ case 8:
489
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild14 = container.firstChild) === null || _container$firstChild14 === void 0 ? void 0 : _container$firstChild14.textContent).toMatchInlineSnapshot("\"no next,no previous\"");
584
490
  expect(_fetchMock["default"].calls()).toHaveLength(1);
585
491
 
586
- case 11:
492
+ case 10:
587
493
  case "end":
588
- return _context8.stop();
494
+ return _context7.stop();
589
495
  }
590
496
  }
591
- }, _callee8);
497
+ }, _callee7);
592
498
  })));
593
- it('useResourceMany should handle setPage with custom limit option', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
594
- var resource, Page, _render8, container, getByText;
499
+ it('useResourceMany should handle setPage with custom limit option', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
500
+ var _container$firstChild15, _container$firstChild16, _container$firstChild17;
595
501
 
596
- return _regenerator["default"].wrap(function _callee9$(_context9) {
502
+ var resource, Page, _render7, container, getByText;
503
+
504
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
597
505
  while (1) {
598
- switch (_context9.prev = _context9.next) {
506
+ switch (_context8.prev = _context8.next) {
599
507
  case 0:
600
- Page = function _Page8() {
508
+ Page = function _Page7() {
601
509
  var _useResourceMany3 = (0, _index.useResourceMany)(resource, {
602
510
  limit: 10
603
511
  }),
@@ -646,39 +554,31 @@ describe('useResourceMany', function () {
646
554
  }
647
555
  })));
648
556
 
649
- _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
557
+ _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Page, null), {
650
558
  wrapper: wrapper
651
- }), container = _render8.container, getByText = _render8.getByText;
559
+ }), container = _render7.container, getByText = _render7.getByText;
652
560
  expect(container.firstChild).not.toBe(null);
653
-
654
- if (!container.firstChild) {
655
- _context9.next = 15;
656
- break;
657
- }
658
-
659
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"Loading\"");
660
- _context9.next = 10;
561
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild15 = container.firstChild) === null || _container$firstChild15 === void 0 ? void 0 : _container$firstChild15.textContent).toMatchInlineSnapshot("\"Loading\"");
562
+ _context8.next = 9;
661
563
  return (0, _delay["default"])(DELAY);
662
564
 
663
- case 10:
664
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"Loading\"");
565
+ case 9:
566
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild16 = container.firstChild) === null || _container$firstChild16 === void 0 ? void 0 : _container$firstChild16.textContent).toMatchInlineSnapshot("\"hello, SWRnext\"");
665
567
 
666
568
  _react2.fireEvent.click(getByText('next'));
667
569
 
668
- _context9.next = 14;
669
- return (0, _delay["default"])(DELAY);
670
-
671
- case 14:
672
- expect(container.firstChild.textContent).toMatchInlineSnapshot("\"hello, RWSnext\"");
570
+ _context8.next = 13;
571
+ return (0, _delay["default"])(DELAY * 2);
673
572
 
674
- case 15:
573
+ case 13:
574
+ expect(container === null || container === void 0 ? void 0 : (_container$firstChild17 = container.firstChild) === null || _container$firstChild17 === void 0 ? void 0 : _container$firstChild17.textContent).toMatchInlineSnapshot("\"hello, RWSnext\"");
675
575
  expect(_fetchMock["default"].calls()).toHaveLength(2);
676
576
 
677
- case 16:
577
+ case 15:
678
578
  case "end":
679
- return _context9.stop();
579
+ return _context8.stop();
680
580
  }
681
581
  }
682
- }, _callee9);
582
+ }, _callee8);
683
583
  })));
684
584
  });
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.useResourceManyBase = useResourceManyBase;
9
8
  exports.useResourceMany = useResourceMany;
9
+ exports.useResourceManyBase = useResourceManyBase;
10
10
 
11
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
12
 
package/api/utils.js CHANGED
@@ -5,10 +5,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.parseErrors = parseErrors;
9
- exports.processResponse = processResponse;
10
8
  exports.getArgs = getArgs;
11
9
  exports.getQueryKey = getQueryKey;
10
+ exports.parseErrors = parseErrors;
11
+ exports.processResponse = processResponse;
12
12
 
13
13
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
14
14
 
package/app/App.js CHANGED
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports["default"] = exports.StaticApp = exports.useAppStyles = void 0;
10
+ exports.useAppStyles = exports["default"] = exports.StaticApp = void 0;
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = exports.HeaderLogo = exports.useHeaderLogoStyles = void 0;
8
+ exports.useHeaderLogoStyles = exports["default"] = exports.HeaderLogo = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = exports.HeaderSection = exports.useHeaderSectionStyles = void 0;
8
+ exports.useHeaderSectionStyles = exports["default"] = exports.HeaderSection = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = exports.HeaderSubtitle = exports.useHeaderSubtitleStyles = exports.HeaderTitle = exports.useHeaderTitleStyles = void 0;
8
+ exports.useHeaderTitleStyles = exports.useHeaderSubtitleStyles = exports["default"] = exports.HeaderTitle = exports.HeaderSubtitle = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -9,7 +9,7 @@ var _exportNames = {
9
9
  useHeaderStyles: true,
10
10
  Header: true
11
11
  };
12
- exports["default"] = exports.Header = exports.useHeaderStyles = void 0;
12
+ exports.useHeaderStyles = exports["default"] = exports.Header = void 0;
13
13
 
14
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
15