kingkont 0.20.59 → 0.20.61

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.20.59",
3
+ "version": "0.20.61",
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": {
@@ -608,11 +608,13 @@ 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;
611
+ // Если description (placeholder ИЛИ filled) спатиально перекрылся бы с
612
+ // bbox'ом другой ноды — не показываем его. Юзер: «блок описания наезжает
613
+ // на ноду которая лежит выше». Текст остаётся в node.description, виден
614
+ // через ПКМ-меню / edit-модалку.
615
+ if (Array.isArray(state?.currentBoard?.metadata?.nodes)) {
616
+ const footerHGuess = 28;
617
+ const descHGuess = isPlaceholder ? 29 : 50; // filled может быть выше
616
618
  const descTop = node.y + node.height - footerHGuess - descHGuess - 2;
617
619
  const descBot = node.y + node.height;
618
620
  const descLeft = node.x;
@@ -705,11 +707,16 @@ function fitNodeHeightToMedia(node, nodeEl, mediaEl) {
705
707
  // Берём актуальную width — node.width если задано, иначе текущий offsetWidth.
706
708
  const w = node.width || nodeEl.offsetWidth;
707
709
  if (!w) return;
708
- // Высота описания (если есть, включая placeholder «Добавить описание»)
709
- // занимает нижнюю часть bboxноды. Без этого описание выходило за
710
- // пределы node.height и «накладывалось» на соседнюю ноду снизу. Юзер:
711
- // «на ноде её описание показывается над нодой которая расположена выше».
712
- const descEl = document.querySelector(`.node-description-outside[data-desc-for="${node.id}"]`);
710
+ // Высота описания учитывается ТОЛЬКО когда у ноды есть реальный текст-
711
+ // описание. Для placeholder«Добавить описание» bbox не расширяем
712
+ // иначе нижняя грань ноды лезла бы в соседнюю ноду снизу (юзер: «блок
713
+ // описания все еще наезжает на ноду которая лежит выше»). Placeholder
714
+ // сидит у нижней грани в любом случае, но без расширения — слегка
715
+ // перекрывает картинку, что OK для подсказки.
716
+ const hasRealDesc = !!(node.description && node.description.trim());
717
+ const descEl = hasRealDesc
718
+ ? document.querySelector(`.node-description-outside[data-desc-for="${node.id}"]`)
719
+ : null;
713
720
  const descH = descEl ? descEl.offsetHeight + 4 : 0; // +4 чтобы зрительно отделять
714
721
  const newH = Math.round(w * (natH / natW) + chromeH + descH);
715
722
  // 2px tolerance — не шумим в save/connections при суб-пиксельных колебаниях.