kingkont 0.20.49 → 0.20.50

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.49",
3
+ "version": "0.20.50",
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/board.js CHANGED
@@ -1671,14 +1671,7 @@ async function openShareModal(p) {
1671
1671
  // там приложение живёт на kingkont.ru. В web используем origin.
1672
1672
  const isLocal = /^https?:\/\/(localhost|127\.0\.0\.1)/.test(location.origin);
1673
1673
  const base = isLocal ? 'https://kingkont.ru' : location.origin;
1674
- // Раньше: /static/web.html но chatium-edge кэширует этот путь
1675
- // НАВЕЧНО, и юзеры получали старую версию HTML со старыми хешами
1676
- // скриптов. Старые cloudProjects.js не имеют R2 pub→worker rewrite
1677
- // → картинки 503 → «Файл не найден».
1678
- // Сейчас: /app/spaces/client/ — auth-aware stub, который JS'ом
1679
- // редиректит на свежий /static/web-<sha>.html (новое имя файла =
1680
- // свежий cache-entry на каждом deploy).
1681
- return base + '/app/spaces/client/#template=' + proj.id;
1674
+ return base + '/static/web.html#template=' + proj.id;
1682
1675
  }
1683
1676
  function render() {
1684
1677
  const isPub = !!proj.isPublic;
@@ -82,16 +82,23 @@
82
82
  // openShareModal живёт в board.js (window.openShareModal). В Electron
83
83
  // share-API'ы (/api/proj/setPublic|share|unshare|shares) проксируются
84
84
  // через server.js → kingkont.ru/proj_*; в web — через web-shim.
85
+ // ↗ Перейти — рядом, только когда проект публичный (state.cloudIsPublic).
86
+ // Юзер: «на проекте если он публичный сделай кнопку перейти (с иконкой,
87
+ // без надписи) справа от кнопки Расшарить».
85
88
  {
86
- let shareBtn = $('shareProjectBtn');
89
+ let row = $('shareProjectRow');
87
90
  const wantShow = logged && state.cloudProjectId && state.cloudMine !== false;
88
- if (wantShow && !shareBtn && saveBtn?.parentNode) {
89
- shareBtn = document.createElement('button');
91
+ if (wantShow && !row && saveBtn?.parentNode) {
92
+ row = document.createElement('div');
93
+ row.id = 'shareProjectRow';
94
+ row.style.cssText = 'display:flex; gap:6px; margin-top:6px; align-items:stretch;';
95
+
96
+ const shareBtn = document.createElement('button');
90
97
  shareBtn.id = 'shareProjectBtn';
91
98
  shareBtn.className = 'kk-edit-only';
92
99
  shareBtn.textContent = '🤝 Расшарить';
93
100
  shareBtn.title = 'Расшарить проект другому юзеру или сделать публичным';
94
- shareBtn.style.cssText = 'margin-top:6px; font-size:12px;';
101
+ shareBtn.style.cssText = 'flex:1; font-size:12px;';
95
102
  shareBtn.addEventListener('click', () => {
96
103
  if (typeof window.openShareModal === 'function') {
97
104
  window.openShareModal({
@@ -102,9 +109,31 @@
102
109
  });
103
110
  }
104
111
  });
105
- saveBtn.parentNode.insertBefore(shareBtn, saveBtn.nextSibling);
112
+ row.appendChild(shareBtn);
113
+
114
+ // ↗ Перейти — иконка, открывает share-URL в новой вкладке.
115
+ // Видна только если проект публичный (по private-проекту ссылка
116
+ // не работает у незалогиненных, и тут смысла нет).
117
+ const gotoBtn = document.createElement('button');
118
+ gotoBtn.id = 'gotoPublicBtn';
119
+ gotoBtn.className = 'kk-edit-only';
120
+ gotoBtn.textContent = '↗';
121
+ gotoBtn.title = 'Открыть публичную страницу проекта в новой вкладке';
122
+ gotoBtn.style.cssText = 'font-size:14px; padding:0 10px;';
123
+ gotoBtn.addEventListener('click', () => {
124
+ const isLocal = /^https?:\/\/(localhost|127\.0\.0\.1)/.test(location.origin);
125
+ const base = isLocal ? 'https://kingkont.ru' : location.origin;
126
+ const url = base + '/static/web.html#template=' + encodeURIComponent(state.cloudProjectId);
127
+ window.open(url, '_blank', 'noopener');
128
+ });
129
+ row.appendChild(gotoBtn);
130
+
131
+ saveBtn.parentNode.insertBefore(row, saveBtn.nextSibling);
106
132
  }
107
- if (shareBtn) shareBtn.style.display = wantShow ? '' : 'none';
133
+ if (row) row.style.display = wantShow ? 'flex' : 'none';
134
+ // Видимость ↗ Перейти зависит от isPublic — обновляем каждый тик.
135
+ const gotoBtn = $('gotoPublicBtn');
136
+ if (gotoBtn) gotoBtn.style.display = (wantShow && state.cloudIsPublic) ? '' : 'none';
108
137
  }
109
138
  }).catch(() => {});
110
139
  }