@nocobase/client 0.14.0-alpha.8 → 0.15.0-alpha.1
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/.dumirc.ts +95 -35
- package/docs/index.md +1 -0
- package/es/application/Application.d.ts +7 -2
- package/es/application/PluginManager.d.ts +2 -1
- package/es/application/PluginSettingsManager.d.ts +49 -0
- package/es/application/components/defaultComponents.d.ts +1 -0
- package/es/application/index.d.ts +1 -0
- package/es/block-provider/TemplateBlockProvider.d.ts +7 -0
- package/es/collection-manager/Configuration/DeleteCollectionAction.d.ts +18 -0
- package/es/collection-manager/Configuration/index.d.ts +1 -0
- package/es/collection-manager/action-hooks.d.ts +3 -0
- package/es/index.mjs +1241 -711
- package/es/locale/en_US.d.ts +2 -0
- package/es/locale/ja_JP.d.ts +1 -0
- package/es/locale/pt_BR.d.ts +1 -0
- package/es/locale/zh_CN.d.ts +2 -0
- package/es/pm/PluginSetting.d.ts +1 -51
- package/es/pm/index.d.ts +1 -0
- package/es/pm/style.d.ts +1 -1
- package/es/schema-component/antd/action/utils.d.ts +1 -2
- package/es/schema-component/antd/auto-complete/AutoComplete.d.ts +1 -1
- package/es/schema-component/antd/date-picker/util.d.ts +1 -1
- package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.d.ts +1 -1
- package/es/schema-component/antd/input/Input.d.ts +1 -0
- package/es/schema-component/antd/password/utils.d.ts +1 -1
- package/es/schema-component/common/utils/uitls.d.ts +1 -2
- package/es/schema-initializer/buttons/GridCardActionInitializers.d.ts +16 -0
- package/es/schema-initializer/buttons/ListActionInitializers.d.ts +16 -0
- package/es/schema-settings/SchemaSettings.d.ts +8 -1
- package/lib/index.js +1238 -708
- package/lib/locale/en_US.js +3 -1
- package/lib/locale/ja_JP.js +2 -1
- package/lib/locale/pt_BR.js +2 -1
- package/lib/locale/zh_CN.js +3 -1
- package/package.json +5 -5
- package/contributing.md +0 -61
package/.dumirc.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import { defineConfig } from 'dumi';
|
|
2
|
-
import { defineThemeConfig } from 'dumi-theme-nocobase'
|
|
3
1
|
import { getUmiConfig } from '@nocobase/devtools/umiConfig';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const contributingPath = path.resolve(__dirname, './contributing.md');
|
|
8
|
-
const docsContributingPath = path.resolve(__dirname, './docs/contributing.md');
|
|
9
|
-
|
|
10
|
-
// check if the target path already exists, and remove it if it does
|
|
11
|
-
if (fs.existsSync(docsContributingPath)) {
|
|
12
|
-
fs.unlinkSync(docsContributingPath);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
fs.copyFileSync(contributingPath, docsContributingPath);
|
|
2
|
+
import { defineConfig } from 'dumi';
|
|
3
|
+
import { defineThemeConfig } from 'dumi-theme-nocobase';
|
|
16
4
|
|
|
17
5
|
const umiConfig = getUmiConfig();
|
|
18
6
|
|
|
@@ -23,34 +11,106 @@ export default defineConfig({
|
|
|
23
11
|
},
|
|
24
12
|
resolve: {
|
|
25
13
|
atomDirs: [
|
|
26
|
-
{ type: '
|
|
27
|
-
{ type: '
|
|
28
|
-
{ type: '
|
|
29
|
-
]
|
|
14
|
+
{ type: 'api', dir: 'src' },
|
|
15
|
+
{ type: 'api', dir: 'src/schema-component/antd' },
|
|
16
|
+
{ type: 'api', dir: 'src/route-switch/antd' },
|
|
17
|
+
],
|
|
30
18
|
},
|
|
31
19
|
themeConfig: defineThemeConfig({
|
|
32
20
|
title: 'NocoBase',
|
|
33
21
|
logo: 'https://www.nocobase.com/images/logo.png',
|
|
34
22
|
github: 'https://github.com/nocobase/nocobase',
|
|
35
23
|
footer: 'nocobase | Copyright © 2022',
|
|
36
|
-
sidebarGroupModePath: ['/components'],
|
|
24
|
+
// sidebarGroupModePath: ['/components'],
|
|
37
25
|
nav: [
|
|
38
26
|
{
|
|
39
|
-
title: '
|
|
40
|
-
link: '/
|
|
27
|
+
title: 'API',
|
|
28
|
+
link: '/apis/application',
|
|
41
29
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
30
|
+
],
|
|
31
|
+
sidebarEnhance: {
|
|
32
|
+
'/apis': [
|
|
33
|
+
{
|
|
34
|
+
title: 'Core',
|
|
35
|
+
type: 'group',
|
|
36
|
+
children: [
|
|
37
|
+
{
|
|
38
|
+
title: 'Application',
|
|
39
|
+
children: [
|
|
40
|
+
{
|
|
41
|
+
title: 'Application',
|
|
42
|
+
link: '/apis/application',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: 'APIClient',
|
|
46
|
+
link: '/apis/api-client',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: 'PluginSettingsManager',
|
|
50
|
+
link: '#',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: 'UI schema designer',
|
|
56
|
+
children: [
|
|
57
|
+
{
|
|
58
|
+
title: 'SchemaComponent',
|
|
59
|
+
link: '#',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: 'SchemaInitializer',
|
|
63
|
+
link: '#',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: 'SchemaSettings',
|
|
67
|
+
link: '#',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
title: 'DNDContext & DragHandler',
|
|
71
|
+
link: '#',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
title: 'Collection Manager',
|
|
77
|
+
link: '#',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: 'BlockProvider',
|
|
81
|
+
link: '#',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
title: 'RecordProvider',
|
|
85
|
+
link: '#',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'React components',
|
|
91
|
+
type: 'group',
|
|
92
|
+
children: [
|
|
93
|
+
{
|
|
94
|
+
title: 'Board',
|
|
95
|
+
link: '#',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
title: 'Icon',
|
|
99
|
+
link: '#',
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: 'Schema components',
|
|
105
|
+
type: 'group',
|
|
106
|
+
children: [
|
|
107
|
+
{
|
|
108
|
+
title: 'Input',
|
|
109
|
+
link: '#',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
}),
|
|
56
116
|
});
|
package/docs/index.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<Navigate replace to="/apis/application"></Navigate>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { APIClientOptions } from '@nocobase/sdk';
|
|
2
2
|
import { i18n as i18next } from 'i18next';
|
|
3
3
|
import React, { ComponentType, ReactElement } from 'react';
|
|
4
|
-
import { APIClient } from '../api-client';
|
|
5
|
-
import type { Plugin } from './Plugin';
|
|
6
4
|
import { PluginManager, PluginType } from './PluginManager';
|
|
7
5
|
import { ComponentTypeAndString, RouterManager, RouterOptions } from './RouterManager';
|
|
8
6
|
import { WebSocketClient, WebSocketClientOptions } from './WebSocketClient';
|
|
7
|
+
import { PluginSettingsManager } from './PluginSettingsManager';
|
|
8
|
+
import { APIClient } from '../api-client';
|
|
9
9
|
import type { RequireJS } from './utils/requirejs';
|
|
10
|
+
import type { Plugin } from './Plugin';
|
|
10
11
|
declare global {
|
|
11
12
|
interface Window {
|
|
12
13
|
define: RequireJS['define'];
|
|
@@ -26,6 +27,7 @@ export interface ApplicationOptions {
|
|
|
26
27
|
scopes?: Record<string, any>;
|
|
27
28
|
router?: RouterOptions;
|
|
28
29
|
devDynamicImport?: DevDynamicImport;
|
|
30
|
+
loadRemotePlugins?: boolean;
|
|
29
31
|
}
|
|
30
32
|
export declare class Application {
|
|
31
33
|
protected options: ApplicationOptions;
|
|
@@ -37,6 +39,7 @@ export declare class Application {
|
|
|
37
39
|
apiClient: APIClient;
|
|
38
40
|
components: Record<string, ComponentType>;
|
|
39
41
|
pm: PluginManager;
|
|
42
|
+
pluginSettingsManager: PluginSettingsManager;
|
|
40
43
|
devDynamicImport: DevDynamicImport;
|
|
41
44
|
requirejs: RequireJS;
|
|
42
45
|
notification: any;
|
|
@@ -44,10 +47,12 @@ export declare class Application {
|
|
|
44
47
|
maintained: boolean;
|
|
45
48
|
maintaining: boolean;
|
|
46
49
|
error: any;
|
|
50
|
+
get pluginManager(): PluginManager;
|
|
47
51
|
constructor(options?: ApplicationOptions);
|
|
48
52
|
private initRequireJs;
|
|
49
53
|
private addDefaultProviders;
|
|
50
54
|
private addReactRouterComponents;
|
|
55
|
+
private addRoutes;
|
|
51
56
|
getComposeProviders(): React.FC;
|
|
52
57
|
use<T = any>(component: ComponentType, props?: T): number;
|
|
53
58
|
addProvider<T = any>(component: ComponentType, props?: T): number;
|
|
@@ -14,11 +14,12 @@ export type PluginData = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare class PluginManager {
|
|
16
16
|
protected _plugins: PluginType[];
|
|
17
|
+
protected loadRemotePlugins: boolean;
|
|
17
18
|
protected app: Application;
|
|
18
19
|
protected pluginInstances: Map<typeof Plugin, Plugin>;
|
|
19
20
|
protected pluginsAliases: Record<string, Plugin>;
|
|
20
21
|
private initPlugins;
|
|
21
|
-
constructor(_plugins: PluginType[], app: Application);
|
|
22
|
+
constructor(_plugins: PluginType[], loadRemotePlugins: boolean, app: Application);
|
|
22
23
|
init(_plugins: PluginType[]): Promise<void>;
|
|
23
24
|
private initStaticPlugins;
|
|
24
25
|
private initRemotePlugins;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Application } from './Application';
|
|
2
|
+
import type { RouteType } from './RouterManager';
|
|
3
|
+
export declare const ADMIN_SETTINGS_KEY = "admin.settings.";
|
|
4
|
+
export declare const ADMIN_SETTINGS_PATH = "/admin/settings/";
|
|
5
|
+
export declare const SNIPPET_PREFIX = "pm.";
|
|
6
|
+
export interface PluginSettingsManagerSettingOptionsType {
|
|
7
|
+
title: string;
|
|
8
|
+
Component: RouteType['Component'];
|
|
9
|
+
icon?: string;
|
|
10
|
+
/**
|
|
11
|
+
* sort, the smaller the number, the higher the priority
|
|
12
|
+
* @default 0
|
|
13
|
+
*/
|
|
14
|
+
sort?: number;
|
|
15
|
+
isBookmark?: boolean;
|
|
16
|
+
aclSnippet?: string;
|
|
17
|
+
[index: string]: any;
|
|
18
|
+
}
|
|
19
|
+
export interface PluginSettingsPageType {
|
|
20
|
+
label?: string;
|
|
21
|
+
title: string;
|
|
22
|
+
key: string;
|
|
23
|
+
icon: any;
|
|
24
|
+
path: string;
|
|
25
|
+
sort?: number;
|
|
26
|
+
name?: string;
|
|
27
|
+
pluginName?: string;
|
|
28
|
+
isBookmark?: boolean;
|
|
29
|
+
children?: PluginSettingsPageType[];
|
|
30
|
+
[index: string]: any;
|
|
31
|
+
}
|
|
32
|
+
export declare class PluginSettingsManager {
|
|
33
|
+
protected app: Application;
|
|
34
|
+
protected settings: Record<string, PluginSettingsManagerSettingOptionsType>;
|
|
35
|
+
protected aclSnippets: string[];
|
|
36
|
+
constructor(app: Application);
|
|
37
|
+
setAclSnippets(aclSnippets: string[]): void;
|
|
38
|
+
getAclSnippet(name: string): string;
|
|
39
|
+
getRouteName(name: string): string;
|
|
40
|
+
getRoutePath(name: string): string;
|
|
41
|
+
add(name: string, options: PluginSettingsManagerSettingOptionsType): void;
|
|
42
|
+
remove(name: string): void;
|
|
43
|
+
hasAuth(name: string): boolean;
|
|
44
|
+
getSetting(name: string): PluginSettingsManagerSettingOptionsType;
|
|
45
|
+
has(name: string): boolean;
|
|
46
|
+
get(name: string, filterAuth?: boolean): PluginSettingsPageType;
|
|
47
|
+
getList(filterAuth?: boolean): PluginSettingsPageType[];
|
|
48
|
+
getAclSnippets(): string[];
|
|
49
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const DeleteCollection: (props: any) => React.JSX.Element;
|
|
3
|
+
export declare const useDestroyActionAndRefreshCM: () => {
|
|
4
|
+
run(): Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
export declare const useBulkDestroyActionAndRefreshCM: () => {
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export declare const useDestroyAction: () => {
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export declare const useBulkDestroyAction: () => {
|
|
13
|
+
run(): Promise<boolean>;
|
|
14
|
+
};
|
|
15
|
+
export declare const DeleteCollectionAction: {
|
|
16
|
+
(props: any): React.JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
@@ -43,6 +43,9 @@ export declare const useSelfAndChildrenCollections: (collectionName: string) =>
|
|
|
43
43
|
label: any;
|
|
44
44
|
}[];
|
|
45
45
|
export declare const useCollectionFilterOptions: (collection: any) => any[];
|
|
46
|
+
export declare const useCollectionFilterOptionsV2: (collection: any) => {
|
|
47
|
+
getFields: () => any[];
|
|
48
|
+
};
|
|
46
49
|
export declare const useLinkageCollectionFilterOptions: (collectionName: string) => any[];
|
|
47
50
|
export declare const useCollectionFieldsOptions: (collectionName: string, maxDepth?: number, excludes?: any[]) => any[];
|
|
48
51
|
export declare const useFilterDataSource: (options: any) => {
|