@panneau/core 4.0.18 → 4.0.27

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.
@@ -373,7 +373,7 @@ interface ModalContextValue {
373
373
  container: unknown | null;
374
374
  setContainer: (container: unknown) => void;
375
375
  register: (id: string, data?: Record<string, unknown> | null) => void;
376
- unregister: (id?: string | null, data?: Record<string, unknown> | null) => void;
376
+ unregister: (id?: string | null) => void;
377
377
  closeLastModal: () => void;
378
378
  getModalById: (modalId: string) => ModalData | null;
379
379
  }
package/dist/contexts.js CHANGED
@@ -645,7 +645,6 @@ function ModalProvider(_ref) {
645
645
  }, [setModals]);
646
646
  var unregister = useCallback(function () {
647
647
  var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
648
- var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
649
648
  var _modalsRef$current2 = modalsRef.current,
650
649
  currentModals = _modalsRef$current2 === void 0 ? [] : _modalsRef$current2;
651
650
  var foundIndex = currentModals.findIndex(function (_ref2) {
@@ -653,14 +652,8 @@ function ModalProvider(_ref) {
653
652
  return modalId === id;
654
653
  });
655
654
  if (foundIndex !== -1) {
656
- var _ref3 = data || {},
657
- _ref3$onClose = _ref3.onClose,
658
- onClose = _ref3$onClose === void 0 ? null : _ref3$onClose;
659
- if (onClose !== null) {
660
- onClose();
661
- }
662
- var newModals = currentModals.filter(function (_ref4) {
663
- var modalId = _ref4.id;
655
+ var newModals = currentModals.filter(function (_ref3) {
656
+ var modalId = _ref3.id;
664
657
  return modalId !== id;
665
658
  });
666
659
  setModals(newModals);
@@ -670,16 +663,16 @@ function ModalProvider(_ref) {
670
663
  var closeLastModal = useCallback(function () {
671
664
  var lastModal = modals.pop() || null;
672
665
  if (lastModal !== null) {
673
- var _ref5 = lastModal || {},
674
- _ref5$id = _ref5.id,
675
- lastModalId = _ref5$id === void 0 ? null : _ref5$id,
676
- _ref5$onClose = _ref5.onClose,
677
- onClose = _ref5$onClose === void 0 ? null : _ref5$onClose;
666
+ var _ref4 = lastModal || {},
667
+ _ref4$id = _ref4.id,
668
+ lastModalId = _ref4$id === void 0 ? null : _ref4$id,
669
+ _ref4$onClose = _ref4.onClose,
670
+ onClose = _ref4$onClose === void 0 ? null : _ref4$onClose;
678
671
  if (onClose !== null) {
679
672
  onClose();
680
673
  }
681
- var newModals = modals.filter(function (_ref6) {
682
- var modalId = _ref6.id;
674
+ var newModals = modals.filter(function (_ref5) {
675
+ var modalId = _ref5.id;
683
676
  return modalId !== lastModalId;
684
677
  });
685
678
  setModals(newModals);
package/dist/hooks.js CHANGED
@@ -1008,17 +1008,21 @@ function useQuery() {
1008
1008
  setQuery(initialQuery);
1009
1009
  }, [initialQuery, setQuery]);
1010
1010
  var onPageChange = useCallback(function (newPage) {
1011
- setQuery(_objectSpread(_objectSpread({}, query || {}), {}, {
1012
- page: newPage || 1
1013
- }));
1014
- }, [query, setQuery]);
1011
+ if (newPage !== null) {
1012
+ setQuery(function (prev) {
1013
+ return _objectSpread(_objectSpread({}, prev || {}), {}, {
1014
+ page: newPage || 1
1015
+ });
1016
+ });
1017
+ }
1018
+ }, [setQuery]);
1015
1019
  var onQueryChange = useCallback(function (newQuery) {
1016
1020
  var finalQuery = newQuery !== null ? Object.keys(newQuery).reduce(function (currentQuery, key) {
1017
1021
  var val = newQuery[key];
1018
1022
  return val !== null ? _objectSpread(_objectSpread({}, currentQuery || {}), {}, _defineProperty({}, key, val)) : currentQuery;
1019
1023
  }, null) : null;
1020
1024
  setQuery(_objectSpread(_objectSpread({}, initialQuery || {}), finalQuery || {}));
1021
- }, [query, setQuery, initialQuery]);
1025
+ }, [setQuery, initialQuery]);
1022
1026
  var onQueryReset = useCallback(function () {
1023
1027
  setQuery(initialQuery);
1024
1028
  }, [initialQuery, setQuery]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/core",
3
- "version": "4.0.18",
3
+ "version": "4.0.27",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -58,11 +58,11 @@
58
58
  "build": "../../scripts/prepare-package.sh --types"
59
59
  },
60
60
  "devDependencies": {
61
- "react": "^19.0.0",
61
+ "react": "^19.2.0",
62
62
  "react-dom": "^19.0.0"
63
63
  },
64
64
  "peerDependencies": {
65
- "react": "^19.0.0",
65
+ "react": "^19.2.0",
66
66
  "react-dom": "^19.0.0"
67
67
  },
68
68
  "dependencies": {
@@ -96,5 +96,5 @@
96
96
  "publishConfig": {
97
97
  "access": "public"
98
98
  },
99
- "gitHead": "411d098e898c68e293dffd633a695042b6fa19ec"
99
+ "gitHead": "48e48752495d69c6b10ddc2c4fe2319d2cd86ff0"
100
100
  }