@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,412 +1,486 @@
|
|
|
1
1
|
sap.ui.define((function () { 'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function _mergeNamespaces(n, m) {
|
|
4
|
+
m.forEach(function (e) {
|
|
5
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
6
|
+
if (k !== 'default' && !(k in n)) {
|
|
7
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
8
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return e[k]; }
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return Object.freeze(n);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getDefaultExportFromCjs (x) {
|
|
19
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
20
|
+
}
|
|
4
21
|
|
|
5
22
|
var dist = {};
|
|
6
23
|
|
|
7
24
|
var api = {};
|
|
8
25
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
var hasRequiredApi;
|
|
27
|
+
|
|
28
|
+
function requireApi () {
|
|
29
|
+
if (hasRequiredApi) return api;
|
|
30
|
+
hasRequiredApi = 1;
|
|
31
|
+
(function (exports) {
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.requestControlContextMenu = exports.showInfoCenterMessage = exports.externalFileChange = exports.setApplicationRequiresReload = exports.executeContextMenuAction = exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.applicationModeChanged = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.toggleAppPreviewVisibility = 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.REJECTED_SUFFIX = exports.FULFILLED_SUFFIX = exports.PENDING_SUFFIX = exports.MessageBarType = exports.NESTED_QUICK_ACTION_KIND = exports.SIMPLE_QUICK_ACTION_KIND = exports.CONTROL_CHANGE_KIND = exports.GENERIC_CHANGE_KIND = exports.UNKNOWN_CHANGE_KIND = exports.SAVED_CHANGE_TYPE = exports.PENDING_CHANGE_TYPE = exports.PropertyType = 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;
|
|
34
|
+
exports.createAsyncActionFactory = createAsyncActionFactory;
|
|
35
|
+
exports.BOOLEAN_VALUE_TYPE = 'boolean';
|
|
36
|
+
exports.INTEGER_VALUE_TYPE = 'integer';
|
|
37
|
+
exports.FLOAT_VALUE_TYPE = 'float';
|
|
38
|
+
exports.STRING_VALUE_TYPE = 'string';
|
|
39
|
+
exports.INPUT_EDITOR_TYPE = 'input';
|
|
40
|
+
exports.DROPDOWN_EDITOR_TYPE = 'dropdown';
|
|
41
|
+
exports.CHECKBOX_EDITOR_TYPE = 'checkbox';
|
|
42
|
+
exports.SCENARIO = {
|
|
43
|
+
AppVariant: 'APP_VARIANT',
|
|
44
|
+
VersionedAppVariant: 'VERSIONED_APP_VARIANT',
|
|
45
|
+
AdaptationProject: 'ADAPTATION_PROJECT',
|
|
46
|
+
FioriElementsFromScratch: 'FE_FROM_SCRATCH',
|
|
47
|
+
UiAdaptation: 'UI_ADAPTATION'
|
|
48
|
+
};
|
|
49
|
+
var PropertyType;
|
|
50
|
+
(function (PropertyType) {
|
|
51
|
+
PropertyType["Configuration"] = "configuration";
|
|
52
|
+
PropertyType["ControlProperty"] = "controlProperty";
|
|
53
|
+
})(PropertyType || (exports.PropertyType = PropertyType = {}));
|
|
54
|
+
exports.PENDING_CHANGE_TYPE = 'pending';
|
|
55
|
+
exports.SAVED_CHANGE_TYPE = 'saved';
|
|
56
|
+
exports.UNKNOWN_CHANGE_KIND = 'unknown';
|
|
57
|
+
exports.GENERIC_CHANGE_KIND = 'generic';
|
|
58
|
+
exports.CONTROL_CHANGE_KIND = 'control';
|
|
59
|
+
exports.SIMPLE_QUICK_ACTION_KIND = 'simple';
|
|
60
|
+
exports.NESTED_QUICK_ACTION_KIND = 'nested';
|
|
61
|
+
var MessageBarType;
|
|
62
|
+
(function (MessageBarType) {
|
|
63
|
+
/** Info styled MessageBar */
|
|
64
|
+
MessageBarType[MessageBarType["info"] = 0] = "info";
|
|
65
|
+
/** Error styled MessageBar */
|
|
66
|
+
MessageBarType[MessageBarType["error"] = 1] = "error";
|
|
67
|
+
/** Warning styled MessageBar */
|
|
68
|
+
MessageBarType[MessageBarType["warning"] = 5] = "warning";
|
|
69
|
+
})(MessageBarType || (exports.MessageBarType = MessageBarType = {}));
|
|
70
|
+
/**
|
|
71
|
+
* Create matcher.
|
|
72
|
+
*
|
|
73
|
+
* @param type action type
|
|
74
|
+
* @returns (value: { type: unknown } | undefined) => value is Y
|
|
75
|
+
*/
|
|
76
|
+
function createMatcher(type) {
|
|
77
|
+
return function match(value) {
|
|
78
|
+
return value?.type === type;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Create action factory.
|
|
83
|
+
*
|
|
84
|
+
* @param prefix to determine ext action
|
|
85
|
+
* @returns Function
|
|
86
|
+
*/
|
|
87
|
+
function createActionFactory(prefix) {
|
|
88
|
+
return function createAction(name) {
|
|
89
|
+
const actionType = [prefix, name].join(' ');
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @param payload action payload
|
|
93
|
+
* @returns PayloadAction<typeof actionType, T>
|
|
94
|
+
*/
|
|
95
|
+
function action(payload) {
|
|
96
|
+
return {
|
|
97
|
+
type: actionType,
|
|
98
|
+
payload
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
action.type = actionType;
|
|
102
|
+
action.match = createMatcher(actionType);
|
|
103
|
+
return action;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
exports.PENDING_SUFFIX = '<pending>';
|
|
107
|
+
exports.FULFILLED_SUFFIX = '<fulfilled>';
|
|
108
|
+
exports.REJECTED_SUFFIX = '<rejected>';
|
|
109
|
+
/**
|
|
110
|
+
* Factory for creating request response actions.
|
|
111
|
+
*
|
|
112
|
+
* @param prefix action prefix
|
|
113
|
+
* @returns Function
|
|
114
|
+
*/
|
|
115
|
+
function createAsyncActionFactory(prefix) {
|
|
116
|
+
return function createAction(name) {
|
|
117
|
+
const pendingType = [prefix, name, exports.PENDING_SUFFIX].join(' ');
|
|
118
|
+
/**
|
|
119
|
+
* Pending action.
|
|
120
|
+
*
|
|
121
|
+
* @param payload action payload
|
|
122
|
+
* @returns PayloadAction<typeof pendingType, T>
|
|
123
|
+
*/
|
|
124
|
+
function pending(payload) {
|
|
125
|
+
return {
|
|
126
|
+
type: pendingType,
|
|
127
|
+
payload
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
pending.type = pendingType;
|
|
131
|
+
pending.match = createMatcher(pendingType);
|
|
132
|
+
const fulfilledType = [prefix, name, exports.FULFILLED_SUFFIX].join(' ');
|
|
133
|
+
/**
|
|
134
|
+
* Fulfill action.
|
|
135
|
+
*
|
|
136
|
+
* @param payload action payload
|
|
137
|
+
* @returns PayloadAction<typeof fulfilledType, F>
|
|
138
|
+
*/
|
|
139
|
+
function fulfilled(payload) {
|
|
140
|
+
return {
|
|
141
|
+
type: fulfilledType,
|
|
142
|
+
payload
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
fulfilled.type = fulfilledType;
|
|
146
|
+
fulfilled.match = createMatcher(fulfilledType);
|
|
147
|
+
const rejectedType = [prefix, name, exports.REJECTED_SUFFIX].join(' ');
|
|
148
|
+
/**
|
|
149
|
+
* Reject action.
|
|
150
|
+
*
|
|
151
|
+
* @param message error message
|
|
152
|
+
* @param payload R
|
|
153
|
+
* @returns ErrorAction<typeof rejectedType, F>
|
|
154
|
+
*/
|
|
155
|
+
function rejected(message, payload) {
|
|
156
|
+
return {
|
|
157
|
+
type: rejectedType,
|
|
158
|
+
payload,
|
|
159
|
+
error: {
|
|
160
|
+
message
|
|
161
|
+
},
|
|
162
|
+
showMessage: true
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
rejected.type = rejectedType;
|
|
166
|
+
rejected.match = createMatcher(rejectedType);
|
|
167
|
+
return {
|
|
168
|
+
pending,
|
|
169
|
+
fulfilled,
|
|
170
|
+
rejected
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
exports.EXTERNAL_ACTION_PREFIX = '[ext]';
|
|
175
|
+
const createExternalAction = createActionFactory(exports.EXTERNAL_ACTION_PREFIX);
|
|
176
|
+
exports.iconsLoaded = createExternalAction('icons-loaded');
|
|
177
|
+
exports.controlSelected = createExternalAction('control-selected');
|
|
178
|
+
exports.selectControl = createExternalAction('select-control');
|
|
179
|
+
exports.addExtensionPoint = createExternalAction('add-extension-point');
|
|
180
|
+
exports.deletePropertyChanges = createExternalAction('delete-property-changes');
|
|
181
|
+
exports.outlineChanged = createExternalAction('outline-changed');
|
|
182
|
+
exports.changeProperty = createExternalAction('change-property');
|
|
183
|
+
exports.propertyChanged = createExternalAction('property-changed');
|
|
184
|
+
exports.propertyChangeFailed = createExternalAction('change-property-failed');
|
|
185
|
+
exports.changeStackModified = createExternalAction('change-stack-modified');
|
|
186
|
+
exports.toggleAppPreviewVisibility = createExternalAction('toggle-app-preview-visibility');
|
|
187
|
+
exports.reloadApplication = createExternalAction('reload-application');
|
|
188
|
+
exports.storageFileChanged = createExternalAction('storage-file-changed');
|
|
189
|
+
exports.setAppMode = createExternalAction('set-app-mode');
|
|
190
|
+
exports.applicationModeChanged = createExternalAction('application-mode-changed');
|
|
191
|
+
exports.setUndoRedoEnablement = createExternalAction('set-undo-redo-enablement');
|
|
192
|
+
exports.setSaveEnablement = createExternalAction('set-save-enablement');
|
|
193
|
+
exports.appLoaded = createExternalAction('app-loaded');
|
|
194
|
+
exports.undo = createExternalAction('undo');
|
|
195
|
+
exports.redo = createExternalAction('redo');
|
|
196
|
+
exports.save = createExternalAction('save');
|
|
197
|
+
exports.quickActionListChanged = createExternalAction('quick-action-list-changed');
|
|
198
|
+
exports.updateQuickAction = createExternalAction('update-quick-action');
|
|
199
|
+
exports.executeQuickAction = createExternalAction('execute-quick-action');
|
|
200
|
+
exports.executeContextMenuAction = createExternalAction('execute-context-menu-action');
|
|
201
|
+
exports.setApplicationRequiresReload = createExternalAction('set-application-requires-reload');
|
|
202
|
+
exports.externalFileChange = createExternalAction('external-file-change');
|
|
203
|
+
exports.showInfoCenterMessage = createExternalAction('show-info-center-message');
|
|
204
|
+
const createAsyncExternalAction = createAsyncActionFactory(exports.EXTERNAL_ACTION_PREFIX);
|
|
205
|
+
exports.requestControlContextMenu = createAsyncExternalAction('request-control-context-menu');
|
|
206
|
+
|
|
207
|
+
} (api));
|
|
208
|
+
return api;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var debounce = {};
|
|
212
|
+
|
|
213
|
+
var hasRequiredDebounce;
|
|
214
|
+
|
|
215
|
+
function requireDebounce () {
|
|
216
|
+
if (hasRequiredDebounce) return debounce;
|
|
217
|
+
hasRequiredDebounce = 1;
|
|
218
|
+
Object.defineProperty(debounce, "__esModule", { value: true });
|
|
219
|
+
debounce.debounce = debounce$1;
|
|
48
220
|
/**
|
|
49
|
-
*
|
|
221
|
+
* Returns a function which calls the callback function only after the specified idle time
|
|
222
|
+
* Works similar to the Debounce operator from rxjs https://reactivex.io/documentation/operators/debounce.html link.
|
|
50
223
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @
|
|
224
|
+
* @param callback Function to execute
|
|
225
|
+
* @param delay Idle period in milliseconds after which the callback will be executed
|
|
226
|
+
* @returns A wrapper function that should be called to invoke the callback function after delay
|
|
53
227
|
*/
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
|
|
228
|
+
function debounce$1(callback, delay) {
|
|
229
|
+
let timerId;
|
|
230
|
+
return (...args) => {
|
|
231
|
+
clearTimeout(timerId);
|
|
232
|
+
timerId = setTimeout(() => {
|
|
233
|
+
callback(...args);
|
|
234
|
+
}, delay);
|
|
57
235
|
};
|
|
58
236
|
}
|
|
237
|
+
|
|
238
|
+
return debounce;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var postMessage = {};
|
|
242
|
+
|
|
243
|
+
var hasRequiredPostMessage;
|
|
244
|
+
|
|
245
|
+
function requirePostMessage () {
|
|
246
|
+
if (hasRequiredPostMessage) return postMessage;
|
|
247
|
+
hasRequiredPostMessage = 1;
|
|
248
|
+
Object.defineProperty(postMessage, "__esModule", { value: true });
|
|
249
|
+
postMessage.startPostMessageCommunication = startPostMessageCommunication;
|
|
250
|
+
const POST_MESSAGE_ACTION_TYPE = 'post-message-action';
|
|
59
251
|
/**
|
|
60
|
-
*
|
|
252
|
+
* Check if data isPostMessageAction.
|
|
61
253
|
*
|
|
62
|
-
* @param
|
|
63
|
-
* @returns
|
|
254
|
+
* @param data - post message action
|
|
255
|
+
* @returns data is PostMessageAction<T>
|
|
64
256
|
*/
|
|
65
|
-
function
|
|
66
|
-
return
|
|
67
|
-
const actionType = [prefix, name].join(' ');
|
|
68
|
-
/**
|
|
69
|
-
*
|
|
70
|
-
* @param payload action payload
|
|
71
|
-
* @returns PayloadAction<typeof actionType, T>
|
|
72
|
-
*/
|
|
73
|
-
function action(payload) {
|
|
74
|
-
return {
|
|
75
|
-
type: actionType,
|
|
76
|
-
payload
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
action.type = actionType;
|
|
80
|
-
action.match = createMatcher(actionType);
|
|
81
|
-
return action;
|
|
82
|
-
};
|
|
257
|
+
function isPostMessageAction(data) {
|
|
258
|
+
return data?.type === POST_MESSAGE_ACTION_TYPE && typeof data?.action === 'object';
|
|
83
259
|
}
|
|
84
|
-
exports.PENDING_SUFFIX = '<pending>';
|
|
85
|
-
exports.FULFILLED_SUFFIX = '<fulfilled>';
|
|
86
|
-
exports.REJECTED_SUFFIX = '<rejected>';
|
|
87
260
|
/**
|
|
88
|
-
*
|
|
261
|
+
* Method to start post message communication.
|
|
89
262
|
*
|
|
90
|
-
* @param
|
|
91
|
-
* @
|
|
263
|
+
* @param target target window
|
|
264
|
+
* @param onActionHandler action handler
|
|
265
|
+
* @param logger to log info, default: browser console.
|
|
266
|
+
* @returns PostMessageCommunication<T>
|
|
92
267
|
*/
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
function pending(payload) {
|
|
103
|
-
return {
|
|
104
|
-
type: pendingType,
|
|
105
|
-
payload
|
|
106
|
-
};
|
|
268
|
+
function startPostMessageCommunication(target, onActionHandler, logger = console) {
|
|
269
|
+
/**
|
|
270
|
+
* Returns target windows or undefined.
|
|
271
|
+
*
|
|
272
|
+
* @returns Window | undefined
|
|
273
|
+
*/
|
|
274
|
+
function getTarget() {
|
|
275
|
+
if (typeof target === 'function') {
|
|
276
|
+
return target();
|
|
107
277
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
payload
|
|
121
|
-
};
|
|
278
|
+
return target;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Invoke action on post message.
|
|
282
|
+
*
|
|
283
|
+
* @param event event
|
|
284
|
+
*/
|
|
285
|
+
function postMessageListener(event) {
|
|
286
|
+
const target = getTarget();
|
|
287
|
+
if (!target || event.origin !== target.origin || event.source !== target) {
|
|
288
|
+
// Ignore messages from unknown sources
|
|
289
|
+
return;
|
|
122
290
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*
|
|
129
|
-
* @param message error message
|
|
130
|
-
* @param payload R
|
|
131
|
-
* @returns ErrorAction<typeof rejectedType, F>
|
|
132
|
-
*/
|
|
133
|
-
function rejected(message, payload) {
|
|
134
|
-
return {
|
|
135
|
-
type: rejectedType,
|
|
136
|
-
payload,
|
|
137
|
-
error: {
|
|
138
|
-
message
|
|
139
|
-
},
|
|
140
|
-
showMessage: true
|
|
141
|
-
};
|
|
291
|
+
if (isPostMessageAction(event.data)) {
|
|
292
|
+
onActionHandler(event.data.action).catch((error) => logger.error(error));
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
logger.warn(`Unknown message received ${event.data}`);
|
|
142
296
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
297
|
+
}
|
|
298
|
+
function dispose() {
|
|
299
|
+
window.removeEventListener('message', postMessageListener);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Post message to a give window.
|
|
303
|
+
*
|
|
304
|
+
* @param action action payload
|
|
305
|
+
*/
|
|
306
|
+
function sendAction(action) {
|
|
307
|
+
const target = getTarget();
|
|
308
|
+
if (!target) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const message = {
|
|
312
|
+
type: POST_MESSAGE_ACTION_TYPE,
|
|
313
|
+
action
|
|
149
314
|
};
|
|
315
|
+
target.postMessage(message, target.origin);
|
|
316
|
+
}
|
|
317
|
+
window.addEventListener('message', postMessageListener);
|
|
318
|
+
return {
|
|
319
|
+
dispose,
|
|
320
|
+
sendAction
|
|
150
321
|
};
|
|
151
322
|
}
|
|
152
|
-
exports.EXTERNAL_ACTION_PREFIX = '[ext]';
|
|
153
|
-
const createExternalAction = createActionFactory(exports.EXTERNAL_ACTION_PREFIX);
|
|
154
|
-
exports.iconsLoaded = createExternalAction('icons-loaded');
|
|
155
|
-
exports.controlSelected = createExternalAction('control-selected');
|
|
156
|
-
exports.selectControl = createExternalAction('select-control');
|
|
157
|
-
exports.addExtensionPoint = createExternalAction('add-extension-point');
|
|
158
|
-
exports.deletePropertyChanges = createExternalAction('delete-property-changes');
|
|
159
|
-
exports.outlineChanged = createExternalAction('outline-changed');
|
|
160
|
-
exports.changeProperty = createExternalAction('change-property');
|
|
161
|
-
exports.propertyChanged = createExternalAction('property-changed');
|
|
162
|
-
exports.propertyChangeFailed = createExternalAction('change-property-failed');
|
|
163
|
-
exports.changeStackModified = createExternalAction('change-stack-modified');
|
|
164
|
-
exports.toggleAppPreviewVisibility = createExternalAction('toggle-app-preview-visibility');
|
|
165
|
-
exports.reloadApplication = createExternalAction('reload-application');
|
|
166
|
-
exports.storageFileChanged = createExternalAction('storage-file-changed');
|
|
167
|
-
exports.setAppMode = createExternalAction('set-app-mode');
|
|
168
|
-
exports.applicationModeChanged = createExternalAction('application-mode-changed');
|
|
169
|
-
exports.setUndoRedoEnablement = createExternalAction('set-undo-redo-enablement');
|
|
170
|
-
exports.setSaveEnablement = createExternalAction('set-save-enablement');
|
|
171
|
-
exports.appLoaded = createExternalAction('app-loaded');
|
|
172
|
-
exports.undo = createExternalAction('undo');
|
|
173
|
-
exports.redo = createExternalAction('redo');
|
|
174
|
-
exports.save = createExternalAction('save');
|
|
175
|
-
exports.quickActionListChanged = createExternalAction('quick-action-list-changed');
|
|
176
|
-
exports.updateQuickAction = createExternalAction('update-quick-action');
|
|
177
|
-
exports.executeQuickAction = createExternalAction('execute-quick-action');
|
|
178
|
-
exports.executeContextMenuAction = createExternalAction('execute-context-menu-action');
|
|
179
|
-
exports.setApplicationRequiresReload = createExternalAction('set-application-requires-reload');
|
|
180
|
-
exports.externalFileChange = createExternalAction('external-file-change');
|
|
181
|
-
exports.showInfoCenterMessage = createExternalAction('show-info-center-message');
|
|
182
|
-
const createAsyncExternalAction = createAsyncActionFactory(exports.EXTERNAL_ACTION_PREFIX);
|
|
183
|
-
exports.requestControlContextMenu = createAsyncExternalAction('request-control-context-menu');
|
|
184
323
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
var debounce$1 = {};
|
|
188
|
-
|
|
189
|
-
Object.defineProperty(debounce$1, "__esModule", { value: true });
|
|
190
|
-
debounce$1.debounce = debounce;
|
|
191
|
-
/**
|
|
192
|
-
* Returns a function which calls the callback function only after the specified idle time
|
|
193
|
-
* Works similar to the Debounce operator from rxjs https://reactivex.io/documentation/operators/debounce.html link.
|
|
194
|
-
*
|
|
195
|
-
* @param callback Function to execute
|
|
196
|
-
* @param delay Idle period in milliseconds after which the callback will be executed
|
|
197
|
-
* @returns A wrapper function that should be called to invoke the callback function after delay
|
|
198
|
-
*/
|
|
199
|
-
function debounce(callback, delay) {
|
|
200
|
-
let timerId;
|
|
201
|
-
return (...args) => {
|
|
202
|
-
clearTimeout(timerId);
|
|
203
|
-
timerId = setTimeout(() => {
|
|
204
|
-
callback(...args);
|
|
205
|
-
}, delay);
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
var postMessage = {};
|
|
210
|
-
|
|
211
|
-
Object.defineProperty(postMessage, "__esModule", { value: true });
|
|
212
|
-
postMessage.startPostMessageCommunication = startPostMessageCommunication;
|
|
213
|
-
const POST_MESSAGE_ACTION_TYPE = 'post-message-action';
|
|
214
|
-
/**
|
|
215
|
-
* Check if data isPostMessageAction.
|
|
216
|
-
*
|
|
217
|
-
* @param data - post message action
|
|
218
|
-
* @returns data is PostMessageAction<T>
|
|
219
|
-
*/
|
|
220
|
-
function isPostMessageAction(data) {
|
|
221
|
-
return data?.type === POST_MESSAGE_ACTION_TYPE && typeof data?.action === 'object';
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Method to start post message communication.
|
|
225
|
-
*
|
|
226
|
-
* @param target target window
|
|
227
|
-
* @param onActionHandler action handler
|
|
228
|
-
* @param logger to log info, default: browser console.
|
|
229
|
-
* @returns PostMessageCommunication<T>
|
|
230
|
-
*/
|
|
231
|
-
function startPostMessageCommunication(target, onActionHandler, logger = console) {
|
|
232
|
-
/**
|
|
233
|
-
* Returns target windows or undefined.
|
|
234
|
-
*
|
|
235
|
-
* @returns Window | undefined
|
|
236
|
-
*/
|
|
237
|
-
function getTarget() {
|
|
238
|
-
if (typeof target === 'function') {
|
|
239
|
-
return target();
|
|
240
|
-
}
|
|
241
|
-
return target;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Invoke action on post message.
|
|
245
|
-
*
|
|
246
|
-
* @param event event
|
|
247
|
-
*/
|
|
248
|
-
function postMessageListener(event) {
|
|
249
|
-
const target = getTarget();
|
|
250
|
-
if (!target || event.origin !== target.origin || event.source !== target) {
|
|
251
|
-
// Ignore messages from unknown sources
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
if (isPostMessageAction(event.data)) {
|
|
255
|
-
onActionHandler(event.data.action).catch((error) => logger.error(error));
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
logger.warn(`Unknown message received ${event.data}`);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
function dispose() {
|
|
262
|
-
window.removeEventListener('message', postMessageListener);
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Post message to a give window.
|
|
266
|
-
*
|
|
267
|
-
* @param action action payload
|
|
268
|
-
*/
|
|
269
|
-
function sendAction(action) {
|
|
270
|
-
const target = getTarget();
|
|
271
|
-
if (!target) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
const message = {
|
|
275
|
-
type: POST_MESSAGE_ACTION_TYPE,
|
|
276
|
-
action
|
|
277
|
-
};
|
|
278
|
-
target.postMessage(message, target.origin);
|
|
279
|
-
}
|
|
280
|
-
window.addEventListener('message', postMessageListener);
|
|
281
|
-
return {
|
|
282
|
-
dispose,
|
|
283
|
-
sendAction
|
|
284
|
-
};
|
|
324
|
+
return postMessage;
|
|
285
325
|
}
|
|
286
326
|
|
|
287
327
|
var telemetry = {};
|
|
288
328
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
329
|
+
var hasRequiredTelemetry;
|
|
330
|
+
|
|
331
|
+
function requireTelemetry () {
|
|
332
|
+
if (hasRequiredTelemetry) return telemetry;
|
|
333
|
+
hasRequiredTelemetry = 1;
|
|
334
|
+
Object.defineProperty(telemetry, "__esModule", { value: true });
|
|
335
|
+
telemetry.enableTelemetry = enableTelemetry;
|
|
336
|
+
telemetry.disableTelemetry = disableTelemetry;
|
|
337
|
+
telemetry.reportTelemetry = reportTelemetry;
|
|
338
|
+
let enabled = false;
|
|
339
|
+
function enableTelemetry() {
|
|
340
|
+
enabled = true;
|
|
341
|
+
}
|
|
342
|
+
function disableTelemetry() {
|
|
343
|
+
enabled = false;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Reports telemetry data from Control Property Editor.
|
|
347
|
+
*
|
|
348
|
+
* @param data The TelemetryData object, that needs to be reported
|
|
349
|
+
* @returns {Promise<void>}
|
|
350
|
+
*/
|
|
351
|
+
async function reportTelemetry(data) {
|
|
352
|
+
try {
|
|
353
|
+
if (enabled) {
|
|
354
|
+
const requestOptions = {
|
|
355
|
+
method: 'POST',
|
|
356
|
+
headers: {
|
|
357
|
+
Accept: 'application/json',
|
|
358
|
+
'Content-Type': 'application/json'
|
|
359
|
+
},
|
|
360
|
+
body: JSON.stringify(data)
|
|
361
|
+
};
|
|
362
|
+
await fetch('/preview/api/telemetry', requestOptions);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
catch (_error) {
|
|
366
|
+
// something is wrong with the telemetry service
|
|
367
|
+
disableTelemetry();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
return telemetry;
|
|
324
372
|
}
|
|
325
373
|
|
|
326
374
|
var utils = {};
|
|
327
375
|
|
|
328
|
-
|
|
329
|
-
utils.FlexChangesEndPoints = utils.convertCamelCaseToPascalCase = void 0;
|
|
330
|
-
const isUpperCase = (code) => code >= 65 && code <= 90;
|
|
331
|
-
const isLowerCase = (code) => code >= 97 && code <= 122;
|
|
332
|
-
const isWordDelimiter = (code) => code === 45 || code === 95 || code === 32; // - or _ or space
|
|
333
|
-
const convertCamelCaseToPascalCase = (text) => {
|
|
334
|
-
const words = [];
|
|
335
|
-
let word = '';
|
|
336
|
-
let lookForUpperCase = true;
|
|
337
|
-
for (let i = 0; i < (text ?? '').length; i++) {
|
|
338
|
-
const character = text[i];
|
|
339
|
-
if (lookForUpperCase) {
|
|
340
|
-
// make sure that the first letter is capitalized
|
|
341
|
-
word += word.length === 0 ? character.toUpperCase() : character;
|
|
342
|
-
if (isLowerCase(text.charCodeAt(i + 1))) {
|
|
343
|
-
// First lower case character after upper case character -> switch mode to collect only lower case characters
|
|
344
|
-
lookForUpperCase = false;
|
|
345
|
-
}
|
|
346
|
-
else if (isUpperCase(text.charCodeAt(i + 1)) && isLowerCase(text.charCodeAt(i + 2))) {
|
|
347
|
-
// Next character is the last uppercase character after a sequence of upper case character -> create an abbreviated word
|
|
348
|
-
words.push(word);
|
|
349
|
-
word = '';
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
else if (isUpperCase(text.charCodeAt(i))) {
|
|
353
|
-
// Upper case character indicates the beginning of a new word -> switch mode to detect abbreviated word
|
|
354
|
-
words.push(word);
|
|
355
|
-
lookForUpperCase = true;
|
|
356
|
-
word = character;
|
|
357
|
-
}
|
|
358
|
-
else if (isWordDelimiter(text.charCodeAt(i))) {
|
|
359
|
-
words.push(word);
|
|
360
|
-
lookForUpperCase = true;
|
|
361
|
-
word = '';
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
word += character;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
if (word.length) {
|
|
368
|
-
words.push(word);
|
|
369
|
-
}
|
|
370
|
-
return words.join(' ');
|
|
371
|
-
};
|
|
372
|
-
utils.convertCamelCaseToPascalCase = convertCamelCaseToPascalCase;
|
|
373
|
-
var FlexChangesEndPoints;
|
|
374
|
-
(function (FlexChangesEndPoints) {
|
|
375
|
-
FlexChangesEndPoints["changes"] = "/preview/api/changes";
|
|
376
|
-
})(FlexChangesEndPoints || (utils.FlexChangesEndPoints = FlexChangesEndPoints = {}));
|
|
376
|
+
var hasRequiredUtils;
|
|
377
377
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
378
|
+
function requireUtils () {
|
|
379
|
+
if (hasRequiredUtils) return utils;
|
|
380
|
+
hasRequiredUtils = 1;
|
|
381
|
+
Object.defineProperty(utils, "__esModule", { value: true });
|
|
382
|
+
utils.FlexChangesEndPoints = utils.convertCamelCaseToPascalCase = void 0;
|
|
383
|
+
const isUpperCase = (code) => code >= 65 && code <= 90;
|
|
384
|
+
const isLowerCase = (code) => code >= 97 && code <= 122;
|
|
385
|
+
const isWordDelimiter = (code) => code === 45 || code === 95 || code === 32; // - or _ or space
|
|
386
|
+
const convertCamelCaseToPascalCase = (text) => {
|
|
387
|
+
const words = [];
|
|
388
|
+
let word = '';
|
|
389
|
+
let lookForUpperCase = true;
|
|
390
|
+
for (let i = 0; i < (text ?? '').length; i++) {
|
|
391
|
+
const character = text[i];
|
|
392
|
+
if (lookForUpperCase) {
|
|
393
|
+
// make sure that the first letter is capitalized
|
|
394
|
+
word += word.length === 0 ? character.toUpperCase() : character;
|
|
395
|
+
if (isLowerCase(text.charCodeAt(i + 1))) {
|
|
396
|
+
// First lower case character after upper case character -> switch mode to collect only lower case characters
|
|
397
|
+
lookForUpperCase = false;
|
|
398
|
+
}
|
|
399
|
+
else if (isUpperCase(text.charCodeAt(i + 1)) && isLowerCase(text.charCodeAt(i + 2))) {
|
|
400
|
+
// Next character is the last uppercase character after a sequence of upper case character -> create an abbreviated word
|
|
401
|
+
words.push(word);
|
|
402
|
+
word = '';
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else if (isUpperCase(text.charCodeAt(i))) {
|
|
406
|
+
// Upper case character indicates the beginning of a new word -> switch mode to detect abbreviated word
|
|
407
|
+
words.push(word);
|
|
408
|
+
lookForUpperCase = true;
|
|
409
|
+
word = character;
|
|
410
|
+
}
|
|
411
|
+
else if (isWordDelimiter(text.charCodeAt(i))) {
|
|
412
|
+
words.push(word);
|
|
413
|
+
lookForUpperCase = true;
|
|
414
|
+
word = '';
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
word += character;
|
|
418
|
+
}
|
|
384
419
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}));
|
|
390
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
391
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
420
|
+
if (word.length) {
|
|
421
|
+
words.push(word);
|
|
422
|
+
}
|
|
423
|
+
return words.join(' ');
|
|
392
424
|
};
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
var post_message_1 = postMessage;
|
|
399
|
-
Object.defineProperty(exports, "startPostMessageCommunication", { enumerable: true, get: function () { return post_message_1.startPostMessageCommunication; } });
|
|
400
|
-
var telemetry_1 = telemetry;
|
|
401
|
-
Object.defineProperty(exports, "reportTelemetry", { enumerable: true, get: function () { return telemetry_1.reportTelemetry; } });
|
|
402
|
-
Object.defineProperty(exports, "enableTelemetry", { enumerable: true, get: function () { return telemetry_1.enableTelemetry; } });
|
|
403
|
-
Object.defineProperty(exports, "disableTelemetry", { enumerable: true, get: function () { return telemetry_1.disableTelemetry; } });
|
|
404
|
-
__exportStar(utils, exports);
|
|
425
|
+
utils.convertCamelCaseToPascalCase = convertCamelCaseToPascalCase;
|
|
426
|
+
var FlexChangesEndPoints;
|
|
427
|
+
(function (FlexChangesEndPoints) {
|
|
428
|
+
FlexChangesEndPoints["changes"] = "/preview/api/changes";
|
|
429
|
+
})(FlexChangesEndPoints || (utils.FlexChangesEndPoints = FlexChangesEndPoints = {}));
|
|
405
430
|
|
|
406
|
-
|
|
431
|
+
return utils;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
var hasRequiredDist;
|
|
435
|
+
|
|
436
|
+
function requireDist () {
|
|
437
|
+
if (hasRequiredDist) return dist;
|
|
438
|
+
hasRequiredDist = 1;
|
|
439
|
+
(function (exports) {
|
|
440
|
+
var __createBinding = (dist && dist.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
441
|
+
if (k2 === undefined) k2 = k;
|
|
442
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
443
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
444
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
445
|
+
}
|
|
446
|
+
Object.defineProperty(o, k2, desc);
|
|
447
|
+
}) : (function(o, m, k, k2) {
|
|
448
|
+
if (k2 === undefined) k2 = k;
|
|
449
|
+
o[k2] = m[k];
|
|
450
|
+
}));
|
|
451
|
+
var __exportStar = (dist && dist.__exportStar) || function(m, exports) {
|
|
452
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
453
|
+
};
|
|
454
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
455
|
+
exports.disableTelemetry = exports.enableTelemetry = exports.reportTelemetry = exports.startPostMessageCommunication = exports.debounce = void 0;
|
|
456
|
+
__exportStar(requireApi(), exports);
|
|
457
|
+
var debounce_1 = requireDebounce();
|
|
458
|
+
Object.defineProperty(exports, "debounce", { enumerable: true, get: function () { return debounce_1.debounce; } });
|
|
459
|
+
var post_message_1 = requirePostMessage();
|
|
460
|
+
Object.defineProperty(exports, "startPostMessageCommunication", { enumerable: true, get: function () { return post_message_1.startPostMessageCommunication; } });
|
|
461
|
+
var telemetry_1 = requireTelemetry();
|
|
462
|
+
Object.defineProperty(exports, "reportTelemetry", { enumerable: true, get: function () { return telemetry_1.reportTelemetry; } });
|
|
463
|
+
Object.defineProperty(exports, "enableTelemetry", { enumerable: true, get: function () { return telemetry_1.enableTelemetry; } });
|
|
464
|
+
Object.defineProperty(exports, "disableTelemetry", { enumerable: true, get: function () { return telemetry_1.disableTelemetry; } });
|
|
465
|
+
__exportStar(requireUtils(), exports);
|
|
466
|
+
|
|
467
|
+
} (dist));
|
|
468
|
+
return dist;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
var distExports = requireDist();
|
|
472
|
+
var defExp = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
473
|
+
|
|
474
|
+
var namedExports = /*#__PURE__*/_mergeNamespaces({
|
|
475
|
+
__proto__: null,
|
|
476
|
+
default: defExp
|
|
477
|
+
}, [distExports]);
|
|
407
478
|
|
|
408
|
-
Object.
|
|
479
|
+
const defaultExports = Object.isFrozen(defExp) ? Object.assign({}, defExp?.default || defExp || { __emptyModule: true }) : defExp;
|
|
480
|
+
Object.keys(namedExports || {}).filter((key) => !defaultExports[key]).forEach((key) => defaultExports[key] = namedExports[key]);
|
|
481
|
+
Object.defineProperty(defaultExports, "__" + "esModule", { value: true });
|
|
482
|
+
var index = Object.isFrozen(defExp) ? Object.freeze(defaultExports) : defaultExports;
|
|
409
483
|
|
|
410
|
-
return
|
|
484
|
+
return index;
|
|
411
485
|
|
|
412
486
|
}));
|