@sap-ux/preview-middleware 0.11.26 → 0.11.27
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.
|
@@ -7,308 +7,308 @@ sap.ui.define((function () { 'use strict';
|
|
|
7
7
|
var api = {};
|
|
8
8
|
|
|
9
9
|
(function (exports) {
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.showMessage = 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.scenario = 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
|
-
exports.BOOLEAN_VALUE_TYPE = 'boolean';
|
|
13
|
-
exports.INTEGER_VALUE_TYPE = 'integer';
|
|
14
|
-
exports.FLOAT_VALUE_TYPE = 'float';
|
|
15
|
-
exports.STRING_VALUE_TYPE = 'string';
|
|
16
|
-
exports.INPUT_EDITOR_TYPE = 'input';
|
|
17
|
-
exports.DROPDOWN_EDITOR_TYPE = 'dropdown';
|
|
18
|
-
exports.CHECKBOX_EDITOR_TYPE = 'checkbox';
|
|
19
|
-
exports.scenario = {
|
|
20
|
-
AppVariant: 'APP_VARIANT',
|
|
21
|
-
VersionedAppVariant: 'VERSIONED_APP_VARIANT',
|
|
22
|
-
AdaptationProject: 'ADAPTATION_PROJECT',
|
|
23
|
-
FioriElementsFromScratch: 'FE_FROM_SCRATCH',
|
|
24
|
-
UiAdaptation: 'UI_ADAPTATION'
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Create matcher.
|
|
28
|
-
*
|
|
29
|
-
* @param type action type
|
|
30
|
-
* @returns (value: { type: unknown } | undefined) => value is Y
|
|
31
|
-
*/
|
|
32
|
-
function createMatcher(type) {
|
|
33
|
-
return function match(value) {
|
|
34
|
-
return (value === null || value === void 0 ? void 0 : value.type) === type;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Create action factory.
|
|
39
|
-
*
|
|
40
|
-
* @param prefix to determine ext action
|
|
41
|
-
* @returns Function
|
|
42
|
-
*/
|
|
43
|
-
function createActionFactory(prefix) {
|
|
44
|
-
return function createAction(name) {
|
|
45
|
-
const actionType = [prefix, name].join(' ');
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* @param payload action payload
|
|
49
|
-
* @returns PayloadAction<typeof actionType, T>
|
|
50
|
-
*/
|
|
51
|
-
function action(payload) {
|
|
52
|
-
return {
|
|
53
|
-
type: actionType,
|
|
54
|
-
payload
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
action.type = actionType;
|
|
58
|
-
action.match = createMatcher(actionType);
|
|
59
|
-
return action;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
exports.EXTERNAL_ACTION_PREFIX = '[ext]';
|
|
63
|
-
const createExternalAction = createActionFactory(exports.EXTERNAL_ACTION_PREFIX);
|
|
64
|
-
exports.iconsLoaded = createExternalAction('icons-loaded');
|
|
65
|
-
exports.controlSelected = createExternalAction('control-selected');
|
|
66
|
-
exports.selectControl = createExternalAction('select-control');
|
|
67
|
-
exports.addExtensionPoint = createExternalAction('add-extension-point');
|
|
68
|
-
exports.deletePropertyChanges = createExternalAction('delete-property-changes');
|
|
69
|
-
exports.outlineChanged = createExternalAction('outline-changed');
|
|
70
|
-
exports.changeProperty = createExternalAction('change-property');
|
|
71
|
-
exports.propertyChanged = createExternalAction('property-changed');
|
|
72
|
-
exports.propertyChangeFailed = createExternalAction('change-property-failed');
|
|
73
|
-
exports.changeStackModified = createExternalAction('change-stack-modified');
|
|
74
|
-
exports.showMessage = createExternalAction('show-dialog-message');
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.showMessage = 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.scenario = 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
|
+
exports.BOOLEAN_VALUE_TYPE = 'boolean';
|
|
13
|
+
exports.INTEGER_VALUE_TYPE = 'integer';
|
|
14
|
+
exports.FLOAT_VALUE_TYPE = 'float';
|
|
15
|
+
exports.STRING_VALUE_TYPE = 'string';
|
|
16
|
+
exports.INPUT_EDITOR_TYPE = 'input';
|
|
17
|
+
exports.DROPDOWN_EDITOR_TYPE = 'dropdown';
|
|
18
|
+
exports.CHECKBOX_EDITOR_TYPE = 'checkbox';
|
|
19
|
+
exports.scenario = {
|
|
20
|
+
AppVariant: 'APP_VARIANT',
|
|
21
|
+
VersionedAppVariant: 'VERSIONED_APP_VARIANT',
|
|
22
|
+
AdaptationProject: 'ADAPTATION_PROJECT',
|
|
23
|
+
FioriElementsFromScratch: 'FE_FROM_SCRATCH',
|
|
24
|
+
UiAdaptation: 'UI_ADAPTATION'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Create matcher.
|
|
28
|
+
*
|
|
29
|
+
* @param type action type
|
|
30
|
+
* @returns (value: { type: unknown } | undefined) => value is Y
|
|
31
|
+
*/
|
|
32
|
+
function createMatcher(type) {
|
|
33
|
+
return function match(value) {
|
|
34
|
+
return (value === null || value === void 0 ? void 0 : value.type) === type;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create action factory.
|
|
39
|
+
*
|
|
40
|
+
* @param prefix to determine ext action
|
|
41
|
+
* @returns Function
|
|
42
|
+
*/
|
|
43
|
+
function createActionFactory(prefix) {
|
|
44
|
+
return function createAction(name) {
|
|
45
|
+
const actionType = [prefix, name].join(' ');
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @param payload action payload
|
|
49
|
+
* @returns PayloadAction<typeof actionType, T>
|
|
50
|
+
*/
|
|
51
|
+
function action(payload) {
|
|
52
|
+
return {
|
|
53
|
+
type: actionType,
|
|
54
|
+
payload
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
action.type = actionType;
|
|
58
|
+
action.match = createMatcher(actionType);
|
|
59
|
+
return action;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
exports.EXTERNAL_ACTION_PREFIX = '[ext]';
|
|
63
|
+
const createExternalAction = createActionFactory(exports.EXTERNAL_ACTION_PREFIX);
|
|
64
|
+
exports.iconsLoaded = createExternalAction('icons-loaded');
|
|
65
|
+
exports.controlSelected = createExternalAction('control-selected');
|
|
66
|
+
exports.selectControl = createExternalAction('select-control');
|
|
67
|
+
exports.addExtensionPoint = createExternalAction('add-extension-point');
|
|
68
|
+
exports.deletePropertyChanges = createExternalAction('delete-property-changes');
|
|
69
|
+
exports.outlineChanged = createExternalAction('outline-changed');
|
|
70
|
+
exports.changeProperty = createExternalAction('change-property');
|
|
71
|
+
exports.propertyChanged = createExternalAction('property-changed');
|
|
72
|
+
exports.propertyChangeFailed = createExternalAction('change-property-failed');
|
|
73
|
+
exports.changeStackModified = createExternalAction('change-stack-modified');
|
|
74
|
+
exports.showMessage = createExternalAction('show-dialog-message');
|
|
75
75
|
|
|
76
76
|
} (api));
|
|
77
77
|
|
|
78
78
|
var debounce$1 = {};
|
|
79
79
|
|
|
80
|
-
Object.defineProperty(debounce$1, "__esModule", { value: true });
|
|
81
|
-
debounce$1.debounce = void 0;
|
|
82
|
-
/**
|
|
83
|
-
* Returns a function which calls the callback function only after the specified idle time
|
|
84
|
-
* Works similar to the Debounce operator from rxjs https://reactivex.io/documentation/operators/debounce.html link.
|
|
85
|
-
*
|
|
86
|
-
* @param callback Function to execute
|
|
87
|
-
* @param delay Idle period in milliseconds after which the callback will be executed
|
|
88
|
-
* @returns A wrapper function that should be called to invoke the callback function after delay
|
|
89
|
-
*/
|
|
90
|
-
function debounce(callback, delay) {
|
|
91
|
-
let timerId;
|
|
92
|
-
return (...args) => {
|
|
93
|
-
clearTimeout(timerId);
|
|
94
|
-
timerId = setTimeout(() => {
|
|
95
|
-
callback(...args);
|
|
96
|
-
}, delay);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
80
|
+
Object.defineProperty(debounce$1, "__esModule", { value: true });
|
|
81
|
+
debounce$1.debounce = void 0;
|
|
82
|
+
/**
|
|
83
|
+
* Returns a function which calls the callback function only after the specified idle time
|
|
84
|
+
* Works similar to the Debounce operator from rxjs https://reactivex.io/documentation/operators/debounce.html link.
|
|
85
|
+
*
|
|
86
|
+
* @param callback Function to execute
|
|
87
|
+
* @param delay Idle period in milliseconds after which the callback will be executed
|
|
88
|
+
* @returns A wrapper function that should be called to invoke the callback function after delay
|
|
89
|
+
*/
|
|
90
|
+
function debounce(callback, delay) {
|
|
91
|
+
let timerId;
|
|
92
|
+
return (...args) => {
|
|
93
|
+
clearTimeout(timerId);
|
|
94
|
+
timerId = setTimeout(() => {
|
|
95
|
+
callback(...args);
|
|
96
|
+
}, delay);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
99
|
debounce$1.debounce = debounce;
|
|
100
100
|
|
|
101
101
|
var postMessage = {};
|
|
102
102
|
|
|
103
|
-
Object.defineProperty(postMessage, "__esModule", { value: true });
|
|
104
|
-
postMessage.startPostMessageCommunication = void 0;
|
|
105
|
-
const POST_MESSAGE_ACTION_TYPE = 'post-message-action';
|
|
106
|
-
/**
|
|
107
|
-
* Check if data isPostMessageAction.
|
|
108
|
-
*
|
|
109
|
-
* @param data - post message action
|
|
110
|
-
* @returns data is PostMessageAction<T>
|
|
111
|
-
*/
|
|
112
|
-
function isPostMessageAction(data) {
|
|
113
|
-
return (data === null || data === void 0 ? void 0 : data.type) === POST_MESSAGE_ACTION_TYPE && typeof (data === null || data === void 0 ? void 0 : data.action) === 'object';
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Method to start post message communication.
|
|
117
|
-
*
|
|
118
|
-
* @param target target window
|
|
119
|
-
* @param onActionHandler action handler
|
|
120
|
-
* @param logger to log info, default: browser console.
|
|
121
|
-
* @returns PostMessageCommunication<T>
|
|
122
|
-
*/
|
|
123
|
-
function startPostMessageCommunication(target, onActionHandler, logger = console) {
|
|
124
|
-
/**
|
|
125
|
-
* Returns target windows or undefined.
|
|
126
|
-
*
|
|
127
|
-
* @returns Window | undefined
|
|
128
|
-
*/
|
|
129
|
-
function getTarget() {
|
|
130
|
-
if (typeof target === 'function') {
|
|
131
|
-
return target();
|
|
132
|
-
}
|
|
133
|
-
return target;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Invoke action on post message.
|
|
137
|
-
*
|
|
138
|
-
* @param event event
|
|
139
|
-
*/
|
|
140
|
-
function postMessageListener(event) {
|
|
141
|
-
const target = getTarget();
|
|
142
|
-
if (!target || event.origin !== target.origin || event.source !== target) {
|
|
143
|
-
// Ignore messages from unknown sources
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
if (isPostMessageAction(event.data)) {
|
|
147
|
-
onActionHandler(event.data.action).catch((error) => logger.error(error));
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
logger.warn(`Unknown message received ${event.data}`);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
function dispose() {
|
|
154
|
-
window.removeEventListener('message', postMessageListener);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Post message to a give window.
|
|
158
|
-
*
|
|
159
|
-
* @param action action payload
|
|
160
|
-
*/
|
|
161
|
-
function sendAction(action) {
|
|
162
|
-
const target = getTarget();
|
|
163
|
-
if (!target) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
const message = {
|
|
167
|
-
type: POST_MESSAGE_ACTION_TYPE,
|
|
168
|
-
action
|
|
169
|
-
};
|
|
170
|
-
target.postMessage(message, target.origin);
|
|
171
|
-
}
|
|
172
|
-
window.addEventListener('message', postMessageListener);
|
|
173
|
-
return {
|
|
174
|
-
dispose,
|
|
175
|
-
sendAction
|
|
176
|
-
};
|
|
177
|
-
}
|
|
103
|
+
Object.defineProperty(postMessage, "__esModule", { value: true });
|
|
104
|
+
postMessage.startPostMessageCommunication = void 0;
|
|
105
|
+
const POST_MESSAGE_ACTION_TYPE = 'post-message-action';
|
|
106
|
+
/**
|
|
107
|
+
* Check if data isPostMessageAction.
|
|
108
|
+
*
|
|
109
|
+
* @param data - post message action
|
|
110
|
+
* @returns data is PostMessageAction<T>
|
|
111
|
+
*/
|
|
112
|
+
function isPostMessageAction(data) {
|
|
113
|
+
return (data === null || data === void 0 ? void 0 : data.type) === POST_MESSAGE_ACTION_TYPE && typeof (data === null || data === void 0 ? void 0 : data.action) === 'object';
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Method to start post message communication.
|
|
117
|
+
*
|
|
118
|
+
* @param target target window
|
|
119
|
+
* @param onActionHandler action handler
|
|
120
|
+
* @param logger to log info, default: browser console.
|
|
121
|
+
* @returns PostMessageCommunication<T>
|
|
122
|
+
*/
|
|
123
|
+
function startPostMessageCommunication(target, onActionHandler, logger = console) {
|
|
124
|
+
/**
|
|
125
|
+
* Returns target windows or undefined.
|
|
126
|
+
*
|
|
127
|
+
* @returns Window | undefined
|
|
128
|
+
*/
|
|
129
|
+
function getTarget() {
|
|
130
|
+
if (typeof target === 'function') {
|
|
131
|
+
return target();
|
|
132
|
+
}
|
|
133
|
+
return target;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Invoke action on post message.
|
|
137
|
+
*
|
|
138
|
+
* @param event event
|
|
139
|
+
*/
|
|
140
|
+
function postMessageListener(event) {
|
|
141
|
+
const target = getTarget();
|
|
142
|
+
if (!target || event.origin !== target.origin || event.source !== target) {
|
|
143
|
+
// Ignore messages from unknown sources
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (isPostMessageAction(event.data)) {
|
|
147
|
+
onActionHandler(event.data.action).catch((error) => logger.error(error));
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
logger.warn(`Unknown message received ${event.data}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function dispose() {
|
|
154
|
+
window.removeEventListener('message', postMessageListener);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Post message to a give window.
|
|
158
|
+
*
|
|
159
|
+
* @param action action payload
|
|
160
|
+
*/
|
|
161
|
+
function sendAction(action) {
|
|
162
|
+
const target = getTarget();
|
|
163
|
+
if (!target) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const message = {
|
|
167
|
+
type: POST_MESSAGE_ACTION_TYPE,
|
|
168
|
+
action
|
|
169
|
+
};
|
|
170
|
+
target.postMessage(message, target.origin);
|
|
171
|
+
}
|
|
172
|
+
window.addEventListener('message', postMessageListener);
|
|
173
|
+
return {
|
|
174
|
+
dispose,
|
|
175
|
+
sendAction
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
178
|
postMessage.startPostMessageCommunication = startPostMessageCommunication;
|
|
179
179
|
|
|
180
180
|
var telemetry = {};
|
|
181
181
|
|
|
182
|
-
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
183
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
184
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
185
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
186
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
187
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
188
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
Object.defineProperty(telemetry, "__esModule", { value: true });
|
|
192
|
-
telemetry.reportTelemetry = telemetry.disableTelemetry = telemetry.enableTelemetry = void 0;
|
|
193
|
-
let enabled = false;
|
|
194
|
-
function enableTelemetry() {
|
|
195
|
-
enabled = true;
|
|
196
|
-
}
|
|
197
|
-
telemetry.enableTelemetry = enableTelemetry;
|
|
198
|
-
function disableTelemetry() {
|
|
199
|
-
enabled = false;
|
|
200
|
-
}
|
|
201
|
-
telemetry.disableTelemetry = disableTelemetry;
|
|
202
|
-
/**
|
|
203
|
-
* Reports telemetry data from Control Property Editor.
|
|
204
|
-
*
|
|
205
|
-
* @param data The TelemetryData object, that needs to be reported
|
|
206
|
-
* @returns {Promise<void>}
|
|
207
|
-
*/
|
|
208
|
-
function reportTelemetry(data) {
|
|
209
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
-
try {
|
|
211
|
-
if (enabled) {
|
|
212
|
-
const requestOptions = {
|
|
213
|
-
method: 'POST',
|
|
214
|
-
headers: {
|
|
215
|
-
Accept: 'application/json',
|
|
216
|
-
'Content-Type': 'application/json'
|
|
217
|
-
},
|
|
218
|
-
body: JSON.stringify(data)
|
|
219
|
-
};
|
|
220
|
-
yield fetch('/preview/api/telemetry', requestOptions);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
catch (_error) {
|
|
224
|
-
// something is wrong with the telemetry service
|
|
225
|
-
disableTelemetry();
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
182
|
+
var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
183
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
184
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
185
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
186
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
187
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
188
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
Object.defineProperty(telemetry, "__esModule", { value: true });
|
|
192
|
+
telemetry.reportTelemetry = telemetry.disableTelemetry = telemetry.enableTelemetry = void 0;
|
|
193
|
+
let enabled = false;
|
|
194
|
+
function enableTelemetry() {
|
|
195
|
+
enabled = true;
|
|
196
|
+
}
|
|
197
|
+
telemetry.enableTelemetry = enableTelemetry;
|
|
198
|
+
function disableTelemetry() {
|
|
199
|
+
enabled = false;
|
|
200
|
+
}
|
|
201
|
+
telemetry.disableTelemetry = disableTelemetry;
|
|
202
|
+
/**
|
|
203
|
+
* Reports telemetry data from Control Property Editor.
|
|
204
|
+
*
|
|
205
|
+
* @param data The TelemetryData object, that needs to be reported
|
|
206
|
+
* @returns {Promise<void>}
|
|
207
|
+
*/
|
|
208
|
+
function reportTelemetry(data) {
|
|
209
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
+
try {
|
|
211
|
+
if (enabled) {
|
|
212
|
+
const requestOptions = {
|
|
213
|
+
method: 'POST',
|
|
214
|
+
headers: {
|
|
215
|
+
Accept: 'application/json',
|
|
216
|
+
'Content-Type': 'application/json'
|
|
217
|
+
},
|
|
218
|
+
body: JSON.stringify(data)
|
|
219
|
+
};
|
|
220
|
+
yield fetch('/preview/api/telemetry', requestOptions);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
catch (_error) {
|
|
224
|
+
// something is wrong with the telemetry service
|
|
225
|
+
disableTelemetry();
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
229
|
telemetry.reportTelemetry = reportTelemetry;
|
|
230
230
|
|
|
231
231
|
var utils = {};
|
|
232
232
|
|
|
233
233
|
(function (exports) {
|
|
234
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
235
|
-
exports.FlexChangesEndPoints = exports.convertCamelCaseToPascalCase = void 0;
|
|
236
|
-
const isUpperCase = (code) => code >= 65 && code <= 90;
|
|
237
|
-
const isLowerCase = (code) => code >= 97 && code <= 122;
|
|
238
|
-
const isWordDelimiter = (code) => code === 45 || code === 95 || code === 32; // - or _ or space
|
|
239
|
-
const convertCamelCaseToPascalCase = (text) => {
|
|
240
|
-
const words = [];
|
|
241
|
-
let word = '';
|
|
242
|
-
let lookForUpperCase = true;
|
|
243
|
-
for (let i = 0; i < text.length; i++) {
|
|
244
|
-
const character = text[i];
|
|
245
|
-
if (lookForUpperCase) {
|
|
246
|
-
// make sure that the first letter is capitalized
|
|
247
|
-
word += word.length === 0 ? character.toUpperCase() : character;
|
|
248
|
-
if (isLowerCase(text.charCodeAt(i + 1))) {
|
|
249
|
-
// First lower case character after upper case character -> switch mode to collect only lower case characters
|
|
250
|
-
lookForUpperCase = false;
|
|
251
|
-
}
|
|
252
|
-
else if (isUpperCase(text.charCodeAt(i + 1)) && isLowerCase(text.charCodeAt(i + 2))) {
|
|
253
|
-
// Next character is the last uppercase character after a sequence of upper case character -> create an abbreviated word
|
|
254
|
-
words.push(word);
|
|
255
|
-
word = '';
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
else if (isUpperCase(text.charCodeAt(i))) {
|
|
259
|
-
// Upper case character indicates the beginning of a new word -> switch mode to detect abbreviated word
|
|
260
|
-
words.push(word);
|
|
261
|
-
lookForUpperCase = true;
|
|
262
|
-
word = character;
|
|
263
|
-
}
|
|
264
|
-
else if (isWordDelimiter(text.charCodeAt(i))) {
|
|
265
|
-
words.push(word);
|
|
266
|
-
lookForUpperCase = true;
|
|
267
|
-
word = '';
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
word += character;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
if (word.length) {
|
|
274
|
-
words.push(word);
|
|
275
|
-
}
|
|
276
|
-
return words.join(' ');
|
|
277
|
-
};
|
|
278
|
-
exports.convertCamelCaseToPascalCase = convertCamelCaseToPascalCase;
|
|
279
|
-
(function (FlexChangesEndPoints) {
|
|
280
|
-
FlexChangesEndPoints["changes"] = "/preview/api/changes";
|
|
281
|
-
})(exports.FlexChangesEndPoints || (exports.FlexChangesEndPoints = {}));
|
|
234
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
235
|
+
exports.FlexChangesEndPoints = exports.convertCamelCaseToPascalCase = void 0;
|
|
236
|
+
const isUpperCase = (code) => code >= 65 && code <= 90;
|
|
237
|
+
const isLowerCase = (code) => code >= 97 && code <= 122;
|
|
238
|
+
const isWordDelimiter = (code) => code === 45 || code === 95 || code === 32; // - or _ or space
|
|
239
|
+
const convertCamelCaseToPascalCase = (text) => {
|
|
240
|
+
const words = [];
|
|
241
|
+
let word = '';
|
|
242
|
+
let lookForUpperCase = true;
|
|
243
|
+
for (let i = 0; i < text.length; i++) {
|
|
244
|
+
const character = text[i];
|
|
245
|
+
if (lookForUpperCase) {
|
|
246
|
+
// make sure that the first letter is capitalized
|
|
247
|
+
word += word.length === 0 ? character.toUpperCase() : character;
|
|
248
|
+
if (isLowerCase(text.charCodeAt(i + 1))) {
|
|
249
|
+
// First lower case character after upper case character -> switch mode to collect only lower case characters
|
|
250
|
+
lookForUpperCase = false;
|
|
251
|
+
}
|
|
252
|
+
else if (isUpperCase(text.charCodeAt(i + 1)) && isLowerCase(text.charCodeAt(i + 2))) {
|
|
253
|
+
// Next character is the last uppercase character after a sequence of upper case character -> create an abbreviated word
|
|
254
|
+
words.push(word);
|
|
255
|
+
word = '';
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else if (isUpperCase(text.charCodeAt(i))) {
|
|
259
|
+
// Upper case character indicates the beginning of a new word -> switch mode to detect abbreviated word
|
|
260
|
+
words.push(word);
|
|
261
|
+
lookForUpperCase = true;
|
|
262
|
+
word = character;
|
|
263
|
+
}
|
|
264
|
+
else if (isWordDelimiter(text.charCodeAt(i))) {
|
|
265
|
+
words.push(word);
|
|
266
|
+
lookForUpperCase = true;
|
|
267
|
+
word = '';
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
word += character;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (word.length) {
|
|
274
|
+
words.push(word);
|
|
275
|
+
}
|
|
276
|
+
return words.join(' ');
|
|
277
|
+
};
|
|
278
|
+
exports.convertCamelCaseToPascalCase = convertCamelCaseToPascalCase;
|
|
279
|
+
(function (FlexChangesEndPoints) {
|
|
280
|
+
FlexChangesEndPoints["changes"] = "/preview/api/changes";
|
|
281
|
+
})(exports.FlexChangesEndPoints || (exports.FlexChangesEndPoints = {}));
|
|
282
282
|
|
|
283
283
|
} (utils));
|
|
284
284
|
|
|
285
285
|
(function (exports) {
|
|
286
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
287
|
-
if (k2 === undefined) k2 = k;
|
|
288
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
289
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
290
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
291
|
-
}
|
|
292
|
-
Object.defineProperty(o, k2, desc);
|
|
293
|
-
}) : (function(o, m, k, k2) {
|
|
294
|
-
if (k2 === undefined) k2 = k;
|
|
295
|
-
o[k2] = m[k];
|
|
296
|
-
}));
|
|
297
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
298
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
299
|
-
};
|
|
300
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
301
|
-
exports.disableTelemetry = exports.enableTelemetry = exports.reportTelemetry = exports.startPostMessageCommunication = exports.debounce = void 0;
|
|
302
|
-
__exportStar(api, exports);
|
|
303
|
-
var debounce_1 = debounce$1;
|
|
304
|
-
Object.defineProperty(exports, "debounce", { enumerable: true, get: function () { return debounce_1.debounce; } });
|
|
305
|
-
var post_message_1 = postMessage;
|
|
306
|
-
Object.defineProperty(exports, "startPostMessageCommunication", { enumerable: true, get: function () { return post_message_1.startPostMessageCommunication; } });
|
|
307
|
-
var telemetry_1 = telemetry;
|
|
308
|
-
Object.defineProperty(exports, "reportTelemetry", { enumerable: true, get: function () { return telemetry_1.reportTelemetry; } });
|
|
309
|
-
Object.defineProperty(exports, "enableTelemetry", { enumerable: true, get: function () { return telemetry_1.enableTelemetry; } });
|
|
310
|
-
Object.defineProperty(exports, "disableTelemetry", { enumerable: true, get: function () { return telemetry_1.disableTelemetry; } });
|
|
311
|
-
__exportStar(utils, exports);
|
|
286
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
287
|
+
if (k2 === undefined) k2 = k;
|
|
288
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
289
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
290
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
291
|
+
}
|
|
292
|
+
Object.defineProperty(o, k2, desc);
|
|
293
|
+
}) : (function(o, m, k, k2) {
|
|
294
|
+
if (k2 === undefined) k2 = k;
|
|
295
|
+
o[k2] = m[k];
|
|
296
|
+
}));
|
|
297
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
298
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
299
|
+
};
|
|
300
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
301
|
+
exports.disableTelemetry = exports.enableTelemetry = exports.reportTelemetry = exports.startPostMessageCommunication = exports.debounce = void 0;
|
|
302
|
+
__exportStar(api, exports);
|
|
303
|
+
var debounce_1 = debounce$1;
|
|
304
|
+
Object.defineProperty(exports, "debounce", { enumerable: true, get: function () { return debounce_1.debounce; } });
|
|
305
|
+
var post_message_1 = postMessage;
|
|
306
|
+
Object.defineProperty(exports, "startPostMessageCommunication", { enumerable: true, get: function () { return post_message_1.startPostMessageCommunication; } });
|
|
307
|
+
var telemetry_1 = telemetry;
|
|
308
|
+
Object.defineProperty(exports, "reportTelemetry", { enumerable: true, get: function () { return telemetry_1.reportTelemetry; } });
|
|
309
|
+
Object.defineProperty(exports, "enableTelemetry", { enumerable: true, get: function () { return telemetry_1.enableTelemetry; } });
|
|
310
|
+
Object.defineProperty(exports, "disableTelemetry", { enumerable: true, get: function () { return telemetry_1.disableTelemetry; } });
|
|
311
|
+
__exportStar(utils, exports);
|
|
312
312
|
|
|
313
313
|
} (dist));
|
|
314
314
|
|
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.11.
|
|
12
|
+
"version": "0.11.27",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"ejs": "3.1.9",
|
|
26
26
|
"@sap-ux/logger": "0.4.0",
|
|
27
|
-
"@sap-ux/
|
|
28
|
-
"@sap-ux/
|
|
27
|
+
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.10",
|
|
28
|
+
"@sap-ux/adp-tooling": "0.8.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/ejs": "3.1.2",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@sap-ux-private/playwright": "0.0.1",
|
|
40
40
|
"dotenv": "16.3.1",
|
|
41
41
|
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.8.13",
|
|
42
|
-
"@sap-ux/project-access": "1.16.
|
|
42
|
+
"@sap-ux/project-access": "1.16.3",
|
|
43
43
|
"@sap-ux/store": "0.4.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|