@cmssy/astro 14.2.0 → 15.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,12 +84,12 @@ 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 ?? internal.layoutRegionIds(config.layout);
87
+ const regions = options.regions ?? 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");
91
91
  const slot = await react.resolveCmssyLayoutSlot(config, {
92
- position: positions[0] ?? "header",
92
+ region: regions[0] ?? "header",
93
93
  blocks,
94
94
  editMode: isEdit,
95
95
  path: segments,
@@ -104,14 +104,14 @@ async function loadCmssyPage(config, request, url, options = {}) {
104
104
  let editorData;
105
105
  if (isEdit && slot.data && slot.resolvedContent) {
106
106
  editorData = {
107
- [positions[0] ?? "header"]: {
107
+ [regions[0] ?? "header"]: {
108
108
  data: slot.data,
109
109
  resolvedContent: slot.resolvedContent
110
110
  }
111
111
  };
112
- for (const position of positions.slice(1)) {
112
+ for (const region of regions.slice(1)) {
113
113
  const extra = await react.resolveCmssyLayoutSlot(config, {
114
- position,
114
+ region,
115
115
  blocks,
116
116
  editMode: true,
117
117
  path: segments,
@@ -120,7 +120,7 @@ async function loadCmssyPage(config, request, url, options = {}) {
120
120
  retry
121
121
  });
122
122
  if (extra.data && extra.resolvedContent) {
123
- editorData[position] = {
123
+ editorData[region] = {
124
124
  data: extra.data,
125
125
  resolvedContent: extra.resolvedContent
126
126
  };
package/dist/index.d.cts CHANGED
@@ -32,7 +32,7 @@ interface CmssyLayoutEditorData {
32
32
  }
33
33
  interface LoadCmssyPageOptions {
34
34
  blocks?: BlockDefinition[];
35
- positions?: string[];
35
+ regions?: string[];
36
36
  appContext?: Record<string, unknown>;
37
37
  retry?: RetryOption;
38
38
  prerendered?: boolean;
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ interface CmssyLayoutEditorData {
32
32
  }
33
33
  interface LoadCmssyPageOptions {
34
34
  blocks?: BlockDefinition[];
35
- positions?: string[];
35
+ regions?: string[];
36
36
  appContext?: Record<string, unknown>;
37
37
  retry?: RetryOption;
38
38
  prerendered?: boolean;
package/dist/index.js CHANGED
@@ -84,12 +84,12 @@ function withoutEditPrefix(pathname) {
84
84
  async function loadCmssyPage(config, request, url, options = {}) {
85
85
  const isEdit = request.headers.get(CMSSY_EDIT_HEADER) === "1" || await isVerifiedEditUrl(url, config);
86
86
  const segments = withoutEditPrefix(url.pathname).split("/").filter(Boolean);
87
- const positions = options.positions ?? layoutRegionIds(config.layout);
87
+ const regions = options.regions ?? layoutRegionIds(config.layout);
88
88
  const blocks = options.blocks ?? [];
89
89
  const headerLocale = request.headers.get(CMSSY_LOCALE_HEADER) ?? void 0;
90
90
  const retry = options.retry ?? (options.prerendered === false ? "interactive" : "build");
91
91
  const slot = await resolveCmssyLayoutSlot(config, {
92
- position: positions[0] ?? "header",
92
+ region: regions[0] ?? "header",
93
93
  blocks,
94
94
  editMode: isEdit,
95
95
  path: segments,
@@ -104,14 +104,14 @@ async function loadCmssyPage(config, request, url, options = {}) {
104
104
  let editorData;
105
105
  if (isEdit && slot.data && slot.resolvedContent) {
106
106
  editorData = {
107
- [positions[0] ?? "header"]: {
107
+ [regions[0] ?? "header"]: {
108
108
  data: slot.data,
109
109
  resolvedContent: slot.resolvedContent
110
110
  }
111
111
  };
112
- for (const position of positions.slice(1)) {
112
+ for (const region of regions.slice(1)) {
113
113
  const extra = await resolveCmssyLayoutSlot(config, {
114
- position,
114
+ region,
115
115
  blocks,
116
116
  editMode: true,
117
117
  path: segments,
@@ -120,7 +120,7 @@ async function loadCmssyPage(config, request, url, options = {}) {
120
120
  retry
121
121
  });
122
122
  if (extra.data && extra.resolvedContent) {
123
- editorData[position] = {
123
+ editorData[region] = {
124
124
  data: extra.data,
125
125
  resolvedContent: extra.resolvedContent
126
126
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/astro",
3
- "version": "14.2.0",
3
+ "version": "15.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": "^14.2.0"
53
+ "@cmssy/react": "^15.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": "14.2.0"
60
+ "@cmssy/react": "15.0.0"
61
61
  },
62
62
  "dependencies": {
63
- "@cmssy/core": "14.2.0"
63
+ "@cmssy/core": "15.0.0"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "tsup",