@contentful/experiences-core 3.5.0-dev-20250902T0640-ab0b512.0 → 3.6.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/exports.d.ts +1 -1
- package/dist/types.d.ts +43 -4
- package/package.json +3 -3
package/dist/exports.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ASSEMBLY_BLOCK_NODE_TYPE, ASSEMBLY_DEFAULT_CATEGORY, ASSEMBLY_NODE_TYPE, ASSEMBLY_NODE_TYPES, CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, CONTENTFUL_COMPONENT_CATEGORY, CONTENTFUL_DEFAULT_CATEGORY, EMPTY_CONTAINER_SIZE, HYPERLINK_DEFAULT_PATTERN, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PATTERN_PROPERTY_DIVIDER, PostMessageMethods, SCROLL_STATES, SIDELOADED_PREFIX, SUPPORTED_IMAGE_FORMATS, StudioCanvasMode, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS } from './constants.js';
|
|
2
|
-
export { 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, SdkOptions, SelectComponentPayload, SendMessageParams, StyleProps, UpdateSelectedComponentCoordinatesPayload, UpdatedEntityPayload, ValidationOption, VariableFormats } from './types.js';
|
|
2
|
+
export { 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, EditorProperties, EditorPropertyNames, 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, SdkOptions, SelectComponentPayload, SendMessageParams, StyleProps, UpdateSelectedComponentCoordinatesPayload, UpdatedEntityPayload, ValidationOption, VariableFormats } from './types.js';
|
|
3
3
|
export { BoundValue, Breakpoint, ComponentDefinitionPropertyType as ComponentDefinitionVariableType, ComponentPropertyValue, ComponentTreeNode, ComponentValue, DesignValue, ExperienceComponentSettings, ExperienceDataSource, ExperienceUnboundValues, NoValue, Parameter, ParameterDefinition, PrimitiveValue, SchemaVersions, UnboundValue, ValuesByBreakpoint, VariableMapping } from '@contentful/experiences-validators';
|
package/dist/types.d.ts
CHANGED
|
@@ -95,15 +95,29 @@ type ComponentRegistration = {
|
|
|
95
95
|
* If true, the component receives the optional boolean property `isInExpEditorMode` to
|
|
96
96
|
* render different content between editor and delivery mode.
|
|
97
97
|
*
|
|
98
|
-
* @deprecated this will be replaced by
|
|
98
|
+
* @deprecated this will be replaced by enableEditorProperties in the next major version
|
|
99
99
|
*/
|
|
100
100
|
enableCustomEditorView?: boolean;
|
|
101
101
|
/**
|
|
102
102
|
* If set, the specified properties are passed to the component when rendered in the editor.
|
|
103
103
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
enableEditorProperties?: {
|
|
105
|
+
/**
|
|
106
|
+
* Enable the property `isEditorMode` which will be `true` if being rendered inside the Studio editor.
|
|
107
|
+
*/
|
|
106
108
|
isEditorMode?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Enable the property `isEmpty` which will be `true` if the component has no children.
|
|
111
|
+
* This can be used to render a placeholder or label in the editor when the component is empty.
|
|
112
|
+
*
|
|
113
|
+
* @note This will be false if there are no direct children nor slot children.
|
|
114
|
+
*/
|
|
115
|
+
isEmpty?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Enable the string property `nodeBlockId` which is equal to the component ID
|
|
118
|
+
* passed during registration, i.e. `ComponentDefinition['id']`.
|
|
119
|
+
*/
|
|
120
|
+
nodeBlockId?: boolean;
|
|
107
121
|
};
|
|
108
122
|
wrapComponent?: boolean;
|
|
109
123
|
wrapContainer?: keyof JSX.IntrinsicElements;
|
|
@@ -113,6 +127,21 @@ type ComponentRegistration = {
|
|
|
113
127
|
wrapContainerWidth?: React.CSSProperties['width'];
|
|
114
128
|
};
|
|
115
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* Use this for type-safe access to editor properties in your custom components
|
|
132
|
+
* @example
|
|
133
|
+
* type MyCustomProps = { myValue: string }
|
|
134
|
+
* type MyComponentProps = EditorProperties<'isEmpty'> & MyCustomProps
|
|
135
|
+
*/
|
|
136
|
+
type EditorProperties<T extends EditorPropertyNames = EditorPropertyNames> = Pick<BaseEditorProperties, T>;
|
|
137
|
+
type EditorPropertyNames = keyof BaseEditorProperties;
|
|
138
|
+
type BaseEditorProperties = {
|
|
139
|
+
isEditorMode?: boolean;
|
|
140
|
+
isEmpty?: boolean;
|
|
141
|
+
nodeBlockId?: string;
|
|
142
|
+
/** @deprecated will be replaced by `isEditorMode` with the next major version of the SDK */
|
|
143
|
+
isInExpEditorMode?: boolean;
|
|
144
|
+
};
|
|
116
145
|
type ComponentRegistrationOptions = {
|
|
117
146
|
/**
|
|
118
147
|
* Restrict the list of built-in components to a defined set of IDs.
|
|
@@ -133,6 +162,14 @@ type ComponentRegistrationOptions = {
|
|
|
133
162
|
* @deprecated This is a temporary solution and will be removed in a future major version.
|
|
134
163
|
*/
|
|
135
164
|
__disableTextAlignmentTransform?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* If you need to adjust the built-in structural components (e.g. `container`),
|
|
167
|
+
* enable this flag. It is marked as *unsafe* since the logic of those components
|
|
168
|
+
* might evolve in future versions. By overwriting their implementation, you accept
|
|
169
|
+
* the risk of potential breaking changes and running out of sync with the original
|
|
170
|
+
* implementation.
|
|
171
|
+
*/
|
|
172
|
+
__unsafe__enableBuiltInStructureOverwrites?: boolean;
|
|
136
173
|
};
|
|
137
174
|
type Binding = {
|
|
138
175
|
spaceId: string;
|
|
@@ -163,6 +200,7 @@ type ExperienceTreeNode = {
|
|
|
163
200
|
unboundValues: ExperienceUnboundValues;
|
|
164
201
|
breakpoints: Breakpoint[];
|
|
165
202
|
parameters?: Record<string, Parameter>;
|
|
203
|
+
prebindingId?: string;
|
|
166
204
|
pattern?: {
|
|
167
205
|
id: string;
|
|
168
206
|
nodeId: string;
|
|
@@ -311,6 +349,7 @@ type DesignTokensDefinition = {
|
|
|
311
349
|
} & RecursiveDesignTokenDefinition;
|
|
312
350
|
type SdkOptions = {
|
|
313
351
|
__disableTextAlignmentTransform?: ComponentRegistrationOptions['__disableTextAlignmentTransform'];
|
|
352
|
+
__unsafe__enableBuiltInStructureOverwrites?: ComponentRegistrationOptions['__unsafe__enableBuiltInStructureOverwrites'];
|
|
314
353
|
};
|
|
315
354
|
/** Type of experience entry JSON data structure as returned by CPA/CDA */
|
|
316
355
|
type ExperienceEntry = {
|
|
@@ -590,4 +629,4 @@ type IncomingMessage = {
|
|
|
590
629
|
};
|
|
591
630
|
}[keyof INCOMING_EVENT_PAYLOADS];
|
|
592
631
|
|
|
593
|
-
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, SdkOptions, SelectComponentPayload, SendMessageParams, StyleProps, UpdateSelectedComponentCoordinatesPayload, UpdatedEntityPayload, ValidationOption, VariableFormats };
|
|
632
|
+
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, EditorProperties, EditorPropertyNames, 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, SdkOptions, SelectComponentPayload, SendMessageParams, StyleProps, UpdateSelectedComponentCoordinatesPayload, UpdatedEntityPayload, ValidationOption, VariableFormats };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"vitest": "^2.1.1"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@contentful/experiences-validators": "3.
|
|
73
|
+
"@contentful/experiences-validators": "3.6.0",
|
|
74
74
|
"@contentful/rich-text-types": "^17.0.0",
|
|
75
75
|
"lodash-es": "^4.17.21",
|
|
76
76
|
"zustand": "^4.4.7"
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"contentful": ">=10.6.0"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "836246fcc25ef7298ad4001374f3115d696320fa"
|
|
82
82
|
}
|