@vived/core 1.6.0 → 2.0.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.
- package/dist/cjs/AppObject/AppObjectComponent.js +8 -10
- package/dist/cjs/AppObject/AppObjectComponent.js.map +1 -1
- package/dist/cjs/AppObject/AppObjectEntityRepo.js +99 -11
- package/dist/cjs/AppObject/AppObjectEntityRepo.js.map +1 -1
- package/dist/cjs/AppObject/AppObjectPM.js +106 -6
- package/dist/cjs/AppObject/AppObjectPM.js.map +1 -1
- package/dist/cjs/AppObject/AppObjectRepo.js +4 -1
- package/dist/cjs/AppObject/AppObjectRepo.js.map +1 -1
- package/dist/cjs/AppObject/AppObjectSingletonEntity.js +40 -0
- package/dist/cjs/AppObject/AppObjectSingletonEntity.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectSingletonEntityRepo.js +54 -0
- package/dist/cjs/AppObject/AppObjectSingletonEntityRepo.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectSingletonPM.js +69 -0
- package/dist/cjs/AppObject/AppObjectSingletonPM.js.map +1 -0
- package/dist/cjs/AppObject/AppObjectSingletonUC.js +60 -0
- package/dist/cjs/AppObject/AppObjectSingletonUC.js.map +1 -0
- package/dist/cjs/AppObject/index.js +4 -0
- package/dist/cjs/AppObject/index.js.map +1 -1
- package/dist/cjs/Entities/ObserverList.js +6 -0
- package/dist/cjs/Entities/ObserverList.js.map +1 -1
- package/dist/cjs/ExampleFeature/Entities/ExampleRepo.js +11 -22
- package/dist/cjs/ExampleFeature/Entities/ExampleRepo.js.map +1 -1
- package/dist/cjs/ExampleFeature/Entities/ExampleSingletonEntity.js +1 -3
- package/dist/cjs/ExampleFeature/Entities/ExampleSingletonEntity.js.map +1 -1
- package/dist/cjs/ExampleFeature/Factory/ExampleFeatureFactory.js +1 -1
- package/dist/cjs/ExampleFeature/Factory/ExampleFeatureFactory.js.map +1 -1
- package/dist/cjs/ExampleFeature/PMs/ExamplePM.js +5 -13
- package/dist/cjs/ExampleFeature/PMs/ExamplePM.js.map +1 -1
- package/dist/cjs/ExampleFeature/PMs/ExampleSingletonPM.js +8 -12
- package/dist/cjs/ExampleFeature/PMs/ExampleSingletonPM.js.map +1 -1
- package/dist/cjs/ExampleFeature/UCs/EditExampleStringUC.js +0 -4
- package/dist/cjs/ExampleFeature/UCs/EditExampleStringUC.js.map +1 -1
- package/dist/cjs/ExampleFeature/UCs/ToggleExampleBooleanUC.js +2 -8
- package/dist/cjs/ExampleFeature/UCs/ToggleExampleBooleanUC.js.map +1 -1
- package/dist/esm/AppObject/AppObjectComponent.js +8 -10
- package/dist/esm/AppObject/AppObjectComponent.js.map +1 -1
- package/dist/esm/AppObject/AppObjectEntityRepo.js +99 -11
- package/dist/esm/AppObject/AppObjectEntityRepo.js.map +1 -1
- package/dist/esm/AppObject/AppObjectPM.js +107 -7
- package/dist/esm/AppObject/AppObjectPM.js.map +1 -1
- package/dist/esm/AppObject/AppObjectRepo.js +4 -1
- package/dist/esm/AppObject/AppObjectRepo.js.map +1 -1
- package/dist/esm/AppObject/AppObjectSingletonEntity.js +36 -0
- package/dist/esm/AppObject/AppObjectSingletonEntity.js.map +1 -0
- package/dist/esm/AppObject/AppObjectSingletonEntityRepo.js +50 -0
- package/dist/esm/AppObject/AppObjectSingletonEntityRepo.js.map +1 -0
- package/dist/esm/AppObject/AppObjectSingletonPM.js +65 -0
- package/dist/esm/AppObject/AppObjectSingletonPM.js.map +1 -0
- package/dist/esm/AppObject/AppObjectSingletonUC.js +56 -0
- package/dist/esm/AppObject/AppObjectSingletonUC.js.map +1 -0
- package/dist/esm/AppObject/index.js +4 -0
- package/dist/esm/AppObject/index.js.map +1 -1
- package/dist/esm/Entities/ObserverList.js +6 -0
- package/dist/esm/Entities/ObserverList.js.map +1 -1
- package/dist/esm/ExampleFeature/Entities/ExampleRepo.js +11 -22
- package/dist/esm/ExampleFeature/Entities/ExampleRepo.js.map +1 -1
- package/dist/esm/ExampleFeature/Entities/ExampleSingletonEntity.js +2 -4
- package/dist/esm/ExampleFeature/Entities/ExampleSingletonEntity.js.map +1 -1
- package/dist/esm/ExampleFeature/Factory/ExampleFeatureFactory.js +1 -1
- package/dist/esm/ExampleFeature/Factory/ExampleFeatureFactory.js.map +1 -1
- package/dist/esm/ExampleFeature/PMs/ExamplePM.js +5 -13
- package/dist/esm/ExampleFeature/PMs/ExamplePM.js.map +1 -1
- package/dist/esm/ExampleFeature/PMs/ExampleSingletonPM.js +9 -13
- package/dist/esm/ExampleFeature/PMs/ExampleSingletonPM.js.map +1 -1
- package/dist/esm/ExampleFeature/UCs/EditExampleStringUC.js +0 -4
- package/dist/esm/ExampleFeature/UCs/EditExampleStringUC.js.map +1 -1
- package/dist/esm/ExampleFeature/UCs/ToggleExampleBooleanUC.js +3 -9
- package/dist/esm/ExampleFeature/UCs/ToggleExampleBooleanUC.js.map +1 -1
- package/dist/types/AppObject/AppObjectComponent.d.ts +6 -4
- package/dist/types/AppObject/AppObjectComponent.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectEntityRepo.d.ts +72 -7
- package/dist/types/AppObject/AppObjectEntityRepo.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectPM.d.ts +82 -2
- package/dist/types/AppObject/AppObjectPM.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectRepo.d.ts +6 -0
- package/dist/types/AppObject/AppObjectRepo.d.ts.map +1 -1
- package/dist/types/AppObject/AppObjectSingletonEntity.d.ts +31 -0
- package/dist/types/AppObject/AppObjectSingletonEntity.d.ts.map +1 -0
- package/dist/types/AppObject/AppObjectSingletonEntityRepo.d.ts +46 -0
- package/dist/types/AppObject/AppObjectSingletonEntityRepo.d.ts.map +1 -0
- package/dist/types/AppObject/AppObjectSingletonPM.d.ts +60 -0
- package/dist/types/AppObject/AppObjectSingletonPM.d.ts.map +1 -0
- package/dist/types/AppObject/AppObjectSingletonUC.d.ts +51 -0
- package/dist/types/AppObject/AppObjectSingletonUC.d.ts.map +1 -0
- package/dist/types/AppObject/index.d.ts +4 -0
- package/dist/types/AppObject/index.d.ts.map +1 -1
- package/dist/types/Entities/ObserverList.d.ts +4 -0
- package/dist/types/Entities/ObserverList.d.ts.map +1 -1
- package/dist/types/ExampleFeature/Entities/ExampleRepo.d.ts +0 -4
- package/dist/types/ExampleFeature/Entities/ExampleRepo.d.ts.map +1 -1
- package/dist/types/ExampleFeature/Entities/ExampleSingletonEntity.d.ts +2 -2
- package/dist/types/ExampleFeature/Entities/ExampleSingletonEntity.d.ts.map +1 -1
- package/dist/types/ExampleFeature/PMs/ExampleSingletonPM.d.ts +4 -4
- package/dist/types/ExampleFeature/PMs/ExampleSingletonPM.d.ts.map +1 -1
- package/dist/types/ExampleFeature/UCs/ToggleExampleBooleanUC.d.ts +2 -2
- package/dist/types/ExampleFeature/UCs/ToggleExampleBooleanUC.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AppObject } from "./AppObject";
|
|
2
|
+
import { AppObjectPM } from "./AppObjectPM";
|
|
3
|
+
/**
|
|
4
|
+
* Singleton Presentation Manager (PM) component that transforms application state into view models
|
|
5
|
+
*
|
|
6
|
+
* AppObjectSingletonPM extends AppObjectPM and automatically registers itself as a singleton
|
|
7
|
+
* in the AppObjectRepo upon construction. This ensures only one instance of this PM type exists
|
|
8
|
+
* across the entire application.
|
|
9
|
+
*
|
|
10
|
+
* Use this class when you need a presentation manager that should have only one instance globally,
|
|
11
|
+
* such as application-wide UI state managers or shared view model providers.
|
|
12
|
+
*
|
|
13
|
+
* A singleton PM typically:
|
|
14
|
+
* 1. Observes entity changes
|
|
15
|
+
* 2. Transforms entity data into view models
|
|
16
|
+
* 3. Notifies attached views when view models change
|
|
17
|
+
* 4. Handles view model caching and optimization
|
|
18
|
+
* 5. Exists as a single instance across the application
|
|
19
|
+
*
|
|
20
|
+
* @typeparam T The view model type this PM produces
|
|
21
|
+
* @extends AppObjectPM
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* class GlobalSettingsPM extends AppObjectSingletonPM<SettingsVM> {
|
|
26
|
+
* static type = "globalSettingsPM";
|
|
27
|
+
*
|
|
28
|
+
* constructor(appObject: AppObject) {
|
|
29
|
+
* super(appObject, GlobalSettingsPM.type);
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* vmsAreEqual(a: SettingsVM, b: SettingsVM): boolean {
|
|
33
|
+
* return a.theme === b.theme && a.language === b.language;
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* formVM(): void {
|
|
37
|
+
* // Form view model from entities
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare abstract class AppObjectSingletonPM<T> extends AppObjectPM<T> {
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new singleton presentation manager component and attaches it to the specified AppObject
|
|
45
|
+
* Automatically registers itself as a singleton in the AppObjectRepo
|
|
46
|
+
*
|
|
47
|
+
* @param appObject The parent AppObject this component will be attached to
|
|
48
|
+
* @param type The unique type identifier for this component
|
|
49
|
+
*/
|
|
50
|
+
constructor(appObject: AppObject, type: string);
|
|
51
|
+
/**
|
|
52
|
+
* Cleans up resources and unregisters the singleton
|
|
53
|
+
*
|
|
54
|
+
* This method:
|
|
55
|
+
* 1. Unregisters itself from the singleton registry
|
|
56
|
+
* 2. Calls the parent class dispose method (which handles entity observers and views)
|
|
57
|
+
*/
|
|
58
|
+
dispose(): void;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=AppObjectSingletonPM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppObjectSingletonPM.d.ts","sourceRoot":"","sources":["../../../src/AppObject/AppObjectSingletonPM.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,8BAAsB,oBAAoB,CAAC,CAAC,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IAClE;;;;;;OAMG;gBACS,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM;IAM9C;;;;;;OAMG;IACH,OAAO;CAIR"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AppObject } from "./AppObject";
|
|
2
|
+
import { AppObjectUC } from "./AppObjectUC";
|
|
3
|
+
/**
|
|
4
|
+
* AppObjectSingletonUC (Use Case) serves as a singleton use case class within the application framework.
|
|
5
|
+
*
|
|
6
|
+
* This class extends AppObjectUC and automatically registers itself as a singleton in the
|
|
7
|
+
* AppObjectRepo upon construction. This ensures only one instance of this use case type exists
|
|
8
|
+
* across the entire application.
|
|
9
|
+
*
|
|
10
|
+
* Use Cases are components that represent specific application operations or workflows.
|
|
11
|
+
* They encapsulate business rules and coordinate interactions between different parts
|
|
12
|
+
* of the application. Use this singleton version when the use case should exist as a
|
|
13
|
+
* single instance globally, such as application-wide orchestration or workflow managers.
|
|
14
|
+
*
|
|
15
|
+
* @extends AppObjectUC
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* class GlobalPurchaseManagerUC extends AppObjectSingletonUC {
|
|
20
|
+
* static type = "globalPurchaseManagerUC";
|
|
21
|
+
*
|
|
22
|
+
* constructor(appObject: AppObject) {
|
|
23
|
+
* super(appObject, GlobalPurchaseManagerUC.type);
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* execute(itemId: string, quantity: number): boolean {
|
|
27
|
+
* // Implement the purchase item use case
|
|
28
|
+
* return true; // if successful
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class AppObjectSingletonUC extends AppObjectUC {
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new singleton use case component and attaches it to the specified AppObject
|
|
36
|
+
* Automatically registers itself as a singleton in the AppObjectRepo
|
|
37
|
+
*
|
|
38
|
+
* @param appObject The parent AppObject this component will be attached to
|
|
39
|
+
* @param type The unique type identifier for this component
|
|
40
|
+
*/
|
|
41
|
+
constructor(appObject: AppObject, type: string);
|
|
42
|
+
/**
|
|
43
|
+
* Cleans up resources and unregisters the singleton
|
|
44
|
+
*
|
|
45
|
+
* This method:
|
|
46
|
+
* 1. Unregisters itself from the singleton registry
|
|
47
|
+
* 2. Calls the parent class dispose method
|
|
48
|
+
*/
|
|
49
|
+
dispose(): void;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=AppObjectSingletonUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppObjectSingletonUC.d.ts","sourceRoot":"","sources":["../../../src/AppObject/AppObjectSingletonUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD;;;;;;OAMG;gBACS,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM;IAM9C;;;;;;OAMG;IACH,OAAO;CAIR"}
|
|
@@ -6,6 +6,10 @@ export * from "./AppObjectRepo";
|
|
|
6
6
|
export * from "./AppObjectUC";
|
|
7
7
|
export * from "./AppObjectController";
|
|
8
8
|
export * from "./AppObjectView";
|
|
9
|
+
export * from "./AppObjectSingletonEntity";
|
|
10
|
+
export * from "./AppObjectSingletonEntityRepo";
|
|
11
|
+
export * from "./AppObjectSingletonPM";
|
|
12
|
+
export * from "./AppObjectSingletonUC";
|
|
9
13
|
export * from "./getSingletonComponent";
|
|
10
14
|
export * from "./printAppObjectDetails";
|
|
11
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AppObject/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AppObject/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class ObserverList<T> {
|
|
8
8
|
private observers;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the number of observers in the list
|
|
11
|
+
*/
|
|
12
|
+
get length(): number;
|
|
9
13
|
/**
|
|
10
14
|
* Notifies all observers by calling them with the provided message
|
|
11
15
|
* @param msg - The message to send to all observers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObserverList.d.ts","sourceRoot":"","sources":["../../../src/Entities/ObserverList.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,YAAY,CAAC,CAAC;IACzB,OAAO,CAAC,SAAS,CAA4B;IAE7C;;;OAGG;IACI,MAAM,GAAI,KAAK,CAAC,UAIrB;IAEF;;;OAGG;IACI,GAAG,GAAI,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,UAEjC;IAEF;;;OAGG;IACI,MAAM,GAAI,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,UAKpC;IAEF;;OAEG;IACI,KAAK,aAEV;CACH"}
|
|
1
|
+
{"version":3,"file":"ObserverList.d.ts","sourceRoot":"","sources":["../../../src/Entities/ObserverList.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,YAAY,CAAC,CAAC;IACzB,OAAO,CAAC,SAAS,CAA4B;IAE7C;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;;OAGG;IACI,MAAM,GAAI,KAAK,CAAC,UAIrB;IAEF;;;OAGG;IACI,GAAG,GAAI,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,UAEjC;IAEF;;;OAGG;IACI,MAAM,GAAI,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,UAKpC;IAEF;;OAEG;IACI,KAAK,aAEV;CACH"}
|
|
@@ -27,10 +27,6 @@ export type ExampleEntityFactory = (id: string) => ExampleEntity;
|
|
|
27
27
|
export declare abstract class ExampleRepo extends AppObjectEntityRepo<ExampleEntity> {
|
|
28
28
|
/** Unique type identifier for this component */
|
|
29
29
|
static readonly type = "ExampleRepoType";
|
|
30
|
-
/** Factory function used to create new entities */
|
|
31
|
-
abstract exampleEntityFactory: ExampleEntityFactory;
|
|
32
|
-
/** Creates a new entity with an optional ID */
|
|
33
|
-
abstract createExampleEntity(id?: string): ExampleEntity;
|
|
34
30
|
/** Deletes an entity by its AppObject ID */
|
|
35
31
|
abstract deleteExampleEntity(id: string): void;
|
|
36
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleRepo.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/ExampleRepo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ExampleRepo.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/ExampleRepo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AAEnE,kFAAkF;AAClF,MAAM,MAAM,oBAAoB,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,aAAa,CAAC;AAEjE;;;GAGG;AACH,8BAAsB,WAAY,SAAQ,mBAAmB,CAAC,aAAa,CAAC;IAC1E,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,qBAAqB;IAEzC,4CAA4C;IAC5C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAE9C;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS;IAItD;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,WAAW,GAAG,SAAS;IAI1B;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW;CAQvD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,CAEjE"}
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
* 2. Access or modify properties via getters/setters
|
|
17
17
|
* 3. Register change observers to react to property updates
|
|
18
18
|
*/
|
|
19
|
-
import { AppObject,
|
|
19
|
+
import { AppObject, AppObjectRepo, AppObjectSingletonEntity } from "../../AppObject";
|
|
20
20
|
/**
|
|
21
21
|
* SingletonEntityExample represents a global entity with a boolean property.
|
|
22
22
|
* As a singleton, only one instance exists in the application.
|
|
23
23
|
*/
|
|
24
|
-
export declare abstract class SingletonEntityExample extends
|
|
24
|
+
export declare abstract class SingletonEntityExample extends AppObjectSingletonEntity {
|
|
25
25
|
/** Unique type identifier for this component */
|
|
26
26
|
static readonly type = "SingletonEntityExampleType";
|
|
27
27
|
/** Boolean property accessor methods that must be implemented */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleSingletonEntity.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/ExampleSingletonEntity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"ExampleSingletonEntity.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/ExampleSingletonEntity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAIzB;;;GAGG;AACH,8BAAsB,sBAAuB,SAAQ,wBAAwB;IAC3E,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,gCAAgC;IAEpD,iEAAiE;IACjE,QAAQ,KAAK,aAAa,IAAI,OAAO,CAAC;IACtC,QAAQ,KAAK,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE;IAEzC;;;;OAIG;IACH,MAAM,CAAC,GAAG,GACR,YAAY,aAAa,KACxB,sBAAsB,GAAG,SAAS,CAC4B;CAClE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,GACnB,sBAAsB,CAExB"}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* accessed globally. They transform data from singleton entities into view models.
|
|
7
7
|
*
|
|
8
8
|
* Key concepts:
|
|
9
|
-
* - Singleton PMs extend
|
|
10
|
-
* - They register themselves as singletons with appObjects.registerSingleton()
|
|
9
|
+
* - Singleton PMs extend AppObjectSingletonPM<VM> which handles singleton registration automatically
|
|
11
10
|
* - They're accessed through a static get() method using getSingletonComponent()
|
|
12
11
|
* - They typically observe singleton entities and provide data to multiple UI components
|
|
12
|
+
* - They use formVM() to transform entity data into view models
|
|
13
13
|
*
|
|
14
14
|
* Usage pattern:
|
|
15
15
|
* 1. Access the singleton PM using the static get() method
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* 3. PM will call the view callbacks with updated view models when entities change
|
|
18
18
|
* 4. Remove UI components with removeView(callback) when they're unmounted
|
|
19
19
|
*/
|
|
20
|
-
import { AppObject,
|
|
20
|
+
import { AppObject, AppObjectRepo, AppObjectSingletonPM } from "../../AppObject";
|
|
21
21
|
/**
|
|
22
22
|
* Interface defining the structure of the view model provided by ExampleSingletonPM
|
|
23
23
|
*/
|
|
@@ -28,7 +28,7 @@ export interface ExampleVM {
|
|
|
28
28
|
* ExampleSingletonPM transforms SingletonEntityExample data into an ExampleVM.
|
|
29
29
|
* As a singleton, only one instance exists in the application.
|
|
30
30
|
*/
|
|
31
|
-
export declare abstract class ExampleSingletonPM extends
|
|
31
|
+
export declare abstract class ExampleSingletonPM extends AppObjectSingletonPM<ExampleVM> {
|
|
32
32
|
/** Unique type identifier for this component */
|
|
33
33
|
static readonly type = "ExampleSingletonPMType";
|
|
34
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleSingletonPM.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/PMs/ExampleSingletonPM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"ExampleSingletonPM.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/PMs/ExampleSingletonPM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAIzB;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,8BAAsB,kBAAmB,SAAQ,oBAAoB,CAAC,SAAS,CAAC;IAC9E,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,4BAA4B;IAEhD;;;;OAIG;IACH,MAAM,CAAC,GAAG,GAAI,YAAY,aAAa,KAAG,kBAAkB,GAAG,SAAS,CACX;CAC9D;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAEtC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,GACnB,kBAAkB,CAEpB"}
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
* 2. Call the UC's methods to perform operations
|
|
17
17
|
* 3. The UC will update entities, which will trigger PM updates and UI refreshes
|
|
18
18
|
*/
|
|
19
|
-
import { AppObject, AppObjectRepo,
|
|
19
|
+
import { AppObject, AppObjectRepo, AppObjectSingletonUC } from "../../AppObject";
|
|
20
20
|
/**
|
|
21
21
|
* ToggleExampleBooleanUC provides functionality to toggle the boolean property
|
|
22
22
|
* of the SingletonEntityExample. As a singleton, only one instance exists in the application.
|
|
23
23
|
*/
|
|
24
|
-
export declare abstract class ToggleExampleBooleanUC extends
|
|
24
|
+
export declare abstract class ToggleExampleBooleanUC extends AppObjectSingletonUC {
|
|
25
25
|
/** Unique type identifier for this component */
|
|
26
26
|
static readonly type = "ToggleExampleBooleanUCType";
|
|
27
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleExampleBooleanUC.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/UCs/ToggleExampleBooleanUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"ToggleExampleBooleanUC.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/UCs/ToggleExampleBooleanUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAIzB;;;GAGG;AACH,8BAAsB,sBAAuB,SAAQ,oBAAoB;IACvE,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,gCAAgC;IAEpD;;OAEG;IACH,QAAQ,CAAC,oBAAoB,IAAI,IAAI;IAErC;;;;OAIG;IACH,MAAM,CAAC,GAAG,GACR,YAAY,aAAa,KACxB,sBAAsB,GAAG,SAAS,CAC4B;CAClE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,GACnB,sBAAsB,CAExB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vived/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Core Components for VIVED Apps and Hosts",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
24
24
|
"lint": "tslint -p tsconfig.json",
|
|
25
25
|
"prepare": "npm run build",
|
|
26
|
-
"prepublishOnly": "npm run testOnce && npm run
|
|
26
|
+
"prepublishOnly": "npm run testOnce && npm run lint",
|
|
27
27
|
"preversion": "npm run lint",
|
|
28
28
|
"version": "npm run format && git add -A src",
|
|
29
29
|
"postversion": "git push && git push --tags"
|