@wix/blog 1.0.703 → 1.0.705

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.
Files changed (37) hide show
  1. package/_sdk-exports/context-blog-feed/runtime.d.ts +2 -2
  2. package/_sdk-exports/context-post/runtime.d.ts +21 -7
  3. package/_sdk-exports/context-post-by-slug/runtime.js +3 -3
  4. package/_sdk-exports/{context-post-item → context-post-list-item}/runtime.d.ts +5 -5
  5. package/_sdk-exports/{context-post-item → context-post-list-item}/runtime.js +2 -2
  6. package/_sdk-exports/context-related-posts/runtime.js +2 -2
  7. package/build/cjs/context-blog-feed.d.ts +2 -2
  8. package/build/cjs/context-post-by-slug.js +18 -18
  9. package/build/cjs/context-post-by-slug.js.map +1 -1
  10. package/build/{internal/es/context-post-item.d.mts → cjs/context-post-list-item.d.ts} +5 -5
  11. package/build/cjs/{context-post-item.js → context-post-list-item.js} +9 -9
  12. package/build/cjs/context-post-list-item.js.map +1 -0
  13. package/build/cjs/context-post.d.ts +21 -7
  14. package/build/cjs/context-related-posts.js +10 -3
  15. package/build/cjs/context-related-posts.js.map +1 -1
  16. package/build/es/context-blog-feed.d.mts +2 -2
  17. package/build/es/context-post-by-slug.mjs +18 -18
  18. package/build/es/context-post-by-slug.mjs.map +1 -1
  19. package/build/es/{context-post-item.d.mts → context-post-list-item.d.mts} +5 -5
  20. package/build/es/{context-post-item.mjs → context-post-list-item.mjs} +4 -4
  21. package/build/es/context-post-list-item.mjs.map +1 -0
  22. package/build/es/context-post.d.mts +21 -7
  23. package/build/es/context-related-posts.mjs +10 -3
  24. package/build/es/context-related-posts.mjs.map +1 -1
  25. package/build/internal/cjs/context-blog-feed.d.ts +2 -2
  26. package/build/{cjs/context-post-item.d.ts → internal/cjs/context-post-list-item.d.ts} +5 -5
  27. package/build/internal/cjs/context-post.d.ts +21 -7
  28. package/build/internal/es/context-blog-feed.d.mts +2 -2
  29. package/build/internal/{cjs/context-post-item.d.ts → es/context-post-list-item.d.mts} +5 -5
  30. package/build/internal/es/context-post.d.mts +21 -7
  31. package/context/post-list-item/package.json +3 -0
  32. package/package.json +14 -14
  33. package/post-list-item-context-provider/package.json +3 -0
  34. package/build/cjs/context-post-item.js.map +0 -1
  35. package/build/es/context-post-item.mjs.map +0 -1
  36. package/context/post-item/package.json +0 -3
  37. package/post-item-context-provider/package.json +0 -3
@@ -144,7 +144,7 @@ interface LiveLikes {
144
144
  * @example Thank the site visitor after they like the post
145
145
  * ```tsx
146
146
  * import { useState } from 'react';
147
- * import { usePostByIdContext } from '@wix/blog/post-by-id-context-provider';
147
+ * import { usePostByIdContext } from '@wix/blog/context/post-by-id';
148
148
  *
149
149
  * function LikeButton() {
150
150
  * const { isEmpty, isLiked, liveLikes, toggleLike } = usePostByIdContext();
@@ -182,7 +182,7 @@ interface LiveLikes {
182
182
  * @example Show the like count as soon as it changes
183
183
  * ```tsx
184
184
  * import { useSyncExternalStore } from 'react';
185
- * import { usePostByIdContext } from '@wix/blog/post-by-id-context-provider';
185
+ * import { usePostByIdContext } from '@wix/blog/context/post-by-id';
186
186
  *
187
187
  * const noLikes = () => () => {};
188
188
  *
@@ -3236,6 +3236,8 @@ interface PostDerivedData {
3236
3236
  *
3237
3237
  * When the post is for paying subscribers only and the site visitor can't read all of it,
3238
3238
  * the body ends where the free part ends, followed by the post's paywall message.
3239
+ *
3240
+ * Empty in a repeater item of a post list, which doesn't load post bodies.
3239
3241
  */
3240
3242
  richContent: RichContent;
3241
3243
  /** The display name of the post's author, as rich text. */
@@ -3271,14 +3273,21 @@ interface PostDerivedData {
3271
3273
  * unlike from `toggleLike()`. Empty when there's no count to show.
3272
3274
  */
3273
3275
  likeCount: RichText;
3274
- /** The categories the post belongs to, in the post's order. Empty when it has none. */
3276
+ /**
3277
+ * The categories the post belongs to, in the post's order. Empty when it has none.
3278
+ *
3279
+ * In a repeater item of a post list, only the post's main category, without a link.
3280
+ */
3275
3281
  postCategories: PostCategoryItem[];
3276
3282
  /**
3277
3283
  * The name of the post's main category, its first one, as rich text. Empty when the post has
3278
3284
  * no category.
3279
3285
  */
3280
3286
  itemCategoryLabel: RichText;
3281
- /** The post's tags, in the post's order. Empty when it has none. */
3287
+ /**
3288
+ * The post's tags, in the post's order. Empty when it has none, and in a repeater item of a
3289
+ * post list, which doesn't load tags.
3290
+ */
3282
3291
  postTags: PostTagItem[];
3283
3292
  /**
3284
3293
  * Whether the post shows a cover image, or a video cover with a poster image. `false` when
@@ -3291,7 +3300,10 @@ interface PostDerivedData {
3291
3300
  * post.
3292
3301
  */
3293
3302
  hasExcerpt: boolean;
3294
- /** Whether the post has at least one tag. `true` in the editor when there's no post. */
3303
+ /**
3304
+ * Whether the post has at least one tag. `true` in the editor when there's no post. `false`
3305
+ * in a repeater item of a post list, like `postTags`.
3306
+ */
3295
3307
  hasTags: boolean;
3296
3308
  /**
3297
3309
  * The date and time the post was first published, as an ISO 8601 string. `undefined` when
@@ -3340,7 +3352,7 @@ type PostContextType = PostDerivedData & {
3340
3352
  *
3341
3353
  * @example Show the like count once it's final
3342
3354
  * ```tsx
3343
- * import { usePostByIdContext } from '@wix/blog/post-by-id-context-provider';
3355
+ * import { usePostByIdContext } from '@wix/blog/context/post-by-id';
3344
3356
  *
3345
3357
  * function LikeCount() {
3346
3358
  * const { isEmpty, likeCountValue, isLikeCountLoaded } = usePostByIdContext();
@@ -3374,7 +3386,7 @@ type PostContextType = PostDerivedData & {
3374
3386
  *
3375
3387
  * @example Add a like button
3376
3388
  * ```tsx
3377
- * import { usePostByIdContext } from '@wix/blog/post-by-id-context-provider';
3389
+ * import { usePostByIdContext } from '@wix/blog/context/post-by-id';
3378
3390
  *
3379
3391
  * function LikeButton() {
3380
3392
  * const { isEmpty, isLiked, toggleLike } = usePostByIdContext();
@@ -3423,6 +3435,8 @@ type PostContextType = PostDerivedData & {
3423
3435
  * IDs used to pick the posts related to this post: the post's own ID, its category IDs,
3424
3436
  * and the related posts its author chose. The object stays the same when
3425
3437
  * the like state changes, so you can use it as an effect dependency.
3438
+ *
3439
+ * In a repeater item of a post list, only the post's ID.
3426
3440
  */
3427
3441
  relatedPostsSource: RelatedPostsSource;
3428
3442
  /**
@@ -1108,11 +1108,18 @@ var sr = (e6, t2) => {
1108
1108
  } catch {
1109
1109
  return;
1110
1110
  }
1111
- let r2 = t2?.split(`/`).filter(Boolean) ?? [];
1111
+ let r2 = t2?.split(`/`).filter(Boolean) ?? [], i2 = n2[n2.length - 1];
1112
1112
  if (r2.length > 0) {
1113
- for (let e7 = 0; e7 + r2.length <= n2.length; e7++) if (r2.every((t3, r3) => n2[e7 + r3] === t3)) return n2[e7 + r2.length];
1113
+ for (let e7 = 0; e7 + r2.length <= n2.length; e7++) if (r2.every((t3, r3) => n2[e7 + r3] === t3)) {
1114
+ i2 = n2[e7 + r2.length];
1115
+ break;
1116
+ }
1117
+ }
1118
+ if (i2 !== void 0) try {
1119
+ return decodeURIComponent(i2);
1120
+ } catch {
1121
+ return i2;
1114
1122
  }
1115
- return n2[n2.length - 1];
1116
1123
  };
1117
1124
  var cr = () => {
1118
1125
  let e6;