@vived/app 2.47.0 → 2.47.1
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/lib/PresentationManagers/SceneModel/SceneModelPM.d.ts +15 -0
- package/lib/PresentationManagers/SceneModel/SceneModelPM.js +36 -0
- package/lib/PresentationManagers/SceneModel/index.d.ts +1 -0
- package/lib/PresentationManagers/SceneModel/index.js +13 -0
- package/lib/PresentationManagers/index.d.ts +1 -0
- package/lib/PresentationManagers/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SceneModelRepo } from "../../Entities";
|
|
2
|
+
import { PresentionManager } from "../PresentationManager";
|
|
3
|
+
export interface SceneModelVM {
|
|
4
|
+
activeSceneModelID: string;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class SceneModelPM extends PresentionManager {
|
|
8
|
+
private sceneModelRepo;
|
|
9
|
+
private updateView;
|
|
10
|
+
private previousVM?;
|
|
11
|
+
doUpdateView: () => void;
|
|
12
|
+
private vmHasChanged;
|
|
13
|
+
constructor(sceneModelRepo: SceneModelRepo, updateView: (vm: SceneModelVM) => void);
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultSceneModelVM: SceneModelVM;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultSceneModelVM = exports.SceneModelPM = void 0;
|
|
4
|
+
const PresentationManager_1 = require("../PresentationManager");
|
|
5
|
+
class SceneModelPM extends PresentationManager_1.PresentionManager {
|
|
6
|
+
constructor(sceneModelRepo, updateView) {
|
|
7
|
+
super(sceneModelRepo);
|
|
8
|
+
this.sceneModelRepo = sceneModelRepo;
|
|
9
|
+
this.updateView = updateView;
|
|
10
|
+
this.doUpdateView = () => {
|
|
11
|
+
const sceneModelID = this.sceneModelRepo.activeModelID;
|
|
12
|
+
const vm = {
|
|
13
|
+
activeSceneModelID: sceneModelID,
|
|
14
|
+
isLoading: this.sceneModelRepo.isLoadingSceneModel,
|
|
15
|
+
};
|
|
16
|
+
if (!this.vmHasChanged(vm))
|
|
17
|
+
return;
|
|
18
|
+
this.updateView(vm);
|
|
19
|
+
this.previousVM = vm;
|
|
20
|
+
};
|
|
21
|
+
this.doUpdateView();
|
|
22
|
+
}
|
|
23
|
+
vmHasChanged(vm) {
|
|
24
|
+
if (this.previousVM === undefined)
|
|
25
|
+
return true;
|
|
26
|
+
if (this.previousVM.activeSceneModelID !== vm.activeSceneModelID ||
|
|
27
|
+
this.previousVM.isLoading !== vm.isLoading)
|
|
28
|
+
return true;
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.SceneModelPM = SceneModelPM;
|
|
33
|
+
exports.defaultSceneModelVM = {
|
|
34
|
+
isLoading: false,
|
|
35
|
+
activeSceneModelID: "",
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SceneModelPM";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./SceneModelPM"), exports);
|
|
@@ -6,6 +6,7 @@ export * from "./ShowBabylonInspectorPM";
|
|
|
6
6
|
export * from "./HasRedoPM";
|
|
7
7
|
export * from "./HasUndoPM";
|
|
8
8
|
export * from "./QuestionChallenge";
|
|
9
|
+
export * from "./SceneModel";
|
|
9
10
|
export * from "./SceneObject";
|
|
10
11
|
export * from "./ToolPM";
|
|
11
12
|
export * from "./TransformNodePM";
|
|
@@ -18,6 +18,7 @@ __exportStar(require("./ShowBabylonInspectorPM"), exports);
|
|
|
18
18
|
__exportStar(require("./HasRedoPM"), exports);
|
|
19
19
|
__exportStar(require("./HasUndoPM"), exports);
|
|
20
20
|
__exportStar(require("./QuestionChallenge"), exports);
|
|
21
|
+
__exportStar(require("./SceneModel"), exports);
|
|
21
22
|
__exportStar(require("./SceneObject"), exports);
|
|
22
23
|
__exportStar(require("./ToolPM"), exports);
|
|
23
24
|
__exportStar(require("./TransformNodePM"), exports);
|