kingkont 0.14.6 → 0.14.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/package.json +1 -1
- package/renderer/chat.js +11 -3
package/package.json
CHANGED
package/renderer/chat.js
CHANGED
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
},
|
|
100
100
|
|
|
101
101
|
add_node: {
|
|
102
|
-
description: 'Добавить ноду на текущую доску.
|
|
103
|
-
params: '{"type":"image|video|audio|text","subKind":"music|sfx|voice
|
|
104
|
-
async handler({ type, subKind, name, prompt, x, y, text, modelKey, durationMs, aspectRatio }) {
|
|
102
|
+
description: 'Добавить ноду на текущую доску. Типы: image, video, audio, text, label.\n - image/video/audio с prompt → draft, юзер потом запустит generation (или используй generate_node).\n - audio: subKind="music"|"sfx"|"voice" (дефолт voice/TTS).\n - aspectRatio: "16:9"|"9:16"|"1:1"|"3:4"|"4:3"|"21:9" — переопределяет дефолт сцены. Если юзер сказал "горизонтальная"→16:9, "вертикальная"→9:16, "квадрат"→1:1.\n - text: длинный markdown-блок (несколько абзацев). Передай text="...".\n - label: КОРОТКАЯ подпись поверх холста (заголовок, метка). Передай text="..." (1-3 слова обычно). Опционально textStyle={fontSize, fontFamily, italic}.',
|
|
103
|
+
params: '{"type":"image|video|audio|text|label","subKind":"music|sfx|voice","name":"<optional>","prompt":"<for image/video/audio>","x":<optional>,"y":<optional>,"text":"<for text/label>","textStyle":{"fontSize":<12|14|18|24|32|48|64|96>,"italic":<bool>,"fontFamily":"default|pencil|handwritten|brush|marker|display|elegant|rounded|serif|mono"},"modelKey":"<optional>","durationMs":<for music/sfx>,"aspectRatio":"<optional>"}',
|
|
104
|
+
async handler({ type, subKind, name, prompt, x, y, text, textStyle, modelKey, durationMs, aspectRatio }) {
|
|
105
105
|
if (!state.currentBoard) throw new Error('доска не выбрана');
|
|
106
106
|
if (!['image','video','audio','text','label'].includes(type)) throw new Error(`unknown type: ${type}`);
|
|
107
107
|
// Поиск незанятого места: пытаемся справа от последней ноды,
|
|
@@ -149,6 +149,14 @@
|
|
|
149
149
|
node.text = text;
|
|
150
150
|
// .md создастся при saveBoardMetadata.
|
|
151
151
|
}
|
|
152
|
+
if (type === 'label') {
|
|
153
|
+
node.text = (typeof text === 'string' && text.trim()) ? text : 'Подпись';
|
|
154
|
+
// textStyle: дефолт совпадает с UI-добавленной подписью.
|
|
155
|
+
// Юзерские поля переопределяют по одному (не replace целиком).
|
|
156
|
+
const defaultStyle = { fontSize: 32, italic: false, fontFamily: 'pencil' };
|
|
157
|
+
node.textStyle = { ...defaultStyle, ...(textStyle || {}) };
|
|
158
|
+
// Label — auto-size по тексту, width/height не задаём.
|
|
159
|
+
}
|
|
152
160
|
if (prompt && type !== 'text' && type !== 'label') {
|
|
153
161
|
node.status = 'draft';
|
|
154
162
|
node.generated = { rawPrompt: prompt, prompt, modelKey: modelKey || undefined };
|