@openui5/sap.ui.documentation 1.120.0 → 1.120.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.documentation",
3
- "version": "1.120.0",
3
+ "version": "1.120.1",
4
4
  "description": "OpenUI5 UI Library sap.ui.documentation",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,11 +14,11 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.m": "1.120.0",
18
- "@openui5/sap.ui.core": "1.120.0",
19
- "@openui5/sap.ui.layout": "1.120.0",
20
- "@openui5/themelib_sap_belize": "1.120.0",
21
- "@openui5/themelib_sap_fiori_3": "1.120.0",
22
- "@openui5/themelib_sap_horizon": "1.120.0"
17
+ "@openui5/sap.m": "1.120.1",
18
+ "@openui5/sap.ui.core": "1.120.1",
19
+ "@openui5/sap.ui.layout": "1.120.1",
20
+ "@openui5/themelib_sap_belize": "1.120.1",
21
+ "@openui5/themelib_sap_fiori_3": "1.120.1",
22
+ "@openui5/themelib_sap_horizon": "1.120.1"
23
23
  }
24
24
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.120.0</version>
9
+ <version>1.120.1</version>
10
10
 
11
11
  <documentation>SAPUI5 library for the Demokit 2.0.</documentation>
12
12
 
@@ -25,13 +25,13 @@ sap.ui.define([
25
25
  * @namespace
26
26
  * @alias sap.ui.documentation
27
27
  * @author SAP SE
28
- * @version 1.120.0
28
+ * @version 1.120.1
29
29
  * @since 1.48
30
30
  * @public
31
31
  */
32
32
  var thisLibrary = Core.initLibrary({
33
33
  name : 'sap.ui.documentation',
34
- version: '1.120.0',
34
+ version: '1.120.1',
35
35
  dependencies : ['sap.ui.core','sap.m'],
36
36
  types: [],
37
37
  interfaces: [],
@@ -315,7 +315,7 @@ sap.ui.define(
315
315
  var sCompId = 'sampleComp-' + this._sId;
316
316
  var sCompName = this._sId;
317
317
 
318
- var oComp = Component.get(sCompId);
318
+ var oComp = Component.getComponentById(sCompId);
319
319
 
320
320
  if (oComp) {
321
321
  oComp.destroy();
@@ -652,7 +652,7 @@ sap.ui.define([
652
652
  var sCompName = this._sId;
653
653
  var oMainComponent = this.getOwnerComponent();
654
654
 
655
- var oComp = Component.get(sCompId);
655
+ var oComp = Component.getComponentById(sCompId);
656
656
 
657
657
  if (oComp) {
658
658
  oComp.destroy();
@@ -67,7 +67,7 @@ sap.ui.define([
67
67
  bChangeBootstrap = oFile.name && (oFile.name === oData.iframe || oFile.name.split(".").pop() === "html");
68
68
 
69
69
  if (oFile.name === "manifest.json") {
70
- oManifestFile = oFile;
70
+ oManifestFile = JSON.parse(oFile.raw);
71
71
  aPromises.push(this._addFileToZip({
72
72
  name: this._formatWebAppPath(oFile.name),
73
73
  url: sUrl,
@@ -80,7 +80,7 @@ sap.ui.define([
80
80
  aPromises.push(this._addFileToZip({
81
81
  name: this._formatWebAppPath(oFile.name.replace(new RegExp(/(\.\.\/)+/g), "./")),
82
82
  url: sUrl,
83
- formatter: (bChangeBootstrap && !bCustomIndexHTML) ? this._changeIframeBootstrapToCloud : undefined
83
+ formatter: (bChangeBootstrap && !bCustomIndexHTML) ? this._rewriteRelativeURLs.bind(this) : undefined
84
84
  }, oZipFile));
85
85
  aPromises.push(this.fetchSourceFile(sUrl).then(fnAddMockFileToZip.bind(this)));
86
86
  }
@@ -100,22 +100,24 @@ sap.ui.define([
100
100
 
101
101
 
102
102
  if (!bCustomIndexHTML) {
103
+ var sIndexHTMLFileName = this._formatWebAppPath("index.html");
103
104
  aPromises.push(this._addFileToZip({
104
- name: this._formatWebAppPath("index.html"),
105
+ name: sIndexHTMLFileName,
105
106
  url: TMPL_REF + "/" + (bHasManifest ? "indexevo.html.tmpl" : "index.html.tmpl"),
106
107
  formatter: function(sIndexFile) {
107
- return this._changeIframeBootstrapToCloud(this._formatIndexHtmlFile(sIndexFile, oData));
108
+ return this._rewriteRelativeURLs(this._formatIndexHtmlFile(sIndexFile, oData, oManifestFile), sIndexHTMLFileName);
108
109
  }.bind(this)
109
110
  }, oZipFile, true));
110
111
  }
111
112
 
112
113
 
113
114
  if (!bHasManifest) {
115
+ var sIndexJSFileName = this._formatWebAppPath("index.js");
114
116
  aPromises.push(this._addFileToZip({
115
- name: this._formatWebAppPath("index.js"),
117
+ name: sIndexJSFileName,
116
118
  url: TMPL_REF + "/" + "index.js.tmpl",
117
119
  formatter: function(sIndexJsFile) {
118
- return this._changeIframeBootstrapToCloud(this._formatIndexJsFile(sIndexJsFile, oData));
120
+ return this._rewriteRelativeURLs(this._formatIndexJsFile(sIndexJsFile, oData), sIndexJSFileName);
119
121
  }.bind(this)
120
122
  }, oZipFile, true));
121
123
  }
@@ -181,7 +183,7 @@ sap.ui.define([
181
183
  return; // ignore 404 responses, e.g. for Apache license text file in SAPUI5 environment
182
184
  }
183
185
  if (fnFileFormatter) {
184
- vRawFile = fnFileFormatter(vRawFile);
186
+ vRawFile = fnFileFormatter(vRawFile, sFileName);
185
187
  }
186
188
  oZipFile.file(sFileName, vRawFile);
187
189
  });
@@ -220,7 +222,7 @@ sap.ui.define([
220
222
  return JSON.stringify(oPackageFile, null, 2);
221
223
  },
222
224
 
223
- _formatUI5Yaml: function(sYamlFile, oData, sManifestFile) {
225
+ _formatUI5Yaml: function(sYamlFile, oData, oManifestFile) {
224
226
  let sFormattedYamlFile = sYamlFile.replace(/{{SAMPLE_ID}}/g, this._formatNameToNpmSpec(oData.id));
225
227
  const bIsOpenUI5 = this.getModel("versionData").getProperty("/isOpenUI5");
226
228
  const sUI5Version = this.getModel("versionData").getProperty("/fullVersion");
@@ -231,8 +233,7 @@ sap.ui.define([
231
233
  sFormattedYamlFile = sFormattedYamlFile.replace(/libraries:/g, "libraries:" + this._getSnapshotNote());
232
234
  }
233
235
 
234
- if (sManifestFile) {
235
- const oManifestFile = JSON.parse(sManifestFile.raw);
236
+ if (oManifestFile) {
236
237
  const oUi5Config = oManifestFile["sap.ui5"];
237
238
  const oDependencies = oUi5Config && oUi5Config.dependencies;
238
239
 
@@ -254,9 +255,20 @@ sap.ui.define([
254
255
  return sRawManifestFileJs.replace(new RegExp(/(\.\.\/)+/g), "./");
255
256
  },
256
257
 
257
- _formatIndexHtmlFile: function (sFile, oData) {
258
- return sFile.replace(/{{TITLE}}/g, oData.name)
258
+ _formatIndexHtmlFile: function (sFile, oData, oManifestFile) {
259
+ let sFormattedIndexHtml = sFile.replace(/{{TITLE}}/g, oData.name)
259
260
  .replace(/{{SAMPLE_ID}}/g, oData.id);
261
+
262
+ if (oManifestFile) {
263
+ const oUi5Config = oManifestFile["sap.ui5"];
264
+ const oDependencies = oUi5Config && oUi5Config.dependencies;
265
+
266
+ // samples using sap.ui.fl get a local flex provider to store flex changes locally
267
+ if (oDependencies && oDependencies.libs && oDependencies.libs["sap.ui.fl"]) {
268
+ sFormattedIndexHtml = sFormattedIndexHtml.replace(/<script id="sap-ui-bootstrap"/g, "<script id=\"sap-ui-bootstrap\"\n\t\tdata-sap-ui-flexibilityServices='[{\"connector\": \"LocalStorageConnector\"}]'");
269
+ }
270
+ }
271
+ return sFormattedIndexHtml;
260
272
  },
261
273
 
262
274
  _formatIndexJsFile: function (sFile, oData) {
@@ -274,12 +286,18 @@ sap.ui.define([
274
286
  return sMockData.replace(oRegExp, sCorrectPath);
275
287
  },
276
288
 
277
- _changeIframeBootstrapToCloud: function (sRawIndexFileHtml) {
278
- var rReplaceIndex = /src=(?:"[^"]*\/sap-ui-core\.js"|'[^']*\/sap-ui-core\.js')/,
279
- oRelativeBootstrapURI = new URI(sap.ui.require.toUrl("") + "/sap-ui-core.js"),
280
- sBootstrapURI = oRelativeBootstrapURI.toString();
289
+ _rewriteRelativeURLs: function (sRawHTMLFile, sFileName) {
290
+ const rQuotedUrl = /(['"])(?:[a-zA-Z0-9./])*(resources|test-resources)\//g;
291
+ const sRelativePathToRoot = this._getRelativePathToRoot(sFileName);
292
+ return sRawHTMLFile.replaceAll(rQuotedUrl, "$1" + sRelativePathToRoot + "$2/");
293
+ },
281
294
 
282
- return sRawIndexFileHtml.replace(rReplaceIndex, 'src="' + sBootstrapURI + '"');
295
+ _getRelativePathToRoot: function(sFilePath) {
296
+ // webapp/test/unit/unitTests.qunit.html -> 2
297
+ // webapp/test/mockServer.html -> 1
298
+ // webapp/index.html -> 0
299
+ const iNumberOfLevels = sFilePath.split("/").length - 2;
300
+ return "../".repeat(iNumberOfLevels);
283
301
  },
284
302
 
285
303
  _formatWebAppPath: function(sPath) {
@@ -6,7 +6,7 @@
6
6
  <title>{{TITLE}}</title>
7
7
 
8
8
  <script id="sap-ui-bootstrap"
9
- src="https://sdk.openui5.org/resources/sap-ui-core.js"
9
+ src="resources/sap-ui-core.js"
10
10
  data-sap-ui-libs="sap.m"
11
11
  data-sap-ui-theme="sap_horizon"
12
12
  data-sap-ui-resourceroots='{
@@ -6,7 +6,7 @@
6
6
  <title>{{TITLE}}</title>
7
7
 
8
8
  <script id="sap-ui-bootstrap"
9
- src="https://sdk.openui5.org/resources/sap-ui-core.js"
9
+ src="resources/sap-ui-core.js"
10
10
  data-sap-ui-theme="sap_horizon"
11
11
  data-sap-ui-resourceroots='{
12
12
  "{{SAMPLE_ID}}": "./",
@@ -1,9 +1,9 @@
1
- specVersion: '3.0'
1
+ specVersion: "3.0"
2
2
  metadata:
3
3
  name: {{SAMPLE_ID}}
4
4
  type: application
5
5
  framework:
6
6
  name: {{UI5_KIND}}
7
- version: '{{UI5_VERSION}}'
7
+ version: "{{UI5_VERSION}}"
8
8
  libraries:
9
9
  - name: themelib_sap_horizon