@sap-ux/preview-middleware 0.23.48 → 0.23.50
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/client/adp/command-executor.js +99 -66
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +120 -102
- package/dist/client/adp/controllers/AddFragment.controller.js +189 -163
- package/dist/client/adp/controllers/AddSubpage.controller.js +146 -137
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +230 -188
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -164
- package/dist/client/adp/controllers/ControllerExtension.controller.js +329 -253
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +158 -114
- package/dist/client/adp/extension-point.js +81 -60
- package/dist/client/adp/init.js +100 -99
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +165 -147
- package/dist/client/adp/quick-actions/enablement-validator.js +0 -4
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +105 -100
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -40
- package/dist/client/adp/quick-actions/table-quick-action-base.js +309 -266
- package/dist/client/adp/sync-views-utils.js +119 -83
- package/dist/client/cpe/changes/flex-change.js +64 -48
- package/dist/client/cpe/changes/service.js +492 -367
- package/dist/client/cpe/communication-service.js +41 -29
- package/dist/client/cpe/connector-service.js +87 -64
- package/dist/client/cpe/context-menu-service.js +87 -74
- package/dist/client/cpe/control-data.js +353 -263
- package/dist/client/cpe/documentation.js +183 -126
- package/dist/client/cpe/init.js +69 -75
- package/dist/client/cpe/outline/service.js +60 -45
- package/dist/client/cpe/quick-actions/quick-action-definition.js +0 -4
- package/dist/client/cpe/quick-actions/quick-action-service.js +154 -129
- package/dist/client/cpe/rta-service.js +91 -69
- package/dist/client/cpe/selection.js +239 -187
- package/dist/client/cpe/types.js +0 -4
- package/dist/client/flp/init.js +403 -296
- package/dist/client/manifest.json +7 -4
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +444 -370
- package/dist/client/utils/info-center-message.js +59 -31
- package/dist/client/utils/version.js +128 -72
- package/package.json +4 -4
|
@@ -1,31 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
static subscribe(handler) {
|
|
25
|
-
this.actionHandlers.push(handler);
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../utils/error"], function (Log, ___sap_ux_private_control_property_editor_common, ___utils_error) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const startPostMessageCommunication = ___sap_ux_private_control_property_editor_common["startPostMessageCommunication"];
|
|
7
|
+
const getError = ___utils_error["getError"];
|
|
8
|
+
class CommunicationService {
|
|
9
|
+
/**
|
|
10
|
+
* Sends an action to the CPE.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
static actionHandlers = [];
|
|
14
|
+
static #_ = (() => {
|
|
15
|
+
const {
|
|
16
|
+
sendAction
|
|
17
|
+
} = startPostMessageCommunication(window.parent, async action => {
|
|
18
|
+
for (const handler of this.actionHandlers) {
|
|
19
|
+
try {
|
|
20
|
+
await handler(action);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
Log.error('Handler Failed: ', getError(error));
|
|
23
|
+
}
|
|
26
24
|
}
|
|
25
|
+
});
|
|
26
|
+
this.sendAction = sendAction;
|
|
27
|
+
})();
|
|
28
|
+
/**
|
|
29
|
+
* Creates a listener to receive actions from the CPE.
|
|
30
|
+
*
|
|
31
|
+
* @param handler - Action handler.
|
|
32
|
+
*/
|
|
33
|
+
static subscribe(handler) {
|
|
34
|
+
this.actionHandlers.push(handler);
|
|
27
35
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
36
|
+
}
|
|
37
|
+
var __exports = {
|
|
38
|
+
__esModule: true
|
|
39
|
+
};
|
|
40
|
+
__exports.CommunicationService = CommunicationService;
|
|
41
|
+
return __exports;
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=communication-service.js.map
|
|
@@ -1,67 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
connector.storage.fileChangeRequestNotifier = this.onChangeSaved.bind(this);
|
|
47
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../utils/version"], function (___sap_ux_private_control_property_editor_common, ___utils_version) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function __ui5_require_async(path) {
|
|
7
|
+
return new Promise(function (resolve, reject) {
|
|
8
|
+
sap.ui.require([path], function (module) {
|
|
9
|
+
if (!(module && module.__esModule)) {
|
|
10
|
+
module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
|
|
11
|
+
default: module
|
|
12
|
+
} : module;
|
|
13
|
+
Object.defineProperty(module, "__esModule", {
|
|
14
|
+
value: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
resolve(module);
|
|
18
|
+
}, function (err) {
|
|
19
|
+
reject(err);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const reloadApplication = ___sap_ux_private_control_property_editor_common["reloadApplication"];
|
|
24
|
+
const storageFileChanged = ___sap_ux_private_control_property_editor_common["storageFileChanged"];
|
|
25
|
+
const getUi5Version = ___utils_version["getUi5Version"];
|
|
26
|
+
const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
|
|
27
|
+
/**
|
|
28
|
+
* A Class of WorkspaceConnectorService
|
|
29
|
+
*/
|
|
30
|
+
class WorkspaceConnectorService {
|
|
31
|
+
/**
|
|
32
|
+
* When save and reload is triggered, we do not need special handling for changes that are not directly visible in preview.
|
|
33
|
+
*/
|
|
34
|
+
isReloadPending = false;
|
|
35
|
+
/**
|
|
36
|
+
* Initializes connector service.
|
|
37
|
+
*
|
|
38
|
+
* @param sendAction action sender function
|
|
39
|
+
* @param subscribe subscriber function
|
|
40
|
+
*/
|
|
41
|
+
async init(sendAction, subscribe) {
|
|
42
|
+
this.sendAction = sendAction;
|
|
43
|
+
subscribe(action => {
|
|
44
|
+
if (reloadApplication.match(action)) {
|
|
45
|
+
this.isReloadPending = true;
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
47
|
+
});
|
|
48
|
+
const ui5Version = await getUi5Version();
|
|
49
|
+
if (isLowerThanMinimalUi5Version(ui5Version, {
|
|
50
|
+
major: 1,
|
|
51
|
+
minor: 84
|
|
52
|
+
})) {
|
|
53
|
+
if (ui5Version.isCdn) {
|
|
54
|
+
const FakeLrepConnector = (await __ui5_require_async('sap/ui/fl/FakeLrepConnector')).default;
|
|
55
|
+
FakeLrepConnector.fileChangeRequestNotifier = this.onChangeSaved.bind(this);
|
|
56
|
+
} else {
|
|
57
|
+
// For UI5 versions below 1.84 served from npmjs, we do not support any connector service
|
|
58
|
+
return;
|
|
62
59
|
}
|
|
60
|
+
} else {
|
|
61
|
+
const connector = (await __ui5_require_async('open/ux/preview/client/flp/WorkspaceConnector')).default;
|
|
62
|
+
// hook the file deletion listener to the UI5 workspace connector
|
|
63
|
+
connector.storage.fileChangeRequestNotifier = this.onChangeSaved.bind(this);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
onChangeSaved(fileName, kind) {
|
|
67
|
+
let change = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
68
|
+
let additionalChangeInfo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
69
|
+
const {
|
|
70
|
+
changeType,
|
|
71
|
+
content
|
|
72
|
+
} = change;
|
|
73
|
+
if (changeType && !['appdescr_fe_changePageConfiguration', 'appdescr_ui_generic_app_changePageConfiguration'].includes(changeType) || kind === 'delete' || this.isReloadPending) {
|
|
74
|
+
this.sendAction(storageFileChanged(fileName?.replace('sap.ui.fl.', '')));
|
|
75
|
+
}
|
|
76
|
+
if (changeType === 'addXML' && additionalChangeInfo?.templateName && content?.fragmentPath) {
|
|
77
|
+
// If there is template available, then we save and reload right away,
|
|
78
|
+
// so we should ignore the first file change event that comes for the fragment.
|
|
79
|
+
// (We don't want to show "Reload" button)
|
|
80
|
+
this.sendAction(storageFileChanged(content.fragmentPath));
|
|
81
|
+
}
|
|
63
82
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
83
|
+
}
|
|
84
|
+
var __exports = {
|
|
85
|
+
__esModule: true
|
|
86
|
+
};
|
|
87
|
+
__exports.WorkspaceConnectorService = WorkspaceConnectorService;
|
|
88
|
+
return __exports;
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=connector-service.js.map
|
|
@@ -1,77 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
contextMenuItems: (actions ?? []).map(val => {
|
|
54
|
-
let enabled = val.enabled;
|
|
55
|
-
let tooltip;
|
|
56
|
-
if (!DialogFactory.canOpenDialog) {
|
|
57
|
-
enabled = false;
|
|
58
|
-
tooltip = resourceBundle.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE');
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
id: val.id,
|
|
62
|
-
title: val.text,
|
|
63
|
-
enabled,
|
|
64
|
-
tooltip
|
|
65
|
-
};
|
|
66
|
-
})
|
|
67
|
-
};
|
|
68
|
-
const requestControlActions = requestControlContextMenu.fulfilled(responsePayload);
|
|
69
|
-
this.sendAction(requestControlActions);
|
|
70
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../adp/dialog-factory", "../i18n", "sap/base/Log", "../utils/core", "../utils/version", "../utils/application"], function (___sap_ux_private_control_property_editor_common, ___adp_dialog_factory, ___i18n, Log, ___utils_core, ___utils_version, ___utils_application) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const executeContextMenuAction = ___sap_ux_private_control_property_editor_common["executeContextMenuAction"];
|
|
7
|
+
const reportTelemetry = ___sap_ux_private_control_property_editor_common["reportTelemetry"];
|
|
8
|
+
const requestControlContextMenu = ___sap_ux_private_control_property_editor_common["requestControlContextMenu"];
|
|
9
|
+
const DialogFactory = ___adp_dialog_factory["DialogFactory"];
|
|
10
|
+
const getTextBundle = ___i18n["getTextBundle"];
|
|
11
|
+
const getControlById = ___utils_core["getControlById"];
|
|
12
|
+
const getUi5Version = ___utils_version["getUi5Version"];
|
|
13
|
+
const getApplicationType = ___utils_application["getApplicationType"];
|
|
14
|
+
/**
|
|
15
|
+
* A Class of ContextMenuService
|
|
16
|
+
*/
|
|
17
|
+
class ContextMenuService {
|
|
18
|
+
sendAction = () => {};
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param rta Runtime Authoring instance.
|
|
22
|
+
*/
|
|
23
|
+
constructor(rta) {
|
|
24
|
+
this.rta = rta;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Initializes rta service.
|
|
29
|
+
*
|
|
30
|
+
* @param sendAction action sender function
|
|
31
|
+
* @param subscribe subscriber function
|
|
32
|
+
*/
|
|
33
|
+
async init(sendAction, subscribe) {
|
|
34
|
+
this.sendAction = sendAction;
|
|
35
|
+
this.actionService = await this.rta.getService('action');
|
|
36
|
+
const resourceBundle = await getTextBundle();
|
|
37
|
+
subscribe(async action => {
|
|
38
|
+
if (executeContextMenuAction.match(action)) {
|
|
39
|
+
const {
|
|
40
|
+
actionName,
|
|
41
|
+
controlId
|
|
42
|
+
} = action.payload;
|
|
43
|
+
await this.actionService.execute(controlId, actionName);
|
|
44
|
+
try {
|
|
45
|
+
const controlName = getControlById(controlId)?.getMetadata().getName();
|
|
46
|
+
const versionInfo = await getUi5Version();
|
|
47
|
+
await reportTelemetry({
|
|
48
|
+
category: 'OutlineContextMenu',
|
|
49
|
+
actionName,
|
|
50
|
+
controlName,
|
|
51
|
+
ui5Version: `${versionInfo.major}.${versionInfo.minor}.${versionInfo.patch}`,
|
|
52
|
+
appType: getApplicationType(this.rta.getRootControlInstance().getManifest())
|
|
71
53
|
});
|
|
54
|
+
} catch (err) {
|
|
55
|
+
Log.error('Error in reporting Telemetry:', err);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (requestControlContextMenu.pending.match(action)) {
|
|
59
|
+
const controlId = action.payload;
|
|
60
|
+
const actions = await this.actionService.get(controlId);
|
|
61
|
+
const responsePayload = {
|
|
62
|
+
controlId: controlId,
|
|
63
|
+
contextMenuItems: (actions ?? []).map(val => {
|
|
64
|
+
let enabled = val.enabled;
|
|
65
|
+
let tooltip;
|
|
66
|
+
if (!DialogFactory.canOpenDialog) {
|
|
67
|
+
enabled = false;
|
|
68
|
+
tooltip = resourceBundle.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE');
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
id: val.id,
|
|
72
|
+
title: val.text,
|
|
73
|
+
enabled,
|
|
74
|
+
tooltip
|
|
75
|
+
};
|
|
76
|
+
})
|
|
77
|
+
};
|
|
78
|
+
const requestControlActions = requestControlContextMenu.fulfilled(responsePayload);
|
|
79
|
+
this.sendAction(requestControlActions);
|
|
72
80
|
}
|
|
81
|
+
});
|
|
73
82
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
83
|
+
}
|
|
84
|
+
var __exports = {
|
|
85
|
+
__esModule: true
|
|
86
|
+
};
|
|
87
|
+
__exports.ContextMenuService = ContextMenuService;
|
|
88
|
+
return __exports;
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=context-menu-service.js.map
|