@cmssy/astro 14.1.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 +6 -6
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/package.json +4 -4
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
|
|
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
|
-
|
|
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
|
-
[
|
|
107
|
+
[regions[0] ?? "header"]: {
|
|
108
108
|
data: slot.data,
|
|
109
109
|
resolvedContent: slot.resolvedContent
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
-
for (const
|
|
112
|
+
for (const region of regions.slice(1)) {
|
|
113
113
|
const extra = await react.resolveCmssyLayoutSlot(config, {
|
|
114
|
-
|
|
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[
|
|
123
|
+
editorData[region] = {
|
|
124
124
|
data: extra.data,
|
|
125
125
|
resolvedContent: extra.resolvedContent
|
|
126
126
|
};
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
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
|
|
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
|
-
|
|
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
|
-
[
|
|
107
|
+
[regions[0] ?? "header"]: {
|
|
108
108
|
data: slot.data,
|
|
109
109
|
resolvedContent: slot.resolvedContent
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
-
for (const
|
|
112
|
+
for (const region of regions.slice(1)) {
|
|
113
113
|
const extra = await resolveCmssyLayoutSlot(config, {
|
|
114
|
-
|
|
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[
|
|
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": "
|
|
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": "^
|
|
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": "
|
|
60
|
+
"@cmssy/react": "15.0.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@cmssy/core": "
|
|
63
|
+
"@cmssy/core": "15.0.0"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "tsup",
|