@_tc/template-core 0.0.1-bate.60 → 0.0.1-bate.61

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.
@@ -1,18 +1,18 @@
1
1
  import { getAuthToken } from "../../src/common/auth/index.js";
2
2
  import { getText } from "../../src/common/language.js";
3
3
  import { generateMenuItemData } from "../../src/common/generateMenuData.js";
4
- import defaultAlias_default from "../../../bundler/defaultAlias.js";
5
4
  import { Menu } from "../../../packages/react/ui/components/Menu/Menu.js";
6
5
  import "../../../packages/react/ui/components/index.js";
7
6
  import { useModeStore } from "../../src/stores/mode.js";
8
7
  import { findMenuItem, leftSidebarBasePath } from "../../src/common/menu.js";
9
8
  import HeaderView from "../../src/components/BasePage/HeaderView.js";
10
9
  import useRouterParams from "../../src/hooks/useRouterParams.js";
11
- import defaultRouteGuard_default from "../../../bundler/defaultRouteGuard.js";
12
10
  import useInit from "../../../packages/react/hooks/useInit.js";
13
11
  import { useEffect, useMemo, useRef, useState } from "react";
14
12
  import { Outlet, useNavigate } from "react-router-dom";
15
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
+ import dashComponents from "@tc/scalability/dash/components";
15
+ import dashRouteGuard from "@tc/scalability/dash/routeGuard";
16
16
  //#region frontend/apps/dash/Dashboard.tsx
17
17
  var normalizePathname = (pathname) => {
18
18
  if (!pathname) return "/";
@@ -82,7 +82,7 @@ var getRenderableHomePage = (projectInfo) => {
82
82
  };
83
83
  var Dashboard = () => {
84
84
  const { initModeData, initData, projectInfo } = useModeStore();
85
- const HeaderUserArea = defaultAlias_default["HeaderView.userArea"];
85
+ const HeaderUserArea = dashComponents["HeaderView.userArea"];
86
86
  useInit(() => {
87
87
  !initData && initModeData();
88
88
  });
@@ -112,9 +112,9 @@ var Dashboard = () => {
112
112
  useEffect(() => {
113
113
  if (initData && projectInfo) {
114
114
  if (isInit.current) return;
115
- if (typeof defaultRouteGuard_default === "function") {
115
+ if (typeof dashRouteGuard === "function") {
116
116
  const authToken = getAuthToken();
117
- const loginUrl = defaultRouteGuard_default({
117
+ const loginUrl = dashRouteGuard({
118
118
  projectInfo,
119
119
  params,
120
120
  pathname: location.pathname,
@@ -1,9 +1,10 @@
1
- import defaultAlias_default from "../../../bundler/defaultAlias.js";
2
1
  import { QK, leftSidebarBasePath } from "../../src/common/menu.js";
3
2
  import Dashboard from "./Dashboard.js";
4
3
  import { renderImportComponent } from "../../src/common/importComponent.js";
5
4
  import { initApp } from "../../src/main.js";
6
5
  import { jsx } from "react/jsx-runtime";
6
+ import extendDashRoutes from "@tc/scalability/dash/customRoutes";
7
+ import initDash from "@tc/scalability/dash/init";
7
8
  //#region frontend/apps/dash/dash.entry.tsx
8
9
  var baseRoutes = [{
9
10
  path: "/",
@@ -32,12 +33,12 @@ var sidebarRoutes = [{
32
33
  }]
33
34
  }];
34
35
  var getDefaultPageRoutes = () => {
35
- if (typeof defaultAlias_default === "function") {
36
+ if (typeof extendDashRoutes === "function") {
36
37
  const ctx = {
37
38
  topRoutes: [],
38
39
  sidebarRoutes: []
39
40
  };
40
- defaultAlias_default(ctx);
41
+ extendDashRoutes(ctx);
41
42
  const { topRoutes: customTopRoutes, sidebarRoutes: customSidebarRoutes } = ctx;
42
43
  baseRoutes[0]?.children?.push(...customTopRoutes);
43
44
  sidebarRoutes.forEach((sr) => {
@@ -53,7 +54,7 @@ initApp(({ children }) => /* @__PURE__ */ jsx("div", {
53
54
  }), {
54
55
  routes: getDefaultPageRoutes(),
55
56
  beforeRender: async (context) => {
56
- if (typeof defaultAlias_default === "function") await defaultAlias_default(context);
57
+ if (typeof initDash === "function") await initDash(context);
57
58
  }
58
59
  });
59
60
  //#endregion
@@ -1,9 +1,9 @@
1
- import defaultAlias_default from "../../../../../../bundler/defaultAlias.js";
2
1
  import { baseComponentsMap } from "./builtIn.js";
2
+ import consumerComponentsMap from "@tc/scalability/SchemaPage/CallCom/data";
3
3
  //#region frontend/src/defaultPages/SchemaPage/components/CallCom/data.ts
4
4
  var components = {
5
5
  ...baseComponentsMap,
6
- ...defaultAlias_default
6
+ ...consumerComponentsMap
7
7
  };
8
8
  //#endregion
9
9
  export { components };
@@ -1,6 +1,6 @@
1
- import defaultAlias_default from "../../../../../../bundler/defaultAlias.js";
2
- import frameComponentsMap from "../../../../../../frontend/extended/SchemaForm/data.js";
3
1
  import React from "react";
2
+ import consumerComponentsMap from "@tc/scalability/SchemaForm/data";
3
+ import frameComponentsMap from "@tc/scalability/SchemaForm/frameData";
4
4
  var componentsMap = {
5
5
  input: React.lazy(async () => ({ default: (await import("../../Input/index.js")).Input })),
6
6
  inputNumber: React.lazy(async () => ({ default: (await import("../../InputNumber/index.js")).InputNumber })),
@@ -10,7 +10,7 @@ var componentsMap = {
10
10
  date: React.lazy(async () => ({ default: (await import("../../Date/index.js")).DatePicker })),
11
11
  checkbox: React.lazy(async () => ({ default: (await import("../../Checkbox/index.js")).Checkbox })),
12
12
  ...frameComponentsMap,
13
- ...defaultAlias_default
13
+ ...consumerComponentsMap
14
14
  };
15
15
  //#endregion
16
16
  export { componentsMap };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_tc/template-core",
3
- "version": "0.0.1-bate.60",
3
+ "version": "0.0.1-bate.61",
4
4
  "description": "A full-stack TypeScript admin framework powered by Koa, React, and Vite - monorepo root",
5
5
  "types": "./types/index.d.ts",
6
6
  "exports": {
@@ -1,4 +0,0 @@
1
- //#region bundler/defaultAlias.ts
2
- var defaultAlias_default = {};
3
- //#endregion
4
- export { defaultAlias_default as default };
@@ -1,4 +0,0 @@
1
- //#region bundler/defaultRouteGuard.ts
2
- var defaultRouteGuard_default = {};
3
- //#endregion
4
- export { defaultRouteGuard_default as default };