@admin-layout/client 12.0.16-alpha.88 → 12.0.16-alpha.91
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/lib/hooks/useLayoutSettings.d.ts.map +1 -1
- package/lib/hooks/useLayoutSettings.js +6 -5
- package/lib/hooks/useLayoutSettings.js.map +1 -1
- package/lib/redux/reducers/settings.d.ts.map +1 -1
- package/lib/redux/reducers/settings.js +2 -5
- package/lib/redux/reducers/settings.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAOA,wBAAgB,iBAAiB;;0BAgDV,GAAG,0BAA0B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;
|
|
1
|
+
{"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAOA,wBAAgB,iBAAiB;;0BAgDV,GAAG,0BAA0B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;EA+DtE"}
|
|
@@ -40,7 +40,7 @@ import {useParams}from'@remix-run/react';import {useCallback}from'react';import
|
|
|
40
40
|
try {
|
|
41
41
|
// 1. Calculate payload first
|
|
42
42
|
if (!currentChangedSetting || Object.keys(currentChangedSetting).length === 0) {
|
|
43
|
-
console.log('
|
|
43
|
+
console.log('No changes to persist');
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
// 2. Apply UI side effects ONLY if relevant settings changed
|
|
@@ -49,12 +49,12 @@ import {useParams}from'@remix-run/react';import {useCallback}from'react';import
|
|
|
49
49
|
if (contentWidth !== undefined &&
|
|
50
50
|
settings.contentWidth !== contentWidth &&
|
|
51
51
|
typeof window !== 'undefined') {
|
|
52
|
-
console.log('
|
|
52
|
+
console.log('Content width changed, triggering resize');
|
|
53
53
|
window.dispatchEvent(new Event('resize'));
|
|
54
54
|
}
|
|
55
55
|
// Only update colorWeak if it changed
|
|
56
56
|
if (colorWeak !== undefined && settings.colorWeak !== colorWeak) {
|
|
57
|
-
console.log('
|
|
57
|
+
console.log('Color weak mode changed');
|
|
58
58
|
updateColorWeak(!!colorWeak);
|
|
59
59
|
}
|
|
60
60
|
// 3. Make API call
|
|
@@ -75,13 +75,14 @@ import {useParams}from'@remix-run/react';import {useCallback}from'react';import
|
|
|
75
75
|
throw new Error('Failed to update settings');
|
|
76
76
|
}
|
|
77
77
|
// 4. update redux
|
|
78
|
+
const [_, changedPublicSetting] = Object.entries(currentChangedSetting)[0];
|
|
78
79
|
dispatch({
|
|
79
80
|
type: CHANGE_SETTINGS_ACTION,
|
|
80
|
-
payload:
|
|
81
|
+
payload: changedPublicSetting,
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
catch (error) {
|
|
84
|
-
console.error('
|
|
85
|
+
console.error('setSettings error:', error);
|
|
85
86
|
return null;
|
|
86
87
|
}
|
|
87
88
|
}, [dispatch, settings]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutSettings.js","sources":["../../src/hooks/useLayoutSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLayoutSettings.js","sources":["../../src/hooks/useLayoutSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"uMAsHC,SAAA,iBAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/redux/reducers/settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/redux/reducers/settings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAanD,QAAA,MAAM,eAAe,GACjB,OAAO,GAAmB,EAC1B,mBAAwB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,QAuBrE,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {merge,cloneDeep}from'lodash-es';import {CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'../../constants/constants.js';/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
2
2
|
/* eslint-disable no-case-declarations */
|
|
3
3
|
// Note: We customize reducer part as AntPro uses inbuild way.
|
|
4
4
|
const updateColorWeak = (colorWeak) => {
|
|
@@ -21,10 +21,7 @@ const settingsReducer = (state = merge({}, {}), { type, payload = {} }) => {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
updateColorWeak(!!colorWeak);
|
|
24
|
-
return {
|
|
25
|
-
...state,
|
|
26
|
-
...cloneDeep(payload),
|
|
27
|
-
};
|
|
24
|
+
return merge({}, state, cloneDeep(payload));
|
|
28
25
|
case CHANGE_LANGUAGE:
|
|
29
26
|
return {
|
|
30
27
|
...state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sources":["../../../src/redux/reducers/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../../src/redux/reducers/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"0HAIA;AAaA;AAEsE;AAyBtE,MAAA,eAAS,GAAe,CAAA,SAAG,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/client",
|
|
3
|
-
"version": "12.0.16-alpha.
|
|
3
|
+
"version": "12.0.16-alpha.91",
|
|
4
4
|
"description": "Sample client for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"serialize-error": "^8.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"common": "12.0.16-alpha.
|
|
29
|
+
"common": "12.0.16-alpha.91",
|
|
30
30
|
"rc-menu": "^9.16.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"typescript": {
|
|
45
45
|
"definition": "lib/index.d.ts"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "9cd72f5df9382dcb5020262b2cc44a90adf8b3d7"
|
|
48
48
|
}
|