locize 3.1.0 → 3.1.1
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 +4 -0
- package/dist/cjs/api/handleRequestPopupChanges.js +8 -7
- package/dist/cjs/process.js +7 -5
- package/dist/cjs/ui/elements/popup.js +3 -1
- package/dist/esm/api/handleRequestPopupChanges.js +2 -1
- package/dist/esm/process.js +8 -6
- package/dist/esm/ui/elements/popup.js +3 -2
- package/dist/umd/locize.js +453 -450
- package/dist/umd/locize.min.js +1 -1
- package/locize.js +453 -450
- package/locize.min.js +1 -1
- package/package.json +1 -1
- package/src/api/handleRequestPopupChanges.js +2 -1
- package/src/process.js +10 -8
- package/src/ui/elements/popup.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var postMessage = require('./postMessage.js');
|
|
4
|
+
var popup = require('../ui/elements/popup.js');
|
|
4
5
|
|
|
5
6
|
function handler(payload) {
|
|
6
7
|
var containerStyle = payload.containerStyle;
|
|
7
8
|
if (containerStyle) {
|
|
8
|
-
var popup = document.getElementById(
|
|
9
|
+
var popup$1 = document.getElementById(popup.popupId);
|
|
9
10
|
if (containerStyle.height) {
|
|
10
|
-
var diff = "calc(".concat(containerStyle.height, " - ").concat(popup.style.height, ")");
|
|
11
|
-
popup.style.setProperty('top', "calc(".concat(popup.style.top, " - ").concat(diff, ")"));
|
|
12
|
-
popup.style.setProperty('height', containerStyle.height);
|
|
11
|
+
var diff = "calc(".concat(containerStyle.height, " - ").concat(popup$1.style.height, ")");
|
|
12
|
+
popup$1.style.setProperty('top', "calc(".concat(popup$1.style.top, " - ").concat(diff, ")"));
|
|
13
|
+
popup$1.style.setProperty('height', containerStyle.height);
|
|
13
14
|
}
|
|
14
15
|
if (containerStyle.width) {
|
|
15
|
-
var _diff = "calc(".concat(containerStyle.width, " - ").concat(popup.style.width, ")");
|
|
16
|
-
popup.style.setProperty('left', "calc(".concat(popup.style.left, " - ").concat(_diff, ")"));
|
|
17
|
-
popup.style.setProperty('width', containerStyle.width);
|
|
16
|
+
var _diff = "calc(".concat(containerStyle.width, " - ").concat(popup$1.style.width, ")");
|
|
17
|
+
popup$1.style.setProperty('left', "calc(".concat(popup$1.style.left, " - ").concat(_diff, ")"));
|
|
18
|
+
popup$1.style.setProperty('width', containerStyle.width);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
}
|
package/dist/cjs/process.js
CHANGED
|
@@ -54,11 +54,13 @@ function start() {
|
|
|
54
54
|
});
|
|
55
55
|
observer$1.start();
|
|
56
56
|
mouseDistance.startMouseTracking(observer$1);
|
|
57
|
-
document.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
if (!document.getElementById(popup.popupId)) {
|
|
58
|
+
document.body.append(popup.Popup(vars.getIframeUrl(), function () {
|
|
59
|
+
postMessage.api.requestInitialize(config);
|
|
60
|
+
}));
|
|
61
|
+
popup$1.initDragElement();
|
|
62
|
+
popup$1.initResizeElement();
|
|
63
|
+
}
|
|
62
64
|
}
|
|
63
65
|
if (document.body) return continueToStart();
|
|
64
66
|
window.addEventListener('load', function () {
|
|
@@ -41,9 +41,10 @@ function Minimize(popupEle, onMinimize) {
|
|
|
41
41
|
};
|
|
42
42
|
return image;
|
|
43
43
|
}
|
|
44
|
+
var popupId = 'i18next-editor-popup';
|
|
44
45
|
function Popup(url, cb) {
|
|
45
46
|
var popup = document.createElement('div');
|
|
46
|
-
popup.setAttribute('id',
|
|
47
|
+
popup.setAttribute('id', popupId);
|
|
47
48
|
popup.classList.add('i18next-editor-popup');
|
|
48
49
|
popup.style = "\n z-index: 9;\n background-color: transparent;\n border: 1px solid rgba(200, 200, 200, 0.9);\n box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n --i18next-editor-popup-height: 200px;\n height: var(--i18next-editor-popup-height);\n min-height: 150px;\n min-width: 300px;\n --i18next-editor-popup-width: 400px;\n width: var(--i18next-editor-popup-width);\n max-height: 600px;\n max-width: 800px;\n\n position: fixed;\n --i18next-editor-popup-position-top: calc(100vh - var(--i18next-editor-popup-height) - 10px);\n top: calc(100vh - var(--i18next-editor-popup-height) - 10px);\n --i18next-editor-popup-position-left: calc(100vw - var(--i18next-editor-popup-width) - 10px);\n left: calc(100vw - var(--i18next-editor-popup-width) - 10px);\n\n overflow: visible;\n ";
|
|
49
50
|
popup.setAttribute('data-i18next-editor-element', 'true');
|
|
@@ -78,3 +79,4 @@ function Popup(url, cb) {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
exports.Popup = Popup;
|
|
82
|
+
exports.popupId = popupId;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { api } from './postMessage.js';
|
|
2
|
+
import { popupId } from '../ui/elements/popup.js';
|
|
2
3
|
|
|
3
4
|
function handler(payload) {
|
|
4
5
|
var containerStyle = payload.containerStyle;
|
|
5
6
|
if (containerStyle) {
|
|
6
|
-
var popup = document.getElementById(
|
|
7
|
+
var popup = document.getElementById(popupId);
|
|
7
8
|
if (containerStyle.height) {
|
|
8
9
|
var diff = "calc(".concat(containerStyle.height, " - ").concat(popup.style.height, ")");
|
|
9
10
|
popup.style.setProperty('top', "calc(".concat(popup.style.top, " - ").concat(diff, ")"));
|
package/dist/esm/process.js
CHANGED
|
@@ -3,7 +3,7 @@ import { parseTree, setImplementation } from './parser.js';
|
|
|
3
3
|
import { createObserver } from './observer.js';
|
|
4
4
|
import { startMouseTracking } from './ui/mouseDistance.js';
|
|
5
5
|
import { initDragElement, initResizeElement } from './ui/popup.js';
|
|
6
|
-
import { Popup } from './ui/elements/popup.js';
|
|
6
|
+
import { popupId, Popup } from './ui/elements/popup.js';
|
|
7
7
|
import { getIframeUrl } from './vars.js';
|
|
8
8
|
import './api/handleEditKey.js';
|
|
9
9
|
import './api/handleCommitKey.js';
|
|
@@ -46,11 +46,13 @@ function start() {
|
|
|
46
46
|
});
|
|
47
47
|
observer.start();
|
|
48
48
|
startMouseTracking(observer);
|
|
49
|
-
document.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
if (!document.getElementById(popupId)) {
|
|
50
|
+
document.body.append(Popup(getIframeUrl(), function () {
|
|
51
|
+
api.requestInitialize(config);
|
|
52
|
+
}));
|
|
53
|
+
initDragElement();
|
|
54
|
+
initResizeElement();
|
|
55
|
+
}
|
|
54
56
|
}
|
|
55
57
|
if (document.body) return continueToStart();
|
|
56
58
|
window.addEventListener('load', function () {
|
|
@@ -37,9 +37,10 @@ function Minimize(popupEle, onMinimize) {
|
|
|
37
37
|
};
|
|
38
38
|
return image;
|
|
39
39
|
}
|
|
40
|
+
var popupId = 'i18next-editor-popup';
|
|
40
41
|
function Popup(url, cb) {
|
|
41
42
|
var popup = document.createElement('div');
|
|
42
|
-
popup.setAttribute('id',
|
|
43
|
+
popup.setAttribute('id', popupId);
|
|
43
44
|
popup.classList.add('i18next-editor-popup');
|
|
44
45
|
popup.style = "\n z-index: 9;\n background-color: transparent;\n border: 1px solid rgba(200, 200, 200, 0.9);\n box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n --i18next-editor-popup-height: 200px;\n height: var(--i18next-editor-popup-height);\n min-height: 150px;\n min-width: 300px;\n --i18next-editor-popup-width: 400px;\n width: var(--i18next-editor-popup-width);\n max-height: 600px;\n max-width: 800px;\n\n position: fixed;\n --i18next-editor-popup-position-top: calc(100vh - var(--i18next-editor-popup-height) - 10px);\n top: calc(100vh - var(--i18next-editor-popup-height) - 10px);\n --i18next-editor-popup-position-left: calc(100vw - var(--i18next-editor-popup-width) - 10px);\n left: calc(100vw - var(--i18next-editor-popup-width) - 10px);\n\n overflow: visible;\n ";
|
|
45
46
|
popup.setAttribute('data-i18next-editor-element', 'true');
|
|
@@ -73,4 +74,4 @@ function Popup(url, cb) {
|
|
|
73
74
|
return popup;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
export { Popup };
|
|
77
|
+
export { Popup, popupId };
|