@cmssy/react 0.7.0 → 0.7.2

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
@@ -296,7 +296,14 @@ function resolveApiUrl(apiUrl) {
296
296
  const fromEnv = env?.CMSSY_API_URL?.trim() ?? "";
297
297
  return fromEnv.length > 0 ? fromEnv : DEFAULT_CMSSY_API_URL;
298
298
  }
299
- var PUBLIC_PAGE_QUERY = `query PublicPage($workspaceSlug: String!, $slug: String!, $previewSecret: String, $devPreview: Boolean) {
299
+ var PUBLIC_PAGE_QUERY = `query PublicPage($workspaceSlug: String!, $slug: String!, $previewSecret: String) {
300
+ publicPage(workspaceSlug: $workspaceSlug, slug: $slug, previewSecret: $previewSecret) {
301
+ id
302
+ blocks { id type content }
303
+ publishedBlocks { id type content }
304
+ }
305
+ }`;
306
+ var PUBLIC_PAGE_DEV_QUERY = `query PublicPage($workspaceSlug: String!, $slug: String!, $previewSecret: String, $devPreview: Boolean) {
300
307
  publicPage(workspaceSlug: $workspaceSlug, slug: $slug, previewSecret: $previewSecret, devPreview: $devPreview) {
301
308
  id
302
309
  blocks { id type content }
@@ -365,12 +372,12 @@ async function fetchPage(config, path, options = {}) {
365
372
  method: "POST",
366
373
  headers,
367
374
  body: JSON.stringify({
368
- query: PUBLIC_PAGE_QUERY,
375
+ query: devPreview ? PUBLIC_PAGE_DEV_QUERY : PUBLIC_PAGE_QUERY,
369
376
  variables: {
370
377
  workspaceSlug: config.workspaceSlug,
371
378
  slug,
372
379
  previewSecret,
373
- devPreview: devPreview ? true : null
380
+ ...devPreview ? { devPreview: true } : {}
374
381
  }
375
382
  }),
376
383
  signal: options.signal
package/dist/index.js CHANGED
@@ -294,7 +294,14 @@ function resolveApiUrl(apiUrl) {
294
294
  const fromEnv = env?.CMSSY_API_URL?.trim() ?? "";
295
295
  return fromEnv.length > 0 ? fromEnv : DEFAULT_CMSSY_API_URL;
296
296
  }
297
- var PUBLIC_PAGE_QUERY = `query PublicPage($workspaceSlug: String!, $slug: String!, $previewSecret: String, $devPreview: Boolean) {
297
+ var PUBLIC_PAGE_QUERY = `query PublicPage($workspaceSlug: String!, $slug: String!, $previewSecret: String) {
298
+ publicPage(workspaceSlug: $workspaceSlug, slug: $slug, previewSecret: $previewSecret) {
299
+ id
300
+ blocks { id type content }
301
+ publishedBlocks { id type content }
302
+ }
303
+ }`;
304
+ var PUBLIC_PAGE_DEV_QUERY = `query PublicPage($workspaceSlug: String!, $slug: String!, $previewSecret: String, $devPreview: Boolean) {
298
305
  publicPage(workspaceSlug: $workspaceSlug, slug: $slug, previewSecret: $previewSecret, devPreview: $devPreview) {
299
306
  id
300
307
  blocks { id type content }
@@ -363,12 +370,12 @@ async function fetchPage(config, path, options = {}) {
363
370
  method: "POST",
364
371
  headers,
365
372
  body: JSON.stringify({
366
- query: PUBLIC_PAGE_QUERY,
373
+ query: devPreview ? PUBLIC_PAGE_DEV_QUERY : PUBLIC_PAGE_QUERY,
367
374
  variables: {
368
375
  workspaceSlug: config.workspaceSlug,
369
376
  slug,
370
377
  previewSecret,
371
- devPreview: devPreview ? true : null
378
+ ...devPreview ? { devPreview: true } : {}
372
379
  }
373
380
  }),
374
381
  signal: options.signal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/react",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "React blocks, renderers, data client and editor bridge for cmssy headless sites",
5
5
  "keywords": [
6
6
  "cmssy",