@rtsee/presentation 0.0.109 → 0.0.111

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.
Files changed (65) hide show
  1. package/dist/presentation/src/models/RTSeeStory.d.ts +40 -1
  2. package/dist/presentation/src/models/RTSeeStory.d.ts.map +1 -1
  3. package/dist/presentation/src/models/RTSeeStory.js +161 -0
  4. package/dist/presentation/src/models/RTSeeStory.js.map +1 -1
  5. package/dist/presentation/src/models/editor/RTSeeIllustrator.d.ts +59 -0
  6. package/dist/presentation/src/models/editor/RTSeeIllustrator.d.ts.map +1 -0
  7. package/dist/presentation/src/models/editor/RTSeeIllustrator.js +485 -0
  8. package/dist/presentation/src/models/editor/RTSeeIllustrator.js.map +1 -0
  9. package/dist/presentation/src/models/editor/RTSeeInteractiveStoryEditorVm.d.ts +93 -0
  10. package/dist/presentation/src/models/editor/RTSeeInteractiveStoryEditorVm.d.ts.map +1 -0
  11. package/dist/presentation/src/models/editor/RTSeeInteractiveStoryEditorVm.js +521 -0
  12. package/dist/presentation/src/models/editor/RTSeeInteractiveStoryEditorVm.js.map +1 -0
  13. package/dist/presentation/src/models/editor/RTSeeStoryElementsEditor.d.ts +71 -0
  14. package/dist/presentation/src/models/editor/RTSeeStoryElementsEditor.d.ts.map +1 -0
  15. package/dist/presentation/src/models/editor/RTSeeStoryElementsEditor.js +163 -0
  16. package/dist/presentation/src/models/editor/RTSeeStoryElementsEditor.js.map +1 -0
  17. package/dist/presentation/src/models/editor/index.d.ts +4 -0
  18. package/dist/presentation/src/models/editor/index.d.ts.map +1 -0
  19. package/dist/presentation/src/models/editor/index.js +4 -0
  20. package/dist/presentation/src/models/editor/index.js.map +1 -0
  21. package/dist/presentation/src/models/index.d.ts +3 -0
  22. package/dist/presentation/src/models/index.d.ts.map +1 -1
  23. package/dist/presentation/src/models/index.js +3 -0
  24. package/dist/presentation/src/models/index.js.map +1 -1
  25. package/dist/presentation/src/models/manage/RTSeeManageStories.d.ts +3 -0
  26. package/dist/presentation/src/models/manage/RTSeeManageStories.d.ts.map +1 -1
  27. package/dist/presentation/src/models/manage/RTSeeManageStories.js +15 -0
  28. package/dist/presentation/src/models/manage/RTSeeManageStories.js.map +1 -1
  29. package/dist/presentation/src/models/remote-actions/PresentationRemoteActions.d.ts +2 -1
  30. package/dist/presentation/src/models/remote-actions/PresentationRemoteActions.d.ts.map +1 -1
  31. package/dist/presentation/src/models/remote-actions/PresentationRemoteActions.js +3 -0
  32. package/dist/presentation/src/models/remote-actions/PresentationRemoteActions.js.map +1 -1
  33. package/dist/presentation/src/models/remote-actions/StoryElementsRemoteActions.d.ts +44 -0
  34. package/dist/presentation/src/models/remote-actions/StoryElementsRemoteActions.d.ts.map +1 -0
  35. package/dist/presentation/src/models/remote-actions/StoryElementsRemoteActions.js +70 -0
  36. package/dist/presentation/src/models/remote-actions/StoryElementsRemoteActions.js.map +1 -0
  37. package/dist/presentation/src/models/story-elements/RTSeeStoryArtifact.d.ts +11 -0
  38. package/dist/presentation/src/models/story-elements/RTSeeStoryArtifact.d.ts.map +1 -0
  39. package/dist/presentation/src/models/story-elements/RTSeeStoryArtifact.js +12 -0
  40. package/dist/presentation/src/models/story-elements/RTSeeStoryArtifact.js.map +1 -0
  41. package/dist/presentation/src/models/story-elements/RTSeeStoryAuthor.d.ts +14 -0
  42. package/dist/presentation/src/models/story-elements/RTSeeStoryAuthor.d.ts.map +1 -0
  43. package/dist/presentation/src/models/story-elements/RTSeeStoryAuthor.js +44 -0
  44. package/dist/presentation/src/models/story-elements/RTSeeStoryAuthor.js.map +1 -0
  45. package/dist/presentation/src/models/story-elements/RTSeeStoryCharacter.d.ts +11 -0
  46. package/dist/presentation/src/models/story-elements/RTSeeStoryCharacter.d.ts.map +1 -0
  47. package/dist/presentation/src/models/story-elements/RTSeeStoryCharacter.js +12 -0
  48. package/dist/presentation/src/models/story-elements/RTSeeStoryCharacter.js.map +1 -0
  49. package/dist/presentation/src/models/story-elements/RTSeeStoryCrudEntity.d.ts +42 -0
  50. package/dist/presentation/src/models/story-elements/RTSeeStoryCrudEntity.d.ts.map +1 -0
  51. package/dist/presentation/src/models/story-elements/RTSeeStoryCrudEntity.js +106 -0
  52. package/dist/presentation/src/models/story-elements/RTSeeStoryCrudEntity.js.map +1 -0
  53. package/dist/presentation/src/models/story-elements/RTSeeStoryElementEntity.d.ts +18 -0
  54. package/dist/presentation/src/models/story-elements/RTSeeStoryElementEntity.d.ts.map +1 -0
  55. package/dist/presentation/src/models/story-elements/RTSeeStoryElementEntity.js +60 -0
  56. package/dist/presentation/src/models/story-elements/RTSeeStoryElementEntity.js.map +1 -0
  57. package/dist/presentation/src/models/story-elements/RTSeeStoryLocation.d.ts +11 -0
  58. package/dist/presentation/src/models/story-elements/RTSeeStoryLocation.d.ts.map +1 -0
  59. package/dist/presentation/src/models/story-elements/RTSeeStoryLocation.js +12 -0
  60. package/dist/presentation/src/models/story-elements/RTSeeStoryLocation.js.map +1 -0
  61. package/dist/presentation/src/models/story-elements/index.d.ts +7 -0
  62. package/dist/presentation/src/models/story-elements/index.d.ts.map +1 -0
  63. package/dist/presentation/src/models/story-elements/index.js +7 -0
  64. package/dist/presentation/src/models/story-elements/index.js.map +1 -0
  65. package/package.json +2 -2
@@ -0,0 +1,485 @@
1
+ import { EventEmitter } from 'events';
2
+ import { RTSeeIllustratorEvents, } from '@rtsee/common';
3
+ import { RTSeeCore } from '@rtsee/core';
4
+ async function optimizeImageDataUrl(url, maxDimension = 1024, quality = 0.85) {
5
+ if (!url || !url.startsWith('data:image/') || typeof window === 'undefined') {
6
+ return url;
7
+ }
8
+ // Don't touch small images
9
+ if (url.length < 200000) {
10
+ return url;
11
+ }
12
+ return new Promise((resolve) => {
13
+ try {
14
+ const img = new Image();
15
+ img.onload = () => {
16
+ let width = img.naturalWidth || img.width;
17
+ let height = img.naturalHeight || img.height;
18
+ if (!width || !height) {
19
+ resolve(url);
20
+ return;
21
+ }
22
+ if (width > maxDimension || height > maxDimension) {
23
+ if (width > height) {
24
+ height = Math.round((height * maxDimension) / width);
25
+ width = maxDimension;
26
+ }
27
+ else {
28
+ width = Math.round((width * maxDimension) / height);
29
+ height = maxDimension;
30
+ }
31
+ }
32
+ const canvas = document.createElement('canvas');
33
+ canvas.width = width;
34
+ canvas.height = height;
35
+ const ctx = canvas.getContext('2d');
36
+ if (!ctx) {
37
+ resolve(url);
38
+ return;
39
+ }
40
+ ctx.drawImage(img, 0, 0, width, height);
41
+ const compressed = canvas.toDataURL('image/jpeg', quality);
42
+ resolve(compressed);
43
+ };
44
+ img.onerror = () => resolve(url);
45
+ img.src = url;
46
+ }
47
+ catch {
48
+ resolve(url);
49
+ }
50
+ });
51
+ }
52
+ export class RTSeeIllustrator extends EventEmitter {
53
+ prompt = '';
54
+ expanded = false;
55
+ configExpanded = false;
56
+ submitting = false;
57
+ lastGeneratedImageUrl = null;
58
+ reviewingGeneratedImage = false;
59
+ currentGeneratedImageUrl = null;
60
+ iterationPrompt = '';
61
+ generationError = null;
62
+ iterationHistory = [];
63
+ activeChatId = null;
64
+ activeAgentId = null;
65
+ agents = [];
66
+ config = {
67
+ aspectRatio: '1:1',
68
+ style: 'Classic Fairy Tale pixel-art Storybook',
69
+ mood: 'Dreamy & Magical',
70
+ lighting: 'Soft Diffused Storybook Glow',
71
+ negativePrompt: 'modern elements, cars, text, watermark, signature, blurry, low quality, photorealistic plastic, distorted faces, mutated anatomy',
72
+ numberOfImages: 1,
73
+ };
74
+ contextImages = [];
75
+ isBrowser = typeof window !== 'undefined';
76
+ onAgentsResponseBound;
77
+ onAddImageBound;
78
+ onGenStartedBound;
79
+ onGenCompletedBound;
80
+ onGetCurrentImageBound;
81
+ onSetPromptBound;
82
+ onSetImageForReviewBound;
83
+ constructor() {
84
+ super();
85
+ this.init();
86
+ }
87
+ init() {
88
+ if (!this.isBrowser)
89
+ return;
90
+ this.onAgentsResponseBound = (e) => {
91
+ const customEvent = e;
92
+ if (customEvent.detail) {
93
+ this.handleAgentsResponse(customEvent.detail);
94
+ }
95
+ };
96
+ this.onAddImageBound = (e) => {
97
+ const customEvent = e;
98
+ if (customEvent.detail) {
99
+ this.addImageToContext(customEvent.detail);
100
+ }
101
+ };
102
+ this.onGenStartedBound = () => {
103
+ this.submitting = true;
104
+ this.generationError = null;
105
+ this.emit('changed');
106
+ };
107
+ this.onGenCompletedBound = (e) => {
108
+ this.submitting = false;
109
+ const customEvent = e;
110
+ const detail = customEvent.detail;
111
+ if (detail?.imageUrl) {
112
+ this.currentGeneratedImageUrl = detail.imageUrl;
113
+ this.lastGeneratedImageUrl = detail.imageUrl;
114
+ this.iterationHistory.push(detail.imageUrl);
115
+ this.reviewingGeneratedImage = true;
116
+ this.generationError = null;
117
+ this.expanded = true;
118
+ }
119
+ else {
120
+ this.generationError = detail?.error || 'No image returned by model. Please try again.';
121
+ }
122
+ this.emit('changed');
123
+ };
124
+ this.onGetCurrentImageBound = (e) => {
125
+ const customEvent = e;
126
+ const detail = customEvent.detail;
127
+ if (this.reviewingGeneratedImage && this.currentGeneratedImageUrl) {
128
+ // 1. If RTSeeIllustrator is in reviewingGeneratedImage mode, the currently reviewed image should be applied
129
+ const response = {
130
+ isLoaded: true,
131
+ isActive: true,
132
+ reviewingGeneratedImage: true,
133
+ imageUrl: this.currentGeneratedImageUrl,
134
+ requestId: detail?.requestId,
135
+ };
136
+ if (detail?.callback) {
137
+ detail.callback(response);
138
+ }
139
+ else if (this.isBrowser) {
140
+ window.dispatchEvent(new CustomEvent(RTSeeIllustratorEvents.CURRENT_IMAGE_RESPONSE, {
141
+ detail: response,
142
+ }));
143
+ }
144
+ }
145
+ else {
146
+ // 2. If RTSeeIllustrator is not active, it should expand and scroll it into view.
147
+ this.expanded = true;
148
+ this.emit('changed');
149
+ this.emit('scroll-into-view');
150
+ if (this.isBrowser) {
151
+ setTimeout(() => {
152
+ const el = document.querySelector('rtsee-illustrator') ||
153
+ document.querySelector('.rtsee-illustrator-container') ||
154
+ document.querySelector('.rtsee-illustrator');
155
+ if (el) {
156
+ el.scrollIntoView({ behavior: 'smooth', block: 'center' });
157
+ }
158
+ }, 60);
159
+ const response = {
160
+ isLoaded: true,
161
+ isActive: false,
162
+ reviewingGeneratedImage: false,
163
+ imageUrl: null,
164
+ requestId: detail?.requestId,
165
+ };
166
+ if (detail?.callback) {
167
+ detail.callback(response);
168
+ }
169
+ else {
170
+ window.dispatchEvent(new CustomEvent(RTSeeIllustratorEvents.CURRENT_IMAGE_RESPONSE, {
171
+ detail: response,
172
+ }));
173
+ }
174
+ }
175
+ }
176
+ };
177
+ this.onSetPromptBound = (e) => {
178
+ const customEvent = e;
179
+ const prompt = typeof customEvent?.detail === 'string'
180
+ ? customEvent.detail
181
+ : customEvent?.detail?.prompt;
182
+ if (typeof prompt === 'string') {
183
+ this.setPrompt(prompt);
184
+ }
185
+ };
186
+ this.onSetImageForReviewBound = (e) => {
187
+ const customEvent = e;
188
+ const detail = customEvent?.detail;
189
+ const imageUrl = typeof detail === 'string' ? detail : detail?.imageUrl;
190
+ const prompt = typeof detail === 'object' ? detail?.prompt : undefined;
191
+ if (imageUrl) {
192
+ this.setImageForReview(imageUrl, prompt);
193
+ }
194
+ };
195
+ window.addEventListener(RTSeeIllustratorEvents.AGENTS_RESPONSE, this.onAgentsResponseBound);
196
+ window.addEventListener(RTSeeIllustratorEvents.ADD_IMAGE_TO_CONTEXT, this.onAddImageBound);
197
+ window.addEventListener(RTSeeIllustratorEvents.GENERATION_STARTED, this.onGenStartedBound);
198
+ window.addEventListener(RTSeeIllustratorEvents.GENERATION_COMPLETED, this.onGenCompletedBound);
199
+ window.addEventListener(RTSeeIllustratorEvents.GET_CURRENT_IMAGE, this.onGetCurrentImageBound);
200
+ window.addEventListener(RTSeeIllustratorEvents.SET_PROMPT, this.onSetPromptBound);
201
+ window.addEventListener(RTSeeIllustratorEvents.SET_IMAGE_FOR_REVIEW, this.onSetImageForReviewBound);
202
+ // Initial request for agents from any open chat
203
+ this.requestAgents();
204
+ }
205
+ destroy() {
206
+ if (!this.isBrowser)
207
+ return;
208
+ if (this.onAgentsResponseBound) {
209
+ window.removeEventListener(RTSeeIllustratorEvents.AGENTS_RESPONSE, this.onAgentsResponseBound);
210
+ }
211
+ if (this.onAddImageBound) {
212
+ window.removeEventListener(RTSeeIllustratorEvents.ADD_IMAGE_TO_CONTEXT, this.onAddImageBound);
213
+ }
214
+ if (this.onGenStartedBound) {
215
+ window.removeEventListener(RTSeeIllustratorEvents.GENERATION_STARTED, this.onGenStartedBound);
216
+ }
217
+ if (this.onGenCompletedBound) {
218
+ window.removeEventListener(RTSeeIllustratorEvents.GENERATION_COMPLETED, this.onGenCompletedBound);
219
+ }
220
+ if (this.onGetCurrentImageBound) {
221
+ window.removeEventListener(RTSeeIllustratorEvents.GET_CURRENT_IMAGE, this.onGetCurrentImageBound);
222
+ }
223
+ if (this.onSetPromptBound) {
224
+ window.removeEventListener(RTSeeIllustratorEvents.SET_PROMPT, this.onSetPromptBound);
225
+ }
226
+ if (this.onSetImageForReviewBound) {
227
+ window.removeEventListener(RTSeeIllustratorEvents.SET_IMAGE_FOR_REVIEW, this.onSetImageForReviewBound);
228
+ }
229
+ }
230
+ setImageForReview(imageUrl, prompt) {
231
+ if (!imageUrl)
232
+ return;
233
+ this.currentGeneratedImageUrl = imageUrl;
234
+ this.lastGeneratedImageUrl = imageUrl;
235
+ if (!this.iterationHistory.includes(imageUrl)) {
236
+ this.iterationHistory.push(imageUrl);
237
+ }
238
+ this.reviewingGeneratedImage = true;
239
+ this.generationError = null;
240
+ this.expanded = true;
241
+ if (prompt && !this.prompt) {
242
+ this.prompt = prompt;
243
+ }
244
+ this.iterationPrompt = '';
245
+ this.emit('changed');
246
+ this.emit('scroll-into-view');
247
+ if (this.isBrowser) {
248
+ setTimeout(() => {
249
+ const el = document.querySelector('rtsee-illustrator') ||
250
+ document.querySelector('.rtsee-illustrator-container') ||
251
+ document.querySelector('.rtsee-illustrator');
252
+ if (el) {
253
+ el.scrollIntoView({ behavior: 'smooth', block: 'center' });
254
+ }
255
+ }, 60);
256
+ }
257
+ }
258
+ setPrompt(prompt) {
259
+ this.prompt = prompt || '';
260
+ this.reviewingGeneratedImage = false;
261
+ this.currentGeneratedImageUrl = null;
262
+ this.iterationPrompt = '';
263
+ this.expanded = true;
264
+ this.emit('changed');
265
+ }
266
+ requestAgents() {
267
+ if (!this.isBrowser)
268
+ return;
269
+ window.dispatchEvent(new CustomEvent(RTSeeIllustratorEvents.REQUEST_AGENTS));
270
+ }
271
+ handleAgentsResponse(payload) {
272
+ if (payload.chatId) {
273
+ this.activeChatId = payload.chatId;
274
+ }
275
+ if (Array.isArray(payload.agents)) {
276
+ this.agents = payload.agents;
277
+ if (payload.activeAgentId) {
278
+ this.activeAgentId = payload.activeAgentId;
279
+ }
280
+ else if (!this.activeAgentId && this.agents.length > 0) {
281
+ this.activeAgentId = this.agents[0].id;
282
+ }
283
+ }
284
+ this.emit('changed');
285
+ }
286
+ get activeAgent() {
287
+ return this.agents.find((a) => a.id === this.activeAgentId);
288
+ }
289
+ selectAgent(agentId) {
290
+ this.activeAgentId = agentId;
291
+ if (this.isBrowser) {
292
+ window.dispatchEvent(new CustomEvent(RTSeeIllustratorEvents.ACTIVE_AGENT_CHANGED, {
293
+ detail: { agentId, chatId: this.activeChatId },
294
+ }));
295
+ }
296
+ this.emit('changed');
297
+ }
298
+ toggleExpand() {
299
+ this.expanded = !this.expanded;
300
+ this.emit('changed');
301
+ }
302
+ toggleConfig() {
303
+ this.configExpanded = !this.configExpanded;
304
+ this.emit('changed');
305
+ }
306
+ addImageToContext(image) {
307
+ const id = image.id || RTSeeCore.uuidv4();
308
+ const existingIndex = this.contextImages.findIndex((img) => img.id === id || (image.imageUrl && img.imageUrl === image.imageUrl));
309
+ const newImage = {
310
+ id,
311
+ imageUrl: image.imageUrl || '',
312
+ title: image.title || 'Context reference',
313
+ description: image.description || '',
314
+ visualDescription: image.visualDescription || image.description || '',
315
+ sourceType: image.sourceType || 'custom',
316
+ active: image.active !== false,
317
+ };
318
+ if (existingIndex !== -1) {
319
+ this.contextImages[existingIndex] = {
320
+ ...this.contextImages[existingIndex],
321
+ ...newImage,
322
+ active: true,
323
+ };
324
+ }
325
+ else {
326
+ this.contextImages.push(newImage);
327
+ }
328
+ // Auto-expand so the user immediately sees the context item added
329
+ this.expanded = true;
330
+ this.emit('changed');
331
+ }
332
+ removeImageFromContext(id) {
333
+ this.contextImages = this.contextImages.filter((img) => img.id !== id);
334
+ this.emit('changed');
335
+ }
336
+ toggleImageActive(id) {
337
+ const img = this.contextImages.find((item) => item.id === id);
338
+ if (img) {
339
+ img.active = !img.active;
340
+ this.emit('changed');
341
+ }
342
+ }
343
+ updateImageDescription(id, description) {
344
+ const img = this.contextImages.find((item) => item.id === id);
345
+ if (img) {
346
+ img.description = description;
347
+ this.emit('changed');
348
+ }
349
+ }
350
+ updateImageVisualDescription(id, visualDescription) {
351
+ const img = this.contextImages.find((item) => item.id === id);
352
+ if (img) {
353
+ img.visualDescription = visualDescription;
354
+ this.emit('changed');
355
+ }
356
+ }
357
+ clearContext() {
358
+ this.contextImages = [];
359
+ this.emit('changed');
360
+ }
361
+ removeContextImage(id) {
362
+ this.removeImageFromContext(id);
363
+ }
364
+ get canSubmit() {
365
+ if (this.submitting)
366
+ return false;
367
+ if (this.reviewingGeneratedImage) {
368
+ return !!(this.iterationPrompt.trim() || this.prompt.trim());
369
+ }
370
+ return !!this.prompt.trim();
371
+ }
372
+ get activeContextImages() {
373
+ return this.contextImages.filter((img) => img.active !== false);
374
+ }
375
+ discardGeneratedImage() {
376
+ this.reviewingGeneratedImage = false;
377
+ this.currentGeneratedImageUrl = null;
378
+ this.iterationPrompt = '';
379
+ this.generationError = null;
380
+ this.emit('changed');
381
+ }
382
+ acceptGeneratedImage() {
383
+ if (this.currentGeneratedImageUrl) {
384
+ this.addImageToContext({
385
+ imageUrl: this.currentGeneratedImageUrl,
386
+ title: 'Story Illustration',
387
+ description: this.prompt,
388
+ visualDescription: this.prompt,
389
+ sourceType: 'custom',
390
+ active: true,
391
+ });
392
+ }
393
+ this.reviewingGeneratedImage = false;
394
+ this.currentGeneratedImageUrl = null;
395
+ this.iterationPrompt = '';
396
+ this.generationError = null;
397
+ this.emit('changed');
398
+ }
399
+ async submitIteration() {
400
+ if (!this.currentGeneratedImageUrl) {
401
+ return;
402
+ }
403
+ const changeRequest = this.iterationPrompt.trim() || this.prompt.trim();
404
+ if (!changeRequest) {
405
+ return;
406
+ }
407
+ if (!this.activeAgentId) {
408
+ if (this.agents.length > 0) {
409
+ this.activeAgentId = this.agents[0].id;
410
+ }
411
+ else {
412
+ this.requestAgents();
413
+ }
414
+ }
415
+ this.submitting = true;
416
+ this.generationError = null;
417
+ this.emit('changed');
418
+ // Optimize/compress image if it is an oversized data URL (and ignore default placeholder images)
419
+ const isCurrentDefault = this.currentGeneratedImageUrl ? this.currentGeneratedImageUrl.toLowerCase().includes('default') : false;
420
+ const optimizedImageUrl = isCurrentDefault ? '' : await optimizeImageDataUrl(this.currentGeneratedImageUrl);
421
+ // Build the iteration base context image representing the current draft
422
+ const iterationBaseImage = {
423
+ id: 'iter-base-' + RTSeeCore.uuidv4(),
424
+ imageUrl: optimizedImageUrl,
425
+ title: 'Current Draft (To Iterate Upon)',
426
+ description: `Original base scene: ${this.prompt}`,
427
+ visualDescription: `Base illustration generated in previous step. Modify this visual according to the revision instructions while preserving core visual style and composition. Requested modifications: ${changeRequest}`,
428
+ sourceType: 'iteration-base',
429
+ active: true,
430
+ };
431
+ // Send all other context pictures alongside the image meant to be iterated upon
432
+ const allContextImages = [
433
+ ...this.contextImages.map((img) => ({ ...img })),
434
+ iterationBaseImage,
435
+ ];
436
+ const iterationPromptText = `Modify and refine the current draft illustration. Requested changes: "${changeRequest}". Maintain visual continuity with the story characters, locations, and artifacts referenced in the context. Original scene description: "${this.prompt}".`;
437
+ const payload = {
438
+ chatId: this.activeChatId || undefined,
439
+ agentId: this.activeAgentId || '',
440
+ prompt: iterationPromptText,
441
+ config: { ...this.config },
442
+ contextImages: allContextImages,
443
+ isIteration: true,
444
+ baseImageUrl: optimizedImageUrl,
445
+ };
446
+ if (this.isBrowser) {
447
+ window.dispatchEvent(new CustomEvent(RTSeeIllustratorEvents.SUBMIT_PROMPT, {
448
+ detail: payload,
449
+ }));
450
+ }
451
+ }
452
+ submitPrompt() {
453
+ if (this.reviewingGeneratedImage) {
454
+ void this.submitIteration();
455
+ return;
456
+ }
457
+ if (!this.prompt.trim()) {
458
+ return;
459
+ }
460
+ if (!this.activeAgentId) {
461
+ if (this.agents.length > 0) {
462
+ this.activeAgentId = this.agents[0].id;
463
+ }
464
+ else {
465
+ this.requestAgents();
466
+ }
467
+ }
468
+ const payload = {
469
+ chatId: this.activeChatId || undefined,
470
+ agentId: this.activeAgentId || '',
471
+ prompt: this.prompt.trim(),
472
+ config: { ...this.config },
473
+ contextImages: this.contextImages.map((img) => ({ ...img })),
474
+ };
475
+ this.submitting = true;
476
+ this.generationError = null;
477
+ this.emit('changed');
478
+ if (this.isBrowser) {
479
+ window.dispatchEvent(new CustomEvent(RTSeeIllustratorEvents.SUBMIT_PROMPT, {
480
+ detail: payload,
481
+ }));
482
+ }
483
+ }
484
+ }
485
+ //# sourceMappingURL=RTSeeIllustrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeIllustrator.js","sourceRoot":"","sources":["../../../../../src/models/editor/RTSeeIllustrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EASL,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,YAAY,GAAG,IAAI,EAAE,OAAO,GAAG,IAAI;IAClF,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAC5E,OAAO,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,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAErB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,sBAAsB,CAAC,aAAa,EAAE;gBACpD,MAAM,EAAE,OAAO;aAChB,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,93 @@
1
+ import { IEntitiesRemoteActions, IRTSeeStory, IRTSeeStoryArtifact, IRTSeeStoryAuthor, IRTSeeStoryCategory, IRTSeeStoryCharacter, IRTSeeStoryLocation, IRTSeeStorySlide, IRTSeeTag, ITagsRemoteActions } from "@rtsee/common";
2
+ import { IRTSeeHandlerCommonOptions, RTSeeSignalHandlersDriver } from "@rtsee/core";
3
+ import { ManageStoryAuthorForm, ManageStoryForm, SelectStoryAuthorForm } from "@rtsee/utilities-ui";
4
+ import { RTSeeStory } from "../RTSeeStory";
5
+ import { RTSeeManageStorySlide } from "../manage/RTSeeManageStorySlide";
6
+ import { IPresentationRemoteActions } from "../remote-actions/PresentationRemoteActions";
7
+ import { RTSeeStoryCharacter } from "../story-elements/RTSeeStoryCharacter";
8
+ import { RTSeeStoryArtifact } from "../story-elements/RTSeeStoryArtifact";
9
+ import { RTSeeStoryLocation } from "../story-elements/RTSeeStoryLocation";
10
+ import { RTSeeStoryAuthor } from "../story-elements/RTSeeStoryAuthor";
11
+ import { RTSeeStoryEditorSection, RTSeeStoryElementsEditor } from "./RTSeeStoryElementsEditor";
12
+ export interface IRTSeeInteractiveStoryEditorOptions extends IRTSeeHandlerCommonOptions {
13
+ /** story to edit (a blank story is created when both story and storyId are missing) */
14
+ story?: IRTSeeStory;
15
+ /** id of the story to load (used when story is not provided) */
16
+ storyId?: string;
17
+ entitiesRemoteActions: IEntitiesRemoteActions & ITagsRemoteActions;
18
+ /** sections collapsed on init (all the sections are expanded by default) */
19
+ collapsedSections?: RTSeeStoryEditorSection[];
20
+ slidesLimit?: number;
21
+ }
22
+ /**
23
+ * Business logic of the interactive story editor.
24
+ * Orchestrates the story domain entities (story, characters, artifacts, locations, author, slides)
25
+ * and their edit forms. The UI layer only renders the state & forwards the user actions.
26
+ */
27
+ export declare class RTSeeInteractiveStoryEditorVm extends RTSeeSignalHandlersDriver {
28
+ story: RTSeeStory | null;
29
+ presentationRemoteActions: IPresentationRemoteActions;
30
+ entitiesRemoteActions: IEntitiesRemoteActions & ITagsRemoteActions;
31
+ collapsedSections: Set<RTSeeStoryEditorSection>;
32
+ detailsExpanded: boolean;
33
+ detailsForm: ManageStoryForm | null;
34
+ detailsSaveInProgress: boolean;
35
+ detailsError: string | null;
36
+ charactersEditor: RTSeeStoryElementsEditor<IRTSeeStoryCharacter, RTSeeStoryCharacter>;
37
+ artifactsEditor: RTSeeStoryElementsEditor<IRTSeeStoryArtifact, RTSeeStoryArtifact>;
38
+ locationsEditor: RTSeeStoryElementsEditor<IRTSeeStoryLocation, RTSeeStoryLocation>;
39
+ slides: IRTSeeStorySlide[];
40
+ totalSlides: number;
41
+ activeSlide: RTSeeManageStorySlide | null;
42
+ slidesLoadInProgress: boolean;
43
+ authorExpanded: boolean;
44
+ authorForm: SelectStoryAuthorForm | null;
45
+ newAuthor: RTSeeStoryAuthor | null;
46
+ newAuthorForm: ManageStoryAuthorForm | null;
47
+ authorSaveInProgress: boolean;
48
+ authorError: string | null;
49
+ initInProgress: boolean;
50
+ initError: string | null;
51
+ private readonly options;
52
+ private authorsCache;
53
+ constructor(options: IRTSeeInteractiveStoryEditorOptions);
54
+ get companionUrlValue(): string;
55
+ get isNewStory(): boolean;
56
+ init(): Promise<void>;
57
+ isCollapsed(section: RTSeeStoryEditorSection): boolean;
58
+ toggleSection(section: RTSeeStoryEditorSection, collapsed?: boolean): void;
59
+ expandDetails(): void;
60
+ collapseDetails(): void;
61
+ toggleDetails(): void;
62
+ saveDetails(model: IRTSeeStory): Promise<void>;
63
+ loadSlides(): Promise<void>;
64
+ isSlideExpanded(slide: IRTSeeStorySlide): boolean;
65
+ expandSlide(slide: IRTSeeStorySlide): void;
66
+ expandNewSlide(): void;
67
+ collapseSlide(): void;
68
+ updateSlideImage(slide: IRTSeeStorySlide, imageUrl: string): Promise<IRTSeeStorySlide>;
69
+ get author(): RTSeeStoryAuthor | null;
70
+ toggleAuthor(): void;
71
+ expandAuthor(): void;
72
+ collapseAuthor(): void;
73
+ /** Assigns an existing author to the story (null clears the author) */
74
+ assignAuthor(storyAuthorId: string | null): Promise<void>;
75
+ /** Opens the form to create a brand new author */
76
+ startNewAuthor(): void;
77
+ cancelNewAuthor(): void;
78
+ saveNewAuthor(model: IRTSeeStoryAuthor): Promise<void>;
79
+ getAuthorsSuggestions(query: string): Promise<IRTSeeStoryAuthor[]>;
80
+ getStoryCategories(_query: string): Promise<IRTSeeStoryCategory[]>;
81
+ getTags(_query: string): Promise<IRTSeeTag[]>;
82
+ destroy(): void;
83
+ private resolveStoryData;
84
+ private getBlankStoryData;
85
+ private loadAuthor;
86
+ private getAuthorData;
87
+ /** Persists the story with its current links (elements ids & author id) */
88
+ private saveStoryLinks;
89
+ private openSlide;
90
+ private requireStory;
91
+ private getErrorMessage;
92
+ }
93
+ //# sourceMappingURL=RTSeeInteractiveStoryEditorVm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeInteractiveStoryEditorVm.d.ts","sourceRoot":"","sources":["../../../../../src/models/editor/RTSeeInteractiveStoryEditorVm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EAEjB,mBAAmB,EAEnB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,SAAS,EAIT,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EAWL,qBAAqB,EAErB,eAAe,EAGf,qBAA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