@tolgee/core 3.6.0 → 4.0.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 +11 -1
- 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 +11 -1
- 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/Observer.d.ts +1 -0
- package/lib/Observer.js +10 -0
- package/lib/Observer.js.map +1 -1
- package/package.json +3 -3
package/dist/tolgee.umd.js
CHANGED
|
@@ -1443,6 +1443,7 @@
|
|
|
1443
1443
|
this.textWrapper = textWrapper;
|
|
1444
1444
|
this.nodeRegistrar = nodeRegistrar;
|
|
1445
1445
|
this._observer = undefined;
|
|
1446
|
+
this._observing = false;
|
|
1446
1447
|
}
|
|
1447
1448
|
Object.defineProperty(Observer.prototype, "observer", {
|
|
1448
1449
|
get: function () {
|
|
@@ -1460,6 +1461,10 @@
|
|
|
1460
1461
|
case 1:
|
|
1461
1462
|
if (!!mutationsList_1_1.done) return [3 /*break*/, 8];
|
|
1462
1463
|
mutation = mutationsList_1_1.value;
|
|
1464
|
+
if (!this._observing) {
|
|
1465
|
+
// make sure we don't touch the DOM after disconnect is called
|
|
1466
|
+
return [2 /*return*/];
|
|
1467
|
+
}
|
|
1463
1468
|
if (!(mutation.type === 'characterData')) return [3 /*break*/, 3];
|
|
1464
1469
|
return [4 /*yield*/, this.textWrapper.handleText(mutation.target)];
|
|
1465
1470
|
case 2:
|
|
@@ -1507,6 +1512,10 @@
|
|
|
1507
1512
|
if (!this.observer) {
|
|
1508
1513
|
return;
|
|
1509
1514
|
}
|
|
1515
|
+
if (this._observing) {
|
|
1516
|
+
throw new Error('Tolgee: Observer is already running');
|
|
1517
|
+
}
|
|
1518
|
+
this._observing = true;
|
|
1510
1519
|
this.observer.observe(this.properties.config.targetElement, {
|
|
1511
1520
|
attributes: true,
|
|
1512
1521
|
childList: true,
|
|
@@ -1518,6 +1527,7 @@
|
|
|
1518
1527
|
if (!this.observer) {
|
|
1519
1528
|
return;
|
|
1520
1529
|
}
|
|
1530
|
+
this._observing = false;
|
|
1521
1531
|
this.observer.disconnect();
|
|
1522
1532
|
};
|
|
1523
1533
|
return Observer;
|
|
@@ -1739,7 +1749,7 @@
|
|
|
1739
1749
|
this.handshake = function () {
|
|
1740
1750
|
var sharedConfiguration = __assign(__assign({}, _this.properties), { config: __assign(__assign({}, _this.properties.config), {
|
|
1741
1751
|
//remove properties, which cannot be sent by window.postMessage
|
|
1742
|
-
staticData: undefined, targetElement: undefined, _targetElement: undefined, ui: undefined }), uiPresent: Boolean(_this.properties.config.ui), uiVersion: "
|
|
1752
|
+
staticData: undefined, targetElement: undefined, _targetElement: undefined, ui: undefined }), uiPresent: Boolean(_this.properties.config.ui), uiVersion: "4.0.0" });
|
|
1743
1753
|
var timer = null;
|
|
1744
1754
|
var ping = function () {
|
|
1745
1755
|
_this.messages.send('TOLGEE_READY', sharedConfiguration);
|