@sprucelabs/heartwood-view-controllers 128.1.8 → 128.3.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/build/.spruce/schemas/heartwoodViewControllers/v2021_02_11/feed.schema.js +13 -0
- package/build/.spruce/schemas/schemas.types.d.ts +25 -0
- package/build/esm/.spruce/schemas/heartwoodViewControllers/v2021_02_11/feed.schema.js +13 -0
- package/build/esm/.spruce/schemas/schemas.types.d.ts +25 -0
- package/build/esm/schemas/v2021_02_11/cards/card.builder.d.ts +15 -0
- package/build/esm/schemas/v2021_02_11/cards/cardBody.builder.d.ts +15 -0
- package/build/esm/schemas/v2021_02_11/cards/cardSection.builder.d.ts +15 -0
- package/build/esm/schemas/v2021_02_11/dialog.builder.d.ts +15 -0
- package/build/esm/schemas/v2021_02_11/feed.builder.d.ts +15 -0
- package/build/esm/schemas/v2021_02_11/feed.builder.js +20 -1
- package/build/esm/schemas/v2021_02_11/toolBelt.builder.d.ts +15 -0
- package/build/esm/tests/utilities/feedAssert.d.ts +2 -1
- package/build/esm/tests/utilities/feedAssert.js +4 -0
- package/build/esm/types/heartwood.types.d.ts +1 -0
- package/build/esm/viewControllers/Feed.vc.d.ts +2 -1
- package/build/esm/viewControllers/Feed.vc.js +5 -1
- package/build/esm/viewControllers/ViewControllerExporter.js +1 -0
- package/build/schemas/v2021_02_11/cards/card.builder.d.ts +15 -0
- package/build/schemas/v2021_02_11/cards/cardBody.builder.d.ts +15 -0
- package/build/schemas/v2021_02_11/cards/cardSection.builder.d.ts +15 -0
- package/build/schemas/v2021_02_11/dialog.builder.d.ts +15 -0
- package/build/schemas/v2021_02_11/feed.builder.d.ts +15 -0
- package/build/schemas/v2021_02_11/feed.builder.js +21 -0
- package/build/schemas/v2021_02_11/toolBelt.builder.d.ts +15 -0
- package/build/tests/utilities/feedAssert.d.ts +2 -1
- package/build/tests/utilities/feedAssert.js +4 -0
- package/build/types/heartwood.types.d.ts +1 -0
- package/build/viewControllers/Feed.vc.d.ts +2 -1
- package/build/viewControllers/Feed.vc.js +8 -1
- package/build/viewControllers/ViewControllerExporter.js +1 -0
- package/package.json +1 -1
|
@@ -20,6 +20,19 @@ const feedSchema = {
|
|
|
20
20
|
minArrayLength: 0,
|
|
21
21
|
options: { schema: feedItem_schema_1.default, }
|
|
22
22
|
},
|
|
23
|
+
/** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
|
|
24
|
+
'scrollMode': {
|
|
25
|
+
type: 'select',
|
|
26
|
+
hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.',
|
|
27
|
+
options: { choices: [{ "value": "inline", "label": "Inline Scroll" }, { "value": "fullView", "label": "Full View" }], }
|
|
28
|
+
},
|
|
29
|
+
/** Agent Name. The name of the agent associated with this feed. Defaults to "Sprucebot" */
|
|
30
|
+
'agentName': {
|
|
31
|
+
label: 'Agent Name',
|
|
32
|
+
type: 'text',
|
|
33
|
+
hint: 'The name of the agent associated with this feed. Defaults to "Sprucebot"',
|
|
34
|
+
options: undefined
|
|
35
|
+
},
|
|
23
36
|
/** . */
|
|
24
37
|
'onSubmitMessage': {
|
|
25
38
|
type: 'raw',
|
|
@@ -7833,6 +7833,10 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
7833
7833
|
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
7834
7834
|
interface Feed {
|
|
7835
7835
|
'items': SpruceSchemas.Spruce.v2020_07_22.FeedItem[];
|
|
7836
|
+
/** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
|
|
7837
|
+
'scrollMode'?: ("inline" | "fullView") | undefined | null;
|
|
7838
|
+
/** Agent Name. The name of the agent associated with this feed. Defaults to "Sprucebot" */
|
|
7839
|
+
'agentName'?: string | undefined | null;
|
|
7836
7840
|
'onSubmitMessage'?: (HeartwoodTypes.OnSubmitFeedMessageHandler) | undefined | null;
|
|
7837
7841
|
'controller'?: (HeartwoodTypes.ViewController<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Feed>) | undefined | null;
|
|
7838
7842
|
}
|
|
@@ -7853,6 +7857,27 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
7853
7857
|
schema: SpruceSchemas.Spruce.v2020_07_22.FeedItemSchema;
|
|
7854
7858
|
};
|
|
7855
7859
|
};
|
|
7860
|
+
/** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
|
|
7861
|
+
'scrollMode': {
|
|
7862
|
+
type: 'select';
|
|
7863
|
+
hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.';
|
|
7864
|
+
options: {
|
|
7865
|
+
choices: [{
|
|
7866
|
+
"value": "inline";
|
|
7867
|
+
"label": "Inline Scroll";
|
|
7868
|
+
}, {
|
|
7869
|
+
"value": "fullView";
|
|
7870
|
+
"label": "Full View";
|
|
7871
|
+
}];
|
|
7872
|
+
};
|
|
7873
|
+
};
|
|
7874
|
+
/** Agent Name. The name of the agent associated with this feed. Defaults to "Sprucebot" */
|
|
7875
|
+
'agentName': {
|
|
7876
|
+
label: 'Agent Name';
|
|
7877
|
+
type: 'text';
|
|
7878
|
+
hint: 'The name of the agent associated with this feed. Defaults to "Sprucebot"';
|
|
7879
|
+
options: undefined;
|
|
7880
|
+
};
|
|
7856
7881
|
/** . */
|
|
7857
7882
|
'onSubmitMessage': {
|
|
7858
7883
|
type: 'raw';
|
|
@@ -15,6 +15,19 @@ const feedSchema = {
|
|
|
15
15
|
minArrayLength: 0,
|
|
16
16
|
options: { schema: feedItemSchema_v2020_07_22, }
|
|
17
17
|
},
|
|
18
|
+
/** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
|
|
19
|
+
'scrollMode': {
|
|
20
|
+
type: 'select',
|
|
21
|
+
hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.',
|
|
22
|
+
options: { choices: [{ "value": "inline", "label": "Inline Scroll" }, { "value": "fullView", "label": "Full View" }], }
|
|
23
|
+
},
|
|
24
|
+
/** Agent Name. The name of the agent associated with this feed. Defaults to "Sprucebot" */
|
|
25
|
+
'agentName': {
|
|
26
|
+
label: 'Agent Name',
|
|
27
|
+
type: 'text',
|
|
28
|
+
hint: 'The name of the agent associated with this feed. Defaults to "Sprucebot"',
|
|
29
|
+
options: undefined
|
|
30
|
+
},
|
|
18
31
|
/** . */
|
|
19
32
|
'onSubmitMessage': {
|
|
20
33
|
type: 'raw',
|
|
@@ -7833,6 +7833,10 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
7833
7833
|
namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
|
|
7834
7834
|
interface Feed {
|
|
7835
7835
|
'items': SpruceSchemas.Spruce.v2020_07_22.FeedItem[];
|
|
7836
|
+
/** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
|
|
7837
|
+
'scrollMode'?: ("inline" | "fullView") | undefined | null;
|
|
7838
|
+
/** Agent Name. The name of the agent associated with this feed. Defaults to "Sprucebot" */
|
|
7839
|
+
'agentName'?: string | undefined | null;
|
|
7836
7840
|
'onSubmitMessage'?: (HeartwoodTypes.OnSubmitFeedMessageHandler) | undefined | null;
|
|
7837
7841
|
'controller'?: (HeartwoodTypes.ViewController<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Feed>) | undefined | null;
|
|
7838
7842
|
}
|
|
@@ -7853,6 +7857,27 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
7853
7857
|
schema: SpruceSchemas.Spruce.v2020_07_22.FeedItemSchema;
|
|
7854
7858
|
};
|
|
7855
7859
|
};
|
|
7860
|
+
/** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
|
|
7861
|
+
'scrollMode': {
|
|
7862
|
+
type: 'select';
|
|
7863
|
+
hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.';
|
|
7864
|
+
options: {
|
|
7865
|
+
choices: [{
|
|
7866
|
+
"value": "inline";
|
|
7867
|
+
"label": "Inline Scroll";
|
|
7868
|
+
}, {
|
|
7869
|
+
"value": "fullView";
|
|
7870
|
+
"label": "Full View";
|
|
7871
|
+
}];
|
|
7872
|
+
};
|
|
7873
|
+
};
|
|
7874
|
+
/** Agent Name. The name of the agent associated with this feed. Defaults to "Sprucebot" */
|
|
7875
|
+
'agentName': {
|
|
7876
|
+
label: 'Agent Name';
|
|
7877
|
+
type: 'text';
|
|
7878
|
+
hint: 'The name of the agent associated with this feed. Defaults to "Sprucebot"';
|
|
7879
|
+
options: undefined;
|
|
7880
|
+
};
|
|
7856
7881
|
/** . */
|
|
7857
7882
|
'onSubmitMessage': {
|
|
7858
7883
|
type: 'raw';
|
|
@@ -30059,6 +30059,21 @@ declare const _default: {
|
|
|
30059
30059
|
id: string;
|
|
30060
30060
|
name: string;
|
|
30061
30061
|
fields: {
|
|
30062
|
+
scrollMode: {
|
|
30063
|
+
type: "select";
|
|
30064
|
+
options: {
|
|
30065
|
+
choices: {
|
|
30066
|
+
value: string;
|
|
30067
|
+
label: string;
|
|
30068
|
+
}[];
|
|
30069
|
+
};
|
|
30070
|
+
hint: string;
|
|
30071
|
+
};
|
|
30072
|
+
agentName: {
|
|
30073
|
+
type: "text";
|
|
30074
|
+
label: string;
|
|
30075
|
+
hint: string;
|
|
30076
|
+
};
|
|
30062
30077
|
onSubmitMessage: {
|
|
30063
30078
|
type: "raw";
|
|
30064
30079
|
options: {
|
|
@@ -22828,6 +22828,21 @@ declare const _default: {
|
|
|
22828
22828
|
id: string;
|
|
22829
22829
|
name: string;
|
|
22830
22830
|
fields: {
|
|
22831
|
+
scrollMode: {
|
|
22832
|
+
type: "select";
|
|
22833
|
+
options: {
|
|
22834
|
+
choices: {
|
|
22835
|
+
value: string;
|
|
22836
|
+
label: string;
|
|
22837
|
+
}[];
|
|
22838
|
+
};
|
|
22839
|
+
hint: string;
|
|
22840
|
+
};
|
|
22841
|
+
agentName: {
|
|
22842
|
+
type: "text";
|
|
22843
|
+
label: string;
|
|
22844
|
+
hint: string;
|
|
22845
|
+
};
|
|
22831
22846
|
onSubmitMessage: {
|
|
22832
22847
|
type: "raw";
|
|
22833
22848
|
options: {
|
|
@@ -22773,6 +22773,21 @@ declare const _default: {
|
|
|
22773
22773
|
id: string;
|
|
22774
22774
|
name: string;
|
|
22775
22775
|
fields: {
|
|
22776
|
+
scrollMode: {
|
|
22777
|
+
type: "select";
|
|
22778
|
+
options: {
|
|
22779
|
+
choices: {
|
|
22780
|
+
value: string;
|
|
22781
|
+
label: string;
|
|
22782
|
+
}[];
|
|
22783
|
+
};
|
|
22784
|
+
hint: string;
|
|
22785
|
+
};
|
|
22786
|
+
agentName: {
|
|
22787
|
+
type: "text";
|
|
22788
|
+
label: string;
|
|
22789
|
+
hint: string;
|
|
22790
|
+
};
|
|
22776
22791
|
onSubmitMessage: {
|
|
22777
22792
|
type: "raw";
|
|
22778
22793
|
options: {
|
|
@@ -30101,6 +30101,21 @@ declare const _default: {
|
|
|
30101
30101
|
id: string;
|
|
30102
30102
|
name: string;
|
|
30103
30103
|
fields: {
|
|
30104
|
+
scrollMode: {
|
|
30105
|
+
type: "select";
|
|
30106
|
+
options: {
|
|
30107
|
+
choices: {
|
|
30108
|
+
value: string;
|
|
30109
|
+
label: string;
|
|
30110
|
+
}[];
|
|
30111
|
+
};
|
|
30112
|
+
hint: string;
|
|
30113
|
+
};
|
|
30114
|
+
agentName: {
|
|
30115
|
+
type: "text";
|
|
30116
|
+
label: string;
|
|
30117
|
+
hint: string;
|
|
30118
|
+
};
|
|
30104
30119
|
onSubmitMessage: {
|
|
30105
30120
|
type: "raw";
|
|
30106
30121
|
options: {
|
|
@@ -2,6 +2,21 @@ declare const _default: {
|
|
|
2
2
|
id: string;
|
|
3
3
|
name: string;
|
|
4
4
|
fields: {
|
|
5
|
+
scrollMode: {
|
|
6
|
+
type: "select";
|
|
7
|
+
options: {
|
|
8
|
+
choices: {
|
|
9
|
+
value: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
hint: string;
|
|
14
|
+
};
|
|
15
|
+
agentName: {
|
|
16
|
+
type: "text";
|
|
17
|
+
label: string;
|
|
18
|
+
hint: string;
|
|
19
|
+
};
|
|
5
20
|
onSubmitMessage: {
|
|
6
21
|
type: "raw";
|
|
7
22
|
options: {
|
|
@@ -3,7 +3,26 @@ import { feedSchema } from '@sprucelabs/spruce-core-schemas';
|
|
|
3
3
|
export default buildSchema({
|
|
4
4
|
id: 'feed',
|
|
5
5
|
name: 'Feed',
|
|
6
|
-
fields: Object.assign(Object.assign({}, feedSchema.fields), {
|
|
6
|
+
fields: Object.assign(Object.assign({}, feedSchema.fields), { scrollMode: {
|
|
7
|
+
type: 'select',
|
|
8
|
+
options: {
|
|
9
|
+
choices: [
|
|
10
|
+
{
|
|
11
|
+
value: 'inline',
|
|
12
|
+
label: 'Inline Scroll',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: 'fullView',
|
|
16
|
+
label: 'Full View',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.',
|
|
21
|
+
}, agentName: {
|
|
22
|
+
type: 'text',
|
|
23
|
+
label: 'Agent Name',
|
|
24
|
+
hint: 'The name of the agent associated with this feed. Defaults to "Sprucebot"',
|
|
25
|
+
}, onSubmitMessage: {
|
|
7
26
|
type: 'raw',
|
|
8
27
|
options: {
|
|
9
28
|
valueType: 'HeartwoodTypes.OnSubmitFeedMessageHandler',
|
|
@@ -30131,6 +30131,21 @@ declare const _default: {
|
|
|
30131
30131
|
id: string;
|
|
30132
30132
|
name: string;
|
|
30133
30133
|
fields: {
|
|
30134
|
+
scrollMode: {
|
|
30135
|
+
type: "select";
|
|
30136
|
+
options: {
|
|
30137
|
+
choices: {
|
|
30138
|
+
value: string;
|
|
30139
|
+
label: string;
|
|
30140
|
+
}[];
|
|
30141
|
+
};
|
|
30142
|
+
hint: string;
|
|
30143
|
+
};
|
|
30144
|
+
agentName: {
|
|
30145
|
+
type: "text";
|
|
30146
|
+
label: string;
|
|
30147
|
+
hint: string;
|
|
30148
|
+
};
|
|
30134
30149
|
onSubmitMessage: {
|
|
30135
30150
|
type: "raw";
|
|
30136
30151
|
options: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Card, ViewController } from '../../types/heartwood.types';
|
|
1
|
+
import { Card, Feed, ScrollMode, ViewController } from '../../types/heartwood.types';
|
|
2
2
|
import FeedViewController from '../../viewControllers/Feed.vc';
|
|
3
3
|
declare const feedAssert: {
|
|
4
4
|
cardRendersFeed(vc: ViewController<Card>): FeedViewController;
|
|
5
|
+
scrollModeEquals(vc: ViewController<Feed>, expected: ScrollMode): void;
|
|
5
6
|
};
|
|
6
7
|
export default feedAssert;
|
|
@@ -10,5 +10,9 @@ const feedAssert = {
|
|
|
10
10
|
assert.isTruthy(feed === null || feed === void 0 ? void 0 : feed.controller, `Your card does not render a feed view!`);
|
|
11
11
|
return feed.controller;
|
|
12
12
|
},
|
|
13
|
+
scrollModeEquals(vc, expected) {
|
|
14
|
+
const { scrollMode } = renderUtil.render(vc);
|
|
15
|
+
assert.isEqual(scrollMode, expected, `Expected scroll mode to be "${expected}" but it was "${scrollMode}"`);
|
|
16
|
+
},
|
|
13
17
|
};
|
|
14
18
|
export default feedAssert;
|
|
@@ -252,6 +252,7 @@ export type FormBuilderPage = SpruceSchemas.HeartwoodViewControllers.v2021_02_11
|
|
|
252
252
|
export type Navigation = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Navigation;
|
|
253
253
|
export type NavigationButton = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationButton;
|
|
254
254
|
export type LayoutWidth = NonNullable<SkillView['width']>;
|
|
255
|
+
export type ScrollMode = NonNullable<Feed['scrollMode']>;
|
|
255
256
|
export type NavigationItem = NavigationButton | NavigationSpacer | NavigationImage;
|
|
256
257
|
export interface NavigationSpacer {
|
|
257
258
|
isSpacer: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FeedItem } from '@sprucelabs/spruce-core-schemas';
|
|
2
|
-
import { Feed, ViewControllerOptions } from '../types/heartwood.types';
|
|
2
|
+
import { Feed, ScrollMode, ViewControllerOptions } from '../types/heartwood.types';
|
|
3
3
|
import AbstractViewController from './Abstract.vc';
|
|
4
4
|
export default class FeedViewController extends AbstractViewController<Feed> {
|
|
5
5
|
private model;
|
|
@@ -9,6 +9,7 @@ export default class FeedViewController extends AbstractViewController<Feed> {
|
|
|
9
9
|
setItems(items: FeedItem[]): void;
|
|
10
10
|
getItems(): import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.FeedItem[];
|
|
11
11
|
private getTotalItems;
|
|
12
|
+
setScrollMode(mode: ScrollMode): void;
|
|
12
13
|
render(): Feed;
|
|
13
14
|
}
|
|
14
15
|
export type FeedViewControllerOptions = Feed;
|
|
@@ -4,7 +4,7 @@ import AbstractViewController from './Abstract.vc.js';
|
|
|
4
4
|
export default class FeedViewController extends AbstractViewController {
|
|
5
5
|
constructor(options) {
|
|
6
6
|
super(options);
|
|
7
|
-
this.model = removeUniversalViewOptions(options);
|
|
7
|
+
this.model = Object.assign({ scrollMode: 'fullView' }, removeUniversalViewOptions(options));
|
|
8
8
|
}
|
|
9
9
|
addItem(item) {
|
|
10
10
|
const hasItem = this.model.items.some((i) => i.id === item.id);
|
|
@@ -35,6 +35,10 @@ export default class FeedViewController extends AbstractViewController {
|
|
|
35
35
|
getTotalItems() {
|
|
36
36
|
return this.model.items.length;
|
|
37
37
|
}
|
|
38
|
+
setScrollMode(mode) {
|
|
39
|
+
this.model.scrollMode = mode;
|
|
40
|
+
this.triggerRender();
|
|
41
|
+
}
|
|
38
42
|
render() {
|
|
39
43
|
return Object.assign(Object.assign({}, this.model), { controller: this });
|
|
40
44
|
}
|
|
@@ -188,6 +188,7 @@ class ViewControllerExporter {
|
|
|
188
188
|
'google-logging-utils': pathUtil.resolve(__dirname, 'noop.js'),
|
|
189
189
|
dotenv: pathUtil.resolve(__dirname, 'noop.js'),
|
|
190
190
|
'gcp-metadata': pathUtil.resolve(__dirname, 'noop.js'),
|
|
191
|
+
webpack: pathUtil.resolve(__dirname, 'noop.js'),
|
|
191
192
|
},
|
|
192
193
|
},
|
|
193
194
|
output: {
|
|
@@ -30059,6 +30059,21 @@ declare const _default: {
|
|
|
30059
30059
|
id: string;
|
|
30060
30060
|
name: string;
|
|
30061
30061
|
fields: {
|
|
30062
|
+
scrollMode: {
|
|
30063
|
+
type: "select";
|
|
30064
|
+
options: {
|
|
30065
|
+
choices: {
|
|
30066
|
+
value: string;
|
|
30067
|
+
label: string;
|
|
30068
|
+
}[];
|
|
30069
|
+
};
|
|
30070
|
+
hint: string;
|
|
30071
|
+
};
|
|
30072
|
+
agentName: {
|
|
30073
|
+
type: "text";
|
|
30074
|
+
label: string;
|
|
30075
|
+
hint: string;
|
|
30076
|
+
};
|
|
30062
30077
|
onSubmitMessage: {
|
|
30063
30078
|
type: "raw";
|
|
30064
30079
|
options: {
|
|
@@ -22828,6 +22828,21 @@ declare const _default: {
|
|
|
22828
22828
|
id: string;
|
|
22829
22829
|
name: string;
|
|
22830
22830
|
fields: {
|
|
22831
|
+
scrollMode: {
|
|
22832
|
+
type: "select";
|
|
22833
|
+
options: {
|
|
22834
|
+
choices: {
|
|
22835
|
+
value: string;
|
|
22836
|
+
label: string;
|
|
22837
|
+
}[];
|
|
22838
|
+
};
|
|
22839
|
+
hint: string;
|
|
22840
|
+
};
|
|
22841
|
+
agentName: {
|
|
22842
|
+
type: "text";
|
|
22843
|
+
label: string;
|
|
22844
|
+
hint: string;
|
|
22845
|
+
};
|
|
22831
22846
|
onSubmitMessage: {
|
|
22832
22847
|
type: "raw";
|
|
22833
22848
|
options: {
|
|
@@ -22773,6 +22773,21 @@ declare const _default: {
|
|
|
22773
22773
|
id: string;
|
|
22774
22774
|
name: string;
|
|
22775
22775
|
fields: {
|
|
22776
|
+
scrollMode: {
|
|
22777
|
+
type: "select";
|
|
22778
|
+
options: {
|
|
22779
|
+
choices: {
|
|
22780
|
+
value: string;
|
|
22781
|
+
label: string;
|
|
22782
|
+
}[];
|
|
22783
|
+
};
|
|
22784
|
+
hint: string;
|
|
22785
|
+
};
|
|
22786
|
+
agentName: {
|
|
22787
|
+
type: "text";
|
|
22788
|
+
label: string;
|
|
22789
|
+
hint: string;
|
|
22790
|
+
};
|
|
22776
22791
|
onSubmitMessage: {
|
|
22777
22792
|
type: "raw";
|
|
22778
22793
|
options: {
|
|
@@ -30101,6 +30101,21 @@ declare const _default: {
|
|
|
30101
30101
|
id: string;
|
|
30102
30102
|
name: string;
|
|
30103
30103
|
fields: {
|
|
30104
|
+
scrollMode: {
|
|
30105
|
+
type: "select";
|
|
30106
|
+
options: {
|
|
30107
|
+
choices: {
|
|
30108
|
+
value: string;
|
|
30109
|
+
label: string;
|
|
30110
|
+
}[];
|
|
30111
|
+
};
|
|
30112
|
+
hint: string;
|
|
30113
|
+
};
|
|
30114
|
+
agentName: {
|
|
30115
|
+
type: "text";
|
|
30116
|
+
label: string;
|
|
30117
|
+
hint: string;
|
|
30118
|
+
};
|
|
30104
30119
|
onSubmitMessage: {
|
|
30105
30120
|
type: "raw";
|
|
30106
30121
|
options: {
|
|
@@ -2,6 +2,21 @@ declare const _default: {
|
|
|
2
2
|
id: string;
|
|
3
3
|
name: string;
|
|
4
4
|
fields: {
|
|
5
|
+
scrollMode: {
|
|
6
|
+
type: "select";
|
|
7
|
+
options: {
|
|
8
|
+
choices: {
|
|
9
|
+
value: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
hint: string;
|
|
14
|
+
};
|
|
15
|
+
agentName: {
|
|
16
|
+
type: "text";
|
|
17
|
+
label: string;
|
|
18
|
+
hint: string;
|
|
19
|
+
};
|
|
5
20
|
onSubmitMessage: {
|
|
6
21
|
type: "raw";
|
|
7
22
|
options: {
|
|
@@ -7,6 +7,27 @@ exports.default = (0, schema_1.buildSchema)({
|
|
|
7
7
|
name: 'Feed',
|
|
8
8
|
fields: {
|
|
9
9
|
...spruce_core_schemas_1.feedSchema.fields,
|
|
10
|
+
scrollMode: {
|
|
11
|
+
type: 'select',
|
|
12
|
+
options: {
|
|
13
|
+
choices: [
|
|
14
|
+
{
|
|
15
|
+
value: 'inline',
|
|
16
|
+
label: 'Inline Scroll',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: 'fullView',
|
|
20
|
+
label: 'Full View',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.',
|
|
25
|
+
},
|
|
26
|
+
agentName: {
|
|
27
|
+
type: 'text',
|
|
28
|
+
label: 'Agent Name',
|
|
29
|
+
hint: 'The name of the agent associated with this feed. Defaults to "Sprucebot"',
|
|
30
|
+
},
|
|
10
31
|
onSubmitMessage: {
|
|
11
32
|
type: 'raw',
|
|
12
33
|
options: {
|
|
@@ -30131,6 +30131,21 @@ declare const _default: {
|
|
|
30131
30131
|
id: string;
|
|
30132
30132
|
name: string;
|
|
30133
30133
|
fields: {
|
|
30134
|
+
scrollMode: {
|
|
30135
|
+
type: "select";
|
|
30136
|
+
options: {
|
|
30137
|
+
choices: {
|
|
30138
|
+
value: string;
|
|
30139
|
+
label: string;
|
|
30140
|
+
}[];
|
|
30141
|
+
};
|
|
30142
|
+
hint: string;
|
|
30143
|
+
};
|
|
30144
|
+
agentName: {
|
|
30145
|
+
type: "text";
|
|
30146
|
+
label: string;
|
|
30147
|
+
hint: string;
|
|
30148
|
+
};
|
|
30134
30149
|
onSubmitMessage: {
|
|
30135
30150
|
type: "raw";
|
|
30136
30151
|
options: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Card, ViewController } from '../../types/heartwood.types';
|
|
1
|
+
import { Card, Feed, ScrollMode, ViewController } from '../../types/heartwood.types';
|
|
2
2
|
import FeedViewController from '../../viewControllers/Feed.vc';
|
|
3
3
|
declare const feedAssert: {
|
|
4
4
|
cardRendersFeed(vc: ViewController<Card>): FeedViewController;
|
|
5
|
+
scrollModeEquals(vc: ViewController<Feed>, expected: ScrollMode): void;
|
|
5
6
|
};
|
|
6
7
|
export default feedAssert;
|
|
@@ -15,5 +15,9 @@ const feedAssert = {
|
|
|
15
15
|
test_utils_1.assert.isTruthy(feed?.controller, `Your card does not render a feed view!`);
|
|
16
16
|
return feed.controller;
|
|
17
17
|
},
|
|
18
|
+
scrollModeEquals(vc, expected) {
|
|
19
|
+
const { scrollMode } = render_utility_1.default.render(vc);
|
|
20
|
+
test_utils_1.assert.isEqual(scrollMode, expected, `Expected scroll mode to be "${expected}" but it was "${scrollMode}"`);
|
|
21
|
+
},
|
|
18
22
|
};
|
|
19
23
|
exports.default = feedAssert;
|
|
@@ -252,6 +252,7 @@ export type FormBuilderPage = SpruceSchemas.HeartwoodViewControllers.v2021_02_11
|
|
|
252
252
|
export type Navigation = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Navigation;
|
|
253
253
|
export type NavigationButton = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationButton;
|
|
254
254
|
export type LayoutWidth = NonNullable<SkillView['width']>;
|
|
255
|
+
export type ScrollMode = NonNullable<Feed['scrollMode']>;
|
|
255
256
|
export type NavigationItem = NavigationButton | NavigationSpacer | NavigationImage;
|
|
256
257
|
export interface NavigationSpacer {
|
|
257
258
|
isSpacer: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FeedItem } from '@sprucelabs/spruce-core-schemas';
|
|
2
|
-
import { Feed, ViewControllerOptions } from '../types/heartwood.types';
|
|
2
|
+
import { Feed, ScrollMode, ViewControllerOptions } from '../types/heartwood.types';
|
|
3
3
|
import AbstractViewController from './Abstract.vc';
|
|
4
4
|
export default class FeedViewController extends AbstractViewController<Feed> {
|
|
5
5
|
private model;
|
|
@@ -9,6 +9,7 @@ export default class FeedViewController extends AbstractViewController<Feed> {
|
|
|
9
9
|
setItems(items: FeedItem[]): void;
|
|
10
10
|
getItems(): import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.FeedItem[];
|
|
11
11
|
private getTotalItems;
|
|
12
|
+
setScrollMode(mode: ScrollMode): void;
|
|
12
13
|
render(): Feed;
|
|
13
14
|
}
|
|
14
15
|
export type FeedViewControllerOptions = Feed;
|
|
@@ -9,7 +9,10 @@ const Abstract_vc_1 = __importDefault(require("./Abstract.vc"));
|
|
|
9
9
|
class FeedViewController extends Abstract_vc_1.default {
|
|
10
10
|
constructor(options) {
|
|
11
11
|
super(options);
|
|
12
|
-
this.model =
|
|
12
|
+
this.model = {
|
|
13
|
+
scrollMode: 'fullView',
|
|
14
|
+
...(0, removeUniversalViewOptions_1.default)(options),
|
|
15
|
+
};
|
|
13
16
|
}
|
|
14
17
|
addItem(item) {
|
|
15
18
|
const hasItem = this.model.items.some((i) => i.id === item.id);
|
|
@@ -40,6 +43,10 @@ class FeedViewController extends Abstract_vc_1.default {
|
|
|
40
43
|
getTotalItems() {
|
|
41
44
|
return this.model.items.length;
|
|
42
45
|
}
|
|
46
|
+
setScrollMode(mode) {
|
|
47
|
+
this.model.scrollMode = mode;
|
|
48
|
+
this.triggerRender();
|
|
49
|
+
}
|
|
43
50
|
render() {
|
|
44
51
|
return { ...this.model, controller: this };
|
|
45
52
|
}
|
|
@@ -174,6 +174,7 @@ class ViewControllerExporter {
|
|
|
174
174
|
'google-logging-utils': path_1.default.resolve(__dirname, 'noop.js'),
|
|
175
175
|
dotenv: path_1.default.resolve(__dirname, 'noop.js'),
|
|
176
176
|
'gcp-metadata': path_1.default.resolve(__dirname, 'noop.js'),
|
|
177
|
+
webpack: path_1.default.resolve(__dirname, 'noop.js'),
|
|
177
178
|
},
|
|
178
179
|
},
|
|
179
180
|
output: {
|
package/package.json
CHANGED