@contentful/experiences-core 2.0.0-prerelease-20250704T1125-6c39a4b.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.
@@ -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
- readonly NewHoveredElement: "newHoveredElement";
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
- readonly ComponentMoveStarted: "componentMoveStarted";
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 EMPTY_CONTAINER_HEIGHT = "80px";
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, EMPTY_CONTAINER_HEIGHT, 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 };
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
- NewHoveredElement: 'newHoveredElement',
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
- ComponentMoveStarted: 'componentMoveStarted',
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 EMPTY_CONTAINER_HEIGHT = '80px';
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, EMPTY_CONTAINER_HEIGHT, 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 };
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
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export 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 MouseMove: 'mouseMove',\n NewHoveredElement: 'newHoveredElement',\n ComponentSelected: 'componentSelected',\n RegisteredComponents: 'registeredComponents',\n RequestComponentTreeUpdate: 'requestComponentTreeUpdate',\n ComponentDragCanceled: 'componentDragCanceled',\n ComponentDropped: 'componentDropped',\n ComponentMoved: 'componentMoved',\n CanvasReload: 'canvasReload',\n UpdateSelectedComponentCoordinates: 'updateSelectedComponentCoordinates',\n CanvasScroll: 'canvasScrolling',\n CanvasError: 'canvasError',\n ComponentMoveStarted: 'componentMoveStarted',\n ComponentMoveEnded: 'componentMoveEnded',\n OutsideCanvasClick: 'outsideCanvasClick',\n SDKFeatures: 'sdkFeatures',\n RequestEntities: 'REQUEST_ENTITIES',\n} as const;\n\nexport const INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\n RequestReadOnlyMode: 'requestReadOnlyMode',\n ExperienceUpdated: 'componentTreeUpdated',\n ComponentDraggingChanged: 'componentDraggingChanged',\n ComponentDragCanceled: 'componentDragCanceled',\n ComponentDragStarted: 'componentDragStarted',\n ComponentDragEnded: 'componentDragEnded',\n ComponentMoveEnded: 'componentMoveEnded',\n CanvasResized: 'canvasResized',\n SelectComponent: 'selectComponent',\n HoverComponent: 'hoverComponent',\n UpdatedEntity: 'updatedEntity',\n AssembliesAdded: 'assembliesAdded',\n AssembliesRegistered: 'assembliesRegistered',\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_HEIGHT = '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":"AAAa,MAAA,aAAa,GAAG;AAC3B,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,GAAG,EAAE,WAAW;EACP;AAEE,MAAA,eAAe,GAAG;AAC7B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,YAAY,EAAE,sBAAsB;AACpC,IAAA,qBAAqB,EAAE,uBAAuB;AAC9C,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,qBAAqB,EAAE,uBAAuB;AAC9C,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,kCAAkC,EAAE,oCAAoC;AACxE,IAAA,YAAY,EAAE,iBAAiB;AAC/B,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,eAAe,EAAE,kBAAkB;EAC1B;AAEE,MAAA,eAAe,GAAG;AAC7B,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,iBAAiB,EAAE,sBAAsB;A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BAAgB;IAChB,sBAAsB;IACtB,0BAA0B;IAC1B,iBAAiB;IACjB,YAAY;IACZ,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,OAAO;IACP,cAAc;IACd,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,cAAc;IACd,iBAAiB;EACjB;AAEK,MAAM,sBAAsB,GAAG,OAAO;AAEtC,MAAM,yBAAyB,GAAG,iCAAiC;AAEnE,MAAM,mBAAmB,GAAG,QAAQ;IAE/B,mBAGX;AAHD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACrC,IAAA,kBAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC,CAAA;AAC3C,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAG7B,EAAA,CAAA,CAAA,CAAA;AAEM,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAW;AAE/E,MAAM,wBAAwB,GAAG,QAAQ;AAEzC,MAAM,iBAAiB,GAAG;;;;"}
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":"AAAA;AACa,MAAA,aAAa,GAAG;AAC3B,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,GAAG,EAAE,WAAW;EACP;AAEE,MAAA,eAAe,GAAG;AAC7B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,YAAY,EAAE,sBAAsB;AACpC,IAAA,qBAAqB,EAAE,uBAAuB;;AAE9C,IAAA,SAAS,EAAE,WAAW;;AAEtB,IAAA,iBAAiB,EAAE,mBAAmB;AACtC,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,YAAY,EAAE,cAAc;;AAE5B,IAAA,kCAAkC,EAAE,oCAAoC;;AAExE,IAAA,YAAY,EAAE,iBAAiB;AAC/B,IAAA,WAAW,EAAE,aAAa;;AAE1B,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,WAAW,EAAE,aAAa;AA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T_CATEGORY, DEFAULT_IMAGE_WIDTH, EMPTY_CONTAINER_HEIGHT, 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, 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';
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, EMPTY_CONTAINER_HEIGHT, 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';
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, getInsertionData, getTargetValueInPixels, parseCSSValue } from './utils/utils.js';
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 EMPTY_CONTAINER_HEIGHT = '80px';
129
+ const EMPTY_CONTAINER_SIZE = '80px';
120
130
  const DEFAULT_IMAGE_WIDTH = '500px';
121
131
  var PostMessageMethods;
122
132
  (function (PostMessageMethods) {
@@ -1560,6 +1570,10 @@ const findOutermostCoordinates = (first, second) => {
1560
1570
  left: Math.min(first.left, second.left),
1561
1571
  };
1562
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
+ };
1563
1577
  const getElementCoordinates = (element) => {
1564
1578
  const rect = element.getBoundingClientRect();
1565
1579
  /**
@@ -1855,7 +1869,14 @@ function buildTemplate({ template, context, }) {
1855
1869
 
1856
1870
  const stylesToKeep = ['cfImageAsset'];
1857
1871
  const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));
1858
- const propsToRemove = ['cfHyperlink', 'cfOpenInNewTab', 'cfSsrClassName'];
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
+ ];
1859
1880
  const sanitizeNodeProps = (nodeProps) => {
1860
1881
  return omit(nodeProps, stylesToRemove, propsToRemove);
1861
1882
  };
@@ -2038,14 +2059,14 @@ const addMinHeightForEmptyStructures = (cssProperties, node) => {
2038
2059
  isStructureWithRelativeHeight(node.definitionId, cssProperties.height)) {
2039
2060
  return {
2040
2061
  ...cssProperties,
2041
- minHeight: EMPTY_CONTAINER_HEIGHT,
2062
+ minHeight: EMPTY_CONTAINER_SIZE,
2042
2063
  };
2043
2064
  }
2044
2065
  return cssProperties;
2045
2066
  };
2046
2067
  /**
2047
2068
  * Container/section default behavior:
2048
- * Default height => height: EMPTY_CONTAINER_HEIGHT
2069
+ * Default height => height: EMPTY_CONTAINER_SIZE
2049
2070
  * If a container component has children => height: 'fit-content'
2050
2071
  */
2051
2072
  const calculateNodeDefaultHeight = ({ blockId, children, value, }) => {
@@ -2055,7 +2076,7 @@ const calculateNodeDefaultHeight = ({ blockId, children, value, }) => {
2055
2076
  if (children.length) {
2056
2077
  return '100%';
2057
2078
  }
2058
- return EMPTY_CONTAINER_HEIGHT;
2079
+ return EMPTY_CONTAINER_SIZE;
2059
2080
  };
2060
2081
 
2061
2082
  function getOptimizedImageUrl(url, width, quality, format) {
@@ -3087,47 +3108,6 @@ const getDataFromTree = (tree) => {
3087
3108
  unboundValues,
3088
3109
  };
3089
3110
  };
3090
- /**
3091
- * Gets calculates the index to drop the dragged component based on the mouse position
3092
- * @returns {InsertionData} a object containing a node that will become a parent for dragged component and index at which it must be inserted
3093
- */
3094
- const getInsertionData = ({ dropReceiverParentNode, dropReceiverNode, flexDirection, isMouseAtTopBorder, isMouseAtBottomBorder, isMouseInLeftHalf, isMouseInUpperHalf, isOverTopIndicator, isOverBottomIndicator, }) => {
3095
- const APPEND_INSIDE = dropReceiverNode.children.length;
3096
- const PREPEND_INSIDE = 0;
3097
- if (isMouseAtTopBorder || isMouseAtBottomBorder) {
3098
- const indexOfSectionInParentChildren = dropReceiverParentNode.children.findIndex((n) => n.data.id === dropReceiverNode.data.id);
3099
- const APPEND_OUTSIDE = indexOfSectionInParentChildren + 1;
3100
- const PREPEND_OUTSIDE = indexOfSectionInParentChildren;
3101
- return {
3102
- // when the mouse is around the border we want to drop the new component as a new section onto the root node
3103
- node: dropReceiverParentNode,
3104
- index: isMouseAtBottomBorder ? APPEND_OUTSIDE : PREPEND_OUTSIDE,
3105
- };
3106
- }
3107
- // if over one of the section indicators
3108
- if (isOverTopIndicator || isOverBottomIndicator) {
3109
- const indexOfSectionInParentChildren = dropReceiverParentNode.children.findIndex((n) => n.data.id === dropReceiverNode.data.id);
3110
- const APPEND_OUTSIDE = indexOfSectionInParentChildren + 1;
3111
- const PREPEND_OUTSIDE = indexOfSectionInParentChildren;
3112
- return {
3113
- // when the mouse is around the border we want to drop the new component as a new section onto the root node
3114
- node: dropReceiverParentNode,
3115
- index: isOverBottomIndicator ? APPEND_OUTSIDE : PREPEND_OUTSIDE,
3116
- };
3117
- }
3118
- if (flexDirection === undefined || flexDirection === 'row') {
3119
- return {
3120
- node: dropReceiverNode,
3121
- index: isMouseInLeftHalf ? PREPEND_INSIDE : APPEND_INSIDE,
3122
- };
3123
- }
3124
- else {
3125
- return {
3126
- node: dropReceiverNode,
3127
- index: isMouseInUpperHalf ? PREPEND_INSIDE : APPEND_INSIDE,
3128
- };
3129
- }
3130
- };
3131
3111
  const generateRandomId = (letterCount) => {
3132
3112
  const LETTERS = 'abcdefghijklmnopqvwxyzABCDEFGHIJKLMNOPQVWXYZ';
3133
3113
  const NUMS = '0123456789';
@@ -4688,5 +4668,5 @@ async function fetchById({ client, experienceTypeId, id, localeCode, isEditorMod
4688
4668
  }
4689
4669
  }
4690
4670
 
4691
- 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, getInsertionData, getTargetValueInPixels, getTemplateValue, getValueForBreakpoint, inMemoryEntities, inMemoryEntitiesStore, indexByBreakpoint, isArrayOfLinks, isAsset, isCfStyleAttribute, isComponentAllowedOnRoot, isContentfulComponent, isContentfulStructureComponent, isDeepPath, 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 };
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 };
4692
4672
  //# sourceMappingURL=index.js.map