@cmssy/astro 12.9.0 → 12.11.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 +7 -3
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +7 -3
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -87,16 +87,19 @@ async function loadCmssyPage(config, request, url, options = {}) {
|
|
|
87
87
|
const positions = options.positions ?? ["header", "footer"];
|
|
88
88
|
const blocks = options.blocks ?? [];
|
|
89
89
|
const headerLocale = request.headers.get(internal.CMSSY_LOCALE_HEADER) ?? void 0;
|
|
90
|
+
const retry = options.retry ?? (options.prerendered === false ? "interactive" : "build");
|
|
90
91
|
const slot = await react.resolveCmssyLayoutSlot(config, {
|
|
91
92
|
position: positions[0] ?? "header",
|
|
92
93
|
blocks,
|
|
93
94
|
editMode: isEdit,
|
|
94
95
|
path: segments,
|
|
95
96
|
locale: headerLocale,
|
|
96
|
-
appContext: options.appContext
|
|
97
|
+
appContext: options.appContext,
|
|
98
|
+
retry
|
|
97
99
|
});
|
|
98
100
|
const page = await internal.fetchPage(config, slot.path, {
|
|
99
|
-
previewSecret: isEdit ? config.draftSecret : void 0
|
|
101
|
+
previewSecret: isEdit ? config.draftSecret : void 0,
|
|
102
|
+
retry
|
|
100
103
|
});
|
|
101
104
|
let editorData;
|
|
102
105
|
if (isEdit && slot.data && slot.resolvedContent) {
|
|
@@ -113,7 +116,8 @@ async function loadCmssyPage(config, request, url, options = {}) {
|
|
|
113
116
|
editMode: true,
|
|
114
117
|
path: segments,
|
|
115
118
|
locale: headerLocale,
|
|
116
|
-
appContext: options.appContext
|
|
119
|
+
appContext: options.appContext,
|
|
120
|
+
retry
|
|
117
121
|
});
|
|
118
122
|
if (extra.data && extra.resolvedContent) {
|
|
119
123
|
editorData[position] = {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CmssyConfig, CmssyPageData, CmssyLayoutGroup } from '@cmssy/core';
|
|
2
|
-
export { CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayoutGroup, CmssyPageData, CmssyWebhookError, CmssyWebhookEvent, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
|
|
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';
|
|
3
3
|
import { BlockDefinition } from '@cmssy/react';
|
|
4
4
|
|
|
5
5
|
declare const CMSSY_EDIT_PATH_PREFIX = "/cmssy-edit";
|
|
@@ -31,7 +31,9 @@ interface LoadCmssyPageOptions {
|
|
|
31
31
|
blocks?: BlockDefinition[];
|
|
32
32
|
positions?: string[];
|
|
33
33
|
appContext?: Record<string, unknown>;
|
|
34
|
+
retry?: RetryOption;
|
|
35
|
+
prerendered?: boolean;
|
|
34
36
|
}
|
|
35
37
|
declare function loadCmssyPage(config: CmssyConfig, request: Request, url: URL, options?: LoadCmssyPageOptions): Promise<CmssyPageResult>;
|
|
36
38
|
|
|
37
|
-
export { CMSSY_EDIT_PATH_PREFIX, type CmssyMiddlewareOptions, type CmssyPageResult, cmssyMiddleware, loadCmssyPage };
|
|
39
|
+
export { CMSSY_EDIT_PATH_PREFIX, type CmssyMiddlewareOptions, type CmssyPageResult, type LoadCmssyPageOptions, cmssyMiddleware, loadCmssyPage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CmssyConfig, CmssyPageData, CmssyLayoutGroup } from '@cmssy/core';
|
|
2
|
-
export { CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayoutGroup, CmssyPageData, CmssyWebhookError, CmssyWebhookEvent, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
|
|
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';
|
|
3
3
|
import { BlockDefinition } from '@cmssy/react';
|
|
4
4
|
|
|
5
5
|
declare const CMSSY_EDIT_PATH_PREFIX = "/cmssy-edit";
|
|
@@ -31,7 +31,9 @@ interface LoadCmssyPageOptions {
|
|
|
31
31
|
blocks?: BlockDefinition[];
|
|
32
32
|
positions?: string[];
|
|
33
33
|
appContext?: Record<string, unknown>;
|
|
34
|
+
retry?: RetryOption;
|
|
35
|
+
prerendered?: boolean;
|
|
34
36
|
}
|
|
35
37
|
declare function loadCmssyPage(config: CmssyConfig, request: Request, url: URL, options?: LoadCmssyPageOptions): Promise<CmssyPageResult>;
|
|
36
38
|
|
|
37
|
-
export { CMSSY_EDIT_PATH_PREFIX, type CmssyMiddlewareOptions, type CmssyPageResult, cmssyMiddleware, loadCmssyPage };
|
|
39
|
+
export { CMSSY_EDIT_PATH_PREFIX, type CmssyMiddlewareOptions, type CmssyPageResult, type LoadCmssyPageOptions, cmssyMiddleware, loadCmssyPage };
|
package/dist/index.js
CHANGED
|
@@ -86,16 +86,19 @@ async function loadCmssyPage(config, request, url, options = {}) {
|
|
|
86
86
|
const positions = options.positions ?? ["header", "footer"];
|
|
87
87
|
const blocks = options.blocks ?? [];
|
|
88
88
|
const headerLocale = request.headers.get(CMSSY_LOCALE_HEADER) ?? void 0;
|
|
89
|
+
const retry = options.retry ?? (options.prerendered === false ? "interactive" : "build");
|
|
89
90
|
const slot = await resolveCmssyLayoutSlot(config, {
|
|
90
91
|
position: positions[0] ?? "header",
|
|
91
92
|
blocks,
|
|
92
93
|
editMode: isEdit,
|
|
93
94
|
path: segments,
|
|
94
95
|
locale: headerLocale,
|
|
95
|
-
appContext: options.appContext
|
|
96
|
+
appContext: options.appContext,
|
|
97
|
+
retry
|
|
96
98
|
});
|
|
97
99
|
const page = await fetchPage(config, slot.path, {
|
|
98
|
-
previewSecret: isEdit ? config.draftSecret : void 0
|
|
100
|
+
previewSecret: isEdit ? config.draftSecret : void 0,
|
|
101
|
+
retry
|
|
99
102
|
});
|
|
100
103
|
let editorData;
|
|
101
104
|
if (isEdit && slot.data && slot.resolvedContent) {
|
|
@@ -112,7 +115,8 @@ async function loadCmssyPage(config, request, url, options = {}) {
|
|
|
112
115
|
editMode: true,
|
|
113
116
|
path: segments,
|
|
114
117
|
locale: headerLocale,
|
|
115
|
-
appContext: options.appContext
|
|
118
|
+
appContext: options.appContext,
|
|
119
|
+
retry
|
|
116
120
|
});
|
|
117
121
|
if (extra.data && extra.resolvedContent) {
|
|
118
122
|
editorData[position] = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/astro",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.11.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.
|
|
53
|
+
"@cmssy/react": "^12.11.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.
|
|
60
|
+
"@cmssy/react": "12.11.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@cmssy/core": "12.
|
|
63
|
+
"@cmssy/core": "12.11.0"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "tsup",
|