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