@sap-ux/preview-middleware 0.8.7 → 0.9.0

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.
@@ -0,0 +1,103 @@
1
+ import type View from 'sap/ui/core/mvc/View';
2
+ import type UI5Element from 'sap/ui/core/Element';
3
+ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
4
+ import AddXMLAtExtensionPoint from 'sap/ui/rta/plugin/AddXMLAtExtensionPoint';
5
+ import CommandFactory from 'sap/ui/rta/command/CommandFactory';
6
+
7
+ import { ExternalAction, addExtensionPoint } from '@sap-ux-private/control-property-editor-common';
8
+
9
+ import { Deferred, createDeferred } from './utils';
10
+
11
+ import { SubscribeFunction } from '../cpe/types';
12
+ import { DialogNames, handler } from './init-dialogs';
13
+
14
+ type ActionService = {
15
+ execute: (controlId: string, actionId: string) => void;
16
+ };
17
+
18
+ type DeferredExtPointData = {
19
+ fragmentPath: string;
20
+ extensionPointName: string | undefined;
21
+ };
22
+
23
+ export interface ExtensionPointData {
24
+ name: string;
25
+ deffered: Deferred<DeferredExtPointData>;
26
+ index?: number;
27
+ view?: View;
28
+ createdControls?: [];
29
+ fragmentId?: string;
30
+ aggregation?: string[];
31
+ aggregationName?: string;
32
+ defaultContent?: string[];
33
+ targetControl?: UI5Element;
34
+ }
35
+
36
+ export default class ExtensionPointService {
37
+ private readonly actionId = 'CTX_ADDXML_AT_EXTENSIONPOINT';
38
+
39
+ /**
40
+ * @param rta Runtime Authoring
41
+ */
42
+ constructor(private readonly rta: RuntimeAuthoring) {}
43
+
44
+ /**
45
+ * Initializes communication with CPE, and the extension point plugin.
46
+ *
47
+ * @param subscribe Handles actions from CPE
48
+ */
49
+ public init(subscribe: SubscribeFunction) {
50
+ this.initPlugin();
51
+ subscribe(async (action: ExternalAction): Promise<void> => {
52
+ if (addExtensionPoint.match(action)) {
53
+ try {
54
+ const { controlId } = action.payload;
55
+
56
+ const service = await this.rta.getService<ActionService>('action');
57
+
58
+ service.execute(controlId, this.actionId);
59
+ } catch (e) {
60
+ throw new Error(`Failed to execute service with actionId: ${this.actionId}`);
61
+ }
62
+ }
63
+ });
64
+ }
65
+
66
+ /**
67
+ * Initializes Add XML at Extension Point plugin and adds it to the default RTA plugins.
68
+ */
69
+ public initPlugin() {
70
+ const flexSettings = this.rta.getFlexSettings();
71
+ const commandFactory = new CommandFactory({
72
+ flexSettings
73
+ });
74
+
75
+ const plugin = new AddXMLAtExtensionPoint({
76
+ commandFactory,
77
+ fragmentHandler: async (overlay: UI5Element, info: ExtensionPointData[]) =>
78
+ await this.fragmentHandler(overlay, info[0])
79
+ });
80
+
81
+ const defaultPlugins = this.rta.getDefaultPlugins();
82
+ defaultPlugins.addXMLAtExtensionPoint = plugin;
83
+ this.rta.setPlugins(defaultPlugins);
84
+ }
85
+
86
+ /**
87
+ * Handler function for AddXMLAtExtensionPoint plugin.
88
+ *
89
+ * @param overlay UI5 Element overlay
90
+ * @param info Extension point data from the plugin
91
+ * @returns Deffered extension point data that is provided to the plugin
92
+ */
93
+ public async fragmentHandler(overlay: UI5Element, info: ExtensionPointData): Promise<DeferredExtPointData> {
94
+ let deffered = createDeferred<DeferredExtPointData>();
95
+
96
+ await handler(overlay, this.rta, DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT, {
97
+ name: info.name,
98
+ deffered
99
+ } as ExtensionPointData);
100
+
101
+ return deffered.promise;
102
+ }
103
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/ui/core/mvc/XMLView", "./controllers/AddFragment.controller", "./controllers/ControllerExtension.controller"], function (XMLView, __AddFragment, __ControllerExtension) {
3
+ sap.ui.define(["sap/ui/core/mvc/XMLView", "./controllers/AddFragment.controller", "./controllers/ControllerExtension.controller", "./controllers/ExtensionPoint.controller"], function (XMLView, __AddFragment, __ControllerExtension, __ExtensionPoint) {
4
4
  "use strict";
5
5
 
6
6
  function _interopRequireDefault(obj) {
@@ -8,9 +8,11 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "./controllers/AddFragment.controller"
8
8
  }
9
9
  const AddFragment = _interopRequireDefault(__AddFragment);
10
10
  const ControllerExtension = _interopRequireDefault(__ControllerExtension);
11
+ const ExtensionPoint = _interopRequireDefault(__ExtensionPoint);
11
12
  var DialogNames = /*#__PURE__*/function (DialogNames) {
12
13
  DialogNames["ADD_FRAGMENT"] = "AddFragment";
13
14
  DialogNames["CONTROLLER_EXTENSION"] = "ControllerExtension";
15
+ DialogNames["ADD_FRAGMENT_AT_EXTENSION_POINT"] = "ExtensionPoint";
14
16
  return DialogNames;
15
17
  }(DialogNames || {});
16
18
  /**
@@ -40,12 +42,26 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "./controllers/AddFragment.controller"
40
42
  * @param overlays Control overlays
41
43
  * @param rta Runtime Authoring
42
44
  * @param dialogName Dialog name
45
+ * @param extensionPointData Control ID
43
46
  */
44
- async function handler(overlays, rta, dialogName) {
45
- const controller = dialogName === DialogNames.ADD_FRAGMENT ? new AddFragment(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta) : new ControllerExtension(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta);
47
+ async function handler(overlays, rta, dialogName, extensionPointData) {
48
+ let controller;
49
+ switch (dialogName) {
50
+ case DialogNames.ADD_FRAGMENT:
51
+ controller = new AddFragment(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta);
52
+ break;
53
+ case DialogNames.CONTROLLER_EXTENSION:
54
+ controller = new ControllerExtension(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta);
55
+ break;
56
+ case DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT:
57
+ controller = new ExtensionPoint(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta, extensionPointData);
58
+ break;
59
+ }
60
+ const id = dialogName === DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT ? `dialog--${dialogName}` : undefined;
46
61
  await XMLView.create({
47
62
  viewName: `open.ux.preview.client.adp.ui.${dialogName}`,
48
- controller
63
+ controller,
64
+ id
49
65
  });
50
66
  }
51
67
  var __exports = {
@@ -7,12 +7,17 @@ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
7
7
 
8
8
  import AddFragment from './controllers/AddFragment.controller';
9
9
  import ControllerExtension from './controllers/ControllerExtension.controller';
10
+ import { ExtensionPointData } from './extension-point';
11
+ import ExtensionPoint from './controllers/ExtensionPoint.controller';
10
12
 
11
13
  export const enum DialogNames {
12
14
  ADD_FRAGMENT = 'AddFragment',
13
- CONTROLLER_EXTENSION = 'ControllerExtension'
15
+ CONTROLLER_EXTENSION = 'ControllerExtension',
16
+ ADD_FRAGMENT_AT_EXTENSION_POINT = 'ExtensionPoint'
14
17
  }
15
18
 
19
+ type Controller = AddFragment | ControllerExtension | ExtensionPoint;
20
+
16
21
  /**
17
22
  * Adds a new item to the context menu
18
23
  *
@@ -42,15 +47,38 @@ export const initDialogs = (rta: RuntimeAuthoring): void => {
42
47
  * @param overlays Control overlays
43
48
  * @param rta Runtime Authoring
44
49
  * @param dialogName Dialog name
50
+ * @param extensionPointData Control ID
45
51
  */
46
- export async function handler(overlays: UI5Element, rta: RuntimeAuthoring, dialogName: DialogNames): Promise<void> {
47
- const controller =
48
- dialogName === DialogNames.ADD_FRAGMENT
49
- ? new AddFragment(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta)
50
- : new ControllerExtension(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta);
52
+ export async function handler(
53
+ overlays: UI5Element,
54
+ rta: RuntimeAuthoring,
55
+ dialogName: DialogNames,
56
+ extensionPointData?: ExtensionPointData
57
+ ): Promise<void> {
58
+ let controller: Controller;
59
+
60
+ switch (dialogName) {
61
+ case DialogNames.ADD_FRAGMENT:
62
+ controller = new AddFragment(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta);
63
+ break;
64
+ case DialogNames.CONTROLLER_EXTENSION:
65
+ controller = new ControllerExtension(`open.ux.preview.client.adp.controllers.${dialogName}`, overlays, rta);
66
+ break;
67
+ case DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT:
68
+ controller = new ExtensionPoint(
69
+ `open.ux.preview.client.adp.controllers.${dialogName}`,
70
+ overlays,
71
+ rta,
72
+ extensionPointData!
73
+ );
74
+ break;
75
+ }
76
+
77
+ const id = dialogName === DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT ? `dialog--${dialogName}` : undefined;
51
78
 
52
79
  await XMLView.create({
53
80
  viewName: `open.ux.preview.client.adp.ui.${dialogName}`,
54
- controller
81
+ controller,
82
+ id
55
83
  });
56
84
  }
@@ -1,20 +1,38 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/base/Log", "../cpe/init", "./init-dialogs"], function (log, __init, ___init_dialogs) {
4
- "use strict";
5
-
6
- function _interopRequireDefault(obj) {
7
- return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
8
- }
9
- const init = _interopRequireDefault(__init);
10
- const initDialogs = ___init_dialogs["initDialogs"];
11
- var __exports = function (rta) {
12
- // initialize fragment content menu entry
13
- initDialogs(rta);
14
- // also initialize the editor
15
- init(rta);
16
- log.debug('ADP init executed.');
17
- };
18
- return __exports;
19
- });
20
- //# sourceMappingURL=init.js.map
1
+ 'use strict';
2
+ sap.ui.define([
3
+ 'sap/base/Log',
4
+ '../cpe/init',
5
+ './init-dialogs',
6
+ 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
7
+ './extension-point'
8
+ ], function (log, __init, ___init_dialogs, ___sap_ux_private_control_property_editor_common, __ExtensionPointService) {
9
+ 'use strict';
10
+ function _interopRequireDefault(obj) {
11
+ return obj && obj.__esModule && typeof obj.default !== 'undefined' ? obj.default : obj;
12
+ }
13
+ const init = _interopRequireDefault(__init);
14
+ const initDialogs = ___init_dialogs['initDialogs'];
15
+ const startPostMessageCommunication = ___sap_ux_private_control_property_editor_common['startPostMessageCommunication'];
16
+ const ExtensionPointService = _interopRequireDefault(__ExtensionPointService);
17
+ var __exports = function (rta) {
18
+ const extPointService = new ExtensionPointService(rta);
19
+ const actionHandlers = [];
20
+ function subscribe(handler) {
21
+ actionHandlers.push(handler);
22
+ }
23
+ startPostMessageCommunication(window.parent, async function onAction(action) {
24
+ for (const handler of actionHandlers) {
25
+ try {
26
+ await handler(action);
27
+ } catch (error) {
28
+ log.error('Handler Failed: ', error);
29
+ }
30
+ }
31
+ });
32
+ initDialogs(rta);
33
+ extPointService.init(subscribe);
34
+ init(rta);
35
+ log.debug('ADP init executed.');
36
+ };
37
+ return __exports;
38
+ });
@@ -3,10 +3,34 @@ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
3
3
 
4
4
  import init from '../cpe/init';
5
5
  import { initDialogs } from './init-dialogs';
6
+ import { ExternalAction, startPostMessageCommunication } from '@sap-ux-private/control-property-editor-common';
7
+ import { ActionHandler } from '../cpe/types';
8
+ import ExtensionPointService from './extension-point';
6
9
 
7
10
  export default function (rta: RuntimeAuthoring) {
11
+ const extPointService = new ExtensionPointService(rta);
12
+ const actionHandlers: ActionHandler[] = [];
13
+ /**
14
+ *
15
+ * @param handler action handler
16
+ */
17
+ function subscribe(handler: ActionHandler): void {
18
+ actionHandlers.push(handler);
19
+ }
20
+
21
+ startPostMessageCommunication<ExternalAction>(window.parent, async function onAction(action) {
22
+ for (const handler of actionHandlers) {
23
+ try {
24
+ await handler(action);
25
+ } catch (error) {
26
+ log.error('Handler Failed: ', error);
27
+ }
28
+ }
29
+ });
8
30
  // initialize fragment content menu entry
9
31
  initDialogs(rta);
32
+ // initialize extension point service
33
+ extPointService.init(subscribe);
10
34
  // also initialize the editor
11
35
  init(rta);
12
36
  log.debug('ADP init executed.');
@@ -0,0 +1,40 @@
1
+ <mvc:View xmlns:mvc="sap.ui.core.mvc"
2
+ xmlns="sap.m"
3
+ xmlns:core="sap.ui.core"
4
+ xmlns:f="sap.ui.layout.form">
5
+ <Dialog id="addFragmentAtExtPointDialog" title="Add XML Fragment at Extension Point" contentWidth="500px" class="sapUiRTABorder">
6
+ <content>
7
+ <f:SimpleForm id="addFragmentAtExtPointDialog_Form"
8
+ editable="true"
9
+ layout="ResponsiveGridLayout"
10
+ labelSpanS="4"
11
+ singleContainerFullSize="false">
12
+ <f:content>
13
+ <Label text="Extension Point" />
14
+ <Text text="{/extensionPointName}" />
15
+ <Label text="Fragment Name" />
16
+ <Input
17
+ description=".fragment.xml"
18
+ value="{/newFragmentName}"
19
+ liveChange="onFragmentNameInputChange">
20
+ </Input>
21
+ </f:content>
22
+ </f:SimpleForm>
23
+ </content>
24
+ <beginButton>
25
+ <Button
26
+ id="createDialogBtn"
27
+ text="Create"
28
+ press="onCreateBtnPress"
29
+ enabled="false"
30
+ type="Emphasized" />
31
+ </beginButton>
32
+ <endButton>
33
+ <Button
34
+ id="closeDialogBtn"
35
+ text="Cancel"
36
+ press="handleDialogClose"
37
+ type="Reject" />
38
+ </endButton>
39
+ </Dialog>
40
+ </mvc:View>
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * Defers the resolution of the promise, stores resolve/reject functions so that they can be accessed at a later stage.
8
+ *
9
+ * @description A Deferred object contains an unresolved promise along with the functions to resolve or reject that promise.
10
+ *
11
+ * @returns {Deferred} Deferred object
12
+ */
13
+ function createDeferred() {
14
+ let resolve = null;
15
+ let reject = null;
16
+ const promise = new Promise((res, rej) => {
17
+ resolve = res;
18
+ reject = rej;
19
+ });
20
+ if (resolve === null || reject === null) {
21
+ throw new Error('Failed to initialize resolve and reject functions.');
22
+ }
23
+ return {
24
+ promise,
25
+ resolve,
26
+ reject
27
+ };
28
+ }
29
+ var __exports = {
30
+ __esModule: true
31
+ };
32
+ __exports.createDeferred = createDeferred;
33
+ return __exports;
34
+ });
35
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,28 @@
1
+ export interface Deferred<T> {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ reject: (reason?: unknown) => void;
5
+ }
6
+
7
+ /**
8
+ * Defers the resolution of the promise, stores resolve/reject functions so that they can be accessed at a later stage.
9
+ *
10
+ * @description A Deferred object contains an unresolved promise along with the functions to resolve or reject that promise.
11
+ *
12
+ * @returns {Deferred} Deferred object
13
+ */
14
+ export function createDeferred<T>(): Deferred<T> {
15
+ let resolve: Deferred<T>['resolve'] | null = null;
16
+ let reject: Deferred<T>['reject'] | null = null;
17
+
18
+ const promise = new Promise<T>((res, rej) => {
19
+ resolve = res;
20
+ reject = rej;
21
+ });
22
+
23
+ if (resolve === null || reject === null) {
24
+ throw new Error('Failed to initialize resolve and reject functions.');
25
+ }
26
+
27
+ return { promise, resolve, reject };
28
+ }
@@ -9,10 +9,11 @@ sap.ui.define([
9
9
  const transformNodes = ___nodes['transformNodes'];
10
10
  async function initOutline(rta, sendAction) {
11
11
  const outline = await rta.getService('outline');
12
+ const scenario = rta.getFlexSettings().scenario;
12
13
  async function syncOutline() {
13
14
  try {
14
15
  const viewNodes = await outline.get();
15
- const outlineNodes = await transformNodes(viewNodes);
16
+ const outlineNodes = await transformNodes(viewNodes, scenario);
16
17
  sendAction(outlineChanged(outlineNodes));
17
18
  } catch (error) {
18
19
  Log.error('Outline sync failed!', error);
@@ -14,10 +14,11 @@ import Log from 'sap/base/Log';
14
14
  */
15
15
  export async function initOutline(rta: RuntimeAuthoring, sendAction: (action: ExternalAction) => void): Promise<void> {
16
16
  const outline = await rta.getService<OutlineService>('outline');
17
+ const scenario = rta.getFlexSettings().scenario;
17
18
  async function syncOutline() {
18
19
  try {
19
20
  const viewNodes = await outline.get();
20
- const outlineNodes = await transformNodes(viewNodes);
21
+ const outlineNodes = await transformNodes(viewNodes, scenario);
21
22
 
22
23
  sendAction(outlineChanged(outlineNodes));
23
24
  } catch (error) {
@@ -4,6 +4,12 @@ sap.ui.define(["./utils"], function (___utils) {
4
4
  "use strict";
5
5
 
6
6
  const isEditable = ___utils["isEditable"];
7
+ /**
8
+ * Retrieves additional data for a given control ID.
9
+ *
10
+ * @param id The control ID for which to retrieve additional data
11
+ * @returns An object containing additional data, including an optional 'text' property
12
+ */
7
13
  function getAdditionalData(id) {
8
14
  const control = sap.ui.getCore().byId(id);
9
15
  if (control?.getMetadata().getProperty('text')) {
@@ -17,31 +23,54 @@ sap.ui.define(["./utils"], function (___utils) {
17
23
  return {};
18
24
  }
19
25
 
26
+ /**
27
+ * Gets the children nodes of an aggregation type node.
28
+ *
29
+ * @param current The current node to retrieve children from
30
+ * @returns An array of children nodes, or an empty array if none are found
31
+ */
32
+ function getChildren(current) {
33
+ return (current.elements ?? []).flatMap(element => element.type === 'aggregation' ? element.elements ?? [] : []);
34
+ }
35
+
20
36
  /**
21
37
  * Transform node.
22
38
  *
23
39
  * @param input outline view node
24
- * @param getAdditionalData gets additional data for give control id.
40
+ * @param scenario type of project
25
41
  * @returns Promise<OutlineNode[]>
26
42
  */
27
- async function transformNodes(input) {
43
+ async function transformNodes(input, scenario) {
28
44
  const stack = [...input];
29
45
  const items = [];
30
46
  while (stack.length) {
31
47
  const current = stack.shift();
32
48
  const editable = await isEditable(current?.id);
33
49
  if (current?.type === 'element') {
34
- const children = (current.elements ?? []).flatMap(element => element.type === 'aggregation' ? element.elements ?? [] : []);
50
+ const children = getChildren(current);
35
51
  const {
36
52
  text
37
53
  } = getAdditionalData(current.id);
54
+ const technicalName = current.technicalName.split('.').slice(-1)[0];
55
+ const node = {
56
+ controlId: current.id,
57
+ controlType: current.technicalName,
58
+ name: text ?? technicalName,
59
+ editable,
60
+ visible: current.visible ?? true,
61
+ children: await transformNodes(children, scenario)
62
+ };
63
+ items.push(node);
64
+ }
65
+ if (scenario === 'ADAPTATION_PROJECT' && current?.type === 'extensionPoint') {
38
66
  const node = {
39
67
  controlId: current.id,
40
68
  controlType: current.technicalName,
41
- name: text ?? current.technicalName.split('.').slice(-1)[0],
69
+ name: current.name,
42
70
  editable,
43
71
  visible: current.visible ?? true,
44
- children: await transformNodes(children)
72
+ children: [],
73
+ icon: current.icon
45
74
  };
46
75
  items.push(node);
47
76
  }
@@ -1,7 +1,16 @@
1
1
  import type { OutlineNode } from '@sap-ux-private/control-property-editor-common';
2
- import { isEditable } from './utils';
2
+
3
3
  import type { OutlineViewNode } from 'sap/ui/rta/command/OutlineService';
4
+ import type { Scenario } from 'sap/ui/fl/Scenario';
5
+
6
+ import { isEditable } from './utils';
4
7
 
8
+ /**
9
+ * Retrieves additional data for a given control ID.
10
+ *
11
+ * @param id The control ID for which to retrieve additional data
12
+ * @returns An object containing additional data, including an optional 'text' property
13
+ */
5
14
  function getAdditionalData(id: string): { text?: string } {
6
15
  const control = sap.ui.getCore().byId(id);
7
16
  if (control?.getMetadata().getProperty('text')) {
@@ -15,32 +24,57 @@ function getAdditionalData(id: string): { text?: string } {
15
24
  return {};
16
25
  }
17
26
 
27
+ /**
28
+ * Gets the children nodes of an aggregation type node.
29
+ *
30
+ * @param current The current node to retrieve children from
31
+ * @returns An array of children nodes, or an empty array if none are found
32
+ */
33
+ function getChildren(current: OutlineViewNode): OutlineViewNode[] {
34
+ return (current.elements ?? []).flatMap((element: OutlineViewNode) =>
35
+ element.type === 'aggregation' ? element.elements ?? [] : []
36
+ );
37
+ }
38
+
18
39
  /**
19
40
  * Transform node.
20
41
  *
21
42
  * @param input outline view node
22
- * @param getAdditionalData gets additional data for give control id.
43
+ * @param scenario type of project
23
44
  * @returns Promise<OutlineNode[]>
24
45
  */
25
- export async function transformNodes(input: OutlineViewNode[]): Promise<OutlineNode[]> {
46
+ export async function transformNodes(input: OutlineViewNode[], scenario: Scenario): Promise<OutlineNode[]> {
26
47
  const stack = [...input];
27
48
  const items: OutlineNode[] = [];
28
49
  while (stack.length) {
29
50
  const current = stack.shift();
30
51
  const editable = await isEditable(current?.id);
31
52
  if (current?.type === 'element') {
32
- const children = (current.elements ?? []).flatMap((element: OutlineViewNode) =>
33
- element.type === 'aggregation' ? element.elements ?? [] : []
34
- );
53
+ const children = getChildren(current);
35
54
  const { text } = getAdditionalData(current.id);
55
+ const technicalName = current.technicalName.split('.').slice(-1)[0];
56
+
57
+ const node: OutlineNode = {
58
+ controlId: current.id,
59
+ controlType: current.technicalName,
60
+ name: text ?? technicalName,
61
+ editable,
62
+ visible: current.visible ?? true,
63
+ children: await transformNodes(children, scenario)
64
+ };
65
+
66
+ items.push(node);
67
+ }
36
68
 
69
+ if (scenario === 'ADAPTATION_PROJECT' && current?.type === 'extensionPoint') {
37
70
  const node: OutlineNode = {
38
71
  controlId: current.id,
39
72
  controlType: current.technicalName,
40
- name: text ?? current.technicalName.split('.').slice(-1)[0],
73
+ name: current.name!,
41
74
  editable,
42
75
  visible: current.visible ?? true,
43
- children: await transformNodes(children)
76
+ children: [],
77
+ icon: current.icon
44
78
  };
45
79
 
46
80
  items.push(node);
@@ -8,7 +8,7 @@ sap.ui.define((function () { 'use strict';
8
8
 
9
9
  (function (exports) {
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
11
+ exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
12
12
  exports.BOOLEAN_VALUE_TYPE = 'boolean';
13
13
  exports.INTEGER_VALUE_TYPE = 'integer';
14
14
  exports.FLOAT_VALUE_TYPE = 'float';
@@ -57,6 +57,7 @@ sap.ui.define((function () { 'use strict';
57
57
  exports.iconsLoaded = createExternalAction('icons-loaded');
58
58
  exports.controlSelected = createExternalAction('control-selected');
59
59
  exports.selectControl = createExternalAction('select-control');
60
+ exports.addExtensionPoint = createExternalAction('add-extension-point');
60
61
  exports.deletePropertyChanges = createExternalAction('delete-property-changes');
61
62
  exports.outlineChanged = createExternalAction('outline-changed');
62
63
  exports.changeProperty = createExternalAction('change-property');
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.8.7",
12
+ "version": "0.9.0",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "ejs": "3.1.9",
26
26
  "@sap-ux/logger": "0.4.0",
27
27
  "@sap-ux/adp-tooling": "0.5.3",
28
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.2.4"
28
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.3.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/ejs": "3.1.2",
@@ -36,7 +36,7 @@
36
36
  "npm-run-all": "4.1.5",
37
37
  "nock": "13.2.1",
38
38
  "supertest": "6.3.3",
39
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.5.1",
39
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.6.0",
40
40
  "@sap-ux/project-access": "1.14.0",
41
41
  "@sap-ux/store": "0.4.0"
42
42
  },