@panneau/data 3.0.307 → 4.0.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.
Files changed (2) hide show
  1. package/es/index.js +24 -39
  2. package/package.json +5 -5
package/es/index.js CHANGED
@@ -1272,21 +1272,19 @@ var ApiContext = /*#__PURE__*/React.createContext(null);
1272
1272
  var useApi = function useApi() {
1273
1273
  return useContext(ApiContext);
1274
1274
  };
1275
- var propTypes$2 = {
1275
+ var propTypes$1 = {
1276
1276
  api: PropTypes.instanceOf(Api),
1277
1277
  baseUrl: PropTypes.string,
1278
1278
  onUnauthorized: PropTypes.func,
1279
1279
  children: PropTypes.node.isRequired
1280
1280
  };
1281
- var defaultProps$2 = {
1282
- api: null,
1283
- onUnauthorized: null,
1284
- baseUrl: undefined
1285
- };
1286
1281
  var ApiProvider = function ApiProvider(_ref) {
1287
- var initialApi = _ref.api,
1288
- baseUrl = _ref.baseUrl,
1289
- onUnauthorized = _ref.onUnauthorized,
1282
+ var _ref$api = _ref.api,
1283
+ initialApi = _ref$api === void 0 ? null : _ref$api,
1284
+ _ref$baseUrl = _ref.baseUrl,
1285
+ baseUrl = _ref$baseUrl === void 0 ? undefined : _ref$baseUrl,
1286
+ _ref$onUnauthorized = _ref.onUnauthorized,
1287
+ onUnauthorized = _ref$onUnauthorized === void 0 ? null : _ref$onUnauthorized,
1290
1288
  children = _ref.children;
1291
1289
  var generateUrl = useUrlGenerator();
1292
1290
  var previousApi = useApi();
@@ -1301,8 +1299,7 @@ var ApiProvider = function ApiProvider(_ref) {
1301
1299
  value: api
1302
1300
  }, children);
1303
1301
  };
1304
- ApiProvider.propTypes = propTypes$2;
1305
- ApiProvider.defaultProps = defaultProps$2;
1302
+ ApiProvider.propTypes = propTypes$1;
1306
1303
 
1307
1304
  var useResourceDestroy = function useResourceDestroy(resource) {
1308
1305
  var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
@@ -1488,21 +1485,19 @@ var QueryContext = /*#__PURE__*/React.createContext(null);
1488
1485
  var useQueryContext = function useQueryContext() {
1489
1486
  return useContext(QueryContext);
1490
1487
  };
1491
- var propTypes$1 = {
1488
+ var propTypes = {
1492
1489
  config: PropTypes.shape({}),
1493
1490
  initialKey: PropTypes.arrayOf(PropTypes.string),
1494
1491
  initialData: PropTypes.oneOfType([PropTypes.shape({}), PropTypes.arrayOf(PropTypes.shape({}))]),
1495
1492
  children: PropTypes.node.isRequired
1496
1493
  };
1497
- var defaultProps$1 = {
1498
- config: null,
1499
- initialKey: null,
1500
- initialData: null
1501
- };
1502
1494
  var QueryProvider = function QueryProvider(_ref) {
1503
- var initialConfig = _ref.config,
1504
- initialKey = _ref.initialKey,
1505
- initialData = _ref.initialData,
1495
+ var _ref$config = _ref.config,
1496
+ initialConfig = _ref$config === void 0 ? null : _ref$config,
1497
+ _ref$initialKey = _ref.initialKey,
1498
+ initialKey = _ref$initialKey === void 0 ? null : _ref$initialKey,
1499
+ _ref$initialData = _ref.initialData,
1500
+ initialData = _ref$initialData === void 0 ? null : _ref$initialData,
1506
1501
  children = _ref.children;
1507
1502
  var queryClient = useMemo(function () {
1508
1503
  var client = new QueryClient(_objectSpread({
@@ -1521,30 +1516,20 @@ var QueryProvider = function QueryProvider(_ref) {
1521
1516
  client: queryClient
1522
1517
  }, children);
1523
1518
  };
1524
- QueryProvider.propTypes = propTypes$1;
1525
- QueryProvider.defaultProps = defaultProps$1;
1519
+ QueryProvider.propTypes = propTypes;
1526
1520
 
1527
1521
  /* eslint-disable react/jsx-props-no-spreading */
1528
- var propTypes = {
1529
- api: PropTypes.instanceOf(Api),
1530
- apiBaseUrl: PropTypes.string,
1531
- children: PropTypes.node
1532
- };
1533
- var defaultProps = {
1534
- api: null,
1535
- apiBaseUrl: undefined,
1536
- children: null
1537
- };
1538
- var DataProvider = function DataProvider(_ref) {
1539
- var api = _ref.api,
1540
- apiBaseUrl = _ref.apiBaseUrl,
1541
- children = _ref.children;
1522
+ function DataProvider(_ref) {
1523
+ var _ref$api = _ref.api,
1524
+ api = _ref$api === void 0 ? null : _ref$api,
1525
+ _ref$apiBaseUrl = _ref.apiBaseUrl,
1526
+ apiBaseUrl = _ref$apiBaseUrl === void 0 ? undefined : _ref$apiBaseUrl,
1527
+ _ref$children = _ref.children,
1528
+ children = _ref$children === void 0 ? null : _ref$children;
1542
1529
  return /*#__PURE__*/React.createElement(ApiProvider, {
1543
1530
  api: api,
1544
1531
  baseUrl: apiBaseUrl
1545
1532
  }, children);
1546
- };
1547
- DataProvider.propTypes = propTypes;
1548
- DataProvider.defaultProps = defaultProps;
1533
+ }
1549
1534
 
1550
1535
  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": "3.0.307",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@babel/runtime": "^7.12.5",
60
- "@folklore/fetch": "^0.1.17",
61
- "@folklore/routes": "^0.2.26",
62
- "@panneau/core": "^3.0.307",
60
+ "@folklore/fetch": "^0.1.21",
61
+ "@folklore/routes": "^0.2.44",
62
+ "@panneau/core": "^4.0.0",
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": "cbe5e8b1705d01c5653a4df617a06243344310d3"
71
+ "gitHead": "2cca874e0388b4a20c39aadb205c0e67d5a946fc"
72
72
  }