@nocobase/client-v2 2.1.0-beta.37 → 2.1.0-beta.40

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 (253) hide show
  1. package/es/Application.d.ts +7 -0
  2. package/es/BaseApplication.d.ts +3 -0
  3. package/es/RouterManager.d.ts +1 -0
  4. package/es/collection-field-interface/CollectionFieldInterface.d.ts +51 -15
  5. package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +82 -3
  6. package/es/collection-manager/field-configure.d.ts +80 -0
  7. package/es/collection-manager/field-validation.d.ts +43 -0
  8. package/es/collection-manager/filter-operators/index.d.ts +46 -0
  9. package/es/collection-manager/filter-operators/operators.d.ts +30 -0
  10. package/es/collection-manager/interfaces/checkbox.d.ts +1 -41
  11. package/es/collection-manager/interfaces/checkboxGroup.d.ts +12 -44
  12. package/es/collection-manager/interfaces/collection.d.ts +12 -51
  13. package/es/collection-manager/interfaces/color.d.ts +1 -16
  14. package/es/collection-manager/interfaces/createdAt.d.ts +1 -44
  15. package/es/collection-manager/interfaces/createdBy.d.ts +0 -4
  16. package/es/collection-manager/interfaces/dateOnly.d.ts +7 -44
  17. package/es/collection-manager/interfaces/datetime.d.ts +1 -44
  18. package/es/collection-manager/interfaces/datetimeNoTz.d.ts +1 -44
  19. package/es/collection-manager/interfaces/email.d.ts +1 -29
  20. package/es/collection-manager/interfaces/id.d.ts +1 -16
  21. package/es/collection-manager/interfaces/index.d.ts +2 -3
  22. package/es/collection-manager/interfaces/input.d.ts +1 -102
  23. package/es/collection-manager/interfaces/integer.d.ts +1 -95
  24. package/es/collection-manager/interfaces/json.d.ts +16 -7
  25. package/es/collection-manager/interfaces/m2m.d.ts +11 -19
  26. package/es/collection-manager/interfaces/m2o.d.ts +11 -19
  27. package/es/collection-manager/interfaces/markdown.d.ts +1 -63
  28. package/es/collection-manager/interfaces/multipleSelect.d.ts +12 -44
  29. package/es/collection-manager/interfaces/nanoid.d.ts +1 -34
  30. package/es/collection-manager/interfaces/number.d.ts +1 -87
  31. package/es/collection-manager/interfaces/o2m.d.ts +12 -24
  32. package/es/collection-manager/interfaces/obo.d.ts +207 -0
  33. package/es/collection-manager/interfaces/oho.d.ts +207 -0
  34. package/es/collection-manager/interfaces/password.d.ts +1 -56
  35. package/es/collection-manager/interfaces/percent.d.ts +1 -84
  36. package/es/collection-manager/interfaces/phone.d.ts +1 -25
  37. package/es/collection-manager/interfaces/properties/index.d.ts +0 -28
  38. package/es/collection-manager/interfaces/radioGroup.d.ts +1 -29
  39. package/es/collection-manager/interfaces/richText.d.ts +1 -63
  40. package/es/collection-manager/interfaces/select.d.ts +12 -44
  41. package/es/collection-manager/interfaces/snowflake-id.d.ts +1 -34
  42. package/es/collection-manager/interfaces/tableoid.d.ts +1 -10
  43. package/es/collection-manager/interfaces/textarea.d.ts +1 -51
  44. package/es/collection-manager/interfaces/time.d.ts +1 -16
  45. package/es/collection-manager/interfaces/types.d.ts +3 -12
  46. package/es/collection-manager/interfaces/unixTimestamp.d.ts +1 -44
  47. package/es/collection-manager/interfaces/updatedAt.d.ts +1 -44
  48. package/es/collection-manager/interfaces/updatedBy.d.ts +0 -4
  49. package/es/collection-manager/interfaces/url.d.ts +1 -20
  50. package/es/collection-manager/interfaces/uuid.d.ts +1 -34
  51. package/es/collection-manager/template-fields.d.ts +53 -0
  52. package/es/components/KeepAlive.d.ts +22 -0
  53. package/es/components/RouterBridge.d.ts +9 -0
  54. package/es/components/form/VariableInput.d.ts +53 -2
  55. package/es/components/form/filter/CollectionFilter.d.ts +9 -1
  56. package/es/components/form/filter/CollectionFilterItem.d.ts +10 -2
  57. package/es/data-source/ExtendCollectionsProvider.d.ts +28 -2
  58. package/es/flow/FlowPage.d.ts +2 -1
  59. package/es/flow/admin-shell/AdminLayoutRouteCoordinator.d.ts +8 -40
  60. package/es/flow/admin-shell/BaseLayoutModel.d.ts +89 -0
  61. package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +74 -0
  62. package/es/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.d.ts +12 -0
  63. package/es/flow/admin-shell/admin-layout/AdminLayoutModel.d.ts +7 -92
  64. package/es/flow/admin-shell/admin-layout/index.d.ts +2 -0
  65. package/es/flow/admin-shell/useAdminLayoutRoutePage.d.ts +2 -2
  66. package/es/flow/admin-shell/useLayoutRoutePage.d.ts +23 -0
  67. package/es/flow/components/FlowRoute.d.ts +10 -1
  68. package/es/flow/components/filter/useFilterOptions.d.ts +13 -1
  69. package/es/flow/index.d.ts +4 -0
  70. package/es/flow/models/base/PageModel/PageModel.d.ts +3 -1
  71. package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +84 -0
  72. package/es/flow/models/blocks/assign-form/index.d.ts +1 -0
  73. package/es/flow/models/blocks/form/FormActionGroupModel.d.ts +1 -0
  74. package/es/flow/models/blocks/form/FormActionModel.d.ts +9 -2
  75. package/es/flow/models/blocks/table/TableBlockModel.d.ts +10 -0
  76. package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.d.ts +1 -1
  77. package/es/index.d.ts +5 -0
  78. package/es/index.mjs +470 -460
  79. package/es/layout-manager/LayoutContentRoute.d.ts +14 -0
  80. package/es/layout-manager/LayoutManager.d.ts +22 -0
  81. package/es/layout-manager/LayoutRoute.d.ts +14 -0
  82. package/es/layout-manager/index.d.ts +13 -0
  83. package/es/layout-manager/types.d.ts +20 -0
  84. package/es/layout-manager/utils.d.ts +14 -0
  85. package/es/settings-center/index.d.ts +1 -1
  86. package/es/settings-center/plugin-manager/BulkEnableButton.d.ts +15 -0
  87. package/es/settings-center/plugin-manager/PluginCard.d.ts +15 -0
  88. package/es/settings-center/plugin-manager/PluginDetail.d.ts +16 -0
  89. package/es/settings-center/{PluginManagerPage.d.ts → plugin-manager/index.d.ts} +1 -7
  90. package/es/settings-center/plugin-manager/types.d.ts +34 -0
  91. package/lib/index.js +470 -460
  92. package/package.json +8 -7
  93. package/src/Application.tsx +51 -12
  94. package/src/BaseApplication.tsx +6 -0
  95. package/src/PluginSettingsManager.ts +1 -1
  96. package/src/RouterManager.tsx +17 -1
  97. package/src/__tests__/PluginSettingsManager.test.ts +41 -2
  98. package/src/__tests__/app.test.tsx +8 -1
  99. package/src/__tests__/globalDeps.test.ts +1 -0
  100. package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +45 -2
  101. package/src/__tests__/plugin-manager.test.tsx +177 -0
  102. package/src/__tests__/settings-center.test.tsx +24 -2
  103. package/src/collection-field-interface/CollectionFieldInterface.ts +71 -77
  104. package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +201 -4
  105. package/src/collection-manager/field-configure.ts +548 -0
  106. package/src/collection-manager/field-validation.ts +195 -0
  107. package/src/collection-manager/filter-operators/index.ts +176 -0
  108. package/src/collection-manager/{interfaces/properties → filter-operators}/operators.ts +24 -13
  109. package/src/collection-manager/interfaces/checkbox.ts +2 -9
  110. package/src/collection-manager/interfaces/checkboxGroup.ts +2 -10
  111. package/src/collection-manager/interfaces/collection.ts +2 -15
  112. package/src/collection-manager/interfaces/color.ts +2 -2
  113. package/src/collection-manager/interfaces/createdAt.ts +2 -2
  114. package/src/collection-manager/interfaces/createdBy.ts +1 -12
  115. package/src/collection-manager/interfaces/dateOnly.ts +8 -2
  116. package/src/collection-manager/interfaces/datetime.ts +2 -2
  117. package/src/collection-manager/interfaces/datetimeNoTz.ts +2 -2
  118. package/src/collection-manager/interfaces/email.ts +2 -9
  119. package/src/collection-manager/interfaces/id.ts +1 -2
  120. package/src/collection-manager/interfaces/index.ts +2 -3
  121. package/src/collection-manager/interfaces/input.ts +2 -133
  122. package/src/collection-manager/interfaces/integer.ts +2 -71
  123. package/src/collection-manager/interfaces/json.tsx +17 -11
  124. package/src/collection-manager/interfaces/m2m.tsx +0 -21
  125. package/src/collection-manager/interfaces/m2o.tsx +0 -22
  126. package/src/collection-manager/interfaces/markdown.ts +2 -51
  127. package/src/collection-manager/interfaces/multipleSelect.ts +2 -14
  128. package/src/collection-manager/interfaces/nanoid.ts +2 -2
  129. package/src/collection-manager/interfaces/number.ts +2 -85
  130. package/src/collection-manager/interfaces/o2m.tsx +1 -22
  131. package/src/collection-manager/interfaces/obo.tsx +145 -0
  132. package/src/collection-manager/interfaces/oho.tsx +145 -0
  133. package/src/collection-manager/interfaces/password.ts +2 -44
  134. package/src/collection-manager/interfaces/percent.ts +2 -74
  135. package/src/collection-manager/interfaces/phone.ts +2 -2
  136. package/src/collection-manager/interfaces/properties/index.ts +0 -133
  137. package/src/collection-manager/interfaces/radioGroup.ts +2 -2
  138. package/src/collection-manager/interfaces/richText.ts +2 -51
  139. package/src/collection-manager/interfaces/select.ts +2 -14
  140. package/src/collection-manager/interfaces/snowflake-id.ts +2 -2
  141. package/src/collection-manager/interfaces/tableoid.ts +1 -2
  142. package/src/collection-manager/interfaces/textarea.ts +2 -51
  143. package/src/collection-manager/interfaces/time.ts +2 -2
  144. package/src/collection-manager/interfaces/types.ts +4 -12
  145. package/src/collection-manager/interfaces/unixTimestamp.tsx +2 -2
  146. package/src/collection-manager/interfaces/updatedAt.ts +2 -2
  147. package/src/collection-manager/interfaces/updatedBy.ts +1 -12
  148. package/src/collection-manager/interfaces/url.ts +2 -4
  149. package/src/collection-manager/interfaces/uuid.ts +2 -2
  150. package/src/collection-manager/template-fields.ts +109 -0
  151. package/src/components/KeepAlive.tsx +131 -0
  152. package/src/components/README.md +1 -0
  153. package/src/components/README.zh-CN.md +1 -0
  154. package/src/components/RouterBridge.tsx +28 -4
  155. package/src/components/__tests__/KeepAlive.test.tsx +63 -0
  156. package/src/components/__tests__/RouterBridge.test.tsx +27 -0
  157. package/src/components/form/VariableInput.tsx +101 -28
  158. package/src/components/form/__tests__/VariableInput.test.ts +85 -0
  159. package/src/components/form/filter/CollectionFilter.tsx +11 -1
  160. package/src/components/form/filter/CollectionFilterItem.tsx +12 -4
  161. package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +42 -0
  162. package/src/components/form/filter/useFilterActionProps.ts +7 -4
  163. package/src/data-source/ExtendCollectionsProvider.tsx +94 -20
  164. package/src/data-source/__tests__/ExtendCollectionsProvider.test.tsx +264 -0
  165. package/src/flow/FlowPage.tsx +35 -7
  166. package/src/flow/__tests__/FlowPage.test.tsx +79 -0
  167. package/src/flow/__tests__/FlowRoute.test.tsx +529 -2
  168. package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +191 -0
  169. package/src/flow/actions/__tests__/openView.subModelKey.test.tsx +33 -0
  170. package/src/flow/actions/aclCheck.tsx +4 -0
  171. package/src/flow/actions/aclCheckRefresh.tsx +4 -0
  172. package/src/flow/actions/dateTimeFormat.tsx +12 -8
  173. package/src/flow/actions/linkageRules.tsx +122 -0
  174. package/src/flow/actions/openView.tsx +28 -4
  175. package/src/flow/admin-shell/AdminLayoutRouteCoordinator.ts +11 -329
  176. package/src/flow/admin-shell/BaseLayoutModel.tsx +455 -0
  177. package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +502 -0
  178. package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +547 -3
  179. package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +4 -4
  180. package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +160 -0
  181. package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +0 -12
  182. package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +28 -201
  183. package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +11 -2
  184. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +1 -26
  185. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +149 -27
  186. package/src/flow/admin-shell/admin-layout/index.ts +2 -0
  187. package/src/flow/admin-shell/useAdminLayoutRoutePage.ts +10 -26
  188. package/src/flow/admin-shell/useLayoutRoutePage.ts +61 -0
  189. package/src/flow/components/AdminLayout.tsx +4 -154
  190. package/src/flow/components/FlowRoute.tsx +105 -15
  191. package/src/flow/components/filter/useFilterOptions.ts +27 -5
  192. package/src/flow/index.ts +4 -0
  193. package/src/flow/models/actions/UpdateRecordActionModel.tsx +14 -95
  194. package/src/flow/models/actions/UpdateRecordActionUtils.ts +4 -7
  195. package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +26 -1
  196. package/src/flow/models/base/ActionModel.tsx +8 -1
  197. package/src/flow/models/base/PageModel/PageModel.tsx +51 -18
  198. package/src/flow/models/base/PageModel/RootPageModel.tsx +6 -13
  199. package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +102 -1
  200. package/src/flow/models/base/RouteModel.tsx +1 -1
  201. package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +63 -2
  202. package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +206 -0
  203. package/src/flow/models/blocks/assign-form/index.ts +1 -0
  204. package/src/flow/models/blocks/form/FormActionGroupModel.tsx +14 -0
  205. package/src/flow/models/blocks/form/FormActionModel.tsx +30 -3
  206. package/src/flow/models/blocks/form/FormItemModel.tsx +8 -1
  207. package/src/flow/models/blocks/form/__tests__/FormActionGroupModel.test.ts +46 -0
  208. package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +71 -0
  209. package/src/flow/models/blocks/form/submitHandler.ts +8 -1
  210. package/src/flow/models/blocks/form/submitValues.ts +4 -1
  211. package/src/flow/models/blocks/table/TableBlockModel.tsx +118 -16
  212. package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +114 -0
  213. package/src/flow/models/fields/AssociationFieldModel/SubFormFieldModel.tsx +7 -1
  214. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +1 -1
  215. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +6 -5
  216. package/src/flow/models/fields/ClickableFieldModel.tsx +9 -1
  217. package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +8 -2
  218. package/src/flow/models/fields/DisplayEnumFieldModel.tsx +8 -2
  219. package/src/flow/models/fields/DisplayTimeFieldModel.tsx +1 -1
  220. package/src/flow/models/fields/TimeFieldModel.tsx +1 -1
  221. package/src/flow/models/fields/__tests__/TimeFieldModel.test.tsx +61 -0
  222. package/src/flow/models/fields/mobile-components/MobileDatePicker.tsx +19 -3
  223. package/src/flow/models/fields/mobile-components/__tests__/MobileDatePicker.test.tsx +94 -0
  224. package/src/flow/models/topbar/TopbarActionModel.tsx +1 -1
  225. package/src/flow/utils/__tests__/dateTimeFormat.test.ts +91 -0
  226. package/src/index.ts +5 -0
  227. package/src/layout-manager/LayoutContentRoute.tsx +90 -0
  228. package/src/layout-manager/LayoutManager.tsx +185 -0
  229. package/src/layout-manager/LayoutRoute.tsx +138 -0
  230. package/src/layout-manager/__tests__/LayoutManager.test.tsx +335 -0
  231. package/src/layout-manager/__tests__/LayoutRoute.test.tsx +473 -0
  232. package/src/layout-manager/index.ts +14 -0
  233. package/src/layout-manager/types.ts +22 -0
  234. package/src/layout-manager/utils.ts +37 -0
  235. package/src/nocobase-buildin-plugin/index.tsx +56 -48
  236. package/src/settings-center/index.ts +1 -1
  237. package/src/settings-center/plugin-manager/BulkEnableButton.tsx +111 -0
  238. package/src/settings-center/plugin-manager/PluginCard.tsx +270 -0
  239. package/src/settings-center/plugin-manager/PluginDetail.tsx +195 -0
  240. package/src/settings-center/plugin-manager/index.tsx +254 -0
  241. package/src/settings-center/plugin-manager/types.ts +35 -0
  242. package/src/settings-center/utils.tsx +8 -1
  243. package/src/theme/__tests__/globalStyles.test.ts +24 -0
  244. package/src/theme/globalStyles.ts +10 -0
  245. package/src/utils/globalDeps.ts +2 -0
  246. package/es/collection-manager/interfaces/linkTo.d.ts +0 -90
  247. package/es/collection-manager/interfaces/o2o.d.ts +0 -621
  248. package/es/collection-manager/interfaces/properties/operators.d.ts +0 -294
  249. package/es/collection-manager/interfaces/subTable.d.ts +0 -172
  250. package/src/collection-manager/interfaces/linkTo.ts +0 -120
  251. package/src/collection-manager/interfaces/o2o.tsx +0 -561
  252. package/src/collection-manager/interfaces/subTable.ts +0 -218
  253. package/src/settings-center/PluginManagerPage.tsx +0 -162
@@ -69,15 +69,6 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
69
69
  'x-decorator': string;
70
70
  'x-component': string;
71
71
  'x-disabled': string;
72
- 'x-reactions': {
73
- dependencies: string[];
74
- when: string;
75
- fulfill: {
76
- state: {
77
- value: boolean;
78
- };
79
- };
80
- }[];
81
72
  };
82
73
  unique: {
83
74
  type: string;
@@ -85,36 +76,12 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
85
76
  'x-decorator': string;
86
77
  'x-component': string;
87
78
  'x-disabled': string;
88
- 'x-reactions': {
89
- dependencies: string[];
90
- when: string;
91
- fulfill: {
92
- state: {
93
- value: boolean;
94
- };
95
- };
96
- }[];
97
79
  };
98
80
  };
99
81
  };
100
82
  };
101
83
  filterable: {
102
- operators: ({
103
- label: string;
104
- value: string;
105
- selected: boolean;
106
- noValue?: undefined;
107
- } | {
108
- label: string;
109
- value: string;
110
- selected?: undefined;
111
- noValue?: undefined;
112
- } | {
113
- label: string;
114
- value: string;
115
- noValue: boolean;
116
- selected?: undefined;
117
- })[];
84
+ operators: string;
118
85
  };
119
86
  titleUsable: boolean;
120
87
  }
@@ -0,0 +1,53 @@
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 { ReactNode } from 'react';
10
+ export interface CollectionTemplateFieldOption {
11
+ label: ReactNode;
12
+ value: string | number | boolean;
13
+ [key: string]: unknown;
14
+ }
15
+ export interface CollectionTemplateField {
16
+ name: string;
17
+ interface?: string;
18
+ type?: string;
19
+ title?: ReactNode;
20
+ options?: CollectionTemplateFieldOption[];
21
+ component?: string;
22
+ componentProps?: Record<string, unknown>;
23
+ uiSchema?: Record<string, unknown>;
24
+ [key: string]: unknown;
25
+ }
26
+ interface FieldInterfaceConfigureLike {
27
+ default?: {
28
+ uiSchema?: Record<string, unknown>;
29
+ [key: string]: unknown;
30
+ };
31
+ }
32
+ interface FieldInterfaceLike {
33
+ default?: {
34
+ uiSchema?: Record<string, unknown>;
35
+ [key: string]: unknown;
36
+ };
37
+ }
38
+ export interface CollectionTemplateFieldNormalizeManager {
39
+ getFieldInterfaceConfigure?: (name: string, collectionInfo?: Record<string, unknown>) => FieldInterfaceConfigureLike | undefined;
40
+ getFieldInterface?: (name: string) => FieldInterfaceLike | undefined;
41
+ }
42
+ export interface NormalizeCollectionTemplateFieldOptions {
43
+ collectionInfo?: Record<string, unknown>;
44
+ }
45
+ export declare function normalizeCollectionTemplateField(field: CollectionTemplateField, manager?: CollectionTemplateFieldNormalizeManager, options?: NormalizeCollectionTemplateFieldOptions): {
46
+ [key: string]: unknown;
47
+ uiSchema?: Record<string, unknown>;
48
+ } & CollectionTemplateField;
49
+ export declare function normalizeCollectionTemplateFields(fields?: CollectionTemplateField[], manager?: CollectionTemplateFieldNormalizeManager, options?: NormalizeCollectionTemplateFieldOptions): ({
50
+ [key: string]: unknown;
51
+ uiSchema?: Record<string, unknown>;
52
+ } & CollectionTemplateField)[];
53
+ export {};
@@ -0,0 +1,22 @@
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, { FC } from 'react';
10
+ export declare const KeepAliveProvider: FC<{
11
+ active: boolean;
12
+ parentActive: boolean;
13
+ }>;
14
+ export declare const useKeepAlive: () => {
15
+ active: boolean;
16
+ };
17
+ interface KeepAliveProps {
18
+ uid: string;
19
+ children: (uid: string) => React.ReactNode;
20
+ }
21
+ export declare const KeepAlive: FC<KeepAliveProps>;
22
+ export {};
@@ -7,7 +7,16 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { Application } from '../Application';
10
+ type LayoutMatchLike = {
11
+ id: string;
12
+ pathname: string;
13
+ };
14
+ type LayoutDefinitionLike = {
15
+ routeName: string;
16
+ };
17
+ export declare function findDeepestLayoutMatch(layouts?: LayoutDefinitionLike[], matches?: LayoutMatchLike[]): LayoutMatchLike;
10
18
  export declare function useRouterSync(app: Application): void;
11
19
  export declare function RouterBridge({ app }: {
12
20
  app: any;
13
21
  }): any;
22
+ export {};
@@ -8,8 +8,45 @@
8
8
  */
9
9
  import { type MetaTreeNode, type VariableHybridInputConverters } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
- export declare function parseVariablePath(value?: string): string[] | undefined;
12
- export declare function formatVariablePath(meta?: MetaTreeNode): string | undefined;
11
+ /**
12
+ * The flow-engine defaults emit `{{ ctx.$X.Y }}` and only parse the same
13
+ * shape back into a path — but NocoBase server templates (and v1 stored
14
+ * values) use the bare `{{$X.Y}}` form without the `ctx.` prefix. These
15
+ * converters keep the picker's output stable against v1 and let already-
16
+ * stored values round-trip to a labelled pill instead of falling back to a
17
+ * raw `{{…}}` literal.
18
+ */
19
+ /**
20
+ * Variable delimiters: opening + closing tokens. Default `['{{', '}}']`
21
+ * matches NocoBase server template convention (Handlebars HTML-escaped
22
+ * output). Pass `['{{{', '}}}']` to switch to Handlebars' raw/unescaped
23
+ * form — required for fields whose content is rendered as HTML (e.g.
24
+ * in-app message body) so the variable expansion bypasses HTML escaping.
25
+ *
26
+ * Restrict to literal-token pairs, since the regex builder escapes them
27
+ * verbatim.
28
+ */
29
+ export type VariableDelimiters = readonly [string, string];
30
+ /**
31
+ * Factory: returns a `parseValueToPath` bound to the given delimiters.
32
+ * Anchored (`^…$`) — only treats the whole input as a single variable
33
+ * reference, matching the v1 single-line picker behaviour.
34
+ */
35
+ export declare function makeParseVariablePath(delimiters?: VariableDelimiters): (value?: string) => string[] | undefined;
36
+ /**
37
+ * Factory: returns a `formatPathToValue` bound to the given delimiters.
38
+ * No inner spaces — matches the v1 storage shape exactly so round-trips
39
+ * through the API stay byte-stable.
40
+ */
41
+ export declare function makeFormatVariablePath(delimiters?: VariableDelimiters): (meta?: MetaTreeNode) => string | undefined;
42
+ /**
43
+ * Factory: returns a global regex matching every occurrence of the
44
+ * variable token within a longer string. Used by `VariableHybridInput`
45
+ * to render embedded variables as pills.
46
+ */
47
+ export declare function makeVariableRegExp(delimiters?: VariableDelimiters): RegExp;
48
+ export declare const parseVariablePath: (value?: string) => string[] | undefined;
49
+ export declare const formatVariablePath: (meta?: MetaTreeNode) => string | undefined;
13
50
  /**
14
51
  * Resolve the meta tree the variable picker should expose. Filters the global
15
52
  * meta tree by `namespaces` (top-level property names like `'$env'`,
@@ -48,8 +85,22 @@ export interface VariableInputProps {
48
85
  * Override the converters used by the underlying `VariableHybridInput`.
49
86
  * Mostly useful when the caller wants to constrain `formatPathToValue` to a
50
87
  * specific namespace (see `EnvVariableInput` for that pattern).
88
+ *
89
+ * Takes precedence over `delimiters` when both are set on the same field
90
+ * (an explicit converter wins over the delimiter-derived one).
51
91
  */
52
92
  converters?: VariableHybridInputConverters;
93
+ /**
94
+ * Token pair wrapping variable references in the stored string. Defaults
95
+ * to `['{{', '}}']` — the standard NocoBase server-template form,
96
+ * HTML-escaped by Handlebars. Pass `['{{{', '}}}']` for fields rendered
97
+ * as HTML where escaping would corrupt the variable value (e.g. the
98
+ * in-app message body).
99
+ *
100
+ * Ignored when `converters` is also supplied — caller-provided converters
101
+ * win.
102
+ */
103
+ delimiters?: VariableDelimiters;
53
104
  className?: string;
54
105
  style?: React.CSSProperties;
55
106
  }
@@ -19,7 +19,15 @@ export interface CollectionFilterProps {
19
19
  t?: (key: string, options?: Record<string, any>) => string;
20
20
  /** Whitelist of root-level field names to expose. */
21
21
  filterableFieldNames?: string[];
22
- /** Bypass the `filterableFieldNames` whitelist. */
22
+ /**
23
+ * Blacklist of root-level field names to drop. Mirrors v1's `nonfilterable: [...]` on `Filter.Action`. When both `filterableFieldNames` and this prop are supplied, both apply (final = whitelist ∩ ¬blacklist).
24
+ */
25
+ nonfilterableFieldNames?: string[];
26
+ /**
27
+ * Bypass the `filterableFieldNames` whitelist.
28
+ *
29
+ * Legacy escape hatch — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead.
30
+ */
23
31
  noIgnore?: boolean;
24
32
  /** Override the trigger button's label. Defaults to `t('Filter')`, or the v1-style `t('{{count}} filter items', { count })` when conditions are present. */
25
33
  buttonText?: React.ReactNode;
@@ -21,7 +21,15 @@ export interface CollectionFilterItemProps {
21
21
  collection: Collection;
22
22
  /** Whitelist of field names to expose; empty/undefined means all filterable fields. */
23
23
  filterableFieldNames?: string[];
24
- /** Bypass the `filterableFieldNames` whitelist (matches the legacy FilterItem `noIgnore`). */
24
+ /**
25
+ * Blacklist of field names to drop. Mirrors v1's `nonfilterable: [...]` on `Filter.Action`. When both whitelist and blacklist are supplied, both apply (final = whitelist ∩ ¬blacklist).
26
+ */
27
+ nonfilterableFieldNames?: string[];
28
+ /**
29
+ * Bypass the `filterableFieldNames` whitelist (matches the legacy FilterItem `noIgnore`).
30
+ *
31
+ * Legacy escape hatch — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead.
32
+ */
25
33
  noIgnore?: boolean;
26
34
  /** Translator; defaults to identity so callers can omit it. */
27
35
  t?: (key: string) => string;
@@ -35,7 +43,7 @@ export declare const CollectionFilterItem: FC<CollectionFilterItemProps>;
35
43
  /**
36
44
  * Convenience factory returning a `FilterContainer`-compatible `FilterItem` component bound to a specific collection. Avoids creating an inline closure on every parent render, which would otherwise reset any focused inner antd control.
37
45
  */
38
- export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'noIgnore' | 't'>): React.FC<{
46
+ export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't'>): React.FC<{
39
47
  value: CollectionFilterItemValue;
40
48
  }>;
41
49
  export default CollectionFilterItem;
@@ -13,12 +13,38 @@ export interface ExtendCollectionsProviderProps {
13
13
  dataSource?: string;
14
14
  /** Collections to surface for the lifetime of this provider's subtree. */
15
15
  collections: CollectionOptions[];
16
+ /**
17
+ * When `true`, re-sync the data source whenever the `collections` prop
18
+ * reference changes after mount: add entries newly present in the prop and
19
+ * remove entries no longer present (only those this provider registered).
20
+ * The diff runs in the same render as the prop change so children see the
21
+ * new state on their first render — at the cost of one observable mutation
22
+ * per change.
23
+ *
24
+ * Defaults to `false`. Most pages pass a stable (often module-level)
25
+ * `collections` list and don't need this; leaving it off avoids accidental
26
+ * re-registration when callers forget to memoize. Enable only when your
27
+ * collection list legitimately varies during the provider's lifetime.
28
+ */
29
+ syncOnChange?: boolean;
16
30
  children?: ReactNode;
17
31
  }
18
32
  /**
19
- * Mount-scoped collection injector. Adds the given `collections` to the target data source on mount and removes them on unmount. Survives mid-session reloads via `dataSource:loaded` events.
33
+ * Mount-scoped collection injector. Adds the given `collections` to the target
34
+ * data source on first render — synchronously, so children can read
35
+ * `getCollection(name)` on their own first render — and removes them on
36
+ * unmount. Survives mid-session data-source reloads via the
37
+ * `dataSource:loaded` event by re-registering only the names this provider
38
+ * owns.
20
39
  *
21
- * Use this for client-only collections — e.g. a `schema-only` server collection that isn't auto-published to the v2 data source, or a pure UI-side mirror — so downstream components (like `<CollectionFilter>`) can resolve the collection by name.
40
+ * Use this for client-only collections — e.g. a `schema-only` server
41
+ * collection that isn't auto-published to the v2 data source, or a pure
42
+ * UI-side mirror — so downstream components (like `<CollectionFilter>`) can
43
+ * resolve the collection by name.
44
+ *
45
+ * Default behavior is "static-at-mount": subsequent changes to the
46
+ * `collections` prop are ignored. Pass `syncOnChange` to opt into diffing on
47
+ * prop change.
22
48
  */
23
49
  export declare const ExtendCollectionsProvider: FC<ExtendCollectionsProviderProps>;
24
50
  export default ExtendCollectionsProvider;
@@ -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 type { FlowModel } from '@nocobase/flow-engine';
9
+ import type { FlowModel, FlowModelRendererProps } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
11
  import FlowRoute from './components/FlowRoute';
12
12
  type FlowPageProps = {
@@ -14,6 +14,7 @@ type FlowPageProps = {
14
14
  parentId?: string;
15
15
  onModelLoaded?: (uid: string, model: FlowModel) => void;
16
16
  defaultTabTitle?: string;
17
+ showFlowSettings?: FlowModelRendererProps['showFlowSettings'];
17
18
  };
18
19
  export declare const FlowPage: React.MemoExoticComponent<(props: FlowPageProps & Record<string, unknown>) => React.JSX.Element>;
19
20
  export declare const RemoteFlowModelRenderer: (props: any) => React.JSX.Element;
@@ -6,46 +6,14 @@
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 { FlowEngine, FlowModel, type ViewParam } from '@nocobase/flow-engine';
10
- export interface RoutePageMeta {
11
- active: boolean;
12
- refreshDesktopRoutes?: () => Promise<unknown>;
13
- layoutContentElement?: HTMLElement | null;
14
- }
15
- interface RouteLike {
16
- params?: {
17
- name?: string;
18
- };
19
- pathname?: string;
20
- }
9
+ import type { FlowEngine } from '@nocobase/flow-engine';
10
+ import { BaseLayoutRouteCoordinator, type BaseLayoutRouteCoordinatorOptions } from './BaseLayoutRouteCoordinator';
21
11
  /**
22
- * 管理 admin 场景下每个 page 的 v2 视图栈编排。
23
- * 该协调器只负责状态机和开关视图,不直接绑定 React 生命周期。
12
+ * Admin Layout 路由协调器。
13
+ *
14
+ * 该类保留旧导出路径,内部复用通用 BaseLayoutRouteCoordinator。
24
15
  */
25
- export declare class AdminLayoutRouteCoordinator {
26
- private readonly flowEngine;
27
- private readonly runtimes;
28
- private layoutContentElement;
29
- private setRuntimeActive;
30
- private getCurrentRouteByPageUid;
31
- constructor(flowEngine: FlowEngine);
32
- setLayoutContentElement(element: HTMLElement | null): void;
33
- registerPage(pageUid: string, meta: RoutePageMeta): FlowModel<import("@nocobase/flow-engine").DefaultStructure>;
34
- syncPageMeta(pageUid: string, meta: Partial<RoutePageMeta>): void;
35
- unregisterPage(pageUid: string): void;
36
- syncRoute(routeLike: RouteLike): void;
37
- cleanupPage(pageUid: string): void;
38
- destroy(): void;
39
- private syncRuntimeWithPathname;
40
- private shouldStepNavigate;
41
- private stepNavigate;
42
- private handleOpenViews;
43
- private openViews;
44
- private ensureRouteModelContext;
45
- private getOrCreateRouteModel;
16
+ export declare class AdminLayoutRouteCoordinator extends BaseLayoutRouteCoordinator {
17
+ constructor(flowEngine: FlowEngine, options?: BaseLayoutRouteCoordinatorOptions);
46
18
  }
47
- /**
48
- * 将 pathname 解析结果和 pageUid 对齐,便于测试里复用。
49
- */
50
- export declare function toViewStack(pathname: string): ViewParam[];
51
- export {};
19
+ export { toViewStack, type BaseLayoutRouteCoordinatorOptions, type RoutePageMeta } from './BaseLayoutRouteCoordinator';
@@ -0,0 +1,89 @@
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 FlowEngine, FlowModel, type ViewParam } from '@nocobase/flow-engine';
10
+ import { BaseLayoutRouteCoordinator, type BaseLayoutRouteCoordinatorOptions, type RoutePageMeta } from './BaseLayoutRouteCoordinator';
11
+ import type { LayoutDefinition } from '../../layout-manager/types';
12
+ export type BaseLayoutStructure = {
13
+ subModels?: Record<string, FlowModel[]>;
14
+ };
15
+ export type GetLayoutModelOptions<TModel extends FlowModel = BaseLayoutModel> = {
16
+ required?: boolean;
17
+ create?: boolean;
18
+ props?: any;
19
+ use?: new (...args: any[]) => TModel;
20
+ };
21
+ export type LayoutRouteMatch = {
22
+ type: 'root';
23
+ pathname: string;
24
+ basePathname: string;
25
+ relativePath: string;
26
+ } | {
27
+ type: 'page';
28
+ pathname: string;
29
+ basePathname: string;
30
+ relativePath: string;
31
+ pageUid: string;
32
+ tabUid?: string;
33
+ viewStack: ViewParam[];
34
+ } | {
35
+ type: 'notFound';
36
+ pathname: string;
37
+ basePathname: string;
38
+ relativePath: string;
39
+ };
40
+ export interface LayoutRouteLike {
41
+ id?: string;
42
+ name?: string;
43
+ pathname?: string;
44
+ params?: Record<string, string | undefined>;
45
+ layoutRouteName?: string;
46
+ layoutBasePathname?: string;
47
+ }
48
+ /**
49
+ * 通用 Layout 运行时模型。
50
+ *
51
+ * 该模型封装页面路由桥接、弹窗路由、page tab 路由、布局容器和移动端状态,
52
+ * Admin、Embed 等具体 Layout 只需要继承并实现各自的渲染和专属业务能力。
53
+ */
54
+ export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = BaseLayoutStructure> extends FlowModel<TStructure> {
55
+ isMobileLayout: boolean;
56
+ currentLayoutRoute: LayoutRouteMatch | null;
57
+ protected routeCoordinator?: BaseLayoutRouteCoordinator;
58
+ private activePageUid;
59
+ private layoutContentElement;
60
+ private readonly routePageMetaMap;
61
+ private contextBindingsActive;
62
+ constructor(options: any);
63
+ registerRoutePage(pageUid: string, meta: RoutePageMeta): import("..").RouteModel<import("@nocobase/flow-engine").DefaultStructure>;
64
+ updateRoutePage(pageUid: string, meta: Partial<RoutePageMeta>): void;
65
+ unregisterRoutePage(pageUid: string): void;
66
+ setLayoutContentElement(element: HTMLElement | null): void;
67
+ setIsMobileLayout(isMobileLayout: boolean): void;
68
+ getCurrentRouteByPageUid(pageUid: string): any;
69
+ get layout(): LayoutDefinition;
70
+ getCoordinator(): BaseLayoutRouteCoordinator;
71
+ protected createRouteCoordinator(): BaseLayoutRouteCoordinator;
72
+ protected getRouteCoordinatorOptions(): BaseLayoutRouteCoordinatorOptions;
73
+ protected getPageUidFromRoute(route: any): any;
74
+ isLayoutContentRoute(routeLike: LayoutRouteLike): boolean;
75
+ resolveLayoutRoute(routeLike: LayoutRouteLike): LayoutRouteMatch;
76
+ getPageUidFromLayoutRoute(match: LayoutRouteMatch | null | undefined): string;
77
+ syncLayoutRoute(routeLike: LayoutRouteLike): LayoutRouteMatch;
78
+ clearLayoutRoute(routeLike?: LayoutRouteLike): void;
79
+ protected onMount(): void;
80
+ protected onUnmount(): void;
81
+ private setupContextBindings;
82
+ private teardownRuntime;
83
+ private getCurrentRouteByActivePage;
84
+ private getCurrentCoordinatorRouteLike;
85
+ }
86
+ /**
87
+ * 按固定 UID 获取或创建 Layout host model。
88
+ */
89
+ export declare function getLayoutModel<TModel extends FlowModel = BaseLayoutModel>(flowEngine: FlowEngine, uid: string, options?: GetLayoutModelOptions<TModel>): TModel;
@@ -0,0 +1,74 @@
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 { FlowEngine, type FlowContext, type ViewParam } from '@nocobase/flow-engine';
10
+ import { RouteModel } from '../models/base/RouteModel';
11
+ import type { LayoutDefinition } from '../../layout-manager/types';
12
+ export interface RoutePageMeta {
13
+ active: boolean;
14
+ refreshDesktopRoutes?: () => Promise<unknown>;
15
+ layoutContentElement?: HTMLElement | null;
16
+ }
17
+ export interface BaseLayoutRouteCoordinatorOptions {
18
+ layout?: LayoutDefinition;
19
+ layoutContext?: FlowContext;
20
+ basePathname?: string;
21
+ }
22
+ interface RouteLike {
23
+ layoutRouteName?: string;
24
+ params?: {
25
+ name?: string;
26
+ };
27
+ pathname?: string;
28
+ pageUid?: string;
29
+ layoutBasePathname?: string;
30
+ layoutRoute?: {
31
+ type: string;
32
+ pageUid?: string;
33
+ basePathname?: string;
34
+ } | null;
35
+ }
36
+ /**
37
+ * 通用 Layout 路由协调器。
38
+ *
39
+ * 负责把当前路由路径解析为 v2 view stack,并驱动 RouteModel 上的弹窗、抽屉和 page tab 状态。
40
+ * Admin、Embed 等布局只需要提供当前 Layout 的基准路径,即可复用同一套 view 编排逻辑。
41
+ */
42
+ export declare class BaseLayoutRouteCoordinator {
43
+ protected readonly flowEngine: FlowEngine;
44
+ protected readonly layout: LayoutDefinition | undefined;
45
+ private readonly layoutContext?;
46
+ private basePathname;
47
+ private readonly runtimes;
48
+ private layoutContentElement;
49
+ constructor(flowEngine: FlowEngine, options?: BaseLayoutRouteCoordinatorOptions);
50
+ setLayoutContentElement(element: HTMLElement | null): void;
51
+ registerPage(pageUid: string, meta: RoutePageMeta): RouteModel<import("@nocobase/flow-engine").DefaultStructure>;
52
+ syncPageMeta(pageUid: string, meta: Partial<RoutePageMeta>): void;
53
+ unregisterPage(pageUid: string): void;
54
+ syncRoute(routeLike: RouteLike): void;
55
+ cleanupPage(pageUid: string): void;
56
+ destroy(): void;
57
+ protected getCurrentRouteByPageUid(pageUid: string): any;
58
+ private setRuntimeActive;
59
+ private notifyRuntimeActiveChange;
60
+ private syncRuntimeWithPathname;
61
+ private syncViewListVisibility;
62
+ private shouldStepNavigate;
63
+ private scheduleInitialDeepLinkReplay;
64
+ private stepNavigate;
65
+ private handleOpenViews;
66
+ private openViews;
67
+ private ensureRouteModelContext;
68
+ private getOrCreateRouteModel;
69
+ }
70
+ /**
71
+ * 将 pathname 解析结果和 pageUid 对齐,便于测试里复用。
72
+ */
73
+ export declare function toViewStack(pathname: string, options?: BaseLayoutRouteCoordinatorOptions): ViewParam[];
74
+ export {};
@@ -0,0 +1,12 @@
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, { type FC } from 'react';
10
+ export declare const AdminLayoutEntryGuard: FC<{
11
+ children: React.ReactNode;
12
+ }>;