@pronto-tools-and-more/components 11.11.0 → 12.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/main.js CHANGED
@@ -166,8 +166,17 @@ var getArticleListDataSource = ({
166
166
  bundleId,
167
167
  collectionName,
168
168
  limit,
169
- offset
169
+ offset,
170
+ bookmarks
170
171
  }) => {
172
+ if (bookmarks) {
173
+ const dataSource2 = {
174
+ data: "$context.bookmarks",
175
+ type: "context",
176
+ batchSize: 1e6
177
+ };
178
+ return dataSource2;
179
+ }
171
180
  if (collectionName) {
172
181
  return {
173
182
  type: "collection-content",
@@ -219,19 +228,46 @@ var getArticleListDataSource = ({
219
228
  };
220
229
 
221
230
  // src/parts/ArticleList/ArticleList.tsx
222
- var unrender2 = (element, renderElement) => {
231
+ var getContentKey = (element) => {
232
+ if (element.dataSource.type === "collection-content") {
233
+ return "'collection-content'";
234
+ }
235
+ if (element.dataSource.data === "$context.bookmarks") {
236
+ return "'context'";
237
+ }
238
+ return "'content'";
239
+ };
240
+ var getNodeInfo = (element) => {
223
241
  const { render, ...rest } = element;
224
- const isCollection = element.dataSource.type === "collection-content";
225
- const contentKey = isCollection ? "'collection-content'" : "'content'";
226
- const node = render({
242
+ const contentKey = getContentKey(element);
243
+ const isBookmarks = element.dataSource.data === "$context.bookmarks";
244
+ if (isBookmarks) {
245
+ return {
246
+ name: `$functions.id($context, ${contentKey}, 'name')`,
247
+ description: `$functions.id($context, ${contentKey}, 'description')`,
248
+ imageSrc: `$functions.id($context, ${contentKey}, 'imageSrc')`,
249
+ slug: `$functions.id($context, ${contentKey}, 'slug')`,
250
+ metadataVideoPodcast: `$functions.id($context, ${contentKey}, 'metadataVideoPodcast')`,
251
+ readTime: `$functions.id($context, ${contentKey}, 'readTime')`,
252
+ publicationDate: `$functions.id($context, ${contentKey}, 'publicationDate')`,
253
+ id: `$functions.id($context, ${contentKey}, 'id')`
254
+ };
255
+ }
256
+ return {
227
257
  name: `$functions.id($context, ${contentKey}, 'name')`,
228
258
  description: `$functions.id($context, ${contentKey}, 'description')`,
229
259
  imageSrc: `$functions.id($context, ${contentKey}, 'thumbnails', 'default')`,
230
260
  slug: `$functions.id($context, ${contentKey}, 'properties', 'slug')`,
231
261
  metadataVideoPodcast: `$functions.id($context, ${contentKey}, 'properties', 'metadataVideoPodcast')`,
232
262
  readTime: `$functions.getReadTime($functions.id($context, ${contentKey}))`,
233
- publicationDate: `$functions.id($context, ${contentKey}, 'publicationDate')`
234
- });
263
+ publicationDate: `$functions.id($context, ${contentKey}, 'publicationDate')`,
264
+ id: `$functions.id($context, ${contentKey}, 'id')`
265
+ };
266
+ };
267
+ var unrender2 = (element, renderElement) => {
268
+ const { render, ...rest } = element;
269
+ const nodeInfo = getNodeInfo(element);
270
+ const node = render(nodeInfo);
235
271
  const final = renderElement(node);
236
272
  return {
237
273
  ...rest,
@@ -247,7 +283,8 @@ var ArticleList = ({
247
283
  limit,
248
284
  offset,
249
285
  collectionName,
250
- noContentFound
286
+ noContentFound,
287
+ bookmarks
251
288
  }) => {
252
289
  const dataSource = getArticleListDataSource({
253
290
  properties,
@@ -256,7 +293,8 @@ var ArticleList = ({
256
293
  bundleId,
257
294
  limit,
258
295
  offset,
259
- collectionName
296
+ collectionName,
297
+ bookmarks
260
298
  });
261
299
  const json = {
262
300
  render,
@@ -1,5 +1,5 @@
1
1
  import type { ArticleListItemRenderer } from "../ArticleListItemRenderer/ArticleListItemRenderer.ts";
2
- export declare const ArticleList: ({ properties, render, authorId, categoryId, bundleId, limit, offset, collectionName, noContentFound, }: {
2
+ export declare const ArticleList: ({ properties, render, authorId, categoryId, bundleId, limit, offset, collectionName, noContentFound, bookmarks, }: {
3
3
  properties?: any;
4
4
  authorId?: string;
5
5
  categoryId?: string;
@@ -9,4 +9,5 @@ export declare const ArticleList: ({ properties, render, authorId, categoryId, b
9
9
  offset?: number;
10
10
  collectionName?: string;
11
11
  noContentFound?: string;
12
+ bookmarks?: boolean;
12
13
  }) => import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
+ import type { IBookmarkInfo } from "../IBookmarkInfo/IBookmarkInfo.ts";
1
2
  export declare const BaseBookmarkButton: ({ info, children, className, }: {
2
- info: any;
3
+ info: IBookmarkInfo;
3
4
  children: React.ReactNode[];
4
5
  className?: string;
5
6
  }) => import("react").JSX.Element;
@@ -34,6 +34,7 @@ export * from "../Heading/Heading.tsx";
34
34
  export * from "../HighlightedEPaper/HighlightedEpaper.tsx";
35
35
  export * from "../HrefLangAlternate/HrefLangAlternate.ts";
36
36
  export * from "../IArticleListItem/IArticleListItem.ts";
37
+ export * from "../IBookmarkInfo/IBookmarkInfo.ts";
37
38
  export * from "../ICategoryItem/ICategoryItem.ts";
38
39
  export * from "../IDossierListItem/IDossierListItem.ts";
39
40
  export * from "../IFooterSocialLink/IFooterSocialLink.ts";
@@ -1,4 +1,4 @@
1
- export declare const getArticleListDataSource: ({ properties, authorId, categoryId, bundleId, collectionName, limit, offset, }: {
1
+ export declare const getArticleListDataSource: ({ properties, authorId, categoryId, bundleId, collectionName, limit, offset, bookmarks, }: {
2
2
  properties: any;
3
3
  authorId: any;
4
4
  categoryId: any;
@@ -6,7 +6,12 @@ export declare const getArticleListDataSource: ({ properties, authorId, category
6
6
  collectionName: any;
7
7
  limit: any;
8
8
  offset: any;
9
+ bookmarks: any;
9
10
  }) => {
11
+ data: string;
12
+ type: string;
13
+ batchSize: number;
14
+ } | {
10
15
  type: string;
11
16
  filter: {
12
17
  AND: any[];
@@ -7,4 +7,5 @@ export interface IArticleListItem {
7
7
  readonly metadataVideoPodcast?: string;
8
8
  readonly readTime?: string;
9
9
  readonly publicationDate: string;
10
+ readonly id: string;
10
11
  }
@@ -0,0 +1,11 @@
1
+ export interface IBookmarkInfo {
2
+ readonly name: string;
3
+ readonly description: string;
4
+ readonly imageSrc: string;
5
+ readonly properties: any;
6
+ readonly slug: string;
7
+ readonly metadataVideoPodcast?: string;
8
+ readonly readTime?: string;
9
+ readonly publicationDate: string;
10
+ readonly id: string;
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "11.11.0",
3
+ "version": "12.0.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",