@contentful/experiences-visual-editor-react 3.4.1-dev-20250901T1444-62c96a8.0 → 3.5.0-dev-20250902T1514-0e19e78.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/renderApp.js CHANGED
@@ -44227,6 +44227,7 @@ const BreakpointSchema$1 = z
44227
44227
  const BaseComponentTreeNodeSchema$1 = z.object({
44228
44228
  id: ComponentTreeNodeIdSchema$1.optional(),
44229
44229
  definitionId: DefinitionPropertyKeySchema$1,
44230
+ prebindingId: z.string().optional(),
44230
44231
  displayName: z.string().optional(),
44231
44232
  slotId: z.string().optional(),
44232
44233
  variables: z.record(propertyKeySchema$1, ComponentPropertyValueSchema$1),
@@ -48973,6 +48974,7 @@ const BreakpointSchema = z
48973
48974
  const BaseComponentTreeNodeSchema = z.object({
48974
48975
  id: ComponentTreeNodeIdSchema.optional(),
48975
48976
  definitionId: DefinitionPropertyKeySchema,
48977
+ prebindingId: z.string().optional(),
48976
48978
  displayName: z.string().optional(),
48977
48979
  slotId: z.string().optional(),
48978
48980
  variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),
@@ -50311,6 +50313,31 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
50311
50313
  styles: componentStyles,
50312
50314
  nodeId: node.data.id,
50313
50315
  });
50316
+ // Allows custom components to render differently in the editor. This needs to be activated
50317
+ // through registry options as the component has to be aware of this prop to not cause any React warnings.
50318
+ const editorProps = reactExports.useMemo(() => {
50319
+ const editorProps = {};
50320
+ if (options?.enableEditorProperties?.isEditorMode) {
50321
+ editorProps.isEditorMode = true;
50322
+ }
50323
+ if (options?.enableEditorProperties?.isEmpty) {
50324
+ editorProps.isEmpty = node.children.length === 0;
50325
+ }
50326
+ if (options?.enableEditorProperties?.nodeBlockId) {
50327
+ editorProps.nodeBlockId = node.data.blockId;
50328
+ }
50329
+ if (options?.enableCustomEditorView) {
50330
+ editorProps.isInExpEditorMode = true;
50331
+ }
50332
+ return editorProps;
50333
+ }, [
50334
+ node.children.length,
50335
+ node.data.blockId,
50336
+ options?.enableEditorProperties?.isEditorMode,
50337
+ options?.enableEditorProperties?.isEmpty,
50338
+ options?.enableEditorProperties?.nodeBlockId,
50339
+ options?.enableCustomEditorView,
50340
+ ]);
50314
50341
  const componentProps = reactExports.useMemo(() => {
50315
50342
  const sharedProps = {
50316
50343
  'data-cf-node-id': node.data.id,
@@ -50320,21 +50347,10 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
50320
50347
  };
50321
50348
  return {
50322
50349
  ...sharedProps,
50323
- // Allows custom components to render differently in the editor. This needs to be activated
50324
- // through options as the component has to be aware of this prop to not cause any React warnings.
50325
- ...(options?.enableCustomEditorView ? { isInExpEditorMode: true } : {}),
50326
- ...(options?.editorProperties?.isEditorMode ? { isEditorMode: true } : {}),
50327
- ...(options?.editorProperties?.node ? { node } : {}),
50350
+ ...editorProps,
50328
50351
  ...sanitizeNodeProps(props),
50329
50352
  };
50330
- }, [
50331
- cfCsrClassName,
50332
- node,
50333
- options?.editorProperties?.isEditorMode,
50334
- options?.editorProperties?.node,
50335
- options?.enableCustomEditorView,
50336
- props,
50337
- ]);
50353
+ }, [cfCsrClassName, editorProps, node, props]);
50338
50354
  return { componentProps };
50339
50355
  };
50340
50356