@wix/blog 1.0.710 → 1.0.712
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-category-item/runtime.d.ts +6 -2
- package/_sdk-exports/context-post/runtime.d.ts +9 -1
- package/_sdk-exports/context-post-by-id/runtime.d.ts +8 -1
- package/_sdk-exports/context-post-by-id/runtime.js +2 -2
- package/_sdk-exports/context-post-by-slug/runtime.d.ts +7 -1
- package/_sdk-exports/context-post-by-slug/runtime.js +2 -2
- package/_sdk-exports/context-post-list-item/runtime.d.ts +6 -2
- package/_sdk-exports/context-tag-item/runtime.d.ts +5 -2
- package/build/cjs/context-category-item.d.ts +6 -2
- package/build/cjs/context-post-by-id.d.ts +9 -2
- package/build/cjs/context-post-by-id.js +15 -12
- package/build/cjs/context-post-by-id.js.map +1 -1
- package/build/cjs/context-post-by-slug.d.ts +8 -2
- package/build/cjs/context-post-by-slug.js +15 -12
- package/build/cjs/context-post-by-slug.js.map +1 -1
- package/build/cjs/context-post-list-item.d.ts +6 -2
- package/build/cjs/context-post.d.ts +9 -1
- package/build/cjs/context-tag-item.d.ts +5 -2
- package/build/es/context-category-item.d.mts +6 -2
- package/build/es/context-post-by-id.d.mts +9 -2
- package/build/es/context-post-by-id.mjs +15 -12
- package/build/es/context-post-by-id.mjs.map +1 -1
- package/build/es/context-post-by-slug.d.mts +8 -2
- package/build/es/context-post-by-slug.mjs +15 -12
- package/build/es/context-post-by-slug.mjs.map +1 -1
- package/build/es/context-post-list-item.d.mts +6 -2
- package/build/es/context-post.d.mts +9 -1
- package/build/es/context-tag-item.d.mts +5 -2
- package/build/internal/cjs/context-category-item.d.ts +6 -2
- package/build/internal/cjs/context-post-by-id.d.ts +9 -2
- package/build/internal/cjs/context-post-by-slug.d.ts +8 -2
- package/build/internal/cjs/context-post-list-item.d.ts +6 -2
- package/build/internal/cjs/context-post.d.ts +9 -1
- package/build/internal/cjs/context-tag-item.d.ts +5 -2
- package/build/internal/es/context-category-item.d.mts +6 -2
- package/build/internal/es/context-post-by-id.d.mts +9 -2
- package/build/internal/es/context-post-by-slug.d.mts +8 -2
- package/build/internal/es/context-post-list-item.d.mts +6 -2
- package/build/internal/es/context-post.d.mts +9 -1
- package/build/internal/es/context-tag-item.d.mts +5 -2
- package/package.json +4 -4
|
@@ -484,8 +484,12 @@ type PostItemContextType = PostListItem & Omit<PostLikes, 'likeCount' | 'viewCou
|
|
|
484
484
|
commentCount: RichText;
|
|
485
485
|
};
|
|
486
486
|
/**
|
|
487
|
-
*
|
|
488
|
-
*
|
|
487
|
+
* The Post List Item context provides access to the post in one item of a repeater connected to
|
|
488
|
+
* the **Posts** list in the Posts Data Source or the **Related Posts** list in the Related Posts
|
|
489
|
+
* Data Source. Use it to show the post's title, excerpt, cover, author, publish date, and counts,
|
|
490
|
+
* and to let a site visitor like the post.
|
|
491
|
+
*
|
|
492
|
+
* Returns `null` outside such a repeater item, and in the editor before the item holds a post.
|
|
489
493
|
*/
|
|
490
494
|
declare function usePostListItemContext(): PostItemContextType | null;
|
|
491
495
|
/** Props accepted by {@link PostItemContextProvider}. */
|
|
@@ -3501,7 +3501,15 @@ type PostContextType = PostDerivedData & {
|
|
|
3501
3501
|
*/
|
|
3502
3502
|
isEmpty: boolean;
|
|
3503
3503
|
};
|
|
3504
|
-
/**
|
|
3504
|
+
/**
|
|
3505
|
+
* The Post context provides access to a blog post: the post on a blog post page, the one a Wix
|
|
3506
|
+
* user chooses in the Selected Post Data Source, or the one in a repeater item of a post list.
|
|
3507
|
+
* Use it to show the post's content, author, publish date, counts, categories, and tags, and to
|
|
3508
|
+
* let a site visitor like the post.
|
|
3509
|
+
*
|
|
3510
|
+
* When the component is in more than one of these, such as a repeater item on a blog post page,
|
|
3511
|
+
* it returns the post of the innermost one. Anywhere else, it throws an error.
|
|
3512
|
+
*/
|
|
3505
3513
|
declare function usePostContext(): PostContextType;
|
|
3506
3514
|
/** Props accepted by {@link PostProvider}. */
|
|
3507
3515
|
interface PostProviderProps {
|
|
@@ -163,8 +163,11 @@ interface PostTagItem {
|
|
|
163
163
|
*/
|
|
164
164
|
type TagItemContextType = PostTagItem;
|
|
165
165
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
166
|
+
* The Tag Item context provides access to one of a blog post's tags, in an item of a repeater
|
|
167
|
+
* connected to the post's **Post Tags** list. Use it to show the tag's name and link to the blog
|
|
168
|
+
* page that lists its posts.
|
|
169
|
+
*
|
|
170
|
+
* Returns `null` outside such a repeater item, and in the editor before the item holds a tag.
|
|
168
171
|
*/
|
|
169
172
|
declare function useTagItemContext(): TagItemContextType | null;
|
|
170
173
|
/** Props accepted by {@link TagItemContextProvider}. */
|
|
@@ -165,8 +165,12 @@ interface PostCategoryItem {
|
|
|
165
165
|
*/
|
|
166
166
|
type CategoryItemContextType = PostCategoryItem;
|
|
167
167
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
168
|
+
* The Category Item context provides access to one of a blog post's categories, in an item of a
|
|
169
|
+
* repeater connected to the post's **Post Categories** list. Use it to show the category's name
|
|
170
|
+
* and link to the blog page that lists its posts.
|
|
171
|
+
*
|
|
172
|
+
* Returns `null` outside such a repeater item, and in the editor before the item holds a
|
|
173
|
+
* category.
|
|
170
174
|
*/
|
|
171
175
|
declare function useCategoryItemContext(): CategoryItemContextType | null;
|
|
172
176
|
/** Props accepted by {@link CategoryItemContextProvider}. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { PostContextType } from '@wix/blog/post-context-provider';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
export { usePostContext as usePostByIdContext } from '@wix/blog/post-context-provider';
|
|
3
3
|
|
|
4
4
|
//#region src/lib/category-picker.d.ts
|
|
5
5
|
/** A WQL clause the filter picker stores for one inline field. */
|
|
@@ -16,6 +16,13 @@ interface PostPickerFilter {
|
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/extensions/post-by-id-context-provider/post-by-id-context-provider.d.ts
|
|
19
|
+
/**
|
|
20
|
+
* The Post by ID context provides access to a blog post: the one a Wix user chooses in the
|
|
21
|
+
* Selected Post Data Source, the one on a blog post page, or the one in a repeater item of a post
|
|
22
|
+
* list. Use it to show the post's content, author, publish date, counts, categories, and tags,
|
|
23
|
+
* and to let a site visitor like the post.
|
|
24
|
+
*/
|
|
25
|
+
declare function usePostByIdContext(): PostContextType;
|
|
19
26
|
/** Props accepted by {@link PostByIdProvider}. */
|
|
20
27
|
interface PostByIdProviderProps {
|
|
21
28
|
children?: React.ReactNode;
|
|
@@ -28,4 +35,4 @@ declare function PostByIdProvider({
|
|
|
28
35
|
postPicker
|
|
29
36
|
}: PostByIdProviderProps): React.ReactNode;
|
|
30
37
|
|
|
31
|
-
export { PostByIdProvider, type PostByIdProviderProps, PostByIdProvider as default };
|
|
38
|
+
export { PostByIdProvider, type PostByIdProviderProps, PostByIdProvider as default, usePostByIdContext };
|
|
@@ -4569,24 +4569,27 @@ var cd = (e6) => {
|
|
|
4569
4569
|
var ld = { ...rd(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4570
4570
|
}, liveLikes: void 0, postUrl: void 0, itemLink: void 0, clockValue: 0, relatedPostsSource: { currentPostId: void 0, categoryIds: void 0, relatedPostIds: void 0 }, commentingEnabled: void 0, isLoadingPost: true, hasError: false, isEmpty: false };
|
|
4571
4571
|
var ud = { ...ld, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4572
|
+
function dd() {
|
|
4573
|
+
return t();
|
|
4574
|
+
}
|
|
4575
|
+
var fd = 2500;
|
|
4576
|
+
var pd = Promise.resolve(od({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
|
|
4577
|
+
var md = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
|
|
4575
4578
|
let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, s(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = ad({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: dr() });
|
|
4576
4579
|
return mr(fr.postByIdProvider, o2 ? `error` : c2.post ? `data` : `empty`), h(e, { value: l2, children: t2 });
|
|
4577
4580
|
};
|
|
4578
|
-
function
|
|
4581
|
+
function hd({ children: t2, postPicker: n2 }) {
|
|
4579
4582
|
let i2 = zl(n2), a2 = Gn(), o2 = gr(), s2 = u(() => jl(zn), []), { i18n: c2, locale: l2 } = Go($o), d2 = qn(() => i2 ? Un(Mo({ key: `blog-builder:post-by-id:${i2}`, warmupData: o2, fetchData: () => {
|
|
4580
4583
|
let e6 = Dl(i2, a2);
|
|
4581
|
-
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6,
|
|
4582
|
-
} }), od, a2 ? cd : sd) :
|
|
4583
|
-
return h(bo, { i18n: c2, children: g(r, { fallback: h(e, { value: ld, children: t2 }), children: [h(Wo, { i18n: c2, locale: l2 }), h(Fl, { fallback: h(e, { value: ud, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: h(
|
|
4584
|
+
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, fd, `post-by-id`) : e6));
|
|
4585
|
+
} }), od, a2 ? cd : sd) : pd, [i2, a2, o2, s2]);
|
|
4586
|
+
return h(bo, { i18n: c2, children: g(r, { fallback: h(e, { value: ld, children: t2 }), children: [h(Wo, { i18n: c2, locale: l2 }), h(Fl, { fallback: h(e, { value: ud, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: h(md, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
|
|
4584
4587
|
}
|
|
4585
|
-
var
|
|
4588
|
+
var gd = Mn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
|
|
4586
4589
|
export {
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4590
|
+
hd as PostByIdProvider,
|
|
4591
|
+
hd as default,
|
|
4592
|
+
gd as injectAccessTokenGetter,
|
|
4593
|
+
dd as usePostByIdContext
|
|
4591
4594
|
};
|
|
4592
4595
|
//# sourceMappingURL=context-post-by-id.mjs.map
|