@wix/blog 1.0.711 → 1.0.713
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 +3 -3
- 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 +423 -420
- 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 +423 -420
- 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
|
@@ -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}. */
|
|
@@ -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 };
|
|
@@ -30,10 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// context-post-by-id.ts
|
|
31
31
|
var context_post_by_id_exports = {};
|
|
32
32
|
__export(context_post_by_id_exports, {
|
|
33
|
-
PostByIdProvider: () =>
|
|
34
|
-
default: () =>
|
|
35
|
-
injectAccessTokenGetter: () =>
|
|
36
|
-
usePostByIdContext: () =>
|
|
33
|
+
PostByIdProvider: () => hd,
|
|
34
|
+
default: () => hd,
|
|
35
|
+
injectAccessTokenGetter: () => gd,
|
|
36
|
+
usePostByIdContext: () => dd
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(context_post_by_id_exports);
|
|
39
39
|
|
|
@@ -4609,20 +4609,23 @@ var cd = (e6) => {
|
|
|
4609
4609
|
var ld = { ...rd(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4610
4610
|
}, 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 };
|
|
4611
4611
|
var ud = { ...ld, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4612
|
+
function dd() {
|
|
4613
|
+
return (0, import_post_context_provider.usePostContext)();
|
|
4614
|
+
}
|
|
4615
|
+
var fd = 2500;
|
|
4616
|
+
var pd = Promise.resolve(od({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
|
|
4617
|
+
var md = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
|
|
4615
4618
|
let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, (0, import_react.useCallback)(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = ad({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: dr() });
|
|
4616
4619
|
return mr(fr.postByIdProvider, o2 ? `error` : c2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: l2, children: t2 });
|
|
4617
4620
|
};
|
|
4618
|
-
function
|
|
4621
|
+
function hd({ children: t2, postPicker: n2 }) {
|
|
4619
4622
|
let i2 = zl(n2), a2 = Gn(), o2 = gr(), s2 = (0, import_react.useMemo)(() => jl(zn), []), { i18n: c2, locale: l2 } = Go($o), d2 = qn(() => i2 ? Un(Mo({ key: `blog-builder:post-by-id:${i2}`, warmupData: o2, fetchData: () => {
|
|
4620
4623
|
let e6 = Dl(i2, a2);
|
|
4621
|
-
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6,
|
|
4622
|
-
} }), od, a2 ? cd : sd) :
|
|
4623
|
-
return (0, import_jsx_runtime.jsx)(bo, { i18n: c2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ld, children: t2 }), children: [(0, import_jsx_runtime.jsx)(Wo, { i18n: c2, locale: l2 }), (0, import_jsx_runtime.jsx)(Fl, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ud, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: (0, import_jsx_runtime.jsx)(
|
|
4624
|
+
return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, fd, `post-by-id`) : e6));
|
|
4625
|
+
} }), od, a2 ? cd : sd) : pd, [i2, a2, o2, s2]);
|
|
4626
|
+
return (0, import_jsx_runtime.jsx)(bo, { i18n: c2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ld, children: t2 }), children: [(0, import_jsx_runtime.jsx)(Wo, { i18n: c2, locale: l2 }), (0, import_jsx_runtime.jsx)(Fl, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ud, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: (0, import_jsx_runtime.jsx)(md, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
|
|
4624
4627
|
}
|
|
4625
|
-
var
|
|
4628
|
+
var gd = Mn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
|
|
4626
4629
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4627
4630
|
0 && (module.exports = {
|
|
4628
4631
|
PostByIdProvider,
|