@sap-ux/preview-middleware 0.20.70 → 0.20.72

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.
@@ -15,6 +15,7 @@ const logger_1 = require("@sap-ux/logger");
15
15
  const ejs_1 = require("ejs");
16
16
  const path_1 = require("path");
17
17
  const project_access_1 = require("@sap-ux/project-access");
18
+ const i18n_1 = require("@sap-ux/i18n");
18
19
  const fs_1 = require("fs");
19
20
  const test_1 = require("./test");
20
21
  const mem_fs_editor_1 = require("mem-fs-editor");
@@ -239,11 +240,10 @@ function getAppName(manifest, intent) {
239
240
  * @returns i18n text of the property
240
241
  */
241
242
  async function getI18nTextFromProperty(projectRoot, propertyValue, logger) {
242
- //i18n model format could be {{key}} or {i18n>key}
243
- if (!projectRoot || !propertyValue || propertyValue.search(/{{\w+}}|{i18n>\w+}/g) === -1) {
243
+ const propertyI18nKey = (0, i18n_1.extractDoubleCurlyBracketsKey)(propertyValue ?? '');
244
+ if (!projectRoot || !propertyI18nKey) {
244
245
  return propertyValue;
245
246
  }
246
- const propertyI18nKey = propertyValue.replace(/i18n>|[{}]/g, '');
247
247
  const projectAccess = await (0, project_access_1.createProjectAccess)(projectRoot);
248
248
  const applicationIds = projectAccess.getApplicationIds();
249
249
  try {
@@ -26,7 +26,7 @@ sap.ui.define(["sap/ui/core/Fragment", "../i18n", "./controllers/AddFragment.con
26
26
  }(DialogNames || {});
27
27
  const OPEN_DIALOG_STATUS_CHANGED = 'OPEN_DIALOG_STATUS_CHANGED';
28
28
  class DialogFactory {
29
- static eventTarget = new EventTarget();
29
+ static eventTarget = (() => new EventTarget())();
30
30
  static isDialogOpen = false;
31
31
  /**
32
32
  * Only one dialog can be open at a time. This flag indicates if a new dialog can be opened.
@@ -31,8 +31,8 @@ sap.ui.define([
31
31
  get quickActionSteps() {
32
32
  return 1;
33
33
  }
34
- kind = NESTED_QUICK_ACTION_KIND;
35
- type = ADD_NEW_ANNOTATION_FILE;
34
+ kind = ((() => NESTED_QUICK_ACTION_KIND)());
35
+ type = ((() => ADD_NEW_ANNOTATION_FILE)());
36
36
  forceRefreshAfterExecution = true;
37
37
  isApplicable = true;
38
38
  get id() {
@@ -27,11 +27,11 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
27
27
  * Quick Action provider for SAP Fiori Elements V2 applications.
28
28
  */
29
29
  class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
30
- PAGE_NAME_MAP = {
30
+ PAGE_NAME_MAP = (() => ({
31
31
  [LIST_REPORT_TYPE]: 'listReport',
32
32
  [OBJECT_PAGE_TYPE]: 'objectPage',
33
33
  [ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
34
- };
34
+ }))();
35
35
  getDefinitions(context) {
36
36
  const activePages = this.getActivePageContent(context.controlIndex);
37
37
  const definitionGroups = [];
@@ -26,10 +26,10 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
26
26
  * Quick Action provider for SAP Fiori Elements V4 applications.
27
27
  */
28
28
  class FEV4QuickActionRegistry extends QuickActionDefinitionRegistry {
29
- PAGE_NAME_MAP = {
29
+ PAGE_NAME_MAP = (() => ({
30
30
  [LIST_REPORT_TYPE]: 'listReport',
31
31
  [OBJECT_PAGE_TYPE]: 'objectPage'
32
- };
32
+ }))();
33
33
  getDefinitions(context) {
34
34
  const activePages = this.getActivePageContent(context.controlIndex);
35
35
  const definitionGroups = [];
@@ -44,8 +44,8 @@ sap.ui.define([
44
44
  pendingChanges = [];
45
45
  changedFiles = {};
46
46
  eventStack = [];
47
- pendingConfigChangeMap = new Map();
48
- configPropertyControlIdMap = new Map();
47
+ pendingConfigChangeMap = ((() => new Map())());
48
+ configPropertyControlIdMap = ((() => new Map())());
49
49
  constructor(options) {
50
50
  super();
51
51
  this.options = options;
@@ -57,8 +57,8 @@ sap.ui.define([
57
57
  }
58
58
  }
59
59
  class SelectionService {
60
- appliedChangeCache = new Map();
61
- activeChangeHandlers = new Set();
60
+ appliedChangeCache = ((() => new Map())());
61
+ activeChangeHandlers = ((() => new Set())());
62
62
  constructor(rta, changeService) {
63
63
  this.rta = rta;
64
64
  this.changeService = changeService;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
11
11
  },
12
- "version": "0.20.70",
12
+ "version": "0.20.72",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -25,13 +25,14 @@
25
25
  "ejs": "3.1.10",
26
26
  "mem-fs": "2.1.0",
27
27
  "mem-fs-editor": "9.4.0",
28
- "@sap-ux/adp-tooling": "0.15.7",
28
+ "@sap-ux/adp-tooling": "0.15.9",
29
29
  "@sap-ux/btp-utils": "1.1.0",
30
30
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.6.8",
31
31
  "@sap-ux/feature-toggle": "0.3.0",
32
32
  "@sap-ux/logger": "0.7.0",
33
- "@sap-ux/project-access": "1.30.7",
34
- "@sap-ux/system-access": "0.6.11"
33
+ "@sap-ux/project-access": "1.30.9",
34
+ "@sap-ux/system-access": "0.6.11",
35
+ "@sap-ux/i18n": "0.3.2"
35
36
  },
36
37
  "devDependencies": {
37
38
  "@sap-ux-private/playwright": "0.2.0",
@@ -48,10 +49,9 @@
48
49
  "express": "4.21.2",
49
50
  "nock": "13.4.0",
50
51
  "npm-run-all2": "6.2.0",
51
- "supertest": "6.3.3",
52
+ "supertest": "7.1.4",
52
53
  "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.14.11",
53
54
  "@sap-ux/axios-extension": "1.22.4",
54
- "@sap-ux/i18n": "0.3.1",
55
55
  "@sap-ux/store": "1.1.2",
56
56
  "@sap-ux/ui5-info": "0.12.1"
57
57
  },