@contentful/experiences-core 1.30.1 → 1.30.2-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/exports.d.ts +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +3 -2
- 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, DEFAULT_IMAGE_WIDTH, EMPTY_CONTAINER_HEIGHT, HYPERLINK_DEFAULT_PATTERN, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PostMessageMethods, SCROLL_STATES, SUPPORTED_IMAGE_FORMATS, StudioCanvasMode, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS } from './constants.js';
|
|
2
2
|
export { 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 } from './types.js';
|
|
3
|
-
export { BoundValue, Breakpoint, ComponentDefinitionPropertyType as ComponentDefinitionVariableType, ComponentPropertyValue, ComponentTreeNode, ComponentValue, DesignValue, ExperienceComponentSettings, ExperienceDataSource, ExperienceUnboundValues, PrimitiveValue, SchemaVersions, UnboundValue, ValuesByBreakpoint } from '@contentful/experiences-validators';
|
|
3
|
+
export { BoundValue, Breakpoint, ComponentDefinitionPropertyType as ComponentDefinitionVariableType, ComponentPropertyValue, ComponentTreeNode, ComponentValue, DesignValue, ExperienceComponentSettings, ExperienceDataSource, ExperienceUnboundValues, PatternProperty, PatternPropertyDefinition, PrimitiveValue, SchemaVersions, UnboundValue, ValuesByBreakpoint, VariableMapping } from '@contentful/experiences-validators';
|
package/dist/index.js
CHANGED
|
@@ -1157,6 +1157,31 @@ const ComponentPropertyValueSchema = z.discriminatedUnion('type', [
|
|
|
1157
1157
|
HyperlinkValueSchema,
|
|
1158
1158
|
ComponentValueSchema,
|
|
1159
1159
|
]);
|
|
1160
|
+
// TODO: finalized schema structure before release
|
|
1161
|
+
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
1162
|
+
const VariableMappingSchema = z.object({
|
|
1163
|
+
patternPropertyDefinitionId: propertyKeySchema,
|
|
1164
|
+
type: z.literal('ContentTypeMapping'),
|
|
1165
|
+
pathsByContentType: z.record(z.string(), z.object({ path: z.string() })),
|
|
1166
|
+
});
|
|
1167
|
+
const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);
|
|
1168
|
+
// TODO: finalized schema structure before release
|
|
1169
|
+
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
1170
|
+
const PatternPropertyDefinitionSchema = z.object({
|
|
1171
|
+
defaultValue: z.object({
|
|
1172
|
+
path: z.string(),
|
|
1173
|
+
type: z.literal('BoundValue'),
|
|
1174
|
+
}),
|
|
1175
|
+
contentTypes: z.record(z.string(), z.any()),
|
|
1176
|
+
});
|
|
1177
|
+
const PatternPropertyDefinitionsSchema = z.record(propertyKeySchema, PatternPropertyDefinitionSchema);
|
|
1178
|
+
// TODO: finalized schema structure before release
|
|
1179
|
+
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
1180
|
+
const PatternPropertySchema = z.object({
|
|
1181
|
+
type: z.literal('BoundValue'),
|
|
1182
|
+
path: z.string(),
|
|
1183
|
+
});
|
|
1184
|
+
const PatternPropertysSchema = z.record(propertyKeySchema, PatternPropertySchema);
|
|
1160
1185
|
const BreakpointSchema = z
|
|
1161
1186
|
.object({
|
|
1162
1187
|
id: propertyKeySchema,
|
|
@@ -1179,6 +1204,7 @@ const BaseComponentTreeNodeSchema = z.object({
|
|
|
1179
1204
|
displayName: z.string().optional(),
|
|
1180
1205
|
slotId: z.string().optional(),
|
|
1181
1206
|
variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),
|
|
1207
|
+
patternProperties: PatternPropertysSchema.optional(),
|
|
1182
1208
|
});
|
|
1183
1209
|
const ComponentTreeNodeSchema = BaseComponentTreeNodeSchema.extend({
|
|
1184
1210
|
children: z.lazy(() => ComponentTreeNodeSchema.array()),
|
|
@@ -1210,6 +1236,8 @@ const ComponentVariablesSchema = z.record(z.string().regex(/^[a-zA-Z0-9-_]{1,54}
|
|
|
1210
1236
|
ComponentVariableSchema);
|
|
1211
1237
|
const ComponentSettingsSchema = z.object({
|
|
1212
1238
|
variableDefinitions: ComponentVariablesSchema,
|
|
1239
|
+
variableMappings: VariableMappingsSchema.optional(),
|
|
1240
|
+
patternPropertyDefinitions: PatternPropertyDefinitionsSchema.optional(),
|
|
1213
1241
|
});
|
|
1214
1242
|
const UsedComponentsSchema = z.array(z.object({
|
|
1215
1243
|
sys: z.object({
|