@nocobase/client 2.1.0-alpha.1 → 2.1.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 (192) hide show
  1. package/.dumirc.ts +8 -0
  2. package/LICENSE +201 -661
  3. package/README.md +79 -10
  4. package/es/ai/ai-manager.d.ts +15 -0
  5. package/es/ai/index.d.ts +12 -0
  6. package/es/ai/skills-manager/index.d.ts +9 -0
  7. package/es/ai/skills-manager/types.d.ts +23 -0
  8. package/es/ai/tools-manager/hooks/context.d.ts +17 -0
  9. package/es/ai/tools-manager/hooks/index.d.ts +11 -0
  10. package/es/ai/tools-manager/hooks/provider.d.ts +16 -0
  11. package/es/ai/tools-manager/index.d.ts +20 -0
  12. package/es/ai/tools-manager/types.d.ts +82 -0
  13. package/es/ai/utils.d.ts +10 -0
  14. package/es/api-client/APIClient.d.ts +1 -0
  15. package/es/application/Application.d.ts +7 -1
  16. package/es/application/Plugin.d.ts +1 -0
  17. package/es/application/RouteRepository.d.ts +23 -0
  18. package/es/application/globalOperators.d.ts +11 -0
  19. package/es/block-provider/TableUidContext.d.ts +10 -0
  20. package/es/collection-manager/templates/view.d.ts +11 -11
  21. package/es/data-source/collection/utils.d.ts +2 -4
  22. package/es/flow/FlowModelRepository.d.ts +7 -0
  23. package/es/flow/actions/aclCheckRefresh.d.ts +9 -0
  24. package/es/flow/actions/afterSuccess.d.ts +9 -0
  25. package/es/flow/actions/blockHeight.d.ts +9 -0
  26. package/es/flow/actions/filterFormDefaultValues.d.ts +9 -0
  27. package/es/flow/actions/formAssignRules.d.ts +9 -0
  28. package/es/flow/actions/index.d.ts +7 -0
  29. package/es/flow/actions/linkageRulesRefresh.d.ts +9 -0
  30. package/es/flow/actions/numberFormat.d.ts +9 -0
  31. package/es/flow/components/BlockItemCard.d.ts +1 -0
  32. package/es/flow/components/ConditionBuilder.d.ts +2 -0
  33. package/es/flow/components/DefaultValue.d.ts +1 -0
  34. package/es/flow/components/FieldAssignEditor.d.ts +32 -0
  35. package/es/flow/components/FieldAssignExactDatePicker.d.ts +23 -0
  36. package/es/flow/components/FieldAssignRulesEditor.d.ts +70 -0
  37. package/es/flow/components/FieldAssignValueInput.d.ts +48 -1
  38. package/es/flow/components/RunJSValueEditor.d.ts +19 -0
  39. package/es/flow/components/TextAreaWithContextSelector.d.ts +1 -0
  40. package/es/flow/components/code-editor/core/EditorCore.d.ts +3 -1
  41. package/es/flow/components/code-editor/formatDocInfo.d.ts +17 -0
  42. package/es/flow/components/code-editor/hooks/useCodeRunner.d.ts +3 -1
  43. package/es/flow/components/code-editor/index.d.ts +1 -0
  44. package/es/flow/components/code-editor/linter.d.ts +10 -2
  45. package/es/flow/components/code-editor/runjsCompletionSource.d.ts +20 -0
  46. package/es/flow/components/code-editor/runjsDiagnostics.d.ts +46 -0
  47. package/es/flow/components/fieldAssignOptions.d.ts +23 -0
  48. package/es/flow/components/filter/LinkageFilterItem.d.ts +27 -1
  49. package/es/flow/components/useAssociationTitleFieldSync.d.ts +13 -0
  50. package/es/flow/index.d.ts +2 -0
  51. package/es/flow/internal/utils/modelUtils.d.ts +27 -0
  52. package/es/flow/internal/utils/saveStepParamsWithSubModels.d.ts +11 -0
  53. package/es/flow/internal/utils/titleFieldQuickSync.d.ts +35 -0
  54. package/es/flow/models/actions/AddChildActionModel.d.ts +1 -0
  55. package/es/flow/models/actions/BulkDeleteActionModel.d.ts +1 -0
  56. package/es/flow/models/actions/JSItemActionModel.d.ts +19 -0
  57. package/es/flow/models/actions/LinkActionModel.d.ts +1 -4
  58. package/es/flow/models/actions/LinkActionUtils.d.ts +34 -0
  59. package/es/flow/models/actions/UpdateRecordActionUtils.d.ts +12 -0
  60. package/es/flow/models/actions/index.d.ts +1 -0
  61. package/es/flow/models/actions/joinUrlSearch.d.ts +12 -0
  62. package/es/flow/models/base/ActionGroupModel.d.ts +8 -0
  63. package/es/flow/models/base/AssociationFieldGroupModel.d.ts +1 -1
  64. package/es/flow/models/base/BlockModel.d.ts +29 -1
  65. package/es/flow/models/base/CollectionBlockModel.d.ts +12 -57
  66. package/es/flow/models/base/GridModel.d.ts +7 -0
  67. package/es/flow/models/base/PageModel/ChildPageModel.d.ts +1 -0
  68. package/es/flow/models/base/PageModel/PageModel.d.ts +17 -1
  69. package/es/flow/models/base/PageModel/RootPageModel.d.ts +8 -0
  70. package/es/flow/models/blocks/details/DetailsBlockModel.d.ts +4 -0
  71. package/es/flow/models/blocks/details/DetailsGridModel.d.ts +1 -0
  72. package/es/flow/models/blocks/details/utils.d.ts +16 -0
  73. package/es/flow/models/blocks/filter-form/FieldOperatorSelect.d.ts +10 -0
  74. package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +6 -0
  75. package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +12 -1
  76. package/es/flow/models/blocks/filter-form/FilterFormItemModel.d.ts +5 -37
  77. package/es/flow/models/blocks/filter-form/customFieldOperators.d.ts +34 -0
  78. package/es/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.d.ts +16 -0
  79. package/es/flow/models/blocks/filter-form/fields/FilterFormCustomRecordSelectFieldModel.d.ts +20 -0
  80. package/es/flow/models/blocks/filter-form/fields/FilterFormRecordSelectFieldModel.d.ts +12 -0
  81. package/es/flow/models/blocks/filter-form/fields/index.d.ts +2 -0
  82. package/es/flow/models/blocks/filter-form/index.d.ts +4 -0
  83. package/es/flow/models/blocks/filter-form/legacyDefaultValueMigration.d.ts +13 -0
  84. package/es/flow/models/blocks/filter-form/valueNormalization.d.ts +17 -0
  85. package/es/flow/models/blocks/filter-manager/flow-actions/defaultOperator.d.ts +1 -3
  86. package/es/flow/models/blocks/form/CreateFormModel.d.ts +3 -1
  87. package/es/flow/models/blocks/form/EditFormModel.d.ts +4 -1
  88. package/es/flow/models/blocks/form/FormAssociationFieldGroupModel.d.ts +12 -0
  89. package/es/flow/models/blocks/form/FormAssociationItemModel.d.ts +39 -0
  90. package/es/flow/models/blocks/form/FormBlockModel.d.ts +35 -2
  91. package/es/flow/models/blocks/form/FormGridModel.d.ts +1 -0
  92. package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +4 -1
  93. package/es/flow/models/blocks/form/assignRulesUpdateAssociationValues.d.ts +18 -0
  94. package/es/flow/models/blocks/form/dynamicNamePath.d.ts +19 -0
  95. package/es/flow/models/blocks/form/index.d.ts +2 -0
  96. package/es/flow/models/blocks/form/legacyDefaultValueMigration.d.ts +13 -0
  97. package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
  98. package/es/flow/models/blocks/form/submitValues.d.ts +27 -0
  99. package/es/flow/models/blocks/form/value-runtime/conditions.d.ts +9 -0
  100. package/es/flow/models/blocks/form/value-runtime/deps.d.ts +23 -0
  101. package/es/flow/models/blocks/form/value-runtime/form-patch.d.ts +19 -0
  102. package/es/flow/models/blocks/form/value-runtime/index.d.ts +11 -0
  103. package/es/flow/models/blocks/form/value-runtime/path.d.ts +25 -0
  104. package/es/flow/models/blocks/form/value-runtime/rules.d.ts +131 -0
  105. package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +75 -0
  106. package/es/flow/models/blocks/form/value-runtime/types.d.ts +62 -0
  107. package/es/flow/models/blocks/form/value-runtime/utils.d.ts +12 -0
  108. package/es/flow/models/blocks/shared/legacyDefaultValueMigrationBase.d.ts +20 -0
  109. package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -23
  110. package/es/flow/models/blocks/table/TableSelectModel.d.ts +0 -1
  111. package/es/flow/models/blocks/table/dragSort/dragSortComponents.d.ts +14 -0
  112. package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +13 -0
  113. package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +39 -0
  114. package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +37 -0
  115. package/es/flow/models/blocks/table/dragSort/index.d.ts +12 -0
  116. package/es/flow/models/blocks/table/utils.d.ts +8 -8
  117. package/es/flow/models/fields/AssociationFieldModel/AssociationFieldModel.d.ts +1 -0
  118. package/es/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.d.ts +16 -0
  119. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionGroupModel.d.ts +11 -0
  120. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionsColumnModel.d.ts +19 -0
  121. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.d.ts +30 -0
  122. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.d.ts +28 -0
  123. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableFormSubmitActionModel.d.ts +16 -0
  124. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableRemoveActionModel.d.ts +14 -0
  125. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/blocks/PopupSubTableFormModel.d.ts +36 -0
  126. package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/index.d.ts +17 -0
  127. package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +8 -1
  128. package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +15 -0
  129. package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +4 -1
  130. package/es/flow/models/fields/AssociationFieldModel/index.d.ts +1 -0
  131. package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +94 -0
  132. package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +15 -5
  133. package/es/flow/models/fields/DisplayAssociationField/displaySubListUtils.d.ts +14 -0
  134. package/es/flow/models/fields/DisplayTextFieldModel.d.ts +1 -0
  135. package/es/flow/models/fields/RichTextFieldModel/registerFontSize.d.ts +9 -0
  136. package/es/flow/models/fields/RichTextFieldModel/registerImageResize.d.ts +9 -0
  137. package/es/flow/models/fields/RichTextFieldModel/registerSmartBreak.d.ts +12 -0
  138. package/es/flow/models/fields/index.d.ts +0 -1
  139. package/es/flow/utils/actionCapability.d.ts +60 -0
  140. package/es/flow/utils/dispatchEventDeep.d.ts +20 -0
  141. package/es/flow/utils/index.d.ts +2 -0
  142. package/es/flow/utils/pagination.d.ts +29 -0
  143. package/es/flow/utils/useJsonTemplateResolver.d.ts +9 -0
  144. package/es/index.css +1 -1
  145. package/es/index.d.ts +1 -0
  146. package/es/index.mjs +2069 -95749
  147. package/es/index.mjs.LICENSE.txt +8 -0
  148. package/es/lazy-helper/index.d.ts +8 -6
  149. package/es/pm/AdminSettingsLayoutModel.d.ts +13 -0
  150. package/es/pm/PluginSetting.d.ts +2 -1
  151. package/es/pm/index.d.ts +1 -0
  152. package/es/route-switch/antd/admin-layout/AdminLayoutModel.d.ts +27 -0
  153. package/es/route-switch/antd/admin-layout/AdminLayoutRouteCoordinator.d.ts +50 -0
  154. package/es/route-switch/antd/admin-layout/index.d.ts +5 -1
  155. package/es/route-switch/antd/admin-layout/mobileMenuNavigation.d.ts +15 -0
  156. package/es/schema-component/antd/association-field/Table.d.ts +0 -57
  157. package/es/schema-component/antd/date-picker/DatePicker.d.ts +26 -0
  158. package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.d.ts +26 -0
  159. package/es/schema-component/antd/menu/Menu.d.ts +7 -0
  160. package/es/schema-settings/SchemaSettingsDefaultValue.d.ts +18 -0
  161. package/es/schema-settings/VariableInput/hooks/useParentIterationVariable.d.ts +3 -3
  162. package/es/user/CurrentUserProvider.d.ts +1 -1
  163. package/es/variables/index.d.ts +1 -1
  164. package/lib/index.css +1 -1
  165. package/lib/index.js +1741 -1564
  166. package/lib/index.js.LICENSE.txt +1 -0
  167. package/lib/locale/de-DE.json +5 -0
  168. package/lib/locale/en-US.json +54 -0
  169. package/lib/locale/es-ES.json +5 -0
  170. package/lib/locale/fr-FR.json +5 -0
  171. package/lib/locale/hu-HU.json +5 -0
  172. package/lib/locale/id-ID.json +5 -0
  173. package/lib/locale/it-IT.json +5 -0
  174. package/lib/locale/ja-JP.json +5 -0
  175. package/lib/locale/ko-KR.json +5 -0
  176. package/lib/locale/nl-NL.json +5 -0
  177. package/lib/locale/pt-BR.json +5 -0
  178. package/lib/locale/ru-RU.json +5 -0
  179. package/lib/locale/tr-TR.json +5 -0
  180. package/lib/locale/uk-UA.json +5 -0
  181. package/lib/locale/vi-VN.json +5 -0
  182. package/lib/locale/zh-CN.json +82 -8
  183. package/lib/locale/zh-TW.json +15 -0
  184. package/package.json +9 -8
  185. package/es/flow/models/fields/UploadFieldModel.d.ts +0 -22
  186. package/es/index-C3fHjsMw.mjs +0 -279
  187. package/es/md-BbvRKckr.mjs +0 -61
  188. package/es/md-oH2RssNY.mjs +0 -61
  189. package/lib/index-C3fHjsMw-CDWZlvuM.js +0 -2237
  190. package/lib/md-BbvRKckr-IQIU5F3r.js +0 -1
  191. package/lib/md-oH2RssNY-IQIU5F3r.js +0 -1
  192. package/lib/style.css +0 -1
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export interface FieldAssignEditorProps {
11
+ t: (key: string) => string;
12
+ fieldOptions: Array<{
13
+ label: string;
14
+ value: string;
15
+ }>;
16
+ /** 赋值目标路径(例如 `title` / `user.name`) */
17
+ field?: string;
18
+ onFieldChange: (targetPath?: string) => void;
19
+ value: any;
20
+ onValueChange: (value: any) => void;
21
+ fieldLabel?: React.ReactNode;
22
+ valueLabel?: React.ReactNode;
23
+ showValueEditorWhenNoField?: boolean;
24
+ }
25
+ /**
26
+ * 通用“字段赋值”编辑器:
27
+ * - 选择字段
28
+ * - 编辑赋值(支持变量引用 + 常量)
29
+ *
30
+ * 可在“表单赋值配置”和“联动规则赋值动作”等场景复用。
31
+ */
32
+ export declare const FieldAssignEditor: React.FC<FieldAssignEditorProps>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import { dayjs } from '@nocobase/utils/client';
11
+ export type ExactDatePickerMode = 'year' | 'quarter' | 'month' | 'date';
12
+ export type ExactDatePickerValue = dayjs.Dayjs | [dayjs.Dayjs, dayjs.Dayjs] | null;
13
+ export interface FieldAssignExactDatePickerProps {
14
+ picker?: ExactDatePickerMode;
15
+ format?: string;
16
+ showTime?: boolean;
17
+ timeFormat?: string;
18
+ value?: unknown;
19
+ isRange?: boolean;
20
+ onChange?: (value: ExactDatePickerValue) => void;
21
+ style?: React.CSSProperties;
22
+ }
23
+ export declare const FieldAssignExactDatePicker: React.FC<FieldAssignExactDatePickerProps>;
@@ -0,0 +1,70 @@
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 { FilterGroupType } from '@nocobase/utils/client';
10
+ import React from 'react';
11
+ import { FieldAssignValueInput } from './FieldAssignValueInput';
12
+ import type { FieldAssignCascaderOption } from './fieldAssignOptions';
13
+ export type AssignMode = 'default' | 'assign';
14
+ type CollectionFieldLike = {
15
+ name?: unknown;
16
+ title?: unknown;
17
+ type?: unknown;
18
+ interface?: unknown;
19
+ targetKey?: unknown;
20
+ targetCollectionTitleFieldName?: unknown;
21
+ targetCollection?: any;
22
+ isAssociationField?: () => boolean;
23
+ };
24
+ export type SyncAssociationTitleFieldParams = {
25
+ ruleItem: FieldAssignRuleItem;
26
+ ruleIndex: number;
27
+ targetPath?: string;
28
+ associationField: CollectionFieldLike;
29
+ targetCollection: any;
30
+ titleField: string;
31
+ };
32
+ export interface FieldAssignRuleItem {
33
+ key: string;
34
+ enable?: boolean;
35
+ /** 赋值目标路径,例如 `title` / `users.nickname` / `user.name` */
36
+ targetPath?: string;
37
+ /** 仅当前规则生效的 title field 覆盖(不改 collection 全局配置) */
38
+ valueTitleField?: string;
39
+ mode?: AssignMode;
40
+ condition?: FilterGroupType;
41
+ value?: any;
42
+ }
43
+ export interface FieldAssignRulesEditorProps {
44
+ t: (key: string) => string;
45
+ fieldOptions: FieldAssignCascaderOption[] | any[];
46
+ /** 根集合(用于构建“上级对象/属性”变量树) */
47
+ rootCollection?: any;
48
+ value?: FieldAssignRuleItem[];
49
+ onChange?: (value: FieldAssignRuleItem[]) => void;
50
+ /** 默认 mode(新建条目时使用) */
51
+ defaultMode?: AssignMode;
52
+ /** 固定 mode:用于“仅默认值/仅赋值”的场景 */
53
+ fixedMode?: AssignMode;
54
+ /** 是否显示 condition */
55
+ showCondition?: boolean;
56
+ /** 是否显示 enable 开关 */
57
+ showEnable?: boolean;
58
+ /** 未选字段时也展示 Value 编辑器(用于表单设置里的占位体验) */
59
+ showValueEditorWhenNoField?: boolean;
60
+ /** 为 Value 编辑器补充额外 props(例如按筛选操作符适配输入组件) */
61
+ getValueInputProps?: (item: FieldAssignRuleItem, index: number) => Partial<React.ComponentProps<typeof FieldAssignValueInput>>;
62
+ /** 可选:用于筛选关系集合中可作为 Title field 的候选字段 */
63
+ isTitleFieldCandidate?: (field: any, targetCollection: any) => boolean;
64
+ /** 可选:点击同步按钮后,将选中的 title field 持久化到关系集合 */
65
+ onSyncAssociationTitleField?: (params: SyncAssociationTitleFieldParams) => Promise<void> | void;
66
+ /** 在日期字段下启用“日期变量替换 Constant 位”。 */
67
+ enableDateVariableAsConstant?: boolean;
68
+ }
69
+ export declare const FieldAssignRulesEditor: React.FC<FieldAssignRulesEditorProps>;
70
+ export {};
@@ -7,12 +7,59 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
+ import { dayjs } from '@nocobase/utils/client';
11
+ import { type MetaTreeNode } from '@nocobase/flow-engine';
12
+ import { type ExactDatePickerMode } from './FieldAssignExactDatePicker';
13
+ export type DateVariableExactNormalizeMode = 'none' | 'date' | 'datetimeNoTz' | 'iso';
14
+ export declare function toExactPickerDisplayValue(rawValue: unknown, options: {
15
+ format: string;
16
+ isRange: boolean;
17
+ }): dayjs.Dayjs | [dayjs.Dayjs, dayjs.Dayjs] | null;
18
+ export declare function normalizeDateVariableExactValue(rawValue: any, options: {
19
+ exactNormalizeMode: DateVariableExactNormalizeMode;
20
+ format: string;
21
+ showTime: boolean;
22
+ }): any;
23
+ type DateVariableComponentProps = {
24
+ picker: ExactDatePickerMode;
25
+ showTime: boolean;
26
+ timeFormat: string;
27
+ format: string;
28
+ exactNormalizeMode: DateVariableExactNormalizeMode;
29
+ };
30
+ export declare function normalizeDateVariableOutput(rawValue: any, options: DateVariableComponentProps): any;
10
31
  interface Props {
11
- fieldUid: string;
32
+ /** 赋值目标路径,例如 `title` / `users.nickname` / `user.name` */
33
+ targetPath: string;
12
34
  value: any;
13
35
  onChange: (value: any) => void;
14
36
  placeholder?: string;
37
+ /** 额外变量树(置于 Constant/Null/RunJS 与 base metaTree 之间) */
38
+ extraMetaTree?: MetaTreeNode[];
39
+ /** 可选:当前字段的筛选操作符,用于在默认值/赋值编辑器中按 operator schema 适配输入组件 */
40
+ operator?: string;
41
+ /** 可选:操作符元数据列表(通常来自 collectionField.filterable.operators) */
42
+ operatorMetaList?: Array<any>;
43
+ /** 可选:当字段已存在于表单时,优先复用表单字段的模型(用于筛选表单默认值等场景) */
44
+ preferFormItemFieldModel?: boolean;
45
+ /** 可选:关系字段显示映射覆盖(用于值编辑器内预览 title field) */
46
+ associationFieldNamesOverride?: {
47
+ label?: string;
48
+ value?: string;
49
+ };
50
+ /**
51
+ * 在日期字段场景下,用日期变量编辑器替换 Constant 位。
52
+ * 默认 false,保持历史行为。
53
+ */
54
+ enableDateVariableAsConstant?: boolean;
15
55
  }
56
+ export declare function mergeItemMetaTreeForAssignValue(baseTree: MetaTreeNode[], extraTree: MetaTreeNode[]): MetaTreeNode[];
57
+ export declare function resolveAssignValueFieldPath(itemModel: any): string | undefined;
58
+ export declare function resolveAssignValueFieldModelUse(options: {
59
+ itemModel: any;
60
+ fieldModelUse?: string;
61
+ preferFormItemFieldModel?: boolean;
62
+ }): string | undefined;
16
63
  /**
17
64
  * 根据所选字段渲染对应的赋值编辑器:
18
65
  * - 使用临时的 VariableFieldFormModel 包裹字段模型,确保常量编辑为真实字段组件
@@ -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 React from 'react';
10
+ import { type RunJSValue } from '@nocobase/flow-engine';
11
+ export interface RunJSValueEditorProps {
12
+ t?: (key: string) => string;
13
+ value: unknown;
14
+ onChange?: (value: RunJSValue) => void;
15
+ height?: string;
16
+ scene?: string;
17
+ containerStyle?: React.CSSProperties;
18
+ }
19
+ export declare const RunJSValueEditor: React.FC<RunJSValueEditorProps>;
@@ -20,6 +20,7 @@ export interface TextAreaWithContextSelectorProps {
20
20
  onChange?: (v: string) => void;
21
21
  placeholder?: string;
22
22
  rows?: number;
23
+ maxRows?: number;
23
24
  style?: React.CSSProperties;
24
25
  }
25
26
  /**
@@ -7,7 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- import { type Completion } from '@codemirror/autocomplete';
10
+ import { type Completion, type CompletionSource } from '@codemirror/autocomplete';
11
11
  import { EditorView } from '@codemirror/view';
12
12
  export declare const EditorCore: React.FC<{
13
13
  value?: string;
@@ -18,6 +18,8 @@ export declare const EditorCore: React.FC<{
18
18
  theme?: 'light' | 'dark';
19
19
  readonly?: boolean;
20
20
  enableLinter?: boolean;
21
+ knownCtxMemberRoots?: string[];
21
22
  extraCompletions?: Completion[];
23
+ completionSource?: CompletionSource;
22
24
  viewRef: React.MutableRefObject<EditorView | null>;
23
25
  }>;
@@ -0,0 +1,17 @@
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
+ type DocInfoMode = 'simple' | 'full';
10
+ export declare function formatDocInfo(doc: any, options?: {
11
+ /**
12
+ * - `simple`: description + examples
13
+ * - `full`: description + params/returns/ref/disabled + examples
14
+ */
15
+ mode?: DocInfoMode;
16
+ }): string;
17
+ export {};
@@ -13,9 +13,11 @@ export type RunLog = {
13
13
  line?: number;
14
14
  column?: number;
15
15
  };
16
+ type RunResult = Awaited<ReturnType<JSRunner['run']>>;
16
17
  export declare function useCodeRunner(hostCtx: FlowModelContext, version?: string): {
17
- run: (code: string) => Promise<Awaited<ReturnType<JSRunner['run']>> | undefined>;
18
+ run: (code: string) => Promise<RunResult | undefined>;
18
19
  logs: RunLog[];
19
20
  clearLogs: () => void;
20
21
  running: boolean;
21
22
  };
23
+ export {};
@@ -27,4 +27,5 @@ interface CodeEditorProps {
27
27
  }
28
28
  export * from './types';
29
29
  export * from './extension';
30
+ export * from './runjsDiagnostics';
30
31
  export declare const CodeEditor: React.FC<CodeEditorProps>;
@@ -7,5 +7,13 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { Diagnostic } from '@codemirror/lint';
10
- export declare const computeDiagnosticsFromText: (text: string) => Diagnostic[];
11
- export declare const createJavaScriptLinter: () => import("@codemirror/state").Extension;
10
+ export declare const computeDiagnosticsFromText: (text: string, options?: {
11
+ /**
12
+ * When provided, treat `ctx.<name>` / `ctx.<name>()` where `<name>` is NOT in this list as a lint issue.
13
+ * This enables context-aware unknown ctx API detection in CodeEditor (best-effort).
14
+ */
15
+ knownCtxMemberRoots?: Iterable<string>;
16
+ }) => Diagnostic[];
17
+ export declare const createJavaScriptLinter: (options?: {
18
+ knownCtxMemberRoots?: Iterable<string>;
19
+ }) => import("@codemirror/state").Extension;
@@ -0,0 +1,20 @@
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 { Completion, CompletionSource } from '@codemirror/autocomplete';
10
+ type CreateRunJSCompletionSourceOptions = {
11
+ hostCtx: any;
12
+ staticOptions?: Completion[];
13
+ /**
14
+ * Roots that should use FlowContext meta tree to provide deep completions.
15
+ * When omitted/empty, all `ctx.*` roots are enabled.
16
+ */
17
+ metaRoots?: string[];
18
+ };
19
+ export declare function createRunJSCompletionSource({ hostCtx, staticOptions, metaRoots, }: CreateRunJSCompletionSourceOptions): CompletionSource;
20
+ export {};
@@ -0,0 +1,46 @@
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 { FlowContext } from '@nocobase/flow-engine';
10
+ export type RunJSIssue = {
11
+ type: 'lint' | 'runtime';
12
+ message: string;
13
+ ruleId?: string;
14
+ location?: {
15
+ start?: {
16
+ line: number;
17
+ column: number;
18
+ };
19
+ };
20
+ stack?: string;
21
+ };
22
+ export type RunJSLog = {
23
+ level: 'log' | 'info' | 'warn' | 'error';
24
+ message: string;
25
+ };
26
+ export type DiagnoseRunJSResult = {
27
+ issues: RunJSIssue[];
28
+ logs: RunJSLog[];
29
+ execution?: {
30
+ started: boolean;
31
+ finished: boolean;
32
+ timeout: boolean;
33
+ durationMs?: number;
34
+ };
35
+ };
36
+ export type PreviewRunJSResult = {
37
+ success: boolean;
38
+ message: string;
39
+ };
40
+ export type RunJSDiagnosticsOptions = {
41
+ version?: string;
42
+ };
43
+ export declare const MAX_MESSAGE_CHARS = 4000;
44
+ export declare function formatRunJSPreviewMessage(result: DiagnoseRunJSResult): string;
45
+ export declare function diagnoseRunJS(code: string, ctx: FlowContext, options?: RunJSDiagnosticsOptions): Promise<DiagnoseRunJSResult>;
46
+ export declare function previewRunJS(code: string, ctx: FlowContext, options?: RunJSDiagnosticsOptions): Promise<PreviewRunJSResult>;
@@ -0,0 +1,23 @@
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 type FieldAssignCascaderOption = {
10
+ label: string;
11
+ value: string;
12
+ /** antd Cascader lazy-load marker */
13
+ isLeaf?: boolean;
14
+ /** antd Cascader loading marker */
15
+ loading?: boolean;
16
+ children?: FieldAssignCascaderOption[];
17
+ };
18
+ export declare function collectFieldAssignCascaderOptions(options: {
19
+ formBlockModel: any;
20
+ t: (key: string) => string;
21
+ /** 子表单模型递归深度(FormItemModel 层级);默认不限制(只受实际配置与循环引用约束) */
22
+ maxFormItemDepth?: number;
23
+ }): FieldAssignCascaderOption[];
@@ -7,7 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- import { FlowModel } from '@nocobase/flow-engine';
10
+ import { type MetaTreeNode, FlowModel } from '@nocobase/flow-engine';
11
11
  export interface LinkageFilterItemValue {
12
12
  path: string | null;
13
13
  operator: string;
@@ -18,8 +18,34 @@ export interface LinkageFilterItemProps {
18
18
  /** 条件值对象(响应式) */
19
19
  value: LinkageFilterItemValue;
20
20
  model: FlowModel;
21
+ /** 向变量树额外注入节点(置于根部) */
22
+ extraMetaTree?: MetaTreeNode[];
21
23
  }
24
+ type OperatorMeta = {
25
+ value: string;
26
+ label: string | React.ReactNode;
27
+ noValue?: boolean;
28
+ schema?: any;
29
+ selected?: boolean;
30
+ };
31
+ type FilterableChild = {
32
+ name: string;
33
+ title?: string;
34
+ schema?: any;
35
+ operators?: OperatorMeta[];
36
+ };
37
+ type FieldInterfaceDef = {
38
+ filterable?: {
39
+ operators?: Array<OperatorMeta & {
40
+ visible?: (meta: MetaTreeNode) => boolean;
41
+ }>;
42
+ children?: FilterableChild[];
43
+ };
44
+ };
45
+ export declare function mergeExtraMetaTreeWithBase(baseMetaTree: MetaTreeNode[] | undefined, extraMetaTree?: MetaTreeNode[]): MetaTreeNode[];
46
+ export declare function enhanceMetaTreeWithFilterableChildren(metaTree: MetaTreeNode[] | undefined, getFieldInterface?: (name: string) => FieldInterfaceDef | undefined): Promise<MetaTreeNode[]>;
22
47
  /**
23
48
  * LinkageFilterItem:左/右均为可变量输入,适用于联动规则等“前端逻辑”场景
24
49
  */
25
50
  export declare const LinkageFilterItem: React.FC<LinkageFilterItemProps>;
51
+ export {};
@@ -0,0 +1,13 @@
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 { SyncAssociationTitleFieldParams } from './FieldAssignRulesEditor';
10
+ export declare function useAssociationTitleFieldSync(t: (key: string) => string): {
11
+ isTitleFieldCandidate: (field: any) => boolean;
12
+ onSyncAssociationTitleField: ({ targetCollection, titleField }: SyncAssociationTitleFieldParams) => Promise<void>;
13
+ };
@@ -13,10 +13,12 @@ export declare class PluginFlowEngine extends Plugin {
13
13
  export * from './components/filter';
14
14
  export * from './components/code-editor';
15
15
  export * from './components/TextAreaWithContextSelector';
16
+ export * from './components/SkeletonFallback';
16
17
  export * from './FlowModelRepository';
17
18
  export * from './FlowPage';
18
19
  export * from './models';
19
20
  export * from './utils';
21
+ export * from './actions';
20
22
  export { openViewFlow } from './flows/openViewFlow';
21
23
  export { editMarkdownFlow } from './flows/editMarkdownFlow';
22
24
  export { TextAreaWithContextSelector } from './components/TextAreaWithContextSelector';
@@ -0,0 +1,27 @@
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 { FormItemModel } from '../../models';
10
+ export interface CollectionLike {
11
+ getField?: (name: string) => unknown;
12
+ getFields?: () => unknown[];
13
+ dataSourceKey?: string;
14
+ name?: string;
15
+ }
16
+ export declare const CUSTOM_FIELD_TARGET_PATH_PREFIX = "__custom__";
17
+ export declare function buildCustomFieldTargetPath(customFieldName: string): string;
18
+ export declare function isToManyAssociationField(field: unknown): boolean;
19
+ export declare function getCollectionFromModel(model: unknown): CollectionLike | undefined;
20
+ export declare function getFormItemFieldPathCandidates(model: unknown): string[];
21
+ export declare function getFormItemPreferredFieldPath(model: unknown): string | undefined;
22
+ /**
23
+ * Find a configured FormItemModel by its `fieldSettings.init.fieldPath` (or `fieldPath`) in the current form grid,
24
+ * including nested subform items. Also supports combined path matching when a model stores
25
+ * `associationPathName + fieldPath` separately (e.g. wrapper field children builders).
26
+ */
27
+ export declare function findFormItemModelByFieldPath(root: unknown, targetPath: string): FormItemModel | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const SAVE_STEP_PARAMS_WITH_SUB_MODELS_FLAG: "__saveStepParamsWithSubModels";
10
+ export declare function markSaveStepParamsWithSubModels(model: unknown): void;
11
+ export declare function saveStepParamsWithSubModelsIfNeeded<T>(model: unknown, fallback: () => Promise<T>): Promise<T>;
@@ -0,0 +1,35 @@
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 { CollectionFieldOptions, DataSourceManager } from '../../../data-source';
10
+ type CollectionLike = {
11
+ name?: unknown;
12
+ dataSource?: unknown;
13
+ dataSourceKey?: unknown;
14
+ setOption?: (key: string, value: any) => any;
15
+ };
16
+ type ApiClientLike = {
17
+ request?: (options: {
18
+ url: string;
19
+ method?: string;
20
+ params?: Record<string, any>;
21
+ data?: Record<string, any>;
22
+ }) => Promise<any>;
23
+ };
24
+ export declare function isTitleUsableField(dm: DataSourceManager | undefined, field: CollectionFieldOptions | undefined): boolean;
25
+ export declare function syncCollectionTitleField(options: {
26
+ api: ApiClientLike;
27
+ dataSourceManager?: DataSourceManager;
28
+ targetCollection: CollectionLike | null | undefined;
29
+ titleField: string;
30
+ }): Promise<{
31
+ dataSourceKey: string;
32
+ collectionName: string;
33
+ titleField: string;
34
+ }>;
35
+ export {};
@@ -9,6 +9,7 @@
9
9
  import type { ButtonProps } from 'antd/es/button';
10
10
  import { PopupActionModel } from '../base';
11
11
  export declare class AddChildActionModel extends PopupActionModel {
12
+ static capabilityActionName: any;
12
13
  defaultProps: ButtonProps;
13
14
  getAclActionName(): string;
14
15
  onInit(options: any): void;
@@ -10,6 +10,7 @@ import { ButtonProps } from 'antd';
10
10
  import { ActionModel } from '../base';
11
11
  export declare class BulkDeleteActionModel extends ActionModel {
12
12
  static scene: import("../base").ActionSceneType;
13
+ static capabilityActionName: string;
13
14
  defaultProps: ButtonProps;
14
15
  getAclActionName(): string;
15
16
  }
@@ -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 React from 'react';
10
+ import { ActionModel } from '../base';
11
+ export declare class JSItemActionModel extends ActionModel {
12
+ private _offResourceRefresh?;
13
+ private _mountedOnce;
14
+ static scene: import("../base").ActionSceneType;
15
+ render(): React.JSX.Element;
16
+ renderHiddenInConfig(): React.ReactNode | undefined;
17
+ protected onMount(): void;
18
+ protected onUnmount(): void;
19
+ }
@@ -8,10 +8,7 @@
8
8
  */
9
9
  import type { ButtonProps } from 'antd/es/button';
10
10
  import { ActionModel } from '../base';
11
- export declare function joinUrlSearch(url: string, params?: {
12
- name: string;
13
- value: any;
14
- }[]): string;
11
+ export { joinUrlSearch } from './joinUrlSearch';
15
12
  export declare class LinkActionModel extends ActionModel {
16
13
  static scene: import("../base").ActionSceneType;
17
14
  defaultProps: ButtonProps;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare function completeURL(url: string, origin?: string): string;
10
+ export declare function handleLinkNavigation(options: {
11
+ link: string;
12
+ openInNewWindow?: boolean;
13
+ router: {
14
+ navigate: (to: string, options?: {
15
+ replace?: boolean;
16
+ }) => void;
17
+ };
18
+ isExternalLink: boolean;
19
+ setLocationHref?: (url: string) => void;
20
+ openWindow?: (url?: string, target?: string) => Window | null;
21
+ }): void;
22
+ /**
23
+ * 判断 Link 导航后是否需要销毁当前视图
24
+ * @param options 判定参数
25
+ * @param options.openInNewWindow 是否新窗口打开
26
+ * @param options.isExternalLink 是否外部链接
27
+ * @param options.viewType 当前视图类型
28
+ * @returns 是否应销毁当前视图
29
+ */
30
+ export declare function shouldDestroyViewAfterLinkNavigation(options: {
31
+ openInNewWindow?: boolean;
32
+ isExternalLink: boolean;
33
+ viewType?: string;
34
+ }): boolean;
@@ -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
+ export declare function refreshLinkageRulesAfterUpdate(ctx: any): Promise<void>;
10
+ export declare function applyUpdateRecordAction(ctx: any, params: any, options?: {
11
+ settingsFlowKey?: string;
12
+ }): Promise<void>;
@@ -13,6 +13,7 @@ export * from './EditActionModel';
13
13
  export * from './FilterActionModel';
14
14
  export * from './JSActionModel';
15
15
  export * from './JSCollectionActionModel';
16
+ export * from './JSItemActionModel';
16
17
  export * from './JSRecordActionModel';
17
18
  export * from './PopupCollectionActionModel';
18
19
  export * from './RefreshActionModel';
@@ -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
+ export declare function joinUrlSearch(url: string, params?: {
10
+ name: string;
11
+ value: any;
12
+ }[]): string;