@sprucelabs/heartwood-view-controllers 126.10.0 → 126.10.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/esm/tests/constants.d.ts +1 -0
- package/build/esm/tests/constants.js +1 -0
- package/build/esm/viewControllers/ViewControllerImporter.js +11 -3
- package/build/esm/viewControllers/navigation/Navigation.vc.d.ts +2 -1
- package/build/esm/viewControllers/navigation/Navigation.vc.js +4 -0
- package/build/tests/constants.d.ts +1 -0
- package/build/tests/constants.js +2 -1
- package/build/viewControllers/ViewControllerImporter.js +11 -3
- package/build/viewControllers/navigation/Navigation.vc.d.ts +2 -1
- package/build/viewControllers/navigation/Navigation.vc.js +4 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare const importExportSourceApp: string;
|
|
|
8
8
|
export declare const importExportSourceApp2: string;
|
|
9
9
|
export declare const importExportDestinationApp: string;
|
|
10
10
|
export declare const importExportDestinationNoIds: string;
|
|
11
|
+
export declare const importExportDestinationWithDefines: string;
|
|
11
12
|
export declare const importExportSourceSyntaxError: string;
|
|
12
13
|
export declare const importExportDestination: string;
|
|
13
14
|
export declare const buildCwdNodeModulesImport: string;
|
|
@@ -15,6 +15,7 @@ export const importExportSourceApp = diskUtil.resolvePath(__dirname, '..', '..',
|
|
|
15
15
|
export const importExportSourceApp2 = diskUtil.resolvePath(__dirname, '..', '..', 'src', '__tests__', 'testDirsAndFiles', 'skill_with_app_2', 'src', '.spruce', 'views', 'views.ts');
|
|
16
16
|
export const importExportDestinationApp = diskUtil.resolvePath(diskUtil.createRandomTempDir(), 'bundle.js');
|
|
17
17
|
export const importExportDestinationNoIds = diskUtil.resolvePath(diskUtil.createRandomTempDir(), 'bundle.js');
|
|
18
|
+
export const importExportDestinationWithDefines = diskUtil.resolvePath(diskUtil.createRandomTempDir(), 'bundle.js');
|
|
18
19
|
export const importExportSourceSyntaxError = diskUtil.resolvePath(__dirname, '..', '..', 'src', '__tests__', 'testDirsAndFiles', 'skill_syntax_error', 'src', '.spruce', 'views', 'views.ts');
|
|
19
20
|
export const importExportDestination = diskUtil.resolvePath(diskUtil.createRandomTempDir(), 'bundle.js');
|
|
20
21
|
export const buildCwdNodeModulesImport = diskUtil.resolvePath(__dirname, '..', '..', 'src', '__tests__', 'testDirsAndFiles', 'skill_import_from_node_module');
|
|
@@ -19,6 +19,7 @@ export default class ViewControllerImporter {
|
|
|
19
19
|
'setInterval',
|
|
20
20
|
'clearInterval',
|
|
21
21
|
'fetch',
|
|
22
|
+
'console',
|
|
22
23
|
].indexOf(name) === -1)
|
|
23
24
|
.filter((name) => this.shouldOverideGlobalNamed(name))
|
|
24
25
|
.map((name) => `var ${name} = {};`)
|
|
@@ -28,9 +29,17 @@ export default class ViewControllerImporter {
|
|
|
28
29
|
${resets}
|
|
29
30
|
var utils = {
|
|
30
31
|
setTimeout,
|
|
31
|
-
clearTimeout
|
|
32
|
+
clearTimeout,
|
|
33
|
+
}
|
|
34
|
+
var console = {
|
|
35
|
+
log() {},
|
|
36
|
+
info() {},
|
|
37
|
+
warn() {},
|
|
38
|
+
error() {}
|
|
39
|
+
}
|
|
40
|
+
var process = { env: {} }
|
|
41
|
+
var global = {
|
|
32
42
|
}
|
|
33
|
-
var global = {}
|
|
34
43
|
var globalThis = {}
|
|
35
44
|
function heartwood(...args) {
|
|
36
45
|
const { vcs, pluginsByName, App } = args[0].vcs ? args[0] : { vcs: args[0], pluginsByName: args[1] }
|
|
@@ -40,7 +49,6 @@ function heartwood(...args) {
|
|
|
40
49
|
plugins = pluginsByName || {}
|
|
41
50
|
}
|
|
42
51
|
|
|
43
|
-
|
|
44
52
|
${script}`;
|
|
45
53
|
eval(guargedScript);
|
|
46
54
|
this.validateImported(exports);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Navigation, ViewControllerOptions } from '../../types/heartwood.types';
|
|
1
|
+
import { Navigation, NavigationButton, ViewControllerOptions } from '../../types/heartwood.types';
|
|
2
2
|
import AbstractViewController from '../Abstract.vc';
|
|
3
3
|
export default class NavigationViewController extends AbstractViewController<Navigation> {
|
|
4
4
|
private model;
|
|
5
5
|
constructor(options: ViewControllerOptions);
|
|
6
6
|
hide(): void;
|
|
7
7
|
show(): void;
|
|
8
|
+
setButtons(buttons: NavigationButton[]): void;
|
|
8
9
|
setShouldRenderButtonLabels(shouldRender: boolean): void;
|
|
9
10
|
render(): Navigation;
|
|
10
11
|
}
|
|
@@ -13,6 +13,10 @@ export default class NavigationViewController extends AbstractViewController {
|
|
|
13
13
|
this.model.isVisible = true;
|
|
14
14
|
this.triggerRender();
|
|
15
15
|
}
|
|
16
|
+
setButtons(buttons) {
|
|
17
|
+
this.model.buttons = buttons;
|
|
18
|
+
this.triggerRender();
|
|
19
|
+
}
|
|
16
20
|
setShouldRenderButtonLabels(shouldRender) {
|
|
17
21
|
this.model.shouldRenderButtonLabels = shouldRender;
|
|
18
22
|
this.triggerRender();
|
|
@@ -8,6 +8,7 @@ export declare const importExportSourceApp: string;
|
|
|
8
8
|
export declare const importExportSourceApp2: string;
|
|
9
9
|
export declare const importExportDestinationApp: string;
|
|
10
10
|
export declare const importExportDestinationNoIds: string;
|
|
11
|
+
export declare const importExportDestinationWithDefines: string;
|
|
11
12
|
export declare const importExportSourceSyntaxError: string;
|
|
12
13
|
export declare const importExportDestination: string;
|
|
13
14
|
export declare const buildCwdNodeModulesImport: string;
|
package/build/tests/constants.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.importExportSourcePlugins2 = exports.importExportSourcePlugins1 = exports.importExportSourceWithDefines = exports.importExportSourceNodeModulesImport = exports.buildCwdNodeModulesImport = exports.importExportDestination = exports.importExportSourceSyntaxError = exports.importExportDestinationNoIds = exports.importExportDestinationApp = exports.importExportSourceApp2 = exports.importExportSourceApp = exports.importExportSourceNoIds = exports.importExportSource = exports.importExportCwd = exports.DEMO_NUMBER_ACTIVE_RECORD = exports.DEMO_NUMBER2 = exports.DEMO_NUMBER = void 0;
|
|
6
|
+
exports.importExportSourcePlugins2 = exports.importExportSourcePlugins1 = exports.importExportSourceWithDefines = exports.importExportSourceNodeModulesImport = exports.buildCwdNodeModulesImport = exports.importExportDestination = exports.importExportSourceSyntaxError = exports.importExportDestinationWithDefines = exports.importExportDestinationNoIds = exports.importExportDestinationApp = exports.importExportSourceApp2 = exports.importExportSourceApp = exports.importExportSourceNoIds = exports.importExportSource = exports.importExportCwd = exports.DEMO_NUMBER_ACTIVE_RECORD = exports.DEMO_NUMBER2 = exports.DEMO_NUMBER = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
|
|
9
9
|
const dotenv = require('dotenv');
|
|
@@ -20,6 +20,7 @@ exports.importExportSourceApp = spruce_skill_utils_1.diskUtil.resolvePath(__dirn
|
|
|
20
20
|
exports.importExportSourceApp2 = spruce_skill_utils_1.diskUtil.resolvePath(__dirname, '..', '..', 'src', '__tests__', 'testDirsAndFiles', 'skill_with_app_2', 'src', '.spruce', 'views', 'views.ts');
|
|
21
21
|
exports.importExportDestinationApp = spruce_skill_utils_1.diskUtil.resolvePath(spruce_skill_utils_1.diskUtil.createRandomTempDir(), 'bundle.js');
|
|
22
22
|
exports.importExportDestinationNoIds = spruce_skill_utils_1.diskUtil.resolvePath(spruce_skill_utils_1.diskUtil.createRandomTempDir(), 'bundle.js');
|
|
23
|
+
exports.importExportDestinationWithDefines = spruce_skill_utils_1.diskUtil.resolvePath(spruce_skill_utils_1.diskUtil.createRandomTempDir(), 'bundle.js');
|
|
23
24
|
exports.importExportSourceSyntaxError = spruce_skill_utils_1.diskUtil.resolvePath(__dirname, '..', '..', 'src', '__tests__', 'testDirsAndFiles', 'skill_syntax_error', 'src', '.spruce', 'views', 'views.ts');
|
|
24
25
|
exports.importExportDestination = spruce_skill_utils_1.diskUtil.resolvePath(spruce_skill_utils_1.diskUtil.createRandomTempDir(), 'bundle.js');
|
|
25
26
|
exports.buildCwdNodeModulesImport = spruce_skill_utils_1.diskUtil.resolvePath(__dirname, '..', '..', 'src', '__tests__', 'testDirsAndFiles', 'skill_import_from_node_module');
|
|
@@ -23,6 +23,7 @@ class ViewControllerImporter {
|
|
|
23
23
|
'setInterval',
|
|
24
24
|
'clearInterval',
|
|
25
25
|
'fetch',
|
|
26
|
+
'console',
|
|
26
27
|
].indexOf(name) === -1)
|
|
27
28
|
.filter((name) => this.shouldOverideGlobalNamed(name))
|
|
28
29
|
.map((name) => `var ${name} = {};`)
|
|
@@ -32,9 +33,17 @@ class ViewControllerImporter {
|
|
|
32
33
|
${resets}
|
|
33
34
|
var utils = {
|
|
34
35
|
setTimeout,
|
|
35
|
-
clearTimeout
|
|
36
|
+
clearTimeout,
|
|
37
|
+
}
|
|
38
|
+
var console = {
|
|
39
|
+
log() {},
|
|
40
|
+
info() {},
|
|
41
|
+
warn() {},
|
|
42
|
+
error() {}
|
|
43
|
+
}
|
|
44
|
+
var process = { env: {} }
|
|
45
|
+
var global = {
|
|
36
46
|
}
|
|
37
|
-
var global = {}
|
|
38
47
|
var globalThis = {}
|
|
39
48
|
function heartwood(...args) {
|
|
40
49
|
const { vcs, pluginsByName, App } = args[0].vcs ? args[0] : { vcs: args[0], pluginsByName: args[1] }
|
|
@@ -44,7 +53,6 @@ function heartwood(...args) {
|
|
|
44
53
|
plugins = pluginsByName || {}
|
|
45
54
|
}
|
|
46
55
|
|
|
47
|
-
|
|
48
56
|
${script}`;
|
|
49
57
|
eval(guargedScript);
|
|
50
58
|
this.validateImported(exports);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Navigation, ViewControllerOptions } from '../../types/heartwood.types';
|
|
1
|
+
import { Navigation, NavigationButton, ViewControllerOptions } from '../../types/heartwood.types';
|
|
2
2
|
import AbstractViewController from '../Abstract.vc';
|
|
3
3
|
export default class NavigationViewController extends AbstractViewController<Navigation> {
|
|
4
4
|
private model;
|
|
5
5
|
constructor(options: ViewControllerOptions);
|
|
6
6
|
hide(): void;
|
|
7
7
|
show(): void;
|
|
8
|
+
setButtons(buttons: NavigationButton[]): void;
|
|
8
9
|
setShouldRenderButtonLabels(shouldRender: boolean): void;
|
|
9
10
|
render(): Navigation;
|
|
10
11
|
}
|
|
@@ -18,6 +18,10 @@ class NavigationViewController extends Abstract_vc_1.default {
|
|
|
18
18
|
this.model.isVisible = true;
|
|
19
19
|
this.triggerRender();
|
|
20
20
|
}
|
|
21
|
+
setButtons(buttons) {
|
|
22
|
+
this.model.buttons = buttons;
|
|
23
|
+
this.triggerRender();
|
|
24
|
+
}
|
|
21
25
|
setShouldRenderButtonLabels(shouldRender) {
|
|
22
26
|
this.model.shouldRenderButtonLabels = shouldRender;
|
|
23
27
|
this.triggerRender();
|
package/package.json
CHANGED