@cmssy/remix 12.8.0 → 12.10.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 +8 -4
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +8 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -11,6 +11,7 @@ function createCmssyLoader(config, options = {}) {
|
|
|
11
11
|
request
|
|
12
12
|
}) {
|
|
13
13
|
const url = new URL(request.url);
|
|
14
|
+
const retry = options.retry ?? {};
|
|
14
15
|
const isEdit = await core.isVerifiedEditUrl(url, config);
|
|
15
16
|
const editRequested = url.searchParams.getAll(core.CMSSY_EDIT_QUERY_PARAM).includes("1");
|
|
16
17
|
if (!isEdit && editRequested && internal.isDevelopment()) {
|
|
@@ -20,7 +21,7 @@ function createCmssyLoader(config, options = {}) {
|
|
|
20
21
|
providedSecret: url.searchParams.get(core.CMSSY_SECRET_QUERY_PARAM),
|
|
21
22
|
devOrigin: url.origin
|
|
22
23
|
});
|
|
23
|
-
const locales = await internal.resolveSiteLocales(config);
|
|
24
|
+
const locales = await internal.resolveSiteLocales(config, { retry });
|
|
24
25
|
return {
|
|
25
26
|
page: null,
|
|
26
27
|
layouts: [],
|
|
@@ -42,10 +43,12 @@ function createCmssyLoader(config, options = {}) {
|
|
|
42
43
|
editMode: isEdit,
|
|
43
44
|
path: segments,
|
|
44
45
|
locale: headerLocale,
|
|
45
|
-
appContext: options.appContext
|
|
46
|
+
appContext: options.appContext,
|
|
47
|
+
retry
|
|
46
48
|
});
|
|
47
49
|
const page = await internal.fetchPage(config, slot.path, {
|
|
48
|
-
previewSecret: isEdit ? config.draftSecret : void 0
|
|
50
|
+
previewSecret: isEdit ? config.draftSecret : void 0,
|
|
51
|
+
retry
|
|
49
52
|
});
|
|
50
53
|
let editorData;
|
|
51
54
|
if (isEdit && slot.data && slot.resolvedContent) {
|
|
@@ -62,7 +65,8 @@ function createCmssyLoader(config, options = {}) {
|
|
|
62
65
|
editMode: true,
|
|
63
66
|
path: segments,
|
|
64
67
|
locale: headerLocale,
|
|
65
|
-
appContext: options.appContext
|
|
68
|
+
appContext: options.appContext,
|
|
69
|
+
retry
|
|
66
70
|
});
|
|
67
71
|
if (extra.data && extra.resolvedContent) {
|
|
68
72
|
editorData[position] = {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CmssyPageData, CmssyLayoutGroup, CmssyConfig } from '@cmssy/core';
|
|
2
|
-
export { CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayoutGroup, CmssyPageData, CmssyWebhookError, CmssyWebhookEvent, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, isVerifiedEditUrl, localizeHref, verifyCmssyWebhook } from '@cmssy/core';
|
|
1
|
+
import { CmssyPageData, CmssyLayoutGroup, RetryPolicy, CmssyConfig } from '@cmssy/core';
|
|
2
|
+
export { CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayoutGroup, CmssyPageData, CmssyWebhookError, CmssyWebhookEvent, RetryPolicy, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, isVerifiedEditUrl, localizeHref, verifyCmssyWebhook } from '@cmssy/core';
|
|
3
3
|
import { BlockDefinition } from '@cmssy/react';
|
|
4
4
|
|
|
5
5
|
interface CmssyRouteData {
|
|
@@ -21,6 +21,7 @@ interface CreateCmssyLoaderOptions {
|
|
|
21
21
|
blocks?: BlockDefinition[];
|
|
22
22
|
positions?: string[];
|
|
23
23
|
appContext?: Record<string, unknown>;
|
|
24
|
+
retry?: RetryPolicy | false;
|
|
24
25
|
}
|
|
25
26
|
declare function createCmssyLoader(config: CmssyConfig, options?: CreateCmssyLoaderOptions): ({ request, }: {
|
|
26
27
|
request: Request;
|
|
@@ -29,4 +30,4 @@ declare function createCmssyHeaders(config: CmssyConfig): () => Record<string, s
|
|
|
29
30
|
|
|
30
31
|
declare function useCmssyLocale(): string | undefined;
|
|
31
32
|
|
|
32
|
-
export { type CmssyRouteData, createCmssyHeaders, createCmssyLoader, useCmssyLocale };
|
|
33
|
+
export { type CmssyRouteData, type CreateCmssyLoaderOptions, createCmssyHeaders, createCmssyLoader, useCmssyLocale };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CmssyPageData, CmssyLayoutGroup, CmssyConfig } from '@cmssy/core';
|
|
2
|
-
export { CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayoutGroup, CmssyPageData, CmssyWebhookError, CmssyWebhookEvent, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, isVerifiedEditUrl, localizeHref, verifyCmssyWebhook } from '@cmssy/core';
|
|
1
|
+
import { CmssyPageData, CmssyLayoutGroup, RetryPolicy, CmssyConfig } from '@cmssy/core';
|
|
2
|
+
export { CMSSY_LOCALE_HEADER, CmssyBlockContext, CmssyConfig, CmssyEnvConfig, CmssyLayoutGroup, CmssyPageData, CmssyWebhookError, CmssyWebhookEvent, RetryPolicy, VerifyCmssyWebhookOptions, createCmssyClient, defineCmssyConfig, isVerifiedEditUrl, localizeHref, verifyCmssyWebhook } from '@cmssy/core';
|
|
3
3
|
import { BlockDefinition } from '@cmssy/react';
|
|
4
4
|
|
|
5
5
|
interface CmssyRouteData {
|
|
@@ -21,6 +21,7 @@ interface CreateCmssyLoaderOptions {
|
|
|
21
21
|
blocks?: BlockDefinition[];
|
|
22
22
|
positions?: string[];
|
|
23
23
|
appContext?: Record<string, unknown>;
|
|
24
|
+
retry?: RetryPolicy | false;
|
|
24
25
|
}
|
|
25
26
|
declare function createCmssyLoader(config: CmssyConfig, options?: CreateCmssyLoaderOptions): ({ request, }: {
|
|
26
27
|
request: Request;
|
|
@@ -29,4 +30,4 @@ declare function createCmssyHeaders(config: CmssyConfig): () => Record<string, s
|
|
|
29
30
|
|
|
30
31
|
declare function useCmssyLocale(): string | undefined;
|
|
31
32
|
|
|
32
|
-
export { type CmssyRouteData, createCmssyHeaders, createCmssyLoader, useCmssyLocale };
|
|
33
|
+
export { type CmssyRouteData, type CreateCmssyLoaderOptions, createCmssyHeaders, createCmssyLoader, useCmssyLocale };
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ function createCmssyLoader(config, options = {}) {
|
|
|
10
10
|
request
|
|
11
11
|
}) {
|
|
12
12
|
const url = new URL(request.url);
|
|
13
|
+
const retry = options.retry ?? {};
|
|
13
14
|
const isEdit = await isVerifiedEditUrl(url, config);
|
|
14
15
|
const editRequested = url.searchParams.getAll(CMSSY_EDIT_QUERY_PARAM).includes("1");
|
|
15
16
|
if (!isEdit && editRequested && isDevelopment()) {
|
|
@@ -19,7 +20,7 @@ function createCmssyLoader(config, options = {}) {
|
|
|
19
20
|
providedSecret: url.searchParams.get(CMSSY_SECRET_QUERY_PARAM),
|
|
20
21
|
devOrigin: url.origin
|
|
21
22
|
});
|
|
22
|
-
const locales = await resolveSiteLocales(config);
|
|
23
|
+
const locales = await resolveSiteLocales(config, { retry });
|
|
23
24
|
return {
|
|
24
25
|
page: null,
|
|
25
26
|
layouts: [],
|
|
@@ -41,10 +42,12 @@ function createCmssyLoader(config, options = {}) {
|
|
|
41
42
|
editMode: isEdit,
|
|
42
43
|
path: segments,
|
|
43
44
|
locale: headerLocale,
|
|
44
|
-
appContext: options.appContext
|
|
45
|
+
appContext: options.appContext,
|
|
46
|
+
retry
|
|
45
47
|
});
|
|
46
48
|
const page = await fetchPage(config, slot.path, {
|
|
47
|
-
previewSecret: isEdit ? config.draftSecret : void 0
|
|
49
|
+
previewSecret: isEdit ? config.draftSecret : void 0,
|
|
50
|
+
retry
|
|
48
51
|
});
|
|
49
52
|
let editorData;
|
|
50
53
|
if (isEdit && slot.data && slot.resolvedContent) {
|
|
@@ -61,7 +64,8 @@ function createCmssyLoader(config, options = {}) {
|
|
|
61
64
|
editMode: true,
|
|
62
65
|
path: segments,
|
|
63
66
|
locale: headerLocale,
|
|
64
|
-
appContext: options.appContext
|
|
67
|
+
appContext: options.appContext,
|
|
68
|
+
retry
|
|
65
69
|
});
|
|
66
70
|
if (extra.data && extra.resolvedContent) {
|
|
67
71
|
editorData[position] = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/remix",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.10.0",
|
|
4
4
|
"description": "React Router 7 bindings for cmssy headless sites: page loader, framing CSP, sitemap and robots.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
],
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react-router": ">=7",
|
|
54
|
-
"@cmssy/react": "^12.
|
|
54
|
+
"@cmssy/react": "^12.10.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^20.0.0",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"tsup": "^8.3.0",
|
|
60
60
|
"typescript": "^5.6.0",
|
|
61
61
|
"vitest": "^2.1.0",
|
|
62
|
-
"@cmssy/react": "12.
|
|
62
|
+
"@cmssy/react": "12.10.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@cmssy/core": "12.
|
|
65
|
+
"@cmssy/core": "12.10.0"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsup",
|