@sap-ux/preview-middleware 0.23.90 → 0.23.91
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/cpe/changes/service.js +1 -1
- package/dist/client/cpe/changes/service.ts +1 -1
- package/dist/client/cpe/feature-service.js +1 -1
- package/dist/client/cpe/feature-service.ts +1 -1
- package/dist/client/cpe/quick-actions/quick-action-definition.js +2 -0
- package/dist/client/cpe/quick-actions/quick-action-definition.ts +132 -0
- package/dist/client/cpe/rta-service.js +1 -1
- package/dist/client/cpe/rta-service.ts +1 -1
- package/dist/client/cpe/types.js +2 -0
- package/dist/client/cpe/types.ts +47 -0
- package/dist/client/flp/enableFakeConnector.js +1 -2
- package/dist/client/flp/enableFakeConnector.ts +1 -2
- package/dist/client/flp/init.js +2 -2
- package/dist/client/flp/init.ts +2 -2
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ sap.ui.define([], function () {
|
|
|
6
6
|
class FeatureService {
|
|
7
7
|
static features = {};
|
|
8
8
|
static {
|
|
9
|
-
// eslint-disable-next-line
|
|
9
|
+
// eslint-disable-next-line fiori-custom/sap-no-dom-access, fiori-custom/sap-browser-api-warning
|
|
10
10
|
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
11
11
|
const features = bootstrapConfig?.dataset.openUxPreviewFeatures;
|
|
12
12
|
if (features) {
|
|
@@ -2,7 +2,7 @@ export class FeatureService {
|
|
|
2
2
|
private static features: Record<string, boolean> = {};
|
|
3
3
|
|
|
4
4
|
static {
|
|
5
|
-
// eslint-disable-next-line
|
|
5
|
+
// eslint-disable-next-line fiori-custom/sap-no-dom-access, fiori-custom/sap-browser-api-warning
|
|
6
6
|
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
7
7
|
const features = bootstrapConfig?.dataset.openUxPreviewFeatures;
|
|
8
8
|
if (features) {
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
|
+
import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
|
|
3
|
+
import type { FlexSettings, Manifest } from 'sap/ui/rta/RuntimeAuthoring';
|
|
4
|
+
import type { ActionService } from 'sap/ui/rta/service/Action';
|
|
5
|
+
import type XMLView from 'sap/ui/core/mvc/XMLView';
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
NestedQuickAction,
|
|
9
|
+
SimpleQuickAction,
|
|
10
|
+
NESTED_QUICK_ACTION_KIND,
|
|
11
|
+
SIMPLE_QUICK_ACTION_KIND
|
|
12
|
+
} from '@sap-ux-private/control-property-editor-common';
|
|
13
|
+
|
|
14
|
+
import type { TextBundle } from '../../i18n';
|
|
15
|
+
import type { ControlTreeIndex } from '../types';
|
|
16
|
+
import type { ChangeService } from '../changes';
|
|
17
|
+
|
|
18
|
+
export interface QuickActionActivationContext {
|
|
19
|
+
controlIndex: ControlTreeIndex;
|
|
20
|
+
actionService: ActionService;
|
|
21
|
+
manifest: Manifest;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface QuickActionTelemetryData {
|
|
25
|
+
actionName: string;
|
|
26
|
+
telemetryEventIdentifier: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface QuickActionContext {
|
|
30
|
+
controlIndex: ControlTreeIndex;
|
|
31
|
+
actionService: ActionService;
|
|
32
|
+
resourceBundle: TextBundle;
|
|
33
|
+
view: XMLView;
|
|
34
|
+
key: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* RTA should not be used directly by quick actions.
|
|
38
|
+
*
|
|
39
|
+
* Currently it is only used for actions opening ADP dialogs,
|
|
40
|
+
* but this should be removed in the future.
|
|
41
|
+
*
|
|
42
|
+
* @deprecated
|
|
43
|
+
*/
|
|
44
|
+
rta: RuntimeAuthoring;
|
|
45
|
+
flexSettings: FlexSettings;
|
|
46
|
+
manifest: Manifest;
|
|
47
|
+
changeService: ChangeService;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface QuickActionDefinitionBase {
|
|
51
|
+
/**
|
|
52
|
+
* Used to identify between different Quick Action definitions.
|
|
53
|
+
*/
|
|
54
|
+
readonly type: string;
|
|
55
|
+
/**
|
|
56
|
+
* Used to identify Quick Action instances.
|
|
57
|
+
* All currently loaded actions must have unique ids.
|
|
58
|
+
*/
|
|
59
|
+
readonly id: string;
|
|
60
|
+
/**
|
|
61
|
+
* Most actions have side effects that already triggers Quick Action reload,
|
|
62
|
+
* however if that is not the case this property should be set to "true" to force Quick Action reload after the action is executed.
|
|
63
|
+
*/
|
|
64
|
+
readonly forceRefreshAfterExecution?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Indicates the number of user steps involved in the Quick Action flow.
|
|
67
|
+
* This value helps distinguish between single-step and multi-step quick actions for telemetry
|
|
68
|
+
*/
|
|
69
|
+
quickActionSteps?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Indicates that the Quick Action is applicable to the given context and should be displayed.
|
|
72
|
+
*/
|
|
73
|
+
isApplicable: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Initializes the action and checks if it should be displayed in current context.
|
|
76
|
+
*/
|
|
77
|
+
initialize: () => void | Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Runs enablement validators to check if the action should be enabled.
|
|
80
|
+
*/
|
|
81
|
+
runEnablementValidators: () => void | Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* This method returns an identifier for telemetry used for grouping multiple events and differentiating
|
|
84
|
+
* between quick actions and other triggering points for fragment creation.
|
|
85
|
+
* @params update - flag for updating timestamp
|
|
86
|
+
*/
|
|
87
|
+
getTelemetryIdentifier: (update?: boolean) => string | undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface SimpleQuickActionDefinition extends QuickActionDefinitionBase {
|
|
91
|
+
readonly kind: typeof SIMPLE_QUICK_ACTION_KIND;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a UI representation object for the action.
|
|
94
|
+
*
|
|
95
|
+
* @returns UI representation object for the action.
|
|
96
|
+
*/
|
|
97
|
+
getActionObject: () => SimpleQuickAction;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Executes the Quick Action.
|
|
101
|
+
*/
|
|
102
|
+
execute: () => FlexCommand[] | Promise<FlexCommand[]>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface NestedQuickActionDefinition extends QuickActionDefinitionBase {
|
|
106
|
+
readonly kind: typeof NESTED_QUICK_ACTION_KIND;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Creates a UI representation object for the action.
|
|
110
|
+
*
|
|
111
|
+
* @returns UI representation object for the action.
|
|
112
|
+
*/
|
|
113
|
+
getActionObject: () => NestedQuickAction;
|
|
114
|
+
/**
|
|
115
|
+
* Executes the Quick Action.
|
|
116
|
+
*
|
|
117
|
+
* @param path - Path to the specific child action that needs to be executed (e.g '0/1').
|
|
118
|
+
*/
|
|
119
|
+
execute: (path: string) => FlexCommand[] | Promise<FlexCommand[]>;
|
|
120
|
+
}
|
|
121
|
+
export type QuickActionDefinition = SimpleQuickActionDefinition | NestedQuickActionDefinition;
|
|
122
|
+
|
|
123
|
+
export interface QuickActionDefinitionConstructor<T extends QuickActionDefinition> {
|
|
124
|
+
new (context: QuickActionContext): T;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface QuickActionDefinitionGroup {
|
|
128
|
+
title: string;
|
|
129
|
+
definitions: QuickActionDefinitionConstructor<QuickActionDefinition>[];
|
|
130
|
+
view: XMLView;
|
|
131
|
+
key: string;
|
|
132
|
+
}
|
|
@@ -53,7 +53,7 @@ sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-proper
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
this.rta.attachStop(() => {
|
|
56
|
-
// eslint-disable-next-line
|
|
56
|
+
// eslint-disable-next-line fiori-custom/sap-no-location-reload
|
|
57
57
|
location.reload();
|
|
58
58
|
});
|
|
59
59
|
this.rta.attachStart(() => {
|
|
@@ -54,7 +54,7 @@ export class RtaService {
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
this.rta.attachStop(() => {
|
|
57
|
-
// eslint-disable-next-line
|
|
57
|
+
// eslint-disable-next-line fiori-custom/sap-no-location-reload
|
|
58
58
|
location.reload();
|
|
59
59
|
});
|
|
60
60
|
this.rta.attachStart(() => {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ExternalAction, OutlineNode } from '@sap-ux-private/control-property-editor-common';
|
|
2
|
+
import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
|
|
3
|
+
|
|
4
|
+
export interface UI5AdaptationOptions {
|
|
5
|
+
rta: RuntimeAuthoring;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type PrimitiveTypes = 'boolean' | 'enum' | 'float' | 'string' | 'any';
|
|
9
|
+
export type PropertyValue = boolean | object | number | string;
|
|
10
|
+
|
|
11
|
+
export interface UI5ControlProperty {
|
|
12
|
+
defaultValue: unknown;
|
|
13
|
+
enumValues: Record<string, string> | undefined;
|
|
14
|
+
isArray: boolean;
|
|
15
|
+
isDeprecated: boolean;
|
|
16
|
+
isEnabled: boolean;
|
|
17
|
+
isIcon: boolean;
|
|
18
|
+
name: string;
|
|
19
|
+
primitiveType: string;
|
|
20
|
+
ui5Type: string | null;
|
|
21
|
+
value: PropertyValue;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface UI5ControlData {
|
|
25
|
+
allowIndexForDefaultAggregation: boolean;
|
|
26
|
+
defaultAggregation: string;
|
|
27
|
+
id: string;
|
|
28
|
+
properties: UI5ControlProperty[];
|
|
29
|
+
selectedControlChildren: string[];
|
|
30
|
+
selectedControlName: string;
|
|
31
|
+
targetAggregation: string[];
|
|
32
|
+
type: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ActionHandler = (action: ExternalAction) => void | Promise<void>;
|
|
36
|
+
export type ActionSenderFunction = (action: ExternalAction) => void;
|
|
37
|
+
export type SubscribeFunction = (handler: ActionHandler) => void;
|
|
38
|
+
export type UnSubscribeFunction = (handler: ActionHandler) => void;
|
|
39
|
+
export type IsReuseComponentApi = (controlId: string) => boolean;
|
|
40
|
+
|
|
41
|
+
export interface Service {
|
|
42
|
+
init(sendAction: ActionSenderFunction, subscribe: SubscribeFunction): void | Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ControlTreeIndex {
|
|
46
|
+
[controlType: string]: OutlineNode[];
|
|
47
|
+
}
|
|
@@ -68,13 +68,12 @@ sap.ui.define(["sap/ui/fl/LrepConnector", "sap/ui/fl/FakeLrepConnector", "../uti
|
|
|
68
68
|
* If the minor version of the SAP UI5 is less than 72, this function extends
|
|
69
69
|
* the FakeLrepConnector's prototype with specific methods and enables the fake connector.
|
|
70
70
|
*
|
|
71
|
-
* Assumes the existence of a global 'sap' object with
|
|
71
|
+
* Assumes the existence of a global 'sap' object with a 'ui.version' property,
|
|
72
72
|
* and global jQuery object with 'extend' method.
|
|
73
73
|
*
|
|
74
74
|
* @returns {void}
|
|
75
75
|
*/
|
|
76
76
|
var __exports = function () {
|
|
77
|
-
// eslint-disable-next-line no-undef
|
|
78
77
|
jQuery.extend(FakeLrepConnector.prototype, {
|
|
79
78
|
create,
|
|
80
79
|
loadChanges,
|
|
@@ -94,13 +94,12 @@ export async function loadChanges(...args: []): Promise<LoadChangesResult> {
|
|
|
94
94
|
* If the minor version of the SAP UI5 is less than 72, this function extends
|
|
95
95
|
* the FakeLrepConnector's prototype with specific methods and enables the fake connector.
|
|
96
96
|
*
|
|
97
|
-
* Assumes the existence of a global 'sap' object with
|
|
97
|
+
* Assumes the existence of a global 'sap' object with a 'ui.version' property,
|
|
98
98
|
* and global jQuery object with 'extend' method.
|
|
99
99
|
*
|
|
100
100
|
* @returns {void}
|
|
101
101
|
*/
|
|
102
102
|
export default function (): void {
|
|
103
|
-
// eslint-disable-next-line no-undef
|
|
104
103
|
jQuery.extend(FakeLrepConnector.prototype, {
|
|
105
104
|
create,
|
|
106
105
|
loadChanges,
|
package/dist/client/flp/init.js
CHANGED
|
@@ -358,7 +358,7 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
358
358
|
renderer.placeAt('content');
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
// eslint-disable-next-line
|
|
361
|
+
// eslint-disable-next-line fiori-custom/sap-no-dom-access,fiori-custom/sap-browser-api-warning
|
|
362
362
|
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
363
363
|
if (bootstrapConfig) {
|
|
364
364
|
init({
|
|
@@ -399,7 +399,7 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
// eslint-disable-next-line
|
|
402
|
+
// eslint-disable-next-line fiori-custom/sap-no-location-reload
|
|
403
403
|
window.location.reload();
|
|
404
404
|
}
|
|
405
405
|
}
|
package/dist/client/flp/init.ts
CHANGED
|
@@ -408,7 +408,7 @@ export async function init({
|
|
|
408
408
|
renderer.placeAt('content');
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
-
// eslint-disable-next-line
|
|
411
|
+
// eslint-disable-next-line fiori-custom/sap-no-dom-access,fiori-custom/sap-browser-api-warning
|
|
412
412
|
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
413
413
|
if (bootstrapConfig) {
|
|
414
414
|
init({
|
|
@@ -442,7 +442,7 @@ export async function handleHigherLayerChanges(error: unknown, ui5VersionInfo: U
|
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
-
// eslint-disable-next-line
|
|
445
|
+
// eslint-disable-next-line fiori-custom/sap-no-location-reload
|
|
446
446
|
window.location.reload();
|
|
447
447
|
}
|
|
448
448
|
}
|
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.23.
|
|
12
|
+
"version": "0.23.91",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
28
|
"qrcode": "1.5.4",
|
|
29
29
|
"@sap/bas-sdk": "3.12.0",
|
|
30
|
-
"@sap-ux/adp-tooling": "0.18.
|
|
30
|
+
"@sap-ux/adp-tooling": "0.18.38",
|
|
31
31
|
"@sap-ux/btp-utils": "1.1.6",
|
|
32
32
|
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.8",
|
|
33
33
|
"@sap-ux/feature-toggle": "0.3.5",
|
|
34
34
|
"@sap-ux/logger": "0.8.0",
|
|
35
|
-
"@sap-ux/project-access": "1.34.
|
|
35
|
+
"@sap-ux/project-access": "1.34.1",
|
|
36
36
|
"@sap-ux/system-access": "0.6.40",
|
|
37
37
|
"@sap-ux/i18n": "0.3.7"
|
|
38
38
|
},
|