@sprucelabs/spruce-heartwood-utils 16.4.0 → 16.4.2
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/build/__tests__/support/MockRemoteViewControllerFactory.d.ts +3 -2
- package/build/__tests__/support/MockRemoteViewControllerFactory.js +3 -2
- package/build/esm/__tests__/support/MockRemoteViewControllerFactory.d.ts +3 -2
- package/build/esm/__tests__/support/MockRemoteViewControllerFactory.js +3 -2
- package/build/esm/index-module.d.ts +1 -0
- package/build/esm/index-module.js +1 -0
- package/build/index-module.d.ts +1 -0
- package/build/index-module.js +3 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ViewControllerMap, ControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import { RemoteViewControllerFactory } from '../../skillViews/RemoteViewControllerFactory';
|
|
2
|
+
import { RemoteFactoryOptions, RemoteViewControllerFactory } from '../../skillViews/RemoteViewControllerFactory';
|
|
3
3
|
export default class MockRemoteViewControllerFactory implements RemoteViewControllerFactory {
|
|
4
4
|
private static instance?;
|
|
5
5
|
private loadedControllers;
|
|
6
6
|
private remoteControllerOptions?;
|
|
7
|
-
|
|
7
|
+
private views;
|
|
8
|
+
constructor(options: RemoteFactoryOptions);
|
|
8
9
|
Controller<N extends keyof ViewControllerMap, O extends ControllerOptions<N>>(_name: N, _options: O): ViewControllerMap[N];
|
|
9
10
|
static reset(): void;
|
|
10
11
|
static getInstance(): MockRemoteViewControllerFactory;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
4
4
|
class MockRemoteViewControllerFactory {
|
|
5
|
-
constructor() {
|
|
5
|
+
constructor(options) {
|
|
6
6
|
this.loadedControllers = {};
|
|
7
7
|
MockRemoteViewControllerFactory.instance = this;
|
|
8
|
+
this.views = options.vcFactory;
|
|
8
9
|
}
|
|
9
10
|
Controller(_name, _options) {
|
|
10
11
|
return {};
|
|
@@ -34,7 +35,7 @@ class MockRemoteViewControllerFactory {
|
|
|
34
35
|
async RemoteController(name, options) {
|
|
35
36
|
this.loadedControllers[name] = true;
|
|
36
37
|
this.remoteControllerOptions = options;
|
|
37
|
-
return
|
|
38
|
+
return this.views.Controller(name, options);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
exports.default = MockRemoteViewControllerFactory;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ViewControllerMap, ControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import { RemoteViewControllerFactory } from '../../skillViews/RemoteViewControllerFactory';
|
|
2
|
+
import { RemoteFactoryOptions, RemoteViewControllerFactory } from '../../skillViews/RemoteViewControllerFactory';
|
|
3
3
|
export default class MockRemoteViewControllerFactory implements RemoteViewControllerFactory {
|
|
4
4
|
private static instance?;
|
|
5
5
|
private loadedControllers;
|
|
6
6
|
private remoteControllerOptions?;
|
|
7
|
-
|
|
7
|
+
private views;
|
|
8
|
+
constructor(options: RemoteFactoryOptions);
|
|
8
9
|
Controller<N extends keyof ViewControllerMap, O extends ControllerOptions<N>>(_name: N, _options: O): ViewControllerMap[N];
|
|
9
10
|
static reset(): void;
|
|
10
11
|
static getInstance(): MockRemoteViewControllerFactory;
|
|
@@ -9,9 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { assert } from '@sprucelabs/test-utils';
|
|
11
11
|
export default class MockRemoteViewControllerFactory {
|
|
12
|
-
constructor() {
|
|
12
|
+
constructor(options) {
|
|
13
13
|
this.loadedControllers = {};
|
|
14
14
|
MockRemoteViewControllerFactory.instance = this;
|
|
15
|
+
this.views = options.vcFactory;
|
|
15
16
|
}
|
|
16
17
|
Controller(_name, _options) {
|
|
17
18
|
return {};
|
|
@@ -42,7 +43,7 @@ export default class MockRemoteViewControllerFactory {
|
|
|
42
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
44
|
this.loadedControllers[name] = true;
|
|
44
45
|
this.remoteControllerOptions = options;
|
|
45
|
-
return
|
|
46
|
+
return this.views.Controller(name, options);
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -2,5 +2,6 @@ export { default as RemoteViewControllerFactory } from './skillViews/RemoteViewC
|
|
|
2
2
|
export { default as CardRegistrar } from './skillViews/CardRegistrar';
|
|
3
3
|
export { default as remoteVcAssert } from './__tests__/support/remoteVcAssert';
|
|
4
4
|
export { default as fakeGetViews } from './__tests__/support/heartwoodEventFaker';
|
|
5
|
+
export { default as MockRemoteViewControllerFactory } from './__tests__/support/MockRemoteViewControllerFactory';
|
|
5
6
|
export * from './types/heartwood-module.types';
|
|
6
7
|
export { default as loadActiveThemeForOrg } from './theming/loadActiveThemeForOrg';
|
|
@@ -2,5 +2,6 @@ export { default as RemoteViewControllerFactory } from './skillViews/RemoteViewC
|
|
|
2
2
|
export { default as CardRegistrar } from './skillViews/CardRegistrar.js';
|
|
3
3
|
export { default as remoteVcAssert } from './__tests__/support/remoteVcAssert.js';
|
|
4
4
|
export { default as fakeGetViews } from './__tests__/support/heartwoodEventFaker.js';
|
|
5
|
+
export { default as MockRemoteViewControllerFactory } from './__tests__/support/MockRemoteViewControllerFactory.js';
|
|
5
6
|
export * from './types/heartwood-module.types.js';
|
|
6
7
|
export { default as loadActiveThemeForOrg } from './theming/loadActiveThemeForOrg.js';
|
package/build/index-module.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { default as RemoteViewControllerFactory } from './skillViews/RemoteViewC
|
|
|
2
2
|
export { default as CardRegistrar } from './skillViews/CardRegistrar';
|
|
3
3
|
export { default as remoteVcAssert } from './__tests__/support/remoteVcAssert';
|
|
4
4
|
export { default as fakeGetViews } from './__tests__/support/heartwoodEventFaker';
|
|
5
|
+
export { default as MockRemoteViewControllerFactory } from './__tests__/support/MockRemoteViewControllerFactory';
|
|
5
6
|
export * from './types/heartwood-module.types';
|
|
6
7
|
export { default as loadActiveThemeForOrg } from './theming/loadActiveThemeForOrg';
|
package/build/index-module.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.loadActiveThemeForOrg = exports.fakeGetViews = exports.remoteVcAssert = exports.CardRegistrar = exports.RemoteViewControllerFactory = void 0;
|
|
20
|
+
exports.loadActiveThemeForOrg = exports.MockRemoteViewControllerFactory = exports.fakeGetViews = exports.remoteVcAssert = exports.CardRegistrar = exports.RemoteViewControllerFactory = void 0;
|
|
21
21
|
var RemoteViewControllerFactory_1 = require("./skillViews/RemoteViewControllerFactory");
|
|
22
22
|
Object.defineProperty(exports, "RemoteViewControllerFactory", { enumerable: true, get: function () { return __importDefault(RemoteViewControllerFactory_1).default; } });
|
|
23
23
|
var CardRegistrar_1 = require("./skillViews/CardRegistrar");
|
|
@@ -26,6 +26,8 @@ var remoteVcAssert_1 = require("./__tests__/support/remoteVcAssert");
|
|
|
26
26
|
Object.defineProperty(exports, "remoteVcAssert", { enumerable: true, get: function () { return __importDefault(remoteVcAssert_1).default; } });
|
|
27
27
|
var heartwoodEventFaker_1 = require("./__tests__/support/heartwoodEventFaker");
|
|
28
28
|
Object.defineProperty(exports, "fakeGetViews", { enumerable: true, get: function () { return __importDefault(heartwoodEventFaker_1).default; } });
|
|
29
|
+
var MockRemoteViewControllerFactory_1 = require("./__tests__/support/MockRemoteViewControllerFactory");
|
|
30
|
+
Object.defineProperty(exports, "MockRemoteViewControllerFactory", { enumerable: true, get: function () { return __importDefault(MockRemoteViewControllerFactory_1).default; } });
|
|
29
31
|
__exportStar(require("./types/heartwood-module.types"), exports);
|
|
30
32
|
var loadActiveThemeForOrg_1 = require("./theming/loadActiveThemeForOrg");
|
|
31
33
|
Object.defineProperty(exports, "loadActiveThemeForOrg", { enumerable: true, get: function () { return __importDefault(loadActiveThemeForOrg_1).default; } });
|