@nocobase/plugin-flow-engine 2.1.0-beta.23 → 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.
- package/dist/ai/ai-employees/nathan/index.js +1 -0
- package/dist/externalVersion.js +10 -10
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +2 -1
- package/dist/server/flow-surfaces/blueprint/compile-blocks.js +142 -22
- package/dist/server/flow-surfaces/blueprint/compile-plan.d.ts +2 -1
- package/dist/server/flow-surfaces/blueprint/compile-plan.js +8 -8
- package/dist/server/flow-surfaces/blueprint/normalize-document.js +5 -14
- package/dist/server/flow-surfaces/blueprint/private-utils.d.ts +0 -1
- package/dist/server/flow-surfaces/blueprint/private-utils.js +0 -3
- package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -1
- package/dist/server/flow-surfaces/builder.d.ts +1 -0
- package/dist/server/flow-surfaces/builder.js +167 -53
- package/dist/server/flow-surfaces/catalog.js +59 -3
- package/dist/server/flow-surfaces/compose-compiler.d.ts +0 -1
- package/dist/server/flow-surfaces/compose-compiler.js +0 -1
- package/dist/server/flow-surfaces/configure-options.js +4 -4
- package/dist/server/flow-surfaces/contract-guard.js +11 -3
- package/dist/server/flow-surfaces/default-block-actions.js +11 -10
- package/dist/server/flow-surfaces/field-type-resolver.d.ts +0 -1
- package/dist/server/flow-surfaces/field-type-resolver.js +3 -13
- package/dist/server/flow-surfaces/hidden-popup-calendar.d.ts +86 -0
- package/dist/server/flow-surfaces/hidden-popup-calendar.js +554 -0
- package/dist/server/flow-surfaces/hidden-popup-contract.d.ts +116 -0
- package/dist/server/flow-surfaces/hidden-popup-contract.js +611 -0
- package/dist/server/flow-surfaces/hidden-popup-kanban.d.ts +62 -0
- package/dist/server/flow-surfaces/hidden-popup-kanban.js +651 -0
- package/dist/server/flow-surfaces/placement.js +1 -0
- package/dist/server/flow-surfaces/public-compatibility.d.ts +28 -0
- package/dist/server/flow-surfaces/public-compatibility.js +161 -0
- package/dist/server/flow-surfaces/service-utils.d.ts +0 -1
- package/dist/server/flow-surfaces/service-utils.js +0 -6
- package/dist/server/flow-surfaces/service.d.ts +66 -10
- package/dist/server/flow-surfaces/service.js +1677 -795
- package/dist/swagger/flow-surfaces.d.ts +0 -29
- package/dist/swagger/flow-surfaces.js +8 -17
- package/dist/swagger/index.d.ts +0 -29
- package/package.json +2 -2
|
@@ -0,0 +1,554 @@
|
|
|
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
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var hidden_popup_calendar_exports = {};
|
|
38
|
+
__export(hidden_popup_calendar_exports, {
|
|
39
|
+
CALENDAR_POPUP_ACTION_KEYS: () => CALENDAR_POPUP_ACTION_KEYS,
|
|
40
|
+
CALENDAR_POPUP_PROP_KEYS: () => CALENDAR_POPUP_PROP_KEYS,
|
|
41
|
+
buildCalendarInitialStepParams: () => buildCalendarInitialStepParams,
|
|
42
|
+
buildCalendarPopupOpenView: () => buildCalendarPopupOpenView,
|
|
43
|
+
ensureCalendarBlockPopupHosts: () => ensureCalendarBlockPopupHosts,
|
|
44
|
+
getCalendarBlockResourceInit: () => getCalendarBlockResourceInit,
|
|
45
|
+
getCalendarPopupActionUid: () => getCalendarPopupActionUid,
|
|
46
|
+
getCalendarPopupActionUse: () => getCalendarPopupActionUse,
|
|
47
|
+
getCalendarPopupPropKey: () => getCalendarPopupPropKey,
|
|
48
|
+
getCalendarPopupStoredSettings: () => getCalendarPopupStoredSettings,
|
|
49
|
+
mergeCalendarPopupSettings: () => mergeCalendarPopupSettings,
|
|
50
|
+
normalizeCalendarInlineSettingsForConfigure: () => normalizeCalendarInlineSettingsForConfigure,
|
|
51
|
+
normalizeCalendarPopupConfigureValue: () => normalizeCalendarPopupConfigureValue,
|
|
52
|
+
normalizeCalendarPopupSettings: () => normalizeCalendarPopupSettings,
|
|
53
|
+
projectCalendarBlockPopupHosts: () => projectCalendarBlockPopupHosts,
|
|
54
|
+
projectCalendarBlockPopupHostsInTree: () => projectCalendarBlockPopupHostsInTree,
|
|
55
|
+
replaceCalendarStoredPopupSettings: () => replaceCalendarStoredPopupSettings,
|
|
56
|
+
resolveCalendarInitialPopupOverride: () => resolveCalendarInitialPopupOverride,
|
|
57
|
+
stripCalendarPopupTargetSettingsForResourceChange: () => stripCalendarPopupTargetSettingsForResourceChange
|
|
58
|
+
});
|
|
59
|
+
module.exports = __toCommonJS(hidden_popup_calendar_exports);
|
|
60
|
+
var import_lodash = __toESM(require("lodash"));
|
|
61
|
+
var import_service_utils = require("./service-utils");
|
|
62
|
+
var import_hidden_popup_contract = require("./hidden-popup-contract");
|
|
63
|
+
const CALENDAR_POPUP_ACTION_KEYS = ["quickCreateAction", "eventViewAction"];
|
|
64
|
+
const CALENDAR_POPUP_PROP_KEYS = ["quickCreatePopupSettings", "eventPopupSettings"];
|
|
65
|
+
function normalizeCalendarPopupSettings(actionKey, popupSettings) {
|
|
66
|
+
return (0, import_hidden_popup_contract.normalizeHiddenPopupSettings)(popupSettings, {
|
|
67
|
+
collectionOnly: actionKey === "quickCreateAction"
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function getCalendarPopupActionUse(actionKey) {
|
|
71
|
+
return actionKey === "quickCreateAction" ? "CalendarQuickCreateActionModel" : "CalendarEventViewActionModel";
|
|
72
|
+
}
|
|
73
|
+
function getCalendarPopupPropKey(actionKey) {
|
|
74
|
+
return actionKey === "quickCreateAction" ? "quickCreatePopupSettings" : "eventPopupSettings";
|
|
75
|
+
}
|
|
76
|
+
function getCalendarPopupActionUid(calendarUid, actionKey) {
|
|
77
|
+
return `${calendarUid}-${actionKey}`;
|
|
78
|
+
}
|
|
79
|
+
function getCalendarBlockResourceInit(blockNode) {
|
|
80
|
+
const resourceInit = import_lodash.default.cloneDeep(import_lodash.default.get(blockNode, ["stepParams", "resourceSettings", "init"]) || {});
|
|
81
|
+
if (resourceInit.collectionName && !resourceInit.dataSourceKey) {
|
|
82
|
+
resourceInit.dataSourceKey = "main";
|
|
83
|
+
}
|
|
84
|
+
return resourceInit;
|
|
85
|
+
}
|
|
86
|
+
function getCalendarPopupStoredSettings(blockNode, actionKey) {
|
|
87
|
+
const propKey = getCalendarPopupPropKey(actionKey);
|
|
88
|
+
const stepParamsPath = ["stepParams", "calendarSettings", propKey];
|
|
89
|
+
const rawSettings = import_lodash.default.has(blockNode, stepParamsPath) ? import_lodash.default.isPlainObject(import_lodash.default.get(blockNode, stepParamsPath)) ? import_lodash.default.get(blockNode, stepParamsPath) : {} : import_lodash.default.isPlainObject(import_lodash.default.get(blockNode, ["props", propKey])) ? import_lodash.default.get(blockNode, ["props", propKey]) : {};
|
|
90
|
+
return normalizeCalendarPopupSettings(actionKey, import_lodash.default.cloneDeep(rawSettings || {}));
|
|
91
|
+
}
|
|
92
|
+
async function replaceCalendarStoredPopupSettings(runtime, blockNode, actionKey, popupSettings, transaction) {
|
|
93
|
+
if (!(blockNode == null ? void 0 : blockNode.uid)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const propKey = getCalendarPopupPropKey(actionKey);
|
|
97
|
+
const path = ["calendarSettings", propKey];
|
|
98
|
+
const nextStepParams = import_lodash.default.cloneDeep(blockNode.stepParams || {});
|
|
99
|
+
if (Object.keys(popupSettings || {}).length) {
|
|
100
|
+
import_lodash.default.set(nextStepParams, path, import_lodash.default.cloneDeep(popupSettings));
|
|
101
|
+
} else {
|
|
102
|
+
(0, import_hidden_popup_contract.unsetHiddenPopupPayloadPathAndPruneEmptyParents)(nextStepParams, path);
|
|
103
|
+
}
|
|
104
|
+
if (import_lodash.default.isEqual(nextStepParams, blockNode.stepParams || {})) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
await runtime.repository.patch(
|
|
108
|
+
{
|
|
109
|
+
uid: blockNode.uid,
|
|
110
|
+
stepParams: nextStepParams
|
|
111
|
+
},
|
|
112
|
+
{ transaction }
|
|
113
|
+
);
|
|
114
|
+
blockNode.stepParams = nextStepParams;
|
|
115
|
+
}
|
|
116
|
+
async function persistCalendarPopupSettingsFromOpenView(runtime, blockNode, actionKey, openView, popupSettings, transaction) {
|
|
117
|
+
const storedSettings = (0, import_hidden_popup_contract.buildPersistedHiddenPopupSettingsFromOpenView)({
|
|
118
|
+
openView,
|
|
119
|
+
popupSettings,
|
|
120
|
+
expectedHostUid: getCalendarPopupActionUid(blockNode.uid, actionKey),
|
|
121
|
+
normalizePopupSettings: (settings) => normalizeCalendarPopupSettings(actionKey, settings)
|
|
122
|
+
});
|
|
123
|
+
await replaceCalendarStoredPopupSettings(runtime, blockNode, actionKey, storedSettings, transaction);
|
|
124
|
+
}
|
|
125
|
+
function buildCalendarInitialStepParams(input) {
|
|
126
|
+
const nextStepParams = import_lodash.default.cloneDeep(input.stepParams || {});
|
|
127
|
+
const props = input.props || {};
|
|
128
|
+
const settings = input.settings || {};
|
|
129
|
+
const quickCreatePopupSettings = import_lodash.default.has(nextStepParams, ["calendarSettings", "quickCreatePopupSettings"]) ? import_lodash.default.get(nextStepParams, ["calendarSettings", "quickCreatePopupSettings"]) : import_lodash.default.isPlainObject(props.quickCreatePopupSettings) ? props.quickCreatePopupSettings : import_lodash.default.isPlainObject(props.quickCreatePopup) ? props.quickCreatePopup : import_lodash.default.isPlainObject(settings.quickCreatePopupSettings) ? settings.quickCreatePopupSettings : import_lodash.default.isPlainObject(settings.quickCreatePopup) ? settings.quickCreatePopup : void 0;
|
|
130
|
+
const eventPopupSettings = import_lodash.default.has(nextStepParams, ["calendarSettings", "eventPopupSettings"]) ? import_lodash.default.get(nextStepParams, ["calendarSettings", "eventPopupSettings"]) : import_lodash.default.isPlainObject(props.eventPopupSettings) ? props.eventPopupSettings : import_lodash.default.isPlainObject(props.eventPopup) ? props.eventPopup : import_lodash.default.isPlainObject(settings.eventPopupSettings) ? settings.eventPopupSettings : import_lodash.default.isPlainObject(settings.eventPopup) ? settings.eventPopup : void 0;
|
|
131
|
+
if (import_lodash.default.isPlainObject(quickCreatePopupSettings)) {
|
|
132
|
+
import_lodash.default.set(
|
|
133
|
+
nextStepParams,
|
|
134
|
+
["calendarSettings", "quickCreatePopupSettings"],
|
|
135
|
+
normalizeCalendarPopupSettings("quickCreateAction", import_lodash.default.cloneDeep(quickCreatePopupSettings))
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
if (import_lodash.default.isPlainObject(eventPopupSettings)) {
|
|
139
|
+
import_lodash.default.set(
|
|
140
|
+
nextStepParams,
|
|
141
|
+
["calendarSettings", "eventPopupSettings"],
|
|
142
|
+
normalizeCalendarPopupSettings("eventViewAction", import_lodash.default.cloneDeep(eventPopupSettings))
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return nextStepParams;
|
|
146
|
+
}
|
|
147
|
+
function buildCalendarPopupOpenView(input) {
|
|
148
|
+
const actionUid = getCalendarPopupActionUid(input.blockNode.uid, input.actionKey);
|
|
149
|
+
const resourceInit = input.resourceInit || getCalendarBlockResourceInit(input.blockNode);
|
|
150
|
+
return (0, import_hidden_popup_contract.buildHiddenPopupOpenView)({
|
|
151
|
+
actionUid,
|
|
152
|
+
resourceInit,
|
|
153
|
+
popupSettings: input.popupSettings ? input.popupSettings : getCalendarPopupStoredSettings(input.blockNode, input.actionKey),
|
|
154
|
+
normalizePopupSettings: (popupSettings) => normalizeCalendarPopupSettings(input.actionKey, popupSettings)
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function mergeCalendarPopupSettings(actionKey, current, value) {
|
|
158
|
+
if (!import_lodash.default.isPlainObject(value)) {
|
|
159
|
+
return {};
|
|
160
|
+
}
|
|
161
|
+
const currentBase = import_lodash.default.isPlainObject(current) && (0, import_hidden_popup_contract.hasExplicitHiddenPopupTargetSettings)(value) ? import_lodash.default.pick(import_lodash.default.cloneDeep(current), import_hidden_popup_contract.HIDDEN_POPUP_DISPLAY_KEYS) : current;
|
|
162
|
+
const merged = import_lodash.default.isPlainObject(currentBase) ? { ...import_lodash.default.cloneDeep(currentBase), ...import_lodash.default.cloneDeep(value) } : value;
|
|
163
|
+
return normalizeCalendarPopupSettings(actionKey, merged);
|
|
164
|
+
}
|
|
165
|
+
function stripCalendarPopupTargetSettingsForResourceChange(actionKey, popupSettings) {
|
|
166
|
+
return normalizeCalendarPopupSettings(
|
|
167
|
+
actionKey,
|
|
168
|
+
(0, import_hidden_popup_contract.stripHiddenPopupTargetSettings)(popupSettings, { disableTemplateAutoBind: true })
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
function mergeCalendarPopupDisplaySettings(actionKey, openView, popupSettings, fallbackOpenView, options = {}) {
|
|
172
|
+
return (0, import_hidden_popup_contract.mergeHiddenPopupDisplaySettings)({
|
|
173
|
+
openView,
|
|
174
|
+
popupSettings,
|
|
175
|
+
fallbackOpenView,
|
|
176
|
+
normalizePopupSettings: (settings) => normalizeCalendarPopupSettings(actionKey, settings),
|
|
177
|
+
preserveOpenViewDisplay: options.preserveOpenViewDisplay,
|
|
178
|
+
preserveOpenViewDisplayFallback: options.preserveOpenViewDisplayFallback
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
async function ensureCalendarPopupHostDefaultContent(runtime, input) {
|
|
182
|
+
return runtime.ensurePopupHostDefaultContent({
|
|
183
|
+
actionName: `calendar ${input.actionKey}`,
|
|
184
|
+
actionUid: input.actionUid,
|
|
185
|
+
popupSettings: input.popupSettings,
|
|
186
|
+
transaction: input.transaction,
|
|
187
|
+
hasCurrentRecord: input.actionKey === "eventViewAction",
|
|
188
|
+
mergeDisplaySettings: (openView, popupSettings, fallbackOpenView) => mergeCalendarPopupDisplaySettings(input.actionKey, openView, popupSettings, fallbackOpenView)
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
async function buildCalendarPopupOpenViewWithTemplate(runtime, input) {
|
|
192
|
+
var _a, _b;
|
|
193
|
+
const actionUid = getCalendarPopupActionUid(input.blockNode.uid, input.actionKey);
|
|
194
|
+
const openView = buildCalendarPopupOpenView(input);
|
|
195
|
+
return runtime.buildPopupOpenViewWithTemplate({
|
|
196
|
+
actionName: `calendar ${input.actionKey}`,
|
|
197
|
+
actionUid,
|
|
198
|
+
openView,
|
|
199
|
+
popupSettings: input.popupSettings,
|
|
200
|
+
existingHost: (0, import_service_utils.getSingleNodeSubModel)((_b = (_a = input.blockNode) == null ? void 0 : _a.subModels) == null ? void 0 : _b[input.actionKey]),
|
|
201
|
+
transaction: input.transaction,
|
|
202
|
+
hasCurrentRecord: input.actionKey === "eventViewAction",
|
|
203
|
+
normalizePopupSettings: (popupSettings) => normalizeCalendarPopupSettings(input.actionKey, popupSettings),
|
|
204
|
+
mergeDisplaySettings: (nextOpenView, popupSettings, fallbackOpenView) => mergeCalendarPopupDisplaySettings(input.actionKey, nextOpenView, popupSettings, fallbackOpenView)
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
async function normalizeCalendarPopupConfigureValue(input) {
|
|
208
|
+
if (import_lodash.default.isUndefined(input.value)) {
|
|
209
|
+
return void 0;
|
|
210
|
+
}
|
|
211
|
+
if (import_lodash.default.isNull(input.value)) {
|
|
212
|
+
return {};
|
|
213
|
+
}
|
|
214
|
+
const actionUid = getCalendarPopupActionUid(input.blockUid, input.actionKey);
|
|
215
|
+
const normalized = await input.normalizeOpenView(input.actionName, input.value, {
|
|
216
|
+
transaction: input.transaction,
|
|
217
|
+
popupTemplateHostUid: actionUid,
|
|
218
|
+
popupActionContext: {
|
|
219
|
+
hasCurrentRecord: input.actionKey === "eventViewAction"
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return normalizeCalendarPopupSettings(input.actionKey, {
|
|
223
|
+
...normalized || {},
|
|
224
|
+
...import_lodash.default.isPlainObject(input.value) && input.value.tryTemplate === false ? { tryTemplate: false } : {}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function normalizeCalendarInlineSettingsForConfigure(settings) {
|
|
228
|
+
if (!import_lodash.default.isPlainObject(settings)) {
|
|
229
|
+
return settings;
|
|
230
|
+
}
|
|
231
|
+
const nextSettings = import_lodash.default.cloneDeep(settings);
|
|
232
|
+
if (Object.prototype.hasOwnProperty.call(nextSettings, "quickCreatePopupSettings")) {
|
|
233
|
+
if (!Object.prototype.hasOwnProperty.call(nextSettings, "quickCreatePopup")) {
|
|
234
|
+
nextSettings.quickCreatePopup = nextSettings.quickCreatePopupSettings;
|
|
235
|
+
}
|
|
236
|
+
delete nextSettings.quickCreatePopupSettings;
|
|
237
|
+
}
|
|
238
|
+
if (Object.prototype.hasOwnProperty.call(nextSettings, "eventPopupSettings")) {
|
|
239
|
+
if (!Object.prototype.hasOwnProperty.call(nextSettings, "eventPopup")) {
|
|
240
|
+
nextSettings.eventPopup = nextSettings.eventPopupSettings;
|
|
241
|
+
}
|
|
242
|
+
delete nextSettings.eventPopupSettings;
|
|
243
|
+
}
|
|
244
|
+
return nextSettings;
|
|
245
|
+
}
|
|
246
|
+
function resolveCalendarInitialPopupOverride(settings, primaryKey, legacyKey) {
|
|
247
|
+
if (!import_lodash.default.isPlainObject(settings)) {
|
|
248
|
+
return void 0;
|
|
249
|
+
}
|
|
250
|
+
if (import_lodash.default.isPlainObject(settings[primaryKey])) {
|
|
251
|
+
return settings[primaryKey];
|
|
252
|
+
}
|
|
253
|
+
if (import_lodash.default.isPlainObject(settings[legacyKey])) {
|
|
254
|
+
return settings[legacyKey];
|
|
255
|
+
}
|
|
256
|
+
return void 0;
|
|
257
|
+
}
|
|
258
|
+
async function ensureCalendarBlockPopupHosts(runtime, blockNode, transaction, popupSettingsOverrides, options = {}) {
|
|
259
|
+
var _a, _b;
|
|
260
|
+
if (!(blockNode == null ? void 0 : blockNode.uid) || blockNode.use !== "CalendarBlockModel") {
|
|
261
|
+
return blockNode;
|
|
262
|
+
}
|
|
263
|
+
const resourceInit = getCalendarBlockResourceInit(blockNode);
|
|
264
|
+
let changed = false;
|
|
265
|
+
for (const actionKey of CALENDAR_POPUP_ACTION_KEYS) {
|
|
266
|
+
let existing = (0, import_service_utils.getSingleNodeSubModel)((_a = blockNode.subModels) == null ? void 0 : _a[actionKey]);
|
|
267
|
+
const expectedUid = getCalendarPopupActionUid(blockNode.uid, actionKey);
|
|
268
|
+
const expectedUse = getCalendarPopupActionUse(actionKey);
|
|
269
|
+
const popupSettingsOverride = (0, import_hidden_popup_contract.resolveHiddenPopupSettingsOverride)(popupSettingsOverrides, actionKey);
|
|
270
|
+
const explicitPopupSettingsProvided = !!popupSettingsOverrides && Object.prototype.hasOwnProperty.call(popupSettingsOverrides, actionKey);
|
|
271
|
+
const popupSettings = popupSettingsOverride ?? getCalendarPopupStoredSettings(blockNode, actionKey);
|
|
272
|
+
const seedOpenView = buildCalendarPopupOpenView({
|
|
273
|
+
blockNode,
|
|
274
|
+
actionKey,
|
|
275
|
+
resourceInit,
|
|
276
|
+
popupSettings
|
|
277
|
+
});
|
|
278
|
+
const displayFallbackOpenView = ((_b = options.displayFallbackOpenViews) == null ? void 0 : _b[actionKey]) || seedOpenView;
|
|
279
|
+
const shouldReplaceExisting = (existing == null ? void 0 : existing.uid) && existing.uid !== expectedUid;
|
|
280
|
+
if (!(existing == null ? void 0 : existing.uid) || shouldReplaceExisting || existing.use !== expectedUse) {
|
|
281
|
+
if (shouldReplaceExisting) {
|
|
282
|
+
await runtime.removeNodeTreeWithBindings(existing.uid, transaction);
|
|
283
|
+
}
|
|
284
|
+
await runtime.repository.upsertModel(
|
|
285
|
+
{
|
|
286
|
+
parentId: blockNode.uid,
|
|
287
|
+
subKey: actionKey,
|
|
288
|
+
subType: "object",
|
|
289
|
+
...(existing == null ? void 0 : existing.uid) === expectedUid ? import_lodash.default.cloneDeep(existing) : {},
|
|
290
|
+
uid: expectedUid,
|
|
291
|
+
use: expectedUse,
|
|
292
|
+
stepParams: (0, import_hidden_popup_contract.buildHiddenPopupActionStepParams)(
|
|
293
|
+
(existing == null ? void 0 : existing.uid) === expectedUid ? existing.stepParams : {},
|
|
294
|
+
seedOpenView
|
|
295
|
+
)
|
|
296
|
+
},
|
|
297
|
+
{ transaction }
|
|
298
|
+
);
|
|
299
|
+
existing = await runtime.repository.findModelById(expectedUid, {
|
|
300
|
+
transaction,
|
|
301
|
+
includeAsyncNode: true
|
|
302
|
+
});
|
|
303
|
+
if (String((seedOpenView == null ? void 0 : seedOpenView.popupTemplateUid) || "").trim()) {
|
|
304
|
+
await runtime.clearFlowTemplateUsagesForNodeTree(expectedUid, transaction);
|
|
305
|
+
await runtime.syncFlowTemplateUsagesForNodeTree(expectedUid, transaction);
|
|
306
|
+
}
|
|
307
|
+
changed = true;
|
|
308
|
+
}
|
|
309
|
+
const currentOpenView = (0, import_hidden_popup_contract.resolveHiddenPopupHostOpenView)(existing);
|
|
310
|
+
const normalizedCurrentOpenView = normalizeCalendarPopupSettings(actionKey, currentOpenView);
|
|
311
|
+
const popupOpenViewTransition = await (0, import_hidden_popup_contract.resolveHiddenPopupOpenViewTransitionWithCandidate)({
|
|
312
|
+
existing,
|
|
313
|
+
expectedUid,
|
|
314
|
+
expectedUse,
|
|
315
|
+
popupSettings,
|
|
316
|
+
seedOpenView,
|
|
317
|
+
currentOpenView,
|
|
318
|
+
normalizedCurrentOpenView,
|
|
319
|
+
displayFallbackOpenView,
|
|
320
|
+
allowResourceMismatchRebuild: explicitPopupSettingsProvided,
|
|
321
|
+
mergeDisplaySettings: (openView2, popupSettings2, fallbackOpenView, mergeOptions) => mergeCalendarPopupDisplaySettings(actionKey, openView2, popupSettings2, fallbackOpenView, mergeOptions),
|
|
322
|
+
resolveCandidateOpenView: () => buildCalendarPopupOpenViewWithTemplate(runtime, {
|
|
323
|
+
blockNode,
|
|
324
|
+
actionKey,
|
|
325
|
+
resourceInit,
|
|
326
|
+
popupSettings,
|
|
327
|
+
transaction
|
|
328
|
+
})
|
|
329
|
+
});
|
|
330
|
+
const { openView } = popupOpenViewTransition;
|
|
331
|
+
const shouldUpsert = !(existing == null ? void 0 : existing.uid) || existing.use !== expectedUse || !import_lodash.default.isEqual(currentOpenView, openView);
|
|
332
|
+
if (shouldUpsert) {
|
|
333
|
+
if ((existing == null ? void 0 : existing.uid) && existing.uid === expectedUid && !import_lodash.default.isEqual(currentOpenView, openView)) {
|
|
334
|
+
await runtime.reconcilePopupOpenViewTransition(expectedUid, currentOpenView, openView, transaction);
|
|
335
|
+
}
|
|
336
|
+
const shouldRefreshTemplateUsages = !import_lodash.default.isEqual(currentOpenView, openView);
|
|
337
|
+
const nextActionNode = {
|
|
338
|
+
...(existing == null ? void 0 : existing.uid) && existing.uid === expectedUid ? import_lodash.default.cloneDeep(existing) : {},
|
|
339
|
+
uid: expectedUid,
|
|
340
|
+
use: expectedUse,
|
|
341
|
+
stepParams: (0, import_hidden_popup_contract.buildHiddenPopupActionStepParams)(
|
|
342
|
+
(existing == null ? void 0 : existing.uid) === expectedUid ? existing.stepParams : {},
|
|
343
|
+
openView
|
|
344
|
+
)
|
|
345
|
+
};
|
|
346
|
+
await runtime.repository.upsertModel(
|
|
347
|
+
{
|
|
348
|
+
parentId: blockNode.uid,
|
|
349
|
+
subKey: actionKey,
|
|
350
|
+
subType: "object",
|
|
351
|
+
...nextActionNode
|
|
352
|
+
},
|
|
353
|
+
{ transaction }
|
|
354
|
+
);
|
|
355
|
+
if (shouldRefreshTemplateUsages || String((openView == null ? void 0 : openView.popupTemplateUid) || "").trim()) {
|
|
356
|
+
await runtime.clearFlowTemplateUsagesForNodeTree(expectedUid, transaction);
|
|
357
|
+
if (String((openView == null ? void 0 : openView.popupTemplateUid) || "").trim()) {
|
|
358
|
+
await runtime.syncFlowTemplateUsagesForNodeTree(expectedUid, transaction);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
changed = true;
|
|
362
|
+
}
|
|
363
|
+
const completedDefaultContent = await ensureCalendarPopupHostDefaultContent(runtime, {
|
|
364
|
+
actionKey,
|
|
365
|
+
actionUid: expectedUid,
|
|
366
|
+
popupSettings,
|
|
367
|
+
transaction
|
|
368
|
+
});
|
|
369
|
+
if (completedDefaultContent) {
|
|
370
|
+
existing = await runtime.repository.findModelById(expectedUid, {
|
|
371
|
+
transaction,
|
|
372
|
+
includeAsyncNode: true
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
const finalOpenView = completedDefaultContent ? (0, import_hidden_popup_contract.resolveHiddenPopupHostOpenView)(existing) : openView;
|
|
376
|
+
await persistCalendarPopupSettingsFromOpenView(
|
|
377
|
+
runtime,
|
|
378
|
+
blockNode,
|
|
379
|
+
actionKey,
|
|
380
|
+
finalOpenView,
|
|
381
|
+
popupSettings,
|
|
382
|
+
transaction
|
|
383
|
+
);
|
|
384
|
+
if (existing == null ? void 0 : existing.uid) {
|
|
385
|
+
blockNode.subModels = {
|
|
386
|
+
...blockNode.subModels || {},
|
|
387
|
+
[actionKey]: existing
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
changed = completedDefaultContent || changed;
|
|
391
|
+
}
|
|
392
|
+
if (!changed) {
|
|
393
|
+
return blockNode;
|
|
394
|
+
}
|
|
395
|
+
const refreshed = await runtime.repository.findModelById(blockNode.uid, {
|
|
396
|
+
transaction,
|
|
397
|
+
includeAsyncNode: true
|
|
398
|
+
});
|
|
399
|
+
if (refreshed == null ? void 0 : refreshed.uid) {
|
|
400
|
+
return refreshed;
|
|
401
|
+
}
|
|
402
|
+
return blockNode;
|
|
403
|
+
}
|
|
404
|
+
function projectCalendarBlockPopupHosts(node) {
|
|
405
|
+
var _a;
|
|
406
|
+
if (!node || typeof node !== "object") {
|
|
407
|
+
return node;
|
|
408
|
+
}
|
|
409
|
+
const current = node;
|
|
410
|
+
if (!(current == null ? void 0 : current.uid) || current.use !== "CalendarBlockModel") {
|
|
411
|
+
return node;
|
|
412
|
+
}
|
|
413
|
+
const resourceInit = getCalendarBlockResourceInit(current);
|
|
414
|
+
let nextSubModels = current.subModels;
|
|
415
|
+
let changed = false;
|
|
416
|
+
for (const actionKey of CALENDAR_POPUP_ACTION_KEYS) {
|
|
417
|
+
const existing = (0, import_service_utils.getSingleNodeSubModel)((_a = current.subModels) == null ? void 0 : _a[actionKey]);
|
|
418
|
+
const expectedUid = getCalendarPopupActionUid(current.uid, actionKey);
|
|
419
|
+
const expectedUse = getCalendarPopupActionUse(actionKey);
|
|
420
|
+
const popupSettings = getCalendarPopupStoredSettings(current, actionKey);
|
|
421
|
+
const persistedOpenView = (0, import_hidden_popup_contract.resolveHiddenPopupHostOpenView)(existing);
|
|
422
|
+
const seedOpenView = buildCalendarPopupOpenView({
|
|
423
|
+
blockNode: current,
|
|
424
|
+
actionKey,
|
|
425
|
+
resourceInit,
|
|
426
|
+
popupSettings
|
|
427
|
+
});
|
|
428
|
+
const currentOpenView = (0, import_hidden_popup_contract.resolveHiddenPopupHostOpenView)(existing);
|
|
429
|
+
const normalizedCurrentOpenView = normalizeCalendarPopupSettings(actionKey, currentOpenView);
|
|
430
|
+
const { openView } = (0, import_hidden_popup_contract.resolveHiddenPopupOpenViewTransition)({
|
|
431
|
+
existing,
|
|
432
|
+
expectedUid,
|
|
433
|
+
expectedUse,
|
|
434
|
+
popupSettings,
|
|
435
|
+
seedOpenView,
|
|
436
|
+
candidateOpenView: seedOpenView,
|
|
437
|
+
currentOpenView,
|
|
438
|
+
normalizedCurrentOpenView,
|
|
439
|
+
preservedOpenView: persistedOpenView,
|
|
440
|
+
resourceMismatchDisplayFallbackOpenView: (0, import_hidden_popup_contract.buildHiddenPopupResourceMismatchDisplayFallbackOpenView)({
|
|
441
|
+
normalizedCurrentOpenView,
|
|
442
|
+
resourceInit,
|
|
443
|
+
popupSettings,
|
|
444
|
+
stripPopupTargetSettingsForResourceChange: (popupSettings2) => stripCalendarPopupTargetSettingsForResourceChange(actionKey, popupSettings2),
|
|
445
|
+
buildOpenView: ({ resourceInit: resourceInit2, popupSettings: popupSettings2 }) => buildCalendarPopupOpenView({
|
|
446
|
+
blockNode: current,
|
|
447
|
+
actionKey,
|
|
448
|
+
resourceInit: resourceInit2,
|
|
449
|
+
popupSettings: popupSettings2
|
|
450
|
+
})
|
|
451
|
+
}),
|
|
452
|
+
allowResourceMismatchRebuild: true,
|
|
453
|
+
mergeDisplaySettings: (openView2, popupSettings2, fallbackOpenView, mergeOptions) => mergeCalendarPopupDisplaySettings(actionKey, openView2, popupSettings2, fallbackOpenView, mergeOptions)
|
|
454
|
+
});
|
|
455
|
+
if ((existing == null ? void 0 : existing.uid) === expectedUid && existing.use === expectedUse && import_lodash.default.isEqual(currentOpenView, openView)) {
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
const nextActionNode = {
|
|
459
|
+
...(existing == null ? void 0 : existing.uid) === expectedUid ? import_lodash.default.cloneDeep(existing) : {},
|
|
460
|
+
uid: expectedUid,
|
|
461
|
+
use: expectedUse,
|
|
462
|
+
stepParams: (0, import_hidden_popup_contract.buildHiddenPopupActionStepParams)((existing == null ? void 0 : existing.uid) === expectedUid ? existing.stepParams : {}, openView)
|
|
463
|
+
};
|
|
464
|
+
if (!changed) {
|
|
465
|
+
nextSubModels = {
|
|
466
|
+
...current.subModels || {}
|
|
467
|
+
};
|
|
468
|
+
changed = true;
|
|
469
|
+
}
|
|
470
|
+
nextSubModels[actionKey] = nextActionNode;
|
|
471
|
+
}
|
|
472
|
+
if (!changed) {
|
|
473
|
+
return node;
|
|
474
|
+
}
|
|
475
|
+
return {
|
|
476
|
+
...current,
|
|
477
|
+
subModels: nextSubModels
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
function projectCalendarBlockPopupHostsInTree(node) {
|
|
481
|
+
if (!node || typeof node !== "object") {
|
|
482
|
+
return node;
|
|
483
|
+
}
|
|
484
|
+
let current = projectCalendarBlockPopupHosts(node);
|
|
485
|
+
let nextSubModels = current == null ? void 0 : current.subModels;
|
|
486
|
+
let changed = current !== node;
|
|
487
|
+
if (!nextSubModels || typeof nextSubModels !== "object") {
|
|
488
|
+
return current;
|
|
489
|
+
}
|
|
490
|
+
for (const [subKey, value] of Object.entries(nextSubModels)) {
|
|
491
|
+
if (Array.isArray(value)) {
|
|
492
|
+
const nextItems = [];
|
|
493
|
+
let itemsChanged = false;
|
|
494
|
+
for (const item of value) {
|
|
495
|
+
const nextItem = projectCalendarBlockPopupHostsInTree(item);
|
|
496
|
+
nextItems.push(nextItem);
|
|
497
|
+
itemsChanged = itemsChanged || nextItem !== item;
|
|
498
|
+
}
|
|
499
|
+
if (!itemsChanged) {
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
if (!changed) {
|
|
503
|
+
current = {
|
|
504
|
+
...current,
|
|
505
|
+
subModels: {
|
|
506
|
+
...nextSubModels
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
nextSubModels = current.subModels;
|
|
510
|
+
changed = true;
|
|
511
|
+
}
|
|
512
|
+
nextSubModels[subKey] = nextItems;
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
const nextValue = projectCalendarBlockPopupHostsInTree(value);
|
|
516
|
+
if (nextValue === value) {
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
if (!changed) {
|
|
520
|
+
current = {
|
|
521
|
+
...current,
|
|
522
|
+
subModels: {
|
|
523
|
+
...nextSubModels
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
nextSubModels = current.subModels;
|
|
527
|
+
changed = true;
|
|
528
|
+
}
|
|
529
|
+
nextSubModels[subKey] = nextValue;
|
|
530
|
+
}
|
|
531
|
+
return current;
|
|
532
|
+
}
|
|
533
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
534
|
+
0 && (module.exports = {
|
|
535
|
+
CALENDAR_POPUP_ACTION_KEYS,
|
|
536
|
+
CALENDAR_POPUP_PROP_KEYS,
|
|
537
|
+
buildCalendarInitialStepParams,
|
|
538
|
+
buildCalendarPopupOpenView,
|
|
539
|
+
ensureCalendarBlockPopupHosts,
|
|
540
|
+
getCalendarBlockResourceInit,
|
|
541
|
+
getCalendarPopupActionUid,
|
|
542
|
+
getCalendarPopupActionUse,
|
|
543
|
+
getCalendarPopupPropKey,
|
|
544
|
+
getCalendarPopupStoredSettings,
|
|
545
|
+
mergeCalendarPopupSettings,
|
|
546
|
+
normalizeCalendarInlineSettingsForConfigure,
|
|
547
|
+
normalizeCalendarPopupConfigureValue,
|
|
548
|
+
normalizeCalendarPopupSettings,
|
|
549
|
+
projectCalendarBlockPopupHosts,
|
|
550
|
+
projectCalendarBlockPopupHostsInTree,
|
|
551
|
+
replaceCalendarStoredPopupSettings,
|
|
552
|
+
resolveCalendarInitialPopupOverride,
|
|
553
|
+
stripCalendarPopupTargetSettingsForResourceChange
|
|
554
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
import type { FlowSurfaceApplyBlueprintPopupDefaultsMetadata } from './blueprint/defaults';
|
|
11
|
+
export declare const OPEN_VIEW_MODE_ALIASES: {
|
|
12
|
+
readonly modal: "dialog";
|
|
13
|
+
readonly page: "embed";
|
|
14
|
+
};
|
|
15
|
+
export declare const HIDDEN_POPUP_TEMPLATE_TARGET_KEYS: readonly ["template", "tryTemplate", "popupTemplateUid", "popupTemplateContext", "popupTemplateMode", "popupTemplateHasFilterByTk", "popupTemplateHasSourceId", "associationName", "filterByTk", "sourceId"];
|
|
16
|
+
export declare const HIDDEN_POPUP_DISPLAY_KEYS: readonly ["mode", "size", "pageModelClass", "title"];
|
|
17
|
+
export declare function normalizeHiddenPopupScalarSettings(popupSettings: Record<string, any>): void;
|
|
18
|
+
export declare function attachHiddenPopupDefaults(popup: any, defaultsMetadata: FlowSurfaceApplyBlueprintPopupDefaultsMetadata | undefined): any;
|
|
19
|
+
export declare function normalizeBlockHiddenPopupSettings(settings: Record<string, any>, blockContext: string, keys: readonly string[], defaultsMetadata?: FlowSurfaceApplyBlueprintPopupDefaultsMetadata, assertPopupObject?: (message: string) => void): Record<string, any>;
|
|
20
|
+
export declare function normalizeHiddenPopupSettings(popupSettings?: Record<string, any>, options?: {
|
|
21
|
+
collectionOnly?: boolean;
|
|
22
|
+
invalidUids?: any[];
|
|
23
|
+
}): Record<string, any>;
|
|
24
|
+
export declare function stripHiddenPopupTargetSettings(popupSettings?: Record<string, any>, options?: {
|
|
25
|
+
disableTemplateAutoBind?: boolean;
|
|
26
|
+
}): Record<string, any>;
|
|
27
|
+
export declare function hiddenPopupOpenViewResourceDiffers(openView?: Record<string, any> | null, fallbackOpenView?: Record<string, any> | null): boolean;
|
|
28
|
+
export declare function buildHiddenPopupOpenView(input: {
|
|
29
|
+
actionUid: string;
|
|
30
|
+
resourceInit?: Record<string, any>;
|
|
31
|
+
popupSettings?: Record<string, any>;
|
|
32
|
+
normalizePopupSettings?: (popupSettings?: Record<string, any>) => Record<string, any>;
|
|
33
|
+
}): _.Dictionary<any>;
|
|
34
|
+
export declare function hasExplicitHiddenPopupTargetSettings(popupSettings?: Record<string, any>, defaultUid?: string): boolean;
|
|
35
|
+
export declare function hasExplicitHiddenPopupResourceTargetSettings(popupSettings?: Record<string, any>, defaultUid?: string): boolean;
|
|
36
|
+
export declare function shouldPreserveExplicitHiddenPopupTemplateOpenView(openView: any, popupSettings?: Record<string, any>): boolean;
|
|
37
|
+
export declare function shouldPreserveHiddenPopupOpenView(openView: any, expectedHostUid?: string, popupSettings?: Record<string, any>, fallbackOpenView?: Record<string, any> | null): boolean;
|
|
38
|
+
export declare function getHiddenPopupDisplaySettings(popupSettings?: Record<string, any>, normalizePopupSettings?: (popupSettings?: Record<string, any>) => Record<string, any>): _.Omit<Record<string, any>, "uid" | "filterByTk" | "sourceId" | "dataSourceKey" | "collectionName" | "template" | "associationName" | "popupTemplateUid" | "tryTemplate" | "popupTemplateMode" | "popupTemplateContext" | "popupTemplateHasFilterByTk" | "popupTemplateHasSourceId">;
|
|
39
|
+
export declare function getHiddenPopupOpenViewDisplayFallback(openView?: Record<string, any> | null, fallbackOpenView?: Record<string, any> | null): _.Dictionary<any>;
|
|
40
|
+
export declare function mergeHiddenPopupDisplaySettings(input: {
|
|
41
|
+
openView: Record<string, any>;
|
|
42
|
+
popupSettings?: Record<string, any>;
|
|
43
|
+
fallbackOpenView?: Record<string, any> | null;
|
|
44
|
+
normalizePopupSettings?: (popupSettings?: Record<string, any>) => Record<string, any>;
|
|
45
|
+
preserveOpenViewDisplay?: boolean;
|
|
46
|
+
preserveOpenViewDisplayFallback?: Record<string, any> | null;
|
|
47
|
+
}): _.Dictionary<any>;
|
|
48
|
+
export declare function getHiddenPopupOpenViewDisplayOverrides(openView?: Record<string, any> | null, fallbackOpenView?: Record<string, any> | null): _.Dictionary<any>;
|
|
49
|
+
export declare function mergeHiddenPopupOpenViewDisplayOverrides(input: {
|
|
50
|
+
openView: Record<string, any>;
|
|
51
|
+
displayOpenView?: Record<string, any> | null;
|
|
52
|
+
fallbackOpenView?: Record<string, any> | null;
|
|
53
|
+
displayFallbackOpenView?: Record<string, any> | null;
|
|
54
|
+
}): _.Dictionary<any>;
|
|
55
|
+
export declare function resolveHiddenPopupOpenViewTransition(input: {
|
|
56
|
+
existing?: any;
|
|
57
|
+
expectedUid: string;
|
|
58
|
+
expectedUse: string;
|
|
59
|
+
popupSettings?: Record<string, any>;
|
|
60
|
+
seedOpenView: Record<string, any>;
|
|
61
|
+
candidateOpenView?: Record<string, any>;
|
|
62
|
+
currentOpenView?: Record<string, any> | null;
|
|
63
|
+
normalizedCurrentOpenView?: Record<string, any> | null;
|
|
64
|
+
preservedOpenView?: Record<string, any> | null;
|
|
65
|
+
displayFallbackOpenView?: Record<string, any> | null;
|
|
66
|
+
resourceMismatchDisplayFallbackOpenView?: Record<string, any> | null;
|
|
67
|
+
allowResourceMismatchRebuild?: boolean;
|
|
68
|
+
mergeDisplaySettings: (openView: Record<string, any>, popupSettings?: Record<string, any>, fallbackOpenView?: Record<string, any> | null, options?: {
|
|
69
|
+
preserveOpenViewDisplay?: boolean;
|
|
70
|
+
preserveOpenViewDisplayFallback?: Record<string, any> | null;
|
|
71
|
+
}) => Record<string, any>;
|
|
72
|
+
}): {
|
|
73
|
+
openView: Record<string, any>;
|
|
74
|
+
shouldRebuildForResourceMismatch: boolean;
|
|
75
|
+
shouldPreservePersistedOpenView: boolean;
|
|
76
|
+
currentOpenView: Record<string, any>;
|
|
77
|
+
normalizedCurrentOpenView: Record<string, any>;
|
|
78
|
+
};
|
|
79
|
+
export declare function resolveHiddenPopupOpenViewTransitionWithCandidate(input: Parameters<typeof resolveHiddenPopupOpenViewTransition>[0] & {
|
|
80
|
+
resolveCandidateOpenView: () => Promise<Record<string, any>> | Record<string, any>;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
openView: Record<string, any>;
|
|
83
|
+
shouldRebuildForResourceMismatch: boolean;
|
|
84
|
+
shouldPreservePersistedOpenView: boolean;
|
|
85
|
+
currentOpenView: Record<string, any>;
|
|
86
|
+
normalizedCurrentOpenView: Record<string, any>;
|
|
87
|
+
}>;
|
|
88
|
+
export declare function buildHiddenPopupResourceMismatchDisplayFallbackOpenView(input: {
|
|
89
|
+
normalizedCurrentOpenView?: Record<string, any> | null;
|
|
90
|
+
resourceInit?: Record<string, any>;
|
|
91
|
+
popupSettings?: Record<string, any>;
|
|
92
|
+
stripPopupTargetSettingsForResourceChange: (popupSettings?: Record<string, any>) => Record<string, any>;
|
|
93
|
+
buildOpenView: (input: {
|
|
94
|
+
resourceInit?: Record<string, any>;
|
|
95
|
+
popupSettings?: Record<string, any>;
|
|
96
|
+
}) => Record<string, any>;
|
|
97
|
+
}): Record<string, any>;
|
|
98
|
+
export declare function buildHiddenPopupActionStepParams(existingStepParams: any, openView: Record<string, any>): any;
|
|
99
|
+
export declare function buildPersistedHiddenPopupSettingsFromOpenView(input: {
|
|
100
|
+
openView?: Record<string, any> | null;
|
|
101
|
+
popupSettings?: Record<string, any>;
|
|
102
|
+
expectedHostUid?: string;
|
|
103
|
+
normalizePopupSettings: (popupSettings?: Record<string, any>) => Record<string, any>;
|
|
104
|
+
}): Record<string, any>;
|
|
105
|
+
export declare function unsetHiddenPopupPayloadPathAndPruneEmptyParents(payload: Record<string, any>, path: Array<string>): void;
|
|
106
|
+
export declare function buildImplicitHiddenPopupDefaultContent(popupSettings?: Record<string, any>): {
|
|
107
|
+
tryTemplate: boolean;
|
|
108
|
+
__flowSurfaceAutoSaveDefaultPopupTemplate: boolean;
|
|
109
|
+
__flowSurfaceApplyBlueprintPopupDefaults?: any;
|
|
110
|
+
};
|
|
111
|
+
export declare function hiddenPopupHostHasLocalContent(actionNode: any): boolean;
|
|
112
|
+
export declare function shouldAutoBindHiddenPopupTemplate(openView: Record<string, any>, popupSettings?: Record<string, any>, expectedHostUid?: string, options?: {
|
|
113
|
+
hostHasLocalContent?: boolean;
|
|
114
|
+
}): boolean;
|
|
115
|
+
export declare function resolveHiddenPopupHostOpenView(node: any): any;
|
|
116
|
+
export declare function resolveHiddenPopupSettingsOverride<TActionKey extends string>(overrides: Partial<Record<TActionKey, Record<string, any> | undefined>> | undefined, actionKey: TActionKey): Partial<Record<TActionKey, Record<string, any>>>[TActionKey];
|