@roottale/cms-renderer-next 0.52.0 → 0.53.1
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/CHANGELOG.md +53 -0
- package/README.md +33 -4
- package/dist/chunk-GVKENK6H.js +75 -0
- package/dist/chunk-GVKENK6H.js.map +1 -0
- package/dist/{chunk-U2IM6OCQ.js → chunk-HM5VP7SR.js} +1 -1
- package/dist/{chunk-U2IM6OCQ.js.map → chunk-HM5VP7SR.js.map} +1 -1
- package/dist/chunk-KSPPYX22.js +14 -0
- package/dist/chunk-KSPPYX22.js.map +1 -0
- package/dist/cms-public.css +65 -0
- package/dist/exposure-client.d.ts +9 -0
- package/dist/exposure-client.js +8 -0
- package/dist/routes.d.ts +10 -1
- package/dist/routes.js +36 -16
- package/dist/routes.js.map +1 -1
- package/dist/section-runtime.d.ts +46 -0
- package/dist/section-runtime.js +9 -0
- package/dist/server.d.ts +49 -3
- package/dist/server.js +1764 -34
- package/dist/server.js.map +1 -1
- package/package.json +8 -24
- package/dist/before-after-client.d.ts +0 -15
- package/dist/before-after-client.js +0 -8
- package/dist/chunk-27RT6B3O.js +0 -93
- package/dist/chunk-27RT6B3O.js.map +0 -1
- package/dist/chunk-2QU4JU46.js +0 -3927
- package/dist/chunk-2QU4JU46.js.map +0 -1
- package/dist/chunk-4RQ3SEDL.js +0 -106
- package/dist/chunk-4RQ3SEDL.js.map +0 -1
- package/dist/chunk-6GQCFFHU.js +0 -540
- package/dist/chunk-6GQCFFHU.js.map +0 -1
- package/dist/chunk-H46JUIHZ.js +0 -79
- package/dist/chunk-H46JUIHZ.js.map +0 -1
- package/dist/chunk-K62RR4UQ.js +0 -53
- package/dist/chunk-K62RR4UQ.js.map +0 -1
- package/dist/chunk-LEHHSI6G.js +0 -64
- package/dist/chunk-LEHHSI6G.js.map +0 -1
- package/dist/chunk-QYNEOFL7.js +0 -418
- package/dist/chunk-QYNEOFL7.js.map +0 -1
- package/dist/chunk-U5AKACPN.js +0 -113
- package/dist/chunk-U5AKACPN.js.map +0 -1
- package/dist/chunk-UM37DOIK.js +0 -961
- package/dist/chunk-UM37DOIK.js.map +0 -1
- package/dist/chunk-YLSQAT6B.js +0 -59
- package/dist/chunk-YLSQAT6B.js.map +0 -1
- package/dist/chunk-ZL2NA3QT.js +0 -313
- package/dist/chunk-ZL2NA3QT.js.map +0 -1
- package/dist/concerns-client.d.ts +0 -12
- package/dist/concerns-client.js +0 -8
- package/dist/contact-map-client.d.ts +0 -27
- package/dist/contact-map-client.js +0 -8
- package/dist/contact-map-client.js.map +0 -1
- package/dist/expertise-client.d.ts +0 -16
- package/dist/expertise-client.js +0 -9
- package/dist/expertise-client.js.map +0 -1
- package/dist/hero-carousel-client.d.ts +0 -52
- package/dist/hero-carousel-client.js +0 -9
- package/dist/hero-carousel-client.js.map +0 -1
- package/dist/seo-checks.d.ts +0 -87
- package/dist/seo-checks.js +0 -27
- package/dist/seo-checks.js.map +0 -1
- package/dist/site-config-DNpvlqA5.d.ts +0 -3961
- package/dist/spaces-client.d.ts +0 -10
- package/dist/spaces-client.js +0 -8
- package/dist/spaces-client.js.map +0 -1
- package/dist/team-expanding-stage-client.d.ts +0 -35
- package/dist/team-expanding-stage-client.js +0 -8
- package/dist/team-expanding-stage-client.js.map +0 -1
- package/dist/templates.css +0 -4145
- package/dist/templates.d.ts +0 -171
- package/dist/templates.js +0 -291
- package/dist/templates.js.map +0 -1
- package/dist/theme-css-vars-CD3jcEkp.d.ts +0 -7
- package/dist/ui-react-motion-client.d.ts +0 -76
- package/dist/ui-react-motion-client.js +0 -16
- package/dist/ui-react-motion-client.js.map +0 -1
- package/dist/validate.d.ts +0 -104
- package/dist/validate.js +0 -1204
- package/dist/validate.js.map +0 -1
- /package/dist/{before-after-client.js.map → exposure-client.js.map} +0 -0
- /package/dist/{concerns-client.js.map → section-runtime.js.map} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
import { CmsPostContent } from '@roottale/cms-client/server';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 섹션 렌더러 주입 지점 — ADR-0040 P2 단방향 계약(코어 ◄ site-sections).
|
|
6
|
+
*
|
|
7
|
+
* 본문(tiptap) 안의 `section` 노드는 비공개 `site-sections` 컴포넌트로 그리지만,
|
|
8
|
+
* 공개 코어가 비공개 패키지를 직접 import 하면 순환·번들
|
|
9
|
+
* 오염이 된다(dependency-cruiser `no-renderer-core-to-templates`). 그래서 코어는
|
|
10
|
+
* "섹션을 그리는 함수" 의 자리만 비워두고, private
|
|
11
|
+
* `@roottale/site-sections`를 import 하는 내부 제작 경로에서만 채운다.
|
|
12
|
+
*
|
|
13
|
+
* 등록 없이 `section` 노드를 만나면 dev 경고 후 skip — 미지 섹션 타입을 만났을
|
|
14
|
+
* 때와 같은 fail-soft 동작이다.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** 발행 API 호출에 필요한 최소 컨텍스트(공개 키 + 베이스 URL). */
|
|
18
|
+
type CmsBoundContext = {
|
|
19
|
+
apiKey: string;
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
};
|
|
22
|
+
type BlogListProps = {
|
|
23
|
+
apiKey: string;
|
|
24
|
+
baseUrl?: string;
|
|
25
|
+
limit?: number;
|
|
26
|
+
emptyMessage?: string;
|
|
27
|
+
postHref?: (post: CmsPostContent) => string;
|
|
28
|
+
};
|
|
29
|
+
type SectionRenderContext = {
|
|
30
|
+
cms: CmsBoundContext | null;
|
|
31
|
+
renderBlogList: (props: BlogListProps) => ReactNode;
|
|
32
|
+
isDev: () => boolean;
|
|
33
|
+
};
|
|
34
|
+
/** `section` 노드 하나를 그리는 함수 — templates 쪽 구현이 주입된다. */
|
|
35
|
+
type SectionNodeRenderer = (node: {
|
|
36
|
+
type?: string;
|
|
37
|
+
attrs?: Record<string, unknown>;
|
|
38
|
+
}, key: number, context: SectionRenderContext) => ReactElement | null;
|
|
39
|
+
/**
|
|
40
|
+
* private 섹션 공장이 로드되며 호출한다. 공개 CMS runtime만 쓰는 고객 FRONT는
|
|
41
|
+
* 이 함수를 호출하지 않으며 `section` 노드를 마케팅 페이지 구조로 사용하지 않는다.
|
|
42
|
+
*/
|
|
43
|
+
declare function setSectionNodeRenderer(renderer: SectionNodeRenderer): void;
|
|
44
|
+
declare function getSectionNodeRenderer(): SectionNodeRenderer | null;
|
|
45
|
+
|
|
46
|
+
export { type BlogListProps, type CmsBoundContext, type SectionNodeRenderer, type SectionRenderContext, getSectionNodeRenderer, setSectionNodeRenderer };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
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
5
|
import { Block, BindingResolver, RouteCollection } from '@roottale/cms-core';
|
|
6
6
|
export { a as BlogCategory, B as BlogCategoryWithCount, c as collectCategories, b as collectCategoriesWithCounts, d as defaultCategoryHref, f as filterPostsByCategory } from './blog-filter-BKCGM0qd.js';
|
|
7
|
-
import '
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* `<RootTalePostCard>` — server-only summary card for a single CmsPostContent.
|
|
@@ -81,6 +81,9 @@ interface RootTaleTableOfContentsProps {
|
|
|
81
81
|
}
|
|
82
82
|
declare function RootTaleTableOfContents(props: RootTaleTableOfContentsProps): ReactElement | null;
|
|
83
83
|
|
|
84
|
+
type RootTaleCssVars = RootTaleThemeStyle;
|
|
85
|
+
declare function themeToCssVars(theme: RootTaleTheme | null): RootTaleCssVars | null;
|
|
86
|
+
|
|
84
87
|
/**
|
|
85
88
|
* `<RootTaleFloatingCta>` — fixed-position call-to-action stack.
|
|
86
89
|
*
|
|
@@ -275,9 +278,23 @@ type RootTalePageProps = {
|
|
|
275
278
|
showTitle?: boolean;
|
|
276
279
|
theme?: RootTaleThemeInput;
|
|
277
280
|
locale?: string;
|
|
281
|
+
/** 페이지 JSON을 렌더하기 직전 콘텐츠 참조를 실제 섹션 props로 바꾸는 서버 함수. */
|
|
282
|
+
prepareBody?: (document: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
278
283
|
};
|
|
279
284
|
declare function RootTalePage(props: RootTalePageProps): Promise<ReactElement>;
|
|
280
285
|
|
|
286
|
+
interface RootTaleExposureSlotProps {
|
|
287
|
+
readonly apiKey: string;
|
|
288
|
+
readonly baseUrl?: string;
|
|
289
|
+
readonly siteId?: string;
|
|
290
|
+
readonly slotKey: string;
|
|
291
|
+
readonly path: string;
|
|
292
|
+
readonly allowedVariants: readonly string[];
|
|
293
|
+
readonly revalidate?: number;
|
|
294
|
+
}
|
|
295
|
+
/** FRONT가 코드로 만든 슬롯 안에서만 활성 배너·팝업을 렌더한다. */
|
|
296
|
+
declare function RootTaleExposureSlot(props: RootTaleExposureSlotProps): Promise<react_jsx_runtime.JSX.Element | null>;
|
|
297
|
+
|
|
281
298
|
type RenderTiptapProps = {
|
|
282
299
|
readonly doc: Record<string, unknown>;
|
|
283
300
|
readonly fields?: Record<string, unknown> | null;
|
|
@@ -286,4 +303,33 @@ type RenderTiptapProps = {
|
|
|
286
303
|
};
|
|
287
304
|
declare function RenderTiptap({ doc, fields, apiKey, baseUrl, }: RenderTiptapProps): ReactElement;
|
|
288
305
|
|
|
289
|
-
|
|
306
|
+
/**
|
|
307
|
+
* 본문 렌더 소스 결정 — HTML 정본 우선, 없으면 Block JSON 폴백.
|
|
308
|
+
*
|
|
309
|
+
* 배경: 외부에서 이관한 글은 **HTML 이 정본**이고 body_json 은 그 파생/대체본이다.
|
|
310
|
+
* 파생본은 표·중첩 목록 같은 구조에서 원문과 미묘하게 달라질 수 있으므로, 원문이
|
|
311
|
+
* 남아 있으면 그것을 보여주는 편이 정확하다. 반대로 에디터에서 편집된 글은
|
|
312
|
+
* body_html 이 비워지므로(저장 경로가 무효화) 자동으로 JSON 경로로 돌아온다.
|
|
313
|
+
*
|
|
314
|
+
* 안전성: HTML 은 신뢰하지 않는다. 최종 sink 는 공용 `sanitizeHtml` 하나뿐이며
|
|
315
|
+
* (cms-core), 렌더 직전 여기서 통과시킨다 — 저장 시점에 정제됐더라도 다시 한다
|
|
316
|
+
* (저장 경로가 여럿이고 sanitizer 규칙은 갱신되므로, 방어는 렌더 시점 기준).
|
|
317
|
+
*
|
|
318
|
+
* sanitize 결과가 실질적으로 비면(태그만 남고 내용이 없음) HTML 을 쓰지 않고
|
|
319
|
+
* JSON 으로 폴백한다 — 빈 화면보다 파생본이 낫다.
|
|
320
|
+
*/
|
|
321
|
+
type PostBodySource = {
|
|
322
|
+
readonly kind: "html";
|
|
323
|
+
readonly html: string;
|
|
324
|
+
} | {
|
|
325
|
+
readonly kind: "json";
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* 렌더에 쓸 본문 소스를 고른다.
|
|
329
|
+
*
|
|
330
|
+
* @param bodyHtml 원문 HTML 정본 (null/미포함 = 구 서버이거나 JSON 이 정본).
|
|
331
|
+
* @returns `kind: "html"` 이면 `html` 은 **이미 sanitize 된** 값이라 그대로 주입 가능.
|
|
332
|
+
*/
|
|
333
|
+
declare function resolvePostBodySource(bodyHtml: string | null | undefined): PostBodySource;
|
|
334
|
+
|
|
335
|
+
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, RootTaleTableOfContents, type RootTaleTableOfContentsProps, type RootTaleThemeInput, RootTaleThemeProvider, type TocEntry, attachHeadingIds, extractToc, headingToId, renderBlock, renderBlocks, renderBoundBlocks, resolvePostBodySource, themeToCssVars };
|