@vived/host 5.1.0 → 5.2.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 (149) hide show
  1. package/dist/cjs/AppSandbox/Factories/AppSandboxFeatureFactory.js +86 -0
  2. package/dist/cjs/AppSandbox/Factories/AppSandboxFeatureFactory.js.map +1 -0
  3. package/dist/cjs/AppSandbox/Factories/index.js +1 -0
  4. package/dist/cjs/AppSandbox/Factories/index.js.map +1 -1
  5. package/dist/cjs/Apps/Factories/AppsFeatureFactory.js +5 -0
  6. package/dist/cjs/Apps/Factories/AppsFeatureFactory.js.map +1 -1
  7. package/dist/cjs/AssetPlugin/Factories/AssetPluginFeatureFactory.js +67 -0
  8. package/dist/cjs/AssetPlugin/Factories/AssetPluginFeatureFactory.js.map +1 -0
  9. package/dist/cjs/AssetPlugin/Factories/index.js +1 -0
  10. package/dist/cjs/AssetPlugin/Factories/index.js.map +1 -1
  11. package/dist/cjs/Assets/Adapters/assetFileAdapter.js.map +1 -1
  12. package/dist/cjs/Assets/Factories/SandboxAssetsFactory.js +87 -0
  13. package/dist/cjs/Assets/Factories/SandboxAssetsFactory.js.map +1 -0
  14. package/dist/cjs/Assets/Factories/index.js +1 -0
  15. package/dist/cjs/Assets/Factories/index.js.map +1 -1
  16. package/dist/cjs/Cache/Factories/CacheFeatureFactory.js +5 -0
  17. package/dist/cjs/Cache/Factories/CacheFeatureFactory.js.map +1 -1
  18. package/dist/cjs/ChallengeResults/Factories/ChallengeResultsFactory.js +53 -0
  19. package/dist/cjs/ChallengeResults/Factories/ChallengeResultsFactory.js.map +1 -0
  20. package/dist/cjs/ChallengeResults/Factories/index.js +1 -0
  21. package/dist/cjs/ChallengeResults/Factories/index.js.map +1 -1
  22. package/dist/cjs/Dialog/Factories/SandboxDialogFactory.js +63 -0
  23. package/dist/cjs/Dialog/Factories/SandboxDialogFactory.js.map +1 -0
  24. package/dist/cjs/Dialog/Factories/index.js +1 -0
  25. package/dist/cjs/Dialog/Factories/index.js.map +1 -1
  26. package/dist/cjs/Logger/Factories/SandboxLoggerFactory.js +54 -0
  27. package/dist/cjs/Logger/Factories/SandboxLoggerFactory.js.map +1 -0
  28. package/dist/cjs/Logger/Factories/index.js +1 -0
  29. package/dist/cjs/Logger/Factories/index.js.map +1 -1
  30. package/dist/cjs/StateMachine/Controllers/index.js.map +1 -1
  31. package/dist/cjs/StateMachine/Factories/SandboxStateMachineFactory.js +72 -0
  32. package/dist/cjs/StateMachine/Factories/SandboxStateMachineFactory.js.map +1 -0
  33. package/dist/cjs/StateMachine/Factories/index.js +1 -0
  34. package/dist/cjs/StateMachine/Factories/index.js.map +1 -1
  35. package/dist/cjs/StateMachine/PMs/HostStatePM.js +17 -23
  36. package/dist/cjs/StateMachine/PMs/HostStatePM.js.map +1 -1
  37. package/dist/cjs/ThemeColors/Controllers/index.js.map +1 -1
  38. package/dist/cjs/ThemeColors/Factories/ThemeFactory.js +63 -0
  39. package/dist/cjs/ThemeColors/Factories/ThemeFactory.js.map +1 -0
  40. package/dist/cjs/ThemeColors/Factories/index.js +1 -0
  41. package/dist/cjs/ThemeColors/Factories/index.js.map +1 -1
  42. package/dist/cjs/ThemeColors/Mocks/MockSetThemeUC.js.map +1 -1
  43. package/dist/cjs/ThemeColors/Mocks/index.js.map +1 -1
  44. package/dist/cjs/VivedAPI/Factories/SandboxVivedAPIFactory.js +63 -0
  45. package/dist/cjs/VivedAPI/Factories/SandboxVivedAPIFactory.js.map +1 -0
  46. package/dist/cjs/VivedAPI/Factories/index.js +1 -0
  47. package/dist/cjs/VivedAPI/Factories/index.js.map +1 -1
  48. package/dist/cjs/ZSpaceHost/Controllers/index.js.map +1 -1
  49. package/dist/cjs/ZSpaceHost/Factories/SandboxZSpaceFactory.js +55 -0
  50. package/dist/cjs/ZSpaceHost/Factories/SandboxZSpaceFactory.js.map +1 -0
  51. package/dist/cjs/ZSpaceHost/Factories/index.js +1 -0
  52. package/dist/cjs/ZSpaceHost/Factories/index.js.map +1 -1
  53. package/dist/esm/AppSandbox/Factories/AppSandboxFeatureFactory.js +81 -0
  54. package/dist/esm/AppSandbox/Factories/AppSandboxFeatureFactory.js.map +1 -0
  55. package/dist/esm/AppSandbox/Factories/index.js +1 -0
  56. package/dist/esm/AppSandbox/Factories/index.js.map +1 -1
  57. package/dist/esm/Apps/Factories/AppsFeatureFactory.js +4 -0
  58. package/dist/esm/Apps/Factories/AppsFeatureFactory.js.map +1 -1
  59. package/dist/esm/AssetPlugin/Factories/AssetPluginFeatureFactory.js +62 -0
  60. package/dist/esm/AssetPlugin/Factories/AssetPluginFeatureFactory.js.map +1 -0
  61. package/dist/esm/AssetPlugin/Factories/index.js +1 -0
  62. package/dist/esm/AssetPlugin/Factories/index.js.map +1 -1
  63. package/dist/esm/Assets/Adapters/assetFileAdapter.js.map +1 -1
  64. package/dist/esm/Assets/Factories/SandboxAssetsFactory.js +82 -0
  65. package/dist/esm/Assets/Factories/SandboxAssetsFactory.js.map +1 -0
  66. package/dist/esm/Assets/Factories/index.js +1 -0
  67. package/dist/esm/Assets/Factories/index.js.map +1 -1
  68. package/dist/esm/Cache/Factories/CacheFeatureFactory.js +4 -0
  69. package/dist/esm/Cache/Factories/CacheFeatureFactory.js.map +1 -1
  70. package/dist/esm/ChallengeResults/Factories/ChallengeResultsFactory.js +48 -0
  71. package/dist/esm/ChallengeResults/Factories/ChallengeResultsFactory.js.map +1 -0
  72. package/dist/esm/ChallengeResults/Factories/index.js +1 -0
  73. package/dist/esm/ChallengeResults/Factories/index.js.map +1 -1
  74. package/dist/esm/Dialog/Factories/SandboxDialogFactory.js +58 -0
  75. package/dist/esm/Dialog/Factories/SandboxDialogFactory.js.map +1 -0
  76. package/dist/esm/Dialog/Factories/index.js +1 -0
  77. package/dist/esm/Dialog/Factories/index.js.map +1 -1
  78. package/dist/esm/Logger/Factories/SandboxLoggerFactory.js +49 -0
  79. package/dist/esm/Logger/Factories/SandboxLoggerFactory.js.map +1 -0
  80. package/dist/esm/Logger/Factories/index.js +1 -0
  81. package/dist/esm/Logger/Factories/index.js.map +1 -1
  82. package/dist/esm/StateMachine/Controllers/index.js.map +1 -1
  83. package/dist/esm/StateMachine/Factories/SandboxStateMachineFactory.js +67 -0
  84. package/dist/esm/StateMachine/Factories/SandboxStateMachineFactory.js.map +1 -0
  85. package/dist/esm/StateMachine/Factories/index.js +1 -0
  86. package/dist/esm/StateMachine/Factories/index.js.map +1 -1
  87. package/dist/esm/StateMachine/PMs/HostStatePM.js +17 -23
  88. package/dist/esm/StateMachine/PMs/HostStatePM.js.map +1 -1
  89. package/dist/esm/ThemeColors/Controllers/index.js.map +1 -1
  90. package/dist/esm/ThemeColors/Factories/ThemeFactory.js +58 -0
  91. package/dist/esm/ThemeColors/Factories/ThemeFactory.js.map +1 -0
  92. package/dist/esm/ThemeColors/Factories/index.js +1 -0
  93. package/dist/esm/ThemeColors/Factories/index.js.map +1 -1
  94. package/dist/esm/ThemeColors/Mocks/MockSetThemeUC.js.map +1 -1
  95. package/dist/esm/ThemeColors/Mocks/index.js.map +1 -1
  96. package/dist/esm/VivedAPI/Factories/SandboxVivedAPIFactory.js +58 -0
  97. package/dist/esm/VivedAPI/Factories/SandboxVivedAPIFactory.js.map +1 -0
  98. package/dist/esm/VivedAPI/Factories/index.js +1 -0
  99. package/dist/esm/VivedAPI/Factories/index.js.map +1 -1
  100. package/dist/esm/ZSpaceHost/Controllers/index.js.map +1 -1
  101. package/dist/esm/ZSpaceHost/Factories/SandboxZSpaceFactory.js +50 -0
  102. package/dist/esm/ZSpaceHost/Factories/SandboxZSpaceFactory.js.map +1 -0
  103. package/dist/esm/ZSpaceHost/Factories/index.js +1 -0
  104. package/dist/esm/ZSpaceHost/Factories/index.js.map +1 -1
  105. package/dist/types/AppSandbox/Factories/AppSandboxFeatureFactory.d.ts +29 -0
  106. package/dist/types/AppSandbox/Factories/AppSandboxFeatureFactory.d.ts.map +1 -0
  107. package/dist/types/AppSandbox/Factories/index.d.ts +1 -0
  108. package/dist/types/AppSandbox/Factories/index.d.ts.map +1 -1
  109. package/dist/types/Apps/Factories/AppsFeatureFactory.d.ts +2 -1
  110. package/dist/types/Apps/Factories/AppsFeatureFactory.d.ts.map +1 -1
  111. package/dist/types/AssetPlugin/Factories/AssetPluginFeatureFactory.d.ts +28 -0
  112. package/dist/types/AssetPlugin/Factories/AssetPluginFeatureFactory.d.ts.map +1 -0
  113. package/dist/types/AssetPlugin/Factories/index.d.ts +1 -0
  114. package/dist/types/AssetPlugin/Factories/index.d.ts.map +1 -1
  115. package/dist/types/Assets/Factories/SandboxAssetsFactory.d.ts +34 -0
  116. package/dist/types/Assets/Factories/SandboxAssetsFactory.d.ts.map +1 -0
  117. package/dist/types/Assets/Factories/index.d.ts +1 -0
  118. package/dist/types/Assets/Factories/index.d.ts.map +1 -1
  119. package/dist/types/Cache/Factories/CacheFeatureFactory.d.ts +2 -1
  120. package/dist/types/Cache/Factories/CacheFeatureFactory.d.ts.map +1 -1
  121. package/dist/types/ChallengeResults/Factories/ChallengeResultsFactory.d.ts +28 -0
  122. package/dist/types/ChallengeResults/Factories/ChallengeResultsFactory.d.ts.map +1 -0
  123. package/dist/types/ChallengeResults/Factories/index.d.ts +1 -0
  124. package/dist/types/ChallengeResults/Factories/index.d.ts.map +1 -1
  125. package/dist/types/Dialog/Factories/SandboxDialogFactory.d.ts +28 -0
  126. package/dist/types/Dialog/Factories/SandboxDialogFactory.d.ts.map +1 -0
  127. package/dist/types/Dialog/Factories/index.d.ts +1 -0
  128. package/dist/types/Dialog/Factories/index.d.ts.map +1 -1
  129. package/dist/types/Logger/Factories/SandboxLoggerFactory.d.ts +28 -0
  130. package/dist/types/Logger/Factories/SandboxLoggerFactory.d.ts.map +1 -0
  131. package/dist/types/Logger/Factories/index.d.ts +1 -0
  132. package/dist/types/Logger/Factories/index.d.ts.map +1 -1
  133. package/dist/types/StateMachine/Factories/SandboxStateMachineFactory.d.ts +30 -0
  134. package/dist/types/StateMachine/Factories/SandboxStateMachineFactory.d.ts.map +1 -0
  135. package/dist/types/StateMachine/Factories/index.d.ts +1 -0
  136. package/dist/types/StateMachine/Factories/index.d.ts.map +1 -1
  137. package/dist/types/ThemeColors/Factories/ThemeFactory.d.ts +30 -0
  138. package/dist/types/ThemeColors/Factories/ThemeFactory.d.ts.map +1 -0
  139. package/dist/types/ThemeColors/Factories/index.d.ts +1 -0
  140. package/dist/types/ThemeColors/Factories/index.d.ts.map +1 -1
  141. package/dist/types/VivedAPI/Factories/SandboxVivedAPIFactory.d.ts +28 -0
  142. package/dist/types/VivedAPI/Factories/SandboxVivedAPIFactory.d.ts.map +1 -0
  143. package/dist/types/VivedAPI/Factories/index.d.ts +1 -0
  144. package/dist/types/VivedAPI/Factories/index.d.ts.map +1 -1
  145. package/dist/types/ZSpaceHost/Factories/SandboxZSpaceFactory.d.ts +28 -0
  146. package/dist/types/ZSpaceHost/Factories/SandboxZSpaceFactory.d.ts.map +1 -0
  147. package/dist/types/ZSpaceHost/Factories/index.d.ts +1 -0
  148. package/dist/types/ZSpaceHost/Factories/index.d.ts.map +1 -1
  149. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxLoggerFactory.js","sourceRoot":"","sources":["../../../../src/Logger/Factories/SandboxLoggerFactory.ts"],"names":[],"mappings":";;;AAmDA,4DAKC;AAxDD,sCAAsE;AACtE,0CAA+C;AAC/C,gCAAsE;AACtE,gCAA2C;AAE3C;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,oBAAa;IAIrD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,sBAAsB,CAAC;IAI9C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,IAAA,2BAAgB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,uBAAuB;QACvB,IAAA,uBAAiB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,mCAAmC;QACnC,IAAA,sBAAgB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjC,IAAA,gCAA0B,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,UAAU;QACR,0CAA0C;IAC5C,CAAC;CACF;AAvCD,oDAuCC;AAED,SAAgB,wBAAwB,CACtC,UAAyB;IAEzB,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,IAAI,oBAAoB,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport { makeLoggerEntity } from \"../Entities\";\r\nimport { makeForwardLogsToConsolePM, makeLogSummaryPM } from \"../PMs\";\r\nimport { makeDownloadLogUC } from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Logger domain components for sandbox.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Logger functionality.\r\n */\r\nexport class SandboxLoggerFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"SandboxLoggerFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Logger system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n makeLoggerEntity(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Logger system\r\n */\r\n setupUCs(): void {\r\n // Initialize use cases\r\n makeDownloadLogUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Logger system\r\n */\r\n setupPMs(): void {\r\n // Initialize presentation managers\r\n makeLogSummaryPM(this.appObject);\r\n makeForwardLogsToConsolePM(this.appObject);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for Logger\r\n }\r\n}\r\n\r\nexport function makeSandboxLoggerFactory(\r\n appObjects: AppObjectRepo\r\n): SandboxLoggerFactory {\r\n const ao = appObjects.getOrCreate(\"Logger\");\r\n return new SandboxLoggerFactory(ao);\r\n}\r\n"]}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./SandboxLoggerFactory"), exports);
17
18
  __exportStar(require("./setupLoggerForSandbox"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Logger/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC","sourcesContent":["export * from \"./setupLoggerForSandbox\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Logger/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,0DAAwC","sourcesContent":["export * from \"./SandboxLoggerFactory\";\nexport * from \"./setupLoggerForSandbox\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/StateMachine/Controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B;AAC9B,mDAAiC;AACjC,oDAAkC;AAClC,8CAA4B;AAC5B,kDAAgC;AAChC,gDAA8B;AAC9B,6CAA2B;AAC3B,kDAAgC;AAChC,0DAAwC;AACxC,sDAAoC;AACpC,yDAAuC","sourcesContent":["export * from \"./cancelEditing\";\nexport * from \"./consumeState\";\nexport * from \"./deleteState\";\nexport * from \"./duplicateState\";\nexport * from \"./editActiveState\";\nexport * from \"./editState\";\nexport * from \"./editStateName\";\nexport * from \"./endActivity\";\nexport * from \"./newState\";\nexport * from \"./saveAuthoring\";\nexport * from \"./setTransitionDuration\";\nexport * from \"./transitionToState\";\nexport * from \"./savePersistentStates\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/StateMachine/Controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B;AAC9B,mDAAiC;AACjC,oDAAkC;AAClC,8CAA4B;AAC5B,kDAAgC;AAChC,gDAA8B;AAC9B,6CAA2B;AAC3B,kDAAgC;AAChC,0DAAwC;AACxC,sDAAoC;AACpC,yDAAuC","sourcesContent":["export * from \"./cancelEditing\";\r\nexport * from \"./consumeState\";\r\nexport * from \"./deleteState\";\r\nexport * from \"./duplicateState\";\r\nexport * from \"./editActiveState\";\r\nexport * from \"./editState\";\r\nexport * from \"./editStateName\";\r\nexport * from \"./endActivity\";\r\nexport * from \"./newState\";\r\nexport * from \"./saveAuthoring\";\r\nexport * from \"./setTransitionDuration\";\r\nexport * from \"./transitionToState\";\r\nexport * from \"./savePersistentStates\";\r\n"]}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SandboxStateMachineFactory = void 0;
4
+ exports.makeSandboxStateMachineFactory = makeSandboxStateMachineFactory;
5
+ const core_1 = require("@vived/core");
6
+ const Entities_1 = require("../Entities");
7
+ const PMs_1 = require("../PMs");
8
+ const UCs_1 = require("../UCs");
9
+ /**
10
+ * Factory responsible for setting up the StateMachine domain components for sandbox.
11
+ * This factory initializes all entities, use cases, and presentation models
12
+ * required for the StateMachine functionality.
13
+ */
14
+ class SandboxStateMachineFactory extends core_1.DomainFactory {
15
+ constructor(appObject) {
16
+ super(appObject);
17
+ // Unique name for this factory
18
+ this.factoryName = "SandboxStateMachineFactory";
19
+ this.stateFactory = (id) => {
20
+ const ao = this.appObjects.getOrCreate(id);
21
+ const entity = (0, Entities_1.makeHostStateEntity)(ao);
22
+ (0, PMs_1.makeHostStatePM)(ao);
23
+ return entity;
24
+ };
25
+ }
26
+ /**
27
+ * Sets up all entities required for the StateMachine system
28
+ */
29
+ setupEntities() {
30
+ // Initialize entities
31
+ const stateMachine = (0, Entities_1.makeHostStateMachine)(this.appObject);
32
+ (0, Entities_1.makeHostEditingStateEntity)(this.appObject);
33
+ stateMachine.stateFactory = this.stateFactory;
34
+ }
35
+ /**
36
+ * Sets up all use cases for the StateMachine system
37
+ */
38
+ setupUCs() {
39
+ // Initialize use cases
40
+ (0, UCs_1.makeCancelSandboxEditingUC)(this.appObject);
41
+ (0, UCs_1.makeConsumeSandboxStateUC)(this.appObject);
42
+ (0, UCs_1.makeEditActiveSandboxStateUC)(this.appObject);
43
+ (0, UCs_1.makeEditSandboxStateUC)(this.appObject);
44
+ (0, UCs_1.makeEndSandboxActivityUC)(this.appObject);
45
+ (0, UCs_1.makeNewSandboxStateUC)(this.appObject);
46
+ (0, UCs_1.makeSaveAuthoringSandboxUC)(this.appObject);
47
+ (0, UCs_1.makeTransitionToSandboxStateUC)(this.appObject);
48
+ (0, UCs_1.makeDeleteStateUC)(this.appObject);
49
+ (0, UCs_1.makeDuplicateStateUC)(this.appObject);
50
+ (0, UCs_1.makeSavePersistentStatesUC)(this.appObject);
51
+ }
52
+ /**
53
+ * Sets up all presentation managers for the StateMachine system
54
+ */
55
+ setupPMs() {
56
+ // Initialize presentation managers
57
+ (0, PMs_1.makeEditingStatePM)(this.appObject);
58
+ (0, PMs_1.makeHostStateMachinePM)(this.appObject);
59
+ }
60
+ /**
61
+ * Performs any final setup operations after all components are initialized
62
+ */
63
+ finalSetup() {
64
+ // No additional setup required for StateMachine
65
+ }
66
+ }
67
+ exports.SandboxStateMachineFactory = SandboxStateMachineFactory;
68
+ function makeSandboxStateMachineFactory(appObjects) {
69
+ const ao = appObjects.getOrCreate("State Machine");
70
+ return new SandboxStateMachineFactory(ao);
71
+ }
72
+ //# sourceMappingURL=SandboxStateMachineFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxStateMachineFactory.js","sourceRoot":"","sources":["../../../../src/StateMachine/Factories/SandboxStateMachineFactory.ts"],"names":[],"mappings":";;;AA8FA,wEAKC;AAnGD,sCAAsE;AACtE,0CAKqB;AACrB,gCAIgB;AAChB,gCAYgB;AAEhB;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,oBAAa;IAI3D,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,4BAA4B,CAAC;QAmDpD,iBAAY,GAAG,CAAC,EAAU,EAAmB,EAAE;YAC7C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAC3C,MAAM,MAAM,GAAG,IAAA,8BAAmB,EAAC,EAAE,CAAC,CAAC;YAEvC,IAAA,qBAAe,EAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IAtDF,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,MAAM,YAAY,GAAG,IAAA,+BAAoB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1D,IAAA,qCAA0B,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE3C,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,uBAAuB;QACvB,IAAA,gCAA0B,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAA,+BAAyB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1C,IAAA,kCAA4B,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAA,4BAAsB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACvC,IAAA,8BAAwB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,IAAA,2BAAqB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,IAAA,gCAA0B,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAA,oCAA8B,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAA,uBAAiB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClC,IAAA,0BAAoB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,IAAA,gCAA0B,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,mCAAmC;QACnC,IAAA,wBAAkB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,IAAA,4BAAsB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,gDAAgD;IAClD,CAAC;CAUF;AA7DD,gEA6DC;AAED,SAAgB,8BAA8B,CAC5C,UAAyB;IAEzB,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACnD,OAAO,IAAI,0BAA0B,CAAC,EAAE,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport {\r\n\tHostStateEntity,\r\n\tmakeHostEditingStateEntity,\r\n\tmakeHostStateEntity,\r\n\tmakeHostStateMachine\r\n} from \"../Entities\";\r\nimport {\r\n\tmakeEditingStatePM,\r\n\tmakeHostStateMachinePM,\r\n\tmakeHostStatePM\r\n} from \"../PMs\";\r\nimport {\r\n\tmakeCancelSandboxEditingUC,\r\n\tmakeConsumeSandboxStateUC,\r\n\tmakeDeleteStateUC,\r\n\tmakeDuplicateStateUC,\r\n\tmakeEditActiveSandboxStateUC,\r\n\tmakeEditSandboxStateUC,\r\n\tmakeEndSandboxActivityUC,\r\n\tmakeNewSandboxStateUC,\r\n\tmakeSaveAuthoringSandboxUC,\r\n\tmakeSavePersistentStatesUC,\r\n\tmakeTransitionToSandboxStateUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the StateMachine domain components for sandbox.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the StateMachine functionality.\r\n */\r\nexport class SandboxStateMachineFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"SandboxStateMachineFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the StateMachine system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n const stateMachine = makeHostStateMachine(this.appObject);\r\n makeHostEditingStateEntity(this.appObject);\r\n\r\n stateMachine.stateFactory = this.stateFactory;\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the StateMachine system\r\n */\r\n setupUCs(): void {\r\n // Initialize use cases\r\n makeCancelSandboxEditingUC(this.appObject);\r\n makeConsumeSandboxStateUC(this.appObject);\r\n makeEditActiveSandboxStateUC(this.appObject);\r\n makeEditSandboxStateUC(this.appObject);\r\n makeEndSandboxActivityUC(this.appObject);\r\n makeNewSandboxStateUC(this.appObject);\r\n makeSaveAuthoringSandboxUC(this.appObject);\r\n makeTransitionToSandboxStateUC(this.appObject);\r\n makeDeleteStateUC(this.appObject);\r\n makeDuplicateStateUC(this.appObject);\r\n makeSavePersistentStatesUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the StateMachine system\r\n */\r\n setupPMs(): void {\r\n // Initialize presentation managers\r\n makeEditingStatePM(this.appObject);\r\n makeHostStateMachinePM(this.appObject);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for StateMachine\r\n }\r\n\r\n stateFactory = (id: string): HostStateEntity => {\r\n const ao = this.appObjects.getOrCreate(id);\r\n const entity = makeHostStateEntity(ao);\r\n\r\n makeHostStatePM(ao);\r\n\r\n return entity;\r\n };\r\n}\r\n\r\nexport function makeSandboxStateMachineFactory(\r\n appObjects: AppObjectRepo\r\n): SandboxStateMachineFactory {\r\n const ao = appObjects.getOrCreate(\"State Machine\");\r\n return new SandboxStateMachineFactory(ao);\r\n}\r\n"]}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./SandboxStateMachineFactory"), exports);
17
18
  __exportStar(require("./setupStateMachineForSandbox"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/StateMachine/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C","sourcesContent":["export * from \"./setupStateMachineForSandbox\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/StateMachine/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,gEAA8C","sourcesContent":["export * from \"./SandboxStateMachineFactory\";\nexport * from \"./setupStateMachineForSandbox\";\n"]}
@@ -68,48 +68,42 @@ class HostStatePMImp extends HostStatePM {
68
68
  return true;
69
69
  }
70
70
  updateViewModel() {
71
- const entity = this.hostStateEntity;
72
- const stateMachine = this.hostStateMachine;
73
- const appRepo = this.appRepo;
74
- if (!entity) {
75
- this.doUpdateView(HostStatePM.defaultVM);
76
- return;
77
- }
78
71
  // Check if this state is the active one in the state machine
79
- const isActive = stateMachine?.activeState === entity.id;
72
+ const isActive = this.hostStateMachine.activeState === this.hostStateEntity.id;
80
73
  // Look up the app name using the appID from the state entity
81
74
  let appName = "";
82
- if (appRepo && entity.appID) {
83
- const app = appRepo.getApp(entity.appID);
75
+ try {
76
+ const app = this.appRepo.getApp(this.hostStateEntity.appID);
84
77
  if (app) {
85
78
  appName = app.name;
86
79
  }
87
80
  }
81
+ catch (e) {
82
+ // No problem
83
+ }
88
84
  // Determine if the state can be bumped backwards or forwards
89
85
  let canBumpBackwards = false;
90
86
  let canBumpForward = false;
91
87
  let index = -1;
92
- if (stateMachine) {
93
- const stateIndex = stateMachine.getStateIndex(entity.id);
94
- if (stateIndex !== undefined) {
95
- index = stateIndex;
96
- // Can bump backwards if index > 0
97
- canBumpBackwards = stateIndex > 0;
98
- // Can bump forward if index < length-1
99
- canBumpForward = stateIndex < stateMachine.stateCount - 1;
100
- }
88
+ const stateIndex = this.hostStateMachine.getStateIndex(this.hostStateEntity.id);
89
+ if (stateIndex !== undefined) {
90
+ index = stateIndex;
91
+ // Can bump backwards if index > 0
92
+ canBumpBackwards = stateIndex > 0;
93
+ // Can bump forward if index < length-1
94
+ canBumpForward = stateIndex < this.hostStateMachine.stateCount - 1;
101
95
  }
102
96
  // Create a new immutable view model based on entity state
103
97
  const newVM = {
104
- id: entity.id,
105
- name: entity.name,
106
- data: entity.stateData,
98
+ id: this.hostStateEntity.id,
99
+ name: this.hostStateEntity.name,
100
+ data: this.hostStateEntity.stateData,
107
101
  isActive: isActive || false,
108
102
  appName,
109
103
  canBumpBackwards,
110
104
  canBumpForward,
111
105
  index,
112
- streamState: entity.streamState
106
+ streamState: this.hostStateEntity.streamState
113
107
  };
114
108
  // Update the view with the new view model
115
109
  this.doUpdateView(newVM);
@@ -1 +1 @@
1
- {"version":3,"file":"HostStatePM.js","sourceRoot":"","sources":["../../../../src/StateMachine/PMs/HostStatePM.ts"],"names":[],"mappings":";;;AA0CA,0CAEC;AA5CD,sCAAoE;AACpE,yDAA4D;AAC5D,iEAA2E;AAC3E,mEAAgE;AAchE,MAAsB,WAAY,SAAQ,kBAAwB;IAgBhE,+BAA+B;IAC/B,MAAM,CAAC,OAAO,CACZ,EAAU,EACV,UAAyB;QAEzB,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,CAAc,WAAW,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC;;AAtB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CAAC,CAAC;YACvE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC,CAAC;QAKA,8BAA8B;QAC9B,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAE7D,qCAAqC;QACrC,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAEpE,4BAA4B;QAC5B,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["import { AppObject, AppObjectPM, AppObjectRepo } from \"@vived/core\";\nimport { AppRepoEntity } from \"../../Apps/Entities/AppRepo\";\nimport { HostStateEntity, StreamState } from \"../Entities/HostStateEntity\";\nimport { HostStateMachine } from \"../Entities/HostStateMachine\";\n\nexport interface HostStateVM {\n readonly id: string;\n readonly name: string;\n readonly data: object;\n readonly isActive: boolean;\n readonly appName: string;\n readonly canBumpBackwards: boolean;\n readonly canBumpForward: boolean;\n readonly index: number;\n readonly streamState: StreamState;\n}\n\nexport abstract class HostStatePM extends AppObjectPM<HostStateVM> {\n static readonly type = \"HostStatePM\";\n\n // Default view model\n static readonly defaultVM: HostStateVM = {\n id: \"\",\n name: \"\",\n data: {},\n isActive: false,\n appName: \"\",\n canBumpBackwards: false,\n canBumpForward: false,\n index: -1,\n streamState: StreamState.INIT\n };\n\n // Non-singleton getter pattern\n static getById(\n id: string,\n appObjects: AppObjectRepo\n ): HostStatePM | undefined {\n return appObjects.get(id)?.getComponent<HostStatePM>(HostStatePM.type);\n }\n}\n\nexport function makeHostStatePM(appObject: AppObject): HostStatePM {\n return new HostStatePMImp(appObject);\n}\n\nclass HostStatePMImp extends HostStatePM {\n // Get the entity from the same AppObject\n private get hostStateEntity() {\n return this.getCachedLocalComponent<HostStateEntity>(HostStateEntity.type);\n }\n\n // Get the state machine which is a singleton\n private get hostStateMachine() {\n return this.getCachedSingleton<HostStateMachine>(HostStateMachine.type);\n }\n\n // Get the app repo which is a singleton\n private get appRepo() {\n return this.getCachedSingleton<AppRepoEntity>(AppRepoEntity.type);\n }\n\n // Required equality check method for view models\n vmsAreEqual(a: HostStateVM, b: HostStateVM): boolean {\n if (a.id !== b.id) return false;\n if (a.name !== b.name) return false;\n if (a.isActive !== b.isActive) return false;\n if (a.appName !== b.appName) return false;\n if (a.canBumpBackwards !== b.canBumpBackwards) return false;\n if (a.canBumpForward !== b.canBumpForward) return false;\n if (a.index !== b.index) return false;\n if (a.streamState !== b.streamState) return false;\n\n // Deep comparison for the data object\n const aData = JSON.stringify(a.data);\n const bData = JSON.stringify(b.data);\n if (aData !== bData) return false;\n\n return true;\n }\n\n // Handler for entity changes\n private onEntityChange = (): void => {\n this.updateViewModel();\n };\n\n // Handler for state machine changes\n private onStateMachineChange = (): void => {\n this.updateViewModel();\n };\n\n private updateViewModel(): void {\n const entity = this.hostStateEntity;\n const stateMachine = this.hostStateMachine;\n const appRepo = this.appRepo;\n\n if (!entity) {\n this.doUpdateView(HostStatePM.defaultVM);\n return;\n }\n\n // Check if this state is the active one in the state machine\n const isActive = stateMachine?.activeState === entity.id;\n\n // Look up the app name using the appID from the state entity\n let appName = \"\";\n if (appRepo && entity.appID) {\n const app = appRepo.getApp(entity.appID);\n if (app) {\n appName = app.name;\n }\n }\n\n // Determine if the state can be bumped backwards or forwards\n let canBumpBackwards = false;\n let canBumpForward = false;\n let index = -1;\n\n if (stateMachine) {\n const stateIndex = stateMachine.getStateIndex(entity.id);\n if (stateIndex !== undefined) {\n index = stateIndex;\n // Can bump backwards if index > 0\n canBumpBackwards = stateIndex > 0;\n // Can bump forward if index < length-1\n canBumpForward = stateIndex < stateMachine.stateCount - 1;\n }\n }\n\n // Create a new immutable view model based on entity state\n const newVM: HostStateVM = {\n id: entity.id,\n name: entity.name,\n data: entity.stateData,\n isActive: isActive || false,\n appName,\n canBumpBackwards,\n canBumpForward,\n index,\n streamState: entity.streamState\n };\n\n // Update the view with the new view model\n this.doUpdateView(newVM);\n }\n\n dispose = (): void => {\n this.hostStateEntity?.removeChangeObserver(this.onEntityChange);\n this.hostStateMachine?.removeChangeObserver(this.onStateMachineChange);\n super.dispose();\n };\n\n constructor(appObject: AppObject) {\n super(appObject, HostStatePM.type);\n\n // Subscribe to entity changes\n this.hostStateEntity?.addChangeObserver(this.onEntityChange);\n\n // Subscribe to state machine changes\n this.hostStateMachine?.addChangeObserver(this.onStateMachineChange);\n\n // Initialize the view model\n this.updateViewModel();\n }\n}\n"]}
1
+ {"version":3,"file":"HostStatePM.js","sourceRoot":"","sources":["../../../../src/StateMachine/PMs/HostStatePM.ts"],"names":[],"mappings":";;;AA0CA,0CAEC;AA5CD,sCAAoE;AACpE,yDAA4D;AAC5D,iEAA2E;AAC3E,mEAAgE;AAchE,MAAsB,WAAY,SAAQ,kBAAwB;IAgBhE,+BAA+B;IAC/B,MAAM,CAAC,OAAO,CACZ,EAAU,EACV,UAAyB;QAEzB,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,CAAc,WAAW,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC;;AAtBH,kCAuBC;AAtBiB,gBAAI,GAAG,aAAa,CAAC;AAErC,qBAAqB;AACL,qBAAS,GAAgB;IACvC,EAAE,EAAE,EAAE;IACN,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,EAAE;IACX,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,KAAK;IACrB,KAAK,EAAE,CAAC,CAAC;IACT,WAAW,EAAE,6BAAW,CAAC,IAAI;CAC9B,CAAC;AAWJ,SAAgB,eAAe,CAAC,SAAoB;IAClD,OAAO,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,cAAe,SAAQ,WAAW;IACtC,yCAAyC;IACzC,IAAY,eAAe;QACzB,OAAO,IAAI,CAAC,uBAAuB,CAAkB,iCAAe,CAAC,IAAI,CAAC,CAAC;IAC7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C;QAC1C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAQD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAjErC,6BAA6B;QACrB,mBAAc,GAAG,GAAS,EAAE;YAClC,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC;QAEF,oCAAoC;QAC5B,yBAAoB,GAAG,GAAS,EAAE;YACxC,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC;QAkDF,YAAO,GAAG,GAAS,EAAE;YACnB,IAAI,CAAC,eAAe,EAAE,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAChE,IAAI,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YACvE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC,CAAC;QAKA,8BAA8B;QAC9B,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAE7D,qCAAqC;QACrC,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAEpE,4BAA4B;QAC5B,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["import { AppObject, AppObjectPM, AppObjectRepo } from \"@vived/core\";\nimport { AppRepoEntity } from \"../../Apps/Entities/AppRepo\";\nimport { HostStateEntity, StreamState } from \"../Entities/HostStateEntity\";\nimport { HostStateMachine } from \"../Entities/HostStateMachine\";\n\nexport interface HostStateVM {\n readonly id: string;\n readonly name: string;\n readonly data: object;\n readonly isActive: boolean;\n readonly appName: string;\n readonly canBumpBackwards: boolean;\n readonly canBumpForward: boolean;\n readonly index: number;\n readonly streamState: StreamState;\n}\n\nexport abstract class HostStatePM extends AppObjectPM<HostStateVM> {\n static readonly type = \"HostStatePM\";\n\n // Default view model\n static readonly defaultVM: HostStateVM = {\n id: \"\",\n name: \"\",\n data: {},\n isActive: false,\n appName: \"\",\n canBumpBackwards: false,\n canBumpForward: false,\n index: -1,\n streamState: StreamState.INIT\n };\n\n // Non-singleton getter pattern\n static getById(\n id: string,\n appObjects: AppObjectRepo\n ): HostStatePM | undefined {\n return appObjects.get(id)?.getComponent<HostStatePM>(HostStatePM.type);\n }\n}\n\nexport function makeHostStatePM(appObject: AppObject): HostStatePM {\n return new HostStatePMImp(appObject);\n}\n\nclass HostStatePMImp extends HostStatePM {\n // Get the entity from the same AppObject\n private get hostStateEntity() {\n return this.getCachedLocalComponent<HostStateEntity>(HostStateEntity.type);\n }\n\n // Get the state machine which is a singleton\n private get hostStateMachine() {\n return this.getCachedSingleton<HostStateMachine>(HostStateMachine.type);\n }\n\n // Get the app repo which is a singleton\n private get appRepo() {\n return this.getCachedSingleton<AppRepoEntity>(AppRepoEntity.type);\n }\n\n // Required equality check method for view models\n vmsAreEqual(a: HostStateVM, b: HostStateVM): boolean {\n if (a.id !== b.id) return false;\n if (a.name !== b.name) return false;\n if (a.isActive !== b.isActive) return false;\n if (a.appName !== b.appName) return false;\n if (a.canBumpBackwards !== b.canBumpBackwards) return false;\n if (a.canBumpForward !== b.canBumpForward) return false;\n if (a.index !== b.index) return false;\n if (a.streamState !== b.streamState) return false;\n\n // Deep comparison for the data object\n const aData = JSON.stringify(a.data);\n const bData = JSON.stringify(b.data);\n if (aData !== bData) return false;\n\n return true;\n }\n\n // Handler for entity changes\n private onEntityChange = (): void => {\n this.updateViewModel();\n };\n\n // Handler for state machine changes\n private onStateMachineChange = (): void => {\n this.updateViewModel();\n };\n\n private updateViewModel(): void {\n // Check if this state is the active one in the state machine\n const isActive = this.hostStateMachine.activeState === this.hostStateEntity.id;\n\n // Look up the app name using the appID from the state entity\n let appName = \"\";\n try{\n const app = this.appRepo.getApp(this.hostStateEntity.appID);\n if (app) {\n appName = app.name;\n } \n } catch(e) {\n // No problem\n }\n\n\n // Determine if the state can be bumped backwards or forwards\n let canBumpBackwards = false;\n let canBumpForward = false;\n let index = -1;\n\n const stateIndex = this.hostStateMachine.getStateIndex(this.hostStateEntity.id);\n if (stateIndex !== undefined) {\n index = stateIndex;\n // Can bump backwards if index > 0\n canBumpBackwards = stateIndex > 0;\n // Can bump forward if index < length-1\n canBumpForward = stateIndex < this.hostStateMachine.stateCount - 1;\n }\n \n\n // Create a new immutable view model based on entity state\n const newVM: HostStateVM = {\n id: this.hostStateEntity.id,\n name: this.hostStateEntity.name,\n data: this.hostStateEntity.stateData,\n isActive: isActive || false,\n appName,\n canBumpBackwards,\n canBumpForward,\n index,\n streamState: this.hostStateEntity.streamState\n };\n\n // Update the view with the new view model\n this.doUpdateView(newVM);\n }\n\n dispose = (): void => {\n this.hostStateEntity?.removeChangeObserver(this.onEntityChange);\n this.hostStateMachine?.removeChangeObserver(this.onStateMachineChange);\n super.dispose();\n };\n\n constructor(appObject: AppObject) {\n super(appObject, HostStatePM.type);\n\n // Subscribe to entity changes\n this.hostStateEntity?.addChangeObserver(this.onEntityChange);\n\n // Subscribe to state machine changes\n this.hostStateMachine?.addChangeObserver(this.onStateMachineChange);\n\n // Initialize the view model\n this.updateViewModel();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,sDAAoC;AACpC,oDAAkC;AAClC,oDAAkC;AAClC,6DAA2C;AAC3C,mDAAiC","sourcesContent":["export * from \"./getOnPrimaryColor\";\nexport * from \"./getOnSurfaceColor\";\nexport * from \"./getPrimaryColor\";\nexport * from \"./getSurfaceColor\";\nexport * from \"./getSurfaceContainerColor\";\nexport * from \"./setThemeByName\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,sDAAoC;AACpC,oDAAkC;AAClC,oDAAkC;AAClC,6DAA2C;AAC3C,mDAAiC","sourcesContent":["export * from \"./getOnPrimaryColor\";\r\nexport * from \"./getOnSurfaceColor\";\r\nexport * from \"./getPrimaryColor\";\r\nexport * from \"./getSurfaceColor\";\r\nexport * from \"./getSurfaceContainerColor\";\r\nexport * from \"./setThemeByName\";\r\n"]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThemeFactory = void 0;
4
+ exports.makeThemeFactory = makeThemeFactory;
5
+ const core_1 = require("@vived/core");
6
+ const Data_1 = require("../Data");
7
+ const Entities_1 = require("../Entities");
8
+ const PM_1 = require("../PM");
9
+ const UCs_1 = require("../UCs");
10
+ /**
11
+ * Factory responsible for setting up the Theme domain components.
12
+ * This factory initializes all entities, use cases, and presentation models
13
+ * required for the Theme functionality.
14
+ */
15
+ class ThemeFactory extends core_1.DomainFactory {
16
+ constructor(appObject) {
17
+ super(appObject);
18
+ // Unique name for this factory
19
+ this.factoryName = "ThemeFactory";
20
+ this.theme = null;
21
+ this.setThemeUC = null;
22
+ }
23
+ /**
24
+ * Sets up all entities required for the Theme system
25
+ */
26
+ setupEntities() {
27
+ // Initialize entities
28
+ this.theme = (0, Entities_1.makeHostThemeEntity)(this.appObject);
29
+ }
30
+ /**
31
+ * Sets up all use cases for the Theme system
32
+ */
33
+ setupUCs() {
34
+ // Initialize use cases
35
+ this.setThemeUC = (0, UCs_1.makeSetThemeUC)(this.appObject);
36
+ }
37
+ /**
38
+ * Sets up all presentation managers for the Theme system
39
+ */
40
+ setupPMs() {
41
+ // Initialize presentation managers
42
+ (0, PM_1.makeThemeColorsPM)(this.appObject);
43
+ }
44
+ /**
45
+ * Performs any final setup operations after all components are initialized
46
+ */
47
+ finalSetup() {
48
+ if (!this.theme || !this.setThemeUC) {
49
+ throw new Error("Theme or SetThemeUC not initialized");
50
+ }
51
+ // Register theme schemes
52
+ this.theme.submitScheme("light", Data_1.vivedLightThemeData);
53
+ this.theme.submitScheme("dark", Data_1.vivedDarkThemeData);
54
+ // Set initial theme
55
+ this.setThemeUC.setThemeByName("light"); // Hardcoded for now
56
+ }
57
+ }
58
+ exports.ThemeFactory = ThemeFactory;
59
+ function makeThemeFactory(appObjects) {
60
+ const ao = appObjects.getOrCreate("Theme");
61
+ return new ThemeFactory(ao);
62
+ }
63
+ //# sourceMappingURL=ThemeFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeFactory.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Factories/ThemeFactory.ts"],"names":[],"mappings":";;;AA+DA,4CAGC;AAlED,sCAAsE;AACtE,kCAAkE;AAClE,0CAAmE;AACnE,8BAA0C;AAC1C,gCAAoD;AAEpD;;;;GAIG;AACH,MAAa,YAAa,SAAQ,oBAAa;IAO7C,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAPnB,+BAA+B;QACtB,gBAAW,GAAG,cAAc,CAAC;QAE9B,UAAK,GAA2B,IAAI,CAAC;QACrC,eAAU,GAAsB,IAAI,CAAC;IAI7C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,IAAI,CAAC,KAAK,GAAG,IAAA,8BAAmB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,uBAAuB;QACvB,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAc,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,mCAAmC;QACnC,IAAA,sBAAiB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QAED,yBAAyB;QACzB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,0BAAmB,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,yBAAkB,CAAC,CAAC;QAEpD,oBAAoB;QACpB,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB;IAC/D,CAAC;CACF;AAlDD,oCAkDC;AAED,SAAgB,gBAAgB,CAAC,UAAyB;IACxD,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport { vivedDarkThemeData, vivedLightThemeData } from \"../Data\";\r\nimport { HostThemeEntity, makeHostThemeEntity } from \"../Entities\";\r\nimport { makeThemeColorsPM } from \"../PM\";\r\nimport { makeSetThemeUC, SetThemeUC } from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Theme domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Theme functionality.\r\n */\r\nexport class ThemeFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"ThemeFactory\";\r\n\r\n private theme: HostThemeEntity | null = null;\r\n private setThemeUC: SetThemeUC | null = null;\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Theme system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n this.theme = makeHostThemeEntity(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Theme system\r\n */\r\n setupUCs(): void {\r\n // Initialize use cases\r\n this.setThemeUC = makeSetThemeUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Theme system\r\n */\r\n setupPMs(): void {\r\n // Initialize presentation managers\r\n makeThemeColorsPM(this.appObject);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n if (!this.theme || !this.setThemeUC) {\r\n throw new Error(\"Theme or SetThemeUC not initialized\");\r\n }\r\n\r\n // Register theme schemes\r\n this.theme.submitScheme(\"light\", vivedLightThemeData);\r\n this.theme.submitScheme(\"dark\", vivedDarkThemeData);\r\n\r\n // Set initial theme\r\n this.setThemeUC.setThemeByName(\"light\"); // Hardcoded for now\r\n }\r\n}\r\n\r\nexport function makeThemeFactory(appObjects: AppObjectRepo): ThemeFactory {\r\n const ao = appObjects.getOrCreate(\"Theme\");\r\n return new ThemeFactory(ao);\r\n}\r\n"]}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ThemeFactory"), exports);
17
18
  __exportStar(require("./setupTheme"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B","sourcesContent":["export * from \"./setupTheme\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,+CAA6B","sourcesContent":["export * from \"./ThemeFactory\";\nexport * from \"./setupTheme\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MockSetThemeUC.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Mocks/MockSetThemeUC.ts"],"names":[],"mappings":";;;AAgBA,gDAEC;AAjBD,gCAAoC;AAEpC,MAAa,cAAe,SAAQ,gBAAU;IAI5C,cAAc,CAAC,KAAa,IAAS,CAAC;IAEtC,cAAc,KAAU,CAAC;IAEzB,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,gBAAU,CAAC,IAAI,CAAC,CAAC;QARpC,mBAAc,GAAW,OAAO,CAAC;QACjC,kBAAa,GAAW,MAAM,CAAC;IAQ/B,CAAC;CACF;AAXD,wCAWC;AAED,SAAgB,kBAAkB,CAAC,UAAyB;IAC1D,OAAO,IAAI,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import { AppObject, AppObjectRepo } from \"@vived/core\";\nimport { SetThemeUC } from \"../UCs\";\n\nexport class MockSetThemeUC extends SetThemeUC {\n lightThemeName: string = \"light\";\n darkThemeName: string = \"dark\";\n\n setThemeByName(_name: string): void {}\n\n tryDetectTheme(): void {}\n\n constructor(appObject: AppObject) {\n super(appObject, SetThemeUC.type);\n }\n}\n\nexport function makeMockSetThemeUC(appObjects: AppObjectRepo) {\n return new MockSetThemeUC(appObjects.getOrCreate(\"MockSetThemeUC\"));\n}\n"]}
1
+ {"version":3,"file":"MockSetThemeUC.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Mocks/MockSetThemeUC.ts"],"names":[],"mappings":";;;AAgBA,gDAEC;AAjBD,gCAAoC;AAEpC,MAAa,cAAe,SAAQ,gBAAU;IAI5C,cAAc,CAAC,KAAa,IAAS,CAAC;IAEtC,cAAc,KAAU,CAAC;IAEzB,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,gBAAU,CAAC,IAAI,CAAC,CAAC;QARpC,mBAAc,GAAW,OAAO,CAAC;QACjC,kBAAa,GAAW,MAAM,CAAC;IAQ/B,CAAC;CACF;AAXD,wCAWC;AAED,SAAgB,kBAAkB,CAAC,UAAyB;IAC1D,OAAO,IAAI,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import { AppObject, AppObjectRepo } from \"@vived/core\";\r\nimport { SetThemeUC } from \"../UCs\";\r\n\r\nexport class MockSetThemeUC extends SetThemeUC {\r\n lightThemeName: string = \"light\";\r\n darkThemeName: string = \"dark\";\r\n\r\n setThemeByName(_name: string): void {}\r\n\r\n tryDetectTheme(): void {}\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, SetThemeUC.type);\r\n }\r\n}\r\n\r\nexport function makeMockSetThemeUC(appObjects: AppObjectRepo) {\r\n return new MockSetThemeUC(appObjects.getOrCreate(\"MockSetThemeUC\"));\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Mocks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,mDAAiC","sourcesContent":["export * from \"./MockThemeColorPM\";\nexport * from \"./MockSetThemeUC\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ThemeColors/Mocks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,mDAAiC","sourcesContent":["export * from \"./MockThemeColorPM\";\r\nexport * from \"./MockSetThemeUC\";\r\n"]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SandboxVivedAPIFactory = void 0;
4
+ exports.makeSandboxVivedAPIFactory = makeSandboxVivedAPIFactory;
5
+ const core_1 = require("@vived/core");
6
+ const Entities_1 = require("../Entities");
7
+ const PMs_1 = require("../PMs");
8
+ const UCs_1 = require("../UCs");
9
+ /**
10
+ * Factory responsible for setting up the VivedAPI domain components for sandbox.
11
+ * This factory initializes all entities, use cases, and presentation models
12
+ * required for the VivedAPI functionality.
13
+ */
14
+ class SandboxVivedAPIFactory extends core_1.DomainFactory {
15
+ constructor(appObject) {
16
+ super(appObject);
17
+ // Unique name for this factory
18
+ this.factoryName = "SandboxVivedAPIFactory";
19
+ }
20
+ /**
21
+ * Sets up all entities required for the VivedAPI system
22
+ */
23
+ setupEntities() {
24
+ // Initialize entities
25
+ new Entities_1.VivedAPIEntity(this.appObject);
26
+ }
27
+ /**
28
+ * Sets up all use cases for the VivedAPI system
29
+ */
30
+ setupUCs() {
31
+ // Initialize use cases
32
+ (0, UCs_1.makeDeleteAssetOnAPIUC)(this.appObject);
33
+ (0, UCs_1.makeFetchAssetFileFromAPIUC)(this.appObject);
34
+ (0, UCs_1.makeFetchAssetMetaFromAPIUC)(this.appObject);
35
+ (0, UCs_1.makeFileUploadUC)(this.appObject);
36
+ (0, UCs_1.makeGetAppFromAPIUC)(this.appObject);
37
+ (0, UCs_1.makeGetAssetsForOwnerFromAPIUC)(this.appObject);
38
+ (0, UCs_1.makePatchAssetFileUC)(this.appObject);
39
+ (0, UCs_1.makePatchAssetIsArchivedUC)(this.appObject);
40
+ (0, UCs_1.makePatchAssetMetaUC)(this.appObject);
41
+ (0, UCs_1.makePatchAssetUC)(this.appObject);
42
+ (0, UCs_1.makePostNewAssetUC)(this.appObject);
43
+ }
44
+ /**
45
+ * Sets up all presentation managers for the VivedAPI system
46
+ */
47
+ setupPMs() {
48
+ // Initialize presentation managers
49
+ (0, PMs_1.makeUserTokenPM)(this.appObject);
50
+ }
51
+ /**
52
+ * Performs any final setup operations after all components are initialized
53
+ */
54
+ finalSetup() {
55
+ // No additional setup required for VivedAPI
56
+ }
57
+ }
58
+ exports.SandboxVivedAPIFactory = SandboxVivedAPIFactory;
59
+ function makeSandboxVivedAPIFactory(appObjects) {
60
+ const ao = appObjects.getOrCreate("VIVED API");
61
+ return new SandboxVivedAPIFactory(ao);
62
+ }
63
+ //# sourceMappingURL=SandboxVivedAPIFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxVivedAPIFactory.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/SandboxVivedAPIFactory.ts"],"names":[],"mappings":";;;AAwEA,gEAKC;AA7ED,sCAAsE;AACtE,0CAA6C;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CAAC,WAAW,CAAC,CAAC;IAC/C,OAAO,IAAI,sBAAsB,CAAC,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport { VivedAPIEntity } from \"../Entities\";\r\nimport { makeUserTokenPM } from \"../PMs\";\r\nimport {\r\n makeDeleteAssetOnAPIUC,\r\n makeFetchAssetFileFromAPIUC,\r\n makeFetchAssetMetaFromAPIUC,\r\n makeFileUploadUC,\r\n makeGetAppFromAPIUC,\r\n makeGetAssetsForOwnerFromAPIUC,\r\n makePatchAssetFileUC,\r\n makePatchAssetIsArchivedUC,\r\n makePatchAssetMetaUC,\r\n makePatchAssetUC,\r\n makePostNewAssetUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the VivedAPI domain components for sandbox.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the VivedAPI functionality.\r\n */\r\nexport class SandboxVivedAPIFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"SandboxVivedAPIFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the VivedAPI system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n new VivedAPIEntity(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the VivedAPI system\r\n */\r\n setupUCs(): void {\r\n // Initialize use cases\r\n makeDeleteAssetOnAPIUC(this.appObject);\r\n makeFetchAssetFileFromAPIUC(this.appObject);\r\n makeFetchAssetMetaFromAPIUC(this.appObject);\r\n makeFileUploadUC(this.appObject);\r\n makeGetAppFromAPIUC(this.appObject);\r\n makeGetAssetsForOwnerFromAPIUC(this.appObject);\r\n makePatchAssetFileUC(this.appObject);\r\n makePatchAssetIsArchivedUC(this.appObject);\r\n makePatchAssetMetaUC(this.appObject);\r\n makePatchAssetUC(this.appObject);\r\n makePostNewAssetUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the VivedAPI system\r\n */\r\n setupPMs(): void {\r\n // Initialize presentation managers\r\n makeUserTokenPM(this.appObject);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for VivedAPI\r\n }\r\n}\r\n\r\nexport function makeSandboxVivedAPIFactory(\r\n appObjects: AppObjectRepo\r\n): SandboxVivedAPIFactory {\r\n const ao = appObjects.getOrCreate(\"VIVED API\");\r\n return new SandboxVivedAPIFactory(ao);\r\n}\r\n"]}
@@ -31,6 +31,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
31
31
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
32
32
  };
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
+ __exportStar(require("./SandboxVivedAPIFactory"), exports);
34
35
  __exportStar(require("./setupVivedAPIForSandbox"), exports);
35
36
  __exportStar(require("./VivedAPIFactory"), exports);
36
37
  __exportStar(require("./setupAPI"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;AAEH,4DAA0C;AAC1C,oDAAkC;AAClC,6CAA2B","sourcesContent":["/**\r\n * VivedAPI Factories Index\r\n *\r\n * This module exports all factory functions for the VivedAPI feature.\r\n * Factory functions provide centralized component creation and feature setup,\r\n * ensuring proper initialization and component wiring for different environments.\r\n *\r\n * Key Concepts:\r\n * - Factory functions encapsulate complex component creation workflows\r\n * - They establish proper dependencies and relationships between components\r\n * - Factories provide environment-specific setup (sandbox, production, testing)\r\n * - They ensure singleton registration and component availability\r\n * - Factory functions serve as entry points for feature initialization\r\n *\r\n * Available Factories:\r\n * - setupVivedAPIForSandbox: Complete feature setup for sandbox environments\r\n */\r\n\r\nexport * from \"./setupVivedAPIForSandbox\";\r\nexport * from \"./VivedAPIFactory\";\r\nexport * from \"./setupAPI\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;AAEH,2DAAyC;AACzC,4DAA0C;AAC1C,oDAAkC;AAClC,6CAA2B","sourcesContent":["/**\r\n * VivedAPI Factories Index\r\n *\r\n * This module exports all factory functions for the VivedAPI feature.\r\n * Factory functions provide centralized component creation and feature setup,\r\n * ensuring proper initialization and component wiring for different environments.\r\n *\r\n * Key Concepts:\r\n * - Factory functions encapsulate complex component creation workflows\r\n * - They establish proper dependencies and relationships between components\r\n * - Factories provide environment-specific setup (sandbox, production, testing)\r\n * - They ensure singleton registration and component availability\r\n * - Factory functions serve as entry points for feature initialization\r\n *\r\n * Available Factories:\r\n * - setupVivedAPIForSandbox: Complete feature setup for sandbox environments\r\n */\r\n\r\nexport * from \"./SandboxVivedAPIFactory\";\r\nexport * from \"./setupVivedAPIForSandbox\";\r\nexport * from \"./VivedAPIFactory\";\r\nexport * from \"./setupAPI\";\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ZSpaceHost/Controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B;AAC7B,wDAAsC","sourcesContent":["export * from \"./setZSpaceIsSupported\";\nexport * from \"./startZSpace\";\nexport * from \"./stopZSpace\";\nexport * from \"./toggleEmulateZSpace\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ZSpaceHost/Controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B;AAC7B,wDAAsC","sourcesContent":["export * from \"./setZSpaceIsSupported\";\r\nexport * from \"./startZSpace\";\r\nexport * from \"./stopZSpace\";\r\nexport * from \"./toggleEmulateZSpace\";\r\n"]}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SandboxZSpaceFactory = void 0;
4
+ exports.makeSandboxZSpaceFactory = makeSandboxZSpaceFactory;
5
+ const core_1 = require("@vived/core");
6
+ const Entities_1 = require("../Entities");
7
+ const PMs_1 = require("../PMs");
8
+ const UCs_1 = require("../UCs");
9
+ /**
10
+ * Factory responsible for setting up the ZSpace domain components for sandbox.
11
+ * This factory initializes all entities, use cases, and presentation models
12
+ * required for the ZSpace functionality.
13
+ */
14
+ class SandboxZSpaceFactory extends core_1.DomainFactory {
15
+ constructor(appObject) {
16
+ super(appObject);
17
+ // Unique name for this factory
18
+ this.factoryName = "SandboxZSpaceFactory";
19
+ }
20
+ /**
21
+ * Sets up all entities required for the ZSpace system
22
+ */
23
+ setupEntities() {
24
+ // Initialize entities
25
+ (0, Entities_1.makeZSpaceHostEntity)(this.appObject);
26
+ }
27
+ /**
28
+ * Sets up all use cases for the ZSpace system
29
+ */
30
+ setupUCs() {
31
+ // Initialize use cases
32
+ (0, UCs_1.makeStopSandboxZSpaceUC)(this.appObject);
33
+ (0, UCs_1.makeStartSandboxZSpaceUC)(this.appObject);
34
+ }
35
+ /**
36
+ * Sets up all presentation managers for the ZSpace system
37
+ */
38
+ setupPMs() {
39
+ // Initialize presentation managers
40
+ (0, PMs_1.makeEmulateZSpacePM)(this.appObject);
41
+ (0, PMs_1.makeZSpaceIsActivePM)(this.appObject);
42
+ }
43
+ /**
44
+ * Performs any final setup operations after all components are initialized
45
+ */
46
+ finalSetup() {
47
+ // No additional setup required for ZSpace
48
+ }
49
+ }
50
+ exports.SandboxZSpaceFactory = SandboxZSpaceFactory;
51
+ function makeSandboxZSpaceFactory(appObjects) {
52
+ const ao = appObjects.getOrCreate("zSpace");
53
+ return new SandboxZSpaceFactory(ao);
54
+ }
55
+ //# sourceMappingURL=SandboxZSpaceFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SandboxZSpaceFactory.js","sourceRoot":"","sources":["../../../../src/ZSpaceHost/Factories/SandboxZSpaceFactory.ts"],"names":[],"mappings":";;;AAoDA,4DAKC;AAzDD,sCAAsE;AACtE,0CAAmD;AACnD,gCAAmE;AACnE,gCAA2E;AAE3E;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,oBAAa;IAIrD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,sBAAsB,CAAC;IAI9C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,IAAA,+BAAoB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,uBAAuB;QACvB,IAAA,6BAAuB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,IAAA,8BAAwB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,mCAAmC;QACnC,IAAA,yBAAmB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,IAAA,0BAAoB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,0CAA0C;IAC5C,CAAC;CACF;AAxCD,oDAwCC;AAED,SAAgB,wBAAwB,CACtC,UAAyB;IAEzB,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,IAAI,oBAAoB,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport { makeZSpaceHostEntity } from \"../Entities\";\r\nimport { makeEmulateZSpacePM, makeZSpaceIsActivePM } from \"../PMs\";\r\nimport { makeStartSandboxZSpaceUC, makeStopSandboxZSpaceUC } from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the ZSpace domain components for sandbox.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the ZSpace functionality.\r\n */\r\nexport class SandboxZSpaceFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"SandboxZSpaceFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the ZSpace system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n makeZSpaceHostEntity(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the ZSpace system\r\n */\r\n setupUCs(): void {\r\n // Initialize use cases\r\n makeStopSandboxZSpaceUC(this.appObject);\r\n makeStartSandboxZSpaceUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the ZSpace system\r\n */\r\n setupPMs(): void {\r\n // Initialize presentation managers\r\n makeEmulateZSpacePM(this.appObject);\r\n makeZSpaceIsActivePM(this.appObject);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for ZSpace\r\n }\r\n}\r\n\r\nexport function makeSandboxZSpaceFactory(\r\n appObjects: AppObjectRepo\r\n): SandboxZSpaceFactory {\r\n const ao = appObjects.getOrCreate(\"zSpace\");\r\n return new SandboxZSpaceFactory(ao);\r\n}\r\n"]}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./SandboxZSpaceFactory"), exports);
17
18
  __exportStar(require("./setupZSpaceForSandbox"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ZSpaceHost/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC","sourcesContent":["export * from \"./setupZSpaceForSandbox\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ZSpaceHost/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,0DAAwC","sourcesContent":["export * from \"./SandboxZSpaceFactory\";\nexport * from \"./setupZSpaceForSandbox\";\n"]}
@@ -0,0 +1,81 @@
1
+ import { DomainFactory } from "@vived/core";
2
+ import { makeSandboxMounter, makeStartAppUC, makeStopAppUC } from "../../Apps/UCs";
3
+ import { makeHostDispatchEntity } from "../../Dispatcher/Entities";
4
+ import { setupStandardHostDispatchers } from "../../Dispatcher/setupStandardHostDispatchers";
5
+ import { makeHostHandlerEntity } from "../../Handler/Entities";
6
+ import { setupStandardHostHandlers } from "../../Handler/setupStandardHostHandlers";
7
+ import { SubmitActivityAssetHandler } from "../../Handler";
8
+ import { makeAppSandboxEntity } from "../Entities";
9
+ import { makeDevFeaturesEnabledPM, makeSandboxStatePM, makeShowInspectorPM, makeStartInZSpacePM } from "../PMs";
10
+ import { makeShowBabylonInspectorUC } from "../UCs";
11
+ import { makeSubmitActivityAssetHandlerSandbox } from "../UCs/submitActivityAssetHandlerSandbox";
12
+ import { AppRepoEntity } from "../../Apps/Entities";
13
+ /**
14
+ * Factory responsible for setting up the AppSandbox domain components.
15
+ * This factory initializes all entities, use cases, and presentation models
16
+ * required for the AppSandbox functionality.
17
+ */
18
+ export class AppSandboxFeatureFactory extends DomainFactory {
19
+ constructor(appObject) {
20
+ super(appObject);
21
+ // Unique name for this factory
22
+ this.factoryName = "AppSandboxFeatureFactory";
23
+ }
24
+ /**
25
+ * Sets up all entities required for the AppSandbox system
26
+ */
27
+ setupEntities() {
28
+ // Initialize entities
29
+ this.sandbox = makeAppSandboxEntity(this.appObject);
30
+ makeHostDispatchEntity(this.appObject);
31
+ makeHostHandlerEntity(this.appObject);
32
+ }
33
+ /**
34
+ * Sets up all use cases for the AppSandbox system
35
+ */
36
+ setupUCs() {
37
+ // Setup standard dispatchers and handlers
38
+ setupStandardHostDispatchers(this.appObject);
39
+ setupStandardHostHandlers(this.appObject);
40
+ // Initialize use cases
41
+ makeStartAppUC(this.appObject);
42
+ makeStopAppUC(this.appObject);
43
+ makeShowBabylonInspectorUC(this.appObject);
44
+ makeSandboxMounter(this.appObject);
45
+ }
46
+ /**
47
+ * Sets up all presentation managers for the AppSandbox system
48
+ */
49
+ setupPMs() {
50
+ // Initialize presentation managers
51
+ makeDevFeaturesEnabledPM(this.appObject);
52
+ makeSandboxStatePM(this.appObject);
53
+ makeShowInspectorPM(this.appObject);
54
+ makeStartInZSpacePM(this.appObject);
55
+ }
56
+ /**
57
+ * Performs any final setup operations after all components are initialized
58
+ */
59
+ finalSetup() {
60
+ // Setup custom handler for activity asset submission
61
+ const submitActivityAssetUC = this.appObjects.getSingleton(SubmitActivityAssetHandler.type);
62
+ if (submitActivityAssetUC) {
63
+ submitActivityAssetUC.action = makeSubmitActivityAssetHandlerSandbox(this.appObjects);
64
+ }
65
+ if (!this.sandbox) {
66
+ this.error("AppSandboxEntity not found during final setup.");
67
+ return;
68
+ }
69
+ const apps = AppRepoEntity.get(this.appObjects);
70
+ if (!apps) {
71
+ this.error("AppRepoEntity not found in AppObjects.");
72
+ return;
73
+ }
74
+ apps.add(this.sandbox.app);
75
+ }
76
+ }
77
+ export function makeAppSandboxFeatureFactory(appID, appObjects) {
78
+ const ao = appObjects.getOrCreate(appID);
79
+ return new AppSandboxFeatureFactory(ao);
80
+ }
81
+ //# sourceMappingURL=AppSandboxFeatureFactory.js.map