@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.
Files changed (36) hide show
  1. package/dist/client/adp/command-executor.js +99 -66
  2. package/dist/client/adp/controllers/AddCustomFragment.controller.js +120 -102
  3. package/dist/client/adp/controllers/AddFragment.controller.js +189 -163
  4. package/dist/client/adp/controllers/AddSubpage.controller.js +146 -137
  5. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +230 -188
  6. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -164
  7. package/dist/client/adp/controllers/ControllerExtension.controller.js +329 -253
  8. package/dist/client/adp/controllers/ExtensionPoint.controller.js +158 -114
  9. package/dist/client/adp/extension-point.js +81 -60
  10. package/dist/client/adp/init.js +100 -99
  11. package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +165 -147
  12. package/dist/client/adp/quick-actions/enablement-validator.js +0 -4
  13. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +105 -100
  14. package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -40
  15. package/dist/client/adp/quick-actions/table-quick-action-base.js +309 -266
  16. package/dist/client/adp/sync-views-utils.js +119 -83
  17. package/dist/client/cpe/changes/flex-change.js +64 -48
  18. package/dist/client/cpe/changes/service.js +492 -367
  19. package/dist/client/cpe/communication-service.js +41 -29
  20. package/dist/client/cpe/connector-service.js +87 -64
  21. package/dist/client/cpe/context-menu-service.js +87 -74
  22. package/dist/client/cpe/control-data.js +353 -263
  23. package/dist/client/cpe/documentation.js +183 -126
  24. package/dist/client/cpe/init.js +69 -75
  25. package/dist/client/cpe/outline/service.js +60 -45
  26. package/dist/client/cpe/quick-actions/quick-action-definition.js +0 -4
  27. package/dist/client/cpe/quick-actions/quick-action-service.js +154 -129
  28. package/dist/client/cpe/rta-service.js +91 -69
  29. package/dist/client/cpe/selection.js +239 -187
  30. package/dist/client/cpe/types.js +0 -4
  31. package/dist/client/flp/init.js +403 -296
  32. package/dist/client/manifest.json +7 -4
  33. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +444 -370
  34. package/dist/client/utils/info-center-message.js +59 -31
  35. package/dist/client/utils/version.js +128 -72
  36. package/package.json +4 -4
@@ -1,33 +1,61 @@
1
- 'use strict';
2
- sap.ui.define([
3
- 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
4
- '../cpe/communication-service',
5
- '../i18n'
6
- ], function (___sap_ux_private_control_property_editor_common, ___cpe_communication_service, ___i18n) {
7
- 'use strict';
8
- const showInfoCenterMessage = ___sap_ux_private_control_property_editor_common['showInfoCenterMessage'];
9
- const CommunicationService = ___cpe_communication_service['CommunicationService'];
10
- const getTextBundle = ___i18n['getTextBundle'];
11
- async function sendInfoCenterMessage(_ref) {
12
- let {title, description, details, type} = _ref;
13
- CommunicationService.sendAction(showInfoCenterMessage({
14
- title: await getTranslation(title),
15
- description: await getTranslation(description),
16
- details: await getTranslation(details),
17
- type
18
- }));
1
+ "use strict";
2
+
3
+ sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../cpe/communication-service", "../i18n"], function (___sap_ux_private_control_property_editor_common, ___cpe_communication_service, ___i18n) {
4
+ "use strict";
5
+
6
+ const showInfoCenterMessage = ___sap_ux_private_control_property_editor_common["showInfoCenterMessage"];
7
+ const CommunicationService = ___cpe_communication_service["CommunicationService"];
8
+ const getTextBundle = ___i18n["getTextBundle"];
9
+ /**
10
+ * Localization key interface for defining message keys and optional parameters.
11
+ */
12
+ /**
13
+ * InfoCenterMessage interface for defining the structure of an Info center message.
14
+ * It includes title, description, optional details, and type.
15
+ */
16
+ /**
17
+ * Shows a localized/plain string message in the Info center.
18
+ *
19
+ * @param {InfoCenterMessage} message - The message object containing title, description,
20
+ * details and type for the message. Each text in the message can be localized or
21
+ * left as a plain string.
22
+ */
23
+ async function sendInfoCenterMessage(_ref) {
24
+ let {
25
+ title,
26
+ description,
27
+ details,
28
+ type
29
+ } = _ref;
30
+ CommunicationService.sendAction(showInfoCenterMessage({
31
+ title: await getTranslation(title),
32
+ description: await getTranslation(description),
33
+ details: await getTranslation(details),
34
+ type
35
+ }));
36
+ }
37
+
38
+ /**
39
+ * Util function which returns translation for a localization key or a plain string.
40
+ * If the value is undefined, it returns undefined.
41
+ *
42
+ * @param {LocalizationKey | string | undefined} value - The localization key, plain string or undefined.
43
+ * @returns {Promise<string>} A promise that resolves to the translated string.
44
+ */
45
+ async function getTranslation(value) {
46
+ if (value === undefined) {
47
+ return undefined;
19
48
  }
20
- async function getTranslation(value) {
21
- if (value === undefined) {
22
- return undefined;
23
- }
24
- if (typeof value === 'string') {
25
- return value;
26
- }
27
- const bundle = await getTextBundle();
28
- return bundle.getText(value.key, value.params);
49
+ if (typeof value === 'string') {
50
+ return value;
29
51
  }
30
- var __exports = { __esModule: true };
31
- __exports.sendInfoCenterMessage = sendInfoCenterMessage;
32
- return __exports;
33
- });
52
+ const bundle = await getTextBundle();
53
+ return bundle.getText(value.key, value.params);
54
+ }
55
+ var __exports = {
56
+ __esModule: true
57
+ };
58
+ __exports.sendInfoCenterMessage = sendInfoCenterMessage;
59
+ return __exports;
60
+ });
61
+ //# sourceMappingURL=info-center-message.js.map
@@ -1,74 +1,130 @@
1
- 'use strict';
2
- sap.ui.define([
3
- 'sap/ui/VersionInfo',
4
- 'sap/base/Log',
5
- './info-center-message',
6
- 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common'
7
- ], function (VersionInfo, Log, ___info_center_message, ___sap_ux_private_control_property_editor_common) {
8
- 'use strict';
9
- const sendInfoCenterMessage = ___info_center_message['sendInfoCenterMessage'];
10
- const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
11
- const minVersionInfo = {
12
- major: 1,
13
- minor: 71
14
- };
15
- function checkVersionInfo(versionInfo) {
16
- if (Number.isNaN(versionInfo.major) || Number.isNaN(versionInfo.minor) || Number.isNaN(versionInfo.patch ?? 0)) {
17
- void sendInfoCenterMessage({
18
- title: { key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE' },
19
- description: { key: 'FLP_UI_INVALID_UI5_VERSION_DESCRIPTION' },
20
- type: MessageBarType.error
21
- });
22
- throw new Error('Invalid version info');
23
- }
24
- }
25
- async function getUi5Version() {
26
- let library = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'sap.ui.core';
27
- const versionInfo = await VersionInfo.load();
28
- let version = versionInfo?.libraries?.find(lib => lib.name === library)?.version;
29
- const isCdn = versionInfo?.name === 'SAPUI5 Distribution';
30
- if (!version) {
31
- Log.error('Could not get UI5 version of application. Using version: 1.130.0 as fallback.');
32
- version = '1.130.0';
33
- await sendInfoCenterMessage({
34
- title: { key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE' },
35
- description: {
36
- key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_DESCRIPTION',
37
- params: [version]
38
- },
39
- type: MessageBarType.error
40
- });
41
- }
42
- const [major, minor, patch] = version.split('.').map(versionPart => Number.parseInt(versionPart, 10));
43
- const label = version.split(/-(.*)/s)?.[1];
44
- return {
45
- major,
46
- minor,
47
- patch,
48
- label,
49
- isCdn
50
- };
51
- }
52
- function isLowerThanMinimalUi5Version(ui5VersionInfo) {
53
- let minUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
54
- checkVersionInfo(ui5VersionInfo);
55
- checkVersionInfo(minUi5VersionInfo);
56
- return ui5VersionInfo.major < minUi5VersionInfo.major || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor < minUi5VersionInfo.minor || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor === minUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) < (minUi5VersionInfo?.patch ?? 0);
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/VersionInfo", "sap/base/Log", "./info-center-message", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common"], function (VersionInfo, Log, ___info_center_message, ___sap_ux_private_control_property_editor_common) {
4
+ "use strict";
5
+
6
+ const sendInfoCenterMessage = ___info_center_message["sendInfoCenterMessage"];
7
+ const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
8
+ /**
9
+ * Default minimal supported UI5 version
10
+ */
11
+ const minVersionInfo = {
12
+ major: 1,
13
+ minor: 71
14
+ };
15
+
16
+ /**
17
+ * Check if the given version info is valid.
18
+ * @param versionInfo to check
19
+ * @throws Error if the version info is invalid
20
+ */
21
+ function checkVersionInfo(versionInfo) {
22
+ if (Number.isNaN(versionInfo.major) || Number.isNaN(versionInfo.minor) || Number.isNaN(versionInfo.patch ?? 0)) {
23
+ void sendInfoCenterMessage({
24
+ title: {
25
+ key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE'
26
+ },
27
+ description: {
28
+ key: 'FLP_UI_INVALID_UI5_VERSION_DESCRIPTION'
29
+ },
30
+ type: MessageBarType.error
31
+ });
32
+ throw new Error('Invalid version info');
57
33
  }
58
- function isVersionEqualOrHasNewerPatch(ui5VersionInfo) {
59
- let targetUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
60
- checkVersionInfo(ui5VersionInfo);
61
- checkVersionInfo(targetUi5VersionInfo);
62
- return ui5VersionInfo.major === targetUi5VersionInfo.major && ui5VersionInfo.minor === targetUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) >= (targetUi5VersionInfo?.patch ?? 0);
34
+ }
35
+
36
+ /**
37
+ * Retrieve the UI5 version.
38
+ * If no library is given, the version from 'sap.ui.core' will be retrieved.
39
+ * Note that the patch version of actual SAPUI5 version might differ from the lib that has been used for the version request (e.g. SAPUI5 1.96.38 contains sap.ui.core 1.96.36).
40
+ * For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
41
+ *
42
+ * @param library - (optional) specific library name to get the version from, e.g. 'sap.m'
43
+ * @returns Ui5VersionInfo
44
+ */
45
+ async function getUi5Version() {
46
+ let library = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'sap.ui.core';
47
+ const versionInfo = await VersionInfo.load();
48
+ let version = versionInfo?.libraries?.find(lib => lib.name === library)?.version;
49
+ const isCdn = versionInfo?.name === 'SAPUI5 Distribution';
50
+ if (!version) {
51
+ Log.error('Could not get UI5 version of application. Using version: 1.130.0 as fallback.');
52
+ version = '1.130.0';
53
+ await sendInfoCenterMessage({
54
+ title: {
55
+ key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE'
56
+ },
57
+ description: {
58
+ key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_DESCRIPTION',
59
+ params: [version]
60
+ },
61
+ type: MessageBarType.error
62
+ });
63
63
  }
64
- function getFullyQualifiedUi5Version(ui5VersionInfo) {
65
- return `${ ui5VersionInfo.major }.${ ui5VersionInfo.minor }`;
66
- }
67
- var __exports = { __esModule: true };
68
- __exports.minVersionInfo = minVersionInfo;
69
- __exports.getUi5Version = getUi5Version;
70
- __exports.isLowerThanMinimalUi5Version = isLowerThanMinimalUi5Version;
71
- __exports.isVersionEqualOrHasNewerPatch = isVersionEqualOrHasNewerPatch;
72
- __exports.getFullyQualifiedUi5Version = getFullyQualifiedUi5Version;
73
- return __exports;
74
- });
64
+ const [major, minor, patch] = version.split('.').map(versionPart => Number.parseInt(versionPart, 10));
65
+ const label = version.split(/-(.*)/s)?.[1];
66
+ return {
67
+ major,
68
+ minor,
69
+ patch,
70
+ label,
71
+ isCdn
72
+ };
73
+ }
74
+
75
+ /**
76
+ * Checks if the given version is lower than the required minimal version.
77
+ * Note that the patch version of actual SAPUI5 version might differ from the lib that has been used for the version request (e.g. SAPUI5 1.96.38 contains sap.ui.core 1.96.36).
78
+ * For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
79
+ *
80
+ * @param ui5VersionInfo to check
81
+ * @param minUi5VersionInfo to check against (default is 1.71)
82
+ * @throws Error if the version info is invalid
83
+ *
84
+ * @returns boolean
85
+ */
86
+ function isLowerThanMinimalUi5Version(ui5VersionInfo) {
87
+ let minUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
88
+ checkVersionInfo(ui5VersionInfo);
89
+ checkVersionInfo(minUi5VersionInfo);
90
+ return ui5VersionInfo.major < minUi5VersionInfo.major || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor < minUi5VersionInfo.minor || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor === minUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) < (minUi5VersionInfo?.patch ?? 0);
91
+ }
92
+
93
+ /**
94
+ * Checks if the given version is equal to the specified version.
95
+ * Note that the patch version of actual SAPUI5 version might differ from the lib that has been used for the version request (e.g. SAPUI5 1.96.38 contains sap.ui.core 1.96.36).
96
+ * For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
97
+ *
98
+ * @param ui5VersionInfo to check
99
+ * @param targetUi5VersionInfo to check against (default is 1.71)
100
+ * @throws Error if the version info is invalid
101
+ *
102
+ * @returns boolean
103
+ */
104
+ function isVersionEqualOrHasNewerPatch(ui5VersionInfo) {
105
+ let targetUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
106
+ checkVersionInfo(ui5VersionInfo);
107
+ checkVersionInfo(targetUi5VersionInfo);
108
+ return ui5VersionInfo.major === targetUi5VersionInfo.major && ui5VersionInfo.minor === targetUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) >= (targetUi5VersionInfo?.patch ?? 0);
109
+ }
110
+
111
+ /**
112
+ * Returns the fully qualified UI5 version string - major and minor version concatenated.
113
+ *
114
+ * @param {Ui5VersionInfo} ui5VersionInfo - The ui5 version info object containing major and minor version.
115
+ * @returns {string} The fully qualified UI5 version string.
116
+ */
117
+ function getFullyQualifiedUi5Version(ui5VersionInfo) {
118
+ return `${ui5VersionInfo.major}.${ui5VersionInfo.minor}`;
119
+ }
120
+ var __exports = {
121
+ __esModule: true
122
+ };
123
+ __exports.minVersionInfo = minVersionInfo;
124
+ __exports.getUi5Version = getUi5Version;
125
+ __exports.isLowerThanMinimalUi5Version = isLowerThanMinimalUi5Version;
126
+ __exports.isVersionEqualOrHasNewerPatch = isVersionEqualOrHasNewerPatch;
127
+ __exports.getFullyQualifiedUi5Version = getFullyQualifiedUi5Version;
128
+ return __exports;
129
+ });
130
+ //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
11
11
  },
12
- "version": "0.23.48",
12
+ "version": "0.23.50",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "qrcode": "1.5.4",
29
29
  "@sap/bas-sdk": "3.12.0",
30
- "@sap-ux/adp-tooling": "0.17.7",
30
+ "@sap-ux/adp-tooling": "0.17.8",
31
31
  "@sap-ux/btp-utils": "1.1.5",
32
32
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.2",
33
33
  "@sap-ux/feature-toggle": "0.3.4",
@@ -53,10 +53,10 @@
53
53
  "nock": "13.4.0",
54
54
  "npm-run-all2": "6.2.0",
55
55
  "supertest": "7.1.4",
56
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.17.3",
56
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.17.4",
57
57
  "@sap-ux/axios-extension": "1.24.2",
58
58
  "@sap-ux/store": "1.3.3",
59
- "@sap-ux/ui5-info": "0.13.1"
59
+ "@sap-ux/ui5-info": "0.13.2"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "express": "4"