@vived/app 4.20.0 → 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 (66) 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/GLBModel/Mocks/LoadGlbFileUCMock.d.ts +1 -0
  64. package/lib/Components/GLBModel/Mocks/LoadGlbFileUCMock.js +1 -0
  65. package/lib/Components/GLBModel/UCs/LoadGlbFileUC.d.ts +1 -0
  66. package/package.json +1 -1
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dispatchStateChange = exports.makeDispatchStateChangeUC = exports.DispatchStateChangeUC = void 0;
4
4
  const AppObject_1 = require("../../../AppObject");
5
5
  const AppObjectUC_1 = require("../../../AppObject/AppObjectUC");
6
- const App_1 = require("../../App");
7
- const StateMachine_1 = require("../../StateMachine");
6
+ const BaseAppState_1 = require("../../App/Entity/BaseAppState");
7
+ const Entities_1 = require("../../StateMachine/Entities");
8
8
  const AppDispatcher_1 = require("../Entities/AppDispatcher");
9
9
  class DispatchStateChangeUC extends AppObjectUC_1.AppObjectUC {
10
10
  constructor() {
@@ -41,12 +41,12 @@ class DispatchStateChangeUCImp extends DispatchStateChangeUC {
41
41
  };
42
42
  this.doDispatch = () => {
43
43
  var _a;
44
- const stateMachine = StateMachine_1.StateMachineEntity.get(this.appObject.appObjectRepo);
44
+ const stateMachine = Entities_1.StateMachineEntity.get(this.appObject.appObjectRepo);
45
45
  if (!stateMachine) {
46
46
  this.warn("Could not find StateMachineEntity");
47
47
  return;
48
48
  }
49
- const baseApp = App_1.BaseAppState.get(this.appObject.appObjectRepo);
49
+ const baseApp = BaseAppState_1.BaseAppState.get(this.appObject.appObjectRepo);
50
50
  if (!baseApp) {
51
51
  this.warn("Could not find BaseAppState");
52
52
  return;
@@ -21,15 +21,15 @@ class DispatchStateChangeUCImp extends DispatchStopZSpaceUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, DispatchStopZSpaceUC.type);
23
23
  this.requestVersion = 1;
24
+ this.doDispatch = () => {
25
+ if (!this.appDispatcher)
26
+ return;
27
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
28
+ };
24
29
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
30
  if (!this.appDispatcher) {
26
31
  this.warn("DispatchStopZSpaceUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
27
32
  this.dispose();
28
33
  }
29
34
  }
30
- doDispatch() {
31
- if (!this.appDispatcher)
32
- return;
33
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
34
- }
35
35
  }
@@ -32,31 +32,31 @@ class GetAppAssetsURLUCImp extends GetAssetBlobURLUC {
32
32
  constructor(appObject) {
33
33
  super(appObject, GetAssetBlobURLUC.type);
34
34
  this.requestVersion = 1;
35
+ this.doDispatch = (assetID) => {
36
+ return new Promise((resolve, reject) => {
37
+ const callback = (blobURL) => {
38
+ if (blobURL === undefined) {
39
+ reject(new Error("Blob URL is undefined"));
40
+ }
41
+ else {
42
+ resolve(blobURL);
43
+ }
44
+ };
45
+ const payload = {
46
+ assetID,
47
+ callback,
48
+ };
49
+ if (!this.appDispatcher)
50
+ return reject(new Error("No host handler has been registered"));
51
+ else {
52
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
53
+ }
54
+ });
55
+ };
35
56
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
36
57
  if (!this.appDispatcher) {
37
58
  this.warn("GetAssetBlobURLUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
38
59
  this.dispose();
39
60
  }
40
61
  }
41
- doDispatch(assetID) {
42
- return new Promise((resolve, reject) => {
43
- const callback = (blobURL) => {
44
- if (blobURL === undefined) {
45
- reject(new Error("Blob URL is undefined"));
46
- }
47
- else {
48
- resolve(blobURL);
49
- }
50
- };
51
- const payload = {
52
- assetID,
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
  }
@@ -32,30 +32,30 @@ class GetAppAssetsURLUCImp extends GetAssetFolderURLUC {
32
32
  constructor(appObject) {
33
33
  super(appObject, GetAssetFolderURLUC.type);
34
34
  this.requestVersion = 1;
35
+ this.doDispatch = () => {
36
+ return new Promise((resolve, reject) => {
37
+ const callback = (url) => {
38
+ if (!url) {
39
+ reject(new Error("URL to asset folder is empty"));
40
+ }
41
+ else {
42
+ resolve(url);
43
+ }
44
+ };
45
+ const payload = {
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
+ };
35
55
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
36
56
  if (!this.appDispatcher) {
37
57
  this.warn("GetAssetFolderURLUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
38
58
  this.dispose();
39
59
  }
40
60
  }
41
- doDispatch() {
42
- return new Promise((resolve, reject) => {
43
- const callback = (url) => {
44
- if (!url) {
45
- reject(new Error("URL to asset folder is empty"));
46
- }
47
- else {
48
- resolve(url);
49
- }
50
- };
51
- const payload = {
52
- callback,
53
- };
54
- if (!this.appDispatcher)
55
- return reject(new Error("No host handler has been registered"));
56
- else {
57
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
58
- }
59
- });
60
- }
61
61
  }
@@ -32,31 +32,31 @@ class GetAppAssetsURLUCImp extends GetAssetMetaUC {
32
32
  constructor(appObject) {
33
33
  super(appObject, GetAssetMetaUC.type);
34
34
  this.requestVersion = 1;
35
+ this.doDispatch = (assetID) => {
36
+ return new Promise((resolve, reject) => {
37
+ const callback = (assetMeta) => {
38
+ if (assetMeta === undefined) {
39
+ reject(new Error("Meta is undefined"));
40
+ }
41
+ else {
42
+ resolve(assetMeta);
43
+ }
44
+ };
45
+ const payload = {
46
+ assetID,
47
+ callback,
48
+ };
49
+ if (!this.appDispatcher)
50
+ return reject(new Error("No host handler has been registered"));
51
+ else {
52
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
53
+ }
54
+ });
55
+ };
35
56
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
36
57
  if (!this.appDispatcher) {
37
58
  this.warn("GetAssetMetaUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
38
59
  this.dispose();
39
60
  }
40
61
  }
41
- doDispatch(assetID) {
42
- return new Promise((resolve, reject) => {
43
- const callback = (assetMeta) => {
44
- if (assetMeta === undefined) {
45
- reject(new Error("Meta is undefined"));
46
- }
47
- else {
48
- resolve(assetMeta);
49
- }
50
- };
51
- const payload = {
52
- assetID,
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
  }
@@ -32,31 +32,31 @@ class GetLinkedAssetsUCImp extends GetAssetsForOwnerUC {
32
32
  constructor(appObject) {
33
33
  super(appObject, GetAssetsForOwnerUC.type);
34
34
  this.requestVersion = 1;
35
+ this.doDispatch = (assetID) => {
36
+ return new Promise((resolve, reject) => {
37
+ const callback = (ownerAssets) => {
38
+ if (ownerAssets === undefined) {
39
+ reject(new Error("Owner asset list is missing"));
40
+ }
41
+ else {
42
+ resolve(ownerAssets);
43
+ }
44
+ };
45
+ const payload = {
46
+ assetID,
47
+ callback,
48
+ };
49
+ if (!this.appDispatcher)
50
+ return reject(new Error("No host handler has been registered"));
51
+ else {
52
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
53
+ }
54
+ });
55
+ };
35
56
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
36
57
  if (!this.appDispatcher) {
37
58
  this.warn("GetAssetsForOwnerUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
38
59
  this.dispose();
39
60
  }
40
61
  }
41
- doDispatch(assetID) {
42
- return new Promise((resolve, reject) => {
43
- const callback = (ownerAssets) => {
44
- if (ownerAssets === undefined) {
45
- reject(new Error("Owner asset list is missing"));
46
- }
47
- else {
48
- resolve(ownerAssets);
49
- }
50
- };
51
- const payload = {
52
- assetID,
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
  }
@@ -32,32 +32,32 @@ class GetLinkedAssetsUCImp extends GetLinkedAssetsUC {
32
32
  constructor(appObject) {
33
33
  super(appObject, GetLinkedAssetsUC.type);
34
34
  this.requestVersion = 1;
35
+ this.doDispatch = (assetID, type) => {
36
+ return new Promise((resolve, reject) => {
37
+ const callback = (linkedAssets) => {
38
+ if (linkedAssets === undefined) {
39
+ reject(new Error("Linked asset list is missing"));
40
+ }
41
+ else {
42
+ resolve(linkedAssets);
43
+ }
44
+ };
45
+ const payload = {
46
+ assetID,
47
+ type,
48
+ callback,
49
+ };
50
+ if (!this.appDispatcher)
51
+ return reject(new Error("No host handler has been registered"));
52
+ else {
53
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
54
+ }
55
+ });
56
+ };
35
57
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
36
58
  if (!this.appDispatcher) {
37
59
  this.warn("GetLinkedAssetsUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
38
60
  this.dispose();
39
61
  }
40
62
  }
41
- doDispatch(assetID, type) {
42
- return new Promise((resolve, reject) => {
43
- const callback = (linkedAssets) => {
44
- if (linkedAssets === undefined) {
45
- reject(new Error("Linked asset list is missing"));
46
- }
47
- else {
48
- resolve(linkedAssets);
49
- }
50
- };
51
- const payload = {
52
- assetID,
53
- type,
54
- callback,
55
- };
56
- if (!this.appDispatcher)
57
- return reject(new Error("No host handler has been registered"));
58
- else {
59
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
60
- }
61
- });
62
- }
63
63
  }
@@ -21,15 +21,15 @@ class DispatchStateChangeUCImp extends GoToNextStateUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, GoToNextStateUC.type);
23
23
  this.requestVersion = 1;
24
+ this.doDispatch = () => {
25
+ if (!this.appDispatcher)
26
+ return;
27
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
28
+ };
24
29
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
30
  if (!this.appDispatcher) {
26
31
  this.warn("GoToNextStateUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
27
32
  this.dispose();
28
33
  }
29
34
  }
30
- doDispatch() {
31
- if (!this.appDispatcher)
32
- return;
33
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
34
- }
35
35
  }
@@ -21,15 +21,15 @@ class DispatchStateChangeUCImp extends GoToPreviousStateUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, GoToPreviousStateUC.type);
23
23
  this.requestVersion = 1;
24
+ this.doDispatch = () => {
25
+ if (!this.appDispatcher)
26
+ return;
27
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
28
+ };
24
29
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
30
  if (!this.appDispatcher) {
26
31
  this.warn("GoToPreviousStateUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
27
32
  this.dispose();
28
33
  }
29
34
  }
30
- doDispatch() {
31
- if (!this.appDispatcher)
32
- return;
33
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
34
- }
35
35
  }
@@ -21,25 +21,25 @@ class DispatchStateChangeUCImp extends HasNextStateUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, HasNextStateUC.type);
23
23
  this.requestVersion = 1;
24
+ this.doDispatch = () => {
25
+ return new Promise((resolve, reject) => {
26
+ const callback = (hasNextState) => {
27
+ resolve(hasNextState);
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("HasNextStateUC 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 = (hasNextState) => {
33
- resolve(hasNextState);
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
  }
@@ -21,25 +21,25 @@ class DispatchStateChangeUCImp extends HasPreviousStateUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, HasPreviousStateUC.type);
23
23
  this.requestVersion = 1;
24
+ this.doDispatch = () => {
25
+ return new Promise((resolve, reject) => {
26
+ const callback = (hasNextState) => {
27
+ resolve(hasNextState);
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
  console.warn("HasPreviousStateUC 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 = (hasNextState) => {
33
- resolve(hasNextState);
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
  }
@@ -32,26 +32,26 @@ class GetAppAssetsURLUCImp extends IsAssetFetchedUC {
32
32
  constructor(appObject) {
33
33
  super(appObject, IsAssetFetchedUC.type);
34
34
  this.requestVersion = 1;
35
+ this.doDispatch = (assetID) => {
36
+ return new Promise((resolve, reject) => {
37
+ const callback = (isFetched) => {
38
+ resolve(isFetched);
39
+ };
40
+ const payload = {
41
+ assetID,
42
+ callback,
43
+ };
44
+ if (!this.appDispatcher)
45
+ return reject(new Error("No host handler has been registered"));
46
+ else {
47
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
48
+ }
49
+ });
50
+ };
35
51
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
36
52
  if (!this.appDispatcher) {
37
53
  this.warn("IsAssetFetchedUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
38
54
  this.dispose();
39
55
  }
40
56
  }
41
- doDispatch(assetID) {
42
- return new Promise((resolve, reject) => {
43
- const callback = (isFetched) => {
44
- resolve(isFetched);
45
- };
46
- const payload = {
47
- assetID,
48
- callback,
49
- };
50
- if (!this.appDispatcher)
51
- return reject(new Error("No host handler has been registered"));
52
- else {
53
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
54
- }
55
- });
56
- }
57
57
  }
@@ -21,25 +21,25 @@ class DispatchStateChangeUCImp extends IsZSpaceAvailableUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, IsZSpaceAvailableUC.type);
23
23
  this.requestVersion = 1;
24
+ this.doDispatch = () => {
25
+ return new Promise((resolve, reject) => {
26
+ const callback = (IsZSpaceAvailable) => {
27
+ resolve(IsZSpaceAvailable);
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("IsZSpaceAvailableUC 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 = (IsZSpaceAvailable) => {
33
- resolve(IsZSpaceAvailable);
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
  }
@@ -21,23 +21,23 @@ class LogUCImp extends LogUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, LogUC.type);
23
23
  this.requestVersion = 1;
24
+ this.dispatchLog = (sender, message) => {
25
+ this.doDispatch(sender, message, "LOG");
26
+ };
27
+ this.dispatchWarn = (sender, message) => {
28
+ this.doDispatch(sender, message, "WARNING");
29
+ };
30
+ this.dispatchError = (sender, message) => {
31
+ this.doDispatch(sender, message, "ERROR");
32
+ };
33
+ this.dispatchFatal = (sender, message) => {
34
+ this.doDispatch(sender, message, "FATAL");
35
+ };
24
36
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
37
  if (!this.appDispatcher) {
26
38
  this.warn(`${LogUC.type} has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first`);
27
39
  }
28
40
  }
29
- dispatchLog(sender, message) {
30
- this.doDispatch(sender, message, "LOG");
31
- }
32
- dispatchWarn(sender, message) {
33
- this.doDispatch(sender, message, "WARNING");
34
- }
35
- dispatchError(sender, message) {
36
- this.doDispatch(sender, message, "ERROR");
37
- }
38
- dispatchFatal(sender, message) {
39
- this.doDispatch(sender, message, "FATAL");
40
- }
41
41
  doDispatch(sender, message, severity) {
42
42
  if (!this.appDispatcher)
43
43
  return;
@@ -31,17 +31,17 @@ class RegisterExternalStylesheetsUCImp extends RegisterExternalStylesheetsUC {
31
31
  constructor(appObject) {
32
32
  super(appObject, RegisterExternalStylesheetsUC.type);
33
33
  this.requestVersion = 1;
34
+ this.doDispatch = (stylesheets) => {
35
+ var _a;
36
+ const payload = {
37
+ stylesheets,
38
+ };
39
+ (_a = this.appDispatcher) === null || _a === void 0 ? void 0 : _a.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
40
+ };
34
41
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
35
42
  if (!this.appDispatcher) {
36
43
  this.warn("DispatchStateChangeUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
37
44
  this.dispose();
38
45
  }
39
46
  }
40
- doDispatch(stylesheets) {
41
- var _a;
42
- const payload = {
43
- stylesheets,
44
- };
45
- (_a = this.appDispatcher) === null || _a === void 0 ? void 0 : _a.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
46
- }
47
47
  }
@@ -21,15 +21,15 @@ class DispatchStateChangeUCImp extends RestoreCurrentStateUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, RestoreCurrentStateUC.type);
23
23
  this.requestVersion = 1;
24
+ this.doDispatch = () => {
25
+ if (!this.appDispatcher)
26
+ return;
27
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
28
+ };
24
29
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
30
  if (!this.appDispatcher) {
26
31
  this.warn("RestoreCurrentStateUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
27
32
  this.dispose();
28
33
  }
29
34
  }
30
- doDispatch() {
31
- if (!this.appDispatcher)
32
- return;
33
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
34
- }
35
35
  }
@@ -21,21 +21,21 @@ class ShowAlertUCImp extends ShowAlertUC {
21
21
  constructor(appObject) {
22
22
  super(appObject, ShowAlertUC.type);
23
23
  this.requestVersion = 1;
24
+ this.showAlert = (data) => {
25
+ if (!this.appDispatcher)
26
+ return;
27
+ const payload = {
28
+ title: data.title,
29
+ message: data.message,
30
+ closeButtonLabel: data.closeButtonLabel,
31
+ closeCallback: data.closeCallback,
32
+ };
33
+ this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
34
+ };
24
35
  this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
25
36
  if (!this.appDispatcher) {
26
37
  this.warn(`${ShowAlertUC.type} has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first`);
27
38
  this.dispose();
28
39
  }
29
40
  }
30
- showAlert(data) {
31
- if (!this.appDispatcher)
32
- return;
33
- const payload = {
34
- title: data.title,
35
- message: data.message,
36
- closeButtonLabel: data.closeButtonLabel,
37
- closeCallback: data.closeCallback,
38
- };
39
- this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion, payload);
40
- }
41
41
  }