@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,521 @@
1
+ import { RTSeeSignalHandlersDriver } from "@rtsee/core";
2
+ import { generateManageStoryAuthorFields, generateManageStoryElementFields, generateManageStoryFields, generateSelectStoryAuthorFields, getManageStoryAuthorFieldsOptions, getManageStoryElementFieldsOptions, getManageStoryFieldsOptions, getSelectStoryAuthorFieldsOptions, ManageStoryArtifactForm, ManageStoryAuthorForm, ManageStoryCharacterForm, ManageStoryForm, ManageStoryLocationForm, SelectStoryAuthorForm, } from "@rtsee/utilities-ui";
3
+ import { RTSeeStory } from "../RTSeeStory";
4
+ import { RTSeeManageStorySlide } from "../manage/RTSeeManageStorySlide";
5
+ import { getPresentationRemoteActions, } from "../remote-actions/PresentationRemoteActions";
6
+ import { RTSeeStoryAuthor } from "../story-elements/RTSeeStoryAuthor";
7
+ import { RTSeeStoryElementEntity } from "../story-elements/RTSeeStoryElementEntity";
8
+ import { RTSeeStoryEditorSection, RTSeeStoryElementsEditor, } from "./RTSeeStoryElementsEditor";
9
+ const DEFAULT_SLIDES_LIMIT = 1000;
10
+ const AUTHORS_SUGGESTIONS_LIMIT = 20;
11
+ /**
12
+ * Business logic of the interactive story editor.
13
+ * Orchestrates the story domain entities (story, characters, artifacts, locations, author, slides)
14
+ * and their edit forms. The UI layer only renders the state & forwards the user actions.
15
+ */
16
+ export class RTSeeInteractiveStoryEditorVm extends RTSeeSignalHandlersDriver {
17
+ story = null;
18
+ presentationRemoteActions;
19
+ entitiesRemoteActions;
20
+ collapsedSections;
21
+ // details
22
+ detailsExpanded = false;
23
+ detailsForm = null;
24
+ detailsSaveInProgress = false;
25
+ detailsError = null;
26
+ // elements
27
+ charactersEditor;
28
+ artifactsEditor;
29
+ locationsEditor;
30
+ // slides
31
+ slides = [];
32
+ totalSlides = 0;
33
+ activeSlide = null;
34
+ slidesLoadInProgress = false;
35
+ // author
36
+ authorExpanded = false;
37
+ authorForm = null;
38
+ newAuthor = null;
39
+ newAuthorForm = null;
40
+ authorSaveInProgress = false;
41
+ authorError = null;
42
+ // ui
43
+ initInProgress = false;
44
+ initError = null;
45
+ options;
46
+ authorsCache = new Map();
47
+ constructor(options) {
48
+ super(options);
49
+ if (!options.companionUrl || !options.peer) {
50
+ throw new Error("RTSeeInteractiveStoryEditorVm: companionUrl/peer is missing");
51
+ }
52
+ this.options = options;
53
+ this.entitiesRemoteActions = options.entitiesRemoteActions;
54
+ this.presentationRemoteActions = getPresentationRemoteActions(this.signalingClient);
55
+ this.collapsedSections = new Set(options.collapsedSections || []);
56
+ this.charactersEditor = new RTSeeStoryElementsEditor({
57
+ section: RTSeeStoryEditorSection.characters,
58
+ label: "Character",
59
+ getItems: () => this.story?.characters || [],
60
+ createEntity: (data) => this.requireStory().createCharacter(data),
61
+ getBlankData: () => RTSeeStoryElementEntity.getBlankData(this.applicationId),
62
+ createForm: (data, onSubmit) => new ManageStoryCharacterForm({
63
+ name: "Manage Character",
64
+ ...generateManageStoryElementFields(getManageStoryElementFieldsOptions(data, this.companionUrl, this.getTags.bind(this), this.peer)),
65
+ onSubmit,
66
+ }),
67
+ attach: (entity) => this.requireStory().addCharacter(entity),
68
+ detach: (id) => this.requireStory().removeCharacter(id),
69
+ getStoryId: () => this.story?.id || "",
70
+ saveStory: () => this.saveStoryLinks(),
71
+ });
72
+ this.artifactsEditor = new RTSeeStoryElementsEditor({
73
+ section: RTSeeStoryEditorSection.artifacts,
74
+ label: "Artifact",
75
+ getItems: () => this.story?.artifacts || [],
76
+ createEntity: (data) => this.requireStory().createArtifact(data),
77
+ getBlankData: () => RTSeeStoryElementEntity.getBlankData(this.applicationId),
78
+ createForm: (data, onSubmit) => new ManageStoryArtifactForm({
79
+ name: "Manage Artifact",
80
+ ...generateManageStoryElementFields(getManageStoryElementFieldsOptions(data, this.companionUrl, this.getTags.bind(this), this.peer)),
81
+ onSubmit,
82
+ }),
83
+ attach: (entity) => this.requireStory().addArtifact(entity),
84
+ detach: (id) => this.requireStory().removeArtifact(id),
85
+ getStoryId: () => this.story?.id || "",
86
+ saveStory: () => this.saveStoryLinks(),
87
+ });
88
+ this.locationsEditor = new RTSeeStoryElementsEditor({
89
+ section: RTSeeStoryEditorSection.locations,
90
+ label: "Location",
91
+ getItems: () => this.story?.locations || [],
92
+ createEntity: (data) => this.requireStory().createLocation(data),
93
+ getBlankData: () => RTSeeStoryElementEntity.getBlankData(this.applicationId),
94
+ createForm: (data, onSubmit) => new ManageStoryLocationForm({
95
+ name: "Manage Location",
96
+ ...generateManageStoryElementFields(getManageStoryElementFieldsOptions(data, this.companionUrl, this.getTags.bind(this), this.peer)),
97
+ onSubmit,
98
+ }),
99
+ attach: (entity) => this.requireStory().addLocation(entity),
100
+ detach: (id) => this.requireStory().removeLocation(id),
101
+ getStoryId: () => this.story?.id || "",
102
+ saveStory: () => this.saveStoryLinks(),
103
+ });
104
+ }
105
+ get companionUrlValue() {
106
+ return this.companionUrl || "";
107
+ }
108
+ get isNewStory() {
109
+ return !this.story || !this.story.id;
110
+ }
111
+ // ---- lifecycle ----
112
+ async init() {
113
+ this.initInProgress = true;
114
+ this.initError = null;
115
+ try {
116
+ const storyData = await this.resolveStoryData();
117
+ this.story = new RTSeeStory({
118
+ ...this.getHandlerCommonOptions(),
119
+ applicationId: storyData.applicationId || this.applicationId,
120
+ storyData,
121
+ entitiesRemoteActions: this.entitiesRemoteActions,
122
+ getRemoteSlides: (query) => this.presentationRemoteActions.getSlides.send(query),
123
+ });
124
+ if (this.isNewStory) {
125
+ this.expandDetails();
126
+ }
127
+ await Promise.all([this.loadSlides(), this.loadAuthor()]);
128
+ }
129
+ catch (e) {
130
+ this.initError = this.getErrorMessage(e);
131
+ }
132
+ finally {
133
+ this.initInProgress = false;
134
+ }
135
+ }
136
+ // ---- sections ----
137
+ isCollapsed(section) {
138
+ return this.collapsedSections.has(section);
139
+ }
140
+ toggleSection(section, collapsed) {
141
+ const shouldCollapse = collapsed !== undefined ? collapsed : !this.isCollapsed(section);
142
+ if (shouldCollapse) {
143
+ this.collapsedSections.add(section);
144
+ }
145
+ else {
146
+ this.collapsedSections.delete(section);
147
+ }
148
+ }
149
+ // ---- details ----
150
+ expandDetails() {
151
+ const story = this.requireStory();
152
+ this.detailsError = null;
153
+ this.detailsExpanded = true;
154
+ const storyData = story.toJson();
155
+ this.detailsForm = new ManageStoryForm({
156
+ name: "Manage Story",
157
+ ...generateManageStoryFields(getManageStoryFieldsOptions(storyData, this.companionUrlValue, this.getStoryCategories.bind(this), this.getTags.bind(this), this.peer)),
158
+ onSubmit: (model) => {
159
+ void this.saveDetails(model);
160
+ },
161
+ });
162
+ }
163
+ collapseDetails() {
164
+ this.detailsExpanded = false;
165
+ this.detailsForm = null;
166
+ this.detailsError = null;
167
+ }
168
+ toggleDetails() {
169
+ if (this.detailsExpanded) {
170
+ this.collapseDetails();
171
+ }
172
+ else {
173
+ this.expandDetails();
174
+ }
175
+ }
176
+ async saveDetails(model) {
177
+ if (this.detailsSaveInProgress) {
178
+ return;
179
+ }
180
+ if (this.detailsForm && !this.detailsForm.isValid) {
181
+ this.detailsError = "Please fix the highlighted fields";
182
+ return;
183
+ }
184
+ this.detailsSaveInProgress = true;
185
+ this.detailsError = null;
186
+ try {
187
+ // only take the fields edited by the form, element links are kept by the story
188
+ await this.requireStory().save({
189
+ name: model.name,
190
+ description: model.description,
191
+ imageUrl: model.imageUrl,
192
+ tagIds: model.tagIds,
193
+ categoriesIds: model.categoriesIds,
194
+ averageReadTime: model.averageReadTime,
195
+ recommendedAge: model.recommendedAge,
196
+ friendlyUrl: model.friendlyUrl,
197
+ isPublished: model.isPublished,
198
+ });
199
+ this.collapseDetails();
200
+ this.emit("story-saved", this.story);
201
+ }
202
+ catch (e) {
203
+ this.detailsError = this.getErrorMessage(e);
204
+ }
205
+ finally {
206
+ this.detailsSaveInProgress = false;
207
+ }
208
+ }
209
+ // ---- slides ----
210
+ async loadSlides() {
211
+ if (this.isNewStory) {
212
+ this.slides = [];
213
+ this.totalSlides = 0;
214
+ return;
215
+ }
216
+ this.slidesLoadInProgress = true;
217
+ try {
218
+ const response = await this.presentationRemoteActions.getSlides.send({
219
+ storyId: this.requireStory().id,
220
+ slideNumber: 0,
221
+ direction: "front",
222
+ limit: this.options.slidesLimit || DEFAULT_SLIDES_LIMIT,
223
+ populate: true,
224
+ });
225
+ this.slides = [...response.slides].sort((a, b) => a.slideNumber - b.slideNumber);
226
+ this.totalSlides = response.total;
227
+ }
228
+ catch (e) {
229
+ console.error("RTSeeInteractiveStoryEditorVm: failed to load slides", e);
230
+ }
231
+ finally {
232
+ this.slidesLoadInProgress = false;
233
+ }
234
+ }
235
+ isSlideExpanded(slide) {
236
+ return !!this.activeSlide && !!slide.id && this.activeSlide.slide.id === slide.id;
237
+ }
238
+ expandSlide(slide) {
239
+ if (this.isSlideExpanded(slide)) {
240
+ this.collapseSlide();
241
+ return;
242
+ }
243
+ this.openSlide({ ...slide });
244
+ }
245
+ expandNewSlide() {
246
+ if (this.isNewStory) {
247
+ return;
248
+ }
249
+ this.openSlide({
250
+ id: "",
251
+ applicationId: this.applicationId,
252
+ configurationId: "",
253
+ name: "",
254
+ tagIds: [],
255
+ tags: [],
256
+ storyId: this.requireStory().id,
257
+ text: "",
258
+ slideNumber: this.slides.length + 1,
259
+ });
260
+ }
261
+ collapseSlide() {
262
+ this.activeSlide?.removeAllListeners();
263
+ this.activeSlide = null;
264
+ }
265
+ async updateSlideImage(slide, imageUrl) {
266
+ const payload = {
267
+ ...slide,
268
+ imageUrl,
269
+ };
270
+ const updated = await this.presentationRemoteActions.editSlide.send(payload);
271
+ const index = this.slides.findIndex((s) => s.id === slide.id);
272
+ if (index !== -1) {
273
+ this.slides[index] = { ...this.slides[index], imageUrl: updated?.imageUrl || imageUrl };
274
+ this.slides = [...this.slides];
275
+ }
276
+ if (this.activeSlide && this.activeSlide.slide.id === slide.id) {
277
+ this.activeSlide.slide.imageUrl = updated?.imageUrl || imageUrl;
278
+ if (this.activeSlide.imageUploader) {
279
+ this.activeSlide.imageUploader.uploadedPhotoPreview = updated?.imageUrl || imageUrl;
280
+ }
281
+ const imageField = this.activeSlide.activeSlideForm?.fields.find((f) => f.name === 'imageUrl' || f.type === 'image-uploader');
282
+ if (imageField) {
283
+ imageField.value = updated?.imageUrl || imageUrl;
284
+ if (imageField.imageUploader) {
285
+ imageField.imageUploader.uploadedPhotoPreview = updated?.imageUrl || imageUrl;
286
+ }
287
+ }
288
+ }
289
+ this.emit('slide-updated', this.slides[index]);
290
+ return updated;
291
+ }
292
+ // ---- author ----
293
+ get author() {
294
+ return this.story?.author || null;
295
+ }
296
+ toggleAuthor() {
297
+ if (this.authorExpanded) {
298
+ this.collapseAuthor();
299
+ }
300
+ else {
301
+ this.expandAuthor();
302
+ }
303
+ }
304
+ expandAuthor() {
305
+ this.authorExpanded = true;
306
+ this.authorError = null;
307
+ this.authorForm = new SelectStoryAuthorForm({
308
+ name: "Story Author",
309
+ ...generateSelectStoryAuthorFields(getSelectStoryAuthorFieldsOptions(this.story?.storyAuthorId, this.getAuthorsSuggestions.bind(this))),
310
+ onSubmit: (model) => {
311
+ void this.assignAuthor(model.storyAuthorId);
312
+ },
313
+ });
314
+ }
315
+ collapseAuthor() {
316
+ this.authorExpanded = false;
317
+ this.authorForm = null;
318
+ this.cancelNewAuthor();
319
+ this.authorError = null;
320
+ }
321
+ /** Assigns an existing author to the story (null clears the author) */
322
+ async assignAuthor(storyAuthorId) {
323
+ if (this.authorSaveInProgress) {
324
+ return;
325
+ }
326
+ const story = this.requireStory();
327
+ const previous = story.author;
328
+ this.authorSaveInProgress = true;
329
+ this.authorError = null;
330
+ try {
331
+ const author = storyAuthorId
332
+ ? story.createAuthor(await this.getAuthorData(storyAuthorId))
333
+ : null;
334
+ story.setAuthor(author);
335
+ await this.saveStoryLinks();
336
+ this.collapseAuthor();
337
+ }
338
+ catch (e) {
339
+ story.setAuthor(previous);
340
+ this.authorError = this.getErrorMessage(e);
341
+ }
342
+ finally {
343
+ this.authorSaveInProgress = false;
344
+ }
345
+ }
346
+ /** Opens the form to create a brand new author */
347
+ startNewAuthor() {
348
+ const story = this.requireStory();
349
+ this.newAuthor = story.createAuthor(RTSeeStoryAuthor.getBlankData(this.applicationId));
350
+ this.newAuthorForm = new ManageStoryAuthorForm({
351
+ name: "New Author",
352
+ ...generateManageStoryAuthorFields(getManageStoryAuthorFieldsOptions(this.newAuthor.toJson(), this.companionUrlValue, this.getTags.bind(this), this.peer)),
353
+ onSubmit: (model) => {
354
+ void this.saveNewAuthor(model);
355
+ },
356
+ });
357
+ }
358
+ cancelNewAuthor() {
359
+ this.newAuthor = null;
360
+ this.newAuthorForm = null;
361
+ }
362
+ async saveNewAuthor(model) {
363
+ const author = this.newAuthor;
364
+ if (!author || this.authorSaveInProgress) {
365
+ return;
366
+ }
367
+ if (this.newAuthorForm && !this.newAuthorForm.isValid) {
368
+ this.authorError = "Please fix the highlighted fields";
369
+ return;
370
+ }
371
+ this.authorSaveInProgress = true;
372
+ this.authorError = null;
373
+ try {
374
+ const saved = await author.save({ ...model, id: "" });
375
+ this.authorsCache.set(saved.id, saved);
376
+ this.requireStory().setAuthor(author);
377
+ await this.saveStoryLinks();
378
+ this.collapseAuthor();
379
+ }
380
+ catch (e) {
381
+ this.authorError = author.lastError || this.getErrorMessage(e);
382
+ }
383
+ finally {
384
+ this.authorSaveInProgress = false;
385
+ }
386
+ }
387
+ // ---- suggestions ----
388
+ async getAuthorsSuggestions(query) {
389
+ try {
390
+ const response = await this.presentationRemoteActions.getAuthors.send({
391
+ query: query || undefined,
392
+ limit: AUTHORS_SUGGESTIONS_LIMIT,
393
+ });
394
+ response.authors.forEach((a) => this.authorsCache.set(a.id, a));
395
+ return response.authors;
396
+ }
397
+ catch (e) {
398
+ console.error(e);
399
+ return [];
400
+ }
401
+ }
402
+ async getStoryCategories(_query) {
403
+ try {
404
+ const result = await this.presentationRemoteActions.getCategories.send({ populate: false });
405
+ return result.categories;
406
+ }
407
+ catch (e) {
408
+ console.error(e);
409
+ return [];
410
+ }
411
+ }
412
+ async getTags(_query) {
413
+ try {
414
+ const result = await this.entitiesRemoteActions.getTags.send({
415
+ applicationId: this.applicationId,
416
+ flat: true,
417
+ });
418
+ return result.tags;
419
+ }
420
+ catch (e) {
421
+ console.error(e);
422
+ return [];
423
+ }
424
+ }
425
+ destroy() {
426
+ this.collapseSlide();
427
+ this.removeAllListeners();
428
+ }
429
+ // ---- private ----
430
+ async resolveStoryData() {
431
+ if (this.options.story && this.options.story.id) {
432
+ // always reload: the provided story may not have the populated elements
433
+ return await this.presentationRemoteActions.getStory.send(this.options.story.id);
434
+ }
435
+ if (this.options.storyId) {
436
+ return await this.presentationRemoteActions.getStory.send(this.options.storyId);
437
+ }
438
+ return this.options.story || this.getBlankStoryData();
439
+ }
440
+ getBlankStoryData() {
441
+ return {
442
+ id: "",
443
+ applicationId: this.applicationId,
444
+ configurationId: "",
445
+ name: "",
446
+ description: "",
447
+ totalSlides: 0,
448
+ categories: [],
449
+ categoriesIds: [],
450
+ tagIds: [],
451
+ tags: [],
452
+ characters: [],
453
+ artifacts: [],
454
+ locations: [],
455
+ storyAuthorId: null,
456
+ };
457
+ }
458
+ async loadAuthor() {
459
+ const story = this.requireStory();
460
+ if (story.author || !story.storyAuthorId) {
461
+ return;
462
+ }
463
+ try {
464
+ story.setAuthor(story.createAuthor(await this.getAuthorData(story.storyAuthorId)));
465
+ }
466
+ catch (e) {
467
+ console.error("RTSeeInteractiveStoryEditorVm: failed to load the author", e);
468
+ }
469
+ }
470
+ async getAuthorData(authorId) {
471
+ const cached = this.authorsCache.get(authorId);
472
+ if (cached) {
473
+ return cached;
474
+ }
475
+ const author = await this.presentationRemoteActions.getAuthor.send(authorId);
476
+ this.authorsCache.set(author.id, author);
477
+ return author;
478
+ }
479
+ /** Persists the story with its current links (elements ids & author id) */
480
+ async saveStoryLinks() {
481
+ const story = this.requireStory();
482
+ if (!story.id && !story.name) {
483
+ // a new story cannot be saved without details, links are persisted with the details
484
+ this.expandDetails();
485
+ return;
486
+ }
487
+ await story.save();
488
+ this.emit("story-saved", story);
489
+ }
490
+ openSlide(slide) {
491
+ this.collapseSlide();
492
+ const manageSlide = new RTSeeManageStorySlide({
493
+ slide,
494
+ companionUrl: this.companionUrlValue,
495
+ peer: this.peer,
496
+ signalingClient: this.signalingClient,
497
+ entitiesRemoteActions: this.entitiesRemoteActions,
498
+ });
499
+ manageSlide.on("cancel-clicked", () => this.collapseSlide());
500
+ manageSlide.on("created", () => {
501
+ this.collapseSlide();
502
+ void this.loadSlides();
503
+ });
504
+ manageSlide.on("updated", () => {
505
+ this.collapseSlide();
506
+ void this.loadSlides();
507
+ });
508
+ this.activeSlide = manageSlide;
509
+ }
510
+ requireStory() {
511
+ if (!this.story) {
512
+ throw new Error("RTSeeInteractiveStoryEditorVm: call init() first");
513
+ }
514
+ return this.story;
515
+ }
516
+ getErrorMessage(e) {
517
+ const error = e;
518
+ return error?.friendlyMessage || error?.message || `${e}`;
519
+ }
520
+ }
521
+ //# sourceMappingURL=RTSeeInteractiveStoryEditorVm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeInteractiveStoryEditorVm.js","sourceRoot":"","sources":["../../../../../src/models/editor/RTSeeInteractiveStoryEditorVm.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA8B,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,yBAAyB,EACzB,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,2BAA2B,EAC3B,iCAAiC,EAEjC,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EACf,uBAAuB,EAEvB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,4BAA4B,GAE7B,MAAM,6CAA6C,CAAC;AAIrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,oBAAoB,GAAW,IAAI,CAAC;AAC1C,MAAM,yBAAyB,GAAW,EAAE,CAAC;AAc7C;;;;GAIG;AACH,MAAM,OAAO,6BAA8B,SAAQ,yBAAyB;IAC1E,KAAK,GAAsB,IAAI,CAAC;IAChC,yBAAyB,CAA6B;IACtD,qBAAqB,CAA8C;IAEnE,iBAAiB,CAA+B;IAEhD,UAAU;IACV,eAAe,GAAY,KAAK,CAAC;IACjC,WAAW,GAA2B,IAAI,CAAC;IAC3C,qBAAqB,GAAY,KAAK,CA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mitter } from "events";
4
+ import { RTSeeStoryElementEntity } from "../story-elements/RTSeeStoryElementEntity";
5
+ export declare enum RTSeeStoryEditorSection {
6
+ details = "details",
7
+ characters = "characters",
8
+ artifacts = "artifacts",
9
+ locations = "locations",
10
+ slides = "slides",
11
+ author = "author"
12
+ }
13
+ export interface IRTSeeStoryElementsEditorOptions<TData extends IRTSeeStoryElement, TEntity extends RTSeeStoryElementEntity<TData>> {
14
+ section: RTSeeStoryEditorSection;
15
+ /** human readable (singular) name of the element, e.g. "Character" */
16
+ label: string;
17
+ /** current story elements (story is the source of truth) */
18
+ getItems: () => TEntity[];
19
+ /** builds a domain entity from data */
20
+ createEntity: (data: TData) => TEntity;
21
+ /** data of a new (blank) element */
22
+ getBlankData: () => TData;
23
+ /** builds the edit form of an element */
24
+ createForm: (data: TData, onSubmit: (model: TData) => void) => RTSeeForm<TData>;
25
+ /** links the element to the story (local) */
26
+ attach: (entity: TEntity) => void;
27
+ /** unlinks the element from the story (local) */
28
+ detach: (id: string) => void;
29
+ /** id of the story (empty for a story that was not saved yet) */
30
+ getStoryId: () => string;
31
+ /** persists the story links (characters / artifacts / locations ids) */
32
+ saveStory: () => Promise<unknown>;
33
+ }
34
+ /**
35
+ * Orchestrates the thumbnails list and the (single) expanded edit form of one kind of
36
+ * story element (characters, artifacts or locations).
37
+ */
38
+ export declare class RTSeeStoryElementsEditor<TData extends IRTSeeStoryElement, TEntity extends RTSeeStoryElementEntity<TData>> extends EventEmitter {
39
+ readonly section: RTSeeStoryEditorSection;
40
+ readonly label: string;
41
+ expanded: TEntity | null;
42
+ form: RTSeeForm<TData> | null;
43
+ saveInProgress: boolean;
44
+ removeInProgress: boolean;
45
+ error: string | null;
46
+ private readonly options;
47
+ constructor(options: IRTSeeStoryElementsEditorOptions<TData, TEntity>);
48
+ get items(): TEntity[];
49
+ get isCreating(): boolean;
50
+ get busy(): boolean;
51
+ isExpanded(entity: TEntity): boolean;
52
+ /** Expands the edit form of an existing element */
53
+ expand(entity: TEntity): void;
54
+ /** Expands the edit form of a new (blank) element */
55
+ expandNew(): void;
56
+ collapse(): void;
57
+ /** Submits the expanded form */
58
+ submit(): void;
59
+ /**
60
+ * Creates / updates the expanded element.
61
+ * A new element is attached to the story (server side when the story already exists).
62
+ */
63
+ save(model: TData): Promise<void>;
64
+ /** Removes the element from the story only (the element is kept for other stories) */
65
+ detach(entity: TEntity): Promise<void>;
66
+ /** Deletes the element permanently (from all the stories) */
67
+ delete(entity: TEntity): Promise<void>;
68
+ private open;
69
+ private getErrorMessage;
70
+ }
71
+ //# sourceMappingURL=RTSeeStoryElementsEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeStoryElementsEditor.d.ts","sourceRoot":"","sources":["../../../../../src/models/editor/RTSeeStoryElementsEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,oBAAY,uBAAuB;IACjC,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,gCAAgC,CAC/C,KAAK,SAAS,kBAAkB,EAChC,OAAO,SAAS,uBAAuB,CAAC,KAAK,CAAC;IAE9C,OAAO,EAAE,uBAAuB,CAAC;IACjC,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,OAAO,EAAE,CAAC;IAC1B,uCAAuC;IACvC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC;IACvC,oCAAoC;IACpC,YAAY,EAAE,MAAM,KAAK,CAAC;IAC1B,yCAAyC;IACzC,U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