@cmssy/next 12.10.0 → 12.12.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.
@@ -1,9 +1,12 @@
1
- import { RetryPolicy, CmssyConfig } from '@cmssy/core';
1
+ import { CmssyRetryMode, RetryOption, CmssyConfig } from '@cmssy/core';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { ComponentType } from 'react';
4
4
  import { CmssyPageData, CmssyFormDefinition, BlockDefinition } from '@cmssy/react';
5
5
  import { EditBridgeConfig } from '@cmssy/react/client';
6
6
 
7
+ declare const NEXT_BUILD_PHASE = "phase-production-build";
8
+ declare function nextRetryMode(): CmssyRetryMode;
9
+
7
10
  interface CmssyEditorProps {
8
11
  page: CmssyPageData;
9
12
  locale: string;
@@ -24,7 +27,7 @@ interface CreateCmssyPageOptions {
24
27
  editor?: ComponentType<CmssyEditorProps>;
25
28
  path?: string;
26
29
  appContext?: CmssyAppContext;
27
- retry?: RetryPolicy | false;
30
+ retry?: RetryOption;
28
31
  }
29
32
  interface CatchAllParams {
30
33
  path?: string[];
@@ -37,4 +40,4 @@ interface CatchAllProps {
37
40
  declare function createCmssyPage(config: CmssyConfig, blocks: BlockDefinition[], options?: CreateCmssyPageOptions): ({ params, searchParams, }: CatchAllProps) => Promise<react_jsx_runtime.JSX.Element>;
38
41
  declare function createCmssyEditPage(config: CmssyConfig, blocks: BlockDefinition[], options?: CreateCmssyPageOptions): ({ params, searchParams, }: CatchAllProps) => Promise<react_jsx_runtime.JSX.Element>;
39
42
 
40
- export { type CmssyAppContext as C, type CmssyEditorProps as a, type CreateCmssyPageOptions as b, createCmssyEditPage as c, createCmssyPage as d };
43
+ export { type CmssyAppContext as C, NEXT_BUILD_PHASE as N, type CmssyEditorProps as a, type CreateCmssyPageOptions as b, createCmssyEditPage as c, createCmssyPage as d, nextRetryMode as n };
@@ -1,9 +1,12 @@
1
- import { RetryPolicy, CmssyConfig } from '@cmssy/core';
1
+ import { CmssyRetryMode, RetryOption, CmssyConfig } from '@cmssy/core';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { ComponentType } from 'react';
4
4
  import { CmssyPageData, CmssyFormDefinition, BlockDefinition } from '@cmssy/react';
5
5
  import { EditBridgeConfig } from '@cmssy/react/client';
6
6
 
7
+ declare const NEXT_BUILD_PHASE = "phase-production-build";
8
+ declare function nextRetryMode(): CmssyRetryMode;
9
+
7
10
  interface CmssyEditorProps {
8
11
  page: CmssyPageData;
9
12
  locale: string;
@@ -24,7 +27,7 @@ interface CreateCmssyPageOptions {
24
27
  editor?: ComponentType<CmssyEditorProps>;
25
28
  path?: string;
26
29
  appContext?: CmssyAppContext;
27
- retry?: RetryPolicy | false;
30
+ retry?: RetryOption;
28
31
  }
29
32
  interface CatchAllParams {
30
33
  path?: string[];
@@ -37,4 +40,4 @@ interface CatchAllProps {
37
40
  declare function createCmssyPage(config: CmssyConfig, blocks: BlockDefinition[], options?: CreateCmssyPageOptions): ({ params, searchParams, }: CatchAllProps) => Promise<react_jsx_runtime.JSX.Element>;
38
41
  declare function createCmssyEditPage(config: CmssyConfig, blocks: BlockDefinition[], options?: CreateCmssyPageOptions): ({ params, searchParams, }: CatchAllProps) => Promise<react_jsx_runtime.JSX.Element>;
39
42
 
40
- export { type CmssyAppContext as C, type CmssyEditorProps as a, type CreateCmssyPageOptions as b, createCmssyEditPage as c, createCmssyPage as d };
43
+ export { type CmssyAppContext as C, NEXT_BUILD_PHASE as N, type CmssyEditorProps as a, type CreateCmssyPageOptions as b, createCmssyEditPage as c, createCmssyPage as d, nextRetryMode as n };
package/dist/index.cjs CHANGED
@@ -2,7 +2,14 @@
2
2
 
3
3
  var core = require('@cmssy/core');
4
4
 
5
+ // src/index.ts
5
6
 
7
+ // src/retry-mode.ts
8
+ var NEXT_BUILD_PHASE = "phase-production-build";
9
+ function nextRetryMode() {
10
+ const phase = typeof process !== "undefined" ? process.env?.NEXT_PHASE : void 0;
11
+ return phase === NEXT_BUILD_PHASE ? "build" : "interactive";
12
+ }
6
13
 
7
14
  Object.defineProperty(exports, "CMSSY_EDIT_HEADER", {
8
15
  enumerable: true,
@@ -44,3 +51,5 @@ Object.defineProperty(exports, "verifyCmssyWebhook", {
44
51
  enumerable: true,
45
52
  get: function () { return core.verifyCmssyWebhook; }
46
53
  });
54
+ exports.NEXT_BUILD_PHASE = NEXT_BUILD_PHASE;
55
+ exports.nextRetryMode = nextRetryMode;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, RetryPolicy, VerifyCmssyWebhookOptions, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
2
- export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions } from './index-Q_bLE9vs.cjs';
1
+ export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRetryMode, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, RetryOption, RetryPolicy, VerifyCmssyWebhookOptions, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
2
+ export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, N as NEXT_BUILD_PHASE, n as nextRetryMode } from './index-ZUEbpOlo.cjs';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
5
5
  import '@cmssy/react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, RetryPolicy, VerifyCmssyWebhookOptions, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
2
- export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions } from './index-Q_bLE9vs.js';
1
+ export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRetryMode, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, RetryOption, RetryPolicy, VerifyCmssyWebhookOptions, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
2
+ export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, N as NEXT_BUILD_PHASE, n as nextRetryMode } from './index-ZUEbpOlo.js';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
5
5
  import '@cmssy/react';
package/dist/index.js CHANGED
@@ -1 +1,12 @@
1
1
  export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyWebhookError, DEFAULT_CMSSY_EDITOR_ORIGINS, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
2
+
3
+ // src/index.ts
4
+
5
+ // src/retry-mode.ts
6
+ var NEXT_BUILD_PHASE = "phase-production-build";
7
+ function nextRetryMode() {
8
+ const phase = typeof process !== "undefined" ? process.env?.NEXT_PHASE : void 0;
9
+ return phase === NEXT_BUILD_PHASE ? "build" : "interactive";
10
+ }
11
+
12
+ export { NEXT_BUILD_PHASE, nextRetryMode };
package/dist/server.cjs CHANGED
@@ -11,6 +11,13 @@ var core = require('@cmssy/core');
11
11
  var jsxRuntime = require('react/jsx-runtime');
12
12
 
13
13
  // src/server.ts
14
+
15
+ // src/retry-mode.ts
16
+ var NEXT_BUILD_PHASE = "phase-production-build";
17
+ function nextRetryMode() {
18
+ const phase = typeof process !== "undefined" ? process.env?.NEXT_PHASE : void 0;
19
+ return phase === NEXT_BUILD_PHASE ? "build" : "interactive";
20
+ }
14
21
  function hasEditFlag(value) {
15
22
  return Array.isArray(value) ? value.includes("1") : value === "1";
16
23
  }
@@ -42,7 +49,7 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
42
49
  workspaceSlug: config.workspaceSlug
43
50
  };
44
51
  const client = react.createCmssyClient(clientConfig);
45
- const requestOptions = { retry: options?.retry ?? {} };
52
+ const requestOptions = { retry: options?.retry ?? nextRetryMode() };
46
53
  const fixedPath = options?.path?.split("/").map((segment) => segment.trim()).filter(Boolean);
47
54
  return async function CmssyCatchAllPage({
48
55
  params,
@@ -265,7 +272,7 @@ async function CmssyLayoutSlot({
265
272
  editMode,
266
273
  page,
267
274
  appContext,
268
- retry: retry ?? {},
275
+ retry: retry ?? nextRetryMode(),
269
276
  ...explicitLocale !== void 0 ? { locale: explicitLocale } : { path: path ?? [] }
270
277
  });
271
278
  const { groups, locale, defaultLocale, enabledLocales } = resolved;
@@ -302,7 +309,9 @@ async function CmssyLayoutSlot({
302
309
  }
303
310
 
304
311
  exports.CmssyLayoutSlot = CmssyLayoutSlot;
312
+ exports.NEXT_BUILD_PHASE = NEXT_BUILD_PHASE;
305
313
  exports.createCmssyEditPage = createCmssyEditPage;
306
314
  exports.createCmssyPage = createCmssyPage;
307
315
  exports.createDraftRoute = createDraftRoute;
308
316
  exports.isCmssyEditMode = isCmssyEditMode;
317
+ exports.nextRetryMode = nextRetryMode;
package/dist/server.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, c as createCmssyEditPage, d as createCmssyPage } from './index-Q_bLE9vs.cjs';
2
- import { CmssyConfig, LayoutPosition, RetryPolicy } from '@cmssy/core';
3
- export { RetryPolicy } from '@cmssy/core';
1
+ export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, N as NEXT_BUILD_PHASE, c as createCmssyEditPage, d as createCmssyPage, n as nextRetryMode } from './index-ZUEbpOlo.cjs';
2
+ import { CmssyConfig, LayoutPosition, RetryOption } from '@cmssy/core';
3
+ export { CmssyRetryMode, RetryOption, RetryPolicy } from '@cmssy/core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ComponentType } from 'react';
6
6
  import { BlockDefinition, CmssyLayoutGroup } from '@cmssy/react';
@@ -33,7 +33,7 @@ interface CmssyLayoutSlotBaseProps {
33
33
  appContext?: Record<string, unknown>;
34
34
  }>;
35
35
  appContext?: Record<string, unknown>;
36
- retry?: RetryPolicy | false;
36
+ retry?: RetryOption;
37
37
  }
38
38
  type CmssyLayoutSlotLocaleSource = {
39
39
  path: string[];
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, c as createCmssyEditPage, d as createCmssyPage } from './index-Q_bLE9vs.js';
2
- import { CmssyConfig, LayoutPosition, RetryPolicy } from '@cmssy/core';
3
- export { RetryPolicy } from '@cmssy/core';
1
+ export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, N as NEXT_BUILD_PHASE, c as createCmssyEditPage, d as createCmssyPage, n as nextRetryMode } from './index-ZUEbpOlo.js';
2
+ import { CmssyConfig, LayoutPosition, RetryOption } from '@cmssy/core';
3
+ export { CmssyRetryMode, RetryOption, RetryPolicy } from '@cmssy/core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ComponentType } from 'react';
6
6
  import { BlockDefinition, CmssyLayoutGroup } from '@cmssy/react';
@@ -33,7 +33,7 @@ interface CmssyLayoutSlotBaseProps {
33
33
  appContext?: Record<string, unknown>;
34
34
  }>;
35
35
  appContext?: Record<string, unknown>;
36
- retry?: RetryPolicy | false;
36
+ retry?: RetryOption;
37
37
  }
38
38
  type CmssyLayoutSlotLocaleSource = {
39
39
  path: string[];
package/dist/server.js CHANGED
@@ -9,6 +9,13 @@ import { CMSSY_SECRET_QUERY_PARAM, resolveEditorOrigin, CMSSY_EDIT_HEADER, CMSSY
9
9
  import { jsx } from 'react/jsx-runtime';
10
10
 
11
11
  // src/server.ts
12
+
13
+ // src/retry-mode.ts
14
+ var NEXT_BUILD_PHASE = "phase-production-build";
15
+ function nextRetryMode() {
16
+ const phase = typeof process !== "undefined" ? process.env?.NEXT_PHASE : void 0;
17
+ return phase === NEXT_BUILD_PHASE ? "build" : "interactive";
18
+ }
12
19
  function hasEditFlag(value) {
13
20
  return Array.isArray(value) ? value.includes("1") : value === "1";
14
21
  }
@@ -40,7 +47,7 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
40
47
  workspaceSlug: config.workspaceSlug
41
48
  };
42
49
  const client = createCmssyClient(clientConfig);
43
- const requestOptions = { retry: options?.retry ?? {} };
50
+ const requestOptions = { retry: options?.retry ?? nextRetryMode() };
44
51
  const fixedPath = options?.path?.split("/").map((segment) => segment.trim()).filter(Boolean);
45
52
  return async function CmssyCatchAllPage({
46
53
  params,
@@ -263,7 +270,7 @@ async function CmssyLayoutSlot({
263
270
  editMode,
264
271
  page,
265
272
  appContext,
266
- retry: retry ?? {},
273
+ retry: retry ?? nextRetryMode(),
267
274
  ...explicitLocale !== void 0 ? { locale: explicitLocale } : { path: path ?? [] }
268
275
  });
269
276
  const { groups, locale, defaultLocale, enabledLocales } = resolved;
@@ -299,4 +306,4 @@ async function CmssyLayoutSlot({
299
306
  );
300
307
  }
301
308
 
302
- export { CmssyLayoutSlot, createCmssyEditPage, createCmssyPage, createDraftRoute, isCmssyEditMode };
309
+ export { CmssyLayoutSlot, NEXT_BUILD_PHASE, createCmssyEditPage, createCmssyPage, createDraftRoute, isCmssyEditMode, nextRetryMode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/next",
3
- "version": "12.10.0",
3
+ "version": "12.12.0",
4
4
  "description": "Next.js App Router bindings for cmssy headless sites (createCmssyPage + draft preview)",
5
5
  "keywords": [
6
6
  "cmssy",
@@ -71,7 +71,7 @@
71
71
  "dist"
72
72
  ],
73
73
  "peerDependencies": {
74
- "@cmssy/react": "^12.10.0",
74
+ "@cmssy/react": "^12.12.0",
75
75
  "next": ">=15",
76
76
  "react": "^18.2.0 || ^19.0.0",
77
77
  "react-dom": "^18.2.0 || ^19.0.0"
@@ -85,12 +85,12 @@
85
85
  "tsup": "^8.3.0",
86
86
  "typescript": "^5.6.0",
87
87
  "vitest": "^2.1.0",
88
- "@cmssy/react": "12.10.0"
88
+ "@cmssy/react": "12.12.0"
89
89
  },
90
90
  "dependencies": {
91
91
  "@cmssy/types": "0.35.0",
92
92
  "server-only": "^0.0.1",
93
- "@cmssy/core": "12.10.0"
93
+ "@cmssy/core": "12.12.0"
94
94
  },
95
95
  "scripts": {
96
96
  "build": "tsup",