@vived/app 4.19.1 → 4.21.0

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 (90) hide show
  1. package/lib/Components/ChannelModel/Controllers/clickSelectChannelModel.d.ts +2 -0
  2. package/lib/Components/ChannelModel/Controllers/clickSelectChannelModel.js +13 -0
  3. package/lib/Components/ChannelModel/Controllers/index.d.ts +1 -0
  4. package/lib/Components/ChannelModel/Controllers/index.js +1 -0
  5. package/lib/Components/ChannelModel/Mocks/LoadChannelModelMock.d.ts +9 -0
  6. package/lib/Components/ChannelModel/Mocks/LoadChannelModelMock.js +16 -0
  7. package/lib/Components/ChannelModel/Mocks/SelectChannelModelUCMock.d.ts +8 -0
  8. package/lib/Components/ChannelModel/Mocks/SelectChannelModelUCMock.js +15 -0
  9. package/lib/Components/ChannelModel/Mocks/index.d.ts +2 -0
  10. package/lib/Components/ChannelModel/Mocks/index.js +2 -0
  11. package/lib/Components/ChannelModel/UC/LoadChannelModelUC.d.ts +10 -0
  12. package/lib/Components/ChannelModel/UC/LoadChannelModelUC.js +132 -0
  13. package/lib/Components/ChannelModel/UC/SelectChannelModelUC.js +28 -34
  14. package/lib/Components/ChannelModel/UC/index.d.ts +2 -0
  15. package/lib/Components/ChannelModel/UC/index.js +2 -0
  16. package/lib/Components/Dispatcher/Mocks/GetAssetBlobURLUCMock.d.ts +8 -0
  17. package/lib/Components/Dispatcher/Mocks/GetAssetBlobURLUCMock.js +15 -0
  18. package/lib/Components/Dispatcher/Mocks/GetLinkedAssetsUCMock.d.ts +8 -0
  19. package/lib/Components/Dispatcher/Mocks/GetLinkedAssetsUCMock.js +15 -0
  20. package/lib/Components/Dispatcher/Mocks/MockGetAssetFolderURL.d.ts +1 -1
  21. package/lib/Components/Dispatcher/Mocks/MockGetAssetFolderURL.js +3 -3
  22. package/lib/Components/Dispatcher/Mocks/MockShowAlert.d.ts +1 -1
  23. package/lib/Components/Dispatcher/Mocks/MockShowAlert.js +3 -3
  24. package/lib/Components/Dispatcher/Mocks/MockShowConfirm.d.ts +1 -1
  25. package/lib/Components/Dispatcher/Mocks/MockShowConfirm.js +3 -3
  26. package/lib/Components/Dispatcher/Mocks/MockShowMarkdown.d.ts +1 -1
  27. package/lib/Components/Dispatcher/Mocks/MockShowMarkdown.js +3 -3
  28. package/lib/Components/Dispatcher/Mocks/MockShowSpinner.d.ts +8 -0
  29. package/lib/Components/Dispatcher/Mocks/MockShowSpinner.js +15 -0
  30. package/lib/Components/Dispatcher/Mocks/MockSubmitResult.d.ts +1 -1
  31. package/lib/Components/Dispatcher/Mocks/MockSubmitResult.js +3 -3
  32. package/lib/Components/Dispatcher/Mocks/ShowSelectModelUCMock.d.ts +8 -0
  33. package/lib/Components/Dispatcher/Mocks/ShowSelectModelUCMock.js +15 -0
  34. package/lib/Components/Dispatcher/Mocks/index.d.ts +6 -1
  35. package/lib/Components/Dispatcher/Mocks/index.js +6 -1
  36. package/lib/Components/Dispatcher/UC/AppIsReadyUC.js +5 -5
  37. package/lib/Components/Dispatcher/UC/DispatchStartZSpaceUC.js +5 -5
  38. package/lib/Components/Dispatcher/UC/DispatchStateChangeUC.js +4 -4
  39. package/lib/Components/Dispatcher/UC/DispatchStopZSpaceUC.js +5 -5
  40. package/lib/Components/Dispatcher/UC/GetAssetBlobURLUC.js +21 -21
  41. package/lib/Components/Dispatcher/UC/GetAssetFolderURLUC.js +20 -20
  42. package/lib/Components/Dispatcher/UC/GetAssetMetaUC.js +21 -21
  43. package/lib/Components/Dispatcher/UC/GetAssetsForOwnerUC.js +21 -21
  44. package/lib/Components/Dispatcher/UC/GetLinkedAssetsUC.js +22 -22
  45. package/lib/Components/Dispatcher/UC/GoToNextStateUC.js +5 -5
  46. package/lib/Components/Dispatcher/UC/GoToPreviousStateUC.js +5 -5
  47. package/lib/Components/Dispatcher/UC/HasNextStateUC.js +15 -15
  48. package/lib/Components/Dispatcher/UC/HasPreviousStateUC.js +15 -15
  49. package/lib/Components/Dispatcher/UC/IsAssetFetchedUC.js +16 -16
  50. package/lib/Components/Dispatcher/UC/IsZSpaceAvailableUC.js +15 -15
  51. package/lib/Components/Dispatcher/UC/LogUC.js +12 -12
  52. package/lib/Components/Dispatcher/UC/RegisterExternalStylesheetsUC.js +7 -7
  53. package/lib/Components/Dispatcher/UC/RestoreCurrentStateUC.js +5 -5
  54. package/lib/Components/Dispatcher/UC/ShowAlertUC.js +11 -11
  55. package/lib/Components/Dispatcher/UC/ShowConfirmUC.js +13 -13
  56. package/lib/Components/Dispatcher/UC/ShowMarkdownEditorUC.js +13 -13
  57. package/lib/Components/Dispatcher/UC/ShowSelectModelUC.js +15 -15
  58. package/lib/Components/Dispatcher/UC/StateIsCompleteUC.js +5 -5
  59. package/lib/Components/Dispatcher/UC/SubmitActivityAssetUC.js +21 -21
  60. package/lib/Components/Dispatcher/UC/SubmitResultResultUC.js +69 -69
  61. package/lib/Components/Dispatcher/index.d.ts +1 -0
  62. package/lib/Components/Dispatcher/index.js +1 -0
  63. package/lib/Components/FeatureFlags/Adapters/featureFlagsAdapter.d.ts +2 -0
  64. package/lib/Components/FeatureFlags/Adapters/featureFlagsAdapter.js +23 -0
  65. package/lib/Components/FeatureFlags/Adapters/index.d.ts +1 -0
  66. package/lib/Components/FeatureFlags/Adapters/index.js +13 -0
  67. package/lib/Components/FeatureFlags/Entity/FeatureFlagEntity.d.ts +10 -0
  68. package/lib/Components/FeatureFlags/Entity/FeatureFlagEntity.js +40 -0
  69. package/lib/Components/FeatureFlags/Entity/index.d.ts +1 -0
  70. package/lib/Components/FeatureFlags/Entity/index.js +13 -0
  71. package/lib/Components/FeatureFlags/Mocks/FeatureFlagsPMMock.d.ts +8 -0
  72. package/lib/Components/FeatureFlags/Mocks/FeatureFlagsPMMock.js +15 -0
  73. package/lib/Components/FeatureFlags/Mocks/index.d.ts +1 -0
  74. package/lib/Components/FeatureFlags/Mocks/index.js +13 -0
  75. package/lib/Components/FeatureFlags/PMs/FeatureFlagsPM.d.ts +6 -0
  76. package/lib/Components/FeatureFlags/PMs/FeatureFlagsPM.js +45 -0
  77. package/lib/Components/FeatureFlags/PMs/index.d.ts +1 -0
  78. package/lib/Components/FeatureFlags/PMs/index.js +13 -0
  79. package/lib/Components/FeatureFlags/index.d.ts +4 -0
  80. package/lib/Components/FeatureFlags/index.js +16 -0
  81. package/lib/Components/GLBModel/Mocks/LoadGlbFileUCMock.d.ts +1 -0
  82. package/lib/Components/GLBModel/Mocks/LoadGlbFileUCMock.js +1 -0
  83. package/lib/Components/GLBModel/UCs/LoadGlbFileUC.d.ts +1 -0
  84. package/lib/Components/RequestHandler/UC/EnableFeatureUC.d.ts +11 -0
  85. package/lib/Components/RequestHandler/UC/EnableFeatureUC.js +53 -0
  86. package/lib/Components/RequestHandler/UC/index.d.ts +1 -0
  87. package/lib/Components/RequestHandler/UC/index.js +1 -0
  88. package/lib/Components/index.d.ts +1 -0
  89. package/lib/Components/index.js +1 -0
  90. package/package.json +1 -1
@@ -21,23 +21,23 @@ class ShowAlertUCImp extends ShowConfirmUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, ShowConfirmUC.type);
23
23
  this.requestVersion = 1;
24
+ this.showConfirm = (data) => {
25
+ if (!this.appDispatcher)
26
+ return;
27
+ const payload = {
28
+ title: data.title,
29
+ message: data.message,
30
+ confirmCallback: data.confirmCallback,
31
+ cancelButtonLabel: data.cancelButtonLabel,
32
+ cancelCallback: data.cancelCallback,
33
+ confirmButtonLabel: data.confirmButtonLabel,
34
+ };
35
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
36
+ };
24
37
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
38
  if (!this.appDispatcher) {
26
39
  this.warn(`${ShowConfirmUC.type} has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first`);
27
40
  this.dispose();
28
41
  }
29
42
  }
30
- showConfirm(data) {
31
- if (!this.appDispatcher)
32
- return;
33
- const payload = {
34
- title: data.title,
35
- message: data.message,
36
- confirmCallback: data.confirmCallback,
37
- cancelButtonLabel: data.cancelButtonLabel,
38
- cancelCallback: data.cancelCallback,
39
- confirmButtonLabel: data.confirmButtonLabel,
40
- };
41
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
42
- }
43
43
  }
@@ -21,23 +21,23 @@ class ShowMarkdownEditorUCImp extends ShowMarkdownEditorUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, ShowMarkdownEditorUC.type);
23
23
  this.requestVersion = 1;
24
+ this.showMarkdownEditor = (data) => {
25
+ var _a;
26
+ if (!this.appDispatcher)
27
+ return;
28
+ const payload = {
29
+ initialText: (_a = data.initialText) !== null && _a !== void 0 ? _a : "",
30
+ submitCallback: data.submitCallback,
31
+ };
32
+ if (data.validateString) {
33
+ payload.validateString = data.validateString;
34
+ }
35
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
36
+ };
24
37
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
38
  if (!this.appDispatcher) {
26
39
  console.warn(`${ShowMarkdownEditorUC.type} has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first`);
27
40
  this.dispose();
28
41
  }
29
42
  }
30
- showMarkdownEditor(data) {
31
- var _a;
32
- if (!this.appDispatcher)
33
- return;
34
- const payload = {
35
- initialText: (_a = data.initialText) !== null && _a !== void 0 ? _a : "",
36
- submitCallback: data.submitCallback,
37
- };
38
- if (data.validateString) {
39
- payload.validateString = data.validateString;
40
- }
41
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
42
- }
43
43
  }
@@ -21,25 +21,25 @@ class ShowSelectModelUCImp extends ShowSelectModelUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, ShowSelectModelUC.type);
23
23
  this.requestVersion = 1;
24
+ this.doDispatch = () => {
25
+ return new Promise((resolve, reject) => {
26
+ const callback = (modelId, dataId) => {
27
+ resolve({ modelId, dataId });
28
+ };
29
+ const payload = {
30
+ callback,
31
+ };
32
+ if (!this.appDispatcher)
33
+ return reject(new Error("No host handler has been registered"));
34
+ else {
35
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
36
+ }
37
+ });
38
+ };
24
39
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
40
  if (!this.appDispatcher) {
26
41
  this.warn(`${ShowSelectModelUC.type} has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first`);
27
42
  this.dispose();
28
43
  }
29
44
  }
30
- doDispatch() {
31
- return new Promise((resolve, reject) => {
32
- const callback = (modelId, dataId) => {
33
- resolve({ modelId, dataId });
34
- };
35
- const payload = {
36
- callback,
37
- };
38
- if (!this.appDispatcher)
39
- return reject(new Error("No host handler has been registered"));
40
- else {
41
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
42
- }
43
- });
44
- }
45
45
  }
@@ -31,15 +31,15 @@ class StateIsCompleteUCImp extends StateIsCompleteUC {
31
31
  constructor(appObject) {
32
32
  super(appObject, StateIsCompleteUC.type);
33
33
  this.requestVersion = 1;
34
+ this.doDispatch = () => {
35
+ if (!this.appDispatcher)
36
+ return;
37
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
38
+ };
34
39
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
35
40
  if (!this.appDispatcher) {
36
41
  this.warn("GoToNextStateUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
37
42
  this.dispose();
38
43
  }
39
44
  }
40
- doDispatch() {
41
- if (!this.appDispatcher)
42
- return;
43
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
44
- }
45
45
  }
@@ -31,6 +31,27 @@ class SubmitActivityAssetUCImp extends SubmitActivityAssetUC {
31
31
  constructor(appObject) {
32
32
  super(appObject, SubmitActivityAssetUC.type);
33
33
  this.requestVersion = 1;
34
+ this.doDispatch = (assetFile) => {
35
+ return new Promise((resolve, reject) => {
36
+ const callback = (assetID) => {
37
+ if (assetID === undefined) {
38
+ reject(exports.NO_ASSET_ID_ERROR);
39
+ }
40
+ else {
41
+ resolve(assetID);
42
+ }
43
+ };
44
+ const payload = {
45
+ assetFile,
46
+ callback
47
+ };
48
+ if (!this.appDispatcher)
49
+ return reject(new Error("No host handler has been registered"));
50
+ else {
51
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
52
+ }
53
+ });
54
+ };
34
55
  this.appDispatcher = appObject.getComponent(Entities_1.AppDispatcher.type);
35
56
  if (!this.appDispatcher) {
36
57
  this.warn("SubmitActivityAssetUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
@@ -38,26 +59,5 @@ class SubmitActivityAssetUCImp extends SubmitActivityAssetUC {
38
59
  }
39
60
  this.appObjects.registerSingleton(this);
40
61
  }
41
- doDispatch(assetFile) {
42
- return new Promise((resolve, reject) => {
43
- const callback = (assetID) => {
44
- if (assetID === undefined) {
45
- reject(exports.NO_ASSET_ID_ERROR);
46
- }
47
- else {
48
- resolve(assetID);
49
- }
50
- };
51
- const payload = {
52
- assetFile,
53
- callback
54
- };
55
- if (!this.appDispatcher)
56
- return reject(new Error("No host handler has been registered"));
57
- else {
58
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
59
- }
60
- });
61
- }
62
62
  }
63
63
  exports.NO_ASSET_ID_ERROR = new Error("Asset ID is undefined");
@@ -71,79 +71,79 @@ class SubmitResultResultUCImp extends SubmitResultResultUC {
71
71
  constructor(appObject) {
72
72
  super(appObject, SubmitResultResultUC.type);
73
73
  this.requestVersion = 3;
74
- this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
75
- if (!this.appDispatcher) {
76
- this.warn("DispatchStateChangeUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
77
- this.dispose();
78
- }
79
- }
80
- submitHitResult(data) {
81
- if (!this.appDispatcher)
82
- return;
83
- const { description, success } = data;
84
- const payload = {
85
- resultType: "HIT_V1",
86
- description,
87
- result: {
88
- success,
89
- },
74
+ this.submitHitResult = (data) => {
75
+ if (!this.appDispatcher)
76
+ return;
77
+ const { description, success } = data;
78
+ const payload = {
79
+ resultType: "HIT_V1",
80
+ description,
81
+ result: {
82
+ success,
83
+ },
84
+ };
85
+ this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
90
86
  };
91
- this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
92
- }
93
- submitProgressResult(data) {
94
- if (!this.appDispatcher)
95
- return;
96
- const { description, progress } = data;
97
- const payload = {
98
- resultType: "PROGRESS_V1",
99
- description,
100
- result: {
101
- progress,
102
- },
87
+ this.submitProgressResult = (data) => {
88
+ if (!this.appDispatcher)
89
+ return;
90
+ const { description, progress } = data;
91
+ const payload = {
92
+ resultType: "PROGRESS_V1",
93
+ description,
94
+ result: {
95
+ progress,
96
+ },
97
+ };
98
+ this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
103
99
  };
104
- this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
105
- }
106
- submitMultiHitResult(data) {
107
- if (!this.appDispatcher)
108
- return;
109
- const { description, hits, misses, unanswered } = data;
110
- const payload = {
111
- resultType: "MULTIHIT_V1",
112
- description,
113
- result: {
114
- hits,
115
- misses,
116
- unanswered,
117
- },
100
+ this.submitMultiHitResult = (data) => {
101
+ if (!this.appDispatcher)
102
+ return;
103
+ const { description, hits, misses, unanswered } = data;
104
+ const payload = {
105
+ resultType: "MULTIHIT_V1",
106
+ description,
107
+ result: {
108
+ hits,
109
+ misses,
110
+ unanswered,
111
+ },
112
+ };
113
+ this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
118
114
  };
119
- this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
120
- }
121
- submitQualityResult(data) {
122
- if (!this.appDispatcher)
123
- return;
124
- const { description, stars, maxStars } = data;
125
- const payload = {
126
- resultType: "QUALITY_V1",
127
- description,
128
- result: {
129
- stars,
130
- maxStars,
131
- },
115
+ this.submitQualityResult = (data) => {
116
+ if (!this.appDispatcher)
117
+ return;
118
+ const { description, stars, maxStars } = data;
119
+ const payload = {
120
+ resultType: "QUALITY_V1",
121
+ description,
122
+ result: {
123
+ stars,
124
+ maxStars,
125
+ },
126
+ };
127
+ this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
132
128
  };
133
- this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
134
- }
135
- submitScoreResult(data) {
136
- if (!this.appDispatcher)
137
- return;
138
- const { description, score, maxScore } = data;
139
- const payload = {
140
- resultType: "SCORE_V1",
141
- description,
142
- result: {
143
- score,
144
- maxScore,
145
- },
129
+ this.submitScoreResult = (data) => {
130
+ if (!this.appDispatcher)
131
+ return;
132
+ const { description, score, maxScore } = data;
133
+ const payload = {
134
+ resultType: "SCORE_V1",
135
+ description,
136
+ result: {
137
+ score,
138
+ maxScore,
139
+ },
140
+ };
141
+ this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
146
142
  };
147
- this.appDispatcher.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
143
+ this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
144
+ if (!this.appDispatcher) {
145
+ this.warn("DispatchStateChangeUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
146
+ this.dispose();
147
+ }
148
148
  }
149
149
  }
@@ -1,3 +1,4 @@
1
1
  export * from "./Controllers";
2
2
  export * from "./Entities";
3
+ export * from "./Mocks";
3
4
  export * from "./UC";
@@ -12,4 +12,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./Controllers"), exports);
14
14
  __exportStar(require("./Entities"), exports);
15
+ __exportStar(require("./Mocks"), exports);
15
16
  __exportStar(require("./UC"), exports);
@@ -0,0 +1,2 @@
1
+ import { SingletonPmAdapter } from "../../../Types";
2
+ export declare const featureFlagsAdapter: SingletonPmAdapter<string[]>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.featureFlagsAdapter = void 0;
4
+ const FeatureFlagsPM_1 = require("../PMs/FeatureFlagsPM");
5
+ exports.featureFlagsAdapter = {
6
+ defaultVM: [],
7
+ subscribe: (appObjects, setVM) => {
8
+ const pm = FeatureFlagsPM_1.FeatureFlagsPM.get(appObjects);
9
+ if (!pm) {
10
+ appObjects.submitError("featureFlagsAdapter", "Unable to find FeatureFlagsPM");
11
+ return;
12
+ }
13
+ pm.addView(setVM);
14
+ },
15
+ unsubscribe: (appObjects, setVM) => {
16
+ const pm = FeatureFlagsPM_1.FeatureFlagsPM.get(appObjects);
17
+ if (!pm) {
18
+ appObjects.submitError("featureFlagsAdapter", "Unable to find FeatureFlagsPM");
19
+ return;
20
+ }
21
+ pm.removeView(setVM);
22
+ }
23
+ };
@@ -0,0 +1 @@
1
+ export * from "./featureFlagsAdapter";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./featureFlagsAdapter"), exports);
@@ -0,0 +1,10 @@
1
+ import { AppObject, AppObjectEntity, AppObjectRepo } from "../../../AppObject";
2
+ export declare abstract class FeatureFlagsEntity extends AppObjectEntity {
3
+ static type: string;
4
+ abstract addFlag(feature: string): void;
5
+ abstract removeFlag(feature: string): void;
6
+ abstract hasFlag(feature: string): boolean;
7
+ abstract get flags(): string[];
8
+ static get(appObjects: AppObjectRepo): FeatureFlagsEntity | undefined;
9
+ }
10
+ export declare function makeFeatureFlagsEntity(appObject: AppObject): FeatureFlagsEntity;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeFeatureFlagsEntity = exports.FeatureFlagsEntity = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
5
+ class FeatureFlagsEntity extends AppObject_1.AppObjectEntity {
6
+ static get(appObjects) {
7
+ return AppObject_1.getSingletonComponent(FeatureFlagsEntity.type, appObjects);
8
+ }
9
+ }
10
+ exports.FeatureFlagsEntity = FeatureFlagsEntity;
11
+ FeatureFlagsEntity.type = "FeatureFlagsEntity";
12
+ function makeFeatureFlagsEntity(appObject) {
13
+ return new FeatureFlagsEntityImp(appObject);
14
+ }
15
+ exports.makeFeatureFlagsEntity = makeFeatureFlagsEntity;
16
+ class FeatureFlagsEntityImp extends FeatureFlagsEntity {
17
+ constructor(appObject) {
18
+ super(appObject, FeatureFlagsEntity.type);
19
+ this._flags = [];
20
+ this.appObjects.registerSingleton(this);
21
+ }
22
+ get flags() {
23
+ return [...this._flags];
24
+ }
25
+ addFlag(feature) {
26
+ if (this.hasFlag(feature))
27
+ return;
28
+ this._flags.push(feature);
29
+ this.notifyOnChange();
30
+ }
31
+ removeFlag(feature) {
32
+ if (!this.hasFlag(feature))
33
+ return;
34
+ this._flags = this._flags.filter((flag) => flag !== feature);
35
+ this.notifyOnChange();
36
+ }
37
+ hasFlag(feature) {
38
+ return this._flags.includes(feature);
39
+ }
40
+ }
@@ -0,0 +1 @@
1
+ export * from "./FeatureFlagEntity";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./FeatureFlagEntity"), exports);
@@ -0,0 +1,8 @@
1
+ /// <reference types="jest" />
2
+ import { AppObject, AppObjectRepo } from "../../../AppObject";
3
+ import { FeatureFlagsPM } from "../PMs/FeatureFlagsPM";
4
+ export declare class FeatureFlagsPMMock extends FeatureFlagsPM {
5
+ vmsAreEqual: jest.Mock<any, any>;
6
+ constructor(appObject: AppObject);
7
+ }
8
+ export declare function makeFeatureFlagsPMMock(appObjects: AppObjectRepo): FeatureFlagsPMMock;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeFeatureFlagsPMMock = exports.FeatureFlagsPMMock = void 0;
4
+ const FeatureFlagsPM_1 = require("../PMs/FeatureFlagsPM");
5
+ class FeatureFlagsPMMock extends FeatureFlagsPM_1.FeatureFlagsPM {
6
+ constructor(appObject) {
7
+ super(appObject, FeatureFlagsPM_1.FeatureFlagsPM.type);
8
+ this.vmsAreEqual = jest.fn();
9
+ }
10
+ }
11
+ exports.FeatureFlagsPMMock = FeatureFlagsPMMock;
12
+ function makeFeatureFlagsPMMock(appObjects) {
13
+ return new FeatureFlagsPMMock(appObjects.getOrCreate("FeatureFlagsPMMock"));
14
+ }
15
+ exports.makeFeatureFlagsPMMock = makeFeatureFlagsPMMock;
@@ -0,0 +1 @@
1
+ export * from "./FeatureFlagsPMMock";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./FeatureFlagsPMMock"), exports);
@@ -0,0 +1,6 @@
1
+ import { AppObject, AppObjectPM, AppObjectRepo } from "../../../AppObject";
2
+ export declare abstract class FeatureFlagsPM extends AppObjectPM<string[]> {
3
+ static type: string;
4
+ static get(appObjects: AppObjectRepo): FeatureFlagsPM | undefined;
5
+ }
6
+ export declare function makeFeatureFlagsPM(appObject: AppObject): FeatureFlagsPM;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeFeatureFlagsPM = exports.FeatureFlagsPM = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
5
+ const FeatureFlagEntity_1 = require("../Entity/FeatureFlagEntity");
6
+ class FeatureFlagsPM extends AppObject_1.AppObjectPM {
7
+ static get(appObjects) {
8
+ return AppObject_1.getSingletonComponent(FeatureFlagsPM.type, appObjects);
9
+ }
10
+ }
11
+ exports.FeatureFlagsPM = FeatureFlagsPM;
12
+ FeatureFlagsPM.type = "FeatureFlagsPM";
13
+ function makeFeatureFlagsPM(appObject) {
14
+ return new FeatureFlagsPMImp(appObject);
15
+ }
16
+ exports.makeFeatureFlagsPM = makeFeatureFlagsPM;
17
+ class FeatureFlagsPMImp extends FeatureFlagsPM {
18
+ constructor(appObject) {
19
+ var _a;
20
+ super(appObject, FeatureFlagsPM.type);
21
+ this.onEntityChange = () => {
22
+ if (!this.featureFlagsEntity)
23
+ return;
24
+ this.doUpdateView(this.featureFlagsEntity.flags);
25
+ };
26
+ this.onEntityChange();
27
+ (_a = this.featureFlagsEntity) === null || _a === void 0 ? void 0 : _a.addChangeObserver(this.onEntityChange);
28
+ this.appObjects.registerSingleton(this);
29
+ }
30
+ get featureFlagsEntity() {
31
+ return this.getCachedSingleton(FeatureFlagEntity_1.FeatureFlagsEntity.type);
32
+ }
33
+ vmsAreEqual(a, b) {
34
+ if (a.length !== b.length)
35
+ return false;
36
+ let areEqual = true;
37
+ a.forEach((flagA, i) => {
38
+ const flagB = b[i];
39
+ if (flagA !== flagB) {
40
+ areEqual = false;
41
+ }
42
+ });
43
+ return areEqual;
44
+ }
45
+ }
@@ -0,0 +1 @@
1
+ export * from "./FeatureFlagsPM";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./FeatureFlagsPM"), exports);
@@ -0,0 +1,4 @@
1
+ export * from "./Adapters";
2
+ export * from "./Entity";
3
+ export * from "./Mocks";
4
+ export * from "./PMs";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./Adapters"), exports);
14
+ __exportStar(require("./Entity"), exports);
15
+ __exportStar(require("./Mocks"), exports);
16
+ __exportStar(require("./PMs"), exports);
@@ -2,6 +2,7 @@
2
2
  import { AppObject, AppObjectRepo } from "../../../AppObject";
3
3
  import { LoadGlbFileUC } from "../UCs/LoadGlbFileUC";
4
4
  export declare class LoadGlbFileUCMock extends LoadGlbFileUC {
5
+ loadBlobURL: jest.Mock<any, any>;
5
6
  loadFile: jest.Mock<any, any>;
6
7
  constructor(appObject: AppObject);
7
8
  }
@@ -5,6 +5,7 @@ const LoadGlbFileUC_1 = require("../UCs/LoadGlbFileUC");
5
5
  class LoadGlbFileUCMock extends LoadGlbFileUC_1.LoadGlbFileUC {
6
6
  constructor(appObject) {
7
7
  super(appObject, LoadGlbFileUC_1.LoadGlbFileUC.type);
8
+ this.loadBlobURL = jest.fn().mockResolvedValue(undefined);
8
9
  this.loadFile = jest.fn().mockResolvedValue(undefined);
9
10
  }
10
11
  }
@@ -3,5 +3,6 @@ import { GlbModelEntity } from "../Entities/GlbModelEntity";
3
3
  export declare abstract class LoadGlbFileUC extends AppObjectUC {
4
4
  static type: string;
5
5
  abstract loadFile(file: File, glbEntity: GlbModelEntity): Promise<void>;
6
+ abstract loadBlobURL(blobURL: string, glbEntity: GlbModelEntity): Promise<void>;
6
7
  static get(appObjects: AppObjectRepo): LoadGlbFileUC | undefined;
7
8
  }
@@ -0,0 +1,11 @@
1
+ import { AppObject } from "../../../AppObject/AppObject";
2
+ import { AppObjectUC } from "../../../AppObject/AppObjectUC";
3
+ import { RequestHandler } from "../Entities";
4
+ export declare abstract class EnableFeatureUC extends AppObjectUC implements RequestHandler {
5
+ static readonly type = "EnableFeatureUC";
6
+ readonly requestType = "ENABLE_FEATURE";
7
+ readonly payloadVersion = 1;
8
+ abstract action: (feature: string) => void;
9
+ abstract handleRequest: (version: number, payload?: unknown) => void;
10
+ }
11
+ export declare function makeEnableFeatureUC(appObject: AppObject): EnableFeatureUC;