@nocobase/plugin-flow-engine 2.1.0-beta.24 → 2.1.0-beta.25

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 (30) hide show
  1. package/dist/ai/ai-employees/nathan/index.js +1 -0
  2. package/dist/externalVersion.js +10 -10
  3. package/dist/node_modules/ses/package.json +1 -1
  4. package/dist/node_modules/zod/package.json +1 -1
  5. package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +2 -1
  6. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +134 -14
  7. package/dist/server/flow-surfaces/blueprint/compile-plan.d.ts +2 -1
  8. package/dist/server/flow-surfaces/blueprint/compile-plan.js +8 -8
  9. package/dist/server/flow-surfaces/blueprint/normalize-document.js +5 -14
  10. package/dist/server/flow-surfaces/blueprint/private-utils.d.ts +0 -1
  11. package/dist/server/flow-surfaces/blueprint/private-utils.js +0 -3
  12. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -0
  13. package/dist/server/flow-surfaces/builder.d.ts +1 -0
  14. package/dist/server/flow-surfaces/builder.js +167 -53
  15. package/dist/server/flow-surfaces/catalog.js +58 -3
  16. package/dist/server/flow-surfaces/configure-options.js +4 -0
  17. package/dist/server/flow-surfaces/default-block-actions.js +11 -10
  18. package/dist/server/flow-surfaces/hidden-popup-calendar.d.ts +86 -0
  19. package/dist/server/flow-surfaces/hidden-popup-calendar.js +554 -0
  20. package/dist/server/flow-surfaces/hidden-popup-contract.d.ts +116 -0
  21. package/dist/server/flow-surfaces/hidden-popup-contract.js +611 -0
  22. package/dist/server/flow-surfaces/hidden-popup-kanban.d.ts +62 -0
  23. package/dist/server/flow-surfaces/hidden-popup-kanban.js +651 -0
  24. package/dist/server/flow-surfaces/placement.js +1 -0
  25. package/dist/server/flow-surfaces/public-compatibility.d.ts +12 -0
  26. package/dist/server/flow-surfaces/public-compatibility.js +24 -2
  27. package/dist/server/flow-surfaces/service.d.ts +54 -10
  28. package/dist/server/flow-surfaces/service.js +1355 -765
  29. package/dist/swagger/flow-surfaces.js +6 -6
  30. package/package.json +2 -2
@@ -54,6 +54,8 @@ var import_catalog = require("./catalog");
54
54
  var import_chart_config = require("./chart-config");
55
55
  var import_approval = require("./approval");
56
56
  var import_service_utils = require("./service-utils");
57
+ var import_public_compatibility = require("./public-compatibility");
58
+ var import_hidden_popup_contract = require("./hidden-popup-contract");
57
59
  const JS_BLOCK_DEFAULT_CODE = [
58
60
  "// Welcome to the JS block",
59
61
  "ctx.render(`",
@@ -122,11 +124,75 @@ const CALENDAR_QUICK_CREATE_ACTION_KEY = "quickCreateAction";
122
124
  const CALENDAR_EVENT_VIEW_ACTION_KEY = "eventViewAction";
123
125
  const KANBAN_QUICK_CREATE_ACTION_KEY = "quickCreateAction";
124
126
  const KANBAN_CARD_VIEW_ACTION_KEY = "cardViewAction";
127
+ const KANBAN_LEGACY_PARENT_CARD_POPUP_PROP_KEYS = [
128
+ "cardOpenMode",
129
+ "cardPopupSize",
130
+ "cardPopupTemplateUid",
131
+ "cardPopupPageModelClass",
132
+ "cardPopupTargetUid"
133
+ ];
134
+ const KANBAN_LEGACY_QUICK_CREATE_POPUP_PROP_KEYS = [
135
+ "popupMode",
136
+ "popupSize",
137
+ "popupTemplateUid",
138
+ "popupPageModelClass",
139
+ "popupTargetUid"
140
+ ];
141
+ const KANBAN_BLOCK_CARD_POPUP_STEP_PARAMS_PATH = ["cardSettings", "popup"];
125
142
  const CALENDAR_READONLY_ACTION_MODEL_USES = /* @__PURE__ */ new Set([
126
143
  "CalendarNavActionModel",
127
144
  "CalendarTitleActionModel",
128
145
  "CalendarViewSelectActionModel"
129
146
  ]);
147
+ function resolveModelStepParamsOrLegacyObject(model, path, legacyValue) {
148
+ if (import_lodash.default.has(model.stepParams, path)) {
149
+ const value = import_lodash.default.get(model.stepParams, path);
150
+ return import_lodash.default.isPlainObject(value) ? value : {};
151
+ }
152
+ return import_lodash.default.isPlainObject(legacyValue) ? legacyValue : void 0;
153
+ }
154
+ function resolvePersistableModelStepParamsOrLegacyObject(model, path, legacyValue) {
155
+ const value = resolveModelStepParamsOrLegacyObject(model, path, legacyValue);
156
+ if (!import_lodash.default.isPlainObject(value)) {
157
+ return void 0;
158
+ }
159
+ const normalized = normalizeInitialKanbanPopupSettings(value);
160
+ return Object.keys(normalized).length ? normalized : void 0;
161
+ }
162
+ function extractPersistableModelStepParamsOrLegacyObject(model, path, legacyValue) {
163
+ const value = resolvePersistableModelStepParamsOrLegacyObject(model, path, legacyValue);
164
+ import_lodash.default.unset(model.stepParams, path);
165
+ return value;
166
+ }
167
+ function persistModelPopupStepParams(model, path, popupSettings) {
168
+ if (!import_lodash.default.isPlainObject(popupSettings)) {
169
+ return;
170
+ }
171
+ import_lodash.default.set(model.stepParams, path, import_lodash.default.cloneDeep(popupSettings));
172
+ }
173
+ function normalizeInitialKanbanPopupSettings(popupSettings) {
174
+ return (0, import_hidden_popup_contract.normalizeHiddenPopupSettings)(popupSettings);
175
+ }
176
+ function normalizeInitialKanbanPopupSettingsFromProps(actionKey, props) {
177
+ if (!import_lodash.default.isPlainObject(props)) {
178
+ return void 0;
179
+ }
180
+ const rawSettings = actionKey === KANBAN_QUICK_CREATE_ACTION_KEY ? (0, import_service_utils.buildDefinedPayload)({
181
+ mode: props.popupMode,
182
+ size: props.popupSize,
183
+ popupTemplateUid: props.popupTemplateUid,
184
+ pageModelClass: props.popupPageModelClass,
185
+ uid: props.popupTargetUid
186
+ }) : (0, import_service_utils.buildDefinedPayload)({
187
+ mode: props.cardOpenMode,
188
+ size: props.cardPopupSize,
189
+ popupTemplateUid: props.cardPopupTemplateUid,
190
+ pageModelClass: props.cardPopupPageModelClass,
191
+ uid: props.cardPopupTargetUid
192
+ });
193
+ const normalized = normalizeInitialKanbanPopupSettings(rawSettings);
194
+ return Object.keys(normalized).length ? normalized : void 0;
195
+ }
130
196
  const JS_ACTION_DEFAULT_CODE_BY_USE = {
131
197
  JSCollectionActionModel: [
132
198
  "const rows = ctx.resource?.getSelectedRows?.() || [];",
@@ -217,7 +283,7 @@ function buildSyntheticRootPageTabModel(options) {
217
283
  };
218
284
  }
219
285
  function buildBlockTree(options) {
220
- var _a, _b;
286
+ var _a, _b, _c, _d;
221
287
  const use = (0, import_catalog.resolveSupportedBlockCatalogItem)(
222
288
  {
223
289
  type: options.type,
@@ -266,6 +332,9 @@ function buildBlockTree(options) {
266
332
  } else if (Object.keys(normalizedResourceInit).length) {
267
333
  import_lodash.default.set(baseStepParams, ["resourceSettings", "init"], normalizedResourceInit);
268
334
  }
335
+ if (options.enableDefaultSorting) {
336
+ applyDefaultSortingIfMissing(baseStepParams, use);
337
+ }
269
338
  const model = {
270
339
  ...use === "CalendarBlockModel" || use === "KanbanBlockModel" ? { uid: (0, import_utils.uid)() } : {},
271
340
  use,
@@ -365,10 +434,38 @@ function buildBlockTree(options) {
365
434
  } else if (use === "KanbanBlockModel") {
366
435
  const blockUid = model.uid || (0, import_utils.uid)();
367
436
  model.uid = blockUid;
437
+ const quickCreatePopupSettings = resolvePersistableModelStepParamsOrLegacyObject(
438
+ model,
439
+ ["kanbanSettings", "popup"],
440
+ (_a = model.props) == null ? void 0 : _a.quickCreatePopupSettings
441
+ ) || normalizeInitialKanbanPopupSettingsFromProps(KANBAN_QUICK_CREATE_ACTION_KEY, model.props);
442
+ const cardPopupSettings = extractPersistableModelStepParamsOrLegacyObject(
443
+ model,
444
+ KANBAN_BLOCK_CARD_POPUP_STEP_PARAMS_PATH,
445
+ (_b = model.props) == null ? void 0 : _b.cardPopupSettings
446
+ ) || normalizeInitialKanbanPopupSettingsFromProps(KANBAN_CARD_VIEW_ACTION_KEY, model.props);
447
+ persistModelPopupStepParams(model, ["kanbanSettings", "popup"], quickCreatePopupSettings);
448
+ if (model.props) {
449
+ delete model.props.quickCreatePopupSettings;
450
+ delete model.props.cardPopupSettings;
451
+ for (const propKey of KANBAN_LEGACY_QUICK_CREATE_POPUP_PROP_KEYS) {
452
+ delete model.props[propKey];
453
+ }
454
+ for (const propKey of KANBAN_LEGACY_PARENT_CARD_POPUP_PROP_KEYS) {
455
+ delete model.props[propKey];
456
+ }
457
+ }
368
458
  model.subModels = {
369
459
  item: {
370
460
  uid: (0, import_utils.uid)(),
371
461
  use: "KanbanCardItemModel",
462
+ ...cardPopupSettings && import_lodash.default.isPlainObject(cardPopupSettings) ? {
463
+ stepParams: {
464
+ cardSettings: {
465
+ popup: import_lodash.default.cloneDeep(cardPopupSettings)
466
+ }
467
+ }
468
+ } : {},
372
469
  subModels: {
373
470
  grid: {
374
471
  uid: (0, import_utils.uid)(),
@@ -379,29 +476,47 @@ function buildBlockTree(options) {
379
476
  [KANBAN_QUICK_CREATE_ACTION_KEY]: buildKanbanPopupActionNode({
380
477
  actionKey: KANBAN_QUICK_CREATE_ACTION_KEY,
381
478
  blockUid,
382
- resourceInit: normalizedResourceInit
479
+ resourceInit: normalizedResourceInit,
480
+ popupSettings: quickCreatePopupSettings
383
481
  }),
384
482
  [KANBAN_CARD_VIEW_ACTION_KEY]: buildKanbanPopupActionNode({
385
483
  actionKey: KANBAN_CARD_VIEW_ACTION_KEY,
386
484
  blockUid,
387
- resourceInit: normalizedResourceInit
485
+ resourceInit: normalizedResourceInit,
486
+ popupSettings: cardPopupSettings
388
487
  })
389
488
  };
390
489
  } else if (use === "CalendarBlockModel") {
391
490
  const blockUid = model.uid || (0, import_utils.uid)();
392
491
  model.uid = blockUid;
492
+ const quickCreatePopupSettings = resolveModelStepParamsOrLegacyObject(
493
+ model,
494
+ ["calendarSettings", "quickCreatePopupSettings"],
495
+ (_c = model.props) == null ? void 0 : _c.quickCreatePopupSettings
496
+ );
497
+ const eventPopupSettings = resolveModelStepParamsOrLegacyObject(
498
+ model,
499
+ ["calendarSettings", "eventPopupSettings"],
500
+ (_d = model.props) == null ? void 0 : _d.eventPopupSettings
501
+ );
502
+ persistModelPopupStepParams(model, ["calendarSettings", "quickCreatePopupSettings"], quickCreatePopupSettings);
503
+ persistModelPopupStepParams(model, ["calendarSettings", "eventPopupSettings"], eventPopupSettings);
504
+ if (model.props) {
505
+ delete model.props.quickCreatePopupSettings;
506
+ delete model.props.eventPopupSettings;
507
+ }
393
508
  model.subModels = {
394
509
  [CALENDAR_QUICK_CREATE_ACTION_KEY]: buildCalendarPopupActionNode({
395
510
  actionKey: CALENDAR_QUICK_CREATE_ACTION_KEY,
396
511
  blockUid,
397
512
  resourceInit: normalizedResourceInit,
398
- popupSettings: (_a = model.props) == null ? void 0 : _a.quickCreatePopupSettings
513
+ popupSettings: quickCreatePopupSettings
399
514
  }),
400
515
  [CALENDAR_EVENT_VIEW_ACTION_KEY]: buildCalendarPopupActionNode({
401
516
  actionKey: CALENDAR_EVENT_VIEW_ACTION_KEY,
402
517
  blockUid,
403
518
  resourceInit: normalizedResourceInit,
404
- popupSettings: (_b = model.props) == null ? void 0 : _b.eventPopupSettings
519
+ popupSettings: eventPopupSettings
405
520
  })
406
521
  };
407
522
  }
@@ -424,29 +539,12 @@ function buildKanbanPopupActionNode(options) {
424
539
  };
425
540
  }
426
541
  function buildKanbanPopupOpenView(options) {
427
- var _a, _b, _c;
428
- const defaults = import_lodash.default.pickBy(
429
- {
430
- mode: "drawer",
431
- size: "medium",
432
- pageModelClass: "ChildPageModel",
433
- uid: options.actionUid,
434
- collectionName: (_a = options.resourceInit) == null ? void 0 : _a.collectionName,
435
- dataSourceKey: ((_b = options.resourceInit) == null ? void 0 : _b.dataSourceKey) || (((_c = options.resourceInit) == null ? void 0 : _c.collectionName) ? "main" : void 0)
436
- },
437
- (value) => !import_lodash.default.isUndefined(value)
438
- );
439
- const current = import_lodash.default.cloneDeep(options.popupSettings || {});
440
- return import_lodash.default.pickBy(
441
- {
442
- ...defaults,
443
- ...current,
444
- uid: current.uid || defaults.uid,
445
- collectionName: current.collectionName || defaults.collectionName,
446
- dataSourceKey: current.dataSourceKey || defaults.dataSourceKey
447
- },
448
- (value) => !import_lodash.default.isUndefined(value)
449
- );
542
+ return (0, import_hidden_popup_contract.buildHiddenPopupOpenView)({
543
+ actionUid: options.actionUid,
544
+ resourceInit: options.resourceInit,
545
+ popupSettings: options.popupSettings,
546
+ normalizePopupSettings: normalizeInitialKanbanPopupSettings
547
+ });
450
548
  }
451
549
  function buildCalendarPopupActionNode(options) {
452
550
  const actionUid = `${options.blockUid}-${options.actionKey}`;
@@ -465,29 +563,7 @@ function buildCalendarPopupActionNode(options) {
465
563
  };
466
564
  }
467
565
  function buildCalendarPopupOpenView(options) {
468
- var _a, _b, _c;
469
- const defaults = import_lodash.default.pickBy(
470
- {
471
- mode: "drawer",
472
- size: "medium",
473
- pageModelClass: "ChildPageModel",
474
- uid: options.actionUid,
475
- collectionName: (_a = options.resourceInit) == null ? void 0 : _a.collectionName,
476
- dataSourceKey: ((_b = options.resourceInit) == null ? void 0 : _b.dataSourceKey) || (((_c = options.resourceInit) == null ? void 0 : _c.collectionName) ? "main" : void 0)
477
- },
478
- (value) => !import_lodash.default.isUndefined(value)
479
- );
480
- const current = import_lodash.default.cloneDeep(options.popupSettings || {});
481
- return import_lodash.default.pickBy(
482
- {
483
- ...defaults,
484
- ...current,
485
- uid: current.uid || defaults.uid,
486
- collectionName: current.collectionName || defaults.collectionName,
487
- dataSourceKey: current.dataSourceKey || defaults.dataSourceKey
488
- },
489
- (value) => !import_lodash.default.isUndefined(value)
490
- );
566
+ return (0, import_hidden_popup_contract.buildHiddenPopupOpenView)(options);
491
567
  }
492
568
  function buildPopupPageTree(options) {
493
569
  const pageUid = options.pageUid || (0, import_utils.uid)();
@@ -855,8 +931,10 @@ function inferActionDefaultProps(use, scope) {
855
931
  icon: "DownOutlined"
856
932
  },
857
933
  BulkDeleteActionModel: {
858
- title: '{{t("Delete")}}',
859
- icon: "DeleteOutlined"
934
+ title: "",
935
+ tooltip: '{{t("Delete")}}',
936
+ icon: "DeleteOutlined",
937
+ position: "right"
860
938
  },
861
939
  BulkEditActionModel: {
862
940
  title: '{{t("Bulk edit")}}',
@@ -995,6 +1073,27 @@ function applyContainerActionStyle(props, containerUse) {
995
1073
  }
996
1074
  return props;
997
1075
  }
1076
+ const BLOCK_DEFAULT_SORTING_PATH_BY_USE = {
1077
+ KanbanBlockModel: ["kanbanSettings", "defaultSorting", "sort"],
1078
+ TreeBlockModel: ["treeSettings", "defaultSorting", "sort"],
1079
+ TableBlockModel: ["tableSettings", "defaultSorting", "sort"],
1080
+ DetailsBlockModel: ["detailsSettings", "defaultSorting", "sort"],
1081
+ ListBlockModel: ["listSettings", "defaultSorting", "sort"],
1082
+ GridCardBlockModel: ["GridCardSettings", "defaultSorting", "sort"],
1083
+ MapBlockModel: ["createMapBlock", "lineSort", "sort"]
1084
+ };
1085
+ function applyDefaultSortingIfMissing(stepParams, use) {
1086
+ const path = BLOCK_DEFAULT_SORTING_PATH_BY_USE[use];
1087
+ if (!path) {
1088
+ return;
1089
+ }
1090
+ const currentSorting = import_lodash.default.get(stepParams, path);
1091
+ if (Array.isArray(currentSorting) || import_lodash.default.isNull(currentSorting) || import_lodash.default.isUndefined(currentSorting)) {
1092
+ if (!import_lodash.default.has(stepParams, path) || import_lodash.default.isNull(currentSorting) || import_lodash.default.isUndefined(currentSorting)) {
1093
+ import_lodash.default.set(stepParams, path, import_lodash.default.cloneDeep(import_public_compatibility.FLOW_SURFACE_DEFAULT_SORTING));
1094
+ }
1095
+ }
1096
+ }
998
1097
  function buildBlockDefaults(use) {
999
1098
  if (use === "JSBlockModel") {
1000
1099
  return {
@@ -1060,6 +1159,21 @@ function buildBlockDefaults(use) {
1060
1159
  }
1061
1160
  };
1062
1161
  }
1162
+ if (use === "TableBlockModel") {
1163
+ return {};
1164
+ }
1165
+ if (use === "DetailsBlockModel") {
1166
+ return {};
1167
+ }
1168
+ if (use === "ListBlockModel") {
1169
+ return {};
1170
+ }
1171
+ if (use === "GridCardBlockModel") {
1172
+ return {};
1173
+ }
1174
+ if (use === "MapBlockModel") {
1175
+ return {};
1176
+ }
1063
1177
  return {};
1064
1178
  }
1065
1179
  function getStandaloneFieldDefaults(use) {
@@ -154,7 +154,7 @@ const OPEN_VIEW_PATH_SCHEMAS = {
154
154
  "openView.tryTemplate": BOOLEAN_SCHEMA
155
155
  };
156
156
  const CONFIRM_ALLOWED_PATHS = ["confirm.enable", "confirm.title", "confirm.content"];
157
- const TABLE_COLUMN_ALLOWED_PATHS = ["title.title"];
157
+ const TABLE_COLUMN_ALLOWED_PATHS = ["title.title", "fieldNames.label"];
158
158
  const FILTER_FORM_ITEM_ALLOWED_PATHS = [
159
159
  "init.defaultTargetUid",
160
160
  "init.filterField.name",
@@ -327,6 +327,8 @@ const CALENDAR_SETTINGS_GROUP = {
327
327
  "quickCreateEvent.enableQuickCreateEvent",
328
328
  "showLunar.showLunar",
329
329
  "weekStart.weekStart",
330
+ "quickCreatePopupSettings",
331
+ "eventPopupSettings",
330
332
  "dataScope.filter",
331
333
  "linkageRules.value"
332
334
  ],
@@ -342,6 +344,8 @@ const CALENDAR_SETTINGS_GROUP = {
342
344
  "quickCreateEvent.enableQuickCreateEvent": BOOLEAN_SCHEMA,
343
345
  "showLunar.showLunar": BOOLEAN_SCHEMA,
344
346
  "weekStart.weekStart": NUMBER_SCHEMA,
347
+ quickCreatePopupSettings: OBJECT_SCHEMA,
348
+ eventPopupSettings: OBJECT_SCHEMA,
345
349
  "dataScope.filter": FILTER_GROUP_SCHEMA,
346
350
  "linkageRules.value": ARRAY_SCHEMA
347
351
  }
@@ -390,8 +394,20 @@ const KANBAN_SETTINGS_GROUP = {
390
394
  "popup.mode",
391
395
  "popup.size",
392
396
  "popup.popupTemplateUid",
397
+ "popup.popupTemplateContext",
398
+ "popup.popupTemplateMode",
399
+ "popup.popupTemplateHasFilterByTk",
400
+ "popup.popupTemplateHasSourceId",
393
401
  "popup.pageModelClass",
394
402
  "popup.uid",
403
+ "popup.collectionName",
404
+ "popup.dataSourceKey",
405
+ "popup.associationName",
406
+ "popup.filterByTk",
407
+ "popup.sourceId",
408
+ "popup.title",
409
+ "popup.template",
410
+ "popup.tryTemplate",
395
411
  "pageSize.pageSize",
396
412
  "columnWidth.columnWidth",
397
413
  "dataScope.filter"
@@ -412,8 +428,20 @@ const KANBAN_SETTINGS_GROUP = {
412
428
  "popup.mode": STRING_SCHEMA,
413
429
  "popup.size": STRING_SCHEMA,
414
430
  "popup.popupTemplateUid": NULLABLE_STRING_SCHEMA,
431
+ "popup.popupTemplateContext": BOOLEAN_SCHEMA,
432
+ "popup.popupTemplateMode": STRING_SCHEMA,
433
+ "popup.popupTemplateHasFilterByTk": BOOLEAN_SCHEMA,
434
+ "popup.popupTemplateHasSourceId": BOOLEAN_SCHEMA,
415
435
  "popup.pageModelClass": NULLABLE_STRING_SCHEMA,
416
436
  "popup.uid": NULLABLE_STRING_SCHEMA,
437
+ "popup.collectionName": STRING_SCHEMA,
438
+ "popup.dataSourceKey": STRING_SCHEMA,
439
+ "popup.associationName": NULLABLE_STRING_SCHEMA,
440
+ "popup.filterByTk": STRING_SCHEMA,
441
+ "popup.sourceId": STRING_SCHEMA,
442
+ "popup.title": STRING_SCHEMA,
443
+ "popup.template": OBJECT_SCHEMA,
444
+ "popup.tryTemplate": BOOLEAN_SCHEMA,
417
445
  "pageSize.pageSize": NUMBER_SCHEMA,
418
446
  "columnWidth.columnWidth": NUMBER_SCHEMA,
419
447
  "dataScope.filter": FILTER_GROUP_SCHEMA
@@ -1141,8 +1169,20 @@ KANBAN_CARD_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1141
1169
  "popup.mode",
1142
1170
  "popup.size",
1143
1171
  "popup.popupTemplateUid",
1172
+ "popup.popupTemplateContext",
1173
+ "popup.popupTemplateMode",
1174
+ "popup.popupTemplateHasFilterByTk",
1175
+ "popup.popupTemplateHasSourceId",
1144
1176
  "popup.pageModelClass",
1145
1177
  "popup.uid",
1178
+ "popup.collectionName",
1179
+ "popup.dataSourceKey",
1180
+ "popup.associationName",
1181
+ "popup.filterByTk",
1182
+ "popup.sourceId",
1183
+ "popup.title",
1184
+ "popup.template",
1185
+ "popup.tryTemplate",
1146
1186
  "layout.layout",
1147
1187
  "layout.labelAlign",
1148
1188
  "layout.labelWidth",
@@ -1157,8 +1197,20 @@ KANBAN_CARD_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1157
1197
  "popup.mode": STRING_SCHEMA,
1158
1198
  "popup.size": STRING_SCHEMA,
1159
1199
  "popup.popupTemplateUid": NULLABLE_STRING_SCHEMA,
1200
+ "popup.popupTemplateContext": BOOLEAN_SCHEMA,
1201
+ "popup.popupTemplateMode": STRING_SCHEMA,
1202
+ "popup.popupTemplateHasFilterByTk": BOOLEAN_SCHEMA,
1203
+ "popup.popupTemplateHasSourceId": BOOLEAN_SCHEMA,
1160
1204
  "popup.pageModelClass": NULLABLE_STRING_SCHEMA,
1161
1205
  "popup.uid": NULLABLE_STRING_SCHEMA,
1206
+ "popup.collectionName": STRING_SCHEMA,
1207
+ "popup.dataSourceKey": STRING_SCHEMA,
1208
+ "popup.associationName": NULLABLE_STRING_SCHEMA,
1209
+ "popup.filterByTk": STRING_SCHEMA,
1210
+ "popup.sourceId": STRING_SCHEMA,
1211
+ "popup.title": STRING_SCHEMA,
1212
+ "popup.template": OBJECT_SCHEMA,
1213
+ "popup.tryTemplate": BOOLEAN_SCHEMA,
1162
1214
  "layout.layout": STRING_SCHEMA,
1163
1215
  "layout.labelAlign": STRING_SCHEMA,
1164
1216
  "layout.labelWidth": NULLABLE_NUMBER_OR_STRING_SCHEMA,
@@ -1381,7 +1433,8 @@ ACTION_COLUMN_CONTRACT.domains.stepParams = groupedDomain({
1381
1433
  allowedPaths: TABLE_COLUMN_ALLOWED_PATHS,
1382
1434
  mergeStrategy: "deep",
1383
1435
  pathSchemas: {
1384
- "title.title": STRING_SCHEMA
1436
+ "title.title": STRING_SCHEMA,
1437
+ "fieldNames.label": STRING_SCHEMA
1385
1438
  }
1386
1439
  }
1387
1440
  });
@@ -1485,6 +1538,7 @@ TABLE_COLUMN_CONTRACT.domains.stepParams = groupedDomain({
1485
1538
  mergeStrategy: "deep",
1486
1539
  pathSchemas: {
1487
1540
  "title.title": STRING_SCHEMA,
1541
+ "fieldNames.label": STRING_SCHEMA,
1488
1542
  "model.use": STRING_SCHEMA
1489
1543
  }
1490
1544
  }
@@ -1508,7 +1562,8 @@ JS_COLUMN_CONTRACT.domains.stepParams = groupedDomain({
1508
1562
  allowedPaths: TABLE_COLUMN_ALLOWED_PATHS,
1509
1563
  mergeStrategy: "deep",
1510
1564
  pathSchemas: {
1511
- "title.title": STRING_SCHEMA
1565
+ "title.title": STRING_SCHEMA,
1566
+ "fieldNames.label": STRING_SCHEMA
1512
1567
  }
1513
1568
  },
1514
1569
  jsSettings: RUN_JS_SETTINGS_GROUP
@@ -678,6 +678,10 @@ function getActionConfigureOptionsByUse(use) {
678
678
  case "ViewActionModel":
679
679
  case "EditActionModel":
680
680
  case "PopupCollectionActionModel":
681
+ case "CalendarQuickCreateActionModel":
682
+ case "CalendarEventViewActionModel":
683
+ case "KanbanQuickCreateActionModel":
684
+ case "KanbanCardViewActionModel":
681
685
  case "UploadActionModel":
682
686
  return merged(ACTION_OPEN_VIEW_OPTIONS, ACTION_LINKAGE_OPTIONS);
683
687
  case "DeleteActionModel":
@@ -47,6 +47,8 @@ const FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY = "__flowSurfac
47
47
  const FLOW_SURFACE_DEFAULT_BLOCK_ACTIONS = {
48
48
  table: [
49
49
  { type: "filter", scope: "actions" },
50
+ { type: "refresh", scope: "actions" },
51
+ { type: "bulkDelete", scope: "actions" },
50
52
  {
51
53
  type: "addNew",
52
54
  scope: "actions",
@@ -54,11 +56,11 @@ const FLOW_SURFACE_DEFAULT_BLOCK_ACTIONS = {
54
56
  tryTemplate: true,
55
57
  [FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY]: true
56
58
  }
57
- },
58
- { type: "refresh", scope: "actions" }
59
+ }
59
60
  ],
60
61
  list: [
61
62
  { type: "filter", scope: "actions" },
63
+ { type: "refresh", scope: "actions" },
62
64
  {
63
65
  type: "addNew",
64
66
  scope: "actions",
@@ -66,11 +68,11 @@ const FLOW_SURFACE_DEFAULT_BLOCK_ACTIONS = {
66
68
  tryTemplate: true,
67
69
  [FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY]: true
68
70
  }
69
- },
70
- { type: "refresh", scope: "actions" }
71
+ }
71
72
  ],
72
73
  gridCard: [
73
74
  { type: "filter", scope: "actions" },
75
+ { type: "refresh", scope: "actions" },
74
76
  {
75
77
  type: "addNew",
76
78
  scope: "actions",
@@ -78,11 +80,11 @@ const FLOW_SURFACE_DEFAULT_BLOCK_ACTIONS = {
78
80
  tryTemplate: true,
79
81
  [FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY]: true
80
82
  }
81
- },
82
- { type: "refresh", scope: "actions" }
83
+ }
83
84
  ],
84
85
  calendar: [
85
86
  { type: "filter", scope: "actions" },
87
+ { type: "refresh", scope: "actions" },
86
88
  {
87
89
  type: "addNew",
88
90
  scope: "actions",
@@ -90,11 +92,11 @@ const FLOW_SURFACE_DEFAULT_BLOCK_ACTIONS = {
90
92
  tryTemplate: true,
91
93
  [FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY]: true
92
94
  }
93
- },
94
- { type: "refresh", scope: "actions" }
95
+ }
95
96
  ],
96
97
  kanban: [
97
98
  { type: "filter", scope: "actions" },
99
+ { type: "refresh", scope: "actions" },
98
100
  {
99
101
  type: "addNew",
100
102
  scope: "actions",
@@ -102,8 +104,7 @@ const FLOW_SURFACE_DEFAULT_BLOCK_ACTIONS = {
102
104
  tryTemplate: true,
103
105
  [FLOW_SURFACE_INTERNAL_AUTO_SAVE_DEFAULT_POPUP_TEMPLATE_KEY]: true
104
106
  }
105
- },
106
- { type: "refresh", scope: "actions" }
107
+ }
107
108
  ],
108
109
  createForm: [{ type: "submit", scope: "actions" }],
109
110
  editForm: [{ type: "submit", scope: "actions" }],
@@ -0,0 +1,86 @@
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 _ from 'lodash';
10
+ export declare const CALENDAR_POPUP_ACTION_KEYS: readonly ["quickCreateAction", "eventViewAction"];
11
+ export type CalendarPopupActionKey = (typeof CALENDAR_POPUP_ACTION_KEYS)[number];
12
+ export declare const CALENDAR_POPUP_PROP_KEYS: readonly ["quickCreatePopupSettings", "eventPopupSettings"];
13
+ export type HiddenPopupOpenViewNormalizer = (actionName: string, value: any, options: {
14
+ transaction?: any;
15
+ popupTemplateHostUid?: string;
16
+ popupActionContext?: {
17
+ hasCurrentRecord?: boolean;
18
+ };
19
+ }) => Promise<Record<string, any> | undefined> | Record<string, any> | undefined;
20
+ export type HiddenPopupTemplateOpenViewBuilder = (input: {
21
+ actionName: string;
22
+ actionUid: string;
23
+ openView: Record<string, any>;
24
+ popupSettings?: Record<string, any>;
25
+ existingHost?: any;
26
+ transaction?: any;
27
+ hasCurrentRecord?: boolean;
28
+ normalizePopupSettings: (popupSettings?: Record<string, any>) => Record<string, any>;
29
+ mergeDisplaySettings: (openView: Record<string, any>, popupSettings?: Record<string, any>, fallbackOpenView?: Record<string, any> | null) => Record<string, any>;
30
+ }) => Promise<Record<string, any>> | Record<string, any>;
31
+ export type HiddenPopupHostDefaultContentEnsurer = (input: {
32
+ actionName: string;
33
+ actionUid: string;
34
+ popupSettings?: Record<string, any>;
35
+ transaction?: any;
36
+ hasCurrentRecord?: boolean;
37
+ mergeDisplaySettings: (openView: Record<string, any>, popupSettings?: Record<string, any>, fallbackOpenView?: Record<string, any> | null) => Record<string, any>;
38
+ }) => Promise<boolean> | boolean;
39
+ export type HiddenPopupHostRuntime = {
40
+ repository: {
41
+ findModelById: (uid: string, options?: any) => Promise<any>;
42
+ patch: (payload: Record<string, any>, options?: any) => Promise<any>;
43
+ upsertModel: (payload: Record<string, any>, options?: any) => Promise<any>;
44
+ };
45
+ buildPopupOpenViewWithTemplate: HiddenPopupTemplateOpenViewBuilder;
46
+ clearFlowTemplateUsagesForNodeTree: (uid: string, transaction?: any) => Promise<any>;
47
+ ensurePopupHostDefaultContent: HiddenPopupHostDefaultContentEnsurer;
48
+ reconcilePopupOpenViewTransition: (uid: string, currentOpenView: Record<string, any> | null | undefined, nextOpenView: Record<string, any>, transaction?: any) => Promise<any>;
49
+ removeNodeTreeWithBindings: (uid: string, transaction?: any) => Promise<any>;
50
+ syncFlowTemplateUsagesForNodeTree: (uid: string, transaction?: any) => Promise<any>;
51
+ };
52
+ export declare function normalizeCalendarPopupSettings(actionKey: CalendarPopupActionKey, popupSettings?: Record<string, any>): Record<string, any>;
53
+ export declare function getCalendarPopupActionUse(actionKey: CalendarPopupActionKey): "CalendarQuickCreateActionModel" | "CalendarEventViewActionModel";
54
+ export declare function getCalendarPopupPropKey(actionKey: CalendarPopupActionKey): "quickCreatePopupSettings" | "eventPopupSettings";
55
+ export declare function getCalendarPopupActionUid(calendarUid: string, actionKey: CalendarPopupActionKey): string;
56
+ export declare function getCalendarBlockResourceInit(blockNode: any): any;
57
+ export declare function getCalendarPopupStoredSettings(blockNode: any, actionKey: CalendarPopupActionKey): Record<string, any>;
58
+ export declare function replaceCalendarStoredPopupSettings(runtime: Pick<HiddenPopupHostRuntime, 'repository'>, blockNode: any, actionKey: CalendarPopupActionKey, popupSettings: Record<string, any>, transaction?: any): Promise<void>;
59
+ export declare function buildCalendarInitialStepParams(input: {
60
+ stepParams?: Record<string, any>;
61
+ props?: Record<string, any>;
62
+ settings?: Record<string, any>;
63
+ }): Record<string, any>;
64
+ export declare function buildCalendarPopupOpenView(input: {
65
+ blockNode: any;
66
+ actionKey: CalendarPopupActionKey;
67
+ resourceInit?: Record<string, any>;
68
+ popupSettings?: Record<string, any>;
69
+ }): _.Dictionary<any>;
70
+ export declare function mergeCalendarPopupSettings(actionKey: CalendarPopupActionKey, current: any, value: any): Record<string, any>;
71
+ export declare function stripCalendarPopupTargetSettingsForResourceChange(actionKey: CalendarPopupActionKey, popupSettings?: Record<string, any>): Record<string, any>;
72
+ export declare function normalizeCalendarPopupConfigureValue(input: {
73
+ actionName: string;
74
+ blockUid: string;
75
+ actionKey: CalendarPopupActionKey;
76
+ value: any;
77
+ transaction?: any;
78
+ normalizeOpenView: HiddenPopupOpenViewNormalizer;
79
+ }): Promise<Record<string, any>>;
80
+ export declare function normalizeCalendarInlineSettingsForConfigure(settings?: Record<string, any>): Record<string, any>;
81
+ export declare function resolveCalendarInitialPopupOverride(settings: Record<string, any> | undefined, primaryKey: 'quickCreatePopup' | 'eventPopup', legacyKey: 'quickCreatePopupSettings' | 'eventPopupSettings'): any;
82
+ export declare function ensureCalendarBlockPopupHosts(runtime: HiddenPopupHostRuntime, blockNode: any, transaction?: any, popupSettingsOverrides?: Partial<Record<CalendarPopupActionKey, Record<string, any> | undefined>>, options?: {
83
+ displayFallbackOpenViews?: Partial<Record<CalendarPopupActionKey, Record<string, any> | undefined>>;
84
+ }): Promise<any>;
85
+ export declare function projectCalendarBlockPopupHosts<T = any>(node: T): T;
86
+ export declare function projectCalendarBlockPopupHostsInTree<T = any>(node: T): T;