@sprucelabs/heartwood-view-controllers 111.1.51 → 111.1.52
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/.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigation.schema.js +8 -0
- package/build/.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema.d.ts +3 -0
- package/build/.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema.js +30 -0
- package/build/.spruce/schemas/schemas.types.d.ts +42 -0
- package/build/esm/.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigation.schema.js +8 -0
- package/build/esm/.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema.d.ts +3 -0
- package/build/esm/.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema.js +25 -0
- package/build/esm/.spruce/schemas/schemas.types.d.ts +42 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/schemas/v2021_02_11/navigation.builder.d.ts +54 -0
- package/build/esm/schemas/v2021_02_11/navigation.builder.js +27 -0
- package/build/esm/tests/utilities/navigationAssert.d.ts +2 -1
- package/build/esm/tests/utilities/navigationAssert.js +19 -1
- package/build/esm/types/heartwood.types.d.ts +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/schemas/v2021_02_11/navigation.builder.d.ts +54 -0
- package/build/schemas/v2021_02_11/navigation.builder.js +27 -0
- package/build/tests/utilities/navigationAssert.d.ts +2 -1
- package/build/tests/utilities/navigationAssert.js +17 -1
- package/build/types/heartwood.types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const schema_1 = require("@sprucelabs/schema");
|
|
7
7
|
const navigationButton_schema_1 = __importDefault(require("./navigationButton.schema"));
|
|
8
|
+
const navigationRoute_schema_1 = __importDefault(require("./navigationRoute.schema"));
|
|
8
9
|
const navigationSchema = {
|
|
9
10
|
id: 'navigation',
|
|
10
11
|
version: 'v2021_02_11',
|
|
@@ -39,6 +40,13 @@ const navigationSchema = {
|
|
|
39
40
|
isArray: true,
|
|
40
41
|
options: { schema: navigationButton_schema_1.default, }
|
|
41
42
|
},
|
|
43
|
+
/** . */
|
|
44
|
+
'additionalValidRoutes': {
|
|
45
|
+
type: 'schema',
|
|
46
|
+
isArray: true,
|
|
47
|
+
minArrayLength: 0,
|
|
48
|
+
options: { schema: navigationRoute_schema_1.default, }
|
|
49
|
+
},
|
|
42
50
|
}
|
|
43
51
|
};
|
|
44
52
|
schema_1.SchemaRegistry.getInstance().trackSchema(navigationSchema);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
7
|
+
const permissionContractReference_schema_1 = __importDefault(require("./permissionContractReference.schema"));
|
|
8
|
+
const routerDestination_schema_1 = __importDefault(require("./routerDestination.schema"));
|
|
9
|
+
const navigationRouteSchema = {
|
|
10
|
+
id: 'navigationRoute',
|
|
11
|
+
version: 'v2021_02_11',
|
|
12
|
+
namespace: 'HeartwoodViewControllers',
|
|
13
|
+
name: '',
|
|
14
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers',
|
|
15
|
+
fields: {
|
|
16
|
+
/** . */
|
|
17
|
+
'viewPermissionContract': {
|
|
18
|
+
type: 'schema',
|
|
19
|
+
options: { schema: permissionContractReference_schema_1.default, }
|
|
20
|
+
},
|
|
21
|
+
/** . */
|
|
22
|
+
'destination': {
|
|
23
|
+
type: 'schema',
|
|
24
|
+
isRequired: true,
|
|
25
|
+
options: { schema: routerDestination_schema_1.default, }
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
schema_1.SchemaRegistry.getInstance().trackSchema(navigationRouteSchema);
|
|
30
|
+
exports.default = navigationRouteSchema;
|
|
@@ -2930,6 +2930,38 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
2930
2930
|
interface PermissionContractReferenceEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.PermissionContractReferenceSchema> {
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
|
+
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
2934
|
+
interface NavigationRoute {
|
|
2935
|
+
'viewPermissionContract'?: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.PermissionContractReference | undefined | null;
|
|
2936
|
+
'destination': SpruceSchemas.HeartwoodViewControllers.v2021_02_11.RouterDestination;
|
|
2937
|
+
}
|
|
2938
|
+
interface NavigationRouteSchema extends SpruceSchema.Schema {
|
|
2939
|
+
id: 'navigationRoute';
|
|
2940
|
+
version: 'v2021_02_11';
|
|
2941
|
+
namespace: 'HeartwoodViewControllers';
|
|
2942
|
+
name: '';
|
|
2943
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers';
|
|
2944
|
+
fields: {
|
|
2945
|
+
/** . */
|
|
2946
|
+
'viewPermissionContract': {
|
|
2947
|
+
type: 'schema';
|
|
2948
|
+
options: {
|
|
2949
|
+
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.PermissionContractReferenceSchema;
|
|
2950
|
+
};
|
|
2951
|
+
};
|
|
2952
|
+
/** . */
|
|
2953
|
+
'destination': {
|
|
2954
|
+
type: 'schema';
|
|
2955
|
+
isRequired: true;
|
|
2956
|
+
options: {
|
|
2957
|
+
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.RouterDestinationSchema;
|
|
2958
|
+
};
|
|
2959
|
+
};
|
|
2960
|
+
};
|
|
2961
|
+
}
|
|
2962
|
+
interface NavigationRouteEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRouteSchema> {
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2933
2965
|
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
2934
2966
|
interface NavigationButton {
|
|
2935
2967
|
/** Line icon. */
|
|
@@ -3438,6 +3470,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
3438
3470
|
/** Controller. */
|
|
3439
3471
|
'controller'?: (HeartwoodTypes.ViewController<HeartwoodTypes.Navigation>) | undefined | null;
|
|
3440
3472
|
'buttons'?: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationButton[] | undefined | null;
|
|
3473
|
+
'additionalValidRoutes'?: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRoute[] | undefined | null;
|
|
3441
3474
|
}
|
|
3442
3475
|
interface NavigationSchema extends SpruceSchema.Schema {
|
|
3443
3476
|
id: 'navigation';
|
|
@@ -3477,6 +3510,15 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
3477
3510
|
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationButtonSchema;
|
|
3478
3511
|
};
|
|
3479
3512
|
};
|
|
3513
|
+
/** . */
|
|
3514
|
+
'additionalValidRoutes': {
|
|
3515
|
+
type: 'schema';
|
|
3516
|
+
isArray: true;
|
|
3517
|
+
minArrayLength: 0;
|
|
3518
|
+
options: {
|
|
3519
|
+
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRouteSchema;
|
|
3520
|
+
};
|
|
3521
|
+
};
|
|
3480
3522
|
};
|
|
3481
3523
|
}
|
|
3482
3524
|
interface NavigationEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationSchema> {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SchemaRegistry } from '@sprucelabs/schema';
|
|
2
2
|
import navigationButtonSchema_v2021_02_11 from './navigationButton.schema.js';
|
|
3
|
+
import navigationRouteSchema_v2021_02_11 from './navigationRoute.schema.js';
|
|
3
4
|
const navigationSchema = {
|
|
4
5
|
id: 'navigation',
|
|
5
6
|
version: 'v2021_02_11',
|
|
@@ -34,6 +35,13 @@ const navigationSchema = {
|
|
|
34
35
|
isArray: true,
|
|
35
36
|
options: { schema: navigationButtonSchema_v2021_02_11, }
|
|
36
37
|
},
|
|
38
|
+
/** . */
|
|
39
|
+
'additionalValidRoutes': {
|
|
40
|
+
type: 'schema',
|
|
41
|
+
isArray: true,
|
|
42
|
+
minArrayLength: 0,
|
|
43
|
+
options: { schema: navigationRouteSchema_v2021_02_11, }
|
|
44
|
+
},
|
|
37
45
|
}
|
|
38
46
|
};
|
|
39
47
|
SchemaRegistry.getInstance().trackSchema(navigationSchema);
|
package/build/esm/.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SchemaRegistry } from '@sprucelabs/schema';
|
|
2
|
+
import permissionContractReferenceSchema_v2021_02_11 from './permissionContractReference.schema.js';
|
|
3
|
+
import routerDestinationSchema_v2021_02_11 from './routerDestination.schema.js';
|
|
4
|
+
const navigationRouteSchema = {
|
|
5
|
+
id: 'navigationRoute',
|
|
6
|
+
version: 'v2021_02_11',
|
|
7
|
+
namespace: 'HeartwoodViewControllers',
|
|
8
|
+
name: '',
|
|
9
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers',
|
|
10
|
+
fields: {
|
|
11
|
+
/** . */
|
|
12
|
+
'viewPermissionContract': {
|
|
13
|
+
type: 'schema',
|
|
14
|
+
options: { schema: permissionContractReferenceSchema_v2021_02_11, }
|
|
15
|
+
},
|
|
16
|
+
/** . */
|
|
17
|
+
'destination': {
|
|
18
|
+
type: 'schema',
|
|
19
|
+
isRequired: true,
|
|
20
|
+
options: { schema: routerDestinationSchema_v2021_02_11, }
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
SchemaRegistry.getInstance().trackSchema(navigationRouteSchema);
|
|
25
|
+
export default navigationRouteSchema;
|
|
@@ -2930,6 +2930,38 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
2930
2930
|
interface PermissionContractReferenceEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.PermissionContractReferenceSchema> {
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
|
+
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
2934
|
+
interface NavigationRoute {
|
|
2935
|
+
'viewPermissionContract'?: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.PermissionContractReference | undefined | null;
|
|
2936
|
+
'destination': SpruceSchemas.HeartwoodViewControllers.v2021_02_11.RouterDestination;
|
|
2937
|
+
}
|
|
2938
|
+
interface NavigationRouteSchema extends SpruceSchema.Schema {
|
|
2939
|
+
id: 'navigationRoute';
|
|
2940
|
+
version: 'v2021_02_11';
|
|
2941
|
+
namespace: 'HeartwoodViewControllers';
|
|
2942
|
+
name: '';
|
|
2943
|
+
moduleToImportFromWhenRemote: '@sprucelabs/heartwood-view-controllers';
|
|
2944
|
+
fields: {
|
|
2945
|
+
/** . */
|
|
2946
|
+
'viewPermissionContract': {
|
|
2947
|
+
type: 'schema';
|
|
2948
|
+
options: {
|
|
2949
|
+
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.PermissionContractReferenceSchema;
|
|
2950
|
+
};
|
|
2951
|
+
};
|
|
2952
|
+
/** . */
|
|
2953
|
+
'destination': {
|
|
2954
|
+
type: 'schema';
|
|
2955
|
+
isRequired: true;
|
|
2956
|
+
options: {
|
|
2957
|
+
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.RouterDestinationSchema;
|
|
2958
|
+
};
|
|
2959
|
+
};
|
|
2960
|
+
};
|
|
2961
|
+
}
|
|
2962
|
+
interface NavigationRouteEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRouteSchema> {
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2933
2965
|
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
2934
2966
|
interface NavigationButton {
|
|
2935
2967
|
/** Line icon. */
|
|
@@ -3438,6 +3470,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
3438
3470
|
/** Controller. */
|
|
3439
3471
|
'controller'?: (HeartwoodTypes.ViewController<HeartwoodTypes.Navigation>) | undefined | null;
|
|
3440
3472
|
'buttons'?: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationButton[] | undefined | null;
|
|
3473
|
+
'additionalValidRoutes'?: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRoute[] | undefined | null;
|
|
3441
3474
|
}
|
|
3442
3475
|
interface NavigationSchema extends SpruceSchema.Schema {
|
|
3443
3476
|
id: 'navigation';
|
|
@@ -3477,6 +3510,15 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
3477
3510
|
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationButtonSchema;
|
|
3478
3511
|
};
|
|
3479
3512
|
};
|
|
3513
|
+
/** . */
|
|
3514
|
+
'additionalValidRoutes': {
|
|
3515
|
+
type: 'schema';
|
|
3516
|
+
isArray: true;
|
|
3517
|
+
minArrayLength: 0;
|
|
3518
|
+
options: {
|
|
3519
|
+
schema: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRouteSchema;
|
|
3520
|
+
};
|
|
3521
|
+
};
|
|
3480
3522
|
};
|
|
3481
3523
|
}
|
|
3482
3524
|
interface NavigationEntity extends SchemaEntity<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationSchema> {
|
package/build/esm/index.d.ts
CHANGED
|
@@ -195,4 +195,5 @@ export { default as barChartDataSetSchema } from './.spruce/schemas/heartwoodVie
|
|
|
195
195
|
export { default as navigationButtonDropdownSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationButtonDropdown.schema';
|
|
196
196
|
export { default as navigationDropdownButtonSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationDropdownButton.schema';
|
|
197
197
|
export { default as routerDestinationSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/routerDestination.schema';
|
|
198
|
+
export { default as navigationRouteSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema';
|
|
198
199
|
export * from './toolBelts/ToolBeltStateMachine';
|
package/build/esm/index.js
CHANGED
|
@@ -194,4 +194,5 @@ export { default as barChartDataSetSchema } from './.spruce/schemas/heartwoodVie
|
|
|
194
194
|
export { default as navigationButtonDropdownSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationButtonDropdown.schema.js';
|
|
195
195
|
export { default as navigationDropdownButtonSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationDropdownButton.schema.js';
|
|
196
196
|
export { default as routerDestinationSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/routerDestination.schema.js';
|
|
197
|
+
export { default as navigationRouteSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema.js';
|
|
197
198
|
export * from './toolBelts/ToolBeltStateMachine.js';
|
|
@@ -563,6 +563,60 @@ declare const _default: {
|
|
|
563
563
|
};
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
|
+
additionalValidRoutes: {
|
|
567
|
+
type: "schema";
|
|
568
|
+
isArray: true;
|
|
569
|
+
minArrayLength: number;
|
|
570
|
+
options: {
|
|
571
|
+
schema: {
|
|
572
|
+
id: string;
|
|
573
|
+
fields: {
|
|
574
|
+
viewPermissionContract: {
|
|
575
|
+
type: "schema";
|
|
576
|
+
options: {
|
|
577
|
+
schema: {
|
|
578
|
+
id: string;
|
|
579
|
+
name: string;
|
|
580
|
+
fields: {
|
|
581
|
+
id: {
|
|
582
|
+
type: "raw";
|
|
583
|
+
options: {
|
|
584
|
+
valueType: string;
|
|
585
|
+
};
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
destination: {
|
|
592
|
+
type: "schema";
|
|
593
|
+
isRequired: true;
|
|
594
|
+
options: {
|
|
595
|
+
schema: {
|
|
596
|
+
id: string;
|
|
597
|
+
name: string;
|
|
598
|
+
fields: {
|
|
599
|
+
id: {
|
|
600
|
+
type: "raw";
|
|
601
|
+
isRequired: true;
|
|
602
|
+
options: {
|
|
603
|
+
valueType: string;
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
args: {
|
|
607
|
+
type: "raw";
|
|
608
|
+
options: {
|
|
609
|
+
valueType: string;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
};
|
|
566
620
|
};
|
|
567
621
|
};
|
|
568
622
|
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { buildSchema } from '@sprucelabs/schema';
|
|
2
2
|
import navigationButtonBuilder from './navigationButton.builder.js';
|
|
3
|
+
import permissionContractReferenceBuilder from './permissionContractReference.builder.js';
|
|
4
|
+
import routerDestinationBuilder from './routerDestination.builder.js';
|
|
3
5
|
export default buildSchema({
|
|
4
6
|
id: 'navigation',
|
|
5
7
|
name: 'Navigation',
|
|
@@ -34,5 +36,30 @@ export default buildSchema({
|
|
|
34
36
|
schema: navigationButtonBuilder,
|
|
35
37
|
},
|
|
36
38
|
},
|
|
39
|
+
additionalValidRoutes: {
|
|
40
|
+
type: 'schema',
|
|
41
|
+
isArray: true,
|
|
42
|
+
minArrayLength: 0,
|
|
43
|
+
options: {
|
|
44
|
+
schema: buildSchema({
|
|
45
|
+
id: 'navigationRoute',
|
|
46
|
+
fields: {
|
|
47
|
+
viewPermissionContract: {
|
|
48
|
+
type: 'schema',
|
|
49
|
+
options: {
|
|
50
|
+
schema: permissionContractReferenceBuilder,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
destination: {
|
|
54
|
+
type: 'schema',
|
|
55
|
+
isRequired: true,
|
|
56
|
+
options: {
|
|
57
|
+
schema: routerDestinationBuilder,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
},
|
|
63
|
+
},
|
|
37
64
|
},
|
|
38
65
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PermissionContractId } from '@sprucelabs/mercury-types';
|
|
2
|
-
import { AppController, Navigation, SkillViewController, SkillViewControllerId, ViewController } from '../../types/heartwood.types';
|
|
2
|
+
import { AppController, Navigation, NavigationRoute, SkillViewController, SkillViewControllerId, ViewController } from '../../types/heartwood.types';
|
|
3
3
|
declare const navigationAssert: {
|
|
4
4
|
rendersButton(vc: ViewController<Navigation>, id: string): void;
|
|
5
5
|
buttonRedirectsTo(options: {
|
|
@@ -17,5 +17,6 @@ declare const navigationAssert: {
|
|
|
17
17
|
appDoesNotRenderNavigation(vc: Pick<AppController, "renderNavigation">): void;
|
|
18
18
|
skillViewDoesNotRenderNavigation(vc: Pick<SkillViewController, "renderNavigation">): void;
|
|
19
19
|
buttonRequiresViewPermissions(vc: ViewController<Navigation>, button: string, permissionContractId: PermissionContractId): void;
|
|
20
|
+
hasAdditionalValidRoutes(vc: ViewController<Navigation>, routes: NavigationRoute[]): void;
|
|
20
21
|
};
|
|
21
22
|
export default navigationAssert;
|
|
@@ -16,6 +16,7 @@ const navigationAssert = {
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
rendersButtons(vc, ids) {
|
|
19
|
+
assertOptions({ vc, buttons: ids }, ['vc', 'buttons']);
|
|
19
20
|
ids.forEach((id) => this.rendersButton(vc, id));
|
|
20
21
|
},
|
|
21
22
|
rendersButtonLabels(vc) {
|
|
@@ -51,11 +52,28 @@ const navigationAssert = {
|
|
|
51
52
|
const match = getButtonFromNav(vc, button);
|
|
52
53
|
assert.isEqual((_a = match.viewPermissionContract) === null || _a === void 0 ? void 0 : _a.id, permissionContractId, 'Your button did not have the view permission contract set to what I expected!');
|
|
53
54
|
},
|
|
55
|
+
hasAdditionalValidRoutes(vc, routes) {
|
|
56
|
+
assertOptions({ vc, routes }, ['vc', 'routes']);
|
|
57
|
+
const model = renderUtil.render(vc);
|
|
58
|
+
assert.isEqualDeep(model.additionalValidRoutes, routes, `I did not find the valid routes I expected. Make sure you set 'additionalValidRoutes' in your navigation's view model (constructor options).`);
|
|
59
|
+
},
|
|
54
60
|
};
|
|
55
61
|
export default navigationAssert;
|
|
56
62
|
function getButtonFromNav(vc, id) {
|
|
63
|
+
var _a, _b, _c, _d;
|
|
57
64
|
const model = renderUtil.render(vc);
|
|
58
|
-
|
|
65
|
+
if ((_a = model.buttons) === null || _a === void 0 ? void 0 : _a[0].dropdown) {
|
|
66
|
+
const button = (_c = (_b = model.buttons[0].dropdown) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c.find((b) => b.id === id);
|
|
67
|
+
assert.isTruthy(button);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const buttons = (_d = model.buttons) === null || _d === void 0 ? void 0 : _d.reduce((acc, b) => {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
if (b.dropdown) {
|
|
73
|
+
return [...acc, ...((_b = (_a = b === null || b === void 0 ? void 0 : b.dropdown) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : [])];
|
|
74
|
+
}
|
|
75
|
+
return [...acc, b];
|
|
76
|
+
}, []);
|
|
59
77
|
const button = buttons === null || buttons === void 0 ? void 0 : buttons.find((b) => b.id === id);
|
|
60
78
|
assert.isTruthy(button, `I could not find a button with the id "${id}" in your navigation!`);
|
|
61
79
|
return button;
|
|
@@ -169,6 +169,7 @@ export type BarChart = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.BarCha
|
|
|
169
169
|
export type BarChartDataSet = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.BarChartDataSet;
|
|
170
170
|
export type BarChartDataPoint = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.BarChartDataPoint;
|
|
171
171
|
export type Form<S extends Schema = any> = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Form<S>;
|
|
172
|
+
export type NavigationRoute = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRoute;
|
|
172
173
|
export type LayoutStyle = NonNullable<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.SkillView['layout']>;
|
|
173
174
|
export type ListColumnWidth = NonNullable<List['columnWidths']>[number];
|
|
174
175
|
export type TriggerRender = () => void;
|
package/build/index.d.ts
CHANGED
|
@@ -195,4 +195,5 @@ export { default as barChartDataSetSchema } from './.spruce/schemas/heartwoodVie
|
|
|
195
195
|
export { default as navigationButtonDropdownSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationButtonDropdown.schema';
|
|
196
196
|
export { default as navigationDropdownButtonSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationDropdownButton.schema';
|
|
197
197
|
export { default as routerDestinationSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/routerDestination.schema';
|
|
198
|
+
export { default as navigationRouteSchema } from './.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema';
|
|
198
199
|
export * from './toolBelts/ToolBeltStateMachine';
|
package/build/index.js
CHANGED
|
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
exports.dialogSchema = exports.buttonSchema = exports.lineIconSchema = exports.fancyIconSchema = exports.selectInputSchema = exports.skillViewSchema = exports.bigFormSchema = exports.calendarEventColorsSchema = exports.buildSkillView = exports.buildForm = exports.buildBigForm = exports.AuthenticatorImpl = exports.PolarAreaViewController = exports.MockActiveRecordCard = exports.activeRecordCardAssert = exports.buildActiveRecordList = exports.buildActiveRecordCard = exports.AbstractInputViewController = exports.AutocompleteInputViewController = exports.AbstractCalendarEventViewController = exports.RatingsViewController = exports.ProgressViewController = exports.StatsViewController = exports.FeedViewController = exports.ActiveRecordListViewController = exports.ActiveRecordCardViewController = exports.TalkingSprucebotViewController = exports.ButtonBarViewController = exports.CalendarViewController = exports.SwipeCardViewControllerImpl = exports.SwipeViewControllerImpl = exports.PagerViewController = exports.ProgressNavigatorViewController = exports.CountdownTimerViewController = exports.FormBuilderCardViewControllerImpl = exports.LoginViewController = exports.BarChartViewController = exports.ToolBeltViewController = exports.FormViewControllerImpl = exports.ListCellViewController = exports.ListRowViewController = exports.ListViewController = exports.NavigationViewController = exports.DialogViewController = exports.ConfirmViewController = exports.CardViewControllerImpl = exports.ButtonGroupViewController = exports.AbstractAppController = exports.AbstractViewController = exports.AbstractSkillViewController = void 0;
|
|
21
21
|
exports.ratingsInputSchema = exports.listRatingsInputSchema = exports.ratingsSchema = exports.progressSchema = exports.statsStatSchema = exports.statsSchema = exports.toggleInputSchema = exports.listToggleInputSchema = exports.addressInputSchema = exports.buttonBarButtonSchema = exports.buttonBarSchema = exports.toolBeltToolSchema = exports.toolBeltSchema = exports.calendarTimeSchema = exports.calendarPersonSchema = exports.calendarSchema = exports.themePropsSchema = exports.themeSchema = exports.cardFooterButtonSchema = exports.criticalErrorSchema = exports.sprucebotTypedMessageSentenceSchema = exports.sprucebotTypedMessageAvatarSchema = exports.selectInputChoiceSchema = exports.calendarEventColorOverrideSchema = exports.portalSchema = exports.listTextInputSchema = exports.listSelectInputSchema = exports.listCellButtonSchema = exports.dropdownButtonSchema = exports.bigFormSectionSchema = exports.textInputSchema = exports.phoneInputSchema = exports.inputSchema = exports.dropdownSchema = exports.sprucebotTypedMessageSchema = exports.talkingSprucebotSchema = exports.sprucebotAvatarSchema = exports.formBuilderImportExportObjectSchema = exports.listCellSchema = exports.listRowSchema = exports.listSchema = exports.layoutSchema = exports.cardSectionSchema = exports.cardHeaderSchema = exports.cardFooterSchema = exports.cardBodySchema = exports.cardSchema = exports.formSectionSchema = exports.formSchema = exports.textSchema = void 0;
|
|
22
22
|
exports.barChartAssert = exports.progressNavigatorAssert = exports.countdownTimerInteractor = exports.countdownTimerAssert = exports.calendarInteractor = exports.interactor = exports.normalizeScopeFromVc = exports.autocompleteInteractor = exports.formAssert = exports.autocompleteAssert = exports.listAssert = exports.buttonAssert = exports.deviceAssert = exports.navigationAssert = exports.toolBeltAssert = exports.toastAssert = exports.vcPluginAssert = exports.vcDurationAssert = exports.pagerAssert = exports.vcAssert = exports.vcAssertUtil = exports.feedAssert = exports.feedInteractor = exports.normalizeFormSectionFieldNamesUtil = exports.ViewControllerError = exports.SpyDevice = exports.StubStorage = exports.ViewControllerFactory = exports.ViewControllerImporter = exports.ViewControllerExporter = exports.pagerSchema = exports.polarAreaDataItemSchema = exports.polarAreaSchema = exports.inputButtonSchema = exports.mapPinSchema = exports.mapSchema = exports.latLngSchema = exports.formBuilderImportExportPageSchema = exports.autocompleteSuggestionSchema = exports.autocompleteInputSchema = exports.feedSchema = exports.calendarShiftSchema = exports.receiptTotalSchema = exports.receiptSectionSchema = exports.receiptLineItemSchema = exports.receiptHeaderSchema = exports.receiptSchema = exports.listDateInputSchema = exports.calendarSelectedDateSchema = exports.calendarEventSchema = void 0;
|
|
23
|
-
exports.routerDestinationSchema = exports.navigationDropdownButtonSchema = exports.navigationButtonDropdownSchema = exports.barChartDataSetSchema = exports.barChartDataPointSchema = exports.barChartSchema = exports.progressDetailsSchema = exports.progressNavigatorStepSchema = exports.progressNavigatorSchema = exports.countdownTimerSchema = exports.permissionContractReferenceSchema = exports.navigationButtonSchema = exports.navigationSchema = exports.ToolBeltStateMachine = exports.removeUniversalViewOptions = exports.buildSkillViewLayout = exports.splitCardsIntoLayouts = exports.listUtil = exports.mapInteractor = exports.mapAssert = exports.renderUtil = exports.routerTestPatcher = exports.dialogTestPatcher = exports.confirmTestPatcher = exports.calendarSeeder = exports.interactionUtil = void 0;
|
|
23
|
+
exports.navigationRouteSchema = exports.routerDestinationSchema = exports.navigationDropdownButtonSchema = exports.navigationButtonDropdownSchema = exports.barChartDataSetSchema = exports.barChartDataPointSchema = exports.barChartSchema = exports.progressDetailsSchema = exports.progressNavigatorStepSchema = exports.progressNavigatorSchema = exports.countdownTimerSchema = exports.permissionContractReferenceSchema = exports.navigationButtonSchema = exports.navigationSchema = exports.ToolBeltStateMachine = exports.removeUniversalViewOptions = exports.buildSkillViewLayout = exports.splitCardsIntoLayouts = exports.listUtil = exports.mapInteractor = exports.mapAssert = exports.renderUtil = exports.routerTestPatcher = exports.dialogTestPatcher = exports.confirmTestPatcher = exports.calendarSeeder = exports.interactionUtil = void 0;
|
|
24
24
|
__exportStar(require("./constants"), exports);
|
|
25
25
|
__exportStar(require("./types/heartwood.types"), exports);
|
|
26
26
|
__exportStar(require("./utilities/removeUniversalViewOptions"), exports);
|
|
@@ -393,4 +393,6 @@ var navigationDropdownButton_schema_1 = require("./.spruce/schemas/heartwoodView
|
|
|
393
393
|
Object.defineProperty(exports, "navigationDropdownButtonSchema", { enumerable: true, get: function () { return __importDefault(navigationDropdownButton_schema_1).default; } });
|
|
394
394
|
var routerDestination_schema_1 = require("./.spruce/schemas/heartwoodViewControllers/v2021_02_11/routerDestination.schema");
|
|
395
395
|
Object.defineProperty(exports, "routerDestinationSchema", { enumerable: true, get: function () { return __importDefault(routerDestination_schema_1).default; } });
|
|
396
|
+
var navigationRoute_schema_1 = require("./.spruce/schemas/heartwoodViewControllers/v2021_02_11/navigationRoute.schema");
|
|
397
|
+
Object.defineProperty(exports, "navigationRouteSchema", { enumerable: true, get: function () { return __importDefault(navigationRoute_schema_1).default; } });
|
|
396
398
|
__exportStar(require("./toolBelts/ToolBeltStateMachine"), exports);
|
|
@@ -563,6 +563,60 @@ declare const _default: {
|
|
|
563
563
|
};
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
|
+
additionalValidRoutes: {
|
|
567
|
+
type: "schema";
|
|
568
|
+
isArray: true;
|
|
569
|
+
minArrayLength: number;
|
|
570
|
+
options: {
|
|
571
|
+
schema: {
|
|
572
|
+
id: string;
|
|
573
|
+
fields: {
|
|
574
|
+
viewPermissionContract: {
|
|
575
|
+
type: "schema";
|
|
576
|
+
options: {
|
|
577
|
+
schema: {
|
|
578
|
+
id: string;
|
|
579
|
+
name: string;
|
|
580
|
+
fields: {
|
|
581
|
+
id: {
|
|
582
|
+
type: "raw";
|
|
583
|
+
options: {
|
|
584
|
+
valueType: string;
|
|
585
|
+
};
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
destination: {
|
|
592
|
+
type: "schema";
|
|
593
|
+
isRequired: true;
|
|
594
|
+
options: {
|
|
595
|
+
schema: {
|
|
596
|
+
id: string;
|
|
597
|
+
name: string;
|
|
598
|
+
fields: {
|
|
599
|
+
id: {
|
|
600
|
+
type: "raw";
|
|
601
|
+
isRequired: true;
|
|
602
|
+
options: {
|
|
603
|
+
valueType: string;
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
args: {
|
|
607
|
+
type: "raw";
|
|
608
|
+
options: {
|
|
609
|
+
valueType: string;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
};
|
|
566
620
|
};
|
|
567
621
|
};
|
|
568
622
|
export default _default;
|
|
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const schema_1 = require("@sprucelabs/schema");
|
|
7
7
|
const navigationButton_builder_1 = __importDefault(require("./navigationButton.builder"));
|
|
8
|
+
const permissionContractReference_builder_1 = __importDefault(require("./permissionContractReference.builder"));
|
|
9
|
+
const routerDestination_builder_1 = __importDefault(require("./routerDestination.builder"));
|
|
8
10
|
exports.default = (0, schema_1.buildSchema)({
|
|
9
11
|
id: 'navigation',
|
|
10
12
|
name: 'Navigation',
|
|
@@ -39,5 +41,30 @@ exports.default = (0, schema_1.buildSchema)({
|
|
|
39
41
|
schema: navigationButton_builder_1.default,
|
|
40
42
|
},
|
|
41
43
|
},
|
|
44
|
+
additionalValidRoutes: {
|
|
45
|
+
type: 'schema',
|
|
46
|
+
isArray: true,
|
|
47
|
+
minArrayLength: 0,
|
|
48
|
+
options: {
|
|
49
|
+
schema: (0, schema_1.buildSchema)({
|
|
50
|
+
id: 'navigationRoute',
|
|
51
|
+
fields: {
|
|
52
|
+
viewPermissionContract: {
|
|
53
|
+
type: 'schema',
|
|
54
|
+
options: {
|
|
55
|
+
schema: permissionContractReference_builder_1.default,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
destination: {
|
|
59
|
+
type: 'schema',
|
|
60
|
+
isRequired: true,
|
|
61
|
+
options: {
|
|
62
|
+
schema: routerDestination_builder_1.default,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
},
|
|
68
|
+
},
|
|
42
69
|
},
|
|
43
70
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PermissionContractId } from '@sprucelabs/mercury-types';
|
|
2
|
-
import { AppController, Navigation, SkillViewController, SkillViewControllerId, ViewController } from '../../types/heartwood.types';
|
|
2
|
+
import { AppController, Navigation, NavigationRoute, SkillViewController, SkillViewControllerId, ViewController } from '../../types/heartwood.types';
|
|
3
3
|
declare const navigationAssert: {
|
|
4
4
|
rendersButton(vc: ViewController<Navigation>, id: string): void;
|
|
5
5
|
buttonRedirectsTo(options: {
|
|
@@ -17,5 +17,6 @@ declare const navigationAssert: {
|
|
|
17
17
|
appDoesNotRenderNavigation(vc: Pick<AppController, "renderNavigation">): void;
|
|
18
18
|
skillViewDoesNotRenderNavigation(vc: Pick<SkillViewController, "renderNavigation">): void;
|
|
19
19
|
buttonRequiresViewPermissions(vc: ViewController<Navigation>, button: string, permissionContractId: PermissionContractId): void;
|
|
20
|
+
hasAdditionalValidRoutes(vc: ViewController<Navigation>, routes: NavigationRoute[]): void;
|
|
20
21
|
};
|
|
21
22
|
export default navigationAssert;
|
|
@@ -20,6 +20,7 @@ const navigationAssert = {
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
rendersButtons(vc, ids) {
|
|
23
|
+
(0, schema_1.assertOptions)({ vc, buttons: ids }, ['vc', 'buttons']);
|
|
23
24
|
ids.forEach((id) => this.rendersButton(vc, id));
|
|
24
25
|
},
|
|
25
26
|
rendersButtonLabels(vc) {
|
|
@@ -52,11 +53,26 @@ const navigationAssert = {
|
|
|
52
53
|
const match = getButtonFromNav(vc, button);
|
|
53
54
|
test_utils_1.assert.isEqual(match.viewPermissionContract?.id, permissionContractId, 'Your button did not have the view permission contract set to what I expected!');
|
|
54
55
|
},
|
|
56
|
+
hasAdditionalValidRoutes(vc, routes) {
|
|
57
|
+
(0, schema_1.assertOptions)({ vc, routes }, ['vc', 'routes']);
|
|
58
|
+
const model = render_utility_1.default.render(vc);
|
|
59
|
+
test_utils_1.assert.isEqualDeep(model.additionalValidRoutes, routes, `I did not find the valid routes I expected. Make sure you set 'additionalValidRoutes' in your navigation's view model (constructor options).`);
|
|
60
|
+
},
|
|
55
61
|
};
|
|
56
62
|
exports.default = navigationAssert;
|
|
57
63
|
function getButtonFromNav(vc, id) {
|
|
58
64
|
const model = render_utility_1.default.render(vc);
|
|
59
|
-
|
|
65
|
+
if (model.buttons?.[0].dropdown) {
|
|
66
|
+
const button = model.buttons[0].dropdown?.items?.find((b) => b.id === id);
|
|
67
|
+
test_utils_1.assert.isTruthy(button);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const buttons = model.buttons?.reduce((acc, b) => {
|
|
71
|
+
if (b.dropdown) {
|
|
72
|
+
return [...acc, ...(b?.dropdown?.items ?? [])];
|
|
73
|
+
}
|
|
74
|
+
return [...acc, b];
|
|
75
|
+
}, []);
|
|
60
76
|
const button = buttons?.find((b) => b.id === id);
|
|
61
77
|
test_utils_1.assert.isTruthy(button, `I could not find a button with the id "${id}" in your navigation!`);
|
|
62
78
|
return button;
|
|
@@ -169,6 +169,7 @@ export type BarChart = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.BarCha
|
|
|
169
169
|
export type BarChartDataSet = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.BarChartDataSet;
|
|
170
170
|
export type BarChartDataPoint = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.BarChartDataPoint;
|
|
171
171
|
export type Form<S extends Schema = any> = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Form<S>;
|
|
172
|
+
export type NavigationRoute = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationRoute;
|
|
172
173
|
export type LayoutStyle = NonNullable<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.SkillView['layout']>;
|
|
173
174
|
export type ListColumnWidth = NonNullable<List['columnWidths']>[number];
|
|
174
175
|
export type TriggerRender = () => void;
|
package/package.json
CHANGED