@rtsee/presentation 0.0.69 → 0.0.71
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/dist/presentation/src/index.js +2 -18
- package/dist/presentation/src/index.js.map +1 -1
- package/dist/presentation/src/interfaces/RTSeePresentationInput.js +0 -2
- package/dist/presentation/src/interfaces/StoryPlayer.d.ts +8 -0
- package/dist/presentation/src/interfaces/StoryPlayer.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/StoryPlayer.js +1 -0
- package/dist/presentation/src/interfaces/StoryPlayer.js.map +1 -0
- package/dist/presentation/src/interfaces/index.d.ts +2 -0
- package/dist/presentation/src/interfaces/index.d.ts.map +1 -1
- package/dist/presentation/src/interfaces/index.js +3 -17
- package/dist/presentation/src/interfaces/index.js.map +1 -1
- package/dist/presentation/src/interfaces/manage/RTSeeManageSlideOptions.d.ts +6 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageSlideOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageSlideOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageSlideOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesCategoriesOptions.d.ts +9 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesCategoriesOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesCategoriesOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesCategoriesOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesCategoryOptions.d.ts +11 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesCategoryOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesCategoryOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesCategoryOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesLabelOptions.d.ts +11 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesLabelOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesLabelOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesLabelOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesLabelsOptions.d.ts +9 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesLabelsOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesLabelsOptions.js +7 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesLabelsOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesOptions.d.ts +11 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoriesOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoryOptions.d.ts +11 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoryOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoryOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStoryOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStorySlideOptions.d.ts +9 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStorySlideOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStorySlideOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStorySlideOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStorySlidesOptions.d.ts +9 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStorySlidesOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStorySlidesOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeeManageStorySlidesOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeePresentationDashboardOptions.d.ts +9 -0
- package/dist/presentation/src/interfaces/manage/RTSeePresentationDashboardOptions.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeePresentationDashboardOptions.js +1 -0
- package/dist/presentation/src/interfaces/manage/RTSeePresentationDashboardOptions.js.map +1 -0
- package/dist/presentation/src/interfaces/manage/index.d.ts +11 -0
- package/dist/presentation/src/interfaces/manage/index.d.ts.map +1 -0
- package/dist/presentation/src/interfaces/manage/index.js +11 -0
- package/dist/presentation/src/interfaces/manage/index.js.map +1 -0
- package/dist/presentation/src/models/RTSeePresentation.d.ts +17 -2
- package/dist/presentation/src/models/RTSeePresentation.d.ts.map +1 -1
- package/dist/presentation/src/models/RTSeePresentation.js +114 -50
- package/dist/presentation/src/models/RTSeePresentation.js.map +1 -1
- package/dist/presentation/src/models/RTSeeStory.d.ts +13 -0
- package/dist/presentation/src/models/RTSeeStory.d.ts.map +1 -1
- package/dist/presentation/src/models/RTSeeStory.js +104 -64
- package/dist/presentation/src/models/RTSeeStory.js.map +1 -1
- package/dist/presentation/src/models/RTSeeStoryCategory.d.ts +11 -0
- package/dist/presentation/src/models/RTSeeStoryCategory.d.ts.map +1 -0
- package/dist/presentation/src/models/RTSeeStoryCategory.js +25 -0
- package/dist/presentation/src/models/RTSeeStoryCategory.js.map +1 -0
- package/dist/presentation/src/models/RTSeeStorySlide.d.ts +2 -0
- package/dist/presentation/src/models/RTSeeStorySlide.d.ts.map +1 -1
- package/dist/presentation/src/models/RTSeeStorySlide.js +12 -7
- package/dist/presentation/src/models/RTSeeStorySlide.js.map +1 -1
- package/dist/presentation/src/models/index.d.ts +3 -0
- package/dist/presentation/src/models/index.d.ts.map +1 -1
- package/dist/presentation/src/models/index.js +6 -19
- package/dist/presentation/src/models/index.js.map +1 -1
- package/dist/presentation/src/models/manage/RTSeeManageStories.d.ts +20 -0
- package/dist/presentation/src/models/manage/RTSeeManageStories.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStories.js +81 -0
- package/dist/presentation/src/models/manage/RTSeeManageStories.js.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStory.d.ts +27 -0
- package/dist/presentation/src/models/manage/RTSeeManageStory.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStory.js +126 -0
- package/dist/presentation/src/models/manage/RTSeeManageStory.js.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryCategories.d.ts +28 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryCategories.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryCategories.js +93 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryCategories.js.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryCategory.d.ts +18 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryCategory.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryCategory.js +50 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryCategory.js.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryLabel.d.ts +18 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryLabel.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryLabel.js +52 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryLabel.js.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryLabels.d.ts +28 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryLabels.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryLabels.js +97 -0
- package/dist/presentation/src/models/manage/RTSeeManageStoryLabels.js.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStorySlide.d.ts +20 -0
- package/dist/presentation/src/models/manage/RTSeeManageStorySlide.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStorySlide.js +69 -0
- package/dist/presentation/src/models/manage/RTSeeManageStorySlide.js.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStorySlides.d.ts +28 -0
- package/dist/presentation/src/models/manage/RTSeeManageStorySlides.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeeManageStorySlides.js +101 -0
- package/dist/presentation/src/models/manage/RTSeeManageStorySlides.js.map +1 -0
- package/dist/presentation/src/models/manage/RTSeePresentationDashboard.d.ts +15 -0
- package/dist/presentation/src/models/manage/RTSeePresentationDashboard.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/RTSeePresentationDashboard.js +41 -0
- package/dist/presentation/src/models/manage/RTSeePresentationDashboard.js.map +1 -0
- package/dist/presentation/src/models/manage/index.d.ts +10 -0
- package/dist/presentation/src/models/manage/index.d.ts.map +1 -0
- package/dist/presentation/src/models/manage/index.js +10 -0
- package/dist/presentation/src/models/manage/index.js.map +1 -0
- package/dist/presentation/src/models/remote-actions/PresentationRemoteActions.d.ts +23 -0
- package/dist/presentation/src/models/remote-actions/PresentationRemoteActions.d.ts.map +1 -0
- package/dist/presentation/src/models/remote-actions/PresentationRemoteActions.js +78 -0
- package/dist/presentation/src/models/remote-actions/PresentationRemoteActions.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { EventEmitter } from "events";
|
|
2
|
+
export class RTSeeStorySlide extends EventEmitter {
|
|
3
|
+
id;
|
|
4
|
+
storyId;
|
|
5
|
+
text;
|
|
6
|
+
slideNumber;
|
|
7
|
+
imageUrl;
|
|
8
|
+
widget;
|
|
9
|
+
data;
|
|
10
|
+
isActive = false;
|
|
6
11
|
constructor(options) {
|
|
7
12
|
super();
|
|
8
|
-
this.
|
|
13
|
+
this.id = options.id || '';
|
|
14
|
+
this.storyId = options.storyId;
|
|
9
15
|
this.text = options.text;
|
|
10
16
|
this.slideNumber = options.slideNumber;
|
|
11
17
|
this.imageUrl = options.imageUrl;
|
|
@@ -21,5 +27,4 @@ class RTSeeStorySlide extends events_1.EventEmitter {
|
|
|
21
27
|
// this.emit('deactivated');
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
|
-
exports.RTSeeStorySlide = RTSeeStorySlide;
|
|
25
30
|
//# sourceMappingURL=RTSeeStorySlide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTSeeStorySlide.js","sourceRoot":"","sources":["../../../../src/models/RTSeeStorySlide.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RTSeeStorySlide.js","sourceRoot":"","sources":["../../../../src/models/RTSeeStorySlide.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAEpC,MAAM,OAAO,eAAyB,SAAQ,YAAY;IACxD,EAAE,CAAS;IACX,OAAO,CAAS;IAChB,IAAI,CAAS;IACb,WAAW,CAAS;IACpB,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,IAAI,CAAK;IACT,QAAQ,GAAY,KAAK,CAAC;IAE1B,YAAY,OAA4B;QACtC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAC9B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,SAAS;QACP,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,0BAA0B;IAC5B,CAAC;IAED,WAAW;QACT,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,4BAA4B;IAC9B,CAAC;CACF"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
export * from './manage';
|
|
1
2
|
export * from './RTSeePresentation';
|
|
2
3
|
export * from './RTSeeStory';
|
|
3
4
|
export * from './RTSeeStorySlide';
|
|
5
|
+
export * from './RTSeeStoryCategory';
|
|
6
|
+
export * from './remote-actions/PresentationRemoteActions';
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC"}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./RTSeePresentation"), exports);
|
|
18
|
-
__exportStar(require("./RTSeeStory"), exports);
|
|
19
|
-
__exportStar(require("./RTSeeStorySlide"), exports);
|
|
1
|
+
export * from './manage';
|
|
2
|
+
export * from './RTSeePresentation';
|
|
3
|
+
export * from './RTSeeStory';
|
|
4
|
+
export * from './RTSeeStorySlide';
|
|
5
|
+
export * from './RTSeeStoryCategory';
|
|
6
|
+
export * from './remote-actions/PresentationRemoteActions';
|
|
20
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IRTSeeStory } from "@rtsee/common";
|
|
2
|
+
import { IPresentationRemoteActions, IRTSeeManageStoriesOptions, RTSeeManageStory } from "@rtsee/presentation";
|
|
3
|
+
import { IPeer, IRTSeeSignalingClientBase } from "@rtsee/core";
|
|
4
|
+
export declare class RTSeeManageStories {
|
|
5
|
+
stories: IRTSeeStory[];
|
|
6
|
+
selectedStory: RTSeeManageStory | null;
|
|
7
|
+
peer: IPeer;
|
|
8
|
+
companionUrl: string;
|
|
9
|
+
signalingClient: IRTSeeSignalingClientBase;
|
|
10
|
+
presentationsRemoteActions: IPresentationRemoteActions;
|
|
11
|
+
storiesLoadInProgress: boolean;
|
|
12
|
+
constructor(options: IRTSeeManageStoriesOptions);
|
|
13
|
+
getStoryById(storyId: string): IRTSeeStory | null;
|
|
14
|
+
selectStory(storyId: string): IRTSeeStory;
|
|
15
|
+
onReorder(): void;
|
|
16
|
+
selectNewStory(): IRTSeeStory;
|
|
17
|
+
private loadStories;
|
|
18
|
+
private setSelectedStory;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=RTSeeManageStories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStories.d.ts","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAqD,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAC,0BAA0B,EAAE,0BAA0B,EAAE,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAE/D,qBAAa,kBAAkB;IAC7B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,aAAa,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAC9C,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,yBAAyB,CAAC;IAC3C,0BAA0B,EAAE,0BAA0B,CAAC;IAEvD,qBAAqB,EAAE,OAAO,CAAS;gBAE3B,OAAO,EAAE,0BAA0B;IAc/C,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAKjD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAOzC,SAAS;IAIT,cAAc,IAAI,WAAW;YAef,WAAW;IAazB,OAAO,CAAC,gBAAgB;CAuBzB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { PresentationSignalingEvents } from "@rtsee/common";
|
|
2
|
+
import { RTSeeManageStory } from "@rtsee/presentation";
|
|
3
|
+
export class RTSeeManageStories {
|
|
4
|
+
stories;
|
|
5
|
+
selectedStory = null;
|
|
6
|
+
peer;
|
|
7
|
+
companionUrl;
|
|
8
|
+
signalingClient;
|
|
9
|
+
presentationsRemoteActions;
|
|
10
|
+
storiesLoadInProgress = false;
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this.stories = options.stories;
|
|
13
|
+
this.companionUrl = options.companionUrl;
|
|
14
|
+
this.peer = options.peer;
|
|
15
|
+
this.signalingClient = options.signalingClient;
|
|
16
|
+
this.presentationsRemoteActions = options.presentationsRemoteActions;
|
|
17
|
+
if (!this.companionUrl) {
|
|
18
|
+
throw new Error('RTSeeManageStories requires companion url');
|
|
19
|
+
}
|
|
20
|
+
void this.loadStories();
|
|
21
|
+
}
|
|
22
|
+
getStoryById(storyId) {
|
|
23
|
+
return this.stories
|
|
24
|
+
.find((story) => story.id === storyId) || null;
|
|
25
|
+
}
|
|
26
|
+
selectStory(storyId) {
|
|
27
|
+
const story = this.getStoryById(storyId);
|
|
28
|
+
if (!story) {
|
|
29
|
+
throw new Error("No story with id " + storyId);
|
|
30
|
+
}
|
|
31
|
+
this.setSelectedStory(story);
|
|
32
|
+
return story;
|
|
33
|
+
}
|
|
34
|
+
onReorder() {
|
|
35
|
+
console.log(this.stories);
|
|
36
|
+
}
|
|
37
|
+
selectNewStory() {
|
|
38
|
+
const blankStory = {
|
|
39
|
+
id: '',
|
|
40
|
+
name: '',
|
|
41
|
+
imageUrl: '',
|
|
42
|
+
totalSlides: 0,
|
|
43
|
+
averageReadTime: 0,
|
|
44
|
+
description: '',
|
|
45
|
+
slides: []
|
|
46
|
+
};
|
|
47
|
+
this.setSelectedStory(blankStory);
|
|
48
|
+
return blankStory;
|
|
49
|
+
}
|
|
50
|
+
async loadStories() {
|
|
51
|
+
this.storiesLoadInProgress = true;
|
|
52
|
+
try {
|
|
53
|
+
const result = await this.presentationsRemoteActions
|
|
54
|
+
.getStories.send({ offset: this.stories.length, limit: 30 });
|
|
55
|
+
this.stories.push(...result.stories);
|
|
56
|
+
this.storiesLoadInProgress = false;
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
this.storiesLoadInProgress = false;
|
|
60
|
+
console.error(e);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
setSelectedStory(story) {
|
|
64
|
+
this.selectedStory = new RTSeeManageStory({
|
|
65
|
+
story,
|
|
66
|
+
peer: this.peer,
|
|
67
|
+
companionUrl: this.companionUrl,
|
|
68
|
+
signalingClient: this.signalingClient,
|
|
69
|
+
presentationsRemoteActions: this.presentationsRemoteActions
|
|
70
|
+
});
|
|
71
|
+
this.selectedStory.on('cancel-clicked', () => {
|
|
72
|
+
this.selectedStory = null;
|
|
73
|
+
});
|
|
74
|
+
this.selectedStory.on(`${PresentationSignalingEvents.CREATE_STORY}-success`, (story) => {
|
|
75
|
+
this.selectedStory = null;
|
|
76
|
+
console.log(story);
|
|
77
|
+
});
|
|
78
|
+
return this.selectedStory;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=RTSeeManageStories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStories.js","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,2BAA2B,EAAC,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAyD,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAG7G,MAAM,OAAO,kBAAkB;IAC7B,OAAO,CAAgB;IACvB,aAAa,GAA4B,IAAI,CAAC;IAC9C,IAAI,CAAQ;IACZ,YAAY,CAAS;IACrB,eAAe,CAA4B;IAC3C,0BAA0B,CAA6B;IAEvD,qBAAqB,GAAY,KAAK,CAAC;IAEvC,YAAY,OAAmC;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;QAErE,IAAI,CAAC,IAAI,CAAC,YAA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AC/D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;YACrC,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;QACrC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;YACnC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAEO,gBAAgB,CACtB,KAAkB;QAElB,IAAI,CAAC,aAAa,GAAG,IAAI,gBAAgB,CAAC;YACxC,KAAK;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,0BAA0B,EAAE,IAAI,CAAC,0BAA0B;SAC5D,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;YAC3C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,2BAA2B,CAAC,YAAY,UAAU,EAAE,CAAC,KAAkB,EAAE,EAAE;YAClG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CAEF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IRTSeeStory, IRTSeeStoryCategory, IRTSeeStoryLabel } from "@rtsee/common";
|
|
2
|
+
import { IRTSeeManageStoryOptions, IPresentationRemoteActions, RTSeeManageStorySlides } from "@rtsee/presentation";
|
|
3
|
+
import { RTSeeFormAutocomplete, RTSeeImageCropper, RTSeeImageUploader } from "@rtsee/utilities-ui";
|
|
4
|
+
import { IPeer, IRTSeeSignalingClientBase, IRTSeeSignalingError } from "@rtsee/core";
|
|
5
|
+
import { EventEmitter } from "events";
|
|
6
|
+
export declare class RTSeeManageStory extends EventEmitter {
|
|
7
|
+
story: IRTSeeStory;
|
|
8
|
+
companionUrl: string;
|
|
9
|
+
manageSlides: RTSeeManageStorySlides;
|
|
10
|
+
peer: IPeer;
|
|
11
|
+
cropper: RTSeeImageCropper;
|
|
12
|
+
imageUploader: RTSeeImageUploader;
|
|
13
|
+
categoriesMultiselect: RTSeeFormAutocomplete<IRTSeeStoryCategory, string>;
|
|
14
|
+
labelsMultiselect: RTSeeFormAutocomplete<IRTSeeStoryLabel, string>;
|
|
15
|
+
signalingClient: IRTSeeSignalingClientBase;
|
|
16
|
+
presentationsRemoteActions: IPresentationRemoteActions;
|
|
17
|
+
saveInProgress: boolean;
|
|
18
|
+
constructor(options: IRTSeeManageStoryOptions);
|
|
19
|
+
getStoryCategories(query: string): Promise<IRTSeeStoryCategory[]>;
|
|
20
|
+
getStoriesLabels(query: string): Promise<IRTSeeStoryLabel[]>;
|
|
21
|
+
save(storyData: Pick<IRTSeeStory, 'name' | 'description' | 'averageReadTime'>): Promise<void>;
|
|
22
|
+
onSaveSuccess(story: IRTSeeStory): void;
|
|
23
|
+
onSaveError(error: IRTSeeSignalingError): void;
|
|
24
|
+
cancel(): void;
|
|
25
|
+
private sanitizeStory;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=RTSeeManageStory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStory.d.ts","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EAExB,0BAA0B,EAAE,sBAAsB,EACnD,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAgB,qBAAqB,EAAE,iBAAiB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAC,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAqB,MAAM,aAAa,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,KAAK,EAAE,WAAW,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,sBAAsB,CAAC;IACrC,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,iBAAiB,CAA2B;IACrD,aAAa,EAAE,kBAAkB,CAAC;IAClC,qBAAqB,EAAE,qBAAqB,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAC1E,iBAAiB,EAAE,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IACnE,eAAe,EAAE,yBAAyB,CAAC;IAC3C,0BAA0B,EAAE,0BAA0B,CAAC;IAGvD,cAAc,EAAE,OAAO,CAAS;gBAEpB,OAAO,EAAE,wBAAwB;IA8D7C,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IASjE,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAStD,IAAI,CACR,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,iBAAiB,CAAC;IAoB1E,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAKvC,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI;IAK9C,MAAM;IAIN,OAAO,CAAC,aAAa;CAMtB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { PresentationSignalingEvents } from "@rtsee/common";
|
|
2
|
+
import { getPresentationRemoteActions, RTSeeManageStorySlides } from "@rtsee/presentation";
|
|
3
|
+
import { RTSeeFormAutocomplete, RTSeeImageCropper, RTSeeImageUploader } from "@rtsee/utilities-ui";
|
|
4
|
+
import { EventEmitter } from "events";
|
|
5
|
+
export class RTSeeManageStory extends EventEmitter {
|
|
6
|
+
story;
|
|
7
|
+
companionUrl;
|
|
8
|
+
manageSlides;
|
|
9
|
+
peer;
|
|
10
|
+
cropper = new RTSeeImageCropper();
|
|
11
|
+
imageUploader;
|
|
12
|
+
categoriesMultiselect;
|
|
13
|
+
labelsMultiselect;
|
|
14
|
+
signalingClient;
|
|
15
|
+
presentationsRemoteActions;
|
|
16
|
+
// ui
|
|
17
|
+
saveInProgress = false;
|
|
18
|
+
constructor(options) {
|
|
19
|
+
super();
|
|
20
|
+
this.story = this.sanitizeStory(options.story);
|
|
21
|
+
this.companionUrl = options.companionUrl;
|
|
22
|
+
this.peer = options.peer;
|
|
23
|
+
this.signalingClient = options.signalingClient;
|
|
24
|
+
this.presentationsRemoteActions = getPresentationRemoteActions(this.signalingClient);
|
|
25
|
+
if (!this.companionUrl || !this.peer) {
|
|
26
|
+
throw new Error('RTSeeManageStory: companionUrl/peer is missing');
|
|
27
|
+
}
|
|
28
|
+
this.imageUploader = new RTSeeImageUploader({
|
|
29
|
+
aspectRatio: 1,
|
|
30
|
+
resizeTo: 900,
|
|
31
|
+
companionUrl: this.companionUrl,
|
|
32
|
+
peer: this.peer,
|
|
33
|
+
uploadedPhotoPreview: this.story.imageUrl
|
|
34
|
+
});
|
|
35
|
+
this.categoriesMultiselect = new RTSeeFormAutocomplete({
|
|
36
|
+
inputName: 'Categories',
|
|
37
|
+
inputId: 'rtsee-story-categories-multiselect',
|
|
38
|
+
suggestions: [],
|
|
39
|
+
suggestionLabel: 'name',
|
|
40
|
+
suggestionId: 'id',
|
|
41
|
+
preselected: this.story.categoriesIds,
|
|
42
|
+
loadOnce: true,
|
|
43
|
+
allowMultipleSelections: true,
|
|
44
|
+
fluid: true,
|
|
45
|
+
getSuggestions: this.getStoryCategories.bind(this),
|
|
46
|
+
});
|
|
47
|
+
this.labelsMultiselect = new RTSeeFormAutocomplete({
|
|
48
|
+
inputName: 'Labels',
|
|
49
|
+
inputId: 'rtsee-story-labels-multiselect',
|
|
50
|
+
suggestions: [],
|
|
51
|
+
suggestionLabel: 'name',
|
|
52
|
+
suggestionId: 'id',
|
|
53
|
+
preselected: this.story.labelsIds,
|
|
54
|
+
loadOnce: true,
|
|
55
|
+
allowMultipleSelections: true,
|
|
56
|
+
fluid: true,
|
|
57
|
+
getSuggestions: this.getStoriesLabels.bind(this),
|
|
58
|
+
});
|
|
59
|
+
this.imageUploader.on('completed', (files) => {
|
|
60
|
+
if (!files || !files.length) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.story.imageUrl = files[0].url;
|
|
64
|
+
});
|
|
65
|
+
this.manageSlides = new RTSeeManageStorySlides({
|
|
66
|
+
story: this.story,
|
|
67
|
+
companionUrl: this.companionUrl,
|
|
68
|
+
peer: this.peer,
|
|
69
|
+
signalingClient: this.signalingClient,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getStoryCategories(query) {
|
|
73
|
+
console.log(`getStoryCategories, ${query}`);
|
|
74
|
+
try {
|
|
75
|
+
return this.presentationsRemoteActions.getCategories.send();
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
console.error(e);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
getStoriesLabels(query) {
|
|
82
|
+
console.log(`getStoryLabels(${query}`);
|
|
83
|
+
try {
|
|
84
|
+
return this.presentationsRemoteActions.getLabels.send();
|
|
85
|
+
}
|
|
86
|
+
catch (e) {
|
|
87
|
+
console.error(e);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async save(storyData) {
|
|
91
|
+
this.saveInProgress = true;
|
|
92
|
+
this.story.name = storyData.name;
|
|
93
|
+
this.story.description = storyData.description;
|
|
94
|
+
this.story.averageReadTime = storyData.averageReadTime;
|
|
95
|
+
this.story.categoriesIds = this.categoriesMultiselect.getSelectionIds();
|
|
96
|
+
this.story.labelsIds = this.labelsMultiselect.getSelectionIds();
|
|
97
|
+
try {
|
|
98
|
+
const action = this.story.id
|
|
99
|
+
? this.presentationsRemoteActions.editStory
|
|
100
|
+
: this.presentationsRemoteActions.createStory;
|
|
101
|
+
const story = await action.send(this.story);
|
|
102
|
+
this.onSaveSuccess(story);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
this.onSaveError(error);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
onSaveSuccess(story) {
|
|
109
|
+
this.saveInProgress = false;
|
|
110
|
+
this.emit(`${PresentationSignalingEvents.CREATE_STORY}-success`, story);
|
|
111
|
+
}
|
|
112
|
+
onSaveError(error) {
|
|
113
|
+
console.log(error);
|
|
114
|
+
this.saveInProgress = false;
|
|
115
|
+
}
|
|
116
|
+
cancel() {
|
|
117
|
+
this.emit('cancel-clicked');
|
|
118
|
+
}
|
|
119
|
+
sanitizeStory(story) {
|
|
120
|
+
if (!story.slides) {
|
|
121
|
+
story.slides = [];
|
|
122
|
+
}
|
|
123
|
+
return story;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=RTSeeManageStory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStory.js","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStory.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,4BAA4B,EACA,sBAAsB,EACnD,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAgB,qBAAqB,EAAE,iBAAiB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAEhH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAChD,KAAK,CAAc;IACnB,YAAY,CAAS;IACrB,YAAY,CAAyB;IACrC,IAAI,CAAQ;IACZ,OAA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AAkB;QAC9B,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,2BAA2B,CAAC,YAAY,UAAU,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;IAED,WAAW,CAAC,KAA2B;QACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC9B,CAAC;IAEO,aAAa,CAAC,KAAkB;QACtC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QACpB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IPresentationRemoteActions, IRTSeeManageStoriesCategoriesOptions, RTSeeManageStoryCategory } from "@rtsee/presentation";
|
|
2
|
+
import { IPeer, IRTSeeSignalingClientBase } from "@rtsee/core";
|
|
3
|
+
import { IRTSeeStoryCategory } from "@rtsee/common";
|
|
4
|
+
export declare class RTSeeManageStoryCategories {
|
|
5
|
+
categories: IRTSeeStoryCategory[];
|
|
6
|
+
peer: IPeer;
|
|
7
|
+
companionUrl: string;
|
|
8
|
+
signalingClient: IRTSeeSignalingClientBase;
|
|
9
|
+
selectedCategory: RTSeeManageStoryCategory | null;
|
|
10
|
+
presentationsRemoteActions: IPresentationRemoteActions;
|
|
11
|
+
loadCategoriesInProgress: boolean;
|
|
12
|
+
createHandler: (category: IRTSeeStoryCategory) => void;
|
|
13
|
+
updateHandler: (category: IRTSeeStoryCategory) => void;
|
|
14
|
+
cancelHandler: () => void;
|
|
15
|
+
constructor(options: IRTSeeManageStoriesCategoriesOptions);
|
|
16
|
+
loadCategories(): Promise<void>;
|
|
17
|
+
selectCategory(categoryId: string): void;
|
|
18
|
+
selectNewCategory(): void;
|
|
19
|
+
private setSelectedCategory;
|
|
20
|
+
private getCategoryById;
|
|
21
|
+
private deselectCategory;
|
|
22
|
+
private unsubscribeFromManageCategoryEvents;
|
|
23
|
+
private subscribeToManageCategoryEvents;
|
|
24
|
+
private onCategoryUpdated;
|
|
25
|
+
private onCategoryCreated;
|
|
26
|
+
private onCategoryFormCancelClicked;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=RTSeeManageStoryCategories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStoryCategories.d.ts","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStoryCategories.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,EACpC,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,qBAAa,0BAA0B;IACrC,UAAU,EAAE,mBAAmB,EAAE,CAAM;IAEvC,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,yBAAyB,CAAC;IAC3C,gBAAgB,EAAE,wBAAwB,GAAG,IAAI,CAAQ;IACzD,0BAA0B,EAAE,0BAA0B,CAAC;IAEvD,wBAAwB,EAAE,OAAO,CAAS;IAE1C,aAAa,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACvD,aAAa,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACvD,aAAa,EAAE,MAAM,IAAI,CAAC;gBAGxB,OAAO,EAAE,oCAAoC;IAazC,cAAc;IAepB,cAAc,CAAC,UAAU,EAAE,MAAM;IAUjC,iBAAiB;IAWjB,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,mCAAmC;IAM3C,OAAO,CAAC,+BAA+B;IAMvC,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,2BAA2B;CAGpC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { RTSeeManageStoryCategory } from "@rtsee/presentation";
|
|
2
|
+
export class RTSeeManageStoryCategories {
|
|
3
|
+
categories = [];
|
|
4
|
+
peer;
|
|
5
|
+
companionUrl;
|
|
6
|
+
signalingClient;
|
|
7
|
+
selectedCategory = null;
|
|
8
|
+
presentationsRemoteActions;
|
|
9
|
+
loadCategoriesInProgress = false;
|
|
10
|
+
createHandler;
|
|
11
|
+
updateHandler;
|
|
12
|
+
cancelHandler;
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.peer = options.peer;
|
|
15
|
+
this.companionUrl = options.companionUrl;
|
|
16
|
+
this.signalingClient = options.signalingClient;
|
|
17
|
+
this.presentationsRemoteActions = options.presentationsRemoteActions;
|
|
18
|
+
this.createHandler = this.onCategoryCreated.bind(this);
|
|
19
|
+
this.updateHandler = this.onCategoryUpdated.bind(this);
|
|
20
|
+
this.cancelHandler = this.onCategoryFormCancelClicked.bind(this);
|
|
21
|
+
void this.loadCategories();
|
|
22
|
+
}
|
|
23
|
+
async loadCategories() {
|
|
24
|
+
this.categories.length = 0;
|
|
25
|
+
this.loadCategoriesInProgress = true;
|
|
26
|
+
try {
|
|
27
|
+
const categories = await this
|
|
28
|
+
.presentationsRemoteActions.getCategories.send();
|
|
29
|
+
this.categories.push(...categories);
|
|
30
|
+
this.loadCategoriesInProgress = false;
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
this.loadCategoriesInProgress = false;
|
|
34
|
+
console.error(e);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
selectCategory(categoryId) {
|
|
38
|
+
const category = this.getCategoryById(categoryId);
|
|
39
|
+
if (!category) {
|
|
40
|
+
throw new Error(`No category with id: ${categoryId}`);
|
|
41
|
+
}
|
|
42
|
+
this.setSelectedCategory(category);
|
|
43
|
+
}
|
|
44
|
+
selectNewCategory() {
|
|
45
|
+
const newCategory = {
|
|
46
|
+
id: '',
|
|
47
|
+
name: '',
|
|
48
|
+
description: '',
|
|
49
|
+
stories: []
|
|
50
|
+
};
|
|
51
|
+
this.setSelectedCategory(newCategory);
|
|
52
|
+
}
|
|
53
|
+
setSelectedCategory(category) {
|
|
54
|
+
this.selectedCategory = new RTSeeManageStoryCategory({
|
|
55
|
+
category,
|
|
56
|
+
peer: this.peer,
|
|
57
|
+
companionUrl: this.companionUrl,
|
|
58
|
+
signalingClient: this.signalingClient,
|
|
59
|
+
presentationsRemoteActions: this.presentationsRemoteActions,
|
|
60
|
+
});
|
|
61
|
+
this.subscribeToManageCategoryEvents();
|
|
62
|
+
}
|
|
63
|
+
getCategoryById(categoryId) {
|
|
64
|
+
return this.categories
|
|
65
|
+
.find((category) => category.id === categoryId) || null;
|
|
66
|
+
}
|
|
67
|
+
deselectCategory() {
|
|
68
|
+
this.unsubscribeFromManageCategoryEvents();
|
|
69
|
+
this.selectedCategory = null;
|
|
70
|
+
}
|
|
71
|
+
unsubscribeFromManageCategoryEvents() {
|
|
72
|
+
this.selectedCategory.off('created', this.createHandler);
|
|
73
|
+
this.selectedCategory.off('updated', this.updateHandler);
|
|
74
|
+
this.selectedCategory.off('cancel-clicked', this.cancelHandler);
|
|
75
|
+
}
|
|
76
|
+
subscribeToManageCategoryEvents() {
|
|
77
|
+
this.selectedCategory.on('created', this.createHandler);
|
|
78
|
+
this.selectedCategory.on('updated', this.updateHandler);
|
|
79
|
+
this.selectedCategory.on('cancel-clicked', this.cancelHandler);
|
|
80
|
+
}
|
|
81
|
+
onCategoryUpdated(category) {
|
|
82
|
+
console.log(`Successfully updated category: ${category.id}, ${category.name}`);
|
|
83
|
+
this.deselectCategory();
|
|
84
|
+
}
|
|
85
|
+
onCategoryCreated(category) {
|
|
86
|
+
this.categories.push(category);
|
|
87
|
+
this.deselectCategory();
|
|
88
|
+
}
|
|
89
|
+
onCategoryFormCancelClicked() {
|
|
90
|
+
this.deselectCategory();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=RTSeeManageStoryCategories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStoryCategories.js","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStoryCategories.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAI7B,MAAM,OAAO,0BAA0B;IACrC,UAAU,GAA0B,EAAE,CAAC;IAEvC,IAAI,CAAQ;IACZ,YAAY,CAAS;IACrB,eAAe,CAA4B;IAC3C,gBAAgB,GAAoC,IAAI,CAAC;IACzD,0BAA0B,CAA6B;IAEvD,wBAAwB,GAAY,KAAK,CAAC;IAE1C,aAAa,CAA0C;IACvD,aAAa,CAA0C;IACvD,aAAa,CAAa;IAE1B,YACE,OAA6C;QAE7C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;QAErE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAA4C,CAAC;QAClG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAA4C,CAAC;QAClG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAe,CAAC;QAC/E,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,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gBAAgB,EAAE,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IPresentationRemoteActions, IRTSeeManageStoriesCategoryOptions } from "@rtsee/presentation";
|
|
2
|
+
import { IPeer, IRTSeeSignalingClientBase } from "@rtsee/core";
|
|
3
|
+
import { IRTSeeStoryCategory } from "@rtsee/common";
|
|
4
|
+
import { EventEmitter } from "events";
|
|
5
|
+
export declare class RTSeeManageStoryCategory extends EventEmitter {
|
|
6
|
+
category: IRTSeeStoryCategory;
|
|
7
|
+
peer: IPeer;
|
|
8
|
+
companionUrl: string;
|
|
9
|
+
signalingClient: IRTSeeSignalingClientBase;
|
|
10
|
+
saveInProgress: boolean;
|
|
11
|
+
presentationsRemoteActions: IPresentationRemoteActions;
|
|
12
|
+
constructor(options: IRTSeeManageStoriesCategoryOptions);
|
|
13
|
+
save(categoryData: Pick<IRTSeeStoryCategory, 'name' | 'description'>): Promise<void>;
|
|
14
|
+
onSuccess(categoryData: IRTSeeStoryCategory): void;
|
|
15
|
+
onError(error: unknown): void;
|
|
16
|
+
cancel(): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=RTSeeManageStoryCategory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStoryCategory.d.ts","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStoryCategory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,0BAA0B,EAAE,kCAAkC,EAAC,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAC,KAAK,EAAE,yBAAyB,EAAqB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAEpC,qBAAa,wBAAyB,SAAQ,YAAY;IACxD,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,yBAAyB,CAAC;IAE3C,cAAc,EAAE,OAAO,CAAS;IAChC,0BAA0B,EAAE,0BAA0B,CAAC;gBAE3C,OAAO,EAAE,kCAAkC;IAUjD,IAAI,CACR,YAAY,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,aAAa,CAAC;IAkBjE,SAAS,CAAC,YAAY,EAAE,mBAAmB;IAW3C,OAAO,CAAC,KAAK,EAAE,OAAO;IAKtB,MAAM;CAGP"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EventEmitter } from "events";
|
|
2
|
+
export class RTSeeManageStoryCategory extends EventEmitter {
|
|
3
|
+
category;
|
|
4
|
+
peer;
|
|
5
|
+
companionUrl;
|
|
6
|
+
signalingClient;
|
|
7
|
+
saveInProgress = false;
|
|
8
|
+
presentationsRemoteActions;
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super();
|
|
11
|
+
this.category = options.category;
|
|
12
|
+
this.peer = options.peer;
|
|
13
|
+
this.companionUrl = options.companionUrl;
|
|
14
|
+
this.signalingClient = options.signalingClient;
|
|
15
|
+
this.presentationsRemoteActions = options.presentationsRemoteActions;
|
|
16
|
+
}
|
|
17
|
+
async save(categoryData) {
|
|
18
|
+
this.saveInProgress = true;
|
|
19
|
+
this.category.name = categoryData.name;
|
|
20
|
+
this.category.description = categoryData.description;
|
|
21
|
+
const action = this.category.id
|
|
22
|
+
? this.presentationsRemoteActions.editCategory
|
|
23
|
+
: this.presentationsRemoteActions.createCategory;
|
|
24
|
+
try {
|
|
25
|
+
const result = await action.send(this.category);
|
|
26
|
+
this.onSuccess(result);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
this.onError(error);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
onSuccess(categoryData) {
|
|
33
|
+
this.saveInProgress = false;
|
|
34
|
+
if (this.category.id) {
|
|
35
|
+
this.emit('updated', categoryData);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.category.id = categoryData.id;
|
|
39
|
+
this.emit('created', categoryData);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
onError(error) {
|
|
43
|
+
this.saveInProgress = false;
|
|
44
|
+
console.error(error);
|
|
45
|
+
}
|
|
46
|
+
cancel() {
|
|
47
|
+
this.emit('cancel-clicked');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=RTSeeManageStoryCategory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStoryCategory.js","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStoryCategory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAEpC,MAAM,OAAO,wBAAyB,SAAQ,YAAY;IACxD,QAAQ,CAAsB;IAE9B,IAAI,CAAQ;IACZ,YAAY,CAAS;IACrB,eAAe,CAA4B;IAE3C,cAAc,GAAY,KAAK,CAAC;IAChC,0BAA0B,CAA6B;IAEvD,YAAY,OAA2C;QACrD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,IAAI,CACR,YAA+D;QAE/D,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QAErD,MAAM,MAAM,GAAiE,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC3F,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,YAAY;YAC9C,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,cAAc,CAAC;QAEnD,IAAI,CAAC;YACH,MAAM,MAAM,GAAwB,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,SAAS,CAAC,YAAiC;QACzC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAE5B,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,YAAY,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,OAAO,CAAC,KAAc;QACpB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IPresentationRemoteActions, IRTSeeManageStoryLabelOptions } from "@rtsee/presentation";
|
|
2
|
+
import { IPeer, IRTSeeSignalingClientBase } from "@rtsee/core";
|
|
3
|
+
import { IRTSeeStoryLabel } from "@rtsee/common";
|
|
4
|
+
import { EventEmitter } from "events";
|
|
5
|
+
export declare class RTSeeManageStoryLabel extends EventEmitter {
|
|
6
|
+
label: IRTSeeStoryLabel;
|
|
7
|
+
peer: IPeer;
|
|
8
|
+
companionUrl: string;
|
|
9
|
+
signalingClient: IRTSeeSignalingClientBase;
|
|
10
|
+
saveInProgress: boolean;
|
|
11
|
+
presentationsRemoteActions: IPresentationRemoteActions;
|
|
12
|
+
constructor(options: IRTSeeManageStoryLabelOptions);
|
|
13
|
+
save(labelData: Pick<IRTSeeStoryLabel, 'name' | 'description' | 'color' | 'symbol'>): Promise<void>;
|
|
14
|
+
private onSuccess;
|
|
15
|
+
private onError;
|
|
16
|
+
cancel(): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=RTSeeManageStoryLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTSeeManageStoryLabel.d.ts","sourceRoot":"","sources":["../../../../../src/models/manage/RTSeeManageStoryLabel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,0BAA0B,EAAE,6BAA6B,EAAC,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAC,KAAK,EAAE,yBAAyB,EAAqB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,qBAAsB,SAAQ,YAAY;IACrD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,yBAAyB,CAAC;IAE3C,cAAc,EAAE,OAAO,CAAS;IAChC,0BAA0B,EAAE,0BAA0B,CAAC;gBAE3C,OAAO,EAAE,6BAA6B;IAU5C,IAAI,CACR,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;IAoBhF,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,OAAO;IAKf,MAAM;CAGP"}
|