@roottale/cms-renderer-next 0.55.0 → 0.57.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
@@ -2,8 +2,8 @@ import { ReactElement, ReactNode } from 'react';
2
2
  import { CmsPostContent, RootTaleTheme, CmsPostType } from '@roottale/cms-client/server';
3
3
  export { RootTaleTheme } from '@roottale/cms-client/server';
4
4
  import { RootTaleThemeStyle } from '@roottale/ui-react/theme';
5
- import { Block, BindingResolver, RouteCollection } from '@roottale/cms-core';
6
- export { a as BlogCategory, B as BlogCategoryWithCount, c as collectCategories, b as collectCategoriesWithCounts, d as defaultCategoryHref, f as filterPostsByCategory } from './blog-filter-BQNQL3Mk.js';
5
+ import { Block, BindingResolver, RouteCollection, InternalContentLinkResolver } from '@roottale/cms-core';
6
+ export { a as BlogCategory, B as BlogCategoryWithCount, c as collectCategories, b as collectCategoriesWithCounts, d as defaultCategoryHref, f as filterPostsByCategory, m as makeCategoryHref } from './blog-filter-qE9Lj49C.js';
7
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
8
 
9
9
  /**
@@ -262,6 +262,13 @@ type RootTaleBlogPostProps = {
262
262
  locale?: string;
263
263
  authorHref?: (slug: string) => string;
264
264
  breadcrumb?: BlogPostBreadcrumbOptions;
265
+ /**
266
+ * 본문 예약 내부 링크(`[[internal:키|문구]]`) 해석. 기본 `"auto"` = 본문에 토큰이
267
+ * 있을 때만 발행 글 경로 색인(`fetchInternalContentPathIndex`)을 만들어 링크로
268
+ * 렌더한다. `false` 면 토큰을 텍스트 그대로 둔다. 미리 만든 색인(Map)이나
269
+ * 함수를 주면 그것을 쓴다.
270
+ */
271
+ internalLinks?: "auto" | false | InternalContentLinkResolver | ReadonlyMap<string, string>;
265
272
  };
266
273
  interface BlogPostBreadcrumbOptions {
267
274
  siteUrl?: string;
@@ -279,6 +286,21 @@ declare function RootTaleFaqJsonLd({ doc, }: {
279
286
  readonly doc: unknown;
280
287
  }): ReactElement | null;
281
288
 
289
+ interface RootTalePostPatternProps {
290
+ readonly apiKey: string;
291
+ readonly baseUrl?: string;
292
+ /** `fetchPost`/`fetchPosts` 로 받은 글(또는 `patternSlots` 만 있는 객체). */
293
+ readonly post: Pick<CmsPostContent, "patternSlots">;
294
+ /** 자리 key. 기본 글 하단(`post_footer`). */
295
+ readonly slot?: string;
296
+ }
297
+ /**
298
+ * 자체 글 화면을 가진 사이트가 글 하단 공통 블록만 가져다 쓰는 서버 컴포넌트.
299
+ * `RootTaleBlogPost` 는 이미 본문 아래에 같은 블록을 그리므로 둘을 함께 쓰지 않는다.
300
+ */
301
+ declare function RootTalePostPattern(props: RootTalePatternProps): Promise<ReactElement | null>;
302
+ type RootTalePatternProps = RootTalePostPatternProps;
303
+
282
304
  interface RootTalePreviewNoticeProps {
283
305
  /** `ko`(기본) · `en`. */
284
306
  locale?: string;
@@ -319,13 +341,36 @@ interface RootTaleExposureSlotProps {
319
341
  /** FRONT가 코드로 만든 슬롯 안에서만 활성 배너·팝업을 렌더한다. */
320
342
  declare function RootTaleExposureSlot(props: RootTaleExposureSlotProps): Promise<react_jsx_runtime.JSX.Element | null>;
321
343
 
344
+ type InternalLinksSource = InternalContentLinkResolver | ReadonlyMap<string, string> | null;
322
345
  type RenderTiptapProps = {
323
346
  readonly doc: Record<string, unknown>;
324
347
  readonly fields?: Record<string, unknown> | null;
325
348
  readonly apiKey?: string;
326
349
  readonly baseUrl?: string;
350
+ /**
351
+ * 본문 예약 내부 링크(`[[internal:키|문구]]`) 해석 — 키 → 공개 경로.
352
+ * `fetchInternalContentPathIndex` 결과(Map)나 함수. 없으면 토큰을 텍스트 그대로 둔다.
353
+ */
354
+ readonly internalLinks?: InternalLinksSource;
327
355
  };
328
- declare function RenderTiptap({ doc, fields, apiKey, baseUrl, }: RenderTiptapProps): ReactElement;
356
+ declare function RenderTiptap({ doc, fields, apiKey, baseUrl, internalLinks, }: RenderTiptapProps): ReactElement;
357
+
358
+ interface FetchInternalContentPathIndexOptions {
359
+ readonly apiKey: string;
360
+ readonly baseUrl?: string;
361
+ readonly locale?: string;
362
+ /** ISR revalidate 초. */
363
+ readonly revalidate?: number;
364
+ /** 안전장치 — 이 이상 페이지는 읽지 않는다(100건/페이지). 기본 20 = 2,000건. */
365
+ readonly maxPages?: number;
366
+ }
367
+ /**
368
+ * 발행 글 전부의 경로를 모아 키 색인을 만든다. 한 페이지라도 실패하면 그때까지
369
+ * 모은 것으로 답한다(fail-soft — 링크가 몇 개 문구로 남는 편이 500 보다 낫다).
370
+ */
371
+ declare function fetchInternalContentPathIndex(options: FetchInternalContentPathIndexOptions): Promise<Map<string, string>>;
372
+ /** 본문(JSON 또는 HTML)에 토큰이 있는지 — 색인을 만들 필요가 있는지 미리 본다. */
373
+ declare function bodyHasInternalContentLinkTokens(doc: Record<string, unknown> | null | undefined, html?: string | null): boolean;
329
374
 
330
375
  /**
331
376
  * 본문 렌더 소스 결정 — HTML 정본 우선, 없으면 Block JSON 폴백.
@@ -356,4 +401,4 @@ type PostBodySource = {
356
401
  */
357
402
  declare function resolvePostBodySource(bodyHtml: string | null | undefined): PostBodySource;
358
403
 
359
- export { type BlogPostBreadcrumbOptions, type CtaButton, type CtaButtonType, type FloatingCtaPosition, type LeadFormVertical, type PostBodySource, RenderTiptap, RootTaleBlogCategories, type RootTaleBlogCategoriesProps, RootTaleBlogList, type RootTaleBlogListProps, RootTaleBlogPost, type RootTaleBlogPostProps, type RootTaleCssVars, RootTaleExposureSlot, type RootTaleExposureSlotProps, RootTaleFaqJsonLd, RootTaleFloatingCta, type RootTaleFloatingCtaProps, RootTaleLeadForm, type RootTaleLeadFormProps, RootTalePage, type RootTalePageProps, RootTalePostCard, type RootTalePostCardProps, RootTalePreviewNotice, type RootTalePreviewNoticeProps, RootTaleTableOfContents, type RootTaleTableOfContentsProps, type RootTaleThemeInput, RootTaleThemeProvider, type TocEntry, attachHeadingIds, extractToc, headingToId, renderBlock, renderBlocks, renderBoundBlocks, resolvePostBodySource, themeToCssVars };
404
+ export { type BlogPostBreadcrumbOptions, type CtaButton, type CtaButtonType, type FetchInternalContentPathIndexOptions, type FloatingCtaPosition, type InternalLinksSource, type LeadFormVertical, type PostBodySource, RenderTiptap, RootTaleBlogCategories, type RootTaleBlogCategoriesProps, RootTaleBlogList, type RootTaleBlogListProps, RootTaleBlogPost, type RootTaleBlogPostProps, type RootTaleCssVars, RootTaleExposureSlot, type RootTaleExposureSlotProps, RootTaleFaqJsonLd, RootTaleFloatingCta, type RootTaleFloatingCtaProps, RootTaleLeadForm, type RootTaleLeadFormProps, RootTalePage, type RootTalePageProps, RootTalePostCard, type RootTalePostCardProps, RootTalePostPattern, type RootTalePostPatternProps, RootTalePreviewNotice, type RootTalePreviewNoticeProps, RootTaleTableOfContents, type RootTaleTableOfContentsProps, type RootTaleThemeInput, RootTaleThemeProvider, type TocEntry, attachHeadingIds, bodyHasInternalContentLinkTokens, extractToc, fetchInternalContentPathIndex, headingToId, renderBlock, renderBlocks, renderBoundBlocks, resolvePostBodySource, themeToCssVars };