@sap-ux/fiori-generator-shared 1.0.20 → 1.2.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.
@@ -1,3 +1,4 @@
1
+ import type { Floorplan } from '../types/index.js';
1
2
  /**
2
3
  * Creates a value suitable for use as a semantic object for navigation intents.
3
4
  * Removes specific characters that would break the navigation.
@@ -7,4 +8,20 @@
7
8
  */
8
9
  export declare const getSemanticObject: (appId: string) => string;
9
10
  export declare const getFlpId: (appId: string, action?: string | undefined) => string;
11
+ /**
12
+ * Returns the display label for a given floorplan template type.
13
+ * Falls back to the templateType value itself if no translation is found.
14
+ *
15
+ * @param templateType - the floorplan template type (e.g. `FloorplanFE.FE_LROP`)
16
+ * @param odataVersion - optional OData version suffix (e.g. `'2'` or `'4'`)
17
+ * @returns the display label (e.g. `'List Report Page V4'`)
18
+ */
19
+ export declare function getFloorplanLabel(templateType: Floorplan, odataVersion?: string): string;
20
+ /**
21
+ * Returns the description for a given floorplan template type.
22
+ *
23
+ * @param templateType - the floorplan template type (e.g. `FloorplanFE.FE_LROP`)
24
+ * @returns the description string
25
+ */
26
+ export declare function getFloorplanDescription(templateType: Floorplan): string;
10
27
  //# sourceMappingURL=app-helpers.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { t } from '../i18n.js';
1
2
  /**
2
3
  * Creates a value suitable for use as a semantic object for navigation intents.
3
4
  * Removes specific characters that would break the navigation.
@@ -12,4 +13,24 @@ export const getSemanticObject = (appId) => {
12
13
  export const getFlpId = (appId, action) => {
13
14
  return `${getSemanticObject(appId)}${action ? '-' + action : ''}`;
14
15
  };
16
+ /**
17
+ * Returns the display label for a given floorplan template type.
18
+ * Falls back to the templateType value itself if no translation is found.
19
+ *
20
+ * @param templateType - the floorplan template type (e.g. `FloorplanFE.FE_LROP`)
21
+ * @param odataVersion - optional OData version suffix (e.g. `'2'` or `'4'`)
22
+ * @returns the display label (e.g. `'List Report Page V4'`)
23
+ */
24
+ export function getFloorplanLabel(templateType, odataVersion) {
25
+ return t(`floorplans.label.${templateType}`, { defaultValue: templateType, odataVersion });
26
+ }
27
+ /**
28
+ * Returns the description for a given floorplan template type.
29
+ *
30
+ * @param templateType - the floorplan template type (e.g. `FloorplanFE.FE_LROP`)
31
+ * @returns the description string
32
+ */
33
+ export function getFloorplanDescription(templateType) {
34
+ return t(`floorplans.description.${templateType}`, { defaultValue: '' });
35
+ }
15
36
  //# sourceMappingURL=app-helpers.js.map
package/dist/i18n.js CHANGED
@@ -16,7 +16,16 @@ export async function initI18n() {
16
16
  fallbackLng: 'en',
17
17
  defaultNS: NS,
18
18
  ns: [NS],
19
- showSupportNotice: false
19
+ showSupportNotice: false,
20
+ interpolation: {
21
+ format: function (value, format) {
22
+ if (format === 'odataVersionFormatter') {
23
+ return value ? ` V${value}` : '';
24
+ }
25
+ return value;
26
+ }
27
+ },
28
+ missingInterpolationHandler: () => ''
20
29
  });
21
30
  }
22
31
  /**
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export { getPackageScripts } from './npm-package-scripts/getPackageScripts.js';
10
10
  export { getBootstrapResourceUrls } from './ui5/ui5.js';
11
11
  export { getDefaultTargetFolder, isExtensionInstalled, isCommandRegistered } from './vscode-helpers/vscode-helpers.js';
12
12
  export { generateAppGenInfo } from './app-gen-info.js';
13
- export { getFlpId, getSemanticObject } from './app-helpers/app-helpers.js';
13
+ export { getFlpId, getSemanticObject, getFloorplanLabel, getFloorplanDescription } from './app-helpers/app-helpers.js';
14
14
  export { setYeomanEnvConflicterForce } from './yeoman.js';
15
+ export { initI18n as initI18nFioriGeneratorShared } from './i18n.js';
15
16
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export { getPackageScripts } from './npm-package-scripts/getPackageScripts.js';
10
10
  export { getBootstrapResourceUrls } from './ui5/ui5.js';
11
11
  export { getDefaultTargetFolder, isExtensionInstalled, isCommandRegistered } from './vscode-helpers/vscode-helpers.js';
12
12
  export { generateAppGenInfo } from './app-gen-info.js';
13
- export { getFlpId, getSemanticObject } from './app-helpers/app-helpers.js';
13
+ export { getFlpId, getSemanticObject, getFloorplanLabel, getFloorplanDescription } from './app-helpers/app-helpers.js';
14
14
  export { setYeomanEnvConflicterForce } from './yeoman.js';
15
+ export { initI18n as initI18nFioriGeneratorShared } from './i18n.js';
15
16
  //# sourceMappingURL=index.js.map
@@ -17,5 +17,25 @@
17
17
  "systemTypeLabel": {
18
18
  "abapCloud": "ABAP Cloud"
19
19
  }
20
+ },
21
+ "floorplans": {
22
+ "label": {
23
+ "basic": "Basic{{odataVersion, odataVersionFormatter}}",
24
+ "fpm": "Custom Page{{odataVersion, odataVersionFormatter}}",
25
+ "lrop": "List Report Page{{odataVersion, odataVersionFormatter}}",
26
+ "worklist": "Worklist Page{{odataVersion, odataVersionFormatter}}",
27
+ "alp": "Analytical List Page{{odataVersion, odataVersionFormatter}}",
28
+ "ovp": "Overview Page{{odataVersion, odataVersionFormatter}}",
29
+ "feop": "Form Entry Object Page{{odataVersion, odataVersionFormatter}}"
30
+ },
31
+ "description": {
32
+ "basic": "Create a freestyle application, starting with an empty page.",
33
+ "fpm": "Create an SAP Fiori elements application containing a custom page based on the flexible programming model.",
34
+ "lrop": "Create an SAP Fiori elements application containing a list report and an object page.",
35
+ "worklist": "Create an SAP Fiori elements application containing a worklist and an object page.",
36
+ "alp": "Create an SAP Fiori elements application containing an analytical list and an object page.",
37
+ "ovp": "Create an SAP Fiori elements application containing an overview page.",
38
+ "feop": "Create an SAP Fiori elements application containing an object page optimized for data entry."
39
+ }
20
40
  }
21
41
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-generator-shared",
3
3
  "description": "Commonly used shared functionality and types to support the fiori generator.",
4
- "version": "1.0.20",
4
+ "version": "1.2.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -27,8 +27,8 @@
27
27
  "semver": "7.8.4",
28
28
  "@sap-ux/axios-extension": "2.0.7",
29
29
  "@sap-ux/btp-utils": "2.0.5",
30
- "@sap-ux/project-access": "2.1.6",
31
- "@sap-ux/telemetry": "1.0.18"
30
+ "@sap-ux/telemetry": "1.0.18",
31
+ "@sap-ux/project-access": "2.1.6"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@jest/globals": "30.4.1",