@wix/blog 1.0.700 → 1.0.701

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.
@@ -419,6 +419,14 @@ interface RelatedPostsContextType {
419
419
  * Preview, where it holds sample posts.
420
420
  */
421
421
  hasError: boolean;
422
+ /**
423
+ * Whether there are related posts to show: `true` exactly when `relatedPosts` isn't empty.
424
+ *
425
+ * `false` while the posts load for the first time, when they fail to load, and when the
426
+ * current post has no related posts. In the editor, but not in Preview, it's `true` while
427
+ * `relatedPosts` holds sample posts.
428
+ */
429
+ hasRelatedPosts: boolean;
422
430
  }
423
431
  /**
424
432
  * The Related Posts context provides access to a list of blog posts related to the current
@@ -4337,7 +4337,7 @@ var fu = (e6, t2, n2) => {
4337
4337
  let a2 = n2();
4338
4338
  return r2.set(t2, a2), a2;
4339
4339
  };
4340
- var pu = { relatedPosts: [], emptyState: null, isLoadingRelatedPosts: true, hasError: false };
4340
+ var pu = { relatedPosts: [], emptyState: null, isLoadingRelatedPosts: true, hasError: false, hasRelatedPosts: false };
4341
4341
  var mu = { ...pu, isLoadingRelatedPosts: false, hasError: true };
4342
4342
  var hu = (e6) => ({ strip: e6, hasError: false });
4343
4343
  var gu = () => ({ strip: { posts: [], authorsByMemberId: {}, categoryLabelsById: {}, videoSourcesByPostId: {}, fetchedAt: Date.now() }, hasError: true });
@@ -4346,8 +4346,8 @@ var _u = (e6) => {
4346
4346
  };
4347
4347
  var vu = ({ children: e6, stripLoadPromise: t2, slug: n2, language: r2 }) => {
4348
4348
  let { strip: { posts: i2, authorsByMemberId: a2, categoryLabelsById: o2, videoSourcesByPostId: s2, fetchedAt: l2, demoPosts: u2 }, hasError: d2 } = zn(t2), f2 = Un(l2), m2 = ol(), h2 = or(n2), { t: g2 } = So(), _2 = hr(), v2 = (0, import_react.useMemo)(() => ts(g2, _2), [g2, _2]), y2 = (0, import_react.useMemo)(() => {
4349
- let e7 = (i2.length === 0 && m2 ? u2 ?? [] : i2).map((e8) => eu(e8, v2, _2, h2, a2, o2, m2, s2, f2));
4350
- return { relatedPosts: e7.length === 0 && m2 ? au(v2, _2, h2, f2) : e7, emptyState: i2.length === 0 && !d2 ? v2.noRelatedPostsEmptyState() : null, isLoadingRelatedPosts: false, hasError: d2 };
4349
+ let e7 = (i2.length === 0 && m2 ? u2 ?? [] : i2).map((e8) => eu(e8, v2, _2, h2, a2, o2, m2, s2, f2)), t3 = e7.length === 0 && m2 ? au(v2, _2, h2, f2) : e7;
4350
+ return { relatedPosts: t3, emptyState: i2.length === 0 && !d2 ? v2.noRelatedPostsEmptyState() : null, isLoadingRelatedPosts: false, hasError: d2, hasRelatedPosts: t3.length > 0 };
4351
4351
  }, [i2, u2, a2, o2, s2, v2, _2, r2, h2, m2, f2, d2]);
4352
4352
  return dr(lr.relatedPostsProvider, d2 ? `error` : i2.length > 0 ? `data` : `empty`), (0, import_jsx_runtime.jsx)(ou.Provider, { value: y2, children: e6 });
4353
4353
  };