@roottale/cms-core 0.55.0 → 0.56.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @roottale/cms-core
2
2
 
3
+ ## 0.56.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9eb39e8: ADR-0105 개정 — 글의 정규 공개 경로 계산기 `resolvePostPublicPath` 를 추가합니다.
8
+ 모델 presentation(fixed_page·detail·category_tree) → 호환 컬렉션 → 레거시 `/blog` 순서
9
+ 하나로 계산하며, 플랫폼의 웹훅·사이트맵·단축링크·내부 링크 키·`posts.public_path`
10
+ 물질화가 모두 이 함수를 씁니다.
11
+
3
12
  ## 0.55.0
4
13
 
5
14
  ## 0.54.0
package/dist/index.cjs CHANGED
@@ -34,6 +34,7 @@ __export(src_exports, {
34
34
  FIELD_BINDING_SOURCE: () => FIELD_BINDING_SOURCE,
35
35
  FIELD_BINDING_SOURCE_ALIAS: () => FIELD_BINDING_SOURCE_ALIAS,
36
36
  IMAGE_ALT_MAX_LENGTH: () => IMAGE_ALT_MAX_LENGTH,
37
+ LEGACY_BLOG_DETAIL_PATH: () => LEGACY_BLOG_DETAIL_PATH,
37
38
  PHASE_1_CORE_BLOCKS: () => PHASE_1_CORE_BLOCKS,
38
39
  PHASE_1_CSP: () => PHASE_1_CSP,
39
40
  applyBlockBindings: () => applyBlockBindings,
@@ -67,6 +68,7 @@ __export(src_exports, {
67
68
  resolvePostCategorySlug: () => resolvePostCategorySlug,
68
69
  resolvePostCollection: () => resolvePostCollection,
69
70
  resolvePostPath: () => resolvePostPath,
71
+ resolvePostPublicPath: () => resolvePostPublicPath,
70
72
  resolvePostUrl: () => resolvePostUrl,
71
73
  sanitizeHtml: () => sanitizeHtml,
72
74
  sanitizeImportedCss: () => sanitizeImportedCss,
@@ -359,6 +361,27 @@ function resolveCategoryTreeEntryPath(presentation, entry, terms) {
359
361
  return leafPath ? `${leafPath}/${encodeURIComponent(entry.slug)}` : null;
360
362
  }
361
363
 
364
+ // src/public-path.ts
365
+ var LEGACY_BLOG_DETAIL_PATH = "/blog";
366
+ function resolvePostPublicPath(post, context) {
367
+ const presentation = context.presentation;
368
+ if (presentation && presentation.kind !== "data_only") {
369
+ if (presentation.kind === "fixed_page") return presentation.path;
370
+ if (presentation.kind === "detail") {
371
+ if (!presentation.detailPath.includes(":slug")) return null;
372
+ return presentation.detailPath.replace(":slug", encodeURIComponent(post.slug));
373
+ }
374
+ return resolveCategoryTreeEntryPath(presentation, post, context.categories);
375
+ }
376
+ const collectionKey = post.collectionKey ?? (presentation ? context.compatibilityCollectionKey ?? post.modelKey ?? null : null);
377
+ const routable = { slug: post.slug, terms: post.terms, collectionKey };
378
+ if (!resolvePostCollection(routable, context.collections)) {
379
+ if (presentation) return null;
380
+ return `${LEGACY_BLOG_DETAIL_PATH}/${post.slug}`;
381
+ }
382
+ return resolvePostPath(routable, context.collections);
383
+ }
384
+
362
385
  // src/delimiter.ts
363
386
  function serializeBlock(block) {
364
387
  const exportable = sanitizeAttributesForExport(block);
@@ -1331,6 +1354,7 @@ function injectStableIdsTree(blocks) {
1331
1354
  FIELD_BINDING_SOURCE,
1332
1355
  FIELD_BINDING_SOURCE_ALIAS,
1333
1356
  IMAGE_ALT_MAX_LENGTH,
1357
+ LEGACY_BLOG_DETAIL_PATH,
1334
1358
  PHASE_1_CORE_BLOCKS,
1335
1359
  PHASE_1_CSP,
1336
1360
  applyBlockBindings,
@@ -1364,6 +1388,7 @@ function injectStableIdsTree(blocks) {
1364
1388
  resolvePostCategorySlug,
1365
1389
  resolvePostCollection,
1366
1390
  resolvePostPath,
1391
+ resolvePostPublicPath,
1367
1392
  resolvePostUrl,
1368
1393
  sanitizeHtml,
1369
1394
  sanitizeImportedCss,