@wix/blog 1.0.714 → 1.0.716
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/_sdk-exports/context-blog-feed/runtime.d.ts +7 -0
- package/_sdk-exports/context-blog-feed/runtime.js +3 -3
- package/_sdk-exports/context-post-by-id/runtime.js +4 -4
- package/_sdk-exports/context-post-by-slug/runtime.js +3 -3
- package/_sdk-exports/context-post-list-item/runtime.d.ts +8 -3
- package/_sdk-exports/context-post-list-item/runtime.js +4 -4
- package/_sdk-exports/context-related-posts/runtime.d.ts +7 -0
- package/_sdk-exports/context-related-posts/runtime.js +3 -3
- package/build/cjs/context-blog-feed.d.ts +7 -0
- package/build/cjs/context-blog-feed.js +5 -6
- package/build/cjs/context-blog-feed.js.map +1 -1
- package/build/cjs/context-post-by-id.js +916 -894
- package/build/cjs/context-post-by-id.js.map +1 -1
- package/build/cjs/context-post-by-slug.js +146 -124
- package/build/cjs/context-post-by-slug.js.map +1 -1
- package/build/cjs/context-post-list-item.d.ts +8 -3
- package/build/cjs/context-post-list-item.js +896 -873
- package/build/cjs/context-post-list-item.js.map +1 -1
- package/build/cjs/context-related-posts.d.ts +7 -0
- package/build/cjs/context-related-posts.js +5 -6
- package/build/cjs/context-related-posts.js.map +1 -1
- package/build/es/context-blog-feed.d.mts +7 -0
- package/build/es/context-blog-feed.mjs +5 -6
- package/build/es/context-blog-feed.mjs.map +1 -1
- package/build/es/context-post-by-id.mjs +916 -894
- package/build/es/context-post-by-id.mjs.map +1 -1
- package/build/es/context-post-by-slug.mjs +146 -124
- package/build/es/context-post-by-slug.mjs.map +1 -1
- package/build/es/context-post-list-item.d.mts +8 -3
- package/build/es/context-post-list-item.mjs +896 -873
- package/build/es/context-post-list-item.mjs.map +1 -1
- package/build/es/context-related-posts.d.mts +7 -0
- package/build/es/context-related-posts.mjs +5 -6
- package/build/es/context-related-posts.mjs.map +1 -1
- package/build/internal/cjs/context-blog-feed.d.ts +7 -0
- package/build/internal/cjs/context-post-list-item.d.ts +8 -3
- package/build/internal/cjs/context-related-posts.d.ts +7 -0
- package/build/internal/es/context-blog-feed.d.mts +7 -0
- package/build/internal/es/context-post-list-item.d.mts +8 -3
- package/build/internal/es/context-related-posts.d.mts +7 -0
- package/package.json +2 -2
|
@@ -403,6 +403,13 @@ interface PostListItem {
|
|
|
403
403
|
* a sample number instead.
|
|
404
404
|
*/
|
|
405
405
|
initialCommentCount: number | undefined;
|
|
406
|
+
/**
|
|
407
|
+
* Number of likes on the post, as loaded with the post.
|
|
408
|
+
*
|
|
409
|
+
* `undefined` when the count wasn't loaded with the post. In the editor, but not in Preview,
|
|
410
|
+
* a sample number instead.
|
|
411
|
+
*/
|
|
412
|
+
initialLikeCount: number | undefined;
|
|
406
413
|
/** Name of the post's author, as rich text. Empty when the author isn't found. */
|
|
407
414
|
authorName: RichText;
|
|
408
415
|
/**
|
|
@@ -1114,8 +1114,7 @@ var sr = (e6) => {
|
|
|
1114
1114
|
let t2;
|
|
1115
1115
|
try {
|
|
1116
1116
|
let n3 = e6.appSectionRelativeUrl(ir, ar);
|
|
1117
|
-
if (n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`, or) && !n3?.endsWith(`/post-page`)) return;
|
|
1118
|
-
t2 = e6.appSectionRelativeUrl(ir, ar, true);
|
|
1117
|
+
if (t2 = e6.appSectionRelativeUrl(ir, ar, true), n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`, or) && !n3?.endsWith(`/post-page`) && t2 === n3) return;
|
|
1119
1118
|
} catch {
|
|
1120
1119
|
return;
|
|
1121
1120
|
}
|
|
@@ -4576,10 +4575,10 @@ var zu = (e6) => {
|
|
|
4576
4575
|
var Bu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
|
|
4577
4576
|
var Vu = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
4578
4577
|
var Q = (e6) => ({ text: e6, html: `<p>${Vu(e6)}</p>`, linkList: [] });
|
|
4579
|
-
var $ = { minutesToRead: 5, views: 120, comments: 4 };
|
|
4578
|
+
var $ = { minutesToRead: 5, views: 120, comments: 4, likes: 12 };
|
|
4580
4579
|
var Hu = (e6) => {
|
|
4581
4580
|
let { metrics: t2 } = e6;
|
|
4582
|
-
return { views: typeof t2?.views == `number` ? t2.views : void 0, comments: typeof t2?.comments == `number` ? t2.comments : void 0 };
|
|
4581
|
+
return { views: typeof t2?.views == `number` ? t2.views : void 0, comments: typeof t2?.comments == `number` ? t2.comments : void 0, likes: typeof t2?.likes == `number` ? t2.likes : void 0 };
|
|
4583
4582
|
};
|
|
4584
4583
|
var Uu = (e6, t2, n2, r2) => Q(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
|
|
4585
4584
|
var Wu = (e6, t2, n2, r2) => {
|
|
@@ -4588,7 +4587,7 @@ var Wu = (e6, t2, n2, r2) => {
|
|
|
4588
4587
|
};
|
|
4589
4588
|
var Gu = (e6, t2, n2, r2, i2 = {}, a2 = {}, o2 = false, s2 = {}, c2 = Date.now()) => {
|
|
4590
4589
|
let { _id: l2, memberId: u2 } = e6, d2 = u2 ? i2[u2] : void 0, f2 = Hu(e6);
|
|
4591
|
-
return { _id: l2 ?? e6.slug ?? ``, title: e6.title ?? ``, itemTitle: Q(e6.title ?? ``), itemExcerpt: Q(e6.excerpt ?? ``), itemCoverImage: Fu(e6), itemCoverMedia: Pu(e6, s2[l2 ?? ``] ?? []), itemLink: pr(e6, r2), itemPublishedDate: Q(Tu(e6.firstPublishedDate ?? new Date(c2), n2, c2)), publishedDateValue: zu(e6.firstPublishedDate), clockValue: c2, minutesToReadValue: Bu(e6.minutesToRead), initialViewCount: f2.views ?? (o2 ? $.views : void 0), initialCommentCount: f2.comments ?? (o2 ? $.comments : void 0), authorName: Q(d2?.profile?.nickname ?? ``), authorImage: gr(d2, t2.canvas.authorPhotoAlt()), timeToRead: Q(typeof e6.minutesToRead == `number` && e6.minutesToRead > 0 ? t2.timeToRead(e6.minutesToRead) : ``), viewCount: Uu(f2.views, $.views, o2, t2.viewCount), commentCount: Uu(f2.comments, $.comments, o2, t2.commentCount), itemCategoryLabel: Wu(e6, a2, o2, t2), recentPostItem: { title: e6.title ?? ``, slug: e6.slug ?? `` }, commentingEnabled: e6.commentingEnabled };
|
|
4590
|
+
return { _id: l2 ?? e6.slug ?? ``, title: e6.title ?? ``, itemTitle: Q(e6.title ?? ``), itemExcerpt: Q(e6.excerpt ?? ``), itemCoverImage: Fu(e6), itemCoverMedia: Pu(e6, s2[l2 ?? ``] ?? []), itemLink: pr(e6, r2), itemPublishedDate: Q(Tu(e6.firstPublishedDate ?? new Date(c2), n2, c2)), publishedDateValue: zu(e6.firstPublishedDate), clockValue: c2, minutesToReadValue: Bu(e6.minutesToRead), initialViewCount: f2.views ?? (o2 ? $.views : void 0), initialCommentCount: f2.comments ?? (o2 ? $.comments : void 0), initialLikeCount: f2.likes ?? (o2 ? $.likes : void 0), authorName: Q(d2?.profile?.nickname ?? ``), authorImage: gr(d2, t2.canvas.authorPhotoAlt()), timeToRead: Q(typeof e6.minutesToRead == `number` && e6.minutesToRead > 0 ? t2.timeToRead(e6.minutesToRead) : ``), viewCount: Uu(f2.views, $.views, o2, t2.viewCount), commentCount: Uu(f2.comments, $.comments, o2, t2.commentCount), itemCategoryLabel: Wu(e6, a2, o2, t2), recentPostItem: { title: e6.title ?? ``, slug: e6.slug ?? `` }, commentingEnabled: e6.commentingEnabled };
|
|
4592
4591
|
};
|
|
4593
4592
|
var Ku = (e6, t2, n2 = []) => {
|
|
4594
4593
|
let r2 = Pu(e6, n2);
|
|
@@ -4617,7 +4616,7 @@ var Zu = (e6) => Array.from({ length: qu }, (t2, n2) => {
|
|
|
4617
4616
|
});
|
|
4618
4617
|
var Qu = (e6, t2, n2, r2 = Date.now()) => Array.from({ length: qu }, (i2, a2) => {
|
|
4619
4618
|
let o2 = e6.canvas.postTitle(), s2 = Yu(a2, e6.canvas.coverAlt());
|
|
4620
|
-
return { _id: `placeholder-${a2}`, title: o2, itemTitle: Q(o2), itemExcerpt: Q(e6.canvas.excerpt()), itemCoverImage: s2, itemCoverMedia: { kind: `image`, image: s2 }, itemLink: Lu(n2), itemPublishedDate: Q(Tu(new Date(r2), t2, r2)), publishedDateValue: Iu, clockValue: r2, minutesToReadValue: $.minutesToRead, initialViewCount: $.views, initialCommentCount: $.comments, authorName: Q(e6.canvas.authorName()), authorImage: Xu(a2, e6.canvas.authorPhotoAlt()), timeToRead: Q(e6.timeToRead($.minutesToRead)), viewCount: Q(e6.viewCount($.views)), commentCount: Q(e6.commentCount($.comments)), itemCategoryLabel: Q(e6.canvas.category()), recentPostItem: { title: o2, slug: `` }, commentingEnabled: void 0 };
|
|
4619
|
+
return { _id: `placeholder-${a2}`, title: o2, itemTitle: Q(o2), itemExcerpt: Q(e6.canvas.excerpt()), itemCoverImage: s2, itemCoverMedia: { kind: `image`, image: s2 }, itemLink: Lu(n2), itemPublishedDate: Q(Tu(new Date(r2), t2, r2)), publishedDateValue: Iu, clockValue: r2, minutesToReadValue: $.minutesToRead, initialViewCount: $.views, initialCommentCount: $.comments, initialLikeCount: $.likes, authorName: Q(e6.canvas.authorName()), authorImage: Xu(a2, e6.canvas.authorPhotoAlt()), timeToRead: Q(e6.timeToRead($.minutesToRead)), viewCount: Q(e6.viewCount($.views)), commentCount: Q(e6.commentCount($.comments)), itemCategoryLabel: Q(e6.canvas.category()), recentPostItem: { title: o2, slug: `` }, commentingEnabled: void 0 };
|
|
4621
4620
|
});
|
|
4622
4621
|
var $u = (0, import_react.createContext)(void 0);
|
|
4623
4622
|
function ed() {
|