@k-int/stripes-kint-components 3.0.3 → 3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.0.4 2022-10-07
2
+ * Fixed bug in intlKeyStore where multiple keys being added would break the structure
3
+
1
4
  ## 3.0.3 2022-10-04
2
5
  * Fixed issue where custom property ctx is not removable
3
6
 
@@ -41,9 +41,9 @@ var useIntlKeyStore = (0, _zustand.default)(function (set, get) {
41
41
  ns = folioNS;
42
42
  }
43
43
 
44
- return {
45
- intlKeys: _objectSpread(_defineProperty({}, ns, key), state)
46
- };
44
+ return _objectSpread(_objectSpread({}, state), {}, {
45
+ intlKeys: _objectSpread(_defineProperty({}, ns, key), state.intlKeys)
46
+ });
47
47
  });
48
48
  },
49
49
  removeKey: function removeKey(namespace) {
@@ -61,9 +61,9 @@ var useIntlKeyStore = (0, _zustand.default)(function (set, get) {
61
61
  _valueToRemove = _state$intlKeys[ns],
62
62
  newKeys = _objectWithoutProperties(_state$intlKeys, [ns].map(_toPropertyKey));
63
63
 
64
- return {
64
+ return _objectSpread(_objectSpread({}, state), {}, {
65
65
  intlKeys: newKeys
66
- };
66
+ });
67
67
  });
68
68
  },
69
69
  getKey: function getKey(namespace) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -12,7 +12,7 @@ const useIntlKeyStore = create((set, get) => ({
12
12
  ns = folioNS;
13
13
  }
14
14
 
15
- return { intlKeys: { [ns]: key, ...state } };
15
+ return { ...state, intlKeys: { [ns]: key, ...state.intlKeys } };
16
16
  }),
17
17
  removeKey: (namespace) => set((state) => {
18
18
  let ns = namespace;
@@ -22,7 +22,7 @@ const useIntlKeyStore = create((set, get) => ({
22
22
  }
23
23
 
24
24
  const { [ns]: _valueToRemove, ...newKeys } = state.intlKeys;
25
- return { intlKeys: newKeys };
25
+ return { ...state, intlKeys: newKeys };
26
26
  }),
27
27
  getKey: (namespace) => {
28
28
  let ns = namespace;