@nocobase/plugin-flow-engine 2.1.0-alpha.20 → 2.1.0-alpha.21

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 (50) hide show
  1. package/dist/externalVersion.js +11 -10
  2. package/dist/node_modules/ses/dist/ses.cjs +1 -1
  3. package/dist/node_modules/ses/package.json +1 -1
  4. package/dist/node_modules/zod/index.cjs +1 -1
  5. package/dist/node_modules/zod/package.json +1 -1
  6. package/dist/server/flow-surfaces/action-scope.d.ts +1 -0
  7. package/dist/server/flow-surfaces/action-scope.js +4 -0
  8. package/dist/server/flow-surfaces/apply/compiler.js +1 -1
  9. package/dist/server/flow-surfaces/approval/builder.js +8 -8
  10. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +192 -29
  11. package/dist/server/flow-surfaces/blueprint/defaults.d.ts +26 -0
  12. package/dist/server/flow-surfaces/blueprint/defaults.js +133 -0
  13. package/dist/server/flow-surfaces/blueprint/index.d.ts +1 -1
  14. package/dist/server/flow-surfaces/blueprint/normalize-document.js +121 -1
  15. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +32 -0
  16. package/dist/server/flow-surfaces/builder.d.ts +2 -2
  17. package/dist/server/flow-surfaces/builder.js +148 -50
  18. package/dist/server/flow-surfaces/catalog.js +276 -34
  19. package/dist/server/flow-surfaces/compose-compiler.d.ts +2 -0
  20. package/dist/server/flow-surfaces/compose-compiler.js +5 -1
  21. package/dist/server/flow-surfaces/configure-options.js +88 -12
  22. package/dist/server/flow-surfaces/contract-guard.js +60 -69
  23. package/dist/server/flow-surfaces/default-action-popup.d.ts +11 -1
  24. package/dist/server/flow-surfaces/default-action-popup.js +72 -12
  25. package/dist/server/flow-surfaces/default-block-actions.js +8 -1
  26. package/dist/server/flow-surfaces/filter-group.d.ts +15 -0
  27. package/dist/server/flow-surfaces/filter-group.js +94 -0
  28. package/dist/server/flow-surfaces/index.js +70 -2
  29. package/dist/server/flow-surfaces/node-use-sets.js +6 -1
  30. package/dist/server/flow-surfaces/placement.js +3 -0
  31. package/dist/server/flow-surfaces/public-data-surface-default-filter.d.ts +20 -0
  32. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +111 -0
  33. package/dist/server/flow-surfaces/reaction/registry.d.ts +7 -0
  34. package/dist/server/flow-surfaces/reaction/registry.js +7 -0
  35. package/dist/server/flow-surfaces/service-utils.d.ts +7 -0
  36. package/dist/server/flow-surfaces/service-utils.js +58 -9
  37. package/dist/server/flow-surfaces/service.d.ts +73 -3
  38. package/dist/server/flow-surfaces/service.js +1794 -162
  39. package/dist/server/flow-surfaces/support-matrix.d.ts +5 -2
  40. package/dist/server/flow-surfaces/support-matrix.js +16 -3
  41. package/dist/server/flow-surfaces/surface-context.js +2 -1
  42. package/dist/server/flow-surfaces/template-display.d.ts +20 -0
  43. package/dist/server/flow-surfaces/template-display.js +289 -0
  44. package/dist/server/flow-surfaces/types.d.ts +1 -0
  45. package/dist/swagger/flow-surfaces.d.ts +160 -0
  46. package/dist/swagger/flow-surfaces.examples.d.ts +117 -11
  47. package/dist/swagger/flow-surfaces.examples.js +152 -1
  48. package/dist/swagger/flow-surfaces.js +141 -21
  49. package/dist/swagger/index.d.ts +160 -0
  50. package/package.json +2 -2
@@ -155,6 +155,15 @@ const FILTER_FORM_ITEM_ALLOWED_PATHS = [
155
155
  "initialValue.defaultValue"
156
156
  ];
157
157
  const ACTION_PROP_KEYS = ["title", "tooltip", "icon", "type", "htmlType", "position", "danger", "color"];
158
+ const FILTER_ACTION_PROP_KEYS = [...ACTION_PROP_KEYS, "filterableFieldNames", "defaultFilterValue", "filterValue"];
159
+ const FILTER_ACTION_PROP_PATH_SCHEMAS = {
160
+ filterableFieldNames: {
161
+ type: "array",
162
+ items: STRING_SCHEMA
163
+ },
164
+ defaultFilterValue: FILTER_GROUP_SCHEMA,
165
+ filterValue: FILTER_GROUP_SCHEMA
166
+ };
158
167
  const ACTION_BUTTON_SETTINGS_GROUP = {
159
168
  allowedPaths: [
160
169
  "general.title",
@@ -280,14 +289,46 @@ const FILTER_FORM_BLOCK_SETTINGS_GROUP = {
280
289
  "defaultValues.value": ARRAY_SCHEMA
281
290
  }
282
291
  };
283
- const BLOCK_LINKAGE_CARD_SETTINGS_GROUP = {
284
- allowedPaths: ["linkageRules"],
292
+ const BLOCK_CARD_SETTINGS_GROUP = {
293
+ allowedPaths: ["titleDescription.title", "titleDescription.description", "linkageRules"],
294
+ clearable: true,
285
295
  mergeStrategy: "deep",
286
- eventBindingSteps: ["linkageRules"],
296
+ eventBindingSteps: ["titleDescription", "linkageRules"],
287
297
  pathSchemas: {
298
+ "titleDescription.title": STRING_SCHEMA,
299
+ "titleDescription.description": STRING_SCHEMA,
288
300
  linkageRules: ARRAY_SCHEMA
289
301
  }
290
302
  };
303
+ const CALENDAR_SETTINGS_GROUP = {
304
+ allowedPaths: [
305
+ "titleField.titleField",
306
+ "colorField.colorFieldName",
307
+ "startDateField.start",
308
+ "endDateField.end",
309
+ "defaultView.defaultView",
310
+ "quickCreateEvent.enableQuickCreateEvent",
311
+ "showLunar.showLunar",
312
+ "weekStart.weekStart",
313
+ "dataScope.filter",
314
+ "linkageRules.value"
315
+ ],
316
+ clearable: true,
317
+ mergeStrategy: "deep",
318
+ eventBindingSteps: ["dataScope", "linkageRules"],
319
+ pathSchemas: {
320
+ "titleField.titleField": STRING_SCHEMA,
321
+ "colorField.colorFieldName": STRING_SCHEMA,
322
+ "startDateField.start": STRING_SCHEMA,
323
+ "endDateField.end": STRING_SCHEMA,
324
+ "defaultView.defaultView": STRING_SCHEMA,
325
+ "quickCreateEvent.enableQuickCreateEvent": BOOLEAN_SCHEMA,
326
+ "showLunar.showLunar": BOOLEAN_SCHEMA,
327
+ "weekStart.weekStart": NUMBER_SCHEMA,
328
+ "dataScope.filter": FILTER_GROUP_SCHEMA,
329
+ "linkageRules.value": ARRAY_SCHEMA
330
+ }
331
+ };
291
332
  const TABLE_SETTINGS_GROUP = {
292
333
  allowedPaths: [
293
334
  "quickEdit.editable",
@@ -398,13 +439,14 @@ const KNOWN_FIELD_NODE_USES = /* @__PURE__ */ new Set([
398
439
  ...REGISTERED_DISPLAY_FIELD_USE_SET,
399
440
  ...REGISTERED_FILTER_FIELD_USE_SET
400
441
  ]);
401
- function keyedDomain(allowedKeys, mergeStrategy = "deep") {
442
+ function keyedDomain(allowedKeys, mergeStrategy = "deep", pathSchemas) {
402
443
  return {
403
444
  allowedKeys,
404
445
  mergeStrategy,
446
+ pathSchemas,
405
447
  schema: {
406
448
  type: "object",
407
- properties: Object.fromEntries(allowedKeys.map((key) => [key, ANY_VALUE_SCHEMA])),
449
+ properties: Object.fromEntries(allowedKeys.map((key) => [key, (pathSchemas == null ? void 0 : pathSchemas[key]) || ANY_VALUE_SCHEMA])),
408
450
  additionalProperties: false
409
451
  }
410
452
  };
@@ -491,6 +533,7 @@ function buildSettingsSchema(contract) {
491
533
  "x-allowedKeys": (definition == null ? void 0 : definition.allowedKeys) || [],
492
534
  "x-wildcard": !!(definition == null ? void 0 : definition.wildcard),
493
535
  "x-mergeStrategy": (definition == null ? void 0 : definition.mergeStrategy) || "deep",
536
+ "x-pathSchemas": definition == null ? void 0 : definition.pathSchemas,
494
537
  "x-groups": (definition == null ? void 0 : definition.groups) ? Object.fromEntries(
495
538
  Object.entries(definition.groups).map(([groupKey, group]) => [
496
539
  groupKey,
@@ -706,7 +749,7 @@ TAB_NODE_CONTRACT.domains.stepParams = groupedDomain({
706
749
  });
707
750
  const TABLE_BLOCK_CONTRACT = createContract({
708
751
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
709
- props: ["title", "displayTitle", "height", "heightMode"],
752
+ props: ["height", "heightMode"],
710
753
  decoratorProps: ["height", "heightMode"],
711
754
  stepParams: ["resourceSettings", "tableSettings", "cardSettings"],
712
755
  flowRegistry: true,
@@ -718,11 +761,11 @@ const TABLE_BLOCK_CONTRACT = createContract({
718
761
  TABLE_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
719
762
  resourceSettings: RESOURCE_SETTINGS_GROUP,
720
763
  tableSettings: TABLE_SETTINGS_GROUP,
721
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
764
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
722
765
  });
723
766
  const FORM_BLOCK_CONTRACT = createContract({
724
767
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
725
- props: ["title", "displayTitle", "labelWidth", "labelWrap"],
768
+ props: ["labelWidth", "labelWrap"],
726
769
  decoratorProps: ["labelWidth", "labelWrap"],
727
770
  stepParams: ["resourceSettings", "formModelSettings", "eventSettings", "cardSettings"],
728
771
  flowRegistry: true,
@@ -735,11 +778,11 @@ FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
735
778
  resourceSettings: RESOURCE_SETTINGS_GROUP,
736
779
  formModelSettings: FORM_MODEL_SETTINGS_GROUP,
737
780
  eventSettings: EVENT_SETTINGS_GROUP,
738
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
781
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
739
782
  });
740
783
  const CREATE_FORM_BLOCK_CONTRACT = createContract({
741
784
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
742
- props: ["title", "displayTitle", "labelWidth", "labelWrap"],
785
+ props: ["labelWidth", "labelWrap"],
743
786
  decoratorProps: ["labelWidth", "labelWrap"],
744
787
  stepParams: ["resourceSettings", "formModelSettings", "eventSettings", "formSettings", "cardSettings"],
745
788
  flowRegistry: true,
@@ -753,11 +796,11 @@ CREATE_FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
753
796
  formModelSettings: FORM_MODEL_SETTINGS_GROUP,
754
797
  eventSettings: EVENT_SETTINGS_GROUP,
755
798
  formSettings: CREATE_FORM_SETTINGS_EVENT_ONLY_GROUP,
756
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
799
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
757
800
  });
758
801
  const EDIT_FORM_BLOCK_CONTRACT = createContract({
759
802
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
760
- props: ["title", "displayTitle", "labelWidth", "labelWrap"],
803
+ props: ["labelWidth", "labelWrap"],
761
804
  decoratorProps: ["labelWidth", "labelWrap"],
762
805
  stepParams: ["resourceSettings", "formModelSettings", "eventSettings", "formSettings", "cardSettings"],
763
806
  flowRegistry: true,
@@ -771,11 +814,11 @@ EDIT_FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
771
814
  formModelSettings: FORM_MODEL_SETTINGS_GROUP,
772
815
  eventSettings: EVENT_SETTINGS_GROUP,
773
816
  formSettings: EDIT_FORM_SETTINGS_GROUP,
774
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
817
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
775
818
  });
776
819
  const DETAILS_BLOCK_CONTRACT = createContract({
777
820
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
778
- props: ["title", "displayTitle", "labelWidth", "labelWrap"],
821
+ props: ["labelWidth", "labelWrap"],
779
822
  decoratorProps: ["labelWidth", "labelWrap"],
780
823
  stepParams: ["resourceSettings", "detailsSettings", "cardSettings"],
781
824
  flowRegistry: true,
@@ -787,7 +830,7 @@ const DETAILS_BLOCK_CONTRACT = createContract({
787
830
  DETAILS_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
788
831
  resourceSettings: RESOURCE_SETTINGS_GROUP,
789
832
  detailsSettings: DETAILS_SETTINGS_GROUP,
790
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
833
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
791
834
  });
792
835
  const FILTER_FORM_BLOCK_CONTRACT = createContract({
793
836
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
@@ -804,9 +847,33 @@ FILTER_FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
804
847
  resourceSettings: RESOURCE_SETTINGS_GROUP,
805
848
  formFilterBlockModelSettings: FILTER_FORM_BLOCK_SETTINGS_GROUP
806
849
  });
850
+ const CALENDAR_BLOCK_CONTRACT = createContract({
851
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
852
+ props: [
853
+ "fieldNames",
854
+ "defaultView",
855
+ "enableQuickCreateEvent",
856
+ "showLunar",
857
+ "weekStart",
858
+ "quickCreatePopupSettings",
859
+ "eventPopupSettings"
860
+ ],
861
+ decoratorProps: ["height", "heightMode"],
862
+ stepParams: ["resourceSettings", "calendarSettings", "cardSettings"],
863
+ flowRegistry: true,
864
+ eventCapabilities: {
865
+ direct: DEFAULT_DIRECT_EVENTS,
866
+ object: ["click"]
867
+ }
868
+ });
869
+ CALENDAR_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
870
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
871
+ calendarSettings: CALENDAR_SETTINGS_GROUP,
872
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
873
+ });
807
874
  const LIST_BLOCK_CONTRACT = createContract({
808
875
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
809
- props: ["title", "displayTitle"],
876
+ props: [],
810
877
  decoratorProps: ["height", "heightMode"],
811
878
  stepParams: ["resourceSettings", "listSettings", "cardSettings"],
812
879
  flowRegistry: true,
@@ -842,11 +909,11 @@ LIST_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
842
909
  "layout.layout": STRING_SCHEMA
843
910
  }
844
911
  },
845
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
912
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
846
913
  });
847
914
  const GRID_CARD_BLOCK_CONTRACT = createContract({
848
915
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
849
- props: ["title", "displayTitle"],
916
+ props: [],
850
917
  decoratorProps: ["height", "heightMode"],
851
918
  stepParams: ["resourceSettings", "GridCardSettings", "cardSettings"],
852
919
  flowRegistry: true,
@@ -899,18 +966,19 @@ GRID_CARD_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
899
966
  "layout.layout": STRING_SCHEMA
900
967
  }
901
968
  },
902
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
969
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
903
970
  });
904
971
  const MARKDOWN_BLOCK_CONTRACT = createContract({
905
972
  editableDomains: ["props", "stepParams", "flowRegistry"],
906
- props: ["title", "displayTitle", "content", "value"],
907
- stepParams: ["markdownBlockSettings"],
973
+ props: ["content", "value"],
974
+ stepParams: ["markdownBlockSettings", "cardSettings"],
908
975
  flowRegistry: true,
909
976
  eventCapabilities: {
910
977
  direct: DEFAULT_DIRECT_EVENTS
911
978
  }
912
979
  });
913
980
  MARKDOWN_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
981
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP,
914
982
  markdownBlockSettings: {
915
983
  allowedPaths: ["editMarkdown.content"],
916
984
  clearable: true,
@@ -922,14 +990,15 @@ MARKDOWN_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
922
990
  });
923
991
  const IFRAME_BLOCK_CONTRACT = createContract({
924
992
  editableDomains: ["props", "stepParams", "flowRegistry"],
925
- props: ["title", "displayTitle", "url", "height", "heightMode", "mode", "html", "params", "allow", "htmlId"],
926
- stepParams: ["iframeBlockSettings"],
993
+ props: ["url", "height", "heightMode", "mode", "html", "params", "allow", "htmlId"],
994
+ stepParams: ["iframeBlockSettings", "cardSettings"],
927
995
  flowRegistry: true,
928
996
  eventCapabilities: {
929
997
  direct: DEFAULT_DIRECT_EVENTS
930
998
  }
931
999
  });
932
1000
  IFRAME_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1001
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP,
933
1002
  iframeBlockSettings: {
934
1003
  allowedPaths: [
935
1004
  "editIframe.mode",
@@ -954,12 +1023,19 @@ IFRAME_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
954
1023
  }
955
1024
  });
956
1025
  const CHART_CARD_SETTINGS_GROUP = {
957
- allowedPaths: ["titleDescription.title", "blockHeight.heightMode", "blockHeight.height", "linkageRules"],
1026
+ allowedPaths: [
1027
+ "titleDescription.title",
1028
+ "titleDescription.description",
1029
+ "blockHeight.heightMode",
1030
+ "blockHeight.height",
1031
+ "linkageRules"
1032
+ ],
958
1033
  clearable: true,
959
1034
  mergeStrategy: "deep",
960
1035
  eventBindingSteps: ["titleDescription", "blockHeight", "linkageRules"],
961
1036
  pathSchemas: {
962
1037
  "titleDescription.title": STRING_SCHEMA,
1038
+ "titleDescription.description": STRING_SCHEMA,
963
1039
  "blockHeight.heightMode": STRING_SCHEMA,
964
1040
  "blockHeight.height": NUMBER_SCHEMA,
965
1041
  linkageRules: ARRAY_SCHEMA
@@ -987,7 +1063,7 @@ CHART_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
987
1063
  });
988
1064
  const ACTION_PANEL_BLOCK_CONTRACT = createContract({
989
1065
  editableDomains: ["props", "stepParams", "flowRegistry"],
990
- props: ["title", "displayTitle", "layout", "ellipsis"],
1066
+ props: ["layout", "ellipsis"],
991
1067
  stepParams: ["actionPanelBlockSetting", "cardSettings"],
992
1068
  flowRegistry: true,
993
1069
  eventCapabilities: {
@@ -1003,7 +1079,7 @@ ACTION_PANEL_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1003
1079
  "ellipsis.ellipsis": BOOLEAN_SCHEMA
1004
1080
  }
1005
1081
  },
1006
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
1082
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
1007
1083
  });
1008
1084
  const JS_BLOCK_CONTRACT = createContract({
1009
1085
  editableDomains: ["decoratorProps", "stepParams", "flowRegistry"],
@@ -1023,8 +1099,9 @@ JS_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1023
1099
  jsSettings: RUN_JS_SETTINGS_GROUP
1024
1100
  });
1025
1101
  const MAP_BLOCK_CONTRACT = createContract({
1026
- editableDomains: ["props", "stepParams", "flowRegistry"],
1027
- props: ["title", "displayTitle", "height", "heightMode", "mapField", "marker", "lineSort", "zoom"],
1102
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1103
+ props: ["height", "heightMode", "mapField", "marker", "lineSort", "zoom"],
1104
+ decoratorProps: ["height", "heightMode"],
1028
1105
  stepParams: ["resourceSettings", "createMapBlock", "cardSettings"],
1029
1106
  flowRegistry: true,
1030
1107
  eventCapabilities: {
@@ -1061,11 +1138,11 @@ MAP_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1061
1138
  "mapZoom.zoom": NUMBER_SCHEMA
1062
1139
  }
1063
1140
  },
1064
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP
1141
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
1065
1142
  });
1066
1143
  const COMMENTS_BLOCK_CONTRACT = createContract({
1067
1144
  editableDomains: ["props", "stepParams", "flowRegistry"],
1068
- props: ["title", "displayTitle"],
1145
+ props: [],
1069
1146
  stepParams: ["resourceSettings", "commentsSettings", "cardSettings"],
1070
1147
  flowRegistry: true,
1071
1148
  eventCapabilities: {
@@ -1091,7 +1168,7 @@ COMMENTS_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1091
1168
  "init.associationPathName": STRING_SCHEMA
1092
1169
  }
1093
1170
  },
1094
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP,
1171
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP,
1095
1172
  commentsSettings: {
1096
1173
  allowedPaths: ["pageSize.pageSize", "dataScope.filter"],
1097
1174
  clearable: true,
@@ -1255,6 +1332,7 @@ const FIELD_NODE_CONTRACT = createContract({
1255
1332
  "icon",
1256
1333
  "titleField",
1257
1334
  "clickToOpen",
1335
+ "mode",
1258
1336
  "autoSize",
1259
1337
  "allowMultiple",
1260
1338
  "multiple",
@@ -1352,6 +1430,28 @@ const JS_ITEM_CONTRACT = createContract({
1352
1430
  JS_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1353
1431
  jsSettings: RUN_JS_SETTINGS_GROUP
1354
1432
  });
1433
+ const DIVIDER_ITEM_CONTRACT = createContract({
1434
+ editableDomains: ["props", "stepParams"],
1435
+ props: ["label", "orientation", "dashed", "color", "borderColor"],
1436
+ stepParams: ["markdownItemSetting"],
1437
+ eventCapabilities: {
1438
+ direct: DEFAULT_DIRECT_EVENTS
1439
+ }
1440
+ });
1441
+ DIVIDER_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1442
+ markdownItemSetting: {
1443
+ allowedPaths: ["title.label", "title.orientation", "title.dashed", "title.color", "title.borderColor"],
1444
+ mergeStrategy: "deep",
1445
+ eventBindingSteps: ["title"],
1446
+ pathSchemas: {
1447
+ "title.label": STRING_SCHEMA,
1448
+ "title.orientation": STRING_SCHEMA,
1449
+ "title.dashed": BOOLEAN_SCHEMA,
1450
+ "title.color": STRING_SCHEMA,
1451
+ "title.borderColor": STRING_SCHEMA
1452
+ }
1453
+ }
1454
+ });
1355
1455
  FIELD_NODE_CONTRACT.domains.stepParams = groupedDomain({
1356
1456
  fieldSettings: FIELD_SETTINGS_INIT_GROUP,
1357
1457
  displayFieldSettings: {
@@ -1456,6 +1556,28 @@ POPUP_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1456
1556
  pathSchemas: OPEN_VIEW_PATH_SCHEMAS
1457
1557
  }
1458
1558
  });
1559
+ const CALENDAR_POPUP_ACTION_CONTRACT = createContract({
1560
+ editableDomains: ["stepParams"],
1561
+ stepParams: ["popupSettings"],
1562
+ eventCapabilities: {
1563
+ direct: ACTION_DIRECT_EVENTS,
1564
+ object: ACTION_OBJECT_EVENTS
1565
+ },
1566
+ eventBindings: {
1567
+ popupSettings: {
1568
+ stepKeys: ["openView"]
1569
+ }
1570
+ }
1571
+ });
1572
+ CALENDAR_POPUP_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1573
+ popupSettings: {
1574
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
1575
+ clearable: true,
1576
+ mergeStrategy: "deep",
1577
+ eventBindingSteps: ["openView"],
1578
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
1579
+ }
1580
+ });
1459
1581
  const DELETE_ACTION_CONTRACT = createContract({
1460
1582
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1461
1583
  props: ACTION_PROP_KEYS,
@@ -1706,6 +1828,68 @@ const SIMPLE_ACTION_CONTRACT = createContract({
1706
1828
  SIMPLE_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1707
1829
  buttonSettings: ACTION_BUTTON_SETTINGS_GROUP
1708
1830
  });
1831
+ const CALENDAR_READONLY_ACTION_CONTRACT = createContract({
1832
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1833
+ props: ["position"],
1834
+ stepParams: ["buttonSettings"],
1835
+ flowRegistry: true,
1836
+ eventCapabilities: {
1837
+ direct: ACTION_DIRECT_EVENTS,
1838
+ object: ACTION_OBJECT_EVENTS
1839
+ },
1840
+ eventBindings: {
1841
+ buttonSettings: {
1842
+ stepKeys: ["linkageRules"]
1843
+ }
1844
+ }
1845
+ });
1846
+ CALENDAR_READONLY_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1847
+ buttonSettings: {
1848
+ allowedPaths: ["linkageRules"],
1849
+ clearable: true,
1850
+ mergeStrategy: "deep",
1851
+ eventBindingSteps: ["linkageRules"],
1852
+ pathSchemas: {
1853
+ linkageRules: ARRAY_SCHEMA
1854
+ }
1855
+ }
1856
+ });
1857
+ const FILTER_ACTION_CONTRACT = createContract({
1858
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1859
+ props: FILTER_ACTION_PROP_KEYS,
1860
+ decoratorProps: ["labelWidth", "labelWrap"],
1861
+ stepParams: ["buttonSettings", "filterSettings"],
1862
+ flowRegistry: true,
1863
+ eventCapabilities: {
1864
+ direct: ACTION_DIRECT_EVENTS,
1865
+ object: ACTION_OBJECT_EVENTS
1866
+ },
1867
+ eventBindings: {
1868
+ buttonSettings: {
1869
+ stepKeys: ["general", "linkageRules"]
1870
+ },
1871
+ filterSettings: {
1872
+ stepKeys: ["filterableFieldNames", "defaultFilter"]
1873
+ }
1874
+ }
1875
+ });
1876
+ FILTER_ACTION_CONTRACT.domains.props = keyedDomain(FILTER_ACTION_PROP_KEYS, "deep", FILTER_ACTION_PROP_PATH_SCHEMAS);
1877
+ FILTER_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1878
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
1879
+ filterSettings: {
1880
+ allowedPaths: ["filterableFieldNames.filterableFieldNames", "defaultFilter.defaultFilter"],
1881
+ clearable: true,
1882
+ mergeStrategy: "deep",
1883
+ eventBindingSteps: ["filterableFieldNames", "defaultFilter"],
1884
+ pathSchemas: {
1885
+ "filterableFieldNames.filterableFieldNames": {
1886
+ type: "array",
1887
+ items: STRING_SCHEMA
1888
+ },
1889
+ "defaultFilter.defaultFilter": FILTER_GROUP_SCHEMA
1890
+ }
1891
+ }
1892
+ });
1709
1893
  const FILTER_FORM_COLLAPSE_ACTION_CONTRACT = createContract({
1710
1894
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1711
1895
  props: ACTION_PROP_KEYS,
@@ -1897,7 +2081,7 @@ JS_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1897
2081
  });
1898
2082
  const APPROVAL_FORM_BLOCK_CONTRACT = createContract({
1899
2083
  editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1900
- props: ["title", "displayTitle", "labelWidth", "labelWrap"],
2084
+ props: ["labelWidth", "labelWrap"],
1901
2085
  decoratorProps: ["labelWidth", "labelWrap"],
1902
2086
  stepParams: ["resourceSettings", "formModelSettings", "eventSettings", "cardSettings", "patternSettings"],
1903
2087
  flowRegistry: true,
@@ -1910,7 +2094,7 @@ APPROVAL_FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1910
2094
  resourceSettings: RESOURCE_SETTINGS_GROUP,
1911
2095
  formModelSettings: FORM_MODEL_SETTINGS_GROUP,
1912
2096
  eventSettings: EVENT_SETTINGS_GROUP,
1913
- cardSettings: BLOCK_LINKAGE_CARD_SETTINGS_GROUP,
2097
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP,
1914
2098
  patternSettings: {
1915
2099
  allowedPaths: ["pattern.pattern"],
1916
2100
  mergeStrategy: "deep",
@@ -2040,6 +2224,7 @@ const NODE_CONTRACT_ENTRIES = [
2040
2224
  ["TriggerBlockGridModel", GRID_NODE_CONTRACT],
2041
2225
  ["ApprovalBlockGridModel", GRID_NODE_CONTRACT],
2042
2226
  ["TableBlockModel", TABLE_BLOCK_CONTRACT],
2227
+ ["CalendarBlockModel", CALENDAR_BLOCK_CONTRACT],
2043
2228
  ["CreateFormModel", CREATE_FORM_BLOCK_CONTRACT],
2044
2229
  ["EditFormModel", EDIT_FORM_BLOCK_CONTRACT],
2045
2230
  ["FormBlockModel", FORM_BLOCK_CONTRACT],
@@ -2072,11 +2257,14 @@ const NODE_CONTRACT_ENTRIES = [
2072
2257
  ["PatternFormFieldModel", PATTERN_FORM_FIELD_NODE_CONTRACT],
2073
2258
  ["JSColumnModel", JS_COLUMN_CONTRACT],
2074
2259
  ["JSItemModel", JS_ITEM_CONTRACT],
2260
+ ["DividerItemModel", DIVIDER_ITEM_CONTRACT],
2075
2261
  ["FormJSFieldItemModel", JS_ITEM_CONTRACT],
2076
2262
  ["AddNewActionModel", POPUP_ACTION_CONTRACT],
2077
2263
  ["ViewActionModel", POPUP_ACTION_CONTRACT],
2078
2264
  ["EditActionModel", POPUP_ACTION_CONTRACT],
2079
2265
  ["PopupCollectionActionModel", POPUP_ACTION_CONTRACT],
2266
+ ["CalendarQuickCreateActionModel", CALENDAR_POPUP_ACTION_CONTRACT],
2267
+ ["CalendarEventViewActionModel", CALENDAR_POPUP_ACTION_CONTRACT],
2080
2268
  ["AddChildActionModel", POPUP_ACTION_CONTRACT],
2081
2269
  ["DeleteActionModel", DELETE_ACTION_CONTRACT],
2082
2270
  ["BulkDeleteActionModel", DELETE_ACTION_CONTRACT],
@@ -2088,7 +2276,11 @@ const NODE_CONTRACT_ENTRIES = [
2088
2276
  ["FilterFormSubmitActionModel", FILTER_FORM_SUBMIT_ACTION_CONTRACT],
2089
2277
  ["FilterFormResetActionModel", SIMPLE_ACTION_CONTRACT],
2090
2278
  ["FilterFormCollapseActionModel", FILTER_FORM_COLLAPSE_ACTION_CONTRACT],
2091
- ["FilterActionModel", SIMPLE_ACTION_CONTRACT],
2279
+ ["CalendarTodayActionModel", SIMPLE_ACTION_CONTRACT],
2280
+ ["CalendarNavActionModel", CALENDAR_READONLY_ACTION_CONTRACT],
2281
+ ["CalendarTitleActionModel", CALENDAR_READONLY_ACTION_CONTRACT],
2282
+ ["CalendarViewSelectActionModel", CALENDAR_READONLY_ACTION_CONTRACT],
2283
+ ["FilterActionModel", FILTER_ACTION_CONTRACT],
2092
2284
  ["RefreshActionModel", SIMPLE_ACTION_CONTRACT],
2093
2285
  ["LinkActionModel", SIMPLE_ACTION_CONTRACT],
2094
2286
  ["ExpandCollapseActionModel", SIMPLE_ACTION_CONTRACT],
@@ -2401,6 +2593,15 @@ function resolveStandaloneFieldUse(input) {
2401
2593
  }
2402
2594
  return "JSItemModel";
2403
2595
  }
2596
+ if (requestedType === "divider") {
2597
+ const containerKind = normalizeFieldContainerUse(input.containerUse);
2598
+ if (containerKind !== "form" && containerKind !== "details") {
2599
+ throw new import_errors.FlowSurfaceBadRequestError(
2600
+ `flowSurfaces field type 'divider' is only allowed under form or details containers`
2601
+ );
2602
+ }
2603
+ return "DividerItemModel";
2604
+ }
2404
2605
  throw new import_errors.FlowSurfaceBadRequestError(
2405
2606
  `flowSurfaces field type '${requestedType}' is not a supported public capability`
2406
2607
  );
@@ -2532,6 +2733,7 @@ function getAvailableActionCatalogItems(containerUse, scope, enabledPackages) {
2532
2733
  }
2533
2734
  const COLLECTION_RESOURCE_REQUIRED = /* @__PURE__ */ new Set([
2534
2735
  "TableBlockModel",
2736
+ "CalendarBlockModel",
2535
2737
  "CreateFormModel",
2536
2738
  "EditFormModel",
2537
2739
  "FormBlockModel",
@@ -2641,6 +2843,46 @@ const actionRegistry = [
2641
2843
  allowedContainerUses: import_action_scope.COLLECTION_BLOCK_ACTION_CONTAINER_USES,
2642
2844
  createSupported: true
2643
2845
  },
2846
+ {
2847
+ publicKey: "today",
2848
+ label: "Today",
2849
+ scope: "block",
2850
+ scene: "collection",
2851
+ use: "CalendarTodayActionModel",
2852
+ ownerPlugin: "@nocobase/plugin-calendar",
2853
+ allowedContainerUses: import_action_scope.CALENDAR_BLOCK_ACTION_CONTAINER_USES,
2854
+ createSupported: true
2855
+ },
2856
+ {
2857
+ publicKey: "turnPages",
2858
+ label: "Turn pages",
2859
+ scope: "block",
2860
+ scene: "collection",
2861
+ use: "CalendarNavActionModel",
2862
+ ownerPlugin: "@nocobase/plugin-calendar",
2863
+ allowedContainerUses: import_action_scope.CALENDAR_BLOCK_ACTION_CONTAINER_USES,
2864
+ createSupported: true
2865
+ },
2866
+ {
2867
+ publicKey: "title",
2868
+ label: "Title",
2869
+ scope: "block",
2870
+ scene: "collection",
2871
+ use: "CalendarTitleActionModel",
2872
+ ownerPlugin: "@nocobase/plugin-calendar",
2873
+ allowedContainerUses: import_action_scope.CALENDAR_BLOCK_ACTION_CONTAINER_USES,
2874
+ createSupported: true
2875
+ },
2876
+ {
2877
+ publicKey: "selectView",
2878
+ label: "Select view",
2879
+ scope: "block",
2880
+ scene: "collection",
2881
+ use: "CalendarViewSelectActionModel",
2882
+ ownerPlugin: "@nocobase/plugin-calendar",
2883
+ allowedContainerUses: import_action_scope.CALENDAR_BLOCK_ACTION_CONTAINER_USES,
2884
+ createSupported: true
2885
+ },
2644
2886
  {
2645
2887
  publicKey: "expandCollapse",
2646
2888
  label: "Expand/Collapse",
@@ -6,6 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import { FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY, type FlowSurfaceApplyBlueprintPopupDefaultsMetadata } from './blueprint/defaults';
9
10
  import type { FlowSurfaceComposeMode } from './types';
10
11
  export type FlowSurfaceComposeObject = Record<string, unknown>;
11
12
  export type FlowSurfaceComposeTargetKey = {
@@ -26,6 +27,7 @@ export type FlowSurfaceComposeNormalizedFieldSpec = {
26
27
  settings?: FlowSurfaceComposeObject;
27
28
  popup?: FlowSurfaceComposeObject;
28
29
  __autoPopupForRelationField?: boolean;
30
+ [FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY]?: FlowSurfaceApplyBlueprintPopupDefaultsMetadata;
29
31
  };
30
32
  export type FlowSurfaceComposeNormalizedActionSpec = {
31
33
  key: string;
@@ -32,6 +32,7 @@ __export(compose_compiler_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(compose_compiler_exports);
34
34
  var import_errors = require("./errors");
35
+ var import_defaults = require("./blueprint/defaults");
35
36
  const LIST_LIKE_COMPOSE_BLOCK_TYPES = /* @__PURE__ */ new Set(["list", "gridCard"]);
36
37
  function compileComposeExecutionPlan(input) {
37
38
  const blocks = compileComposeBlockTasks(input.gridUid, input.normalizedBlocks);
@@ -123,7 +124,10 @@ function buildComposeFieldCreatePayload(fieldSpec) {
123
124
  ...fieldSpec.renderer ? { renderer: fieldSpec.renderer } : {},
124
125
  ...fieldSpec.type ? { type: fieldSpec.type } : {},
125
126
  ...fieldSpec.popup ? { popup: fieldSpec.popup } : {},
126
- ...fieldSpec.__autoPopupForRelationField ? { __autoPopupForRelationField: true } : {}
127
+ ...fieldSpec.__autoPopupForRelationField ? { __autoPopupForRelationField: true } : {},
128
+ ...fieldSpec[import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY] ? {
129
+ [import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY]: fieldSpec[import_defaults.FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY]
130
+ } : {}
127
131
  };
128
132
  }
129
133
  function buildComposeActionCreatePayload(actionSpec) {