@wix/blog 1.0.711 → 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 +2 -2
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { PostContextType } from '@wix/blog/post-context-provider';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
export { usePostContext as usePostBySlugContext } from '@wix/blog/post-context-provider';
|
|
3
3
|
|
|
4
4
|
//#region src/extensions/post-by-slug-context-provider/post-by-slug-context-provider.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Post Page context provides access to the blog post the page's URL names. Use it to show
|
|
7
|
+
* the post's content, author, publish date, counts, categories, and tags, and to let a site
|
|
8
|
+
* visitor like the post.
|
|
9
|
+
*/
|
|
10
|
+
declare function usePostBySlugContext(): PostContextType;
|
|
5
11
|
/** Props accepted by {@link PostBySlugProvider}. */
|
|
6
12
|
interface PostBySlugProviderProps {
|
|
7
13
|
children?: React.ReactNode;
|
|
@@ -15,4 +21,4 @@ declare function PostBySlugProvider({
|
|
|
15
21
|
children
|
|
16
22
|
}: PostBySlugProviderProps): React.ReactNode;
|
|
17
23
|
|
|
18
|
-
export { PostBySlugProvider, type PostBySlugProviderProps, PostBySlugProvider as default };
|
|
24
|
+
export { PostBySlugProvider, type PostBySlugProviderProps, PostBySlugProvider as default, usePostBySlugContext };
|
|
@@ -4907,32 +4907,35 @@ var Af = (e6) => {
|
|
|
4907
4907
|
var jf = { ...Tf(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4908
4908
|
}, 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 };
|
|
4909
4909
|
var Mf = { ...jf, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4910
|
+
function Nf() {
|
|
4911
|
+
return t();
|
|
4912
|
+
}
|
|
4913
|
+
var Pf = ({ source: e6, children: t2 }) => h(Td.Provider, { value: void 0, children: h(wd.Provider, { value: e6, children: t2 }) });
|
|
4914
|
+
var Ff = 2500;
|
|
4915
|
+
var If = ({ children: t2, postLoadPromise: n2, relatedSourcePromise: r2, monitoringClient: i2, slug: a2, language: o2, isPostInPreview: c2 }) => {
|
|
4913
4916
|
let { post: l2, hasError: u2 } = Vn(n2), d2 = pa(l2, s(() => $u(a2, false, o2), [a2, o2]));
|
|
4914
4917
|
ho(d2, c2, i2), Po(a2 && d2.post?.slug === a2 && !c2 ? d2.post : void 0, o2, pd);
|
|
4915
4918
|
let { _id: f2 } = d2.post ?? {};
|
|
4916
4919
|
oa(c2 ? void 0 : f2 ?? void 0);
|
|
4917
4920
|
let p2 = Df({ postWithAuthor: d2, hasError: u2, monitoringClient: i2, isPostInPreview: c2, postPageBase: Da(a2) });
|
|
4918
|
-
return Fa(Na.postBySlugProvider, u2 ? `error` : d2.post ? `data` : `empty`), h(e, { value: p2, children: h(
|
|
4921
|
+
return Fa(Na.postBySlugProvider, u2 ? `error` : d2.post ? `data` : `empty`), h(e, { value: p2, children: h(Pf, { source: r2, children: t2 }) });
|
|
4919
4922
|
};
|
|
4920
|
-
function
|
|
4923
|
+
function Lf({ children: t2 }) {
|
|
4921
4924
|
let n2 = Aa(), i2 = Ma(), a2 = vo(), o2 = ca(), { draftPostId: s2, instance: c2 } = n2 ?? {}, l2 = Co(), d2 = Io(), f2 = u(() => za(zn), []), { i18n: p2, locale: m2 } = du(yu), _2 = ua(() => {
|
|
4922
4925
|
let e6 = s2 && c2 ? hd(Cd({ draftPostId: s2, instance: c2 }, o2)) : Ql({ key: i2 ? `blog-builder:post:${i2}|${a2 ?? ``}` : null, warmupData: d2, fetchData: () => {
|
|
4923
4926
|
let e7 = ud(i2, o2, a2).then((e8) => l2 ? sd(e8, a2) : e8);
|
|
4924
|
-
return hd(Ha(f2, `post-read`, { feature: Ra.post }, o2 ? Gu(e7,
|
|
4927
|
+
return hd(Ha(f2, `post-read`, { feature: Ra.post }, o2 ? Gu(e7, Ff, `post`) : e7));
|
|
4925
4928
|
} }), t3 = e6.then(({ post: e7 }) => fd(e7));
|
|
4926
4929
|
return t3.catch(() => {
|
|
4927
4930
|
}), { slug: i2, language: a2, isPostInPreview: !!s2, postLoadPromise: Un(e6, Of, o2 ? Af : kf), relatedSourcePromise: t3 };
|
|
4928
4931
|
}, [s2, c2, a2, i2, o2, l2, d2, f2]);
|
|
4929
|
-
return h(Ul, { i18n: p2, children: g(r, { fallback: h(e, { value: jf, children: h(
|
|
4932
|
+
return h(Ul, { i18n: p2, children: g(r, { fallback: h(e, { value: jf, children: h(Pf, { source: _2.relatedSourcePromise, children: t2 }) }), children: [h(uu, { i18n: p2, locale: m2 }), h(md, { fallback: h(e, { value: Mf, children: h(Pf, { source: _2.relatedSourcePromise, children: t2 }) }), feature: Ra.post, monitoringClient: f2, rethrow: o2, children: h(If, { postLoadPromise: _2.postLoadPromise, relatedSourcePromise: _2.relatedSourcePromise, monitoringClient: f2, slug: _2.isPostInPreview ? void 0 : _2.slug, language: _2.language, isPostInPreview: _2.isPostInPreview, children: t2 }) })] }) });
|
|
4930
4933
|
}
|
|
4931
|
-
var
|
|
4934
|
+
var Rf = Mn(`12ed204c-821c-4ce9-802b-8bfe8e98d7e2`);
|
|
4932
4935
|
export {
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4936
|
+
Lf as PostBySlugProvider,
|
|
4937
|
+
Lf as default,
|
|
4938
|
+
Rf as injectAccessTokenGetter,
|
|
4939
|
+
Nf as usePostBySlugContext
|
|
4937
4940
|
};
|
|
4938
4941
|
//# sourceMappingURL=context-post-by-slug.mjs.map
|