@cmssy/next 0.7.5 → 0.7.6
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 +4 -7
- package/dist/index.js +4 -7
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -204,7 +204,6 @@ function applyCmssyCsp(response, options) {
|
|
|
204
204
|
return response;
|
|
205
205
|
}
|
|
206
206
|
var EDIT_QUERY_PARAM = "cmssyEdit";
|
|
207
|
-
var DEV_QUERY_PARAM = "cmssyDev";
|
|
208
207
|
function hasEditFlag(value) {
|
|
209
208
|
return Array.isArray(value) ? value.includes("1") : value === "1";
|
|
210
209
|
}
|
|
@@ -229,9 +228,7 @@ function createCmssyPage(config, blocks, options) {
|
|
|
229
228
|
const query = searchParams ? await searchParams : {};
|
|
230
229
|
const editMode = isEnabled || hasEditFlag(query[EDIT_QUERY_PARAM]);
|
|
231
230
|
const devAllowed = isDevelopment() && Boolean(config.devToken?.trim());
|
|
232
|
-
const
|
|
233
|
-
const devPreview = devAllowed && devFlagged;
|
|
234
|
-
const editorActive = editMode || devAllowed && devFlagged;
|
|
231
|
+
const editorActive = editMode;
|
|
235
232
|
let locale;
|
|
236
233
|
let pagePath = path;
|
|
237
234
|
let defaultLocale;
|
|
@@ -248,11 +245,11 @@ function createCmssyPage(config, blocks, options) {
|
|
|
248
245
|
locale = split.locale;
|
|
249
246
|
pagePath = split.path;
|
|
250
247
|
}
|
|
251
|
-
const devWorkspaceId =
|
|
248
|
+
const devWorkspaceId = devAllowed ? await client$1.resolveWorkspaceId() : void 0;
|
|
252
249
|
const page = await react.fetchPage(clientConfig, pagePath, {
|
|
253
250
|
previewSecret: editMode ? config.draftSecret : void 0,
|
|
254
|
-
devPreview:
|
|
255
|
-
devToken:
|
|
251
|
+
devPreview: devAllowed || void 0,
|
|
252
|
+
devToken: devAllowed ? config.devToken : void 0,
|
|
256
253
|
workspaceId: devWorkspaceId
|
|
257
254
|
});
|
|
258
255
|
if (!page) {
|
package/dist/index.js
CHANGED
|
@@ -203,7 +203,6 @@ function applyCmssyCsp(response, options) {
|
|
|
203
203
|
return response;
|
|
204
204
|
}
|
|
205
205
|
var EDIT_QUERY_PARAM = "cmssyEdit";
|
|
206
|
-
var DEV_QUERY_PARAM = "cmssyDev";
|
|
207
206
|
function hasEditFlag(value) {
|
|
208
207
|
return Array.isArray(value) ? value.includes("1") : value === "1";
|
|
209
208
|
}
|
|
@@ -228,9 +227,7 @@ function createCmssyPage(config, blocks, options) {
|
|
|
228
227
|
const query = searchParams ? await searchParams : {};
|
|
229
228
|
const editMode = isEnabled || hasEditFlag(query[EDIT_QUERY_PARAM]);
|
|
230
229
|
const devAllowed = isDevelopment() && Boolean(config.devToken?.trim());
|
|
231
|
-
const
|
|
232
|
-
const devPreview = devAllowed && devFlagged;
|
|
233
|
-
const editorActive = editMode || devAllowed && devFlagged;
|
|
230
|
+
const editorActive = editMode;
|
|
234
231
|
let locale;
|
|
235
232
|
let pagePath = path;
|
|
236
233
|
let defaultLocale;
|
|
@@ -247,11 +244,11 @@ function createCmssyPage(config, blocks, options) {
|
|
|
247
244
|
locale = split.locale;
|
|
248
245
|
pagePath = split.path;
|
|
249
246
|
}
|
|
250
|
-
const devWorkspaceId =
|
|
247
|
+
const devWorkspaceId = devAllowed ? await client.resolveWorkspaceId() : void 0;
|
|
251
248
|
const page = await fetchPage(clientConfig, pagePath, {
|
|
252
249
|
previewSecret: editMode ? config.draftSecret : void 0,
|
|
253
|
-
devPreview:
|
|
254
|
-
devToken:
|
|
250
|
+
devPreview: devAllowed || void 0,
|
|
251
|
+
devToken: devAllowed ? config.devToken : void 0,
|
|
255
252
|
workspaceId: devWorkspaceId
|
|
256
253
|
});
|
|
257
254
|
if (!page) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/next",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "Next.js App Router bindings for cmssy headless sites (createCmssyPage + draft preview)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@cmssy/react": "^0.7.
|
|
44
|
+
"@cmssy/react": "^0.7.6",
|
|
45
45
|
"next": ">=15",
|
|
46
46
|
"react": "^18.2.0 || ^19.0.0",
|
|
47
47
|
"react-dom": "^18.2.0 || ^19.0.0"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"tsup": "^8.3.0",
|
|
55
55
|
"typescript": "^5.6.0",
|
|
56
56
|
"vitest": "^2.1.0",
|
|
57
|
-
"@cmssy/react": "0.7.
|
|
57
|
+
"@cmssy/react": "0.7.6"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"jose": "^6.2.3"
|