@pronto-tools-and-more/components 12.5.0 → 12.6.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
@@ -169,9 +169,17 @@ var getArticleListDataSource = ({
169
169
  }) => {
170
170
  if (bookmarks) {
171
171
  const dataSource2 = {
172
- data: "$context.bookmarks",
173
- type: "context",
174
- batchSize: 1e6
172
+ type: "content",
173
+ filter: {
174
+ AND: [
175
+ {
176
+ id: {
177
+ operation: "REGEX",
178
+ value: "$functions.bookmarkIdString($context.bookmarkIds)"
179
+ }
180
+ }
181
+ ]
182
+ }
175
183
  };
176
184
  return dataSource2;
177
185
  }
@@ -338,16 +346,24 @@ var BaseBookmarkButton = ({
338
346
  children,
339
347
  className
340
348
  }) => {
341
- const stringifiedInfo = JSON.stringify(info);
342
- const fnString = `globalThis.toggleBookmarkArticle(${stringifiedInfo})`;
349
+ const fnString = `globalThis.toggleBookmarkArticle(this)`;
343
350
  const dataBookmarked = `$functions.isBookmarked(${info.id})`;
344
351
  return /* @__PURE__ */ React.createElement(
345
352
  "button",
346
353
  {
347
354
  className,
348
355
  onClick: fnString,
349
- "data-article-id": info.id,
350
- "data-bookmarked": dataBookmarked
356
+ "data-bookmarked": dataBookmarked,
357
+ "data-bookmark-article-id": info.id,
358
+ "data-bookmark-article-name": info.name,
359
+ "data-bookmark-article-description": info.description,
360
+ "data-bookmark-article-imageSrc": info.imageSrc,
361
+ "data-bookmark-article-slug": info.slug,
362
+ "data-bookmark-article-metadataVideoPodcast": info.metadataVideoPodcast,
363
+ "data-bookmark-article-readTime": info.readTime,
364
+ "data-bookmark-article-publicationDate": info.publicationDate,
365
+ "data-bookmark-article-primaryCategoryId": info.primaryCategoryId,
366
+ "data-bookmark-article-primaryCategoryName": info.primaryCategoryName
351
367
  },
352
368
  ...children
353
369
  );
@@ -8,9 +8,15 @@ export declare const getArticleListDataSource: ({ properties, authorId, category
8
8
  offset: any;
9
9
  bookmarks: any;
10
10
  }) => {
11
- data: string;
12
11
  type: string;
13
- batchSize: number;
12
+ filter: {
13
+ AND: {
14
+ id: {
15
+ operation: string;
16
+ value: string;
17
+ };
18
+ }[];
19
+ };
14
20
  } | {
15
21
  type: string;
16
22
  filter: {
@@ -8,4 +8,6 @@ export interface IBookmarkInfo {
8
8
  readonly readTime?: string;
9
9
  readonly publicationDate: string;
10
10
  readonly id: string;
11
+ readonly primaryCategoryName?: string;
12
+ readonly primaryCategoryId?: string;
11
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "12.5.0",
3
+ "version": "12.6.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",