@exodus/ui-config 3.10.2 → 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,18 @@
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
+
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)
13
+
14
+ ### Features
15
+
16
+ - use formatting v7 ([#9321](https://github.com/ExodusMovement/exodus-hydra/issues/9321)) ([83b1d31](https://github.com/ExodusMovement/exodus-hydra/commit/83b1d311204adcf03e33377f19ff980c8e8cceda))
17
+
6
18
  ## [3.10.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/ui-config@3.10.1...@exodus/ui-config@3.10.2) (2024-09-12)
7
19
 
8
20
  ### Bug Fixes
package/api/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Atom } from '@exodus/atoms'
1
+ import type { Atom } from '@exodus/atoms'
2
2
 
3
3
  type UiConfigAtom = Pick<Atom<any>, 'set' | 'get'>
4
4
 
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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import uiConfigApiDefinition from './api/index.js'
1
+ import type uiConfigApiDefinition from './api/index.js'
2
2
 
3
3
  type Config = { config: Record<string, any> }
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ui-config",
3
- "version": "3.10.2",
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",
@@ -33,12 +33,13 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@exodus/atoms": "^8.1.1",
36
- "@exodus/formatting": "^6.0.0",
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": "7fa5448fde0fb383fe7f23d7d13bb7461d2f85b6"
44
+ "gitHead": "6aa2b5f80b103d195264348e1d21bc0d271c260f"
44
45
  }