@nocobase/plugin-flow-engine 2.1.0-alpha.29 → 2.1.0-alpha.30

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.
@@ -36,6 +36,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
  var public_compatibility_exports = {};
38
38
  __export(public_compatibility_exports, {
39
+ FLOW_SURFACE_DEFAULT_SORTING: () => FLOW_SURFACE_DEFAULT_SORTING,
40
+ normalizeFlowSurfaceDefaultSorting: () => normalizeFlowSurfaceDefaultSorting,
41
+ normalizeFlowSurfaceEmptySortingAsDefault: () => normalizeFlowSurfaceEmptySortingAsDefault,
39
42
  normalizeFlowSurfacePublicSortingAlias: () => normalizeFlowSurfacePublicSortingAlias
40
43
  });
41
44
  module.exports = __toCommonJS(public_compatibility_exports);
@@ -43,6 +46,7 @@ var import_lodash = __toESM(require("lodash"));
43
46
  var import_configure_options = require("./configure-options");
44
47
  var import_errors = require("./errors");
45
48
  var import_support_matrix = require("./support-matrix");
49
+ const FLOW_SURFACE_DEFAULT_SORTING = [{ field: "createdAt", direction: "desc" }];
46
50
  function resolveBlockUse(input) {
47
51
  var _a;
48
52
  const explicitUse = String(input.use || "").trim();
@@ -105,6 +109,21 @@ function normalizeSortingArray(input, context) {
105
109
  }
106
110
  return input.map((item, index) => normalizeSortingEntry(item, `${context}[${index}]`));
107
111
  }
112
+ function normalizeFlowSurfaceDefaultSorting(input, context) {
113
+ if (Array.isArray(input)) {
114
+ return normalizeSortingArray(input, context);
115
+ }
116
+ if (import_lodash.default.isUndefined(input) || import_lodash.default.isNull(input)) {
117
+ return import_lodash.default.cloneDeep(FLOW_SURFACE_DEFAULT_SORTING);
118
+ }
119
+ (0, import_errors.throwBadRequest)(`${context} must be an array`);
120
+ }
121
+ function normalizeFlowSurfaceEmptySortingAsDefault(input, context) {
122
+ if (Array.isArray(input) && !input.length) {
123
+ return import_lodash.default.cloneDeep(FLOW_SURFACE_DEFAULT_SORTING);
124
+ }
125
+ return normalizeFlowSurfaceDefaultSorting(input, context);
126
+ }
108
127
  function normalizeFlowSurfacePublicSortingAlias(input) {
109
128
  if (import_lodash.default.isUndefined(input.settings)) {
110
129
  return input.settings;
@@ -120,9 +139,9 @@ function normalizeFlowSurfacePublicSortingAlias(input) {
120
139
  return input.settings;
121
140
  }
122
141
  const nextSettings = import_lodash.default.cloneDeep(input.settings);
123
- const sortingFromSort = normalizeSortingArray(nextSettings.sort, `${input.context}.sort`);
142
+ const sortingFromSort = normalizeFlowSurfaceDefaultSorting(nextSettings.sort, `${input.context}.sort`);
124
143
  if (Object.prototype.hasOwnProperty.call(nextSettings, "sorting")) {
125
- const canonicalSorting = normalizeSortingArray(nextSettings.sorting, `${input.context}.sorting`);
144
+ const canonicalSorting = normalizeFlowSurfaceDefaultSorting(nextSettings.sorting, `${input.context}.sorting`);
126
145
  if (!import_lodash.default.isEqual(sortingFromSort, canonicalSorting)) {
127
146
  (0, import_errors.throwBadRequest)(`${input.context}.sort conflicts with ${input.context}.sorting; use canonical sorting`);
128
147
  }
@@ -135,5 +154,8 @@ function normalizeFlowSurfacePublicSortingAlias(input) {
135
154
  }
136
155
  // Annotate the CommonJS export names for ESM import in node:
137
156
  0 && (module.exports = {
157
+ FLOW_SURFACE_DEFAULT_SORTING,
158
+ normalizeFlowSurfaceDefaultSorting,
159
+ normalizeFlowSurfaceEmptySortingAsDefault,
138
160
  normalizeFlowSurfacePublicSortingAlias
139
161
  });
@@ -99,6 +99,7 @@ export declare class FlowSurfacesService {
99
99
  private buildPopupBlockResourceBindings;
100
100
  private listPopupAssociatedRecordFields;
101
101
  private resolvePopupBlockProfile;
102
+ private resolvePopupCurrentRecordResourceFilterByTk;
102
103
  private resolvePopupAssociationFields;
103
104
  private findPopupHostNode;
104
105
  private getBlockKeyByUse;
@@ -230,6 +231,9 @@ export declare class FlowSurfacesService {
230
231
  private inferSaveTemplateTarget;
231
232
  private createFlowTemplateReferenceBlockModel;
232
233
  private buildPopupTemplateReferenceOpenView;
234
+ private shouldHydrateDetachedPopupTemplateBlockResourceContext;
235
+ private collectDetachedPopupTemplateBlockResourceContextPatches;
236
+ private hydrateDetachedPopupTemplateBlockResourceContext;
233
237
  private hydrateDetachedPopupTemplateSourceContext;
234
238
  private clearFlowTemplateUsagesByModelUids;
235
239
  private clearFlowTemplateUsagesForNodeTree;
@@ -437,6 +441,9 @@ export declare class FlowSurfacesService {
437
441
  private validateComposePopupTemplateAliases;
438
442
  private validateApplyBlueprintPopupTemplateAliases;
439
443
  private normalizeInlineSettings;
444
+ private shouldEnableCreatedAtDefaultSorting;
445
+ private normalizeBlockSortingInput;
446
+ private normalizeMapSortingInput;
440
447
  private normalizeInlinePopup;
441
448
  private normalizePopupSaveAsTemplate;
442
449
  private hasInlinePopupSaveAsTemplateSource;
@@ -468,6 +475,7 @@ export declare class FlowSurfacesService {
468
475
  private getDefaultFlowTemplateSort;
469
476
  private getPopupTryTemplateExpectedAssociationName;
470
477
  private getPopupTryTemplatePriority;
478
+ private shouldRequireExactPopupTryTemplateAssociation;
471
479
  private getRequestedPopupDefaultType;
472
480
  private getPopupTryTemplateAllowedDefaultTypes;
473
481
  private inferPopupDefaultTypeFromTemplateTree;
@@ -554,6 +562,7 @@ export declare class FlowSurfacesService {
554
562
  private replaceExplicitPopupStepParamSubtreesForUpdateSettings;
555
563
  private normalizePopupStepParamReplacementForUpdateSettings;
556
564
  private stripPopupPropsFromPayload;
565
+ private syncDefaultSortingForUpdateSettings;
557
566
  private syncKanbanPopupPropsForUpdateSettings;
558
567
  private syncFilterActionSettingsForUpdateSettings;
559
568
  private syncMirroredStepParamsForUpdateSettings;
@@ -652,10 +661,15 @@ export declare class FlowSurfacesService {
652
661
  private resolveComposeBlockActionCatalogItem;
653
662
  private resolveComposeRecordActionCatalogItem;
654
663
  private isAddChildCatalogItem;
664
+ private resolveTreeChildrenField;
665
+ private resolveTreeChildrenAssociationName;
655
666
  private isTreeCollection;
656
667
  private isTreeTableEnabled;
657
668
  private resolveAddChildOwnerNode;
669
+ private resolveAddChildOwnerResourceContext;
658
670
  private resolveOwnerCollectionForAddChild;
671
+ private resolveAddChildResourceInitForOwnerNode;
672
+ private normalizeAddChildOpenViewForAction;
659
673
  private canUseAddChildOnOwnerNode;
660
674
  private assertAddChildSupportedForOwnerNode;
661
675
  private filterTargetRecordActions;
@@ -854,6 +868,8 @@ export declare class FlowSurfacesService {
854
868
  private ensureFlowRoutePageSchemaShell;
855
869
  private removeFlowRoutePageSchemaShell;
856
870
  private normalizeDisplayFieldBinding;
871
+ private collectionFieldHasRequiredValidation;
872
+ private buildRequiredCollectionFieldFormWrapperDefaults;
857
873
  private getCollectionFieldOrBadRequest;
858
874
  private buildRelationTargetFieldInit;
859
875
  private buildRelationTargetTableColumnNode;