kingkont 0.8.6 → 0.8.7

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
@@ -238,8 +238,6 @@
238
238
  <button data-act="audio">🎙 Сгенерировать голос</button>
239
239
  <button data-act="image">🖼 Сгенерировать картинку</button>
240
240
  <button data-act="video">🎬 Сгенерировать видео</button>
241
- <hr style="margin:4px 0; border:0; border-top:1px solid #333;">
242
- <button data-act="save-template" title="Загрузить эту сцену как шаблон на сервер">💾 Сохранить сцену как шаблон</button>
243
241
  </div>
244
242
 
245
243
  <!-- ===== Settings modal (двойной клик на сгенерированную ноду) ===== -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "KingKont · Chatium — нод-редактор сцен с AI-генерацией (картинки/видео/голос/SFX/музыка/текст)",
5
5
  "main": "main.js",
6
6
  "bin": {
package/renderer/board.js CHANGED
@@ -757,6 +757,21 @@ function showBoardContextMenu(kind, item, clientX, clientY) {
757
757
  selectBoard({ kind, ...item }).then(() => openCharacterSettings()).catch(() => {});
758
758
  });
759
759
  }
760
+ // Сохранение этого board'а как шаблон. saveCurrentBoardAsTemplate
761
+ // работает с state.currentBoard, поэтому сначала открываем нужный
762
+ // board (если он не текущий), а затем запускаем сохранение.
763
+ add('💾 Сохранить как шаблон', async () => {
764
+ try {
765
+ if (!state.currentBoard || state.currentBoard.kind !== kind || state.currentBoard.name !== item.name) {
766
+ await selectBoard({ kind, ...item });
767
+ }
768
+ if (typeof saveCurrentBoardAsTemplate === 'function') {
769
+ await saveCurrentBoardAsTemplate();
770
+ }
771
+ } catch (e) {
772
+ alert('Не удалось сохранить как шаблон: ' + (e?.message || e));
773
+ }
774
+ });
760
775
  add('🗑 Удалить', async () => {
761
776
  if (!confirm(`Удалить «${item.name}»? Папка переедет в _deleted, Cmd+Z восстановит.`)) return;
762
777
  try { await deleteBoard(kind, item.name); }
@@ -158,18 +158,11 @@ document.querySelectorAll('#addMenu button').forEach(btn => {
158
158
  state.addMenuPos = null;
159
159
  return;
160
160
  }
161
- if (act === 'save-template') {
162
- // Сохранение всей сцены как шаблона на Chatium-сервер.
163
- // saveCurrentBoardAsTemplate сам откроет templates-модалку (для
164
- // прогресс-бара) и обновит список после успешного upload'а.
165
- state.addMenuPos = null;
166
- if (typeof saveCurrentBoardAsTemplate === 'function') {
167
- await saveCurrentBoardAsTemplate();
168
- }
169
- return;
170
- }
171
- // save-project-template вынесен на ПКМ 📚 Templates-кнопки
172
- // (см. board.js: showTemplatesButtonContextMenu).
161
+ // save-template actions перенесены:
162
+ // «Сохранить сцену как шаблон» — ПКМ на board-item в sidebar
163
+ // (см. showBoardContextMenu в board.js)
164
+ // «Сохранить проект как шаблон» ПКМ на 📚 Templates-кнопке
165
+ // (см. showTemplatesButtonContextMenu в board.js)
173
166
  if (act === 'gen-text') {
174
167
  // открываем text-gen modal; если есть fromNode — подставляем @ref в промпт
175
168
  if (!await ensureApiKey('text')) return;