@contentful/experiences-core 3.4.1-dev-20250901T1444-72c17a2.0 → 3.5.0-beta.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/entity/EntityStore.d.ts +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +33 -4
- package/package.json +3 -3
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.
|
|
@@ -590,4 +619,4 @@ type IncomingMessage = {
|
|
|
590
619
|
};
|
|
591
620
|
}[keyof INCOMING_EVENT_PAYLOADS];
|
|
592
621
|
|
|
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 };
|
|
622
|
+
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.5.0-beta.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.5.0-beta.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": "3167e75b248ffe537d4c030ee8f211f2f7b9690d"
|
|
82
82
|
}
|