@roottale/cms-renderer-next 0.71.0 → 0.72.0

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/dist/server.d.ts CHANGED
@@ -250,6 +250,8 @@ type RootTaleBlogPostProps = {
250
250
  previewToken?: string;
251
251
  /** 미리보기 토큰이 만료됐을 때 대신 그릴 요소(기본: 만료 안내 문구). */
252
252
  previewExpiredElement?: ReactElement;
253
+ /** 작업본이 저장되어 이전 토큰의 버전이 교체됐을 때 대신 그릴 요소. */
254
+ previewSupersededElement?: ReactElement;
253
255
  baseUrl?: string;
254
256
  notFoundElement?: ReactElement;
255
257
  showTitle?: boolean;
package/dist/server.js CHANGED
@@ -92,6 +92,7 @@ var DICTS = {
92
92
  postNotFound: "\uAE00\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
93
93
  pageNotFound: "\uD398\uC774\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
94
94
  previewExpired: "\uBBF8\uB9AC\uBCF4\uAE30 \uB9C1\uD06C\uAC00 \uB9CC\uB8CC\uB410\uC5B4\uC694. \uAD00\uB9AC\uC790 \uD3B8\uC9D1\uAE30\uC5D0\uC11C \uBBF8\uB9AC\uBCF4\uAE30\uB97C \uB2E4\uC2DC \uC5F4\uC5B4 \uC8FC\uC138\uC694.",
95
+ previewSuperseded: "\uD3B8\uC9D1\uD55C \uB0B4\uC6A9\uC774 \uBCC0\uACBD\uB410\uC5B4\uC694. \uAD00\uB9AC\uC790 \uD3B8\uC9D1\uAE30\uC5D0\uC11C \uBBF8\uB9AC\uBCF4\uAE30\uB97C \uB2E4\uC2DC \uC5F4\uC5B4 \uC8FC\uC138\uC694.",
95
96
  previewNotice: "\uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC544\uC9C1 \uACF5\uAC1C\uB418\uC9C0 \uC54A\uC740 \uB0B4\uC6A9\uC774\uBA70 \uAC80\uC0C9\uC5D0 \uB178\uCD9C\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
96
97
  tableOfContentsTitle: "\uBAA9\uCC28"
97
98
  },
@@ -103,6 +104,7 @@ var DICTS = {
103
104
  postNotFound: "Post not found.",
104
105
  pageNotFound: "Page not found.",
105
106
  previewExpired: "This preview link has expired. Open the preview again from the admin editor.",
107
+ previewSuperseded: "The content has changed. Open the preview again from the admin editor.",
106
108
  previewNotice: "Preview \u2014 this content is not public and is hidden from search engines.",
107
109
  tableOfContentsTitle: "Table of contents"
108
110
  }
@@ -867,6 +869,7 @@ import {
867
869
  fetchPostPreview,
868
870
  fetchPosts as fetchPosts3,
869
871
  isPreviewExpiredError,
872
+ isPreviewSupersededError,
870
873
  resolvePostDisplay as resolvePostDisplay2,
871
874
  selectRelatedPosts
872
875
  } from "@roottale/cms-client/server";
@@ -1737,6 +1740,7 @@ async function lookupPost(input) {
1737
1740
  return preview ? { kind: "post", post: preview } : { kind: "missing" };
1738
1741
  } catch (error) {
1739
1742
  if (isPreviewExpiredError(error)) return { kind: "preview-expired" };
1743
+ if (isPreviewSupersededError(error)) return { kind: "preview-superseded" };
1740
1744
  throw error;
1741
1745
  }
1742
1746
  }
@@ -1765,6 +1769,7 @@ async function RootTaleBlogPost(props) {
1765
1769
  slugOrId,
1766
1770
  previewToken,
1767
1771
  previewExpiredElement,
1772
+ previewSupersededElement,
1768
1773
  baseUrl,
1769
1774
  notFoundElement,
1770
1775
  showTitle = true,
@@ -1787,6 +1792,9 @@ async function RootTaleBlogPost(props) {
1787
1792
  resolveThemeStyleFailSoft({ themeProp, apiKey, baseUrl }),
1788
1793
  fetchBlogSettingsFailSoft({ apiKey, baseUrl })
1789
1794
  ]);
1795
+ if (lookup.kind === "preview-superseded") {
1796
+ return previewSupersededElement ?? /* @__PURE__ */ jsx18("div", { "data-roottale-cms": "post-preview-superseded", style: themeStyle ?? void 0, children: /* @__PURE__ */ jsx18("p", { className: "rt-cms-empty", children: t(locale, "previewSuperseded") }) });
1797
+ }
1790
1798
  if (lookup.kind === "preview-expired") {
1791
1799
  return previewExpiredElement ?? /* @__PURE__ */ jsx18("div", { "data-roottale-cms": "post-preview-expired", style: themeStyle ?? void 0, children: /* @__PURE__ */ jsx18("p", { className: "rt-cms-empty", children: t(locale, "previewExpired") }) });
1792
1800
  }