@sap-ux/preview-middleware 0.5.5 → 0.5.6
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/README.md +1 -0
- package/dist/base/flp.js +12 -10
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ It hosts a local Fiori launchpad based on your configuration as well as offers a
|
|
|
13
13
|
| `flp.intent.action` | `string` | `preview` | Optional intent action |
|
|
14
14
|
| `flp.apps` | `array` | `undefined` | Optional additional local apps that are available in local Fiori launchpad |
|
|
15
15
|
| `flp.libs` | `boolean` | `undefined` | Optional flag to add a generic script fetching the paths of used libraries not available in UI5. To disable set it to `false`, if not set, then the project is checked for a `load-reuse-libs` script and if available the libraries are fetched as well. |
|
|
16
|
+
| `flp.theme` | `string` | `undefined` | Optional flag for setting the UI5 Theme. |
|
|
16
17
|
| `adp.target` | | | Required configuration for adaptation projects defining the connected backend |
|
|
17
18
|
| `adp.ignoreCertErrors` | `boolean` | `false` | Optional setting to ignore certification validation errors when working with e.g. development systems with self signed certificates |
|
|
18
19
|
| `rta` | | | Optional configuration allowing to add mount points for runtime adaptation |
|
package/dist/base/flp.js
CHANGED
|
@@ -54,7 +54,7 @@ class FlpSandbox {
|
|
|
54
54
|
* @param logger logger instance
|
|
55
55
|
*/
|
|
56
56
|
constructor(config, project, utils, logger) {
|
|
57
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
57
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
58
58
|
this.project = project;
|
|
59
59
|
this.utils = utils;
|
|
60
60
|
this.logger = logger;
|
|
@@ -62,7 +62,8 @@ class FlpSandbox {
|
|
|
62
62
|
path: (_b = (_a = config.flp) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : DEFAULT_PATH,
|
|
63
63
|
intent: (_d = (_c = config.flp) === null || _c === void 0 ? void 0 : _c.intent) !== null && _d !== void 0 ? _d : DEFAULT_INTENT,
|
|
64
64
|
apps: (_f = (_e = config.flp) === null || _e === void 0 ? void 0 : _e.apps) !== null && _f !== void 0 ? _f : [],
|
|
65
|
-
libs: (_g = config.flp) === null || _g === void 0 ? void 0 : _g.libs
|
|
65
|
+
libs: (_g = config.flp) === null || _g === void 0 ? void 0 : _g.libs,
|
|
66
|
+
theme: (_h = config.flp) === null || _h === void 0 ? void 0 : _h.theme
|
|
66
67
|
};
|
|
67
68
|
if (!this.config.path.startsWith('/')) {
|
|
68
69
|
this.config.path = `/${this.config.path}`;
|
|
@@ -79,31 +80,32 @@ class FlpSandbox {
|
|
|
79
80
|
* @param resources optional additional resource mappings
|
|
80
81
|
*/
|
|
81
82
|
init(manifest, componentId, resources = {}) {
|
|
82
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
83
|
-
var
|
|
83
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
84
|
+
var _l;
|
|
84
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
86
|
const flex = this.createFlexHandler();
|
|
86
87
|
const supportedThemes = (_b = (_a = manifest['sap.ui5']) === null || _a === void 0 ? void 0 : _a.supportedThemes) !== null && _b !== void 0 ? _b : [DEFAULT_THEME];
|
|
88
|
+
const ui5Theme = (_c = this.config.theme) !== null && _c !== void 0 ? _c : (supportedThemes.includes(DEFAULT_THEME) ? DEFAULT_THEME : supportedThemes[0]);
|
|
87
89
|
this.templateConfig = {
|
|
88
|
-
basePath: (
|
|
90
|
+
basePath: (_d = (0, path_1.relative)((0, path_1.dirname)(this.config.path), '/')) !== null && _d !== void 0 ? _d : '.',
|
|
89
91
|
apps: {},
|
|
90
92
|
ui5: {
|
|
91
|
-
libs: Object.keys((
|
|
92
|
-
theme:
|
|
93
|
+
libs: Object.keys((_g = (_f = (_e = manifest['sap.ui5']) === null || _e === void 0 ? void 0 : _e.dependencies) === null || _f === void 0 ? void 0 : _f.libs) !== null && _g !== void 0 ? _g : {}).join(','),
|
|
94
|
+
theme: ui5Theme,
|
|
93
95
|
flex,
|
|
94
96
|
resources: Object.assign(Object.assign({}, resources), { [PREVIEW_URL.client.ns]: PREVIEW_URL.client.url })
|
|
95
97
|
},
|
|
96
|
-
locateReuseLibsScript: (
|
|
98
|
+
locateReuseLibsScript: (_h = this.config.libs) !== null && _h !== void 0 ? _h : (yield this.hasLocateReuseLibsScript())
|
|
97
99
|
};
|
|
98
100
|
this.addApp(manifest, {
|
|
99
101
|
componentId,
|
|
100
|
-
target: (
|
|
102
|
+
target: (_j = resources[componentId !== null && componentId !== void 0 ? componentId : manifest['sap.app'].id]) !== null && _j !== void 0 ? _j : this.templateConfig.basePath,
|
|
101
103
|
local: '.',
|
|
102
104
|
intent: this.config.intent
|
|
103
105
|
});
|
|
104
106
|
this.addStandardRoutes();
|
|
105
107
|
if (this.rta) {
|
|
106
|
-
(
|
|
108
|
+
(_k = (_l = this.rta).options) !== null && _k !== void 0 ? _k : (_l.options = {});
|
|
107
109
|
this.rta.options.baseId = componentId !== null && componentId !== void 0 ? componentId : manifest['sap.app'].id;
|
|
108
110
|
this.addEditorRoutes(this.rta);
|
|
109
111
|
}
|
package/dist/types/index.d.ts
CHANGED
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.5.
|
|
12
|
+
"version": "0.5.6",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|