@nocobase/plugin-ui-templates 2.1.0-alpha.45 → 2.1.0-alpha.47

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.
Files changed (40) hide show
  1. package/client-v2.d.ts +2 -0
  2. package/client-v2.js +1 -0
  3. package/dist/client/{schemas/flowModelTemplates.d.ts → 220.346d5c8edaa0cd0c.js} +2 -3
  4. package/dist/client/285.b1fb1c5e753da51b.js +10 -0
  5. package/dist/client/643.047c34d491bb5ac0.js +10 -0
  6. package/dist/client/682.72134d5030608646.js +10 -0
  7. package/dist/client/934.5dd36051e3d71be1.js +10 -0
  8. package/dist/client/945.3cf235750267b089.js +10 -0
  9. package/dist/client/index.js +1 -1
  10. package/dist/client/legacyV2Bridge.d.ts +13 -0
  11. package/dist/client/openViewActionExtensions.d.ts +1 -34
  12. package/dist/client-v2/220.ebe24d52f9f5a0df.js +10 -0
  13. package/dist/client-v2/643.df78038aa6e1b397.js +10 -0
  14. package/dist/client-v2/945.e06ae2942a1afaa4.js +10 -0
  15. package/dist/client-v2/components/FlowModelTemplatesPage.d.ts +65 -0
  16. package/dist/{client → client-v2}/components/TemplateSelectOption.d.ts +1 -1
  17. package/dist/{client/components/FlowModelTemplatesPage.d.ts → client-v2/index.d.ts} +2 -4
  18. package/dist/client-v2/index.js +10 -0
  19. package/dist/{client → client-v2}/locale.d.ts +6 -4
  20. package/dist/{client → client-v2}/menuExtensions.d.ts +1 -1
  21. package/dist/{client → client-v2}/models/ReferenceBlockModel.d.ts +1 -1
  22. package/dist/{client → client-v2}/models/SubModelTemplateImporterModel.d.ts +1 -1
  23. package/dist/client-v2/models/index.d.ts +11 -0
  24. package/dist/client-v2/openViewActionExtensions.d.ts +42 -0
  25. package/dist/client-v2/pages/BlockTemplatesPage.d.ts +9 -0
  26. package/dist/client-v2/pages/PopupTemplatesPage.d.ts +9 -0
  27. package/dist/client-v2/plugin.d.ts +14 -0
  28. package/dist/externalVersion.js +8 -9
  29. package/dist/locale/en-US.json +3 -2
  30. package/dist/locale/zh-CN.json +3 -2
  31. package/package.json +3 -3
  32. package/dist/client/collections/flowModelTemplates.d.ts +0 -67
  33. package/dist/client/hooks/useFlowModelTemplateActions.d.ts +0 -24
  34. /package/dist/{client → client-v2}/constants.d.ts +0 -0
  35. /package/dist/{client → client-v2}/models/ReferenceFormGridModel.d.ts +0 -0
  36. /package/dist/{client → client-v2}/models/referenceShared.d.ts +0 -0
  37. /package/dist/{client → client-v2}/utils/infiniteSelect.d.ts +0 -0
  38. /package/dist/{client → client-v2}/utils/replaceGridLayoutUid.d.ts +0 -0
  39. /package/dist/{client → client-v2}/utils/templateCompatibility.d.ts +0 -0
  40. /package/dist/{client → client-v2}/utils/templateCopy.d.ts +0 -0
@@ -6,4 +6,4 @@
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
- export declare function registerMenuExtensions(): void;
9
+ export declare function registerMenuExtensions(): () => void;
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import React from 'react';
10
10
  import { type FlowModel } from '@nocobase/flow-engine';
11
- import { BlockModel } from '@nocobase/client';
11
+ import { BlockModel } from '@nocobase/client-v2';
12
12
  /**
13
13
  * ReferenceBlockModel(插件版)
14
14
  * - 通过配置 targetUid(实例 model.uid)引用并渲染另一个区块;
@@ -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 { CommonItemModel } from '@nocobase/client';
9
+ import { CommonItemModel } from '@nocobase/client-v2';
10
10
  import { FlowModel, FlowContext } from '@nocobase/flow-engine';
11
11
  type ImporterProps = {
12
12
  expectedRootUse?: string | string[];
@@ -0,0 +1,11 @@
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
+ export * from './ReferenceBlockModel';
10
+ export * from './ReferenceFormGridModel';
11
+ export * from './SubModelTemplateImporterModel';
@@ -0,0 +1,42 @@
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
+ import type { FlowEngine } from '@nocobase/flow-engine';
11
+ export type TemplateRow = {
12
+ uid: string;
13
+ name?: string;
14
+ description?: string;
15
+ targetUid?: string;
16
+ useModel?: string;
17
+ type?: string;
18
+ dataSourceKey?: string;
19
+ collectionName?: string;
20
+ associationName?: string;
21
+ filterByTk?: string;
22
+ sourceId?: string;
23
+ };
24
+ type ExpectedResourceInfo = {
25
+ dataSourceKey?: string;
26
+ collectionName?: string;
27
+ associationName?: string;
28
+ };
29
+ export type PopupTemplateSelectOption = {
30
+ label: React.ReactNode;
31
+ value: string;
32
+ raw?: TemplateRow;
33
+ description?: string;
34
+ disabled?: boolean;
35
+ disabledReason?: string;
36
+ rawName?: string;
37
+ __idx?: number;
38
+ };
39
+ export declare function appendPopupTemplateOptions(prev: PopupTemplateSelectOption[], next: PopupTemplateSelectOption[]): PopupTemplateSelectOption[];
40
+ export declare function buildPopupTemplateListFilter(expected: ExpectedResourceInfo): Record<string, any>;
41
+ export declare function registerOpenViewPopupTemplateAction(flowEngine: FlowEngine): void;
42
+ export {};
@@ -0,0 +1,9 @@
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
+ export { BlockTemplatesPage as default } from '../components/FlowModelTemplatesPage';
@@ -0,0 +1,9 @@
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
+ export { PopupTemplatesPage as default } from '../components/FlowModelTemplatesPage';
@@ -0,0 +1,14 @@
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 type { Application } from '@nocobase/client-v2';
10
+ import { Plugin } from '@nocobase/client-v2';
11
+ export declare class PluginUiTemplatesClientV2 extends Plugin<Record<string, never>, Application> {
12
+ load(): Promise<void>;
13
+ }
14
+ export default PluginUiTemplatesClientV2;
@@ -8,17 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.45",
12
- "@nocobase/flow-engine": "2.1.0-alpha.45",
11
+ "@nocobase/client": "2.1.0-alpha.47",
12
+ "@nocobase/flow-engine": "2.1.0-alpha.47",
13
13
  "react": "18.2.0",
14
14
  "antd": "5.24.2",
15
15
  "@ant-design/icons": "5.6.1",
16
16
  "lodash": "4.18.1",
17
- "@formily/react": "2.3.7",
18
- "@nocobase/server": "2.1.0-alpha.45",
19
- "@nocobase/plugin-flow-engine": "2.1.0-alpha.45",
20
- "@nocobase/utils": "2.1.0-alpha.45",
21
- "@formily/core": "2.3.7",
22
- "@nocobase/database": "2.1.0-alpha.45",
23
- "@nocobase/actions": "2.1.0-alpha.45"
17
+ "@nocobase/client-v2": "2.1.0-alpha.47",
18
+ "@nocobase/server": "2.1.0-alpha.47",
19
+ "@nocobase/plugin-flow-engine": "2.1.0-alpha.47",
20
+ "@nocobase/utils": "2.1.0-alpha.47",
21
+ "@nocobase/database": "2.1.0-alpha.47",
22
+ "@nocobase/actions": "2.1.0-alpha.47"
24
23
  };
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "UI templates": "UI templates",
3
- "Block templates (v2)": "Block templates (v2)",
4
- "Popup templates (v2)": "Popup templates (v2)",
5
3
  "Actions": "Actions",
4
+ "Collection": "Collection",
5
+ "Data source": "Data source",
6
6
  "Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
7
7
  "Block UID": "Block UID",
8
8
  "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
@@ -14,6 +14,7 @@
14
14
  "Edit": "Edit",
15
15
  "Edit template": "Edit template",
16
16
  "Mode": "Mode",
17
+ "Operation failed": "Operation failed",
17
18
  "Other blocks": "Other blocks",
18
19
  "Please configure target block": "Please configure target block",
19
20
  "Reference": "Reference",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "UI templates": "UI 模板",
3
- "Block templates (v2)": "区块模板 (v2)",
4
- "Popup templates (v2)": "弹窗模板 (v2)",
5
3
  "Actions": "操作",
4
+ "Collection": "数据表",
5
+ "Data source": "数据源",
6
6
  "Are you sure you want to delete this item? This action cannot be undone.": "确定要删除此项吗?此操作不可撤销。",
7
7
  "Block UID": "区块 UID",
8
8
  "Block UID is already set and cannot be modified": "当前已经指定区块UID,不允许修改",
@@ -15,6 +15,7 @@
15
15
  "Edit": "编辑",
16
16
  "Edit template": "编辑模板",
17
17
  "Mode": "模式",
18
+ "Operation failed": "操作失败",
18
19
  "Other blocks": "其他区块",
19
20
  "Please configure target block": "请先配置目标区块",
20
21
  "Reference": "引用",
package/package.json CHANGED
@@ -4,17 +4,17 @@
4
4
  "displayName.zh-CN": "UI 模板",
5
5
  "description": "Provides block templates and popup templates for UI reuse.",
6
6
  "description.zh-CN": "提供区块模板和弹窗模板复用的能力。",
7
- "version": "2.1.0-alpha.45",
7
+ "version": "2.1.0-alpha.47",
8
8
  "license": "Apache-2.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "types": "./dist/index.d.ts",
11
11
  "devDependencies": {
12
- "@formily/shared": "2.x",
13
12
  "antd": "5.x",
14
13
  "react": "^18.2.0"
15
14
  },
16
15
  "peerDependencies": {
17
16
  "@nocobase/client": "2.x",
17
+ "@nocobase/client-v2": "2.x",
18
18
  "@nocobase/flow-engine": "2.x",
19
19
  "@nocobase/plugin-flow-engine": "2.x",
20
20
  "@nocobase/server": "2.x",
@@ -33,5 +33,5 @@
33
33
  "block",
34
34
  "popup"
35
35
  ],
36
- "gitHead": "e9e24987e12d0ad10a5db8815b1e1b7b447f1938"
36
+ "gitHead": "66196b57f9043ea0ac6ebdafbc732bfb98af1396"
37
37
  }
@@ -1,67 +0,0 @@
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
- export declare const flowModelTemplatesCollection: {
10
- name: string;
11
- filterTargetKey: string;
12
- fields: ({
13
- type: string;
14
- name: string;
15
- interface: string;
16
- uiSchema: {
17
- type: string;
18
- title: string;
19
- required: boolean;
20
- 'x-component': string;
21
- 'x-component-props'?: undefined;
22
- 'x-disabled'?: undefined;
23
- 'x-hidden'?: undefined;
24
- };
25
- } | {
26
- type: string;
27
- name: string;
28
- interface: string;
29
- uiSchema: {
30
- type: string;
31
- title: string;
32
- 'x-component': string;
33
- 'x-component-props': {
34
- rows: number;
35
- };
36
- required?: undefined;
37
- 'x-disabled'?: undefined;
38
- 'x-hidden'?: undefined;
39
- };
40
- } | {
41
- type: string;
42
- name: string;
43
- interface: string;
44
- uiSchema: {
45
- type: string;
46
- title: string;
47
- 'x-component': string;
48
- 'x-disabled': boolean;
49
- required?: undefined;
50
- 'x-component-props'?: undefined;
51
- 'x-hidden'?: undefined;
52
- };
53
- } | {
54
- type: string;
55
- name: string;
56
- interface: string;
57
- uiSchema: {
58
- type: string;
59
- title: string;
60
- 'x-component': string;
61
- 'x-disabled': boolean;
62
- 'x-hidden': boolean;
63
- required?: undefined;
64
- 'x-component-props'?: undefined;
65
- };
66
- })[];
67
- };
@@ -1,24 +0,0 @@
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 { ActionProps } from '@nocobase/client';
10
- export declare const useFlowModelTemplateSearchProps: () => {
11
- placeholder: string;
12
- value: string;
13
- onChange: (e: any) => void;
14
- onSearch: (value: string) => void;
15
- allowClear: boolean;
16
- style: {
17
- width: number;
18
- };
19
- };
20
- export declare const useFlowModelTemplateEditFormProps: () => {
21
- form: import("@formily/core").Form<any>;
22
- };
23
- export declare const useFlowModelTemplateEditActionProps: () => ActionProps;
24
- export declare const useFlowModelTemplateDeleteActionProps: () => ActionProps;
File without changes