@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.
- package/dist/tolgee.cjs.js +17 -8
- package/dist/tolgee.cjs.js.map +1 -1
- package/dist/tolgee.cjs.min.js +1 -1
- package/dist/tolgee.cjs.min.js.map +1 -1
- package/dist/tolgee.esm.js +1 -1
- package/dist/tolgee.esm.js.map +1 -1
- package/dist/tolgee.umd.js +17 -8
- package/dist/tolgee.umd.js.map +1 -1
- package/dist/tolgee.umd.min.js +1 -1
- package/dist/tolgee.umd.min.js.map +1 -1
- package/lib/Tolgee.d.ts +6 -1
- package/lib/Tolgee.js.map +1 -1
- package/lib/TolgeeConfig.js +3 -0
- package/lib/TolgeeConfig.js.map +1 -1
- package/lib/highlighter/MouseEventHandler.js +1 -1
- package/lib/highlighter/MouseEventHandler.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/modules/IcuFormatter.js +5 -1
- package/lib/modules/IcuFormatter.js.map +1 -1
- package/lib/services/TextService.d.ts +3 -3
- package/lib/services/TextService.js.map +1 -1
- package/lib/types.d.ts +32 -3
- package/lib/wrappers/AbstractWrapper.d.ts +2 -2
- package/lib/wrappers/NodeHandler.d.ts +2 -2
- package/lib/wrappers/NodeHandler.js.map +1 -1
- package/lib/wrappers/invisible/Coder.d.ts +2 -2
- package/lib/wrappers/invisible/Coder.js +6 -2
- package/lib/wrappers/invisible/Coder.js.map +1 -1
- package/lib/wrappers/invisible/InvisibleWrapper.d.ts +1 -1
- package/lib/wrappers/text/Coder.js +1 -3
- package/lib/wrappers/text/Coder.js.map +1 -1
- package/package.json +5 -5
package/dist/tolgee.umd.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
2786
|
-
|
|
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
|
-
|
|
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
|
}()),
|