locize 4.0.5 → 4.0.7

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 4.0.7
2
+
3
+ - fix highlighting
4
+
1
5
  ### 4.0.5
2
6
 
3
7
  - fix some typos
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023 inweso GmbH
3
+ Copyright (c) 2025 inweso GmbH
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -102,8 +102,8 @@ Having [i18next-locize-backend](https://github.com/locize/i18next-locize-backend
102
102
  i18next.init({
103
103
  // ...
104
104
  editor: {
105
- projectId="5e9ed7da-51ab-4b15-888b-27903f06be09"
106
- version="latest"
105
+ projectId: "5e9ed7da-51ab-4b15-888b-27903f06be09"
106
+ version: "latest"
107
107
  }
108
108
  })
109
109
  ```
@@ -137,8 +137,8 @@ setEditorLng(lng)
137
137
 
138
138
  ```js
139
139
  startStandalone({
140
- projectId="5e9ed7da-51ab-4b15-888b-27903f06be09"
141
- version="latest"
140
+ projectId: "5e9ed7da-51ab-4b15-888b-27903f06be09",
141
+ version: "latest"
142
142
  })
143
143
  ```
144
144
 
@@ -18,8 +18,8 @@ function handler(payload) {
18
18
  ns: item.ns,
19
19
  key: item.key
20
20
  }), item.value), uni === null || uni === void 0 ? void 0 : uni.node);
21
- delete uni.keys["".concat(item.textType)];
22
- if (!Object.keys(uni.keys).length) uninstrumentedStore.uninstrumentedStore.remove(item.eleUniqueID, uni.node);
21
+ if (uni && uni.keys) delete uni.keys["".concat(item.textType)];
22
+ if (uni && uni.keys && !Object.keys(uni.keys).length) uninstrumentedStore.uninstrumentedStore.remove(item.eleUniqueID, uni.node);
23
23
  });
24
24
  postMessage.api.sendCurrentParsedContent();
25
25
  }
@@ -34,7 +34,7 @@ function highlight(item, node, keys) {
34
34
  }), dom.shift(), dom.offset(function (_ref) {
35
35
  var placement = _ref.placement,
36
36
  rects = _ref.rects;
37
- if (placement === 'bottom') return rects.r;
37
+ if (placement === 'bottom') return -rects.reference.height / 2 - rects.floating.height / 2;
38
38
  return 35;
39
39
  }), dom.arrow({
40
40
  element: arrowEle
@@ -12,8 +12,8 @@ function handler(payload) {
12
12
  ns: item.ns,
13
13
  key: item.key
14
14
  }), item.value), uni === null || uni === void 0 ? void 0 : uni.node);
15
- delete uni.keys["".concat(item.textType)];
16
- if (!Object.keys(uni.keys).length) uninstrumentedStore.remove(item.eleUniqueID, uni.node);
15
+ if (uni && uni.keys) delete uni.keys["".concat(item.textType)];
16
+ if (uni && uni.keys && !Object.keys(uni.keys).length) uninstrumentedStore.remove(item.eleUniqueID, uni.node);
17
17
  });
18
18
  api.sendCurrentParsedContent();
19
19
  }
@@ -26,7 +26,7 @@ function highlight(item, node, keys) {
26
26
  }), shift(), offset(function (_ref) {
27
27
  var placement = _ref.placement,
28
28
  rects = _ref.rects;
29
- if (placement === 'bottom') return rects.r;
29
+ if (placement === 'bottom') return -rects.reference.height / 2 - rects.floating.height / 2;
30
30
  return 35;
31
31
  }), arrow({
32
32
  element: arrowEle