kingkont 0.20.63 → 0.20.65

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
@@ -45,9 +45,14 @@
45
45
  <input id="sidebarSearch" type="text" placeholder="Поиск…" autocomplete="off">
46
46
  </div>
47
47
 
48
- <div class="sidebar-section kk-edit-only">
49
- <h3>Персонажи <button id="newCharacter" disabled title="Создать персонажа">+</button></h3>
50
- <div class="sidebar-list" id="characterList"></div>
48
+ <!-- Раздел «Персонажи» убран — он будет включён в «Ресурсы» (юзер: «убери
49
+ совсем раздел Персонажи. мы будем его включать в ресурсы»). #newCharacter
50
+ и #characterList оставлены как скрытые stub'ы, чтобы getElementById-
51
+ обращения из board.js (newCharacter listener, refreshCharacters →
52
+ characterList.innerHTML, addEventListener'ы) не падали. -->
53
+ <div style="display:none">
54
+ <button id="newCharacter"></button>
55
+ <div id="characterList"></div>
51
56
  </div>
52
57
 
53
58
  <div class="sidebar-section kk-edit-only">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.20.63",
3
+ "version": "0.20.65",
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": {
@@ -319,9 +319,35 @@
319
319
  if (meta.cloudProjectId === projectId) {
320
320
  state.cloudProjectId = projectId;
321
321
  state.cloudDirty = false;
322
+ // Сбрасываем permission-state в null ("ещё не знаем") —
323
+ // closeProject выставил всё в false, и без этого reset'а
324
+ // кнопка «🤝 Расшарить» осталась бы скрытой (зависит от
325
+ // state.cloudMine !== false). Background-fetch ниже
326
+ // подтянет актуальные значения с сервера.
327
+ state.cloudPermission = null;
328
+ state.cloudMine = null;
329
+ state.cloudCanModify = null;
330
+ state.cloudIsPublic = null;
322
331
  touchCloudOpened(projectId);
323
332
  await openFilm(folderHandle);
324
333
  setCloudButtonsVisibility();
334
+ if (typeof window.renderTemplateOverlay === 'function') window.renderTemplateOverlay();
335
+ // Background — получаем актуальный owner/canModify/isPublic
336
+ // с сервера. Без этого «Расшарить» зависел бы только от
337
+ // initial null (true wantShow), но иконка ↗ (isPublic) не
338
+ // работала бы пока юзер не клик'нет save или подождёт reload.
339
+ fetch('/api/projects/' + encodeURIComponent(projectId))
340
+ .then(r => r.ok ? r.json() : null)
341
+ .then(p => {
342
+ if (!p) return;
343
+ state.cloudPermission = p.permission || (p.mine ? 'owner' : null);
344
+ state.cloudMine = !!p.mine;
345
+ state.cloudCanModify = !!p.canModify;
346
+ state.cloudIsPublic = !!p.isPublic;
347
+ setCloudButtonsVisibility();
348
+ if (typeof window.renderTemplateOverlay === 'function') window.renderTemplateOverlay();
349
+ })
350
+ .catch(() => {});
325
351
  return;
326
352
  }
327
353
  } catch {}