@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,134 +1,191 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
const ui5ApiDtMetadata = new Map();
|
|
23
|
-
function loadDefaultLibraries() {
|
|
24
|
-
const allData = Promise.all([
|
|
25
|
-
getUi5ApiDtMetadata('sap.m'),
|
|
26
|
-
getUi5ApiDtMetadata('sap.ui.comp'),
|
|
27
|
-
getUi5ApiDtMetadata('sap.ui.core'),
|
|
28
|
-
getUi5ApiDtMetadata('sap.f')
|
|
29
|
-
]);
|
|
30
|
-
allData.then(res => {
|
|
31
|
-
res.forEach(api => {
|
|
32
|
-
if (api.library) {
|
|
33
|
-
ui5ApiDtMetadata.set(api.library, api);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}).catch(reason => {
|
|
37
|
-
Log.error('Loading Library Failed: ' + reason);
|
|
38
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["./utils", "sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../utils/info-center-message", "../utils/error"], function (___utils, Log, ___sap_ux_private_control_property_editor_common, ___utils_info_center_message, ___utils_error) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getLibrary = ___utils["getLibrary"];
|
|
7
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
|
|
8
|
+
const sendInfoCenterMessage = ___utils_info_center_message["sendInfoCenterMessage"];
|
|
9
|
+
const FetchError = ___utils_error["FetchError"];
|
|
10
|
+
/**
|
|
11
|
+
* Get ui5 metadata of given library name.
|
|
12
|
+
*
|
|
13
|
+
* @param libName library name for eg: sap.m
|
|
14
|
+
* @returns Promise<SchemaForApiJsonFiles>
|
|
15
|
+
*/
|
|
16
|
+
async function getUi5ApiDtMetadata(libName) {
|
|
17
|
+
const libUrl = '/test-resources/' + libName.split('.').join('/') + '/designtime/api.json';
|
|
18
|
+
const response = await fetch(libUrl);
|
|
19
|
+
if (!response.ok) {
|
|
20
|
+
throw new FetchError(response);
|
|
39
21
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
return response.json();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* load ui5 controls design time metadata api.json for following libraries
|
|
27
|
+
* sap.m, sap.ui.comp, sap.f, sap.ui.core
|
|
28
|
+
* loading libraries(more in file size) in parallel during initialization.
|
|
29
|
+
* Others (less in file size) are loaded dynamically in getControlMetadata method
|
|
30
|
+
*/
|
|
31
|
+
const ui5ApiDtMetadata = new Map();
|
|
32
|
+
function loadDefaultLibraries() {
|
|
33
|
+
const allData = Promise.all([getUi5ApiDtMetadata('sap.m'), getUi5ApiDtMetadata('sap.ui.comp'), getUi5ApiDtMetadata('sap.ui.core'), getUi5ApiDtMetadata('sap.f')]);
|
|
34
|
+
allData.then(res => {
|
|
35
|
+
res.forEach(api => {
|
|
36
|
+
if (api.library) {
|
|
37
|
+
ui5ApiDtMetadata.set(api.library, api);
|
|
50
38
|
}
|
|
51
|
-
|
|
39
|
+
});
|
|
40
|
+
}).catch(reason => {
|
|
41
|
+
Log.error('Loading Library Failed: ' + reason);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Format html text.
|
|
47
|
+
*
|
|
48
|
+
* @param sHtml - html string
|
|
49
|
+
* @returns string
|
|
50
|
+
*/
|
|
51
|
+
function formatHtmlText(sHtml) {
|
|
52
|
+
// replaced "sHtml.replace(new RegExp('<[^>]*>', 'g')" due to regex runtime vulnerability
|
|
53
|
+
const parts = (sHtml || '').split('<');
|
|
54
|
+
let result = '';
|
|
55
|
+
for (const part of parts) {
|
|
56
|
+
if (!result) {
|
|
57
|
+
result = part;
|
|
58
|
+
} else {
|
|
59
|
+
const indexClosingBracket = part.indexOf('>');
|
|
60
|
+
result += indexClosingBracket >= 0 ? part.substring(indexClosingBracket + 1) : `<${part}`;
|
|
61
|
+
}
|
|
52
62
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Method to parse ui5 control metadata.
|
|
68
|
+
*
|
|
69
|
+
* @param controlLibMetadata control library metadata
|
|
70
|
+
* @param controlName name of the control
|
|
71
|
+
* @returns ControlMetadata
|
|
72
|
+
*/
|
|
73
|
+
function parseControlMetaModel(controlLibMetadata, controlName) {
|
|
74
|
+
const controlInfo = {
|
|
75
|
+
baseType: '',
|
|
76
|
+
doc: '',
|
|
77
|
+
properties: {}
|
|
78
|
+
};
|
|
79
|
+
const selectedControlMetadata = (controlLibMetadata.symbols ?? []).find(control => control.name === controlName);
|
|
80
|
+
if (selectedControlMetadata) {
|
|
81
|
+
// base type info of control is available on property 'extends'
|
|
82
|
+
controlInfo.baseType = selectedControlMetadata.extends;
|
|
83
|
+
controlInfo.doc = selectedControlMetadata.description ?? '';
|
|
84
|
+
const properties = selectedControlMetadata['ui5-metadata'].properties;
|
|
85
|
+
if (properties) {
|
|
86
|
+
properties.forEach(prop => {
|
|
87
|
+
prop.description = formatHtmlText(prop.description || '');
|
|
88
|
+
prop.propertyName = prop.name;
|
|
89
|
+
prop.propertyType = prop.type;
|
|
90
|
+
if (prop.defaultValue === null || prop.defaultValue === '') {
|
|
91
|
+
prop.defaultValue = '-';
|
|
92
|
+
}
|
|
93
|
+
controlInfo.properties[prop.name] = {
|
|
94
|
+
...prop
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
77
98
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
return controlInfo;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Get control metadata for a given control.
|
|
104
|
+
*
|
|
105
|
+
* @param controlName name of the control
|
|
106
|
+
* @param contLibName library name of the control
|
|
107
|
+
* @returns Promise<ControlMetadata | undefined>
|
|
108
|
+
*/
|
|
109
|
+
async function getControlMetadata(controlName, contLibName) {
|
|
110
|
+
let result;
|
|
111
|
+
let controlLibMetadata = ui5ApiDtMetadata.get(contLibName);
|
|
112
|
+
if (controlLibMetadata) {
|
|
113
|
+
result = parseControlMetaModel(controlLibMetadata, controlName);
|
|
114
|
+
} else {
|
|
115
|
+
controlLibMetadata = await getUi5ApiDtMetadata(contLibName);
|
|
116
|
+
ui5ApiDtMetadata.set(contLibName, controlLibMetadata);
|
|
117
|
+
result = parseControlMetaModel(controlLibMetadata, controlName);
|
|
89
118
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Get Control Property Documentation for a give control name and control library.
|
|
124
|
+
*
|
|
125
|
+
* @param controlName name of the control
|
|
126
|
+
* @param contLibName library name of the control
|
|
127
|
+
* @returns Promise<Properties | undefined>
|
|
128
|
+
*/
|
|
129
|
+
async function getControlPropertyDocumentation(controlName, contLibName) {
|
|
130
|
+
const doc = await getControlMetadata(controlName, contLibName);
|
|
131
|
+
if (doc) {
|
|
132
|
+
const baseControlType = doc.baseType;
|
|
133
|
+
if (baseControlType) {
|
|
134
|
+
const baseContLibName = await getLibrary(baseControlType);
|
|
135
|
+
if (baseContLibName) {
|
|
136
|
+
const baseControlProps = await getControlPropertyDocumentation(baseControlType, baseContLibName);
|
|
137
|
+
return {
|
|
138
|
+
...baseControlProps,
|
|
139
|
+
...doc.properties
|
|
140
|
+
};
|
|
107
141
|
}
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
...doc.properties
|
|
145
|
+
};
|
|
146
|
+
} else {
|
|
147
|
+
return undefined;
|
|
108
148
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Get documentation of a given control of a ui5 library.
|
|
153
|
+
*
|
|
154
|
+
* @param controlName name of the control.
|
|
155
|
+
* @param contLibName library name of the control
|
|
156
|
+
* @returns Promise<Properties | undefined>
|
|
157
|
+
*/
|
|
158
|
+
async function getDocumentation(controlName, contLibName) {
|
|
159
|
+
let doc;
|
|
160
|
+
try {
|
|
161
|
+
doc = await getControlPropertyDocumentation(controlName, contLibName);
|
|
162
|
+
} catch (error) {
|
|
163
|
+
Log.error(`Error in getting documentation for ${contLibName}`);
|
|
164
|
+
// For some UI5 components we do not have an api.json provided instead 404, not found,
|
|
165
|
+
// response is retuned from the server. For such components we do not want to
|
|
166
|
+
// flood the info center with errors.
|
|
167
|
+
if (error instanceof FetchError && error.status === 404) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
await sendInfoCenterMessage({
|
|
171
|
+
title: {
|
|
172
|
+
key: 'DOCUMENTATION_ERROR_TITLE'
|
|
173
|
+
},
|
|
174
|
+
description: {
|
|
175
|
+
key: 'DOCUMENTATION_ERROR_DESCRIPTION',
|
|
176
|
+
params: [contLibName]
|
|
177
|
+
},
|
|
178
|
+
type: MessageBarType.error
|
|
179
|
+
});
|
|
128
180
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
181
|
+
return doc;
|
|
182
|
+
}
|
|
183
|
+
var __exports = {
|
|
184
|
+
__esModule: true
|
|
185
|
+
};
|
|
186
|
+
__exports.getUi5ApiDtMetadata = getUi5ApiDtMetadata;
|
|
187
|
+
__exports.loadDefaultLibraries = loadDefaultLibraries;
|
|
188
|
+
__exports.getDocumentation = getDocumentation;
|
|
189
|
+
return __exports;
|
|
190
|
+
});
|
|
191
|
+
//# sourceMappingURL=documentation.js.map
|
package/dist/client/cpe/init.js
CHANGED
|
@@ -1,76 +1,70 @@
|
|
|
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
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const QuickActionService = ___quick_actions_quick_action_service['QuickActionService'];
|
|
29
|
-
const RtaService = ___rta_service['RtaService'];
|
|
30
|
-
const SelectionService = ___selection['SelectionService'];
|
|
31
|
-
const getIcons = ___ui5_utils['getIcons'];
|
|
32
|
-
function init(rta) {
|
|
33
|
-
let registries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
34
|
-
Log.info('Initializing Control Property Editor');
|
|
35
|
-
const flexSettings = rta.getFlexSettings();
|
|
36
|
-
if (flexSettings.telemetry === true) {
|
|
37
|
-
enableTelemetry();
|
|
38
|
-
}
|
|
39
|
-
function subscribe(handler) {
|
|
40
|
-
CommunicationService.subscribe(handler);
|
|
41
|
-
}
|
|
42
|
-
const rtaService = new RtaService(rta);
|
|
43
|
-
const changesService = new ChangeService({ rta });
|
|
44
|
-
const selectionService = new SelectionService(rta, changesService);
|
|
45
|
-
const connectorService = new WorkspaceConnectorService();
|
|
46
|
-
const contextMenuService = new ContextMenuService(rta);
|
|
47
|
-
const outlineService = new OutlineService(rta, changesService);
|
|
48
|
-
const quickActionService = new QuickActionService(rta, outlineService, registries, changesService);
|
|
49
|
-
const services = [
|
|
50
|
-
connectorService,
|
|
51
|
-
selectionService,
|
|
52
|
-
changesService,
|
|
53
|
-
contextMenuService,
|
|
54
|
-
outlineService,
|
|
55
|
-
rtaService,
|
|
56
|
-
quickActionService
|
|
57
|
-
];
|
|
58
|
-
try {
|
|
59
|
-
loadDefaultLibraries();
|
|
60
|
-
const allPromises = services.map(service => {
|
|
61
|
-
return service.init(CommunicationService.sendAction, subscribe)?.catch(error => {
|
|
62
|
-
Log.error('Service Initialization Failed: ', getError(error));
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
Promise.all(allPromises).then(() => {
|
|
66
|
-
CommunicationService.sendAction(appLoaded());
|
|
67
|
-
}).catch(Log.error);
|
|
68
|
-
const icons = getIcons();
|
|
69
|
-
CommunicationService.sendAction(iconsLoaded(icons));
|
|
70
|
-
} catch (error) {
|
|
71
|
-
Log.error('Error during initialization of Control Property Editor', getError(error));
|
|
72
|
-
}
|
|
73
|
-
return Promise.resolve();
|
|
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", "./changes/service", "./communication-service", "./connector-service", "./context-menu-service", "./documentation", "./outline/service", "./quick-actions/quick-action-service", "./rta-service", "./selection", "./ui5-utils"], function (Log, ___sap_ux_private_control_property_editor_common, ___utils_error, ___changes_service, ___communication_service, ___connector_service, ___context_menu_service, ___documentation, ___outline_service, ___quick_actions_quick_action_service, ___rta_service, ___selection, ___ui5_utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const appLoaded = ___sap_ux_private_control_property_editor_common["appLoaded"];
|
|
7
|
+
const enableTelemetry = ___sap_ux_private_control_property_editor_common["enableTelemetry"];
|
|
8
|
+
const iconsLoaded = ___sap_ux_private_control_property_editor_common["iconsLoaded"];
|
|
9
|
+
const getError = ___utils_error["getError"];
|
|
10
|
+
const ChangeService = ___changes_service["ChangeService"];
|
|
11
|
+
const CommunicationService = ___communication_service["CommunicationService"];
|
|
12
|
+
const WorkspaceConnectorService = ___connector_service["WorkspaceConnectorService"];
|
|
13
|
+
const ContextMenuService = ___context_menu_service["ContextMenuService"];
|
|
14
|
+
const loadDefaultLibraries = ___documentation["loadDefaultLibraries"];
|
|
15
|
+
const OutlineService = ___outline_service["OutlineService"];
|
|
16
|
+
const QuickActionService = ___quick_actions_quick_action_service["QuickActionService"];
|
|
17
|
+
const RtaService = ___rta_service["RtaService"];
|
|
18
|
+
const SelectionService = ___selection["SelectionService"];
|
|
19
|
+
const getIcons = ___ui5_utils["getIcons"];
|
|
20
|
+
function init(rta) {
|
|
21
|
+
let registries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
22
|
+
Log.info('Initializing Control Property Editor');
|
|
23
|
+
|
|
24
|
+
// enable telemetry if requested
|
|
25
|
+
const flexSettings = rta.getFlexSettings();
|
|
26
|
+
if (flexSettings.telemetry === true) {
|
|
27
|
+
enableTelemetry();
|
|
74
28
|
}
|
|
75
|
-
|
|
76
|
-
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param handler action handler
|
|
33
|
+
*/
|
|
34
|
+
function subscribe(handler) {
|
|
35
|
+
CommunicationService.subscribe(handler);
|
|
36
|
+
}
|
|
37
|
+
const rtaService = new RtaService(rta);
|
|
38
|
+
const changesService = new ChangeService({
|
|
39
|
+
rta
|
|
40
|
+
});
|
|
41
|
+
const selectionService = new SelectionService(rta, changesService);
|
|
42
|
+
const connectorService = new WorkspaceConnectorService();
|
|
43
|
+
const contextMenuService = new ContextMenuService(rta);
|
|
44
|
+
const outlineService = new OutlineService(rta, changesService);
|
|
45
|
+
const quickActionService = new QuickActionService(rta, outlineService, registries, changesService);
|
|
46
|
+
const services = [connectorService, selectionService, changesService, contextMenuService, outlineService, rtaService, quickActionService];
|
|
47
|
+
try {
|
|
48
|
+
loadDefaultLibraries();
|
|
49
|
+
const allPromises = services.map(service => {
|
|
50
|
+
return service.init(CommunicationService.sendAction, subscribe)?.catch(error => {
|
|
51
|
+
Log.error('Service Initialization Failed: ', getError(error));
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
Promise.all(allPromises).then(() => {
|
|
55
|
+
CommunicationService.sendAction(appLoaded());
|
|
56
|
+
})
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
58
|
+
.catch(Log.error);
|
|
59
|
+
const icons = getIcons();
|
|
60
|
+
CommunicationService.sendAction(iconsLoaded(icons));
|
|
61
|
+
} catch (error) {
|
|
62
|
+
Log.error('Error during initialization of Control Property Editor', getError(error));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// * This is returned immediately to avoid promise deadlock, preventing services from waiting indefinitely.
|
|
66
|
+
return Promise.resolve();
|
|
67
|
+
}
|
|
68
|
+
return init;
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -1,47 +1,62 @@
|
|
|
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
|
-
|
|
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", "./nodes"], function (Log, ___sap_ux_private_control_property_editor_common, ____utils_error, ___nodes) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const outlineChanged = ___sap_ux_private_control_property_editor_common["outlineChanged"];
|
|
7
|
+
const getError = ____utils_error["getError"];
|
|
8
|
+
const transformNodes = ___nodes["transformNodes"];
|
|
9
|
+
const OUTLINE_CHANGE_EVENT = 'OUTLINE_CHANGED';
|
|
10
|
+
/**
|
|
11
|
+
* A Class of WorkspaceConnectorService
|
|
12
|
+
*/
|
|
13
|
+
class OutlineService extends EventTarget {
|
|
14
|
+
constructor(rta, changeService) {
|
|
15
|
+
super();
|
|
16
|
+
this.rta = rta;
|
|
17
|
+
this.changeService = changeService;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Initializes connector service.
|
|
22
|
+
*
|
|
23
|
+
* @param sendAction action sender function
|
|
24
|
+
*/
|
|
25
|
+
async init(sendAction) {
|
|
26
|
+
const outline = await this.rta.getService('outline');
|
|
27
|
+
const {
|
|
28
|
+
scenario
|
|
29
|
+
} = this.rta.getFlexSettings();
|
|
30
|
+
const syncOutline = async () => {
|
|
31
|
+
try {
|
|
32
|
+
const viewNodes = await outline.get();
|
|
33
|
+
const controlIndex = {};
|
|
34
|
+
const configPropertyIdMap = new Map();
|
|
35
|
+
const outlineNodes = await transformNodes(viewNodes, scenario, controlIndex, this.changeService, configPropertyIdMap);
|
|
36
|
+
const event = new CustomEvent(OUTLINE_CHANGE_EVENT, {
|
|
37
|
+
detail: {
|
|
38
|
+
controlIndex
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
this.dispatchEvent(event);
|
|
42
|
+
sendAction(outlineChanged(outlineNodes));
|
|
43
|
+
await this.changeService.updateConfigurationProps(configPropertyIdMap);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
Log.error('Outline sync failed!', getError(error));
|
|
41
46
|
}
|
|
47
|
+
};
|
|
48
|
+
await syncOutline();
|
|
49
|
+
outline.attachEvent('update', syncOutline);
|
|
50
|
+
}
|
|
51
|
+
onOutlineChange(handler) {
|
|
52
|
+
this.addEventListener(OUTLINE_CHANGE_EVENT, handler);
|
|
42
53
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
}
|
|
55
|
+
var __exports = {
|
|
56
|
+
__esModule: true
|
|
57
|
+
};
|
|
58
|
+
__exports.OUTLINE_CHANGE_EVENT = OUTLINE_CHANGE_EVENT;
|
|
59
|
+
__exports.OutlineService = OutlineService;
|
|
60
|
+
return __exports;
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=service.js.map
|