@contentful/experiences-core 1.39.0-dev-20250603T0757-ecbd0d2.0 → 1.40.0-alpha-20250604T0813-1f6e699.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/types.d.ts CHANGED
@@ -22,6 +22,7 @@ type ComponentDefinitionVariableTypeMap = {
22
22
  Text: string;
23
23
  };
24
24
  type ScrollStateKey = keyof typeof SCROLL_STATES;
25
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
25
26
  type ScrollState = (typeof SCROLL_STATES)[ScrollStateKey];
26
27
  type OutgoingEventKey = keyof typeof OUTGOING_EVENTS;
27
28
  type OutgoingEvent = (typeof OUTGOING_EVENTS)[OutgoingEventKey];
@@ -347,27 +348,6 @@ type BackgroundImageOptions = {
347
348
  quality?: string;
348
349
  targetSize: string;
349
350
  };
350
- interface DraggableProvidedDraggableProps {
351
- 'data-rfd-draggable-context-id'?: string;
352
- 'data-rfd-draggable-id'?: string;
353
- }
354
- interface DraggableProvidedDragHandleProps {
355
- 'data-rfd-drag-handle-draggable-id'?: string;
356
- 'data-rfd-drag-handle-context-id'?: string;
357
- }
358
- type WrapperTags = keyof Pick<JSX.IntrinsicElements, 'div' | 'span' | 'section' | 'article' | 'aside' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'header' | 'footer' | 'nav' | 'main'>;
359
- interface DragWrapperProps extends DraggableProvidedDragHandleProps, DraggableProvidedDraggableProps, React.HTMLAttributes<HTMLElement>, React.PropsWithChildren {
360
- 'data-cf-node-id'?: string;
361
- 'data-ctfl-draggable-id'?: string;
362
- 'data-test-id'?: string;
363
- 'data-cf-node-block-id'?: string;
364
- 'data-cf-node-block-type'?: string;
365
- 'data-ctfl-dragging-element'?: string;
366
- innerRef?: (refNode: HTMLElement) => void;
367
- wrapComponent?: boolean;
368
- Tag?: WrapperTags;
369
- ToolTipAndPlaceholder?: React.ReactNode;
370
- }
371
351
  type ConnectedPayload = undefined | {
372
352
  sdkVersion: string;
373
353
  definitions: ComponentDefinition[];
@@ -457,7 +437,18 @@ type OUTGOING_EVENT_PAYLOADS = {
457
437
  outsideCanvasClick: OutsideCanvasClickPayload;
458
438
  sdkFeatures: SDKFeaturesPayload;
459
439
  REQUEST_ENTITIES: RequestEntitiesPayload;
440
+ canvasGeometryUpdated: {
441
+ size: {
442
+ width: number;
443
+ height: number;
444
+ };
445
+ nodes: Record<string, {
446
+ coordinates: Pick<DOMRect, 'x' | 'y' | 'width' | 'height'>;
447
+ }>;
448
+ sourceEvent: CanvasGeometryUpdateSourceEvent;
449
+ };
460
450
  };
451
+ type CanvasGeometryUpdateSourceEvent = 'resize' | 'mutation';
461
452
  type SendMessageParams = <T extends OutgoingEvent>(eventType: T, data: OUTGOING_EVENT_PAYLOADS[T]) => void;
462
453
  type OutgoingMessage = {
463
454
  [K in keyof OUTGOING_EVENT_PAYLOADS]: {
@@ -481,25 +472,33 @@ type ExperienceUpdatedPayload = {
481
472
  changedNode?: ExperienceTreeNode;
482
473
  changedValueType?: SelectedValueTypes;
483
474
  };
475
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
484
476
  type ComponentDraggingChangedPayload = {
485
477
  isDragging: boolean;
486
478
  };
479
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
487
480
  type IncomingComponentDragCanceledPayload = undefined;
481
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
488
482
  type ComponentDragStartedPayload = {
489
483
  id: string;
490
484
  isAssembly: boolean;
491
485
  };
486
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
492
487
  type ComponentDragEndedPayload = undefined;
488
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
493
489
  type IncomingComponentMoveEndedPayload = {
494
490
  mouseX: number;
495
491
  mouseY: number;
496
492
  };
493
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
497
494
  type CanvasResizedPayload = {
498
495
  selectedNodeId: string;
499
496
  };
497
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
500
498
  type SelectComponentPayload = {
501
499
  selectedNodeId: string;
502
500
  };
501
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
503
502
  type HoverComponentPayload = {
504
503
  hoveredNodeId: string;
505
504
  };
@@ -514,6 +513,7 @@ type AssembliesAddedPayload = {
514
513
  type AssembliesRegisteredPayload = {
515
514
  assemblies: ComponentDefinition[];
516
515
  };
516
+ /** @deprecated will be removed when dropping backward compatibility for old DND */
517
517
  type IncomingMouseMovePayload = {
518
518
  mouseX: number;
519
519
  mouseY: number;
@@ -545,5 +545,12 @@ type IncomingMessage = {
545
545
  payload: INCOMING_EVENT_PAYLOADS[K];
546
546
  };
547
547
  }[keyof INCOMING_EVENT_PAYLOADS];
548
+ type StructuralEditorModeProps = {
549
+ editorMode: true;
550
+ node: ExperienceTreeNode;
551
+ } | {
552
+ editorMode?: false;
553
+ };
554
+ type StructureComponentProps<OtherProps> = React.PropsWithChildren<StructuralEditorModeProps & OtherProps>;
548
555
 
549
- export type { AssembliesAddedPayload, AssembliesRegisteredPayload, BackgroundImageAlignmentOption, BackgroundImageOptions, BackgroundImageScalingOption, Binding, BindingMap, BindingMapByBlockId, BoundComponentPropertyTypes, CSSProperties, CanvasErrorPayload, CanvasReloadPayload, CanvasResizedPayload, CanvasScrollPayload, ComponentBinding, ComponentDefinition, ComponentDefinitionVariable, ComponentDefinitionVariableBase, ComponentDefinitionVariableTypeMap, ComponentDefinitionVariableValidation, ComponentDragCanceledPayload, ComponentDragEndedPayload, ComponentDragStartedPayload, ComponentDraggingChangedPayload, ComponentDroppedPayload, ComponentMoveEndedPayload, ComponentMoveStartedPayload, ComponentMovedPayload, ComponentRegistration, ComponentRegistrationOptions, ComponentSelectedPayload, ConnectedPayload, ContainerStyleVariableName, Coordinates, DataSourceEntryValueType, DesignTokensDefinition, DesignTokensPayload, DesignVariableMap, DesignVariableTypes, DragWrapperProps, Experience, ExperienceEntry, ExperienceFields, ExperienceTree, ExperienceTreeNode, ExperienceUpdatedPayload, HoverComponentPayload, HoveredElement, ImageLoadingOption, ImageObjectFitOption, ImageObjectPositionOption, ImageOptions, IncomingComponentDragCanceledPayload, IncomingComponentMoveEndedPayload, IncomingEvent, IncomingMessage, IncomingMouseMovePayload, InternalEvent, Link, ManagementEntity, MouseMovePayload, NewHoveredElementPayload, OptimizedBackgroundImageAsset, OptimizedImageAsset, OutgoingEvent, OutgoingMessage, OutsideCanvasClickPayload, RawCoordinates, RecursiveDesignTokenDefinition, RegisteredBreakpointsPayload, RegisteredComponentsPayload, RequestComponentTreeUpdatePayload, RequestEditorModePayload, RequestEntitiesMessage, RequestEntitiesPayload, RequestReadOnlyModePayload, RequestedEntitiesMessage, RequestedEntitiesPayload, ResolveDesignValueType, SDKFeaturesPayload, ScrollState, SelectComponentPayload, SendMessageParams, StyleProps, UpdateSelectedComponentCoordinatesPayload, UpdatedEntityPayload, ValidationOption, VariableFormats, WrapperTags };
556
+ export type { AssembliesAddedPayload, AssembliesRegisteredPayload, BackgroundImageAlignmentOption, BackgroundImageOptions, BackgroundImageScalingOption, Binding, BindingMap, BindingMapByBlockId, BoundComponentPropertyTypes, CSSProperties, CanvasErrorPayload, CanvasGeometryUpdateSourceEvent, CanvasReloadPayload, CanvasResizedPayload, CanvasScrollPayload, ComponentBinding, ComponentDefinition, ComponentDefinitionVariable, ComponentDefinitionVariableBase, ComponentDefinitionVariableTypeMap, ComponentDefinitionVariableValidation, ComponentDragCanceledPayload, ComponentDragEndedPayload, ComponentDragStartedPayload, ComponentDraggingChangedPayload, ComponentDroppedPayload, ComponentMoveEndedPayload, ComponentMoveStartedPayload, ComponentMovedPayload, ComponentRegistration, ComponentRegistrationOptions, ComponentSelectedPayload, ConnectedPayload, ContainerStyleVariableName, Coordinates, DataSourceEntryValueType, DesignTokensDefinition, DesignTokensPayload, DesignVariableMap, DesignVariableTypes, Experience, ExperienceEntry, ExperienceFields, ExperienceTree, ExperienceTreeNode, ExperienceUpdatedPayload, HoverComponentPayload, HoveredElement, ImageLoadingOption, ImageObjectFitOption, ImageObjectPositionOption, ImageOptions, IncomingComponentDragCanceledPayload, IncomingComponentMoveEndedPayload, IncomingEvent, IncomingMessage, IncomingMouseMovePayload, InternalEvent, Link, ManagementEntity, MouseMovePayload, NewHoveredElementPayload, OptimizedBackgroundImageAsset, OptimizedImageAsset, OutgoingEvent, OutgoingMessage, OutsideCanvasClickPayload, RawCoordinates, RecursiveDesignTokenDefinition, RegisteredBreakpointsPayload, RegisteredComponentsPayload, RequestComponentTreeUpdatePayload, RequestEditorModePayload, RequestEntitiesMessage, RequestEntitiesPayload, RequestReadOnlyModePayload, RequestedEntitiesMessage, RequestedEntitiesPayload, ResolveDesignValueType, SDKFeaturesPayload, ScrollState, SelectComponentPayload, SendMessageParams, StructureComponentProps, StyleProps, UpdateSelectedComponentCoordinatesPayload, UpdatedEntityPayload, ValidationOption, VariableFormats };
@@ -1,4 +1,4 @@
1
- import { ExperienceTree, ExperienceEntry, ComponentDefinition, ExperienceTreeNode, StyleProps } from '../types.js';
1
+ import { ExperienceTree, ExperienceEntry, ComponentDefinition } from '../types.js';
2
2
  import { Entry } from 'contentful';
3
3
  import { ExperienceDataSource, ExperienceUnboundValues } from '@contentful/experiences-validators';
4
4
 
@@ -6,26 +6,6 @@ declare const getDataFromTree: (tree: ExperienceTree) => {
6
6
  dataSource: ExperienceDataSource;
7
7
  unboundValues: ExperienceUnboundValues;
8
8
  };
9
- type GetInsertionDataParams = {
10
- dropReceiverNode: ExperienceTreeNode;
11
- dropReceiverParentNode: ExperienceTreeNode;
12
- flexDirection?: StyleProps['cfFlexDirection'];
13
- isMouseAtTopBorder: boolean;
14
- isMouseAtBottomBorder: boolean;
15
- isMouseInLeftHalf: boolean;
16
- isMouseInUpperHalf: boolean;
17
- isOverTopIndicator: boolean;
18
- isOverBottomIndicator: boolean;
19
- };
20
- type InsertionData = {
21
- node: ExperienceTreeNode;
22
- index: number;
23
- };
24
- /**
25
- * Gets calculates the index to drop the dragged component based on the mouse position
26
- * @returns {InsertionData} a object containing a node that will become a parent for dragged component and index at which it must be inserted
27
- */
28
- declare const getInsertionData: ({ dropReceiverParentNode, dropReceiverNode, flexDirection, isMouseAtTopBorder, isMouseAtBottomBorder, isMouseInLeftHalf, isMouseInUpperHalf, isOverTopIndicator, isOverBottomIndicator, }: GetInsertionDataParams) => InsertionData;
29
9
  declare const generateRandomId: (letterCount: number) => string;
30
10
  declare const checkIsAssemblyNode: ({ componentId, usedComponents, }: {
31
11
  componentId: string;
@@ -49,4 +29,4 @@ interface ParsedValue {
49
29
  declare function parseCSSValue(input: string): ParsedValue | null;
50
30
  declare function getTargetValueInPixels(targetWidthObject: ParsedValue): number;
51
31
 
52
- export { checkIsAssembly, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, generateRandomId, getDataFromTree, getInsertionData, getTargetValueInPixels, parseCSSValue };
32
+ export { checkIsAssembly, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, generateRandomId, getDataFromTree, getTargetValueInPixels, parseCSSValue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-core",
3
- "version": "1.39.0-dev-20250603T0757-ecbd0d2.0",
3
+ "version": "1.40.0-alpha-20250604T0813-1f6e699.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -70,11 +70,11 @@
70
70
  "vitest": "^2.1.1"
71
71
  },
72
72
  "dependencies": {
73
- "@contentful/experiences-validators": "1.39.0-dev-20250603T0757-ecbd0d2.0",
73
+ "@contentful/experiences-validators": "1.40.0-alpha-20250604T0813-1f6e699.0",
74
74
  "@contentful/rich-text-types": "^17.0.0"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "contentful": ">=10.6.0"
78
78
  },
79
- "gitHead": "32a0afe9eaf800f9a27eee3ac282643141c99642"
79
+ "gitHead": "cdf8e35c462fc76e415a338e3e98694cbb2a2364"
80
80
  }