@nocobase/client-v2 2.2.0-alpha.1 → 2.2.0-alpha.11

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 (334) hide show
  1. package/es/APIClient.d.ts +1 -3
  2. package/es/BaseApplication.d.ts +3 -0
  3. package/es/PluginSettingsManager.d.ts +33 -0
  4. package/es/RouteRepository.d.ts +29 -6
  5. package/es/RouterManager.d.ts +15 -0
  6. package/es/authRedirect.d.ts +1 -0
  7. package/es/collection-field-interface/CollectionFieldInterface.d.ts +1 -0
  8. package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +1 -0
  9. package/es/components/category-tabs/SortableCategoryTabs.d.ts +55 -0
  10. package/es/components/category-tabs/index.d.ts +9 -0
  11. package/es/components/form/JsonTextArea.d.ts +2 -1
  12. package/es/components/form/ScanInput/useCodeScanner.d.ts +3 -2
  13. package/es/components/form/TypedVariableInput.d.ts +31 -5
  14. package/es/components/form/VariableJsonTextArea.d.ts +19 -0
  15. package/es/components/form/filter/CollectionFilter.d.ts +2 -0
  16. package/es/components/form/filter/CollectionFilterItem.d.ts +11 -1
  17. package/es/components/form/filter/CollectionFilterPanel.d.ts +2 -0
  18. package/es/components/form/filter/index.d.ts +2 -0
  19. package/es/components/form/filter/useFilterActionProps.d.ts +2 -0
  20. package/es/components/form/index.d.ts +1 -0
  21. package/es/components/index.d.ts +2 -0
  22. package/es/entry-actions/EntryActionManager.d.ts +24 -0
  23. package/es/entry-actions/index.d.ts +9 -0
  24. package/es/flow/actions/afterSuccess.d.ts +8 -1
  25. package/es/flow/actions/index.d.ts +2 -2
  26. package/es/flow/actions/linkageRules.d.ts +2 -0
  27. package/es/flow/admin-shell/BaseLayoutModel.d.ts +6 -0
  28. package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +7 -0
  29. package/es/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.d.ts +2 -0
  30. package/es/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.d.ts +2 -1
  31. package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +3 -0
  32. package/es/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.d.ts +3 -2
  33. package/es/flow/admin-shell/admin-layout/AdminLayoutSlotModels.d.ts +5 -0
  34. package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +2 -1
  35. package/es/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.d.ts +24 -0
  36. package/es/flow/admin-shell/admin-layout/index.d.ts +1 -0
  37. package/es/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.d.ts +6 -0
  38. package/es/flow/admin-shell/admin-layout/useApplications.d.ts +7 -2
  39. package/es/flow/components/FieldAssignExactDatePicker.d.ts +1 -0
  40. package/es/flow/components/FieldAssignRulesEditor.d.ts +3 -1
  41. package/es/flow/components/FieldAssignValueInput.d.ts +9 -0
  42. package/es/flow/components/FlowRoute.d.ts +2 -2
  43. package/es/flow/components/RunJSValueEditor.d.ts +1 -0
  44. package/es/flow/components/filter/FilterGroup.d.ts +1 -0
  45. package/es/flow/components/filter/VariableFilterItem.d.ts +6 -1
  46. package/es/flow/index.d.ts +1 -0
  47. package/es/flow/internal/registerDeviceTypeContext.d.ts +10 -0
  48. package/es/flow/models/base/ActionModelCore.d.ts +2 -0
  49. package/es/flow/models/base/BlockGridModel.d.ts +3 -0
  50. package/es/flow/models/base/GridModel.d.ts +1 -1
  51. package/es/flow/models/base/PageModel/PageModel.d.ts +12 -0
  52. package/es/flow/models/base/PageModel/PageModelTabBar.d.ts +22 -0
  53. package/es/flow/models/base/PageModel/PageTabModel.d.ts +12 -0
  54. package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +5 -0
  55. package/es/flow/models/blocks/form/FormBlockModel.d.ts +4 -0
  56. package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +17 -2
  57. package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
  58. package/es/flow/models/blocks/form/value-runtime/rules.d.ts +21 -0
  59. package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +30 -0
  60. package/es/flow/models/blocks/form/value-runtime/types.d.ts +2 -2
  61. package/es/flow/models/blocks/js-block/JSBlock.d.ts +1 -0
  62. package/es/flow/models/blocks/table/TableActionsColumnModel.d.ts +1 -0
  63. package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -0
  64. package/es/flow/models/blocks/table/TableColumnModel.d.ts +1 -0
  65. package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +1 -1
  66. package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +2 -1
  67. package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +6 -4
  68. package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +2 -0
  69. package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +6 -0
  70. package/es/flow/models/fields/DateTimeFieldModel/dateLimit.d.ts +15 -7
  71. package/es/flow/resolveViewParamsToViewList.d.ts +1 -1
  72. package/es/flow/routeTransientInputArgs.d.ts +14 -0
  73. package/es/flow/utils/dataScopeRowSnapshot.d.ts +59 -0
  74. package/es/flow/utils/dateTimeDisplayProps.d.ts +49 -0
  75. package/es/flow/utils/formValueDeps.d.ts +32 -0
  76. package/es/flow-compat/FieldValidation.d.ts +2 -1
  77. package/es/flow-compat/fieldValidationConstants.d.ts +1 -1
  78. package/es/flow-compat/routeTypes.d.ts +1 -0
  79. package/es/index.d.ts +8 -1
  80. package/es/index.mjs +367 -181
  81. package/es/utils/getRouteRuntimeVersion.d.ts +23 -0
  82. package/es/utils/index.d.ts +1 -0
  83. package/es/utils/markdownSanitize.d.ts +11 -0
  84. package/lib/index.js +367 -181
  85. package/lib/locale/languageCodes.js +3 -1
  86. package/package.json +9 -7
  87. package/src/APIClient.ts +1 -10
  88. package/src/Application.tsx +4 -0
  89. package/src/BaseApplication.tsx +13 -6
  90. package/src/PluginSettingsManager.ts +53 -0
  91. package/src/RouteRepository.ts +151 -24
  92. package/src/RouterManager.tsx +142 -1
  93. package/src/__tests__/PluginSettingsManager.test.ts +13 -0
  94. package/src/__tests__/RouteRepository.test.ts +239 -0
  95. package/src/__tests__/RouterManager.test.ts +125 -0
  96. package/src/__tests__/app.test.tsx +73 -0
  97. package/src/__tests__/authRedirect.test.ts +17 -0
  98. package/src/__tests__/browserChecker.test.ts +61 -0
  99. package/src/__tests__/exports.test.ts +16 -0
  100. package/src/__tests__/getRouteRuntimeVersion.test.ts +68 -0
  101. package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +234 -2
  102. package/src/__tests__/plugin-manager.test.tsx +44 -2
  103. package/src/__tests__/settings-center.test.tsx +40 -1
  104. package/src/authRedirect.ts +38 -0
  105. package/src/collection-field-interface/CollectionFieldInterface.ts +1 -0
  106. package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +1 -0
  107. package/src/collection-manager/field-configure.ts +1 -1
  108. package/src/collection-manager/field-validation.ts +1 -1
  109. package/src/collection-manager/interfaces/id.ts +1 -1
  110. package/src/collection-manager/interfaces/m2m.tsx +2 -2
  111. package/src/collection-manager/interfaces/m2o.tsx +2 -2
  112. package/src/collection-manager/interfaces/nanoid.ts +1 -1
  113. package/src/collection-manager/interfaces/o2m.tsx +2 -2
  114. package/src/collection-manager/interfaces/obo.tsx +2 -2
  115. package/src/collection-manager/interfaces/oho.tsx +2 -2
  116. package/src/collection-manager/interfaces/properties/index.ts +2 -2
  117. package/src/collection-manager/interfaces/uuid.ts +1 -1
  118. package/src/components/AppComponents.tsx +19 -3
  119. package/src/components/README.md +7 -1
  120. package/src/components/README.zh-CN.md +6 -1
  121. package/src/components/category-tabs/SortableCategoryTabs.tsx +210 -0
  122. package/src/components/category-tabs/index.ts +10 -0
  123. package/src/components/form/JsonTextArea.tsx +25 -11
  124. package/src/components/form/ScanInput/CodeScanner.tsx +79 -35
  125. package/src/components/form/ScanInput/__tests__/CodeScanner.test.tsx +101 -0
  126. package/src/components/form/ScanInput/__tests__/useCodeScanner.test.tsx +284 -11
  127. package/src/components/form/ScanInput/useCodeScanner.ts +332 -24
  128. package/src/components/form/TypedVariableInput.tsx +452 -101
  129. package/src/components/form/VariableJsonTextArea.tsx +175 -0
  130. package/src/components/form/__tests__/JsonTextArea.test.tsx +43 -0
  131. package/src/components/form/__tests__/TypedVariableInput.test.tsx +364 -12
  132. package/src/components/form/__tests__/VariableJsonTextArea.test.tsx +86 -0
  133. package/src/components/form/filter/CollectionFilter.tsx +4 -0
  134. package/src/components/form/filter/CollectionFilterItem.tsx +32 -7
  135. package/src/components/form/filter/CollectionFilterPanel.tsx +4 -0
  136. package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +38 -0
  137. package/src/components/form/filter/__tests__/useFilterActionProps.test.tsx +95 -0
  138. package/src/components/form/filter/index.ts +2 -0
  139. package/src/components/form/filter/useFilterActionProps.ts +37 -6
  140. package/src/components/form/index.tsx +1 -0
  141. package/src/components/index.ts +2 -0
  142. package/src/entry-actions/EntryActionManager.ts +76 -0
  143. package/src/entry-actions/index.ts +10 -0
  144. package/src/flow/FlowPage.tsx +38 -3
  145. package/src/flow/__tests__/FlowPage.test.tsx +201 -27
  146. package/src/flow/__tests__/FlowRoute.test.tsx +1181 -80
  147. package/src/flow/__tests__/PluginFlowEngine.test.ts +58 -0
  148. package/src/flow/__tests__/getKey.test.ts +7 -0
  149. package/src/flow/__tests__/resolveViewParamsToViewList.test.ts +34 -0
  150. package/src/flow/actions/__tests__/actionLinkageRules.forkProps.test.ts +115 -0
  151. package/src/flow/actions/__tests__/afterSuccess.test.ts +73 -0
  152. package/src/flow/actions/__tests__/dataScopeFilter.test.ts +120 -0
  153. package/src/flow/actions/__tests__/dataScopeFormValueClear.test.ts +1124 -0
  154. package/src/flow/actions/__tests__/fieldLinkageRules.scopeDepth.test.ts +150 -1
  155. package/src/flow/actions/__tests__/linkageAssignField.legacy.test.ts +135 -0
  156. package/src/flow/actions/__tests__/linkageRules.hiddenSync.restore.test.ts +19 -5
  157. package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +92 -0
  158. package/src/flow/actions/__tests__/linkageRules.tab.test.ts +171 -0
  159. package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +7 -3
  160. package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +164 -0
  161. package/src/flow/actions/__tests__/subFormFieldLinkageRules.inputArgs.test.ts +2 -2
  162. package/src/flow/actions/afterSuccess.tsx +142 -3
  163. package/src/flow/actions/customVariable.tsx +1 -2
  164. package/src/flow/actions/dataScopeFilter.ts +20 -1
  165. package/src/flow/actions/dateTimeFormat.tsx +42 -28
  166. package/src/flow/actions/index.ts +3 -1
  167. package/src/flow/actions/linkageRules.tsx +209 -47
  168. package/src/flow/actions/linkageRulesFormValueRefresh.ts +22 -130
  169. package/src/flow/actions/linkageRulesRefresh.tsx +2 -6
  170. package/src/flow/actions/openView.tsx +59 -5
  171. package/src/flow/actions/runjs.tsx +2 -14
  172. package/src/flow/actions/validation.tsx +62 -30
  173. package/src/flow/admin-shell/BaseLayoutModel.tsx +149 -3
  174. package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +187 -42
  175. package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +1020 -110
  176. package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +74 -14
  177. package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +486 -0
  178. package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +64 -8
  179. package/src/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.ts +5 -3
  180. package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +61 -9
  181. package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +71 -8
  182. package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +1 -1
  183. package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +23 -9
  184. package/src/flow/admin-shell/admin-layout/AppListRender.tsx +13 -2
  185. package/src/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.tsx +289 -0
  186. package/src/flow/admin-shell/admin-layout/HelpLite.tsx +1 -3
  187. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutComponent.test.tsx +435 -0
  188. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +99 -0
  189. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +518 -2
  190. package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +214 -2
  191. package/src/flow/admin-shell/admin-layout/index.ts +1 -0
  192. package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +20 -0
  193. package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +33 -5
  194. package/src/flow/admin-shell/admin-layout/useApplications.tsx +81 -12
  195. package/src/flow/common/Markdown/Display.tsx +14 -3
  196. package/src/flow/common/Markdown/Edit.tsx +19 -7
  197. package/src/flow/common/Markdown/style.ts +4 -0
  198. package/src/flow/components/BlockItemCard.tsx +2 -2
  199. package/src/flow/components/DefaultValue.tsx +1 -2
  200. package/src/flow/components/DynamicFlowsIcon.tsx +447 -126
  201. package/src/flow/components/FieldAssignExactDatePicker.tsx +25 -11
  202. package/src/flow/components/FieldAssignRulesEditor.tsx +128 -21
  203. package/src/flow/components/FieldAssignValueInput.tsx +91 -20
  204. package/src/flow/components/FlowRoute.tsx +256 -53
  205. package/src/flow/components/RunJSValueEditor.tsx +9 -1
  206. package/src/flow/components/__tests__/DynamicFlowsIcon.test.tsx +148 -2
  207. package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +508 -4
  208. package/src/flow/components/__tests__/FieldAssignValueInput.context.test.tsx +216 -0
  209. package/src/flow/components/__tests__/fieldAssignOptions.test.ts +151 -3
  210. package/src/flow/components/code-editor/__tests__/useCodeRunner.test.tsx +2 -17
  211. package/src/flow/components/code-editor/hooks/useCodeRunner.ts +2 -14
  212. package/src/flow/components/code-editor/runjsDiagnostics.ts +8 -45
  213. package/src/flow/components/fieldAssignOptions.ts +155 -27
  214. package/src/flow/components/filter/FilterGroup.tsx +33 -5
  215. package/src/flow/components/filter/VariableFilterItem.tsx +158 -10
  216. package/src/flow/components/filter/__tests__/FilterGroup.test.tsx +45 -0
  217. package/src/flow/components/filter/__tests__/VariableFilterItem.leftMetaTree.test.tsx +9 -0
  218. package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +70 -1
  219. package/src/flow/flows/editMarkdownFlow.tsx +1 -1
  220. package/src/flow/getViewDiffAndUpdateHidden.tsx +1 -0
  221. package/src/flow/index.ts +4 -1
  222. package/src/flow/internal/components/Markdown/util.ts +2 -1
  223. package/src/flow/internal/registerDeviceTypeContext.ts +39 -0
  224. package/src/flow/internal/utils/operatorSchemaHelper.ts +15 -1
  225. package/src/flow/models/actions/JSActionModel.tsx +2 -7
  226. package/src/flow/models/actions/JSCollectionActionModel.tsx +2 -7
  227. package/src/flow/models/actions/JSItemActionModel.tsx +2 -7
  228. package/src/flow/models/actions/JSRecordActionModel.tsx +2 -7
  229. package/src/flow/models/base/ActionModel.tsx +21 -8
  230. package/src/flow/models/base/ActionModelCore.tsx +11 -4
  231. package/src/flow/models/base/BlockGridModel.tsx +26 -0
  232. package/src/flow/models/base/CollectionBlockModel.tsx +6 -2
  233. package/src/flow/models/base/GridModel.tsx +38 -7
  234. package/src/flow/models/base/PageModel/PageModel.tsx +387 -50
  235. package/src/flow/models/base/PageModel/PageModelTabBar.tsx +114 -0
  236. package/src/flow/models/base/PageModel/PageTabModel.tsx +249 -18
  237. package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +817 -13
  238. package/src/flow/models/base/PageModel/__tests__/PageModelTabBar.module-isolation.test.tsx +130 -0
  239. package/src/flow/models/base/PageModel/__tests__/PageModelTabBar.test.tsx +118 -0
  240. package/src/flow/models/base/PageModel/__tests__/PageTabModel.test.ts +1075 -7
  241. package/src/flow/models/base/__tests__/ActionModel.test.ts +83 -0
  242. package/src/flow/models/base/__tests__/ActionModelCore.render.test.tsx +37 -0
  243. package/src/flow/models/base/__tests__/BlockGridModel.selectSceneActivation.test.ts +124 -0
  244. package/src/flow/models/base/__tests__/CollectionBlockModel.addAppends.test.ts +41 -0
  245. package/src/flow/models/base/__tests__/GridModel.dragSnapshotContainer.test.ts +239 -1
  246. package/src/flow/models/base/__tests__/transformRowsToSingleColumn.test.ts +48 -0
  247. package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +59 -6
  248. package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +27 -12
  249. package/src/flow/models/blocks/filter-form/FilterFormJSActionModel.tsx +2 -7
  250. package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +36 -0
  251. package/src/flow/models/blocks/filter-form/__tests__/defaultValues.wiring.test.ts +143 -4
  252. package/src/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.tsx +1 -1
  253. package/src/flow/models/blocks/filter-manager/flow-actions/__tests__/customizeFilterRender.test.tsx +56 -1
  254. package/src/flow/models/blocks/form/EditFormModel.tsx +1 -0
  255. package/src/flow/models/blocks/form/FormActionModel.tsx +1 -1
  256. package/src/flow/models/blocks/form/FormBlockModel.tsx +7 -0
  257. package/src/flow/models/blocks/form/JSFormActionModel.tsx +2 -7
  258. package/src/flow/models/blocks/form/QuickEditFormModel.tsx +189 -36
  259. package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +17 -0
  260. package/src/flow/models/blocks/form/__tests__/QuickEditFormModel.quickEdit.test.ts +350 -2
  261. package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +54 -1
  262. package/src/flow/models/blocks/form/submitHandler.ts +17 -3
  263. package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +940 -75
  264. package/src/flow/models/blocks/form/value-runtime/rules.ts +445 -13
  265. package/src/flow/models/blocks/form/value-runtime/runtime.ts +348 -13
  266. package/src/flow/models/blocks/form/value-runtime/types.ts +2 -2
  267. package/src/flow/models/blocks/js-block/JSBlock.tsx +225 -9
  268. package/src/flow/models/blocks/js-block/__tests__/JSBlockModel.test.tsx +150 -0
  269. package/src/flow/models/blocks/table/JSColumnModel.tsx +1 -9
  270. package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +38 -14
  271. package/src/flow/models/blocks/table/TableBlockModel.tsx +42 -19
  272. package/src/flow/models/blocks/table/TableColumnModel.tsx +72 -6
  273. package/src/flow/models/blocks/table/__tests__/TableActionsColumnModel.test.tsx +111 -1
  274. package/src/flow/models/blocks/table/__tests__/TableBlockModel.dragSort.test.ts +127 -0
  275. package/src/flow/models/blocks/table/__tests__/TableBlockModel.mobileSettingsButtons.test.tsx +78 -0
  276. package/src/flow/models/blocks/table/__tests__/TableBlockModel.quickEditRefresh.test.ts +12 -0
  277. package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +1 -0
  278. package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +243 -1
  279. package/src/flow/models/blocks/table/dragSort/dragSortHooks.tsx +28 -17
  280. package/src/flow/models/blocks/table/dragSort/dragSortSettings.ts +13 -6
  281. package/src/flow/models/blocks/table/dragSort/dragSortUtils.ts +15 -2
  282. package/src/flow/models/fields/AssociationFieldModel/AssociationFieldModel.tsx +1 -1
  283. package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.tsx +31 -7
  284. package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +61 -17
  285. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +141 -19
  286. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +13 -1
  287. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/__tests__/SubTableColumnModel.rowRecord.test.ts +197 -0
  288. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/__tests__/SubTableFieldModel.reset.test.ts +180 -0
  289. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +6 -4
  290. package/src/flow/models/fields/AssociationFieldModel/__tests__/AssociationFieldModel.updateAssociation.test.ts +72 -0
  291. package/src/flow/models/fields/AssociationFieldModel/__tests__/RecordPickerFieldModel.itemContext.test.ts +23 -0
  292. package/src/flow/models/fields/ClickableFieldModel.tsx +5 -0
  293. package/src/flow/models/fields/DateTimeFieldModel/__tests__/DateTimeNoTzFieldModel.dateLimit.test.tsx +149 -0
  294. package/src/flow/models/fields/DateTimeFieldModel/dateLimit.ts +149 -113
  295. package/src/flow/models/fields/DisplayDateTimeFieldModel.tsx +29 -1
  296. package/src/flow/models/fields/InputFieldModel.tsx +40 -2
  297. package/src/flow/models/fields/JSEditableFieldModel.tsx +2 -11
  298. package/src/flow/models/fields/JSFieldModel.tsx +2 -7
  299. package/src/flow/models/fields/JSItemModel.tsx +2 -14
  300. package/src/flow/models/fields/SelectFieldModel.tsx +6 -4
  301. package/src/flow/models/fields/TextareaFieldModel.tsx +72 -3
  302. package/src/flow/models/fields/VariableFieldFormModel.tsx +3 -3
  303. package/src/flow/models/fields/__tests__/DisplayDateTimeFieldModel.test.tsx +96 -0
  304. package/src/flow/models/fields/__tests__/InputFieldModel.test.tsx +117 -1
  305. package/src/flow/models/fields/__tests__/SelectFieldModel.test.tsx +43 -0
  306. package/src/flow/models/fields/__tests__/TextareaFieldModel.test.tsx +131 -0
  307. package/src/flow/models/fields/__tests__/VariableFieldFormModel.test.tsx +51 -0
  308. package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +20 -10
  309. package/src/flow/models/fields/mobile-components/MobileSelect.tsx +24 -12
  310. package/src/flow/models/topbar/TopbarActionModel.tsx +168 -10
  311. package/src/flow/resolveViewParamsToViewList.tsx +11 -3
  312. package/src/flow/routeTransientInputArgs.ts +27 -0
  313. package/src/flow/utils/__tests__/dateTimeFormat.test.ts +300 -0
  314. package/src/flow/utils/dataScopeFormValueClear.ts +219 -81
  315. package/src/flow/utils/dataScopeRowSnapshot.ts +616 -0
  316. package/src/flow/utils/dateTimeDisplayProps.ts +135 -0
  317. package/src/flow/utils/formValueDeps.ts +170 -0
  318. package/src/flow-compat/FieldValidation.tsx +122 -60
  319. package/src/flow-compat/Popover.tsx +43 -4
  320. package/src/flow-compat/__tests__/Popover.test.tsx +34 -0
  321. package/src/flow-compat/fieldValidationConstants.ts +1 -1
  322. package/src/flow-compat/routeTypes.ts +1 -0
  323. package/src/index.ts +14 -1
  324. package/src/layout-manager/__tests__/LayoutRoute.test.tsx +41 -1
  325. package/src/locale/languageCodes.ts +3 -1
  326. package/src/nocobase-buildin-plugin/index.tsx +63 -15
  327. package/src/settings-center/AdminSettingsLayout.tsx +10 -2
  328. package/src/settings-center/SystemSettingsPage.tsx +1 -2
  329. package/src/settings-center/plugin-manager/PluginCard.tsx +2 -2
  330. package/src/settings-center/plugin-manager/index.tsx +3 -0
  331. package/src/settings-center/utils.tsx +0 -6
  332. package/src/utils/getRouteRuntimeVersion.ts +185 -0
  333. package/src/utils/index.tsx +1 -0
  334. package/src/utils/markdownSanitize.ts +88 -0
package/es/APIClient.d.ts CHANGED
@@ -6,10 +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 { APIClient as APIClientSDK, type APIClientOptions } from '@nocobase/sdk';
9
+ import { APIClient as APIClientSDK } from '@nocobase/sdk';
10
10
  export declare class APIClient extends APIClientSDK {
11
- appName?: string;
12
- constructor(options?: APIClientOptions);
13
11
  getHostname(): string;
14
12
  getHeaders(): {};
15
13
  interceptors(): void;
@@ -12,6 +12,7 @@ import type { i18n as i18next } from 'i18next';
12
12
  import React, { ReactElement, ReactNode } from 'react';
13
13
  import type { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
14
14
  import { AIManager } from './ai';
15
+ import { EntryActionManager } from './entry-actions';
15
16
  import { SystemSettingsSource } from './flow/system-settings';
16
17
  import { LayoutManager } from './layout-manager/LayoutManager';
17
18
  import type { PluginClass, PluginManager, PluginType } from './PluginManager';
@@ -75,6 +76,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
75
76
  pluginManager: TPluginManager;
76
77
  pluginSettingsManager: TPluginSettingsManager;
77
78
  layoutManager: LayoutManager<this>;
79
+ entryActionManager: EntryActionManager;
78
80
  aiManager: AIManager;
79
81
  devDynamicImport?: DevDynamicImport;
80
82
  requirejs: RequireJS;
@@ -141,6 +143,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
141
143
  setMaintaining(maintaining: boolean): void;
142
144
  getOptions(): TOptions;
143
145
  getName(): string;
146
+ getCdnUrl(): string;
144
147
  getPublicPath(): string;
145
148
  getApiUrl(pathname?: string): string;
146
149
  getRouteUrl(pathname: string): string;
@@ -86,6 +86,7 @@ interface InternalPageItemRecord extends PluginSettingsPageItemOptions {
86
86
  export declare class PluginSettingsManager<TApp extends BaseApplication<any> = BaseApplication<any>> {
87
87
  protected menus: Record<string, InternalMenuItemRecord>;
88
88
  protected pages: Record<string, InternalPageItemRecord>;
89
+ protected pluginSettingsLinks: Record<string, string>;
89
90
  protected aclSnippets: string[];
90
91
  app: TApp;
91
92
  private cachedList;
@@ -165,6 +166,38 @@ export declare class PluginSettingsManager<TApp extends BaseApplication<any> = B
165
166
  * @returns {boolean} 是否已注册
166
167
  */
167
168
  has(name: string): boolean;
169
+ /**
170
+ * 绑定插件管理列表中的 plugin name 到实际 settings 入口。
171
+ *
172
+ * 插件管理列表使用 applicationPlugins.name 判断是否显示 Settings 入口,
173
+ * 但部分插件会把设置页挂到共享菜单或历史路径下。
174
+ *
175
+ * @param pluginName 插件管理列表中的插件名
176
+ * @param settingsName menu 或 page 名称
177
+ * @returns {void}
178
+ */
179
+ setPluginSettingsLink(pluginName: string, settingsName: string): void;
180
+ /**
181
+ * 获取插件管理列表中的 plugin name 对应的 settings 名称。
182
+ *
183
+ * @param pluginName 插件管理列表中的插件名
184
+ * @returns {string} settings 名称
185
+ */
186
+ getPluginSettingsName(pluginName: string): string;
187
+ /**
188
+ * 判断插件管理列表中的插件是否有可跳转的 settings 入口。
189
+ *
190
+ * @param pluginName 插件管理列表中的插件名
191
+ * @returns {boolean} 是否已注册 settings 入口
192
+ */
193
+ hasPluginSettings(pluginName: string): boolean;
194
+ /**
195
+ * 获取插件管理列表中的插件对应的 settings 路径。
196
+ *
197
+ * @param pluginName 插件管理列表中的插件名
198
+ * @returns {string} settings 绝对路径
199
+ */
200
+ getPluginSettingsRoutePath(pluginName: string): string;
168
201
  /**
169
202
  * 获取单个 menu 或 page 的只读快照。
170
203
  *
@@ -11,6 +11,9 @@ import type { NocoBaseDesktopRoute } from './flow-compat';
11
11
  type RouteSubscriber = () => void;
12
12
  type RouteCreateValues = Partial<NocoBaseDesktopRoute>;
13
13
  type RouteUpdateValues = Partial<NocoBaseDesktopRoute>;
14
+ type RouteLayoutLike = {
15
+ uid?: unknown;
16
+ };
14
17
  type RouteMutationOptions = {
15
18
  refreshAfterMutation?: boolean;
16
19
  };
@@ -28,18 +31,22 @@ export declare class RouteRepository {
28
31
  api?: APIClient;
29
32
  };
30
33
  routes: NocoBaseDesktopRoute[];
31
- protected subscribers: Set<RouteSubscriber>;
32
- protected accessibleLoaded: boolean;
33
- protected accessibleLoadingPromise: Promise<NocoBaseDesktopRoute[]> | null;
34
+ protected subscribers: Map<RouteSubscriber, string>;
35
+ protected accessibleLoadingPromises: Map<string, Promise<NocoBaseDesktopRoute[]>>;
36
+ private layoutActivations;
37
+ private routeCaches;
38
+ private refreshRequestIds;
39
+ private notifiedLayoutUid;
34
40
  constructor(ctx: {
35
41
  api?: APIClient;
36
42
  });
43
+ activateLayout(layout?: RouteLayoutLike): () => void;
37
44
  /**
38
45
  * 同步当前可访问桌面路由,并通知订阅方刷新。
39
46
  *
40
47
  * @param routes 最新的桌面路由树
41
48
  */
42
- setRoutes(routes: NocoBaseDesktopRoute[]): void;
49
+ setRoutes(routes: NocoBaseDesktopRoute[], layoutUid?: string): void;
43
50
  /**
44
51
  * 读取当前缓存的桌面路由树。
45
52
  *
@@ -58,12 +65,13 @@ export declare class RouteRepository {
58
65
  * @returns 最新的路由数组
59
66
  */
60
67
  refreshAccessible(): Promise<any>;
68
+ private refreshAccessibleByLayout;
61
69
  /**
62
70
  * 确保当前用户可访问的桌面路由至少完成一次初始化加载。
63
71
  *
64
72
  * @returns 当前可访问的路由数组
65
73
  */
66
- ensureAccessibleLoaded(): Promise<NocoBaseDesktopRoute[]>;
74
+ ensureAccessibleLoaded(): Promise<any>;
67
75
  /**
68
76
  * 订阅路由缓存变化,用于驱动 React 上下文刷新。
69
77
  *
@@ -116,9 +124,24 @@ export declare class RouteRepository {
116
124
  * @returns 匹配到的路由节点
117
125
  */
118
126
  getRouteBySchemaUid(schemaUid: string): NocoBaseDesktopRoute | undefined;
127
+ /**
128
+ * 通过路由 id 反查对应路由节点。
129
+ *
130
+ * @param routeId 桌面路由主键
131
+ * @returns 匹配到的路由节点
132
+ */
133
+ getRouteById(routeId: string | number): NocoBaseDesktopRoute | undefined;
119
134
  protected getAPIClient(): APIClient;
120
135
  protected getResource(collectionName: string): import("@nocobase/sdk").IResource;
121
- protected emitChange(): void;
136
+ protected emitChange(layoutUid?: string): void;
137
+ private getCurrentLayoutUid;
138
+ private normalizeLayoutUid;
139
+ private getReadableLayoutUid;
140
+ private getRouteCache;
141
+ private syncRoutesProperty;
142
+ private nextRefreshRequestId;
143
+ private getRefreshRequestId;
122
144
  private findRoute;
145
+ private findRouteById;
123
146
  }
124
147
  export {};
@@ -40,9 +40,18 @@ export type RenderComponentType = (Component: ComponentTypeAndString, props?: an
40
40
  export type RouterComponentType = React.FC<{
41
41
  BaseLayout?: ComponentType;
42
42
  }>;
43
+ type AdminRouteNavigationTarget = {
44
+ currentPathname?: string;
45
+ targetPathname: unknown;
46
+ basePath?: string;
47
+ adminRoutePath?: string;
48
+ replace?: boolean;
49
+ };
50
+ export declare function shouldOpenAdminRouteInNewWindow(options: AdminRouteNavigationTarget): boolean;
43
51
  export declare class RouterManager<TApp extends BaseApplication<any> = BaseApplication<any>> {
44
52
  protected routes: Record<string, RouteType>;
45
53
  protected options: RouterOptions;
54
+ private routerNavigate?;
46
55
  app: TApp;
47
56
  router: Router;
48
57
  get basename(): string;
@@ -52,6 +61,11 @@ export declare class RouterManager<TApp extends BaseApplication<any> = BaseAppli
52
61
  (to: import("react-router").To, opts?: import("@remix-run/router").RouterNavigateOptions): Promise<void>;
53
62
  };
54
63
  constructor(options: RouterOptions, app: TApp);
64
+ private navigateWithPortalPolicy;
65
+ private shouldOpenAdminRouteInNewWindow;
66
+ private getRuntimeBasePath;
67
+ private getAdminRoutePath;
68
+ private getAdminRouteNavigationHref;
55
69
  protected resolveLoadedComponent(moduleOrComponent: ComponentLoaderResult): ComponentTypeAndString | undefined;
56
70
  protected createRouteLazyComponent(componentLoader: ComponentLoader): ComponentType;
57
71
  /**
@@ -73,3 +87,4 @@ export declare class RouterManager<TApp extends BaseApplication<any> = BaseAppli
73
87
  has(name: string): boolean;
74
88
  remove(name: string): void;
75
89
  }
90
+ export {};
@@ -31,6 +31,7 @@ export declare function getModernClientPrefix(): string;
31
31
  export declare function stripModernClientPrefix(publicPath?: string): string;
32
32
  export declare function getV2EffectiveBasePath(app: AppLike): string;
33
33
  declare function getDefaultV2AdminRedirectPath(app: AppLike): string;
34
+ export declare function normalizeV2RedirectPath(app: AppLike, target?: string | null, fallbackPath?: string): string;
34
35
  /**
35
36
  * 将当前 v2 页面地址转换为根相对 redirect 路径。
36
37
  *
@@ -98,6 +98,7 @@ export declare abstract class CollectionFieldInterface {
98
98
  titleUsable?: boolean;
99
99
  usePathOptions?(field: any): any;
100
100
  hidden?: boolean;
101
+ creatable?: boolean;
101
102
  addComponentOption(componentOption: CollectionFieldInterfaceComponentOption): void;
102
103
  getConfigureFormProperties(collectionInfo?: any): Record<string, ISchema>;
103
104
  getDefaultValueProperty(): {
@@ -15,6 +15,7 @@ interface FieldInterfaceLike {
15
15
  title?: ReactNode;
16
16
  group?: string;
17
17
  order?: number;
18
+ creatable?: boolean;
18
19
  isAssociation?: boolean;
19
20
  supportDataSourceType?: string[];
20
21
  notSupportDataSourceType?: string[];
@@ -0,0 +1,55 @@
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
+ /**
11
+ * A category descriptor for {@link SortableCategoryTabs}. The component is
12
+ * i18n-agnostic: `label` is rendered verbatim, so consumers pass an
13
+ * already-compiled/translated node. `color` is an antd preset color name or a
14
+ * hex string; `'default'` / `undefined` renders no badge color.
15
+ */
16
+ export type SortableCategoryTabItem = {
17
+ id: string | number;
18
+ label: React.ReactNode;
19
+ color?: string;
20
+ };
21
+ export type SortableCategoryTabsProps = {
22
+ activeKey: string;
23
+ onChange: (key: string) => void;
24
+ /** Draggable category tabs (the fixed leading tab is configured via `allTab`). */
25
+ categories: SortableCategoryTabItem[];
26
+ /** The fixed, non-draggable leading tab, e.g. "All". */
27
+ allTab: {
28
+ key: string;
29
+ label: React.ReactNode;
30
+ };
31
+ /** Show the "+" add button and handle its click. */
32
+ onAdd?: () => void;
33
+ /** Per-category edit menu item handler; menu is hidden when omitted. */
34
+ onEdit?: (id: string | number) => void;
35
+ /** Per-category delete menu item handler; menu is hidden when omitted. */
36
+ onDelete?: (id: string | number) => void;
37
+ /** Reorder handler. Receives the dragged and dropped category ids. */
38
+ onSort?: (sourceId: string | number, targetId: string | number) => void | Promise<void>;
39
+ /** Consumer-translated labels for the per-category dropdown menu. */
40
+ menuLabels?: {
41
+ edit?: string;
42
+ delete?: string;
43
+ };
44
+ className?: string;
45
+ };
46
+ /**
47
+ * A draggable, editable category tab bar. Renders only the tab bar (no content
48
+ * panes) — the page renders its content below and reacts to `activeKey`.
49
+ *
50
+ * Shared by settings pages that group records under reorderable categories
51
+ * (data-source collections, workflows, …). Drag-to-reorder is powered by
52
+ * `@dnd-kit`; the "+" / per-tab edit-delete affordances are optional.
53
+ */
54
+ export declare function SortableCategoryTabs(props: SortableCategoryTabsProps): React.JSX.Element;
55
+ export default SortableCategoryTabs;
@@ -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 * from './SortableCategoryTabs';
@@ -7,6 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import type { TextAreaProps } from 'antd/es/input';
10
+ import type { TextAreaRef } from 'antd/es/input/TextArea';
10
11
  import React from 'react';
11
12
  export interface JsonTextAreaProps extends Omit<TextAreaProps, 'value' | 'onChange'> {
12
13
  value?: unknown;
@@ -15,4 +16,4 @@ export interface JsonTextAreaProps extends Omit<TextAreaProps, 'value' | 'onChan
15
16
  json5?: boolean;
16
17
  showError?: boolean;
17
18
  }
18
- export declare const JsonTextArea: React.MemoExoticComponent<(props: JsonTextAreaProps) => React.JSX.Element>;
19
+ export declare const JsonTextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<JsonTextAreaProps & React.RefAttributes<TextAreaRef>>>;
@@ -15,17 +15,18 @@ type UseCodeScannerOptions = {
15
15
  enabled: boolean;
16
16
  elementId: string;
17
17
  formatsToSupport?: CodeFormatsToSupport;
18
- scanBoxSize?: ScannerSize;
19
18
  onScannerSizeChanged?: (size: ScannerSize) => void;
20
19
  onScanSuccess: (text: string) => void;
21
20
  onScanFailure?: () => void;
21
+ onCameraStartFailure?: (error: unknown) => void;
22
22
  };
23
23
  export declare const DEFAULT_CODE_FORMATS: CodeFormatsToSupport;
24
24
  export declare function getCodeScanBoxSize(width: number, height: number): {
25
25
  width: number;
26
26
  height: number;
27
27
  };
28
- export declare function useCodeScanner({ enabled, elementId, formatsToSupport, scanBoxSize, onScannerSizeChanged, onScanSuccess, onScanFailure, }: UseCodeScannerOptions): {
28
+ export declare function scanQrVideoFrame(video: HTMLVideoElement, canvas: HTMLCanvasElement): string;
29
+ export declare function useCodeScanner({ enabled, elementId, formatsToSupport, onScannerSizeChanged, onScanSuccess, onScanFailure, onCameraStartFailure, }: UseCodeScannerOptions): {
29
30
  startScanFile: (file: File) => Promise<void>;
30
31
  };
31
32
  export {};
@@ -10,11 +10,11 @@ import { type MetaTreeNode } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
11
  import { type VariableDelimiters } from './VariableInput';
12
12
  /**
13
- * Constant types this input can edit. Subset of v1 `Variable.Input`
14
- * `useTypedConstant` drops `'object'` (no v2 JSON editor yet) and `'null'`
15
- * (handled by the dedicated `nullable` prop).
13
+ * Constant types this input can edit. Matches v1 `Variable.Input`
14
+ * `useTypedConstant` minus `'null'` (handled by the dedicated `nullable` prop).
15
+ * `'object'` renders an inline JSON editor (textarea).
16
16
  */
17
- export type TypedConstantType = 'string' | 'number' | 'boolean' | 'date';
17
+ export type TypedConstantType = 'string' | 'number' | 'boolean' | 'date' | 'object';
18
18
  /**
19
19
  * One allowed constant type. Either a bare type name (`'number'`) or a
20
20
  * `[type, editorProps]` pair (`['number', { min: 1, max: 65535 }]`) where
@@ -33,25 +33,51 @@ export interface TypedVariableInputProps {
33
33
  * Allowed constant types. The `Constant` switcher entry always exposes a
34
34
  * typed submenu (matching v1 `Variable.Input`) so users can see what type
35
35
  * the constant is, even when only one type is permitted. Default: all four
36
- * supported types.
36
+ * supported types. Passing `[]` switches the component into a variable-only
37
+ * mode: constants/null are hidden, the empty state becomes a readonly
38
+ * placeholder, and clearing a selected variable resets to `null`.
37
39
  */
38
40
  types?: TypedConstantSpec[];
39
41
  /**
40
42
  * Restrict the variable picker to specific top-level meta-tree namespaces
41
43
  * (e.g. `['$env']`). When omitted, every registered top-level property is
42
44
  * exposed — matching `VariableInput`'s default behaviour.
45
+ *
46
+ * Ignored when `metaTree` is supplied (an explicit tree wins).
43
47
  */
44
48
  namespaces?: string[];
45
49
  /** Additional leaves appended to the picker after the namespace-filtered nodes. */
46
50
  extraNodes?: MetaTreeNode[];
51
+ /**
52
+ * Provide the variable tree explicitly instead of reading the global
53
+ * FlowContext meta tree. When set, `namespaces`/`extraNodes` are ignored and
54
+ * this tree is used verbatim — use for context-scoped variable sources that
55
+ * are not part of the global registry (e.g. a workflow node's upstream
56
+ * outputs). Lazy `children` thunks are resolved on demand as the user
57
+ * expands the cascader.
58
+ */
59
+ metaTree?: MetaTreeNode[];
47
60
  /**
48
61
  * When true (default), the switcher exposes a `Null` option that resets the
49
62
  * value to `null`. When false, the value is constrained to one of the
50
63
  * allowed types or a variable reference.
51
64
  */
52
65
  nullable?: boolean;
66
+ /**
67
+ * Opt-in: when the incoming `value` is `undefined`, initialize the editor to
68
+ * the first allowed constant type instead of rendering the null-mode
69
+ * placeholder. `null` still keeps its explicit null semantics; only
70
+ * `undefined` triggers this path.
71
+ */
72
+ defaultToFirstConstantTypeWhenUndefined?: boolean;
53
73
  /** Variable-token delimiters. Default `['{{', '}}']` — see `VariableInput`. */
54
74
  delimiters?: VariableDelimiters;
75
+ /**
76
+ * Hide variable choices from the switcher. In variable-only mode this hides
77
+ * the selector button entirely; in mixed constant/variable mode it keeps the
78
+ * null/constant choices but removes variable entries.
79
+ */
80
+ hideVariable?: boolean;
55
81
  disabled?: boolean;
56
82
  placeholder?: string;
57
83
  style?: React.CSSProperties;
@@ -0,0 +1,19 @@
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 MetaTreeNode } from '@nocobase/flow-engine';
10
+ import React from 'react';
11
+ import { type JsonTextAreaProps } from './JsonTextArea';
12
+ export interface VariableJsonTextAreaProps extends JsonTextAreaProps {
13
+ namespaces?: string[];
14
+ extraNodes?: MetaTreeNode[];
15
+ metaTree?: MetaTreeNode[] | (() => MetaTreeNode[] | Promise<MetaTreeNode[]>);
16
+ formatPathToValue?: (meta: MetaTreeNode) => string | undefined;
17
+ }
18
+ export declare const VariableJsonTextArea: React.MemoExoticComponent<(props: VariableJsonTextAreaProps) => React.JSX.Element>;
19
+ export declare const VariableJSON: React.MemoExoticComponent<(props: VariableJsonTextAreaProps) => React.JSX.Element>;
@@ -15,6 +15,8 @@ export interface CollectionFilterProps {
15
15
  collection: Collection | undefined;
16
16
  /** Previously compiled filter param used to seed the editable filter group. */
17
17
  initialValue?: CompiledFilter;
18
+ /** Default compiled filter used both for initial empty state and Reset. */
19
+ defaultValue?: CompiledFilter;
18
20
  /** Called on Submit or Reset with the compiled NocoBase filter param (`undefined` when cleared). */
19
21
  onChange: (filter: CompiledFilter) => void;
20
22
  /** Translator. Defaults to identity. */
@@ -37,6 +37,16 @@ export interface CollectionFilterItemProps {
37
37
  app?: {
38
38
  getComponent?: (name: string) => React.ComponentType<any> | undefined;
39
39
  };
40
+ /** Optional override for the left field picker placeholder. */
41
+ fieldPlaceholder?: string;
42
+ /** Optional override for the operator picker placeholder. */
43
+ operatorPlaceholder?: string;
44
+ /** Optional override for the value input placeholder. Pass `null` to suppress it. */
45
+ valuePlaceholder?: string | null;
46
+ /** Optional override for the left field picker width. Defaults to v2's original 200px. */
47
+ fieldWidth?: number;
48
+ /** Optional override for the operator picker min-width. Defaults to v2's original 120px. */
49
+ operatorMinWidth?: number;
40
50
  }
41
51
  /**
42
52
  * Filter row bound directly to a `Collection`, with no `FlowModel` dependency. Use this from settings pages or other surfaces that need a filter UI but don't have (and shouldn't synthesise) a block model just to satisfy `FilterItem`. Pair with `FilterContainer` via either an inline wrapper or `createCollectionFilterItem(collection)`.
@@ -47,7 +57,7 @@ export declare const CollectionFilterItem: FC<CollectionFilterItemProps>;
47
57
  /**
48
58
  * 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.
49
59
  */
50
- export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't' | 'app'>): React.FC<{
60
+ export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't' | 'app' | 'fieldPlaceholder' | 'operatorPlaceholder' | 'valuePlaceholder' | 'fieldWidth' | 'operatorMinWidth'>): React.FC<{
51
61
  value: CollectionFilterItemValue;
52
62
  }>;
53
63
  export default CollectionFilterItem;
@@ -18,6 +18,8 @@ export interface CollectionFilterPanelProps {
18
18
  collection: Collection | undefined;
19
19
  /** Previously compiled filter param used to seed the editable filter group. */
20
20
  initialValue?: CompiledFilter;
21
+ /** Default compiled filter used both for initial empty state and Reset. */
22
+ defaultValue?: CompiledFilter;
21
23
  /** Called when the condition group structure changes or `reset()` is invoked. */
22
24
  onChange?: (filter: CompiledFilter) => void;
23
25
  /** Translator. Defaults to identity. */
@@ -9,5 +9,7 @@
9
9
  export { CollectionFilter } from './CollectionFilter';
10
10
  export type { CollectionFilterProps } from './CollectionFilter';
11
11
  export { CollectionFilterPanel } from './CollectionFilterPanel';
12
+ export { CollectionFilterItem } from './CollectionFilterItem';
13
+ export type { CollectionFilterItemValue } from './CollectionFilterItem';
12
14
  export type { CollectionFilterPanelProps, CollectionFilterPanelRef } from './CollectionFilterPanel';
13
15
  export type { CompiledFilter } from './useFilterActionProps';
@@ -46,6 +46,8 @@ export interface UseFilterActionPropsArgs extends UseFilterOptionsArgs {
46
46
  collection: Collection | undefined;
47
47
  /** Previously compiled filter param used to seed the editable filter group. */
48
48
  initialValue?: CompiledFilter;
49
+ /** Default compiled filter used both for initial empty state and Reset. */
50
+ defaultValue?: CompiledFilter;
49
51
  /**
50
52
  * Called when the user submits or resets the filter popover. Receives the compiled filter param (`undefined` when cleared) and which footer button triggered the call. Typical implementation: `(filter, action) => { listRequest.run(filter); if (action === 'submit') closePopover(); }`.
51
53
  */
@@ -18,3 +18,4 @@ export * from './RemoteSelect';
18
18
  export * from './ScanInput';
19
19
  export * from './TypedVariableInput';
20
20
  export * from './VariableInput';
21
+ export * from './VariableJsonTextArea';
@@ -8,9 +8,11 @@
8
8
  */
9
9
  export * from './AppComponents';
10
10
  export * from './BlankComponent';
11
+ export * from './category-tabs';
11
12
  export * from './form/table/dnd';
12
13
  export * from './form';
13
14
  export * from './Icon';
15
+ export * from './KeepAlive';
14
16
  export * from './PoweredBy';
15
17
  export * from './RouterContextCleaner';
16
18
  export * from './SwitchLanguage';
@@ -0,0 +1,24 @@
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 FlowModelContext, type SubModelItem, type SubModelItemsType } from '@nocobase/flow-engine';
10
+ export type EntryActionScope = 'action-panel' | 'app-switcher' | string;
11
+ export type EntryActionProvider = (ctx: FlowModelContext) => SubModelItem[] | Promise<SubModelItem[]>;
12
+ export declare class EntryActionManager {
13
+ private readonly providers;
14
+ revision: number;
15
+ constructor();
16
+ register(name: string, options: {
17
+ scope: EntryActionScope;
18
+ provider: EntryActionProvider;
19
+ sort?: number;
20
+ }): void;
21
+ unregister(name: string): void;
22
+ invalidate(): void;
23
+ getItems(scope: EntryActionScope): SubModelItemsType;
24
+ }
@@ -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 * from './EntryActionManager';
@@ -6,4 +6,11 @@
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 const afterSuccess: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
9
+ import { FlowContext, type FlowRuntimeContext, type MetaTreeNode } from '@nocobase/flow-engine';
10
+ type ResponseRecordPlainStepContext = {
11
+ steps?: FlowRuntimeContext['steps'];
12
+ };
13
+ export declare function getAfterSuccessResponseRecord(ctx: FlowContext | ResponseRecordPlainStepContext): any;
14
+ export declare function getMetaTreeWithResponseRecord(ctx: FlowRuntimeContext): MetaTreeNode[];
15
+ export declare const afterSuccess: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
16
+ 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
- export * from './afterSuccess';
9
+ export { afterSuccess } from './afterSuccess';
10
10
  export * from './confirm';
11
11
  export * from './dataScope';
12
12
  export * from './openView';
@@ -35,7 +35,7 @@ export * from './formAssignRules';
35
35
  export * from './filterFormDefaultValues';
36
36
  export * from './linkageRulesRefresh';
37
37
  export * from './blockHeight';
38
- export { fieldLinkageRules, subFormFieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, menuLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetMenuItemProps, linkageSetFieldProps, subFormLinkageSetFieldProps, linkageAssignField, linkageRunjs, subFormLinkageAssignField, } from './linkageRules';
38
+ export { fieldLinkageRules, subFormFieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, menuLinkageRules, tabLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetMenuItemProps, linkageSetTabProps, linkageSetFieldProps, subFormLinkageSetFieldProps, linkageAssignField, linkageRunjs, subFormLinkageAssignField, } from './linkageRules';
39
39
  export { displayFieldComponent } from './displayFieldComponent';
40
40
  export * from './overflowMode';
41
41
  export * from './numberFormat';
@@ -10,6 +10,7 @@ import { FlowContext, FlowModel } from '@nocobase/flow-engine';
10
10
  export declare const linkageSetBlockProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
11
11
  export declare const linkageSetActionProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
12
12
  export declare const linkageSetMenuItemProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
13
+ export declare const linkageSetTabProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
13
14
  export declare const linkageSetFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
14
15
  export declare const subFormLinkageSetFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
15
16
  export declare const linkageSetDetailsFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
@@ -20,6 +21,7 @@ export declare const linkageRunjs: import("@nocobase/flow-engine").ActionDefinit
20
21
  export declare const blockLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
21
22
  export declare const actionLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
22
23
  export declare const menuLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
24
+ export declare const tabLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
23
25
  export declare const fieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
24
26
  export declare const subFormFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
25
27
  export declare const detailsFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
@@ -41,6 +41,7 @@ export interface LayoutRouteLike {
41
41
  id?: string;
42
42
  name?: string;
43
43
  pathname?: string;
44
+ state?: unknown;
44
45
  params?: Record<string, string | undefined>;
45
46
  layoutRouteName?: string;
46
47
  layoutBasePathname?: string;
@@ -56,6 +57,7 @@ export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = Ba
56
57
  currentLayoutRoute: LayoutRouteMatch | null;
57
58
  protected routeCoordinator?: BaseLayoutRouteCoordinator;
58
59
  private activePageUid;
60
+ private currentRouteState?;
59
61
  private layoutContentElement;
60
62
  private readonly routePageMetaMap;
61
63
  private contextBindingsActive;
@@ -82,6 +84,10 @@ export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = Ba
82
84
  private teardownRuntime;
83
85
  private getCurrentRouteByActivePage;
84
86
  private getCurrentCoordinatorRouteLike;
87
+ private restoreCurrentLayoutRouteFromRouterContext;
88
+ private shouldIgnoreStaleLayoutRouteCleanup;
89
+ private getRouterContextRouteLike;
90
+ private isRouteLikeOwnedByCurrentLayout;
85
91
  }
86
92
  /**
87
93
  * 按固定 UID 获取或创建 Layout host model。