@sap-ux/preview-middleware 0.16.27 → 0.16.29

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.
@@ -101,9 +101,10 @@ export declare function addApp(templateConfig: TemplateConfig, manifest: Partial
101
101
  *
102
102
  * @param config FLP configuration
103
103
  * @param manifest application manifest
104
+ * @param resources additional resources
104
105
  * @returns configuration object for the sandbox.html template
105
106
  */
106
- export declare function createFlpTemplateConfig(config: FlpConfig, manifest: Partial<Manifest>): TemplateConfig;
107
+ export declare function createFlpTemplateConfig(config: FlpConfig, manifest: Partial<Manifest>, resources?: Record<string, string>): TemplateConfig;
107
108
  /**
108
109
  * Creates the configuration object for the test template.
109
110
  *
@@ -196,9 +196,10 @@ async function getI18nTextFromProperty(projectRoot, propertyValue, logger) {
196
196
  *
197
197
  * @param config FLP configuration
198
198
  * @param manifest application manifest
199
+ * @param resources additional resources
199
200
  * @returns configuration object for the sandbox.html template
200
201
  */
201
- function createFlpTemplateConfig(config, manifest) {
202
+ function createFlpTemplateConfig(config, manifest, resources = {}) {
202
203
  const flex = getFlexSettings();
203
204
  const supportedThemes = manifest['sap.ui5']?.supportedThemes ?? [exports.DEFAULT_THEME];
204
205
  const ui5Theme = config.theme ?? (supportedThemes.includes(exports.DEFAULT_THEME) ? exports.DEFAULT_THEME : supportedThemes[0]);
@@ -213,6 +214,7 @@ function createFlpTemplateConfig(config, manifest) {
213
214
  theme: ui5Theme,
214
215
  flex,
215
216
  resources: {
217
+ ...resources,
216
218
  [exports.PREVIEW_URL.client.ns]: exports.PREVIEW_URL.client.url
217
219
  },
218
220
  bootstrapOptions: ''
package/dist/base/flp.js CHANGED
@@ -72,7 +72,7 @@ class FlpSandbox {
72
72
  this.createFlexHandler();
73
73
  this.config.libs ??= await this.hasLocateReuseLibsScript();
74
74
  const id = manifest['sap.app'].id;
75
- this.templateConfig = (0, config_1.createFlpTemplateConfig)(this.config, manifest);
75
+ this.templateConfig = (0, config_1.createFlpTemplateConfig)(this.config, manifest, resources);
76
76
  await (0, config_1.addApp)(this.templateConfig, manifest, {
77
77
  componentId,
78
78
  target: resources[componentId ?? id] ?? this.templateConfig.basePath,
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.16.27",
12
+ "version": "0.16.29",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "@sap-ux/logger": "0.6.0",
29
29
  "@sap-ux/btp-utils": "0.15.0",
30
- "@sap-ux/adp-tooling": "0.12.18",
30
+ "@sap-ux/adp-tooling": "0.12.19",
31
31
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.26",
32
32
  "@sap-ux/project-access": "1.25.7"
33
33
  },