@cmssy/core 10.1.0 → 10.2.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.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/internal.cjs +29 -3
- package/dist/internal.d.cts +10 -2
- package/dist/internal.d.ts +10 -2
- package/dist/internal.js +29 -4
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlReque
|
|
|
3
3
|
export { C as CmssyRequestError, D as DEFAULT_CMSSY_API_URL, F as FetchLike, a as FetchLikeResponse, b as FetchPageOptions, R as RetryPolicy } from './content-client-D0EdiqbQ.cjs';
|
|
4
4
|
import * as _cmssy_types from '@cmssy/types';
|
|
5
5
|
import { FieldOptions, TypedField, BlockPropsSchema, InferBlockContent, RelationMode, CmssyModelRecord, VerifyCmssyWebhookOptions, CmssyWebhookEvent } from '@cmssy/types';
|
|
6
|
-
export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssyWebhookEvent, CmssyWebhookOrder, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldOptions, FieldType, InferBlockContent, RawBlock, RawLayoutBlock, SubmitFormInput, TypedField, VerifyCmssyWebhookOptions, evaluateFieldConditionGroup } from '@cmssy/types';
|
|
6
|
+
export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockPage, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssyWebhookEvent, CmssyWebhookOrder, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldOptions, FieldType, InferBlockContent, RawBlock, RawLayoutBlock, SubmitFormInput, TypedField, VerifyCmssyWebhookOptions, evaluateFieldConditionGroup } from '@cmssy/types';
|
|
7
7
|
|
|
8
8
|
type Declared<O> = O extends {
|
|
9
9
|
required: true;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlReque
|
|
|
3
3
|
export { C as CmssyRequestError, D as DEFAULT_CMSSY_API_URL, F as FetchLike, a as FetchLikeResponse, b as FetchPageOptions, R as RetryPolicy } from './content-client-D0EdiqbQ.js';
|
|
4
4
|
import * as _cmssy_types from '@cmssy/types';
|
|
5
5
|
import { FieldOptions, TypedField, BlockPropsSchema, InferBlockContent, RelationMode, CmssyModelRecord, VerifyCmssyWebhookOptions, CmssyWebhookEvent } from '@cmssy/types';
|
|
6
|
-
export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssyWebhookEvent, CmssyWebhookOrder, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldOptions, FieldType, InferBlockContent, RawBlock, RawLayoutBlock, SubmitFormInput, TypedField, VerifyCmssyWebhookOptions, evaluateFieldConditionGroup } from '@cmssy/types';
|
|
6
|
+
export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockPage, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssyWebhookEvent, CmssyWebhookOrder, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldOptions, FieldType, InferBlockContent, RawBlock, RawLayoutBlock, SubmitFormInput, TypedField, VerifyCmssyWebhookOptions, evaluateFieldConditionGroup } from '@cmssy/types';
|
|
7
7
|
|
|
8
8
|
type Declared<O> = O extends {
|
|
9
9
|
required: true;
|
package/dist/internal.cjs
CHANGED
|
@@ -120,6 +120,8 @@ var PUBLIC_PAGE_QUERY = `query PublicPage($workspaceSlug: String!, $slug: String
|
|
|
120
120
|
page {
|
|
121
121
|
get(workspaceSlug: $workspaceSlug, slug: $slug, previewSecret: $previewSecret) {
|
|
122
122
|
id
|
|
123
|
+
slug
|
|
124
|
+
pageType
|
|
123
125
|
blocks { id type content style advanced }
|
|
124
126
|
publishedBlocks { id type content style advanced }
|
|
125
127
|
}
|
|
@@ -131,6 +133,8 @@ var PUBLIC_PAGE_DEV_QUERY = `query PublicPage($workspaceSlug: String!, $slug: St
|
|
|
131
133
|
page {
|
|
132
134
|
get(workspaceSlug: $workspaceSlug, slug: $slug, previewSecret: $previewSecret, devPreview: $devPreview) {
|
|
133
135
|
id
|
|
136
|
+
slug
|
|
137
|
+
pageType
|
|
134
138
|
blocks { id type content style advanced }
|
|
135
139
|
publishedBlocks { id type content style advanced }
|
|
136
140
|
}
|
|
@@ -142,6 +146,8 @@ var PUBLIC_PAGE_BY_ID_QUERY = `query PublicPageById($workspaceSlug: String!, $pa
|
|
|
142
146
|
page {
|
|
143
147
|
getById(workspaceSlug: $workspaceSlug, pageId: $pageId) {
|
|
144
148
|
id
|
|
149
|
+
slug
|
|
150
|
+
pageType
|
|
145
151
|
publishedBlocks { id type content style advanced }
|
|
146
152
|
}
|
|
147
153
|
}
|
|
@@ -225,7 +231,12 @@ async function fetchPage(config, path, options = {}) {
|
|
|
225
231
|
if (!page) return null;
|
|
226
232
|
const draft = previewSecret !== null || devPreview;
|
|
227
233
|
const blocks = (draft ? page.blocks : page.publishedBlocks) ?? [];
|
|
228
|
-
return {
|
|
234
|
+
return {
|
|
235
|
+
id: page.id,
|
|
236
|
+
blocks,
|
|
237
|
+
slug: page.slug ?? slug,
|
|
238
|
+
pageType: page.pageType ?? null
|
|
239
|
+
};
|
|
229
240
|
}
|
|
230
241
|
async function fetchPageById(config, pageId, options = {}) {
|
|
231
242
|
const data = await postGraphql(
|
|
@@ -241,7 +252,12 @@ async function fetchPageById(config, pageId, options = {}) {
|
|
|
241
252
|
);
|
|
242
253
|
const page = data?.public?.page?.getById;
|
|
243
254
|
if (!page) return null;
|
|
244
|
-
return {
|
|
255
|
+
return {
|
|
256
|
+
id: page.id,
|
|
257
|
+
blocks: page.publishedBlocks ?? [],
|
|
258
|
+
...page.slug ? { slug: page.slug } : {},
|
|
259
|
+
pageType: page.pageType ?? null
|
|
260
|
+
};
|
|
245
261
|
}
|
|
246
262
|
async function fetchPages(config, options = {}) {
|
|
247
263
|
const data = await postGraphql(
|
|
@@ -803,6 +819,14 @@ function localizedPath(slug, locale, defaultLocale) {
|
|
|
803
819
|
}
|
|
804
820
|
|
|
805
821
|
// src/block-context.ts
|
|
822
|
+
function blockPageOf(page) {
|
|
823
|
+
if (!page?.slug) return void 0;
|
|
824
|
+
return {
|
|
825
|
+
id: page.id,
|
|
826
|
+
slug: page.slug,
|
|
827
|
+
pageType: page.pageType ?? null
|
|
828
|
+
};
|
|
829
|
+
}
|
|
806
830
|
function buildBlockContext(locale, defaultLocale, enabledLocales, isPreview, forms, extra) {
|
|
807
831
|
return {
|
|
808
832
|
locale: {
|
|
@@ -813,7 +837,8 @@ function buildBlockContext(locale, defaultLocale, enabledLocales, isPreview, for
|
|
|
813
837
|
isPreview: isPreview ?? false,
|
|
814
838
|
forms,
|
|
815
839
|
...extra?.auth ? { auth: extra.auth } : {},
|
|
816
|
-
...extra?.workspace ? { workspace: extra.workspace } : {}
|
|
840
|
+
...extra?.workspace ? { workspace: extra.workspace } : {},
|
|
841
|
+
...extra?.page ? { page: extra.page } : {}
|
|
817
842
|
};
|
|
818
843
|
}
|
|
819
844
|
|
|
@@ -920,6 +945,7 @@ exports.RECORDS_BY_IDS_QUERY = RECORDS_BY_IDS_QUERY;
|
|
|
920
945
|
exports.SITE_CONFIG_QUERY = SITE_CONFIG_QUERY;
|
|
921
946
|
exports.SUBMIT_FORM_MUTATION = SUBMIT_FORM_MUTATION;
|
|
922
947
|
exports.asBucket = asBucket;
|
|
948
|
+
exports.blockPageOf = blockPageOf;
|
|
923
949
|
exports.buildBlockContext = buildBlockContext;
|
|
924
950
|
exports.buildLocaleSwitchHref = buildLocaleSwitchHref;
|
|
925
951
|
exports.cachedWorkspaceId = cachedWorkspaceId;
|
package/dist/internal.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { f as fetchLayouts, c as fetchPage, d as fetchPageById, e as fetchPageMeta, g as fetchPages, n as normalizeSlug, r as resolveApiUrl, h as resolvePublicUrl } from './content-client-D0EdiqbQ.cjs';
|
|
2
|
-
import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyClientConfig, CmssySiteConfig, RawBlock, FieldDefinition } from '@cmssy/types';
|
|
2
|
+
import { CmssyPageData, CmssyBlockPage, CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyClientConfig, CmssySiteConfig, RawBlock, FieldDefinition } from '@cmssy/types';
|
|
3
3
|
export { CmssySiteLocales } from '@cmssy/types';
|
|
4
4
|
import { G as GraphqlRequestOptions } from './locale-rhYcXU5z.cjs';
|
|
5
5
|
export { C as CMSSY_LOCALE_HEADER, b as buildLocaleSwitchHref, a as localeForPath, c as localeForPathname, l as localizeHref, d as localizeHtmlLinks, s as splitCmssyLocale } from './locale-rhYcXU5z.cjs';
|
|
@@ -13,6 +13,14 @@ declare const MODEL_RECORDS_QUERY = "query PublicModelRecords($workspaceId: Stri
|
|
|
13
13
|
declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n public {\n form {\n get(formId: $formId) {\n id\n name\n slug\n description\n fields {\n id name fieldType label placeholder helpText\n defaultValue width order showWhen requiredWhen\n options { value label disabled }\n validation { required minLength maxLength minValue maxValue pattern customMessage }\n }\n settings {\n actionType submitButtonLabel successMessage errorMessage\n redirectUrl requireLogin enableCaptcha\n }\n }\n }\n }\n}";
|
|
14
14
|
declare const SUBMIT_FORM_MUTATION = "mutation SubmitForm($formId: ID!, $input: SubmitFormInput!) {\n public {\n form {\n submit(formId: $formId, input: $input) {\n success message submissionId redirectUrl accessToken customer\n }\n }\n }\n}";
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* The identity half of a fetched page, for `context.page`.
|
|
18
|
+
*
|
|
19
|
+
* A page fetched by an older SDK - or by a consumer that builds `CmssyPageData`
|
|
20
|
+
* itself - has no slug, and then a block gets no `page` at all rather than one
|
|
21
|
+
* with a hole in it: `context.page ? … : …` is a question a block can answer.
|
|
22
|
+
*/
|
|
23
|
+
declare function blockPageOf(page: CmssyPageData | null | undefined): CmssyBlockPage | undefined;
|
|
16
24
|
declare function buildBlockContext(locale: string, defaultLocale: string, enabledLocales?: string[], isPreview?: boolean, forms?: Record<string, CmssyFormDefinition>, extra?: BuildBlockContextExtra): CmssyBlockContext;
|
|
17
25
|
|
|
18
26
|
declare function getBlockContentForLanguage(content: unknown, locale: string, defaultLocale?: string, availableLocales?: string[]): Record<string, unknown>;
|
|
@@ -62,4 +70,4 @@ declare function resolveRelationContent(config: CmssyClientConfig, entries: Rela
|
|
|
62
70
|
|
|
63
71
|
declare function cmssySecretsMatch(a: string, b: string): Promise<boolean>;
|
|
64
72
|
|
|
65
|
-
export { type BlockSchemaMap, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, RECORDS_BY_IDS_QUERY, type RelationContentEntry, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, cachedWorkspaceId, clearWorkspaceIdCache, cmssySecretsMatch, collectFormIds, fetchSiteConfig, getBlockContentForLanguage, normalizeRelationContent, resolveForms, resolveRelationContent, resolveWorkspaceId };
|
|
73
|
+
export { type BlockSchemaMap, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, RECORDS_BY_IDS_QUERY, type RelationContentEntry, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, blockPageOf, buildBlockContext, cachedWorkspaceId, clearWorkspaceIdCache, cmssySecretsMatch, collectFormIds, fetchSiteConfig, getBlockContentForLanguage, normalizeRelationContent, resolveForms, resolveRelationContent, resolveWorkspaceId };
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { f as fetchLayouts, c as fetchPage, d as fetchPageById, e as fetchPageMeta, g as fetchPages, n as normalizeSlug, r as resolveApiUrl, h as resolvePublicUrl } from './content-client-D0EdiqbQ.js';
|
|
2
|
-
import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyClientConfig, CmssySiteConfig, RawBlock, FieldDefinition } from '@cmssy/types';
|
|
2
|
+
import { CmssyPageData, CmssyBlockPage, CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyClientConfig, CmssySiteConfig, RawBlock, FieldDefinition } from '@cmssy/types';
|
|
3
3
|
export { CmssySiteLocales } from '@cmssy/types';
|
|
4
4
|
import { G as GraphqlRequestOptions } from './locale-XintNd0n.js';
|
|
5
5
|
export { C as CMSSY_LOCALE_HEADER, b as buildLocaleSwitchHref, a as localeForPath, c as localeForPathname, l as localizeHref, d as localizeHtmlLinks, s as splitCmssyLocale } from './locale-XintNd0n.js';
|
|
@@ -13,6 +13,14 @@ declare const MODEL_RECORDS_QUERY = "query PublicModelRecords($workspaceId: Stri
|
|
|
13
13
|
declare const FORM_QUERY = "query PublicForm($formId: ID!) {\n public {\n form {\n get(formId: $formId) {\n id\n name\n slug\n description\n fields {\n id name fieldType label placeholder helpText\n defaultValue width order showWhen requiredWhen\n options { value label disabled }\n validation { required minLength maxLength minValue maxValue pattern customMessage }\n }\n settings {\n actionType submitButtonLabel successMessage errorMessage\n redirectUrl requireLogin enableCaptcha\n }\n }\n }\n }\n}";
|
|
14
14
|
declare const SUBMIT_FORM_MUTATION = "mutation SubmitForm($formId: ID!, $input: SubmitFormInput!) {\n public {\n form {\n submit(formId: $formId, input: $input) {\n success message submissionId redirectUrl accessToken customer\n }\n }\n }\n}";
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* The identity half of a fetched page, for `context.page`.
|
|
18
|
+
*
|
|
19
|
+
* A page fetched by an older SDK - or by a consumer that builds `CmssyPageData`
|
|
20
|
+
* itself - has no slug, and then a block gets no `page` at all rather than one
|
|
21
|
+
* with a hole in it: `context.page ? … : …` is a question a block can answer.
|
|
22
|
+
*/
|
|
23
|
+
declare function blockPageOf(page: CmssyPageData | null | undefined): CmssyBlockPage | undefined;
|
|
16
24
|
declare function buildBlockContext(locale: string, defaultLocale: string, enabledLocales?: string[], isPreview?: boolean, forms?: Record<string, CmssyFormDefinition>, extra?: BuildBlockContextExtra): CmssyBlockContext;
|
|
17
25
|
|
|
18
26
|
declare function getBlockContentForLanguage(content: unknown, locale: string, defaultLocale?: string, availableLocales?: string[]): Record<string, unknown>;
|
|
@@ -62,4 +70,4 @@ declare function resolveRelationContent(config: CmssyClientConfig, entries: Rela
|
|
|
62
70
|
|
|
63
71
|
declare function cmssySecretsMatch(a: string, b: string): Promise<boolean>;
|
|
64
72
|
|
|
65
|
-
export { type BlockSchemaMap, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, RECORDS_BY_IDS_QUERY, type RelationContentEntry, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, cachedWorkspaceId, clearWorkspaceIdCache, cmssySecretsMatch, collectFormIds, fetchSiteConfig, getBlockContentForLanguage, normalizeRelationContent, resolveForms, resolveRelationContent, resolveWorkspaceId };
|
|
73
|
+
export { type BlockSchemaMap, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, RECORDS_BY_IDS_QUERY, type RelationContentEntry, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, blockPageOf, buildBlockContext, cachedWorkspaceId, clearWorkspaceIdCache, cmssySecretsMatch, collectFormIds, fetchSiteConfig, getBlockContentForLanguage, normalizeRelationContent, resolveForms, resolveRelationContent, resolveWorkspaceId };
|
package/dist/internal.js
CHANGED
|
@@ -118,6 +118,8 @@ var PUBLIC_PAGE_QUERY = `query PublicPage($workspaceSlug: String!, $slug: String
|
|
|
118
118
|
page {
|
|
119
119
|
get(workspaceSlug: $workspaceSlug, slug: $slug, previewSecret: $previewSecret) {
|
|
120
120
|
id
|
|
121
|
+
slug
|
|
122
|
+
pageType
|
|
121
123
|
blocks { id type content style advanced }
|
|
122
124
|
publishedBlocks { id type content style advanced }
|
|
123
125
|
}
|
|
@@ -129,6 +131,8 @@ var PUBLIC_PAGE_DEV_QUERY = `query PublicPage($workspaceSlug: String!, $slug: St
|
|
|
129
131
|
page {
|
|
130
132
|
get(workspaceSlug: $workspaceSlug, slug: $slug, previewSecret: $previewSecret, devPreview: $devPreview) {
|
|
131
133
|
id
|
|
134
|
+
slug
|
|
135
|
+
pageType
|
|
132
136
|
blocks { id type content style advanced }
|
|
133
137
|
publishedBlocks { id type content style advanced }
|
|
134
138
|
}
|
|
@@ -140,6 +144,8 @@ var PUBLIC_PAGE_BY_ID_QUERY = `query PublicPageById($workspaceSlug: String!, $pa
|
|
|
140
144
|
page {
|
|
141
145
|
getById(workspaceSlug: $workspaceSlug, pageId: $pageId) {
|
|
142
146
|
id
|
|
147
|
+
slug
|
|
148
|
+
pageType
|
|
143
149
|
publishedBlocks { id type content style advanced }
|
|
144
150
|
}
|
|
145
151
|
}
|
|
@@ -223,7 +229,12 @@ async function fetchPage(config, path, options = {}) {
|
|
|
223
229
|
if (!page) return null;
|
|
224
230
|
const draft = previewSecret !== null || devPreview;
|
|
225
231
|
const blocks = (draft ? page.blocks : page.publishedBlocks) ?? [];
|
|
226
|
-
return {
|
|
232
|
+
return {
|
|
233
|
+
id: page.id,
|
|
234
|
+
blocks,
|
|
235
|
+
slug: page.slug ?? slug,
|
|
236
|
+
pageType: page.pageType ?? null
|
|
237
|
+
};
|
|
227
238
|
}
|
|
228
239
|
async function fetchPageById(config, pageId, options = {}) {
|
|
229
240
|
const data = await postGraphql(
|
|
@@ -239,7 +250,12 @@ async function fetchPageById(config, pageId, options = {}) {
|
|
|
239
250
|
);
|
|
240
251
|
const page = data?.public?.page?.getById;
|
|
241
252
|
if (!page) return null;
|
|
242
|
-
return {
|
|
253
|
+
return {
|
|
254
|
+
id: page.id,
|
|
255
|
+
blocks: page.publishedBlocks ?? [],
|
|
256
|
+
...page.slug ? { slug: page.slug } : {},
|
|
257
|
+
pageType: page.pageType ?? null
|
|
258
|
+
};
|
|
243
259
|
}
|
|
244
260
|
async function fetchPages(config, options = {}) {
|
|
245
261
|
const data = await postGraphql(
|
|
@@ -801,6 +817,14 @@ function localizedPath(slug, locale, defaultLocale) {
|
|
|
801
817
|
}
|
|
802
818
|
|
|
803
819
|
// src/block-context.ts
|
|
820
|
+
function blockPageOf(page) {
|
|
821
|
+
if (!page?.slug) return void 0;
|
|
822
|
+
return {
|
|
823
|
+
id: page.id,
|
|
824
|
+
slug: page.slug,
|
|
825
|
+
pageType: page.pageType ?? null
|
|
826
|
+
};
|
|
827
|
+
}
|
|
804
828
|
function buildBlockContext(locale, defaultLocale, enabledLocales, isPreview, forms, extra) {
|
|
805
829
|
return {
|
|
806
830
|
locale: {
|
|
@@ -811,7 +835,8 @@ function buildBlockContext(locale, defaultLocale, enabledLocales, isPreview, for
|
|
|
811
835
|
isPreview: isPreview ?? false,
|
|
812
836
|
forms,
|
|
813
837
|
...extra?.auth ? { auth: extra.auth } : {},
|
|
814
|
-
...extra?.workspace ? { workspace: extra.workspace } : {}
|
|
838
|
+
...extra?.workspace ? { workspace: extra.workspace } : {},
|
|
839
|
+
...extra?.page ? { page: extra.page } : {}
|
|
815
840
|
};
|
|
816
841
|
}
|
|
817
842
|
|
|
@@ -910,4 +935,4 @@ function cmssyCspHeaders(options) {
|
|
|
910
935
|
};
|
|
911
936
|
}
|
|
912
937
|
|
|
913
|
-
export { CMSSY_LOCALE_HEADER, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, RECORDS_BY_IDS_QUERY, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, buildLocaleSwitchHref, cachedWorkspaceId, clearWorkspaceIdCache, cmssyCspHeaders, cmssySecretsMatch, collectFormIds, fetchLayouts, fetchPage, fetchPageById, fetchPageMeta, fetchPages, fetchSiteConfig, getBlockContentForLanguage, isDevelopment, localeForPath, localeForPathname, localesFromSiteConfig, localizeHref, localizeHtmlLinks, localizedPath, normalizeRelationContent, normalizeSlug, resolveApiUrl, resolveForms, resolveInitialTarget, resolvePublicUrl, resolveRelationContent, resolveSiteLocales, resolveWorkspaceId, splitCmssyLocale, splitLocaleFromPath, toCspOrigin };
|
|
938
|
+
export { CMSSY_LOCALE_HEADER, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, RECORDS_BY_IDS_QUERY, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, blockPageOf, buildBlockContext, buildLocaleSwitchHref, cachedWorkspaceId, clearWorkspaceIdCache, cmssyCspHeaders, cmssySecretsMatch, collectFormIds, fetchLayouts, fetchPage, fetchPageById, fetchPageMeta, fetchPages, fetchSiteConfig, getBlockContentForLanguage, isDevelopment, localeForPath, localeForPathname, localesFromSiteConfig, localizeHref, localizeHtmlLinks, localizedPath, normalizeRelationContent, normalizeSlug, resolveApiUrl, resolveForms, resolveInitialTarget, resolvePublicUrl, resolveRelationContent, resolveSiteLocales, resolveWorkspaceId, splitCmssyLocale, splitLocaleFromPath, toCspOrigin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/core",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "Framework-agnostic cmssy gateway: GraphQL client, block/field system, editor protocol. No React, no Next.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vitest": "^2.1.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@cmssy/types": "0.
|
|
65
|
+
"@cmssy/types": "0.30.0",
|
|
66
66
|
"jose": "^6.2.3"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|