@panneau/data 4.0.2 → 4.0.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.
- package/es/index.js +16 -12
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import React
|
|
2
|
+
import React, { useState, useCallback, useEffect, useMemo, useRef, useContext } from 'react';
|
|
3
3
|
import { useUrlGenerator } from '@panneau/core/contexts';
|
|
4
4
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
5
5
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
@@ -9,6 +9,7 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
9
9
|
import { getJSON, getCSRFHeaders, postJSON } from '@folklore/fetch';
|
|
10
10
|
import { generatePath } from '@folklore/routes';
|
|
11
11
|
import queryString from 'query-string';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
13
|
import { useQuery, keepPreviousData, QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
13
14
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
14
15
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
@@ -1268,7 +1269,7 @@ var Api = /*#__PURE__*/function (_Base) {
|
|
|
1268
1269
|
}(Base);
|
|
1269
1270
|
|
|
1270
1271
|
/* eslint-disable react/jsx-props-no-spreading */
|
|
1271
|
-
var ApiContext = /*#__PURE__*/React
|
|
1272
|
+
var ApiContext = /*#__PURE__*/React.createContext(null);
|
|
1272
1273
|
var useApi = function useApi() {
|
|
1273
1274
|
return useContext(ApiContext);
|
|
1274
1275
|
};
|
|
@@ -1295,9 +1296,10 @@ var ApiProvider = function ApiProvider(_ref) {
|
|
|
1295
1296
|
onUnauthorized: onUnauthorized
|
|
1296
1297
|
});
|
|
1297
1298
|
}, [previousApi, initialApi, baseUrl]);
|
|
1298
|
-
return /*#__PURE__*/
|
|
1299
|
-
value: api
|
|
1300
|
-
|
|
1299
|
+
return /*#__PURE__*/jsx(ApiContext.Provider, {
|
|
1300
|
+
value: api,
|
|
1301
|
+
children: children
|
|
1302
|
+
});
|
|
1301
1303
|
};
|
|
1302
1304
|
ApiProvider.propTypes = propTypes$1;
|
|
1303
1305
|
|
|
@@ -1481,7 +1483,7 @@ var useResourceRestore = function useResourceRestore(resource) {
|
|
|
1481
1483
|
};
|
|
1482
1484
|
};
|
|
1483
1485
|
|
|
1484
|
-
var QueryContext = /*#__PURE__*/React
|
|
1486
|
+
var QueryContext = /*#__PURE__*/React.createContext(null);
|
|
1485
1487
|
var useQueryContext = function useQueryContext() {
|
|
1486
1488
|
return useContext(QueryContext);
|
|
1487
1489
|
};
|
|
@@ -1512,9 +1514,10 @@ var QueryProvider = function QueryProvider(_ref) {
|
|
|
1512
1514
|
}
|
|
1513
1515
|
return client;
|
|
1514
1516
|
}, [initialConfig]);
|
|
1515
|
-
return /*#__PURE__*/
|
|
1516
|
-
client: queryClient
|
|
1517
|
-
|
|
1517
|
+
return /*#__PURE__*/jsx(QueryClientProvider, {
|
|
1518
|
+
client: queryClient,
|
|
1519
|
+
children: children
|
|
1520
|
+
});
|
|
1518
1521
|
};
|
|
1519
1522
|
QueryProvider.propTypes = propTypes;
|
|
1520
1523
|
|
|
@@ -1525,10 +1528,11 @@ function DataProvider(_ref) {
|
|
|
1525
1528
|
apiBaseUrl = _ref$apiBaseUrl === void 0 ? undefined : _ref$apiBaseUrl,
|
|
1526
1529
|
_ref$children = _ref.children,
|
|
1527
1530
|
children = _ref$children === void 0 ? null : _ref$children;
|
|
1528
|
-
return /*#__PURE__*/
|
|
1531
|
+
return /*#__PURE__*/jsx(ApiProvider, {
|
|
1529
1532
|
api: api,
|
|
1530
|
-
baseUrl: apiBaseUrl
|
|
1531
|
-
|
|
1533
|
+
baseUrl: apiBaseUrl,
|
|
1534
|
+
children: children
|
|
1535
|
+
});
|
|
1532
1536
|
}
|
|
1533
1537
|
|
|
1534
1538
|
export { Api, ApiProvider, Base as BaseApi, DataProvider, QueryProvider, useApi, useData, useItems$1 as useItems, useItems as useItemsLegacy, useItemsStore, useQueryContext, useResourceClone, useResourceDestroy, useResourceItem, useResourceItems, useResourceRestore, useResourceCreate as useResourceStore, useResourceUpdate };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/data",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@babel/runtime": "^7.12.5",
|
|
60
60
|
"@folklore/fetch": "^0.1.21",
|
|
61
61
|
"@folklore/routes": "^0.2.44",
|
|
62
|
-
"@panneau/core": "^4.0.
|
|
62
|
+
"@panneau/core": "^4.0.4",
|
|
63
63
|
"@tanstack/react-query": "^5.29.2",
|
|
64
64
|
"lodash-es": "^4.17.21",
|
|
65
65
|
"prop-types": "^15.7.2",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "e854451a718c6bc7dcde2b804c9913d8ac0297ff"
|
|
72
72
|
}
|