@pubinfo/core 2.0.0-rc.2 → 2.0.0-rc.3

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.
Files changed (81) hide show
  1. package/dist/{AppSetting-D2RJrc9O.js → AppSetting-3wJKvibc.js} +19 -19
  2. package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-DusVz35O.js → HCheckList.vue_vue_type_script_setup_true_lang-17EywJvs.js} +1 -1
  3. package/dist/{HToggle-DMcVgMVY.js → HToggle-B-ZjSh6S.js} +1 -1
  4. package/dist/{PreferencesContent-Dtd9rtew.js → PreferencesContent-xT4paU7N.js} +52 -52
  5. package/dist/{SettingBreadcrumb-QSCSviKM.js → SettingBreadcrumb-CYnO51Ek.js} +5 -5
  6. package/dist/{SettingCopyright-Dr5P6yfq.js → SettingCopyright-FOW5ObHK.js} +2 -2
  7. package/dist/{SettingEnableTransition-DGiHEbCI.js → SettingEnableTransition-Q5cvubmF.js} +12 -12
  8. package/dist/{SettingHome-CEPcBlds.js → SettingHome-Df7-AlWB.js} +8 -8
  9. package/dist/{SettingMenu-BJdjnRA6.js → SettingMenu-BNAJ3el9.js} +14 -14
  10. package/dist/{SettingMode-BnuCHoEY.js → SettingMode-LzlRsBL9.js} +3 -3
  11. package/dist/{SettingNavSearch-CiU4BmlU.js → SettingNavSearch-BA08vYuw.js} +6 -6
  12. package/dist/{SettingOther-DTHjVlFe.js → SettingOther-BE8dDCYD.js} +11 -11
  13. package/dist/{SettingPage-D75_Nf05.js → SettingPage-D061yXCv.js} +2 -2
  14. package/dist/{SettingTabbar-D48dzvgA.js → SettingTabbar-COwdPPKy.js} +13 -13
  15. package/dist/{SettingThemes-D-8vTs5n.js → SettingThemes-BHaYERNp.js} +12 -12
  16. package/dist/{SettingToolbar-DjIjm9V-.js → SettingToolbar-fSuzu6ND.js} +10 -10
  17. package/dist/{SettingTopbar-Cg30OTH3.js → SettingTopbar-D7GgP0KB.js} +6 -6
  18. package/dist/{SettingWidthMode-BKV_7kb8.js → SettingWidthMode-CNjzChe1.js} +11 -11
  19. package/dist/{TopThinMode-JFYsp_lJ.js → TopThinMode-B-28sBJD.js} +3 -3
  20. package/dist/built-in/layout-component/Layout.vue.d.ts +1 -0
  21. package/dist/built-in/layout-component/components/Tools/Fullscreen.vue.d.ts +2 -0
  22. package/dist/built-in/layout-component/components/Tools/PageReload.vue.d.ts +2 -0
  23. package/dist/built-in/layout-component/components/Tools/SearchBar.vue.d.ts +2 -0
  24. package/dist/built-in/layout-component/components/Tools/index.vue.d.ts +47 -1
  25. package/dist/built-in/layout-component/components/Tools/interface.d.ts +26 -0
  26. package/dist/built-in/layout-component/components/ui/HDropdownMenu.vue.d.ts +2 -7
  27. package/dist/built-in/layout-component/composables/useHotkey.d.ts +1 -5
  28. package/dist/built-in/layout-component/composables/useMainPage.d.ts +1 -1
  29. package/dist/built-in/layout-component/composables/useMenu.d.ts +1 -1
  30. package/dist/built-in/layout-component/composables/useTabbar.d.ts +1 -1
  31. package/dist/built-in/layout-component/composables/useTitle.d.ts +2 -1
  32. package/dist/built-in/layout-component/composables/useWatermark.d.ts +3 -1
  33. package/dist/built-in/layout-component/index.d.ts +9 -6
  34. package/dist/built-in/layout-component/utils/index.d.ts +0 -1
  35. package/dist/{colors-CODcBxrF.js → colors-BIQSd520.js} +1 -1
  36. package/dist/{index-Jd3PYkpj.js → index-Beb7_0-E.js} +11384 -11329
  37. package/dist/{index-BAoB7aoj.js → index-CPRiufg0.js} +1 -1
  38. package/dist/{index-DmcblkoZ.js → index-DNdH93AP.js} +13 -13
  39. package/dist/{index-DQn1WFMa.js → index-DYMBkmAp.js} +2 -2
  40. package/dist/{index-BVLkBCRY.js → index-Dlf6GQBd.js} +6418 -6439
  41. package/dist/{index-DvJr0paY.js → index-IscoZG-Y.js} +2 -2
  42. package/dist/{index-BROqFYXS.js → index-WubcSL0v.js} +1 -1
  43. package/dist/{index-RT-QBzm0.js → index-YSjb6X1D.js} +10 -12
  44. package/dist/{index-D4_xmL_A.js → index-wxEEuQXu.js} +17 -17
  45. package/dist/index.d.ts +4 -2
  46. package/dist/index.js +53 -55
  47. package/dist/{pick-BLJM77QN.js → pick-D_XPbQHB.js} +1 -1
  48. package/dist/style.css +1 -1
  49. package/package.json +9 -9
  50. package/src/built-in/layout-component/Layout.vue +11 -22
  51. package/src/built-in/layout-component/components/Header/TopMode/index.vue +1 -1
  52. package/src/built-in/layout-component/components/Sidebar/MainSidebar.vue +1 -1
  53. package/src/built-in/layout-component/components/Sidebar/index.vue +1 -1
  54. package/src/built-in/layout-component/components/Tools/DarkModeToggle.vue +108 -0
  55. package/src/built-in/layout-component/components/Tools/Fullscreen.vue +24 -0
  56. package/src/built-in/layout-component/components/Tools/PageReload.vue +22 -0
  57. package/src/built-in/layout-component/components/Tools/SearchBar.vue +44 -0
  58. package/src/built-in/layout-component/components/Tools/{Search.vue → SearchPanel.vue} +1 -1
  59. package/src/built-in/layout-component/components/Tools/index.vue +63 -131
  60. package/src/built-in/layout-component/components/Tools/interface.ts +27 -0
  61. package/src/built-in/layout-component/components/Topbar/Tabbar/MoreAction.vue +2 -2
  62. package/src/built-in/layout-component/components/Topbar/Tabbar/index.vue +2 -2
  63. package/src/built-in/layout-component/components/ui/HDropdownMenu.vue +19 -26
  64. package/src/built-in/layout-component/composables/useGetComputedStyle.ts +2 -3
  65. package/src/built-in/layout-component/composables/useHotkey.ts +6 -10
  66. package/src/built-in/layout-component/composables/useMainPage.ts +5 -6
  67. package/src/built-in/layout-component/composables/useMenu.ts +3 -5
  68. package/src/built-in/layout-component/composables/useTabbar.ts +3 -5
  69. package/src/built-in/layout-component/composables/useTitle.ts +2 -3
  70. package/src/built-in/layout-component/composables/useWatermark.ts +25 -12
  71. package/src/built-in/layout-component/index.ts +21 -12
  72. package/src/built-in/layout-component/provider.ts +6 -2
  73. package/src/built-in/layout-component/utils/index.ts +0 -1
  74. package/src/built-in/settings/router.ts +5 -1
  75. package/src/features/stores/utils/routerHelper.ts +3 -0
  76. package/src/index.ts +7 -9
  77. package/dist/built-in/layout-component/utils/eventBus.d.ts +0 -5
  78. package/src/built-in/layout-component/components/Tools/DayNightSwitch.vue +0 -70
  79. package/src/built-in/layout-component/utils/eventBus.ts +0 -8
  80. /package/dist/built-in/layout-component/components/Tools/{DayNightSwitch.vue.d.ts → DarkModeToggle.vue.d.ts} +0 -0
  81. /package/dist/built-in/layout-component/components/Tools/{Search.vue.d.ts → SearchPanel.vue.d.ts} +0 -0
@@ -13,8 +13,8 @@ import RiPushpin2Fill from '~icons/ri/pushpin-2-fill';
13
13
  import { PubinfoIcon } from '@/features/components';
14
14
  import { useContext } from '../../../composables/useContext';
15
15
  import { useGlobalSearch } from '../../../composables/useGlobalSearch';
16
- import useTabbar from '../../../composables/useTabbar';
17
- import Search from '../../Tools/Search.vue';
16
+ import { useTabbar } from '../../../composables/useTabbar';
17
+ import Search from '../../Tools/SearchPanel.vue';
18
18
 
19
19
  defineOptions({
20
20
  name: 'TabbarMoreAction',
@@ -11,8 +11,8 @@ import RiPushpin2Fill from '~icons/ri/pushpin-2-fill';
11
11
  import { PubinfoIcon } from '@/features/components';
12
12
  import { storage } from '@/utils';
13
13
  import { useContext } from '../../../composables/useContext';
14
- import useMainPage from '../../../composables/useMainPage';
15
- import useTabbar from '../../../composables/useTabbar';
14
+ import { useMainPage } from '../../../composables/useMainPage';
15
+ import { useTabbar } from '../../../composables/useTabbar';
16
16
  import MoreAction from './MoreAction.vue';
17
17
  import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css';
18
18
 
@@ -1,20 +1,13 @@
1
1
  <script setup lang="ts">
2
+ import type { DropdownMenu } from '../Tools/interface';
2
3
  import { PubinfoIcon } from '@/features/components';
3
4
 
4
5
  const props = defineProps<{
5
- items: {
6
- icon?: string
7
- label: string
8
- disabled?: boolean
9
- hide?: boolean
10
- handle?: () => void
11
- }[][]
6
+ items: DropdownMenu[]
12
7
  }>();
13
8
 
14
9
  const myItems = computed(() => {
15
- return props.items.map((item) => {
16
- return item.filter(v => !v.hide);
17
- }).filter(v => v.length);
10
+ return props.items.filter(item => !item?.hide);
18
11
  });
19
12
  </script>
20
13
 
@@ -27,23 +20,23 @@ const myItems = computed(() => {
27
20
  :auto-hide="false"
28
21
  >
29
22
  <slot />
23
+
30
24
  <template #popper>
31
- <div
32
- v-for="(item, index) in myItems"
33
- :key="index"
34
- class="p-1 dark:bg-[var(--g-container-bg)]"
35
- border-b="~ solid stone-2 dark:stone-7 last:size-0"
36
- >
37
- <button
38
- v-for="(v, i) in item"
39
- :key="i"
40
- :disabled="v.disabled"
41
- class="w-full flex cursor-pointer items-center gap-2 border-size-0 rounded-md bg-inherit px-2 py-1.5 text-sm text-dark disabled:cursor-not-allowed dark:text-white disabled:opacity-50 hover:not-disabled:bg-stone-1 dark:hover:not-disabled:bg-stone-9"
42
- @click="v.handle"
43
- >
44
- <PubinfoIcon v-if="v.icon" :name="v.icon" />
45
- {{ v.label }}
46
- </button>
25
+ <div class="dark:bg-[var(--g-container-bg)] py-1">
26
+ <template v-for="(item, index) in myItems" :key="index">
27
+ <div v-if="item?.key === 'divider'" border-b="~ solid stone-2 dark:stone-7 last:size-0" class="my-1" />
28
+
29
+ <div v-else class="px-1">
30
+ <button
31
+ :disabled="item.disabled"
32
+ class="w-full flex cursor-pointer items-center gap-2 border-size-0 rounded-md bg-inherit px-2 py-1.5 text-sm text-dark disabled:cursor-not-allowed dark:text-white disabled:opacity-50 hover:not-disabled:bg-stone-1 dark:hover:not-disabled:bg-stone-9"
33
+ @click="item?.onClick"
34
+ >
35
+ <PubinfoIcon v-if="item?.icon" :name="item.icon" />
36
+ {{ item?.label }}
37
+ </button>
38
+ </div>
39
+ </template>
47
40
  </div>
48
41
  </template>
49
42
  </VMenu>
@@ -1,4 +1,4 @@
1
- import { useMenuStore, useSettingsStore } from '@/features/stores';
1
+ import { useContext } from './useContext';
2
2
 
3
3
  /**
4
4
  * 获取指定元素的计算样式属性值
@@ -17,8 +17,7 @@ type unit = `${string}px`;
17
17
  * @returns 包含主侧边栏和子侧边栏实际宽度的计算属性对象。
18
18
  */
19
19
  export function useGetSidebarActualWidth() {
20
- const settingsStore = useSettingsStore();
21
- const menuStore = useMenuStore();
20
+ const { settingsStore, menuStore } = useContext();
22
21
 
23
22
  const mainSidebarActualWidth = computed<unit>(() => {
24
23
  const menuMode = settingsStore.settings.menu.menuMode;
@@ -1,15 +1,11 @@
1
- import type { useMenuStore, useSettingsStore } from '@/features/stores';
2
1
  import hotkeys from 'hotkeys-js';
3
- import useMainPage from './useMainPage';
4
- import useMenu from './useMenu';
2
+ import { useContext } from './useContext';
3
+ import { useMainPage } from './useMainPage';
4
+ import { useMenu } from './useMenu';
5
+
6
+ export function useHotkey() {
7
+ const { settingsStore, menuStore } = useContext();
5
8
 
6
- export function useHotkey({
7
- menuStore,
8
- settingsStore,
9
- }: {
10
- menuStore: ReturnType<typeof useMenuStore>
11
- settingsStore: ReturnType<typeof useSettingsStore>
12
- }) {
13
9
  const mainPage = useMainPage();
14
10
  const menu = useMenu();
15
11
 
@@ -1,5 +1,5 @@
1
- import { useSettingsStore, useTabbarStore } from '@/features/stores';
2
- import useTabbar from './useTabbar';
1
+ import { useContext } from './useContext';
2
+ import { useTabbar } from './useTabbar';
3
3
 
4
4
  /**
5
5
  * 用于主页面功能的自定义钩子。
@@ -9,13 +9,12 @@ import useTabbar from './useTabbar';
9
9
  * - resetCustomTitle: 重置当前页面的自定义标题。
10
10
  * - maximize: 设置主页面的最大化状态。
11
11
  */
12
- export default function useMainPage() {
12
+ export function useMainPage() {
13
+ const { settingsStore, tabbarStore } = useContext();
14
+
13
15
  const route = useRoute();
14
16
  const router = useRouter();
15
17
 
16
- const settingsStore = useSettingsStore();
17
- const tabbarStore = useTabbarStore();
18
-
19
18
  const tabbar = useTabbar();
20
19
 
21
20
  /**
@@ -1,17 +1,15 @@
1
1
  import type { Menu } from '#/menu';
2
2
  import { message } from 'ant-design-vue';
3
- import { useMenuStore, useSettingsStore } from '@/features/stores';
3
+ import { useContext } from './useContext';
4
4
 
5
5
  /**
6
6
  * 用于管理菜单功能的自定义组合函数。
7
7
  * @returns 一个包含 `switchTo` 函数的对象。
8
8
  */
9
- export default function useMenu() {
9
+ export function useMenu() {
10
+ const { settingsStore, menuStore } = useContext();
10
11
  const router = useRouter();
11
12
 
12
- const settingsStore = useSettingsStore();
13
- const menuStore = useMenuStore();
14
-
15
13
  function switchTo(index: number | string, mainRouter?: Menu.recordMainRaw) {
16
14
  if (mainRouter && mainRouter.meta?.isDev) {
17
15
  message.info('暂未上线,敬请期待!');
@@ -1,14 +1,12 @@
1
1
  import type { RouteLocationRaw } from 'vue-router';
2
2
  import Message from 'vue-m-message';
3
- import { useSettingsStore, useTabbarStore } from '@/features/stores';
3
+ import { useContext } from './useContext';
4
4
 
5
- export default function useTabbar() {
5
+ export function useTabbar() {
6
+ const { settingsStore, tabbarStore } = useContext();
6
7
  const route = useRoute();
7
8
  const router = useRouter();
8
9
 
9
- const settingsStore = useSettingsStore();
10
- const tabbarStore = useTabbarStore();
11
-
12
10
  function getId() {
13
11
  return settingsStore.settings.tabbar.mergeTabsBy === 'activeMenu' ? (route.meta.activeMenu ?? route.fullPath) : route.fullPath;
14
12
  }
@@ -1,8 +1,7 @@
1
+ import type { useSettingsStore } from '@/features/stores';
1
2
  import { useI18n } from 'vue-i18n';
2
- import { useSettingsStore } from '@/features/stores';
3
3
 
4
- export function useTitle(appTitle: string) {
5
- const settingsStore = useSettingsStore();
4
+ export function useTitle(appTitle: string, settingsStore: ReturnType<typeof useSettingsStore>) {
6
5
  const { t, te } = useI18n();
7
6
  const routeInfo = useRoute();
8
7
  watch(
@@ -1,12 +1,16 @@
1
- import { useSettingsStore, useUserStore } from '@/features/stores';
2
- import { eventBus, watermark } from '../utils';
1
+ import mitt from 'mitt';
2
+ import { watermark } from '../utils';
3
+ import { useContext } from './useContext';
3
4
 
4
- export default function useWatermark() {
5
- const settingsStore = useSettingsStore();
6
- const userStore = useUserStore();
5
+ const eventBus = mitt();
6
+
7
+ export function useWatermark() {
8
+ const { settingsStore, userStore } = useContext();
7
9
  const { init, remove } = watermark();
8
10
 
9
- eventBus.on('updateWatermark', () => {
11
+ eventBus.on('updateWatermark', updateWatermark);
12
+
13
+ function updateWatermark() {
10
14
  if (settingsStore.settings.watermark.enable) {
11
15
  loadWatermark();
12
16
  window.addEventListener('resize', loadWatermark);
@@ -15,13 +19,17 @@ export default function useWatermark() {
15
19
  removeWatermark();
16
20
  window.removeEventListener('resize', loadWatermark);
17
21
  }
18
- });
22
+ }
19
23
 
20
- watch(() => settingsStore.settings.app.colorScheme, () => {
21
- if (settingsStore.settings.watermark.enable) {
22
- loadWatermark();
23
- }
24
- }, { immediate: true });
24
+ watch(
25
+ () => settingsStore.settings.app.colorScheme,
26
+ () => {
27
+ if (settingsStore.settings.watermark.enable) {
28
+ loadWatermark();
29
+ }
30
+ },
31
+ { immediate: true },
32
+ );
25
33
 
26
34
  function getTextVal() {
27
35
  const type = settingsStore.settings.watermark.text;
@@ -63,5 +71,10 @@ export default function useWatermark() {
63
71
  return {
64
72
  loadWatermark,
65
73
  removeWatermark,
74
+ updateWatermark,
66
75
  };
67
76
  }
77
+
78
+ export function updateWatermark() {
79
+ eventBus.emit('updateWatermark');
80
+ }
@@ -7,18 +7,17 @@ import { Provider as LayoutProvider } from './provider';
7
7
  import Layout from './Layout.vue';
8
8
  import LayoutContent from './components/Content/index.vue';
9
9
  import LayoutHeader from './components/Header/index.vue';
10
+ import LayoutSidebar from './components/Sidebar/index.vue';
11
+ import LayoutTopbar from './components/Topbar/index.vue';
10
12
 
11
13
  import Logo from './components/Logo/index.vue';
12
- import Menu from './components/Menu/index.vue';
13
14
  import Tools from './components/Tools/index.vue';
15
+ import Fullscreen from './components/Tools/Fullscreen.vue';
16
+ import PageReload from './components/Tools/PageReload.vue';
17
+ import DarkModeToggle from './components/Tools/DarkModeToggle.vue';
14
18
 
15
- import Topbar from './components/Topbar/index.vue';
16
- import Sidebar from './components/Sidebar/index.vue';
17
19
  import Copyright from './components/Copyright/index.vue';
18
20
 
19
- import SettingBar from './components/SettingBar/index.vue';
20
- import BackTop from './components/BackTop/index.vue';
21
-
22
21
  import FloatingVue from 'floating-vue';
23
22
  import Message from 'vue-m-message';
24
23
  import 'vue-m-message/dist/style.css';
@@ -62,20 +61,30 @@ export function LayoutComponent(): ModuleOptions {
62
61
  };
63
62
  }
64
63
 
64
+ export type { DropdownMenu, DropdownMenuRender } from './components/Tools/interface';
65
+
66
+ export const Tool = {
67
+ Fullscreen,
68
+ PageReload,
69
+ DarkModeToggle,
70
+ };
71
+
72
+ Layout.Provider = LayoutProvider;
73
+ Layout.Header = LayoutHeader;
74
+ Layout.Content = LayoutContent;
75
+ Layout.Sidebar = LayoutSidebar;
76
+ Layout.Topbar = LayoutTopbar;
77
+
65
78
  export {
66
79
  LayoutProvider,
67
80
  Layout,
68
81
  LayoutContent,
69
82
  LayoutHeader,
83
+ LayoutSidebar,
84
+ LayoutTopbar,
70
85
 
71
86
  Logo,
72
- Menu,
73
87
  Tools,
74
88
 
75
- Topbar,
76
- Sidebar,
77
89
  Copyright,
78
-
79
- SettingBar,
80
- BackTop,
81
90
  };
@@ -38,7 +38,7 @@ export const Provider = defineComponent({
38
38
  const tabbarStore = useTabbarStore();
39
39
  const favoritesStore = useFavoritesStore();
40
40
 
41
- const { generateI18nTitle } = useTitle(props.appTitle);
41
+ const { generateI18nTitle } = useTitle(props.appTitle, settingsStore);
42
42
 
43
43
  createContext({
44
44
  settingsStore,
@@ -58,7 +58,11 @@ export const Provider = defineComponent({
58
58
  return () => h(
59
59
  PubinfoProvider,
60
60
  {},
61
- () => slots?.default?.(),
61
+ () => slots?.default?.({
62
+ allMenus: menuStore.allMenus,
63
+ sidebarMenus: menuStore.sidebarMenus,
64
+ activedMenuIndex: menuStore.actived,
65
+ }),
62
66
  );
63
67
  },
64
68
  });
@@ -1,3 +1,2 @@
1
- export * from './eventBus';
2
1
  export * from './injectionKeys';
3
2
  export * from './watermark';
@@ -106,7 +106,11 @@ function hitCache(
106
106
  cache?: RouterMetaRawBaseOptions['cache'],
107
107
  noCache?: RouterMetaRawBaseOptions['noCache'],
108
108
  ) {
109
- return cache && matched(name, cache) && !matched(name, noCache);
109
+ if (typeof cache === 'boolean') {
110
+ return cache && !matched(name, noCache);
111
+ }
112
+
113
+ return matched(name, cache) && !matched(name, noCache);
110
114
  }
111
115
 
112
116
  function matched(
@@ -136,6 +136,7 @@ function transformMenuAndIframe(route: BackEndRoute, parent: API.PubResourceTree
136
136
  const menuRouteChildren: BackEndRoute[] = [
137
137
  {
138
138
  path: '',
139
+ name: route.name,
139
140
  component: replaceComponent(route.component, route.meta?.scope),
140
141
  meta: {
141
142
  ...route.meta,
@@ -155,6 +156,7 @@ function transformMenuAndIframe(route: BackEndRoute, parent: API.PubResourceTree
155
156
  menuRoute = {
156
157
  ...route,
157
158
  path: startsWithSlash(route.path),
159
+ name: undefined,
158
160
  component: setupDefaultLayout(),
159
161
  children: menuRouteChildren,
160
162
  };
@@ -165,6 +167,7 @@ function transformMenuAndIframe(route: BackEndRoute, parent: API.PubResourceTree
165
167
  menuRoute = {
166
168
  ...route,
167
169
  path: route.path,
170
+ name: undefined,
168
171
  component: undefined,
169
172
  children: menuRouteChildren,
170
173
  };
package/src/index.ts CHANGED
@@ -78,22 +78,21 @@ export function createPubinfo(options: PubinfoOptions) {
78
78
  });
79
79
  }
80
80
 
81
+ export { RESPONSE_CODE } from './built-in/authentication';
81
82
  export {
82
- BackTop,
83
83
  Copyright,
84
84
  Layout,
85
85
  LayoutContent,
86
86
  LayoutHeader,
87
87
  LayoutProvider,
88
+ LayoutSidebar,
89
+ LayoutTopbar,
88
90
  Logo,
89
- Menu,
90
- RESPONSE_CODE,
91
- SettingBar,
92
- Sidebar,
91
+ Tool,
93
92
  Tools,
94
- Topbar,
95
- } from './built-in';
96
- export { eventBus } from './built-in/layout-component/utils';
93
+ } from './built-in/layout-component';
94
+ export type { DropdownMenu, DropdownMenuRender } from './built-in/layout-component';
95
+ export { updateWatermark } from './built-in/layout-component/composables/useWatermark';
97
96
 
98
97
  export {
99
98
  createRequest,
@@ -103,7 +102,6 @@ export {
103
102
  getAllRouteModules,
104
103
  readProjectModules,
105
104
  } from './core';
106
-
107
105
  export * from './core/interface';
108
106
 
109
107
  export * from './features';
@@ -1,5 +0,0 @@
1
- interface MittTypes {
2
- [key: PropertyKey]: any;
3
- }
4
- export declare const eventBus: import('mitt').Emitter<MittTypes>;
5
- export {};
@@ -1,70 +0,0 @@
1
- <script setup lang="ts">
2
- import { useContext } from '../../composables/useContext';
3
-
4
- defineOptions({
5
- name: 'DayNightSwitch',
6
- });
7
-
8
- const { settingsStore } = useContext();
9
- </script>
10
-
11
- <template>
12
- <label v-if="settingsStore.settings.toolbar.enableColorScheme" class="day-night">
13
- <div
14
- class="animate-icon"
15
- :class="{
16
- 'animate-icon-day': settingsStore.settings.app.colorScheme !== 'dark',
17
- }"
18
- />
19
- </label>
20
- </template>
21
-
22
- <style scoped>
23
- .day-night {
24
- --at-apply: size-11 cursor-pointer scale-45;
25
- }
26
-
27
- .animate-icon {
28
- --at-apply: relative size-38px rounded-1/2 ;
29
- box-shadow: inset 16px -16px 0 0 #fff;
30
- transition: box-shadow 0.5s ease 0s, transform 0.4s ease 0.1s;
31
- transform: scale(1) rotate(-2deg);
32
- }
33
-
34
- .animate-icon::before {
35
- --at-apply: absolute w-[inherit] h-[inherit] content-empty rounded-[inherit] left-0 top-0;
36
- transition: background 0.3s ease;
37
- }
38
-
39
- .animate-icon::after {
40
- --at-apply: absolute top-1/2 left-1/2 size-2 -ml-1 mr-0 -mt-1 mb-0 rounded-[50%] content-empty;
41
- box-shadow:
42
- 0 -23px 0 #ffce6e,
43
- 0 23px 0 #ffce6e,
44
- 23px 0 0 #ffce6e,
45
- -23px 0 0 #ffce6e,
46
- 15px 15px 0 #ffce6e,
47
- -15px 15px 0 #ffce6e,
48
- 15px -15px 0 #ffce6e,
49
- -15px -15px 0 #ffce6e;
50
- transition: all 0.3s ease;
51
- transform: scale(0);
52
- }
53
-
54
- .animate-icon-day {
55
- --at-apply: size-11;
56
- box-shadow: inset 32px -32px 0 0 #fff;
57
- transition: transform 0.3s ease 0.1s, box-shadow 0.2s ease 0s;
58
- transform: scale(0.5) rotate(0deg);
59
- }
60
-
61
- .animate-icon-day::before {
62
- background: #ffce6e;
63
- transition: background 0.3s ease 0.1s;
64
- }
65
-
66
- .animate-icon-day::after {
67
- transition: transform 0.5s ease 0.15s;
68
- transform: scale(1.5);
69
- }
70
- </style>
@@ -1,8 +0,0 @@
1
- // TODO 考虑优化掉
2
- import mitt from 'mitt';
3
-
4
- interface MittTypes {
5
- [key: PropertyKey]: any
6
- }
7
-
8
- export const eventBus = mitt<MittTypes>();