@cmssy/next 0.7.2 → 0.7.3

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
@@ -203,7 +203,7 @@ function createCmssyPage(config, blocks, options) {
203
203
  const editMode = isEnabled || hasEditFlag(query[EDIT_QUERY_PARAM]);
204
204
  const devAllowed = isDevelopment() && Boolean(config.devToken?.trim());
205
205
  const devFlagged = hasEditFlag(query[DEV_QUERY_PARAM]);
206
- const devPreview = devAllowed && (devFlagged || Boolean(config.devPreview));
206
+ const devPreview = devAllowed && (devFlagged || config.preview === "dev");
207
207
  const editorActive = editMode || devAllowed && devFlagged;
208
208
  let locale;
209
209
  let pagePath = path;
package/dist/index.d.cts CHANGED
@@ -12,6 +12,7 @@ interface CmssyAuthConfig {
12
12
  modelSlug: string;
13
13
  sessionSecret: string;
14
14
  }
15
+ type CmssyPreviewMode = "dev" | "live";
15
16
  interface CmssyNextConfig {
16
17
  /**
17
18
  * Full GraphQL delivery endpoint. Defaults to the cmssy cloud endpoint
@@ -22,11 +23,12 @@ interface CmssyNextConfig {
22
23
  draftSecret: string;
23
24
  devToken?: string;
24
25
  /**
25
- * When true (and NODE_ENV=development with a devToken), the app serves the
26
- * caller's dev-draft overlay on every request without the `?cmssyDev` flag -
27
- * for local development against your own dev drafts. Ignored in production.
26
+ * Local content-source mode. `"dev"` (with NODE_ENV=development + a devToken)
27
+ * serves the caller's dev-draft overlay on every request without the
28
+ * `?cmssyDev` flag; `"live"` (or unset) serves published content. Ignored in
29
+ * production. Pass the raw env value through - the SDK owns the semantics.
28
30
  */
29
- devPreview?: boolean;
31
+ preview?: CmssyPreviewMode | (string & {});
30
32
  /**
31
33
  * Origin allowed to frame your app in the editor. Defaults to
32
34
  * {@link DEFAULT_CMSSY_EDITOR_ORIGINS}; set it only for self-hosted admins.
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ interface CmssyAuthConfig {
12
12
  modelSlug: string;
13
13
  sessionSecret: string;
14
14
  }
15
+ type CmssyPreviewMode = "dev" | "live";
15
16
  interface CmssyNextConfig {
16
17
  /**
17
18
  * Full GraphQL delivery endpoint. Defaults to the cmssy cloud endpoint
@@ -22,11 +23,12 @@ interface CmssyNextConfig {
22
23
  draftSecret: string;
23
24
  devToken?: string;
24
25
  /**
25
- * When true (and NODE_ENV=development with a devToken), the app serves the
26
- * caller's dev-draft overlay on every request without the `?cmssyDev` flag -
27
- * for local development against your own dev drafts. Ignored in production.
26
+ * Local content-source mode. `"dev"` (with NODE_ENV=development + a devToken)
27
+ * serves the caller's dev-draft overlay on every request without the
28
+ * `?cmssyDev` flag; `"live"` (or unset) serves published content. Ignored in
29
+ * production. Pass the raw env value through - the SDK owns the semantics.
28
30
  */
29
- devPreview?: boolean;
31
+ preview?: CmssyPreviewMode | (string & {});
30
32
  /**
31
33
  * Origin allowed to frame your app in the editor. Defaults to
32
34
  * {@link DEFAULT_CMSSY_EDITOR_ORIGINS}; set it only for self-hosted admins.
package/dist/index.js CHANGED
@@ -202,7 +202,7 @@ function createCmssyPage(config, blocks, options) {
202
202
  const editMode = isEnabled || hasEditFlag(query[EDIT_QUERY_PARAM]);
203
203
  const devAllowed = isDevelopment() && Boolean(config.devToken?.trim());
204
204
  const devFlagged = hasEditFlag(query[DEV_QUERY_PARAM]);
205
- const devPreview = devAllowed && (devFlagged || Boolean(config.devPreview));
205
+ const devPreview = devAllowed && (devFlagged || config.preview === "dev");
206
206
  const editorActive = editMode || devAllowed && devFlagged;
207
207
  let locale;
208
208
  let pagePath = path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/next",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
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.2",
44
+ "@cmssy/react": "^0.7.3",
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.2"
57
+ "@cmssy/react": "0.7.3"
58
58
  },
59
59
  "dependencies": {
60
60
  "jose": "^6.2.3"