kingkont 0.20.58 → 0.20.60
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/package.json +1 -1
- package/renderer/settings.js +31 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kingkont",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.60",
|
|
4
4
|
"description": "KingKont \u00b7 Chatium \u2014 \u043d\u043e\u0434-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u0446\u0435\u043d \u0441 AI-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438/\u0432\u0438\u0434\u0435\u043e/\u0433\u043e\u043b\u043e\u0441/SFX/\u043c\u0443\u0437\u044b\u043a\u0430/\u0442\u0435\u043a\u0441\u0442)",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"bin": {
|
package/renderer/settings.js
CHANGED
|
@@ -608,6 +608,27 @@ function ensureNodeDescriptionEl(node, nodeElHint) {
|
|
|
608
608
|
if (existing) existing.remove();
|
|
609
609
|
return null;
|
|
610
610
|
}
|
|
611
|
+
// Если placeholder спатиально перекрылся бы с bbox'ом другой ноды на
|
|
612
|
+
// холсте — не показываем его. Юзер: «блок описания наезжает на ноду
|
|
613
|
+
// которая лежит выше». Filled-описания показываем всегда — текст важнее.
|
|
614
|
+
if (isPlaceholder && Array.isArray(state?.currentBoard?.metadata?.nodes)) {
|
|
615
|
+
const footerHGuess = 28, descHGuess = 29;
|
|
616
|
+
const descTop = node.y + node.height - footerHGuess - descHGuess - 2;
|
|
617
|
+
const descBot = node.y + node.height;
|
|
618
|
+
const descLeft = node.x;
|
|
619
|
+
const descRight = node.x + (node.width || 280);
|
|
620
|
+
const overlapsOther = state.currentBoard.metadata.nodes.some(m => {
|
|
621
|
+
if (m.id === node.id) return false;
|
|
622
|
+
const mW = m.width || 280, mH = m.height || 200;
|
|
623
|
+
return descLeft < m.x + mW && descRight > m.x
|
|
624
|
+
&& descTop < m.y + mH && descBot > m.y;
|
|
625
|
+
});
|
|
626
|
+
if (overlapsOther) {
|
|
627
|
+
const existing = canvasEl.querySelector(`.node-description-outside[data-desc-for="${node.id}"]`);
|
|
628
|
+
if (existing) existing.remove();
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
611
632
|
const sel = `.node-description-outside[data-desc-for="${node.id}"]`;
|
|
612
633
|
let el = canvasEl.querySelector(sel);
|
|
613
634
|
if (!el) {
|
|
@@ -684,11 +705,16 @@ function fitNodeHeightToMedia(node, nodeEl, mediaEl) {
|
|
|
684
705
|
// Берём актуальную width — node.width если задано, иначе текущий offsetWidth.
|
|
685
706
|
const w = node.width || nodeEl.offsetWidth;
|
|
686
707
|
if (!w) return;
|
|
687
|
-
// Высота описания
|
|
688
|
-
//
|
|
689
|
-
//
|
|
690
|
-
//
|
|
691
|
-
|
|
708
|
+
// Высота описания учитывается ТОЛЬКО когда у ноды есть реальный текст-
|
|
709
|
+
// описание. Для placeholder'а «Добавить описание» bbox не расширяем —
|
|
710
|
+
// иначе нижняя грань ноды лезла бы в соседнюю ноду снизу (юзер: «блок
|
|
711
|
+
// описания все еще наезжает на ноду которая лежит выше»). Placeholder
|
|
712
|
+
// сидит у нижней грани в любом случае, но без расширения — слегка
|
|
713
|
+
// перекрывает картинку, что OK для подсказки.
|
|
714
|
+
const hasRealDesc = !!(node.description && node.description.trim());
|
|
715
|
+
const descEl = hasRealDesc
|
|
716
|
+
? document.querySelector(`.node-description-outside[data-desc-for="${node.id}"]`)
|
|
717
|
+
: null;
|
|
692
718
|
const descH = descEl ? descEl.offsetHeight + 4 : 0; // +4 чтобы зрительно отделять
|
|
693
719
|
const newH = Math.round(w * (natH / natW) + chromeH + descH);
|
|
694
720
|
// 2px tolerance — не шумим в save/connections при суб-пиксельных колебаниях.
|