@omerlo/omerlo-webkit 0.0.15 → 0.0.16

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.
@@ -73,7 +73,7 @@ export type ContentBlockQuote = {
73
73
  };
74
74
  export type ContentBlockRelatedContents = {
75
75
  id: string;
76
- kind: 'related-contents';
76
+ kind: 'related_contents';
77
77
  contents: ContentSummary[];
78
78
  visual: Visual | null;
79
79
  template: ContentBlockTemplate | null;
@@ -115,7 +115,7 @@ export type ContentBlockVideo = {
115
115
  template: ContentBlockTemplate | null;
116
116
  };
117
117
  export type ContentBlock = ContentBlockRichtext | ContentBlockData | ContentBlockHTML | ContentBlockQuote | ContentBlockRelatedContents | ContentBlockQuestion | ContentBlockImage | ContentBlockSlideshow | ContentBlockVideo;
118
- export type ContentBlockType = 'richtext' | 'data' | 'html' | 'quote' | 'related-contents' | 'question' | 'image' | 'slideshow' | 'video';
118
+ export type ContentBlockType = 'richtext' | 'data' | 'html' | 'quote' | 'related_contents' | 'question' | 'image' | 'slideshow' | 'video';
119
119
  export declare function getContent(f: typeof fetch): (id: string) => Promise<import("../utils/api").ApiResponse<Content>>;
120
120
  export declare function listContents(f: typeof fetch): (params?: Partial<PagingParams>) => Promise<import("../utils/api").ApiResponse<ContentSummary[]>>;
121
121
  export declare function parseContentSummary(data: ApiData, assocs: ApiAssocs): ContentSummary;
@@ -49,7 +49,7 @@ export function parseContentSummary(data, assocs) {
49
49
  leadText: data.localized.lead_text,
50
50
  subtitleHtml: data.localized.subtitle_html,
51
51
  subtitleText: data.localized.subtitle_text,
52
- visual: parseVisual(data.visual, assocs),
52
+ visual: parseVisual(data.localized.visual, assocs),
53
53
  meta: buildMeta(data.localized.locale),
54
54
  metadata: {},
55
55
  authors: getAssocs(assocs, 'profiles', data.localized.author_ids)
@@ -101,7 +101,7 @@ const ContentBlockParser = {
101
101
  data: parseContentBlockData,
102
102
  html: parseContentBlockHTML,
103
103
  quote: parseContentBlockQuote,
104
- 'related-contents': parseContentBlockRelatedContents,
104
+ related_contents: parseContentBlockRelatedContents,
105
105
  question: parseContentBlockQuestion,
106
106
  image: parseContentBlockImage,
107
107
  slideshow: parseContentBlockSlideshow,
@@ -117,9 +117,7 @@ function getBlockTemplate(data, assocs) {
117
117
  : null;
118
118
  }
119
119
  function getBlockContents(data, assocs) {
120
- return data.related_contents
121
- ? getAssocs(assocs, 'contents', data.related_contents)
122
- : [];
120
+ return data.content_ids ? getAssocs(assocs, 'contents', data.content_ids) : [];
123
121
  }
124
122
  function parseContentBlockRichtext(data, assocs) {
125
123
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omerlo/omerlo-webkit",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",