@vuu-ui/vuu-shell 0.8.14-debug → 0.8.15-debug
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/cjs/index.js +19 -2
- package/cjs/index.js.map +2 -2
- package/esm/index.js +19 -2
- package/esm/index.js.map +2 -2
- package/index.css +13 -4
- package/index.css.map +2 -2
- package/package.json +9 -9
- package/types/layout-management/useLayoutManager.d.ts +5 -3
package/esm/index.js
CHANGED
|
@@ -1798,6 +1798,7 @@ var getPersistenceManager = () => {
|
|
|
1798
1798
|
return _persistenceManager;
|
|
1799
1799
|
};
|
|
1800
1800
|
var LayoutManagementContext = React8.createContext({
|
|
1801
|
+
getApplicationSettings: () => void 0,
|
|
1801
1802
|
layoutMetadata: [],
|
|
1802
1803
|
saveLayout: () => void 0,
|
|
1803
1804
|
// The default Application JSON will be served if no LayoutManagementProvider
|
|
@@ -1927,12 +1928,27 @@ var LayoutManagementProvider = (props) => {
|
|
|
1927
1928
|
[notify]
|
|
1928
1929
|
);
|
|
1929
1930
|
const saveApplicationSettings = useCallback16(
|
|
1930
|
-
(settings) => {
|
|
1931
|
-
|
|
1931
|
+
(settings, key) => {
|
|
1932
|
+
const { settings: applicationSettings } = applicationJSONRef.current;
|
|
1933
|
+
if (key) {
|
|
1934
|
+
setApplicationSettings({
|
|
1935
|
+
...applicationSettings,
|
|
1936
|
+
[key]: settings
|
|
1937
|
+
});
|
|
1938
|
+
} else {
|
|
1939
|
+
setApplicationSettings(settings);
|
|
1940
|
+
}
|
|
1932
1941
|
getPersistenceManager().saveApplicationJSON(applicationJSONRef.current);
|
|
1933
1942
|
},
|
|
1934
1943
|
[setApplicationSettings]
|
|
1935
1944
|
);
|
|
1945
|
+
const getApplicationSettings = useCallback16(
|
|
1946
|
+
(key) => {
|
|
1947
|
+
const { settings } = applicationJSONRef.current;
|
|
1948
|
+
return key ? settings == null ? void 0 : settings[key] : settings;
|
|
1949
|
+
},
|
|
1950
|
+
[]
|
|
1951
|
+
);
|
|
1936
1952
|
const loadLayoutById = useCallback16(
|
|
1937
1953
|
(id) => {
|
|
1938
1954
|
getPersistenceManager().loadLayout(id).then((layoutJson) => {
|
|
@@ -1961,6 +1977,7 @@ var LayoutManagementProvider = (props) => {
|
|
|
1961
1977
|
LayoutManagementContext.Provider,
|
|
1962
1978
|
{
|
|
1963
1979
|
value: {
|
|
1980
|
+
getApplicationSettings,
|
|
1964
1981
|
layoutMetadata,
|
|
1965
1982
|
saveLayout,
|
|
1966
1983
|
applicationJson: applicationJSONRef.current,
|