@vived/host 3.3.0 → 3.5.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/lib/Components/Dispatcher/UCs/DispatchThemeUC.d.ts +52 -1
- package/lib/Components/Dispatcher/UCs/DispatchThemeUC.js +7 -2
- package/lib/Components/Handler/UCs/SubmitLogHandler.js +25 -2
- package/lib/Components/Logger/Adapters/fatalErrorAdapter.d.ts +3 -0
- package/lib/Components/Logger/Adapters/fatalErrorAdapter.js +23 -0
- package/lib/Components/Logger/Adapters/index.d.ts +1 -0
- package/lib/Components/Logger/Adapters/index.js +13 -0
- package/lib/Components/Logger/Controllers/clickDownloadLog.d.ts +2 -0
- package/lib/Components/Logger/Controllers/clickDownloadLog.js +14 -0
- package/lib/Components/Logger/Controllers/index.d.ts +1 -0
- package/lib/Components/Logger/Controllers/index.js +13 -0
- package/lib/Components/Logger/Entities/LoggerEntity.d.ts +20 -0
- package/lib/Components/Logger/Entities/LoggerEntity.js +70 -0
- package/lib/Components/Logger/Entities/index.d.ts +1 -0
- package/lib/Components/Logger/Entities/index.js +13 -0
- package/lib/Components/Logger/Mocks/MockDownloadLogUC.d.ts +9 -0
- package/lib/Components/Logger/Mocks/MockDownloadLogUC.js +16 -0
- package/lib/Components/Logger/Mocks/MockFatalErrorPM.d.ts +8 -0
- package/lib/Components/Logger/Mocks/MockFatalErrorPM.js +15 -0
- package/lib/Components/Logger/Mocks/index.d.ts +2 -0
- package/lib/Components/Logger/Mocks/index.js +14 -0
- package/lib/Components/Logger/PMs/FatalErrorPM.d.ts +17 -0
- package/lib/Components/Logger/PMs/FatalErrorPM.js +18 -0
- package/lib/Components/Logger/PMs/index.d.ts +1 -0
- package/lib/Components/Logger/PMs/index.js +13 -0
- package/lib/Components/Logger/UCs/DownloadLogUC.d.ts +8 -0
- package/lib/Components/Logger/UCs/DownloadLogUC.js +36 -0
- package/lib/Components/Logger/UCs/index.d.ts +1 -0
- package/lib/Components/Logger/UCs/index.js +13 -0
- package/lib/Components/Logger/index.d.ts +6 -0
- package/lib/Components/Logger/index.js +18 -0
- package/lib/Components/ThemeColors/Adapter/index.d.ts +1 -0
- package/lib/Components/ThemeColors/Adapter/index.js +13 -0
- package/lib/Components/ThemeColors/Adapter/themeColorAdapter.d.ts +3 -0
- package/lib/Components/ThemeColors/Adapter/themeColorAdapter.js +23 -0
- package/lib/Components/ThemeColors/Controllers/getOnPrimaryColor.d.ts +3 -0
- package/lib/Components/ThemeColors/Controllers/getOnPrimaryColor.js +16 -0
- package/lib/Components/ThemeColors/Controllers/getOnSurfaceColor.d.ts +3 -0
- package/lib/Components/ThemeColors/Controllers/getOnSurfaceColor.js +16 -0
- package/lib/Components/ThemeColors/Controllers/getPrimaryColor.d.ts +3 -0
- package/lib/Components/ThemeColors/Controllers/getPrimaryColor.js +16 -0
- package/lib/Components/ThemeColors/Controllers/getSurfaceColor.d.ts +3 -0
- package/lib/Components/ThemeColors/Controllers/getSurfaceColor.js +16 -0
- package/lib/Components/ThemeColors/Controllers/getSurfaceContainerColor.d.ts +3 -0
- package/lib/Components/ThemeColors/Controllers/getSurfaceContainerColor.js +16 -0
- package/lib/Components/ThemeColors/Controllers/index.d.ts +5 -0
- package/lib/Components/ThemeColors/Controllers/index.js +17 -0
- package/lib/Components/ThemeColors/Data/index.d.ts +2 -0
- package/lib/Components/ThemeColors/Data/index.js +10 -0
- package/lib/Components/ThemeColors/Data/vivedDarkTheme.json +51 -0
- package/lib/Components/ThemeColors/Data/vivedLightTheme.json +51 -0
- package/lib/Components/ThemeColors/Entities/HostThemeEntity.d.ts +127 -0
- package/lib/Components/ThemeColors/Entities/HostThemeEntity.js +166 -0
- package/lib/Components/ThemeColors/Entities/index.d.ts +1 -0
- package/lib/Components/ThemeColors/Entities/index.js +13 -0
- package/lib/Components/ThemeColors/Mocks/MockThemeColorPM.d.ts +8 -0
- package/lib/Components/ThemeColors/Mocks/MockThemeColorPM.js +15 -0
- package/lib/Components/ThemeColors/Mocks/index.d.ts +1 -0
- package/lib/Components/ThemeColors/Mocks/index.js +13 -0
- package/lib/Components/ThemeColors/PM/ThemeColorsPM.d.ts +12 -0
- package/lib/Components/ThemeColors/PM/ThemeColorsPM.js +46 -0
- package/lib/Components/ThemeColors/PM/index.d.ts +1 -0
- package/lib/Components/ThemeColors/PM/index.js +13 -0
- package/lib/Components/ThemeColors/UCs/SetThemeUC.d.ts +10 -0
- package/lib/Components/ThemeColors/UCs/SetThemeUC.js +43 -0
- package/lib/Components/ThemeColors/UCs/index.d.ts +1 -0
- package/lib/Components/ThemeColors/UCs/index.js +13 -0
- package/lib/Components/ThemeColors/index.d.ts +7 -0
- package/lib/Components/ThemeColors/index.js +19 -0
- package/lib/Components/index.d.ts +2 -0
- package/lib/Components/index.js +2 -0
- package/lib/Entities/MemoizedColor.d.ts +9 -0
- package/lib/Entities/MemoizedColor.js +23 -0
- package/lib/Entities/index.d.ts +9 -9
- package/lib/Entities/index.js +1 -1
- package/lib/Utilities/addAlphaToHex.d.ts +1 -0
- package/lib/Utilities/addAlphaToHex.js +16 -0
- package/lib/Utilities/alphaToHex.d.ts +2 -0
- package/lib/Utilities/alphaToHex.js +21 -0
- package/lib/Utilities/downloadFile.d.ts +1 -0
- package/lib/Utilities/downloadFile.js +14 -0
- package/lib/Utilities/index.d.ts +3 -0
- package/lib/Utilities/index.js +3 -0
- package/lib/ValueObjects/Color.d.ts +82 -0
- package/lib/ValueObjects/Color.js +858 -0
- package/lib/ValueObjects/index.d.ts +2 -1
- package/lib/ValueObjects/index.js +1 -0
- package/package.json +1 -1
|
@@ -2,8 +2,59 @@ import { HostAppObject, HostAppObjectRepo, HostAppObjectUC } from "../../../Host
|
|
|
2
2
|
export declare abstract class DispatchThemeUC extends HostAppObjectUC {
|
|
3
3
|
static readonly type = "DispatchThemeUC";
|
|
4
4
|
readonly requestType = "SET_THEME_COLORS";
|
|
5
|
-
abstract doDispatch(
|
|
5
|
+
abstract doDispatch(): void;
|
|
6
6
|
static get(appObject: HostAppObject): DispatchThemeUC | undefined;
|
|
7
7
|
static getByID(id: string, appObjects: HostAppObjectRepo): DispatchThemeUC | undefined;
|
|
8
8
|
}
|
|
9
9
|
export declare function makeDispatchThemeUC(appObject: HostAppObject): DispatchThemeUC;
|
|
10
|
+
export interface ColorSchemeV1 {
|
|
11
|
+
primary: string;
|
|
12
|
+
onPrimary: string;
|
|
13
|
+
primaryContainer: string;
|
|
14
|
+
onPrimaryContainer: string;
|
|
15
|
+
primaryFixed: string;
|
|
16
|
+
onPrimaryFixed: string;
|
|
17
|
+
primaryFixedDim: string;
|
|
18
|
+
onPrimaryFixedVariant: string;
|
|
19
|
+
secondary: string;
|
|
20
|
+
onSecondary: string;
|
|
21
|
+
secondaryContainer: string;
|
|
22
|
+
onSecondaryContainer: string;
|
|
23
|
+
secondaryFixed: string;
|
|
24
|
+
onSecondaryFixed: string;
|
|
25
|
+
secondaryFixedDim: string;
|
|
26
|
+
onSecondaryFixedVariant: string;
|
|
27
|
+
tertiary: string;
|
|
28
|
+
onTertiary: string;
|
|
29
|
+
tertiaryContainer: string;
|
|
30
|
+
onTertiaryContainer: string;
|
|
31
|
+
tertiaryFixed: string;
|
|
32
|
+
onTertiaryFixed: string;
|
|
33
|
+
tertiaryFixedDim: string;
|
|
34
|
+
onTertiaryFixedVariant: string;
|
|
35
|
+
error: string;
|
|
36
|
+
onError: string;
|
|
37
|
+
errorContainer: string;
|
|
38
|
+
onErrorContainer: string;
|
|
39
|
+
outline: string;
|
|
40
|
+
background: string;
|
|
41
|
+
onBackground: string;
|
|
42
|
+
surface: string;
|
|
43
|
+
onSurface: string;
|
|
44
|
+
surfaceVariant: string;
|
|
45
|
+
onSurfaceVariant: string;
|
|
46
|
+
inverseSurface: string;
|
|
47
|
+
inverseOnSurface: string;
|
|
48
|
+
inversePrimary: string;
|
|
49
|
+
shadow: string;
|
|
50
|
+
surfaceTint: string;
|
|
51
|
+
outlineVariant: string;
|
|
52
|
+
scrim: string;
|
|
53
|
+
surfaceContainerHighest: string;
|
|
54
|
+
surfaceContainerHigh: string;
|
|
55
|
+
surfaceContainer: string;
|
|
56
|
+
surfaceContainerLow: string;
|
|
57
|
+
surfaceContainerLowest: string;
|
|
58
|
+
surfaceBright: string;
|
|
59
|
+
surfaceDim: string;
|
|
60
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeDispatchThemeUC = exports.DispatchThemeUC = void 0;
|
|
4
4
|
const HostAppObject_1 = require("../../../HostAppObject");
|
|
5
|
+
const ThemeColors_1 = require("../../ThemeColors");
|
|
5
6
|
const Entities_1 = require("../Entities");
|
|
6
7
|
class DispatchThemeUC extends HostAppObject_1.HostAppObjectUC {
|
|
7
8
|
constructor() {
|
|
@@ -40,9 +41,13 @@ class DispatchThemeUCImp extends DispatchThemeUC {
|
|
|
40
41
|
this.dispose();
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
get theme() {
|
|
45
|
+
return this.getCachedSingleton(ThemeColors_1.HostThemeEntity.type);
|
|
46
|
+
}
|
|
47
|
+
doDispatch() {
|
|
48
|
+
if (!this.dispatcher || !this.theme)
|
|
45
49
|
return;
|
|
50
|
+
const colors = Object.assign({}, this.theme.activeScheme);
|
|
46
51
|
const payload = {
|
|
47
52
|
colors
|
|
48
53
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeSubmitLogHandler = exports.SubmitLogHandler = void 0;
|
|
4
4
|
const HostAppObject_1 = require("../../../HostAppObject");
|
|
5
|
+
const Apps_1 = require("../../Apps");
|
|
5
6
|
const Entities_1 = require("../Entities");
|
|
6
7
|
class SubmitLogHandler extends HostAppObject_1.HostAppObjectUC {
|
|
7
8
|
constructor() {
|
|
@@ -18,8 +19,27 @@ exports.makeSubmitLogHandler = makeSubmitLogHandler;
|
|
|
18
19
|
class SubmitLogHandlerImp extends SubmitLogHandler {
|
|
19
20
|
constructor(appObject) {
|
|
20
21
|
super(appObject, SubmitLogHandler.type);
|
|
21
|
-
this.action = () => {
|
|
22
|
-
|
|
22
|
+
this.action = (sender, severity, message) => {
|
|
23
|
+
if (!this.app) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const prependedSender = `[${this.app.name}] ${sender}`;
|
|
27
|
+
if (severity === "LOG") {
|
|
28
|
+
this.appObjects.submitLog(prependedSender, message);
|
|
29
|
+
}
|
|
30
|
+
else if (severity === "WARNING") {
|
|
31
|
+
this.appObjects.submitWarning(prependedSender, message);
|
|
32
|
+
}
|
|
33
|
+
else if (severity === "ERROR") {
|
|
34
|
+
this.appObjects.submitError(prependedSender, message);
|
|
35
|
+
}
|
|
36
|
+
else if (severity === "FATAL") {
|
|
37
|
+
this.appObjects.submitFatal(prependedSender, message);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.appObjects.submitLog(prependedSender, message);
|
|
41
|
+
this.appObjects.submitWarning("Host Handler - Submit Log", `Received an unsupported log severity type of ${severity}`);
|
|
42
|
+
}
|
|
23
43
|
};
|
|
24
44
|
this.handleRequest = (version, payload) => {
|
|
25
45
|
if (version === 1) {
|
|
@@ -37,6 +57,9 @@ class SubmitLogHandlerImp extends SubmitLogHandler {
|
|
|
37
57
|
}
|
|
38
58
|
hostHandler.registerRequestHandler(this);
|
|
39
59
|
}
|
|
60
|
+
get app() {
|
|
61
|
+
return this.getCachedLocalComponent(Apps_1.AppEntity.type);
|
|
62
|
+
}
|
|
40
63
|
castPayloadV1(payload) {
|
|
41
64
|
const castPayload = payload;
|
|
42
65
|
if (castPayload.sender === undefined ||
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fatalErrorAdapter = void 0;
|
|
4
|
+
const PMs_1 = require("../PMs");
|
|
5
|
+
exports.fatalErrorAdapter = {
|
|
6
|
+
defaultVM: PMs_1.defaultFatalErrorVM,
|
|
7
|
+
subscribe: (appObjects, setVM) => {
|
|
8
|
+
const pm = PMs_1.FatalErrorPM.get(appObjects);
|
|
9
|
+
if (!pm) {
|
|
10
|
+
appObjects.submitError("appListPMAdapter", "Unable to find AppsListPM");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
pm.addView(setVM);
|
|
14
|
+
},
|
|
15
|
+
unsubscribe: (appObjects, setVM) => {
|
|
16
|
+
const pm = PMs_1.FatalErrorPM.get(appObjects);
|
|
17
|
+
if (!pm) {
|
|
18
|
+
appObjects.submitError("appListPMAdapter", "Unable to find AppsListPM");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
pm.removeView(setVM);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./fatalErrorAdapter";
|
|
@@ -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("./fatalErrorAdapter"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clickDownloadLog = void 0;
|
|
4
|
+
const UCs_1 = require("../UCs");
|
|
5
|
+
function clickDownloadLog(appObjects) {
|
|
6
|
+
const uc = UCs_1.DownloadLogUC.get(appObjects);
|
|
7
|
+
if (uc) {
|
|
8
|
+
uc.doDownload();
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
appObjects.submitError("clickDownloadLog", "Unable to find DownloadLogUC");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.clickDownloadLog = clickDownloadLog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./clickDownloadLog";
|
|
@@ -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("./clickDownloadLog"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HostAppObject, HostAppObjectEntity, HostAppObjectRepo } from "../../../HostAppObject";
|
|
2
|
+
export declare type LogSeverity = "LOG" | "WARNING" | "ERROR" | "FATAL";
|
|
3
|
+
export declare type LogEntry = {
|
|
4
|
+
sender: string;
|
|
5
|
+
message: string;
|
|
6
|
+
severity: LogSeverity;
|
|
7
|
+
};
|
|
8
|
+
export declare abstract class LoggerEntity extends HostAppObjectEntity {
|
|
9
|
+
static type: string;
|
|
10
|
+
static get(appObjects: HostAppObjectRepo): LoggerEntity | undefined;
|
|
11
|
+
abstract logs: LogEntry[];
|
|
12
|
+
abstract forwardLogsToConsole: boolean;
|
|
13
|
+
abstract get lastLog(): LogEntry | undefined;
|
|
14
|
+
abstract submitLog: (sender: string, message: string) => void;
|
|
15
|
+
abstract submitWarning: (sender: string, message: string) => void;
|
|
16
|
+
abstract submitError: (sender: string, message: string) => void;
|
|
17
|
+
abstract submitFatal: (sender: string, message: string) => void;
|
|
18
|
+
abstract clear: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function makeLoggerEntity(appObject: HostAppObject): LoggerEntity;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeLoggerEntity = exports.LoggerEntity = void 0;
|
|
4
|
+
const HostAppObject_1 = require("../../../HostAppObject");
|
|
5
|
+
class LoggerEntity extends HostAppObject_1.HostAppObjectEntity {
|
|
6
|
+
static get(appObjects) {
|
|
7
|
+
return HostAppObject_1.getSingletonComponent(LoggerEntity.type, appObjects);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.LoggerEntity = LoggerEntity;
|
|
11
|
+
LoggerEntity.type = "LoggerEntity";
|
|
12
|
+
function makeLoggerEntity(appObject) {
|
|
13
|
+
return new LoggerEntityImp(appObject);
|
|
14
|
+
}
|
|
15
|
+
exports.makeLoggerEntity = makeLoggerEntity;
|
|
16
|
+
class LoggerEntityImp extends LoggerEntity {
|
|
17
|
+
constructor(appObject) {
|
|
18
|
+
super(appObject, LoggerEntity.type);
|
|
19
|
+
this.forwardLogsToConsole = false;
|
|
20
|
+
this.logs = [];
|
|
21
|
+
this.submitLog = (sender, message) => {
|
|
22
|
+
const log = this.setNewLog(sender, message, "LOG");
|
|
23
|
+
if (this.forwardLogsToConsole) {
|
|
24
|
+
console.log(this.formConsoleString(log));
|
|
25
|
+
}
|
|
26
|
+
this.notifyOnChange();
|
|
27
|
+
};
|
|
28
|
+
this.submitWarning = (sender, message) => {
|
|
29
|
+
const log = this.setNewLog(sender, message, "WARNING");
|
|
30
|
+
console.warn(this.formConsoleString(log));
|
|
31
|
+
this.notifyOnChange();
|
|
32
|
+
};
|
|
33
|
+
this.submitError = (sender, message) => {
|
|
34
|
+
const log = this.setNewLog(sender, message, "ERROR");
|
|
35
|
+
console.error(this.formConsoleString(log));
|
|
36
|
+
this.notifyOnChange();
|
|
37
|
+
};
|
|
38
|
+
this.submitFatal = (sender, message) => {
|
|
39
|
+
const log = this.setNewLog(sender, message, "FATAL");
|
|
40
|
+
console.error(this.formConsoleString(log));
|
|
41
|
+
this.notifyOnChange();
|
|
42
|
+
};
|
|
43
|
+
this.clear = () => {
|
|
44
|
+
this.logs = [];
|
|
45
|
+
this._lastLog = undefined;
|
|
46
|
+
};
|
|
47
|
+
this.appObjects.registerSingleton(this);
|
|
48
|
+
this.appObjects.submitLog = this.submitLog;
|
|
49
|
+
this.appObjects.submitWarning = this.submitWarning;
|
|
50
|
+
this.appObjects.submitError = this.submitError;
|
|
51
|
+
this.appObjects.submitFatal = this.submitFatal;
|
|
52
|
+
}
|
|
53
|
+
formConsoleString(log) {
|
|
54
|
+
const { sender, message } = log;
|
|
55
|
+
return `[${sender}] ${message}`;
|
|
56
|
+
}
|
|
57
|
+
setNewLog(sender, message, severity) {
|
|
58
|
+
const log = {
|
|
59
|
+
sender,
|
|
60
|
+
message,
|
|
61
|
+
severity
|
|
62
|
+
};
|
|
63
|
+
this.logs.push(log);
|
|
64
|
+
this._lastLog = log;
|
|
65
|
+
return log;
|
|
66
|
+
}
|
|
67
|
+
get lastLog() {
|
|
68
|
+
return this._lastLog;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LoggerEntity";
|
|
@@ -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("./LoggerEntity"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { HostAppObject, HostAppObjectRepo } from "../../../HostAppObject";
|
|
3
|
+
import { DownloadLogUC } from "../UCs";
|
|
4
|
+
export declare class MockDownloadLogUC extends DownloadLogUC {
|
|
5
|
+
downloadFile: jest.Mock<any, any>;
|
|
6
|
+
doDownload: jest.Mock<any, any>;
|
|
7
|
+
constructor(appObject: HostAppObject);
|
|
8
|
+
}
|
|
9
|
+
export declare function makeMockDownloadLogUC(appObjects: HostAppObjectRepo): MockDownloadLogUC;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMockDownloadLogUC = exports.MockDownloadLogUC = void 0;
|
|
4
|
+
const UCs_1 = require("../UCs");
|
|
5
|
+
class MockDownloadLogUC extends UCs_1.DownloadLogUC {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, UCs_1.DownloadLogUC.type);
|
|
8
|
+
this.downloadFile = jest.fn();
|
|
9
|
+
this.doDownload = jest.fn();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.MockDownloadLogUC = MockDownloadLogUC;
|
|
13
|
+
function makeMockDownloadLogUC(appObjects) {
|
|
14
|
+
return new MockDownloadLogUC(appObjects.getOrCreate("MockDownloadLogUC"));
|
|
15
|
+
}
|
|
16
|
+
exports.makeMockDownloadLogUC = makeMockDownloadLogUC;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { HostAppObject, HostAppObjectRepo } from "../../../HostAppObject";
|
|
3
|
+
import { FatalErrorPM } from "../PMs/FatalErrorPM";
|
|
4
|
+
export declare class MockFatalErrorPM extends FatalErrorPM {
|
|
5
|
+
vmsAreEqual: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: HostAppObject);
|
|
7
|
+
}
|
|
8
|
+
export declare function makeMockFatalErrorPM(appObjects: HostAppObjectRepo): MockFatalErrorPM;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMockFatalErrorPM = exports.MockFatalErrorPM = void 0;
|
|
4
|
+
const FatalErrorPM_1 = require("../PMs/FatalErrorPM");
|
|
5
|
+
class MockFatalErrorPM extends FatalErrorPM_1.FatalErrorPM {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, FatalErrorPM_1.FatalErrorPM.type);
|
|
8
|
+
this.vmsAreEqual = jest.fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.MockFatalErrorPM = MockFatalErrorPM;
|
|
12
|
+
function makeMockFatalErrorPM(appObjects) {
|
|
13
|
+
return new MockFatalErrorPM(appObjects.getOrCreate("MockFatalErrorPM"));
|
|
14
|
+
}
|
|
15
|
+
exports.makeMockFatalErrorPM = makeMockFatalErrorPM;
|
|
@@ -0,0 +1,14 @@
|
|
|
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("./MockDownloadLogUC"), exports);
|
|
14
|
+
__exportStar(require("./MockFatalErrorPM"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HostAppObjectPM, HostAppObjectRepo } from "../../../HostAppObject";
|
|
2
|
+
export interface FatalErrorVM {
|
|
3
|
+
show: boolean;
|
|
4
|
+
message: string;
|
|
5
|
+
sender: string;
|
|
6
|
+
playerVersion: string;
|
|
7
|
+
apps: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
version: string;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultFatalErrorVM: FatalErrorVM;
|
|
14
|
+
export declare abstract class FatalErrorPM extends HostAppObjectPM<FatalErrorVM> {
|
|
15
|
+
static type: string;
|
|
16
|
+
static get(appObjects: HostAppObjectRepo): FatalErrorPM | undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FatalErrorPM = exports.defaultFatalErrorVM = void 0;
|
|
4
|
+
const HostAppObject_1 = require("../../../HostAppObject");
|
|
5
|
+
exports.defaultFatalErrorVM = {
|
|
6
|
+
show: false,
|
|
7
|
+
apps: [],
|
|
8
|
+
message: "",
|
|
9
|
+
playerVersion: "",
|
|
10
|
+
sender: ""
|
|
11
|
+
};
|
|
12
|
+
class FatalErrorPM extends HostAppObject_1.HostAppObjectPM {
|
|
13
|
+
static get(appObjects) {
|
|
14
|
+
return HostAppObject_1.getSingletonComponent(FatalErrorPM.type, appObjects);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.FatalErrorPM = FatalErrorPM;
|
|
18
|
+
FatalErrorPM.type = "FatalErrorPM";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FatalErrorPM";
|
|
@@ -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("./FatalErrorPM"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HostAppObject, HostAppObjectRepo, HostAppObjectUC } from "../../../HostAppObject";
|
|
2
|
+
export declare abstract class DownloadLogUC extends HostAppObjectUC {
|
|
3
|
+
static type: string;
|
|
4
|
+
abstract downloadFile(filename: string, file: Blob): void;
|
|
5
|
+
abstract doDownload(): void;
|
|
6
|
+
static get(appObjects: HostAppObjectRepo): DownloadLogUC | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function makeDownloadLogUC(appObject: HostAppObject): DownloadLogUC;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeDownloadLogUC = exports.DownloadLogUC = void 0;
|
|
4
|
+
const HostAppObject_1 = require("../../../HostAppObject");
|
|
5
|
+
const downloadFile_1 = require("../../../Utilities/downloadFile");
|
|
6
|
+
const Entities_1 = require("../Entities");
|
|
7
|
+
class DownloadLogUC extends HostAppObject_1.HostAppObjectUC {
|
|
8
|
+
static get(appObjects) {
|
|
9
|
+
return HostAppObject_1.getSingletonComponent(DownloadLogUC.type, appObjects);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.DownloadLogUC = DownloadLogUC;
|
|
13
|
+
DownloadLogUC.type = "DownloadLogUC";
|
|
14
|
+
function makeDownloadLogUC(appObject) {
|
|
15
|
+
return new DownloadLogUCImp(appObject);
|
|
16
|
+
}
|
|
17
|
+
exports.makeDownloadLogUC = makeDownloadLogUC;
|
|
18
|
+
class DownloadLogUCImp extends DownloadLogUC {
|
|
19
|
+
constructor(appObject) {
|
|
20
|
+
super(appObject, DownloadLogUC.type);
|
|
21
|
+
this.downloadFile = downloadFile_1.downloadFile;
|
|
22
|
+
this.appObjects.registerSingleton(this);
|
|
23
|
+
}
|
|
24
|
+
get logger() {
|
|
25
|
+
return this.getCachedSingleton(Entities_1.LoggerEntity.type);
|
|
26
|
+
}
|
|
27
|
+
doDownload() {
|
|
28
|
+
if (!this.logger)
|
|
29
|
+
return;
|
|
30
|
+
const filename = "vivedPlayerLog.json";
|
|
31
|
+
const logsArray = this.logger.logs;
|
|
32
|
+
const logData = JSON.stringify(logsArray, null, 2);
|
|
33
|
+
const file = new Blob([logData], { type: "application/pdf" });
|
|
34
|
+
this.downloadFile(filename, file);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DownloadLogUC";
|
|
@@ -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("./DownloadLogUC"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Adapters"), exports);
|
|
14
|
+
__exportStar(require("./Controllers"), exports);
|
|
15
|
+
__exportStar(require("./Entities"), exports);
|
|
16
|
+
__exportStar(require("./Mocks"), exports);
|
|
17
|
+
__exportStar(require("./PMs"), exports);
|
|
18
|
+
__exportStar(require("./UCs"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./themeColorAdapter";
|
|
@@ -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("./themeColorAdapter"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.themeColorAdapter = void 0;
|
|
4
|
+
const PM_1 = require("../PM");
|
|
5
|
+
exports.themeColorAdapter = {
|
|
6
|
+
defaultVM: PM_1.defaultThemeColorsVM,
|
|
7
|
+
subscribe: (appObjects, setVM) => {
|
|
8
|
+
const pm = PM_1.ThemeColorsPM.get(appObjects);
|
|
9
|
+
if (!pm) {
|
|
10
|
+
appObjects.submitError("themeColorAdapter", "Unable to find ThemeColorsPM");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
pm.addView(setVM);
|
|
14
|
+
},
|
|
15
|
+
unsubscribe: (appObjects, setVM) => {
|
|
16
|
+
const pm = PM_1.ThemeColorsPM.get(appObjects);
|
|
17
|
+
if (!pm) {
|
|
18
|
+
appObjects.submitError("themeColorAdapter", "Unable to find ThemeColorsPM");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
pm.removeView(setVM);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOnPrimaryColor = void 0;
|
|
4
|
+
const ValueObjects_1 = require("../../../ValueObjects");
|
|
5
|
+
const Entities_1 = require("../Entities");
|
|
6
|
+
function getOnPrimaryColor(appObjects) {
|
|
7
|
+
const theme = Entities_1.HostThemeEntity.get(appObjects);
|
|
8
|
+
if (theme) {
|
|
9
|
+
return theme.getColorForType(Entities_1.ThemeColorType.onPrimary);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
appObjects.submitError("getOnPrimaryColor", "Unable to find ThemeColors");
|
|
13
|
+
return ValueObjects_1.Color.RGB(0, 0, 0);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.getOnPrimaryColor = getOnPrimaryColor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOnSurfaceColor = void 0;
|
|
4
|
+
const ValueObjects_1 = require("../../../ValueObjects");
|
|
5
|
+
const Entities_1 = require("../Entities");
|
|
6
|
+
function getOnSurfaceColor(appObjects) {
|
|
7
|
+
const theme = Entities_1.HostThemeEntity.get(appObjects);
|
|
8
|
+
if (theme) {
|
|
9
|
+
return theme.getColorForType(Entities_1.ThemeColorType.onSurface);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
appObjects.submitError("getOnSurfaceColor", "Unable to find ThemeColors");
|
|
13
|
+
return ValueObjects_1.Color.RGB(0, 0, 0);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.getOnSurfaceColor = getOnSurfaceColor;
|