@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 };
|
|
@@ -30,10 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// context-post-by-slug.ts
|
|
31
31
|
var context_post_by_slug_exports = {};
|
|
32
32
|
__export(context_post_by_slug_exports, {
|
|
33
|
-
PostBySlugProvider: () =>
|
|
34
|
-
default: () =>
|
|
35
|
-
injectAccessTokenGetter: () =>
|
|
36
|
-
usePostBySlugContext: () =>
|
|
33
|
+
PostBySlugProvider: () => Lf,
|
|
34
|
+
default: () => Lf,
|
|
35
|
+
injectAccessTokenGetter: () => Rf,
|
|
36
|
+
usePostBySlugContext: () => Nf
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(context_post_by_slug_exports);
|
|
39
39
|
|
|
@@ -4947,28 +4947,31 @@ var Af = (e6) => {
|
|
|
4947
4947
|
var jf = { ...Tf(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4948
4948
|
}, 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 };
|
|
4949
4949
|
var Mf = { ...jf, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4950
|
+
function Nf() {
|
|
4951
|
+
return (0, import_post_context_provider.usePostContext)();
|
|
4952
|
+
}
|
|
4953
|
+
var Pf = ({ source: e6, children: t2 }) => (0, import_jsx_runtime.jsx)(Td.Provider, { value: void 0, children: (0, import_jsx_runtime.jsx)(wd.Provider, { value: e6, children: t2 }) });
|
|
4954
|
+
var Ff = 2500;
|
|
4955
|
+
var If = ({ children: t2, postLoadPromise: n2, relatedSourcePromise: r2, monitoringClient: i2, slug: a2, language: o2, isPostInPreview: c2 }) => {
|
|
4953
4956
|
let { post: l2, hasError: u2 } = Vn(n2), d2 = pa(l2, (0, import_react.useCallback)(() => $u(a2, false, o2), [a2, o2]));
|
|
4954
4957
|
ho(d2, c2, i2), Po(a2 && d2.post?.slug === a2 && !c2 ? d2.post : void 0, o2, pd);
|
|
4955
4958
|
let { _id: f2 } = d2.post ?? {};
|
|
4956
4959
|
oa(c2 ? void 0 : f2 ?? void 0);
|
|
4957
4960
|
let p2 = Df({ postWithAuthor: d2, hasError: u2, monitoringClient: i2, isPostInPreview: c2, postPageBase: Da(a2) });
|
|
4958
|
-
return Fa(Na.postBySlugProvider, u2 ? `error` : d2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: p2, children: (0, import_jsx_runtime.jsx)(
|
|
4961
|
+
return Fa(Na.postBySlugProvider, u2 ? `error` : d2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: p2, children: (0, import_jsx_runtime.jsx)(Pf, { source: r2, children: t2 }) });
|
|
4959
4962
|
};
|
|
4960
|
-
function
|
|
4963
|
+
function Lf({ children: t2 }) {
|
|
4961
4964
|
let n2 = Aa(), i2 = Ma(), a2 = vo(), o2 = ca(), { draftPostId: s2, instance: c2 } = n2 ?? {}, l2 = Co(), d2 = Io(), f2 = (0, import_react.useMemo)(() => za(zn), []), { i18n: p2, locale: m2 } = du(yu), _2 = ua(() => {
|
|
4962
4965
|
let e6 = s2 && c2 ? hd(Cd({ draftPostId: s2, instance: c2 }, o2)) : Ql({ key: i2 ? `blog-builder:post:${i2}|${a2 ?? ``}` : null, warmupData: d2, fetchData: () => {
|
|
4963
4966
|
let e7 = ud(i2, o2, a2).then((e8) => l2 ? sd(e8, a2) : e8);
|
|
4964
|
-
return hd(Ha(f2, `post-read`, { feature: Ra.post }, o2 ? Gu(e7,
|
|
4967
|
+
return hd(Ha(f2, `post-read`, { feature: Ra.post }, o2 ? Gu(e7, Ff, `post`) : e7));
|
|
4965
4968
|
} }), t3 = e6.then(({ post: e7 }) => fd(e7));
|
|
4966
4969
|
return t3.catch(() => {
|
|
4967
4970
|
}), { slug: i2, language: a2, isPostInPreview: !!s2, postLoadPromise: Un(e6, Of, o2 ? Af : kf), relatedSourcePromise: t3 };
|
|
4968
4971
|
}, [s2, c2, a2, i2, o2, l2, d2, f2]);
|
|
4969
|
-
return (0, import_jsx_runtime.jsx)(Ul, { i18n: p2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: jf, children: (0, import_jsx_runtime.jsx)(
|
|
4972
|
+
return (0, import_jsx_runtime.jsx)(Ul, { i18n: p2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: jf, children: (0, import_jsx_runtime.jsx)(Pf, { source: _2.relatedSourcePromise, children: t2 }) }), children: [(0, import_jsx_runtime.jsx)(uu, { i18n: p2, locale: m2 }), (0, import_jsx_runtime.jsx)(md, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: Mf, children: (0, import_jsx_runtime.jsx)(Pf, { source: _2.relatedSourcePromise, children: t2 }) }), feature: Ra.post, monitoringClient: f2, rethrow: o2, children: (0, import_jsx_runtime.jsx)(If, { postLoadPromise: _2.postLoadPromise, relatedSourcePromise: _2.relatedSourcePromise, monitoringClient: f2, slug: _2.isPostInPreview ? void 0 : _2.slug, language: _2.language, isPostInPreview: _2.isPostInPreview, children: t2 }) })] }) });
|
|
4970
4973
|
}
|
|
4971
|
-
var
|
|
4974
|
+
var Rf = Mn(`12ed204c-821c-4ce9-802b-8bfe8e98d7e2`);
|
|
4972
4975
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4973
4976
|
0 && (module.exports = {
|
|
4974
4977
|
PostBySlugProvider,
|