@contentful/experiences-core 2.0.0-prerelease-20250703T1150-c529c88.0 → 2.0.0-prerelease-20250704T1603-11d76eb.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 +18 -8
- package/dist/constants.js +18 -8
- package/dist/constants.js.map +1 -1
- package/dist/entity/EntityStore.d.ts +1 -7
- package/dist/exports.d.ts +2 -2
- package/dist/exports.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +34 -57
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +29 -22
- package/dist/utils/breakpoints.d.ts +3 -3
- package/dist/utils/domValues.d.ts +2 -1
- package/dist/utils/styleUtils/stylesUtils.d.ts +1 -1
- package/dist/utils/utils.d.ts +2 -22
- package/package.json +3 -3
package/dist/constants.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
1
2
|
declare const SCROLL_STATES: {
|
|
2
3
|
readonly Start: "scrollStart";
|
|
3
4
|
readonly IsScrolling: "isScrolling";
|
|
@@ -7,39 +8,48 @@ declare const OUTGOING_EVENTS: {
|
|
|
7
8
|
readonly Connected: "connected";
|
|
8
9
|
readonly DesignTokens: "registerDesignTokens";
|
|
9
10
|
readonly RegisteredBreakpoints: "registeredBreakpoints";
|
|
11
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
10
12
|
readonly MouseMove: "mouseMove";
|
|
11
|
-
|
|
13
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
12
14
|
readonly ComponentSelected: "componentSelected";
|
|
13
15
|
readonly RegisteredComponents: "registeredComponents";
|
|
14
16
|
readonly RequestComponentTreeUpdate: "requestComponentTreeUpdate";
|
|
15
|
-
readonly ComponentDragCanceled: "componentDragCanceled";
|
|
16
|
-
readonly ComponentDropped: "componentDropped";
|
|
17
|
-
readonly ComponentMoved: "componentMoved";
|
|
18
17
|
readonly CanvasReload: "canvasReload";
|
|
18
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
19
19
|
readonly UpdateSelectedComponentCoordinates: "updateSelectedComponentCoordinates";
|
|
20
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
20
21
|
readonly CanvasScroll: "canvasScrolling";
|
|
21
22
|
readonly CanvasError: "canvasError";
|
|
22
|
-
|
|
23
|
-
readonly ComponentMoveEnded: "componentMoveEnded";
|
|
23
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
24
24
|
readonly OutsideCanvasClick: "outsideCanvasClick";
|
|
25
25
|
readonly SDKFeatures: "sdkFeatures";
|
|
26
26
|
readonly RequestEntities: "REQUEST_ENTITIES";
|
|
27
|
+
readonly CanvasGeometryUpdated: "canvasGeometryUpdated";
|
|
27
28
|
};
|
|
28
29
|
declare const INCOMING_EVENTS: {
|
|
29
30
|
readonly RequestEditorMode: "requestEditorMode";
|
|
30
31
|
readonly RequestReadOnlyMode: "requestReadOnlyMode";
|
|
31
32
|
readonly ExperienceUpdated: "componentTreeUpdated";
|
|
33
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
32
34
|
readonly ComponentDraggingChanged: "componentDraggingChanged";
|
|
35
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
33
36
|
readonly ComponentDragCanceled: "componentDragCanceled";
|
|
37
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
34
38
|
readonly ComponentDragStarted: "componentDragStarted";
|
|
39
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
35
40
|
readonly ComponentDragEnded: "componentDragEnded";
|
|
41
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
36
42
|
readonly ComponentMoveEnded: "componentMoveEnded";
|
|
43
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
37
44
|
readonly CanvasResized: "canvasResized";
|
|
45
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
38
46
|
readonly SelectComponent: "selectComponent";
|
|
47
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
39
48
|
readonly HoverComponent: "hoverComponent";
|
|
40
49
|
readonly UpdatedEntity: "updatedEntity";
|
|
41
50
|
readonly AssembliesAdded: "assembliesAdded";
|
|
42
51
|
readonly AssembliesRegistered: "assembliesRegistered";
|
|
52
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
43
53
|
readonly MouseMove: "mouseMove";
|
|
44
54
|
readonly RequestedEntities: "REQUESTED_ENTITIES";
|
|
45
55
|
};
|
|
@@ -115,7 +125,7 @@ declare const ASSEMBLY_BLOCK_NODE_TYPE = "assemblyBlock";
|
|
|
115
125
|
declare const ASSEMBLY_NODE_TYPES: string[];
|
|
116
126
|
declare const LATEST_SCHEMA_VERSION = "2023-09-28";
|
|
117
127
|
declare const CF_STYLE_ATTRIBUTES: string[];
|
|
118
|
-
declare const
|
|
128
|
+
declare const EMPTY_CONTAINER_SIZE = "80px";
|
|
119
129
|
declare const HYPERLINK_DEFAULT_PATTERN = "/{locale}/{entry.fields.slug}/";
|
|
120
130
|
declare const DEFAULT_IMAGE_WIDTH = "500px";
|
|
121
131
|
declare enum PostMessageMethods {
|
|
@@ -126,4 +136,4 @@ declare const SUPPORTED_IMAGE_FORMATS: readonly ["jpg", "png", "webp", "gif", "a
|
|
|
126
136
|
declare const PATTERN_PROPERTY_DIVIDER = "-----";
|
|
127
137
|
declare const SIDELOADED_PREFIX = "sideloaded_";
|
|
128
138
|
|
|
129
|
-
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,
|
|
139
|
+
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_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 };
|
package/dist/constants.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
1
2
|
const SCROLL_STATES = {
|
|
2
3
|
Start: 'scrollStart',
|
|
3
4
|
IsScrolling: 'isScrolling',
|
|
@@ -7,39 +8,48 @@ const OUTGOING_EVENTS = {
|
|
|
7
8
|
Connected: 'connected',
|
|
8
9
|
DesignTokens: 'registerDesignTokens',
|
|
9
10
|
RegisteredBreakpoints: 'registeredBreakpoints',
|
|
11
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
10
12
|
MouseMove: 'mouseMove',
|
|
11
|
-
|
|
13
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
12
14
|
ComponentSelected: 'componentSelected',
|
|
13
15
|
RegisteredComponents: 'registeredComponents',
|
|
14
16
|
RequestComponentTreeUpdate: 'requestComponentTreeUpdate',
|
|
15
|
-
ComponentDragCanceled: 'componentDragCanceled',
|
|
16
|
-
ComponentDropped: 'componentDropped',
|
|
17
|
-
ComponentMoved: 'componentMoved',
|
|
18
17
|
CanvasReload: 'canvasReload',
|
|
18
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
19
19
|
UpdateSelectedComponentCoordinates: 'updateSelectedComponentCoordinates',
|
|
20
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
20
21
|
CanvasScroll: 'canvasScrolling',
|
|
21
22
|
CanvasError: 'canvasError',
|
|
22
|
-
|
|
23
|
-
ComponentMoveEnded: 'componentMoveEnded',
|
|
23
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
24
24
|
OutsideCanvasClick: 'outsideCanvasClick',
|
|
25
25
|
SDKFeatures: 'sdkFeatures',
|
|
26
26
|
RequestEntities: 'REQUEST_ENTITIES',
|
|
27
|
+
CanvasGeometryUpdated: 'canvasGeometryUpdated',
|
|
27
28
|
};
|
|
28
29
|
const INCOMING_EVENTS = {
|
|
29
30
|
RequestEditorMode: 'requestEditorMode',
|
|
30
31
|
RequestReadOnlyMode: 'requestReadOnlyMode',
|
|
31
32
|
ExperienceUpdated: 'componentTreeUpdated',
|
|
33
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
32
34
|
ComponentDraggingChanged: 'componentDraggingChanged',
|
|
35
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
33
36
|
ComponentDragCanceled: 'componentDragCanceled',
|
|
37
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
34
38
|
ComponentDragStarted: 'componentDragStarted',
|
|
39
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
35
40
|
ComponentDragEnded: 'componentDragEnded',
|
|
41
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
36
42
|
ComponentMoveEnded: 'componentMoveEnded',
|
|
43
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
37
44
|
CanvasResized: 'canvasResized',
|
|
45
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
38
46
|
SelectComponent: 'selectComponent',
|
|
47
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
39
48
|
HoverComponent: 'hoverComponent',
|
|
40
49
|
UpdatedEntity: 'updatedEntity',
|
|
41
50
|
AssembliesAdded: 'assembliesAdded',
|
|
42
51
|
AssembliesRegistered: 'assembliesRegistered',
|
|
52
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
43
53
|
MouseMove: 'mouseMove',
|
|
44
54
|
RequestedEntities: 'REQUESTED_ENTITIES',
|
|
45
55
|
};
|
|
@@ -149,7 +159,7 @@ const CF_STYLE_ATTRIBUTES = [
|
|
|
149
159
|
'cfTextItalic',
|
|
150
160
|
'cfTextUnderline',
|
|
151
161
|
];
|
|
152
|
-
const
|
|
162
|
+
const EMPTY_CONTAINER_SIZE = '80px';
|
|
153
163
|
const HYPERLINK_DEFAULT_PATTERN = `/{locale}/{entry.fields.slug}/`;
|
|
154
164
|
const DEFAULT_IMAGE_WIDTH = '500px';
|
|
155
165
|
var PostMessageMethods;
|
|
@@ -161,5 +171,5 @@ const SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];
|
|
|
161
171
|
const PATTERN_PROPERTY_DIVIDER = '-----';
|
|
162
172
|
const SIDELOADED_PREFIX = 'sideloaded_';
|
|
163
173
|
|
|
164
|
-
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,
|
|
174
|
+
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_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 };
|
|
165
175
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["/** @deprecated will be removed when dropping backward compatibility for old DND */\nexport const SCROLL_STATES = {\n Start: 'scrollStart',\n IsScrolling: 'isScrolling',\n End: 'scrollEnd',\n} as const;\n\nexport const OUTGOING_EVENTS = {\n Connected: 'connected',\n DesignTokens: 'registerDesignTokens',\n RegisteredBreakpoints: 'registeredBreakpoints',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n MouseMove: 'mouseMove',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentSelected: 'componentSelected',\n RegisteredComponents: 'registeredComponents',\n RequestComponentTreeUpdate: 'requestComponentTreeUpdate',\n CanvasReload: 'canvasReload',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n UpdateSelectedComponentCoordinates: 'updateSelectedComponentCoordinates',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n CanvasScroll: 'canvasScrolling',\n CanvasError: 'canvasError',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n OutsideCanvasClick: 'outsideCanvasClick',\n SDKFeatures: 'sdkFeatures',\n RequestEntities: 'REQUEST_ENTITIES',\n CanvasGeometryUpdated: 'canvasGeometryUpdated',\n} as const;\n\nexport const INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\n RequestReadOnlyMode: 'requestReadOnlyMode',\n ExperienceUpdated: 'componentTreeUpdated',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDraggingChanged: 'componentDraggingChanged',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragCanceled: 'componentDragCanceled',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragStarted: 'componentDragStarted',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentDragEnded: 'componentDragEnded',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n ComponentMoveEnded: 'componentMoveEnded',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n CanvasResized: 'canvasResized',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n SelectComponent: 'selectComponent',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n HoverComponent: 'hoverComponent',\n UpdatedEntity: 'updatedEntity',\n AssembliesAdded: 'assembliesAdded',\n AssembliesRegistered: 'assembliesRegistered',\n /** @deprecated will be removed when dropping backward compatibility for old DND */\n MouseMove: 'mouseMove',\n RequestedEntities: 'REQUESTED_ENTITIES',\n} as const;\n\nexport const INTERNAL_EVENTS = {\n ComponentsRegistered: 'cfComponentsRegistered',\n VisualEditorInitialize: 'cfVisualEditorInitialize',\n} as const;\n\nexport const VISUAL_EDITOR_EVENTS = {\n Ready: 'cfVisualEditorReady',\n};\n\n/**\n * These modes are ONLY intended to be internally used within the context of\n * editing an experience inside of Contentful Studio. i.e. these modes\n * intentionally do not include preview/delivery modes.\n */\nexport enum StudioCanvasMode {\n READ_ONLY = 'readOnlyMode',\n EDITOR = 'editorMode',\n NONE = 'none',\n}\n\nexport const VISUAL_EDITOR_CONTAINER_ID = 'cf-visual-editor';\nexport const CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';\nexport const CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';\n\nexport const CONTENTFUL_COMPONENTS = {\n section: {\n id: 'contentful-section',\n name: 'Section',\n },\n container: {\n id: 'contentful-container',\n name: 'Container',\n },\n columns: {\n id: 'contentful-columns',\n name: 'Columns',\n },\n singleColumn: {\n id: 'contentful-single-column',\n name: 'Column',\n },\n button: {\n id: 'contentful-button',\n name: 'Button',\n },\n heading: {\n id: 'contentful-heading',\n name: 'Heading',\n },\n image: {\n id: 'contentful-image',\n name: 'Image',\n },\n richText: {\n id: 'contentful-richText',\n name: 'Rich Text',\n },\n text: {\n id: 'contentful-text',\n name: 'Text',\n },\n divider: {\n id: 'contentful-divider',\n name: 'Divider',\n },\n carousel: {\n id: 'contentful-carousel',\n name: 'Carousel',\n },\n} as const;\n\nexport const ASSEMBLY_NODE_TYPE = 'assembly';\nexport const ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';\nexport const ASSEMBLY_BLOCK_NODE_TYPE = 'assemblyBlock';\nexport const ASSEMBLY_NODE_TYPES = [ASSEMBLY_NODE_TYPE, ASSEMBLY_BLOCK_NODE_TYPE];\nexport const LATEST_SCHEMA_VERSION = '2023-09-28';\nexport const CF_STYLE_ATTRIBUTES = [\n 'cfVisibility',\n 'cfHorizontalAlignment',\n 'cfVerticalAlignment',\n 'cfMargin',\n 'cfPadding',\n 'cfBackgroundColor',\n 'cfWidth',\n 'cfMaxWidth',\n 'cfHeight',\n 'cfImageAsset',\n 'cfImageOptions',\n 'cfBackgroundImageUrl',\n 'cfBackgroundImageOptions',\n 'cfFlexDirection',\n 'cfFlexWrap',\n 'cfFlexReverse',\n 'cfBorder',\n 'cfBorderRadius',\n 'cfGap',\n 'cfColumnSpan',\n 'cfColumnSpanLock',\n 'cfColumns',\n 'cfFontSize',\n 'cfFontWeight',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n 'cfTextAlign',\n 'cfTextTransform',\n 'cfTextBold',\n 'cfTextItalic',\n 'cfTextUnderline',\n];\n\nexport const EMPTY_CONTAINER_SIZE = '80px';\n\nexport const HYPERLINK_DEFAULT_PATTERN = `/{locale}/{entry.fields.slug}/`;\n\nexport const DEFAULT_IMAGE_WIDTH = '500px';\n\nexport enum PostMessageMethods {\n REQUEST_ENTITIES = 'REQUEST_ENTITIES',\n REQUESTED_ENTITIES = 'REQUESTED_ENTITIES',\n}\n\nexport const SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'] as const;\n\nexport const PATTERN_PROPERTY_DIVIDER = '-----';\n\nexport const SIDELOADED_PREFIX = 'sideloaded_';\n"],"names":[],"mappings":"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"}
|
|
@@ -29,13 +29,7 @@ declare class EntityStore extends EntityStoreBase {
|
|
|
29
29
|
}>;
|
|
30
30
|
}>;
|
|
31
31
|
get hoistedParameterDefinitions(): Record<string, {
|
|
32
|
-
contentTypes:
|
|
33
|
-
sys: {
|
|
34
|
-
type: "Link";
|
|
35
|
-
id: string;
|
|
36
|
-
linkType: "ContentType";
|
|
37
|
-
};
|
|
38
|
-
}>;
|
|
32
|
+
contentTypes: string[];
|
|
39
33
|
defaultSource?: {
|
|
40
34
|
type: "Entry";
|
|
41
35
|
contentTypeId: string;
|
package/dist/exports.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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,
|
|
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,
|
|
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_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, SelectComponentPayload, SendMessageParams, StructureComponentProps, 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/exports.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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,
|
|
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_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
2
|
//# sourceMappingURL=exports.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { isComponentAllowedOnRoot, isContentfulComponent, isContentfulStructureComponent, isPatternComponent, isStructureWithRelativeHeight } from './utils/components.js';
|
|
2
2
|
export { MEDIA_QUERY_REGEXP, getActiveBreakpointIndex, getFallbackBreakpointIndex, getValueForBreakpoint, isValidBreakpointValue, mediaQueryMatcher, mergeDesignValuesByBreakpoint } from './utils/breakpoints.js';
|
|
3
3
|
export { DebugLogger, debug, disableDebug, enableDebug } from './utils/debugLogger.js';
|
|
4
|
-
export { findOutermostCoordinates, getElementCoordinates } from './utils/domValues.js';
|
|
4
|
+
export { findOutermostCoordinates, getElementCoordinates, isElementHidden } from './utils/domValues.js';
|
|
5
5
|
export { isLinkToAsset } from './utils/isLinkToAsset.js';
|
|
6
6
|
export { isLinkToEntry } from './utils/isLinkToEntry.js';
|
|
7
7
|
export { isLink } from './utils/isLink.js';
|
|
@@ -16,7 +16,7 @@ export { transformVisibility } from './utils/styleUtils/styleTransformers.js';
|
|
|
16
16
|
export { transformBoundContentValue } from './utils/transformers/transformBoundContentValue.js';
|
|
17
17
|
export { treeMap, treeVisit } from './utils/treeTraversal.js';
|
|
18
18
|
export { isArrayOfLinks, isAsset, isEntry, isExperienceEntry, isPatternEntry } from './utils/typeguards.js';
|
|
19
|
-
export { checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, generateRandomId, getDataFromTree,
|
|
19
|
+
export { checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, generateRandomId, getDataFromTree, getTargetValueInPixels, parseCSSValue } from './utils/utils.js';
|
|
20
20
|
export { doesMismatchMessageSchema, tryParseMessage, validateExperienceBuilderConfig } from './utils/validations.js';
|
|
21
21
|
export { extractLeafLinksReferencedFromExperience } from './utils/schema/experienceSchema.js';
|
|
22
22
|
export { FnShouldFollowReferencesOfEntryField, extractReferencesFromEntries, extractReferencesFromEntriesAsIds, referencesOf, uniqueById } from './utils/schema/references.js';
|
package/dist/index.js
CHANGED
|
@@ -4,21 +4,31 @@ import md5 from 'md5';
|
|
|
4
4
|
import { BLOCKS } from '@contentful/rich-text-types';
|
|
5
5
|
import { create } from 'zustand';
|
|
6
6
|
|
|
7
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
7
8
|
const INCOMING_EVENTS = {
|
|
8
9
|
RequestEditorMode: 'requestEditorMode',
|
|
9
10
|
RequestReadOnlyMode: 'requestReadOnlyMode',
|
|
10
11
|
ExperienceUpdated: 'componentTreeUpdated',
|
|
12
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
11
13
|
ComponentDraggingChanged: 'componentDraggingChanged',
|
|
14
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
12
15
|
ComponentDragCanceled: 'componentDragCanceled',
|
|
16
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
13
17
|
ComponentDragStarted: 'componentDragStarted',
|
|
18
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
14
19
|
ComponentDragEnded: 'componentDragEnded',
|
|
20
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
15
21
|
ComponentMoveEnded: 'componentMoveEnded',
|
|
22
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
16
23
|
CanvasResized: 'canvasResized',
|
|
24
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
17
25
|
SelectComponent: 'selectComponent',
|
|
26
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
18
27
|
HoverComponent: 'hoverComponent',
|
|
19
28
|
UpdatedEntity: 'updatedEntity',
|
|
20
29
|
AssembliesAdded: 'assembliesAdded',
|
|
21
30
|
AssembliesRegistered: 'assembliesRegistered',
|
|
31
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
22
32
|
MouseMove: 'mouseMove',
|
|
23
33
|
RequestedEntities: 'REQUESTED_ENTITIES',
|
|
24
34
|
};
|
|
@@ -116,7 +126,7 @@ const CF_STYLE_ATTRIBUTES = [
|
|
|
116
126
|
'cfTextItalic',
|
|
117
127
|
'cfTextUnderline',
|
|
118
128
|
];
|
|
119
|
-
const
|
|
129
|
+
const EMPTY_CONTAINER_SIZE = '80px';
|
|
120
130
|
const DEFAULT_IMAGE_WIDTH = '500px';
|
|
121
131
|
var PostMessageMethods;
|
|
122
132
|
(function (PostMessageMethods) {
|
|
@@ -1059,13 +1069,7 @@ const ParameterDefinitionSchema = z.object({
|
|
|
1059
1069
|
}),
|
|
1060
1070
|
})
|
|
1061
1071
|
.optional(),
|
|
1062
|
-
contentTypes: z.
|
|
1063
|
-
sys: z.object({
|
|
1064
|
-
type: z.literal('Link'),
|
|
1065
|
-
id: z.string(),
|
|
1066
|
-
linkType: z.enum(['ContentType']),
|
|
1067
|
-
}),
|
|
1068
|
-
})),
|
|
1072
|
+
contentTypes: z.array(z.string()),
|
|
1069
1073
|
passToNodes: z.array(PassToNodeSchema).optional(),
|
|
1070
1074
|
});
|
|
1071
1075
|
const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefinitionSchema);
|
|
@@ -1085,7 +1089,7 @@ const ComponentSettingsSchema = z
|
|
|
1085
1089
|
variableDefinitions: ComponentVariablesSchema,
|
|
1086
1090
|
thumbnailId: z.enum(THUMBNAIL_IDS).optional(),
|
|
1087
1091
|
category: z.string().max(50, 'Category must contain at most 50 characters').optional(),
|
|
1088
|
-
prebindingDefinitions: z.array(PrebindingDefinitionSchema).
|
|
1092
|
+
prebindingDefinitions: z.array(PrebindingDefinitionSchema).length(1).optional(),
|
|
1089
1093
|
})
|
|
1090
1094
|
.strict();
|
|
1091
1095
|
z.object({
|
|
@@ -1458,7 +1462,10 @@ propertyName, resolveDesignTokens = true) => {
|
|
|
1458
1462
|
};
|
|
1459
1463
|
/** Overwrites the default value breakpoint by breakpoint. If a breakpoint
|
|
1460
1464
|
* is not overwritten, it will fall back to the default. */
|
|
1461
|
-
|
|
1465
|
+
function mergeDesignValuesByBreakpoint(defaultValue, overwriteValue) {
|
|
1466
|
+
if (!defaultValue || !overwriteValue) {
|
|
1467
|
+
return defaultValue ?? overwriteValue;
|
|
1468
|
+
}
|
|
1462
1469
|
const mergedValuesByBreakpoint = { ...defaultValue.valuesByBreakpoint };
|
|
1463
1470
|
for (const [breakpointId, value] of Object.entries(overwriteValue.valuesByBreakpoint)) {
|
|
1464
1471
|
if (!isValidBreakpointValue(value)) {
|
|
@@ -1470,7 +1477,7 @@ const mergeDesignValuesByBreakpoint = (defaultValue, overwriteValue) => {
|
|
|
1470
1477
|
type: 'DesignValue',
|
|
1471
1478
|
valuesByBreakpoint: mergedValuesByBreakpoint,
|
|
1472
1479
|
};
|
|
1473
|
-
}
|
|
1480
|
+
}
|
|
1474
1481
|
|
|
1475
1482
|
const CF_DEBUG_KEY = 'cf_debug';
|
|
1476
1483
|
/**
|
|
@@ -1563,6 +1570,10 @@ const findOutermostCoordinates = (first, second) => {
|
|
|
1563
1570
|
left: Math.min(first.left, second.left),
|
|
1564
1571
|
};
|
|
1565
1572
|
};
|
|
1573
|
+
const isElementHidden = (rect) => {
|
|
1574
|
+
/** if the rect has no size and position, its element is not rendered in the DOM */
|
|
1575
|
+
return rect.width === 0 && rect.height === 0 && rect.x === 0 && rect.y === 0;
|
|
1576
|
+
};
|
|
1566
1577
|
const getElementCoordinates = (element) => {
|
|
1567
1578
|
const rect = element.getBoundingClientRect();
|
|
1568
1579
|
/**
|
|
@@ -1858,7 +1869,14 @@ function buildTemplate({ template, context, }) {
|
|
|
1858
1869
|
|
|
1859
1870
|
const stylesToKeep = ['cfImageAsset'];
|
|
1860
1871
|
const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));
|
|
1861
|
-
|
|
1872
|
+
// cfWrapColumns & cfWrapColumnsCount are no real style attributes as they are handled on the editor side
|
|
1873
|
+
const propsToRemove = [
|
|
1874
|
+
'cfHyperlink',
|
|
1875
|
+
'cfOpenInNewTab',
|
|
1876
|
+
'cfSsrClassName',
|
|
1877
|
+
'cfWrapColumns',
|
|
1878
|
+
'cfWrapColumnsCount',
|
|
1879
|
+
];
|
|
1862
1880
|
const sanitizeNodeProps = (nodeProps) => {
|
|
1863
1881
|
return omit(nodeProps, stylesToRemove, propsToRemove);
|
|
1864
1882
|
};
|
|
@@ -2041,14 +2059,14 @@ const addMinHeightForEmptyStructures = (cssProperties, node) => {
|
|
|
2041
2059
|
isStructureWithRelativeHeight(node.definitionId, cssProperties.height)) {
|
|
2042
2060
|
return {
|
|
2043
2061
|
...cssProperties,
|
|
2044
|
-
minHeight:
|
|
2062
|
+
minHeight: EMPTY_CONTAINER_SIZE,
|
|
2045
2063
|
};
|
|
2046
2064
|
}
|
|
2047
2065
|
return cssProperties;
|
|
2048
2066
|
};
|
|
2049
2067
|
/**
|
|
2050
2068
|
* Container/section default behavior:
|
|
2051
|
-
* Default height => height:
|
|
2069
|
+
* Default height => height: EMPTY_CONTAINER_SIZE
|
|
2052
2070
|
* If a container component has children => height: 'fit-content'
|
|
2053
2071
|
*/
|
|
2054
2072
|
const calculateNodeDefaultHeight = ({ blockId, children, value, }) => {
|
|
@@ -2058,7 +2076,7 @@ const calculateNodeDefaultHeight = ({ blockId, children, value, }) => {
|
|
|
2058
2076
|
if (children.length) {
|
|
2059
2077
|
return '100%';
|
|
2060
2078
|
}
|
|
2061
|
-
return
|
|
2079
|
+
return EMPTY_CONTAINER_SIZE;
|
|
2062
2080
|
};
|
|
2063
2081
|
|
|
2064
2082
|
function getOptimizedImageUrl(url, width, quality, format) {
|
|
@@ -3090,47 +3108,6 @@ const getDataFromTree = (tree) => {
|
|
|
3090
3108
|
unboundValues,
|
|
3091
3109
|
};
|
|
3092
3110
|
};
|
|
3093
|
-
/**
|
|
3094
|
-
* Gets calculates the index to drop the dragged component based on the mouse position
|
|
3095
|
-
* @returns {InsertionData} a object containing a node that will become a parent for dragged component and index at which it must be inserted
|
|
3096
|
-
*/
|
|
3097
|
-
const getInsertionData = ({ dropReceiverParentNode, dropReceiverNode, flexDirection, isMouseAtTopBorder, isMouseAtBottomBorder, isMouseInLeftHalf, isMouseInUpperHalf, isOverTopIndicator, isOverBottomIndicator, }) => {
|
|
3098
|
-
const APPEND_INSIDE = dropReceiverNode.children.length;
|
|
3099
|
-
const PREPEND_INSIDE = 0;
|
|
3100
|
-
if (isMouseAtTopBorder || isMouseAtBottomBorder) {
|
|
3101
|
-
const indexOfSectionInParentChildren = dropReceiverParentNode.children.findIndex((n) => n.data.id === dropReceiverNode.data.id);
|
|
3102
|
-
const APPEND_OUTSIDE = indexOfSectionInParentChildren + 1;
|
|
3103
|
-
const PREPEND_OUTSIDE = indexOfSectionInParentChildren;
|
|
3104
|
-
return {
|
|
3105
|
-
// when the mouse is around the border we want to drop the new component as a new section onto the root node
|
|
3106
|
-
node: dropReceiverParentNode,
|
|
3107
|
-
index: isMouseAtBottomBorder ? APPEND_OUTSIDE : PREPEND_OUTSIDE,
|
|
3108
|
-
};
|
|
3109
|
-
}
|
|
3110
|
-
// if over one of the section indicators
|
|
3111
|
-
if (isOverTopIndicator || isOverBottomIndicator) {
|
|
3112
|
-
const indexOfSectionInParentChildren = dropReceiverParentNode.children.findIndex((n) => n.data.id === dropReceiverNode.data.id);
|
|
3113
|
-
const APPEND_OUTSIDE = indexOfSectionInParentChildren + 1;
|
|
3114
|
-
const PREPEND_OUTSIDE = indexOfSectionInParentChildren;
|
|
3115
|
-
return {
|
|
3116
|
-
// when the mouse is around the border we want to drop the new component as a new section onto the root node
|
|
3117
|
-
node: dropReceiverParentNode,
|
|
3118
|
-
index: isOverBottomIndicator ? APPEND_OUTSIDE : PREPEND_OUTSIDE,
|
|
3119
|
-
};
|
|
3120
|
-
}
|
|
3121
|
-
if (flexDirection === undefined || flexDirection === 'row') {
|
|
3122
|
-
return {
|
|
3123
|
-
node: dropReceiverNode,
|
|
3124
|
-
index: isMouseInLeftHalf ? PREPEND_INSIDE : APPEND_INSIDE,
|
|
3125
|
-
};
|
|
3126
|
-
}
|
|
3127
|
-
else {
|
|
3128
|
-
return {
|
|
3129
|
-
node: dropReceiverNode,
|
|
3130
|
-
index: isMouseInUpperHalf ? PREPEND_INSIDE : APPEND_INSIDE,
|
|
3131
|
-
};
|
|
3132
|
-
}
|
|
3133
|
-
};
|
|
3134
3111
|
const generateRandomId = (letterCount) => {
|
|
3135
3112
|
const LETTERS = 'abcdefghijklmnopqvwxyzABCDEFGHIJKLMNOPQVWXYZ';
|
|
3136
3113
|
const NUMS = '0123456789';
|
|
@@ -4691,5 +4668,5 @@ async function fetchById({ client, experienceTypeId, id, localeCode, isEditorMod
|
|
|
4691
4668
|
}
|
|
4692
4669
|
}
|
|
4693
4670
|
|
|
4694
|
-
export { DebugLogger, DeepReference, EditorModeEntityStore, EntityStore, EntityStoreBase, MEDIA_QUERY_REGEXP, VisualEditorMode, addLocale, addMinHeightForEmptyStructures, breakpointsRegistry, buildCfStyles, buildStyleTag, buildTemplate, builtInStyles, calculateNodeDefaultHeight, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, columnsBuiltInStyles, containerBuiltInStyles, createExperience, debug, defineBreakpoints, defineDesignTokens, designTokensRegistry, detachExperienceStyles, disableDebug, dividerBuiltInStyles, doesMismatchMessageSchema, enableDebug, extractLeafLinksReferencedFromExperience, extractReferencesFromEntries, extractReferencesFromEntriesAsIds, fetchAllAssets, fetchAllEntries, fetchById, fetchBySlug, fetchExperienceEntry, fetchReferencedEntities, findOutermostCoordinates, flattenDesignTokenRegistry, gatherDeepReferencesFromExperienceEntry, gatherDeepReferencesFromTree, generateRandomId, getActiveBreakpointIndex, getBreakpointRegistration, getDataFromTree, getDesignTokenRegistration, getElementCoordinates, getFallbackBreakpointIndex,
|
|
4671
|
+
export { DebugLogger, DeepReference, EditorModeEntityStore, EntityStore, EntityStoreBase, MEDIA_QUERY_REGEXP, VisualEditorMode, addLocale, addMinHeightForEmptyStructures, breakpointsRegistry, buildCfStyles, buildStyleTag, buildTemplate, builtInStyles, calculateNodeDefaultHeight, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, columnsBuiltInStyles, containerBuiltInStyles, createExperience, debug, defineBreakpoints, defineDesignTokens, designTokensRegistry, detachExperienceStyles, disableDebug, dividerBuiltInStyles, doesMismatchMessageSchema, enableDebug, extractLeafLinksReferencedFromExperience, extractReferencesFromEntries, extractReferencesFromEntriesAsIds, fetchAllAssets, fetchAllEntries, fetchById, fetchBySlug, fetchExperienceEntry, fetchReferencedEntities, findOutermostCoordinates, flattenDesignTokenRegistry, gatherDeepReferencesFromExperienceEntry, gatherDeepReferencesFromTree, generateRandomId, getActiveBreakpointIndex, getBreakpointRegistration, getDataFromTree, getDesignTokenRegistration, getElementCoordinates, getFallbackBreakpointIndex, getTargetValueInPixels, getTemplateValue, getValueForBreakpoint, inMemoryEntities, inMemoryEntitiesStore, indexByBreakpoint, isArrayOfLinks, isAsset, isCfStyleAttribute, isComponentAllowedOnRoot, isContentfulComponent, isContentfulStructureComponent, isDeepPath, isElementHidden, isEntry, isExperienceEntry, isLink, isLinkToAsset, isLinkToEntry, isPatternComponent, isPatternEntry, isStructureWithRelativeHeight, isValidBreakpointValue, lastPathNamedSegmentEq, localizeEntity, maybePopulateDesignTokenValue, mediaQueryMatcher, mergeDesignValuesByBreakpoint, optionalBuiltInStyles, parseCSSValue, parseDataSourcePathIntoFieldset, parseDataSourcePathWithL1DeepBindings, referencesOf, resetBreakpointsRegistry, resetDesignTokenRegistry, resolveBackgroundImageBinding, resolveHyperlinkPattern, runBreakpointsValidation, sanitizeNodeProps, sectionBuiltInStyles, sendMessage, singleColumnBuiltInStyles, stringifyCssProperties, toCSSAttribute, toMediaQuery, transformBoundContentValue, transformVisibility, treeMap, treeVisit, tryParseMessage, uniqueById, useInMemoryEntities, validateExperienceBuilderConfig };
|
|
4695
4672
|
//# sourceMappingURL=index.js.map
|