@cmssy/next 12.14.2 → 13.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
@@ -39,6 +39,10 @@ Object.defineProperty(exports, "defineCmssyConfig", {
39
39
  enumerable: true,
40
40
  get: function () { return core.defineCmssyConfig; }
41
41
  });
42
+ Object.defineProperty(exports, "defineCmssyLayout", {
43
+ enumerable: true,
44
+ get: function () { return core.defineCmssyLayout; }
45
+ });
42
46
  Object.defineProperty(exports, "localizeHref", {
43
47
  enumerable: true,
44
48
  get: function () { return core.localizeHref; }
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
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';
1
+ export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyLayout, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRegion, CmssyRegionOf, CmssyRetryMode, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, LayoutRegion, RetryOption, RetryPolicy, VerifyCmssyWebhookOptions, defineCmssyConfig, defineCmssyLayout, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
2
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';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
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';
1
+ export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyLayout, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRegion, CmssyRegionOf, CmssyRetryMode, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, LayoutRegion, RetryOption, RetryPolicy, VerifyCmssyWebhookOptions, defineCmssyConfig, defineCmssyLayout, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
2
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';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
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';
1
+ export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyWebhookError, DEFAULT_CMSSY_EDITOR_ORIGINS, defineCmssyConfig, defineCmssyLayout, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
2
2
 
3
3
  // src/index.ts
4
4
 
package/dist/server.cjs CHANGED
@@ -126,7 +126,10 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
126
126
  locale,
127
127
  defaultLocale,
128
128
  enabledLocales,
129
- edit: { editorOrigin: bridgeOrigin },
129
+ edit: {
130
+ editorOrigin: bridgeOrigin,
131
+ ...config.layout ? { layoutRegions: config.layout.regions } : {}
132
+ },
130
133
  forms,
131
134
  data: editorData.data,
132
135
  resolvedContent: editorData.content,
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
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';
2
+ import { CmssyConfig, CmssyRegionOf, RetryOption } from '@cmssy/core';
3
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';
@@ -13,10 +13,10 @@ declare function createDraftRoute(config: CmssyDraftRouteConfig): (request: Requ
13
13
 
14
14
  declare function isCmssyEditMode(): Promise<boolean>;
15
15
 
16
- interface CmssyLayoutSlotBaseProps {
17
- config: CmssyConfig;
16
+ interface CmssyLayoutSlotBaseProps<C extends CmssyConfig> {
17
+ config: C;
18
18
  blocks: BlockDefinition[];
19
- position: LayoutPosition;
19
+ position: CmssyRegionOf<C>;
20
20
  editMode: boolean;
21
21
  page?: string;
22
22
  editable: ComponentType<{
@@ -42,7 +42,7 @@ type CmssyLayoutSlotLocaleSource = {
42
42
  locale: string;
43
43
  path?: never;
44
44
  };
45
- type CmssyLayoutSlotProps = CmssyLayoutSlotBaseProps & CmssyLayoutSlotLocaleSource;
46
- declare function CmssyLayoutSlot({ config, blocks, position, path, locale: explicitLocale, editMode, page, editable: Editable, appContext, retry, }: CmssyLayoutSlotProps): Promise<react_jsx_runtime.JSX.Element>;
45
+ type CmssyLayoutSlotProps<C extends CmssyConfig = CmssyConfig> = CmssyLayoutSlotBaseProps<C> & CmssyLayoutSlotLocaleSource;
46
+ declare function CmssyLayoutSlot<C extends CmssyConfig>({ config, blocks, position, path, locale: explicitLocale, editMode, page, editable: Editable, appContext, retry, }: CmssyLayoutSlotProps<C>): Promise<react_jsx_runtime.JSX.Element>;
47
47
 
48
48
  export { type CmssyDraftRouteConfig, CmssyLayoutSlot, type CmssyLayoutSlotProps, createDraftRoute, isCmssyEditMode };
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
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';
2
+ import { CmssyConfig, CmssyRegionOf, RetryOption } from '@cmssy/core';
3
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';
@@ -13,10 +13,10 @@ declare function createDraftRoute(config: CmssyDraftRouteConfig): (request: Requ
13
13
 
14
14
  declare function isCmssyEditMode(): Promise<boolean>;
15
15
 
16
- interface CmssyLayoutSlotBaseProps {
17
- config: CmssyConfig;
16
+ interface CmssyLayoutSlotBaseProps<C extends CmssyConfig> {
17
+ config: C;
18
18
  blocks: BlockDefinition[];
19
- position: LayoutPosition;
19
+ position: CmssyRegionOf<C>;
20
20
  editMode: boolean;
21
21
  page?: string;
22
22
  editable: ComponentType<{
@@ -42,7 +42,7 @@ type CmssyLayoutSlotLocaleSource = {
42
42
  locale: string;
43
43
  path?: never;
44
44
  };
45
- type CmssyLayoutSlotProps = CmssyLayoutSlotBaseProps & CmssyLayoutSlotLocaleSource;
46
- declare function CmssyLayoutSlot({ config, blocks, position, path, locale: explicitLocale, editMode, page, editable: Editable, appContext, retry, }: CmssyLayoutSlotProps): Promise<react_jsx_runtime.JSX.Element>;
45
+ type CmssyLayoutSlotProps<C extends CmssyConfig = CmssyConfig> = CmssyLayoutSlotBaseProps<C> & CmssyLayoutSlotLocaleSource;
46
+ declare function CmssyLayoutSlot<C extends CmssyConfig>({ config, blocks, position, path, locale: explicitLocale, editMode, page, editable: Editable, appContext, retry, }: CmssyLayoutSlotProps<C>): Promise<react_jsx_runtime.JSX.Element>;
47
47
 
48
48
  export { type CmssyDraftRouteConfig, CmssyLayoutSlot, type CmssyLayoutSlotProps, createDraftRoute, isCmssyEditMode };
package/dist/server.js CHANGED
@@ -124,7 +124,10 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
124
124
  locale,
125
125
  defaultLocale,
126
126
  enabledLocales,
127
- edit: { editorOrigin: bridgeOrigin },
127
+ edit: {
128
+ editorOrigin: bridgeOrigin,
129
+ ...config.layout ? { layoutRegions: config.layout.regions } : {}
130
+ },
128
131
  forms,
129
132
  data: editorData.data,
130
133
  resolvedContent: editorData.content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/next",
3
- "version": "12.14.2",
3
+ "version": "13.0.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.14.2",
74
+ "@cmssy/react": "^13.0.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.14.2"
88
+ "@cmssy/react": "13.0.0"
89
89
  },
90
90
  "dependencies": {
91
- "@cmssy/types": "0.35.0",
91
+ "@cmssy/types": "0.37.0",
92
92
  "server-only": "^0.0.1",
93
- "@cmssy/core": "12.14.2"
93
+ "@cmssy/core": "13.0.0"
94
94
  },
95
95
  "scripts": {
96
96
  "build": "tsup",