@sprucelabs/spruce-feed-view-controllers 0.0.142 → 0.0.145
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/feed.types.d.ts +5 -5
- package/build/esm/index-module.d.ts +1 -1
- package/build/esm/index-module.js +1 -1
- package/build/esm/{viewControllers → root}/FeedCard.vc.d.ts +4 -17
- package/build/esm/{viewControllers → root}/FeedCard.vc.js +16 -75
- package/build/esm/types-module.d.ts +1 -1
- package/build/feed.types.d.ts +5 -5
- package/build/index-module.d.ts +1 -1
- package/build/index-module.js +1 -1
- package/build/{viewControllers → root}/FeedCard.vc.d.ts +4 -17
- package/build/{viewControllers → root}/FeedCard.vc.js +14 -69
- package/build/types-module.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SpruceSchemas } from '@sprucelabs/spruce-core-schemas';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
2
|
+
export type FeedPredicate = SpruceSchemas.Mercury.v2020_12_25.FeedPredicate;
|
|
3
|
+
export type FeedItem = SpruceSchemas.Spruce.v2020_07_22.FeedItem;
|
|
4
|
+
export type Feed = SpruceSchemas.Spruce.v2020_07_22.Feed;
|
|
5
|
+
export type CardSection = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CardSection;
|
|
6
|
+
export type Card = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as FeedCardViewController } from './
|
|
1
|
+
export { default as FeedCardViewController } from './root/FeedCard.vc';
|
|
2
2
|
export * from './types-module';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as FeedCardViewController } from './
|
|
1
|
+
export { default as FeedCardViewController } from './root/FeedCard.vc.js';
|
|
2
2
|
export * from './types-module.js';
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { AbstractViewController, Authenticator, CardViewController,
|
|
1
|
+
import { AbstractViewController, Authenticator, CardViewController, FeedViewController, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { Card, FeedPredicate } from '../feed.types';
|
|
3
3
|
export default class FeedCardViewController extends AbstractViewController<Card> {
|
|
4
4
|
static id: string;
|
|
5
5
|
private isLoaded;
|
|
6
6
|
protected cardVc: CardViewController;
|
|
7
7
|
private predicates;
|
|
8
|
-
protected formVc: FormViewController<MessageFormSchema>;
|
|
9
8
|
private shouldEnableChat;
|
|
10
9
|
private auth;
|
|
11
10
|
private sentMessageCount;
|
|
12
11
|
private pendingAddedMessages;
|
|
12
|
+
protected feedVc: FeedViewController;
|
|
13
13
|
constructor(options: ViewControllerOptions & FeedCardViewControllerOptions);
|
|
14
|
+
private FeedVc;
|
|
14
15
|
private CardVc;
|
|
15
|
-
private FormVc;
|
|
16
|
-
private handleChangeForm;
|
|
17
16
|
private handleSubmitForm;
|
|
18
|
-
private setMessage;
|
|
19
17
|
private handleDidUpdateFeed;
|
|
20
18
|
private sendMessage;
|
|
21
19
|
private removeItem;
|
|
22
20
|
private pushItem;
|
|
23
21
|
private addSentMessage;
|
|
24
|
-
private getFeed;
|
|
25
22
|
getIsLoaded(): boolean;
|
|
26
23
|
load(options: {
|
|
27
24
|
predicates: FeedPredicate[];
|
|
@@ -32,17 +29,7 @@ export default class FeedCardViewController extends AbstractViewController<Card>
|
|
|
32
29
|
private handleTryAgain;
|
|
33
30
|
render(): import("@sprucelabs/heartwood-view-controllers").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
|
|
34
31
|
}
|
|
35
|
-
export
|
|
32
|
+
export type FeedCardViewControllerOptions = {
|
|
36
33
|
id?: string;
|
|
37
34
|
shouldEnableChat?: boolean;
|
|
38
35
|
};
|
|
39
|
-
declare const messageFormSchema: {
|
|
40
|
-
id: string;
|
|
41
|
-
fields: {
|
|
42
|
-
message: {
|
|
43
|
-
type: "text";
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
declare type MessageFormSchema = typeof messageFormSchema;
|
|
48
|
-
export {};
|
|
@@ -7,8 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { AbstractViewController,
|
|
11
|
-
import { assertOptions
|
|
10
|
+
import { AbstractViewController, } from '@sprucelabs/heartwood-view-controllers';
|
|
11
|
+
import { assertOptions } from '@sprucelabs/schema';
|
|
12
12
|
export default class FeedCardViewController extends AbstractViewController {
|
|
13
13
|
constructor(options) {
|
|
14
14
|
super(options);
|
|
@@ -18,24 +18,23 @@ export default class FeedCardViewController extends AbstractViewController {
|
|
|
18
18
|
this.pendingAddedMessages = [];
|
|
19
19
|
const { shouldEnableChat } = options;
|
|
20
20
|
this.shouldEnableChat = !!shouldEnableChat;
|
|
21
|
-
this.
|
|
21
|
+
this.feedVc = this.FeedVc();
|
|
22
22
|
this.cardVc = this.CardVc(options);
|
|
23
23
|
}
|
|
24
|
+
FeedVc() {
|
|
25
|
+
return this.Controller('feed', {
|
|
26
|
+
items: [],
|
|
27
|
+
onSubmitMessage: this.handleSubmitForm.bind(this),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
24
30
|
CardVc(options) {
|
|
25
|
-
const { id
|
|
31
|
+
const { id } = options;
|
|
26
32
|
const sections = [
|
|
27
33
|
{
|
|
28
34
|
id: 'feed',
|
|
29
|
-
feed:
|
|
30
|
-
items: [],
|
|
31
|
-
},
|
|
35
|
+
feed: this.feedVc.render(),
|
|
32
36
|
},
|
|
33
37
|
];
|
|
34
|
-
if (shouldEnableChat) {
|
|
35
|
-
sections.push({
|
|
36
|
-
form: this.formVc.render(),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
38
|
return this.Controller('card', {
|
|
40
39
|
id,
|
|
41
40
|
body: {
|
|
@@ -44,50 +43,11 @@ export default class FeedCardViewController extends AbstractViewController {
|
|
|
44
43
|
},
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
return this.Controller('form', buildForm({
|
|
49
|
-
id: 'message',
|
|
50
|
-
schema: messageFormSchema,
|
|
51
|
-
isEnabled: false,
|
|
52
|
-
onChange: this.handleChangeForm.bind(this),
|
|
53
|
-
onSubmit: this.handleSubmitForm.bind(this),
|
|
54
|
-
sections: [
|
|
55
|
-
{
|
|
56
|
-
fields: [
|
|
57
|
-
{
|
|
58
|
-
name: 'message',
|
|
59
|
-
renderAs: 'textarea',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
shouldShowCancelButton: false,
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
handleChangeForm() {
|
|
68
|
-
var _a;
|
|
46
|
+
handleSubmitForm(message) {
|
|
69
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const message = (_a = this.formVc.getValue('message')) !== null && _a !== void 0 ? _a : '';
|
|
71
|
-
if (message.length > 0) {
|
|
72
|
-
this.formVc.enable();
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
this.formVc.disable();
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
handleSubmitForm() {
|
|
80
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
const message = this.formVc.getValue('message');
|
|
82
|
-
yield this.setMessage(null);
|
|
83
48
|
yield this.sendMessage(message);
|
|
84
49
|
});
|
|
85
50
|
}
|
|
86
|
-
setMessage(value) {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
yield this.formVc.setValue('message', value);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
51
|
handleDidUpdateFeed(item) {
|
|
92
52
|
const idx = this.pendingAddedMessages.indexOf(item.message);
|
|
93
53
|
console.log({ idx });
|
|
@@ -116,7 +76,6 @@ export default class FeedCardViewController extends AbstractViewController {
|
|
|
116
76
|
}
|
|
117
77
|
catch (err) {
|
|
118
78
|
this.removeItem(added.id);
|
|
119
|
-
yield this.setMessage(added.message);
|
|
120
79
|
yield this.alert({
|
|
121
80
|
title: 'Failed to send message!',
|
|
122
81
|
message: err.message,
|
|
@@ -126,14 +85,10 @@ export default class FeedCardViewController extends AbstractViewController {
|
|
|
126
85
|
});
|
|
127
86
|
}
|
|
128
87
|
removeItem(id) {
|
|
129
|
-
|
|
130
|
-
feed.items = feed.items.filter((i) => i.id !== id);
|
|
131
|
-
this.cardVc.updateSection('feed', { feed });
|
|
88
|
+
this.feedVc.removeItem(id);
|
|
132
89
|
}
|
|
133
90
|
pushItem(item) {
|
|
134
|
-
|
|
135
|
-
items.push(item);
|
|
136
|
-
this.cardVc.triggerRender();
|
|
91
|
+
this.feedVc.addItem(item);
|
|
137
92
|
}
|
|
138
93
|
addSentMessage(message) {
|
|
139
94
|
const person = this.auth.getPerson();
|
|
@@ -142,7 +97,7 @@ export default class FeedCardViewController extends AbstractViewController {
|
|
|
142
97
|
isMe: true,
|
|
143
98
|
message: message,
|
|
144
99
|
fromCasualName: person.casualName,
|
|
145
|
-
dateCreated:
|
|
100
|
+
dateCreated: this.dates.date(),
|
|
146
101
|
avatar: person.avatar,
|
|
147
102
|
source: {
|
|
148
103
|
personId: person.id,
|
|
@@ -151,10 +106,6 @@ export default class FeedCardViewController extends AbstractViewController {
|
|
|
151
106
|
this.pushItem(item);
|
|
152
107
|
return item;
|
|
153
108
|
}
|
|
154
|
-
getFeed() {
|
|
155
|
-
const { feed } = this.cardVc.getSection('feed');
|
|
156
|
-
return feed;
|
|
157
|
-
}
|
|
158
109
|
getIsLoaded() {
|
|
159
110
|
return this.isLoaded;
|
|
160
111
|
}
|
|
@@ -181,9 +132,7 @@ export default class FeedCardViewController extends AbstractViewController {
|
|
|
181
132
|
},
|
|
182
133
|
});
|
|
183
134
|
feed.items.reverse();
|
|
184
|
-
this.
|
|
185
|
-
feed: Object.assign(Object.assign({}, feed), { shouldEnableChat: true }),
|
|
186
|
-
});
|
|
135
|
+
this.feedVc.setItems(feed.items);
|
|
187
136
|
}
|
|
188
137
|
catch (err) {
|
|
189
138
|
this.cardVc.setCriticalError({
|
|
@@ -215,11 +164,3 @@ export default class FeedCardViewController extends AbstractViewController {
|
|
|
215
164
|
}
|
|
216
165
|
}
|
|
217
166
|
FeedCardViewController.id = 'feed-card';
|
|
218
|
-
const messageFormSchema = buildSchema({
|
|
219
|
-
id: 'message',
|
|
220
|
-
fields: {
|
|
221
|
-
message: {
|
|
222
|
-
type: 'text',
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FeedCardViewController } from './index-module';
|
|
2
|
-
import { FeedCardViewControllerOptions } from './
|
|
2
|
+
import { FeedCardViewControllerOptions } from './root/FeedCard.vc';
|
|
3
3
|
declare module '@sprucelabs/heartwood-view-controllers/build/types/heartwood.types' {
|
|
4
4
|
interface ViewControllerMap {
|
|
5
5
|
feedCard: FeedCardViewController;
|
package/build/feed.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SpruceSchemas } from '@sprucelabs/spruce-core-schemas';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
2
|
+
export type FeedPredicate = SpruceSchemas.Mercury.v2020_12_25.FeedPredicate;
|
|
3
|
+
export type FeedItem = SpruceSchemas.Spruce.v2020_07_22.FeedItem;
|
|
4
|
+
export type Feed = SpruceSchemas.Spruce.v2020_07_22.Feed;
|
|
5
|
+
export type CardSection = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.CardSection;
|
|
6
|
+
export type Card = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
|
package/build/index-module.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as FeedCardViewController } from './
|
|
1
|
+
export { default as FeedCardViewController } from './root/FeedCard.vc';
|
|
2
2
|
export * from './types-module';
|
package/build/index-module.js
CHANGED
|
@@ -18,6 +18,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.FeedCardViewController = void 0;
|
|
21
|
-
var FeedCard_vc_1 = require("./
|
|
21
|
+
var FeedCard_vc_1 = require("./root/FeedCard.vc");
|
|
22
22
|
Object.defineProperty(exports, "FeedCardViewController", { enumerable: true, get: function () { return __importDefault(FeedCard_vc_1).default; } });
|
|
23
23
|
__exportStar(require("./types-module"), exports);
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { AbstractViewController, Authenticator, CardViewController,
|
|
1
|
+
import { AbstractViewController, Authenticator, CardViewController, FeedViewController, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { Card, FeedPredicate } from '../feed.types';
|
|
3
3
|
export default class FeedCardViewController extends AbstractViewController<Card> {
|
|
4
4
|
static id: string;
|
|
5
5
|
private isLoaded;
|
|
6
6
|
protected cardVc: CardViewController;
|
|
7
7
|
private predicates;
|
|
8
|
-
protected formVc: FormViewController<MessageFormSchema>;
|
|
9
8
|
private shouldEnableChat;
|
|
10
9
|
private auth;
|
|
11
10
|
private sentMessageCount;
|
|
12
11
|
private pendingAddedMessages;
|
|
12
|
+
protected feedVc: FeedViewController;
|
|
13
13
|
constructor(options: ViewControllerOptions & FeedCardViewControllerOptions);
|
|
14
|
+
private FeedVc;
|
|
14
15
|
private CardVc;
|
|
15
|
-
private FormVc;
|
|
16
|
-
private handleChangeForm;
|
|
17
16
|
private handleSubmitForm;
|
|
18
|
-
private setMessage;
|
|
19
17
|
private handleDidUpdateFeed;
|
|
20
18
|
private sendMessage;
|
|
21
19
|
private removeItem;
|
|
22
20
|
private pushItem;
|
|
23
21
|
private addSentMessage;
|
|
24
|
-
private getFeed;
|
|
25
22
|
getIsLoaded(): boolean;
|
|
26
23
|
load(options: {
|
|
27
24
|
predicates: FeedPredicate[];
|
|
@@ -32,17 +29,7 @@ export default class FeedCardViewController extends AbstractViewController<Card>
|
|
|
32
29
|
private handleTryAgain;
|
|
33
30
|
render(): import("@sprucelabs/heartwood-view-controllers").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Card;
|
|
34
31
|
}
|
|
35
|
-
export
|
|
32
|
+
export type FeedCardViewControllerOptions = {
|
|
36
33
|
id?: string;
|
|
37
34
|
shouldEnableChat?: boolean;
|
|
38
35
|
};
|
|
39
|
-
declare const messageFormSchema: {
|
|
40
|
-
id: string;
|
|
41
|
-
fields: {
|
|
42
|
-
message: {
|
|
43
|
-
type: "text";
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
declare type MessageFormSchema = typeof messageFormSchema;
|
|
48
|
-
export {};
|
|
@@ -11,24 +11,23 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
11
11
|
this.pendingAddedMessages = [];
|
|
12
12
|
const { shouldEnableChat } = options;
|
|
13
13
|
this.shouldEnableChat = !!shouldEnableChat;
|
|
14
|
-
this.
|
|
14
|
+
this.feedVc = this.FeedVc();
|
|
15
15
|
this.cardVc = this.CardVc(options);
|
|
16
16
|
}
|
|
17
|
+
FeedVc() {
|
|
18
|
+
return this.Controller('feed', {
|
|
19
|
+
items: [],
|
|
20
|
+
onSubmitMessage: this.handleSubmitForm.bind(this),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
17
23
|
CardVc(options) {
|
|
18
|
-
const { id
|
|
24
|
+
const { id } = options;
|
|
19
25
|
const sections = [
|
|
20
26
|
{
|
|
21
27
|
id: 'feed',
|
|
22
|
-
feed:
|
|
23
|
-
items: [],
|
|
24
|
-
},
|
|
28
|
+
feed: this.feedVc.render(),
|
|
25
29
|
},
|
|
26
30
|
];
|
|
27
|
-
if (shouldEnableChat) {
|
|
28
|
-
sections.push({
|
|
29
|
-
form: this.formVc.render(),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
31
|
return this.Controller('card', {
|
|
33
32
|
id,
|
|
34
33
|
body: {
|
|
@@ -37,44 +36,9 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
37
36
|
},
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
return this.Controller('form', (0, heartwood_view_controllers_1.buildForm)({
|
|
42
|
-
id: 'message',
|
|
43
|
-
schema: messageFormSchema,
|
|
44
|
-
isEnabled: false,
|
|
45
|
-
onChange: this.handleChangeForm.bind(this),
|
|
46
|
-
onSubmit: this.handleSubmitForm.bind(this),
|
|
47
|
-
sections: [
|
|
48
|
-
{
|
|
49
|
-
fields: [
|
|
50
|
-
{
|
|
51
|
-
name: 'message',
|
|
52
|
-
renderAs: 'textarea',
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
shouldShowCancelButton: false,
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
async handleChangeForm() {
|
|
61
|
-
var _a;
|
|
62
|
-
const message = (_a = this.formVc.getValue('message')) !== null && _a !== void 0 ? _a : '';
|
|
63
|
-
if (message.length > 0) {
|
|
64
|
-
this.formVc.enable();
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
this.formVc.disable();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
async handleSubmitForm() {
|
|
71
|
-
const message = this.formVc.getValue('message');
|
|
72
|
-
await this.setMessage(null);
|
|
39
|
+
async handleSubmitForm(message) {
|
|
73
40
|
await this.sendMessage(message);
|
|
74
41
|
}
|
|
75
|
-
async setMessage(value) {
|
|
76
|
-
await this.formVc.setValue('message', value);
|
|
77
|
-
}
|
|
78
42
|
handleDidUpdateFeed(item) {
|
|
79
43
|
const idx = this.pendingAddedMessages.indexOf(item.message);
|
|
80
44
|
console.log({ idx });
|
|
@@ -102,7 +66,6 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
102
66
|
}
|
|
103
67
|
catch (err) {
|
|
104
68
|
this.removeItem(added.id);
|
|
105
|
-
await this.setMessage(added.message);
|
|
106
69
|
await this.alert({
|
|
107
70
|
title: 'Failed to send message!',
|
|
108
71
|
message: err.message,
|
|
@@ -111,14 +74,10 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
111
74
|
}
|
|
112
75
|
}
|
|
113
76
|
removeItem(id) {
|
|
114
|
-
|
|
115
|
-
feed.items = feed.items.filter((i) => i.id !== id);
|
|
116
|
-
this.cardVc.updateSection('feed', { feed });
|
|
77
|
+
this.feedVc.removeItem(id);
|
|
117
78
|
}
|
|
118
79
|
pushItem(item) {
|
|
119
|
-
|
|
120
|
-
items.push(item);
|
|
121
|
-
this.cardVc.triggerRender();
|
|
80
|
+
this.feedVc.addItem(item);
|
|
122
81
|
}
|
|
123
82
|
addSentMessage(message) {
|
|
124
83
|
const person = this.auth.getPerson();
|
|
@@ -127,7 +86,7 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
127
86
|
isMe: true,
|
|
128
87
|
message: message,
|
|
129
88
|
fromCasualName: person.casualName,
|
|
130
|
-
dateCreated:
|
|
89
|
+
dateCreated: this.dates.date(),
|
|
131
90
|
avatar: person.avatar,
|
|
132
91
|
source: {
|
|
133
92
|
personId: person.id,
|
|
@@ -136,10 +95,6 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
136
95
|
this.pushItem(item);
|
|
137
96
|
return item;
|
|
138
97
|
}
|
|
139
|
-
getFeed() {
|
|
140
|
-
const { feed } = this.cardVc.getSection('feed');
|
|
141
|
-
return feed;
|
|
142
|
-
}
|
|
143
98
|
getIsLoaded() {
|
|
144
99
|
return this.isLoaded;
|
|
145
100
|
}
|
|
@@ -163,9 +118,7 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
163
118
|
},
|
|
164
119
|
});
|
|
165
120
|
feed.items.reverse();
|
|
166
|
-
this.
|
|
167
|
-
feed: Object.assign(Object.assign({}, feed), { shouldEnableChat: true }),
|
|
168
|
-
});
|
|
121
|
+
this.feedVc.setItems(feed.items);
|
|
169
122
|
}
|
|
170
123
|
catch (err) {
|
|
171
124
|
this.cardVc.setCriticalError({
|
|
@@ -195,11 +148,3 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
195
148
|
}
|
|
196
149
|
exports.default = FeedCardViewController;
|
|
197
150
|
FeedCardViewController.id = 'feed-card';
|
|
198
|
-
const messageFormSchema = (0, schema_1.buildSchema)({
|
|
199
|
-
id: 'message',
|
|
200
|
-
fields: {
|
|
201
|
-
message: {
|
|
202
|
-
type: 'text',
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
});
|
package/build/types-module.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FeedCardViewController } from './index-module';
|
|
2
|
-
import { FeedCardViewControllerOptions } from './
|
|
2
|
+
import { FeedCardViewControllerOptions } from './root/FeedCard.vc';
|
|
3
3
|
declare module '@sprucelabs/heartwood-view-controllers/build/types/heartwood.types' {
|
|
4
4
|
interface ViewControllerMap {
|
|
5
5
|
feedCard: FeedCardViewController;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprucelabs/spruce-feed-view-controllers",
|
|
3
3
|
"description": "Spruce feed view controllers",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.145",
|
|
5
5
|
"skill": {
|
|
6
6
|
"namespace": "feed"
|
|
7
7
|
},
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"build/index-module.js",
|
|
18
18
|
"build/index-module.d.ts",
|
|
19
|
-
"build/
|
|
20
|
-
"build/
|
|
19
|
+
"build/root/FeedCard.vc.js",
|
|
20
|
+
"build/root/FeedCard.vc.d.ts",
|
|
21
21
|
"build/esm/index-module.js",
|
|
22
22
|
"build/esm/index-module.d.ts",
|
|
23
|
-
"build/esm/
|
|
24
|
-
"build/esm/
|
|
23
|
+
"build/esm/root/FeedCard.vc.js",
|
|
24
|
+
"build/esm/root/FeedCard.vc.d.ts",
|
|
25
25
|
"build/types-module.js",
|
|
26
26
|
"build/types-module.d.ts",
|
|
27
27
|
"build/esm/types-module.js",
|