kingkont 0.7.70 → 0.7.72

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/index.html CHANGED
@@ -32,7 +32,7 @@
32
32
  </div>
33
33
 
34
34
  <div class="sidebar-section">
35
- <h3>Локации <button id="newLocation" disabled title="Создать локацию">+</button></h3>
35
+ <h3>Общее <button id="newLocation" disabled title="Создать общую доску">+</button></h3>
36
36
  <div class="sidebar-list" id="locationList"></div>
37
37
  </div>
38
38
 
@@ -445,7 +445,7 @@
445
445
  <label id="charsPickRow" style="display:none;">Персонажи
446
446
  <div class="picker-chips" id="charsPickChips"></div>
447
447
  </label>
448
- <label id="locPickRow" style="display:none;">Локация
448
+ <label id="locPickRow" style="display:none;">Из общего
449
449
  <select id="locPickSelect"><option value="">— не выбрана —</option></select>
450
450
  </label>
451
451
  <!-- Дефолтные промпты сцены (стек чекбоксов; рендерится динамически) -->
package/main.js CHANGED
@@ -635,7 +635,7 @@ function buildMenu() {
635
635
  click: () => trigger('#newCharacter'),
636
636
  },
637
637
  {
638
- label: 'Новая локация',
638
+ label: 'Новая общая доска',
639
639
  enabled: projectOpen,
640
640
  click: () => trigger('#newLocation'),
641
641
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.7.70",
3
+ "version": "0.7.72",
4
4
  "description": "KingKont · Chatium — нод-редактор сцен с AI-генерацией (картинки/видео/голос/SFX/музыка/текст)",
5
5
  "main": "main.js",
6
6
  "bin": {
package/renderer/board.js CHANGED
@@ -1092,10 +1092,15 @@ function askName(title, placeholder = '', initialValue = '', opts = {}) {
1092
1092
  document.body.append(overlay);
1093
1093
  setTimeout(() => { inp.focus(); inp.select(); }, 30);
1094
1094
  const close = (val) => { overlay.remove(); resolve(val); };
1095
+ // Различаем «отмена» (null) и «пустая строка» (''):
1096
+ // - Cancel button / Esc / mousedown overlay → null
1097
+ // - OK button / Enter → trimmed string (может быть '')
1098
+ // Это нужно для renameNode — юзер может ОЧИСТИТЬ имя, а это
1099
+ // отдельный случай от «передумал».
1095
1100
  cancel.addEventListener('click', () => close(null));
1096
- ok.addEventListener('click', () => close(inp.value.trim() || null));
1101
+ ok.addEventListener('click', () => close(inp.value.trim()));
1097
1102
  inp.addEventListener('keydown', e => {
1098
- if (e.key === 'Enter') { e.preventDefault(); close(inp.value.trim() || null); }
1103
+ if (e.key === 'Enter') { e.preventDefault(); close(inp.value.trim()); }
1099
1104
  if (e.key === 'Escape') { e.preventDefault(); close(null); }
1100
1105
  });
1101
1106
  overlay.addEventListener('mousedown', e => { if (e.target === overlay) close(null); });
@@ -1211,7 +1216,7 @@ $('newLocation').addEventListener('click', async () => {
1211
1216
  vlog('info', 'newLocation click; hasFilm=' + !!state.filmHandle);
1212
1217
  if (!state.filmHandle) { alert('Сначала открой проект (папку).'); return; }
1213
1218
  try {
1214
- const name = await askName('Название локации:', 'например, Кухня');
1219
+ const name = await askName('Название (общее):', 'например, Кухня, Револьвер, Фон…');
1215
1220
  vlog('info', 'newLocation name=' + JSON.stringify(name));
1216
1221
  if (!name) return;
1217
1222
  const root = await state.filmHandle.getDirectoryHandle(LOC_DIR, { create: true });
@@ -1778,7 +1783,7 @@ function showNodeContextMenu(node, clientX, clientY) {
1778
1783
  // Локация: пометить картинку как location sheet
1779
1784
  if (node.type === 'image' && node.file && state.currentBoard?.kind === 'location') {
1780
1785
  const isSheet = state.currentBoard.metadata.location?.sheet === node.file;
1781
- add(isSheet ? '⭐ Это sheet локации' : '⭐ Сделать sheet локации', () => {
1786
+ add(isSheet ? '⭐ Это главная картинка' : '⭐ Сделать главной картинкой', () => {
1782
1787
  if (!state.currentBoard.metadata.location) state.currentBoard.metadata.location = {};
1783
1788
  state.currentBoard.metadata.location.sheet = isSheet ? null : node.file;
1784
1789
  scheduleSave();
@@ -942,7 +942,9 @@ function renderLocPickSelect() {
942
942
  function syncCharLocRows() {
943
943
  const showPicker = (state.genKind === 'image' || state.genKind === 'video');
944
944
  $('charsPickRow').style.display = showPicker ? '' : 'none';
945
- $('locPickRow').style.display = showPicker ? '' : 'none';
945
+ // «Из общего» теперь только для видео — для image юзер берёт референс
946
+ // через @-mention из «Эта сцена»/общих досок (так универсальнее).
947
+ $('locPickRow').style.display = state.genKind === 'video' ? '' : 'none';
946
948
  }
947
949
 
948
950
  // Авто-предвыбор: если открываем доску персонажа/локации — пометим её сразу
package/renderer/media.js CHANGED
@@ -1299,8 +1299,8 @@ function updateMentionPopup() {
1299
1299
  t.className = `mtype ${s.type}`;
1300
1300
  t.textContent = s.scope === 'char' ? 'персонаж'
1301
1301
  : s.scope === 'char-image' ? `персонаж·${s.charName}`
1302
- : s.scope === 'loc' ? 'локация'
1303
- : s.scope === 'loc-image' ? `локация·${s.locName}`
1302
+ : s.scope === 'loc' ? 'общее'
1303
+ : s.scope === 'loc-image' ? `общее·${s.locName}`
1304
1304
  : s.scope === 'scene-folder' ? 'сцена'
1305
1305
  : s.type;
1306
1306
  const nm = document.createElement('span');