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/locize.js
CHANGED
|
@@ -499,10 +499,348 @@
|
|
|
499
499
|
}
|
|
500
500
|
api.addHandler('confirmInitialized', handler$6);
|
|
501
501
|
|
|
502
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
503
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
504
|
+
var data$1 = {};
|
|
505
|
+
function clean$1() {
|
|
506
|
+
Object.values(data$1).forEach(function (item) {
|
|
507
|
+
if (!document.body.contains(item.node)) {
|
|
508
|
+
resetHighlight(item.id, item.node);
|
|
509
|
+
delete data$1[item.id];
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
function save$1(id, type, node) {
|
|
514
|
+
if (!id || !type || !node) return;
|
|
515
|
+
if (!data$1[id]) {
|
|
516
|
+
data$1[id] = {
|
|
517
|
+
id: id,
|
|
518
|
+
node: node
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
data$1[id].keys = _objectSpread$6(_objectSpread$6({}, data$1[id].keys), {}, _defineProperty({}, "".concat(type), 'uninstrumented'));
|
|
522
|
+
}
|
|
523
|
+
function get$1(id) {
|
|
524
|
+
return data$1[id];
|
|
525
|
+
}
|
|
526
|
+
var uninstrumentedStore = {
|
|
527
|
+
save: save$1,
|
|
528
|
+
clean: clean$1,
|
|
529
|
+
get: get$1,
|
|
530
|
+
data: data$1
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
function isInViewport(el) {
|
|
534
|
+
var rect = el.getBoundingClientRect();
|
|
535
|
+
var windowHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
536
|
+
var windowWidth = window.innerWidth || document.documentElement.clientWidth;
|
|
537
|
+
var vertInView = rect.top <= windowHeight && rect.top + rect.height >= 0;
|
|
538
|
+
var horInView = rect.left <= windowWidth && rect.left + rect.width >= 0;
|
|
539
|
+
return vertInView && horInView;
|
|
540
|
+
}
|
|
541
|
+
function mouseDistanceFromElement(mouseEvent, element) {
|
|
542
|
+
var $n = element,
|
|
543
|
+
mX = mouseEvent.pageX,
|
|
544
|
+
mY = mouseEvent.pageY,
|
|
545
|
+
from = {
|
|
546
|
+
x: mX,
|
|
547
|
+
y: mY
|
|
548
|
+
},
|
|
549
|
+
off = $n.getBoundingClientRect(),
|
|
550
|
+
ny1 = off.top + document.documentElement.scrollTop,
|
|
551
|
+
ny2 = ny1 + $n.offsetHeight,
|
|
552
|
+
nx1 = off.left + document.documentElement.scrollLeft,
|
|
553
|
+
nx2 = nx1 + $n.offsetWidth,
|
|
554
|
+
maxX1 = Math.max(mX, nx1),
|
|
555
|
+
minX2 = Math.min(mX, nx2),
|
|
556
|
+
maxY1 = Math.max(mY, ny1),
|
|
557
|
+
minY2 = Math.min(mY, ny2),
|
|
558
|
+
intersectX = minX2 >= maxX1,
|
|
559
|
+
intersectY = minY2 >= maxY1,
|
|
560
|
+
to = {
|
|
561
|
+
x: intersectX ? mX : nx2 < mX ? nx2 : nx1,
|
|
562
|
+
y: intersectY ? mY : ny2 < mY ? ny2 : ny1
|
|
563
|
+
},
|
|
564
|
+
distX = to.x - from.x,
|
|
565
|
+
distY = to.y - from.y,
|
|
566
|
+
hypot = Math.pow(Math.pow(distX, 2) + Math.pow(distY, 2), 1 / 2);
|
|
567
|
+
return Math.floor(hypot);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
function debounce(func, wait, immediate) {
|
|
571
|
+
var timeout;
|
|
572
|
+
return function () {
|
|
573
|
+
var context = this;
|
|
574
|
+
var args = arguments;
|
|
575
|
+
var later = function later() {
|
|
576
|
+
timeout = null;
|
|
577
|
+
if (!immediate) func.apply(context, args);
|
|
578
|
+
};
|
|
579
|
+
var callNow = immediate && !timeout;
|
|
580
|
+
clearTimeout(timeout);
|
|
581
|
+
timeout = setTimeout(later, wait);
|
|
582
|
+
if (callNow) func.apply(context, args);
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
function isWindow(obj) {
|
|
586
|
+
return obj != null && obj === obj.window;
|
|
587
|
+
}
|
|
588
|
+
function getWindow$1(elem) {
|
|
589
|
+
return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
|
|
590
|
+
}
|
|
591
|
+
function offset$1(elem) {
|
|
592
|
+
var box = {
|
|
593
|
+
top: 0,
|
|
594
|
+
left: 0,
|
|
595
|
+
right: 0,
|
|
596
|
+
bottom: 0
|
|
597
|
+
};
|
|
598
|
+
var doc = elem && elem.ownerDocument;
|
|
599
|
+
var docElem = doc && doc.documentElement;
|
|
600
|
+
if (!docElem) return box;
|
|
601
|
+
if (_typeof(elem.getBoundingClientRect) !== ("undefined" )) {
|
|
602
|
+
box = elem.getBoundingClientRect();
|
|
603
|
+
}
|
|
604
|
+
var win = getWindow$1(doc);
|
|
605
|
+
var top = box.top + win.pageYOffset - docElem.clientTop;
|
|
606
|
+
var left = box.left + win.pageXOffset - docElem.clientLeft;
|
|
607
|
+
return {
|
|
608
|
+
top: top,
|
|
609
|
+
left: left,
|
|
610
|
+
right: left + (box.right - box.left),
|
|
611
|
+
bottom: top + (box.bottom - box.top)
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
function getClickedElement(e) {
|
|
615
|
+
if (e.srcElement && e.srcElement.nodeType === 1 && (e.srcElement.nodeName === 'BUTTON' || e.srcElement.nodeName === 'INPUT')) {
|
|
616
|
+
if (e.srcElement.getAttribute && e.srcElement.getAttribute('ignorelocizeeditor') === '') {
|
|
617
|
+
return null;
|
|
618
|
+
}
|
|
619
|
+
return e.srcElement;
|
|
620
|
+
}
|
|
621
|
+
var el;
|
|
622
|
+
if (e.originalEvent && e.originalEvent.explicitOriginalTarget) {
|
|
623
|
+
el = e.originalEvent.explicitOriginalTarget;
|
|
624
|
+
} else {
|
|
625
|
+
var parent = e.srcElement;
|
|
626
|
+
if (parent.getAttribute && parent.getAttribute('ignorelocizeeditor') === '') return null;
|
|
627
|
+
var left = e.pageX;
|
|
628
|
+
var top = e.pageY;
|
|
629
|
+
var topStartsAt = 0;
|
|
630
|
+
var topBreaksAt;
|
|
631
|
+
for (var i = 0; i < parent.childNodes.length; i++) {
|
|
632
|
+
var n = parent.childNodes[i];
|
|
633
|
+
var nOffset = offset$1(n);
|
|
634
|
+
if (n.nodeType === 1 && nOffset.bottom < top) topStartsAt = i + 1;
|
|
635
|
+
if (!topBreaksAt && nOffset.top + (n.clientHeight || 0) > top) topBreaksAt = i;
|
|
636
|
+
}
|
|
637
|
+
if (topStartsAt + 1 > parent.childNodes.length) topStartsAt = parent.childNodes.length - 1;
|
|
638
|
+
if (!topBreaksAt) topBreaksAt = parent.childNodes.length;
|
|
639
|
+
for (var y = topStartsAt; y < topBreaksAt; y++) {
|
|
640
|
+
var _n = parent.childNodes[y];
|
|
641
|
+
var _nOffset = offset$1(_n);
|
|
642
|
+
if (_nOffset.left > left) {
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
if (_n && _n.nodeType !== 8) el = _n;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
return el;
|
|
649
|
+
}
|
|
650
|
+
function getElementText(el) {
|
|
651
|
+
var str = el.textContent || el.text && el.text.innerText || el.placeholder;
|
|
652
|
+
if (typeof str !== 'string') return;
|
|
653
|
+
return str.replace(/\n +/g, '').trim();
|
|
654
|
+
}
|
|
655
|
+
function getAttribute(el, name) {
|
|
656
|
+
return el && el.getAttribute && el.getAttribute(name);
|
|
657
|
+
}
|
|
658
|
+
function getElementI18nKey(el) {
|
|
659
|
+
var key = getAttribute(el, 'data-i18n');
|
|
660
|
+
if (key) return key;
|
|
661
|
+
if (el.nodeType === window.Node.TEXT_NODE && el.parentElement) {
|
|
662
|
+
return getElementI18nKey(el.parentElement);
|
|
663
|
+
}
|
|
664
|
+
return undefined;
|
|
665
|
+
}
|
|
666
|
+
function getElementNamespace(el) {
|
|
667
|
+
var found;
|
|
668
|
+
var find = function find(ele) {
|
|
669
|
+
var opts = getAttribute(ele, 'i18next-options');
|
|
670
|
+
if (!opts) opts = getAttribute(ele, 'data-i18next-options');
|
|
671
|
+
if (!opts) opts = getAttribute(ele, 'i18n-options');
|
|
672
|
+
if (!opts) opts = getAttribute(ele, 'data-i18n-options');
|
|
673
|
+
if (opts) {
|
|
674
|
+
var jsonData = {};
|
|
675
|
+
try {
|
|
676
|
+
jsonData = JSON.parse(opts);
|
|
677
|
+
} catch (e) {}
|
|
678
|
+
if (jsonData.ns) found = jsonData.ns;
|
|
679
|
+
}
|
|
680
|
+
if (!found) found = getAttribute(ele, 'i18next-ns');
|
|
681
|
+
if (!found) found = getAttribute(ele, 'data-i18next-ns');
|
|
682
|
+
if (!found) found = getAttribute(ele, 'i18n-ns');
|
|
683
|
+
if (!found) found = getAttribute(ele, 'data-i18n-ns');
|
|
684
|
+
if (!found && ele.parentElement) find(ele.parentElement);
|
|
685
|
+
};
|
|
686
|
+
find(el);
|
|
687
|
+
return found;
|
|
688
|
+
}
|
|
689
|
+
function getQsParameterByName(name, url) {
|
|
690
|
+
if (typeof window === 'undefined') return null;
|
|
691
|
+
if (!url) url = window.location.href.toLowerCase();
|
|
692
|
+
name = name.replace(/[\[\]]/g, '\\$&');
|
|
693
|
+
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
|
|
694
|
+
var results = regex.exec(url);
|
|
695
|
+
if (!results) return null;
|
|
696
|
+
if (!results[2]) return '';
|
|
697
|
+
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
var debouncedUpdateDistance = debounce(function (e, observer) {
|
|
701
|
+
Object.values(store.data).forEach(function (item) {
|
|
702
|
+
if (!isInViewport(item.node)) return;
|
|
703
|
+
var distance = mouseDistanceFromElement(e, item.node);
|
|
704
|
+
if (distance < 5) {
|
|
705
|
+
highlight(item, item.node, item.keys);
|
|
706
|
+
} else if (distance > 5) {
|
|
707
|
+
var boxDistance = item.ribbonBox ? mouseDistanceFromElement(e, item.ribbonBox) : 1000;
|
|
708
|
+
if (boxDistance > 10) resetHighlight(item, item.node, item.keys);
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
Object.values(uninstrumentedStore.data).forEach(function (item) {
|
|
712
|
+
if (!isInViewport(item.node)) return;
|
|
713
|
+
var distance = mouseDistanceFromElement(e, item.node);
|
|
714
|
+
if (distance < 10) {
|
|
715
|
+
highlightUninstrumented(item, item.node, item.keys);
|
|
716
|
+
} else if (distance > 10) {
|
|
717
|
+
resetHighlight(item, item.node, item.keys);
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
}, 50);
|
|
721
|
+
var currentFC;
|
|
722
|
+
function startMouseTracking(observer) {
|
|
723
|
+
currentFC = function handle(e) {
|
|
724
|
+
debouncedUpdateDistance(e, observer);
|
|
725
|
+
};
|
|
726
|
+
document.addEventListener('mousemove', currentFC);
|
|
727
|
+
}
|
|
728
|
+
function stopMouseTracking() {
|
|
729
|
+
document.removeEventListener('mousemove', currentFC);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
var iconEdit = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#FFFFFF"><g></g><g><g><g><path d="M3,21l3.75,0L17.81,9.94l-3.75-3.75L3,17.25L3,21z M5,18.08l9.06-9.06l0.92,0.92L5.92,19L5,19L5,18.08z"/></g><g><path d="M18.37,3.29c-0.39-0.39-1.02-0.39-1.41,0l-1.83,1.83l3.75,3.75l1.83-1.83c0.39-0.39,0.39-1.02,0-1.41L18.37,3.29z"/></g></g></g></svg>';
|
|
733
|
+
var i18nextIcon = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 210 304\" stroke=\"#000\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"#fff\" fill-rule=\"evenodd\">\n <g stroke=\"none\" class=\"B\">\n <path d=\"M 142 31.5 v 57.2 l 64.3 165.1 s 19.6 40.3 -36.5 50.1 h -128 s -52.3 -5.5 -39.8 -46.9 L 69.5 88.7 V 31.5 z\" fill=\"#009688\"/>\n <path d=\"M 143.3 24.8 H 66.2 c -6.2 0 -11.3 -5.6 -11.3 -12.4 S 60 0 66.2 0 h 77.1 c 6.3 0 11.3 5.6 11.3 12.4 s -5.1 12.4 -11.3 12.4 z\" class=\"C\" fill=\"#004d40\"/>\n <path d=\"M 123 124.9 c 8.3 0 15 8.1 15 18.1 c 0 10 -6.8 18.1 -15 18.1 c -8.3 0 -15 -8.1 -15 -18.1 c 0 -10 6.7 -18.1 15 -18.1 z m -58.8 31.7 c 0 -8.5 5.6 -15.3 12.7 -15.3 s 12.7 6.8 12.7 15.3 s -5.6 15.3 -12.7 15.3 s -12.7 -6.8 -12.7 -15.3 z\" fill=\"white\"/>\n <path d=\"M 147.7 84.9 V 57.7 s 34.5 -7.6 51.7 32.5 c 0 0 -26.9 19.6 -51.7 -5.3 z m -84.5 0 V 57.7 s -34.5 -7.6 -51.7 32.5 c 0 0 26.8 19.6 51.7 -5.3 z\" class=\"C\" fill=\"#004d40\"/>\n <path d=\"M 168.4 197.5 c -56.1 -17.4 -103.3 -8.1 -126.3 -1 l -23.2 56 c -10.5 33.4 33.2 37.8 33.2 37.8 h 106.9 c 46.9 -7.9 30.5 -40.4 30.5 -40.4 z\" fill=\"white\"/>\n <path d=\"M 87.6 218.3 c 0 6 -8.1 10.9 -18.1 10.9 s -18.1 -4.9 -18.1 -10.9 c 0 -6.1 8.1 -10.9 18.1 -10.9 s 18.1 4.9 18.1 10.9 z m 64.4 0 c 0 6 -8.1 10.9 -18.1 10.9 c -10 0 -18.1 -4.9 -18.1 -10.9 c 0 -6.1 8.1 -10.9 18.1 -10.9 c 10 0 18.1 4.9 18.1 10.9 z\" class=\"C\" fill=\"#004d40\"/>\n </g>\n</svg>\n";
|
|
734
|
+
var locizeIcon = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 194.667 196\" height=\"196\" width=\"194.667\" xml:space=\"preserve\">\n <defs>\n <clipPath id=\"a\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M5.5 74.048C5.5 36.98 35.551 6.93 72.619 6.93c37.069 0 67.119 30.05 67.119 67.118 0 37.07-30.05 67.12-67.119 67.12-37.068 0-67.119-30.05-67.119-67.12\"/>\n </clipPath>\n <clipPath id=\"b\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M0 147h146V0H0Z\"/>\n </clipPath>\n <clipPath id=\"c\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M88.756 55.055h50.982l4.512 88.195-64 1.25z\"/>\n </clipPath>\n </defs>\n <g clip-path=\"url(#a)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.766-5.554 1.148-8.427 0-11.107-1.149-2.681-2.49-7.469-1.341-10.724 1.149-3.255 2.872-10.34 4.404-10.533 1.532-.19-1.148 7.66.383 5.171 1.533-2.49 1.533-6.193 4.214-8.746 2.68-2.553 6.319-2.17 9.192-4.658 2.872-2.49 5.744-6.129 8.425-5.746 0 0-.192-1.914-1.532-5.17-1.34-3.255-1.532-7.084.192-9.383 1.723-2.298 3.446-5.746 4.979-7.469 1.532-1.723 2.681-10.915 2.297-15.51-.382-4.596 1.724-14.937 6.511-17.236 4.787-2.298 0 1.15-.957 4.022-.958 2.872.739 9.575 3.052 10.533 2.309.958 4.416 4.787 6.139 7.469 1.724 2.68 6.128 3.83 7.469 7.084 1.341 3.255.766 7.085 1.532 8.809.766 1.724 2.873 5.554-1.724 7.852-4.595 2.298-6.51 1.148-6.702 3.255-.192 2.107-1.341 4.404-4.595 5.361-3.256.959-6.129 2.816-9.768 3.227-3.638.412-4.404-2.461-6.319-.928-1.914 1.531-3.446 3.064-4.213 4.978-.765 1.915-3.064.766-2.871 1.915.19 1.15 3.254 4.404-.193 3.255-3.446-1.148-6.51-.765-6.319 2.298.193 3.064 4.405 4.214 6.129 4.597 1.722.383 3.063-1.723 5.17-3.065 2.106-1.34.191 1.915 1.34 4.214 1.149 2.298 5.554 2.106 6.128 5.361.575 3.255-.191 5.937 3.256 6.32 3.446.383 7.084-.191 7.468 1.533.382 1.722-4.022-.576-4.213 1.531-.192 2.106 3.829 4.978 4.978 2.872 1.149-2.106 4.022-2.298 4.405-1.531.383.765 0 2.105-1.341 5.361-1.34 3.256-2.681 2.298-3.829 5.936-1.149 3.639-3.064-.191-4.979 1.724s-4.213 5.937-4.597 2.489c-.382-3.446-.382-5.361-2.105-8.042-1.724-2.682-2.489-.575-4.022 1.149-1.532 1.723-4.979 3.447-3.83 4.978C23.362 4.979 24.511 9 26.234 7.85c1.724-1.149 4.405-1.149 4.022.767-.383 1.914 0 2.681.766 3.638.766.958 3.447 2.682 3.447-.766 0-3.447-.384-4.405 2.298-4.788 2.681-.383 5.744-.574 5.554 1.149-.193 1.724.766 1.341 0 4.214-.767 2.873-3.065 3.063-5.554 4.405-2.489 1.34-3.83 3.446-5.936 2.68s-2.299-1.531-2.49-3.638c-.192-2.107-1.341-2.873-2.107-1.915-.765.957.192 4.022-2.68 2.106-2.873-1.914-4.021-5.171-5.553-2.872-1.533 2.297 2.297 6.319-1.724 4.595-4.022-1.723-6.895-3.637-4.788-4.404 2.107-.766 4.214-2.107 2.107-2.873-2.107-.765-6.32.575-7.852-.957C4.212 7.66 0 0 0 0\" transform=\"translate(13.926 109.38)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.766-5.554 1.148-8.427 0-11.107-1.149-2.681-2.49-7.469-1.341-10.724 1.149-3.255 2.872-10.34 4.404-10.533 1.532-.19-1.148 7.66.383 5.171 1.533-2.49 1.533-6.193 4.214-8.746 2.68-2.553 6.319-2.17 9.192-4.658 2.872-2.49 5.744-6.129 8.425-5.746 0 0-.192-1.914-1.532-5.17-1.34-3.255-1.532-7.084.192-9.383 1.723-2.298 3.446-5.746 4.979-7.469 1.532-1.723 2.681-10.915 2.297-15.51-.382-4.596 1.724-14.937 6.511-17.236 4.787-2.298 0 1.15-.957 4.022-.958 2.872.739 9.575 3.052 10.533 2.309.958 4.416 4.787 6.139 7.469 1.724 2.68 6.128 3.83 7.469 7.084 1.341 3.255.766 7.085 1.532 8.809.766 1.724 2.873 5.554-1.724 7.852-4.595 2.298-6.51 1.148-6.702 3.255-.192 2.107-1.341 4.404-4.595 5.361-3.256.959-6.129 2.816-9.768 3.227-3.638.412-4.404-2.461-6.319-.928-1.914 1.531-3.446 3.064-4.213 4.978-.765 1.915-3.064.766-2.871 1.915.19 1.15 3.254 4.404-.193 3.255-3.446-1.148-6.51-.765-6.319 2.298.193 3.064 4.405 4.214 6.129 4.597 1.722.383 3.063-1.723 5.17-3.065 2.106-1.34.191 1.915 1.34 4.214 1.149 2.298 5.554 2.106 6.128 5.361.575 3.255-.191 5.937 3.256 6.32 3.446.383 7.084-.191 7.468 1.533.382 1.722-4.022-.576-4.213 1.531-.192 2.106 3.829 4.978 4.978 2.872 1.149-2.106 4.022-2.298 4.405-1.531.383.765 0 2.105-1.341 5.361-1.34 3.256-2.681 2.298-3.829 5.936-1.149 3.639-3.064-.191-4.979 1.724s-4.213 5.937-4.597 2.489c-.382-3.446-.382-5.361-2.105-8.042-1.724-2.682-2.489-.575-4.022 1.149-1.532 1.723-4.979 3.447-3.83 4.978C23.362 4.979 24.511 9 26.234 7.85c1.724-1.149 4.405-1.149 4.022.767-.383 1.914 0 2.681.766 3.638.766.958 3.447 2.682 3.447-.766 0-3.447-.384-4.405 2.298-4.788 2.681-.383 5.744-.574 5.554 1.149-.193 1.724.766 1.341 0 4.214-.767 2.873-3.065 3.063-5.554 4.405-2.489 1.34-3.83 3.446-5.936 2.68s-2.299-1.531-2.49-3.638c-.192-2.107-1.341-2.873-2.107-1.915-.765.957.192 4.022-2.68 2.106-2.873-1.914-4.021-5.171-5.553-2.872-1.533 2.297 2.297 6.319-1.724 4.595-4.022-1.723-6.895-3.637-4.788-4.404 2.107-.766 4.214-2.107 2.107-2.873-2.107-.765-6.32.575-7.852-.957C4.212 7.66 0 0 0 0Z\" transform=\"translate(13.926 109.38)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.01-2.141.575-3.829 2.49-1.915C4.405 0 5.553 2.298 6.895 1.341c1.34-.958 3.638-.703 4.594-.639.959.064 1.15 2.937 3.831 2.554s1.724.574 4.596 2.107c2.873 1.532 9.001 4.212 2.681 3.446-6.32-.766-6.703.958-11.108-1.914-4.403-2.873-5.36-2.873-6.509-3.639-1.149-.766-2.49 2.298-4.022 0C-.575.958.011 2.182 0 0\" transform=\"translate(36.522 130.061)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.01-2.141.575-3.829 2.49-1.915C4.405 0 5.553 2.298 6.895 1.341c1.34-.958 3.638-.703 4.594-.639.959.064 1.15 2.937 3.831 2.554s1.724.574 4.596 2.107c2.873 1.532 9.001 4.212 2.681 3.446-6.32-.766-6.703.958-11.108-1.914-4.403-2.873-5.36-2.873-6.509-3.639-1.149-.766-2.49 2.298-4.022 0C-.575.958.011 2.182 0 0Z\" transform=\"translate(36.522 130.061)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-2.263-1.956-5.744-4.788-3.064-4.788 2.681 0 3.983 1.404 5.439-.447 1.456-1.85.88-4.723.88-6.063 0-1.341-.766-4.406 1.15-8.235 1.915-3.829 2.106-6.319 4.022-3.829 1.914 2.488 6.51 7.276 8.808 7.658 2.298.384 4.597 1.342 5.746 3.257 1.148 1.915 0 3.773 1.914 5.141 1.914 1.369 1.531 3.093 2.107 5.199C27.575 0 32.747 0 30.448 1.148c-2.297 1.15-6.51 1.916-11.49 1.341C13.979 1.915 4.213 3.638 0 0\" transform=\"translate(59.502 135.998)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-2.263-1.956-5.744-4.788-3.064-4.788 2.681 0 3.983 1.404 5.439-.447 1.456-1.85.88-4.723.88-6.063 0-1.341-.766-4.406 1.15-8.235 1.915-3.829 2.106-6.319 4.022-3.829 1.914 2.488 6.51 7.276 8.808 7.658 2.298.384 4.597 1.342 5.746 3.257 1.148 1.915 0 3.773 1.914 5.141 1.914 1.369 1.531 3.093 2.107 5.199C27.575 0 32.747 0 30.448 1.148c-2.297 1.15-6.51 1.916-11.49 1.341C13.979 1.915 4.213 3.638 0 0Z\" transform=\"translate(59.502 135.998)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.218-1.986-.575-2.107.766-2.49 1.34-.383-.575-2.68.957-2.872 1.532-.193 4.979-1.15 5.936 0 .959 1.148-1.531.7-3.255 1.977C2.682-2.107.865 1.41 0 0\" transform=\"translate(38.438 76.826)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.218-1.986-.575-2.107.766-2.49 1.34-.383-.575-2.68.957-2.872 1.532-.193 4.979-1.15 5.936 0 .959 1.148-1.531.7-3.255 1.977C2.682-2.107.865 1.41 0 0Z\" transform=\"translate(38.438 76.826)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-2.063-1.033-1.148-2.682-3.064-3.831-1.915-1.148-1.149-1.531-1.723-4.213-.575-2.68.191-4.212 1.532-2.106S2.298 1.148 0 0\" transform=\"translate(131.121 45.612)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-2.063-1.033-1.148-2.682-3.064-3.831-1.915-1.148-1.149-1.531-1.723-4.213-.575-2.68.191-4.212 1.532-2.106S2.298 1.148 0 0Z\" transform=\"translate(131.121 45.612)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.575-.575-1.532 2.681-2.106 4.213-.575 1.532-.561 4.195 1.056 5.675C.964 11.734 0 7.469 0 5.17 0 2.873.574.575 0 0m-6.704 5.936c-1.341.766-3.828 0-6.892-.957-3.065-.958-.613 2.131.766 4.213 1.233 1.861.574-.574 3.256-.766 2.68-.192 4.213-3.256 2.87-2.49m-4.402-6.511c-.192-1.531.574-4.021-3.639-3.064-4.213.958-4.213 3.256-5.936 1.533-1.723-1.724-3.83-3.255-6.32-.575C-29.49 0-29.107.766-30.447.958c-.955.135-4.138.846-6.792.074.206.123.426.285.663.5 1.915 1.723 1.532 2.298 3.638 4.213 2.108 1.916 3.639 3.638 5.171 1.916 1.532-1.725 4.788-2.108 3.639-4.023-1.149-1.914-.383-3.063.958-1.914 1.339 1.149 3.255 1.914 1.915 3.446-1.342 1.532-2.682 5.554-.766 2.873 1.915-2.681 2.489-4.022 3.637-5.553C-17.234.958-16.085 0-15.702.958c.383.957-.192 3.063.383 3.446.574.383 0-3.255 1.723-3.446 1.723-.192 2.681 0 2.49-1.533M9.192-8.81c-.574 3.257-4.787 32.747-4.787 32.747s-11.299 7.277-13.213 5.746c-1.916-1.533-5.171-1.302-4.788.21s2.872 1.128-1.341 4.002c-4.212 2.873-4.978 5.362-8.233 1.724-3.257-3.639-4.022-6.703-5.937-7.661-1.915-.957-3.447-4.021-1.34-4.787 2.106-.765 2.298 0 4.02-1.531 1.725-1.533 4.023-1.149 4.406-.193.383.959.766 4.022.957 5.171.192 1.149 2.138 4.979 1.93 1.915-.207-3.064 2.665-3.064.75-5.17-1.914-2.106-.765-3.831-4.595-4.214-3.831-.382-4.022 1.915-6.128.766-2.107-1.148-1.915-1.915-2.681-3.063-.766-1.149-4.788-3.447-4.788-3.447s-3.255 1.149-1.724-.958c1.533-2.106 2.873-4.595 1.533-4.786-1.341-.192-4.98 1.914-4.98-.384s-.573-4.787.959-5.362c1.081-.405 1.783-1.284 2.775-1.161-.769-.332-1.468-.813-2.009-1.52-1.491-1.947-.575-5.362-3.639-6.511-3.063-1.15-3.063-2.489-3.639-4.979-.573-2.489 0-8.808.766-9.383.765-.574 2.107-5.362 5.363-4.978 3.256.383 6.702.53 7.851-.023 1.149-.551 3.063 1.171 3.638-3.233.575-4.404 1.915-4.979 2.681-7.277.766-2.297-.383-7.086 0-9.958s3.064-7.852 3.064-10.341c0-2.489 2.873-3.638 4.405-2.681 1.532.958 4.787 2.873 6.127 5.937 1.342 3.063 1.342 4.595 3.447 8.617 2.106 4.021 1.533 6.894 2.489 9.958.958 3.064 3.262 5.171 6.419 8.617 3.156 3.446 2.588 5.362 0 5.171-2.588-.191-4.314 2.297-5.654 5.361-1.338 3.065-2.87 10.724-1.721 8.235 1.149-2.491 3.446-9.384 5.744-10.533 2.298-1.149 6.512 1.953 7.469 3.083.957 1.131.574 4.385-1.916 5.726C.383-8.617 1.915-7.469 4.405-9c2.489-1.532 5.362-3.064 4.787.19\" transform=\"translate(132.845 86.592)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.575-.575-1.532 2.681-2.106 4.213-.575 1.532-.561 4.195 1.056 5.675C.964 11.734 0 7.469 0 5.17 0 2.873.574.575 0 0Zm-6.704 5.936c-1.341.766-3.828 0-6.892-.957-3.065-.958-.613 2.131.766 4.213 1.233 1.861.574-.574 3.256-.766 2.68-.192 4.213-3.256 2.87-2.49zm-4.402-6.511c-.192-1.531.574-4.021-3.639-3.064-4.213.958-4.213 3.256-5.936 1.533-1.723-1.724-3.83-3.255-6.32-.575C-29.49 0-29.107.766-30.447.958c-.955.135-4.138.846-6.792.074.206.123.426.285.663.5 1.915 1.723 1.532 2.298 3.638 4.213 2.108 1.916 3.639 3.638 5.171 1.916 1.532-1.725 4.788-2.108 3.639-4.023-1.149-1.914-.383-3.063.958-1.914 1.339 1.149 3.255 1.914 1.915 3.446-1.342 1.532-2.682 5.554-.766 2.873 1.915-2.681 2.489-4.022 3.637-5.553C-17.234.958-16.085 0-15.702.958c.383.957-.192 3.063.383 3.446.574.383 0-3.255 1.723-3.446 1.723-.192 2.681 0 2.49-1.533zM9.192-8.81c-.574 3.257-4.787 32.747-4.787 32.747s-11.299 7.277-13.213 5.746c-1.916-1.533-5.171-1.302-4.788.21s2.872 1.128-1.341 4.002c-4.212 2.873-4.978 5.362-8.233 1.724-3.257-3.639-4.022-6.703-5.937-7.661-1.915-.957-3.447-4.021-1.34-4.787 2.106-.765 2.298 0 4.02-1.531 1.725-1.533 4.023-1.149 4.406-.193.383.959.766 4.022.957 5.171.192 1.149 2.138 4.979 1.93 1.915-.207-3.064 2.665-3.064.75-5.17-1.914-2.106-.765-3.831-4.595-4.214-3.831-.382-4.022 1.915-6.128.766-2.107-1.148-1.915-1.915-2.681-3.063-.766-1.149-4.788-3.447-4.788-3.447s-3.255 1.149-1.724-.958c1.533-2.106 2.873-4.595 1.533-4.786-1.341-.192-4.98 1.914-4.98-.384s-.573-4.787.959-5.362c1.081-.405 1.783-1.284 2.775-1.161-.769-.332-1.468-.813-2.009-1.52-1.491-1.947-.575-5.362-3.639-6.511-3.063-1.15-3.063-2.489-3.639-4.979-.573-2.489 0-8.808.766-9.383.765-.574 2.107-5.362 5.363-4.978 3.256.383 6.702.53 7.851-.023 1.149-.551 3.063 1.171 3.638-3.233.575-4.404 1.915-4.979 2.681-7.277.766-2.297-.383-7.086 0-9.958s3.064-7.852 3.064-10.341c0-2.489 2.873-3.638 4.405-2.681 1.532.958 4.787 2.873 6.127 5.937 1.342 3.063 1.342 4.595 3.447 8.617 2.106 4.021 1.533 6.894 2.489 9.958.958 3.064 3.262 5.171 6.419 8.617 3.156 3.446 2.588 5.362 0 5.171-2.588-.191-4.314 2.297-5.654 5.361-1.338 3.065-2.87 10.724-1.721 8.235 1.149-2.491 3.446-9.384 5.744-10.533 2.298-1.149 6.512 1.953 7.469 3.083.957 1.131.574 4.385-1.916 5.726C.383-8.617 1.915-7.469 4.405-9c2.489-1.532 5.362-3.064 4.787.19z\" transform=\"translate(132.845 86.592)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.173-.353-2.106-2.681-1.532-3.831.576-1.148-.574.576-2.106-.382-1.533-.957-3.808-3.639-1.713-3.829 2.096-.193 1.713 1.531 3.628.765 1.915-.765 4.021-.575 4.021 1.34C2.298-4.021 1.915.574 0 0\" transform=\"translate(95.886 109.955)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.173-.353-2.106-2.681-1.532-3.831.576-1.148-.574.576-2.106-.382-1.533-.957-3.808-3.639-1.713-3.829 2.096-.193 1.713 1.531 3.628.765 1.915-.765 4.021-.575 4.021 1.34C2.298-4.021 1.915.574 0 0Z\" transform=\"translate(95.886 109.955)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.154-.165-1.533-3.064.957-3.447 2.49-.383 6.947.575 5.293 2.107C4.596.191 2.682.383 0 0\" transform=\"translate(83.44 118.763)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.154-.165-1.533-3.064.957-3.447 2.49-.383 6.947.575 5.293 2.107C4.596.191 2.682.383 0 0Z\" transform=\"translate(83.44 118.763)\"/>\n </g>\n <g clip-path=\"url(#b)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c0-37.068-30.05-67.119-67.119-67.119S-134.238-37.068-134.238 0c0 37.069 30.05 67.119 67.119 67.119S0 37.069 0 0Z\" transform=\"translate(139.738 74.049)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c0-36.731-29.777-66.509-66.509-66.509S-133.019-36.731-133.019 0c0 36.733 29.778 66.51 66.51 66.51C-29.777 66.51 0 36.733 0 0Z\" transform=\"translate(139.438 73.186)\"/>\n </g>\n <g clip-path=\"url(#c)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0m12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754\" transform=\"translate(119.64 109.307)\"/>\n <path style=\"fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0m12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754\" transform=\"translate(119.64 109.307)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0Zm12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754z\" transform=\"translate(119.64 109.307)\"/>\n </g>\n</svg>\n";
|
|
735
|
+
var minimizeIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M6 19h12v2H6v-2z"/></svg>';
|
|
736
|
+
var editIconUrl = URL.createObjectURL(new Blob([iconEdit], {
|
|
737
|
+
type: 'image/svg+xml'
|
|
738
|
+
}));
|
|
739
|
+
var i18nextIconUrl = URL.createObjectURL(new Blob([i18nextIcon], {
|
|
740
|
+
type: 'image/svg+xml'
|
|
741
|
+
}));
|
|
742
|
+
var minimizeIconUrl = URL.createObjectURL(new Blob([minimizeIcon], {
|
|
743
|
+
type: 'image/svg+xml'
|
|
744
|
+
}));
|
|
745
|
+
var locizeIconUrl = URL.createObjectURL(new Blob([locizeIcon], {
|
|
746
|
+
type: 'image/svg+xml'
|
|
747
|
+
}));
|
|
748
|
+
function EditIcon() {
|
|
749
|
+
var image = document.createElement('img');
|
|
750
|
+
image.setAttribute('data-i18next-editor-element', 'true');
|
|
751
|
+
image.src = editIconUrl;
|
|
752
|
+
image.style.width = '15px';
|
|
753
|
+
return image;
|
|
754
|
+
}
|
|
755
|
+
function RibbonLogo() {
|
|
756
|
+
var circleSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '18px';
|
|
757
|
+
var logoSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '15px';
|
|
758
|
+
var ribbon = document.createElement('div');
|
|
759
|
+
ribbon.setAttribute('data-i18next-editor-element', 'true');
|
|
760
|
+
ribbon.style = "display: inline-flex; align-items: center; justify-content: center; width: ".concat(circleSize, "; height: ").concat(circleSize, "; box-shadow: inset 0 0 5px ").concat(colors.highlight, "; border: 2px solid ").concat(colors.highlight, "; border-radius: 50%");
|
|
761
|
+
var image = document.createElement('img');
|
|
762
|
+
image.src = i18nextIconUrl;
|
|
763
|
+
image.style.width = logoSize;
|
|
764
|
+
ribbon.appendChild(image);
|
|
765
|
+
return ribbon;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if (sheet) {
|
|
769
|
+
sheet.insertRule("@keyframes i18next-editor-animate-top { \n from {\n top: calc(100vh + 600px); \n left: calc(100vw + 300px);\n opacity: 0;\n }\n to {\n top: var(--i18next-editor-popup-position-top);\n left: var(--i18next-editor-popup-position-left);\n opacity: 1;\n }\n }");
|
|
770
|
+
sheet.insertRule("@keyframes i18next-editor-animate-bottom { \n from {\n top: var(--i18next-editor-popup-position-top);\n left: var(--i18next-editor-popup-position-left);\n opacity: 1;\n }\n to {\n top: calc(100vh + 600px); \n left: calc(100vw + 300px);\n opacity: 0;\n }\n }");
|
|
771
|
+
sheet.insertRule(".i18next-editor-popup * { \n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */\n }");
|
|
772
|
+
sheet.insertRule(".i18next-editor-popup .resizer-right {\n width: 15px;\n height: 100%;\n background: transparent;\n position: absolute;\n right: -15px;\n bottom: 0;\n cursor: e-resize;\n }");
|
|
773
|
+
sheet.insertRule(".i18next-editor-popup .resizer-both {\n width: 15px;\n height: 15px;\n background: transparent;\n z-index: 10;\n position: absolute;\n right: -15px;\n bottom: -15px;\n cursor: se-resize;\n }");
|
|
774
|
+
sheet.insertRule(".i18next-editor-popup .resizer-bottom {\n width: 100%;\n height: 15px;\n background: transparent;\n position: absolute;\n right: 0;\n bottom: -15px;\n cursor: s-resize;\n }");
|
|
775
|
+
}
|
|
776
|
+
function Ribbon(popupEle, onMaximize) {
|
|
777
|
+
var ribbon = document.createElement('div');
|
|
778
|
+
ribbon.setAttribute('data-i18next-editor-element', 'true');
|
|
779
|
+
ribbon.style = "\n cursor: pointer;\n position: fixed;\n bottom: 25px;\n right: 25px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n height: 50px;\n background-color: rgba(249, 249, 249, 0.2);\n backdrop-filter: blur(3px);\n box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);\n border-radius: 50%\n ";
|
|
780
|
+
ribbon.onclick = function () {
|
|
781
|
+
onMaximize();
|
|
782
|
+
};
|
|
783
|
+
var image = document.createElement('img');
|
|
784
|
+
image.src = locizeIconUrl;
|
|
785
|
+
image.style.width = '45px';
|
|
786
|
+
ribbon.appendChild(image);
|
|
787
|
+
return ribbon;
|
|
788
|
+
}
|
|
789
|
+
function Minimize(popupEle, onMinimize) {
|
|
790
|
+
var image = document.createElement('img');
|
|
791
|
+
image.setAttribute('data-i18next-editor-element', 'true');
|
|
792
|
+
image.src = minimizeIconUrl;
|
|
793
|
+
image.style.width = '24px';
|
|
794
|
+
image.style.cursor = 'pointer';
|
|
795
|
+
image.onclick = function () {
|
|
796
|
+
popupEle.style.setProperty('--i18next-editor-popup-position-top', popupEle.style.top);
|
|
797
|
+
popupEle.style.setProperty('--i18next-editor-popup-position-left', popupEle.style.left);
|
|
798
|
+
popupEle.style.animation = 'i18next-editor-animate-bottom 2s forwards';
|
|
799
|
+
onMinimize();
|
|
800
|
+
};
|
|
801
|
+
return image;
|
|
802
|
+
}
|
|
803
|
+
var popupId = 'i18next-editor-popup';
|
|
804
|
+
function Popup(url, cb) {
|
|
805
|
+
var popup = document.createElement('div');
|
|
806
|
+
popup.setAttribute('id', popupId);
|
|
807
|
+
popup.classList.add('i18next-editor-popup');
|
|
808
|
+
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 ";
|
|
809
|
+
popup.setAttribute('data-i18next-editor-element', 'true');
|
|
810
|
+
var header = document.createElement('div');
|
|
811
|
+
header.classList.add('i18next-editor-popup-header');
|
|
812
|
+
header.style = "\n padding: 2px 10px;\n cursor: move;\n z-index: 10;\n backdrop-filter: blur(3px);\n background-color: rgba(200, 200, 200, 0.5);\n background: linear-gradient(0deg, rgba(200, 200, 200, 0.6), rgba(200, 200, 200, 0.5));\n color: #fff;\n text-align: right;\n ";
|
|
813
|
+
popup.appendChild(header);
|
|
814
|
+
header.appendChild(Minimize(popup, function () {
|
|
815
|
+
var ribbon = Ribbon(popup, function () {
|
|
816
|
+
popup.style.animation = 'i18next-editor-animate-top 1s';
|
|
817
|
+
startMouseTracking();
|
|
818
|
+
setTimeout(function () {
|
|
819
|
+
document.body.removeChild(ribbon);
|
|
820
|
+
}, 1000);
|
|
821
|
+
});
|
|
822
|
+
document.body.appendChild(ribbon);
|
|
823
|
+
stopMouseTracking();
|
|
824
|
+
}));
|
|
825
|
+
var iframe = document.createElement('iframe');
|
|
826
|
+
iframe.setAttribute('id', 'i18next-editor-iframe');
|
|
827
|
+
iframe.setAttribute('data-i18next-editor-element', 'true');
|
|
828
|
+
iframe.style = "\n z-index: 100;\n width: 100%;\n height: calc(100% - 28px);\n border: none;\n background: #fff;\n ";
|
|
829
|
+
iframe.setAttribute('src', url);
|
|
830
|
+
iframe.addEventListener('load', cb);
|
|
831
|
+
popup.appendChild(iframe);
|
|
832
|
+
var overlay = document.createElement('div');
|
|
833
|
+
overlay.setAttribute('id', 'i18next-editor-popup-overlay');
|
|
834
|
+
overlay.setAttribute('data-i18next-editor-element', 'true');
|
|
835
|
+
overlay.style = "\n display: none;\n position: absolute;\n top: 32px;\n z-index: 101;\n width: 100%;\n height: calc(100% - 32px);\n background-color: rgba(200, 200, 200, 0.5);\n background: linear-gradient(0deg, rgba(240, 240, 240, 0.6), rgba(255, 255, 255, 0.5));\n backdrop-filter: blur(2px);\n";
|
|
836
|
+
popup.appendChild(overlay);
|
|
837
|
+
return popup;
|
|
838
|
+
}
|
|
839
|
+
|
|
502
840
|
function handler$5(payload) {
|
|
503
841
|
var containerStyle = payload.containerStyle;
|
|
504
842
|
if (containerStyle) {
|
|
505
|
-
var popup = document.getElementById(
|
|
843
|
+
var popup = document.getElementById(popupId);
|
|
506
844
|
if (containerStyle.height) {
|
|
507
845
|
var diff = "calc(".concat(containerStyle.height, " - ").concat(popup.style.height, ")");
|
|
508
846
|
popup.style.setProperty('top', "calc(".concat(popup.style.top, " - ").concat(diff, ")"));
|
|
@@ -547,14 +885,14 @@
|
|
|
547
885
|
}
|
|
548
886
|
|
|
549
887
|
var _excluded = ["lng", "ns"];
|
|
550
|
-
function ownKeys$
|
|
551
|
-
function _objectSpread$
|
|
888
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
889
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
552
890
|
function handler$4(payload) {
|
|
553
891
|
var lng = payload.lng,
|
|
554
892
|
ns = payload.ns,
|
|
555
893
|
rest = _objectWithoutProperties(payload, _excluded);
|
|
556
894
|
api.i18n.getResourceBundle(lng, ns, function (resources) {
|
|
557
|
-
api.confirmResourceBundle(_objectSpread$
|
|
895
|
+
api.confirmResourceBundle(_objectSpread$5({
|
|
558
896
|
resources: resources,
|
|
559
897
|
lng: lng,
|
|
560
898
|
ns: ns
|
|
@@ -603,42 +941,6 @@
|
|
|
603
941
|
}
|
|
604
942
|
api.addHandler('turnOff', handler);
|
|
605
943
|
|
|
606
|
-
var iconEdit = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#FFFFFF"><g></g><g><g><g><path d="M3,21l3.75,0L17.81,9.94l-3.75-3.75L3,17.25L3,21z M5,18.08l9.06-9.06l0.92,0.92L5.92,19L5,19L5,18.08z"/></g><g><path d="M18.37,3.29c-0.39-0.39-1.02-0.39-1.41,0l-1.83,1.83l3.75,3.75l1.83-1.83c0.39-0.39,0.39-1.02,0-1.41L18.37,3.29z"/></g></g></g></svg>';
|
|
607
|
-
var i18nextIcon = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 210 304\" stroke=\"#000\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"#fff\" fill-rule=\"evenodd\">\n <g stroke=\"none\" class=\"B\">\n <path d=\"M 142 31.5 v 57.2 l 64.3 165.1 s 19.6 40.3 -36.5 50.1 h -128 s -52.3 -5.5 -39.8 -46.9 L 69.5 88.7 V 31.5 z\" fill=\"#009688\"/>\n <path d=\"M 143.3 24.8 H 66.2 c -6.2 0 -11.3 -5.6 -11.3 -12.4 S 60 0 66.2 0 h 77.1 c 6.3 0 11.3 5.6 11.3 12.4 s -5.1 12.4 -11.3 12.4 z\" class=\"C\" fill=\"#004d40\"/>\n <path d=\"M 123 124.9 c 8.3 0 15 8.1 15 18.1 c 0 10 -6.8 18.1 -15 18.1 c -8.3 0 -15 -8.1 -15 -18.1 c 0 -10 6.7 -18.1 15 -18.1 z m -58.8 31.7 c 0 -8.5 5.6 -15.3 12.7 -15.3 s 12.7 6.8 12.7 15.3 s -5.6 15.3 -12.7 15.3 s -12.7 -6.8 -12.7 -15.3 z\" fill=\"white\"/>\n <path d=\"M 147.7 84.9 V 57.7 s 34.5 -7.6 51.7 32.5 c 0 0 -26.9 19.6 -51.7 -5.3 z m -84.5 0 V 57.7 s -34.5 -7.6 -51.7 32.5 c 0 0 26.8 19.6 51.7 -5.3 z\" class=\"C\" fill=\"#004d40\"/>\n <path d=\"M 168.4 197.5 c -56.1 -17.4 -103.3 -8.1 -126.3 -1 l -23.2 56 c -10.5 33.4 33.2 37.8 33.2 37.8 h 106.9 c 46.9 -7.9 30.5 -40.4 30.5 -40.4 z\" fill=\"white\"/>\n <path d=\"M 87.6 218.3 c 0 6 -8.1 10.9 -18.1 10.9 s -18.1 -4.9 -18.1 -10.9 c 0 -6.1 8.1 -10.9 18.1 -10.9 s 18.1 4.9 18.1 10.9 z m 64.4 0 c 0 6 -8.1 10.9 -18.1 10.9 c -10 0 -18.1 -4.9 -18.1 -10.9 c 0 -6.1 8.1 -10.9 18.1 -10.9 c 10 0 18.1 4.9 18.1 10.9 z\" class=\"C\" fill=\"#004d40\"/>\n </g>\n</svg>\n";
|
|
608
|
-
var locizeIcon = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 194.667 196\" height=\"196\" width=\"194.667\" xml:space=\"preserve\">\n <defs>\n <clipPath id=\"a\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M5.5 74.048C5.5 36.98 35.551 6.93 72.619 6.93c37.069 0 67.119 30.05 67.119 67.118 0 37.07-30.05 67.12-67.119 67.12-37.068 0-67.119-30.05-67.119-67.12\"/>\n </clipPath>\n <clipPath id=\"b\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M0 147h146V0H0Z\"/>\n </clipPath>\n <clipPath id=\"c\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M88.756 55.055h50.982l4.512 88.195-64 1.25z\"/>\n </clipPath>\n </defs>\n <g clip-path=\"url(#a)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.766-5.554 1.148-8.427 0-11.107-1.149-2.681-2.49-7.469-1.341-10.724 1.149-3.255 2.872-10.34 4.404-10.533 1.532-.19-1.148 7.66.383 5.171 1.533-2.49 1.533-6.193 4.214-8.746 2.68-2.553 6.319-2.17 9.192-4.658 2.872-2.49 5.744-6.129 8.425-5.746 0 0-.192-1.914-1.532-5.17-1.34-3.255-1.532-7.084.192-9.383 1.723-2.298 3.446-5.746 4.979-7.469 1.532-1.723 2.681-10.915 2.297-15.51-.382-4.596 1.724-14.937 6.511-17.236 4.787-2.298 0 1.15-.957 4.022-.958 2.872.739 9.575 3.052 10.533 2.309.958 4.416 4.787 6.139 7.469 1.724 2.68 6.128 3.83 7.469 7.084 1.341 3.255.766 7.085 1.532 8.809.766 1.724 2.873 5.554-1.724 7.852-4.595 2.298-6.51 1.148-6.702 3.255-.192 2.107-1.341 4.404-4.595 5.361-3.256.959-6.129 2.816-9.768 3.227-3.638.412-4.404-2.461-6.319-.928-1.914 1.531-3.446 3.064-4.213 4.978-.765 1.915-3.064.766-2.871 1.915.19 1.15 3.254 4.404-.193 3.255-3.446-1.148-6.51-.765-6.319 2.298.193 3.064 4.405 4.214 6.129 4.597 1.722.383 3.063-1.723 5.17-3.065 2.106-1.34.191 1.915 1.34 4.214 1.149 2.298 5.554 2.106 6.128 5.361.575 3.255-.191 5.937 3.256 6.32 3.446.383 7.084-.191 7.468 1.533.382 1.722-4.022-.576-4.213 1.531-.192 2.106 3.829 4.978 4.978 2.872 1.149-2.106 4.022-2.298 4.405-1.531.383.765 0 2.105-1.341 5.361-1.34 3.256-2.681 2.298-3.829 5.936-1.149 3.639-3.064-.191-4.979 1.724s-4.213 5.937-4.597 2.489c-.382-3.446-.382-5.361-2.105-8.042-1.724-2.682-2.489-.575-4.022 1.149-1.532 1.723-4.979 3.447-3.83 4.978C23.362 4.979 24.511 9 26.234 7.85c1.724-1.149 4.405-1.149 4.022.767-.383 1.914 0 2.681.766 3.638.766.958 3.447 2.682 3.447-.766 0-3.447-.384-4.405 2.298-4.788 2.681-.383 5.744-.574 5.554 1.149-.193 1.724.766 1.341 0 4.214-.767 2.873-3.065 3.063-5.554 4.405-2.489 1.34-3.83 3.446-5.936 2.68s-2.299-1.531-2.49-3.638c-.192-2.107-1.341-2.873-2.107-1.915-.765.957.192 4.022-2.68 2.106-2.873-1.914-4.021-5.171-5.553-2.872-1.533 2.297 2.297 6.319-1.724 4.595-4.022-1.723-6.895-3.637-4.788-4.404 2.107-.766 4.214-2.107 2.107-2.873-2.107-.765-6.32.575-7.852-.957C4.212 7.66 0 0 0 0\" transform=\"translate(13.926 109.38)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.766-5.554 1.148-8.427 0-11.107-1.149-2.681-2.49-7.469-1.341-10.724 1.149-3.255 2.872-10.34 4.404-10.533 1.532-.19-1.148 7.66.383 5.171 1.533-2.49 1.533-6.193 4.214-8.746 2.68-2.553 6.319-2.17 9.192-4.658 2.872-2.49 5.744-6.129 8.425-5.746 0 0-.192-1.914-1.532-5.17-1.34-3.255-1.532-7.084.192-9.383 1.723-2.298 3.446-5.746 4.979-7.469 1.532-1.723 2.681-10.915 2.297-15.51-.382-4.596 1.724-14.937 6.511-17.236 4.787-2.298 0 1.15-.957 4.022-.958 2.872.739 9.575 3.052 10.533 2.309.958 4.416 4.787 6.139 7.469 1.724 2.68 6.128 3.83 7.469 7.084 1.341 3.255.766 7.085 1.532 8.809.766 1.724 2.873 5.554-1.724 7.852-4.595 2.298-6.51 1.148-6.702 3.255-.192 2.107-1.341 4.404-4.595 5.361-3.256.959-6.129 2.816-9.768 3.227-3.638.412-4.404-2.461-6.319-.928-1.914 1.531-3.446 3.064-4.213 4.978-.765 1.915-3.064.766-2.871 1.915.19 1.15 3.254 4.404-.193 3.255-3.446-1.148-6.51-.765-6.319 2.298.193 3.064 4.405 4.214 6.129 4.597 1.722.383 3.063-1.723 5.17-3.065 2.106-1.34.191 1.915 1.34 4.214 1.149 2.298 5.554 2.106 6.128 5.361.575 3.255-.191 5.937 3.256 6.32 3.446.383 7.084-.191 7.468 1.533.382 1.722-4.022-.576-4.213 1.531-.192 2.106 3.829 4.978 4.978 2.872 1.149-2.106 4.022-2.298 4.405-1.531.383.765 0 2.105-1.341 5.361-1.34 3.256-2.681 2.298-3.829 5.936-1.149 3.639-3.064-.191-4.979 1.724s-4.213 5.937-4.597 2.489c-.382-3.446-.382-5.361-2.105-8.042-1.724-2.682-2.489-.575-4.022 1.149-1.532 1.723-4.979 3.447-3.83 4.978C23.362 4.979 24.511 9 26.234 7.85c1.724-1.149 4.405-1.149 4.022.767-.383 1.914 0 2.681.766 3.638.766.958 3.447 2.682 3.447-.766 0-3.447-.384-4.405 2.298-4.788 2.681-.383 5.744-.574 5.554 1.149-.193 1.724.766 1.341 0 4.214-.767 2.873-3.065 3.063-5.554 4.405-2.489 1.34-3.83 3.446-5.936 2.68s-2.299-1.531-2.49-3.638c-.192-2.107-1.341-2.873-2.107-1.915-.765.957.192 4.022-2.68 2.106-2.873-1.914-4.021-5.171-5.553-2.872-1.533 2.297 2.297 6.319-1.724 4.595-4.022-1.723-6.895-3.637-4.788-4.404 2.107-.766 4.214-2.107 2.107-2.873-2.107-.765-6.32.575-7.852-.957C4.212 7.66 0 0 0 0Z\" transform=\"translate(13.926 109.38)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.01-2.141.575-3.829 2.49-1.915C4.405 0 5.553 2.298 6.895 1.341c1.34-.958 3.638-.703 4.594-.639.959.064 1.15 2.937 3.831 2.554s1.724.574 4.596 2.107c2.873 1.532 9.001 4.212 2.681 3.446-6.32-.766-6.703.958-11.108-1.914-4.403-2.873-5.36-2.873-6.509-3.639-1.149-.766-2.49 2.298-4.022 0C-.575.958.011 2.182 0 0\" transform=\"translate(36.522 130.061)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.01-2.141.575-3.829 2.49-1.915C4.405 0 5.553 2.298 6.895 1.341c1.34-.958 3.638-.703 4.594-.639.959.064 1.15 2.937 3.831 2.554s1.724.574 4.596 2.107c2.873 1.532 9.001 4.212 2.681 3.446-6.32-.766-6.703.958-11.108-1.914-4.403-2.873-5.36-2.873-6.509-3.639-1.149-.766-2.49 2.298-4.022 0C-.575.958.011 2.182 0 0Z\" transform=\"translate(36.522 130.061)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-2.263-1.956-5.744-4.788-3.064-4.788 2.681 0 3.983 1.404 5.439-.447 1.456-1.85.88-4.723.88-6.063 0-1.341-.766-4.406 1.15-8.235 1.915-3.829 2.106-6.319 4.022-3.829 1.914 2.488 6.51 7.276 8.808 7.658 2.298.384 4.597 1.342 5.746 3.257 1.148 1.915 0 3.773 1.914 5.141 1.914 1.369 1.531 3.093 2.107 5.199C27.575 0 32.747 0 30.448 1.148c-2.297 1.15-6.51 1.916-11.49 1.341C13.979 1.915 4.213 3.638 0 0\" transform=\"translate(59.502 135.998)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-2.263-1.956-5.744-4.788-3.064-4.788 2.681 0 3.983 1.404 5.439-.447 1.456-1.85.88-4.723.88-6.063 0-1.341-.766-4.406 1.15-8.235 1.915-3.829 2.106-6.319 4.022-3.829 1.914 2.488 6.51 7.276 8.808 7.658 2.298.384 4.597 1.342 5.746 3.257 1.148 1.915 0 3.773 1.914 5.141 1.914 1.369 1.531 3.093 2.107 5.199C27.575 0 32.747 0 30.448 1.148c-2.297 1.15-6.51 1.916-11.49 1.341C13.979 1.915 4.213 3.638 0 0Z\" transform=\"translate(59.502 135.998)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.218-1.986-.575-2.107.766-2.49 1.34-.383-.575-2.68.957-2.872 1.532-.193 4.979-1.15 5.936 0 .959 1.148-1.531.7-3.255 1.977C2.682-2.107.865 1.41 0 0\" transform=\"translate(38.438 76.826)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.218-1.986-.575-2.107.766-2.49 1.34-.383-.575-2.68.957-2.872 1.532-.193 4.979-1.15 5.936 0 .959 1.148-1.531.7-3.255 1.977C2.682-2.107.865 1.41 0 0Z\" transform=\"translate(38.438 76.826)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-2.063-1.033-1.148-2.682-3.064-3.831-1.915-1.148-1.149-1.531-1.723-4.213-.575-2.68.191-4.212 1.532-2.106S2.298 1.148 0 0\" transform=\"translate(131.121 45.612)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-2.063-1.033-1.148-2.682-3.064-3.831-1.915-1.148-1.149-1.531-1.723-4.213-.575-2.68.191-4.212 1.532-2.106S2.298 1.148 0 0Z\" transform=\"translate(131.121 45.612)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.575-.575-1.532 2.681-2.106 4.213-.575 1.532-.561 4.195 1.056 5.675C.964 11.734 0 7.469 0 5.17 0 2.873.574.575 0 0m-6.704 5.936c-1.341.766-3.828 0-6.892-.957-3.065-.958-.613 2.131.766 4.213 1.233 1.861.574-.574 3.256-.766 2.68-.192 4.213-3.256 2.87-2.49m-4.402-6.511c-.192-1.531.574-4.021-3.639-3.064-4.213.958-4.213 3.256-5.936 1.533-1.723-1.724-3.83-3.255-6.32-.575C-29.49 0-29.107.766-30.447.958c-.955.135-4.138.846-6.792.074.206.123.426.285.663.5 1.915 1.723 1.532 2.298 3.638 4.213 2.108 1.916 3.639 3.638 5.171 1.916 1.532-1.725 4.788-2.108 3.639-4.023-1.149-1.914-.383-3.063.958-1.914 1.339 1.149 3.255 1.914 1.915 3.446-1.342 1.532-2.682 5.554-.766 2.873 1.915-2.681 2.489-4.022 3.637-5.553C-17.234.958-16.085 0-15.702.958c.383.957-.192 3.063.383 3.446.574.383 0-3.255 1.723-3.446 1.723-.192 2.681 0 2.49-1.533M9.192-8.81c-.574 3.257-4.787 32.747-4.787 32.747s-11.299 7.277-13.213 5.746c-1.916-1.533-5.171-1.302-4.788.21s2.872 1.128-1.341 4.002c-4.212 2.873-4.978 5.362-8.233 1.724-3.257-3.639-4.022-6.703-5.937-7.661-1.915-.957-3.447-4.021-1.34-4.787 2.106-.765 2.298 0 4.02-1.531 1.725-1.533 4.023-1.149 4.406-.193.383.959.766 4.022.957 5.171.192 1.149 2.138 4.979 1.93 1.915-.207-3.064 2.665-3.064.75-5.17-1.914-2.106-.765-3.831-4.595-4.214-3.831-.382-4.022 1.915-6.128.766-2.107-1.148-1.915-1.915-2.681-3.063-.766-1.149-4.788-3.447-4.788-3.447s-3.255 1.149-1.724-.958c1.533-2.106 2.873-4.595 1.533-4.786-1.341-.192-4.98 1.914-4.98-.384s-.573-4.787.959-5.362c1.081-.405 1.783-1.284 2.775-1.161-.769-.332-1.468-.813-2.009-1.52-1.491-1.947-.575-5.362-3.639-6.511-3.063-1.15-3.063-2.489-3.639-4.979-.573-2.489 0-8.808.766-9.383.765-.574 2.107-5.362 5.363-4.978 3.256.383 6.702.53 7.851-.023 1.149-.551 3.063 1.171 3.638-3.233.575-4.404 1.915-4.979 2.681-7.277.766-2.297-.383-7.086 0-9.958s3.064-7.852 3.064-10.341c0-2.489 2.873-3.638 4.405-2.681 1.532.958 4.787 2.873 6.127 5.937 1.342 3.063 1.342 4.595 3.447 8.617 2.106 4.021 1.533 6.894 2.489 9.958.958 3.064 3.262 5.171 6.419 8.617 3.156 3.446 2.588 5.362 0 5.171-2.588-.191-4.314 2.297-5.654 5.361-1.338 3.065-2.87 10.724-1.721 8.235 1.149-2.491 3.446-9.384 5.744-10.533 2.298-1.149 6.512 1.953 7.469 3.083.957 1.131.574 4.385-1.916 5.726C.383-8.617 1.915-7.469 4.405-9c2.489-1.532 5.362-3.064 4.787.19\" transform=\"translate(132.845 86.592)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.575-.575-1.532 2.681-2.106 4.213-.575 1.532-.561 4.195 1.056 5.675C.964 11.734 0 7.469 0 5.17 0 2.873.574.575 0 0Zm-6.704 5.936c-1.341.766-3.828 0-6.892-.957-3.065-.958-.613 2.131.766 4.213 1.233 1.861.574-.574 3.256-.766 2.68-.192 4.213-3.256 2.87-2.49zm-4.402-6.511c-.192-1.531.574-4.021-3.639-3.064-4.213.958-4.213 3.256-5.936 1.533-1.723-1.724-3.83-3.255-6.32-.575C-29.49 0-29.107.766-30.447.958c-.955.135-4.138.846-6.792.074.206.123.426.285.663.5 1.915 1.723 1.532 2.298 3.638 4.213 2.108 1.916 3.639 3.638 5.171 1.916 1.532-1.725 4.788-2.108 3.639-4.023-1.149-1.914-.383-3.063.958-1.914 1.339 1.149 3.255 1.914 1.915 3.446-1.342 1.532-2.682 5.554-.766 2.873 1.915-2.681 2.489-4.022 3.637-5.553C-17.234.958-16.085 0-15.702.958c.383.957-.192 3.063.383 3.446.574.383 0-3.255 1.723-3.446 1.723-.192 2.681 0 2.49-1.533zM9.192-8.81c-.574 3.257-4.787 32.747-4.787 32.747s-11.299 7.277-13.213 5.746c-1.916-1.533-5.171-1.302-4.788.21s2.872 1.128-1.341 4.002c-4.212 2.873-4.978 5.362-8.233 1.724-3.257-3.639-4.022-6.703-5.937-7.661-1.915-.957-3.447-4.021-1.34-4.787 2.106-.765 2.298 0 4.02-1.531 1.725-1.533 4.023-1.149 4.406-.193.383.959.766 4.022.957 5.171.192 1.149 2.138 4.979 1.93 1.915-.207-3.064 2.665-3.064.75-5.17-1.914-2.106-.765-3.831-4.595-4.214-3.831-.382-4.022 1.915-6.128.766-2.107-1.148-1.915-1.915-2.681-3.063-.766-1.149-4.788-3.447-4.788-3.447s-3.255 1.149-1.724-.958c1.533-2.106 2.873-4.595 1.533-4.786-1.341-.192-4.98 1.914-4.98-.384s-.573-4.787.959-5.362c1.081-.405 1.783-1.284 2.775-1.161-.769-.332-1.468-.813-2.009-1.52-1.491-1.947-.575-5.362-3.639-6.511-3.063-1.15-3.063-2.489-3.639-4.979-.573-2.489 0-8.808.766-9.383.765-.574 2.107-5.362 5.363-4.978 3.256.383 6.702.53 7.851-.023 1.149-.551 3.063 1.171 3.638-3.233.575-4.404 1.915-4.979 2.681-7.277.766-2.297-.383-7.086 0-9.958s3.064-7.852 3.064-10.341c0-2.489 2.873-3.638 4.405-2.681 1.532.958 4.787 2.873 6.127 5.937 1.342 3.063 1.342 4.595 3.447 8.617 2.106 4.021 1.533 6.894 2.489 9.958.958 3.064 3.262 5.171 6.419 8.617 3.156 3.446 2.588 5.362 0 5.171-2.588-.191-4.314 2.297-5.654 5.361-1.338 3.065-2.87 10.724-1.721 8.235 1.149-2.491 3.446-9.384 5.744-10.533 2.298-1.149 6.512 1.953 7.469 3.083.957 1.131.574 4.385-1.916 5.726C.383-8.617 1.915-7.469 4.405-9c2.489-1.532 5.362-3.064 4.787.19z\" transform=\"translate(132.845 86.592)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.173-.353-2.106-2.681-1.532-3.831.576-1.148-.574.576-2.106-.382-1.533-.957-3.808-3.639-1.713-3.829 2.096-.193 1.713 1.531 3.628.765 1.915-.765 4.021-.575 4.021 1.34C2.298-4.021 1.915.574 0 0\" transform=\"translate(95.886 109.955)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.173-.353-2.106-2.681-1.532-3.831.576-1.148-.574.576-2.106-.382-1.533-.957-3.808-3.639-1.713-3.829 2.096-.193 1.713 1.531 3.628.765 1.915-.765 4.021-.575 4.021 1.34C2.298-4.021 1.915.574 0 0Z\" transform=\"translate(95.886 109.955)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.154-.165-1.533-3.064.957-3.447 2.49-.383 6.947.575 5.293 2.107C4.596.191 2.682.383 0 0\" transform=\"translate(83.44 118.763)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.154-.165-1.533-3.064.957-3.447 2.49-.383 6.947.575 5.293 2.107C4.596.191 2.682.383 0 0Z\" transform=\"translate(83.44 118.763)\"/>\n </g>\n <g clip-path=\"url(#b)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c0-37.068-30.05-67.119-67.119-67.119S-134.238-37.068-134.238 0c0 37.069 30.05 67.119 67.119 67.119S0 37.069 0 0Z\" transform=\"translate(139.738 74.049)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c0-36.731-29.777-66.509-66.509-66.509S-133.019-36.731-133.019 0c0 36.733 29.778 66.51 66.51 66.51C-29.777 66.51 0 36.733 0 0Z\" transform=\"translate(139.438 73.186)\"/>\n </g>\n <g clip-path=\"url(#c)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0m12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754\" transform=\"translate(119.64 109.307)\"/>\n <path style=\"fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0m12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754\" transform=\"translate(119.64 109.307)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0Zm12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754z\" transform=\"translate(119.64 109.307)\"/>\n </g>\n</svg>\n";
|
|
609
|
-
var minimizeIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M6 19h12v2H6v-2z"/></svg>';
|
|
610
|
-
var editIconUrl = URL.createObjectURL(new Blob([iconEdit], {
|
|
611
|
-
type: 'image/svg+xml'
|
|
612
|
-
}));
|
|
613
|
-
var i18nextIconUrl = URL.createObjectURL(new Blob([i18nextIcon], {
|
|
614
|
-
type: 'image/svg+xml'
|
|
615
|
-
}));
|
|
616
|
-
var minimizeIconUrl = URL.createObjectURL(new Blob([minimizeIcon], {
|
|
617
|
-
type: 'image/svg+xml'
|
|
618
|
-
}));
|
|
619
|
-
var locizeIconUrl = URL.createObjectURL(new Blob([locizeIcon], {
|
|
620
|
-
type: 'image/svg+xml'
|
|
621
|
-
}));
|
|
622
|
-
function EditIcon() {
|
|
623
|
-
var image = document.createElement('img');
|
|
624
|
-
image.setAttribute('data-i18next-editor-element', 'true');
|
|
625
|
-
image.src = editIconUrl;
|
|
626
|
-
image.style.width = '15px';
|
|
627
|
-
return image;
|
|
628
|
-
}
|
|
629
|
-
function RibbonLogo() {
|
|
630
|
-
var circleSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '18px';
|
|
631
|
-
var logoSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '15px';
|
|
632
|
-
var ribbon = document.createElement('div');
|
|
633
|
-
ribbon.setAttribute('data-i18next-editor-element', 'true');
|
|
634
|
-
ribbon.style = "display: inline-flex; align-items: center; justify-content: center; width: ".concat(circleSize, "; height: ").concat(circleSize, "; box-shadow: inset 0 0 5px ").concat(colors.highlight, "; border: 2px solid ").concat(colors.highlight, "; border-radius: 50%");
|
|
635
|
-
var image = document.createElement('img');
|
|
636
|
-
image.src = i18nextIconUrl;
|
|
637
|
-
image.style.width = logoSize;
|
|
638
|
-
ribbon.appendChild(image);
|
|
639
|
-
return ribbon;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
944
|
if (sheet) {
|
|
643
945
|
sheet.insertRule('.i18next-editor-button:hover { background-color: rgba(38, 166, 154, 1) !important; }');
|
|
644
946
|
}
|
|
@@ -1262,7 +1564,7 @@
|
|
|
1262
1564
|
* object may be passed.
|
|
1263
1565
|
* @see https://floating-ui.com/docs/offset
|
|
1264
1566
|
*/
|
|
1265
|
-
const offset
|
|
1567
|
+
const offset = function (options) {
|
|
1266
1568
|
if (options === void 0) {
|
|
1267
1569
|
options = 0;
|
|
1268
1570
|
}
|
|
@@ -1367,7 +1669,7 @@
|
|
|
1367
1669
|
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
1368
1670
|
return '#document';
|
|
1369
1671
|
}
|
|
1370
|
-
function getWindow
|
|
1672
|
+
function getWindow(node) {
|
|
1371
1673
|
var _node$ownerDocument;
|
|
1372
1674
|
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
1373
1675
|
}
|
|
@@ -1376,20 +1678,20 @@
|
|
|
1376
1678
|
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
1377
1679
|
}
|
|
1378
1680
|
function isNode(value) {
|
|
1379
|
-
return value instanceof Node || value instanceof getWindow
|
|
1681
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
1380
1682
|
}
|
|
1381
1683
|
function isElement(value) {
|
|
1382
|
-
return value instanceof Element || value instanceof getWindow
|
|
1684
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
1383
1685
|
}
|
|
1384
1686
|
function isHTMLElement(value) {
|
|
1385
|
-
return value instanceof HTMLElement || value instanceof getWindow
|
|
1687
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
1386
1688
|
}
|
|
1387
1689
|
function isShadowRoot(value) {
|
|
1388
1690
|
// Browsers without `ShadowRoot` support.
|
|
1389
1691
|
if (typeof ShadowRoot === 'undefined') {
|
|
1390
1692
|
return false;
|
|
1391
1693
|
}
|
|
1392
|
-
return value instanceof ShadowRoot || value instanceof getWindow
|
|
1694
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
1393
1695
|
}
|
|
1394
1696
|
function isOverflowElement(element) {
|
|
1395
1697
|
const {
|
|
@@ -1429,7 +1731,7 @@
|
|
|
1429
1731
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
1430
1732
|
}
|
|
1431
1733
|
function getComputedStyle(element) {
|
|
1432
|
-
return getWindow
|
|
1734
|
+
return getWindow(element).getComputedStyle(element);
|
|
1433
1735
|
}
|
|
1434
1736
|
function getNodeScroll(element) {
|
|
1435
1737
|
if (isElement(element)) {
|
|
@@ -1478,7 +1780,7 @@
|
|
|
1478
1780
|
}
|
|
1479
1781
|
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1480
1782
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1481
|
-
const win = getWindow
|
|
1783
|
+
const win = getWindow(scrollableAncestor);
|
|
1482
1784
|
if (isBody) {
|
|
1483
1785
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
1484
1786
|
}
|
|
@@ -1540,7 +1842,7 @@
|
|
|
1540
1842
|
|
|
1541
1843
|
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
1542
1844
|
function getVisualOffsets(element) {
|
|
1543
|
-
const win = getWindow
|
|
1845
|
+
const win = getWindow(element);
|
|
1544
1846
|
if (!isWebKit() || !win.visualViewport) {
|
|
1545
1847
|
return noOffsets;
|
|
1546
1848
|
}
|
|
@@ -1553,7 +1855,7 @@
|
|
|
1553
1855
|
if (isFixed === void 0) {
|
|
1554
1856
|
isFixed = false;
|
|
1555
1857
|
}
|
|
1556
|
-
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow
|
|
1858
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
1557
1859
|
return false;
|
|
1558
1860
|
}
|
|
1559
1861
|
return isFixed;
|
|
@@ -1584,8 +1886,8 @@
|
|
|
1584
1886
|
let width = clientRect.width / scale.x;
|
|
1585
1887
|
let height = clientRect.height / scale.y;
|
|
1586
1888
|
if (domElement) {
|
|
1587
|
-
const win = getWindow
|
|
1588
|
-
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow
|
|
1889
|
+
const win = getWindow(domElement);
|
|
1890
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1589
1891
|
let currentIFrame = win.frameElement;
|
|
1590
1892
|
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
1591
1893
|
const iframeScale = getScale(currentIFrame);
|
|
@@ -1599,7 +1901,7 @@
|
|
|
1599
1901
|
height *= iframeScale.y;
|
|
1600
1902
|
x += left;
|
|
1601
1903
|
y += top;
|
|
1602
|
-
currentIFrame = getWindow
|
|
1904
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
1603
1905
|
}
|
|
1604
1906
|
}
|
|
1605
1907
|
return rectToClientRect({
|
|
@@ -1678,7 +1980,7 @@
|
|
|
1678
1980
|
}
|
|
1679
1981
|
|
|
1680
1982
|
function getViewportRect(element, strategy) {
|
|
1681
|
-
const win = getWindow
|
|
1983
|
+
const win = getWindow(element);
|
|
1682
1984
|
const html = getDocumentElement(element);
|
|
1683
1985
|
const visualViewport = win.visualViewport;
|
|
1684
1986
|
let width = html.clientWidth;
|
|
@@ -1854,7 +2156,7 @@
|
|
|
1854
2156
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1855
2157
|
// such as table ancestors and cross browser bugs.
|
|
1856
2158
|
function getOffsetParent(element, polyfill) {
|
|
1857
|
-
const window = getWindow
|
|
2159
|
+
const window = getWindow(element);
|
|
1858
2160
|
if (!isHTMLElement(element)) {
|
|
1859
2161
|
return window;
|
|
1860
2162
|
}
|
|
@@ -1974,7 +2276,7 @@
|
|
|
1974
2276
|
placement: 'right',
|
|
1975
2277
|
middleware: [flip({
|
|
1976
2278
|
fallbackPlacements: ['left', 'bottom']
|
|
1977
|
-
}), shift(), offset
|
|
2279
|
+
}), shift(), offset(function (_ref) {
|
|
1978
2280
|
var placement = _ref.placement,
|
|
1979
2281
|
rects = _ref.rects;
|
|
1980
2282
|
if (placement === 'bottom') return rects.r;
|
|
@@ -2077,43 +2379,6 @@
|
|
|
2077
2379
|
delete selected[id];
|
|
2078
2380
|
}
|
|
2079
2381
|
|
|
2080
|
-
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2081
|
-
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2082
|
-
var data$1 = {};
|
|
2083
|
-
function clean$1() {
|
|
2084
|
-
Object.values(data$1).forEach(function (item) {
|
|
2085
|
-
if (!document.body.contains(item.node)) {
|
|
2086
|
-
resetHighlight(item.id, item.node);
|
|
2087
|
-
delete data$1[item.id];
|
|
2088
|
-
}
|
|
2089
|
-
});
|
|
2090
|
-
}
|
|
2091
|
-
function save$1(id, subliminal, type, meta, node, children) {
|
|
2092
|
-
if (!id || !type || !meta || !node) return;
|
|
2093
|
-
if (!data$1[id]) {
|
|
2094
|
-
data$1[id] = {
|
|
2095
|
-
id: id,
|
|
2096
|
-
node: node,
|
|
2097
|
-
subliminal: subliminal
|
|
2098
|
-
};
|
|
2099
|
-
}
|
|
2100
|
-
data$1[id].keys = _objectSpread$5(_objectSpread$5({}, data$1[id].keys), {}, _defineProperty({}, "".concat(type), meta));
|
|
2101
|
-
if (children) {
|
|
2102
|
-
data$1[id].children = _objectSpread$5(_objectSpread$5({}, data$1[id].children), {}, _defineProperty({}, "".concat(type, "-").concat(children.map(function (c) {
|
|
2103
|
-
return c.childIndex;
|
|
2104
|
-
}).join(',')), children));
|
|
2105
|
-
}
|
|
2106
|
-
}
|
|
2107
|
-
function get$1(id) {
|
|
2108
|
-
return data$1[id];
|
|
2109
|
-
}
|
|
2110
|
-
var store = {
|
|
2111
|
-
save: save$1,
|
|
2112
|
-
clean: clean$1,
|
|
2113
|
-
get: get$1,
|
|
2114
|
-
data: data$1
|
|
2115
|
-
};
|
|
2116
|
-
|
|
2117
2382
|
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2118
2383
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2119
2384
|
var data = {};
|
|
@@ -2125,20 +2390,26 @@
|
|
|
2125
2390
|
}
|
|
2126
2391
|
});
|
|
2127
2392
|
}
|
|
2128
|
-
function save(id, type, node) {
|
|
2129
|
-
if (!id || !type || !node) return;
|
|
2393
|
+
function save(id, subliminal, type, meta, node, children) {
|
|
2394
|
+
if (!id || !type || !meta || !node) return;
|
|
2130
2395
|
if (!data[id]) {
|
|
2131
2396
|
data[id] = {
|
|
2132
2397
|
id: id,
|
|
2133
|
-
node: node
|
|
2398
|
+
node: node,
|
|
2399
|
+
subliminal: subliminal
|
|
2134
2400
|
};
|
|
2135
2401
|
}
|
|
2136
|
-
data[id].keys = _objectSpread$4(_objectSpread$4({}, data[id].keys), {}, _defineProperty({}, "".concat(type),
|
|
2402
|
+
data[id].keys = _objectSpread$4(_objectSpread$4({}, data[id].keys), {}, _defineProperty({}, "".concat(type), meta));
|
|
2403
|
+
if (children) {
|
|
2404
|
+
data[id].children = _objectSpread$4(_objectSpread$4({}, data[id].children), {}, _defineProperty({}, "".concat(type, "-").concat(children.map(function (c) {
|
|
2405
|
+
return c.childIndex;
|
|
2406
|
+
}).join(',')), children));
|
|
2407
|
+
}
|
|
2137
2408
|
}
|
|
2138
2409
|
function get(id) {
|
|
2139
2410
|
return data[id];
|
|
2140
2411
|
}
|
|
2141
|
-
var
|
|
2412
|
+
var store = {
|
|
2142
2413
|
save: save,
|
|
2143
2414
|
clean: clean,
|
|
2144
2415
|
get: get,
|
|
@@ -2196,218 +2467,88 @@
|
|
|
2196
2467
|
var invisibleMeta = meta.invisibleMeta,
|
|
2197
2468
|
text = meta.text;
|
|
2198
2469
|
if (!invisibleMeta || !invisibleMeta.key || !invisibleMeta.ns) return;
|
|
2199
|
-
if (!currentSourceLng) currentSourceLng = (_i18n = i18n) === null || _i18n === void 0 ? void 0 : _i18n.getSourceLng();
|
|
2200
|
-
return _objectSpread$3(_objectSpread$3({
|
|
2201
|
-
eleUniqueID: id,
|
|
2202
|
-
textType: type,
|
|
2203
|
-
children: children ? children.map(function (c) {
|
|
2204
|
-
return c.childIndex;
|
|
2205
|
-
}).join(',') : null,
|
|
2206
|
-
qualifiedKey: "".concat(invisibleMeta.ns, ":").concat(invisibleMeta.key)
|
|
2207
|
-
}, invisibleMeta), {}, {
|
|
2208
|
-
extractedText: text,
|
|
2209
|
-
i18nTargetLng: (_i18n2 = i18n) === null || _i18n2 === void 0 ? void 0 : _i18n2.getLng(),
|
|
2210
|
-
i18nSourceLng: currentSourceLng,
|
|
2211
|
-
i18nRawText: _defineProperty(_defineProperty({}, "".concat(invisibleMeta.lng), invisibleMeta.source === 'translation' && i18n ? i18n.getResource(invisibleMeta.lng, invisibleMeta.ns, invisibleMeta.key) : null), "".concat(currentSourceLng), invisibleMeta.source === 'translation' && i18n ? i18n.getResource(currentSourceLng, invisibleMeta.ns, invisibleMeta.key) : null)
|
|
2212
|
-
});
|
|
2213
|
-
}
|
|
2214
|
-
function containsOnlySpaces(str) {
|
|
2215
|
-
return /^\s*$/.test(str);
|
|
2216
|
-
}
|
|
2217
|
-
function handleNode(node) {
|
|
2218
|
-
if (node.childNodes && !ignoreMergedEleUniqueIds.includes(node.uniqueID)) {
|
|
2219
|
-
var merge = [];
|
|
2220
|
-
node.childNodes.forEach(function (child, i) {
|
|
2221
|
-
if (merge.length && child.nodeName !== '#text') {
|
|
2222
|
-
ignoreMergedEleUniqueIds.push(child.uniqueID);
|
|
2223
|
-
merge.push({
|
|
2224
|
-
childIndex: i,
|
|
2225
|
-
child: child
|
|
2226
|
-
});
|
|
2227
|
-
}
|
|
2228
|
-
if (child.nodeName !== '#text') return;
|
|
2229
|
-
var txt = child.textContent;
|
|
2230
|
-
if (containsOnlySpaces(txt)) return;
|
|
2231
|
-
var hasHiddenMeta = containsHiddenMeta(txt);
|
|
2232
|
-
var hasHiddenStartMarker = containsHiddenStartMarker(txt);
|
|
2233
|
-
if (hasHiddenStartMarker && hasHiddenMeta) {
|
|
2234
|
-
var meta = unwrap(txt);
|
|
2235
|
-
store.save(node.uniqueID, meta.invisibleMeta, 'text', extractMeta(node.uniqueID, 'text', meta), node);
|
|
2236
|
-
} else if (hasHiddenStartMarker) {
|
|
2237
|
-
merge.push({
|
|
2238
|
-
childIndex: i,
|
|
2239
|
-
child: child,
|
|
2240
|
-
text: txt
|
|
2241
|
-
});
|
|
2242
|
-
} else if (merge.length && !hasHiddenMeta) {
|
|
2243
|
-
merge.push({
|
|
2244
|
-
childIndex: i,
|
|
2245
|
-
child: child,
|
|
2246
|
-
text: txt
|
|
2247
|
-
});
|
|
2248
|
-
} else if (merge.length && hasHiddenMeta) {
|
|
2249
|
-
merge.push({
|
|
2250
|
-
childIndex: i,
|
|
2251
|
-
child: child,
|
|
2252
|
-
text: txt
|
|
2253
|
-
});
|
|
2254
|
-
var _meta = unwrap(merge.reduce(function (mem, item) {
|
|
2255
|
-
return mem + item.text;
|
|
2256
|
-
}, ''));
|
|
2257
|
-
store.save(node.uniqueID, _meta.invisibleMeta, 'html', extractMeta(node.uniqueID, 'html', _meta, merge), node, merge);
|
|
2258
|
-
merge = [];
|
|
2259
|
-
} else if (txt) {
|
|
2260
|
-
uninstrumentedStore.save(node.uniqueID, 'text', node);
|
|
2261
|
-
}
|
|
2262
|
-
});
|
|
2263
|
-
}
|
|
2264
|
-
if (!node.getAttribute) return;
|
|
2265
|
-
validAttributes.forEach(function (attr) {
|
|
2266
|
-
var txt = node.getAttribute(attr);
|
|
2267
|
-
if (containsHiddenMeta(txt)) {
|
|
2268
|
-
var meta = unwrap(txt);
|
|
2269
|
-
store.save(node.uniqueID, meta.invisibleMeta, "attr:".concat(attr), extractMeta(node.uniqueID, "attr:".concat(attr), meta), node);
|
|
2270
|
-
} else if (txt) {
|
|
2271
|
-
uninstrumentedStore.save(node.uniqueID, "attr:".concat(attr), node);
|
|
2272
|
-
}
|
|
2273
|
-
});
|
|
2274
|
-
}
|
|
2275
|
-
function parseTree(node) {
|
|
2276
|
-
currentSourceLng = undefined;
|
|
2277
|
-
walk(node, handleNode);
|
|
2278
|
-
store.clean();
|
|
2279
|
-
ignoreMergedEleUniqueIds = [];
|
|
2280
|
-
return store.data;
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
|
-
function debounce(func, wait, immediate) {
|
|
2284
|
-
var timeout;
|
|
2285
|
-
return function () {
|
|
2286
|
-
var context = this;
|
|
2287
|
-
var args = arguments;
|
|
2288
|
-
var later = function later() {
|
|
2289
|
-
timeout = null;
|
|
2290
|
-
if (!immediate) func.apply(context, args);
|
|
2291
|
-
};
|
|
2292
|
-
var callNow = immediate && !timeout;
|
|
2293
|
-
clearTimeout(timeout);
|
|
2294
|
-
timeout = setTimeout(later, wait);
|
|
2295
|
-
if (callNow) func.apply(context, args);
|
|
2296
|
-
};
|
|
2297
|
-
}
|
|
2298
|
-
function isWindow(obj) {
|
|
2299
|
-
return obj != null && obj === obj.window;
|
|
2300
|
-
}
|
|
2301
|
-
function getWindow(elem) {
|
|
2302
|
-
return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
|
|
2303
|
-
}
|
|
2304
|
-
function offset(elem) {
|
|
2305
|
-
var box = {
|
|
2306
|
-
top: 0,
|
|
2307
|
-
left: 0,
|
|
2308
|
-
right: 0,
|
|
2309
|
-
bottom: 0
|
|
2310
|
-
};
|
|
2311
|
-
var doc = elem && elem.ownerDocument;
|
|
2312
|
-
var docElem = doc && doc.documentElement;
|
|
2313
|
-
if (!docElem) return box;
|
|
2314
|
-
if (_typeof(elem.getBoundingClientRect) !== ("undefined" )) {
|
|
2315
|
-
box = elem.getBoundingClientRect();
|
|
2316
|
-
}
|
|
2317
|
-
var win = getWindow(doc);
|
|
2318
|
-
var top = box.top + win.pageYOffset - docElem.clientTop;
|
|
2319
|
-
var left = box.left + win.pageXOffset - docElem.clientLeft;
|
|
2320
|
-
return {
|
|
2321
|
-
top: top,
|
|
2322
|
-
left: left,
|
|
2323
|
-
right: left + (box.right - box.left),
|
|
2324
|
-
bottom: top + (box.bottom - box.top)
|
|
2325
|
-
};
|
|
2326
|
-
}
|
|
2327
|
-
function getClickedElement(e) {
|
|
2328
|
-
if (e.srcElement && e.srcElement.nodeType === 1 && (e.srcElement.nodeName === 'BUTTON' || e.srcElement.nodeName === 'INPUT')) {
|
|
2329
|
-
if (e.srcElement.getAttribute && e.srcElement.getAttribute('ignorelocizeeditor') === '') {
|
|
2330
|
-
return null;
|
|
2331
|
-
}
|
|
2332
|
-
return e.srcElement;
|
|
2333
|
-
}
|
|
2334
|
-
var el;
|
|
2335
|
-
if (e.originalEvent && e.originalEvent.explicitOriginalTarget) {
|
|
2336
|
-
el = e.originalEvent.explicitOriginalTarget;
|
|
2337
|
-
} else {
|
|
2338
|
-
var parent = e.srcElement;
|
|
2339
|
-
if (parent.getAttribute && parent.getAttribute('ignorelocizeeditor') === '') return null;
|
|
2340
|
-
var left = e.pageX;
|
|
2341
|
-
var top = e.pageY;
|
|
2342
|
-
var topStartsAt = 0;
|
|
2343
|
-
var topBreaksAt;
|
|
2344
|
-
for (var i = 0; i < parent.childNodes.length; i++) {
|
|
2345
|
-
var n = parent.childNodes[i];
|
|
2346
|
-
var nOffset = offset(n);
|
|
2347
|
-
if (n.nodeType === 1 && nOffset.bottom < top) topStartsAt = i + 1;
|
|
2348
|
-
if (!topBreaksAt && nOffset.top + (n.clientHeight || 0) > top) topBreaksAt = i;
|
|
2349
|
-
}
|
|
2350
|
-
if (topStartsAt + 1 > parent.childNodes.length) topStartsAt = parent.childNodes.length - 1;
|
|
2351
|
-
if (!topBreaksAt) topBreaksAt = parent.childNodes.length;
|
|
2352
|
-
for (var y = topStartsAt; y < topBreaksAt; y++) {
|
|
2353
|
-
var _n = parent.childNodes[y];
|
|
2354
|
-
var _nOffset = offset(_n);
|
|
2355
|
-
if (_nOffset.left > left) {
|
|
2356
|
-
break;
|
|
2357
|
-
}
|
|
2358
|
-
if (_n && _n.nodeType !== 8) el = _n;
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
return el;
|
|
2362
|
-
}
|
|
2363
|
-
function getElementText(el) {
|
|
2364
|
-
var str = el.textContent || el.text && el.text.innerText || el.placeholder;
|
|
2365
|
-
if (typeof str !== 'string') return;
|
|
2366
|
-
return str.replace(/\n +/g, '').trim();
|
|
2470
|
+
if (!currentSourceLng) currentSourceLng = (_i18n = i18n) === null || _i18n === void 0 ? void 0 : _i18n.getSourceLng();
|
|
2471
|
+
return _objectSpread$3(_objectSpread$3({
|
|
2472
|
+
eleUniqueID: id,
|
|
2473
|
+
textType: type,
|
|
2474
|
+
children: children ? children.map(function (c) {
|
|
2475
|
+
return c.childIndex;
|
|
2476
|
+
}).join(',') : null,
|
|
2477
|
+
qualifiedKey: "".concat(invisibleMeta.ns, ":").concat(invisibleMeta.key)
|
|
2478
|
+
}, invisibleMeta), {}, {
|
|
2479
|
+
extractedText: text,
|
|
2480
|
+
i18nTargetLng: (_i18n2 = i18n) === null || _i18n2 === void 0 ? void 0 : _i18n2.getLng(),
|
|
2481
|
+
i18nSourceLng: currentSourceLng,
|
|
2482
|
+
i18nRawText: _defineProperty(_defineProperty({}, "".concat(invisibleMeta.lng), invisibleMeta.source === 'translation' && i18n ? i18n.getResource(invisibleMeta.lng, invisibleMeta.ns, invisibleMeta.key) : null), "".concat(currentSourceLng), invisibleMeta.source === 'translation' && i18n ? i18n.getResource(currentSourceLng, invisibleMeta.ns, invisibleMeta.key) : null)
|
|
2483
|
+
});
|
|
2367
2484
|
}
|
|
2368
|
-
function
|
|
2369
|
-
return
|
|
2485
|
+
function containsOnlySpaces(str) {
|
|
2486
|
+
return /^\s*$/.test(str);
|
|
2370
2487
|
}
|
|
2371
|
-
function
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2488
|
+
function handleNode(node) {
|
|
2489
|
+
if (node.childNodes && !ignoreMergedEleUniqueIds.includes(node.uniqueID)) {
|
|
2490
|
+
var merge = [];
|
|
2491
|
+
node.childNodes.forEach(function (child, i) {
|
|
2492
|
+
if (merge.length && child.nodeName !== '#text') {
|
|
2493
|
+
ignoreMergedEleUniqueIds.push(child.uniqueID);
|
|
2494
|
+
merge.push({
|
|
2495
|
+
childIndex: i,
|
|
2496
|
+
child: child
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
if (child.nodeName !== '#text') return;
|
|
2500
|
+
var txt = child.textContent;
|
|
2501
|
+
if (containsOnlySpaces(txt)) return;
|
|
2502
|
+
var hasHiddenMeta = containsHiddenMeta(txt);
|
|
2503
|
+
var hasHiddenStartMarker = containsHiddenStartMarker(txt);
|
|
2504
|
+
if (hasHiddenStartMarker && hasHiddenMeta) {
|
|
2505
|
+
var meta = unwrap(txt);
|
|
2506
|
+
store.save(node.uniqueID, meta.invisibleMeta, 'text', extractMeta(node.uniqueID, 'text', meta), node);
|
|
2507
|
+
} else if (hasHiddenStartMarker) {
|
|
2508
|
+
merge.push({
|
|
2509
|
+
childIndex: i,
|
|
2510
|
+
child: child,
|
|
2511
|
+
text: txt
|
|
2512
|
+
});
|
|
2513
|
+
} else if (merge.length && !hasHiddenMeta) {
|
|
2514
|
+
merge.push({
|
|
2515
|
+
childIndex: i,
|
|
2516
|
+
child: child,
|
|
2517
|
+
text: txt
|
|
2518
|
+
});
|
|
2519
|
+
} else if (merge.length && hasHiddenMeta) {
|
|
2520
|
+
merge.push({
|
|
2521
|
+
childIndex: i,
|
|
2522
|
+
child: child,
|
|
2523
|
+
text: txt
|
|
2524
|
+
});
|
|
2525
|
+
var _meta = unwrap(merge.reduce(function (mem, item) {
|
|
2526
|
+
return mem + item.text;
|
|
2527
|
+
}, ''));
|
|
2528
|
+
store.save(node.uniqueID, _meta.invisibleMeta, 'html', extractMeta(node.uniqueID, 'html', _meta, merge), node, merge);
|
|
2529
|
+
merge = [];
|
|
2530
|
+
} else if (txt) {
|
|
2531
|
+
uninstrumentedStore.save(node.uniqueID, 'text', node);
|
|
2532
|
+
}
|
|
2533
|
+
});
|
|
2376
2534
|
}
|
|
2377
|
-
return
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
if (
|
|
2384
|
-
|
|
2385
|
-
if (!opts) opts = getAttribute(ele, 'data-i18n-options');
|
|
2386
|
-
if (opts) {
|
|
2387
|
-
var jsonData = {};
|
|
2388
|
-
try {
|
|
2389
|
-
jsonData = JSON.parse(opts);
|
|
2390
|
-
} catch (e) {}
|
|
2391
|
-
if (jsonData.ns) found = jsonData.ns;
|
|
2535
|
+
if (!node.getAttribute) return;
|
|
2536
|
+
validAttributes.forEach(function (attr) {
|
|
2537
|
+
var txt = node.getAttribute(attr);
|
|
2538
|
+
if (containsHiddenMeta(txt)) {
|
|
2539
|
+
var meta = unwrap(txt);
|
|
2540
|
+
store.save(node.uniqueID, meta.invisibleMeta, "attr:".concat(attr), extractMeta(node.uniqueID, "attr:".concat(attr), meta), node);
|
|
2541
|
+
} else if (txt) {
|
|
2542
|
+
uninstrumentedStore.save(node.uniqueID, "attr:".concat(attr), node);
|
|
2392
2543
|
}
|
|
2393
|
-
|
|
2394
|
-
if (!found) found = getAttribute(ele, 'data-i18next-ns');
|
|
2395
|
-
if (!found) found = getAttribute(ele, 'i18n-ns');
|
|
2396
|
-
if (!found) found = getAttribute(ele, 'data-i18n-ns');
|
|
2397
|
-
if (!found && ele.parentElement) find(ele.parentElement);
|
|
2398
|
-
};
|
|
2399
|
-
find(el);
|
|
2400
|
-
return found;
|
|
2544
|
+
});
|
|
2401
2545
|
}
|
|
2402
|
-
function
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
if (!results) return null;
|
|
2409
|
-
if (!results[2]) return '';
|
|
2410
|
-
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
2546
|
+
function parseTree(node) {
|
|
2547
|
+
currentSourceLng = undefined;
|
|
2548
|
+
walk(node, handleNode);
|
|
2549
|
+
store.clean();
|
|
2550
|
+
ignoreMergedEleUniqueIds = [];
|
|
2551
|
+
return store.data;
|
|
2411
2552
|
}
|
|
2412
2553
|
|
|
2413
2554
|
var mutationTriggeringElements = {};
|
|
@@ -2510,75 +2651,6 @@
|
|
|
2510
2651
|
};
|
|
2511
2652
|
}
|
|
2512
2653
|
|
|
2513
|
-
function isInViewport(el) {
|
|
2514
|
-
var rect = el.getBoundingClientRect();
|
|
2515
|
-
var windowHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
2516
|
-
var windowWidth = window.innerWidth || document.documentElement.clientWidth;
|
|
2517
|
-
var vertInView = rect.top <= windowHeight && rect.top + rect.height >= 0;
|
|
2518
|
-
var horInView = rect.left <= windowWidth && rect.left + rect.width >= 0;
|
|
2519
|
-
return vertInView && horInView;
|
|
2520
|
-
}
|
|
2521
|
-
function mouseDistanceFromElement(mouseEvent, element) {
|
|
2522
|
-
var $n = element,
|
|
2523
|
-
mX = mouseEvent.pageX,
|
|
2524
|
-
mY = mouseEvent.pageY,
|
|
2525
|
-
from = {
|
|
2526
|
-
x: mX,
|
|
2527
|
-
y: mY
|
|
2528
|
-
},
|
|
2529
|
-
off = $n.getBoundingClientRect(),
|
|
2530
|
-
ny1 = off.top + document.documentElement.scrollTop,
|
|
2531
|
-
ny2 = ny1 + $n.offsetHeight,
|
|
2532
|
-
nx1 = off.left + document.documentElement.scrollLeft,
|
|
2533
|
-
nx2 = nx1 + $n.offsetWidth,
|
|
2534
|
-
maxX1 = Math.max(mX, nx1),
|
|
2535
|
-
minX2 = Math.min(mX, nx2),
|
|
2536
|
-
maxY1 = Math.max(mY, ny1),
|
|
2537
|
-
minY2 = Math.min(mY, ny2),
|
|
2538
|
-
intersectX = minX2 >= maxX1,
|
|
2539
|
-
intersectY = minY2 >= maxY1,
|
|
2540
|
-
to = {
|
|
2541
|
-
x: intersectX ? mX : nx2 < mX ? nx2 : nx1,
|
|
2542
|
-
y: intersectY ? mY : ny2 < mY ? ny2 : ny1
|
|
2543
|
-
},
|
|
2544
|
-
distX = to.x - from.x,
|
|
2545
|
-
distY = to.y - from.y,
|
|
2546
|
-
hypot = Math.pow(Math.pow(distX, 2) + Math.pow(distY, 2), 1 / 2);
|
|
2547
|
-
return Math.floor(hypot);
|
|
2548
|
-
}
|
|
2549
|
-
|
|
2550
|
-
var debouncedUpdateDistance = debounce(function (e, observer) {
|
|
2551
|
-
Object.values(store.data).forEach(function (item) {
|
|
2552
|
-
if (!isInViewport(item.node)) return;
|
|
2553
|
-
var distance = mouseDistanceFromElement(e, item.node);
|
|
2554
|
-
if (distance < 5) {
|
|
2555
|
-
highlight(item, item.node, item.keys);
|
|
2556
|
-
} else if (distance > 5) {
|
|
2557
|
-
var boxDistance = item.ribbonBox ? mouseDistanceFromElement(e, item.ribbonBox) : 1000;
|
|
2558
|
-
if (boxDistance > 10) resetHighlight(item, item.node, item.keys);
|
|
2559
|
-
}
|
|
2560
|
-
});
|
|
2561
|
-
Object.values(uninstrumentedStore.data).forEach(function (item) {
|
|
2562
|
-
if (!isInViewport(item.node)) return;
|
|
2563
|
-
var distance = mouseDistanceFromElement(e, item.node);
|
|
2564
|
-
if (distance < 10) {
|
|
2565
|
-
highlightUninstrumented(item, item.node, item.keys);
|
|
2566
|
-
} else if (distance > 10) {
|
|
2567
|
-
resetHighlight(item, item.node, item.keys);
|
|
2568
|
-
}
|
|
2569
|
-
});
|
|
2570
|
-
}, 50);
|
|
2571
|
-
var currentFC;
|
|
2572
|
-
function startMouseTracking(observer) {
|
|
2573
|
-
currentFC = function handle(e) {
|
|
2574
|
-
debouncedUpdateDistance(e, observer);
|
|
2575
|
-
};
|
|
2576
|
-
document.addEventListener('mousemove', currentFC);
|
|
2577
|
-
}
|
|
2578
|
-
function stopMouseTracking() {
|
|
2579
|
-
document.removeEventListener('mousemove', currentFC);
|
|
2580
|
-
}
|
|
2581
|
-
|
|
2582
2654
|
function initDragElement() {
|
|
2583
2655
|
var pos1 = 0;
|
|
2584
2656
|
var pos2 = 0;
|
|
@@ -2684,77 +2756,6 @@
|
|
|
2684
2756
|
}
|
|
2685
2757
|
}
|
|
2686
2758
|
|
|
2687
|
-
if (sheet) {
|
|
2688
|
-
sheet.insertRule("@keyframes i18next-editor-animate-top { \n from {\n top: calc(100vh + 600px); \n left: calc(100vw + 300px);\n opacity: 0;\n }\n to {\n top: var(--i18next-editor-popup-position-top);\n left: var(--i18next-editor-popup-position-left);\n opacity: 1;\n }\n }");
|
|
2689
|
-
sheet.insertRule("@keyframes i18next-editor-animate-bottom { \n from {\n top: var(--i18next-editor-popup-position-top);\n left: var(--i18next-editor-popup-position-left);\n opacity: 1;\n }\n to {\n top: calc(100vh + 600px); \n left: calc(100vw + 300px);\n opacity: 0;\n }\n }");
|
|
2690
|
-
sheet.insertRule(".i18next-editor-popup * { \n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */\n }");
|
|
2691
|
-
sheet.insertRule(".i18next-editor-popup .resizer-right {\n width: 15px;\n height: 100%;\n background: transparent;\n position: absolute;\n right: -15px;\n bottom: 0;\n cursor: e-resize;\n }");
|
|
2692
|
-
sheet.insertRule(".i18next-editor-popup .resizer-both {\n width: 15px;\n height: 15px;\n background: transparent;\n z-index: 10;\n position: absolute;\n right: -15px;\n bottom: -15px;\n cursor: se-resize;\n }");
|
|
2693
|
-
sheet.insertRule(".i18next-editor-popup .resizer-bottom {\n width: 100%;\n height: 15px;\n background: transparent;\n position: absolute;\n right: 0;\n bottom: -15px;\n cursor: s-resize;\n }");
|
|
2694
|
-
}
|
|
2695
|
-
function Ribbon(popupEle, onMaximize) {
|
|
2696
|
-
var ribbon = document.createElement('div');
|
|
2697
|
-
ribbon.setAttribute('data-i18next-editor-element', 'true');
|
|
2698
|
-
ribbon.style = "\n cursor: pointer;\n position: fixed;\n bottom: 25px;\n right: 25px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n height: 50px;\n background-color: rgba(249, 249, 249, 0.2);\n backdrop-filter: blur(3px);\n box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);\n border-radius: 50%\n ";
|
|
2699
|
-
ribbon.onclick = function () {
|
|
2700
|
-
onMaximize();
|
|
2701
|
-
};
|
|
2702
|
-
var image = document.createElement('img');
|
|
2703
|
-
image.src = locizeIconUrl;
|
|
2704
|
-
image.style.width = '45px';
|
|
2705
|
-
ribbon.appendChild(image);
|
|
2706
|
-
return ribbon;
|
|
2707
|
-
}
|
|
2708
|
-
function Minimize(popupEle, onMinimize) {
|
|
2709
|
-
var image = document.createElement('img');
|
|
2710
|
-
image.setAttribute('data-i18next-editor-element', 'true');
|
|
2711
|
-
image.src = minimizeIconUrl;
|
|
2712
|
-
image.style.width = '24px';
|
|
2713
|
-
image.style.cursor = 'pointer';
|
|
2714
|
-
image.onclick = function () {
|
|
2715
|
-
popupEle.style.setProperty('--i18next-editor-popup-position-top', popupEle.style.top);
|
|
2716
|
-
popupEle.style.setProperty('--i18next-editor-popup-position-left', popupEle.style.left);
|
|
2717
|
-
popupEle.style.animation = 'i18next-editor-animate-bottom 2s forwards';
|
|
2718
|
-
onMinimize();
|
|
2719
|
-
};
|
|
2720
|
-
return image;
|
|
2721
|
-
}
|
|
2722
|
-
function Popup(url, cb) {
|
|
2723
|
-
var popup = document.createElement('div');
|
|
2724
|
-
popup.setAttribute('id', 'i18next-editor-popup');
|
|
2725
|
-
popup.classList.add('i18next-editor-popup');
|
|
2726
|
-
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 ";
|
|
2727
|
-
popup.setAttribute('data-i18next-editor-element', 'true');
|
|
2728
|
-
var header = document.createElement('div');
|
|
2729
|
-
header.classList.add('i18next-editor-popup-header');
|
|
2730
|
-
header.style = "\n padding: 2px 10px;\n cursor: move;\n z-index: 10;\n backdrop-filter: blur(3px);\n background-color: rgba(200, 200, 200, 0.5);\n background: linear-gradient(0deg, rgba(200, 200, 200, 0.6), rgba(200, 200, 200, 0.5));\n color: #fff;\n text-align: right;\n ";
|
|
2731
|
-
popup.appendChild(header);
|
|
2732
|
-
header.appendChild(Minimize(popup, function () {
|
|
2733
|
-
var ribbon = Ribbon(popup, function () {
|
|
2734
|
-
popup.style.animation = 'i18next-editor-animate-top 1s';
|
|
2735
|
-
startMouseTracking();
|
|
2736
|
-
setTimeout(function () {
|
|
2737
|
-
document.body.removeChild(ribbon);
|
|
2738
|
-
}, 1000);
|
|
2739
|
-
});
|
|
2740
|
-
document.body.appendChild(ribbon);
|
|
2741
|
-
stopMouseTracking();
|
|
2742
|
-
}));
|
|
2743
|
-
var iframe = document.createElement('iframe');
|
|
2744
|
-
iframe.setAttribute('id', 'i18next-editor-iframe');
|
|
2745
|
-
iframe.setAttribute('data-i18next-editor-element', 'true');
|
|
2746
|
-
iframe.style = "\n z-index: 100;\n width: 100%;\n height: calc(100% - 28px);\n border: none;\n background: #fff;\n ";
|
|
2747
|
-
iframe.setAttribute('src', url);
|
|
2748
|
-
iframe.addEventListener('load', cb);
|
|
2749
|
-
popup.appendChild(iframe);
|
|
2750
|
-
var overlay = document.createElement('div');
|
|
2751
|
-
overlay.setAttribute('id', 'i18next-editor-popup-overlay');
|
|
2752
|
-
overlay.setAttribute('data-i18next-editor-element', 'true');
|
|
2753
|
-
overlay.style = "\n display: none;\n position: absolute;\n top: 32px;\n z-index: 101;\n width: 100%;\n height: calc(100% - 32px);\n background-color: rgba(200, 200, 200, 0.5);\n background: linear-gradient(0deg, rgba(240, 240, 240, 0.6), rgba(255, 255, 255, 0.5));\n backdrop-filter: blur(2px);\n";
|
|
2754
|
-
popup.appendChild(overlay);
|
|
2755
|
-
return popup;
|
|
2756
|
-
}
|
|
2757
|
-
|
|
2758
2759
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2759
2760
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2760
2761
|
function start() {
|
|
@@ -2784,11 +2785,13 @@
|
|
|
2784
2785
|
});
|
|
2785
2786
|
observer.start();
|
|
2786
2787
|
startMouseTracking(observer);
|
|
2787
|
-
document.
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2788
|
+
if (!document.getElementById(popupId)) {
|
|
2789
|
+
document.body.append(Popup(getIframeUrl(), function () {
|
|
2790
|
+
api.requestInitialize(config);
|
|
2791
|
+
}));
|
|
2792
|
+
initDragElement();
|
|
2793
|
+
initResizeElement();
|
|
2794
|
+
}
|
|
2792
2795
|
}
|
|
2793
2796
|
if (document.body) return continueToStart();
|
|
2794
2797
|
window.addEventListener('load', function () {
|