@openui5/sap.ui.documentation 1.102.2 → 1.104.0

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.
Files changed (85) hide show
  1. package/.reuse/dep5 +17 -0
  2. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
  3. package/THIRDPARTY.txt +35 -2
  4. package/package.json +6 -6
  5. package/src/sap/ui/documentation/.library +1 -1
  6. package/src/sap/ui/documentation/library.js +2 -2
  7. package/src/sap/ui/documentation/messagebundle.properties +2 -0
  8. package/src/sap/ui/documentation/messagebundle_ar.properties +1 -1
  9. package/src/sap/ui/documentation/messagebundle_bg.properties +1 -1
  10. package/src/sap/ui/documentation/messagebundle_ca.properties +1 -1
  11. package/src/sap/ui/documentation/messagebundle_cy.properties +1 -1
  12. package/src/sap/ui/documentation/messagebundle_da.properties +1 -1
  13. package/src/sap/ui/documentation/messagebundle_el.properties +1 -1
  14. package/src/sap/ui/documentation/messagebundle_en_US_sappsd.properties +1 -0
  15. package/src/sap/ui/documentation/messagebundle_es_MX.properties +1 -1
  16. package/src/sap/ui/documentation/messagebundle_et.properties +1 -1
  17. package/src/sap/ui/documentation/messagebundle_fi.properties +1 -1
  18. package/src/sap/ui/documentation/messagebundle_fr.properties +1 -1
  19. package/src/sap/ui/documentation/messagebundle_fr_CA.properties +1 -1
  20. package/src/sap/ui/documentation/messagebundle_hi.properties +1 -1
  21. package/src/sap/ui/documentation/messagebundle_hu.properties +1 -1
  22. package/src/sap/ui/documentation/messagebundle_id.properties +1 -1
  23. package/src/sap/ui/documentation/messagebundle_iw.properties +1 -1
  24. package/src/sap/ui/documentation/messagebundle_ja.properties +1 -1
  25. package/src/sap/ui/documentation/messagebundle_kk.properties +1 -1
  26. package/src/sap/ui/documentation/messagebundle_ko.properties +1 -1
  27. package/src/sap/ui/documentation/messagebundle_lt.properties +1 -1
  28. package/src/sap/ui/documentation/messagebundle_lv.properties +1 -1
  29. package/src/sap/ui/documentation/messagebundle_ms.properties +1 -1
  30. package/src/sap/ui/documentation/messagebundle_nl.properties +1 -1
  31. package/src/sap/ui/documentation/messagebundle_no.properties +1 -1
  32. package/src/sap/ui/documentation/messagebundle_ru.properties +1 -1
  33. package/src/sap/ui/documentation/messagebundle_sh.properties +1 -1
  34. package/src/sap/ui/documentation/messagebundle_sk.properties +1 -1
  35. package/src/sap/ui/documentation/messagebundle_sl.properties +1 -1
  36. package/src/sap/ui/documentation/messagebundle_sv.properties +1 -1
  37. package/src/sap/ui/documentation/messagebundle_th.properties +1 -1
  38. package/src/sap/ui/documentation/messagebundle_tr.properties +1 -1
  39. package/src/sap/ui/documentation/messagebundle_uk.properties +1 -1
  40. package/src/sap/ui/documentation/messagebundle_vi.properties +1 -1
  41. package/src/sap/ui/documentation/messagebundle_zh_CN.properties +1 -1
  42. package/src/sap/ui/documentation/messagebundle_zh_TW.properties +1 -1
  43. package/src/sap/ui/documentation/sdk/Component.js +1 -1
  44. package/src/sap/ui/documentation/sdk/controller/App.controller.js +3 -3
  45. package/src/sap/ui/documentation/sdk/controller/Code.controller.js +1 -1
  46. package/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js +2 -2
  47. package/src/sap/ui/documentation/sdk/controller/Sample.controller.js +106 -46
  48. package/src/sap/ui/documentation/sdk/controller/TopicDetail.controller.js +1 -1
  49. package/src/sap/ui/documentation/sdk/controller/VersionNotFound.controller.js +19 -12
  50. package/src/sap/ui/documentation/sdk/controller/util/ToolsInfo.js +7 -3
  51. package/src/sap/ui/documentation/sdk/controller/util/URLUtil.js +117 -0
  52. package/src/sap/ui/documentation/sdk/css/style.css +22 -13
  53. package/src/sap/ui/documentation/sdk/index.html +42 -7
  54. package/src/sap/ui/documentation/sdk/model/formatter.js +25 -0
  55. package/src/sap/ui/documentation/sdk/thirdparty/highlight.js/styles.css +47 -1
  56. package/src/sap/ui/documentation/sdk/util/DocumentationRouter.js +7 -0
  57. package/src/sap/ui/documentation/sdk/util/Resources.js +3 -0
  58. package/src/sap/ui/documentation/sdk/view/ApiDetailInitial.view.xml +13 -13
  59. package/src/sap/ui/documentation/sdk/view/Controls.view.xml +19 -19
  60. package/src/sap/ui/documentation/sdk/view/Entity.view.xml +2 -2
  61. package/src/sap/ui/documentation/sdk/view/Tools.view.xml +12 -3
  62. package/src/sap/ui/documentation/sdk/view/TopicDetailInitial.view.xml +12 -12
  63. package/src/sap/ui/documentation/sdk/view/Welcome.view.xml +49 -25
  64. package/src/sap/ui/documentation/sdk/view/appSettingsDialog.fragment.xml +6 -4
  65. package/src/sap/ui/documentation/themes/base/DemokitTreeItem.less +5 -9
  66. package/src/sap/ui/documentation/themes/base/Documentation.less +16 -2
  67. package/src/sap/ui/documentation/themes/base/LightTable.less +49 -40
  68. package/src/sap/ui/documentation/themes/base/ObjectPageSubSection.less +9 -0
  69. package/src/sap/ui/documentation/themes/base/Search.less +1 -0
  70. package/src/sap/ui/documentation/themes/base/global.less +27 -0
  71. package/src/sap/ui/documentation/themes/base/library.source.less +2 -0
  72. package/src/sap/ui/documentation/themes/sap_belize/global.less +19 -0
  73. package/src/sap/ui/documentation/themes/sap_belize/library.source.less +1 -0
  74. package/src/sap/ui/documentation/themes/sap_fiori_3/global.less +18 -0
  75. package/src/sap/ui/documentation/themes/sap_fiori_3/library.source.less +2 -1
  76. package/src/sap/ui/documentation/themes/sap_horizon/Link.less +3 -0
  77. package/src/sap/ui/documentation/themes/sap_horizon/Search.less +3 -0
  78. package/src/sap/ui/documentation/themes/sap_horizon/SplitButton.less +5 -0
  79. package/src/sap/ui/documentation/themes/sap_horizon/global.less +18 -0
  80. package/src/sap/ui/documentation/themes/sap_horizon/library.source.less +6 -1
  81. package/src/sap/ui/documentation/themes/sap_horizon_dark/Documentation.less +17 -0
  82. package/src/sap/ui/documentation/themes/sap_horizon_dark/Link.less +3 -0
  83. package/src/sap/ui/documentation/themes/sap_horizon_dark/Search.less +3 -0
  84. package/src/sap/ui/documentation/themes/sap_horizon_dark/SplitButton.less +5 -0
  85. package/src/sap/ui/documentation/themes/sap_horizon_dark/library.source.less +6 -1
@@ -219,7 +219,7 @@ sap.ui.define([
219
219
  sEditorTheme = "github";
220
220
  } else if (sTheme === "sap_fiori_3") {
221
221
  sEditorTheme = "crimson_editor";
222
- } else if (sTheme === "sap_fiori_3_dark") {
222
+ } else if (sTheme === "sap_fiori_3_dark" || sTheme === "sap_horizon_dark") {
223
223
  sEditorTheme = "clouds_midnight";
224
224
  }
225
225
  this._getCodeEditor().setColorTheme(sEditorTheme);
@@ -51,12 +51,12 @@ sap.ui.define([
51
51
  _sStorageKey: "UI5_EXPLORED_LIST_SETTINGS_FROM_1_48",
52
52
  _oViewSettings: {
53
53
  densityMode: COMPACT,
54
- themeActive: "sap_fiori_3",
54
+ themeActive: "sap_horizon",
55
55
  rtl: false
56
56
  },
57
57
  _oDefaultSettings: {
58
58
  densityMode: COMPACT,
59
- themeActive: "sap_fiori_3",
59
+ themeActive: "sap_horizon",
60
60
  rtl: false
61
61
  },
62
62
  _oListSettings: {
@@ -18,7 +18,6 @@ sap.ui.define([
18
18
  "sap/ui/core/HTML",
19
19
  "sap/m/library",
20
20
  "sap/base/Log",
21
- "sap/base/util/UriParameters",
22
21
  "sap/ui/core/Fragment",
23
22
  "sap/ui/documentation/sdk/util/Resources",
24
23
  "./config/sampleForwardingConfig",
@@ -36,7 +35,6 @@ sap.ui.define([
36
35
  HTML,
37
36
  mobileLibrary,
38
37
  Log,
39
- UriParameters,
40
38
  Fragment,
41
39
  ResourcesUtil,
42
40
  sampleForwardingConfig,
@@ -58,6 +56,7 @@ sap.ui.define([
58
56
  /* =========================================================== */
59
57
 
60
58
  onInit: function () {
59
+ var oConfiguration = sap.ui.getCore().getConfiguration();
61
60
  SampleBaseController.prototype.onInit.call(this);
62
61
 
63
62
  this.getRouter().getRoute("sample").attachPatternMatched(this._onSampleMatched, this);
@@ -65,7 +64,10 @@ sap.ui.define([
65
64
  this.oModel = new JSONModel({
66
65
  showNavButton : true,
67
66
  showNewTab: false,
68
- rtaLoaded: false
67
+ rtaLoaded: false,
68
+ density: this.getOwnerComponent().getContentDensityClass(),
69
+ rtl: oConfiguration.getRTL(),
70
+ theme: oConfiguration.getTheme()
69
71
  });
70
72
 
71
73
  this._sId = null; // Used to hold sample ID
@@ -91,11 +93,18 @@ sap.ui.define([
91
93
  * @private
92
94
  */
93
95
  _onSampleMatched: function (event) {
96
+ var bShouldRedirect = new URLSearchParams(window.location.search).has("dk-sample-standalone");
97
+
94
98
  this._sId = event.getParameter("arguments").sampleId;
95
99
  this._sEntityId = event.getParameter("arguments").entityId;
96
100
 
97
101
  this.byId("page").setBusy(true);
98
102
 
103
+ // check whether to open sample standalone
104
+ if (bShouldRedirect) {
105
+ this._handleRedirect();
106
+ }
107
+
99
108
  if (sampleForwardingConfig[this._sId]) {
100
109
  return this.router.navTo("sample", {
101
110
  entityId: sampleForwardingConfig[this._sId].entityId,
@@ -203,6 +212,42 @@ sap.ui.define([
203
212
  });
204
213
  },
205
214
 
215
+ /**
216
+ * Handles redirection from DemoKit to the sample page, rather than loading it as an iFrame.
217
+ * The 'dk-sample-standalone' query parameter must be in the URI to take effect.
218
+ * @private
219
+ */
220
+ _handleRedirect : function () {
221
+ this._initIframeURL();
222
+ this._applySearchParamValueToIframeURL('sap-ui-theme', this._sDefaultSampleTheme);
223
+ this.sIFrameUrl += "&dk-sample-standalone";
224
+ URLHelper.redirect(this.sIFrameUrl, false);
225
+ },
226
+
227
+ /**
228
+ * Initializes the URL of the sample itself, loaded either in an iFrame or standalone.
229
+ * @private
230
+ */
231
+ _initIframeURL : function () {
232
+ var sSampleOrigin = (window['sap-ui-documentation-config'] && window['sap-ui-documentation-config'].demoKitResourceOrigin) || "",
233
+ sSampleVersion = ResourcesUtil.getResourcesVersion(),
234
+ sSampleSearchParams = "";
235
+
236
+ // Assigning allowed query parameters from Demo Kit URL
237
+ ALLOWLIST_SAMPLES_SEARCH_PARAMS.forEach(function (oParam, index) {
238
+ if (new URL(document.location.href).searchParams.get(oParam)) {
239
+ sSampleSearchParams += (sSampleSearchParams === "" ? "?" : "&") + oParam + "=" + new URL(document.location.href).searchParams.get(oParam);
240
+ }
241
+ });
242
+
243
+ sSampleSearchParams = (sSampleSearchParams === "" ? "?" : sSampleSearchParams + "&") +
244
+ "sap-ui-xx-sample-id=" + this._sId
245
+ + "&sap-ui-xx-sample-origin=" + sSampleOrigin + sSampleVersion
246
+ + "&sap-ui-xx-dk-origin=" + window.location.origin;
247
+
248
+ this.sIFrameUrl = ResourcesUtil.getResourceOrigin() + "/resources/sap/ui/documentation/sdk/index.html" + sSampleSearchParams;
249
+ },
250
+
206
251
  /**
207
252
  * Opens the View settings dialog
208
253
  * @public
@@ -218,19 +263,33 @@ sap.ui.define([
218
263
  if (!this._oSettingsDialog) {
219
264
  this._oSettingsDialog = sap.ui.xmlfragment("sample", "sap.ui.documentation.sdk.view.appSettingsDialog", this);
220
265
 
221
- // oView = sap.ui.getCore().byId("__xmlview0") || sap.ui.getCore().byId("__container0");
222
266
  this._oSettingsDialog.setModel(this._oMessageBundle, "i18n");
223
- // oView.addDependent(this._oSettingsDialog);
224
267
  }
225
268
 
226
- this.loadSampleSettings().then(function() {
269
+ this.loadSampleSettings(this.applySampleSettings.bind(this)).then(function() {
227
270
  this._oSettingsDialog.open();
228
271
  }.bind(this)).catch(function(err) {
229
272
  Log.error(err);
230
273
  });
231
274
  },
232
275
 
233
- loadSampleSettings: function() {
276
+ applySampleSettings: function(eMessage) {
277
+ if (eMessage.data.type === "SETTINGS") {
278
+ var oThemeSelect = sap.ui.getCore().byId("sample--ThemeSelect");
279
+
280
+ // Theme select
281
+ oThemeSelect.setSelectedKey(eMessage.data.data.theme);
282
+
283
+ // RTL
284
+ sap.ui.getCore().byId("sample--RTLSwitch").setState(eMessage.data.data.RTL);
285
+
286
+ // Density mode select
287
+ sap.ui.getCore().byId("sample--DensityModeSwitch").setSelectedKey(this._presetDensity(eMessage.data.data.density, true));
288
+
289
+ }
290
+ },
291
+
292
+ loadSampleSettings: function(fnCallback) {
234
293
  return new Promise(function (resolve, reject) {
235
294
  var oIframe = this._oHtmlControl.getDomRef();
236
295
  oIframe.contentWindow.postMessage({
@@ -241,21 +300,9 @@ sap.ui.define([
241
300
  window.addEventListener("message", loadSettings);
242
301
 
243
302
  function loadSettings(eMessage) {
244
- if (eMessage.data.type === "SETTINGS") {
245
- var oThemeSelect = sap.ui.getCore().byId("sample--ThemeSelect");
246
-
247
- // Theme select
248
- oThemeSelect.setSelectedKey(eMessage.data.data.theme);
249
-
250
- // RTL
251
- sap.ui.getCore().byId("sample--RTLSwitch").setState(eMessage.data.data.RTL);
252
-
253
- // Density mode select
254
- sap.ui.getCore().byId("sample--DensityModeSwitch").setSelectedKey(eMessage.data.data.density.slice(9).toLowerCase());
255
-
303
+ fnCallback(eMessage);
256
304
  window.removeEventListener("message", loadSettings);
257
305
  resolve();
258
- }
259
306
  }
260
307
  setTimeout(function() {
261
308
  reject("The sample iframe is not loading settings");
@@ -289,6 +336,21 @@ sap.ui.define([
289
336
 
290
337
  // handle settings change
291
338
  this._applyAppConfiguration(sTheme, sDensityMode, bRTL);
339
+ this._saveLocalSettings(sTheme, sDensityMode, bRTL);
340
+ },
341
+
342
+ _saveLocalSettings: function(sTheme, sDensityMode, bRTL) {
343
+ var sDensityMode = this._presetDensity(sDensityMode);
344
+ this.getView().getModel().setData({
345
+ theme: sTheme,
346
+ rtl: bRTL,
347
+ density: sDensityMode
348
+ }, true);
349
+
350
+ },
351
+
352
+ _presetDensity: function(sDensity, bToValue) {
353
+ return bToValue ? sDensity.slice(9).toLowerCase() : "sapUiSize" + capitalize(sDensity);
292
354
  },
293
355
 
294
356
  /**
@@ -299,12 +361,13 @@ sap.ui.define([
299
361
  * @private
300
362
  */
301
363
  _applyAppConfiguration: function(sThemeActive, sDensityMode, bRTL){
302
- var oIframe = this._oHtmlControl.getDomRef();
364
+ var oIframe = this._oHtmlControl.getDomRef(),
365
+ sDensityMode = this._presetDensity(sDensityMode);
303
366
  oIframe.contentWindow.postMessage({
304
367
  type: "SETTINGS",
305
368
  reason: "set",
306
369
  data: {
307
- "density": "sapUiSize" + capitalize(sDensityMode),
370
+ "density": sDensityMode,
308
371
  "RTL": bRTL,
309
372
  "theme": sThemeActive
310
373
  }
@@ -339,9 +402,21 @@ sap.ui.define([
339
402
  this.getRouter().navTo("apiId", {id: this.entityId});
340
403
  },
341
404
 
342
- onNewTab : function () {
343
- this._applySearchParamValueToIframeURL('sap-ui-theme', this._sDefaultSampleTheme);
344
- URLHelper.redirect(this.sIFrameUrl, true);
405
+ onNewTab: function () {
406
+ if (this.oModel.getProperty("/iframe")) {
407
+ URLHelper.redirect(this.sIFrameUrl, true);
408
+ return;
409
+ }
410
+ // this._applySearchParamValueToIframeURL('sap-ui-theme', this._sDefaultSampleTheme);
411
+ this.loadSampleSettings(function(eMessage){
412
+ this._applySearchParamValueToIframeURL('sap-ui-theme', eMessage.data.data.theme);
413
+ this._applySearchParamValueToIframeURL('sap-ui-rtl', eMessage.data.data.RTL);
414
+ this._applySearchParamValueToIframeURL('sap-ui-density', eMessage.data.data.density);
415
+ }.bind(this)).then(function(){
416
+ URLHelper.redirect(this.sIFrameUrl, true);
417
+ }.bind(this)).catch(function(err){
418
+ Log.error(err);
419
+ });
345
420
  },
346
421
 
347
422
  onPreviousSample: function (oEvent) {
@@ -401,7 +476,7 @@ sap.ui.define([
401
476
 
402
477
  _createIframe : function () {
403
478
  return new Promise(function (resolve, reject) {
404
- var sSampleId = this._sId,
479
+ var sSampleId,
405
480
  sIframePath = "",
406
481
  rExtractFilename = /\/([^\/]*)$/,// extracts everything after the last slash (e.g. some/path/index.html -> index.html)
407
482
  rStripUI5Ending = /\..+$/,// removes everything after the first dot in the filename (e.g. someFile.qunit.html -> .qunit.html)
@@ -412,31 +487,16 @@ sap.ui.define([
412
487
 
413
488
  this.fResolve = resolve;
414
489
  this.fReject = reject;
415
- var sSampleOrigin = (window['sap-ui-documentation-config'] && window['sap-ui-documentation-config'].demoKitResourceOrigin) || "",
416
- sSampleVersion = ResourcesUtil.getResourcesVersion(),
417
- sSampleSearchParams = "";
418
-
419
- // Assigning allowed query parameters from Demo Kit URL
420
- ALLOWLIST_SAMPLES_SEARCH_PARAMS.forEach(function(oParam, index){
421
- if (new URL(document.location.href).searchParams.get(oParam)){
422
- sSampleSearchParams += (sSampleSearchParams === "" ? "?" : "&") + oParam + "=" + new URL(document.location.href).searchParams.get(oParam);
423
- }
424
- });
425
-
426
- sSampleSearchParams = (sSampleSearchParams === "" ? "?" : sSampleSearchParams + "&") +
427
- "sap-ui-xx-sample-id=" + sSampleId
428
- + "&sap-ui-xx-sample-origin=" + sSampleOrigin + sSampleVersion
429
- + "&sap-ui-xx-dk-origin=" + window.location.origin;
430
490
 
431
- this.sIFrameUrl = ResourcesUtil.getResourceOrigin() + "/resources/sap/ui/documentation/sdk/index.html" + sSampleSearchParams;
491
+ this._initIframeURL();
432
492
 
433
493
  if (this._oHtmlControl) {
434
494
  this._oHtmlControl.destroy();
435
495
  }
436
496
 
437
497
  var fnMessage = function (eMessage) {
498
+ var oSettingsData = this.getView().getModel().getData();
438
499
  if (eMessage.data.type === "INIT") {
439
- var oConfiguration = sap.ui.getCore().getConfiguration();
440
500
  if (eMessage.data.config && eMessage.data.config.sample && eMessage.data.config.sample.iframe) {
441
501
  sSampleId = this._sId;
442
502
  vIframe = eMessage.data.config.sample.iframe;
@@ -458,9 +518,9 @@ sap.ui.define([
458
518
  type: "SETTINGS",
459
519
  reason: "set",
460
520
  data: {
461
- "density": this.getOwnerComponent().getContentDensityClass(),
462
- "RTL": oConfiguration.getRTL(),
463
- "theme": oConfiguration.getTheme()
521
+ "density": oSettingsData.density,
522
+ "RTL": oSettingsData.rtl,
523
+ "theme": oSettingsData.theme
464
524
  }
465
525
  }, this.getOwnerComponent()._sSampleIframeOrigin);
466
526
  this.fResolve(eMessage.data.config.sample);
@@ -342,7 +342,7 @@ sap.ui.define([
342
342
  });
343
343
 
344
344
  if (window.hljs) {
345
- document.querySelectorAll('pre').forEach(function(block) {
345
+ document.querySelectorAll('pre:not([class*="lines"])').forEach(function(block) {
346
346
  window.hljs.highlightBlock(block);
347
347
  });
348
348
  }
@@ -7,12 +7,12 @@
7
7
  sap.ui.define([
8
8
  "./BaseController",
9
9
  "sap/ui/thirdparty/jquery",
10
- "sap/ui/thirdparty/URI",
10
+ "sap/ui/documentation/sdk/controller/util/URLUtil",
11
11
  "sap/m/library"
12
12
  ], function (
13
13
  BaseController,
14
14
  jQuery,
15
- URI,
15
+ DemokitURLUtil,
16
16
  mLib
17
17
  ) {
18
18
  "use strict";
@@ -44,22 +44,29 @@ sap.ui.define([
44
44
  _onVersionInfo: function (oVersionInfo) {
45
45
  var oMessagePage = this.getView().byId("page"),
46
46
  oReadMoreBtn = this.getView().byId("readMoreButton"),
47
- reVersion = new RegExp("^([0-9]+)(?:\\.([0-9]+)(?:\\.([0-9]+))?)?(.+)?"),
48
- oURI = new URI(document.location.href),
49
- aSegments = oURI.segment(),
50
- sVersion,
47
+ sUrl = document.location.href,
48
+ sRedirectUrl,
49
+ sVersion = DemokitURLUtil.parseVersion(sUrl),
51
50
  isRemoved = false;
52
51
 
53
52
  oMessagePage.setBusy(false);
54
53
 
55
- for (var i = 0, l = aSegments.length; i < l; i++) {
56
- if (reVersion.test(aSegments[i])) {
57
- sVersion = aSegments[i];
58
- break;
59
- }
54
+ isRemoved = this._isVersionRemoved(oVersionInfo, sVersion);
55
+
56
+ if (isRemoved && DemokitURLUtil.requestsDemokitView(sUrl)) {
57
+ // redirect to the latest (version-less) URL
58
+ sRedirectUrl = DemokitURLUtil.removeVersion(sUrl);
59
+ mLib.URLHelper.redirect(sRedirectUrl);
60
+ return;
60
61
  }
61
62
 
62
- isRemoved = this._isVersionRemoved(oVersionInfo, sVersion);
63
+ if (DemokitURLUtil.hasSEOOptimizedFormat(sUrl)) {
64
+ // 404 may be due to server not supporting SEO-optimized urls =>
65
+ // redirect to the corresponding non-optimized URL
66
+ sRedirectUrl = DemokitURLUtil.convertToNonSEOFormat(sUrl);
67
+ mLib.URLHelper.redirect(sRedirectUrl);
68
+ return;
69
+ }
63
70
 
64
71
  if (isRemoved) {
65
72
  // show removed message
@@ -58,7 +58,8 @@ sap.ui.define([],
58
58
  {
59
59
  "id": "liveEditor",
60
60
  "text": "Live Editor",
61
- "href": "liveEditor"
61
+ "href": "liveEditor",
62
+ "hideOnPhone": true
62
63
  },
63
64
  {
64
65
  "id": "fioriTools",
@@ -68,12 +69,15 @@ sap.ui.define([],
68
69
  {
69
70
  "id": "flexibleProgrammingModelExplorer",
70
71
  "text": "Flexible Programming Model Explorer",
71
- "href": "https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/overview/introduction"
72
+ "href": "test-resources/sap/fe/core/fpmExplorer/index.html#/overview/introduction",
73
+ "isDistributionScope": true,
74
+ "hideOnPhone": true
72
75
  },
73
76
  {
74
77
  "id": "accessibilityGuide",
75
78
  "text": "Accessibility Guide",
76
- "href": "test-resources/sap/m/demokit/accessibilityGuide/webapp/index.html"
79
+ "href": "test-resources/sap/m/demokit/accessibilityGuide/webapp/index.html",
80
+ "hideOnPhone": true
77
81
  }
78
82
  ];
79
83
 
@@ -0,0 +1,117 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ // Provides reuse functionality for parsing and manipulating demokit urls
8
+ sap.ui.define(["sap/ui/thirdparty/URI"], function(URI) {
9
+
10
+ "use strict";
11
+
12
+ var reVersion = new RegExp("^([0-9]+)(?:\\.([0-9]+)(?:\\.([0-9]+))?)?(.+)?"),
13
+ // compiling a single RegExp seems a less readable option
14
+ // so bellow are the patterns for individual Demokit sections
15
+ aDemokitPaths = [
16
+ /^\/controls/,
17
+ /^\/group/,
18
+ /^\/entity/,
19
+ /^\/sample/,
20
+ /^\/downloads/,
21
+ /^\/api/,
22
+ /^\/topic/,
23
+ /^\/liveEditor/,
24
+ /^\/sitemap\//,
25
+ /\/sitemap$/,
26
+ /^\/demoapps/,
27
+ /^\/tools/,
28
+ /^\/news\//,
29
+ /\/news$/,
30
+ /^\/search\//,
31
+ /^\/license[.]txt/,
32
+ /^\/docs\/guide/,
33
+ /^\/docs\/api\/symbols/
34
+ ];
35
+
36
+ function pathMatchesDemokitRoute (path) {
37
+ return aDemokitPaths.some(function(regexp) {
38
+ return regexp.test(path);
39
+ });
40
+ }
41
+
42
+ return {
43
+ parseVersion: function(sUrl) {
44
+ var oURI = new URI(sUrl),
45
+ aSegments = oURI.segment(),
46
+ sVersion;
47
+
48
+ for (var i = 0, l = aSegments.length; i < l; i++) {
49
+ if (reVersion.test(aSegments[i])) {
50
+ sVersion = aSegments[i];
51
+ break;
52
+ }
53
+ if (pathMatchesDemokitRoute("/" + aSegments[i] + "/")) {
54
+ break; // version not found
55
+ }
56
+ }
57
+ return sVersion;
58
+ },
59
+
60
+ removeVersion: function(sUrl) {
61
+ var oURI = new URI(sUrl),
62
+ sPath = oURI.path(),
63
+ sVersion = this.parseVersion(sUrl);
64
+
65
+ // remove the version string from <code>sPath</code>
66
+ if (sVersion) {
67
+ sPath = sPath.substring(sPath.indexOf(sVersion) + sVersion.length);
68
+ oURI.path(sPath);
69
+ return oURI.href();
70
+ }
71
+ return sUrl;
72
+ },
73
+
74
+ requestsDemokitView: function(sUrl) {
75
+ if (this.hasSEOOptimizedFormat(sUrl)) {
76
+ return true;
77
+ }
78
+
79
+ return pathMatchesDemokitRoute(new URI(sUrl).fragment());
80
+ },
81
+
82
+ hasSEOOptimizedFormat: function(sUrl) {
83
+ var sPath = new URI(sUrl).path();
84
+
85
+ if (pathMatchesDemokitRoute(sPath)) {
86
+ return true;
87
+ }
88
+
89
+ sUrl = this.removeVersion(sUrl);
90
+ sPath = new URI(sUrl).path();
91
+ return pathMatchesDemokitRoute(sPath);
92
+ },
93
+
94
+ convertToNonSEOFormat: function(sUrl) {
95
+ var oURI = new URI(sUrl),
96
+ sViewPath = new URI(this.removeVersion(sUrl)).path(),
97
+ sFragment = oURI.fragment(),
98
+ sNewPath,
99
+ sNewFragment;
100
+
101
+ // move the <code>sViewPath</code> from the URL path into the URL fragment:
102
+ sNewPath = oURI.path().replace(sViewPath, "/");
103
+ sNewFragment = sViewPath;
104
+
105
+ if (sFragment) {
106
+ // preserve any existing fragment part by appending at the end
107
+ sNewFragment += encodeURIComponent("#") + sFragment;
108
+ }
109
+
110
+ oURI.path(sNewPath);
111
+ oURI.fragment(sNewFragment);
112
+
113
+ return oURI.href();
114
+ }
115
+ };
116
+
117
+ });
@@ -219,8 +219,10 @@ html:not(.sapUiMedia-StdExt-Phone) .sapUiDocumentationFooter {
219
219
  height: 3rem;
220
220
  }
221
221
 
222
- .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect,
223
- .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect .sapMSltArrow {
222
+ .sapUiTheme-sap_fiori_3 .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect,
223
+ .sapUiTheme-sap_fiori_3_dark .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect,
224
+ .sapUiTheme-sap_fiori_3 .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect .sapMSltArrow,
225
+ .sapUiTheme-sap_fiori_3_dark .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect .sapMSltArrow {
224
226
  border:none;
225
227
  background: #2f3c48;
226
228
  }
@@ -246,8 +248,10 @@ html:not(.sapUiMedia-StdExt-Phone) .sapUiDocumentationFooter {
246
248
  }
247
249
 
248
250
  /* Menu Select`s hover bakground */
249
- .sapContrast.sapUiDocumentationSelect.sapMSltHoverable:not(.sapMSltState):not(.sapMSltIconOnly):hover,
250
- .sapContrast .sapUiDocumentationSelect.sapMSltHoverable:not(.sapMSltState):not(.sapMSltIconOnly):hover {
251
+ .sapUiTheme-sap_fiori_3 .sapContrast.sapUiDocumentationSelect.sapMSltHoverable:not(.sapMSltState):not(.sapMSltIconOnly):hover,
252
+ .sapUiTheme-sap_fiori_3_dark .sapContrast.sapUiDocumentationSelect.sapMSltHoverable:not(.sapMSltState):not(.sapMSltIconOnly):hover,
253
+ .sapUiTheme-sap_fiori_3 .sapContrast .sapUiDocumentationSelect.sapMSltHoverable:not(.sapMSltState):not(.sapMSltIconOnly):hover,
254
+ .sapUiTheme-sap_fiori_3_dark .sapContrast .sapUiDocumentationSelect.sapMSltHoverable:not(.sapMSltState):not(.sapMSltIconOnly):hover {
251
255
  background: #2f3c48;
252
256
  }
253
257
 
@@ -275,7 +279,8 @@ html.sap-desktop .sapContrast.sapMSlt.sapUiDocumentationSelect:not(.sapMSltExpan
275
279
  }
276
280
 
277
281
  /* Menu Select`s label */
278
- .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect .sapMSltLabel {
282
+ .sapUiTheme-sap_fiori_3 .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect .sapMSltLabel,
283
+ .sapUiTheme-sap_fiori_3_dark .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect .sapMSltLabel {
279
284
  color: #91c8f6;
280
285
  font-size: 1rem;
281
286
  border-bottom: 0.1625rem solid;
@@ -290,7 +295,8 @@ html.sap-desktop .sapContrast.sapMSlt.sapUiDocumentationSelect:not(.sapMSltExpan
290
295
  }
291
296
 
292
297
  /* Menu Select`s arrow color on press */
293
- .sapTntToolHeader .sapMSlt.sapMSltPressed > .sapMSltArrow::before {
298
+ :not(.sapUiTheme-sap_fiori_3) .sapTntToolHeader .sapMSlt.sapMSltPressed > .sapMSltArrow::before,
299
+ :not(.sapUiTheme-sap_fiori_3_dark) .sapTntToolHeader .sapMSlt.sapMSltPressed > .sapMSltArrow::before {
294
300
  color: #cae4fb;
295
301
  }
296
302
 
@@ -981,11 +987,13 @@ html.sapUiTheme-sap_belize_hcw .sapUiJSD a {
981
987
  color: #000000;
982
988
  }
983
989
 
984
- html:not(.sapUiTheme-sap_belize_hcb):not(.sapUiTheme-sap_belize_hcw):not(.sapUiTheme-sap_fiori_3_hcb):not(.sapUiTheme-sap_fiori_3_hcw) .sapUiJSD a {
990
+ html:not(.sapUiTheme-sap_belize_hcb):not(.sapUiTheme-sap_belize_hcw):not(.sapUiTheme-sap_fiori_3_hcb):not(.sapUiTheme-sap_fiori_3_hcw)
991
+ .sapUiJSD a {
985
992
  color: #0070b1;
986
993
  }
987
994
 
988
- html:not(.sapUiTheme-sap_belize_hcb):not(.sapUiTheme-sap_belize_hcw):not(.sapUiTheme-sap_fiori_3_hcb):not(.sapUiTheme-sap_fiori_3_hcw) .sapUiJSD a,
995
+ html:not(.sapUiTheme-sap_belize_hcb):not(.sapUiTheme-sap_belize_hcw):not(.sapUiTheme-sap_fiori_3_hcb):not(.sapUiTheme-sap_fiori_3_hcw):not(.sapUiTheme-sap_horizon):not(.sapUiTheme-sap_horizon_dark)
996
+ .sapUiJSD a,
989
997
  html.sapUiTheme-sap_fiori_3_hcb .sapUiJSD a:hover,
990
998
  html.sapUiTheme-sap_fiori_3_hcw .sapUiJSD a:hover,
991
999
  html.sapUiTheme-sap_belize_hcb .sapUiJSD a:hover,
@@ -1800,11 +1808,6 @@ html[dir="rtl"] .sapUiDemoKitTreeItemIcon {
1800
1808
  background: #ffffff;
1801
1809
  }
1802
1810
 
1803
- .sapUiTheme-sap_fiori_3 .sapUiDemokit .sapUiHomePage .sapMTitleStyleH1,
1804
- .sapUiTheme-sap_fiori_3 .sapUiDemokit .sapUiDemoApps .sapMTitleStyleH1 {
1805
- font-size: 1.625rem;
1806
- }
1807
-
1808
1811
  .sapUiTheme-sap_fiori_3 .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect,
1809
1812
  .sapUiTheme-sap_fiori_3 .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect:hover,
1810
1813
  .sapUiTheme-sap_fiori_3 .sapTntToolHeader .sapMSlt.menuSelect.sapUiDocumentationSelect .sapMSltArrow,
@@ -1839,4 +1842,10 @@ html[dir="rtl"] .sapUiDemoKitTreeItemIcon {
1839
1842
  .sapUiForcedHidden .editorSrcWindow {
1840
1843
  width: 0;
1841
1844
  height: 0;
1845
+ }
1846
+
1847
+ /* override default 3rem on desktop */
1848
+ .sapUiDemokit .sapUiHomePage .sapMTitleStyleH1,
1849
+ .sapUiDemokit .sapUiDemoApps .sapMTitleStyleH1 {
1850
+ font-size: 1.625rem;
1842
1851
  }