@nocobase/client-v2 2.2.53 → 2.2.55

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.
@@ -53,6 +53,7 @@ export interface BaseApplicationOptions<TPluginType> {
53
53
  scopes?: Record<string, any>;
54
54
  router?: RouterOptions;
55
55
  designable?: boolean;
56
+ initializeAuthFromUrl?: boolean;
56
57
  loadRemotePlugins?: boolean;
57
58
  devDynamicImport?: DevDynamicImport;
58
59
  disableAcl?: boolean;
@@ -105,6 +106,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
105
106
  maintaining: boolean;
106
107
  error: any;
107
108
  model: ApplicationModel;
109
+ private appliedAuthCallback?;
108
110
  private wsAuthorized;
109
111
  apps: {
110
112
  Component?: AnyComponent | null;
@@ -115,6 +117,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
115
117
  get isWsAuthorized(): boolean;
116
118
  setDocumentLanguage(language?: string | null): void;
117
119
  constructor(options?: TOptions);
120
+ applyAuthCallback(params: URLSearchParams): boolean;
118
121
  /**
119
122
  * 注册共享 observable 状态。
120
123
  */
@@ -16,6 +16,7 @@ export declare class AdminLayoutMenuItemModel extends FlowModel<AdminLayoutMenuI
16
16
  private creationPersisted;
17
17
  private persistedStateHydrated;
18
18
  private persistedStateHydrating?;
19
+ get pendingMenuState(): Promise<void>;
19
20
  onInit(options: any): void;
20
21
  syncFromRoute(route: NocoBaseDesktopRoute, parentRoute?: NocoBaseDesktopRoute): void;
21
22
  getRoute(): NocoBaseDesktopRoute;
@@ -24,6 +24,7 @@ export type AdminLayoutMenuNode = {
24
24
  icon?: React.ReactNode;
25
25
  path: string;
26
26
  redirect?: string;
27
+ _landingPage?: NocoBaseDesktopRoute;
27
28
  hideInMenu?: boolean;
28
29
  disabled?: boolean;
29
30
  _runtimePath?: string | null;
@@ -18,6 +18,7 @@ export type AdminLayoutStructure = BaseLayoutStructure & {
18
18
  menuItems?: AdminLayoutMenuItemModel[];
19
19
  };
20
20
  };
21
+ type FindFirstPage = (routes: NocoBaseDesktopRoute[]) => NocoBaseDesktopRoute | undefined;
21
22
  type GetAdminLayoutModelOptions<TModel extends FlowModel = AdminLayoutModel> = GetLayoutModelOptions<TModel>;
22
23
  /**
23
24
  * Admin Layout 的纯运行时 host model。
@@ -47,6 +48,7 @@ export declare class AdminLayoutModel extends BaseLayoutModel<AdminLayoutStructu
47
48
  * @returns {void}
48
49
  */
49
50
  syncMenuRoutes(routes: NocoBaseDesktopRoute[]): void;
51
+ resolveDefaultPage(routes: NocoBaseDesktopRoute[], findFirstPage: FindFirstPage): Promise<NocoBaseDesktopRoute>;
50
52
  /**
51
53
  * 将菜单模型转换为 ProLayout 路由树。
52
54
  *
@@ -8,6 +8,7 @@
8
8
  */
9
9
  export * from './AdminLayoutComponent';
10
10
  export * from './AdminLayoutModel';
11
+ export * from './observeAdminMenuRoutes';
11
12
  export * from './AppSwitcherActionPanelModel';
12
13
  export * from '../BaseLayoutModel';
13
14
  export * from '../BaseLayoutRouteCoordinator';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ type MenuNode<T> = {
10
+ _route?: {
11
+ type?: string;
12
+ };
13
+ _model?: {
14
+ readonly pendingMenuState?: Promise<void>;
15
+ };
16
+ _landingPage?: unknown;
17
+ routes?: T[];
18
+ };
19
+ export declare function observeAdminMenuRoutes<T extends MenuNode<T>>(project: () => {
20
+ path: string;
21
+ children: T[];
22
+ }, publish: (route: {
23
+ path: string;
24
+ children: T[];
25
+ }) => void, designable: boolean): () => void;
26
+ export {};
@@ -6,7 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { FlowModelContext, type SubModelItem } from '@nocobase/flow-engine';
9
+ import { type FlowModelContext, type SubModelItem } from '@nocobase/flow-engine';
10
10
  import { TableCustomColumnModel } from './TableCustomColumnModel';
11
11
  /**
12
12
  * “JavaScript 字段”菜单入口(表格):