@cmssy/react 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/client.cjs CHANGED
@@ -657,8 +657,10 @@ function EditableBlocks({
657
657
  }) {
658
658
  const blockMap = react.useMemo(() => buildBlockMap(blocks), [blocks]);
659
659
  const context = react.useMemo(
660
- () => internal.buildBlockContext(locale, defaultLocale, enabledLocales, true, forms),
661
- [locale, defaultLocale, enabledLocales, forms]
660
+ () => internal.buildBlockContext(locale, defaultLocale, enabledLocales, true, forms, {
661
+ page: internal.blockPageOf(page)
662
+ }),
663
+ [locale, defaultLocale, enabledLocales, forms, page]
662
664
  );
663
665
  const bridgeConfig = react.useMemo(
664
666
  () => ({
package/dist/client.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { useState, useRef, useEffect, useMemo, createElement } from 'react';
3
3
  import { postToEditor, PROTOCOL_VERSION, parseEditorMessage } from '@cmssy/core';
4
- import { resolveInitialTarget, buildBlockContext, getBlockContentForLanguage, normalizeRelationContent, asBucket } from '@cmssy/core/internal';
4
+ import { resolveInitialTarget, buildBlockContext, blockPageOf, getBlockContentForLanguage, normalizeRelationContent, asBucket } from '@cmssy/core/internal';
5
5
  import { BlockErrorBoundary } from '@cmssy/react/block-error-boundary';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
 
@@ -655,8 +655,10 @@ function EditableBlocks({
655
655
  }) {
656
656
  const blockMap = useMemo(() => buildBlockMap(blocks), [blocks]);
657
657
  const context = useMemo(
658
- () => buildBlockContext(locale, defaultLocale, enabledLocales, true, forms),
659
- [locale, defaultLocale, enabledLocales, forms]
658
+ () => buildBlockContext(locale, defaultLocale, enabledLocales, true, forms, {
659
+ page: blockPageOf(page)
660
+ }),
661
+ [locale, defaultLocale, enabledLocales, forms, page]
660
662
  );
661
663
  const bridgeConfig = useMemo(
662
664
  () => ({
package/dist/index.cjs CHANGED
@@ -278,7 +278,7 @@ async function CmssyServerPage({
278
278
  enabledLocales,
279
279
  false,
280
280
  forms,
281
- { auth, workspace }
281
+ { auth, workspace, page: internal.blockPageOf(page) }
282
282
  );
283
283
  const resolved = await resolveBlocks(
284
284
  page.blocks,
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CmssyPageData, CmssyClientConfig, CmssyFormDefinition, CmssyBlockAuthContext, CmssyBlockWorkspace, CmssyLayoutGroup, RawBlock, CmssyBlockContext } from '@cmssy/core';
2
- export { AppToEditorMessage, BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BoundsMessage, BuildBlockContextExtra, ClickMessage, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockWorkspace, CmssyBranding, CmssyClient, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssyRequestError, CmssySiteConfig, EditorToAppMessage, FetchLike, FetchLikeResponse, FetchPageOptions, FieldControl, FieldDefinition, FieldType, GraphqlRequestOptions, InferBlockContent, PROTOCOL_VERSION, ParentReadyMessage, PatchMessage, PostTarget, QueryScopedOptions, RawBlock, RawLayoutBlock, ReadyMessage, RetryPolicy, SelectMessage, SubmitFormInput, TypedField, createCmssyClient, fields, graphqlRequest, isProtocolCompatible, normalizeOrigin, parseEditorMessage, postToEditor } from '@cmssy/core';
2
+ export { AppToEditorMessage, BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BoundsMessage, BuildBlockContextExtra, ClickMessage, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockPage, CmssyBlockWorkspace, CmssyBranding, CmssyClient, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssyRequestError, CmssySiteConfig, EditorToAppMessage, FetchLike, FetchLikeResponse, FetchPageOptions, FieldControl, FieldDefinition, FieldType, GraphqlRequestOptions, InferBlockContent, PROTOCOL_VERSION, ParentReadyMessage, PatchMessage, PostTarget, QueryScopedOptions, RawBlock, RawLayoutBlock, ReadyMessage, RetryPolicy, SelectMessage, SubmitFormInput, TypedField, createCmssyClient, fields, graphqlRequest, isProtocolCompatible, normalizeOrigin, parseEditorMessage, postToEditor } from '@cmssy/core';
3
3
  import { B as BlockDefinition, a as BlockMap } from './registry-zeNh3t6y.cjs';
4
4
  export { b as BlockProps, c as buildBlockMap, d as defineBlock } from './registry-zeNh3t6y.cjs';
5
5
  import { FieldDefinition } from '@cmssy/types';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CmssyPageData, CmssyClientConfig, CmssyFormDefinition, CmssyBlockAuthContext, CmssyBlockWorkspace, CmssyLayoutGroup, RawBlock, CmssyBlockContext } from '@cmssy/core';
2
- export { AppToEditorMessage, BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BoundsMessage, BuildBlockContextExtra, ClickMessage, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockWorkspace, CmssyBranding, CmssyClient, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssyRequestError, CmssySiteConfig, EditorToAppMessage, FetchLike, FetchLikeResponse, FetchPageOptions, FieldControl, FieldDefinition, FieldType, GraphqlRequestOptions, InferBlockContent, PROTOCOL_VERSION, ParentReadyMessage, PatchMessage, PostTarget, QueryScopedOptions, RawBlock, RawLayoutBlock, ReadyMessage, RetryPolicy, SelectMessage, SubmitFormInput, TypedField, createCmssyClient, fields, graphqlRequest, isProtocolCompatible, normalizeOrigin, parseEditorMessage, postToEditor } from '@cmssy/core';
2
+ export { AppToEditorMessage, BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BoundsMessage, BuildBlockContextExtra, ClickMessage, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockPage, CmssyBlockWorkspace, CmssyBranding, CmssyClient, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLayoutSettings, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssyRequestError, CmssySiteConfig, EditorToAppMessage, FetchLike, FetchLikeResponse, FetchPageOptions, FieldControl, FieldDefinition, FieldType, GraphqlRequestOptions, InferBlockContent, PROTOCOL_VERSION, ParentReadyMessage, PatchMessage, PostTarget, QueryScopedOptions, RawBlock, RawLayoutBlock, ReadyMessage, RetryPolicy, SelectMessage, SubmitFormInput, TypedField, createCmssyClient, fields, graphqlRequest, isProtocolCompatible, normalizeOrigin, parseEditorMessage, postToEditor } from '@cmssy/core';
3
3
  import { B as BlockDefinition, a as BlockMap } from './registry-zeNh3t6y.js';
4
4
  export { b as BlockProps, c as buildBlockMap, d as defineBlock } from './registry-zeNh3t6y.js';
5
5
  import { FieldDefinition } from '@cmssy/types';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { CmssyRequestError, PROTOCOL_VERSION, createCmssyClient, fields, graphqlRequest, isProtocolCompatible, normalizeOrigin, parseEditorMessage, postToEditor } from '@cmssy/core';
2
- import { buildBlockContext, getBlockContentForLanguage, normalizeRelationContent, asBucket, resolveSiteLocales, resolveRelationContent } from '@cmssy/core/internal';
2
+ import { buildBlockContext, blockPageOf, getBlockContentForLanguage, normalizeRelationContent, asBucket, resolveSiteLocales, resolveRelationContent } from '@cmssy/core/internal';
3
3
  export { buildBlockContext } from '@cmssy/core/internal';
4
4
  import { createElement } from 'react';
5
5
  import { BlockErrorBoundary } from '@cmssy/react/block-error-boundary';
@@ -277,7 +277,7 @@ async function CmssyServerPage({
277
277
  enabledLocales,
278
278
  false,
279
279
  forms,
280
- { auth, workspace }
280
+ { auth, workspace, page: blockPageOf(page) }
281
281
  );
282
282
  const resolved = await resolveBlocks(
283
283
  page.blocks,
@@ -107,7 +107,8 @@ async function resolveEditorBlockData({
107
107
  defaultLocale,
108
108
  enabledLocales,
109
109
  isPreview,
110
- forms
110
+ forms,
111
+ { page: internal.blockPageOf(page) }
111
112
  );
112
113
  const resolved = await resolveBlocks(
113
114
  page.blocks,
@@ -1,4 +1,4 @@
1
- import { buildBlockContext, getBlockContentForLanguage, resolveRelationContent } from '@cmssy/core/internal';
1
+ import { buildBlockContext, blockPageOf, getBlockContentForLanguage, resolveRelationContent } from '@cmssy/core/internal';
2
2
 
3
3
  // src/components/resolve-block-data.ts
4
4
 
@@ -105,7 +105,8 @@ async function resolveEditorBlockData({
105
105
  defaultLocale,
106
106
  enabledLocales,
107
107
  isPreview,
108
- forms
108
+ forms,
109
+ { page: blockPageOf(page) }
109
110
  );
110
111
  const resolved = await resolveBlocks(
111
112
  page.blocks,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/react",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "description": "React blocks, renderers, data client and editor bridge for cmssy headless sites",
5
5
  "keywords": [
6
6
  "cmssy",
@@ -71,8 +71,8 @@
71
71
  "vitest": "^2.1.0"
72
72
  },
73
73
  "dependencies": {
74
- "@cmssy/types": "0.29.0",
75
- "@cmssy/core": "10.1.0"
74
+ "@cmssy/types": "0.30.0",
75
+ "@cmssy/core": "10.2.0"
76
76
  },
77
77
  "scripts": {
78
78
  "build": "tsup",