@sap-ux/preview-middleware 1.0.16 → 1.0.18

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.
@@ -265,7 +265,7 @@ sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-proper
265
265
  } = processed;
266
266
  const isIcon = testIconPattern(property.name) && selectedControlName !== 'sap.m.Image' && analyzedType.ui5Type === 'sap.ui.core.URI';
267
267
  const ui5Type = analyzedType.ui5Type || undefined;
268
- const readableName = convertCamelCaseToPascalCase(property.name);
268
+ const readableName = 'configuration' in property ? property.readableName : convertCamelCaseToPascalCase(property.name);
269
269
  const docuSpread = docu ? {
270
270
  documentation: docu
271
271
  } : {};
@@ -327,7 +327,8 @@ function buildPropertyEntry(
327
327
  selectedControlName !== 'sap.m.Image' &&
328
328
  analyzedType.ui5Type === 'sap.ui.core.URI';
329
329
  const ui5Type = analyzedType.ui5Type || undefined;
330
- const readableName = convertCamelCaseToPascalCase(property.name);
330
+ const readableName =
331
+ 'configuration' in property ? property.readableName : convertCamelCaseToPascalCase(property.name);
331
332
  const docuSpread = docu ? { documentation: docu } : {};
332
333
 
333
334
  switch (analyzedType.primitiveType) {
@@ -81,7 +81,7 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/c
81
81
  ...item,
82
82
  defaultValue: item.value,
83
83
  configuration: true,
84
- name: item.name ?? item.id,
84
+ name: item.id,
85
85
  readableName: item.name ?? item.id,
86
86
  manifestPropertyPath: `${overlayData?.manifestPropertyPath(control)}/${propertyId}`,
87
87
  type: item.type === 'number' ? 'int' : item.type,
@@ -137,7 +137,7 @@ export function getManifestProperties(
137
137
  ...item,
138
138
  defaultValue: item.value,
139
139
  configuration: true,
140
- name: item.name ?? item.id,
140
+ name: item.id,
141
141
  readableName: item.name ?? item.id,
142
142
  manifestPropertyPath: `${overlayData?.manifestPropertyPath(control)}/${propertyId}`,
143
143
  type: item.type === 'number' ? 'int' : (item.type as 'string' | 'boolean' | 'undefined'),
@@ -300,34 +300,7 @@ sap.ui.define(['exports'], (function (exports) { 'use strict';
300
300
  const isUpperCase = (code) => code >= 65 && code <= 90;
301
301
  const isLowerCase = (code) => code >= 97 && code <= 122;
302
302
  const isWordDelimiter = (code) => code === 45 || code === 95 || code === 32; // - or _ or space
303
- const isSentenceCase = (text) => {
304
- if (!text || text.length === 0 || !isUpperCase(text.charCodeAt(0))) {
305
- return false;
306
- }
307
- // Sentence case should have spaces between words
308
- for (let i = 0; i < text.length; i++) {
309
- const code = text.charCodeAt(i);
310
- if (code === 32) {
311
- return true;
312
- }
313
- else if (code === 45 || code === 95) {
314
- // Has hyphens or underscores - not sentence case
315
- return false;
316
- }
317
- }
318
- return true;
319
- };
320
- const isEndOfAbbreviatedWord = (text, index) => {
321
- if (index + 2 >= text.length) {
322
- return false;
323
- }
324
- return isUpperCase(text.charCodeAt(index + 1)) && isLowerCase(text.charCodeAt(index + 2));
325
- };
326
303
  const convertCamelCaseToPascalCase = (text) => {
327
- // Early return if already in sentence case
328
- if (isSentenceCase(text)) {
329
- return text;
330
- }
331
304
  const words = [];
332
305
  let word = '';
333
306
  let lookForUpperCase = true;
@@ -340,7 +313,7 @@ sap.ui.define(['exports'], (function (exports) { 'use strict';
340
313
  // First lower case character after upper case character -> switch mode to collect only lower case characters
341
314
  lookForUpperCase = false;
342
315
  }
343
- else if (isEndOfAbbreviatedWord(text, i)) {
316
+ else if (isUpperCase(text.charCodeAt(i + 1)) && isLowerCase(text.charCodeAt(i + 2))) {
344
317
  // Next character is the last uppercase character after a sequence of upper case character -> create an abbreviated word
345
318
  words.push(word);
346
319
  word = '';
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "bugs": {
11
11
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
12
12
  },
13
- "version": "1.0.16",
13
+ "version": "1.0.18",
14
14
  "license": "Apache-2.0",
15
15
  "author": "@SAP/ux-tools-team",
16
16
  "main": "dist/index.js",
@@ -28,13 +28,13 @@
28
28
  "mem-fs-editor": "9.4.0",
29
29
  "qrcode": "1.5.4",
30
30
  "@sap/bas-sdk": "3.13.7",
31
- "@sap-ux/adp-tooling": "1.0.13",
31
+ "@sap-ux/adp-tooling": "1.0.14",
32
32
  "@sap-ux/btp-utils": "2.0.2",
33
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@1.0.4",
34
- "@sap-ux/feature-toggle": "1.0.1",
33
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@1.0.5",
34
+ "@sap-ux/feature-toggle": "1.0.2",
35
35
  "@sap-ux/logger": "1.0.1",
36
36
  "@sap-ux/project-access": "2.1.2",
37
- "@sap-ux/system-access": "1.0.2",
37
+ "@sap-ux/system-access": "1.0.3",
38
38
  "@sap-ux/i18n": "1.0.1"
39
39
  },
40
40
  "devDependencies": {
@@ -54,9 +54,9 @@
54
54
  "nock": "14.0.11",
55
55
  "npm-run-all2": "8.0.4",
56
56
  "supertest": "7.2.2",
57
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@1.0.16",
57
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@1.0.18",
58
58
  "@sap-ux-private/playwright": "1.0.2",
59
- "@sap-ux/axios-extension": "2.0.2",
59
+ "@sap-ux/axios-extension": "2.0.3",
60
60
  "@sap-ux/store": "2.0.1",
61
61
  "@sap-ux/ui5-info": "1.0.1"
62
62
  },