@spacego/fe-components 0.0.1-alpha.1 → 0.0.1-alpha.2

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.
@@ -13,9 +13,9 @@ import "../../store/modules/layout-config.store.js";
13
13
  import { useThemeStore as T } from "../../store/modules/theme.store.js";
14
14
  import { THEME_COLORS as E } from "../../config/theme.js";
15
15
  import "antd";
16
+ import { useGlobal as C } from "../context/context.js";
16
17
  /* empty css */
17
18
  import "../basics-layout/index.js";
18
- import { useGlobal as C } from "../context/context.js";
19
19
  function A() {
20
20
  const { appName: s, logo: n } = C(), { theme: o, themeColor: c, TOGGLE_THEME: m, SET_THEME_COLOR: f } = T(p(["theme", "themeColor", "TOGGLE_THEME", "SET_THEME_COLOR"])), [a, l] = u(!1), d = (r) => {
21
21
  const i = r.currentTarget.getBoundingClientRect(), h = i.left + i.width / 2, x = i.top + i.height / 2;
@@ -8,11 +8,11 @@ import { useLayoutConfigStore as d } from "../store/modules/layout-config.store.
8
8
  import { useThemeStore as C } from "../store/modules/theme.store.js";
9
9
  import a from "../config/theme.js";
10
10
  import "react-router-dom";
11
- import y from "./auth-layout/index.js";
12
- import k from "./basics-layout/index.js";
13
- import L from "./blank-layout/index.js";
14
11
  import "./context/context.js";
15
- import M from "./context/global-context.provider.js";
12
+ import y from "./context/global-context.provider.js";
13
+ import k from "./auth-layout/index.js";
14
+ import L from "./basics-layout/index.js";
15
+ import M from "./blank-layout/index.js";
16
16
  function q(p) {
17
17
  const { layoutType: e } = p, { loadingConfig: s } = d(n(["loadingConfig"])), { theme: t, themeColor: r } = C(n(["theme", "themeColor"])), l = u(() => {
18
18
  const f = g(t);
@@ -31,11 +31,11 @@ function q(p) {
31
31
  }
32
32
  };
33
33
  }, [t, r]), m = (/* @__PURE__ */ new Map([
34
- ["blank", L],
35
- ["basic", k],
36
- ["auth", y]
34
+ ["blank", M],
35
+ ["basic", L],
36
+ ["auth", k]
37
37
  ])).get(e);
38
- return /* @__PURE__ */ o(h, { theme: l, children: /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
38
+ return /* @__PURE__ */ o(h, { theme: l, children: /* @__PURE__ */ o(y, { children: /* @__PURE__ */ o(
39
39
  c,
40
40
  {
41
41
  spinning: s.show && e !== "basic",
package/lib/index.js CHANGED
@@ -5,44 +5,46 @@ import { useThemeStore as y } from "./store/modules/theme.store.js";
5
5
  import { APP_KEY as g, NOOP as d, STORE_KEY as L } from "./config/constants.js";
6
6
  import { THEME_COLORS as C } from "./config/theme.js";
7
7
  import { createRouter as E, generateRouter as O } from "./router/index.js";
8
- import { default as b } from "./fe-layouts/auth-layout/index.js";
9
- import { default as _ } from "./fe-layouts/basics-layout/index.js";
10
- import { default as B } from "./fe-layouts/blank-layout/index.js";
11
- import { GlobalContext as I, useGlobal as K } from "./fe-layouts/context/context.js";
12
- import { default as k } from "./fe-layouts/context/global-context.provider.js";
13
- import { default as z } from "./fe-layouts/layout.js";
14
- import { createDefaultRoutes as F } from "./router/routes.js";
15
- import { createLazyComponent as N, getPath as W, processRoutes as j } from "./router/utils.js";
16
- import { createPermissionHelpers as w } from "./router/permission.js";
8
+ import { useAuth as b } from "./hooks/use-auth.hook.js";
9
+ import { default as G } from "./fe-layouts/auth-layout/index.js";
10
+ import { default as B } from "./fe-layouts/basics-layout/index.js";
11
+ import { default as I } from "./fe-layouts/blank-layout/index.js";
12
+ import { GlobalContext as Y, useGlobal as k } from "./fe-layouts/context/context.js";
13
+ import { default as z } from "./fe-layouts/context/global-context.provider.js";
14
+ import { default as F } from "./fe-layouts/layout.js";
15
+ import { createDefaultRoutes as N } from "./router/routes.js";
16
+ import { createLazyComponent as j, getPath as q, processRoutes as w } from "./router/utils.js";
17
+ import { createPermissionHelpers as Q } from "./router/permission.js";
17
18
  export {
18
19
  g as APP_KEY,
19
- b as AuthLayout,
20
- _ as BasicsLayout,
21
- B as BlankLayout,
22
- z as FeLayout,
23
- I as GlobalContext,
24
- k as GlobalContextProvider,
20
+ G as AuthLayout,
21
+ B as BasicsLayout,
22
+ I as BlankLayout,
23
+ F as FeLayout,
24
+ Y as GlobalContext,
25
+ z as GlobalContextProvider,
25
26
  d as NOOP,
26
27
  L as STORE_KEY,
27
28
  C as THEME_COLORS,
28
29
  m as applyTheme,
29
30
  p as applyThemeColor,
30
31
  f as applyThemeWithTransition,
31
- F as createDefaultRoutes,
32
- N as createLazyComponent,
33
- w as createPermissionHelpers,
32
+ N as createDefaultRoutes,
33
+ j as createLazyComponent,
34
+ Q as createPermissionHelpers,
34
35
  E as createRouter,
35
36
  O as generateRouter,
36
37
  t as getIcon,
37
- W as getPath,
38
+ q as getPath,
38
39
  l as getRealTheme,
39
40
  s as getTheme,
40
41
  u as initTheme,
41
42
  x as listenSystemTheme,
42
- j as processRoutes,
43
+ w as processRoutes,
43
44
  r as renderIcon,
44
45
  n as toggleTheme,
45
- K as useGlobal,
46
+ b as useAuth,
47
+ k as useGlobal,
46
48
  T as useLayoutConfigStore,
47
49
  y as useThemeStore
48
50
  };
@@ -7,6 +7,7 @@ import { STORE_KEY as E } from "../../config/constants.js";
7
7
  import "react-router-dom";
8
8
  import "antd";
9
9
  import "react";
10
+ import "../../fe-layouts/context/context.js";
10
11
  import "@spacego/zustand";
11
12
  import "react-icons/fa6";
12
13
  import "react-icons/io5";
@@ -14,7 +15,6 @@ import "react-icons/lu";
14
15
  import "react-icons/md";
15
16
  /* empty css */
16
17
  import "../../fe-layouts/basics-layout/index.js";
17
- import "../../fe-layouts/context/context.js";
18
18
  const A = () => ({
19
19
  tabsAttribute: {
20
20
  tabsList: [{
@@ -8,6 +8,7 @@ import { STORE_KEY as i } from "../../config/constants.js";
8
8
  import "react-router-dom";
9
9
  import "antd";
10
10
  import "react";
11
+ import "../../fe-layouts/context/context.js";
11
12
  import "@spacego/zustand";
12
13
  import "react-icons/fa6";
13
14
  import "react-icons/io5";
@@ -15,7 +16,6 @@ import "react-icons/lu";
15
16
  import "react-icons/md";
16
17
  /* empty css */
17
18
  import "../../fe-layouts/basics-layout/index.js";
18
- import "../../fe-layouts/context/context.js";
19
19
  const a = () => ({
20
20
  theme: "light",
21
21
  themeColor: "#006BE6",
@@ -6,5 +6,7 @@ export * from './store';
6
6
  export * from './config';
7
7
  /**------------------------------------------- router ------------------------------------------- */
8
8
  export * from './router';
9
+ /**------------------------------------------- hooks ------------------------------------------- */
10
+ export * from './hooks';
9
11
  /**------------------------------------------- components ------------------------------------------- */
10
12
  export * from './fe-layouts';
@@ -15,7 +15,7 @@ export interface CreateRouterOptions {
15
15
  /**
16
16
  * 创建路由器配置(第一层)
17
17
  * @param options
18
- * @returns { routes, permissionHelpers }
18
+ * @returns
19
19
  */
20
20
  export declare function createRouter(options: CreateRouterOptions): {
21
21
  /** 最终合并后的路由配置 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spacego/fe-components",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.2",
4
4
  "description": "🚀 A component library for fe to use.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
package/src/index.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Author: dushuai
3
3
  * @Date: 2026-01-31 23:07:12
4
4
  * @LastEditors: dushuai
5
- * @LastEditTime: 2026-02-01 12:38:34
5
+ * @LastEditTime: 2026-02-01 13:00:31
6
6
  * @description: export
7
7
  */
8
8
  /**------------------------------------------- utils ------------------------------------------- */
@@ -17,5 +17,8 @@ export * from './config';
17
17
  /**------------------------------------------- router ------------------------------------------- */
18
18
  export * from './router';
19
19
 
20
+ /**------------------------------------------- hooks ------------------------------------------- */
21
+ export * from './hooks';
22
+
20
23
  /**------------------------------------------- components ------------------------------------------- */
21
24
  export * from './fe-layouts';
@@ -2,7 +2,7 @@
2
2
  * @Author: dushuai
3
3
  * @Date: 2024-03-29 16:05:16
4
4
  * @LastEditors: dushuai
5
- * @LastEditTime: 2026-02-01 01:14:48
5
+ * @LastEditTime: 2026-02-01 12:54:00
6
6
  * @description: router
7
7
  */
8
8
  import type { ComponentType } from 'react';
@@ -26,7 +26,7 @@ export interface CreateRouterOptions {
26
26
  /**
27
27
  * 创建路由器配置(第一层)
28
28
  * @param options
29
- * @returns { routes, permissionHelpers }
29
+ * @returns
30
30
  */
31
31
  export function createRouter(options: CreateRouterOptions) {
32
32
  const { modules, token, BaseLayout, routes: customRoutes = [] } = options;