@contentful/experiences-core 1.38.1-dev-20250528T1136-d03d94c.0 → 1.39.0-alpha-20250528T1342-e28bc3d.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/constants.d.ts +15 -6
- package/dist/constants.js +15 -6
- package/dist/constants.js.map +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -42
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +18 -22
- package/dist/utils/utils.d.ts +2 -22
- package/package.json +3 -3
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[];
|
|
@@ -481,25 +461,33 @@ type ExperienceUpdatedPayload = {
|
|
|
481
461
|
changedNode?: ExperienceTreeNode;
|
|
482
462
|
changedValueType?: SelectedValueTypes;
|
|
483
463
|
};
|
|
464
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
484
465
|
type ComponentDraggingChangedPayload = {
|
|
485
466
|
isDragging: boolean;
|
|
486
467
|
};
|
|
468
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
487
469
|
type IncomingComponentDragCanceledPayload = undefined;
|
|
470
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
488
471
|
type ComponentDragStartedPayload = {
|
|
489
472
|
id: string;
|
|
490
473
|
isAssembly: boolean;
|
|
491
474
|
};
|
|
475
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
492
476
|
type ComponentDragEndedPayload = undefined;
|
|
477
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
493
478
|
type IncomingComponentMoveEndedPayload = {
|
|
494
479
|
mouseX: number;
|
|
495
480
|
mouseY: number;
|
|
496
481
|
};
|
|
482
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
497
483
|
type CanvasResizedPayload = {
|
|
498
484
|
selectedNodeId: string;
|
|
499
485
|
};
|
|
486
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
500
487
|
type SelectComponentPayload = {
|
|
501
488
|
selectedNodeId: string;
|
|
502
489
|
};
|
|
490
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
503
491
|
type HoverComponentPayload = {
|
|
504
492
|
hoveredNodeId: string;
|
|
505
493
|
};
|
|
@@ -514,6 +502,7 @@ type AssembliesAddedPayload = {
|
|
|
514
502
|
type AssembliesRegisteredPayload = {
|
|
515
503
|
assemblies: ComponentDefinition[];
|
|
516
504
|
};
|
|
505
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
517
506
|
type IncomingMouseMovePayload = {
|
|
518
507
|
mouseX: number;
|
|
519
508
|
mouseY: number;
|
|
@@ -545,5 +534,12 @@ type IncomingMessage = {
|
|
|
545
534
|
payload: INCOMING_EVENT_PAYLOADS[K];
|
|
546
535
|
};
|
|
547
536
|
}[keyof INCOMING_EVENT_PAYLOADS];
|
|
537
|
+
type StructuralEditorModeProps = {
|
|
538
|
+
editorMode: true;
|
|
539
|
+
node: ExperienceTreeNode;
|
|
540
|
+
} | {
|
|
541
|
+
editorMode?: false;
|
|
542
|
+
};
|
|
543
|
+
type StructureComponentProps<OtherProps> = React.PropsWithChildren<StructuralEditorModeProps & OtherProps>;
|
|
548
544
|
|
|
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,
|
|
545
|
+
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, 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 };
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExperienceTree, ExperienceEntry, ComponentDefinition
|
|
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,
|
|
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.
|
|
3
|
+
"version": "1.39.0-alpha-20250528T1342-e28bc3d.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.
|
|
73
|
+
"@contentful/experiences-validators": "1.39.0-alpha-20250528T1342-e28bc3d.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": "
|
|
79
|
+
"gitHead": "2260b6f7c1ba8064ab4e12c7817cffe6cc2cdbd5"
|
|
80
80
|
}
|