@openui5/sap.ui.documentation 1.120.0 → 1.120.2
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/.reuse/dep5 +1 -1
- package/THIRDPARTY.txt +1 -1
- package/package.json +7 -7
- package/src/sap/ui/documentation/.library +1 -1
- package/src/sap/ui/documentation/library.js +2 -2
- package/src/sap/ui/documentation/sdk/controller/Code.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Sample.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/SampleBaseController.js +35 -17
- package/src/sap/ui/documentation/sdk/tmpl/index.html.tmpl +1 -1
- package/src/sap/ui/documentation/sdk/tmpl/indexevo.html.tmpl +1 -1
- package/src/sap/ui/documentation/sdk/tmpl/ui5.yaml.tmpl +2 -2
package/.reuse/dep5
CHANGED
|
@@ -223,7 +223,7 @@ License: Apache-2.0
|
|
|
223
223
|
Comment: these files belong to: Google-Caja JS HTML Sanitizer
|
|
224
224
|
|
|
225
225
|
Files: src/sap.ui.core/src/sap/ui/core/cldr/*
|
|
226
|
-
Copyright: 1991-
|
|
226
|
+
Copyright: 1991-2023 Unicode, Inc.
|
|
227
227
|
License: Unicode-DFS-2015
|
|
228
228
|
Comment: these files belong to: Unicode Common Locale Data Repository
|
|
229
229
|
|
package/THIRDPARTY.txt
CHANGED
|
@@ -180,7 +180,7 @@ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
|
180
180
|
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js
|
|
181
181
|
|
|
182
182
|
Component: Unicode Common Locale Data Repository, version: 43
|
|
183
|
-
Copyright: 1991-
|
|
183
|
+
Copyright: 1991-2023 Unicode, Inc.
|
|
184
184
|
License: Unicode-DFS-2015
|
|
185
185
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Unicode-DFS-2015.txt
|
|
186
186
|
Contained in: src/sap.ui.core/src/sap/ui/core/cldr/*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.documentation",
|
|
3
|
-
"version": "1.120.
|
|
3
|
+
"version": "1.120.2",
|
|
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.
|
|
18
|
-
"@openui5/sap.ui.core": "1.120.
|
|
19
|
-
"@openui5/sap.ui.layout": "1.120.
|
|
20
|
-
"@openui5/themelib_sap_belize": "1.120.
|
|
21
|
-
"@openui5/themelib_sap_fiori_3": "1.120.
|
|
22
|
-
"@openui5/themelib_sap_horizon": "1.120.
|
|
17
|
+
"@openui5/sap.m": "1.120.2",
|
|
18
|
+
"@openui5/sap.ui.core": "1.120.2",
|
|
19
|
+
"@openui5/sap.ui.layout": "1.120.2",
|
|
20
|
+
"@openui5/themelib_sap_belize": "1.120.2",
|
|
21
|
+
"@openui5/themelib_sap_fiori_3": "1.120.2",
|
|
22
|
+
"@openui5/themelib_sap_horizon": "1.120.2"
|
|
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.
|
|
9
|
+
<version>1.120.2</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.
|
|
28
|
+
* @version 1.120.2
|
|
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.
|
|
34
|
+
version: '1.120.2',
|
|
35
35
|
dependencies : ['sap.ui.core','sap.m'],
|
|
36
36
|
types: [],
|
|
37
37
|
interfaces: [],
|
|
@@ -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.
|
|
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:
|
|
105
|
+
name: sIndexHTMLFileName,
|
|
105
106
|
url: TMPL_REF + "/" + (bHasManifest ? "indexevo.html.tmpl" : "index.html.tmpl"),
|
|
106
107
|
formatter: function(sIndexFile) {
|
|
107
|
-
return this.
|
|
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:
|
|
117
|
+
name: sIndexJSFileName,
|
|
116
118
|
url: TMPL_REF + "/" + "index.js.tmpl",
|
|
117
119
|
formatter: function(sIndexJsFile) {
|
|
118
|
-
return this.
|
|
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,
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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
|
-
|
|
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) {
|