@cmssy/next 9.6.0 → 9.7.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-C7l1HgN0.d.cts → index-C4vUxDkk.d.cts} +1 -0
- package/dist/{index-C7l1HgN0.d.ts → index-C4vUxDkk.d.ts} +1 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/server.cjs +9 -5
- package/dist/server.d.cts +2 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +10 -6
- package/package.json +3 -3
|
@@ -12,6 +12,7 @@ interface CmssyEditorProps {
|
|
|
12
12
|
edit: EditBridgeConfig;
|
|
13
13
|
forms?: Record<string, CmssyFormDefinition>;
|
|
14
14
|
data?: Record<string, unknown>;
|
|
15
|
+
resolvedContent?: Record<string, Record<string, unknown>>;
|
|
15
16
|
}
|
|
16
17
|
interface CreateCmssyPageOptions {
|
|
17
18
|
editor?: ComponentType<CmssyEditorProps>;
|
|
@@ -12,6 +12,7 @@ interface CmssyEditorProps {
|
|
|
12
12
|
edit: EditBridgeConfig;
|
|
13
13
|
forms?: Record<string, CmssyFormDefinition>;
|
|
14
14
|
data?: Record<string, unknown>;
|
|
15
|
+
resolvedContent?: Record<string, Record<string, unknown>>;
|
|
15
16
|
}
|
|
16
17
|
interface CreateCmssyPageOptions {
|
|
17
18
|
editor?: ComponentType<CmssyEditorProps>;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CMSSY_SESSION_COOKIE, CmssyAuthConfig, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, DEFAULT_CMSSY_EDITOR_ORIGINS, assertAuthConfig, defineCmssyConfig, resolveEditorOrigin } from '@cmssy/core';
|
|
2
|
-
export { C as CmssyEditorProps, a as CreateCmssyPageOptions } from './index-
|
|
2
|
+
export { C as CmssyEditorProps, a as CreateCmssyPageOptions } from './index-C4vUxDkk.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
1
|
export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CMSSY_SESSION_COOKIE, CmssyAuthConfig, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, DEFAULT_CMSSY_EDITOR_ORIGINS, assertAuthConfig, defineCmssyConfig, resolveEditorOrigin } from '@cmssy/core';
|
|
2
|
-
export { C as CmssyEditorProps, a as CreateCmssyPageOptions } from './index-
|
|
2
|
+
export { C as CmssyEditorProps, a as CreateCmssyPageOptions } from './index-C4vUxDkk.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@cmssy/react';
|
package/dist/server.cjs
CHANGED
|
@@ -121,7 +121,7 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
121
121
|
};
|
|
122
122
|
if (editorActive && Editor) {
|
|
123
123
|
const bridgeOrigin = resolveBridgeOrigin(config.editorOrigin);
|
|
124
|
-
const editorData = await react.
|
|
124
|
+
const editorData = await react.resolveEditorBlockData({
|
|
125
125
|
page,
|
|
126
126
|
blocks,
|
|
127
127
|
locale,
|
|
@@ -140,7 +140,8 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
140
140
|
enabledLocales,
|
|
141
141
|
edit: { editorOrigin: bridgeOrigin },
|
|
142
142
|
forms,
|
|
143
|
-
data: editorData
|
|
143
|
+
data: editorData.data,
|
|
144
|
+
resolvedContent: editorData.content
|
|
144
145
|
}
|
|
145
146
|
) });
|
|
146
147
|
}
|
|
@@ -330,14 +331,15 @@ async function CmssyLayoutSlot({
|
|
|
330
331
|
if (editMode && editable) {
|
|
331
332
|
const origin = core.resolveEditorOrigin(config.editorOrigin);
|
|
332
333
|
const Editable = editable;
|
|
333
|
-
const
|
|
334
|
+
const editorData = await react.resolveEditorLayoutBlockData({
|
|
334
335
|
groups,
|
|
335
336
|
blocks,
|
|
336
337
|
position,
|
|
337
338
|
locale,
|
|
338
339
|
defaultLocale: siteLocales.defaultLocale,
|
|
339
340
|
enabledLocales: siteLocales.locales,
|
|
340
|
-
isPreview: true
|
|
341
|
+
isPreview: true,
|
|
342
|
+
config
|
|
341
343
|
});
|
|
342
344
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
343
345
|
Editable,
|
|
@@ -350,7 +352,8 @@ async function CmssyLayoutSlot({
|
|
|
350
352
|
edit: {
|
|
351
353
|
editorOrigin: (Array.isArray(origin) ? origin[0] : origin) ?? ""
|
|
352
354
|
},
|
|
353
|
-
data
|
|
355
|
+
data: editorData.data,
|
|
356
|
+
resolvedContent: editorData.content
|
|
354
357
|
}
|
|
355
358
|
);
|
|
356
359
|
}
|
|
@@ -363,6 +366,7 @@ async function CmssyLayoutSlot({
|
|
|
363
366
|
locale,
|
|
364
367
|
defaultLocale: siteLocales.defaultLocale,
|
|
365
368
|
enabledLocales: siteLocales.locales,
|
|
369
|
+
config,
|
|
366
370
|
editMode
|
|
367
371
|
}
|
|
368
372
|
);
|
package/dist/server.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CmssyEditorProps, a as CreateCmssyPageOptions, c as createCmssyEditPage, b as createCmssyPage } from './index-
|
|
1
|
+
export { C as CmssyEditorProps, a as CreateCmssyPageOptions, c as createCmssyEditPage, b as createCmssyPage } from './index-C4vUxDkk.cjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ReactNode, ComponentType } from 'react';
|
|
4
4
|
import { BlockDefinition, CmssyLayoutGroup } from '@cmssy/react';
|
|
@@ -48,6 +48,7 @@ interface CmssyLayoutSlotProps {
|
|
|
48
48
|
editorOrigin: string;
|
|
49
49
|
};
|
|
50
50
|
data?: Record<string, unknown>;
|
|
51
|
+
resolvedContent?: Record<string, Record<string, unknown>>;
|
|
51
52
|
}>;
|
|
52
53
|
}
|
|
53
54
|
/**
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CmssyEditorProps, a as CreateCmssyPageOptions, c as createCmssyEditPage, b as createCmssyPage } from './index-
|
|
1
|
+
export { C as CmssyEditorProps, a as CreateCmssyPageOptions, c as createCmssyEditPage, b as createCmssyPage } from './index-C4vUxDkk.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ReactNode, ComponentType } from 'react';
|
|
4
4
|
import { BlockDefinition, CmssyLayoutGroup } from '@cmssy/react';
|
|
@@ -48,6 +48,7 @@ interface CmssyLayoutSlotProps {
|
|
|
48
48
|
editorOrigin: string;
|
|
49
49
|
};
|
|
50
50
|
data?: Record<string, unknown>;
|
|
51
|
+
resolvedContent?: Record<string, Record<string, unknown>>;
|
|
51
52
|
}>;
|
|
52
53
|
}
|
|
53
54
|
/**
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
2
|
import { draftMode, headers, cookies } from 'next/headers';
|
|
3
3
|
import { notFound, redirect } from 'next/navigation';
|
|
4
|
-
import { createCmssyClient, resolveSiteLocales, splitLocaleFromPath, fetchPage, resolveForms,
|
|
4
|
+
import { createCmssyClient, resolveSiteLocales, splitLocaleFromPath, fetchPage, resolveForms, resolveEditorBlockData, CmssyServerPage, fetchSiteConfig, fetchPageById, fetchLayouts, resolveEditorLayoutBlockData, CmssyServerLayout, normalizeSlug, fetchPageMeta, fetchPages } from '@cmssy/react';
|
|
5
5
|
import { CmssyLocaleProvider } from '@cmssy/react/client';
|
|
6
6
|
import { isDevelopment, CMSSY_SECRET_QUERY_PARAM, resolveEditorOrigin, toCspOrigin, CMSSY_EDIT_HEADER, localeForPath, CMSSY_LOCALE_HEADER, resolveSiteLocales as resolveSiteLocales$1, localesFromSiteConfig, localizedPath, normalizeSlug as normalizeSlug$1, assertAuthConfig, backendProduct, backendCheckout, backendMergeCart, backendSetShippingMethod, backendRemoveDiscount, backendApplyDiscount, backendClearCart, backendRemoveItem, backendUpdateItem, backendAddToCart, backendGetCart, backendMyOrder, backendMyOrders, cmssySecretsMatch, fetchProducts as fetchProducts$1, fetchProduct as fetchProduct$1, backendSignIn, toSessionPayload, backendRegister, backendSignOut, isAccessExpired, backendSignOutEverywhere, backendForgotPassword, backendResetPassword, backendVerifyEmail, CMSSY_SESSION_COOKIE, openSession, CMSSY_EDIT_QUERY_PARAM, sealSession, sessionCookieOptions, backendRefresh } from '@cmssy/core';
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -119,7 +119,7 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
119
119
|
};
|
|
120
120
|
if (editorActive && Editor) {
|
|
121
121
|
const bridgeOrigin = resolveBridgeOrigin(config.editorOrigin);
|
|
122
|
-
const editorData = await
|
|
122
|
+
const editorData = await resolveEditorBlockData({
|
|
123
123
|
page,
|
|
124
124
|
blocks,
|
|
125
125
|
locale,
|
|
@@ -138,7 +138,8 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
138
138
|
enabledLocales,
|
|
139
139
|
edit: { editorOrigin: bridgeOrigin },
|
|
140
140
|
forms,
|
|
141
|
-
data: editorData
|
|
141
|
+
data: editorData.data,
|
|
142
|
+
resolvedContent: editorData.content
|
|
142
143
|
}
|
|
143
144
|
) });
|
|
144
145
|
}
|
|
@@ -328,14 +329,15 @@ async function CmssyLayoutSlot({
|
|
|
328
329
|
if (editMode && editable) {
|
|
329
330
|
const origin = resolveEditorOrigin(config.editorOrigin);
|
|
330
331
|
const Editable = editable;
|
|
331
|
-
const
|
|
332
|
+
const editorData = await resolveEditorLayoutBlockData({
|
|
332
333
|
groups,
|
|
333
334
|
blocks,
|
|
334
335
|
position,
|
|
335
336
|
locale,
|
|
336
337
|
defaultLocale: siteLocales.defaultLocale,
|
|
337
338
|
enabledLocales: siteLocales.locales,
|
|
338
|
-
isPreview: true
|
|
339
|
+
isPreview: true,
|
|
340
|
+
config
|
|
339
341
|
});
|
|
340
342
|
return /* @__PURE__ */ jsx(
|
|
341
343
|
Editable,
|
|
@@ -348,7 +350,8 @@ async function CmssyLayoutSlot({
|
|
|
348
350
|
edit: {
|
|
349
351
|
editorOrigin: (Array.isArray(origin) ? origin[0] : origin) ?? ""
|
|
350
352
|
},
|
|
351
|
-
data
|
|
353
|
+
data: editorData.data,
|
|
354
|
+
resolvedContent: editorData.content
|
|
352
355
|
}
|
|
353
356
|
);
|
|
354
357
|
}
|
|
@@ -361,6 +364,7 @@ async function CmssyLayoutSlot({
|
|
|
361
364
|
locale,
|
|
362
365
|
defaultLocale: siteLocales.defaultLocale,
|
|
363
366
|
enabledLocales: siteLocales.locales,
|
|
367
|
+
config,
|
|
364
368
|
editMode
|
|
365
369
|
}
|
|
366
370
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/next",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.0",
|
|
4
4
|
"description": "Next.js App Router bindings for cmssy headless sites (createCmssyPage + draft preview)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
"tsup": "^8.3.0",
|
|
71
71
|
"typescript": "^5.6.0",
|
|
72
72
|
"vitest": "^2.1.0",
|
|
73
|
-
"@cmssy/react": "9.
|
|
73
|
+
"@cmssy/react": "9.7.0"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@cmssy/types": "0.29.0",
|
|
77
77
|
"server-only": "^0.0.1",
|
|
78
|
-
"@cmssy/core": "9.
|
|
78
|
+
"@cmssy/core": "9.7.0"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsup",
|