@omerlo/omerlo-webkit 0.0.54 → 0.0.55

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.
@@ -45,6 +45,7 @@ export type ContentBlockRichtext = {
45
45
  id: string;
46
46
  kind: 'richtext';
47
47
  contentHtml: string;
48
+ contentText: string;
48
49
  visual: Visual | null;
49
50
  template: ContentBlockTemplate | null;
50
51
  };
@@ -79,10 +80,15 @@ export type ContentBlockRelatedContents = {
79
80
  visual: Visual | null;
80
81
  template: ContentBlockTemplate | null;
81
82
  };
83
+ export type AnswerVotes = {
84
+ total: number;
85
+ sources: Record<string, unknown>;
86
+ };
82
87
  export type Answer = {
83
88
  id: string;
84
89
  contentHtml: string;
85
90
  contentText: string;
91
+ votes: AnswerVotes | null;
86
92
  };
87
93
  export type ContentBlockQuestion = {
88
94
  id: string;
@@ -90,6 +96,7 @@ export type ContentBlockQuestion = {
90
96
  questionHtml: string;
91
97
  questionText: string;
92
98
  acceptVoteUntil: Date;
99
+ acceptVotesUntilTimezone: string | null;
93
100
  answers: Answer[];
94
101
  visual: Visual | null;
95
102
  template: ContentBlockTemplate | null;
@@ -130,7 +130,8 @@ function getBlockContents(data, assocs) {
130
130
  function parseContentBlockRichtext(data, assocs) {
131
131
  return {
132
132
  ...baseBlock(data, assocs),
133
- contentHtml: data.content_html
133
+ contentHtml: data.content_html,
134
+ contentText: data.content_text
134
135
  };
135
136
  }
136
137
  function parseContentBlockData(data, assocs) {
@@ -167,6 +168,7 @@ function parseContentBlockQuestion(data, assocs) {
167
168
  questionHtml: data.question_html,
168
169
  questionText: data.question_text,
169
170
  acceptVoteUntil: new Date(data.accept_vote_until),
171
+ acceptVotesUntilTimezone: data.accept_votes_until_timezone ?? null,
170
172
  answers: data.answers?.map((answer) => parseAnswer(answer)) || []
171
173
  };
172
174
  }
@@ -174,7 +176,8 @@ function parseAnswer(data) {
174
176
  return {
175
177
  id: data.id,
176
178
  contentHtml: data.content_html,
177
- contentText: data.content_text
179
+ contentText: data.content_text,
180
+ votes: data.votes ? { total: data.votes.total ?? 0, sources: data.votes.sources ?? {} } : null
178
181
  };
179
182
  }
180
183
  function parseContentBlockImage(data, assocs) {
@@ -20,6 +20,7 @@ export interface OrganizationSummary {
20
20
  kind: string;
21
21
  name: string;
22
22
  profileImageUrl: string | null;
23
+ canonicalUrl: string | null;
23
24
  meta: {
24
25
  locales: LocalesMetadata;
25
26
  };
@@ -57,6 +57,7 @@ export function parseOrganizationSummary(data, assocs) {
57
57
  name: data.name,
58
58
  // NOTE remove logo_image_url once using reader api
59
59
  profileImageUrl: data.logo_image_url || data.profile_image_url,
60
+ canonicalUrl: data.canonical_url ?? null,
60
61
  ...localizedField,
61
62
  updatedAt: new Date(data.updated_at)
62
63
  };
@@ -23,6 +23,7 @@ export interface PersonSummary {
23
23
  pronoun: string | null;
24
24
  profileImageUrl: string | null;
25
25
  coverImageUrl: string | null;
26
+ canonicalUrl: string | null;
26
27
  meta: {
27
28
  locales: LocalesMetadata;
28
29
  };
@@ -61,6 +61,7 @@ export function parsePersonSummary(data, assocs) {
61
61
  // NOTE remove logo_image_url once using reader api
62
62
  profileImageUrl: data.avatar_image_url || data.profile_image_url,
63
63
  coverImageUrl: data.cover_image_url,
64
+ canonicalUrl: data.canonical_url ?? null,
64
65
  ...localizedField,
65
66
  updatedAt: new Date(data.updated_at)
66
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omerlo/omerlo-webkit",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",