@cmssy/react 0.7.0 → 0.7.1
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 +10 -3
- package/dist/index.js +10 -3
- package/package.json +1 -1
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
|
|
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
|
|
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
|
|
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
|
|
378
|
+
...devPreview ? { devPreview: true } : {}
|
|
372
379
|
}
|
|
373
380
|
}),
|
|
374
381
|
signal: options.signal
|