@nocobase/client-v2 2.2.0-alpha.10 → 2.2.0-alpha.12
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/es/acl/ACLProvider.d.ts +10 -0
- package/es/authRedirect.d.ts +5 -0
- package/es/components/AttachmentUpload.d.ts +51 -0
- package/es/components/index.d.ts +1 -0
- package/es/flow/actions/linkageRules.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/NocoBaseLogo.d.ts +10 -0
- package/es/flow/models/base/ActionModelCore.d.ts +4 -2
- package/es/index.d.ts +4 -1
- package/es/index.mjs +123 -112
- package/es/nocobase-buildin-plugin/currentUserAuthStatus.d.ts +11 -0
- package/es/nocobase-buildin-plugin/index.d.ts +9 -0
- package/es/settings-app/SettingsApplication.d.ts +18 -0
- package/es/settings-app/SettingsBrand.d.ts +16 -0
- package/es/settings-app/SettingsBuildInPlugin.d.ts +9 -0
- package/es/settings-app/SettingsDocumentRedirect.d.ts +10 -0
- package/es/settings-app/SettingsGroupNav.d.ts +17 -0
- package/es/settings-app/SettingsPluginSettingsManager.d.ts +14 -0
- package/es/settings-app/SettingsRouterManager.d.ts +15 -0
- package/es/settings-app/SettingsSearch.d.ts +17 -0
- package/es/settings-app/SettingsShell.d.ts +10 -0
- package/es/settings-app/isSettingsApp.d.ts +18 -0
- package/es/settings-app/runtimePaths.d.ts +18 -0
- package/es/settings-app/settingsDocumentPath.d.ts +14 -0
- package/es/settings-app/settingsTheme.d.ts +87 -0
- package/es/settings-app/useSettingsThemeConfig.d.ts +22 -0
- package/es/settings-center/AdminSettingsLayout.d.ts +2 -2
- package/es/settings-center/groups.d.ts +66 -0
- package/es/settings-center/useSettingsGroups.d.ts +36 -0
- package/es/settings-center/useSettingsSearch.d.ts +35 -0
- package/es/settings-center/utils.d.ts +24 -0
- package/es/theme/index.d.ts +1 -0
- package/es/theme/itemActive.d.ts +24 -0
- package/es/theme/type.d.ts +9 -0
- package/lib/index.js +126 -115
- package/package.json +7 -7
- package/src/__tests__/authRedirect.test.ts +137 -0
- package/src/__tests__/browserChecker.test.ts +124 -6
- package/src/__tests__/mockSettingsApplication.ts +29 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +44 -8
- package/src/__tests__/plugin-manager.test.tsx +7 -6
- package/src/__tests__/settings-application.test.ts +164 -0
- package/src/__tests__/settings-auth-routes.test.ts +71 -0
- package/src/__tests__/settings-center.test.tsx +38 -37
- package/src/__tests__/settings-layout-root.test.tsx +260 -0
- package/src/__tests__/settings-runtime-paths.test.ts +99 -0
- package/src/__tests__/settings-shell.test.tsx +200 -0
- package/src/acl/ACLProvider.tsx +21 -0
- package/src/authRedirect.ts +72 -3
- package/src/components/AttachmentUpload.tsx +275 -0
- package/src/components/index.ts +1 -0
- package/src/flow/actions/__tests__/actionLinkageRules.forkProps.test.ts +203 -4
- package/src/flow/actions/linkageRules.tsx +25 -4
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +1 -56
- package/src/flow/admin-shell/admin-layout/NocoBaseLogo.tsx +77 -0
- package/src/flow/admin-shell/admin-layout/TopbarActionsBar.tsx +37 -14
- package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +77 -13
- package/src/flow/models/base/ActionModelCore.tsx +11 -2
- package/src/flow/models/base/__tests__/ActionModelCore.render.test.tsx +49 -0
- package/src/flow/models/fields/JsonFieldModel.tsx +31 -8
- package/src/flow/models/fields/__tests__/JsonFieldModel.test.ts +82 -0
- package/src/flow/models/topbar/TopbarActionModel.tsx +52 -180
- package/src/index.ts +10 -1
- package/src/nocobase-buildin-plugin/currentUserAuthStatus.ts +58 -0
- package/src/nocobase-buildin-plugin/index.tsx +99 -71
- package/src/settings-app/SettingsApplication.ts +31 -0
- package/src/settings-app/SettingsBrand.tsx +108 -0
- package/src/settings-app/SettingsBuildInPlugin.ts +10 -0
- package/src/settings-app/SettingsDocumentRedirect.tsx +26 -0
- package/src/settings-app/SettingsGroupNav.tsx +124 -0
- package/src/settings-app/SettingsPluginSettingsManager.ts +38 -0
- package/src/settings-app/SettingsRouterManager.ts +92 -0
- package/src/settings-app/SettingsSearch.tsx +238 -0
- package/src/settings-app/SettingsShell.tsx +167 -0
- package/src/settings-app/isSettingsApp.ts +21 -0
- package/src/settings-app/runtimePaths.ts +104 -0
- package/src/settings-app/settingsDocumentPath.ts +66 -0
- package/src/settings-app/settingsTheme.ts +301 -0
- package/src/settings-app/useSettingsThemeConfig.ts +100 -0
- package/src/settings-center/AdminSettingsLayout.tsx +122 -141
- package/src/settings-center/SystemSettingsPage.tsx +4 -170
- package/src/settings-center/groups.ts +108 -0
- package/src/settings-center/useSettingsGroups.ts +105 -0
- package/src/settings-center/useSettingsSearch.ts +173 -0
- package/src/settings-center/utils.tsx +50 -1
- package/src/theme/index.tsx +1 -0
- package/src/theme/itemActive.ts +31 -0
- package/src/theme/type.ts +10 -0
package/es/acl/ACLProvider.d.ts
CHANGED
|
@@ -43,6 +43,16 @@ export declare const ACLRolesCheckProvider: FC;
|
|
|
43
43
|
* 返回原始 ACL provider 上下文。
|
|
44
44
|
*/
|
|
45
45
|
export declare const useACLContext: () => ACLContextValue;
|
|
46
|
+
/**
|
|
47
|
+
* 读取当前角色的 snippets,且不要求调用方位于 `ACLRolesCheckProvider` 之内。
|
|
48
|
+
*
|
|
49
|
+
* 设置中心顶栏导航挂在 app 级 provider 上,位置比 `ACLRolesCheckProvider` 更外层,
|
|
50
|
+
* 这种情况下退回到 app context 上的 ACL observable store。
|
|
51
|
+
* 调用方需要用 `observer` 包裹,store 更新后才会重新渲染。
|
|
52
|
+
*
|
|
53
|
+
* @returns {string[]} 当前角色的 snippets
|
|
54
|
+
*/
|
|
55
|
+
export declare const useACLSnippets: () => string[];
|
|
46
56
|
/**
|
|
47
57
|
* 触发当前角色权限重新检查。
|
|
48
58
|
*/
|
package/es/authRedirect.d.ts
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { BaseApplication } from './BaseApplication';
|
|
10
10
|
type AppLike = Pick<BaseApplication<any>, 'getPublicPath'> & {
|
|
11
|
+
name?: string;
|
|
12
|
+
pluginSettingsManager?: {
|
|
13
|
+
getRouteName?: (name: string) => string;
|
|
14
|
+
getRoutePath?: (name: string) => string;
|
|
15
|
+
};
|
|
11
16
|
router?: {
|
|
12
17
|
getBasename?: () => string | undefined;
|
|
13
18
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
import React from 'react';
|
|
10
|
+
export type UploadedAttachment = {
|
|
11
|
+
id?: number;
|
|
12
|
+
title?: string;
|
|
13
|
+
filename?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
};
|
|
16
|
+
export type AttachmentStorageRules = {
|
|
17
|
+
size?: number;
|
|
18
|
+
mimetype?: string | string[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 读取默认附件存储的上传限制。
|
|
22
|
+
*
|
|
23
|
+
* 校验交给存储自身的配置(大小、mimetype),而不是在每个调用点各写一套硬编码规则。
|
|
24
|
+
*
|
|
25
|
+
* @returns {AttachmentStorageRules | null} 存储规则,取不到时为 null
|
|
26
|
+
*/
|
|
27
|
+
export declare function useAttachmentStorageRules(): AttachmentStorageRules;
|
|
28
|
+
export type AttachmentUploadProps = {
|
|
29
|
+
value?: UploadedAttachment | null;
|
|
30
|
+
onChange?: (value: UploadedAttachment | null) => void;
|
|
31
|
+
/** 卡片尺寸;`fit` 对应 CSS object-fit */
|
|
32
|
+
preview?: {
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
fit?: 'contain' | 'cover';
|
|
36
|
+
};
|
|
37
|
+
/** 在存储规则之外再收窄可选文件类型,例如只收图片 */
|
|
38
|
+
accept?: string;
|
|
39
|
+
/** 上传卡片里 `+` 下方的文字 */
|
|
40
|
+
uploadText?: string;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 附件上传控件。
|
|
45
|
+
*
|
|
46
|
+
* 受控组件,值就是 `attachments:create` 返回的附件对象,可直接挂在 `Form.Item` 上。
|
|
47
|
+
* 外观沿用附件字段的原生形态:一张 picture-card,删除在卡片自身的悬浮操作里,不额外摆按钮。
|
|
48
|
+
* 上传前按默认存储的规则校验大小与 mimetype,与业务表单里的附件字段保持同一套限制。
|
|
49
|
+
*/
|
|
50
|
+
export declare const AttachmentUpload: React.FC<AttachmentUploadProps>;
|
|
51
|
+
export default AttachmentUpload;
|
package/es/components/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
export * from './AppComponents';
|
|
10
|
+
export * from './AttachmentUpload';
|
|
10
11
|
export * from './BlankComponent';
|
|
11
12
|
export * from './category-tabs';
|
|
12
13
|
export * from './form/table/dnd';
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { FlowContext, FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
export declare function updateLinkageRules<T>(rules: T[], updater: (nextRules: T[]) => void): T[];
|
|
10
11
|
export declare const linkageSetBlockProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
11
12
|
export declare const linkageSetActionProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
12
13
|
export declare const linkageSetMenuItemProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
import React from 'react';
|
|
10
|
+
export declare const NocoBaseLogo: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<unknown>>;
|
|
@@ -6,7 +6,8 @@
|
|
|
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 {
|
|
9
|
+
import { FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import type { DefaultStructure, FlowModelOptions } from '@nocobase/flow-engine';
|
|
10
11
|
import type { ButtonProps } from 'antd/es/button';
|
|
11
12
|
import React from 'react';
|
|
12
13
|
export declare function ActionWithoutPermission(props: any): React.JSX.Element;
|
|
@@ -41,7 +42,8 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
|
|
|
41
42
|
static _getScene(): any[];
|
|
42
43
|
static _isScene(scene: ActionSceneType): boolean;
|
|
43
44
|
getAclActionName(): any;
|
|
44
|
-
onInit(options:
|
|
45
|
+
onInit(options: FlowModelOptions<T>): void;
|
|
46
|
+
serialize(): Record<string, any>;
|
|
45
47
|
getInputArgs(): Record<string, any>;
|
|
46
48
|
onClick(event: any): void;
|
|
47
49
|
getTitle(): string;
|
package/es/index.d.ts
CHANGED
|
@@ -27,7 +27,8 @@ export * from './PluginSettingsManager';
|
|
|
27
27
|
export * from './layout-manager';
|
|
28
28
|
export * from './hooks';
|
|
29
29
|
export { default as languageCodes } from './locale/languageCodes';
|
|
30
|
-
export
|
|
30
|
+
export { CurrentUserContext, NocoBaseBuildInPlugin, NocoBaseBuildInPluginV2, useCurrentRoles, useCurrentUserContext, } from './nocobase-buildin-plugin';
|
|
31
|
+
export type { CurrentRoleOption, CurrentUserState } from './nocobase-buildin-plugin';
|
|
31
32
|
export { getRouteRuntimeVersion } from './utils/getRouteRuntimeVersion';
|
|
32
33
|
export type { RouteRuntimeVersion } from './utils/getRouteRuntimeVersion';
|
|
33
34
|
export * from './collection-field-interface/CollectionFieldInterface';
|
|
@@ -46,3 +47,5 @@ export { DEFAULT_DATA_SOURCE_KEY, IconPicker, isTitleField, isTitleFieldInterfac
|
|
|
46
47
|
export type { NocoBaseDesktopRoute } from './flow-compat';
|
|
47
48
|
export * from './utils/markdownSanitize';
|
|
48
49
|
export { default as AntdAppProvider } from './theme/AntdAppProvider';
|
|
50
|
+
export { isSettingsApp } from './settings-app/isSettingsApp';
|
|
51
|
+
export { MINIMAL_THEME_UID, useSettingsThemeConfig } from './settings-app/useSettingsThemeConfig';
|