@tolgee/core 3.3.0 → 3.6.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.
@@ -968,7 +968,7 @@ var MouseEventHandler = /** @class */ (function () {
968
968
  var onMouseOver = function () { return _this.onMouseOver(element); };
969
969
  var onMouseOut = function () { return _this.onMouseOut(element); };
970
970
  var onClick = function (e) {
971
- if (_this.areKeysDown()) {
971
+ if (_this.areKeysDown() && _this.highlighted === e.currentTarget) {
972
972
  e.stopPropagation();
973
973
  e.preventDefault();
974
974
  onclick(e);
@@ -1677,6 +1677,9 @@ var TolgeeConfig = /** @class */ (function () {
1677
1677
  if (this.watch === undefined) {
1678
1678
  this.watch = this.mode === 'development';
1679
1679
  }
1680
+ if (this.availableLanguages === undefined && this.staticData) {
1681
+ this.availableLanguages = Object.keys(this.staticData);
1682
+ }
1680
1683
  }
1681
1684
  return TolgeeConfig;
1682
1685
  }());
@@ -1734,7 +1737,7 @@ var PluginManager = /** @class */ (function () {
1734
1737
  this.handshake = function () {
1735
1738
  var sharedConfiguration = __assign(__assign({}, _this.properties), { config: __assign(__assign({}, _this.properties.config), {
1736
1739
  //remove properties, which cannot be sent by window.postMessage
1737
- staticData: undefined, targetElement: undefined, _targetElement: undefined, ui: undefined }), uiPresent: Boolean(_this.properties.config.ui), uiVersion: "3.3.0" });
1740
+ staticData: undefined, targetElement: undefined, _targetElement: undefined, ui: undefined }), uiPresent: Boolean(_this.properties.config.ui), uiVersion: "3.6.0" });
1738
1741
  var timer = null;
1739
1742
  var ping = function () {
1740
1743
  _this.messages.send('TOLGEE_READY', sharedConfiguration);
@@ -2176,9 +2179,7 @@ var Coder$1 = /** @class */ (function () {
2176
2179
  return param.toString();
2177
2180
  }
2178
2181
  // eslint-disable-next-line no-console
2179
- console.warn(param);
2180
- // eslint-disable-next-line no-console
2181
- console.warn('Unsupported value type of above param. Consider converting to string.');
2182
+ console.warn("Parameters of type \"".concat(typeof param, "\" are not supported in \"text\" wrapper mode."));
2182
2183
  return param;
2183
2184
  };
2184
2185
  }
@@ -2780,8 +2781,12 @@ var Coder = /** @class */ (function () {
2780
2781
  if (defaultValue) {
2781
2782
  codes.push(this.defaultMemory.valueToNumber(defaultValue));
2782
2783
  }
2783
- return ((translation || defaultValue || '') +
2784
- encodeMessage(String.fromCodePoint.apply(String, __spreadArray([], __read(codes), false))));
2784
+ var value = translation || '';
2785
+ var invisibleMark = encodeMessage(String.fromCodePoint.apply(String, __spreadArray([], __read(codes), false)));
2786
+ return typeof value === 'string'
2787
+ ? value + invisibleMark
2788
+ : Array.isArray(value)
2789
+ ? __spreadArray(__spreadArray([], __read(value), false), [invisibleMark], false) : [value, invisibleMark];
2785
2790
  };
2786
2791
  return Coder;
2787
2792
  }());
@@ -5578,10 +5583,14 @@ var IntlMessageFormat = IntlMessageFormat$1;
5578
5583
  var _a;
5579
5584
  var IcuFormatter = (_a = /** @class */ (function () {
5580
5585
  function class_1() {
5586
+ this.cache = new Map();
5581
5587
  }
5582
5588
  class_1.prototype.format = function (_a) {
5583
5589
  var translation = _a.translation, language = _a.language, params = _a.params;
5584
- return new IntlMessageFormat(translation, language).format(params);
5590
+ var ignoreTag = !Object.values(params).find(function (p) { return typeof p === 'function'; });
5591
+ return new IntlMessageFormat(translation, language, undefined, {
5592
+ ignoreTag: ignoreTag,
5593
+ }).format(params);
5585
5594
  };
5586
5595
  return class_1;
5587
5596
  }()),