@sap-ux/preview-middleware 0.16.112 → 0.16.114

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 (42) hide show
  1. package/dist/client/adp/quick-actions/common/create-page-action.js +2 -3
  2. package/dist/client/adp/quick-actions/common/create-page-action.ts +1 -5
  3. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +1 -8
  4. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +1 -10
  5. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +1 -8
  6. package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +0 -8
  7. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +1 -12
  8. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +0 -11
  9. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +5 -1
  10. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +5 -1
  11. package/dist/client/adp/quick-actions/fe-v2/registry.js +2 -2
  12. package/dist/client/adp/quick-actions/fe-v2/registry.ts +6 -5
  13. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +1 -12
  14. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +0 -11
  15. package/dist/client/adp/quick-actions/fe-v4/registry.js +2 -2
  16. package/dist/client/adp/quick-actions/fe-v4/registry.ts +6 -6
  17. package/dist/client/adp/quick-actions/fe-v4/utils.js +4 -44
  18. package/dist/client/adp/quick-actions/fe-v4/utils.ts +2 -47
  19. package/dist/client/cpe/changes/flex-change.js +60 -51
  20. package/dist/client/cpe/changes/flex-change.ts +59 -26
  21. package/dist/client/cpe/changes/service.js +150 -34
  22. package/dist/client/cpe/changes/service.ts +239 -54
  23. package/dist/client/cpe/control-data.js +104 -28
  24. package/dist/client/cpe/control-data.ts +134 -43
  25. package/dist/client/cpe/init.js +3 -3
  26. package/dist/client/cpe/init.ts +5 -8
  27. package/dist/client/cpe/outline/editable.js +3 -3
  28. package/dist/client/cpe/outline/editable.ts +3 -2
  29. package/dist/client/cpe/outline/nodes.js +39 -9
  30. package/dist/client/cpe/outline/nodes.ts +61 -10
  31. package/dist/client/cpe/outline/service.js +3 -2
  32. package/dist/client/cpe/outline/service.ts +11 -3
  33. package/dist/client/cpe/selection.js +29 -16
  34. package/dist/client/cpe/selection.ts +38 -20
  35. package/dist/client/cpe/utils.js +42 -1
  36. package/dist/client/cpe/utils.ts +74 -0
  37. package/dist/client/messagebundle.properties +4 -4
  38. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +7 -1
  39. package/dist/client/tsconfig.tsbuildinfo +1 -1
  40. package/dist/client/utils/fe-v4.js +87 -0
  41. package/dist/client/utils/fe-v4.ts +81 -0
  42. package/package.json +5 -5
@@ -0,0 +1,81 @@
1
+ import ManagedObject from 'sap/ui/base/ManagedObject';
2
+ import TemplateComponent from 'sap/fe/core/TemplateComponent';
3
+ import Component from 'sap/ui/core/Component';
4
+ import AppComponent from 'sap/fe/core/AppComponent';
5
+ import XMLView from 'sap/ui/core/mvc/XMLView';
6
+ import type { Manifest } from 'sap/ui/rta/RuntimeAuthoring';
7
+ import { isA } from './core';
8
+
9
+
10
+ /**
11
+ * Gets app component of a v4 project.
12
+ *
13
+ * @param control - ManagedObject.
14
+ * @returns AppComponent.
15
+ */
16
+ export function getAppComponent(control: ManagedObject): AppComponent | undefined {
17
+ const ownerComponent = Component.getOwnerComponentFor(control);
18
+ if (ownerComponent?.isA<TemplateComponent>('sap.fe.core.TemplateComponent')) {
19
+ return ownerComponent.getAppComponent();
20
+ }
21
+ return undefined;
22
+ }
23
+
24
+ /**
25
+ * Gets reference id of the app.
26
+ *
27
+ * @param control - ManagedObject.
28
+ * @returns string.
29
+ */
30
+ export function getReference(control: ManagedObject): string {
31
+ const manifest = getAppComponent(control)?.getManifest() as Manifest;
32
+ return manifest?.['sap.app']?.id ?? '';
33
+ }
34
+
35
+ /**
36
+ * Determines the page type of v4 app.
37
+ *
38
+ * @param control - ManagedObject.
39
+ * @returns 'ObjectPage' | 'ListReport' | undefined.
40
+ */
41
+ export function getV4PageType(control: ManagedObject): 'ObjectPage' | 'ListReport' | undefined {
42
+ const component = Component.getOwnerComponentFor(control);
43
+ if (!component?.isA<TemplateComponent>('sap.fe.core.TemplateComponent')) {
44
+ return undefined;
45
+ }
46
+ const view = component.getRootControl();
47
+ const name = (view as XMLView).getViewName();
48
+ if (name === 'sap.fe.templates.ObjectPage.ObjectPage') {
49
+ return 'ObjectPage';
50
+ }
51
+ if (name === 'sap.fe.templates.ListReport.ListReport') {
52
+ return 'ListReport';
53
+ }
54
+ return undefined;
55
+ }
56
+
57
+ /**
58
+ * Get the containing page name of a control.
59
+ *
60
+ * @param control - UI5 control instance.
61
+ * @returns Page name to which the control belongs.
62
+ */
63
+ export function getPageName(control: ManagedObject): string | undefined {
64
+ const component = Component.getOwnerComponentFor(control);
65
+ if (!isA<TemplateComponent>('sap.fe.core.TemplateComponent', component)) {
66
+ return undefined;
67
+ }
68
+ const view = component.getRootControl();
69
+ return view.getId().split('::').pop();
70
+ }
71
+
72
+ export function getConfigMapControlIdMap(page: string | undefined, propertyPathSegments: string[]): string {
73
+ if (page && !propertyPathSegments.length) {
74
+ return page;
75
+ }
76
+
77
+ if (page) {
78
+ return `${page}-${propertyPathSegments.join('/')}`;
79
+ }
80
+ return propertyPathSegments.join('/');
81
+ }
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.16.112",
12
+ "version": "0.16.114",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -25,12 +25,12 @@
25
25
  "ejs": "3.1.10",
26
26
  "mem-fs": "2.1.0",
27
27
  "mem-fs-editor": "9.4.0",
28
+ "@sap-ux/btp-utils": "0.16.0",
28
29
  "@sap-ux/logger": "0.6.0",
29
30
  "@sap-ux/feature-toggle": "0.2.2",
30
- "@sap-ux/btp-utils": "0.16.0",
31
31
  "@sap-ux/adp-tooling": "0.12.75",
32
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.24",
33
- "@sap-ux/project-access": "1.28.6"
32
+ "@sap-ux/project-access": "1.28.6",
33
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.25"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/ejs": "3.1.2",
@@ -46,7 +46,7 @@
46
46
  "supertest": "6.3.3",
47
47
  "@sap-ux-private/playwright": "0.1.0",
48
48
  "dotenv": "16.3.1",
49
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.25",
49
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.28",
50
50
  "@sap-ux/axios-extension": "1.17.2",
51
51
  "@sap-ux/store": "0.9.3",
52
52
  "@sap-ux/ui5-info": "0.8.3",