@contentful/experiences-core 2.0.0-prerelease-20250704T1603-11d76eb.0 → 2.0.1-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.
@@ -1,4 +1,3 @@
1
- /** @deprecated will be removed when dropping backward compatibility for old DND */
2
1
  declare const SCROLL_STATES: {
3
2
  readonly Start: "scrollStart";
4
3
  readonly IsScrolling: "isScrolling";
@@ -8,48 +7,39 @@ declare const OUTGOING_EVENTS: {
8
7
  readonly Connected: "connected";
9
8
  readonly DesignTokens: "registerDesignTokens";
10
9
  readonly RegisteredBreakpoints: "registeredBreakpoints";
11
- /** @deprecated will be removed when dropping backward compatibility for old DND */
12
10
  readonly MouseMove: "mouseMove";
13
- /** @deprecated will be removed when dropping backward compatibility for old DND */
11
+ readonly NewHoveredElement: "newHoveredElement";
14
12
  readonly ComponentSelected: "componentSelected";
15
13
  readonly RegisteredComponents: "registeredComponents";
16
14
  readonly RequestComponentTreeUpdate: "requestComponentTreeUpdate";
15
+ readonly ComponentDragCanceled: "componentDragCanceled";
16
+ readonly ComponentDropped: "componentDropped";
17
+ readonly ComponentMoved: "componentMoved";
17
18
  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 */
21
20
  readonly CanvasScroll: "canvasScrolling";
22
21
  readonly CanvasError: "canvasError";
23
- /** @deprecated will be removed when dropping backward compatibility for old DND */
22
+ readonly ComponentMoveStarted: "componentMoveStarted";
23
+ readonly ComponentMoveEnded: "componentMoveEnded";
24
24
  readonly OutsideCanvasClick: "outsideCanvasClick";
25
25
  readonly SDKFeatures: "sdkFeatures";
26
26
  readonly RequestEntities: "REQUEST_ENTITIES";
27
- readonly CanvasGeometryUpdated: "canvasGeometryUpdated";
28
27
  };
29
28
  declare const INCOMING_EVENTS: {
30
29
  readonly RequestEditorMode: "requestEditorMode";
31
30
  readonly RequestReadOnlyMode: "requestReadOnlyMode";
32
31
  readonly ExperienceUpdated: "componentTreeUpdated";
33
- /** @deprecated will be removed when dropping backward compatibility for old DND */
34
32
  readonly ComponentDraggingChanged: "componentDraggingChanged";
35
- /** @deprecated will be removed when dropping backward compatibility for old DND */
36
33
  readonly ComponentDragCanceled: "componentDragCanceled";
37
- /** @deprecated will be removed when dropping backward compatibility for old DND */
38
34
  readonly ComponentDragStarted: "componentDragStarted";
39
- /** @deprecated will be removed when dropping backward compatibility for old DND */
40
35
  readonly ComponentDragEnded: "componentDragEnded";
41
- /** @deprecated will be removed when dropping backward compatibility for old DND */
42
36
  readonly ComponentMoveEnded: "componentMoveEnded";
43
- /** @deprecated will be removed when dropping backward compatibility for old DND */
44
37
  readonly CanvasResized: "canvasResized";
45
- /** @deprecated will be removed when dropping backward compatibility for old DND */
46
38
  readonly SelectComponent: "selectComponent";
47
- /** @deprecated will be removed when dropping backward compatibility for old DND */
48
39
  readonly HoverComponent: "hoverComponent";
49
40
  readonly UpdatedEntity: "updatedEntity";
50
41
  readonly AssembliesAdded: "assembliesAdded";
51
42
  readonly AssembliesRegistered: "assembliesRegistered";
52
- /** @deprecated will be removed when dropping backward compatibility for old DND */
53
43
  readonly MouseMove: "mouseMove";
54
44
  readonly RequestedEntities: "REQUESTED_ENTITIES";
55
45
  };
@@ -125,7 +115,7 @@ declare const ASSEMBLY_BLOCK_NODE_TYPE = "assemblyBlock";
125
115
  declare const ASSEMBLY_NODE_TYPES: string[];
126
116
  declare const LATEST_SCHEMA_VERSION = "2023-09-28";
127
117
  declare const CF_STYLE_ATTRIBUTES: string[];
128
- declare const EMPTY_CONTAINER_SIZE = "80px";
118
+ declare const EMPTY_CONTAINER_HEIGHT = "80px";
129
119
  declare const HYPERLINK_DEFAULT_PATTERN = "/{locale}/{entry.fields.slug}/";
130
120
  declare const DEFAULT_IMAGE_WIDTH = "500px";
131
121
  declare enum PostMessageMethods {
@@ -136,4 +126,4 @@ declare const SUPPORTED_IMAGE_FORMATS: readonly ["jpg", "png", "webp", "gif", "a
136
126
  declare const PATTERN_PROPERTY_DIVIDER = "-----";
137
127
  declare const SIDELOADED_PREFIX = "sideloaded_";
138
128
 
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 };
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 };
package/dist/constants.js CHANGED
@@ -1,4 +1,3 @@
1
- /** @deprecated will be removed when dropping backward compatibility for old DND */
2
1
  const SCROLL_STATES = {
3
2
  Start: 'scrollStart',
4
3
  IsScrolling: 'isScrolling',
@@ -8,48 +7,39 @@ const OUTGOING_EVENTS = {
8
7
  Connected: 'connected',
9
8
  DesignTokens: 'registerDesignTokens',
10
9
  RegisteredBreakpoints: 'registeredBreakpoints',
11
- /** @deprecated will be removed when dropping backward compatibility for old DND */
12
10
  MouseMove: 'mouseMove',
13
- /** @deprecated will be removed when dropping backward compatibility for old DND */
11
+ NewHoveredElement: 'newHoveredElement',
14
12
  ComponentSelected: 'componentSelected',
15
13
  RegisteredComponents: 'registeredComponents',
16
14
  RequestComponentTreeUpdate: 'requestComponentTreeUpdate',
15
+ ComponentDragCanceled: 'componentDragCanceled',
16
+ ComponentDropped: 'componentDropped',
17
+ ComponentMoved: 'componentMoved',
17
18
  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 */
21
20
  CanvasScroll: 'canvasScrolling',
22
21
  CanvasError: 'canvasError',
23
- /** @deprecated will be removed when dropping backward compatibility for old DND */
22
+ ComponentMoveStarted: 'componentMoveStarted',
23
+ ComponentMoveEnded: 'componentMoveEnded',
24
24
  OutsideCanvasClick: 'outsideCanvasClick',
25
25
  SDKFeatures: 'sdkFeatures',
26
26
  RequestEntities: 'REQUEST_ENTITIES',
27
- CanvasGeometryUpdated: 'canvasGeometryUpdated',
28
27
  };
29
28
  const INCOMING_EVENTS = {
30
29
  RequestEditorMode: 'requestEditorMode',
31
30
  RequestReadOnlyMode: 'requestReadOnlyMode',
32
31
  ExperienceUpdated: 'componentTreeUpdated',
33
- /** @deprecated will be removed when dropping backward compatibility for old DND */
34
32
  ComponentDraggingChanged: 'componentDraggingChanged',
35
- /** @deprecated will be removed when dropping backward compatibility for old DND */
36
33
  ComponentDragCanceled: 'componentDragCanceled',
37
- /** @deprecated will be removed when dropping backward compatibility for old DND */
38
34
  ComponentDragStarted: 'componentDragStarted',
39
- /** @deprecated will be removed when dropping backward compatibility for old DND */
40
35
  ComponentDragEnded: 'componentDragEnded',
41
- /** @deprecated will be removed when dropping backward compatibility for old DND */
42
36
  ComponentMoveEnded: 'componentMoveEnded',
43
- /** @deprecated will be removed when dropping backward compatibility for old DND */
44
37
  CanvasResized: 'canvasResized',
45
- /** @deprecated will be removed when dropping backward compatibility for old DND */
46
38
  SelectComponent: 'selectComponent',
47
- /** @deprecated will be removed when dropping backward compatibility for old DND */
48
39
  HoverComponent: 'hoverComponent',
49
40
  UpdatedEntity: 'updatedEntity',
50
41
  AssembliesAdded: 'assembliesAdded',
51
42
  AssembliesRegistered: 'assembliesRegistered',
52
- /** @deprecated will be removed when dropping backward compatibility for old DND */
53
43
  MouseMove: 'mouseMove',
54
44
  RequestedEntities: 'REQUESTED_ENTITIES',
55
45
  };
@@ -159,7 +149,7 @@ const CF_STYLE_ATTRIBUTES = [
159
149
  'cfTextItalic',
160
150
  'cfTextUnderline',
161
151
  ];
162
- const EMPTY_CONTAINER_SIZE = '80px';
152
+ const EMPTY_CONTAINER_HEIGHT = '80px';
163
153
  const HYPERLINK_DEFAULT_PATTERN = `/{locale}/{entry.fields.slug}/`;
164
154
  const DEFAULT_IMAGE_WIDTH = '500px';
165
155
  var PostMessageMethods;
@@ -171,5 +161,5 @@ const SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];
171
161
  const PATTERN_PROPERTY_DIVIDER = '-----';
172
162
  const SIDELOADED_PREFIX = 'sideloaded_';
173
163
 
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 };
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 };
175
165
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
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;AAC1B,IAAA,eAAe,EAAE,kBAA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E;AAC3E,MAAM,qBAAqB,GAAG,aAAa;AACrC,MAAA,mBAAmB,GAAG;IACjC,cAAc;IACd,uBAAuB;IACvB,qBAAqB;IACrB,UAAU;IACV,WAAW;IACX,mBAAmB;IACnB,SAAS;IACT,YAAY;IACZ,UAAU;IACV,cAAc;IACd,gBAAgB;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,oBAAoB,GAAG,OAAO;AAEpC,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":["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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TAINER_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';
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';
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
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_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';
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';
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, isElementHidden } from './utils/domValues.js';
4
+ export { findOutermostCoordinates, getElementCoordinates } 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, getTargetValueInPixels, parseCSSValue } from './utils/utils.js';
19
+ export { checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, generateRandomId, getDataFromTree, getInsertionData, 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,31 +4,21 @@ 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 */
8
7
  const INCOMING_EVENTS = {
9
8
  RequestEditorMode: 'requestEditorMode',
10
9
  RequestReadOnlyMode: 'requestReadOnlyMode',
11
10
  ExperienceUpdated: 'componentTreeUpdated',
12
- /** @deprecated will be removed when dropping backward compatibility for old DND */
13
11
  ComponentDraggingChanged: 'componentDraggingChanged',
14
- /** @deprecated will be removed when dropping backward compatibility for old DND */
15
12
  ComponentDragCanceled: 'componentDragCanceled',
16
- /** @deprecated will be removed when dropping backward compatibility for old DND */
17
13
  ComponentDragStarted: 'componentDragStarted',
18
- /** @deprecated will be removed when dropping backward compatibility for old DND */
19
14
  ComponentDragEnded: 'componentDragEnded',
20
- /** @deprecated will be removed when dropping backward compatibility for old DND */
21
15
  ComponentMoveEnded: 'componentMoveEnded',
22
- /** @deprecated will be removed when dropping backward compatibility for old DND */
23
16
  CanvasResized: 'canvasResized',
24
- /** @deprecated will be removed when dropping backward compatibility for old DND */
25
17
  SelectComponent: 'selectComponent',
26
- /** @deprecated will be removed when dropping backward compatibility for old DND */
27
18
  HoverComponent: 'hoverComponent',
28
19
  UpdatedEntity: 'updatedEntity',
29
20
  AssembliesAdded: 'assembliesAdded',
30
21
  AssembliesRegistered: 'assembliesRegistered',
31
- /** @deprecated will be removed when dropping backward compatibility for old DND */
32
22
  MouseMove: 'mouseMove',
33
23
  RequestedEntities: 'REQUESTED_ENTITIES',
34
24
  };
@@ -126,7 +116,7 @@ const CF_STYLE_ATTRIBUTES = [
126
116
  'cfTextItalic',
127
117
  'cfTextUnderline',
128
118
  ];
129
- const EMPTY_CONTAINER_SIZE = '80px';
119
+ const EMPTY_CONTAINER_HEIGHT = '80px';
130
120
  const DEFAULT_IMAGE_WIDTH = '500px';
131
121
  var PostMessageMethods;
132
122
  (function (PostMessageMethods) {
@@ -1570,10 +1560,6 @@ const findOutermostCoordinates = (first, second) => {
1570
1560
  left: Math.min(first.left, second.left),
1571
1561
  };
1572
1562
  };
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
- };
1577
1563
  const getElementCoordinates = (element) => {
1578
1564
  const rect = element.getBoundingClientRect();
1579
1565
  /**
@@ -1869,14 +1855,7 @@ function buildTemplate({ template, context, }) {
1869
1855
 
1870
1856
  const stylesToKeep = ['cfImageAsset'];
1871
1857
  const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));
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
- ];
1858
+ const propsToRemove = ['cfHyperlink', 'cfOpenInNewTab', 'cfSsrClassName'];
1880
1859
  const sanitizeNodeProps = (nodeProps) => {
1881
1860
  return omit(nodeProps, stylesToRemove, propsToRemove);
1882
1861
  };
@@ -2059,14 +2038,14 @@ const addMinHeightForEmptyStructures = (cssProperties, node) => {
2059
2038
  isStructureWithRelativeHeight(node.definitionId, cssProperties.height)) {
2060
2039
  return {
2061
2040
  ...cssProperties,
2062
- minHeight: EMPTY_CONTAINER_SIZE,
2041
+ minHeight: EMPTY_CONTAINER_HEIGHT,
2063
2042
  };
2064
2043
  }
2065
2044
  return cssProperties;
2066
2045
  };
2067
2046
  /**
2068
2047
  * Container/section default behavior:
2069
- * Default height => height: EMPTY_CONTAINER_SIZE
2048
+ * Default height => height: EMPTY_CONTAINER_HEIGHT
2070
2049
  * If a container component has children => height: 'fit-content'
2071
2050
  */
2072
2051
  const calculateNodeDefaultHeight = ({ blockId, children, value, }) => {
@@ -2076,7 +2055,7 @@ const calculateNodeDefaultHeight = ({ blockId, children, value, }) => {
2076
2055
  if (children.length) {
2077
2056
  return '100%';
2078
2057
  }
2079
- return EMPTY_CONTAINER_SIZE;
2058
+ return EMPTY_CONTAINER_HEIGHT;
2080
2059
  };
2081
2060
 
2082
2061
  function getOptimizedImageUrl(url, width, quality, format) {
@@ -3108,6 +3087,47 @@ const getDataFromTree = (tree) => {
3108
3087
  unboundValues,
3109
3088
  };
3110
3089
  };
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
+ };
3111
3131
  const generateRandomId = (letterCount) => {
3112
3132
  const LETTERS = 'abcdefghijklmnopqvwxyzABCDEFGHIJKLMNOPQVWXYZ';
3113
3133
  const NUMS = '0123456789';
@@ -4668,5 +4688,5 @@ async function fetchById({ client, experienceTypeId, id, localeCode, isEditorMod
4668
4688
  }
4669
4689
  }
4670
4690
 
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 };
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 };
4672
4692
  //# sourceMappingURL=index.js.map