@imerss/inat-components 1.0.0 → 1.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/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import React, { useCallback, useState, useEffect } from 'react';
3
+ import fetch$1 from 'isomorphic-unfetch';
3
4
  import { format } from 'date-fns';
4
5
  import LoadingSpinner from 'react-spinners/MoonLoader.js';
5
6
  import { Chart } from 'react-charts';
@@ -92,7 +93,7 @@ var getCommonTaxa = function (_a) {
92
93
  if (year !== "all") {
93
94
  url += "&d1=".concat(year, "-01-01&d2=").concat(year, "-12-31");
94
95
  }
95
- return [4 /*yield*/, fetch(url, {
96
+ return [4 /*yield*/, fetch$1(url, {
96
97
  method: 'GET',
97
98
  headers: {
98
99
  Accept: 'application/json'
@@ -141,7 +142,7 @@ var getFavourites = function (_a) {
141
142
  if (year !== "all") {
142
143
  url += "&d1=".concat(year, "-01-01&d2=").concat(year, "-12-31");
143
144
  }
144
- return [4 /*yield*/, fetch(url, {
145
+ return [4 /*yield*/, fetch$1(url, {
145
146
  // method: 'GET',
146
147
  // headers: {
147
148
  // Accept: 'application/json'
@@ -189,7 +190,7 @@ var getRecentObservations = function (_a) {
189
190
  switch (_b.label) {
190
191
  case 0:
191
192
  url = "".concat(BASE_API_URL, "/v1/observations?photos=true&per_page=").concat(perPage, "&taxon_id=").concat(taxonId, "&place_id=").concat(placeId, "&order=desc&order_by=observed_on");
192
- return [4 /*yield*/, fetch(url)];
193
+ return [4 /*yield*/, fetch$1(url)];
193
194
  case 1:
194
195
  response = _b.sent();
195
196
  return [4 /*yield*/, response.json()];
@@ -248,7 +249,7 @@ var getObserverSummary = function (taxonId, placeId, year) { return __awaiter(vo
248
249
  if (year !== "all") {
249
250
  url += "&d1=".concat(year, "-01-01&d2=").concat(year, "-12-31");
250
251
  }
251
- return [4 /*yield*/, fetch(url)];
252
+ return [4 /*yield*/, fetch$1(url)];
252
253
  case 1:
253
254
  response = _a.sent();
254
255
  return [4 /*yield*/, response.json()];
@@ -275,7 +276,7 @@ var getObservationSummary = function (taxonId, placeId, year) { return __awaiter
275
276
  if (year !== "all") {
276
277
  url += "&d1=".concat(year, "-01-01&d2=").concat(year, "-12-31");
277
278
  }
278
- return [4 /*yield*/, fetch(url)];
279
+ return [4 /*yield*/, fetch$1(url)];
279
280
  case 1:
280
281
  response = _a.sent();
281
282
  return [4 /*yield*/, response.json()];
@@ -296,7 +297,7 @@ var getSeasonalityData = function (taxonId, placeId, year) { return __awaiter(vo
296
297
  if (year !== "all") {
297
298
  url += "&d1=".concat(year, "-01-01&d2=").concat(year, "-12-31");
298
299
  }
299
- return [4 /*yield*/, fetch(url)];
300
+ return [4 /*yield*/, fetch$1(url)];
300
301
  case 1:
301
302
  response = _a.sent();
302
303
  return [4 /*yield*/, response.json()];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imerss/inat-components",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "date-fns": "^2.28.0",
12
+ "isomorphic-unfetch": "^3.1.0",
12
13
  "react-spinners": "^0.13.2",
13
14
  "sleep-promise": "^9.1.0"
14
15
  },
@@ -32,6 +33,9 @@
32
33
  "tslib": "^2.4.0",
33
34
  "typescript": "^4.7.4"
34
35
  },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
35
39
  "eslintConfig": {
36
40
  "extends": [
37
41
  "react-app",
@@ -1,4 +1,5 @@
1
1
  import * as C from "../constants";
2
+ import fetch from "isomorphic-unfetch";
2
3
 
3
4
  export type CommonTaxaCallProps = {
4
5
  year: string | number;
@@ -1,4 +1,5 @@
1
1
  import * as C from "../constants";
2
+ import fetch from "isomorphic-unfetch";
2
3
 
3
4
  export type FavouritesCallProps = {
4
5
  year: string | number;
@@ -1,3 +1,4 @@
1
+ import fetch from "isomorphic-unfetch";
1
2
  import * as C from "../constants";
2
3
 
3
4
  export type RecentObservationsCallProps = {
@@ -1,3 +1,4 @@
1
+ import fetch from "isomorphic-unfetch";
1
2
  import * as C from '../constants';
2
3
 
3
4
  export type SummaryApiProps = {