@cmssy/astro 12.14.2 → 13.0.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/index.cjs CHANGED
@@ -84,7 +84,7 @@ function withoutEditPrefix(pathname) {
84
84
  async function loadCmssyPage(config, request, url, options = {}) {
85
85
  const isEdit = request.headers.get(core.CMSSY_EDIT_HEADER) === "1" || await core.isVerifiedEditUrl(url, config);
86
86
  const segments = withoutEditPrefix(url.pathname).split("/").filter(Boolean);
87
- const positions = options.positions ?? ["header", "footer"];
87
+ const positions = options.positions ?? internal.layoutRegionIds(config.layout);
88
88
  const blocks = options.blocks ?? [];
89
89
  const headerLocale = request.headers.get(internal.CMSSY_LOCALE_HEADER) ?? void 0;
90
90
  const retry = options.retry ?? (options.prerendered === false ? "interactive" : "build");
@@ -135,7 +135,8 @@ async function loadCmssyPage(config, request, url, options = {}) {
135
135
  enabledLocales: slot.enabledLocales,
136
136
  isEdit,
137
137
  editorData,
138
- editorOrigin: slot.editorOrigin
138
+ editorOrigin: slot.editorOrigin,
139
+ ...config.layout ? { layoutRegions: config.layout.regions } : {}
139
140
  };
140
141
  }
141
142
 
@@ -159,6 +160,10 @@ Object.defineProperty(exports, "defineCmssyConfig", {
159
160
  enumerable: true,
160
161
  get: function () { return core.defineCmssyConfig; }
161
162
  });
163
+ Object.defineProperty(exports, "defineCmssyLayout", {
164
+ enumerable: true,
165
+ get: function () { return core.defineCmssyLayout; }
166
+ });
162
167
  Object.defineProperty(exports, "localizeHref", {
163
168
  enumerable: true,
164
169
  get: function () { return core.localizeHref; }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { CmssyConfig, CmssyPageData, CmssyLayoutGroup, RetryOption } from '@cmssy/core';
2
- export { CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayoutGroup, CmssyPageData, CmssyRetryMode, CmssyWebhookError, CmssyWebhookEvent, RetryOption, RetryPolicy, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
1
+ import { CmssyConfig, CmssyPageData, CmssyLayoutGroup, LayoutRegion, RetryOption } from '@cmssy/core';
2
+ export { CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayout, CmssyLayoutGroup, CmssyPageData, CmssyRegion, CmssyRegionOf, CmssyRetryMode, CmssyWebhookError, CmssyWebhookEvent, LayoutRegion, RetryOption, RetryPolicy, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, defineCmssyLayout, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
3
3
  import { BlockDefinition } from '@cmssy/react';
4
4
 
5
5
  declare const CMSSY_EDIT_PATH_PREFIX = "/cmssy-edit";
@@ -22,6 +22,7 @@ interface CmssyPageResult {
22
22
  isEdit: boolean;
23
23
  editorData?: Record<string, CmssyLayoutEditorData>;
24
24
  editorOrigin?: string | string[];
25
+ layoutRegions?: readonly LayoutRegion[];
25
26
  }
26
27
  interface CmssyLayoutEditorData {
27
28
  data: Record<string, unknown>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { CmssyConfig, CmssyPageData, CmssyLayoutGroup, RetryOption } from '@cmssy/core';
2
- export { CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayoutGroup, CmssyPageData, CmssyRetryMode, CmssyWebhookError, CmssyWebhookEvent, RetryOption, RetryPolicy, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
1
+ import { CmssyConfig, CmssyPageData, CmssyLayoutGroup, LayoutRegion, RetryOption } from '@cmssy/core';
2
+ export { CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayout, CmssyLayoutGroup, CmssyPageData, CmssyRegion, CmssyRegionOf, CmssyRetryMode, CmssyWebhookError, CmssyWebhookEvent, LayoutRegion, RetryOption, RetryPolicy, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, defineCmssyLayout, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
3
3
  import { BlockDefinition } from '@cmssy/react';
4
4
 
5
5
  declare const CMSSY_EDIT_PATH_PREFIX = "/cmssy-edit";
@@ -22,6 +22,7 @@ interface CmssyPageResult {
22
22
  isEdit: boolean;
23
23
  editorData?: Record<string, CmssyLayoutEditorData>;
24
24
  editorOrigin?: string | string[];
25
+ layoutRegions?: readonly LayoutRegion[];
25
26
  }
26
27
  interface CmssyLayoutEditorData {
27
28
  data: Record<string, unknown>;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, isVerifiedEditUrl, applyCmssyCsp, CMSSY_SECRET_QUERY_PARAM } from '@cmssy/core';
2
- export { CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CmssyWebhookError, createCmssyClient, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
3
- import { CMSSY_LOCALE_HEADER, localeForPathname, isDevelopment, resolveSiteLocales, fetchPage } from '@cmssy/core/internal';
2
+ export { CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CmssyWebhookError, createCmssyClient, defineCmssyConfig, defineCmssyLayout, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
3
+ import { CMSSY_LOCALE_HEADER, localeForPathname, isDevelopment, resolveSiteLocales, layoutRegionIds, fetchPage } from '@cmssy/core/internal';
4
4
  import { resolveCmssyLayoutSlot } from '@cmssy/react';
5
5
 
6
6
  // src/middleware.ts
@@ -83,7 +83,7 @@ function withoutEditPrefix(pathname) {
83
83
  async function loadCmssyPage(config, request, url, options = {}) {
84
84
  const isEdit = request.headers.get(CMSSY_EDIT_HEADER) === "1" || await isVerifiedEditUrl(url, config);
85
85
  const segments = withoutEditPrefix(url.pathname).split("/").filter(Boolean);
86
- const positions = options.positions ?? ["header", "footer"];
86
+ const positions = options.positions ?? layoutRegionIds(config.layout);
87
87
  const blocks = options.blocks ?? [];
88
88
  const headerLocale = request.headers.get(CMSSY_LOCALE_HEADER) ?? void 0;
89
89
  const retry = options.retry ?? (options.prerendered === false ? "interactive" : "build");
@@ -134,7 +134,8 @@ async function loadCmssyPage(config, request, url, options = {}) {
134
134
  enabledLocales: slot.enabledLocales,
135
135
  isEdit,
136
136
  editorData,
137
- editorOrigin: slot.editorOrigin
137
+ editorOrigin: slot.editorOrigin,
138
+ ...config.layout ? { layoutRegions: config.layout.regions } : {}
138
139
  };
139
140
  }
140
141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/astro",
3
- "version": "12.14.2",
3
+ "version": "13.0.0",
4
4
  "description": "Astro bindings for cmssy headless sites: middleware, page loader, sitemap and robots.",
5
5
  "keywords": [
6
6
  "cmssy",
@@ -50,17 +50,17 @@
50
50
  ],
51
51
  "peerDependencies": {
52
52
  "astro": ">=4.16",
53
- "@cmssy/react": "^12.14.2"
53
+ "@cmssy/react": "^13.0.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^20.0.0",
57
57
  "tsup": "^8.3.0",
58
58
  "typescript": "^5.6.0",
59
59
  "vitest": "^2.1.0",
60
- "@cmssy/react": "12.14.2"
60
+ "@cmssy/react": "13.0.0"
61
61
  },
62
62
  "dependencies": {
63
- "@cmssy/core": "12.14.2"
63
+ "@cmssy/core": "13.0.0"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "tsup",