@exodus/ui-config 3.11.0 → 3.12.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.12.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/ui-config@3.11.0...@exodus/ui-config@3.12.0) (2024-09-27)
7
+
8
+ ### Features
9
+
10
+ - **ui-config:** add syncable configs support ([#9543](https://github.com/ExodusMovement/exodus-hydra/issues/9543)) ([31e5d61](https://github.com/ExodusMovement/exodus-hydra/commit/31e5d61bb64279d3caf4d9045d87afd23234e345))
11
+
6
12
  ## [3.11.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/ui-config@3.10.2...@exodus/ui-config@3.11.0) (2024-09-20)
7
13
 
8
14
  ### Features
package/atoms/index.js CHANGED
@@ -1,20 +1,36 @@
1
1
  import { createStorageAtomFactory } from '@exodus/atoms'
2
+ import { createFusionAtom } from '@exodus/fusion-atoms'
2
3
 
3
- const createUiConfigAtomDefinitions = ({ configValues }) => {
4
- return configValues.map(({ id, atomId, encrypted, defaultValue }) => ({
5
- definition: {
6
- id: atomId,
7
- type: 'atom',
8
- factory: ({ storage }) =>
9
- createStorageAtomFactory({ storage })({ key: id, isSoleWriter: true, defaultValue }),
10
- dependencies: ['storage'],
11
- public: true,
4
+ const createStorageUiConfigAtom = ({ id, atomId, encrypted, defaultValue }) => ({
5
+ definition: {
6
+ id: atomId,
7
+ type: 'atom',
8
+ factory: ({ storage }) => createStorageAtomFactory({ storage })({ key: id, defaultValue }),
9
+ dependencies: ['storage'],
10
+ public: true,
11
+ },
12
+ aliases: [{ implementationId: encrypted ? 'storage' : 'unsafeStorage', interfaceId: 'storage' }],
13
+ storage: { namespace: 'uiConfig' },
14
+ })
15
+
16
+ const createFusionUiConfigAtom = ({ id, atomId, encrypted, defaultValue }) => ({
17
+ definition: {
18
+ id: atomId,
19
+ type: 'atom',
20
+ factory: ({ fusion }) => {
21
+ const path = encrypted ? `private.${id}` : id
22
+ return createFusionAtom({ fusion, defaultValue, path })
12
23
  },
13
- aliases: [
14
- { implementationId: encrypted ? 'storage' : 'unsafeStorage', interfaceId: 'storage' },
15
- ],
16
- storage: { namespace: 'uiConfig' },
17
- }))
24
+ dependencies: ['fusion'],
25
+ },
26
+ })
27
+
28
+ const createUiConfigAtomDefinitions = ({ configValues }) => {
29
+ return configValues.map((configValue) =>
30
+ configValue.syncable
31
+ ? createFusionUiConfigAtom(configValue)
32
+ : createStorageUiConfigAtom(configValue)
33
+ )
18
34
  }
19
35
 
20
36
  export default createUiConfigAtomDefinitions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ui-config",
3
- "version": "3.11.0",
3
+ "version": "3.12.0",
4
4
  "description": "Helper for storing various UI-specific settings/config.",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "license": "UNLICENSED",
@@ -34,11 +34,12 @@
34
34
  "dependencies": {
35
35
  "@exodus/atoms": "^8.1.1",
36
36
  "@exodus/formatting": "^8.0.0",
37
+ "@exodus/fusion-atoms": "^1.2.0",
37
38
  "lodash": "^4.17.21"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@exodus/redux-dependency-injection": "^4.0.3",
41
42
  "redux": "^4.2.1"
42
43
  },
43
- "gitHead": "9f46287a2df974301fb838845f271dd2ee9adcb3"
44
+ "gitHead": "6aa2b5f80b103d195264348e1d21bc0d271c260f"
44
45
  }