@things-factory/setting-ui 10.1.215 → 10.1.218
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/dist-client/bootstrap.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
import { clientSettingStore } from '@operato/shell';
|
|
1
|
+
import { clientSettingStore, navigate, store } from '@operato/shell';
|
|
2
|
+
import { ADD_USER_MENU } from '@things-factory/apptool-base/client';
|
|
2
3
|
import { setThemeMode } from './set-theme-mode.js';
|
|
3
4
|
export default async function bootstrap() {
|
|
5
|
+
/*
|
|
6
|
+
* The settings page holds the person's own preferences - theme, notifications, whether the menu
|
|
7
|
+
* hides - so its way in is in the menu the header's avatar opens. Every app wrote this entry as a
|
|
8
|
+
* morenda of its own; this module owns the page, so it registers the one entry.
|
|
9
|
+
*/
|
|
10
|
+
store.dispatch({
|
|
11
|
+
type: ADD_USER_MENU,
|
|
12
|
+
item: {
|
|
13
|
+
name: 'setting',
|
|
14
|
+
icon: 'settings',
|
|
15
|
+
label: 'label.setting',
|
|
16
|
+
order: 20,
|
|
17
|
+
action: () => navigate('setting')
|
|
18
|
+
}
|
|
19
|
+
});
|
|
4
20
|
const themeMode = ((await clientSettingStore.get('theme'))?.value || {}).mode || 'light';
|
|
5
21
|
setThemeMode(themeMode);
|
|
6
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS;IACrC;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;SAClC;KACF,CAAC,CAAA;IAEF,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,OAAO,CAAA;IAExF,YAAY,CAAC,SAAS,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import { clientSettingStore, navigate, store } from '@operato/shell'\nimport { ADD_USER_MENU } from '@things-factory/apptool-base/client'\n\nimport { setThemeMode } from './set-theme-mode.js'\n\nexport default async function bootstrap() {\n /*\n * The settings page holds the person's own preferences - theme, notifications, whether the menu\n * hides - so its way in is in the menu the header's avatar opens. Every app wrote this entry as a\n * morenda of its own; this module owns the page, so it registers the one entry.\n */\n store.dispatch({\n type: ADD_USER_MENU,\n item: {\n name: 'setting',\n icon: 'settings',\n label: 'label.setting',\n order: 20,\n action: () => navigate('setting')\n }\n })\n\n const themeMode = ((await clientSettingStore.get('theme'))?.value || {}).mode || 'light'\n\n setThemeMode(themeMode)\n}\n"]}
|