@rtsee/presentation 0.0.109 → 0.0.110

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 +57 -0
  6. package/dist/presentation/src/models/editor/RTSeeIllustrator.d.ts.map +1 -0
  7. package/dist/presentation/src/models/editor/RTSeeIllustrator.js +443 -0
  8. package/dist/presentation/src/models/editor/RTSeeIllustrator.js.map +1 -0
  9. package/dist/presentation/src/models/editor/RTSeeInteractiveStoryEditorVm.d.ts +92 -0
  10. package/dist/presentation/src/models/editor/RTSeeInteractiveStoryEditorVm.d.ts.map +1 -0
  11. package/dist/presentation/src/models/editor/RTSeeInteractiveStoryEditorVm.js +494 -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 @@
1
+ {"version":3,"file":"RTSeeStoryCharacter.js","sourceRoot":"","sources":["../../../../../src/models/story-elements/RTSeeStoryCharacter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,8BAA8B,GAE/B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAKpE,yEAAyE;AACzE,MAAM,OAAO,mBACX,SAAQ,uBAA6C;IAGrD,YAAY,OAAoC;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAES,cAAc;QACtB,OAAO,8BAA8B,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -0,0 +1,42 @@
1
+ import { IEntitiesRemoteActions, IRTSeeEntity, ITagsRemoteActions } from "@rtsee/common";
2
+ import { IRTSeeHandlerCommonOptions } from "@rtsee/core";
3
+ import { RTSeeEntity } from "@rtsee/utilities-ui";
4
+ import { IPresentationRemoteActions } from "../remote-actions/PresentationRemoteActions";
5
+ import { IStoryElementRemoteActions } from "../remote-actions/StoryElementsRemoteActions";
6
+ export interface IRTSeeStoryCrudEntityOptions<T extends IRTSeeEntity> extends IRTSeeHandlerCommonOptions {
7
+ data: T;
8
+ /** entities & tags remote actions (comments, rates, tags of the mirrored RtsEntity) */
9
+ remoteActions?: IEntitiesRemoteActions & ITagsRemoteActions;
10
+ /** presentation remote actions, created from the signalingClient when omitted */
11
+ presentationRemoteActions?: IPresentationRemoteActions | null;
12
+ }
13
+ export type RTSeeStoryCrudEntityEvents = "saved" | "deleted" | "save-error";
14
+ /**
15
+ * Base class of the story domain entities (characters, artifacts, locations, authors).
16
+ * Holds the presentation remote actions needed to create / read / update / delete itself.
17
+ * The entity shares its id with the mirrored RtsEntity (tags, rates, comments).
18
+ */
19
+ export declare abstract class RTSeeStoryCrudEntity<T extends IRTSeeEntity> extends RTSeeEntity {
20
+ presentationRemoteActions: IPresentationRemoteActions | null;
21
+ deleteInProgress: boolean;
22
+ lastError: string | null;
23
+ protected constructor(options: IRTSeeStoryCrudEntityOptions<T>);
24
+ /** CRUD remote actions of the concrete entity */
25
+ protected abstract getCrudActions(): IStoryElementRemoteActions<T, any, any, any, any>;
26
+ /** Applies the remote data to the entity */
27
+ abstract applyData(data: T): void;
28
+ /** Base entity fields (subclasses extend it with their own fields) */
29
+ toJson(): T;
30
+ get isNew(): boolean;
31
+ /**
32
+ * Creates (no id yet) or updates the entity.
33
+ * @param changes - values to apply before saving (e.g. form model)
34
+ * @param extraPayload - additional payload fields (e.g. storyId to attach the element to)
35
+ */
36
+ save(changes?: Partial<T>, extraPayload?: Record<string, unknown>): Promise<T>;
37
+ remove(): Promise<T | null>;
38
+ refresh(): Promise<T | null>;
39
+ protected ensureActions(): IPresentationRemoteActions;
40
+ private getErrorMessage;
41
+ }
42
+ //# sourceMappingURL=RTSeeStoryCrudEntity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeStoryCrudEntity.d.ts","sourceRoot":"","sources":["../../../../../src/models/story-elements/RTSeeStoryCrudEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAEL,0BAA0B,EAC3B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAE1F,MAAM,WAAW,4BAA4B,CAAC,CAAC,SAAS,YAAY,CAClE,SAAQ,0BAA0B;IAClC,IAAI,EAAE,CAAC,CAAC;IACR,uFAAuF;IACvF,aAAa,CAAC,EAAE,sBAAsB,GAAG,kBAAkB,CAAC;IAC5D,iFAAiF;IACjF,yBAAyB,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAC/D;AAED,MAAM,MAAM,0BAA0B,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,CAAC;AAE5E;;;;GAIG;AACH,8BAAsB,oBAAoB,CACxC,CAAC,SAAS,YAAY,CACtB,SAAQ,WAAW;IACnB,yBAAyB,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAC7D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,SAAS,aAAa,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC;IAiB9D,iDAAiD;IACjD,SAAS,CAAC,QAAQ,CAAC,cAAc,IAAI,0BAA0B,CAC7D,CAAC,EACD,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,CACJ;IAED,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAEjC,sEAAsE;IAC7D,MAAM,IAAI,CAAC;IAIpB,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED;;;;OAIG;IACG,IAAI,CACR,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EACpB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,CAAC,CAAC;IA2BP,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAoB3B,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAgBlC,SAAS,CAAC,aAAa,IAAI,0BAA0B;IASrD,OAAO,CAAC,eAAe;CAIxB"}
@@ -0,0 +1,106 @@
1
+ import { RTSeeEntity } from "@rtsee/utilities-ui";
2
+ import { getPresentationRemoteActions, } from "../remote-actions/PresentationRemoteActions";
3
+ /**
4
+ * Base class of the story domain entities (characters, artifacts, locations, authors).
5
+ * Holds the presentation remote actions needed to create / read / update / delete itself.
6
+ * The entity shares its id with the mirrored RtsEntity (tags, rates, comments).
7
+ */
8
+ export class RTSeeStoryCrudEntity extends RTSeeEntity {
9
+ presentationRemoteActions;
10
+ deleteInProgress;
11
+ lastError;
12
+ constructor(options) {
13
+ super({
14
+ ...options,
15
+ applicationId: options.data.applicationId || options.applicationId,
16
+ entityData: options.data,
17
+ remoteActions: options.remoteActions,
18
+ });
19
+ this.deleteInProgress = false;
20
+ this.lastError = null;
21
+ this.presentationRemoteActions =
22
+ options.presentationRemoteActions ||
23
+ (options.signalingClient
24
+ ? getPresentationRemoteActions(options.signalingClient)
25
+ : null);
26
+ }
27
+ /** Base entity fields (subclasses extend it with their own fields) */
28
+ toJson() {
29
+ return super.toJson();
30
+ }
31
+ get isNew() {
32
+ return !this.id;
33
+ }
34
+ /**
35
+ * Creates (no id yet) or updates the entity.
36
+ * @param changes - values to apply before saving (e.g. form model)
37
+ * @param extraPayload - additional payload fields (e.g. storyId to attach the element to)
38
+ */
39
+ async save(changes, extraPayload) {
40
+ if (changes) {
41
+ this.applyData({ ...this.toJson(), ...changes, id: this.id });
42
+ }
43
+ this.saveInProgress = true;
44
+ this.lastError = null;
45
+ try {
46
+ const actions = this.getCrudActions();
47
+ const payload = { ...this.toJson(), ...(extraPayload || {}) };
48
+ const result = this.isNew
49
+ ? await actions.create.send(payload)
50
+ : await actions.edit.send(payload);
51
+ this.applyData(result);
52
+ this.saveInProgress = false;
53
+ this.emit("saved", result);
54
+ return result;
55
+ }
56
+ catch (e) {
57
+ this.saveInProgress = false;
58
+ this.lastError = this.getErrorMessage(e);
59
+ this.emit("save-error", e);
60
+ throw e;
61
+ }
62
+ }
63
+ async remove() {
64
+ if (this.isNew) {
65
+ return null;
66
+ }
67
+ this.deleteInProgress = true;
68
+ this.lastError = null;
69
+ try {
70
+ const result = await this.getCrudActions().delete.send(this.id);
71
+ this.deleteInProgress = false;
72
+ this.emit("deleted", result);
73
+ return result;
74
+ }
75
+ catch (e) {
76
+ this.deleteInProgress = false;
77
+ this.lastError = this.getErrorMessage(e);
78
+ throw e;
79
+ }
80
+ }
81
+ async refresh() {
82
+ if (this.isNew) {
83
+ return null;
84
+ }
85
+ this.loadInProgress = true;
86
+ try {
87
+ const result = await this.getCrudActions().get.send(this.id);
88
+ this.applyData(result);
89
+ return result;
90
+ }
91
+ finally {
92
+ this.loadInProgress = false;
93
+ }
94
+ }
95
+ ensureActions() {
96
+ if (!this.presentationRemoteActions) {
97
+ throw new Error(`${this.constructor.name}: presentation remote actions are not available (no signalingClient)`);
98
+ }
99
+ return this.presentationRemoteActions;
100
+ }
101
+ getErrorMessage(e) {
102
+ const error = e;
103
+ return error?.friendlyMessage || error?.message || `${e}`;
104
+ }
105
+ }
106
+ //# sourceMappingURL=RTSeeStoryCrudEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeStoryCrudEntity.js","sourceRo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
+ * Shared shape of characters, artifacts & locations.
5
+ */
6
+ export declare abstract class RTSeeStoryElementEntity<T extends IRTSeeStoryElement> extends RTSeeStoryCrudEntity<T> {
7
+ description: string;
8
+ visualDescription: string;
9
+ images: IRTSeeImage[];
10
+ protected constructor(options: IRTSeeStoryCrudEntityOptions<T>);
11
+ applyData(data: T): void;
12
+ /** Short description used by the thumbnails */
13
+ getTruncatedDescription(maxLength?: number): string;
14
+ toJson(): T;
15
+ /** Builds the base (blank) data of a new element */
16
+ static getBlankData<D extends IRTSeeStoryElement>(applicationId: string): D;
17
+ }
18
+ //# sourceMappingURL=RTSeeStoryElementEntity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeStoryElementEntity.d.ts","sourceRoot":"","sources":["../../../../../src/models/story-elements/RTSeeStoryElementEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,8BAAsB,uBAAuB,CAC3C,CAAC,SAAS,kBAAkB,CAC5B,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,SAAS,aAAa,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC;IAS9D,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAcxB,+CAA+C;IAC/C,uBAAuB,CAAC,SAAS,GAAE,MAAY,GAAG,MAAM;IAOxD,MAAM,IAAI,CAAC;IAUX,oDAAoD;IACpD,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,kBAAkB,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;CAc5E"}
@@ -0,0 +1,60 @@
1
+ import { RTSeeStoryCrudEntity, } from "./RTSeeStoryCrudEntity";
2
+ /**
3
+ * Shared shape of characters, artifacts & locations.
4
+ */
5
+ export class RTSeeStoryElementEntity extends RTSeeStoryCrudEntity {
6
+ description;
7
+ visualDescription;
8
+ images;
9
+ constructor(options) {
10
+ super(options);
11
+ this.description = "";
12
+ this.visualDescription = "";
13
+ this.images = [];
14
+ this.applyData(options.data);
15
+ }
16
+ applyData(data) {
17
+ this.init(data);
18
+ this.id = data.id || this.id || "";
19
+ this.name = data.name || "";
20
+ this.imageUrl = data.imageUrl || null;
21
+ this.configurationId = data.configurationId || this.configurationId || "";
22
+ this.description = data.description || "";
23
+ this.visualDescription = data.visualDescription || "";
24
+ this.images = data.images || [];
25
+ this.tagIds = data.tagIds || [];
26
+ this.tags = data.tags || [];
27
+ }
28
+ /** Short description used by the thumbnails */
29
+ getTruncatedDescription(maxLength = 120) {
30
+ if (!this.description || this.description.length <= maxLength) {
31
+ return this.description;
32
+ }
33
+ return `${this.description.substring(0, maxLength).trim()}…`;
34
+ }
35
+ toJson() {
36
+ return {
37
+ ...super.toJson(),
38
+ imageUrl: this.imageUrl || "",
39
+ description: this.description,
40
+ visualDescription: this.visualDescription,
41
+ images: this.images,
42
+ };
43
+ }
44
+ /** Builds the base (blank) data of a new element */
45
+ static getBlankData(applicationId) {
46
+ return {
47
+ id: "",
48
+ applicationId,
49
+ configurationId: "",
50
+ name: "",
51
+ imageUrl: "",
52
+ description: "",
53
+ visualDescription: "",
54
+ images: [],
55
+ tagIds: [],
56
+ tags: [],
57
+ };
58
+ }
59
+ }
60
+ //# sourceMappingURL=RTSeeStoryElementEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeStoryElementEntity.js","sourceRoot":"","sources":["../../../../../src/models/story-elements/RTSeeStoryElementEntity.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,OAAgB,uBAEpB,SAAQ,oBAAuB;IAC/B,WAAW,CAAS;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CAAC;QACD,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC;IAC/D,CAAC;IAED,MAAM;QACJ,OAAO;YACL,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,MAAM,EAAE,IAAI,CAAC,MAAM;SACf,CAAC;IACT,CAAC;IAED,oDAAoD;IACpD,MAAM,CAAC,YAAY,CAA+B,aAAqB;QACrE,OAAO;YACL,EAAE,EAAE,EAAE;YACN,aAAa;YACb,eAAe,EAAE,EAAE;YACnB,IAAI,EAAE,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;SACJ,CAAC;IACT,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { IRTSeeStoryLocation } from "@rtsee/common";
2
+ import { IStoryLocationRemoteActions } from "../remote-actions/StoryElementsRemoteActions";
3
+ import { IRTSeeStoryCrudEntityOptions } from "./RTSeeStoryCrudEntity";
4
+ import { RTSeeStoryElementEntity } from "./RTSeeStoryElementEntity";
5
+ export type IRTSeeStoryLocationOptions = IRTSeeStoryCrudEntityOptions<IRTSeeStoryLocation>;
6
+ /** Place where episodes of a story take place; can belong to multiple stories */
7
+ export declare class RTSeeStoryLocation extends RTSeeStoryElementEntity<IRTSeeStoryLocation> implements IRTSeeStoryLocation {
8
+ constructor(options: IRTSeeStoryLocationOptions);
9
+ protected getCrudActions(): IStoryLocationRemoteActions;
10
+ }
11
+ //# sourceMappingURL=RTSeeStoryLocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeStoryLocation.d.ts","sourceRoot":"","sources":["../../../../../src/models/story-elements/RTSeeStoryLocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAEL,2BAA2B,EAC5B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,MAAM,0BAA0B,GACpC,4BAA4B,CAAC,mBAAmB,CAAC,CAAC;AAEpD,iFAAiF;AACjF,qBAAa,kBACX,SAAQ,uBAAuB,CAAC,mBAAmB,CACnD,YAAW,mBAAmB;gBAElB,OAAO,EAAE,0BAA0B;IAI/C,SAAS,CAAC,cAAc,IAAI,2BAA2B;CAGxD"}
@@ -0,0 +1,12 @@
1
+ import { getStoryLocationRemoteActions, } from "../remote-actions/StoryElementsRemoteActions";
2
+ import { RTSeeStoryElementEntity } from "./RTSeeStoryElementEntity";
3
+ /** Place where episodes of a story take place; can belong to multiple stories */
4
+ export class RTSeeStoryLocation extends RTSeeStoryElementEntity {
5
+ constructor(options) {
6
+ super(options);
7
+ }
8
+ getCrudActions() {
9
+ return getStoryLocationRemoteActions(this.ensureActions());
10
+ }
11
+ }
12
+ //# sourceMappingURL=RTSeeStoryLocation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTSeeStoryLocation.js","sourceRoot":"","sources":["../../../../../src/models/story-elements/RTSeeStoryLocation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,GAE9B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAKpE,iFAAiF;AACjF,MAAM,OAAO,kBACX,SAAQ,uBAA4C;IAGpD,YAAY,OAAmC;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAES,cAAc;QACtB,OAAO,6BAA6B,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ export * from "./RTSeeStoryCrudEntity";
2
+ export * from "./RTSeeStoryElementEntity";
3
+ export * from "./RTSeeStoryCharacter";
4
+ export * from "./RTSeeStoryArtifact";
5
+ export * from "./RTSeeStoryLocation";
6
+ export * from "./RTSeeStoryAuthor";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/models/story-elements/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./RTSeeStoryCrudEntity";
2
+ export * from "./RTSeeStoryElementEntity";
3
+ export * from "./RTSeeStoryCharacter";
4
+ export * from "./RTSeeStoryArtifact";
5
+ export * from "./RTSeeStoryLocation";
6
+ export * from "./RTSeeStoryAuthor";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/models/story-elements/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtsee/presentation",
3
- "version": "0.0.109",
3
+ "version": "0.0.110",
4
4
  "license": "ISC",
5
5
  "private": false,
6
6
  "main": "dist/presentation/src/index",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "901fd61fa4b5b985e199a6e74626dc14aa549d10"
51
+ "gitHead": "9356d4ce9d6ed8749f09d7e70e60ea9c8593d36f"
52
52
  }