@pronto-tools-and-more/components 11.12.0 → 12.0.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/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,11 +228,32 @@ 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')`,
@@ -232,7 +262,12 @@ var unrender2 = (element, renderElement) => {
232
262
  readTime: `$functions.getReadTime($functions.id($context, ${contentKey}))`,
233
263
  publicationDate: `$functions.id($context, ${contentKey}, 'publicationDate')`,
234
264
  id: `$functions.id($context, ${contentKey}, 'id')`
235
- });
265
+ };
266
+ };
267
+ var unrender2 = (element, renderElement) => {
268
+ const { render, ...rest } = element;
269
+ const nodeInfo = getNodeInfo(element);
270
+ const node = render(nodeInfo);
236
271
  const final = renderElement(node);
237
272
  return {
238
273
  ...rest,
@@ -248,7 +283,8 @@ var ArticleList = ({
248
283
  limit,
249
284
  offset,
250
285
  collectionName,
251
- noContentFound
286
+ noContentFound,
287
+ bookmarks
252
288
  }) => {
253
289
  const dataSource = getArticleListDataSource({
254
290
  properties,
@@ -257,7 +293,8 @@ var ArticleList = ({
257
293
  bundleId,
258
294
  limit,
259
295
  offset,
260
- collectionName
296
+ collectionName,
297
+ bookmarks
261
298
  });
262
299
  const json = {
263
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,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[];
@@ -1,5 +1,11 @@
1
1
  export interface IBookmarkInfo {
2
- readonly title: string;
3
- readonly url: string;
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;
4
10
  readonly id: string;
5
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "11.12.0",
3
+ "version": "12.0.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",