@sap-ux/preview-middleware 0.26.11 → 1.0.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.
- package/dist/base/cdm.d.ts +2 -2
- package/dist/base/cdm.js +10 -11
- package/dist/base/config.d.ts +1 -1
- package/dist/base/config.js +60 -72
- package/dist/base/flex.js +16 -23
- package/dist/base/flp.d.ts +2 -2
- package/dist/base/flp.js +96 -96
- package/dist/base/index.d.ts +3 -3
- package/dist/base/index.js +3 -12
- package/dist/base/remote-url.js +14 -24
- package/dist/base/test.d.ts +1 -1
- package/dist/base/test.js +2 -6
- package/dist/base/utils/cards.d.ts +1 -1
- package/dist/base/utils/cards.js +3 -9
- package/dist/client/adp/add-fragment.js +4 -4
- package/dist/client/adp/add-fragment.ts +2 -2
- package/dist/client/adp/api-handler.js +2 -2
- package/dist/client/adp/api-handler.ts +1 -1
- package/dist/client/adp/command-executor.js +3 -3
- package/dist/client/adp/command-executor.ts +2 -2
- package/dist/client/adp/controllers/AddActionFragment.controller.js +5 -5
- package/dist/client/adp/controllers/AddActionFragment.controller.ts +7 -7
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +7 -7
- package/dist/client/adp/controllers/AddCustomFragment.controller.ts +9 -9
- package/dist/client/adp/controllers/AddFragment.controller.js +7 -7
- package/dist/client/adp/controllers/AddFragment.controller.ts +11 -11
- package/dist/client/adp/controllers/AddSubpage.controller.js +4 -4
- package/dist/client/adp/controllers/AddSubpage.controller.ts +7 -7
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +7 -7
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +11 -11
- package/dist/client/adp/controllers/BaseDialog.controller.js +3 -3
- package/dist/client/adp/controllers/BaseDialog.controller.ts +6 -6
- package/dist/client/adp/controllers/ControllerExtension.controller.js +14 -14
- package/dist/client/adp/controllers/ControllerExtension.controller.ts +12 -12
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +4 -4
- package/dist/client/adp/controllers/ExtensionPoint.controller.ts +5 -5
- package/dist/client/adp/controllers/FileExistsDialog.controller.js +2 -2
- package/dist/client/adp/controllers/FileExistsDialog.controller.ts +2 -2
- package/dist/client/adp/dialog-factory.js +2 -2
- package/dist/client/adp/dialog-factory.ts +16 -16
- package/dist/client/adp/extend-controller.js +4 -4
- package/dist/client/adp/extend-controller.ts +2 -2
- package/dist/client/adp/extension-point.js +5 -5
- package/dist/client/adp/extension-point.ts +4 -4
- package/dist/client/adp/init-dialogs.js +6 -6
- package/dist/client/adp/init-dialogs.ts +6 -6
- package/dist/client/adp/init.js +13 -13
- package/dist/client/adp/init.ts +9 -9
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +8 -8
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts +10 -10
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +13 -13
- package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +11 -11
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +11 -11
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +10 -10
- package/dist/client/adp/quick-actions/common/create-page-action.js +8 -8
- package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -7
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +6 -6
- package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +5 -5
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +7 -7
- package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -7
- package/dist/client/adp/quick-actions/common/utils.ts +1 -1
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +3 -3
- package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +3 -3
- package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +6 -6
- package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.ts +5 -5
- package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +5 -5
- package/dist/client/adp/quick-actions/fe-v2/change-table-actions.ts +5 -5
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +7 -7
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +5 -5
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +11 -11
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -6
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +13 -13
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +7 -7
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +9 -9
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +6 -6
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +11 -11
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +6 -6
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +4 -4
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.ts +3 -3
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +4 -4
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +4 -4
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +12 -12
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +8 -8
- package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +6 -6
- package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.ts +5 -5
- package/dist/client/adp/quick-actions/fe-v2/registry.js +18 -18
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +18 -18
- package/dist/client/adp/quick-actions/fe-v2/utils.js +4 -4
- package/dist/client/adp/quick-actions/fe-v2/utils.ts +2 -2
- package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +7 -7
- package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.ts +5 -5
- package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +9 -9
- package/dist/client/adp/quick-actions/fe-v4/change-table-actions.ts +7 -7
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +6 -6
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +6 -6
- package/dist/client/adp/quick-actions/fe-v4/create-page-action.js +11 -11
- package/dist/client/adp/quick-actions/fe-v4/create-page-action.ts +9 -9
- package/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.js +13 -13
- package/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.ts +11 -11
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.js +16 -16
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.ts +9 -9
- package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +5 -5
- package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.ts +4 -4
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +5 -5
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +5 -5
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +7 -7
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +6 -6
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +5 -5
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts +5 -5
- package/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.js +8 -8
- package/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.ts +8 -8
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +12 -12
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +8 -8
- package/dist/client/adp/quick-actions/fe-v4/registry.js +17 -17
- package/dist/client/adp/quick-actions/fe-v4/registry.ts +17 -17
- package/dist/client/adp/quick-actions/fe-v4/utils.js +6 -6
- package/dist/client/adp/quick-actions/fe-v4/utils.ts +3 -3
- package/dist/client/adp/quick-actions/load.ts +2 -2
- package/dist/client/adp/quick-actions/quick-action-base.js +2 -2
- package/dist/client/adp/quick-actions/quick-action-base.ts +3 -3
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +3 -3
- package/dist/client/adp/quick-actions/simple-quick-action-base.ts +4 -4
- package/dist/client/adp/quick-actions/table-quick-action-base.js +17 -17
- package/dist/client/adp/quick-actions/table-quick-action-base.ts +9 -9
- package/dist/client/adp/sync-views-utils.js +4 -4
- package/dist/client/adp/sync-views-utils.ts +3 -3
- package/dist/client/adp/utils.js +3 -3
- package/dist/client/adp/utils.ts +2 -2
- package/dist/client/cpe/additional-change-info/add-xml-additional-info.js +7 -7
- package/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +2 -2
- package/dist/client/cpe/changes/flex-change.js +3 -3
- package/dist/client/cpe/changes/flex-change.ts +3 -3
- package/dist/client/cpe/changes/generic-change.js +5 -5
- package/dist/client/cpe/changes/generic-change.ts +4 -4
- package/dist/client/cpe/changes/index.js +2 -2
- package/dist/client/cpe/changes/index.ts +1 -1
- package/dist/client/cpe/changes/service.js +12 -12
- package/dist/client/cpe/changes/service.ts +9 -9
- package/dist/client/cpe/changes/validator.js +2 -2
- package/dist/client/cpe/changes/validator.ts +1 -1
- package/dist/client/cpe/communication-service.js +2 -2
- package/dist/client/cpe/communication-service.ts +2 -2
- package/dist/client/cpe/connector-service.js +3 -3
- package/dist/client/cpe/connector-service.ts +3 -3
- package/dist/client/cpe/context-menu-service.js +6 -6
- package/dist/client/cpe/context-menu-service.ts +6 -6
- package/dist/client/cpe/control-data.js +3 -3
- package/dist/client/cpe/control-data.ts +5 -5
- package/dist/client/cpe/documentation.js +4 -4
- package/dist/client/cpe/documentation.ts +5 -5
- package/dist/client/cpe/init.js +15 -15
- package/dist/client/cpe/init.ts +16 -16
- package/dist/client/cpe/odata-health/odata-health-checker.js +5 -5
- package/dist/client/cpe/odata-health/odata-health-checker.ts +10 -10
- package/dist/client/cpe/outline/editable.js +4 -4
- package/dist/client/cpe/outline/editable.ts +4 -4
- package/dist/client/cpe/outline/nodes.js +7 -7
- package/dist/client/cpe/outline/nodes.ts +7 -7
- package/dist/client/cpe/outline/service.js +3 -3
- package/dist/client/cpe/outline/service.ts +4 -4
- package/dist/client/cpe/quick-actions/quick-action-service.js +5 -5
- package/dist/client/cpe/quick-actions/quick-action-service.ts +10 -10
- package/dist/client/cpe/quick-actions/registry.js +3 -3
- package/dist/client/cpe/quick-actions/registry.ts +4 -4
- package/dist/client/cpe/quick-actions/utils.js +3 -3
- package/dist/client/cpe/quick-actions/utils.ts +2 -2
- package/dist/client/cpe/rta-service.ts +1 -1
- package/dist/client/cpe/selection.js +8 -8
- package/dist/client/cpe/selection.ts +7 -7
- package/dist/client/cpe/utils.js +2 -2
- package/dist/client/cpe/utils.ts +2 -2
- package/dist/client/flp/WorkspaceConnector.js +6 -6
- package/dist/client/flp/WorkspaceConnector.ts +4 -4
- package/dist/client/flp/enableFakeConnector.js +4 -4
- package/dist/client/flp/enableFakeConnector.ts +3 -3
- package/dist/client/flp/init.js +6 -6
- package/dist/client/flp/init.ts +5 -5
- package/dist/client/flp/initConnectors.js +3 -3
- package/dist/client/flp/initConnectors.ts +1 -1
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +397 -477
- package/dist/client/utils/additional-change-info.js +2 -2
- package/dist/client/utils/additional-change-info.ts +2 -2
- package/dist/client/utils/core.js +2 -2
- package/dist/client/utils/core.ts +1 -1
- package/dist/client/utils/fe-v4.js +3 -3
- package/dist/client/utils/fe-v4.ts +2 -2
- package/dist/client/utils/info-center-message.js +3 -3
- package/dist/client/utils/info-center-message.ts +2 -2
- package/dist/client/utils/version.js +2 -2
- package/dist/client/utils/version.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -25
- package/dist/types/index.js +1 -4
- package/dist/ui5/middleware.d.ts +11 -1
- package/dist/ui5/middleware.js +13 -15
- package/package.json +18 -16
|
@@ -1,486 +1,406 @@
|
|
|
1
|
-
sap.ui.define((function () { 'use strict';
|
|
1
|
+
sap.ui.define(['exports'], (function (exports) { 'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
const BOOLEAN_VALUE_TYPE = 'boolean';
|
|
4
|
+
const INTEGER_VALUE_TYPE = 'integer';
|
|
5
|
+
const FLOAT_VALUE_TYPE = 'float';
|
|
6
|
+
const STRING_VALUE_TYPE = 'string';
|
|
7
|
+
const INPUT_EDITOR_TYPE = 'input';
|
|
8
|
+
const DROPDOWN_EDITOR_TYPE = 'dropdown';
|
|
9
|
+
const CHECKBOX_EDITOR_TYPE = 'checkbox';
|
|
10
|
+
const SCENARIO = {
|
|
11
|
+
AppVariant: 'APP_VARIANT',
|
|
12
|
+
VersionedAppVariant: 'VERSIONED_APP_VARIANT',
|
|
13
|
+
AdaptationProject: 'ADAPTATION_PROJECT',
|
|
14
|
+
FioriElementsFromScratch: 'FE_FROM_SCRATCH',
|
|
15
|
+
UiAdaptation: 'UI_ADAPTATION'
|
|
16
|
+
};
|
|
17
|
+
exports.PropertyType = void 0;
|
|
18
|
+
(function (PropertyType) {
|
|
19
|
+
PropertyType["Configuration"] = "configuration";
|
|
20
|
+
PropertyType["ControlProperty"] = "controlProperty";
|
|
21
|
+
})(exports.PropertyType || (exports.PropertyType = {}));
|
|
22
|
+
const PENDING_CHANGE_TYPE = 'pending';
|
|
23
|
+
const SAVED_CHANGE_TYPE = 'saved';
|
|
24
|
+
const UNKNOWN_CHANGE_KIND = 'unknown';
|
|
25
|
+
const GENERIC_CHANGE_KIND = 'generic';
|
|
26
|
+
const CONTROL_CHANGE_KIND = 'control';
|
|
27
|
+
const SIMPLE_QUICK_ACTION_KIND = 'simple';
|
|
28
|
+
const NESTED_QUICK_ACTION_KIND = 'nested';
|
|
29
|
+
exports.MessageBarType = void 0;
|
|
30
|
+
(function (MessageBarType) {
|
|
31
|
+
/** Info styled MessageBar */
|
|
32
|
+
MessageBarType[MessageBarType["info"] = 0] = "info";
|
|
33
|
+
/** Error styled MessageBar */
|
|
34
|
+
MessageBarType[MessageBarType["error"] = 1] = "error";
|
|
35
|
+
/** Warning styled MessageBar */
|
|
36
|
+
MessageBarType[MessageBarType["warning"] = 5] = "warning";
|
|
37
|
+
})(exports.MessageBarType || (exports.MessageBarType = {}));
|
|
38
|
+
/**
|
|
39
|
+
* Create matcher.
|
|
40
|
+
*
|
|
41
|
+
* @param type action type
|
|
42
|
+
* @returns (value: { type: unknown } | undefined) => value is Y
|
|
43
|
+
*/
|
|
44
|
+
function createMatcher(type) {
|
|
45
|
+
return function match(value) {
|
|
46
|
+
return value?.type === type;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Create action factory.
|
|
51
|
+
*
|
|
52
|
+
* @param prefix to determine ext action
|
|
53
|
+
* @returns Function
|
|
54
|
+
*/
|
|
55
|
+
function createActionFactory(prefix) {
|
|
56
|
+
return function createAction(name) {
|
|
57
|
+
const actionType = [prefix, name].join(' ');
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param payload action payload
|
|
61
|
+
* @returns PayloadAction<typeof actionType, T>
|
|
62
|
+
*/
|
|
63
|
+
function action(payload) {
|
|
64
|
+
return {
|
|
65
|
+
type: actionType,
|
|
66
|
+
payload
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
action.type = actionType;
|
|
70
|
+
action.match = createMatcher(actionType);
|
|
71
|
+
return action;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const PENDING_SUFFIX = '<pending>';
|
|
75
|
+
const FULFILLED_SUFFIX = '<fulfilled>';
|
|
76
|
+
const REJECTED_SUFFIX = '<rejected>';
|
|
77
|
+
/**
|
|
78
|
+
* Factory for creating request response actions.
|
|
79
|
+
*
|
|
80
|
+
* @param prefix action prefix
|
|
81
|
+
* @returns Function
|
|
82
|
+
*/
|
|
83
|
+
function createAsyncActionFactory(prefix) {
|
|
84
|
+
return function createAction(name) {
|
|
85
|
+
const pendingType = [prefix, name, PENDING_SUFFIX].join(' ');
|
|
86
|
+
/**
|
|
87
|
+
* Pending action.
|
|
88
|
+
*
|
|
89
|
+
* @param payload action payload
|
|
90
|
+
* @returns PayloadAction<typeof pendingType, T>
|
|
91
|
+
*/
|
|
92
|
+
function pending(payload) {
|
|
93
|
+
return {
|
|
94
|
+
type: pendingType,
|
|
95
|
+
payload
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
pending.type = pendingType;
|
|
99
|
+
pending.match = createMatcher(pendingType);
|
|
100
|
+
const fulfilledType = [prefix, name, FULFILLED_SUFFIX].join(' ');
|
|
101
|
+
/**
|
|
102
|
+
* Fulfill action.
|
|
103
|
+
*
|
|
104
|
+
* @param payload action payload
|
|
105
|
+
* @returns PayloadAction<typeof fulfilledType, F>
|
|
106
|
+
*/
|
|
107
|
+
function fulfilled(payload) {
|
|
108
|
+
return {
|
|
109
|
+
type: fulfilledType,
|
|
110
|
+
payload
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
fulfilled.type = fulfilledType;
|
|
114
|
+
fulfilled.match = createMatcher(fulfilledType);
|
|
115
|
+
const rejectedType = [prefix, name, REJECTED_SUFFIX].join(' ');
|
|
116
|
+
/**
|
|
117
|
+
* Reject action.
|
|
118
|
+
*
|
|
119
|
+
* @param message error message
|
|
120
|
+
* @param payload R
|
|
121
|
+
* @returns ErrorAction<typeof rejectedType, F>
|
|
122
|
+
*/
|
|
123
|
+
function rejected(message, payload) {
|
|
124
|
+
return {
|
|
125
|
+
type: rejectedType,
|
|
126
|
+
payload,
|
|
127
|
+
error: {
|
|
128
|
+
message
|
|
129
|
+
},
|
|
130
|
+
showMessage: true
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
rejected.type = rejectedType;
|
|
134
|
+
rejected.match = createMatcher(rejectedType);
|
|
135
|
+
return {
|
|
136
|
+
pending,
|
|
137
|
+
fulfilled,
|
|
138
|
+
rejected
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const EXTERNAL_ACTION_PREFIX = '[ext]';
|
|
143
|
+
const createExternalAction = createActionFactory(EXTERNAL_ACTION_PREFIX);
|
|
144
|
+
const iconsLoaded = createExternalAction('icons-loaded');
|
|
145
|
+
const controlSelected = createExternalAction('control-selected');
|
|
146
|
+
const selectControl = createExternalAction('select-control');
|
|
147
|
+
const addExtensionPoint = createExternalAction('add-extension-point');
|
|
148
|
+
const deletePropertyChanges = createExternalAction('delete-property-changes');
|
|
149
|
+
const outlineChanged = createExternalAction('outline-changed');
|
|
150
|
+
const changeProperty = createExternalAction('change-property');
|
|
151
|
+
const propertyChanged = createExternalAction('property-changed');
|
|
152
|
+
const propertyChangeFailed = createExternalAction('change-property-failed');
|
|
153
|
+
const changeStackModified = createExternalAction('change-stack-modified');
|
|
154
|
+
const toggleAppPreviewVisibility = createExternalAction('toggle-app-preview-visibility');
|
|
155
|
+
const reloadApplication = createExternalAction('reload-application');
|
|
156
|
+
const storageFileChanged = createExternalAction('storage-file-changed');
|
|
157
|
+
const setAppMode = createExternalAction('set-app-mode');
|
|
158
|
+
const applicationModeChanged = createExternalAction('application-mode-changed');
|
|
159
|
+
const setUndoRedoEnablement = createExternalAction('set-undo-redo-enablement');
|
|
160
|
+
const setSaveEnablement = createExternalAction('set-save-enablement');
|
|
161
|
+
const appLoaded = createExternalAction('app-loaded');
|
|
162
|
+
const undo = createExternalAction('undo');
|
|
163
|
+
const redo = createExternalAction('redo');
|
|
164
|
+
const save = createExternalAction('save');
|
|
165
|
+
const quickActionListChanged = createExternalAction('quick-action-list-changed');
|
|
166
|
+
const updateQuickAction = createExternalAction('update-quick-action');
|
|
167
|
+
const executeQuickAction = createExternalAction('execute-quick-action');
|
|
168
|
+
const executeContextMenuAction = createExternalAction('execute-context-menu-action');
|
|
169
|
+
const setApplicationRequiresReload = createExternalAction('set-application-requires-reload');
|
|
170
|
+
const externalFileChange = createExternalAction('external-file-change');
|
|
171
|
+
const showInfoCenterMessage = createExternalAction('show-info-center-message');
|
|
172
|
+
const createAsyncExternalAction = createAsyncActionFactory(EXTERNAL_ACTION_PREFIX);
|
|
173
|
+
const requestControlContextMenu = createAsyncExternalAction('request-control-context-menu');
|
|
17
174
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
175
|
+
/**
|
|
176
|
+
* Returns a function which calls the callback function only after the specified idle time
|
|
177
|
+
* Works similar to the Debounce operator from rxjs https://reactivex.io/documentation/operators/debounce.html link.
|
|
178
|
+
*
|
|
179
|
+
* @param callback Function to execute
|
|
180
|
+
* @param delay Idle period in milliseconds after which the callback will be executed
|
|
181
|
+
* @returns A wrapper function that should be called to invoke the callback function after delay
|
|
182
|
+
*/
|
|
183
|
+
function debounce(callback, delay) {
|
|
184
|
+
let timerId;
|
|
185
|
+
return (...args) => {
|
|
186
|
+
clearTimeout(timerId);
|
|
187
|
+
timerId = setTimeout(() => {
|
|
188
|
+
callback(...args);
|
|
189
|
+
}, delay);
|
|
190
|
+
};
|
|
191
|
+
}
|
|
21
192
|
|
|
22
|
-
|
|
193
|
+
const POST_MESSAGE_ACTION_TYPE = 'post-message-action';
|
|
194
|
+
/**
|
|
195
|
+
* Check if data isPostMessageAction.
|
|
196
|
+
*
|
|
197
|
+
* @param data - post message action
|
|
198
|
+
* @returns data is PostMessageAction<T>
|
|
199
|
+
*/
|
|
200
|
+
function isPostMessageAction(data) {
|
|
201
|
+
return data?.type === POST_MESSAGE_ACTION_TYPE && typeof data?.action === 'object';
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Method to start post message communication.
|
|
205
|
+
*
|
|
206
|
+
* @param target target window
|
|
207
|
+
* @param onActionHandler action handler
|
|
208
|
+
* @param logger to log info, default: browser console.
|
|
209
|
+
* @returns PostMessageCommunication<T>
|
|
210
|
+
*/
|
|
211
|
+
function startPostMessageCommunication(target, onActionHandler, logger = console) {
|
|
212
|
+
/**
|
|
213
|
+
* Returns target windows or undefined.
|
|
214
|
+
*
|
|
215
|
+
* @returns Window | undefined
|
|
216
|
+
*/
|
|
217
|
+
function getTarget() {
|
|
218
|
+
if (typeof target === 'function') {
|
|
219
|
+
return target();
|
|
220
|
+
}
|
|
221
|
+
return target;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Invoke action on post message.
|
|
225
|
+
*
|
|
226
|
+
* @param event event
|
|
227
|
+
*/
|
|
228
|
+
function postMessageListener(event) {
|
|
229
|
+
const target = getTarget();
|
|
230
|
+
if (event.origin !== target?.origin || event.source !== target) {
|
|
231
|
+
// Ignore messages from unknown sources
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (isPostMessageAction(event.data)) {
|
|
235
|
+
onActionHandler(event.data.action).catch((error) => logger.error(error));
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
logger.warn(`Unknown message received ${event.data}`);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function dispose() {
|
|
242
|
+
window.removeEventListener('message', postMessageListener);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Post message to a give window.
|
|
246
|
+
*
|
|
247
|
+
* @param action action payload
|
|
248
|
+
*/
|
|
249
|
+
function sendAction(action) {
|
|
250
|
+
const target = getTarget();
|
|
251
|
+
if (!target) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
const message = {
|
|
255
|
+
type: POST_MESSAGE_ACTION_TYPE,
|
|
256
|
+
action
|
|
257
|
+
};
|
|
258
|
+
target.postMessage(message, target.origin);
|
|
259
|
+
}
|
|
260
|
+
window.addEventListener('message', postMessageListener);
|
|
261
|
+
return {
|
|
262
|
+
dispose,
|
|
263
|
+
sendAction
|
|
264
|
+
};
|
|
265
|
+
}
|
|
23
266
|
|
|
24
|
-
|
|
267
|
+
let enabled = false;
|
|
268
|
+
function enableTelemetry() {
|
|
269
|
+
enabled = true;
|
|
270
|
+
}
|
|
271
|
+
function disableTelemetry() {
|
|
272
|
+
enabled = false;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Reports telemetry data from Control Property Editor.
|
|
276
|
+
*
|
|
277
|
+
* @param data The TelemetryData object, that needs to be reported
|
|
278
|
+
* @returns {Promise<void>}
|
|
279
|
+
*/
|
|
280
|
+
async function reportTelemetry(data) {
|
|
281
|
+
try {
|
|
282
|
+
if (enabled) {
|
|
283
|
+
const requestOptions = {
|
|
284
|
+
method: 'POST',
|
|
285
|
+
headers: {
|
|
286
|
+
Accept: 'application/json',
|
|
287
|
+
'Content-Type': 'application/json'
|
|
288
|
+
},
|
|
289
|
+
body: JSON.stringify(data)
|
|
290
|
+
};
|
|
291
|
+
await fetch('/preview/api/telemetry', requestOptions);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
catch (_error) {
|
|
295
|
+
// something is wrong with the telemetry service
|
|
296
|
+
disableTelemetry();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
25
299
|
|
|
26
|
-
|
|
300
|
+
const isUpperCase = (code) => code >= 65 && code <= 90;
|
|
301
|
+
const isLowerCase = (code) => code >= 97 && code <= 122;
|
|
302
|
+
const isWordDelimiter = (code) => code === 45 || code === 95 || code === 32; // - or _ or space
|
|
303
|
+
const convertCamelCaseToPascalCase = (text) => {
|
|
304
|
+
const words = [];
|
|
305
|
+
let word = '';
|
|
306
|
+
let lookForUpperCase = true;
|
|
307
|
+
for (let i = 0; i < (text ?? '').length; i++) {
|
|
308
|
+
const character = text[i];
|
|
309
|
+
if (lookForUpperCase) {
|
|
310
|
+
// make sure that the first letter is capitalized
|
|
311
|
+
word += word.length === 0 ? character.toUpperCase() : character;
|
|
312
|
+
if (isLowerCase(text.charCodeAt(i + 1))) {
|
|
313
|
+
// First lower case character after upper case character -> switch mode to collect only lower case characters
|
|
314
|
+
lookForUpperCase = false;
|
|
315
|
+
}
|
|
316
|
+
else if (isUpperCase(text.charCodeAt(i + 1)) && isLowerCase(text.charCodeAt(i + 2))) {
|
|
317
|
+
// Next character is the last uppercase character after a sequence of upper case character -> create an abbreviated word
|
|
318
|
+
words.push(word);
|
|
319
|
+
word = '';
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
else if (isUpperCase(text.charCodeAt(i))) {
|
|
323
|
+
// Upper case character indicates the beginning of a new word -> switch mode to detect abbreviated word
|
|
324
|
+
words.push(word);
|
|
325
|
+
lookForUpperCase = true;
|
|
326
|
+
word = character;
|
|
327
|
+
}
|
|
328
|
+
else if (isWordDelimiter(text.charCodeAt(i))) {
|
|
329
|
+
words.push(word);
|
|
330
|
+
lookForUpperCase = true;
|
|
331
|
+
word = '';
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
word += character;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (word.length) {
|
|
338
|
+
words.push(word);
|
|
339
|
+
}
|
|
340
|
+
return words.join(' ');
|
|
341
|
+
};
|
|
342
|
+
exports.FlexChangesEndPoints = void 0;
|
|
343
|
+
(function (FlexChangesEndPoints) {
|
|
344
|
+
FlexChangesEndPoints["changes"] = "/preview/api/changes";
|
|
345
|
+
})(exports.FlexChangesEndPoints || (exports.FlexChangesEndPoints = {}));
|
|
27
346
|
|
|
28
|
-
|
|
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');
|
|
347
|
+
const __esModule = true ;
|
|
206
348
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
* @param target target window
|
|
264
|
-
* @param onActionHandler action handler
|
|
265
|
-
* @param logger to log info, default: browser console.
|
|
266
|
-
* @returns PostMessageCommunication<T>
|
|
267
|
-
*/
|
|
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();
|
|
277
|
-
}
|
|
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 (event.origin !== target?.origin || event.source !== target) {
|
|
288
|
-
// Ignore messages from unknown sources
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
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}`);
|
|
296
|
-
}
|
|
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
|
|
314
|
-
};
|
|
315
|
-
target.postMessage(message, target.origin);
|
|
316
|
-
}
|
|
317
|
-
window.addEventListener('message', postMessageListener);
|
|
318
|
-
return {
|
|
319
|
-
dispose,
|
|
320
|
-
sendAction
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
return postMessage;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
var telemetry = {};
|
|
328
|
-
|
|
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;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
var utils = {};
|
|
375
|
-
|
|
376
|
-
var hasRequiredUtils;
|
|
377
|
-
|
|
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
|
-
}
|
|
419
|
-
}
|
|
420
|
-
if (word.length) {
|
|
421
|
-
words.push(word);
|
|
422
|
-
}
|
|
423
|
-
return words.join(' ');
|
|
424
|
-
};
|
|
425
|
-
utils.convertCamelCaseToPascalCase = convertCamelCaseToPascalCase;
|
|
426
|
-
var FlexChangesEndPoints;
|
|
427
|
-
(function (FlexChangesEndPoints) {
|
|
428
|
-
FlexChangesEndPoints["changes"] = "/preview/api/changes";
|
|
429
|
-
})(FlexChangesEndPoints || (utils.FlexChangesEndPoints = FlexChangesEndPoints = {}));
|
|
430
|
-
|
|
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]);
|
|
478
|
-
|
|
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;
|
|
483
|
-
|
|
484
|
-
return index;
|
|
349
|
+
exports.BOOLEAN_VALUE_TYPE = BOOLEAN_VALUE_TYPE;
|
|
350
|
+
exports.CHECKBOX_EDITOR_TYPE = CHECKBOX_EDITOR_TYPE;
|
|
351
|
+
exports.CONTROL_CHANGE_KIND = CONTROL_CHANGE_KIND;
|
|
352
|
+
exports.DROPDOWN_EDITOR_TYPE = DROPDOWN_EDITOR_TYPE;
|
|
353
|
+
exports.EXTERNAL_ACTION_PREFIX = EXTERNAL_ACTION_PREFIX;
|
|
354
|
+
exports.FLOAT_VALUE_TYPE = FLOAT_VALUE_TYPE;
|
|
355
|
+
exports.FULFILLED_SUFFIX = FULFILLED_SUFFIX;
|
|
356
|
+
exports.GENERIC_CHANGE_KIND = GENERIC_CHANGE_KIND;
|
|
357
|
+
exports.INPUT_EDITOR_TYPE = INPUT_EDITOR_TYPE;
|
|
358
|
+
exports.INTEGER_VALUE_TYPE = INTEGER_VALUE_TYPE;
|
|
359
|
+
exports.NESTED_QUICK_ACTION_KIND = NESTED_QUICK_ACTION_KIND;
|
|
360
|
+
exports.PENDING_CHANGE_TYPE = PENDING_CHANGE_TYPE;
|
|
361
|
+
exports.PENDING_SUFFIX = PENDING_SUFFIX;
|
|
362
|
+
exports.REJECTED_SUFFIX = REJECTED_SUFFIX;
|
|
363
|
+
exports.SAVED_CHANGE_TYPE = SAVED_CHANGE_TYPE;
|
|
364
|
+
exports.SCENARIO = SCENARIO;
|
|
365
|
+
exports.SIMPLE_QUICK_ACTION_KIND = SIMPLE_QUICK_ACTION_KIND;
|
|
366
|
+
exports.STRING_VALUE_TYPE = STRING_VALUE_TYPE;
|
|
367
|
+
exports.UNKNOWN_CHANGE_KIND = UNKNOWN_CHANGE_KIND;
|
|
368
|
+
exports.__esModule = __esModule;
|
|
369
|
+
exports.addExtensionPoint = addExtensionPoint;
|
|
370
|
+
exports.appLoaded = appLoaded;
|
|
371
|
+
exports.applicationModeChanged = applicationModeChanged;
|
|
372
|
+
exports.changeProperty = changeProperty;
|
|
373
|
+
exports.changeStackModified = changeStackModified;
|
|
374
|
+
exports.controlSelected = controlSelected;
|
|
375
|
+
exports.convertCamelCaseToPascalCase = convertCamelCaseToPascalCase;
|
|
376
|
+
exports.createAsyncActionFactory = createAsyncActionFactory;
|
|
377
|
+
exports.debounce = debounce;
|
|
378
|
+
exports.deletePropertyChanges = deletePropertyChanges;
|
|
379
|
+
exports.disableTelemetry = disableTelemetry;
|
|
380
|
+
exports.enableTelemetry = enableTelemetry;
|
|
381
|
+
exports.executeContextMenuAction = executeContextMenuAction;
|
|
382
|
+
exports.executeQuickAction = executeQuickAction;
|
|
383
|
+
exports.externalFileChange = externalFileChange;
|
|
384
|
+
exports.iconsLoaded = iconsLoaded;
|
|
385
|
+
exports.outlineChanged = outlineChanged;
|
|
386
|
+
exports.propertyChangeFailed = propertyChangeFailed;
|
|
387
|
+
exports.propertyChanged = propertyChanged;
|
|
388
|
+
exports.quickActionListChanged = quickActionListChanged;
|
|
389
|
+
exports.redo = redo;
|
|
390
|
+
exports.reloadApplication = reloadApplication;
|
|
391
|
+
exports.reportTelemetry = reportTelemetry;
|
|
392
|
+
exports.requestControlContextMenu = requestControlContextMenu;
|
|
393
|
+
exports.save = save;
|
|
394
|
+
exports.selectControl = selectControl;
|
|
395
|
+
exports.setAppMode = setAppMode;
|
|
396
|
+
exports.setApplicationRequiresReload = setApplicationRequiresReload;
|
|
397
|
+
exports.setSaveEnablement = setSaveEnablement;
|
|
398
|
+
exports.setUndoRedoEnablement = setUndoRedoEnablement;
|
|
399
|
+
exports.showInfoCenterMessage = showInfoCenterMessage;
|
|
400
|
+
exports.startPostMessageCommunication = startPostMessageCommunication;
|
|
401
|
+
exports.storageFileChanged = storageFileChanged;
|
|
402
|
+
exports.toggleAppPreviewVisibility = toggleAppPreviewVisibility;
|
|
403
|
+
exports.undo = undo;
|
|
404
|
+
exports.updateQuickAction = updateQuickAction;
|
|
485
405
|
|
|
486
406
|
}));
|