@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
@@ -569,7 +569,7 @@ interface PostListContextType {
569
569
  *
570
570
  * @example Add a button that loads more posts
571
571
  * ```tsx
572
- * import { useBlogFeedContext } from '@wix/blog/blog-feed-context-provider';
572
+ * import { useBlogFeedContext } from '@wix/blog/context/blog-feed';
573
573
  *
574
574
  * function LoadMoreButton() {
575
575
  * const { hasMorePosts, isLoadingPosts, loadMorePosts } = useBlogFeedContext();
@@ -596,7 +596,7 @@ interface PostListContextType {
596
596
  *
597
597
  * @example Show the category's or tag's name above the posts
598
598
  * ```tsx
599
- * import { useBlogFeedContext } from '@wix/blog/blog-feed-context-provider';
599
+ * import { useBlogFeedContext } from '@wix/blog/context/blog-feed';
600
600
  *
601
601
  * function FeedHeading() {
602
602
  * const { filteredView } = useBlogFeedContext();
@@ -406,7 +406,7 @@ interface LiveLikes {
406
406
  * @example Thank the site visitor after they like the post
407
407
  * ```tsx
408
408
  * import { useState } from 'react';
409
- * import { usePostByIdContext } from '@wix/blog/post-by-id-context-provider';
409
+ * import { usePostByIdContext } from '@wix/blog/context/post-by-id';
410
410
  *
411
411
  * function LikeButton() {
412
412
  * const { isEmpty, isLiked, liveLikes, toggleLike } = usePostByIdContext();
@@ -444,7 +444,7 @@ interface LiveLikes {
444
444
  * @example Show the like count as soon as it changes
445
445
  * ```tsx
446
446
  * import { useSyncExternalStore } from 'react';
447
- * import { usePostByIdContext } from '@wix/blog/post-by-id-context-provider';
447
+ * import { usePostByIdContext } from '@wix/blog/context/post-by-id';
448
448
  *
449
449
  * const noLikes = () => () => {};
450
450
  *
@@ -464,7 +464,7 @@ interface LiveLikes {
464
464
  subscribe(listener: () => void): () => void;
465
465
  }
466
466
  //#endregion
467
- //#region src/extensions/post-item-context-provider/post-item-context-provider.d.ts
467
+ //#region src/extensions/post-list-item-context-provider/post-list-item-context-provider.d.ts
468
468
  /**
469
469
  * The cell's raw item plus its like state, for the Blog widgets that read a cell directly
470
470
  * (Comments, Cover Media). Elements bind the Post context this provider publishes, never this.
@@ -487,7 +487,7 @@ type PostItemContextType = PostListItem & Omit<PostLikes, 'likeCount' | 'viewCou
487
487
  * Nullable rather than throwing: the hook runs for every element inside the repeater
488
488
  * cell, including on the editor stage before the cell is populated.
489
489
  */
490
- declare function usePostItemContext(): PostItemContextType | null;
490
+ declare function usePostListItemContext(): PostItemContextType | null;
491
491
  /** Props accepted by {@link PostItemContextProvider}. */
492
492
  interface PostItemContextProviderProps extends React.PropsWithChildren {
493
493
  /**
@@ -505,4 +505,4 @@ declare function PostItemContextProvider({
505
505
  children
506
506
  }: PostItemContextProviderProps): React.ReactNode;
507
507
 
508
- export { PostItemContextProvider, type PostItemContextProviderProps, type PostItemContextType, type PostListItem, PostItemContextProvider as default, usePostItemContext };
508
+ export { PostItemContextProvider, type PostItemContextProviderProps, type PostItemContextType, type PostListItem, PostItemContextProvider as default, usePostListItemContext };
@@ -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
  /**
@@ -569,7 +569,7 @@ interface PostListContextType {
569
569
  *
570
570
  * @example Add a button that loads more posts
571
571
  * ```tsx
572
- * import { useBlogFeedContext } from '@wix/blog/blog-feed-context-provider';
572
+ * import { useBlogFeedContext } from '@wix/blog/context/blog-feed';
573
573
  *
574
574
  * function LoadMoreButton() {
575
575
  * const { hasMorePosts, isLoadingPosts, loadMorePosts } = useBlogFeedContext();
@@ -596,7 +596,7 @@ interface PostListContextType {
596
596
  *
597
597
  * @example Show the category's or tag's name above the posts
598
598
  * ```tsx
599
- * import { useBlogFeedContext } from '@wix/blog/blog-feed-context-provider';
599
+ * import { useBlogFeedContext } from '@wix/blog/context/blog-feed';
600
600
  *
601
601
  * function FeedHeading() {
602
602
  * const { filteredView } = useBlogFeedContext();
@@ -406,7 +406,7 @@ interface LiveLikes {
406
406
  * @example Thank the site visitor after they like the post
407
407
  * ```tsx
408
408
  * import { useState } from 'react';
409
- * import { usePostByIdContext } from '@wix/blog/post-by-id-context-provider';
409
+ * import { usePostByIdContext } from '@wix/blog/context/post-by-id';
410
410
  *
411
411
  * function LikeButton() {
412
412
  * const { isEmpty, isLiked, liveLikes, toggleLike } = usePostByIdContext();
@@ -444,7 +444,7 @@ interface LiveLikes {
444
444
  * @example Show the like count as soon as it changes
445
445
  * ```tsx
446
446
  * import { useSyncExternalStore } from 'react';
447
- * import { usePostByIdContext } from '@wix/blog/post-by-id-context-provider';
447
+ * import { usePostByIdContext } from '@wix/blog/context/post-by-id';
448
448
  *
449
449
  * const noLikes = () => () => {};
450
450
  *
@@ -464,7 +464,7 @@ interface LiveLikes {
464
464
  subscribe(listener: () => void): () => void;
465
465
  }
466
466
  //#endregion
467
- //#region src/extensions/post-item-context-provider/post-item-context-provider.d.ts
467
+ //#region src/extensions/post-list-item-context-provider/post-list-item-context-provider.d.ts
468
468
  /**
469
469
  * The cell's raw item plus its like state, for the Blog widgets that read a cell directly
470
470
  * (Comments, Cover Media). Elements bind the Post context this provider publishes, never this.
@@ -487,7 +487,7 @@ type PostItemContextType = PostListItem & Omit<PostLikes, 'likeCount' | 'viewCou
487
487
  * Nullable rather than throwing: the hook runs for every element inside the repeater
488
488
  * cell, including on the editor stage before the cell is populated.
489
489
  */
490
- declare function usePostItemContext(): PostItemContextType | null;
490
+ declare function usePostListItemContext(): PostItemContextType | null;
491
491
  /** Props accepted by {@link PostItemContextProvider}. */
492
492
  interface PostItemContextProviderProps extends React.PropsWithChildren {
493
493
  /**
@@ -505,4 +505,4 @@ declare function PostItemContextProvider({
505
505
  children
506
506
  }: PostItemContextProviderProps): React.ReactNode;
507
507
 
508
- export { PostItemContextProvider, type PostItemContextProviderProps, type PostItemContextType, type PostListItem, PostItemContextProvider as default, usePostItemContext };
508
+ export { PostItemContextProvider, type PostItemContextProviderProps, type PostItemContextType, type PostListItem, PostItemContextProvider as default, usePostListItemContext };
@@ -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
  /**
@@ -0,0 +1,3 @@
1
+ {
2
+ "main": "../../build/cjs/context-post-list-item.js"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/blog",
3
- "version": "1.0.703",
3
+ "version": "1.0.705",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -63,6 +63,16 @@
63
63
  "require": "./build/cjs/context-post.js",
64
64
  "types": "./build/es/context-post.d.mts"
65
65
  },
66
+ "./context/post-list-item": {
67
+ "import": "./build/es/context-post-list-item.mjs",
68
+ "require": "./build/cjs/context-post-list-item.js",
69
+ "types": "./build/es/context-post-list-item.d.mts"
70
+ },
71
+ "./post-list-item-context-provider": {
72
+ "import": "./build/es/context-post-list-item.mjs",
73
+ "require": "./build/cjs/context-post-list-item.js",
74
+ "types": "./build/es/context-post-list-item.d.mts"
75
+ },
66
76
  "./components": {
67
77
  "import": "./build/es/components.mjs",
68
78
  "require": "./build/cjs/components.js",
@@ -103,16 +113,6 @@
103
113
  "require": "./build/cjs/context-related-posts.js",
104
114
  "types": "./build/es/context-related-posts.d.mts"
105
115
  },
106
- "./context/post-item": {
107
- "import": "./build/es/context-post-item.mjs",
108
- "require": "./build/cjs/context-post-item.js",
109
- "types": "./build/es/context-post-item.d.mts"
110
- },
111
- "./post-item-context-provider": {
112
- "import": "./build/es/context-post-item.mjs",
113
- "require": "./build/cjs/context-post-item.js",
114
- "types": "./build/es/context-post-item.d.mts"
115
- },
116
116
  "./context/post-by-id": {
117
117
  "import": "./build/es/context-post-by-id.mjs",
118
118
  "require": "./build/cjs/context-post-by-id.js",
@@ -136,6 +136,8 @@
136
136
  "category-item-context-provider",
137
137
  "context/post",
138
138
  "post-context-provider",
139
+ "context/post-list-item",
140
+ "post-list-item-context-provider",
139
141
  "components",
140
142
  "context/post-by-slug",
141
143
  "post-by-slug-context-provider",
@@ -144,8 +146,6 @@
144
146
  "services",
145
147
  "context/related-posts",
146
148
  "related-posts-context-provider",
147
- "context/post-item",
148
- "post-item-context-provider",
149
149
  "context/post-by-id",
150
150
  "post-by-id-context-provider"
151
151
  ],
@@ -193,5 +193,5 @@
193
193
  "optional": true
194
194
  }
195
195
  },
196
- "falconPackageHash": "ab3776c14957b29da5c64b91bad435ddd74e3c7fa72f1b4b494ce288"
196
+ "falconPackageHash": "b93d2458dd4f80bf67d0b87a792050fb3ae57461608b8adb6208e947"
197
197
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "main": "../build/cjs/context-post-list-item.js"
3
+ }