@contentful/experiences-visual-editor-react 0.0.1-alpha.12 → 0.0.1-alpha.13

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../core/dist/index.js","../../core/dist/constants.js","../../src/components/Draggable/canvasToolsUtils.ts","../../src/components/Draggable/Tooltip.tsx","../../src/store/draggedItem.ts","../../src/types/constants.ts","../../src/components/Draggable/Placeholder.tsx","../../src/hooks/useDraggablePosition.ts","../../src/components/Draggable/DraggableComponent.tsx","../../src/communication/sendSelectedComponentCoordinates.ts","../../src/store/registries.ts","../../src/store/editor.ts","../../src/hooks/useSelectedInstanceCoordinates.ts","../../src/hooks/useStyleTag.ts","../../src/utils/getUnboundValues.ts","../../src/store/entityStore.ts","../../src/components/Dropzone/useComponentProps.ts","../../components/dist/index.js","../../src/utils/assemblyUtils.ts","../../src/components/Dropzone/useComponent.ts","../../src/components/Draggable/DraggableChildComponent.tsx","../../src/utils/getItem.ts","../../src/utils/treeHelpers.ts","../../src/utils/getTreeDiff.ts","../../src/utils/treeTraversal.ts","../../src/store/tree.ts","../../src/store/zone.ts","../../src/utils/getHitboxStyles.ts","../../src/components/Dropzone/Hitboxes.tsx","../../src/components/Dropzone/EditorBlock.tsx","../../src/components/EmptyContainer/EmptyContainer.tsx","../../src/utils/zone.ts","../../src/hooks/useDropzoneDirection.ts","../../src/components/Dropzone/EditorBlockClone.tsx","../../src/components/Dropzone/DropzoneClone.tsx","../../src/components/Dropzone/Dropzone.tsx","../../src/components/Draggable/DraggableComponentList.tsx","../../src/hooks/useBreakpoints.ts","../../src/communication/MouseOverHandler.ts","../../src/communication/sendHoveredComponentCoordinates.ts","../../src/utils/dragState.ts","../../src/utils/simulateDnD.ts","../../src/hooks/useEditorSubscriber.ts","../../src/communication/onComponentMoved.ts","../../src/utils/generate-id.ts","../../src/utils/createTreeNode.ts","../../src/communication/onComponentDrop.ts","../../src/utils/onDrop.ts","../../src/hooks/useCanvasInteractions.ts","../../src/components/RootRenderer/TestDNDContainer.tsx","../../src/components/RootRenderer/DNDProvider.tsx","../../src/components/RootRenderer/RootRenderer.tsx","../../src/hooks/useInitializeEditor.ts","../../src/components/VisualEditorRoot.tsx"],"sourcesContent":["import md5 from 'md5';\nimport { BLOCKS } from '@contentful/rich-text-types';\n\nconst INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\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 InitEditor: 'initEditor',\n MouseMove: 'mouseMove',\n};\nconst CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';\nconst 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};\nconst ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';\nconst EMPTY_CONTAINER_HEIGHT = '80px';\nconst DEFAULT_IMAGE_WIDTH = '500px';\nvar PostMessageMethods;\n(function (PostMessageMethods) {\n PostMessageMethods[\"REQUEST_ENTITIES\"] = \"REQUEST_ENTITIES\";\n PostMessageMethods[\"REQUESTED_ENTITIES\"] = \"REQUESTED_ENTITIES\";\n})(PostMessageMethods || (PostMessageMethods = {}));\nconst SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];\n\nconst structureComponents = new Set([\n CONTENTFUL_COMPONENTS.section.id,\n CONTENTFUL_COMPONENTS.columns.id,\n CONTENTFUL_COMPONENTS.container.id,\n CONTENTFUL_COMPONENTS.singleColumn.id,\n]);\nconst isContentfulStructureComponent = (componentId) => structureComponents.has(componentId ?? '');\nconst isEmptyStructureWithRelativeHeight = (children, componentId, height) => {\n return (children === 0 &&\n isContentfulStructureComponent(componentId) &&\n !height?.toString().endsWith('px'));\n};\n\nconst findOutermostCoordinates = (first, second) => {\n return {\n top: Math.min(first.top, second.top),\n right: Math.max(first.right, second.right),\n bottom: Math.max(first.bottom, second.bottom),\n left: Math.min(first.left, second.left),\n };\n};\nconst getElementCoordinates = (element) => {\n const rect = element.getBoundingClientRect();\n /**\n * If element does not have children, or element has it's own width or height,\n * return the element's coordinates.\n */\n if (element.children.length === 0 || rect.width !== 0 || rect.height !== 0) {\n return rect;\n }\n const rects = [];\n /**\n * If element has children, or element does not have it's own width and height,\n * we find the cordinates of the children, and assume the outermost coordinates of the children\n * as the coordinate of the element.\n *\n * E.g child1 => {top: 2, bottom: 3, left: 4, right: 6} & child2 => {top: 1, bottom: 8, left: 12, right: 24}\n * The final assumed coordinates of the element would be => { top: 1, right: 24, bottom: 8, left: 4 }\n */\n for (const child of element.children) {\n const childRect = getElementCoordinates(child);\n if (childRect.width !== 0 || childRect.height !== 0) {\n const { top, right, bottom, left } = childRect;\n rects.push({ top, right, bottom, left });\n }\n }\n if (rects.length === 0) {\n return rect;\n }\n const { top, right, bottom, left } = rects.reduce(findOutermostCoordinates);\n return DOMRect.fromRect({\n x: left,\n y: top,\n height: bottom - top,\n width: right - left,\n });\n};\n\nclass ParseError extends Error {\n constructor(message) {\n super(message);\n }\n}\nconst isValidJsonObject = (s) => {\n try {\n const result = JSON.parse(s);\n if ('object' !== typeof result) {\n return false;\n }\n return true;\n }\n catch (e) {\n return false;\n }\n};\nconst doesMismatchMessageSchema = (event) => {\n try {\n tryParseMessage(event);\n return false;\n }\n catch (e) {\n if (e instanceof ParseError) {\n return e.message;\n }\n throw e;\n }\n};\nconst tryParseMessage = (event) => {\n if (!event.data) {\n throw new ParseError('Field event.data is missing');\n }\n if ('string' !== typeof event.data) {\n throw new ParseError(`Field event.data must be a string, instead of '${typeof event.data}'`);\n }\n if (!isValidJsonObject(event.data)) {\n throw new ParseError('Field event.data must be a valid JSON object serialized as string');\n }\n const eventData = JSON.parse(event.data);\n if (!eventData.source) {\n throw new ParseError(`Field eventData.source must be equal to 'composability-app'`);\n }\n if ('composability-app' !== eventData.source) {\n throw new ParseError(`Field eventData.source must be equal to 'composability-app', instead of '${eventData.source}'`);\n }\n // check eventData.eventType\n const supportedEventTypes = Object.values(INCOMING_EVENTS);\n if (!supportedEventTypes.includes(eventData.eventType)) {\n // Expected message: This message is handled in the EntityStore to store fetched entities\n if (eventData.eventType !== PostMessageMethods.REQUESTED_ENTITIES) {\n throw new ParseError(`Field eventData.eventType must be one of the supported values: [${supportedEventTypes.join(', ')}]`);\n }\n }\n return eventData;\n};\nconst validateExperienceBuilderConfig = ({ locale, isEditorMode, }) => {\n if (isEditorMode) {\n return;\n }\n if (!locale) {\n throw new Error('Parameter \"locale\" is required for experience builder initialization outside of editor mode');\n }\n};\n\nconst transformFill = (value) => (value === 'fill' ? '100%' : value);\nconst transformGridColumn = (span) => {\n if (!span) {\n return {};\n }\n return {\n gridColumn: `span ${span}`,\n };\n};\nconst transformBorderStyle = (value) => {\n if (!value)\n return {};\n const parts = value.split(' ');\n // Just accept the passed value\n if (parts.length < 3)\n return { border: value };\n // Replace the second part always with `solid` and set the box sizing accordingly\n const [borderSize, borderStyle, ...borderColorParts] = parts;\n const borderColor = borderColorParts.join(' ');\n return {\n border: `${borderSize} ${borderStyle} ${borderColor}`,\n };\n};\nconst transformAlignment = (cfHorizontalAlignment, cfVerticalAlignment, cfFlexDirection = 'column') => cfFlexDirection === 'row'\n ? {\n alignItems: cfHorizontalAlignment,\n justifyContent: cfVerticalAlignment === 'center' ? `safe ${cfVerticalAlignment}` : cfVerticalAlignment,\n }\n : {\n alignItems: cfVerticalAlignment,\n justifyContent: cfHorizontalAlignment === 'center'\n ? `safe ${cfHorizontalAlignment}`\n : cfHorizontalAlignment,\n };\nconst transformBackgroundImage = (cfBackgroundImageUrl, cfBackgroundImageOptions) => {\n const matchBackgroundSize = (scaling) => {\n if ('fill' === scaling)\n return 'cover';\n if ('fit' === scaling)\n return 'contain';\n };\n const matchBackgroundPosition = (alignment) => {\n if (!alignment || 'string' !== typeof alignment) {\n return;\n }\n let [horizontalAlignment, verticalAlignment] = alignment.trim().split(/\\s+/, 2);\n // Special case for handling single values\n // for backwards compatibility with single values 'right','left', 'center', 'top','bottom'\n if (horizontalAlignment && !verticalAlignment) {\n const singleValue = horizontalAlignment;\n switch (singleValue) {\n case 'left':\n horizontalAlignment = 'left';\n verticalAlignment = 'center';\n break;\n case 'right':\n horizontalAlignment = 'right';\n verticalAlignment = 'center';\n break;\n case 'center':\n horizontalAlignment = 'center';\n verticalAlignment = 'center';\n break;\n case 'top':\n horizontalAlignment = 'center';\n verticalAlignment = 'top';\n break;\n case 'bottom':\n horizontalAlignment = 'center';\n verticalAlignment = 'bottom';\n break;\n // just fall down to the normal validation logic for horiz and vert\n }\n }\n const isHorizontalValid = ['left', 'right', 'center'].includes(horizontalAlignment);\n const isVerticalValid = ['top', 'bottom', 'center'].includes(verticalAlignment);\n horizontalAlignment = isHorizontalValid ? horizontalAlignment : 'left';\n verticalAlignment = isVerticalValid ? verticalAlignment : 'top';\n return `${horizontalAlignment} ${verticalAlignment}`;\n };\n if (!cfBackgroundImageUrl) {\n return;\n }\n let backgroundImage;\n let backgroundImageSet;\n if (typeof cfBackgroundImageUrl === 'string') {\n backgroundImage = `url(${cfBackgroundImageUrl})`;\n }\n else {\n const imgSet = cfBackgroundImageUrl.srcSet?.join(',');\n backgroundImage = `url(${cfBackgroundImageUrl.url})`;\n backgroundImageSet = `image-set(${imgSet})`;\n }\n return {\n backgroundImage,\n backgroundImage2: backgroundImageSet,\n backgroundRepeat: cfBackgroundImageOptions?.scaling === 'tile' ? 'repeat' : 'no-repeat',\n backgroundPosition: matchBackgroundPosition(cfBackgroundImageOptions?.alignment),\n backgroundSize: matchBackgroundSize(cfBackgroundImageOptions?.scaling),\n };\n};\nconst transformWidthSizing = ({ value, cfMargin, }) => {\n if (!value || !cfMargin)\n return;\n const transformedValue = transformFill(value);\n const marginValues = cfMargin.split(' ');\n const rightMargin = marginValues[1] || '0px';\n const leftMargin = marginValues[3] || '0px';\n const calcValue = `calc(${transformedValue} - ${leftMargin} - ${rightMargin})`;\n /**\n * We want to check if the calculated value is valid CSS. If this fails,\n * this means the `transformedValue` is not a calculable value (not a px, rem, or %).\n * The value may instead be a string such as `min-content` or `max-content`. In\n * that case we don't want to use calc and instead return the raw value.\n */\n if (typeof window !== 'undefined' && CSS.supports('width', calcValue)) {\n return calcValue;\n }\n return transformedValue;\n};\n\nconst toCSSAttribute = (key) => {\n let val = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n // Remove the number from the end of the key to allow for overrides on style properties\n val = val.replace(/\\d+$/, '');\n return val;\n};\nconst buildStyleTag = ({ styles, nodeId }) => {\n const stylesStr = Object.entries(styles)\n .filter(([, value]) => value !== undefined)\n .reduce((acc, [key, value]) => `${acc}\n ${toCSSAttribute(key)}: ${value};`, '');\n const className = `cfstyles-${nodeId ? nodeId : md5(stylesStr)}`;\n const styleRule = `.${className}{ ${stylesStr} }`;\n return [className, styleRule];\n};\nconst buildCfStyles = ({ cfHorizontalAlignment, cfVerticalAlignment, cfFlexDirection, cfFlexWrap, cfMargin, cfPadding, cfBackgroundColor, cfWidth, cfHeight, cfMaxWidth, cfBorder, cfBorderRadius, cfGap, cfBackgroundImageUrl, cfBackgroundImageOptions, cfFontSize, cfFontWeight, cfImageOptions, cfLineHeight, cfLetterSpacing, cfTextColor, cfTextAlign, cfTextTransform, cfTextBold, cfTextItalic, cfTextUnderline, cfColumnSpan, }) => {\n return {\n margin: cfMargin,\n padding: cfPadding,\n backgroundColor: cfBackgroundColor,\n width: transformWidthSizing({ value: cfWidth || cfImageOptions?.width, cfMargin }),\n height: transformFill(cfHeight || cfImageOptions?.height),\n maxWidth: cfMaxWidth,\n ...transformGridColumn(cfColumnSpan),\n ...transformBorderStyle(cfBorder),\n borderRadius: cfBorderRadius,\n gap: cfGap,\n ...transformAlignment(cfHorizontalAlignment, cfVerticalAlignment, cfFlexDirection),\n flexDirection: cfFlexDirection,\n flexWrap: cfFlexWrap,\n ...transformBackgroundImage(cfBackgroundImageUrl, cfBackgroundImageOptions),\n fontSize: cfFontSize,\n fontWeight: cfTextBold ? 'bold' : cfFontWeight,\n fontStyle: cfTextItalic ? 'italic' : 'normal',\n lineHeight: cfLineHeight,\n letterSpacing: cfLetterSpacing,\n color: cfTextColor,\n textAlign: cfTextAlign,\n textTransform: cfTextTransform,\n textDecoration: cfTextUnderline ? 'underline' : 'none',\n boxSizing: 'border-box',\n objectFit: cfImageOptions?.objectFit,\n objectPosition: cfImageOptions?.objectPosition,\n };\n};\n/**\n * Container/section default behavior:\n * Default height => height: EMPTY_CONTAINER_HEIGHT (120px)\n * If a container component has children => height: 'fit-content'\n */\nconst calculateNodeDefaultHeight = ({ blockId, children, value, }) => {\n if (!blockId || !isContentfulStructureComponent(blockId) || value !== 'auto') {\n return value;\n }\n if (children.length) {\n return '100%';\n }\n return EMPTY_CONTAINER_HEIGHT;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction get(obj, path) {\n if (!path.length) {\n return obj;\n }\n try {\n const [currentPath, ...nextPath] = path;\n return get(obj[currentPath], nextPath);\n }\n catch (err) {\n return undefined;\n }\n}\n\nconst getBoundValue = (entryOrAsset, path) => {\n const value = get(entryOrAsset, path.split('/').slice(2, -1));\n return value && typeof value == 'object' && value.url\n ? value.url\n : value;\n};\n\nconst transformRichText = (entryOrAsset, path) => {\n const value = getBoundValue(entryOrAsset, path);\n if (typeof value === 'string') {\n return {\n data: {},\n content: [\n {\n nodeType: BLOCKS.PARAGRAPH,\n data: {},\n content: [\n {\n data: {},\n nodeType: 'text',\n value: value,\n marks: [],\n },\n ],\n },\n ],\n nodeType: BLOCKS.DOCUMENT,\n };\n }\n if (typeof value === 'object' && value.nodeType === BLOCKS.DOCUMENT) {\n return value;\n }\n return undefined;\n};\n\nfunction getOptimizedImageUrl(url, width, quality, format) {\n if (url.startsWith('//')) {\n url = 'https:' + url;\n }\n const params = new URLSearchParams();\n if (width) {\n params.append('w', width.toString());\n }\n if (quality && quality > 0 && quality < 100) {\n params.append('q', quality.toString());\n }\n if (format) {\n params.append('fm', format);\n }\n const queryString = params.toString();\n return `${url}${queryString ? '?' + queryString : ''}`;\n}\n\nfunction validateParams(file, quality, format) {\n if (!file.details.image) {\n throw Error('No image in file asset to transform');\n }\n if (quality < 0 || quality > 100) {\n throw Error('Quality must be between 0 and 100');\n }\n if (format && !SUPPORTED_IMAGE_FORMATS.includes(format)) {\n throw Error(`Format must be one of ${SUPPORTED_IMAGE_FORMATS.join(', ')}`);\n }\n return true;\n}\n\nconst MAX_WIDTH_ALLOWED$1 = 2000;\nconst getOptimizedBackgroundImageAsset = (file, widthStyle, quality = '100%', format) => {\n const qualityNumber = Number(quality.replace('%', ''));\n if (!validateParams(file, qualityNumber, format)) ;\n if (!validateParams(file, qualityNumber, format)) ;\n const url = file.url;\n const { width1x, width2x } = getWidths(widthStyle, file);\n const imageUrl1x = getOptimizedImageUrl(url, width1x, qualityNumber, format);\n const imageUrl2x = getOptimizedImageUrl(url, width2x, qualityNumber, format);\n const srcSet = [`url(${imageUrl1x}) 1x`, `url(${imageUrl2x}) 2x`];\n const returnedUrl = getOptimizedImageUrl(url, width2x, qualityNumber, format);\n const optimizedBackgroundImageAsset = {\n url: returnedUrl,\n srcSet,\n file,\n };\n return optimizedBackgroundImageAsset;\n function getWidths(widthStyle, file) {\n let width1x = 0;\n let width2x = 0;\n const intrinsicImageWidth = file.details.image.width;\n if (widthStyle.endsWith('px')) {\n width1x = Math.min(Number(widthStyle.replace('px', '')), intrinsicImageWidth);\n }\n else {\n width1x = Math.min(MAX_WIDTH_ALLOWED$1, intrinsicImageWidth);\n }\n width2x = Math.min(width1x * 2, intrinsicImageWidth);\n return { width1x, width2x };\n }\n};\n\nconst MAX_WIDTH_ALLOWED = 4000;\nconst getOptimizedImageAsset = (file, sizes, quality = '100%', format) => {\n const qualityNumber = Number(quality.replace('%', ''));\n if (!validateParams(file, qualityNumber, format)) ;\n const url = file.url;\n const maxWidth = Math.min(file.details.image.width, MAX_WIDTH_ALLOWED);\n const numOfParts = Math.max(2, Math.ceil(maxWidth / 500));\n const widthParts = Array.from({ length: numOfParts }, (_, index) => Math.ceil((index + 1) * (maxWidth / numOfParts)));\n const srcSet = sizes\n ? widthParts.map((width) => `${getOptimizedImageUrl(url, width, qualityNumber, format)} ${width}w`)\n : [];\n const intrinsicImageWidth = file.details.image.width;\n if (intrinsicImageWidth > MAX_WIDTH_ALLOWED) {\n srcSet.push(`${getOptimizedImageUrl(url, undefined, qualityNumber, format)} ${intrinsicImageWidth}w`);\n }\n const returnedUrl = getOptimizedImageUrl(url, file.details.image.width > 2000 ? 2000 : undefined, qualityNumber, format);\n const optimizedImageAsset = {\n url: returnedUrl,\n srcSet,\n sizes,\n file,\n };\n return optimizedImageAsset;\n};\n\nconst transformMedia = (asset, variables, resolveDesignValue, variableName, path) => {\n let value;\n //TODO: this will be better served by injectable type transformers instead of if statement\n if (variableName === 'cfImageAsset') {\n const optionsVariableName = 'cfImageOptions';\n const options = resolveDesignValue(variables[optionsVariableName]?.type === 'DesignValue'\n ? variables[optionsVariableName].valuesByBreakpoint\n : {}, optionsVariableName);\n if (!options) {\n console.error(`Error transforming image asset: Required variable [${optionsVariableName}] missing from component definition`);\n return;\n }\n try {\n value = getOptimizedImageAsset(asset.fields.file, options.targetSize, options.quality, options.format);\n return value;\n }\n catch (error) {\n console.error('Error transforming image asset', error);\n }\n return;\n }\n if (variableName === 'cfBackgroundImageUrl') {\n const width = resolveDesignValue(variables['cfWidth']?.type === 'DesignValue' ? variables['cfWidth'].valuesByBreakpoint : {}, 'cfWidth');\n const optionsVariableName = 'cfBackgroundImageOptions';\n const options = resolveDesignValue(variables[optionsVariableName]?.type === 'DesignValue'\n ? variables[optionsVariableName].valuesByBreakpoint\n : {}, optionsVariableName);\n if (!options) {\n console.error(`Error transforming image asset: Required variable [${optionsVariableName}] missing from component definition`);\n return;\n }\n try {\n value = getOptimizedBackgroundImageAsset(asset.fields.file, width, options.quality, options.format);\n return value;\n }\n catch (error) {\n console.error('Error transforming image asset', error);\n }\n return;\n }\n // return getBoundValue(asset, entityStore, binding, path);\n return getBoundValue(asset, path);\n};\n\nconst transformBoundContentValue = (variables, entityStore, binding, resolveDesignValue, variableName, variableDefinition, path) => {\n const entityOrAsset = entityStore.getEntryOrAsset(binding, path);\n if (!entityOrAsset)\n return;\n switch (variableDefinition.type) {\n case 'Media':\n return transformMedia(entityOrAsset, variables, resolveDesignValue, variableName, path);\n case 'RichText':\n return transformRichText(entityOrAsset, path);\n default:\n return getBoundValue(entityOrAsset, path);\n }\n};\n\nconst getDataFromTree = (tree) => {\n let dataSource = {};\n let unboundValues = {};\n const queue = [...tree.root.children];\n while (queue.length) {\n const node = queue.shift();\n if (!node) {\n continue;\n }\n dataSource = { ...dataSource, ...node.data.dataSource };\n unboundValues = { ...unboundValues, ...node.data.unboundValues };\n if (node.children.length) {\n queue.push(...node.children);\n }\n }\n return {\n dataSource,\n unboundValues,\n };\n};\n/**\n * Gets calculates the index to drop the dragged component based on the mouse position\n * @returns {InsertionData} a object containing a node that will become a parent for dragged component and index at which it must be inserted\n */\nconst getInsertionData = ({ dropReceiverParentNode, dropReceiverNode, flexDirection, isMouseAtTopBorder, isMouseAtBottomBorder, isMouseInLeftHalf, isMouseInUpperHalf, isOverTopIndicator, isOverBottomIndicator, }) => {\n const APPEND_INSIDE = dropReceiverNode.children.length;\n const PREPEND_INSIDE = 0;\n if (isMouseAtTopBorder || isMouseAtBottomBorder) {\n const indexOfSectionInParentChildren = dropReceiverParentNode.children.findIndex((n) => n.data.id === dropReceiverNode.data.id);\n const APPEND_OUTSIDE = indexOfSectionInParentChildren + 1;\n const PREPEND_OUTSIDE = indexOfSectionInParentChildren;\n return {\n // when the mouse is around the border we want to drop the new component as a new section onto the root node\n node: dropReceiverParentNode,\n index: isMouseAtBottomBorder ? APPEND_OUTSIDE : PREPEND_OUTSIDE,\n };\n }\n // if over one of the section indicators\n if (isOverTopIndicator || isOverBottomIndicator) {\n const indexOfSectionInParentChildren = dropReceiverParentNode.children.findIndex((n) => n.data.id === dropReceiverNode.data.id);\n const APPEND_OUTSIDE = indexOfSectionInParentChildren + 1;\n const PREPEND_OUTSIDE = indexOfSectionInParentChildren;\n return {\n // when the mouse is around the border we want to drop the new component as a new section onto the root node\n node: dropReceiverParentNode,\n index: isOverBottomIndicator ? APPEND_OUTSIDE : PREPEND_OUTSIDE,\n };\n }\n if (flexDirection === undefined || flexDirection === 'row') {\n return {\n node: dropReceiverNode,\n index: isMouseInLeftHalf ? PREPEND_INSIDE : APPEND_INSIDE,\n };\n }\n else {\n return {\n node: dropReceiverNode,\n index: isMouseInUpperHalf ? PREPEND_INSIDE : APPEND_INSIDE,\n };\n }\n};\nconst generateRandomId = (letterCount) => {\n const LETTERS = 'abcdefghijklmnopqvwxyzABCDEFGHIJKLMNOPQVWXYZ';\n const NUMS = '0123456789';\n const ALNUM = NUMS + LETTERS;\n const times = (n, callback) => Array.from({ length: n }, callback);\n const random = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;\n return times(letterCount, () => ALNUM[random(0, ALNUM.length - 1)]).join('');\n};\nconst checkIsAssemblyNode = ({ componentId, usedComponents, }) => {\n if (!usedComponents?.length)\n return false;\n return usedComponents.some((usedComponent) => usedComponent.sys.id === componentId);\n};\n/** @deprecated use `checkIsAssemblyNode` instead. Will be removed with SDK v5. */\nconst checkIsAssembly = checkIsAssemblyNode;\n/**\n * This check assumes that the entry is already ensured to be an experience, i.e. the\n * content type of the entry is an experience type with the necessary annotations.\n **/\nconst checkIsAssemblyEntry = (entry) => {\n return Boolean(entry.fields?.componentSettings);\n};\nconst checkIsAssemblyDefinition = (component) => component?.category === ASSEMBLY_DEFAULT_CATEGORY;\n\nconst isExperienceEntry = (entry) => {\n return (entry?.sys?.type === 'Entry' &&\n !!entry.fields?.title &&\n !!entry.fields?.slug &&\n !!entry.fields?.componentTree &&\n Array.isArray(entry.fields.componentTree.breakpoints) &&\n Array.isArray(entry.fields.componentTree.children) &&\n typeof entry.fields.componentTree.schemaVersion === 'string');\n};\n\nconst supportedModes = ['delivery', 'preview', 'editor'];\n\nconst builtInStyles = {\n cfVerticalAlignment: {\n validations: {\n in: [\n {\n value: 'start',\n displayName: 'Align left',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'end',\n displayName: 'Align right',\n },\n ],\n },\n type: 'Text',\n group: 'style',\n description: 'The horizontal alignment of the section',\n defaultValue: 'center',\n displayName: 'Vertical alignment',\n },\n cfHorizontalAlignment: {\n validations: {\n in: [\n {\n value: 'start',\n displayName: 'Align top',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'end',\n displayName: 'Align bottom',\n },\n ],\n },\n type: 'Text',\n group: 'style',\n description: 'The horizontal alignment of the section',\n defaultValue: 'center',\n displayName: 'Horizontal alignment',\n },\n cfMargin: {\n displayName: 'Margin',\n type: 'Text',\n group: 'style',\n description: 'The margin of the section',\n defaultValue: '0 0 0 0',\n },\n cfPadding: {\n displayName: 'Padding',\n type: 'Text',\n group: 'style',\n description: 'The padding of the section',\n defaultValue: '0 0 0 0',\n },\n cfBackgroundColor: {\n displayName: 'Background color',\n type: 'Text',\n group: 'style',\n description: 'The background color of the section',\n defaultValue: 'rgba(255, 255, 255, 0)',\n },\n cfWidth: {\n displayName: 'Width',\n type: 'Text',\n group: 'style',\n description: 'The width of the section',\n defaultValue: 'fill',\n },\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the section',\n defaultValue: 'fit-content',\n },\n cfMaxWidth: {\n displayName: 'Max width',\n type: 'Text',\n group: 'style',\n description: 'The max-width of the section',\n defaultValue: 'none',\n },\n cfFlexDirection: {\n displayName: 'Direction',\n type: 'Text',\n group: 'style',\n description: 'The orientation of the section',\n defaultValue: 'column',\n },\n cfFlexWrap: {\n displayName: 'Wrap objects',\n type: 'Text',\n group: 'style',\n description: 'Wrap objects',\n defaultValue: 'nowrap',\n },\n cfBorder: {\n displayName: 'Border',\n type: 'Text',\n group: 'style',\n description: 'The border of the section',\n defaultValue: '0px solid rgba(0, 0, 0, 0)',\n },\n cfBorderRadius: {\n displayName: 'Border Radius',\n type: 'Text',\n group: 'style',\n description: 'The border radius of the section',\n defaultValue: '0px',\n },\n cfGap: {\n displayName: 'Gap',\n type: 'Text',\n group: 'style',\n description: 'The spacing between the elements of the section',\n defaultValue: '0px',\n },\n cfHyperlink: {\n displayName: 'Hyperlink',\n type: 'Text',\n defaultValue: '',\n validations: {\n format: 'URL',\n },\n description: 'hyperlink for section or container',\n },\n cfOpenInNewTab: {\n displayName: 'Hyperlink behaviour',\n type: 'Boolean',\n defaultValue: false,\n description: 'To open hyperlink in new Tab or not',\n },\n};\nconst optionalBuiltInStyles = {\n cfFontSize: {\n displayName: 'Font Size',\n type: 'Text',\n group: 'style',\n description: 'The font size of the element',\n defaultValue: '16px',\n },\n cfFontWeight: {\n validations: {\n in: [\n {\n value: '400',\n displayName: 'Normal',\n },\n {\n value: '500',\n displayName: 'Medium',\n },\n {\n value: '600',\n displayName: 'Semi Bold',\n },\n ],\n },\n displayName: 'Font Weight',\n type: 'Text',\n group: 'style',\n description: 'The font weight of the element',\n defaultValue: '400',\n },\n cfImageAsset: {\n displayName: 'Image',\n type: 'Media',\n description: 'Image to display',\n },\n cfImageOptions: {\n displayName: 'Image options',\n type: 'Object',\n group: 'style',\n defaultValue: {\n width: DEFAULT_IMAGE_WIDTH,\n height: '100%',\n targetSize: DEFAULT_IMAGE_WIDTH,\n },\n },\n cfBackgroundImageUrl: {\n displayName: 'Background image',\n type: 'Media',\n description: 'Background image for component',\n },\n cfBackgroundImageOptions: {\n displayName: 'Background image options',\n type: 'Object',\n group: 'style',\n defaultValue: {\n scaling: 'fill',\n alignment: 'left top',\n targetSize: '2000px',\n },\n },\n cfLineHeight: {\n displayName: 'Line Height',\n type: 'Text',\n group: 'style',\n description: 'The line height of the element',\n defaultValue: '20px',\n },\n cfLetterSpacing: {\n displayName: 'Letter Spacing',\n type: 'Text',\n group: 'style',\n description: 'The letter spacing of the element',\n defaultValue: '0px',\n },\n cfTextColor: {\n displayName: 'Text Color',\n type: 'Text',\n group: 'style',\n description: 'The text color of the element',\n defaultValue: 'rgba(0, 0, 0, 1)',\n },\n cfTextAlign: {\n validations: {\n in: [\n {\n value: 'left',\n displayName: 'Align left',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'right',\n displayName: 'Align right',\n },\n ],\n },\n displayName: 'Text Align',\n type: 'Text',\n group: 'style',\n description: 'The text alignment of the element',\n defaultValue: 'left',\n },\n cfTextTransform: {\n validations: {\n in: [\n {\n value: 'none',\n displayName: 'Normal',\n },\n {\n value: 'capitalize',\n displayName: 'Capitalize',\n },\n {\n value: 'uppercase',\n displayName: 'Uppercase',\n },\n {\n value: 'lowercase',\n displayName: 'Lowercase',\n },\n ],\n },\n displayName: 'Text Transform',\n type: 'Text',\n group: 'style',\n description: 'The text transform of the element',\n defaultValue: 'none',\n },\n cfTextBold: {\n displayName: 'Bold',\n type: 'Boolean',\n group: 'style',\n description: 'The text bold of the element',\n defaultValue: false,\n },\n cfTextItalic: {\n displayName: 'Italic',\n type: 'Boolean',\n group: 'style',\n description: 'The text italic of the element',\n defaultValue: false,\n },\n cfTextUnderline: {\n displayName: 'Underline',\n type: 'Boolean',\n group: 'style',\n description: 'The text underline of the element',\n defaultValue: false,\n },\n};\nconst sectionBuiltInStyles = {\n ...builtInStyles,\n cfBackgroundImageUrl: optionalBuiltInStyles.cfBackgroundImageUrl,\n cfBackgroundImageOptions: optionalBuiltInStyles.cfBackgroundImageOptions,\n};\nconst containerBuiltInStyles = {\n ...builtInStyles,\n cfBackgroundImageUrl: optionalBuiltInStyles.cfBackgroundImageUrl,\n cfBackgroundImageOptions: optionalBuiltInStyles.cfBackgroundImageOptions,\n cfMaxWidth: {\n displayName: 'Max Width',\n type: 'Text',\n group: 'style',\n description: 'The max-width of the section',\n defaultValue: '1192px',\n },\n};\nconst singleColumnBuiltInStyles = {\n cfBackgroundImageUrl: optionalBuiltInStyles.cfBackgroundImageUrl,\n cfBackgroundImageOptions: optionalBuiltInStyles.cfBackgroundImageOptions,\n cfVerticalAlignment: {\n validations: {\n in: [\n {\n value: 'start',\n displayName: 'Align left',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'end',\n displayName: 'Align right',\n },\n ],\n },\n type: 'Text',\n group: 'style',\n description: 'The horizontal alignment of the column',\n defaultValue: 'center',\n displayName: 'Vertical alignment',\n },\n cfHorizontalAlignment: {\n validations: {\n in: [\n {\n value: 'start',\n displayName: 'Align top',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'end',\n displayName: 'Align bottom',\n },\n ],\n },\n type: 'Text',\n group: 'style',\n description: 'The horizontal alignment of the column',\n defaultValue: 'center',\n displayName: 'Horizontal alignment',\n },\n cfPadding: {\n displayName: 'Padding',\n type: 'Text',\n group: 'style',\n description: 'The padding of the column',\n defaultValue: '0 0 0 0',\n },\n cfBackgroundColor: {\n displayName: 'Background color',\n type: 'Text',\n group: 'style',\n description: 'The background color of the column',\n defaultValue: 'rgba(255, 255, 255, 0)',\n },\n cfFlexDirection: {\n displayName: 'Direction',\n type: 'Text',\n group: 'style',\n description: 'The orientation of the column',\n defaultValue: 'column',\n },\n cfFlexWrap: {\n displayName: 'Wrap objects',\n type: 'Text',\n group: 'style',\n description: 'Wrap objects',\n defaultValue: 'nowrap',\n },\n cfBorder: {\n displayName: 'Border',\n type: 'Text',\n group: 'style',\n description: 'The border of the column',\n defaultValue: '0px solid rgba(0, 0, 0, 0)',\n },\n cfBorderRadius: {\n displayName: 'Border Radius',\n type: 'Text',\n group: 'style',\n description: 'The border radius of the column',\n defaultValue: '0px',\n },\n cfGap: {\n displayName: 'Gap',\n type: 'Text',\n group: 'style',\n description: 'The spacing between the elements of the column',\n defaultValue: '0px',\n },\n cfColumnSpan: {\n type: 'Text',\n defaultValue: '6',\n group: 'style',\n },\n cfColumnSpanLock: {\n type: 'Boolean',\n defaultValue: false,\n group: 'style',\n },\n};\nconst columnsBuiltInStyles = {\n cfBackgroundImageUrl: optionalBuiltInStyles.cfBackgroundImageUrl,\n cfBackgroundImageOptions: optionalBuiltInStyles.cfBackgroundImageOptions,\n cfMargin: {\n displayName: 'Margin',\n type: 'Text',\n group: 'style',\n description: 'The margin of the columns',\n defaultValue: '0 0 0 0',\n },\n cfWidth: {\n displayName: 'Width',\n type: 'Text',\n group: 'style',\n description: 'The width of the columns',\n defaultValue: 'fill',\n },\n cfMaxWidth: {\n displayName: 'Max width',\n type: 'Text',\n group: 'style',\n description: 'The max-width of the columns',\n defaultValue: '1192px',\n },\n cfPadding: {\n displayName: 'Padding',\n type: 'Text',\n group: 'style',\n description: 'The padding of the columns',\n defaultValue: '10px 10px 10px 10px',\n },\n cfBackgroundColor: {\n displayName: 'Background color',\n type: 'Text',\n group: 'style',\n description: 'The background color of the columns',\n defaultValue: 'rgba(255, 255, 255, 0)',\n },\n cfBorder: {\n displayName: 'Border',\n type: 'Text',\n group: 'style',\n description: 'The border of the columns',\n defaultValue: '0px solid rgba(0, 0, 0, 0)',\n },\n cfBorderRadius: {\n displayName: 'Border Radius',\n type: 'Text',\n group: 'style',\n description: 'The border radius of the columns',\n defaultValue: '0px',\n },\n cfGap: {\n displayName: 'Gap',\n type: 'Text',\n group: 'style',\n description: 'The spacing between the elements of the columns',\n defaultValue: '10px 10px',\n },\n cfColumns: {\n type: 'Text',\n defaultValue: '[6,6]',\n group: 'style',\n },\n cfWrapColumns: {\n type: 'Boolean',\n defaultValue: false,\n group: 'style',\n },\n cfWrapColumnsCount: {\n type: 'Text',\n defaultValue: '2',\n group: 'style',\n },\n};\n\nconst designTokensRegistry = {};\n/**\n * Register design tokens styling\n * @param designTokenDefinition - {[key:string]: Record<string, string>}\n * @returns void\n */\nconst defineDesignTokens = (designTokenDefinition) => {\n Object.assign(designTokensRegistry, designTokenDefinition);\n};\nconst templateStringRegex = /\\${(.+?)}/g;\nconst getDesignTokenRegistration = (breakpointValue, variableName) => {\n if (!breakpointValue)\n return breakpointValue;\n let resolvedValue = '';\n for (const part of breakpointValue.split(' ')) {\n const tokenValue = templateStringRegex.test(part)\n ? resolveSimpleDesignToken(part, variableName)\n : part;\n resolvedValue += `${tokenValue} `;\n }\n // Not trimming would end up with a trailing space that breaks the check in `calculateNodeDefaultHeight`\n return resolvedValue.trim();\n};\nconst resolveSimpleDesignToken = (templateString, variableName) => {\n const nonTemplateValue = templateString.replace(templateStringRegex, '$1');\n const [tokenCategory, tokenName] = nonTemplateValue.split('.');\n const tokenValues = designTokensRegistry[tokenCategory];\n if (tokenValues && tokenValues[tokenName]) {\n if (variableName === 'cfBorder') {\n const { width, style, color } = tokenValues[tokenName];\n return `${width} ${style} ${color}`;\n }\n return tokenValues[tokenName];\n }\n if (builtInStyles[variableName]) {\n return builtInStyles[variableName].defaultValue;\n }\n if (optionalBuiltInStyles[variableName]) {\n return optionalBuiltInStyles[variableName].defaultValue;\n }\n return '0px';\n};\n\nconst MEDIA_QUERY_REGEXP = /(<|>)(\\d{1,})(px|cm|mm|in|pt|pc)$/;\nconst toCSSMediaQuery = ({ query }) => {\n if (query === '*')\n return undefined;\n const match = query.match(MEDIA_QUERY_REGEXP);\n if (!match)\n return undefined;\n const [, operator, value, unit] = match;\n if (operator === '<') {\n const maxScreenWidth = Number(value) - 1;\n return `(max-width: ${maxScreenWidth}${unit})`;\n }\n else if (operator === '>') {\n const minScreenWidth = Number(value) + 1;\n return `(min-width: ${minScreenWidth}${unit})`;\n }\n return undefined;\n};\n// Remove this helper when upgrading to TypeScript 5.0 - https://github.com/microsoft/TypeScript/issues/48829\nconst findLast = (array, predicate) => {\n return array.reverse().find(predicate);\n};\n// Initialise media query matchers. This won't include the always matching fallback breakpoint.\nconst mediaQueryMatcher = (breakpoints) => {\n const mediaQueryMatches = {};\n const mediaQueryMatchers = breakpoints\n .map((breakpoint) => {\n const cssMediaQuery = toCSSMediaQuery(breakpoint);\n if (!cssMediaQuery)\n return undefined;\n if (typeof window === 'undefined')\n return undefined;\n const mediaQueryMatcher = window.matchMedia(cssMediaQuery);\n mediaQueryMatches[breakpoint.id] = mediaQueryMatcher.matches;\n return { id: breakpoint.id, signal: mediaQueryMatcher };\n })\n .filter((matcher) => !!matcher);\n return [mediaQueryMatchers, mediaQueryMatches];\n};\nconst getActiveBreakpointIndex = (breakpoints, mediaQueryMatches, fallbackBreakpointIndex) => {\n // The breakpoints are ordered (desktop-first: descending by screen width)\n const breakpointsWithMatches = breakpoints.map(({ id }, index) => ({\n id,\n index,\n // The fallback breakpoint with wildcard query will always match\n isMatch: mediaQueryMatches[id] ?? index === fallbackBreakpointIndex,\n }));\n // Find the last breakpoint in the list that matches (desktop-first: the narrowest one)\n const mostSpecificIndex = findLast(breakpointsWithMatches, ({ isMatch }) => isMatch)?.index;\n return mostSpecificIndex ?? fallbackBreakpointIndex;\n};\nconst getFallbackBreakpointIndex = (breakpoints) => {\n // We assume that there will be a single breakpoint which uses the wildcard query.\n // If there is none, we just take the first one in the list.\n return Math.max(breakpoints.findIndex(({ query }) => query === '*'), 0);\n};\nconst builtInStylesWithDesignTokens = [\n 'cfMargin',\n 'cfPadding',\n 'cfGap',\n 'cfWidth',\n 'cfHeight',\n 'cfBackgroundColor',\n 'cfBorder',\n 'cfBorderRadius',\n 'cfFontSize',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n];\nconst getValueForBreakpoint = (valuesByBreakpoint, breakpoints, activeBreakpointIndex, variableName) => {\n const eventuallyResolveDesignTokens = (value) => {\n // For some built-in design propertier, we support design tokens\n if (builtInStylesWithDesignTokens.includes(variableName)) {\n return getDesignTokenRegistration(value, variableName);\n }\n // For all other properties, we just return the breakpoint-specific value\n return value;\n };\n if (valuesByBreakpoint instanceof Object) {\n // Assume that the values are sorted by media query to apply the cascading CSS logic\n for (let index = activeBreakpointIndex; index >= 0; index--) {\n const breakpointId = breakpoints[index].id;\n if (valuesByBreakpoint[breakpointId]) {\n // If the value is defined, we use it and stop the breakpoints cascade\n return eventuallyResolveDesignTokens(valuesByBreakpoint[breakpointId]);\n }\n }\n // If no breakpoint matched, we search and apply the fallback breakpoint\n const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);\n const fallbackBreakpointId = breakpoints[fallbackBreakpointIndex].id;\n return eventuallyResolveDesignTokens(valuesByBreakpoint[fallbackBreakpointId]);\n }\n else {\n // Old design properties did not support breakpoints, keep for backward compatibility\n return valuesByBreakpoint;\n }\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isLinkToAsset = (variable) => {\n if (!variable)\n return false;\n if (typeof variable !== 'object')\n return false;\n return (variable.sys?.linkType === 'Asset' &&\n typeof variable.sys?.id === 'string' &&\n !!variable.sys?.id &&\n variable.sys?.type === 'Link');\n};\n\nconst isLink = (maybeLink) => {\n if (maybeLink === null)\n return false;\n if (typeof maybeLink !== 'object')\n return false;\n const link = maybeLink;\n return Boolean(link.sys?.id) && link.sys?.type === 'Link';\n};\n\n/**\n * This module encapsulates format of the path to a deep reference.\n */\nconst parseDataSourcePathIntoFieldset = (path) => {\n const parsedPath = parseDeepPath(path);\n if (null === parsedPath) {\n throw new Error(`Cannot parse path '${path}' as deep path`);\n }\n return parsedPath.fields.map((field) => [null, field, '~locale']);\n};\n/**\n * Parse path into components, supports L1 references (one reference follow) atm.\n * @param path from data source. eg. `/uuid123/fields/image/~locale/fields/file/~locale`\n * eg. `/uuid123/fields/file/~locale/fields/title/~locale`\n * @returns\n */\nconst parseDataSourcePathWithL1DeepBindings = (path) => {\n const parsedPath = parseDeepPath(path);\n if (null === parsedPath) {\n throw new Error(`Cannot parse path '${path}' as deep path`);\n }\n return {\n key: parsedPath.key,\n field: parsedPath.fields[0],\n referentField: parsedPath.fields[1],\n };\n};\n/**\n * Detects if paths is valid deep-path, like:\n * - /gV6yKXp61hfYrR7rEyKxY/fields/mainStory/~locale/fields/cover/~locale/fields/title/~locale\n * or regular, like:\n * - /6J8eA60yXwdm5eyUh9fX6/fields/mainStory/~locale\n * @returns\n */\nconst isDeepPath = (deepPathCandidate) => {\n const deepPathParsed = parseDeepPath(deepPathCandidate);\n if (!deepPathParsed) {\n return false;\n }\n return deepPathParsed.fields.length > 1;\n};\nconst parseDeepPath = (deepPathCandidate) => {\n // ALGORITHM:\n // We start with deep path in form:\n // /uuid123/fields/mainStory/~locale/fields/cover/~locale/fields/title/~locale\n // First turn string into array of segments\n // ['', 'uuid123', 'fields', 'mainStory', '~locale', 'fields', 'cover', '~locale', 'fields', 'title', '~locale']\n // Then group segments into intermediate represenatation - chunks, where each non-initial chunk starts with 'fields'\n // [\n // [ \"\", \"uuid123\" ],\n // [ \"fields\", \"mainStory\", \"~locale\" ],\n // [ \"fields\", \"cover\", \"~locale\" ],\n // [ \"fields\", \"title\", \"~locale\" ]\n // ]\n // Then check \"initial\" chunk for corretness\n // Then check all \"field-leading\" chunks for correctness\n const isValidInitialChunk = (initialChunk) => {\n // must have start with '' and have at least 2 segments, second non-empty\n // eg. /-_432uuid123123\n return /^\\/([^/^~]+)$/.test(initialChunk.join('/'));\n };\n const isValidFieldChunk = (fieldChunk) => {\n // must start with 'fields' and have at least 3 segments, second non-empty and last segment must be '~locale'\n // eg. fields/-32234mainStory/~locale\n return /^fields\\/[^/^~]+\\/~locale$/.test(fieldChunk.join('/'));\n };\n const deepPathSegments = deepPathCandidate.split('/');\n const chunks = chunkSegments(deepPathSegments, { startNextChunkOnElementEqualTo: 'fields' });\n if (chunks.length <= 1) {\n return null; // malformed path, even regular paths have at least 2 chunks\n }\n else if (chunks.length === 2) {\n return null; // deep paths have at least 3 chunks\n }\n // With 3+ chunks we can now check for deep path correctness\n const [initialChunk, ...fieldChunks] = chunks;\n if (!isValidInitialChunk(initialChunk)) {\n return null;\n }\n if (!fieldChunks.every(isValidFieldChunk)) {\n return null;\n }\n return {\n key: initialChunk[1], // pick uuid from initial chunk ['','uuid123'],\n fields: fieldChunks.map((fieldChunk) => fieldChunk[1]), // pick only fieldName eg. from ['fields','mainStory', '~locale'] we pick `mainStory`\n };\n};\nconst chunkSegments = (segments, { startNextChunkOnElementEqualTo }) => {\n const chunks = [];\n let currentChunk = [];\n const isSegmentBeginningOfChunk = (segment) => segment === startNextChunkOnElementEqualTo;\n const excludeEmptyChunks = (chunk) => chunk.length > 0;\n for (let i = 0; i < segments.length; i++) {\n const isInitialElement = i === 0;\n const segment = segments[i];\n if (isInitialElement) {\n currentChunk = [segment];\n }\n else if (isSegmentBeginningOfChunk(segment)) {\n chunks.push(currentChunk);\n currentChunk = [segment];\n }\n else {\n currentChunk.push(segment);\n }\n }\n chunks.push(currentChunk);\n return chunks.filter(excludeEmptyChunks);\n};\n\nconst sectionDefinition = {\n id: CONTENTFUL_COMPONENTS.section.id,\n name: CONTENTFUL_COMPONENTS.section.name,\n category: CONTENTFUL_COMPONENT_CATEGORY,\n children: true,\n variables: sectionBuiltInStyles,\n tooltip: {\n description: 'Create a new full width section of your experience by dragging this component onto the canvas. Other components and patterns can be added into a section.',\n },\n};\nconst containerDefinition = {\n id: CONTENTFUL_COMPONENTS.container.id,\n name: CONTENTFUL_COMPONENTS.container.name,\n category: CONTENTFUL_COMPONENT_CATEGORY,\n children: true,\n variables: containerBuiltInStyles,\n tooltip: {\n description: 'Create a new area or pattern within your page layout by dragging a container onto the canvas. Other components and patterns can be added into a container.',\n },\n};\nconst columnsDefinition = {\n id: CONTENTFUL_COMPONENTS.columns.id,\n name: CONTENTFUL_COMPONENTS.columns.name,\n category: CONTENTFUL_COMPONENT_CATEGORY,\n children: true,\n variables: columnsBuiltInStyles,\n tooltip: {\n description: 'Add columns to a container to create your desired layout and ensure that the experience is responsive across different screen sizes.',\n },\n};\nconst singleColumnDefinition = {\n id: CONTENTFUL_COMPONENTS.singleColumn.id,\n name: CONTENTFUL_COMPONENTS.singleColumn.name,\n category: CONTENTFUL_COMPONENT_CATEGORY,\n children: true,\n variables: singleColumnBuiltInStyles,\n};\n\nconst sendMessage = (eventType, data) => {\n if (typeof window === 'undefined') {\n return;\n }\n console.debug(`[experiences-sdk-react::sendMessage] Sending message [${eventType}]`, {\n source: 'customer-app',\n eventType,\n payload: data,\n });\n window.parent?.postMessage({\n source: 'customer-app',\n eventType,\n payload: data,\n }, '*');\n};\n\n/**\n * Base Store for entities\n * Can be extended for the different loading behaviours (editor, production, ..)\n */\nclass EntityStoreBase {\n constructor({ entities, locale }) {\n this.entryMap = new Map();\n this.assetMap = new Map();\n this.locale = locale;\n for (const entity of entities) {\n this.addEntity(entity);\n }\n }\n get entities() {\n return [...this.entryMap.values(), ...this.assetMap.values()];\n }\n updateEntity(entity) {\n this.addEntity(entity);\n }\n getEntryOrAsset(linkOrEntryOrAsset, path) {\n if (isDeepPath(path)) {\n return this.getDeepEntry(linkOrEntryOrAsset, path);\n }\n let entity;\n if (isLink(linkOrEntryOrAsset)) {\n const resolvedEntity = linkOrEntryOrAsset.sys.linkType === 'Entry'\n ? this.entryMap.get(linkOrEntryOrAsset.sys.id)\n : this.assetMap.get(linkOrEntryOrAsset.sys.id);\n if (!resolvedEntity || resolvedEntity.sys.type !== linkOrEntryOrAsset.sys.linkType) {\n console.warn(`Experience references unresolved entity: ${JSON.stringify(linkOrEntryOrAsset)}`);\n return;\n }\n entity = resolvedEntity;\n }\n else {\n // We already have the complete entity in preview & delivery (resolved by the CMA client)\n entity = linkOrEntryOrAsset;\n }\n return entity;\n }\n /**\n * @deprecated in the base class this should be simply an abstract method\n * @param entityLink\n * @param path\n * @returns\n */\n getValue(entityLink, path) {\n const entity = this.getEntity(entityLink.sys.linkType, entityLink.sys.id);\n if (!entity) {\n // TODO: move to `debug` utils once it is extracted\n console.warn(`Unresolved entity reference: ${entityLink.sys.linkType} with ID ${entityLink.sys.id}`);\n return;\n }\n return get(entity, path);\n }\n getEntityFromLink(link) {\n const resolvedEntity = link.sys.linkType === 'Entry'\n ? this.entryMap.get(link.sys.id)\n : this.assetMap.get(link.sys.id);\n if (!resolvedEntity || resolvedEntity.sys.type !== link.sys.linkType) {\n console.warn(`Experience references unresolved entity: ${JSON.stringify(link)}`);\n return;\n }\n return resolvedEntity;\n }\n getEntitiesFromMap(type, ids) {\n const resolved = [];\n const missing = [];\n for (const id of ids) {\n const entity = this.getEntity(type, id);\n if (entity) {\n resolved.push(entity);\n }\n else {\n missing.push(id);\n }\n }\n return {\n resolved,\n missing,\n };\n }\n addEntity(entity) {\n if (this.isAsset(entity)) {\n this.assetMap.set(entity.sys.id, entity);\n }\n else {\n this.entryMap.set(entity.sys.id, entity);\n }\n }\n async fetchAsset(id) {\n const { resolved, missing } = this.getEntitiesFromMap('Asset', [id]);\n if (missing.length) {\n // TODO: move to `debug` utils once it is extracted\n console.warn(`Asset \"${id}\" is not in the store`);\n return;\n }\n return resolved[0];\n }\n async fetchAssets(ids) {\n const { resolved, missing } = this.getEntitiesFromMap('Asset', ids);\n if (missing.length) {\n throw new Error(`Missing assets in the store (${missing.join(',')})`);\n }\n return resolved;\n }\n async fetchEntry(id) {\n const { resolved, missing } = this.getEntitiesFromMap('Entry', [id]);\n if (missing.length) {\n // TODO: move to `debug` utils once it is extracted\n console.warn(`Entry \"${id}\" is not in the store`);\n return;\n }\n return resolved[0];\n }\n async fetchEntries(ids) {\n const { resolved, missing } = this.getEntitiesFromMap('Entry', ids);\n if (missing.length) {\n throw new Error(`Missing assets in the store (${missing.join(',')})`);\n }\n return resolved;\n }\n getDeepEntry(linkOrEntryOrAsset, path) {\n const resolveFieldset = (unresolvedFieldset, headEntry) => {\n const resolvedFieldset = [];\n let entityToResolveFieldsFrom = headEntry;\n for (let i = 0; i < unresolvedFieldset.length; i++) {\n const isLeaf = i === unresolvedFieldset.length - 1; // with last row, we are not expecting a link, but a value\n const row = unresolvedFieldset[i];\n const [, field, _localeQualifier] = row;\n if (!entityToResolveFieldsFrom) {\n throw new Error(`Logic Error: Cannot resolve field ${field} of a fieldset as there is no entity to resolve it from.`);\n }\n if (isLeaf) {\n resolvedFieldset.push([entityToResolveFieldsFrom, field, _localeQualifier]);\n break;\n }\n const fieldValue = get(entityToResolveFieldsFrom, ['fields', field]);\n if (undefined === fieldValue) {\n return {\n resolvedFieldset,\n isFullyResolved: false,\n reason: `Cannot resolve field Link<${entityToResolveFieldsFrom.sys.type}>(sys.id=${entityToResolveFieldsFrom.sys.id}).fields[${field}] as field value is not defined`,\n };\n }\n else if (isLink(fieldValue)) {\n const entity = this.getEntityFromLink(fieldValue);\n if (entity === undefined) {\n return {\n resolvedFieldset,\n isFullyResolved: false,\n reason: `Field reference Link (sys.id=${fieldValue.sys.id}) not found in the EntityStore, waiting...`,\n };\n }\n resolvedFieldset.push([entityToResolveFieldsFrom, field, _localeQualifier]);\n entityToResolveFieldsFrom = entity; // we move up\n }\n else {\n // TODO: Eg. when someone changed the schema and the field is not a link anymore, what should we return then?\n throw new Error(`LogicError: Invalid value of a field we consider a reference field. Cannot resolve field ${field} of a fieldset as it is not a link, neither undefined.`);\n }\n }\n return {\n resolvedFieldset,\n isFullyResolved: true,\n };\n };\n const headEntity = isLink(linkOrEntryOrAsset)\n ? this.getEntityFromLink(linkOrEntryOrAsset)\n : linkOrEntryOrAsset;\n if (undefined === headEntity) {\n return;\n }\n const unresolvedFieldset = parseDataSourcePathIntoFieldset(path);\n // The purpose here is to take this intermediate representation of the deep-path\n // and to follow the links to the leaf-entity and field\n // in case we can't follow till the end, we should signal that there was null-reference in the path\n const { resolvedFieldset, isFullyResolved, reason } = resolveFieldset(unresolvedFieldset, headEntity);\n if (!isFullyResolved) {\n reason &&\n console.debug(`[exp-builder.sdk::EntityStoreBased::getValueDeep()] Deep path wasn't resolved till leaf node, falling back to undefined, because: ${reason}`);\n return;\n }\n const [leafEntity] = resolvedFieldset[resolvedFieldset.length - 1];\n return leafEntity;\n }\n isAsset(entity) {\n return entity.sys.type === 'Asset';\n }\n getEntity(type, id) {\n if (type === 'Asset') {\n return this.assetMap.get(id);\n }\n return this.entryMap.get(id);\n }\n toJSON() {\n return {\n entryMap: Object.fromEntries(this.entryMap),\n assetMap: Object.fromEntries(this.assetMap),\n locale: this.locale,\n };\n }\n}\n\n/**\n * EntityStore which resolves entries and assets from the editor\n * over the sendMessage and subscribe functions.\n */\nclass EditorEntityStore extends EntityStoreBase {\n constructor({ entities, locale, sendMessage, subscribe, timeoutDuration = 3000, }) {\n super({ entities, locale });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.requestCache = new Map();\n this.cacheIdSeperator = ',';\n this.sendMessage = sendMessage;\n this.subscribe = subscribe;\n this.timeoutDuration = timeoutDuration;\n }\n cleanupPromise(referenceId) {\n setTimeout(() => {\n this.requestCache.delete(referenceId);\n }, 300);\n }\n getCacheId(id) {\n return id.length === 1 ? id[0] : id.join(this.cacheIdSeperator);\n }\n async fetchEntity(type, ids, skipCache = false) {\n let missing;\n if (!skipCache) {\n const { missing: missingFromCache, resolved } = this.getEntitiesFromMap(type, ids);\n if (missingFromCache.length === 0) {\n // everything is already in cache\n return resolved;\n }\n missing = missingFromCache;\n }\n else {\n missing = [...ids];\n }\n const cacheId = this.getCacheId(missing);\n const openRequest = this.requestCache.get(cacheId);\n if (openRequest) {\n return openRequest;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const newPromise = new Promise((resolve, reject) => {\n const unsubscribe = this.subscribe(PostMessageMethods.REQUESTED_ENTITIES, (message) => {\n const messageIds = [\n ...message.entities.map((entity) => entity.sys.id),\n ...(message.missingEntityIds ?? []),\n ];\n if (missing.every((id) => messageIds.find((entityId) => entityId === id))) {\n clearTimeout(timeout);\n resolve(message.entities);\n this.cleanupPromise(cacheId);\n ids.forEach((id) => this.cleanupPromise(id));\n unsubscribe();\n }\n else {\n console.warn('Unexpected entities received in REQUESTED_ENTITIES. Ignoring this response.');\n }\n });\n const timeout = setTimeout(() => {\n reject(new Error(`Request for entities timed out ${this.timeoutDuration}ms} for ${cacheId}`));\n this.cleanupPromise(cacheId);\n ids.forEach((id) => this.cleanupPromise(id));\n unsubscribe();\n }, this.timeoutDuration);\n this.sendMessage(PostMessageMethods.REQUEST_ENTITIES, {\n entityIds: missing,\n entityType: type,\n locale: this.locale,\n });\n });\n this.requestCache.set(cacheId, newPromise);\n ids.forEach((cid) => {\n this.requestCache.set(cid, newPromise);\n });\n const result = (await newPromise);\n result.forEach((value) => {\n this.addEntity(value);\n });\n return this.getEntitiesFromMap(type, ids).resolved;\n }\n async fetchAsset(id, skipCache = false) {\n try {\n return (await this.fetchAssets([id], skipCache))[0];\n }\n catch (err) {\n // TODO: move to debug utils once it is extracted\n console.warn(`Failed to request asset ${id}`);\n return undefined;\n }\n }\n fetchAssets(ids, skipCache = false) {\n return this.fetchEntity('Asset', ids, skipCache);\n }\n async fetchEntry(id, skipCache = false) {\n try {\n return (await this.fetchEntries([id], skipCache))[0];\n }\n catch (err) {\n // TODO: move to debug utils once it is extracted\n console.warn(`Failed to request entry ${id}`, err);\n return undefined;\n }\n }\n fetchEntries(ids, skipCache = false) {\n return this.fetchEntity('Entry', ids, skipCache);\n }\n}\n\nfunction transformAssetFileToUrl(fieldValue) {\n return fieldValue && typeof fieldValue == 'object' && fieldValue.url\n ? fieldValue.url\n : fieldValue;\n}\n\n// The default of 3s in the EditorEntityStore is sometimes timing out and\n// leads to not rendering bound content and assemblies.\nconst REQUEST_TIMEOUT = 10000;\nclass EditorModeEntityStore extends EditorEntityStore {\n constructor({ entities, locale }) {\n console.debug(`[experiences-sdk-react] Initializing editor entity store with ${entities.length} entities for locale ${locale}.`, { entities });\n const subscribe = (method, cb) => {\n const handleMessage = (event) => {\n const data = JSON.parse(event.data);\n if (typeof data !== 'object' || !data)\n return;\n if (data.source !== 'composability-app')\n return;\n if (data.eventType === method) {\n cb(data.payload);\n }\n };\n if (typeof window !== 'undefined') {\n window.addEventListener('message', handleMessage);\n }\n return () => {\n if (typeof window !== 'undefined') {\n window.removeEventListener('message', handleMessage);\n }\n };\n };\n super({ entities, sendMessage, subscribe, locale, timeoutDuration: REQUEST_TIMEOUT });\n this.locale = locale;\n }\n /**\n * This function collects and returns the list of requested entries and assets. Additionally, it checks\n * upfront whether any async fetching logic is actually happening. If not, it returns a plain `false` value, so we\n * can detect this early and avoid unnecessary re-renders.\n * @param entityLinks\n * @returns false if no async fetching is happening, otherwise a promise that resolves when all entities are fetched\n */\n async fetchEntities({ missingEntryIds, missingAssetIds, skipCache = false, }) {\n // Entries and assets will be stored in entryMap and assetMap\n await Promise.all([\n this.fetchEntries(missingEntryIds, skipCache),\n this.fetchAssets(missingAssetIds, skipCache),\n ]);\n }\n getMissingEntityIds(entityLinks) {\n const entryLinks = entityLinks.filter((link) => link.sys?.linkType === 'Entry');\n const assetLinks = entityLinks.filter((link) => link.sys?.linkType === 'Asset');\n const uniqueEntryIds = [...new Set(entryLinks.map((link) => link.sys.id))];\n const uniqueAssetIds = [...new Set(assetLinks.map((link) => link.sys.id))];\n const { missing: missingEntryIds } = this.getEntitiesFromMap('Entry', uniqueEntryIds);\n const { missing: missingAssetIds } = this.getEntitiesFromMap('Asset', uniqueAssetIds);\n return { missingEntryIds, missingAssetIds };\n }\n getValue(entityLinkOrEntity, path) {\n const entity = this.getEntryOrAsset(entityLinkOrEntity, path.join('/'));\n if (!entity) {\n return;\n }\n const fieldValue = get(entity, path);\n // walk around to render asset files\n return fieldValue && typeof fieldValue == 'object' && fieldValue.url\n ? fieldValue.url\n : fieldValue;\n }\n}\n\nclass EntityStore extends EntityStoreBase {\n constructor(options) {\n if (typeof options === 'string') {\n const data = JSON.parse(options);\n const { _experienceEntry, _unboundValues, locale, entryMap, assetMap } = data.entityStore;\n super({\n entities: [\n ...Object.values(entryMap),\n ...Object.values(assetMap),\n ],\n locale,\n });\n this._experienceEntry = _experienceEntry;\n this._unboundValues = _unboundValues;\n }\n else {\n const { experienceEntry, entities, locale } = options;\n super({ entities, locale });\n if (isExperienceEntry(experienceEntry)) {\n this._experienceEntry = experienceEntry.fields;\n this._unboundValues = experienceEntry.fields.unboundValues;\n }\n else {\n throw new Error('Provided entry is not experience entry');\n }\n }\n }\n getCurrentLocale() {\n return this.locale;\n }\n get experienceEntryFields() {\n return this._experienceEntry;\n }\n get schemaVersion() {\n return this._experienceEntry?.componentTree.schemaVersion;\n }\n get breakpoints() {\n return this._experienceEntry?.componentTree.breakpoints ?? [];\n }\n get dataSource() {\n return this._experienceEntry?.dataSource ?? {};\n }\n get unboundValues() {\n return this._unboundValues ?? {};\n }\n get usedComponents() {\n return this._experienceEntry?.usedComponents ?? [];\n }\n /**\n * Extend the existing set of unbound values with the ones from the assembly definition.\n * When creating a new assembly out of a container, the unbound value keys are copied and\n * thus the existing and the added ones have colliding keys. In the case of overlapping value\n * keys, the ones from the experience overrule the ones from the assembly definition as\n * the latter one is certainly just a default value while the other one is from the actual instance.\n * @param unboundValues set of unbound values defined in the assembly definition\n */\n addAssemblyUnboundValues(unboundValues) {\n this._unboundValues = { ...unboundValues, ...(this._unboundValues ?? {}) };\n }\n getValue(entityLinkOrEntity, path) {\n const entity = isLink(entityLinkOrEntity)\n ? this.getEntityFromLink(entityLinkOrEntity)\n : entityLinkOrEntity;\n if (entity === undefined) {\n return;\n }\n const fieldValue = get(entity, path);\n return transformAssetFileToUrl(fieldValue);\n }\n toJSON() {\n return {\n _experienceEntry: this._experienceEntry,\n _unboundValues: this._unboundValues,\n ...super.toJSON(),\n };\n }\n}\n\nvar VisualEditorMode;\n(function (VisualEditorMode) {\n VisualEditorMode[\"LazyLoad\"] = \"lazyLoad\";\n VisualEditorMode[\"InjectScript\"] = \"injectScript\";\n})(VisualEditorMode || (VisualEditorMode = {}));\n\nfunction createExperience(options) {\n if (typeof options === 'string') {\n const entityStore = new EntityStore(options);\n return {\n entityStore,\n };\n }\n else {\n const { experienceEntry, referencedAssets, referencedEntries, locale } = options;\n if (!isExperienceEntry(experienceEntry)) {\n throw new Error('Provided entry is not experience entry');\n }\n const entityStore = new EntityStore({\n experienceEntry,\n entities: [...referencedEntries, ...referencedAssets],\n locale,\n });\n return {\n entityStore,\n };\n }\n}\n\nconst fetchExperienceEntry = async ({ client, experienceTypeId, locale, identifier, }) => {\n if (!client) {\n throw new Error('Failed to fetch experience entities. Required \"client\" parameter was not provided');\n }\n if (!locale) {\n throw new Error('Failed to fetch experience entities. Required \"locale\" parameter was not provided');\n }\n if (!experienceTypeId) {\n throw new Error('Failed to fetch experience entities. Required \"experienceTypeId\" parameter was not provided');\n }\n if (!identifier.slug && !identifier.id) {\n throw new Error(`Failed to fetch experience entities. At least one identifier must be provided. Received: ${JSON.stringify(identifier)}`);\n }\n const filter = identifier.slug ? { 'fields.slug': identifier.slug } : { 'sys.id': identifier.id };\n const entries = await client.getEntries({\n content_type: experienceTypeId,\n locale,\n ...filter,\n });\n if (entries.items.length > 1) {\n throw new Error(`More than one experience with identifier: ${JSON.stringify(identifier)} was found`);\n }\n return entries.items[0];\n};\n\nfunction treeVisit(initialNode, onNode) {\n // returns last used index\n const _treeVisit = (currentNode, currentIndex, currentDepth) => {\n // Copy children in case of onNode removing it as we pass the node by reference\n const children = [...currentNode.children];\n onNode(currentNode, currentIndex, currentDepth);\n let nextAvailableIndex = currentIndex + 1;\n const lastUsedIndex = currentIndex;\n for (const child of children) {\n const lastUsedIndex = _treeVisit(child, nextAvailableIndex, currentDepth + 1);\n nextAvailableIndex = lastUsedIndex + 1;\n }\n return lastUsedIndex;\n };\n _treeVisit(initialNode, 0, 0);\n}\n\nclass DeepReference {\n constructor({ path, dataSource }) {\n const { key, field, referentField } = parseDataSourcePathWithL1DeepBindings(path);\n this.originalPath = path;\n this.entityId = dataSource[key].sys.id;\n this.entityLink = dataSource[key];\n this.field = field;\n this.referentField = referentField;\n }\n get headEntityId() {\n return this.entityId;\n }\n /**\n * Extracts referent from the path, using EntityStore as source of\n * entities during the resolution path.\n * TODO: should it be called `extractLeafReferent` ? or `followToLeafReferent`\n */\n extractReferent(entityStore) {\n const headEntity = entityStore.getEntityFromLink(this.entityLink);\n const maybeReferentLink = headEntity.fields[this.field];\n if (undefined === maybeReferentLink) {\n // field references nothing (or even field doesn't exist)\n return undefined;\n }\n if (!isLink(maybeReferentLink)) {\n // Scenario of \"impostor referent\", where one of the deepPath's segments is not a Link but some other type\n // Under normal circumstance we expect field to be a Link, but it could be an \"impostor\"\n // eg. `Text` or `Number` or anything like that; could be due to CT changes or manual path creation via CMA\n return undefined;\n }\n return maybeReferentLink;\n }\n static from(opt) {\n return new DeepReference(opt);\n }\n}\nfunction gatherDeepReferencesFromExperienceEntry(experienceEntry) {\n const deepReferences = [];\n const dataSource = experienceEntry.fields.dataSource;\n const { children } = experienceEntry.fields.componentTree;\n treeVisit({\n definitionId: 'root',\n variables: {},\n children,\n }, (node) => {\n if (!node.variables)\n return;\n for (const [, variableMapping] of Object.entries(node.variables)) {\n if (variableMapping.type !== 'BoundValue')\n continue;\n if (!isDeepPath(variableMapping.path))\n continue;\n deepReferences.push(DeepReference.from({\n path: variableMapping.path,\n dataSource,\n }));\n }\n });\n return deepReferences;\n}\nfunction gatherDeepReferencesFromTree(startingNode, dataSource) {\n const deepReferences = [];\n treeVisit(startingNode, (node) => {\n if (!node.data.props)\n return;\n for (const [, variableMapping] of Object.entries(node.data.props)) {\n if (variableMapping.type !== 'BoundValue')\n continue;\n if (!isDeepPath(variableMapping.path))\n continue;\n deepReferences.push(DeepReference.from({\n path: variableMapping.path,\n dataSource,\n }));\n }\n });\n return deepReferences;\n}\n\n/**\n * Traverses deep-references and extracts referents from valid deep-paths.\n * The referents are received from the CDA/CPA response `.includes` field.\n *\n * In case deep-paths not resolving till the end, eg.:\n * - non-link referents: are ignored\n * - unset references: are ignored\n *\n * Errors are thrown in case of deep-paths being correct,\n * but referents not found. Because if we don't throw now, the EntityStore will\n * be missing entities and upon rendering will not be able to render bindings.\n */\nfunction gatherAutoFetchedReferentsFromIncludes(deepReferences, entriesResponse) {\n const autoFetchedReferentEntries = [];\n const autoFetchedReferentAssets = [];\n for (const reference of deepReferences) {\n const headEntry = entriesResponse.items.find((entry) => entry.sys.id === reference.headEntityId);\n if (!headEntry) {\n throw new Error(`LogicError: When resolving deep-references could not find headEntry (id=${reference.entityId})`);\n }\n const linkToReferent = headEntry.fields[reference.field];\n if (undefined === linkToReferent) {\n console.debug(`[experiences-sdk-react::gatherAutoFetchedReferentsFromIncludes] Empty reference in headEntity. Probably reference is simply not set.`);\n continue;\n }\n if (!isLink(linkToReferent)) {\n console.debug(`[experiences-sdk-react::gatherAutoFetchedReferentsFromIncludes] Non-link value in headEntity. Probably broken path '${reference.originalPath}'`);\n continue;\n }\n if (linkToReferent.sys.linkType === 'Entry') {\n const referentEntry = entriesResponse.includes?.Entry?.find((entry) => entry.sys.id === linkToReferent.sys.id);\n if (!referentEntry) {\n throw new Error(`Logic Error: L2-referent Entry was not found within .includes (${JSON.stringify({\n linkToReferent,\n })})`);\n }\n autoFetchedReferentEntries.push(referentEntry);\n }\n else if (linkToReferent.sys.linkType === 'Asset') {\n const referentAsset = entriesResponse.includes?.Asset?.find((entry) => entry.sys.id === linkToReferent.sys.id);\n if (!referentAsset) {\n throw new Error(`Logic Error: L2-referent Asset was not found within includes (${JSON.stringify({\n linkToReferent,\n })})`);\n }\n autoFetchedReferentAssets.push(referentAsset);\n }\n else {\n console.debug(`[experiences-sdk-react::gatherAutoFetchedReferentsFromIncludes] Unhandled linkType :${JSON.stringify(linkToReferent)}`);\n }\n } // for (reference of deepReferences)\n return { autoFetchedReferentAssets, autoFetchedReferentEntries };\n}\n\nconst MIN_FETCH_LIMIT = 1;\nconst fetchEntities = async ({ entityType, client, query, }) => {\n if (entityType === 'Asset') {\n return client.getAssets({ ...query });\n }\n return client.withoutLinkResolution.getEntries({ ...query });\n};\nconst fetchAllEntities = async ({ client, entityType, ids, locale, skip = 0, limit = 100, responseItems = [], }) => {\n try {\n if (!ids.length || !client) {\n return {\n items: [],\n };\n }\n const query = { 'sys.id[in]': ids, locale, limit, skip };\n const response = await fetchEntities({ entityType, client, query });\n if (!response) {\n return {\n items: responseItems,\n };\n }\n responseItems.push(...response.items);\n if (skip + limit < response.total) {\n await fetchAllEntities({\n client,\n entityType,\n ids,\n locale,\n skip: skip + limit,\n limit,\n responseItems,\n });\n }\n return {\n items: responseItems,\n };\n }\n catch (error) {\n if (error instanceof Error &&\n error.message.includes('size too big') &&\n limit > MIN_FETCH_LIMIT) {\n const newLimit = Math.max(MIN_FETCH_LIMIT, Math.floor(limit / 2));\n return fetchAllEntities({\n client,\n entityType,\n ids,\n locale,\n skip,\n limit: newLimit,\n responseItems,\n });\n }\n return error;\n }\n};\n\nconst fetchReferencedEntities = async ({ client, experienceEntry, locale, }) => {\n if (!client) {\n throw new Error('Failed to fetch experience entities. Required \"client\" parameter was not provided');\n }\n if (!locale) {\n throw new Error('Failed to fetch experience entities. Required \"locale\" parameter was not provided');\n }\n if (!isExperienceEntry(experienceEntry)) {\n throw new Error('Failed to fetch experience entities. Provided \"experienceEntry\" does not match experience entry schema');\n }\n const deepReferences = gatherDeepReferencesFromExperienceEntry(experienceEntry);\n const entryIds = [];\n const assetIds = [];\n for (const dataBinding of Object.values(experienceEntry.fields.dataSource)) {\n if (!('sys' in dataBinding)) {\n continue;\n }\n if (dataBinding.sys.linkType === 'Entry') {\n entryIds.push(dataBinding.sys.id);\n }\n if (dataBinding.sys.linkType === 'Asset') {\n assetIds.push(dataBinding.sys.id);\n }\n }\n const [entriesResponse, assetsResponse] = (await Promise.all([\n fetchAllEntities({ client, entityType: 'Entry', ids: entryIds, locale }),\n fetchAllEntities({ client, entityType: 'Asset', ids: assetIds, locale }),\n ]));\n const { autoFetchedReferentAssets, autoFetchedReferentEntries } = gatherAutoFetchedReferentsFromIncludes(deepReferences, entriesResponse);\n // Using client getEntries resolves all linked entry references, so we do not need to resolve entries in usedComponents\n const allResolvedEntries = [\n ...(entriesResponse?.items ?? []),\n ...(experienceEntry.fields.usedComponents || []),\n ...autoFetchedReferentEntries,\n ];\n const allResolvedAssets = [\n ...(assetsResponse.items ?? []),\n ...autoFetchedReferentAssets,\n ];\n return {\n entries: allResolvedEntries,\n assets: allResolvedAssets,\n };\n};\n\nconst errorMessagesWhileFetching$1 = {\n experience: 'Failed to fetch experience',\n experienceReferences: 'Failed to fetch entities, referenced in experience',\n};\nconst handleError$1 = (generalMessage, error) => {\n const message = error instanceof Error ? error.message : `Unknown error: ${error}`;\n throw Error(message);\n};\n/**\n * Fetch experience entry using slug as the identifier\n * @param {string} experienceTypeId - id of the content type associated with the experience\n * @param {string} slug - slug of the experience (defined in entry settings)\n * @param {string} localeCode - locale code to fetch the experience. Falls back to the currently active locale in the state\n */\n// Promise<Experience<EntityStore> | undefined> =>\nasync function fetchBySlug({ client, experienceTypeId, slug, localeCode, }) {\n let experienceEntry = undefined;\n try {\n experienceEntry = await fetchExperienceEntry({\n client,\n experienceTypeId,\n locale: localeCode,\n identifier: {\n slug,\n },\n });\n if (!experienceEntry) {\n throw new Error(`No experience entry with slug: ${slug} exists`);\n }\n try {\n const { entries, assets } = await fetchReferencedEntities({\n client,\n experienceEntry,\n locale: localeCode,\n });\n const experience = createExperience({\n experienceEntry,\n referencedAssets: assets,\n referencedEntries: entries,\n locale: localeCode,\n });\n return experience;\n }\n catch (error) {\n handleError$1(errorMessagesWhileFetching$1.experienceReferences, error);\n }\n }\n catch (error) {\n handleError$1(errorMessagesWhileFetching$1.experience, error);\n }\n}\n\nconst errorMessagesWhileFetching = {\n experience: 'Failed to fetch experience',\n experienceReferences: 'Failed to fetch entities, referenced in experience',\n};\nconst handleError = (generalMessage, error) => {\n const message = error instanceof Error ? error.message : `Unknown error: ${error}`;\n throw Error(message);\n};\n/**\n * Fetch experience entry using slug as the identifier\n * @param {string} experienceTypeId - id of the content type associated with the experience\n * @param {string} slug - slug of the experience (defined in entry settings)\n * @param {string} localeCode - locale code to fetch the experience. Falls back to the currently active locale in the state\n */\nasync function fetchById({ client, experienceTypeId, id, localeCode, }) {\n let experienceEntry = undefined;\n try {\n experienceEntry = await fetchExperienceEntry({\n client,\n experienceTypeId,\n locale: localeCode,\n identifier: {\n id,\n },\n });\n if (!experienceEntry) {\n throw new Error(`No experience entry with id: ${id} exists`);\n }\n try {\n const { entries, assets } = await fetchReferencedEntities({\n client,\n experienceEntry,\n locale: localeCode,\n });\n const experience = createExperience({\n experienceEntry,\n referencedAssets: assets,\n referencedEntries: entries,\n locale: localeCode,\n });\n return experience;\n }\n catch (error) {\n handleError(errorMessagesWhileFetching.experienceReferences, error);\n }\n }\n catch (error) {\n handleError(errorMessagesWhileFetching.experience, error);\n }\n}\n\nexport { DeepReference, EditorModeEntityStore, EntityStore, EntityStoreBase, MEDIA_QUERY_REGEXP, VisualEditorMode, buildCfStyles, buildStyleTag, builtInStyles, calculateNodeDefaultHeight, checkIsAssembly, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, columnsBuiltInStyles, columnsDefinition, containerBuiltInStyles, containerDefinition, createExperience, defineDesignTokens, designTokensRegistry, doesMismatchMessageSchema, fetchById, fetchBySlug, findOutermostCoordinates, gatherDeepReferencesFromExperienceEntry, gatherDeepReferencesFromTree, generateRandomId, getActiveBreakpointIndex, getDataFromTree, getDesignTokenRegistration, getElementCoordinates, getFallbackBreakpointIndex, getInsertionData, getValueForBreakpoint, isContentfulStructureComponent, isDeepPath, isEmptyStructureWithRelativeHeight, isExperienceEntry, isLink, isLinkToAsset, mediaQueryMatcher, optionalBuiltInStyles, parseDataSourcePathIntoFieldset, parseDataSourcePathWithL1DeepBindings, sectionBuiltInStyles, sectionDefinition, sendMessage, singleColumnBuiltInStyles, singleColumnDefinition, supportedModes, transformBoundContentValue, tryParseMessage, validateExperienceBuilderConfig };\n//# sourceMappingURL=index.js.map\n","const SCROLL_STATES = {\n Start: 'scrollStart',\n IsScrolling: 'isScrolling',\n End: 'scrollEnd',\n};\nconst OUTGOING_EVENTS = {\n Connected: 'connected',\n DesignTokens: 'registerDesignTokens',\n HoveredSection: 'hoveredSection',\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 UpdateHoveredComponentCoordinates: 'updateHoveredComponentCoordinates',\n CanvasScroll: 'canvasScrolling',\n CanvasError: 'canvasError',\n ComponentMoveStarted: 'componentMoveStarted',\n ComponentMoveEnded: 'componentMoveEnded',\n OutsideCanvasClick: 'outsideCanvasClick',\n};\nconst INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\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 InitEditor: 'initEditor',\n MouseMove: 'mouseMove',\n};\nconst INTERNAL_EVENTS = {\n ComponentsRegistered: 'cfComponentsRegistered',\n VisualEditorInitialize: 'cfVisualEditorInitialize',\n};\nconst VISUAL_EDITOR_EVENTS = {\n Ready: 'cfVisualEditorReady',\n};\nconst VISUAL_EDITOR_CONTAINER_ID = 'cf-visual-editor';\nconst CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';\nconst CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';\nconst 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};\nconst ASSEMBLY_NODE_TYPE = 'assembly';\nconst ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';\nconst ASSEMBLY_BLOCK_NODE_TYPE = 'assemblyBlock';\nconst ASSEMBLY_NODE_TYPES = [ASSEMBLY_NODE_TYPE, ASSEMBLY_BLOCK_NODE_TYPE];\nconst LATEST_SCHEMA_VERSION = '2023-09-28';\nconst CF_STYLE_ATTRIBUTES = [\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 'cfBorder',\n 'cfBorderRadius',\n 'cfGap',\n 'cfFontSize',\n 'cfFontWeight',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n 'cfTextAlign',\n 'cfTextTransform',\n 'cfTextBold',\n 'cfTextItalic',\n 'cfTextUnderline',\n // For backwards compatibility\n // we need to keep those in this constant array\n // so that omit() in <VisualEditorBlock> and <CompositionBlock>\n // can filter them out and not pass as props\n 'cfBackgroundImageScaling',\n 'cfBackgroundImageAlignment',\n 'cfBackgroundImageAlignmentVertical',\n 'cfBackgroundImageAlignmentHorizontal',\n];\nconst EMPTY_CONTAINER_HEIGHT = '80px';\nconst DEFAULT_IMAGE_WIDTH = '500px';\nvar PostMessageMethods;\n(function (PostMessageMethods) {\n PostMessageMethods[\"REQUEST_ENTITIES\"] = \"REQUEST_ENTITIES\";\n PostMessageMethods[\"REQUESTED_ENTITIES\"] = \"REQUESTED_ENTITIES\";\n})(PostMessageMethods || (PostMessageMethods = {}));\nconst SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];\n\nexport { 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, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PostMessageMethods, SCROLL_STATES, SUPPORTED_IMAGE_FORMATS, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS };\n//# sourceMappingURL=constants.js.map\n","import type { ComponentDefinition } from '@contentful/experiences-core/types';\nimport { ASSEMBLY_DEFAULT_CATEGORY } from '@contentful/experiences-core/constants';\n\nexport type Breakpoints = Array<BreakpointItem>;\n\nexport type Rect = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n width: number;\n height: number;\n};\nexport type BreakpointItem = {\n id: string;\n query: string;\n displayName: string;\n previewSize: string;\n};\n\nexport const isRelativePreviewSize = (width: string) => {\n // For now, we solely allow 100% as relative value\n return width === '100%';\n};\n\nexport const checkIsDesignComponentDefinition = (component?: ComponentDefinition) =>\n component?.category === ASSEMBLY_DEFAULT_CATEGORY;\n\nexport const getTooltipPositions = ({\n previewSize,\n tooltipRect,\n coordinates,\n}: {\n previewSize: string;\n tooltipRect?: DOMRect;\n coordinates?: Rect;\n}) => {\n if (!coordinates || !tooltipRect) {\n return { display: 'none' };\n }\n\n /**\n * By default, the tooltip floats to the left of the element\n */\n const newTooltipStyles = { display: 'flex' };\n\n // If the preview size is relative, we don't change the floating direction\n if (!isRelativePreviewSize(previewSize)) {\n const previewSizeMatch = previewSize.match(/(\\d{1,})px/);\n if (!previewSizeMatch) {\n return { display: 'none' };\n }\n const previewSizePx = parseInt(previewSizeMatch[1]);\n\n /**\n * If the element is at the right edge of the canvas, and the element isn't wide enough to fit the tooltip width,\n * we float the tooltip to the right of the element.\n */\n if (\n tooltipRect.width > previewSizePx - coordinates.right &&\n tooltipRect.width > coordinates.width\n ) {\n newTooltipStyles['float'] = 'right';\n }\n }\n\n const tooltipHeight = tooltipRect.height === 0 ? 32 : tooltipRect.height;\n\n /**\n * For elements with small heights, we don't want the tooltip covering the content in the element,\n * so we show the tooltip at the top or bottom.\n */\n if (tooltipHeight * 2 > coordinates.height) {\n /**\n * If there's enough space for the tooltip at the top of the element, we show the tooltip at the top of the element,\n * else we show the tooltip at the bottom.\n */\n if (tooltipHeight < coordinates.top) {\n newTooltipStyles['bottom'] = coordinates.height;\n } else {\n newTooltipStyles['top'] = coordinates.height;\n }\n }\n /**\n * If the component draws outside of the borders of the canvas to the left we move the tooltip to the right\n * so that it is fully visible.\n */\n if (coordinates.left < 0) {\n newTooltipStyles['left'] = -coordinates.left;\n }\n\n /**\n * If for any reason, the element's top is negative, we show the tooltip at the bottom\n */\n if (coordinates.top < 0) {\n newTooltipStyles['top'] = coordinates.height;\n }\n\n return newTooltipStyles;\n};\n","import { Rect, getTooltipPositions } from '@components/Draggable/canvasToolsUtils';\nimport classNames from 'classnames';\nimport React, { useMemo, useRef } from 'react';\nimport styles from './styles.module.css';\n\ninterface Props {\n coordinates: Rect | null;\n id: string;\n label: string;\n isContainer: boolean;\n isAssemblyBlock: boolean;\n}\n\nconst Tooltip: React.FC<Props> = ({ coordinates, id, label, isAssemblyBlock, isContainer }) => {\n const tooltipRef = useRef<HTMLDivElement>(null);\n\n const previewSize = '100%'; // This should be based on breakpoints and added to usememo dependency array\n\n const tooltipStyles = useMemo(() => {\n const tooltipRect = tooltipRef.current?.getBoundingClientRect();\n\n const draggableRect = document\n .querySelector(`[data-ctfl-draggable-id=\"${id}\"]`)\n ?.getBoundingClientRect();\n\n const newTooltipStyles = getTooltipPositions({\n previewSize,\n tooltipRect,\n coordinates: draggableRect,\n });\n return newTooltipStyles;\n\n // Ignore eslint because we intentionally want to trigger this whenever a user clicks on a container/component which is tracked by these coordinates of the component being clicked being changed\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [coordinates, id, tooltipRef.current]);\n\n return (\n <div\n ref={tooltipRef}\n style={tooltipStyles}\n className={classNames(styles.overlay, {\n [styles.overlayContainer]: isContainer,\n [styles.overlayAssembly]: isAssemblyBlock,\n })}>\n {label}\n </div>\n );\n};\n\nexport default Tooltip;\n","import { DragStart, DragUpdate } from '@hello-pangea/dnd';\nimport { create } from 'zustand';\n\nexport type DraggedItem = DragStart & Partial<DragUpdate>;\n\nexport interface DraggedItemStore {\n componentId: string;\n draggedItem?: DraggedItem;\n isDraggingOnCanvas: boolean;\n onBeforeCaptureId: string;\n mouseX: number;\n mouseY: number;\n scrollY: number;\n domRect?: DOMRect;\n\n // actions\n setComponentId: (id: string) => void;\n updateItem: (item?: DraggedItem) => void;\n setOnBeforeCaptureId: (draggableId: string) => void;\n setMousePosition: (x: number, y: number) => void;\n setScrollY: (y: number) => void;\n setDraggingOnCanvas: (isDraggingOnCanvas: boolean) => void;\n setDomRect: (domRect?: DOMRect) => void;\n}\n\nexport const useDraggedItemStore = create<DraggedItemStore>((set) => ({\n draggedItem: undefined,\n domRect: undefined,\n componentId: '',\n isDraggingOnCanvas: false,\n onBeforeCaptureId: '',\n mouseX: 0,\n mouseY: 0,\n scrollY: 0,\n setComponentId(id) {\n set({ componentId: id });\n },\n updateItem: (item) => {\n set({ draggedItem: item });\n },\n setDraggingOnCanvas: (isDraggingOnCanvas) => {\n set({ isDraggingOnCanvas });\n },\n setOnBeforeCaptureId: (onBeforeCaptureId) => {\n set({ onBeforeCaptureId });\n },\n setMousePosition(x, y) {\n set({ mouseX: x, mouseY: y });\n },\n setDomRect(domRect) {\n set({ domRect });\n },\n setScrollY(y) {\n set({ scrollY: y });\n },\n}));\n","import { CONTENTFUL_COMPONENTS } from '@contentful/experiences-core/constants';\n\nexport const DRAGGABLE_HEIGHT = 30;\nexport const DRAGGABLE_WIDTH = 50;\nexport const DRAG_PADDING = 4;\n\nexport const ROOT_ID = 'root';\nexport const COMPONENT_LIST_ID = 'component-list';\nexport const NEW_COMPONENT_ID = 'ctfl-new-draggable';\nexport const CTFL_ZONE_ID = 'data-ctfl-zone-id';\nexport const CTFL_DRAGGABLE_ID = 'data-ctfl-draggable-id';\nexport const CTFL_DRAGGING_ELEMENT = 'data-ctfl-dragging-element';\n\nexport const HITBOX = {\n WIDTH: 70,\n HEIGHT: 20,\n INITIAL_OFFSET: 10,\n OFFSET_INCREMENT: 8,\n MIN_HEIGHT: 45,\n MIN_DEPTH_HEIGHT: 20,\n DEEP_ZONE: 5,\n};\n\nexport const builtInComponents = [\n CONTENTFUL_COMPONENTS.container.id,\n CONTENTFUL_COMPONENTS.section.id,\n CONTENTFUL_COMPONENTS.columns.id,\n CONTENTFUL_COMPONENTS.singleColumn.id,\n];\n\nexport enum TreeAction {\n REMOVE_NODE,\n ADD_NODE,\n MOVE_NODE,\n UPDATE_NODE,\n REORDER_NODE,\n REPLACE_NODE,\n}\n\nexport enum HitboxDirection {\n TOP,\n LEFT,\n RIGHT,\n BOTTOM,\n SELF_VERTICAL,\n SELF_HORIZONTAL,\n}\n\nexport enum DraggablePosition {\n CENTERED,\n MOUSE_POSITION,\n}\n","import { useDraggedItemStore } from '@/store/draggedItem';\nimport { COMPONENT_LIST_ID, DRAGGABLE_HEIGHT, DRAGGABLE_WIDTH } from '@/types/constants';\nimport { Direction } from '@hello-pangea/dnd';\nimport React, { CSSProperties } from 'react';\n\nexport interface PlaceholderParams {\n dropzoneElementId: string;\n direction: Direction;\n elementIndex: number;\n totalIndexes: number;\n isDraggingOver: boolean;\n}\n\ninterface PlaceholderProps extends PlaceholderParams {\n id: string;\n}\n\nconst calcOffsetLeft = (\n parentElement: Element | null,\n placeholderWidth: number,\n nodeWidth: number,\n) => {\n if (!parentElement) {\n return 0;\n }\n\n const alignItems = window.getComputedStyle(parentElement).alignItems;\n\n if (alignItems === 'center') {\n return -(placeholderWidth - nodeWidth) / 2;\n }\n\n if (alignItems === 'end') {\n return -placeholderWidth + nodeWidth + 2;\n }\n\n return 0;\n};\n\nconst calcOffsetTop = (\n parentElement: Element | null,\n placeholderHeight: number,\n nodeHeight: number,\n) => {\n if (!parentElement) {\n return 0;\n }\n\n const alignItems = window.getComputedStyle(parentElement).alignItems;\n\n if (alignItems === 'center') {\n return -(placeholderHeight - nodeHeight) / 2;\n }\n\n if (alignItems === 'end') {\n return -placeholderHeight + nodeHeight + 2;\n }\n\n return 0;\n};\n\nconst getPaddingOffset = (element: Element): [number, number] => {\n const paddingLeft = parseFloat(window.getComputedStyle(element).paddingLeft);\n const paddingRight = parseFloat(window.getComputedStyle(element).paddingRight);\n const paddingTop = parseFloat(window.getComputedStyle(element).paddingTop);\n const paddingBottom = parseFloat(window.getComputedStyle(element).paddingBottom);\n\n const horizontalOffset = paddingLeft + paddingRight;\n const verticalOffset = paddingTop + paddingBottom;\n\n return [horizontalOffset, verticalOffset];\n};\n/**\n * Calculate the size and position of the dropzone indicator\n * when dragging a new component onto the canvas\n */\nconst calcNewComponentStyles = (params: CalcStylesParams): CSSProperties => {\n const { destinationIndex, elementIndex, dropzoneElementId, id, direction, totalIndexes } = params;\n\n const isEnd = destinationIndex === totalIndexes && elementIndex === totalIndexes - 1;\n const isHorizontal = direction === 'horizontal';\n const isRightAlign = isHorizontal && isEnd;\n const isBottomAlign = !isHorizontal && isEnd;\n\n const dropzone = document.querySelector(`[data-rfd-droppable-id=\"${dropzoneElementId}\"]`);\n const element = document.querySelector(`[data-ctfl-draggable-id=\"${id}\"]`);\n\n if (!dropzone || !element) {\n return emptyStyles;\n }\n\n const elementSizes = element.getBoundingClientRect();\n const dropzoneSizes = dropzone.getBoundingClientRect();\n\n const [horizontalPadding, verticalPadding] = getPaddingOffset(dropzone);\n\n const width = isHorizontal ? DRAGGABLE_WIDTH : dropzoneSizes.width - horizontalPadding;\n const height = isHorizontal ? dropzoneSizes.height - verticalPadding : DRAGGABLE_HEIGHT;\n const top = isHorizontal\n ? calcOffsetTop(element.parentElement, height, elementSizes.height)\n : -height;\n const left = isHorizontal\n ? -width\n : calcOffsetLeft(element.parentElement, width, elementSizes.width);\n\n return {\n width,\n height,\n top: !isBottomAlign ? top : 'unset',\n right: isRightAlign ? -width : 'unset',\n bottom: isBottomAlign ? -height : 'unset',\n left: !isRightAlign ? left : 'unset',\n };\n};\n\n/**\n * Calculate the size and position of the dropzone indicator\n * when moving an existing component on the canvas\n */\nconst calcMovementStyles = (params: CalcStylesParams): CSSProperties => {\n const {\n destinationIndex,\n sourceIndex,\n destinationId,\n sourceId,\n elementIndex,\n dropzoneElementId,\n id,\n direction,\n totalIndexes,\n draggableId,\n } = params;\n\n const isEnd = destinationIndex === totalIndexes && elementIndex === totalIndexes - 1;\n const isHorizontal = direction === 'horizontal';\n const isSameZone = destinationId === sourceId;\n const isBelowSourceIndex = destinationIndex > sourceIndex;\n const isRightAlign = isHorizontal && (isEnd || (isSameZone && isBelowSourceIndex));\n const isBottomAlign = !isHorizontal && (isEnd || (isSameZone && isBelowSourceIndex));\n\n const dropzone = document.querySelector(`[data-rfd-droppable-id=\"${dropzoneElementId}\"]`);\n const draggable = document.querySelector(`[data-rfd-draggable-id=\"${draggableId}\"]`);\n const element = document.querySelector(`[data-ctfl-draggable-id=\"${id}\"]`);\n\n if (!dropzone || !element || !draggable) {\n return emptyStyles;\n }\n\n const elementSizes = element.getBoundingClientRect();\n const dropzoneSizes = dropzone.getBoundingClientRect();\n const draggableSizes = draggable.getBoundingClientRect();\n\n const [horizontalPadding, verticalPadding] = getPaddingOffset(dropzone);\n\n const width = isHorizontal ? draggableSizes.width : dropzoneSizes.width - horizontalPadding;\n const height = isHorizontal ? dropzoneSizes.height - verticalPadding : draggableSizes.height;\n const top = isHorizontal\n ? calcOffsetTop(element.parentElement, height, elementSizes.height)\n : -height;\n const left = isHorizontal\n ? -width\n : calcOffsetLeft(element.parentElement, width, elementSizes.width);\n\n return {\n width,\n height,\n top: !isBottomAlign ? top : 'unset',\n right: isRightAlign ? -width : 'unset',\n bottom: isBottomAlign ? -height : 'unset',\n left: !isRightAlign ? left : 'unset',\n };\n};\n\ninterface CalcStylesParams extends PlaceholderProps {\n sourceIndex: number;\n sourceId: string;\n destinationIndex: number;\n destinationId: string;\n draggableId: string;\n}\n\nconst emptyStyles = { width: 0, height: 0 };\n\nconst calcPlaceholderStyles = (params: CalcStylesParams): CSSProperties => {\n const { isDraggingOver, sourceId } = params;\n\n if (!isDraggingOver) {\n return emptyStyles;\n }\n\n if (sourceId === COMPONENT_LIST_ID) {\n return calcNewComponentStyles(params);\n }\n\n return calcMovementStyles(params);\n};\n\nconst Placeholder: React.FC<PlaceholderProps> = (props) => {\n const sourceIndex = useDraggedItemStore((state) => state.draggedItem?.source.index) ?? -1;\n const draggableId = useDraggedItemStore((state) => state.draggedItem?.draggableId) ?? '';\n const sourceId = useDraggedItemStore((state) => state.draggedItem?.source.droppableId) ?? '';\n const destinationIndex =\n useDraggedItemStore((state) => state.draggedItem?.destination?.index) ?? -1;\n const destinationId =\n useDraggedItemStore((state) => state.draggedItem?.destination?.droppableId) ?? '';\n\n const { elementIndex, totalIndexes, isDraggingOver } = props;\n\n const isActive = destinationIndex === elementIndex;\n const isEnd = destinationIndex === totalIndexes && elementIndex === totalIndexes - 1;\n const isVisible = isEnd || isActive;\n\n const isComponentList = destinationId === COMPONENT_LIST_ID;\n\n return (\n !isComponentList &&\n isDraggingOver &&\n isVisible && (\n <div\n style={{\n ...calcPlaceholderStyles({\n ...props,\n sourceId,\n sourceIndex,\n destinationId,\n destinationIndex,\n draggableId,\n }),\n backgroundColor: 'rgba(var(--exp-builder-blue300-rgb), 0.5)',\n position: 'absolute',\n }}\n />\n )\n );\n};\n\nexport default Placeholder;\n","import { useDraggedItemStore } from '@/store/draggedItem';\nimport { DraggablePosition } from '@/types/constants';\nimport { MutableRefObject, useEffect } from 'react';\n\ninterface Params {\n draggableRef: MutableRefObject<HTMLElement | null>;\n draggableId: string;\n position: DraggablePosition;\n}\n\nexport default function useDraggablePosition({ draggableId, draggableRef, position }: Params) {\n const isDraggingOnCanvas = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n const draggingId = useDraggedItemStore((state) => state.onBeforeCaptureId);\n const preDragDomRect = useDraggedItemStore((state) => state.domRect);\n\n useEffect(() => {\n const el: HTMLElement | null = draggableRef?.current;\n\n if (!isDraggingOnCanvas || draggingId !== draggableId || !el) {\n return;\n }\n\n const isCentered = position === DraggablePosition.CENTERED || !preDragDomRect;\n\n const domRect = isCentered ? el.getBoundingClientRect() : preDragDomRect;\n\n const { mouseX, mouseY } = useDraggedItemStore.getState();\n\n const top = isCentered ? mouseY - domRect.height / 2 : domRect.top;\n const left = isCentered ? mouseX - domRect.width / 2 : domRect.left;\n\n el.style.position = 'fixed';\n el.style.left = `${left}px`;\n el.style.top = `${top}px`;\n el.style.width = `${domRect.width}px`;\n el.style.height = `${domRect.height}px`;\n }, [draggableRef, draggableId, isDraggingOnCanvas, draggingId, position, preDragDomRect]);\n}\n","import React, { useRef } from 'react';\nimport { CSSProperties, ReactNode, SyntheticEvent } from 'react';\nimport { Draggable } from '@hello-pangea/dnd';\nimport classNames from 'classnames';\nimport styles from './styles.module.css';\nimport { Rect } from '@components/Draggable/canvasToolsUtils';\nimport Tooltip from './Tooltip';\nimport Placeholder, { PlaceholderParams } from './Placeholder';\nimport {\n ComponentDefinition,\n ComponentDefinitionVariableType,\n} from '@contentful/experiences-core/types';\nimport useDraggablePosition from '@/hooks/useDraggablePosition';\nimport { DraggablePosition } from '@/types/constants';\nimport { useDraggedItemStore } from '@/store/draggedItem';\n\nfunction getStyle(style, snapshot) {\n if (!snapshot.isDropAnimating) {\n return style;\n }\n return {\n ...style,\n // cannot be 0, but make it super tiny\n transitionDuration: `0.001s`,\n };\n}\n\ninterface DraggableComponentProps {\n placeholder: PlaceholderParams;\n wrapperProps: Record<string, string | undefined>;\n children: ReactNode;\n id: string;\n index: number;\n isAssemblyBlock?: boolean;\n isSelected?: boolean;\n onClick?: (e: SyntheticEvent) => void;\n onMouseDown?: (e: SyntheticEvent) => void;\n onMouseUp?: (e: SyntheticEvent) => void;\n onMouseOver?: (e: SyntheticEvent) => void;\n onMouseOut?: (e: SyntheticEvent) => void;\n coordinates: Rect | null;\n isContainer: boolean;\n blockId?: string;\n userIsDragging?: boolean;\n style?: CSSProperties;\n isDragDisabled?: boolean;\n definition: ComponentDefinition<ComponentDefinitionVariableType>;\n}\n\nexport const DraggableComponent: React.FC<DraggableComponentProps> = ({\n children,\n id,\n index,\n isAssemblyBlock = false,\n isSelected = false,\n onClick = () => null,\n coordinates,\n userIsDragging,\n style,\n wrapperProps,\n isContainer,\n blockId,\n isDragDisabled = false,\n placeholder,\n definition,\n ...rest\n}) => {\n const ref = useRef<HTMLElement | null>(null);\n const setDomRect = useDraggedItemStore((state) => state.setDomRect);\n\n useDraggablePosition({\n draggableId: id,\n draggableRef: ref,\n position: DraggablePosition.MOUSE_POSITION,\n });\n\n return (\n <Draggable key={id} draggableId={id} index={index} isDragDisabled={isDragDisabled}>\n {(provided, snapshot) => (\n <div\n data-ctfl-draggable-id={id}\n data-test-id={`draggable-${blockId ?? 'node'}`}\n ref={(refNode) => {\n provided?.innerRef(refNode);\n ref.current = refNode;\n }}\n {...wrapperProps}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n {...rest}\n className={classNames(styles.DraggableComponent, wrapperProps.className, {\n [styles.isAssemblyBlock]: isAssemblyBlock,\n [styles.isDragging]: snapshot.isDragging,\n [styles.isSelected]: isSelected,\n [styles.userIsDragging]: userIsDragging,\n })}\n style={{\n ...style,\n ...getStyle(provided.draggableProps.style, snapshot),\n }}\n onMouseDown={(e) => {\n if (isDragDisabled) {\n return;\n }\n\n e.stopPropagation();\n setDomRect(e.currentTarget.getBoundingClientRect());\n }}\n onClick={onClick}>\n <Tooltip\n id={id}\n coordinates={coordinates}\n isAssemblyBlock={isAssemblyBlock}\n isContainer={isContainer}\n label={definition.name || 'No label specified'}\n />\n <Placeholder {...placeholder} id={id} />\n {children}\n </div>\n )}\n </Draggable>\n );\n};\n","import { sendMessage, getElementCoordinates } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\n/**\n * This function gets the element co-ordinates of a specified component in the DOM and its parent\n * and sends the DOM Rect to the client app\n */\nexport const sendSelectedComponentCoordinates = (instanceId?: string) => {\n if (!instanceId) return;\n let selectedElement = document.querySelector(`[data-cf-node-id=\"${instanceId}\"]`);\n\n let selectedAssemblyChild: Element | null | undefined = undefined;\n\n const [rootNodeId, nodeLocation] = instanceId.split('---');\n\n if (nodeLocation) {\n selectedAssemblyChild = selectedElement;\n selectedElement = document.querySelector(`[data-cf-node-id=\"${rootNodeId}\"]`);\n }\n\n // Finds the first parent that is a VisualEditorBlock\n let parent = selectedElement?.parentElement;\n while (parent) {\n if (parent?.dataset?.cfNodeId) {\n break;\n }\n parent = parent?.parentElement;\n }\n\n if (selectedElement) {\n sendMessage(OUTGOING_EVENTS.UpdateSelectedComponentCoordinates, {\n selectedNodeCoordinates: getElementCoordinates(selectedElement),\n selectedAssemblyChildCoordinates: selectedAssemblyChild\n ? getElementCoordinates(selectedAssemblyChild)\n : null,\n parentCoordinates: parent ? getElementCoordinates(parent) : null,\n });\n }\n};\n","import type {\n ComponentRegistration,\n ComponentDefinition,\n Link,\n} from '@contentful/experiences-core/types';\n\nimport { ASSEMBLY_DEFAULT_CATEGORY } from '@contentful/experiences-core/constants';\n\n// Note: During development, the hot reloading might empty this and it\n// stays empty leading to not rendering assemblies. Ideally, this is\n// integrated into the state machine to keep track of its state.\nexport const assembliesRegistry = new Map<string, Link<'Entry'>>([]);\nexport const setAssemblies = (assemblies: Link<'Entry'>[]) => {\n for (const assembly of assemblies) {\n assembliesRegistry.set(assembly.sys.id, assembly);\n }\n};\n\nexport const componentRegistry = new Map<string, ComponentRegistration>();\n\nexport const getComponentRegistration = (id: string) => componentRegistry.get(id);\n\nexport const addComponentRegistration = (componentRegistration: ComponentRegistration) => {\n componentRegistry.set(componentRegistration.definition.id, componentRegistration);\n};\n\nexport const createAssemblyRegistration = ({\n definitionId,\n definitionName,\n component,\n}: {\n definitionId: string;\n definitionName?: string;\n component: ComponentRegistration['component'];\n}) => {\n const componentRegistration = componentRegistry.get(definitionId);\n\n if (componentRegistration) {\n return componentRegistration;\n }\n\n const definition = {\n id: definitionId,\n name: definitionName || 'Component',\n variables: {} as ComponentDefinition['variables'],\n children: true,\n category: ASSEMBLY_DEFAULT_CATEGORY,\n };\n\n addComponentRegistration({ component, definition });\n\n return componentRegistry.get(definitionId);\n};\n","import { defineDesignTokens } from '@contentful/experiences-core';\nimport type {\n ComponentRegistration,\n ExperienceDataSource,\n ExperienceUnboundValues,\n DesignTokensDefinition,\n} from '@contentful/experiences-core/types';\nimport { create } from 'zustand';\nimport { componentRegistry } from './registries';\nimport { isEqual } from 'lodash-es';\n\nexport interface InitEditorParams {\n componentRegistry: Map<string, ComponentRegistration>;\n designTokens: DesignTokensDefinition;\n initialLocale: string;\n}\nexport interface EditorStore {\n dataSource: ExperienceDataSource;\n locale: string | null;\n selectedNodeId: string | null;\n unboundValues: ExperienceUnboundValues;\n // updaters\n setDataSource: (data: ExperienceDataSource) => void;\n setUnboundValues: (values: ExperienceUnboundValues) => void;\n setLocale: (locale: string) => void;\n setSelectedNodeId: (id: string) => void;\n\n initializeEditor: (params: InitEditorParams) => void;\n}\n\nexport const useEditorStore = create<EditorStore>((set, get) => ({\n dataSource: {},\n unboundValues: {},\n isDragging: false,\n dragItem: '',\n selectedNodeId: null,\n locale: null,\n\n setSelectedNodeId: (id: string) => {\n set({ selectedNodeId: id });\n },\n setDataSource(data) {\n const dataSource = get().dataSource;\n const newDataSource = { ...dataSource, ...data };\n if (isEqual(dataSource, newDataSource)) {\n return;\n }\n set({ dataSource: newDataSource });\n },\n setUnboundValues(values) {\n set({ unboundValues: values });\n },\n setLocale(locale) {\n const currentLocale = get().locale;\n\n if (locale === currentLocale) {\n return;\n }\n\n set({ locale });\n },\n initializeEditor({ componentRegistry: initialRegistry, designTokens, initialLocale }) {\n initialRegistry.forEach((registration) => {\n componentRegistry.set(registration.definition.id, registration);\n });\n\n // Re-register the design tokens with the Visual Editor's instance of the experiences-core package\n defineDesignTokens(designTokens);\n\n set({ locale: initialLocale });\n },\n}));\n","import { useEffect } from 'react';\nimport type { ExperienceTreeNode } from '@contentful/experiences-core/types';\nimport { sendSelectedComponentCoordinates } from '@/communication/sendSelectedComponentCoordinates';\nimport { useEditorStore } from '@/store/editor';\nimport { getElementCoordinates } from '@contentful/experiences-core';\n/**\n * This hook gets the element co-ordinates of a specified element in the DOM\n * and sends the DOM Rect to the client app\n */\nexport const useSelectedInstanceCoordinates = ({ node }: { node: ExperienceTreeNode }) => {\n const selectedNodeId = useEditorStore((state) => state.selectedNodeId);\n\n useEffect(() => {\n if (selectedNodeId !== node.data.id) {\n return;\n }\n\n // Allows the drop animation to finish before\n // calculating the components coordinates\n setTimeout(() => {\n sendSelectedComponentCoordinates(node.data.id);\n }, 10);\n }, [node, selectedNodeId]);\n\n const selectedElement = node.data.id\n ? document.querySelector(`[data-cf-node-id=\"${selectedNodeId}\"]`)\n : undefined;\n return selectedElement ? getElementCoordinates(selectedElement) : null;\n};\n","import { useEffect, useState } from 'react';\nimport { buildStyleTag } from '@contentful/experiences-core';\nimport type { CSSProperties } from '@contentful/experiences-core/types';\n\n/**\n *\n * @param styles: the list of styles to apply\n * @param nodeId: [Optional] the id of node that these styles will be applied to\n * @returns className: the className that was used\n * Builds and adds a style tag in the document. Returns the className to be attached to the element.\n * In editor mode the nodeId is used as the identifier in order to avoid creating endless tags as the styles are tweeked\n * In preview/delivery mode the styles don't change oftem so we're using the md5 hash of the content of the tag\n */\nexport const useStyleTag = ({ styles, nodeId }: { styles: CSSProperties; nodeId?: string }) => {\n const [className, setClassName] = useState('');\n\n useEffect(() => {\n if (Object.keys(styles).length === 0) {\n return;\n }\n\n const [className, styleRule] = buildStyleTag({ styles, nodeId });\n\n setClassName(className);\n\n const existingTag = document.querySelector(`[data-cf-styles=\"${className}\"]`);\n\n if (existingTag) {\n // editor mode - update existing\n if (nodeId) {\n existingTag.innerHTML = styleRule;\n }\n // preview/delivery mode - here we don't need to update the existing tag because\n // the className is based on the md5 hash of the content so it hasn't changed\n return;\n }\n\n const styleTag = document.createElement('style');\n styleTag.dataset['cfStyles'] = className;\n\n document.head.appendChild(styleTag).innerHTML = styleRule;\n }, [styles, nodeId]);\n\n return { className };\n};\n","import { get } from 'lodash-es';\nimport type { ExperienceUnboundValues, PrimitiveValue } from '@contentful/experiences-core/types';\n\nexport const getUnboundValues = ({\n key,\n fallback,\n unboundValues,\n}: {\n key: string;\n fallback: PrimitiveValue;\n unboundValues: ExperienceUnboundValues;\n}): PrimitiveValue => {\n const lodashPath = `${key}.value`;\n\n return get(unboundValues, lodashPath, fallback) as PrimitiveValue;\n};\n","import { EditorModeEntityStore } from '@contentful/experiences-core';\nimport { create } from 'zustand';\n\nexport interface EntityState {\n entityStore: EditorModeEntityStore;\n // Set to true when entities were fetched from the parent app.\n // Reset to false when we receive a tree update and need to validate\n // again whether all necessary entities are fetched.\n areEntitiesFetched: boolean;\n // updaters\n setEntitiesFetched: (fetched: boolean) => void;\n resetEntityStore: (\n locale: string,\n entities?: EditorModeEntityStore['entities'],\n ) => EditorModeEntityStore;\n}\n\nexport const useEntityStore = create<EntityState>((set) => ({\n entityStore: new EditorModeEntityStore({ locale: 'en-US', entities: [] }),\n areEntitiesFetched: false,\n\n setEntitiesFetched(fetched) {\n set({ areEntitiesFetched: fetched });\n },\n resetEntityStore(locale, entities = []): EditorModeEntityStore {\n console.debug(\n `[experiences-sdk-react] Resetting entity store because the locale changed to '${locale}'.`,\n );\n const newEntityStore = new EditorModeEntityStore({ locale, entities });\n set({\n entityStore: newEntityStore,\n areEntitiesFetched: false,\n });\n\n return newEntityStore;\n },\n}));\n","import { useEditorStore } from '@/store/editor';\nimport {\n buildCfStyles,\n calculateNodeDefaultHeight,\n isLinkToAsset,\n isEmptyStructureWithRelativeHeight,\n isContentfulStructureComponent,\n transformBoundContentValue,\n} from '@contentful/experiences-core';\nimport {\n CF_STYLE_ATTRIBUTES,\n ASSEMBLY_NODE_TYPE,\n EMPTY_CONTAINER_HEIGHT,\n CONTENTFUL_COMPONENTS,\n} from '@contentful/experiences-core/constants';\nimport type {\n StyleProps,\n PrimitiveValue,\n ExperienceTreeNode,\n ResolveDesignValueType,\n ComponentRegistration,\n Link,\n} from '@contentful/experiences-core/types';\nimport { useMemo } from 'react';\nimport { useStyleTag } from '../../hooks/useStyleTag';\nimport { omit } from 'lodash-es';\nimport { getUnboundValues } from '@/utils/getUnboundValues';\nimport { useEntityStore } from '@/store/entityStore';\nimport type { RenderDropzoneFunction } from './Dropzone.types';\nimport { DRAG_PADDING } from '../../types/constants';\n\ntype ComponentProps = StyleProps | Record<string, PrimitiveValue | Link<'Entry'> | Link<'Asset'>>;\n\ntype UseComponentProps = {\n node: ExperienceTreeNode;\n resolveDesignValue: ResolveDesignValueType;\n areEntitiesFetched: boolean;\n definition: ComponentRegistration['definition'];\n renderDropzone: RenderDropzoneFunction;\n userIsDragging: boolean;\n};\n\nexport const useComponentProps = ({\n node,\n areEntitiesFetched,\n resolveDesignValue,\n renderDropzone,\n definition,\n userIsDragging,\n}: UseComponentProps) => {\n const unboundValues = useEditorStore((state) => state.unboundValues);\n const dataSource = useEditorStore((state) => state.dataSource);\n const entityStore = useEntityStore((state) => state.entityStore);\n const props: ComponentProps = useMemo(() => {\n // Don't enrich the assembly wrapper node with props\n if (!definition || node.type === ASSEMBLY_NODE_TYPE) {\n return {};\n }\n\n return Object.entries(definition.variables).reduce(\n (acc, [variableName, variableDefinition]) => {\n const variableMapping = node.data.props[variableName];\n if (!variableMapping) {\n return {\n ...acc,\n [variableName]: variableDefinition.defaultValue,\n };\n }\n\n if (variableMapping.type === 'DesignValue') {\n const valueByBreakpoint = resolveDesignValue(\n variableMapping.valuesByBreakpoint,\n variableName,\n );\n const designValue =\n variableName === 'cfHeight'\n ? calculateNodeDefaultHeight({\n blockId: node.data.blockId,\n children: node.children,\n value: valueByBreakpoint,\n })\n : valueByBreakpoint;\n\n return {\n ...acc,\n [variableName]: designValue,\n };\n } else if (variableMapping.type === 'BoundValue') {\n const [, uuid, path] = variableMapping.path.split('/');\n const binding = dataSource[uuid] as Link<'Entry' | 'Asset'>;\n\n const variableDefinition = definition.variables[variableName];\n let boundValue = transformBoundContentValue(\n node.data.props,\n entityStore,\n binding,\n resolveDesignValue,\n variableName,\n variableDefinition,\n variableMapping.path,\n );\n\n // In some cases, there may be an asset linked in the path, so we need to consider this scenario:\n // If no 'boundValue' is found, we also attempt to extract the value associated with the second-to-last item in the path.\n // If successful, it means we have identified the linked asset.\n\n if (!boundValue) {\n const maybeBoundAsset = areEntitiesFetched\n ? entityStore.getValue(binding, path.split('/').slice(0, -2))\n : undefined;\n\n if (isLinkToAsset(maybeBoundAsset)) {\n boundValue = maybeBoundAsset;\n }\n }\n\n const value = boundValue || variableDefinition.defaultValue;\n\n return {\n ...acc,\n [variableName]: value,\n };\n } else {\n const value = getUnboundValues({\n key: variableMapping.key,\n fallback: variableDefinition.defaultValue,\n unboundValues: unboundValues || {},\n });\n\n return {\n ...acc,\n [variableName]: value,\n };\n }\n },\n {},\n );\n }, [\n definition,\n node.data.props,\n node.children,\n node.data.blockId,\n resolveDesignValue,\n dataSource,\n areEntitiesFetched,\n unboundValues,\n node.type,\n entityStore,\n ]);\n\n const cfStyles = buildCfStyles(props);\n\n // Separate the component styles from the editor wrapper styles\n const { margin, height, width, maxWidth, ...componentStyles } = cfStyles;\n\n // Styles that will be applied to the editor wrapper (draggable) element\n const { className: wrapperClass } = useStyleTag({\n styles:\n // To ensure that assembly nodes are rendered like they are rendered in\n // the assembly editor, we need to use a normal block instead of a flex box.\n node.type === ASSEMBLY_NODE_TYPE\n ? {\n display: 'block !important',\n width: '100%',\n }\n : {\n margin,\n maxWidth,\n width,\n height,\n },\n nodeId: `editor-${node.data.id}`,\n });\n\n // Styles that will be applied to the component element\n const { className: componentClass } = useStyleTag({\n styles: {\n ...componentStyles,\n margin: 0,\n width: '100%',\n height: '100%',\n maxWidth: 'none',\n ...(isEmptyStructureWithRelativeHeight(node.children.length, node?.data.blockId, height) && {\n minHeight: EMPTY_CONTAINER_HEIGHT,\n }),\n ...(userIsDragging &&\n isContentfulStructureComponent(node?.data.blockId) &&\n node?.data.blockId !== CONTENTFUL_COMPONENTS.columns.id && {\n padding: addExtraDropzonePadding(componentStyles.padding?.toString() || '0 0 0 0'),\n }),\n },\n nodeId: node.data.id,\n });\n\n const wrapperProps = {\n className: wrapperClass,\n 'data-cf-node-id': node.data.id,\n 'data-cf-node-block-id': node.data.blockId,\n 'data-cf-node-block-type': node.type,\n };\n\n //List explicit style props that will end up being passed to the component\n const stylesToKeep = ['cfImageAsset'];\n const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));\n\n const componentProps = {\n className: componentClass,\n editorMode: true,\n node,\n renderDropzone,\n ...omit(props, stylesToRemove, ['cfHyperlink', 'cfOpenInNewTab']),\n ...(definition.children ? { children: renderDropzone(node) } : {}),\n };\n\n return { componentProps, wrapperProps };\n};\n\nconst addExtraDropzonePadding = (padding: string) =>\n padding\n .split(' ')\n .map((value) => {\n if (value.endsWith('px')) {\n const parsedValue = parseInt(value.replace(/px$/, ''), 10);\n return (parsedValue < DRAG_PADDING ? DRAG_PADDING : parsedValue) + 'px';\n }\n return `${DRAG_PADDING}px`;\n })\n .join(' ');\n","import React, { forwardRef } from 'react';\nimport styleInject from 'style-inject';\nimport { documentToReactComponents } from '@contentful/rich-text-react-renderer';\nimport { BLOCKS } from '@contentful/rich-text-types';\n\nconst CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';\nconst 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};\nvar PostMessageMethods;\n(function (PostMessageMethods) {\n PostMessageMethods[\"REQUEST_ENTITIES\"] = \"REQUEST_ENTITIES\";\n PostMessageMethods[\"REQUESTED_ENTITIES\"] = \"REQUESTED_ENTITIES\";\n})(PostMessageMethods || (PostMessageMethods = {}));\n\nfunction combineClasses(...classes) {\n return classes\n .filter((val) => val)\n .map((c) => c.trim())\n .join(' ');\n}\n\nconst Button = ({ children, className, label, onClick, onNavigate, target, url, ...props }) => {\n const classes = combineClasses('cf-button', className);\n const handleClick = (event) => {\n if (onNavigate && url) {\n event.preventDefault();\n onNavigate(url, target);\n }\n onClick && onClick(event);\n };\n const button = (React.createElement(\"button\", { className: classes, \"data-url\": url, \"data-target\": target, onClick: handleClick, ...props }, label ? label : children));\n return url ? (React.createElement(\"a\", { href: url, target: target }, button)) : (button);\n};\n\nconst ButtonComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.button.id,\n name: CONTENTFUL_COMPONENTS.button.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: [\n 'cfMargin',\n 'cfMaxWidth',\n 'cfLetterSpacing',\n 'cfTextItalic',\n 'cfTextUnderline',\n 'cfTextBold',\n 'cfLineHeight',\n 'cfBorder',\n 'cfBorderRadius',\n ],\n tooltip: {\n description: 'Drop onto the canvas to add button that can be used to trigger an action.',\n },\n variables: {\n cfFontSize: {\n displayName: 'Font Size',\n type: 'Text',\n group: 'style',\n description: 'The font size of the button.',\n defaultValue: '16px',\n },\n cfFontWeight: {\n displayName: 'Font Weight',\n type: 'Text',\n group: 'style',\n description: 'The font weight of the button.',\n defaultValue: '600',\n },\n cfTextColor: {\n displayName: 'Text Color',\n type: 'Text',\n group: 'style',\n description: 'The text color of the button.',\n defaultValue: 'rgba(255, 255, 255, 1)',\n },\n cfBackgroundColor: {\n displayName: 'Background color',\n type: 'Text',\n group: 'style',\n description: 'The background color of the button.',\n defaultValue: 'rgba(0, 0, 0, 1)',\n },\n cfPadding: {\n displayName: 'Padding',\n type: 'Text',\n group: 'style',\n description: 'The padding of the button.',\n defaultValue: '6px 12px 6px 12px',\n },\n cfWidth: {\n displayName: 'Width',\n type: 'Text',\n group: 'style',\n description: 'The width of the button.',\n defaultValue: 'fit-content',\n },\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the button.',\n defaultValue: 'fit-content',\n },\n cfTextAlign: {\n displayName: 'Text Align',\n type: 'Text',\n group: 'style',\n description: 'The text align of the button.',\n defaultValue: 'center',\n },\n label: {\n displayName: 'Label',\n type: 'Text',\n defaultValue: 'Button',\n },\n url: {\n displayName: 'URL',\n type: 'Text',\n defaultValue: '/',\n },\n target: {\n displayName: 'Target',\n type: 'Text',\n defaultValue: '',\n },\n },\n};\n\nvar css_248z$5 = \".cf-heading {\\n white-space: pre-line;\\n}\\n\";\nstyleInject(css_248z$5);\n\nconst Heading = ({ children, className, text, type = 'h1', ...props }) => {\n const Tag = type;\n const classes = combineClasses('cf-heading', className);\n return (React.createElement(Tag, { className: classes, ...props }, text ? text : children));\n};\n\nconst HeadingComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.heading.id,\n name: CONTENTFUL_COMPONENTS.heading.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: [\n 'cfMargin',\n 'cfPadding',\n 'cfFontWeight',\n 'cfLetterSpacing',\n 'cfTextAlign',\n 'cfTextColor',\n 'cfTextTransform',\n 'cfTextItalic',\n 'cfTextUnderline',\n 'cfWidth',\n 'cfMaxWidth',\n 'cfBackgroundColor',\n 'cfBorder',\n 'cfBorderRadius',\n ],\n tooltip: {\n description: 'Drop onto the canvas to add a heading.',\n },\n variables: {\n // Built-in style variables with default values changed\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the button.',\n defaultValue: 'fit-content',\n },\n cfFontSize: {\n displayName: 'Font Size',\n type: 'Text',\n group: 'style',\n description: 'The font size of the heading.',\n defaultValue: '32px',\n },\n cfLineHeight: {\n displayName: 'Line Height',\n type: 'Text',\n group: 'style',\n description: 'The line height of the heading.',\n defaultValue: '48px',\n },\n cfTextBold: {\n displayName: 'Bold',\n type: 'Boolean',\n group: 'style',\n description: 'The text bold of the heading.',\n defaultValue: true,\n },\n // Component specific variables\n text: {\n displayName: 'text',\n type: 'Text',\n description: 'The text to display in the heading.',\n defaultValue: 'Heading',\n },\n type: {\n displayName: 'Type',\n type: 'Text',\n defaultValue: 'h1',\n description: 'Determines the HTML tag of the heading. Value can be h1, h2, h3, h4, h5, or h6.',\n validations: {\n in: [\n { value: 'h1', displayName: 'H1' },\n { value: 'h2', displayName: 'H2' },\n { value: 'h3', displayName: 'H3' },\n { value: 'h4', displayName: 'H4' },\n { value: 'h5', displayName: 'H5' },\n { value: 'h6', displayName: 'H6' },\n ],\n },\n },\n },\n};\n\nvar css_248z$4 = \".cf-richtext {\\n white-space: pre-line;\\n}\\n\";\nstyleInject(css_248z$4);\n\nconst RichText = ({ as = 'p', className, value, ...props }) => {\n const classes = combineClasses('cf-richtext', className);\n const Tag = as;\n return documentToReactComponents(value, {\n renderNode: {\n [BLOCKS.PARAGRAPH]: (_node, children) => {\n return (React.createElement(Tag, { className: classes, ...props }, children));\n },\n },\n });\n};\n\nconst RichTextComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.richText.id,\n name: CONTENTFUL_COMPONENTS.richText.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: [\n 'cfMargin',\n 'cfPadding',\n 'cfFontWeight',\n 'cfLetterSpacing',\n 'cfTextTransform',\n 'cfMaxWidth',\n 'cfBackgroundColor',\n 'cfBorder',\n 'cfBorderRadius',\n ],\n tooltip: {\n description: 'Drop onto the canvas to add text with Rich text formatting options.',\n },\n variables: {\n // Built-in style variables with default values changed\n cfLineHeight: {\n displayName: 'Line Height',\n type: 'Text',\n group: 'style',\n description: 'The line height of the heading.',\n defaultValue: '24px',\n },\n cfTextAlign: {\n displayName: 'Text Align',\n type: 'Text',\n group: 'style',\n description: 'The text alignment of the heading.',\n defaultValue: 'center',\n },\n cfWidth: {\n displayName: 'Width',\n type: 'Text',\n group: 'style',\n description: 'The width of the button.',\n defaultValue: 'fit-content',\n },\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the button.',\n defaultValue: 'fit-content',\n },\n value: {\n displayName: 'Value',\n description: 'The text to display.',\n type: 'RichText',\n defaultValue: {\n nodeType: 'document',\n data: {},\n content: [\n {\n nodeType: 'paragraph',\n data: {},\n content: [\n {\n nodeType: 'text',\n value: 'Rich text',\n marks: [],\n data: {},\n },\n ],\n },\n ],\n },\n },\n },\n};\n\nvar css_248z$3 = \".cf-text {\\n white-space: pre-line;\\n}\\n\";\nstyleInject(css_248z$3);\n\nconst Text = ({ as = 'p', children, className, value, url, target, onNavigate, onClick, ...props }) => {\n const handleClick = (event) => {\n if (onNavigate && url) {\n event.preventDefault();\n onNavigate(url, target);\n }\n onClick && onClick(event);\n };\n const Tag = as;\n const textAsTag = (React.createElement(Tag, { className: combineClasses('cf-text', className), onClick: handleClick, \"data-url\": url, ...(target ? { 'data-target': target } : {}), ...props }, value ? value : children));\n if (!url) {\n return textAsTag;\n }\n return (React.createElement(\"a\", { className: \"cf-text-link\", href: url, ...(target ? { target } : {}) }, textAsTag));\n};\n\nconst TextComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.text.id,\n name: CONTENTFUL_COMPONENTS.text.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: [\n 'cfMargin',\n 'cfPadding',\n 'cfFontSize',\n 'cfFontWeight',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n 'cfTextAlign',\n 'cfTextTransform',\n 'cfTextBold',\n 'cfTextItalic',\n 'cfTextUnderline',\n 'cfBackgroundColor',\n 'cfBorder',\n 'cfBorderRadius',\n 'cfWidth',\n 'cfMaxWidth',\n ],\n tooltip: {\n description: 'Drop onto the canvas to add plain text.',\n },\n variables: {\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the button.',\n defaultValue: 'fit-content',\n },\n value: {\n displayName: 'Value',\n description: 'The text to display. If not provided, children will be used instead.',\n type: 'Text',\n defaultValue: 'Text',\n },\n as: {\n displayName: 'As',\n description: 'Renders the text in a specific HTML tag.',\n type: 'Text',\n defaultValue: 'p',\n validations: {\n in: [\n { value: 'p', displayName: 'p' },\n { value: 'span', displayName: 'span' },\n { value: 'div', displayName: 'div' },\n { value: 'label', displayName: 'label' },\n { value: 'caption', displayName: 'caption' },\n { value: 'small', displayName: 'small' },\n { value: 'strong', displayName: 'strong' },\n { value: 'em', displayName: 'em' },\n ],\n },\n },\n url: {\n displayName: 'URL',\n type: 'Text',\n defaultValue: '',\n },\n target: {\n displayName: 'Target',\n type: 'Text',\n defaultValue: '',\n },\n },\n};\n\nvar css_248z$2 = \".cf-no-image {\\n position: relative;\\n}\\n\\n.cf-no-image img {\\n background-color: var(--cf-color-gray100);\\n outline-offset: -2px;\\n outline: 2px solid rgba(var(--cf-color-gray400-rgb), 0.5);\\n}\\n\\n[data-ctfl-draggable-id] .cf-no-image {\\n width: 100%;\\n height: 100%;\\n}\\n\\n[data-ctfl-draggable-id] .cf-no-image img {\\n width: 100%;\\n}\\n\\n.cf-no-image svg {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n transform: translate(-50%, -50%);\\n height: var(--cf-text-3xl);\\n width: var(--cf-text-3xl);\\n max-height: 100%;\\n max-width: 100%;\\n}\\n\\n.cf-no-image svg path {\\n fill: var(--cf-color-gray400);\\n}\\n\";\nstyleInject(css_248z$2);\n\nconst Image = ({ className = '', src, cfImageAsset, ...props }) => {\n if (!cfImageAsset && !src) {\n return (React.createElement(\"div\", { className: \"cf-no-image\" },\n React.createElement(\"img\", { className: className, src: \"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAA\", ...props }),\n React.createElement(\"svg\", { fill: \"none\", viewBox: \"0 0 17 16\", xmlns: \"http://www.w3.org/2000/svg\" },\n React.createElement(\"path\", { fill: \"#fff\", d: \"M13.5 2h-10a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1m-10 1h10v4.836l-1.543-1.543a1 1 0 0 0-1.414 0L3.836 13H3.5zm10 10H5.25l6-6 2.25 2.25zm-7-5.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3m0-2a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1\" }))));\n }\n if (typeof cfImageAsset === 'string') {\n return React.createElement(\"img\", { src: cfImageAsset, className: 'cf-image ' + className, ...props });\n }\n if (cfImageAsset) {\n return (React.createElement(\"img\", { src: cfImageAsset.url, srcSet: cfImageAsset.srcSet?.length ? cfImageAsset.srcSet?.join(', ') : undefined, sizes: cfImageAsset.sizes ? cfImageAsset.sizes : undefined, className: 'cf-image ' + className, ...props }));\n }\n if (src) {\n return React.createElement(\"img\", { src: src, className: 'cf-image ' + className, ...props });\n }\n};\n\nconst ImageComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.image.id,\n name: CONTENTFUL_COMPONENTS.image.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: ['cfMargin', 'cfPadding', 'cfImageAsset', 'cfImageOptions'],\n tooltip: {\n description: 'Drop onto the canvas to upload an image.',\n },\n variables: {\n alt: {\n displayName: 'Alt',\n type: 'Text',\n description: 'Alternative text for the image',\n },\n },\n};\n\nvar css_248z$1 = \".contentful-container {\\n position: relative;\\n display: flex;\\n box-sizing: border-box;\\n pointer-events: all;\\n}\\n\\n.contentful-container::-webkit-scrollbar {\\n display: none; /* Safari and Chrome */\\n}\\n\\n.cf-single-column-wrapper {\\n position: relative;\\n}\\n\\n.cf-container-wrapper {\\n position: relative;\\n width: 100%;\\n}\\n\\n.cf-container-label {\\n position: absolute;\\n pointer-events: none;\\n top: 0;\\n left: 0;\\n right: 0;\\n bottom: 0;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n overflow-x: clip;\\n font-family: var(--exp-builder-font-stack-primary);\\n font-size: 12px;\\n color: var(--exp-builder-gray400);\\n z-index: 10;\\n}\\n\\n/* used by ContentfulSectionAsHyperlink.tsx */\\n\\n.contentful-container-link,\\n.contentful-container-link:active,\\n.contentful-container-link:visited,\\n.contentful-container-link:hover,\\n.contentful-container-link:read-write,\\n.contentful-container-link:focus-visible {\\n color: inherit;\\n text-decoration: unset;\\n outline: unset;\\n}\\n\";\nstyleInject(css_248z$1);\n\nconst Flex = forwardRef(({ id, children, onMouseEnter, onMouseUp, onMouseLeave, onMouseDown, onClick, flex, flexBasis, flexShrink, flexDirection, gap, justifyContent, justifyItems, justifySelf, alignItems, alignSelf, alignContent, order, flexWrap, flexGrow, className, cssStyles, ...props }, ref) => {\n return (React.createElement(\"div\", { id: id, ref: ref, style: {\n display: 'flex',\n flex,\n flexBasis,\n flexShrink,\n flexDirection,\n gap,\n justifyContent,\n justifyItems,\n justifySelf,\n alignItems,\n alignSelf,\n alignContent,\n order,\n flexWrap,\n flexGrow,\n ...cssStyles,\n }, className: className, onMouseEnter: onMouseEnter, onMouseUp: onMouseUp, onMouseDown: onMouseDown, onMouseLeave: onMouseLeave, onClick: onClick, ...props }, children));\n});\nFlex.displayName = 'Flex';\n\n/* eslint-disable */ /* TODO: fix eslint errors */\nconst ContentfulContainerAsHyperlink = (props) => {\n const { cfHyperlink, cfOpenInNewTab, editorMode, className, children } = props;\n if (editorMode === false) {\n let anchorTagProps = {};\n if (cfOpenInNewTab) {\n anchorTagProps = {\n target: '_blank',\n rel: 'noopener noreferrer',\n };\n }\n return (React.createElement(\"a\", { className: combineClasses(className, 'contentful-container', 'contentful-container-link'), href: cfHyperlink, ...anchorTagProps }, children));\n }\n const { renderDropzone, node } = props;\n const stopPropagationInEditorMode = (e) => {\n e.stopPropagation();\n e.preventDefault();\n };\n return renderDropzone(node, {\n ['data-test-id']: 'contentful-container',\n className: combineClasses(className, 'contentful-container', 'contentful-container-link'),\n zoneId: node.data.id,\n WrapperComponent: 'a',\n onClick: stopPropagationInEditorMode,\n });\n};\n\n/* eslint-disable */\nconst ContentfulContainer = (props) => {\n const { className, editorMode, children, cfHyperlink } = props;\n if (cfHyperlink) {\n return React.createElement(ContentfulContainerAsHyperlink, { ...props }, children);\n }\n if (editorMode === false) {\n return (React.createElement(Flex, { \"data-test-id\": \"contentful-container\", className: combineClasses(className, 'contentful-container') }, children));\n }\n // Extract properties that are only available in editor mode\n const { renderDropzone, node } = props;\n const isEmpty = !node.children.length;\n const renderDropzoneComponent = () => {\n return renderDropzone(node, {\n ['data-test-id']: 'contentful-container',\n id: 'ContentfulContainer',\n className: combineClasses('contentful-container', className),\n WrapperComponent: Flex,\n });\n };\n // Perform ternary so that we only render the wrapper div if the container is empty\n return isEmpty ? (React.createElement(\"div\", { className: \"cf-container-wrapper\", \"data-ctfl-draggable-id\": node.data.id },\n React.createElement(\"div\", { className: \"cf-container-label\" }, node.data.blockId === CONTENTFUL_COMPONENTS.section.id ? 'Section' : 'Container'),\n renderDropzoneComponent())) : (renderDropzoneComponent());\n};\n\nvar css_248z = \".Columns {\\n display: flex;\\n gap: 24px;\\n grid-template-columns: repeat(12, 1fr);\\n flex-direction: column;\\n min-height: 0; /* NEW */\\n min-width: 0; /* NEW; needed for Firefox */\\n}\\n\\n@media (min-width: 768px) {\\n .Columns {\\n display: grid;\\n }\\n}\\n\\n.cf-single-column-wrapper {\\n position: relative;\\n}\\n\\n.cf-single-column {\\n pointer-events: all;\\n}\\n\\n.cf-single-column-label {\\n pointer-events: none;\\n position: absolute;\\n z-index: -1;\\n top: 0;\\n left: 0;\\n right: 0;\\n bottom: 0;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n font-family: var(--exp-builder-font-stack-primary);\\n font-size: 12px;\\n color: var(--exp-builder-gray400);\\n z-index: 100;\\n}\\n\";\nstyleInject(css_248z);\n\nconst ColumnWrapper = forwardRef((props, ref) => {\n return (React.createElement(\"div\", { ref: ref, ...props, style: {\n ...(props.style || {}),\n display: 'grid',\n gridTemplateColumns: 'repeat(12, [col-start] 1fr)',\n } }, props.children));\n});\nColumnWrapper.displayName = 'ColumnWrapper';\nconst Columns = (props) => {\n const { editorMode, className, children } = props;\n if (!editorMode) {\n return (React.createElement(ColumnWrapper, { className: combineClasses(className, 'Columns') }, children));\n }\n const { node, renderDropzone } = props;\n return renderDropzone(node, {\n ['data-test-id']: 'contentful-columns',\n className: className,\n WrapperComponent: ColumnWrapper,\n });\n};\n\nconst SingleColumn = (props) => {\n const { className, editorMode, children } = props;\n if (editorMode === false) {\n return React.createElement(Flex, { className: className }, children);\n }\n const { renderDropzone, node, innerRef, Tooltip, style, dragHandleProps, draggableProps, cfColumnSpan, editorMode: edit, wrapperClassName, ...editorProps } = props;\n const isEmpty = !node.children.length;\n return (React.createElement(\"div\", { ref: innerRef, ...dragHandleProps, ...draggableProps, ...editorProps, className: combineClasses(wrapperClassName, 'cf-single-column-wrapper', isEmpty ? 'cf-single-column-empty' : ''), style: {\n ...style,\n gridColumn: `span ${cfColumnSpan}`,\n } },\n Tooltip,\n isEmpty && React.createElement(\"div\", { className: \"cf-single-column-label\" }, \"Column\"),\n renderDropzone(node, {\n ['data-test-id']: 'contentful-single-column',\n className: combineClasses('cf-single-column', className),\n WrapperComponent: Flex,\n })));\n};\n\nconst assemblyStyle = { display: 'contents' };\n// Feel free to do any magic as regards variable definitions for assemblies\n// Or if this isn't necessary by the time we figure that part out, we can bid this part farewell\nconst Assembly = (props) => {\n if (props.editorMode) {\n const { node } = props;\n return props.renderDropzone(node, {\n ['data-test-id']: 'contentful-assembly',\n className: props.className,\n style: assemblyStyle,\n });\n }\n // Using a display contents so assembly content/children\n // can appear as if they are direct children of the div wrapper's parent\n return React.createElement(\"div\", { \"data-test-id\": \"assembly\", ...props, style: assemblyStyle });\n};\n\nexport { Assembly, Button, ButtonComponentDefinition, Columns, ContentfulContainer, Heading, HeadingComponentDefinition, Image, ImageComponentDefinition, RichText, RichTextComponentDefinition, SingleColumn, Text, TextComponentDefinition };\n//# sourceMappingURL=index.js.map\n","import { EntityStoreBase } from '@contentful/experiences-core';\nimport type {\n ComponentTreeNode,\n ExperienceDataSource,\n ExperienceUnboundValues,\n ExperienceTreeNode,\n ComponentPropertyValue,\n ExperienceFields,\n} from '@contentful/experiences-core/types';\nimport type { Entry } from 'contentful';\nimport {\n ASSEMBLY_BLOCK_NODE_TYPE,\n ASSEMBLY_NODE_TYPE,\n} from '@contentful/experiences-core/constants';\nimport { assembliesRegistry } from '@/store/registries';\n\nexport const checkIsAssemblyEntry = (entry: Entry): boolean => {\n return Boolean(entry.fields?.componentSettings);\n};\n\nexport const deserializeAssemblyNode = ({\n node,\n nodeId,\n nodeLocation,\n parentId,\n assemblyDataSource,\n assemblyId,\n assemblyComponentId,\n assemblyUnboundValues,\n componentInstanceProps,\n componentInstanceUnboundValues,\n componentInstanceDataSource,\n}: {\n node: ComponentTreeNode;\n nodeId: string;\n nodeLocation: string | null;\n parentId?: string;\n assemblyDataSource: ExperienceDataSource;\n assemblyUnboundValues: ExperienceUnboundValues;\n assemblyId: string;\n assemblyComponentId: string;\n componentInstanceProps: Record<string, ComponentPropertyValue>;\n componentInstanceUnboundValues: ExperienceUnboundValues;\n componentInstanceDataSource: ExperienceDataSource;\n}): ExperienceTreeNode => {\n const childNodeVariable: Record<string, ComponentPropertyValue> = {};\n const dataSource: ExperienceDataSource = {};\n const unboundValues: ExperienceUnboundValues = {};\n\n for (const [variableName, variable] of Object.entries(node.variables)) {\n childNodeVariable[variableName] = variable;\n if (variable.type === 'ComponentValue') {\n const componentValueKey = variable.key;\n const instanceProperty = componentInstanceProps[componentValueKey];\n\n // For assembly, we look up the value in the assembly instance and\n // replace the componentValue with that one.\n if (instanceProperty?.type === 'UnboundValue') {\n const componentInstanceValue = componentInstanceUnboundValues[instanceProperty.key];\n unboundValues[instanceProperty.key] = componentInstanceValue;\n childNodeVariable[variableName] = {\n type: 'UnboundValue',\n key: instanceProperty.key,\n };\n } else if (instanceProperty?.type === 'BoundValue') {\n const [, dataSourceKey] = instanceProperty.path.split('/');\n const componentInstanceValue = componentInstanceDataSource[dataSourceKey];\n dataSource[dataSourceKey] = componentInstanceValue;\n childNodeVariable[variableName] = {\n type: 'BoundValue',\n path: instanceProperty.path,\n };\n }\n }\n }\n\n const isAssembly = assembliesRegistry.has(node.definitionId);\n\n const children: ExperienceTreeNode[] = node.children.map((child, childIndex) => {\n const newNodeLocation =\n nodeLocation === null ? `${childIndex}` : nodeLocation + '_' + childIndex;\n return deserializeAssemblyNode({\n node: child,\n nodeId: `${assemblyComponentId}---${newNodeLocation}`,\n parentId: nodeId,\n nodeLocation: newNodeLocation,\n assemblyId,\n assemblyDataSource,\n assemblyComponentId,\n assemblyUnboundValues,\n componentInstanceProps,\n componentInstanceUnboundValues,\n componentInstanceDataSource,\n });\n });\n\n return {\n // separate node type identifiers for assemblies and their blocks, so we can treat them differently in as much as we want\n type: isAssembly ? ASSEMBLY_NODE_TYPE : ASSEMBLY_BLOCK_NODE_TYPE,\n parentId,\n data: {\n id: nodeId,\n assembly: {\n id: assemblyId,\n componentId: assemblyComponentId,\n nodeLocation: nodeLocation || null,\n },\n blockId: node.definitionId,\n props: childNodeVariable,\n dataSource,\n unboundValues,\n breakpoints: [],\n },\n children,\n };\n};\n\nexport const resolveAssembly = ({\n node,\n entityStore,\n}: {\n node: ExperienceTreeNode;\n entityStore: EntityStoreBase | null;\n}) => {\n if (node.type !== ASSEMBLY_NODE_TYPE) {\n return node;\n }\n\n const componentId = node.data.blockId as string;\n const assembly = assembliesRegistry.get(componentId);\n\n if (!assembly) {\n console.warn(`Link to assembly with ID '${componentId}' not found`, {\n assembliesRegistry,\n });\n return node;\n }\n\n const componentFields = entityStore?.getValue(assembly, [\n 'fields',\n ]) as unknown as ExperienceFields;\n\n if (!componentFields) {\n console.warn(`Entry for assembly with ID '${componentId}' not found`, { entityStore });\n return node;\n }\n\n if (!componentFields.componentTree?.children) {\n console.warn(`Component tree for assembly with ID '${componentId}' not found`, {\n componentFields,\n });\n }\n\n const deserializedNode = deserializeAssemblyNode({\n node: {\n definitionId: node.data.blockId || '',\n variables: {},\n children: componentFields.componentTree?.children ?? [],\n },\n nodeLocation: null,\n nodeId: node.data.id,\n parentId: node.parentId,\n assemblyDataSource: {},\n assemblyId: assembly.sys.id,\n assemblyComponentId: node.data.id,\n assemblyUnboundValues: componentFields.unboundValues,\n componentInstanceProps: node.data.props,\n componentInstanceUnboundValues: node.data.unboundValues,\n componentInstanceDataSource: node.data.dataSource,\n });\n\n return deserializedNode;\n};\n","import React from 'react';\nimport type {\n ComponentRegistration,\n ExperienceTreeNode,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport { useMemo } from 'react';\nimport { useComponentProps } from './useComponentProps';\nimport { builtInComponents } from '@/types/constants';\nimport { ASSEMBLY_NODE_TYPE } from '@contentful/experiences-core/constants';\nimport { Assembly } from '@contentful/experiences-components-react';\nimport { resolveAssembly } from '@/utils/assemblyUtils';\nimport { componentRegistry, createAssemblyRegistration } from '@/store/registries';\nimport { useEntityStore } from '@/store/entityStore';\nimport type { RenderDropzoneFunction } from './Dropzone.types';\nimport { NoWrapDraggableProps } from '@components/Draggable/DraggableChildComponent';\n\ntype UseComponentProps = {\n node: ExperienceTreeNode;\n resolveDesignValue: ResolveDesignValueType;\n renderDropzone: RenderDropzoneFunction;\n userIsDragging: boolean;\n};\n\nexport const useComponent = ({\n node: rawNode,\n resolveDesignValue,\n renderDropzone,\n userIsDragging,\n}: UseComponentProps) => {\n const areEntitiesFetched = useEntityStore((state) => state.areEntitiesFetched);\n const entityStore = useEntityStore((state) => state.entityStore);\n\n const node = useMemo(() => {\n if (rawNode.type === ASSEMBLY_NODE_TYPE && areEntitiesFetched) {\n return resolveAssembly({\n node: rawNode,\n entityStore,\n });\n }\n\n return rawNode;\n }, [areEntitiesFetched, rawNode, entityStore]);\n\n const componentRegistration = useMemo(() => {\n const registration = componentRegistry.get(node.data.blockId as string);\n\n if (node.type === ASSEMBLY_NODE_TYPE && !registration) {\n return createAssemblyRegistration({\n definitionId: node.data.blockId as string,\n component: Assembly,\n }) as ComponentRegistration;\n } else if (!registration) {\n throw Error(\n `Component registration not found for component with id: \"${node.data.blockId}\". The component might of been removed. To proceed, remove the component manually from the layers tab.`,\n );\n }\n return registration as ComponentRegistration;\n }, [node]);\n\n const componentId = node.data.id;\n\n const { componentProps, wrapperProps } = useComponentProps({\n node,\n areEntitiesFetched,\n resolveDesignValue,\n renderDropzone,\n definition: componentRegistration.definition,\n userIsDragging,\n });\n\n // Only pass editor props to built-in components\n const { editorMode, renderDropzone: _renderDropzone, ...otherComponentProps } = componentProps;\n const elementToRender = builtInComponents.includes(node.data.blockId || '')\n ? (dragProps?: NoWrapDraggableProps) =>\n React.createElement(componentRegistration.component, { ...dragProps, ...componentProps })\n : node.type === ASSEMBLY_NODE_TYPE\n ? // Assembly.tsx requires renderDropzone and editorMode as well\n () => React.createElement(componentRegistration.component, componentProps)\n : () => React.createElement(componentRegistration.component, otherComponentProps);\n\n return {\n node,\n componentId,\n elementToRender,\n wrapperProps,\n definition: componentRegistration.definition,\n };\n};\n","import React from 'react';\nimport { CSSProperties, SyntheticEvent } from 'react';\nimport {\n Draggable,\n DraggableProvidedDragHandleProps,\n DraggableProvidedDraggableProps,\n} from '@hello-pangea/dnd';\nimport classNames from 'classnames';\nimport styles from './styles.module.css';\nimport { Rect } from '@components/Draggable/canvasToolsUtils';\nimport Tooltip from './Tooltip';\nimport {\n ComponentDefinition,\n ComponentDefinitionVariableType,\n} from '@contentful/experiences-core/types';\n\nexport type NoWrapDraggableProps = {\n ['data-ctfl-draggable-id']: string;\n wrapperClassName: string;\n Tooltip: React.ReactNode;\n innerRef: (element?: HTMLElement | null | undefined) => void;\n draggableProps: DraggableProvidedDraggableProps;\n dragHandleProps: DraggableProvidedDragHandleProps;\n style: CSSProperties;\n onClick: (e: SyntheticEvent<Element, Event>) => void;\n ['data-test-id']?: string;\n};\n\ntype DraggableChildComponentProps = {\n wrapperProps: Record<string, string | undefined>;\n elementToRender: (props: NoWrapDraggableProps) => JSX.Element;\n id: string;\n index: number;\n isAssemblyBlock?: boolean;\n isSelected?: boolean;\n onClick?: (e: SyntheticEvent) => void;\n coordinates: Rect | null;\n isContainer: boolean;\n blockId: string;\n userIsDragging?: boolean;\n style?: CSSProperties;\n isDragDisabled?: boolean;\n className?: string;\n definition: ComponentDefinition<ComponentDefinitionVariableType>;\n};\n\n/**\n * This component is meant to function the same as DraggableComponent except\n * with the difference that the draggable props are passed to the underlying\n * component. This removes an extra nexted `div` in editor mode that otherwise\n * is not visible in delivery mode.\n *\n * This is helpful for `flex` or `grid` layouts. Currently used by the SingleColumn\n * component.\n */\nexport const DraggableChildComponent: React.FC<DraggableChildComponentProps> = (props) => {\n const {\n elementToRender,\n id,\n index,\n isAssemblyBlock = false,\n isSelected = false,\n onClick = () => null,\n coordinates,\n userIsDragging,\n style,\n isContainer,\n blockId,\n isDragDisabled = false,\n wrapperProps,\n definition,\n } = props;\n\n return (\n <Draggable key={id} draggableId={id} index={index} isDragDisabled={isDragDisabled}>\n {(provided, snapshot) =>\n elementToRender({\n ['data-ctfl-draggable-id']: id,\n ['data-test-id']: `draggable-${blockId}`,\n innerRef: provided.innerRef,\n ...wrapperProps,\n draggableProps: provided.draggableProps,\n wrapperClassName: classNames(styles.DraggableComponent, wrapperProps.className, {\n [styles.isAssemblyBlock]: isAssemblyBlock,\n [styles.isDragging]: snapshot.isDragging,\n [styles.isSelected]: isSelected,\n [styles.userIsDragging]: userIsDragging,\n }),\n dragHandleProps: provided.dragHandleProps!,\n style: {\n ...style,\n ...provided.draggableProps.style,\n },\n onClick,\n Tooltip: (\n <Tooltip\n id={id}\n coordinates={coordinates}\n isAssemblyBlock={isAssemblyBlock}\n isContainer={isContainer}\n label={definition.name || 'No label specified'}\n />\n ),\n })\n }\n </Draggable>\n );\n};\n","import type { ExperienceTreeNode, ExperienceTree } from '@contentful/experiences-core/types';\nimport { ROOT_ID } from '../types/constants';\n\nexport type ItemSelector = {\n id: string;\n};\n\nfunction getItemFromTree(id: string, node: ExperienceTreeNode): ExperienceTreeNode | undefined {\n // Check if the current node's id matches the search id\n\n if (node.data.id === id) {\n return node;\n }\n\n // Recursively search through each child\n for (const child of node.children) {\n const foundNode = getItemFromTree(id, child);\n if (foundNode) {\n // Node found in children\n return foundNode;\n }\n }\n\n // If the node is not found in this branch of the tree, return undefined\n return undefined;\n}\n\nfunction findDepthById(node: ExperienceTreeNode, id: string, currentDepth: number = 1): number {\n if (node.data.id === id) {\n return currentDepth;\n }\n\n // If the node has children, check each one\n for (const child of node.children) {\n const childDepth = findDepthById(child, id, currentDepth + 1);\n if (childDepth !== -1) {\n return childDepth; // Found the node in a child\n }\n }\n\n return -1; // Node not found in this branch\n}\n\nexport const getChildFromTree = (\n parentId: string,\n index: number,\n node: ExperienceTreeNode,\n): ExperienceTreeNode | undefined => {\n // Check if the current node's id matches the search id\n\n if (node.data.id === parentId) {\n return node.children[index];\n }\n\n // Recursively search through each child\n for (const child of node.children) {\n const foundNode = getChildFromTree(parentId, index, child);\n if (foundNode) {\n // Node found in children\n return foundNode;\n }\n }\n\n // If the node is not found in this branch of the tree, return undefined\n return undefined;\n};\n\nexport const getItem = (\n selector: ItemSelector,\n tree: ExperienceTree,\n): ExperienceTreeNode | undefined => {\n return getItemFromTree(selector.id, {\n type: 'block',\n data: {\n id: ROOT_ID,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as any,\n children: tree.root.children,\n });\n};\n\nexport const getItemDepthFromNode = (selector: ItemSelector, node: ExperienceTreeNode): number => {\n return findDepthById(node, selector.id);\n};\n","import type { ExperienceTreeNode } from '@contentful/experiences-core/types';\nimport { isEqual } from 'lodash-es';\nimport { getChildFromTree } from './getItem';\n\nexport function updateNode(\n nodeId: string,\n updatedNode: ExperienceTreeNode,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === nodeId) {\n node.data = updatedNode.data;\n return;\n }\n\n node.children.forEach((childNode) => updateNode(nodeId, updatedNode, childNode));\n}\nexport function replaceNode(\n indexToReplace: number,\n updatedNode: ExperienceTreeNode,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === updatedNode.parentId) {\n node.children = [\n ...node.children.slice(0, indexToReplace),\n updatedNode,\n ...node.children.slice(indexToReplace + 1),\n ];\n return;\n }\n\n node.children.forEach((childNode) => replaceNode(indexToReplace, updatedNode, childNode));\n}\n\nexport function reorderChildrenNodes(\n nodeId: string,\n updatedChildren: ExperienceTreeNode[],\n node: ExperienceTreeNode,\n) {\n if (node.data.id === nodeId) {\n node.children = updatedChildren;\n return;\n }\n\n node.children.forEach((childNode) => reorderChildrenNodes(nodeId, updatedChildren, childNode));\n}\n\nexport function addChildToNode(\n nodeId: string,\n oldChildren: ExperienceTreeNode[],\n updatedChildren: ExperienceTreeNode[],\n node: ExperienceTreeNode,\n) {\n if (node.data.id !== nodeId) {\n node.children.forEach((childNode) =>\n addChildToNode(nodeId, oldChildren, updatedChildren, childNode),\n );\n }\n\n let changed = false;\n\n oldChildren.forEach((child, i) => {\n if (isEqual(child, updatedChildren[i])) {\n return;\n }\n\n changed = true;\n addChildNode(i, node.data.id, updatedChildren[i], node);\n });\n\n if (!changed) {\n // we iterated over the old children and didn't introduce a change.\n // that means the child node is added to the end of the array.\n addChildNode(\n oldChildren.length,\n node.data.id,\n updatedChildren[updatedChildren.length - 1],\n node,\n );\n }\n}\n\nexport function removeChildNode(\n indexToRemove: number,\n nodeId: string,\n parentNodeId: string,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === parentNodeId) {\n const childIndex = node.children.findIndex((child) => child.data.id === nodeId);\n\n node.children.splice(childIndex === -1 ? indexToRemove : childIndex, 1);\n return;\n }\n\n node.children.forEach((childNode) =>\n removeChildNode(indexToRemove, nodeId, parentNodeId, childNode),\n );\n}\n\nexport function addChildNode(\n indexToAdd: number,\n parentNodeId: string,\n nodeToAdd: ExperienceTreeNode,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === parentNodeId) {\n node.children = [\n ...node.children.slice(0, indexToAdd),\n nodeToAdd,\n ...node.children.slice(indexToAdd),\n ];\n\n return;\n }\n\n node.children.forEach((childNode) =>\n addChildNode(indexToAdd, parentNodeId, nodeToAdd, childNode),\n );\n}\n\nexport function reorderChildNode(\n oldIndex: number,\n newIndex: number,\n parentNodeId: string,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === parentNodeId) {\n // Remove the child from the old position\n const [childToMove] = node.children.splice(oldIndex, 1);\n\n // Insert the child at the new position\n node.children.splice(newIndex, 0, childToMove);\n return;\n }\n\n node.children.forEach((childNode) =>\n reorderChildNode(oldIndex, newIndex, parentNodeId, childNode),\n );\n}\n\nexport function reparentChildNode(\n oldIndex: number,\n newIndex: number,\n sourceNodeId: string,\n destinationNodeId: string,\n node: ExperienceTreeNode,\n) {\n const nodeToMove = getChildFromTree(sourceNodeId, oldIndex, node);\n\n if (!nodeToMove) {\n return;\n }\n\n removeChildNode(oldIndex, nodeToMove.data.id, sourceNodeId, node);\n addChildNode(newIndex, destinationNodeId, nodeToMove, node);\n}\n","import { ExperienceTreeNode, ExperienceTree } from '@contentful/experiences-core/types';\n\nimport { getItem } from './getItem';\nimport { isEqual } from 'lodash-es';\nimport { ROOT_ID, TreeAction } from '@/types/constants';\nimport { TreeDiff } from '@/types/treeActions';\n\ninterface MissingNodeActionParams {\n index: number;\n nodeAdded: boolean;\n tree: ExperienceTree;\n child: ExperienceTreeNode;\n currentNode: ExperienceTreeNode;\n parentNodeId: string;\n}\n\nfunction missingNodeAction({\n index,\n nodeAdded,\n child,\n tree,\n parentNodeId,\n currentNode,\n}: MissingNodeActionParams): TreeDiff | null {\n if (nodeAdded) {\n return { type: TreeAction.ADD_NODE, indexToAdd: index, nodeToAdd: child, parentNodeId };\n }\n\n const item = getItem({ id: child.data.id }, tree);\n\n if (item) {\n const parentNode = getItem({ id: item.parentId! }, tree);\n\n if (!parentNode) {\n return null;\n }\n const sourceIndex = parentNode.children.findIndex((c) => c.data.id === child.data.id);\n\n return { type: TreeAction.MOVE_NODE, sourceIndex, destinationIndex: index, parentNodeId };\n }\n\n return {\n type: TreeAction.REPLACE_NODE,\n originalId: currentNode.children[index].data.id,\n indexToReplace: index,\n node: child,\n };\n}\n\ninterface MatchingNodeActionParams {\n index: number;\n originalIndex: number;\n nodeAdded: boolean;\n nodeRemoved: boolean;\n parentNodeId: string;\n}\n\nfunction matchingNodeAction({\n index,\n originalIndex,\n nodeRemoved,\n nodeAdded,\n parentNodeId,\n}: MatchingNodeActionParams): TreeDiff | null {\n if (index !== originalIndex && !nodeRemoved && !nodeAdded) {\n return {\n type: TreeAction.REORDER_NODE,\n sourceIndex: originalIndex,\n destinationIndex: index,\n parentNodeId,\n };\n }\n\n return null;\n}\n\ninterface CompareNodeParams {\n currentNode?: ExperienceTreeNode;\n updatedNode?: ExperienceTreeNode;\n originalTree: ExperienceTree;\n differences: Array<TreeDiff | null>;\n}\n\nfunction compareNodes({\n currentNode,\n updatedNode,\n originalTree,\n differences = [],\n}: CompareNodeParams): Array<TreeDiff | null> {\n // In the end, this map contains the list of nodes that are not present\n // in the updated tree and must be removed\n const map = new Map<string, number>();\n\n if (!currentNode || !updatedNode) {\n return differences;\n }\n\n // On each tree level, consider only the children of the current node to differentiate between added, removed, or replaced case\n const currentNodeCount = currentNode.children.length;\n const updatedNodeCount = updatedNode.children.length;\n const nodeRemoved = currentNodeCount > updatedNodeCount;\n const nodeAdded = currentNodeCount < updatedNodeCount;\n const parentNodeId = updatedNode.data.id;\n const isRoot = currentNode.data.id === ROOT_ID;\n\n /**\n * The data of the current node has changed, we need to update\n * this node to reflect the data change. (design, content, unbound values)\n */\n if (!isRoot && !isEqual(currentNode.data, updatedNode.data)) {\n differences.push({\n type: TreeAction.UPDATE_NODE,\n nodeId: currentNode.data.id,\n node: updatedNode,\n });\n }\n\n // Map children of the first tree by their ID\n currentNode.children.forEach((child, index) => map.set(child.data.id, index));\n\n // Compare with the second tree\n updatedNode.children.forEach((child, index) => {\n const childId = child.data.id;\n // The original tree does not have this node in the updated tree.\n if (!map.has(childId)) {\n const diff = missingNodeAction({\n index,\n child,\n nodeAdded,\n parentNodeId,\n tree: originalTree,\n currentNode,\n });\n if (diff?.type === TreeAction.REPLACE_NODE) {\n // Remove it from the deletion map to avoid adding another REMOVE_NODE action\n map.delete(diff.originalId);\n }\n return differences.push(diff);\n }\n\n const originalIndex = map.get(childId)!;\n\n const diff = matchingNodeAction({\n index,\n originalIndex,\n nodeAdded,\n nodeRemoved,\n parentNodeId,\n });\n\n differences.push(diff);\n map.delete(childId);\n\n compareNodes({\n currentNode: currentNode.children[originalIndex],\n updatedNode: child,\n originalTree,\n differences,\n });\n });\n\n map.forEach((index, key) => {\n // If the node count of the entire tree doesn't signify\n // a node was removed, don't add that as a diff\n if (!nodeRemoved) {\n return;\n }\n // Remaining nodes in the map are removed in the second tree\n differences.push({\n type: TreeAction.REMOVE_NODE,\n indexToRemove: index,\n parentNodeId,\n idToRemove: key,\n });\n });\n\n return differences;\n}\n\nexport function getTreeDiffs(\n tree1: ExperienceTreeNode,\n tree2: ExperienceTreeNode,\n originalTree: ExperienceTree,\n): TreeDiff[] {\n const differences: TreeDiff[] = [];\n\n compareNodes({\n currentNode: tree1,\n updatedNode: tree2,\n originalTree,\n differences,\n });\n\n return differences.filter((diff) => diff) as TreeDiff[];\n}\n","type NodeWithChildren<T> = {\n children: T[];\n};\n\n/**\n * @deprecated in favor of one in 'core' package\n */\nexport function treeVisit<T extends NodeWithChildren<T>>(\n initialNode: T,\n onNode: (node: T, index: number, depth: number) => void,\n) {\n // returns last used index\n const _treeVisit = (currentNode: T, currentIndex: number, currentDepth: number): number => {\n // Copy children in case of onNode removing it as we pass the node by reference\n const children = [...currentNode.children];\n onNode(currentNode, currentIndex, currentDepth);\n let nextAvailableIndex = currentIndex + 1;\n const lastUsedIndex = currentIndex;\n for (const child of children) {\n const lastUsedIndex = _treeVisit(child, nextAvailableIndex, currentDepth + 1);\n nextAvailableIndex = lastUsedIndex + 1;\n }\n return lastUsedIndex;\n };\n _treeVisit(initialNode, 0, 0);\n}\n\n/**\n * Traverses all nodes of a tree and maps all of them.\n * Intuitively works similarly to Array.map().\n * When returning mapped object from the mapper function\n * you _do not_ need to return about `.children[]` field.\n * This field is automatically managed by the treeMap() function.\n *\n * You can map each node to whatever you want, but shouldn't\n * modify the structure of the tree from the mapping function.\n * @deprecated in favor of one in 'core' package\n */\nexport function treeMap<T extends NodeWithChildren<T>, U>(\n node: T,\n onNode: (node: T) => Omit<U, 'children'>,\n): U {\n // Copy children in case of onNode removing it as we pass the node by reference\n const children = [...node.children];\n const newNode = {\n ...onNode(node),\n children: children.map((child) => treeMap(child, onNode)),\n } as U;\n\n return newNode;\n}\n","import type {\n Breakpoint,\n ExperienceTreeNode,\n ExperienceTree,\n} from '@contentful/experiences-core/types';\nimport { ROOT_ID, TreeAction } from '@/types/constants';\nimport { create } from 'zustand';\nimport { produce } from 'immer';\nimport {\n addChildNode,\n removeChildNode,\n reorderChildNode,\n reparentChildNode,\n replaceNode,\n updateNode,\n} from '@/utils/treeHelpers';\nimport { getTreeDiffs } from '@/utils/getTreeDiff';\nimport { treeVisit } from '@/utils/treeTraversal';\nimport { ASSEMBLY_NODE_TYPE } from '@contentful/experiences-core/constants';\nexport interface TreeStore {\n tree: ExperienceTree;\n breakpoints: Breakpoint[];\n updateTree: (tree: ExperienceTree) => void;\n updateTreeForced: (tree: ExperienceTree) => void;\n updateNodesByUpdatedEntity: (entityId: string) => void;\n addChild: (\n destinationIndex: number,\n destinationParentId: string,\n node: ExperienceTreeNode,\n ) => void;\n reorderChildren: (\n destinationIndex: number,\n destinationParentId: string,\n sourceIndex: number,\n ) => void;\n reparentChild: (\n destinationIndex: number,\n destinationParentId: string,\n sourceIndex: number,\n sourceParentId: string,\n ) => void;\n}\n\nconst isAssemblyNode = (node: ExperienceTreeNode) => {\n return node.type === ASSEMBLY_NODE_TYPE;\n};\n\nexport const useTreeStore = create<TreeStore>((set, get) => ({\n tree: {\n root: {\n children: [],\n type: 'root',\n data: {\n breakpoints: [],\n dataSource: {},\n id: ROOT_ID,\n props: {},\n unboundValues: {},\n },\n },\n },\n breakpoints: [],\n\n updateNodesByUpdatedEntity: (entityId: string) => {\n set(\n produce((draftState: TreeStore) => {\n treeVisit(draftState.tree.root, (node) => {\n if (isAssemblyNode(node) && node.data.blockId === entityId) {\n // Cannot use `structuredClone()` as node is probably a Proxy object with weird references\n updateNode(node.data.id, cloneDeepAsPOJO(node), draftState.tree.root);\n return;\n }\n const dataSourceIds = Object.values(node.data.dataSource).map((link) => link.sys.id);\n if (dataSourceIds.includes(entityId)) {\n // Cannot use `structuredClone()` as node is probably a Proxy object with weird references\n updateNode(node.data.id, cloneDeepAsPOJO(node), draftState.tree.root);\n }\n });\n }),\n );\n },\n\n /**\n * NOTE: this is for debugging purposes only as it causes ugly canvas flash.\n *\n * Force updates entire tree. Usually shouldn't be used as updateTree()\n * uses smart update algorithm based on diffs. But for troubleshooting\n * you may want to force update the tree so leaving this in.\n */\n updateTreeForced: (tree) => {\n set({\n tree,\n // Breakpoints must be updated, as we receive completely new tree with possibly new breakpoints\n breakpoints: tree?.root?.data?.breakpoints || [],\n });\n },\n updateTree: (tree) => {\n const currentTree = get().tree;\n\n /**\n * If we simply update the tree as in:\n *\n * `state.tree = tree`\n *\n * we end up causing a lot of unnecesary rerenders which can lead to\n * flickering of the component layout. Instead, we use this function\n * to deteremine exactly which nodes in the tree changed and combined\n * with immer, we end up updating only the changed nodes instead of\n * rerendering the entire tree.\n */\n const treeDiff = getTreeDiffs({ ...currentTree.root }, { ...tree.root }, currentTree);\n\n // The current and updated tree are the same, no tree update required.\n if (!treeDiff.length) {\n console.debug(\n `[exp-builder.visual-editor::updateTree()]: During smart-diffing no diffs. Skipping tree update.`,\n );\n return;\n }\n\n set(\n produce((state: TreeStore) => {\n treeDiff.map((diff) => {\n switch (diff.type) {\n case TreeAction.ADD_NODE:\n addChildNode(diff.indexToAdd, diff.parentNodeId, diff.nodeToAdd, state.tree.root);\n break;\n case TreeAction.REPLACE_NODE:\n replaceNode(diff.indexToReplace, diff.node, state.tree.root);\n break;\n case TreeAction.UPDATE_NODE:\n updateNode(diff.nodeId, diff.node, state.tree.root);\n break;\n case TreeAction.REMOVE_NODE:\n removeChildNode(\n diff.indexToRemove,\n diff.idToRemove,\n diff.parentNodeId,\n state.tree.root,\n );\n break;\n case TreeAction.MOVE_NODE:\n case TreeAction.REORDER_NODE:\n state.tree = tree;\n break;\n default:\n break;\n }\n });\n\n state.breakpoints = tree?.root?.data?.breakpoints || [];\n }),\n );\n },\n addChild: (index, parentId, node) => {\n set(\n produce((state: TreeStore) => {\n addChildNode(index, parentId, node, state.tree.root);\n }),\n );\n },\n reorderChildren: (destinationIndex, destinationParentId, sourceIndex) => {\n set(\n produce((state: TreeStore) => {\n reorderChildNode(sourceIndex, destinationIndex, destinationParentId, state.tree.root);\n }),\n );\n },\n reparentChild: (destinationIndex, destinationParentId, sourceIndex, sourceParentId) => {\n set(\n produce((state: TreeStore) => {\n reparentChildNode(\n sourceIndex,\n destinationIndex,\n sourceParentId,\n destinationParentId,\n state.tree.root,\n );\n }),\n );\n },\n}));\n\n// Serialize and deserialize an object again to remove all functions and references.\n// Some people refer to this as \"Plain Old JavaScript Object\" (POJO) as it solely contains plain data.\nfunction cloneDeepAsPOJO(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n","import { Direction } from '@hello-pangea/dnd';\nimport { create } from 'zustand';\n\nimport { produce } from 'immer';\nexport interface Zone {\n id: string;\n direction: Direction;\n}\n\ninterface State {\n hoveringZone: string;\n zones: Record<string, Zone>;\n}\n\ninterface Actions {\n upsertZone: (id: string, data: Partial<Zone>) => void;\n setHoveringZone: (zoneId: string) => void;\n}\n\nexport const useZoneStore = create<Actions & State>()((set) => ({\n zones: {},\n hoveringZone: '',\n setHoveringZone(zoneId) {\n set({\n hoveringZone: zoneId,\n });\n },\n upsertZone(id, data) {\n set(\n produce((state) => {\n state.zones[id] = { ...(state.zones[id] || {}), ...data };\n }),\n );\n },\n}));\n","import { DRAGGABLE_HEIGHT, DRAGGABLE_WIDTH, HITBOX, HitboxDirection } from '@/types/constants';\nimport { CSSProperties } from '@contentful/experiences-core/types';\n\nconst { WIDTH, HEIGHT, INITIAL_OFFSET, OFFSET_INCREMENT, MIN_HEIGHT, MIN_DEPTH_HEIGHT, DEEP_ZONE } =\n HITBOX;\n\ninterface Params {\n direction: HitboxDirection;\n domRect?: DOMRect;\n zoneDepth: number;\n scrollY: number;\n}\n\nconst calcOffsetDepth = (depth: number) => {\n return INITIAL_OFFSET - OFFSET_INCREMENT * depth;\n};\n\nexport const getHitboxStyles = ({ direction, zoneDepth, domRect }: Params): CSSProperties => {\n if (!domRect) {\n return {\n display: 'none',\n };\n }\n\n const { width, height, top, left, bottom, right } = domRect;\n\n const MAX_SELF_HEIGHT = DRAGGABLE_HEIGHT * 2;\n\n const isDeepZone = zoneDepth > DEEP_ZONE;\n const isAboveMaxHeight = height > MAX_SELF_HEIGHT;\n\n switch (direction) {\n case HitboxDirection.TOP:\n return {\n width,\n height: HEIGHT,\n top: top - calcOffsetDepth(zoneDepth) - scrollY,\n left,\n zIndex: 100 + zoneDepth,\n };\n case HitboxDirection.BOTTOM:\n return {\n width,\n height: HEIGHT,\n top: bottom + calcOffsetDepth(zoneDepth) - scrollY,\n left,\n zIndex: 100 + zoneDepth,\n };\n case HitboxDirection.LEFT:\n return {\n width: WIDTH,\n height: height - HEIGHT,\n left: left - calcOffsetDepth(zoneDepth) - WIDTH / 2,\n top: top + HEIGHT / 2 - scrollY,\n zIndex: 100 + zoneDepth,\n };\n case HitboxDirection.RIGHT:\n return {\n width: WIDTH,\n height: height - HEIGHT,\n left: right - calcOffsetDepth(zoneDepth) - WIDTH / 2,\n top: top + HEIGHT / 2 - scrollY,\n zIndex: 100 + zoneDepth,\n };\n case HitboxDirection.SELF_VERTICAL: {\n if (isAboveMaxHeight && !isDeepZone) {\n return { display: 'none' };\n }\n\n const selfHeight = isDeepZone ? MIN_DEPTH_HEIGHT : MIN_HEIGHT;\n return {\n width,\n height: selfHeight,\n left,\n top: top + height / 2 - selfHeight / 2 - scrollY,\n zIndex: 1000 + zoneDepth,\n };\n }\n case HitboxDirection.SELF_HORIZONTAL: {\n if (width > DRAGGABLE_WIDTH) {\n return { display: 'none' };\n }\n return {\n width: width - DRAGGABLE_WIDTH * 2,\n height,\n left: left + (DRAGGABLE_WIDTH * 2) / 2,\n top: top - scrollY,\n zIndex: 1000 + zoneDepth,\n };\n }\n default:\n return {};\n }\n};\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport styles from './styles.module.css';\nimport { useTreeStore } from '@/store/tree';\nimport { getItemDepthFromNode } from '@/utils/getItem';\nimport { CTFL_ZONE_ID, HitboxDirection, ROOT_ID } from '@/types/constants';\nimport { useZoneStore } from '@/store/zone';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport { createPortal } from 'react-dom';\nimport { getHitboxStyles } from '@/utils/getHitboxStyles';\n\ninterface Props {\n parentZoneId: string;\n zoneId: string;\n enableRootHitboxes: boolean;\n}\n\nconst Hitboxes: React.FC<Props> = ({ zoneId, parentZoneId, enableRootHitboxes }) => {\n const tree = useTreeStore((state) => state.tree);\n const isDraggingOnCanvas = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n const scrollY = useDraggedItemStore((state) => state.scrollY);\n const zoneDepth = useMemo(\n () => getItemDepthFromNode({ id: parentZoneId }, tree.root),\n [tree, parentZoneId],\n );\n const [fetchDomRect, setFetchDomRect] = useState(Date.now());\n\n useEffect(() => {\n /**\n * A bit hacky but we need to wait a very small amount\n * of time to fetch the dom getBoundingClientRect once a\n * drag starts because we need pre-drag styles like padding\n * applied before we calculate positions of hitboxes\n */\n setTimeout(() => {\n setFetchDomRect(Date.now());\n }, 50);\n }, [isDraggingOnCanvas]);\n\n const hitboxContainer = useMemo(() => {\n return document.querySelector('[data-ctfl-hitboxes]');\n }, []);\n\n const domRect = useMemo(() => {\n return document.querySelector(`[${CTFL_ZONE_ID}=\"${zoneId}\"]`)?.getBoundingClientRect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [zoneId, fetchDomRect]);\n\n const zones = useZoneStore((state) => state.zones);\n\n const zoneDirection = zones[parentZoneId]?.direction || 'vertical';\n const isVertical = zoneDirection === 'vertical';\n const isRoot = parentZoneId === ROOT_ID;\n const showRootHitboxes = isRoot && enableRootHitboxes;\n\n const getStyles = useCallback(\n (direction: HitboxDirection) => getHitboxStyles({ direction, zoneDepth, domRect, scrollY }),\n [zoneDepth, domRect, scrollY],\n );\n\n const ActiveHitboxes = (\n <>\n <div\n data-ctfl-zone-id={zoneId}\n className={styles.hitbox}\n style={getStyles(\n isVertical ? HitboxDirection.SELF_VERTICAL : HitboxDirection.SELF_HORIZONTAL,\n )}\n />\n {showRootHitboxes && (\n <div\n data-ctfl-zone-id={parentZoneId}\n className={styles.hitbox}\n style={getStyles(HitboxDirection.BOTTOM)}\n />\n )}\n {!isRoot && (\n <>\n <div\n data-ctfl-zone-id={parentZoneId}\n className={styles.hitbox}\n style={getStyles(isVertical ? HitboxDirection.TOP : HitboxDirection.LEFT)}\n />\n <div\n data-ctfl-zone-id={parentZoneId}\n className={styles.hitbox}\n style={getStyles(isVertical ? HitboxDirection.BOTTOM : HitboxDirection.RIGHT)}\n />\n </>\n )}\n </>\n );\n\n if (!hitboxContainer) {\n return null;\n }\n return createPortal(ActiveHitboxes, hitboxContainer);\n};\n\nexport default Hitboxes;\n","import React from 'react';\nimport { DraggableComponent } from '../Draggable/DraggableComponent';\nimport { isContentfulStructureComponent, sendMessage } from '@contentful/experiences-core';\nimport { useSelectedInstanceCoordinates } from '@/hooks/useSelectedInstanceCoordinates';\nimport { useEditorStore } from '@/store/editor';\nimport { useComponent } from './useComponent';\nimport type {\n ExperienceTreeNode,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport {\n CONTENTFUL_COMPONENTS,\n ASSEMBLY_BLOCK_NODE_TYPE,\n OUTGOING_EVENTS,\n ASSEMBLY_NODE_TYPE,\n} from '@contentful/experiences-core/constants';\nimport { DraggableChildComponent } from '@components/Draggable/DraggableChildComponent';\nimport { RenderDropzoneFunction } from './Dropzone.types';\nimport { PlaceholderParams } from '@components/Draggable/Placeholder';\nimport { ROOT_ID } from '@/types/constants';\nimport Hitboxes from './Hitboxes';\n\ntype EditorBlockProps = {\n placeholder: PlaceholderParams;\n node: ExperienceTreeNode;\n index: number;\n userIsDragging: boolean;\n draggingNewComponent: boolean | undefined;\n resolveDesignValue: ResolveDesignValueType;\n renderDropzone: RenderDropzoneFunction;\n zoneId: string;\n};\n\nexport const EditorBlock: React.FC<EditorBlockProps> = ({\n node: rawNode,\n resolveDesignValue,\n renderDropzone,\n draggingNewComponent,\n index,\n zoneId,\n userIsDragging,\n placeholder,\n}) => {\n const setSelectedNodeId = useEditorStore((state) => state.setSelectedNodeId);\n const selectedNodeId = useEditorStore((state) => state.selectedNodeId);\n const { node, componentId, wrapperProps, definition, elementToRender } = useComponent({\n node: rawNode,\n resolveDesignValue,\n renderDropzone,\n userIsDragging,\n });\n\n const coordinates = useSelectedInstanceCoordinates({ node });\n\n const isContainer = node.data.blockId === CONTENTFUL_COMPONENTS.container.id;\n const isSingleColumn = node.data.blockId === CONTENTFUL_COMPONENTS.singleColumn.id;\n const isAssemblyBlock = node.type === ASSEMBLY_BLOCK_NODE_TYPE;\n const isAssembly = node.type === ASSEMBLY_NODE_TYPE;\n const isStructureComponent = isContentfulStructureComponent(node.data.blockId);\n const isRootComponent = zoneId === ROOT_ID;\n\n const enableRootHitboxes = isRootComponent && !!draggingNewComponent;\n\n const onClick = (e: React.SyntheticEvent<Element, Event>) => {\n e.stopPropagation();\n\n if (!userIsDragging) {\n setSelectedNodeId(node.data.id);\n // if it is the assembly directly we just want to select it as a normal component\n if (isAssembly) {\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: node.data.id,\n });\n return;\n }\n\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n assembly: node.data.assembly,\n nodeId: node.data.id,\n });\n }\n };\n\n if (node.data.blockId === CONTENTFUL_COMPONENTS.singleColumn.id) {\n return (\n <>\n <DraggableChildComponent\n elementToRender={elementToRender}\n id={componentId}\n index={index}\n isAssemblyBlock={isAssemblyBlock}\n isDragDisabled={isSingleColumn}\n isSelected={selectedNodeId === componentId}\n userIsDragging={userIsDragging}\n isContainer={isContainer}\n blockId={node.data.blockId}\n coordinates={coordinates!}\n wrapperProps={wrapperProps}\n onClick={onClick}\n definition={definition}\n />\n {isStructureComponent && !isSingleColumn && userIsDragging && (\n <Hitboxes\n parentZoneId={zoneId}\n zoneId={componentId}\n enableRootHitboxes={enableRootHitboxes}\n />\n )}\n </>\n );\n }\n\n return (\n <DraggableComponent\n placeholder={placeholder}\n definition={definition}\n id={componentId}\n index={index}\n isAssemblyBlock={isAssemblyBlock}\n isDragDisabled={isAssemblyBlock}\n isSelected={selectedNodeId === componentId}\n userIsDragging={userIsDragging}\n isContainer={isContainer}\n blockId={node.data.blockId}\n coordinates={coordinates!}\n wrapperProps={wrapperProps}\n onClick={onClick}>\n {elementToRender()}\n {isStructureComponent && !isSingleColumn && userIsDragging && (\n <Hitboxes\n parentZoneId={zoneId}\n zoneId={componentId}\n enableRootHitboxes={enableRootHitboxes}\n />\n )}\n </DraggableComponent>\n );\n};\n","import React from 'react';\nimport styles from './EmptyContainer.module.css';\nimport classNames from 'classnames';\n\nexport interface EmptyContainerProps {\n isFirst?: boolean;\n isDragging?: boolean;\n isHoveringOnRoot?: boolean;\n}\n\nexport const EmptyContainer = ({ isDragging }: EmptyContainerProps) => {\n return (\n <div\n className={classNames(styles.container, {\n [styles.highlight]: isDragging,\n })}\n data-type=\"empty-container\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"37\"\n height=\"36\"\n fill=\"none\"\n className={styles.icon}>\n <rect\n width=\"11.676\"\n height=\"11.676\"\n x=\"18.512\"\n y=\".153\"\n rx=\"1.621\"\n transform=\"rotate(45 18.512 .153)\"\n />\n <rect\n width=\"11.676\"\n height=\"11.676\"\n x=\"9.254\"\n y=\"9.139\"\n rx=\"1.621\"\n transform=\"rotate(45 9.254 9.139)\"\n />\n <rect\n width=\"11.676\"\n height=\"11.676\"\n x=\"18.011\"\n y=\"18.625\"\n rx=\"1.621\"\n transform=\"rotate(45 18.01 18.625)\"\n />\n <rect\n width=\"11.676\"\n height=\"11.676\"\n x=\"30.557\"\n y=\"10.131\"\n rx=\"1.621\"\n transform=\"rotate(60 30.557 10.13)\"\n />\n <path\n fill=\"#fff\"\n stroke=\"#fff\"\n strokeWidth=\".243\"\n d=\"M31.113 17.038a.463.463 0 0 0-.683-.517l-1.763 1.032-1.033-1.763a.464.464 0 0 0-.8.469l1.034 1.763-1.763 1.033a.463.463 0 1 0 .468.8l1.763-1.033 1.033 1.763a.463.463 0 1 0 .8-.469l-1.033-1.763 1.763-1.033a.463.463 0 0 0 .214-.282Z\"\n />\n </svg>\n\n <span className={styles.label}>Add components to begin</span>\n </div>\n );\n};\n","import { ROOT_ID } from '../types/constants';\n\nexport const getZoneParents = (zoneId: string) => {\n const element = document.querySelector(`[data-rfd-droppable-id='${zoneId}']`);\n\n if (!element) {\n return [];\n }\n\n function getZonesToRoot(element: Element | null, parentIds: string[] = []) {\n if (!element) {\n return parentIds;\n }\n\n const attribute = element.getAttribute('data-rfd-droppable-id');\n\n if (attribute === ROOT_ID) {\n return parentIds;\n }\n\n if (attribute) {\n parentIds.push(attribute);\n }\n\n return getZonesToRoot(element.parentElement, parentIds);\n }\n\n return getZonesToRoot(element);\n};\n","import { CONTENTFUL_COMPONENTS } from '@contentful/experiences-core/constants';\nimport type {\n ExperienceTreeNode,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport { useEffect } from 'react';\nimport { useZoneStore } from '@/store/zone';\nimport { isContentfulStructureComponent } from '@contentful/experiences-core';\n\ninterface Params {\n resolveDesignValue: ResolveDesignValueType | undefined;\n node: ExperienceTreeNode | undefined;\n zoneId: string;\n}\n\nexport const useDropzoneDirection = ({ resolveDesignValue, node, zoneId }: Params) => {\n const zone = useZoneStore((state) => state.zones);\n const upsertZone = useZoneStore((state) => state.upsertZone);\n\n useEffect(() => {\n function getDirection() {\n if (!node || !node.data.blockId) {\n return 'vertical';\n }\n\n if (!isContentfulStructureComponent(node.data.blockId)) {\n return 'vertical';\n }\n\n if (node.data.blockId === CONTENTFUL_COMPONENTS.columns.id) {\n return 'horizontal';\n }\n\n const designValues = node.data.props['cfFlexDirection'];\n\n if (!designValues || !resolveDesignValue || designValues.type !== 'DesignValue') {\n return 'vertical';\n }\n\n const direction = resolveDesignValue(designValues.valuesByBreakpoint, 'cfFlexDirection');\n\n if (direction === 'row') {\n return 'horizontal';\n }\n\n return 'vertical';\n }\n\n upsertZone(zoneId, { direction: getDirection() });\n }, [node, resolveDesignValue, zoneId, upsertZone]);\n\n return zone[zoneId]?.direction || 'vertical';\n};\n","import React, { CSSProperties } from 'react';\nimport styles from '../Draggable/styles.module.css';\nimport { useComponent } from './useComponent';\nimport type {\n ExperienceTreeNode,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport { RenderDropzoneFunction } from './Dropzone.types';\nimport { DraggableProvided, DraggableStateSnapshot } from '@hello-pangea/dnd';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport {\n ASSEMBLY_BLOCK_NODE_TYPE,\n CONTENTFUL_COMPONENTS,\n} from '@contentful/experiences-core/constants';\nimport classNames from 'classnames';\n\nfunction getStyle(style: CSSProperties = {}, snapshot?: DraggableStateSnapshot) {\n if (!snapshot?.isDropAnimating) {\n return style;\n }\n\n return {\n ...style,\n // cannot be 0, but make it super tiny\n transitionDuration: `0.001s`,\n };\n}\n\ntype EditorBlockCloneProps = {\n node: ExperienceTreeNode;\n resolveDesignValue: ResolveDesignValueType;\n provided?: DraggableProvided;\n snapshot?: DraggableStateSnapshot;\n renderDropzone: RenderDropzoneFunction;\n};\n\nexport const EditorBlockClone: React.FC<EditorBlockCloneProps> = ({\n node: rawNode,\n resolveDesignValue,\n snapshot,\n provided,\n renderDropzone,\n}) => {\n const userIsDragging = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n\n const { node, wrapperProps, elementToRender } = useComponent({\n node: rawNode,\n resolveDesignValue,\n renderDropzone,\n userIsDragging,\n });\n\n const isAssemblyBlock = node.type === ASSEMBLY_BLOCK_NODE_TYPE;\n const isSingleColumn = node.data.blockId === CONTENTFUL_COMPONENTS.singleColumn.id;\n\n if (isSingleColumn) {\n return elementToRender();\n }\n\n return (\n <div\n ref={provided?.innerRef}\n data-ctfl-dragging-element\n {...wrapperProps}\n {...provided?.draggableProps}\n {...provided?.dragHandleProps}\n className={classNames(\n styles.DraggableComponent,\n wrapperProps.className,\n styles.DraggableClone,\n {\n [styles.isAssemblyBlock]: isAssemblyBlock,\n [styles.isDragging]: snapshot?.isDragging,\n },\n )}\n style={getStyle(provided?.draggableProps.style, snapshot)}>\n {elementToRender()}\n </div>\n );\n};\n","import React, { ElementType } from 'react';\nimport type { ResolveDesignValueType } from '@contentful/experiences-core/types';\nimport { ComponentData } from '@/types/Config';\nimport { useTreeStore } from '@/store/tree';\nimport styles from './styles.module.css';\nimport classNames from 'classnames';\nimport { ROOT_ID } from '@/types/constants';\n\nimport { RenderDropzoneFunction } from './Dropzone.types';\nimport { EditorBlockClone } from './EditorBlockClone';\n\ntype DropzoneProps = {\n zoneId: string;\n node?: ComponentData;\n resolveDesignValue?: ResolveDesignValueType;\n className?: string;\n WrapperComponent?: ElementType | string;\n renderDropzone: RenderDropzoneFunction;\n};\n\nexport function DropzoneClone({\n node,\n zoneId,\n resolveDesignValue,\n className,\n WrapperComponent = 'div',\n renderDropzone,\n ...rest\n}: DropzoneProps) {\n const tree = useTreeStore((state) => state.tree);\n const content = node?.children || tree.root?.children || [];\n\n const isRootZone = zoneId === ROOT_ID;\n\n if (!resolveDesignValue) {\n return null;\n }\n\n return (\n <WrapperComponent\n className={classNames(\n styles.container,\n {\n [styles.isRoot]: isRootZone,\n [styles.isEmptyZone]: !content.length,\n },\n className,\n )}\n node={node}\n {...rest}>\n {content.map((item) => {\n const componentId = item.data.id;\n\n return (\n <EditorBlockClone\n key={componentId}\n node={item}\n resolveDesignValue={resolveDesignValue}\n renderDropzone={renderDropzone}\n />\n );\n })}\n </WrapperComponent>\n );\n}\n","import React, { ElementType, useCallback } from 'react';\nimport { Droppable } from '@hello-pangea/dnd';\nimport type { ResolveDesignValueType } from '@contentful/experiences-core/types';\nimport { EditorBlock } from './EditorBlock';\nimport { ComponentData } from '@/types/Config';\nimport { useTreeStore } from '@/store/tree';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport styles from './styles.module.css';\nimport classNames from 'classnames';\nimport { ROOT_ID } from '@/types/constants';\nimport { EmptyContainer } from '@components/EmptyContainer/EmptyContainer';\nimport { getZoneParents } from '@/utils/zone';\nimport { useZoneStore } from '@/store/zone';\nimport { useDropzoneDirection } from '@/hooks/useDropzoneDirection';\nimport { ASSEMBLY_NODE_TYPES, CONTENTFUL_COMPONENTS } from '@contentful/experiences-core/constants';\nimport { RenderDropzoneFunction } from './Dropzone.types';\nimport { EditorBlockClone } from './EditorBlockClone';\nimport { DropzoneClone } from './DropzoneClone';\n\ntype DropzoneProps = {\n zoneId: string;\n node?: ComponentData;\n resolveDesignValue?: ResolveDesignValueType;\n className?: string;\n WrapperComponent?: ElementType | string;\n};\n\nexport function Dropzone({\n node,\n zoneId,\n resolveDesignValue,\n className,\n WrapperComponent = 'div',\n ...rest\n}: DropzoneProps) {\n const userIsDragging = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n const draggedItem = useDraggedItemStore((state) => state.draggedItem);\n const newComponentId = useDraggedItemStore((state) => state.componentId);\n const hoveringZone = useZoneStore((state) => state.hoveringZone);\n const tree = useTreeStore((state) => state.tree);\n const content = node?.children || tree.root?.children || [];\n\n const direction = useDropzoneDirection({ resolveDesignValue, node, zoneId });\n\n const draggedSourceId = draggedItem && draggedItem.source.droppableId;\n const draggedDestinationId = draggedItem && draggedItem.destination?.droppableId;\n\n const isDraggingNewComponent = !!newComponentId;\n const isHoveringZone = hoveringZone === zoneId;\n const isRootZone = zoneId === ROOT_ID;\n const isDestination = draggedDestinationId === zoneId;\n const isEmptyCanvas = isRootZone && !content.length;\n\n const isAssembly = ASSEMBLY_NODE_TYPES.includes(node?.type || '');\n\n // To avoid a circular dependency, we create the recursive rendering function here and trickle it down\n const renderDropzone: RenderDropzoneFunction = useCallback(\n (node, props) => {\n return (\n <Dropzone\n zoneId={node.data.id}\n node={node}\n resolveDesignValue={resolveDesignValue}\n {...props}\n />\n );\n },\n [resolveDesignValue],\n );\n\n const renderClonedDropzone: RenderDropzoneFunction = useCallback(\n (node, props) => {\n return (\n <DropzoneClone\n zoneId={node.data.id}\n node={node}\n resolveDesignValue={resolveDesignValue}\n renderDropzone={renderClonedDropzone}\n {...props}\n />\n );\n },\n [resolveDesignValue],\n );\n\n if (!resolveDesignValue) {\n return null;\n }\n\n /**\n * The Rules of Dropzones\n *\n * 1. A dropzone is disabled unless the mouse is hovering over it\n *\n * 2. Dragging a new component onto the canvas has no addtional rules\n * besides rule #1\n *\n * 3. Dragging a component that is a direct descendant of the root\n * (parentId === ROOT_ID) then only the Root Dropzone is enabled\n *\n * 4. Dragging a nested component (parentId !== ROOT_ID) then the Root\n * Dropzone is disabled, all other Dropzones follow rule #1\n *\n * 5. Assemblies and the SingleColumn component are always disabled\n *\n */\n const isDropzoneEnabled = () => {\n if (node?.data.blockId === CONTENTFUL_COMPONENTS.columns.id) {\n return false;\n }\n\n if (isAssembly) {\n return false;\n }\n\n if (isDraggingNewComponent) {\n return isHoveringZone;\n }\n\n const draggingParentIds = getZoneParents(draggedSourceId || '');\n\n if (!draggingParentIds.length) {\n return isRootZone;\n }\n\n return isHoveringZone && !isRootZone;\n };\n\n return (\n <Droppable\n droppableId={zoneId}\n direction={direction}\n isDropDisabled={!isDropzoneEnabled()}\n renderClone={(provided, snapshot, rubic) => (\n <EditorBlockClone\n node={content[rubic.source.index]}\n resolveDesignValue={resolveDesignValue}\n provided={provided}\n snapshot={snapshot}\n renderDropzone={renderClonedDropzone}\n />\n )}>\n {(provided, snapshot) => {\n return (\n <WrapperComponent\n {...(provided || { droppableProps: {} }).droppableProps}\n ref={provided?.innerRef}\n id={zoneId}\n data-ctfl-zone-id={zoneId}\n className={classNames(\n styles.container,\n {\n [styles.isEmptyCanvas]: isEmptyCanvas,\n [styles.isDragging]: userIsDragging && !isAssembly,\n [styles.isDestination]: isDestination && !isAssembly,\n [styles.isRoot]: isRootZone,\n [styles.isEmptyZone]: !content.length,\n },\n className,\n )}\n node={node}\n {...rest}>\n {isEmptyCanvas ? (\n <EmptyContainer isDragging={isRootZone && userIsDragging} />\n ) : (\n content.map((item, i) => {\n const componentId = item.data.id;\n\n return (\n <EditorBlock\n placeholder={{\n isDraggingOver: snapshot?.isDraggingOver,\n totalIndexes: content.length,\n elementIndex: i,\n dropzoneElementId: zoneId,\n direction,\n }}\n index={i}\n zoneId={zoneId}\n key={componentId}\n userIsDragging={userIsDragging}\n draggingNewComponent={isDraggingNewComponent}\n node={item}\n resolveDesignValue={resolveDesignValue}\n renderDropzone={renderDropzone}\n />\n );\n })\n )}\n {provided?.placeholder}\n </WrapperComponent>\n );\n }}\n </Droppable>\n );\n}\n","import useDraggablePosition from '@/hooks/useDraggablePosition';\nimport {\n COMPONENT_LIST_ID,\n DRAGGABLE_HEIGHT,\n DRAGGABLE_WIDTH,\n DraggablePosition,\n NEW_COMPONENT_ID,\n} from '@/types/constants';\nimport { Draggable, Droppable } from '@hello-pangea/dnd';\nimport React, { useRef } from 'react';\n\ninterface Props {\n id: string;\n}\n\nfunction getStyle(style, snapshot) {\n if (!snapshot.isDropAnimating) {\n return style;\n }\n return {\n ...style,\n // cannot be 0, but make it super tiny\n transitionDuration: `0.001s`,\n };\n}\n\nconst DraggableContainer: React.FC<Props> = ({ id }) => {\n const ref = useRef<HTMLElement | null>(null);\n\n useDraggablePosition({\n draggableId: id,\n draggableRef: ref,\n position: DraggablePosition.CENTERED,\n });\n\n return (\n <div\n id={COMPONENT_LIST_ID}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n pointerEvents: 'none',\n zIndex: -1,\n }}>\n <Droppable droppableId={COMPONENT_LIST_ID} isDropDisabled>\n {(provided) => (\n <div {...provided.droppableProps} ref={provided.innerRef}>\n <Draggable draggableId={id} key={id} index={0}>\n {(provided, snapshot) => (\n <div\n id={NEW_COMPONENT_ID}\n data-ctfl-dragging-element\n ref={(node) => {\n provided.innerRef(node);\n ref.current = node;\n }}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n style={{\n ...getStyle(provided.draggableProps.style, snapshot),\n width: DRAGGABLE_WIDTH,\n height: DRAGGABLE_HEIGHT,\n pointerEvents: 'none',\n }}\n />\n )}\n </Draggable>\n {provided.placeholder}\n </div>\n )}\n </Droppable>\n </div>\n );\n};\n\nexport default DraggableContainer;\n","import type {\n ValuesByBreakpoint,\n Breakpoint,\n PrimitiveValue,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport {\n mediaQueryMatcher,\n getFallbackBreakpointIndex,\n getActiveBreakpointIndex,\n getValueForBreakpoint,\n} from '@contentful/experiences-core';\nimport { useCallback, useEffect, useState } from 'react';\n\n// TODO: In order to support integrations without React, we should extract this heavy logic into simple\n// functions that we can reuse in other frameworks.\n\n/*\n * Registers media query change listeners for each breakpoint (except for \"*\").\n * It will always assume the last matching media query in the list. It therefore,\n * assumes that the breakpoints are sorted beginning with the default value (query: \"*\")\n * and then decending by screen width. For mobile-first designs, the order would be ascending\n */\nexport const useBreakpoints = (breakpoints: Breakpoint[]) => {\n const [mediaQueryMatches, setMediaQueryMatches] = useState<Record<string, boolean>>({});\n\n const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);\n\n // Register event listeners to update the media query states\n useEffect(() => {\n const [mediaQueryMatchers, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);\n // Store the media query state in the beginning to initialise the state\n setMediaQueryMatches(initialMediaQueryMatches);\n const eventListeners = mediaQueryMatchers.map(({ id, signal }) => {\n const onChange = () =>\n setMediaQueryMatches((prev) => ({\n ...prev,\n [id]: signal.matches,\n }));\n\n signal.addEventListener('change', onChange);\n return onChange;\n });\n\n return () => {\n eventListeners.forEach((eventListener, index) => {\n mediaQueryMatchers[index].signal.removeEventListener('change', eventListener);\n });\n };\n // Only re-setup all listeners when the breakpoint definition changed\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [breakpoints]);\n\n const activeBreakpointIndex = getActiveBreakpointIndex(\n breakpoints,\n mediaQueryMatches,\n fallbackBreakpointIndex,\n );\n\n const resolveDesignValue: ResolveDesignValueType = useCallback(\n (valuesByBreakpoint: ValuesByBreakpoint, variableName: string): PrimitiveValue => {\n return getValueForBreakpoint(\n valuesByBreakpoint,\n breakpoints,\n activeBreakpointIndex,\n variableName,\n );\n },\n [activeBreakpointIndex, breakpoints],\n );\n\n return { resolveDesignValue };\n};\n","import type { HoveredElement } from '@contentful/experiences-core/types';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { ASSEMBLY_NODE_TYPE, OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\nexport class MouseOverHandler {\n private currentHoveredElementId: string | null = null;\n\n private getMargins = (element: HTMLElement) => {\n if (typeof window === 'undefined') return undefined;\n const styles = window.getComputedStyle(element);\n const top = parseInt(styles.marginTop);\n const bottom = parseInt(styles.marginBottom);\n const left = parseInt(styles.marginLeft);\n const right = parseInt(styles.marginRight);\n\n return { top, bottom, left, right };\n };\n\n private getBoundingClientRect(element: Element) {\n const isAssembly = element.getAttribute('data-cf-node-block-type') === ASSEMBLY_NODE_TYPE;\n if (!isAssembly) {\n return element.getBoundingClientRect();\n } else {\n // As we use `display: contents` for assemblies, there is no real \"block\"\n // in the DOM and thus the browser fails to calculate the bounding rect.\n // Instead, we calculate it for each child and add it up:\n if (!element.firstElementChild) {\n return { left: 0, top: 0, width: 0, height: 0 };\n }\n const firstChildRect = element.firstElementChild.getBoundingClientRect();\n let fullHeight = firstChildRect.height;\n let nextChild = element.firstElementChild.nextElementSibling;\n while (nextChild) {\n const nextChildRect = nextChild.getBoundingClientRect();\n fullHeight += nextChildRect.height;\n nextChild = nextChild.nextElementSibling;\n }\n // The root of a assembly positions its first level containers vertically.\n // So we just need to add up the height and use the remaining properties from the first child.\n return {\n left: firstChildRect.left,\n top: firstChildRect.top,\n width: firstChildRect.width,\n height: fullHeight,\n };\n }\n }\n\n private getFullCoordinates = (element: HTMLElement) => {\n const validChildren = Array.from(element.children).filter(\n (child) => child instanceof HTMLElement && child.dataset.cfNodeBlockType === 'block',\n );\n\n const { left, top, width, height } = this.getBoundingClientRect(element);\n const margins = this.getMargins(element);\n\n const childrenCoordinates = validChildren.map((child) => {\n const { left, top, width, height } = this.getBoundingClientRect(child);\n\n return { left, top, width, height, margins };\n });\n\n return {\n left,\n top,\n width,\n height,\n margins,\n childrenCoordinates,\n };\n };\n\n private getClosestComponentInformation = (\n element: HTMLElement | null,\n ): [HTMLElement | null, HoveredElement] | undefined => {\n let target = element;\n\n // If the target is outside on the root or anywhere else on the iframes body\n if (target?.id === 'VisualEditorRoot' || target?.tagName === 'BODY') {\n const rootElement = document.getElementById('VisualEditorRoot');\n const hoveredRootElement = {\n nodeId: 'root',\n blockType: 'root',\n blockId: 'root',\n };\n return [rootElement, hoveredRootElement];\n }\n // Find the closest contentful container or direct parent that is a contentful container\n while (target) {\n if (\n // is itself a section?\n target.dataset.cfNodeId ||\n // Or a direct child of a section\n (target.parentElement && target.parentElement.dataset.cfNodeBlockId === 'ContentfulSection')\n ) {\n const sectionId = target.dataset.cfNodeId;\n const sectionBlockId = target.dataset.cfNodeBlockId;\n const sectionBlockType = target.dataset.cfNodeBlockType;\n\n const hoveredElement = {\n nodeId: sectionId,\n blockId: sectionBlockId,\n blockType: sectionBlockType,\n };\n\n return [target, hoveredElement];\n\n break;\n }\n\n target = target.parentElement;\n }\n };\n\n private getNewlyHoveredElement = (element: HTMLElement | null) => {\n let parentElement: HoveredElement | null = null;\n\n let parentSectionIndex = -1;\n\n const [hoveredElement, hoveredInfo] = this.getClosestComponentInformation(element) || [\n null,\n null,\n ];\n\n if (!hoveredElement) return;\n\n // if hovered element is already hovered and the information is already sent\n // ignore the rest and don't proceed.\n if (hoveredInfo.nodeId === this.currentHoveredElementId) return;\n\n let parentHTMLElement: HTMLElement | null = hoveredElement?.parentElement || null;\n\n while (parentHTMLElement) {\n const parentIsRoot = parentHTMLElement.id === 'VisualEditorRoot';\n if (parentHTMLElement.dataset.cfNodeId || parentIsRoot) {\n parentElement = {\n nodeId: parentIsRoot ? 'root' : parentHTMLElement.dataset.cfNodeId,\n blockType: parentHTMLElement.dataset.cfNodeBlockType,\n blockId: parentHTMLElement.dataset.cfNodeBlockId,\n };\n const parentChildrenElements = parentHTMLElement.children;\n parentSectionIndex = Array.from(parentChildrenElements).findIndex(\n (child) => child === hoveredElement,\n );\n break;\n }\n parentHTMLElement = parentHTMLElement.parentElement;\n }\n\n const coordinates = this.getFullCoordinates(hoveredElement);\n\n return { coordinates, hoveredElement: hoveredInfo, parentElement, parentSectionIndex };\n };\n\n handleMouseMove = (target: HTMLElement | null): void => {\n const hoveredElementInfo = this.getNewlyHoveredElement(target);\n\n if (!hoveredElementInfo) {\n return;\n }\n\n const { coordinates, hoveredElement, parentElement, parentSectionIndex } = hoveredElementInfo;\n this.currentHoveredElementId = hoveredElementInfo.hoveredElement.nodeId || null;\n\n sendMessage(OUTGOING_EVENTS.NewHoveredElement, {\n hoveredElement,\n parentElement,\n parentSectionIndex,\n coordinates,\n });\n };\n\n onMouseMove = (event: MouseEvent) => {\n const target: HTMLElement | null = event.target as HTMLElement;\n this.handleMouseMove(target);\n };\n\n onMouseLeave = () => {\n this.currentHoveredElementId = null;\n };\n\n attachEvent(): void {\n document.addEventListener('mousemove', this.onMouseMove);\n document.addEventListener('mouseout', this.onMouseLeave);\n }\n\n detachEvent(): void {\n document.removeEventListener('mousemove', this.onMouseMove);\n document.removeEventListener('mouseout', this.onMouseLeave);\n }\n}\n","import { MouseOverHandler } from './MouseOverHandler';\n\n/**\n * This function gets the element co-ordinates of a specified component in the DOM and its parent\n * and sends the DOM Rect to the client app\n */\nexport const sendHoveredComponentCoordinates = (instanceId?: string) => {\n const selectedElement: HTMLElement | null | undefined = instanceId\n ? (document.querySelector(`[data-cf-node-id=\"${instanceId}\"]`) as HTMLElement)\n : undefined;\n\n const mouseOverHandler = new MouseOverHandler();\n mouseOverHandler.handleMouseMove(selectedElement || null);\n};\n","export default class DragState {\n private isDraggingItem;\n private isDragStartedOnParent;\n\n constructor() {\n this.isDragStartedOnParent = false;\n this.isDraggingItem = false;\n }\n\n get isDragging() {\n return this.isDraggingItem;\n }\n\n get isDraggingOnParent() {\n return this.isDragStartedOnParent;\n }\n\n public updateIsDragging(isDraggingItem: boolean) {\n this.isDraggingItem = isDraggingItem;\n }\n public updateIsDragStartedOnParent(isDragStartedOnParent: boolean) {\n this.isDragStartedOnParent = isDragStartedOnParent;\n }\n\n public resetState() {\n this.isDraggingItem = false;\n this.isDragStartedOnParent = false;\n }\n}\n","import { CTFL_DRAGGING_ELEMENT, NEW_COMPONENT_ID } from '../types/constants';\nimport DragState from './dragState';\n\nclass SimulateDnD extends DragState {\n private draggingElement: Element | null;\n\n constructor() {\n super();\n this.draggingElement = null;\n }\n\n public setupDrag() {\n this.updateIsDragStartedOnParent(true);\n }\n\n public startDrag(coordX: number, coordY: number) {\n this.draggingElement = document.getElementById(NEW_COMPONENT_ID);\n this.updateIsDragging(true);\n this.simulateMouseEvent(coordX, coordY, 'mousedown');\n }\n\n public updateDrag(coordX: number, coordY: number) {\n if (!this.draggingElement) {\n this.draggingElement = document.querySelector(`[${CTFL_DRAGGING_ELEMENT}]`);\n }\n\n this.simulateMouseEvent(coordX, coordY);\n }\n\n public endDrag(coordX: number, coordY: number) {\n this.simulateMouseEvent(coordX, coordY, 'mouseup');\n this.reset();\n }\n\n public reset() {\n this.draggingElement = null;\n this.resetState();\n }\n\n private simulateMouseEvent(coordX: number, coordY: number, eventName = 'mousemove') {\n if (!this.draggingElement) {\n return;\n }\n\n const options = {\n bubbles: true,\n cancelable: true,\n view: window,\n pageX: 0,\n pageY: 0,\n clientX: coordX,\n clientY: coordY,\n };\n\n const event = new MouseEvent(eventName, options);\n this.draggingElement.dispatchEvent(event);\n }\n}\n\nexport default new SimulateDnD();\n","import { useCallback, useEffect, useState } from 'react';\nimport {\n sendMessage,\n getDataFromTree,\n doesMismatchMessageSchema,\n tryParseMessage,\n gatherDeepReferencesFromTree,\n DeepReference,\n isLink,\n EditorModeEntityStore,\n} from '@contentful/experiences-core';\nimport {\n OUTGOING_EVENTS,\n INCOMING_EVENTS,\n SCROLL_STATES,\n PostMessageMethods,\n} from '@contentful/experiences-core/constants';\nimport {\n ExperienceTree,\n ExperienceTreeNode,\n ComponentPropertyValue,\n ComponentRegistration,\n Link,\n ExperienceDataSource,\n ManagementEntity,\n} from '@contentful/experiences-core/types';\nimport { sendSelectedComponentCoordinates } from '@/communication/sendSelectedComponentCoordinates';\nimport { useTreeStore } from '@/store/tree';\nimport { useEditorStore } from '@/store/editor';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport { Assembly } from '@contentful/experiences-components-react';\nimport { addComponentRegistration, assembliesRegistry, setAssemblies } from '@/store/registries';\nimport { sendHoveredComponentCoordinates } from '@/communication/sendHoveredComponentCoordinates';\nimport { useEntityStore } from '@/store/entityStore';\nimport SimulateDnD from '@/utils/simulateDnD';\nimport { UnresolvedLink } from 'contentful';\n\nexport function useEditorSubscriber() {\n const entityStore = useEntityStore((state) => state.entityStore);\n const areEntitiesFetched = useEntityStore((state) => state.areEntitiesFetched);\n const setEntitiesFetched = useEntityStore((state) => state.setEntitiesFetched);\n const { updateTree, updateNodesByUpdatedEntity } = useTreeStore((state) => ({\n updateTree: state.updateTree,\n updateNodesByUpdatedEntity: state.updateNodesByUpdatedEntity,\n }));\n const unboundValues = useEditorStore((state) => state.unboundValues);\n const dataSource = useEditorStore((state) => state.dataSource);\n const setLocale = useEditorStore((state) => state.setLocale);\n const setUnboundValues = useEditorStore((state) => state.setUnboundValues);\n const setDataSource = useEditorStore((state) => state.setDataSource);\n const setSelectedNodeId = useEditorStore((state) => state.setSelectedNodeId);\n const selectedNodeId = useEditorStore((state) => state.selectedNodeId);\n const resetEntityStore = useEntityStore((state) => state.resetEntityStore);\n\n const setComponentId = useDraggedItemStore((state) => state.setComponentId);\n const setDraggingOnCanvas = useDraggedItemStore((state) => state.setDraggingOnCanvas);\n const setMousePosition = useDraggedItemStore((state) => state.setMousePosition);\n const setScrollY = useDraggedItemStore((state) => state.setScrollY);\n\n // TODO: As we have disabled the useEffect, we can remove these states\n const [, /* isFetchingEntities */ setFetchingEntities] = useState(false);\n\n const reloadApp = () => {\n sendMessage(OUTGOING_EVENTS.CanvasReload, {});\n // Wait a moment to ensure that the message was sent\n setTimeout(() => {\n // Received a hot reload message from webpack dev server -> reload the canvas\n window.location.reload();\n }, 50);\n };\n\n useEffect(() => {\n sendMessage(OUTGOING_EVENTS.RequestComponentTreeUpdate);\n }, []);\n\n /**\n * Fills up entityStore with entities from newDataSource and from the tree.\n * Also manages \"entity status\" variables (areEntitiesFetched, isFetchingEntities)\n */\n const fetchMissingEntities = useCallback(\n async (\n entityStore: EditorModeEntityStore,\n newDataSource: ExperienceDataSource,\n tree: ExperienceTree,\n ) => {\n // if we realize that there's nothing missing and nothing to fill-fetch before we do any async call,\n // then we can simply return and not lock the EntityStore at all.\n const startFetching = () => {\n setEntitiesFetched(false);\n setFetchingEntities(true);\n };\n const endFetching = () => {\n setEntitiesFetched(true);\n setFetchingEntities(false);\n };\n\n // Prepare L1 entities and deepReferences\n const entityLinksL1 = [\n ...Object.values(newDataSource),\n ...assembliesRegistry.values(), // we count assemblies here as \"L1 entities\", for convenience. Even though they're not headEntities.\n ];\n const deepReferences = gatherDeepReferencesFromTree(tree.root, newDataSource);\n\n /**\n * Checks only for _missing_ L1 entities\n * WARNING: Does NOT check for entity staleness/versions. If an entity is stale, it will NOT be considered missing.\n * If ExperienceBuilder wants to update stale entities, it should post `▼UPDATED_ENTITY` message to SDK.\n */\n const isMissingL1Entities = (entityLinks: UnresolvedLink<'Entry' | 'Asset'>[]): boolean => {\n const { missingAssetIds, missingEntryIds } = entityStore.getMissingEntityIds(entityLinks);\n return Boolean(missingAssetIds.length) || Boolean(missingEntryIds.length);\n };\n\n /**\n * PRECONDITION: all L1 entities are fetched\n */\n const isMissingL2Entities = (deepReferences: DeepReference[]): boolean => {\n const referentLinks = deepReferences\n .map((deepReference) => deepReference.extractReferent(entityStore))\n .filter(isLink);\n const { missingAssetIds, missingEntryIds } = entityStore.getMissingEntityIds(referentLinks);\n return Boolean(missingAssetIds.length) || Boolean(missingEntryIds.length);\n };\n\n /**\n * POST_CONDITION: entityStore is has all L1 entities (aka headEntities)\n */\n const fillupL1 = async ({\n entityLinksL1,\n }: {\n entityLinksL1: UnresolvedLink<'Entry' | 'Asset'>[];\n }) => {\n const { missingAssetIds, missingEntryIds } = entityStore.getMissingEntityIds(entityLinksL1);\n await entityStore.fetchEntities({ missingAssetIds, missingEntryIds });\n };\n\n /**\n * PRECONDITION: all L1 entites are fetched\n */\n const fillupL2 = async ({ deepReferences }: { deepReferences: DeepReference[] }) => {\n const referentLinks = deepReferences\n .map((deepReference) => deepReference.extractReferent(entityStore))\n .filter(isLink);\n const { missingAssetIds, missingEntryIds } = entityStore.getMissingEntityIds(referentLinks);\n await entityStore.fetchEntities({ missingAssetIds, missingEntryIds });\n };\n\n try {\n if (isMissingL1Entities(entityLinksL1)) {\n startFetching();\n await fillupL1({ entityLinksL1 });\n }\n if (isMissingL2Entities(deepReferences)) {\n startFetching();\n await fillupL2({ deepReferences });\n }\n } catch (error) {\n console.error('[experiences-sdk-react] Failed fetching entities');\n console.error(error);\n throw error; // TODO: The original catch didn't let's rethrow; for the moment throw to see if we have any errors\n } finally {\n endFetching();\n }\n },\n [setEntitiesFetched /* setFetchingEntities, assembliesRegistry */],\n );\n\n useEffect(() => {\n const onMessage = async (event: MessageEvent) => {\n let reason;\n if ((reason = doesMismatchMessageSchema(event))) {\n if (\n event.origin.startsWith('http://localhost') &&\n `${event.data}`.includes('webpackHotUpdate')\n ) {\n reloadApp();\n } else {\n console.warn(\n `[experiences-sdk-react::onMessage] Ignoring alien incoming message from origin [${event.origin}], due to: [${reason}]`,\n event,\n );\n }\n return;\n }\n\n const eventData = tryParseMessage(event);\n if (eventData.eventType === PostMessageMethods.REQUESTED_ENTITIES) {\n // Expected message: This message is handled in the EntityStore to store fetched entities\n return;\n }\n console.debug(\n `[experiences-sdk-react::onMessage] Received message [${eventData.eventType}]`,\n eventData,\n );\n\n const { payload } = eventData;\n\n switch (eventData.eventType) {\n case INCOMING_EVENTS.ExperienceUpdated: {\n const {\n tree,\n locale,\n changedNode,\n changedValueType,\n assemblies,\n }: {\n tree: ExperienceTree;\n assemblies: Link<'Entry'>[];\n locale: string;\n entitiesResolved?: boolean;\n changedNode?: ExperienceTreeNode;\n changedValueType?: ComponentPropertyValue['type'];\n } = payload;\n\n // Make sure to first store the assemblies before setting the tree and thus triggering a rerender\n if (assemblies) {\n setAssemblies(assemblies);\n // If the assemblyEntry is not yet fetched, this will be done below by\n // the imperative calls to fetchMissingEntities.\n }\n\n let newEntityStore = entityStore;\n if (entityStore.locale !== locale) {\n newEntityStore = resetEntityStore(locale);\n setLocale(locale);\n }\n\n // Below are mutually exclusive cases\n if (changedNode) {\n /**\n * On single node updates, we want to skip the process of getting the data (datasource and unbound values)\n * from tree. Since we know the updated node, we can skip that recursion everytime the tree updates and\n * just update the relevant data we need from the relevant node.\n *\n * We still update the tree here so we don't have a stale \"tree\"\n */\n if (changedValueType === 'BoundValue') {\n const newDataSource = { ...dataSource, ...changedNode.data.dataSource };\n setDataSource(newDataSource);\n await fetchMissingEntities(newEntityStore, newDataSource, tree);\n } else if (changedValueType === 'UnboundValue') {\n setUnboundValues({\n ...unboundValues,\n ...changedNode.data.unboundValues,\n });\n }\n } else {\n const { dataSource, unboundValues } = getDataFromTree(tree);\n setDataSource(dataSource);\n setUnboundValues(unboundValues);\n await fetchMissingEntities(newEntityStore, dataSource, tree);\n }\n // Update the tree when all necessary data is fetched and ready for rendering.\n updateTree(tree);\n break;\n }\n case INCOMING_EVENTS.AssembliesRegistered: {\n const { assemblies }: { assemblies: ComponentRegistration['definition'][] } = payload;\n\n assemblies.forEach((definition) => {\n addComponentRegistration({\n component: Assembly,\n definition,\n });\n });\n break;\n }\n case INCOMING_EVENTS.AssembliesAdded: {\n const {\n assembly,\n assemblyDefinition,\n }: {\n assembly: ManagementEntity;\n assemblyDefinition?: ComponentRegistration['definition'];\n } = payload;\n entityStore.updateEntity(assembly);\n // Using a Map here to avoid setting state and rerending all existing assemblies when a new assembly is added\n // TODO: Figure out if we can extend this love to data source and unbound values. Maybe that'll solve the blink\n // of all bound and unbound values when new values are added\n assembliesRegistry.set(assembly.sys.id, {\n sys: { id: assembly.sys.id, linkType: 'Entry', type: 'Link' },\n } as Link<'Entry'>);\n if (assemblyDefinition) {\n addComponentRegistration({\n component: Assembly,\n definition: assemblyDefinition,\n });\n }\n\n break;\n }\n case INCOMING_EVENTS.CanvasResized: {\n const { selectedNodeId } = payload;\n if (selectedNodeId) {\n sendSelectedComponentCoordinates(selectedNodeId);\n }\n break;\n }\n case INCOMING_EVENTS.HoverComponent: {\n const { hoveredNodeId } = payload;\n sendHoveredComponentCoordinates(hoveredNodeId);\n break;\n }\n case INCOMING_EVENTS.ComponentDraggingChanged: {\n const { isDragging } = payload;\n\n if (!isDragging) {\n setComponentId('');\n setDraggingOnCanvas(false);\n SimulateDnD.reset();\n }\n break;\n }\n case INCOMING_EVENTS.UpdatedEntity: {\n const { entity: updatedEntity, shouldRerender } = payload as {\n entity: ManagementEntity;\n shouldRerender?: boolean;\n };\n if (updatedEntity) {\n const storedEntity = entityStore.entities.find(\n (entity) => entity.sys.id === updatedEntity.sys.id,\n ) as unknown as ManagementEntity | undefined;\n\n const didEntityChange = storedEntity?.sys.version !== updatedEntity.sys.version;\n entityStore.updateEntity(updatedEntity);\n // We traverse the whole tree, so this is a opt-in feature to only use it when required.\n if (shouldRerender && didEntityChange) {\n updateNodesByUpdatedEntity(updatedEntity.sys.id);\n }\n }\n break;\n }\n case INCOMING_EVENTS.RequestEditorMode: {\n break;\n }\n case INCOMING_EVENTS.ComponentDragCanceled: {\n if (SimulateDnD.isDragging) {\n //simulate a mouseup event to cancel the drag\n SimulateDnD.endDrag(0, 0);\n }\n break;\n }\n case INCOMING_EVENTS.ComponentDragStarted: {\n SimulateDnD.setupDrag();\n setComponentId(payload.id || '');\n setDraggingOnCanvas(true);\n\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: '',\n });\n break;\n }\n case INCOMING_EVENTS.ComponentDragEnded: {\n SimulateDnD.reset();\n setComponentId('');\n setDraggingOnCanvas(false);\n break;\n }\n case INCOMING_EVENTS.SelectComponent: {\n const { selectedNodeId: nodeId } = payload;\n setSelectedNodeId(nodeId);\n sendSelectedComponentCoordinates(nodeId);\n break;\n }\n case INCOMING_EVENTS.MouseMove: {\n const { mouseX, mouseY } = payload;\n setMousePosition(mouseX, mouseY);\n\n if (SimulateDnD.isDraggingOnParent && !SimulateDnD.isDragging) {\n SimulateDnD.startDrag(mouseX, mouseY);\n } else {\n SimulateDnD.updateDrag(mouseX, mouseY);\n }\n\n break;\n }\n case INCOMING_EVENTS.ComponentMoveEnded: {\n const { mouseX, mouseY } = payload;\n SimulateDnD.endDrag(mouseX, mouseY);\n break;\n }\n default:\n console.error(\n `[experiences-sdk-react::onMessage] Logic error, unsupported eventType: [${eventData.eventType}]`,\n );\n }\n };\n\n window.addEventListener('message', onMessage);\n\n return () => {\n window.removeEventListener('message', onMessage);\n };\n }, [\n entityStore,\n setComponentId,\n setDraggingOnCanvas,\n setDataSource,\n setLocale,\n setSelectedNodeId,\n dataSource,\n areEntitiesFetched,\n fetchMissingEntities,\n setUnboundValues,\n unboundValues,\n updateTree,\n updateNodesByUpdatedEntity,\n setMousePosition,\n resetEntityStore,\n ]);\n\n /*\n * Handles on scroll business\n */\n useEffect(() => {\n let timeoutId = 0;\n let isScrolling = false;\n\n const onScroll = () => {\n setScrollY(window.scrollY);\n if (isScrolling === false) {\n sendMessage(OUTGOING_EVENTS.CanvasScroll, SCROLL_STATES.Start);\n }\n\n sendMessage(OUTGOING_EVENTS.CanvasScroll, SCROLL_STATES.IsScrolling);\n isScrolling = true;\n\n clearTimeout(timeoutId);\n\n timeoutId = window.setTimeout(() => {\n if (isScrolling === false) {\n return;\n }\n\n isScrolling = false;\n sendMessage(OUTGOING_EVENTS.CanvasScroll, SCROLL_STATES.End);\n\n /**\n * On scroll end, send new co-ordinates of selected node\n */\n if (selectedNodeId) {\n sendSelectedComponentCoordinates(selectedNodeId);\n }\n }, 150);\n };\n\n window.addEventListener('scroll', onScroll, { capture: true, passive: true });\n\n return () => {\n window.removeEventListener('scroll', onScroll, { capture: true });\n clearTimeout(timeoutId);\n };\n }, [selectedNodeId, setScrollY]);\n}\n","import { sendMessage } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\nexport const onComponentMoved = (options: {\n nodeId: string;\n sourceParentId: string;\n destinationParentId: string;\n sourceIndex: number;\n destinationIndex: number;\n}) => {\n sendMessage(OUTGOING_EVENTS.ComponentMoved, options);\n};\n","import { v4 as uuidv4 } from 'uuid';\n\nexport const generateId = (type: string | number) => `${type}-${uuidv4()}`;\n","import { ExperienceTreeNode } from '@contentful/experiences-core/types';\nimport { generateId } from './generate-id';\n\ninterface Params {\n blockId: string;\n parentId: string;\n}\n\nexport const createTreeNode = ({ blockId, parentId }: Params) => {\n const node: ExperienceTreeNode = {\n type: 'block',\n data: {\n id: generateId(blockId),\n blockId,\n props: {},\n dataSource: {},\n breakpoints: [],\n unboundValues: {},\n },\n parentId,\n children: [],\n };\n\n return node;\n};\n","import { sendMessage } from '@contentful/experiences-core';\nimport { ExperienceTreeNode } from '@contentful/experiences-core/types';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\nexport const onComponentDropped = ({\n node,\n index,\n parentBlockId,\n parentType,\n parentId,\n}: {\n node: ExperienceTreeNode;\n index?: number;\n parentType?: string;\n parentBlockId?: string;\n parentId?: string;\n}) => {\n sendMessage(OUTGOING_EVENTS.ComponentDropped, {\n node,\n index: index ?? node.children.length,\n parentNode: {\n type: parentType,\n data: {\n blockId: parentBlockId,\n id: parentId,\n },\n },\n });\n};\n","import { onComponentDropped } from '@/communication/onComponentDrop';\nimport { getItem } from './getItem';\nimport type { ExperienceTreeNode, ExperienceTree } from '@contentful/experiences-core/types';\nimport { generateId } from './generate-id';\nimport { ROOT_ID } from '../types/constants';\n\ninterface OnDropParams {\n data: ExperienceTree;\n componentType: string;\n destinationZoneId: string;\n destinationIndex: number;\n}\nexport const onDrop = ({\n destinationIndex,\n componentType,\n destinationZoneId,\n data,\n}: OnDropParams) => {\n const parentId = destinationZoneId;\n\n const parentNode = getItem({ id: parentId }, data);\n\n const parentIsRoot = parentId === ROOT_ID;\n\n const emptyComponentData: ExperienceTreeNode = {\n type: 'block',\n parentId,\n children: [],\n data: {\n blockId: componentType,\n id: generateId(componentType),\n breakpoints: [],\n dataSource: {},\n props: {},\n unboundValues: {},\n },\n };\n\n onComponentDropped({\n node: emptyComponentData,\n index: destinationIndex,\n parentType: parentIsRoot ? 'root' : parentNode?.type,\n parentBlockId: parentNode?.data.blockId,\n parentId: parentIsRoot ? 'root' : parentId,\n });\n};\n","import { onComponentMoved } from '@/communication/onComponentMoved';\nimport { useTreeStore } from '@/store/tree';\nimport { ROOT_ID } from '@/types/constants';\nimport { createTreeNode } from '@/utils/createTreeNode';\nimport { onDrop } from '@/utils/onDrop';\nimport { CONTENTFUL_COMPONENTS } from '@contentful/experiences-core/constants';\nimport { DropResult } from '@hello-pangea/dnd';\n\nexport default function useCanvasInteractions() {\n const tree = useTreeStore((state) => state.tree);\n const reorderChildren = useTreeStore((state) => state.reorderChildren);\n const reparentChild = useTreeStore((state) => state.reparentChild);\n const addChild = useTreeStore((state) => state.addChild);\n\n const onAddComponent = (droppedItem: DropResult) => {\n const { destination, draggableId } = droppedItem;\n\n if (!destination) {\n return;\n }\n\n const droppingOnRoot = destination.droppableId === ROOT_ID;\n const isValidRootComponent = draggableId === CONTENTFUL_COMPONENTS.container.id;\n\n let node = createTreeNode({ blockId: draggableId, parentId: destination.droppableId });\n\n if (droppingOnRoot && !isValidRootComponent) {\n const wrappingContainer = createTreeNode({\n blockId: CONTENTFUL_COMPONENTS.container.id,\n parentId: destination.droppableId,\n });\n const childNode = createTreeNode({\n blockId: draggableId,\n parentId: wrappingContainer.data.id,\n });\n\n node = wrappingContainer;\n node.children = [childNode];\n }\n\n addChild(destination.index, destination.droppableId, node);\n\n onDrop({\n data: tree,\n componentType: draggableId,\n destinationIndex: destination.index,\n destinationZoneId: destination.droppableId,\n });\n };\n\n const onMoveComponent = (droppedItem: DropResult) => {\n const { destination, source, draggableId } = droppedItem;\n\n if (!destination || !source) {\n return;\n }\n\n if (destination.droppableId === source.droppableId) {\n reorderChildren(destination.index, destination.droppableId, source.index);\n }\n\n if (destination.droppableId !== source.droppableId) {\n reparentChild(destination.index, destination.droppableId, source.index, source.droppableId);\n }\n\n onComponentMoved({\n nodeId: draggableId,\n destinationIndex: destination.index,\n destinationParentId: destination.droppableId,\n sourceIndex: source.index,\n sourceParentId: source.droppableId,\n });\n };\n\n return { onAddComponent, onMoveComponent };\n}\n","import {\n DragStart,\n DragUpdate,\n DropResult,\n OnBeforeDragStartResponder,\n OnDragEndResponder,\n OnDragUpdateResponder,\n ResponderProvided,\n} from '@hello-pangea/dnd';\nimport React from 'react';\n\ninterface TestDNDContainerProps extends React.PropsWithChildren {\n onDragUpdate: OnDragUpdateResponder;\n onBeforeDragStart: OnBeforeDragStartResponder;\n onDragEnd: OnDragEndResponder;\n}\n\nconst TestDNDContainer: React.FC<TestDNDContainerProps> = ({\n onDragEnd,\n onBeforeDragStart,\n onDragUpdate,\n children,\n}) => {\n const handleDragStart = (event: React.DragEvent<HTMLDivElement>) => {\n const draggedItem = event.nativeEvent as unknown as DragStart;\n const start: DragStart = {\n mode: draggedItem.mode,\n draggableId: draggedItem.draggableId,\n type: draggedItem.type,\n source: draggedItem.source,\n };\n onBeforeDragStart(start);\n };\n\n const handleDrag = (event: React.DragEvent<HTMLDivElement>) => {\n const draggedItem = event.nativeEvent as unknown as DragUpdate;\n const update: DragUpdate = {\n mode: draggedItem.mode,\n draggableId: draggedItem.draggableId,\n type: draggedItem.type,\n source: draggedItem.source,\n destination: draggedItem.destination,\n combine: draggedItem.combine,\n };\n onDragUpdate(update, {} as ResponderProvided);\n };\n\n const handleDragEnd = (event: React.DragEvent<HTMLDivElement>) => {\n const draggedItem = event.nativeEvent as unknown as DropResult;\n const result: DropResult = {\n mode: draggedItem.mode,\n draggableId: draggedItem.draggableId,\n type: draggedItem.type,\n source: draggedItem.source,\n destination: draggedItem.destination,\n combine: draggedItem.combine,\n reason: draggedItem.reason,\n };\n onDragEnd(result, {} as ResponderProvided);\n };\n\n return (\n <div\n data-test-id=\"dnd-context-substitute\"\n onDragStart={handleDragStart}\n onDrag={handleDrag}\n onDragEnd={handleDragEnd}>\n {children}\n </div>\n );\n};\n\nexport default TestDNDContainer;\n","import useCanvasInteractions from '@/hooks/useCanvasInteractions';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport { useEditorStore } from '@/store/editor';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\nimport {\n DragDropContext,\n OnBeforeCaptureResponder,\n OnBeforeDragStartResponder,\n OnDragEndResponder,\n OnDragUpdateResponder,\n} from '@hello-pangea/dnd';\nimport React, { useRef } from 'react';\nimport type { ReactNode } from 'react';\nimport TestDNDContainer from './TestDNDContainer';\nimport { COMPONENT_LIST_ID } from '@/types/constants';\nimport SimulateDnD from '@/utils/simulateDnD';\n\ntype Props = {\n children: ReactNode;\n};\n\nexport const DNDProvider = ({ children }: Props) => {\n const setSelectedNodeId = useEditorStore((state) => state.setSelectedNodeId);\n const draggedItem = useDraggedItemStore((state) => state.draggedItem);\n const setOnBeforeCaptureId = useDraggedItemStore((state) => state.setOnBeforeCaptureId);\n const setDraggingOnCanvas = useDraggedItemStore((state) => state.setDraggingOnCanvas);\n const updateItem = useDraggedItemStore((state) => state.updateItem);\n const { onAddComponent, onMoveComponent } = useCanvasInteractions();\n const selectedNodeId = useEditorStore((state) => state.selectedNodeId);\n const prevSelectedNodeId = useRef<string | null>(null);\n\n const isTestRun =\n typeof window !== 'undefined' && Object.prototype.hasOwnProperty.call(window, 'Cypress');\n\n const dragStart: OnBeforeDragStartResponder = ({ source }) => {\n prevSelectedNodeId.current = selectedNodeId;\n\n //Unselect the current node when dragging and remove the outline\n setSelectedNodeId('');\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: '',\n });\n if (source.droppableId !== COMPONENT_LIST_ID) {\n sendMessage(OUTGOING_EVENTS.ComponentMoveStarted);\n }\n };\n\n const beforeCapture: OnBeforeCaptureResponder = ({ draggableId }) => {\n setDraggingOnCanvas(true);\n setOnBeforeCaptureId(draggableId);\n };\n\n const dragUpdate: OnDragUpdateResponder = (update) => {\n updateItem(update);\n };\n\n const dragEnd: OnDragEndResponder = (dropResult) => {\n setDraggingOnCanvas(false);\n setOnBeforeCaptureId('');\n updateItem(undefined);\n SimulateDnD.reset();\n\n if (!dropResult.destination) {\n if (!draggedItem?.destination) {\n // User cancel drag\n sendMessage(OUTGOING_EVENTS.ComponentDragCanceled);\n //select the previously selected node if drag was canceled\n if (prevSelectedNodeId.current) {\n setSelectedNodeId(prevSelectedNodeId.current);\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: prevSelectedNodeId.current,\n });\n prevSelectedNodeId.current = null;\n }\n return;\n }\n // Use the destination from the draggedItem (when clicking the canvas)\n dropResult.destination = draggedItem.destination;\n }\n\n // New component added to canvas\n if (dropResult.source.droppableId.startsWith('component-list')) {\n onAddComponent(dropResult);\n } else {\n onMoveComponent(dropResult);\n }\n\n // If a node was previously selected prior to dragging, re-select it\n setSelectedNodeId(dropResult.draggableId);\n sendMessage(OUTGOING_EVENTS.ComponentMoveEnded);\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: dropResult.draggableId,\n });\n };\n\n return (\n <DragDropContext\n onBeforeCapture={beforeCapture}\n onDragUpdate={dragUpdate}\n onBeforeDragStart={dragStart}\n onDragEnd={dragEnd}>\n {isTestRun ? (\n <TestDNDContainer\n onDragEnd={dragEnd}\n onBeforeDragStart={dragStart}\n onDragUpdate={dragUpdate}>\n {children}\n </TestDNDContainer>\n ) : (\n children\n )}\n </DragDropContext>\n );\n};\n","import React, { CSSProperties, useCallback, useRef, useState } from 'react';\nimport { useEffect } from 'react';\nimport { Dropzone } from '../Dropzone/Dropzone';\nimport DraggableContainer from '../Draggable/DraggableComponentList';\nimport type { ExperienceTree } from '@contentful/experiences-core/types';\n\nimport { COMPONENT_LIST_ID, DRAGGABLE_HEIGHT, ROOT_ID } from '@/types/constants';\nimport { useTreeStore } from '@/store/tree';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport styles from './render.module.css';\nimport { useBreakpoints } from '@/hooks/useBreakpoints';\nimport { useEditorSubscriber } from '@/hooks/useEditorSubscriber';\nimport { DNDProvider } from './DNDProvider';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\nimport { useEditorStore } from '@/store/editor';\n\ninterface Props {\n onChange?: (data: ExperienceTree) => void;\n}\n\nexport const RootRenderer: React.FC<Props> = ({ onChange }) => {\n useEditorSubscriber();\n\n const dragItem = useDraggedItemStore((state) => state.componentId);\n const userIsDragging = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n const breakpoints = useTreeStore((state) => state.breakpoints);\n const setSelectedNodeId = useEditorStore((state) => state.setSelectedNodeId);\n const draggableSourceId = useDraggedItemStore((state) => state.draggedItem?.source.droppableId);\n const draggingNewComponent = !!draggableSourceId?.startsWith(COMPONENT_LIST_ID);\n const containerRef = useRef<HTMLDivElement>(null);\n const { resolveDesignValue } = useBreakpoints(breakpoints);\n const [containerStyles, setContainerStyles] = useState<CSSProperties>({});\n const tree = useTreeStore((state) => state.tree);\n\n const handleClickOutside = useCallback(\n (e: MouseEvent) => {\n const element = e.target as HTMLElement;\n\n const isRoot = element.getAttribute('data-ctfl-zone-id') === ROOT_ID;\n const clickedOnCanvas = element.closest(`[data-ctfl-root]`);\n\n if (clickedOnCanvas && !isRoot) {\n return;\n }\n\n sendMessage(OUTGOING_EVENTS.OutsideCanvasClick, {\n outsideCanvasClick: true,\n });\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n selectedId: '',\n });\n setSelectedNodeId('');\n },\n [setSelectedNodeId],\n );\n\n const handleResizeCanvas = useCallback(() => {\n const parentElement = containerRef.current?.parentElement;\n if (!parentElement) {\n return;\n }\n\n let siblingHeight = 0;\n\n for (const child of parentElement.children) {\n if (!child.hasAttribute('data-ctfl-root')) {\n siblingHeight += child.getBoundingClientRect().height;\n }\n }\n\n if (!siblingHeight) {\n /**\n * DRAGGABLE_HEIGHT is subtracted here due to an uninteded scrolling effect\n * when dragging a new component onto the canvas\n *\n * The DRAGGABLE_HEIGHT is then added as margin bottom to offset this value\n * so that visually there is no difference to the user.\n */\n setContainerStyles({\n minHeight: `${window.innerHeight - DRAGGABLE_HEIGHT}px`,\n });\n return;\n }\n\n setContainerStyles({\n minHeight: `${window.innerHeight - siblingHeight}px`,\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [containerRef.current]);\n\n useEffect(() => {\n if (onChange) onChange(tree);\n }, [tree, onChange]);\n\n useEffect(() => {\n document.addEventListener('click', handleClickOutside);\n return () => {\n document.removeEventListener('click', handleClickOutside);\n };\n }, [handleClickOutside]);\n\n useEffect(() => {\n handleResizeCanvas();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [containerRef.current]);\n\n return (\n <DNDProvider>\n {dragItem && <DraggableContainer id={dragItem} />}\n\n <div data-ctfl-root className={styles.container} ref={containerRef} style={containerStyles}>\n {/* \n This hitbox is required so that users can\n add sections to the top of the document.\n */}\n {userIsDragging && draggingNewComponent && (\n <div className={styles.hitbox} data-ctfl-zone-id={ROOT_ID} />\n )}\n <Dropzone zoneId={ROOT_ID} resolveDesignValue={resolveDesignValue} />\n {/* \n This hitbox is required so that users can\n add sections to the bottom of the document.\n */}\n {userIsDragging && draggingNewComponent && (\n <div data-ctfl-zone-id={ROOT_ID} className={styles.hitboxLower} />\n )}\n </div>\n <div data-ctfl-hitboxes />\n </DNDProvider>\n );\n};\n","import { useEditorStore } from '@/store/editor';\nimport { useEntityStore } from '@/store/entityStore';\n\nimport { INTERNAL_EVENTS, VISUAL_EDITOR_EVENTS } from '@contentful/experiences-core/constants';\nimport { useEffect, useState } from 'react';\n\nexport const useInitializeEditor = () => {\n const initializeEditor = useEditorStore((state) => state.initializeEditor);\n const [initialized, setInitialized] = useState(false);\n const resetEntityStore = useEntityStore((state) => state.resetEntityStore);\n\n useEffect(() => {\n const onVisualEditorInitialize = (event) => {\n if (!event.detail) return;\n const {\n componentRegistry,\n designTokens,\n locale: initialLocale,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n entities,\n } = event.detail;\n\n initializeEditor({\n initialLocale,\n componentRegistry,\n designTokens,\n });\n\n // if entities is set to [], then everything will still work as EntityStore will\n // request entities on demand via ▲REQUEST_ENTITY\n resetEntityStore(initialLocale, entities);\n setInitialized(true);\n };\n\n // Listen for VisualEditorComponents internal event\n window.addEventListener(INTERNAL_EVENTS.VisualEditorInitialize, onVisualEditorInitialize);\n\n // Clean up the event listener\n return () => {\n window.removeEventListener(INTERNAL_EVENTS.VisualEditorInitialize, onVisualEditorInitialize);\n };\n }, [initializeEditor, resetEntityStore]);\n\n useEffect(() => {\n if (initialized) {\n return;\n }\n\n // Dispatch Visual Editor Ready event\n window.dispatchEvent(new CustomEvent(VISUAL_EDITOR_EVENTS.Ready));\n }, [initialized]);\n\n return initialized;\n};\n","import React, { useEffect } from 'react';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { RootRenderer } from './RootRenderer/RootRenderer';\nimport SimulateDnD from '@/utils/simulateDnD';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\nimport { useInitializeEditor } from '@/hooks/useInitializeEditor';\nimport { useZoneStore } from '@/store/zone';\nimport { CTFL_ZONE_ID, NEW_COMPONENT_ID } from '@/types/constants';\nimport { useDraggedItemStore } from '@/store/draggedItem';\n\nexport const VisualEditorRoot = () => {\n const initialized = useInitializeEditor();\n const setMousePosition = useDraggedItemStore((state) => state.setMousePosition);\n const setHoveringZone = useZoneStore((state) => state.setHoveringZone);\n\n useEffect(() => {\n const onMouseMove = (e: MouseEvent) => {\n setMousePosition(e.clientX, e.clientY);\n\n const target = e.target as HTMLElement;\n const zoneId = target.closest(`[${CTFL_ZONE_ID}]`)?.getAttribute(CTFL_ZONE_ID);\n\n if (zoneId) {\n setHoveringZone(zoneId);\n }\n\n if (!SimulateDnD.isDragging) {\n return;\n }\n\n if (target.id === NEW_COMPONENT_ID) {\n return;\n }\n\n SimulateDnD.updateDrag(e.clientX, e.clientY);\n\n sendMessage(OUTGOING_EVENTS.MouseMove, {\n clientX: e.pageX,\n clientY: e.pageY - window.scrollY,\n });\n };\n\n document.addEventListener('mousemove', onMouseMove);\n\n return () => {\n document.removeEventListener('mousemove', onMouseMove);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!initialized) return null;\n\n return <RootRenderer />;\n};\n"],"names":["INCOMING_EVENTS","CONTENTFUL_COMPONENTS","EMPTY_CONTAINER_HEIGHT","PostMessageMethods","treeVisit","styles","getStyle","get","css_248z$2","css_248z$1","css_248z","SimulateDnD","uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAMA,iBAAe,GAAG;AACxB,IAAI,iBAAiB,EAAE,mBAAmB;AAC1C,IAAI,iBAAiB,EAAE,sBAAsB;AAC7C,IAAI,wBAAwB,EAAE,0BAA0B;AACxD,IAAI,qBAAqB,EAAE,uBAAuB;AAClD,IAAI,oBAAoB,EAAE,sBAAsB;AAChD,IAAI,kBAAkB,EAAE,oBAAoB;AAC5C,IAAI,kBAAkB,EAAE,oBAAoB;AAC5C,IAAI,aAAa,EAAE,eAAe;AAClC,IAAI,eAAe,EAAE,iBAAiB;AACtC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,aAAa,EAAE,eAAe;AAClC,IAAI,eAAe,EAAE,iBAAiB;AACtC,IAAI,oBAAoB,EAAE,sBAAsB;AAChD,IAAI,UAAU,EAAE,YAAY;AAC5B,IAAI,SAAS,EAAE,WAAW;AAC1B,CAAC,C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AAY,CAAC,YAAY,CAAC,CAAC;YAE/E,IAAI,MAAM,EAAE;gBACV,eAAe,CAAC,MAAM,CAAC,CAAC;aACzB;AAED,YAAA,IAAI,CAACA,aAAW,CAAC,UAAU,EAAE;gBAC3B,OAAO;aACR;AAED,YAAA,IAAI,MAAM,CAAC,EAAE,KAAK,gBAAgB,EAAE;gBAClC,OAAO;aACR;YAEDA,aAAW,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;AAE7C,YAAA,WAAW,CAAC,eAAe,CAAC,SAAS,EAAE;gBACrC,OAAO,EAAE,CAAC,CAAC,KAAK;AAChB,gBAAA,OAAO,EAAE,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO;AAClC,aAAA,CAAC,CAAC;AACL,SAAC,CAAC;AAEF,QAAA,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAEpD,QAAA,OAAO,MAAK;AACV,YAAA,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AACzD,SAAC,CAAC;;KAEH,EAAE,EAAE,CAAC,CAAC;AAEP,IAAA,IAAI,CAAC,WAAW;AAAE,QAAA,OAAO,IAAI,CAAC;IAE9B,OAAO,KAAA,CAAA,aAAA,CAAC,YAAY,EAAA,IAAA,CAAG,CAAC;AAC1B;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../core/dist/index.js","../../core/dist/constants.js","../../src/components/Draggable/canvasToolsUtils.ts","../../src/components/Draggable/Tooltip.tsx","../../src/store/draggedItem.ts","../../src/types/constants.ts","../../src/components/Draggable/Placeholder.tsx","../../src/hooks/useDraggablePosition.ts","../../src/components/Draggable/DraggableComponent.tsx","../../src/communication/sendSelectedComponentCoordinates.ts","../../src/store/registries.ts","../../src/store/editor.ts","../../src/hooks/useSelectedInstanceCoordinates.ts","../../src/hooks/useStyleTag.ts","../../src/utils/getUnboundValues.ts","../../src/store/entityStore.ts","../../src/components/Dropzone/useComponentProps.ts","../../components/dist/index.js","../../src/utils/assemblyUtils.ts","../../src/components/Dropzone/useComponent.ts","../../src/components/Draggable/DraggableChildComponent.tsx","../../src/utils/getItem.ts","../../src/utils/treeHelpers.ts","../../src/utils/getTreeDiff.ts","../../src/utils/treeTraversal.ts","../../src/store/tree.ts","../../src/store/zone.ts","../../src/utils/getHitboxStyles.ts","../../src/components/Dropzone/Hitboxes.tsx","../../src/components/Dropzone/EditorBlock.tsx","../../src/components/EmptyContainer/EmptyContainer.tsx","../../src/utils/zone.ts","../../src/hooks/useDropzoneDirection.ts","../../src/components/Dropzone/EditorBlockClone.tsx","../../src/components/Dropzone/DropzoneClone.tsx","../../src/components/Dropzone/Dropzone.tsx","../../src/components/Draggable/DraggableComponentList.tsx","../../src/hooks/useBreakpoints.ts","../../src/communication/MouseOverHandler.ts","../../src/communication/sendHoveredComponentCoordinates.ts","../../src/utils/dragState.ts","../../src/utils/simulateDnD.ts","../../src/hooks/useEditorSubscriber.ts","../../src/communication/onComponentMoved.ts","../../src/utils/generate-id.ts","../../src/utils/createTreeNode.ts","../../src/communication/onComponentDrop.ts","../../src/utils/onDrop.ts","../../src/hooks/useCanvasInteractions.ts","../../src/components/RootRenderer/TestDNDContainer.tsx","../../src/components/RootRenderer/DNDProvider.tsx","../../src/components/RootRenderer/RootRenderer.tsx","../../src/hooks/useInitializeEditor.ts","../../src/components/VisualEditorRoot.tsx"],"sourcesContent":["import md5 from 'md5';\nimport { BLOCKS } from '@contentful/rich-text-types';\n\nconst INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\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 InitEditor: 'initEditor',\n MouseMove: 'mouseMove',\n};\nconst CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';\nconst 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};\nconst ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';\nconst EMPTY_CONTAINER_HEIGHT = '80px';\nconst DEFAULT_IMAGE_WIDTH = '500px';\nvar PostMessageMethods;\n(function (PostMessageMethods) {\n PostMessageMethods[\"REQUEST_ENTITIES\"] = \"REQUEST_ENTITIES\";\n PostMessageMethods[\"REQUESTED_ENTITIES\"] = \"REQUESTED_ENTITIES\";\n})(PostMessageMethods || (PostMessageMethods = {}));\nconst SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];\n\nconst structureComponents = new Set([\n CONTENTFUL_COMPONENTS.section.id,\n CONTENTFUL_COMPONENTS.columns.id,\n CONTENTFUL_COMPONENTS.container.id,\n CONTENTFUL_COMPONENTS.singleColumn.id,\n]);\nconst isContentfulStructureComponent = (componentId) => structureComponents.has(componentId ?? '');\nconst isEmptyStructureWithRelativeHeight = (children, componentId, height) => {\n return (children === 0 &&\n isContentfulStructureComponent(componentId) &&\n !height?.toString().endsWith('px'));\n};\n\nconst findOutermostCoordinates = (first, second) => {\n return {\n top: Math.min(first.top, second.top),\n right: Math.max(first.right, second.right),\n bottom: Math.max(first.bottom, second.bottom),\n left: Math.min(first.left, second.left),\n };\n};\nconst getElementCoordinates = (element) => {\n const rect = element.getBoundingClientRect();\n /**\n * If element does not have children, or element has it's own width or height,\n * return the element's coordinates.\n */\n if (element.children.length === 0 || rect.width !== 0 || rect.height !== 0) {\n return rect;\n }\n const rects = [];\n /**\n * If element has children, or element does not have it's own width and height,\n * we find the cordinates of the children, and assume the outermost coordinates of the children\n * as the coordinate of the element.\n *\n * E.g child1 => {top: 2, bottom: 3, left: 4, right: 6} & child2 => {top: 1, bottom: 8, left: 12, right: 24}\n * The final assumed coordinates of the element would be => { top: 1, right: 24, bottom: 8, left: 4 }\n */\n for (const child of element.children) {\n const childRect = getElementCoordinates(child);\n if (childRect.width !== 0 || childRect.height !== 0) {\n const { top, right, bottom, left } = childRect;\n rects.push({ top, right, bottom, left });\n }\n }\n if (rects.length === 0) {\n return rect;\n }\n const { top, right, bottom, left } = rects.reduce(findOutermostCoordinates);\n return DOMRect.fromRect({\n x: left,\n y: top,\n height: bottom - top,\n width: right - left,\n });\n};\n\nclass ParseError extends Error {\n constructor(message) {\n super(message);\n }\n}\nconst isValidJsonObject = (s) => {\n try {\n const result = JSON.parse(s);\n if ('object' !== typeof result) {\n return false;\n }\n return true;\n }\n catch (e) {\n return false;\n }\n};\nconst doesMismatchMessageSchema = (event) => {\n try {\n tryParseMessage(event);\n return false;\n }\n catch (e) {\n if (e instanceof ParseError) {\n return e.message;\n }\n throw e;\n }\n};\nconst tryParseMessage = (event) => {\n if (!event.data) {\n throw new ParseError('Field event.data is missing');\n }\n if ('string' !== typeof event.data) {\n throw new ParseError(`Field event.data must be a string, instead of '${typeof event.data}'`);\n }\n if (!isValidJsonObject(event.data)) {\n throw new ParseError('Field event.data must be a valid JSON object serialized as string');\n }\n const eventData = JSON.parse(event.data);\n if (!eventData.source) {\n throw new ParseError(`Field eventData.source must be equal to 'composability-app'`);\n }\n if ('composability-app' !== eventData.source) {\n throw new ParseError(`Field eventData.source must be equal to 'composability-app', instead of '${eventData.source}'`);\n }\n // check eventData.eventType\n const supportedEventTypes = Object.values(INCOMING_EVENTS);\n if (!supportedEventTypes.includes(eventData.eventType)) {\n // Expected message: This message is handled in the EntityStore to store fetched entities\n if (eventData.eventType !== PostMessageMethods.REQUESTED_ENTITIES) {\n throw new ParseError(`Field eventData.eventType must be one of the supported values: [${supportedEventTypes.join(', ')}]`);\n }\n }\n return eventData;\n};\nconst validateExperienceBuilderConfig = ({ locale, isEditorMode, }) => {\n if (isEditorMode) {\n return;\n }\n if (!locale) {\n throw new Error('Parameter \"locale\" is required for experience builder initialization outside of editor mode');\n }\n};\n\nconst transformFill = (value) => (value === 'fill' ? '100%' : value);\nconst transformGridColumn = (span) => {\n if (!span) {\n return {};\n }\n return {\n gridColumn: `span ${span}`,\n };\n};\nconst transformBorderStyle = (value) => {\n if (!value)\n return {};\n const parts = value.split(' ');\n // Just accept the passed value\n if (parts.length < 3)\n return { border: value };\n // Replace the second part always with `solid` and set the box sizing accordingly\n const [borderSize, borderStyle, ...borderColorParts] = parts;\n const borderColor = borderColorParts.join(' ');\n return {\n border: `${borderSize} ${borderStyle} ${borderColor}`,\n };\n};\nconst transformAlignment = (cfHorizontalAlignment, cfVerticalAlignment, cfFlexDirection = 'column') => cfFlexDirection === 'row'\n ? {\n alignItems: cfHorizontalAlignment,\n justifyContent: cfVerticalAlignment === 'center' ? `safe ${cfVerticalAlignment}` : cfVerticalAlignment,\n }\n : {\n alignItems: cfVerticalAlignment,\n justifyContent: cfHorizontalAlignment === 'center'\n ? `safe ${cfHorizontalAlignment}`\n : cfHorizontalAlignment,\n };\nconst transformBackgroundImage = (cfBackgroundImageUrl, cfBackgroundImageOptions) => {\n const matchBackgroundSize = (scaling) => {\n if ('fill' === scaling)\n return 'cover';\n if ('fit' === scaling)\n return 'contain';\n };\n const matchBackgroundPosition = (alignment) => {\n if (!alignment || 'string' !== typeof alignment) {\n return;\n }\n let [horizontalAlignment, verticalAlignment] = alignment.trim().split(/\\s+/, 2);\n // Special case for handling single values\n // for backwards compatibility with single values 'right','left', 'center', 'top','bottom'\n if (horizontalAlignment && !verticalAlignment) {\n const singleValue = horizontalAlignment;\n switch (singleValue) {\n case 'left':\n horizontalAlignment = 'left';\n verticalAlignment = 'center';\n break;\n case 'right':\n horizontalAlignment = 'right';\n verticalAlignment = 'center';\n break;\n case 'center':\n horizontalAlignment = 'center';\n verticalAlignment = 'center';\n break;\n case 'top':\n horizontalAlignment = 'center';\n verticalAlignment = 'top';\n break;\n case 'bottom':\n horizontalAlignment = 'center';\n verticalAlignment = 'bottom';\n break;\n // just fall down to the normal validation logic for horiz and vert\n }\n }\n const isHorizontalValid = ['left', 'right', 'center'].includes(horizontalAlignment);\n const isVerticalValid = ['top', 'bottom', 'center'].includes(verticalAlignment);\n horizontalAlignment = isHorizontalValid ? horizontalAlignment : 'left';\n verticalAlignment = isVerticalValid ? verticalAlignment : 'top';\n return `${horizontalAlignment} ${verticalAlignment}`;\n };\n if (!cfBackgroundImageUrl) {\n return;\n }\n let backgroundImage;\n let backgroundImageSet;\n if (typeof cfBackgroundImageUrl === 'string') {\n backgroundImage = `url(${cfBackgroundImageUrl})`;\n }\n else {\n const imgSet = cfBackgroundImageUrl.srcSet?.join(',');\n backgroundImage = `url(${cfBackgroundImageUrl.url})`;\n backgroundImageSet = `image-set(${imgSet})`;\n }\n return {\n backgroundImage,\n backgroundImage2: backgroundImageSet,\n backgroundRepeat: cfBackgroundImageOptions?.scaling === 'tile' ? 'repeat' : 'no-repeat',\n backgroundPosition: matchBackgroundPosition(cfBackgroundImageOptions?.alignment),\n backgroundSize: matchBackgroundSize(cfBackgroundImageOptions?.scaling),\n };\n};\nconst transformWidthSizing = ({ value, cfMargin, }) => {\n if (!value || !cfMargin)\n return;\n const transformedValue = transformFill(value);\n const marginValues = cfMargin.split(' ');\n const rightMargin = marginValues[1] || '0px';\n const leftMargin = marginValues[3] || '0px';\n const calcValue = `calc(${transformedValue} - ${leftMargin} - ${rightMargin})`;\n /**\n * We want to check if the calculated value is valid CSS. If this fails,\n * this means the `transformedValue` is not a calculable value (not a px, rem, or %).\n * The value may instead be a string such as `min-content` or `max-content`. In\n * that case we don't want to use calc and instead return the raw value.\n */\n if (typeof window !== 'undefined' && CSS.supports('width', calcValue)) {\n return calcValue;\n }\n return transformedValue;\n};\n\nconst toCSSAttribute = (key) => {\n let val = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n // Remove the number from the end of the key to allow for overrides on style properties\n val = val.replace(/\\d+$/, '');\n return val;\n};\nconst buildStyleTag = ({ styles, nodeId }) => {\n const stylesStr = Object.entries(styles)\n .filter(([, value]) => value !== undefined)\n .reduce((acc, [key, value]) => `${acc}\n ${toCSSAttribute(key)}: ${value};`, '');\n const className = `cfstyles-${nodeId ? nodeId : md5(stylesStr)}`;\n const styleRule = `.${className}{ ${stylesStr} }`;\n return [className, styleRule];\n};\nconst buildCfStyles = ({ cfHorizontalAlignment, cfVerticalAlignment, cfFlexDirection, cfFlexWrap, cfMargin, cfPadding, cfBackgroundColor, cfWidth, cfHeight, cfMaxWidth, cfBorder, cfBorderRadius, cfGap, cfBackgroundImageUrl, cfBackgroundImageOptions, cfFontSize, cfFontWeight, cfImageOptions, cfLineHeight, cfLetterSpacing, cfTextColor, cfTextAlign, cfTextTransform, cfTextBold, cfTextItalic, cfTextUnderline, cfColumnSpan, }) => {\n return {\n margin: cfMargin,\n padding: cfPadding,\n backgroundColor: cfBackgroundColor,\n width: transformWidthSizing({ value: cfWidth || cfImageOptions?.width, cfMargin }),\n height: transformFill(cfHeight || cfImageOptions?.height),\n maxWidth: cfMaxWidth,\n ...transformGridColumn(cfColumnSpan),\n ...transformBorderStyle(cfBorder),\n borderRadius: cfBorderRadius,\n gap: cfGap,\n ...transformAlignment(cfHorizontalAlignment, cfVerticalAlignment, cfFlexDirection),\n flexDirection: cfFlexDirection,\n flexWrap: cfFlexWrap,\n ...transformBackgroundImage(cfBackgroundImageUrl, cfBackgroundImageOptions),\n fontSize: cfFontSize,\n fontWeight: cfTextBold ? 'bold' : cfFontWeight,\n fontStyle: cfTextItalic ? 'italic' : 'normal',\n lineHeight: cfLineHeight,\n letterSpacing: cfLetterSpacing,\n color: cfTextColor,\n textAlign: cfTextAlign,\n textTransform: cfTextTransform,\n textDecoration: cfTextUnderline ? 'underline' : 'none',\n boxSizing: 'border-box',\n objectFit: cfImageOptions?.objectFit,\n objectPosition: cfImageOptions?.objectPosition,\n };\n};\n/**\n * Container/section default behavior:\n * Default height => height: EMPTY_CONTAINER_HEIGHT (120px)\n * If a container component has children => height: 'fit-content'\n */\nconst calculateNodeDefaultHeight = ({ blockId, children, value, }) => {\n if (!blockId || !isContentfulStructureComponent(blockId) || value !== 'auto') {\n return value;\n }\n if (children.length) {\n return '100%';\n }\n return EMPTY_CONTAINER_HEIGHT;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction get(obj, path) {\n if (!path.length) {\n return obj;\n }\n try {\n const [currentPath, ...nextPath] = path;\n return get(obj[currentPath], nextPath);\n }\n catch (err) {\n return undefined;\n }\n}\n\nconst getBoundValue = (entryOrAsset, path) => {\n const value = get(entryOrAsset, path.split('/').slice(2, -1));\n return value && typeof value == 'object' && value.url\n ? value.url\n : value;\n};\n\nconst transformRichText = (entryOrAsset, path) => {\n const value = getBoundValue(entryOrAsset, path);\n if (typeof value === 'string') {\n return {\n data: {},\n content: [\n {\n nodeType: BLOCKS.PARAGRAPH,\n data: {},\n content: [\n {\n data: {},\n nodeType: 'text',\n value: value,\n marks: [],\n },\n ],\n },\n ],\n nodeType: BLOCKS.DOCUMENT,\n };\n }\n if (typeof value === 'object' && value.nodeType === BLOCKS.DOCUMENT) {\n return value;\n }\n return undefined;\n};\n\nfunction getOptimizedImageUrl(url, width, quality, format) {\n if (url.startsWith('//')) {\n url = 'https:' + url;\n }\n const params = new URLSearchParams();\n if (width) {\n params.append('w', width.toString());\n }\n if (quality && quality > 0 && quality < 100) {\n params.append('q', quality.toString());\n }\n if (format) {\n params.append('fm', format);\n }\n const queryString = params.toString();\n return `${url}${queryString ? '?' + queryString : ''}`;\n}\n\nfunction validateParams(file, quality, format) {\n if (!file.details.image) {\n throw Error('No image in file asset to transform');\n }\n if (quality < 0 || quality > 100) {\n throw Error('Quality must be between 0 and 100');\n }\n if (format && !SUPPORTED_IMAGE_FORMATS.includes(format)) {\n throw Error(`Format must be one of ${SUPPORTED_IMAGE_FORMATS.join(', ')}`);\n }\n return true;\n}\n\nconst MAX_WIDTH_ALLOWED$1 = 2000;\nconst getOptimizedBackgroundImageAsset = (file, widthStyle, quality = '100%', format) => {\n const qualityNumber = Number(quality.replace('%', ''));\n if (!validateParams(file, qualityNumber, format)) ;\n if (!validateParams(file, qualityNumber, format)) ;\n const url = file.url;\n const { width1x, width2x } = getWidths(widthStyle, file);\n const imageUrl1x = getOptimizedImageUrl(url, width1x, qualityNumber, format);\n const imageUrl2x = getOptimizedImageUrl(url, width2x, qualityNumber, format);\n const srcSet = [`url(${imageUrl1x}) 1x`, `url(${imageUrl2x}) 2x`];\n const returnedUrl = getOptimizedImageUrl(url, width2x, qualityNumber, format);\n const optimizedBackgroundImageAsset = {\n url: returnedUrl,\n srcSet,\n file,\n };\n return optimizedBackgroundImageAsset;\n function getWidths(widthStyle, file) {\n let width1x = 0;\n let width2x = 0;\n const intrinsicImageWidth = file.details.image.width;\n if (widthStyle.endsWith('px')) {\n width1x = Math.min(Number(widthStyle.replace('px', '')), intrinsicImageWidth);\n }\n else {\n width1x = Math.min(MAX_WIDTH_ALLOWED$1, intrinsicImageWidth);\n }\n width2x = Math.min(width1x * 2, intrinsicImageWidth);\n return { width1x, width2x };\n }\n};\n\nconst MAX_WIDTH_ALLOWED = 4000;\nconst getOptimizedImageAsset = (file, sizes, quality = '100%', format) => {\n const qualityNumber = Number(quality.replace('%', ''));\n if (!validateParams(file, qualityNumber, format)) ;\n const url = file.url;\n const maxWidth = Math.min(file.details.image.width, MAX_WIDTH_ALLOWED);\n const numOfParts = Math.max(2, Math.ceil(maxWidth / 500));\n const widthParts = Array.from({ length: numOfParts }, (_, index) => Math.ceil((index + 1) * (maxWidth / numOfParts)));\n const srcSet = sizes\n ? widthParts.map((width) => `${getOptimizedImageUrl(url, width, qualityNumber, format)} ${width}w`)\n : [];\n const intrinsicImageWidth = file.details.image.width;\n if (intrinsicImageWidth > MAX_WIDTH_ALLOWED) {\n srcSet.push(`${getOptimizedImageUrl(url, undefined, qualityNumber, format)} ${intrinsicImageWidth}w`);\n }\n const returnedUrl = getOptimizedImageUrl(url, file.details.image.width > 2000 ? 2000 : undefined, qualityNumber, format);\n const optimizedImageAsset = {\n url: returnedUrl,\n srcSet,\n sizes,\n file,\n };\n return optimizedImageAsset;\n};\n\nconst transformMedia = (asset, variables, resolveDesignValue, variableName, path) => {\n let value;\n //TODO: this will be better served by injectable type transformers instead of if statement\n if (variableName === 'cfImageAsset') {\n const optionsVariableName = 'cfImageOptions';\n const options = resolveDesignValue(variables[optionsVariableName]?.type === 'DesignValue'\n ? variables[optionsVariableName].valuesByBreakpoint\n : {}, optionsVariableName);\n if (!options) {\n console.error(`Error transforming image asset: Required variable [${optionsVariableName}] missing from component definition`);\n return;\n }\n try {\n value = getOptimizedImageAsset(asset.fields.file, options.targetSize, options.quality, options.format);\n return value;\n }\n catch (error) {\n console.error('Error transforming image asset', error);\n }\n return;\n }\n if (variableName === 'cfBackgroundImageUrl') {\n const width = resolveDesignValue(variables['cfWidth']?.type === 'DesignValue' ? variables['cfWidth'].valuesByBreakpoint : {}, 'cfWidth');\n const optionsVariableName = 'cfBackgroundImageOptions';\n const options = resolveDesignValue(variables[optionsVariableName]?.type === 'DesignValue'\n ? variables[optionsVariableName].valuesByBreakpoint\n : {}, optionsVariableName);\n if (!options) {\n console.error(`Error transforming image asset: Required variable [${optionsVariableName}] missing from component definition`);\n return;\n }\n try {\n value = getOptimizedBackgroundImageAsset(asset.fields.file, width, options.quality, options.format);\n return value;\n }\n catch (error) {\n console.error('Error transforming image asset', error);\n }\n return;\n }\n // return getBoundValue(asset, entityStore, binding, path);\n return getBoundValue(asset, path);\n};\n\nconst transformBoundContentValue = (variables, entityStore, binding, resolveDesignValue, variableName, variableDefinition, path) => {\n const entityOrAsset = entityStore.getEntryOrAsset(binding, path);\n if (!entityOrAsset)\n return;\n switch (variableDefinition.type) {\n case 'Media':\n return transformMedia(entityOrAsset, variables, resolveDesignValue, variableName, path);\n case 'RichText':\n return transformRichText(entityOrAsset, path);\n default:\n return getBoundValue(entityOrAsset, path);\n }\n};\n\nconst getDataFromTree = (tree) => {\n let dataSource = {};\n let unboundValues = {};\n const queue = [...tree.root.children];\n while (queue.length) {\n const node = queue.shift();\n if (!node) {\n continue;\n }\n dataSource = { ...dataSource, ...node.data.dataSource };\n unboundValues = { ...unboundValues, ...node.data.unboundValues };\n if (node.children.length) {\n queue.push(...node.children);\n }\n }\n return {\n dataSource,\n unboundValues,\n };\n};\n/**\n * Gets calculates the index to drop the dragged component based on the mouse position\n * @returns {InsertionData} a object containing a node that will become a parent for dragged component and index at which it must be inserted\n */\nconst getInsertionData = ({ dropReceiverParentNode, dropReceiverNode, flexDirection, isMouseAtTopBorder, isMouseAtBottomBorder, isMouseInLeftHalf, isMouseInUpperHalf, isOverTopIndicator, isOverBottomIndicator, }) => {\n const APPEND_INSIDE = dropReceiverNode.children.length;\n const PREPEND_INSIDE = 0;\n if (isMouseAtTopBorder || isMouseAtBottomBorder) {\n const indexOfSectionInParentChildren = dropReceiverParentNode.children.findIndex((n) => n.data.id === dropReceiverNode.data.id);\n const APPEND_OUTSIDE = indexOfSectionInParentChildren + 1;\n const PREPEND_OUTSIDE = indexOfSectionInParentChildren;\n return {\n // when the mouse is around the border we want to drop the new component as a new section onto the root node\n node: dropReceiverParentNode,\n index: isMouseAtBottomBorder ? APPEND_OUTSIDE : PREPEND_OUTSIDE,\n };\n }\n // if over one of the section indicators\n if (isOverTopIndicator || isOverBottomIndicator) {\n const indexOfSectionInParentChildren = dropReceiverParentNode.children.findIndex((n) => n.data.id === dropReceiverNode.data.id);\n const APPEND_OUTSIDE = indexOfSectionInParentChildren + 1;\n const PREPEND_OUTSIDE = indexOfSectionInParentChildren;\n return {\n // when the mouse is around the border we want to drop the new component as a new section onto the root node\n node: dropReceiverParentNode,\n index: isOverBottomIndicator ? APPEND_OUTSIDE : PREPEND_OUTSIDE,\n };\n }\n if (flexDirection === undefined || flexDirection === 'row') {\n return {\n node: dropReceiverNode,\n index: isMouseInLeftHalf ? PREPEND_INSIDE : APPEND_INSIDE,\n };\n }\n else {\n return {\n node: dropReceiverNode,\n index: isMouseInUpperHalf ? PREPEND_INSIDE : APPEND_INSIDE,\n };\n }\n};\nconst generateRandomId = (letterCount) => {\n const LETTERS = 'abcdefghijklmnopqvwxyzABCDEFGHIJKLMNOPQVWXYZ';\n const NUMS = '0123456789';\n const ALNUM = NUMS + LETTERS;\n const times = (n, callback) => Array.from({ length: n }, callback);\n const random = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;\n return times(letterCount, () => ALNUM[random(0, ALNUM.length - 1)]).join('');\n};\nconst checkIsAssemblyNode = ({ componentId, usedComponents, }) => {\n if (!usedComponents?.length)\n return false;\n return usedComponents.some((usedComponent) => usedComponent.sys.id === componentId);\n};\n/** @deprecated use `checkIsAssemblyNode` instead. Will be removed with SDK v5. */\nconst checkIsAssembly = checkIsAssemblyNode;\n/**\n * This check assumes that the entry is already ensured to be an experience, i.e. the\n * content type of the entry is an experience type with the necessary annotations.\n **/\nconst checkIsAssemblyEntry = (entry) => {\n return Boolean(entry.fields?.componentSettings);\n};\nconst checkIsAssemblyDefinition = (component) => component?.category === ASSEMBLY_DEFAULT_CATEGORY;\n\nconst isExperienceEntry = (entry) => {\n return (entry?.sys?.type === 'Entry' &&\n !!entry.fields?.title &&\n !!entry.fields?.slug &&\n !!entry.fields?.componentTree &&\n Array.isArray(entry.fields.componentTree.breakpoints) &&\n Array.isArray(entry.fields.componentTree.children) &&\n typeof entry.fields.componentTree.schemaVersion === 'string');\n};\n\nconst supportedModes = ['delivery', 'preview', 'editor'];\n\nconst builtInStyles = {\n cfVerticalAlignment: {\n validations: {\n in: [\n {\n value: 'start',\n displayName: 'Align left',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'end',\n displayName: 'Align right',\n },\n ],\n },\n type: 'Text',\n group: 'style',\n description: 'The horizontal alignment of the section',\n defaultValue: 'center',\n displayName: 'Vertical alignment',\n },\n cfHorizontalAlignment: {\n validations: {\n in: [\n {\n value: 'start',\n displayName: 'Align top',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'end',\n displayName: 'Align bottom',\n },\n ],\n },\n type: 'Text',\n group: 'style',\n description: 'The horizontal alignment of the section',\n defaultValue: 'center',\n displayName: 'Horizontal alignment',\n },\n cfMargin: {\n displayName: 'Margin',\n type: 'Text',\n group: 'style',\n description: 'The margin of the section',\n defaultValue: '0 0 0 0',\n },\n cfPadding: {\n displayName: 'Padding',\n type: 'Text',\n group: 'style',\n description: 'The padding of the section',\n defaultValue: '0 0 0 0',\n },\n cfBackgroundColor: {\n displayName: 'Background color',\n type: 'Text',\n group: 'style',\n description: 'The background color of the section',\n defaultValue: 'rgba(255, 255, 255, 0)',\n },\n cfWidth: {\n displayName: 'Width',\n type: 'Text',\n group: 'style',\n description: 'The width of the section',\n defaultValue: 'fill',\n },\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the section',\n defaultValue: 'fit-content',\n },\n cfMaxWidth: {\n displayName: 'Max width',\n type: 'Text',\n group: 'style',\n description: 'The max-width of the section',\n defaultValue: 'none',\n },\n cfFlexDirection: {\n displayName: 'Direction',\n type: 'Text',\n group: 'style',\n description: 'The orientation of the section',\n defaultValue: 'column',\n },\n cfFlexWrap: {\n displayName: 'Wrap objects',\n type: 'Text',\n group: 'style',\n description: 'Wrap objects',\n defaultValue: 'nowrap',\n },\n cfBorder: {\n displayName: 'Border',\n type: 'Text',\n group: 'style',\n description: 'The border of the section',\n defaultValue: '0px solid rgba(0, 0, 0, 0)',\n },\n cfBorderRadius: {\n displayName: 'Border Radius',\n type: 'Text',\n group: 'style',\n description: 'The border radius of the section',\n defaultValue: '0px',\n },\n cfGap: {\n displayName: 'Gap',\n type: 'Text',\n group: 'style',\n description: 'The spacing between the elements of the section',\n defaultValue: '0px',\n },\n cfHyperlink: {\n displayName: 'Hyperlink',\n type: 'Text',\n defaultValue: '',\n validations: {\n format: 'URL',\n },\n description: 'hyperlink for section or container',\n },\n cfOpenInNewTab: {\n displayName: 'Hyperlink behaviour',\n type: 'Boolean',\n defaultValue: false,\n description: 'To open hyperlink in new Tab or not',\n },\n};\nconst optionalBuiltInStyles = {\n cfFontSize: {\n displayName: 'Font Size',\n type: 'Text',\n group: 'style',\n description: 'The font size of the element',\n defaultValue: '16px',\n },\n cfFontWeight: {\n validations: {\n in: [\n {\n value: '400',\n displayName: 'Normal',\n },\n {\n value: '500',\n displayName: 'Medium',\n },\n {\n value: '600',\n displayName: 'Semi Bold',\n },\n ],\n },\n displayName: 'Font Weight',\n type: 'Text',\n group: 'style',\n description: 'The font weight of the element',\n defaultValue: '400',\n },\n cfImageAsset: {\n displayName: 'Image',\n type: 'Media',\n description: 'Image to display',\n },\n cfImageOptions: {\n displayName: 'Image options',\n type: 'Object',\n group: 'style',\n defaultValue: {\n width: DEFAULT_IMAGE_WIDTH,\n height: '100%',\n targetSize: DEFAULT_IMAGE_WIDTH,\n },\n },\n cfBackgroundImageUrl: {\n displayName: 'Background image',\n type: 'Media',\n description: 'Background image for component',\n },\n cfBackgroundImageOptions: {\n displayName: 'Background image options',\n type: 'Object',\n group: 'style',\n defaultValue: {\n scaling: 'fill',\n alignment: 'left top',\n targetSize: '2000px',\n },\n },\n cfLineHeight: {\n displayName: 'Line Height',\n type: 'Text',\n group: 'style',\n description: 'The line height of the element',\n defaultValue: '20px',\n },\n cfLetterSpacing: {\n displayName: 'Letter Spacing',\n type: 'Text',\n group: 'style',\n description: 'The letter spacing of the element',\n defaultValue: '0px',\n },\n cfTextColor: {\n displayName: 'Text Color',\n type: 'Text',\n group: 'style',\n description: 'The text color of the element',\n defaultValue: 'rgba(0, 0, 0, 1)',\n },\n cfTextAlign: {\n validations: {\n in: [\n {\n value: 'left',\n displayName: 'Align left',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'right',\n displayName: 'Align right',\n },\n ],\n },\n displayName: 'Text Align',\n type: 'Text',\n group: 'style',\n description: 'The text alignment of the element',\n defaultValue: 'left',\n },\n cfTextTransform: {\n validations: {\n in: [\n {\n value: 'none',\n displayName: 'Normal',\n },\n {\n value: 'capitalize',\n displayName: 'Capitalize',\n },\n {\n value: 'uppercase',\n displayName: 'Uppercase',\n },\n {\n value: 'lowercase',\n displayName: 'Lowercase',\n },\n ],\n },\n displayName: 'Text Transform',\n type: 'Text',\n group: 'style',\n description: 'The text transform of the element',\n defaultValue: 'none',\n },\n cfTextBold: {\n displayName: 'Bold',\n type: 'Boolean',\n group: 'style',\n description: 'The text bold of the element',\n defaultValue: false,\n },\n cfTextItalic: {\n displayName: 'Italic',\n type: 'Boolean',\n group: 'style',\n description: 'The text italic of the element',\n defaultValue: false,\n },\n cfTextUnderline: {\n displayName: 'Underline',\n type: 'Boolean',\n group: 'style',\n description: 'The text underline of the element',\n defaultValue: false,\n },\n};\nconst sectionBuiltInStyles = {\n ...builtInStyles,\n cfBackgroundImageUrl: optionalBuiltInStyles.cfBackgroundImageUrl,\n cfBackgroundImageOptions: optionalBuiltInStyles.cfBackgroundImageOptions,\n};\nconst containerBuiltInStyles = {\n ...builtInStyles,\n cfBackgroundImageUrl: optionalBuiltInStyles.cfBackgroundImageUrl,\n cfBackgroundImageOptions: optionalBuiltInStyles.cfBackgroundImageOptions,\n cfMaxWidth: {\n displayName: 'Max Width',\n type: 'Text',\n group: 'style',\n description: 'The max-width of the section',\n defaultValue: '1192px',\n },\n};\nconst singleColumnBuiltInStyles = {\n cfBackgroundImageUrl: optionalBuiltInStyles.cfBackgroundImageUrl,\n cfBackgroundImageOptions: optionalBuiltInStyles.cfBackgroundImageOptions,\n cfVerticalAlignment: {\n validations: {\n in: [\n {\n value: 'start',\n displayName: 'Align left',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'end',\n displayName: 'Align right',\n },\n ],\n },\n type: 'Text',\n group: 'style',\n description: 'The horizontal alignment of the column',\n defaultValue: 'center',\n displayName: 'Vertical alignment',\n },\n cfHorizontalAlignment: {\n validations: {\n in: [\n {\n value: 'start',\n displayName: 'Align top',\n },\n {\n value: 'center',\n displayName: 'Align center',\n },\n {\n value: 'end',\n displayName: 'Align bottom',\n },\n ],\n },\n type: 'Text',\n group: 'style',\n description: 'The horizontal alignment of the column',\n defaultValue: 'center',\n displayName: 'Horizontal alignment',\n },\n cfPadding: {\n displayName: 'Padding',\n type: 'Text',\n group: 'style',\n description: 'The padding of the column',\n defaultValue: '0 0 0 0',\n },\n cfBackgroundColor: {\n displayName: 'Background color',\n type: 'Text',\n group: 'style',\n description: 'The background color of the column',\n defaultValue: 'rgba(255, 255, 255, 0)',\n },\n cfFlexDirection: {\n displayName: 'Direction',\n type: 'Text',\n group: 'style',\n description: 'The orientation of the column',\n defaultValue: 'column',\n },\n cfFlexWrap: {\n displayName: 'Wrap objects',\n type: 'Text',\n group: 'style',\n description: 'Wrap objects',\n defaultValue: 'nowrap',\n },\n cfBorder: {\n displayName: 'Border',\n type: 'Text',\n group: 'style',\n description: 'The border of the column',\n defaultValue: '0px solid rgba(0, 0, 0, 0)',\n },\n cfBorderRadius: {\n displayName: 'Border Radius',\n type: 'Text',\n group: 'style',\n description: 'The border radius of the column',\n defaultValue: '0px',\n },\n cfGap: {\n displayName: 'Gap',\n type: 'Text',\n group: 'style',\n description: 'The spacing between the elements of the column',\n defaultValue: '0px',\n },\n cfColumnSpan: {\n type: 'Text',\n defaultValue: '6',\n group: 'style',\n },\n cfColumnSpanLock: {\n type: 'Boolean',\n defaultValue: false,\n group: 'style',\n },\n};\nconst columnsBuiltInStyles = {\n cfBackgroundImageUrl: optionalBuiltInStyles.cfBackgroundImageUrl,\n cfBackgroundImageOptions: optionalBuiltInStyles.cfBackgroundImageOptions,\n cfMargin: {\n displayName: 'Margin',\n type: 'Text',\n group: 'style',\n description: 'The margin of the columns',\n defaultValue: '0 0 0 0',\n },\n cfWidth: {\n displayName: 'Width',\n type: 'Text',\n group: 'style',\n description: 'The width of the columns',\n defaultValue: 'fill',\n },\n cfMaxWidth: {\n displayName: 'Max width',\n type: 'Text',\n group: 'style',\n description: 'The max-width of the columns',\n defaultValue: '1192px',\n },\n cfPadding: {\n displayName: 'Padding',\n type: 'Text',\n group: 'style',\n description: 'The padding of the columns',\n defaultValue: '10px 10px 10px 10px',\n },\n cfBackgroundColor: {\n displayName: 'Background color',\n type: 'Text',\n group: 'style',\n description: 'The background color of the columns',\n defaultValue: 'rgba(255, 255, 255, 0)',\n },\n cfBorder: {\n displayName: 'Border',\n type: 'Text',\n group: 'style',\n description: 'The border of the columns',\n defaultValue: '0px solid rgba(0, 0, 0, 0)',\n },\n cfBorderRadius: {\n displayName: 'Border Radius',\n type: 'Text',\n group: 'style',\n description: 'The border radius of the columns',\n defaultValue: '0px',\n },\n cfGap: {\n displayName: 'Gap',\n type: 'Text',\n group: 'style',\n description: 'The spacing between the elements of the columns',\n defaultValue: '10px 10px',\n },\n cfColumns: {\n type: 'Text',\n defaultValue: '[6,6]',\n group: 'style',\n },\n cfWrapColumns: {\n type: 'Boolean',\n defaultValue: false,\n group: 'style',\n },\n cfWrapColumnsCount: {\n type: 'Text',\n defaultValue: '2',\n group: 'style',\n },\n};\n\nconst designTokensRegistry = {};\n/**\n * Register design tokens styling\n * @param designTokenDefinition - {[key:string]: Record<string, string>}\n * @returns void\n */\nconst defineDesignTokens = (designTokenDefinition) => {\n Object.assign(designTokensRegistry, designTokenDefinition);\n};\nconst templateStringRegex = /\\${(.+?)}/g;\nconst getDesignTokenRegistration = (breakpointValue, variableName) => {\n if (!breakpointValue)\n return breakpointValue;\n let resolvedValue = '';\n for (const part of breakpointValue.split(' ')) {\n const tokenValue = templateStringRegex.test(part)\n ? resolveSimpleDesignToken(part, variableName)\n : part;\n resolvedValue += `${tokenValue} `;\n }\n // Not trimming would end up with a trailing space that breaks the check in `calculateNodeDefaultHeight`\n return resolvedValue.trim();\n};\nconst resolveSimpleDesignToken = (templateString, variableName) => {\n const nonTemplateValue = templateString.replace(templateStringRegex, '$1');\n const [tokenCategory, tokenName] = nonTemplateValue.split('.');\n const tokenValues = designTokensRegistry[tokenCategory];\n if (tokenValues && tokenValues[tokenName]) {\n if (variableName === 'cfBorder') {\n const { width, style, color } = tokenValues[tokenName];\n return `${width} ${style} ${color}`;\n }\n return tokenValues[tokenName];\n }\n if (builtInStyles[variableName]) {\n return builtInStyles[variableName].defaultValue;\n }\n if (optionalBuiltInStyles[variableName]) {\n return optionalBuiltInStyles[variableName].defaultValue;\n }\n return '0px';\n};\n\nconst MEDIA_QUERY_REGEXP = /(<|>)(\\d{1,})(px|cm|mm|in|pt|pc)$/;\nconst toCSSMediaQuery = ({ query }) => {\n if (query === '*')\n return undefined;\n const match = query.match(MEDIA_QUERY_REGEXP);\n if (!match)\n return undefined;\n const [, operator, value, unit] = match;\n if (operator === '<') {\n const maxScreenWidth = Number(value) - 1;\n return `(max-width: ${maxScreenWidth}${unit})`;\n }\n else if (operator === '>') {\n const minScreenWidth = Number(value) + 1;\n return `(min-width: ${minScreenWidth}${unit})`;\n }\n return undefined;\n};\n// Remove this helper when upgrading to TypeScript 5.0 - https://github.com/microsoft/TypeScript/issues/48829\nconst findLast = (array, predicate) => {\n return array.reverse().find(predicate);\n};\n// Initialise media query matchers. This won't include the always matching fallback breakpoint.\nconst mediaQueryMatcher = (breakpoints) => {\n const mediaQueryMatches = {};\n const mediaQueryMatchers = breakpoints\n .map((breakpoint) => {\n const cssMediaQuery = toCSSMediaQuery(breakpoint);\n if (!cssMediaQuery)\n return undefined;\n if (typeof window === 'undefined')\n return undefined;\n const mediaQueryMatcher = window.matchMedia(cssMediaQuery);\n mediaQueryMatches[breakpoint.id] = mediaQueryMatcher.matches;\n return { id: breakpoint.id, signal: mediaQueryMatcher };\n })\n .filter((matcher) => !!matcher);\n return [mediaQueryMatchers, mediaQueryMatches];\n};\nconst getActiveBreakpointIndex = (breakpoints, mediaQueryMatches, fallbackBreakpointIndex) => {\n // The breakpoints are ordered (desktop-first: descending by screen width)\n const breakpointsWithMatches = breakpoints.map(({ id }, index) => ({\n id,\n index,\n // The fallback breakpoint with wildcard query will always match\n isMatch: mediaQueryMatches[id] ?? index === fallbackBreakpointIndex,\n }));\n // Find the last breakpoint in the list that matches (desktop-first: the narrowest one)\n const mostSpecificIndex = findLast(breakpointsWithMatches, ({ isMatch }) => isMatch)?.index;\n return mostSpecificIndex ?? fallbackBreakpointIndex;\n};\nconst getFallbackBreakpointIndex = (breakpoints) => {\n // We assume that there will be a single breakpoint which uses the wildcard query.\n // If there is none, we just take the first one in the list.\n return Math.max(breakpoints.findIndex(({ query }) => query === '*'), 0);\n};\nconst builtInStylesWithDesignTokens = [\n 'cfMargin',\n 'cfPadding',\n 'cfGap',\n 'cfWidth',\n 'cfHeight',\n 'cfBackgroundColor',\n 'cfBorder',\n 'cfBorderRadius',\n 'cfFontSize',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n];\nconst getValueForBreakpoint = (valuesByBreakpoint, breakpoints, activeBreakpointIndex, variableName) => {\n const eventuallyResolveDesignTokens = (value) => {\n // For some built-in design propertier, we support design tokens\n if (builtInStylesWithDesignTokens.includes(variableName)) {\n return getDesignTokenRegistration(value, variableName);\n }\n // For all other properties, we just return the breakpoint-specific value\n return value;\n };\n if (valuesByBreakpoint instanceof Object) {\n // Assume that the values are sorted by media query to apply the cascading CSS logic\n for (let index = activeBreakpointIndex; index >= 0; index--) {\n const breakpointId = breakpoints[index].id;\n if (valuesByBreakpoint[breakpointId]) {\n // If the value is defined, we use it and stop the breakpoints cascade\n return eventuallyResolveDesignTokens(valuesByBreakpoint[breakpointId]);\n }\n }\n // If no breakpoint matched, we search and apply the fallback breakpoint\n const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);\n const fallbackBreakpointId = breakpoints[fallbackBreakpointIndex].id;\n return eventuallyResolveDesignTokens(valuesByBreakpoint[fallbackBreakpointId]);\n }\n else {\n // Old design properties did not support breakpoints, keep for backward compatibility\n return valuesByBreakpoint;\n }\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isLinkToAsset = (variable) => {\n if (!variable)\n return false;\n if (typeof variable !== 'object')\n return false;\n return (variable.sys?.linkType === 'Asset' &&\n typeof variable.sys?.id === 'string' &&\n !!variable.sys?.id &&\n variable.sys?.type === 'Link');\n};\n\nconst isLink = (maybeLink) => {\n if (maybeLink === null)\n return false;\n if (typeof maybeLink !== 'object')\n return false;\n const link = maybeLink;\n return Boolean(link.sys?.id) && link.sys?.type === 'Link';\n};\n\n/**\n * This module encapsulates format of the path to a deep reference.\n */\nconst parseDataSourcePathIntoFieldset = (path) => {\n const parsedPath = parseDeepPath(path);\n if (null === parsedPath) {\n throw new Error(`Cannot parse path '${path}' as deep path`);\n }\n return parsedPath.fields.map((field) => [null, field, '~locale']);\n};\n/**\n * Parse path into components, supports L1 references (one reference follow) atm.\n * @param path from data source. eg. `/uuid123/fields/image/~locale/fields/file/~locale`\n * eg. `/uuid123/fields/file/~locale/fields/title/~locale`\n * @returns\n */\nconst parseDataSourcePathWithL1DeepBindings = (path) => {\n const parsedPath = parseDeepPath(path);\n if (null === parsedPath) {\n throw new Error(`Cannot parse path '${path}' as deep path`);\n }\n return {\n key: parsedPath.key,\n field: parsedPath.fields[0],\n referentField: parsedPath.fields[1],\n };\n};\n/**\n * Detects if paths is valid deep-path, like:\n * - /gV6yKXp61hfYrR7rEyKxY/fields/mainStory/~locale/fields/cover/~locale/fields/title/~locale\n * or regular, like:\n * - /6J8eA60yXwdm5eyUh9fX6/fields/mainStory/~locale\n * @returns\n */\nconst isDeepPath = (deepPathCandidate) => {\n const deepPathParsed = parseDeepPath(deepPathCandidate);\n if (!deepPathParsed) {\n return false;\n }\n return deepPathParsed.fields.length > 1;\n};\nconst parseDeepPath = (deepPathCandidate) => {\n // ALGORITHM:\n // We start with deep path in form:\n // /uuid123/fields/mainStory/~locale/fields/cover/~locale/fields/title/~locale\n // First turn string into array of segments\n // ['', 'uuid123', 'fields', 'mainStory', '~locale', 'fields', 'cover', '~locale', 'fields', 'title', '~locale']\n // Then group segments into intermediate represenatation - chunks, where each non-initial chunk starts with 'fields'\n // [\n // [ \"\", \"uuid123\" ],\n // [ \"fields\", \"mainStory\", \"~locale\" ],\n // [ \"fields\", \"cover\", \"~locale\" ],\n // [ \"fields\", \"title\", \"~locale\" ]\n // ]\n // Then check \"initial\" chunk for corretness\n // Then check all \"field-leading\" chunks for correctness\n const isValidInitialChunk = (initialChunk) => {\n // must have start with '' and have at least 2 segments, second non-empty\n // eg. /-_432uuid123123\n return /^\\/([^/^~]+)$/.test(initialChunk.join('/'));\n };\n const isValidFieldChunk = (fieldChunk) => {\n // must start with 'fields' and have at least 3 segments, second non-empty and last segment must be '~locale'\n // eg. fields/-32234mainStory/~locale\n return /^fields\\/[^/^~]+\\/~locale$/.test(fieldChunk.join('/'));\n };\n const deepPathSegments = deepPathCandidate.split('/');\n const chunks = chunkSegments(deepPathSegments, { startNextChunkOnElementEqualTo: 'fields' });\n if (chunks.length <= 1) {\n return null; // malformed path, even regular paths have at least 2 chunks\n }\n else if (chunks.length === 2) {\n return null; // deep paths have at least 3 chunks\n }\n // With 3+ chunks we can now check for deep path correctness\n const [initialChunk, ...fieldChunks] = chunks;\n if (!isValidInitialChunk(initialChunk)) {\n return null;\n }\n if (!fieldChunks.every(isValidFieldChunk)) {\n return null;\n }\n return {\n key: initialChunk[1], // pick uuid from initial chunk ['','uuid123'],\n fields: fieldChunks.map((fieldChunk) => fieldChunk[1]), // pick only fieldName eg. from ['fields','mainStory', '~locale'] we pick `mainStory`\n };\n};\nconst chunkSegments = (segments, { startNextChunkOnElementEqualTo }) => {\n const chunks = [];\n let currentChunk = [];\n const isSegmentBeginningOfChunk = (segment) => segment === startNextChunkOnElementEqualTo;\n const excludeEmptyChunks = (chunk) => chunk.length > 0;\n for (let i = 0; i < segments.length; i++) {\n const isInitialElement = i === 0;\n const segment = segments[i];\n if (isInitialElement) {\n currentChunk = [segment];\n }\n else if (isSegmentBeginningOfChunk(segment)) {\n chunks.push(currentChunk);\n currentChunk = [segment];\n }\n else {\n currentChunk.push(segment);\n }\n }\n chunks.push(currentChunk);\n return chunks.filter(excludeEmptyChunks);\n};\n\nconst sectionDefinition = {\n id: CONTENTFUL_COMPONENTS.section.id,\n name: CONTENTFUL_COMPONENTS.section.name,\n category: CONTENTFUL_COMPONENT_CATEGORY,\n children: true,\n variables: sectionBuiltInStyles,\n tooltip: {\n description: 'Create a new full width section of your experience by dragging this component onto the canvas. Other components and patterns can be added into a section.',\n },\n};\nconst containerDefinition = {\n id: CONTENTFUL_COMPONENTS.container.id,\n name: CONTENTFUL_COMPONENTS.container.name,\n category: CONTENTFUL_COMPONENT_CATEGORY,\n children: true,\n variables: containerBuiltInStyles,\n tooltip: {\n description: 'Create a new area or pattern within your page layout by dragging a container onto the canvas. Other components and patterns can be added into a container.',\n },\n};\nconst columnsDefinition = {\n id: CONTENTFUL_COMPONENTS.columns.id,\n name: CONTENTFUL_COMPONENTS.columns.name,\n category: CONTENTFUL_COMPONENT_CATEGORY,\n children: true,\n variables: columnsBuiltInStyles,\n tooltip: {\n description: 'Add columns to a container to create your desired layout and ensure that the experience is responsive across different screen sizes.',\n },\n};\nconst singleColumnDefinition = {\n id: CONTENTFUL_COMPONENTS.singleColumn.id,\n name: CONTENTFUL_COMPONENTS.singleColumn.name,\n category: CONTENTFUL_COMPONENT_CATEGORY,\n children: true,\n variables: singleColumnBuiltInStyles,\n};\n\nconst sendMessage = (eventType, data) => {\n if (typeof window === 'undefined') {\n return;\n }\n console.debug(`[experiences-sdk-react::sendMessage] Sending message [${eventType}]`, {\n source: 'customer-app',\n eventType,\n payload: data,\n });\n window.parent?.postMessage({\n source: 'customer-app',\n eventType,\n payload: data,\n }, '*');\n};\n\n/**\n * Base Store for entities\n * Can be extended for the different loading behaviours (editor, production, ..)\n */\nclass EntityStoreBase {\n constructor({ entities, locale }) {\n this.entryMap = new Map();\n this.assetMap = new Map();\n this.locale = locale;\n for (const entity of entities) {\n this.addEntity(entity);\n }\n }\n get entities() {\n return [...this.entryMap.values(), ...this.assetMap.values()];\n }\n updateEntity(entity) {\n this.addEntity(entity);\n }\n getEntryOrAsset(linkOrEntryOrAsset, path) {\n if (isDeepPath(path)) {\n return this.getDeepEntry(linkOrEntryOrAsset, path);\n }\n let entity;\n if (isLink(linkOrEntryOrAsset)) {\n const resolvedEntity = linkOrEntryOrAsset.sys.linkType === 'Entry'\n ? this.entryMap.get(linkOrEntryOrAsset.sys.id)\n : this.assetMap.get(linkOrEntryOrAsset.sys.id);\n if (!resolvedEntity || resolvedEntity.sys.type !== linkOrEntryOrAsset.sys.linkType) {\n console.warn(`Experience references unresolved entity: ${JSON.stringify(linkOrEntryOrAsset)}`);\n return;\n }\n entity = resolvedEntity;\n }\n else {\n // We already have the complete entity in preview & delivery (resolved by the CMA client)\n entity = linkOrEntryOrAsset;\n }\n return entity;\n }\n /**\n * @deprecated in the base class this should be simply an abstract method\n * @param entityLink\n * @param path\n * @returns\n */\n getValue(entityLink, path) {\n const entity = this.getEntity(entityLink.sys.linkType, entityLink.sys.id);\n if (!entity) {\n // TODO: move to `debug` utils once it is extracted\n console.warn(`Unresolved entity reference: ${entityLink.sys.linkType} with ID ${entityLink.sys.id}`);\n return;\n }\n return get(entity, path);\n }\n getEntityFromLink(link) {\n const resolvedEntity = link.sys.linkType === 'Entry'\n ? this.entryMap.get(link.sys.id)\n : this.assetMap.get(link.sys.id);\n if (!resolvedEntity || resolvedEntity.sys.type !== link.sys.linkType) {\n console.warn(`Experience references unresolved entity: ${JSON.stringify(link)}`);\n return;\n }\n return resolvedEntity;\n }\n getEntitiesFromMap(type, ids) {\n const resolved = [];\n const missing = [];\n for (const id of ids) {\n const entity = this.getEntity(type, id);\n if (entity) {\n resolved.push(entity);\n }\n else {\n missing.push(id);\n }\n }\n return {\n resolved,\n missing,\n };\n }\n addEntity(entity) {\n if (this.isAsset(entity)) {\n this.assetMap.set(entity.sys.id, entity);\n }\n else {\n this.entryMap.set(entity.sys.id, entity);\n }\n }\n async fetchAsset(id) {\n const { resolved, missing } = this.getEntitiesFromMap('Asset', [id]);\n if (missing.length) {\n // TODO: move to `debug` utils once it is extracted\n console.warn(`Asset \"${id}\" is not in the store`);\n return;\n }\n return resolved[0];\n }\n async fetchAssets(ids) {\n const { resolved, missing } = this.getEntitiesFromMap('Asset', ids);\n if (missing.length) {\n throw new Error(`Missing assets in the store (${missing.join(',')})`);\n }\n return resolved;\n }\n async fetchEntry(id) {\n const { resolved, missing } = this.getEntitiesFromMap('Entry', [id]);\n if (missing.length) {\n // TODO: move to `debug` utils once it is extracted\n console.warn(`Entry \"${id}\" is not in the store`);\n return;\n }\n return resolved[0];\n }\n async fetchEntries(ids) {\n const { resolved, missing } = this.getEntitiesFromMap('Entry', ids);\n if (missing.length) {\n throw new Error(`Missing assets in the store (${missing.join(',')})`);\n }\n return resolved;\n }\n getDeepEntry(linkOrEntryOrAsset, path) {\n const resolveFieldset = (unresolvedFieldset, headEntry) => {\n const resolvedFieldset = [];\n let entityToResolveFieldsFrom = headEntry;\n for (let i = 0; i < unresolvedFieldset.length; i++) {\n const isLeaf = i === unresolvedFieldset.length - 1; // with last row, we are not expecting a link, but a value\n const row = unresolvedFieldset[i];\n const [, field, _localeQualifier] = row;\n if (!entityToResolveFieldsFrom) {\n throw new Error(`Logic Error: Cannot resolve field ${field} of a fieldset as there is no entity to resolve it from.`);\n }\n if (isLeaf) {\n resolvedFieldset.push([entityToResolveFieldsFrom, field, _localeQualifier]);\n break;\n }\n const fieldValue = get(entityToResolveFieldsFrom, ['fields', field]);\n if (undefined === fieldValue) {\n return {\n resolvedFieldset,\n isFullyResolved: false,\n reason: `Cannot resolve field Link<${entityToResolveFieldsFrom.sys.type}>(sys.id=${entityToResolveFieldsFrom.sys.id}).fields[${field}] as field value is not defined`,\n };\n }\n else if (isLink(fieldValue)) {\n const entity = this.getEntityFromLink(fieldValue);\n if (entity === undefined) {\n return {\n resolvedFieldset,\n isFullyResolved: false,\n reason: `Field reference Link (sys.id=${fieldValue.sys.id}) not found in the EntityStore, waiting...`,\n };\n }\n resolvedFieldset.push([entityToResolveFieldsFrom, field, _localeQualifier]);\n entityToResolveFieldsFrom = entity; // we move up\n }\n else {\n // TODO: Eg. when someone changed the schema and the field is not a link anymore, what should we return then?\n throw new Error(`LogicError: Invalid value of a field we consider a reference field. Cannot resolve field ${field} of a fieldset as it is not a link, neither undefined.`);\n }\n }\n return {\n resolvedFieldset,\n isFullyResolved: true,\n };\n };\n const headEntity = isLink(linkOrEntryOrAsset)\n ? this.getEntityFromLink(linkOrEntryOrAsset)\n : linkOrEntryOrAsset;\n if (undefined === headEntity) {\n return;\n }\n const unresolvedFieldset = parseDataSourcePathIntoFieldset(path);\n // The purpose here is to take this intermediate representation of the deep-path\n // and to follow the links to the leaf-entity and field\n // in case we can't follow till the end, we should signal that there was null-reference in the path\n const { resolvedFieldset, isFullyResolved, reason } = resolveFieldset(unresolvedFieldset, headEntity);\n if (!isFullyResolved) {\n reason &&\n console.debug(`[exp-builder.sdk::EntityStoreBased::getValueDeep()] Deep path wasn't resolved till leaf node, falling back to undefined, because: ${reason}`);\n return;\n }\n const [leafEntity] = resolvedFieldset[resolvedFieldset.length - 1];\n return leafEntity;\n }\n isAsset(entity) {\n return entity.sys.type === 'Asset';\n }\n getEntity(type, id) {\n if (type === 'Asset') {\n return this.assetMap.get(id);\n }\n return this.entryMap.get(id);\n }\n toJSON() {\n return {\n entryMap: Object.fromEntries(this.entryMap),\n assetMap: Object.fromEntries(this.assetMap),\n locale: this.locale,\n };\n }\n}\n\n/**\n * EntityStore which resolves entries and assets from the editor\n * over the sendMessage and subscribe functions.\n */\nclass EditorEntityStore extends EntityStoreBase {\n constructor({ entities, locale, sendMessage, subscribe, timeoutDuration = 3000, }) {\n super({ entities, locale });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.requestCache = new Map();\n this.cacheIdSeperator = ',';\n this.sendMessage = sendMessage;\n this.subscribe = subscribe;\n this.timeoutDuration = timeoutDuration;\n }\n cleanupPromise(referenceId) {\n setTimeout(() => {\n this.requestCache.delete(referenceId);\n }, 300);\n }\n getCacheId(id) {\n return id.length === 1 ? id[0] : id.join(this.cacheIdSeperator);\n }\n async fetchEntity(type, ids, skipCache = false) {\n let missing;\n if (!skipCache) {\n const { missing: missingFromCache, resolved } = this.getEntitiesFromMap(type, ids);\n if (missingFromCache.length === 0) {\n // everything is already in cache\n return resolved;\n }\n missing = missingFromCache;\n }\n else {\n missing = [...ids];\n }\n const cacheId = this.getCacheId(missing);\n const openRequest = this.requestCache.get(cacheId);\n if (openRequest) {\n return openRequest;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const newPromise = new Promise((resolve, reject) => {\n const unsubscribe = this.subscribe(PostMessageMethods.REQUESTED_ENTITIES, (message) => {\n const messageIds = [\n ...message.entities.map((entity) => entity.sys.id),\n ...(message.missingEntityIds ?? []),\n ];\n if (missing.every((id) => messageIds.find((entityId) => entityId === id))) {\n clearTimeout(timeout);\n resolve(message.entities);\n this.cleanupPromise(cacheId);\n ids.forEach((id) => this.cleanupPromise(id));\n unsubscribe();\n }\n else {\n console.warn('Unexpected entities received in REQUESTED_ENTITIES. Ignoring this response.');\n }\n });\n const timeout = setTimeout(() => {\n reject(new Error(`Request for entities timed out ${this.timeoutDuration}ms} for ${cacheId}`));\n this.cleanupPromise(cacheId);\n ids.forEach((id) => this.cleanupPromise(id));\n unsubscribe();\n }, this.timeoutDuration);\n this.sendMessage(PostMessageMethods.REQUEST_ENTITIES, {\n entityIds: missing,\n entityType: type,\n locale: this.locale,\n });\n });\n this.requestCache.set(cacheId, newPromise);\n ids.forEach((cid) => {\n this.requestCache.set(cid, newPromise);\n });\n const result = (await newPromise);\n result.forEach((value) => {\n this.addEntity(value);\n });\n return this.getEntitiesFromMap(type, ids).resolved;\n }\n async fetchAsset(id, skipCache = false) {\n try {\n return (await this.fetchAssets([id], skipCache))[0];\n }\n catch (err) {\n // TODO: move to debug utils once it is extracted\n console.warn(`Failed to request asset ${id}`);\n return undefined;\n }\n }\n fetchAssets(ids, skipCache = false) {\n return this.fetchEntity('Asset', ids, skipCache);\n }\n async fetchEntry(id, skipCache = false) {\n try {\n return (await this.fetchEntries([id], skipCache))[0];\n }\n catch (err) {\n // TODO: move to debug utils once it is extracted\n console.warn(`Failed to request entry ${id}`, err);\n return undefined;\n }\n }\n fetchEntries(ids, skipCache = false) {\n return this.fetchEntity('Entry', ids, skipCache);\n }\n}\n\nfunction transformAssetFileToUrl(fieldValue) {\n return fieldValue && typeof fieldValue == 'object' && fieldValue.url\n ? fieldValue.url\n : fieldValue;\n}\n\n// The default of 3s in the EditorEntityStore is sometimes timing out and\n// leads to not rendering bound content and assemblies.\nconst REQUEST_TIMEOUT = 10000;\nclass EditorModeEntityStore extends EditorEntityStore {\n constructor({ entities, locale }) {\n console.debug(`[experiences-sdk-react] Initializing editor entity store with ${entities.length} entities for locale ${locale}.`, { entities });\n const subscribe = (method, cb) => {\n const handleMessage = (event) => {\n const data = JSON.parse(event.data);\n if (typeof data !== 'object' || !data)\n return;\n if (data.source !== 'composability-app')\n return;\n if (data.eventType === method) {\n cb(data.payload);\n }\n };\n if (typeof window !== 'undefined') {\n window.addEventListener('message', handleMessage);\n }\n return () => {\n if (typeof window !== 'undefined') {\n window.removeEventListener('message', handleMessage);\n }\n };\n };\n super({ entities, sendMessage, subscribe, locale, timeoutDuration: REQUEST_TIMEOUT });\n this.locale = locale;\n }\n /**\n * This function collects and returns the list of requested entries and assets. Additionally, it checks\n * upfront whether any async fetching logic is actually happening. If not, it returns a plain `false` value, so we\n * can detect this early and avoid unnecessary re-renders.\n * @param entityLinks\n * @returns false if no async fetching is happening, otherwise a promise that resolves when all entities are fetched\n */\n async fetchEntities({ missingEntryIds, missingAssetIds, skipCache = false, }) {\n // Entries and assets will be stored in entryMap and assetMap\n await Promise.all([\n this.fetchEntries(missingEntryIds, skipCache),\n this.fetchAssets(missingAssetIds, skipCache),\n ]);\n }\n getMissingEntityIds(entityLinks) {\n const entryLinks = entityLinks.filter((link) => link.sys?.linkType === 'Entry');\n const assetLinks = entityLinks.filter((link) => link.sys?.linkType === 'Asset');\n const uniqueEntryIds = [...new Set(entryLinks.map((link) => link.sys.id))];\n const uniqueAssetIds = [...new Set(assetLinks.map((link) => link.sys.id))];\n const { missing: missingEntryIds } = this.getEntitiesFromMap('Entry', uniqueEntryIds);\n const { missing: missingAssetIds } = this.getEntitiesFromMap('Asset', uniqueAssetIds);\n return { missingEntryIds, missingAssetIds };\n }\n getValue(entityLinkOrEntity, path) {\n const entity = this.getEntryOrAsset(entityLinkOrEntity, path.join('/'));\n if (!entity) {\n return;\n }\n const fieldValue = get(entity, path);\n // walk around to render asset files\n return fieldValue && typeof fieldValue == 'object' && fieldValue.url\n ? fieldValue.url\n : fieldValue;\n }\n}\n\nclass EntityStore extends EntityStoreBase {\n constructor(options) {\n if (typeof options === 'string') {\n const data = JSON.parse(options);\n const { _experienceEntry, _unboundValues, locale, entryMap, assetMap } = data.entityStore;\n super({\n entities: [\n ...Object.values(entryMap),\n ...Object.values(assetMap),\n ],\n locale,\n });\n this._experienceEntry = _experienceEntry;\n this._unboundValues = _unboundValues;\n }\n else {\n const { experienceEntry, entities, locale } = options;\n super({ entities, locale });\n if (isExperienceEntry(experienceEntry)) {\n this._experienceEntry = experienceEntry.fields;\n this._unboundValues = experienceEntry.fields.unboundValues;\n }\n else {\n throw new Error('Provided entry is not experience entry');\n }\n }\n }\n getCurrentLocale() {\n return this.locale;\n }\n get experienceEntryFields() {\n return this._experienceEntry;\n }\n get schemaVersion() {\n return this._experienceEntry?.componentTree.schemaVersion;\n }\n get breakpoints() {\n return this._experienceEntry?.componentTree.breakpoints ?? [];\n }\n get dataSource() {\n return this._experienceEntry?.dataSource ?? {};\n }\n get unboundValues() {\n return this._unboundValues ?? {};\n }\n get usedComponents() {\n return this._experienceEntry?.usedComponents ?? [];\n }\n /**\n * Extend the existing set of unbound values with the ones from the assembly definition.\n * When creating a new assembly out of a container, the unbound value keys are copied and\n * thus the existing and the added ones have colliding keys. In the case of overlapping value\n * keys, the ones from the experience overrule the ones from the assembly definition as\n * the latter one is certainly just a default value while the other one is from the actual instance.\n * @param unboundValues set of unbound values defined in the assembly definition\n */\n addAssemblyUnboundValues(unboundValues) {\n this._unboundValues = { ...unboundValues, ...(this._unboundValues ?? {}) };\n }\n getValue(entityLinkOrEntity, path) {\n const entity = isLink(entityLinkOrEntity)\n ? this.getEntityFromLink(entityLinkOrEntity)\n : entityLinkOrEntity;\n if (entity === undefined) {\n return;\n }\n const fieldValue = get(entity, path);\n return transformAssetFileToUrl(fieldValue);\n }\n toJSON() {\n return {\n _experienceEntry: this._experienceEntry,\n _unboundValues: this._unboundValues,\n ...super.toJSON(),\n };\n }\n}\n\nvar VisualEditorMode;\n(function (VisualEditorMode) {\n VisualEditorMode[\"LazyLoad\"] = \"lazyLoad\";\n VisualEditorMode[\"InjectScript\"] = \"injectScript\";\n})(VisualEditorMode || (VisualEditorMode = {}));\n\nfunction createExperience(options) {\n if (typeof options === 'string') {\n const entityStore = new EntityStore(options);\n return {\n entityStore,\n };\n }\n else {\n const { experienceEntry, referencedAssets, referencedEntries, locale } = options;\n if (!isExperienceEntry(experienceEntry)) {\n throw new Error('Provided entry is not experience entry');\n }\n const entityStore = new EntityStore({\n experienceEntry,\n entities: [...referencedEntries, ...referencedAssets],\n locale,\n });\n return {\n entityStore,\n };\n }\n}\n\nconst fetchExperienceEntry = async ({ client, experienceTypeId, locale, identifier, }) => {\n if (!client) {\n throw new Error('Failed to fetch experience entities. Required \"client\" parameter was not provided');\n }\n if (!locale) {\n throw new Error('Failed to fetch experience entities. Required \"locale\" parameter was not provided');\n }\n if (!experienceTypeId) {\n throw new Error('Failed to fetch experience entities. Required \"experienceTypeId\" parameter was not provided');\n }\n if (!identifier.slug && !identifier.id) {\n throw new Error(`Failed to fetch experience entities. At least one identifier must be provided. Received: ${JSON.stringify(identifier)}`);\n }\n const filter = identifier.slug ? { 'fields.slug': identifier.slug } : { 'sys.id': identifier.id };\n const entries = await client.getEntries({\n content_type: experienceTypeId,\n locale,\n ...filter,\n });\n if (entries.items.length > 1) {\n throw new Error(`More than one experience with identifier: ${JSON.stringify(identifier)} was found`);\n }\n return entries.items[0];\n};\n\nfunction treeVisit(initialNode, onNode) {\n // returns last used index\n const _treeVisit = (currentNode, currentIndex, currentDepth) => {\n // Copy children in case of onNode removing it as we pass the node by reference\n const children = [...currentNode.children];\n onNode(currentNode, currentIndex, currentDepth);\n let nextAvailableIndex = currentIndex + 1;\n const lastUsedIndex = currentIndex;\n for (const child of children) {\n const lastUsedIndex = _treeVisit(child, nextAvailableIndex, currentDepth + 1);\n nextAvailableIndex = lastUsedIndex + 1;\n }\n return lastUsedIndex;\n };\n _treeVisit(initialNode, 0, 0);\n}\n\nclass DeepReference {\n constructor({ path, dataSource }) {\n const { key, field, referentField } = parseDataSourcePathWithL1DeepBindings(path);\n this.originalPath = path;\n this.entityId = dataSource[key].sys.id;\n this.entityLink = dataSource[key];\n this.field = field;\n this.referentField = referentField;\n }\n get headEntityId() {\n return this.entityId;\n }\n /**\n * Extracts referent from the path, using EntityStore as source of\n * entities during the resolution path.\n * TODO: should it be called `extractLeafReferent` ? or `followToLeafReferent`\n */\n extractReferent(entityStore) {\n const headEntity = entityStore.getEntityFromLink(this.entityLink);\n const maybeReferentLink = headEntity.fields[this.field];\n if (undefined === maybeReferentLink) {\n // field references nothing (or even field doesn't exist)\n return undefined;\n }\n if (!isLink(maybeReferentLink)) {\n // Scenario of \"impostor referent\", where one of the deepPath's segments is not a Link but some other type\n // Under normal circumstance we expect field to be a Link, but it could be an \"impostor\"\n // eg. `Text` or `Number` or anything like that; could be due to CT changes or manual path creation via CMA\n return undefined;\n }\n return maybeReferentLink;\n }\n static from(opt) {\n return new DeepReference(opt);\n }\n}\nfunction gatherDeepReferencesFromExperienceEntry(experienceEntry) {\n const deepReferences = [];\n const dataSource = experienceEntry.fields.dataSource;\n const { children } = experienceEntry.fields.componentTree;\n treeVisit({\n definitionId: 'root',\n variables: {},\n children,\n }, (node) => {\n if (!node.variables)\n return;\n for (const [, variableMapping] of Object.entries(node.variables)) {\n if (variableMapping.type !== 'BoundValue')\n continue;\n if (!isDeepPath(variableMapping.path))\n continue;\n deepReferences.push(DeepReference.from({\n path: variableMapping.path,\n dataSource,\n }));\n }\n });\n return deepReferences;\n}\nfunction gatherDeepReferencesFromTree(startingNode, dataSource) {\n const deepReferences = [];\n treeVisit(startingNode, (node) => {\n if (!node.data.props)\n return;\n for (const [, variableMapping] of Object.entries(node.data.props)) {\n if (variableMapping.type !== 'BoundValue')\n continue;\n if (!isDeepPath(variableMapping.path))\n continue;\n deepReferences.push(DeepReference.from({\n path: variableMapping.path,\n dataSource,\n }));\n }\n });\n return deepReferences;\n}\n\n/**\n * Traverses deep-references and extracts referents from valid deep-paths.\n * The referents are received from the CDA/CPA response `.includes` field.\n *\n * In case deep-paths not resolving till the end, eg.:\n * - non-link referents: are ignored\n * - unset references: are ignored\n *\n * Errors are thrown in case of deep-paths being correct,\n * but referents not found. Because if we don't throw now, the EntityStore will\n * be missing entities and upon rendering will not be able to render bindings.\n */\nfunction gatherAutoFetchedReferentsFromIncludes(deepReferences, entriesResponse) {\n const autoFetchedReferentEntries = [];\n const autoFetchedReferentAssets = [];\n for (const reference of deepReferences) {\n const headEntry = entriesResponse.items.find((entry) => entry.sys.id === reference.headEntityId);\n if (!headEntry) {\n throw new Error(`LogicError: When resolving deep-references could not find headEntry (id=${reference.entityId})`);\n }\n const linkToReferent = headEntry.fields[reference.field];\n if (undefined === linkToReferent) {\n console.debug(`[experiences-sdk-react::gatherAutoFetchedReferentsFromIncludes] Empty reference in headEntity. Probably reference is simply not set.`);\n continue;\n }\n if (!isLink(linkToReferent)) {\n console.debug(`[experiences-sdk-react::gatherAutoFetchedReferentsFromIncludes] Non-link value in headEntity. Probably broken path '${reference.originalPath}'`);\n continue;\n }\n if (linkToReferent.sys.linkType === 'Entry') {\n const referentEntry = entriesResponse.includes?.Entry?.find((entry) => entry.sys.id === linkToReferent.sys.id);\n if (!referentEntry) {\n throw new Error(`Logic Error: L2-referent Entry was not found within .includes (${JSON.stringify({\n linkToReferent,\n })})`);\n }\n autoFetchedReferentEntries.push(referentEntry);\n }\n else if (linkToReferent.sys.linkType === 'Asset') {\n const referentAsset = entriesResponse.includes?.Asset?.find((entry) => entry.sys.id === linkToReferent.sys.id);\n if (!referentAsset) {\n throw new Error(`Logic Error: L2-referent Asset was not found within includes (${JSON.stringify({\n linkToReferent,\n })})`);\n }\n autoFetchedReferentAssets.push(referentAsset);\n }\n else {\n console.debug(`[experiences-sdk-react::gatherAutoFetchedReferentsFromIncludes] Unhandled linkType :${JSON.stringify(linkToReferent)}`);\n }\n } // for (reference of deepReferences)\n return { autoFetchedReferentAssets, autoFetchedReferentEntries };\n}\n\nconst fetchReferencedEntities = async ({ client, experienceEntry, locale, }) => {\n if (!client) {\n throw new Error('Failed to fetch experience entities. Required \"client\" parameter was not provided');\n }\n if (!locale) {\n throw new Error('Failed to fetch experience entities. Required \"locale\" parameter was not provided');\n }\n if (!isExperienceEntry(experienceEntry)) {\n throw new Error('Failed to fetch experience entities. Provided \"experienceEntry\" does not match experience entry schema');\n }\n const deepReferences = gatherDeepReferencesFromExperienceEntry(experienceEntry);\n const entryIds = [];\n const assetIds = [];\n for (const dataBinding of Object.values(experienceEntry.fields.dataSource)) {\n if (!('sys' in dataBinding)) {\n continue;\n }\n if (dataBinding.sys.linkType === 'Entry') {\n entryIds.push(dataBinding.sys.id);\n }\n if (dataBinding.sys.linkType === 'Asset') {\n assetIds.push(dataBinding.sys.id);\n }\n }\n const [entriesResponse, assetsResponse] = (await Promise.all([\n entryIds.length > 0\n ? client.withoutLinkResolution.getEntries({ 'sys.id[in]': entryIds, locale })\n : { items: [], includes: [] },\n assetIds.length > 0 ? client.getAssets({ 'sys.id[in]': assetIds, locale }) : { items: [] },\n ]));\n const { autoFetchedReferentAssets, autoFetchedReferentEntries } = gatherAutoFetchedReferentsFromIncludes(deepReferences, entriesResponse);\n // Using client getEntries resolves all linked entry references, so we do not need to resolve entries in usedComponents\n const allResolvedEntries = [\n ...(entriesResponse.items ?? []),\n ...(experienceEntry.fields.usedComponents || []),\n ...autoFetchedReferentEntries,\n ];\n const allResolvedAssets = [\n ...(assetsResponse.items ?? []),\n ...autoFetchedReferentAssets,\n ];\n return {\n entries: allResolvedEntries,\n assets: allResolvedAssets,\n };\n};\n\nconst errorMessagesWhileFetching$1 = {\n experience: 'Failed to fetch experience',\n experienceReferences: 'Failed to fetch entities, referenced in experience',\n};\nconst handleError$1 = (generalMessage, error) => {\n const message = error instanceof Error ? error.message : `Unknown error: ${error}`;\n throw Error(message);\n};\n/**\n * Fetch experience entry using slug as the identifier\n * @param {string} experienceTypeId - id of the content type associated with the experience\n * @param {string} slug - slug of the experience (defined in entry settings)\n * @param {string} localeCode - locale code to fetch the experience. Falls back to the currently active locale in the state\n */\n// Promise<Experience<EntityStore> | undefined> =>\nasync function fetchBySlug({ client, experienceTypeId, slug, localeCode, }) {\n let experienceEntry = undefined;\n try {\n experienceEntry = await fetchExperienceEntry({\n client,\n experienceTypeId,\n locale: localeCode,\n identifier: {\n slug,\n },\n });\n if (!experienceEntry) {\n throw new Error(`No experience entry with slug: ${slug} exists`);\n }\n try {\n const { entries, assets } = await fetchReferencedEntities({\n client,\n experienceEntry,\n locale: localeCode,\n });\n const experience = createExperience({\n experienceEntry,\n referencedAssets: assets,\n referencedEntries: entries,\n locale: localeCode,\n });\n return experience;\n }\n catch (error) {\n handleError$1(errorMessagesWhileFetching$1.experienceReferences, error);\n }\n }\n catch (error) {\n handleError$1(errorMessagesWhileFetching$1.experience, error);\n }\n}\n\nconst errorMessagesWhileFetching = {\n experience: 'Failed to fetch experience',\n experienceReferences: 'Failed to fetch entities, referenced in experience',\n};\nconst handleError = (generalMessage, error) => {\n const message = error instanceof Error ? error.message : `Unknown error: ${error}`;\n throw Error(message);\n};\n/**\n * Fetch experience entry using slug as the identifier\n * @param {string} experienceTypeId - id of the content type associated with the experience\n * @param {string} slug - slug of the experience (defined in entry settings)\n * @param {string} localeCode - locale code to fetch the experience. Falls back to the currently active locale in the state\n */\nasync function fetchById({ client, experienceTypeId, id, localeCode, }) {\n let experienceEntry = undefined;\n try {\n experienceEntry = await fetchExperienceEntry({\n client,\n experienceTypeId,\n locale: localeCode,\n identifier: {\n id,\n },\n });\n if (!experienceEntry) {\n throw new Error(`No experience entry with id: ${id} exists`);\n }\n try {\n const { entries, assets } = await fetchReferencedEntities({\n client,\n experienceEntry,\n locale: localeCode,\n });\n const experience = createExperience({\n experienceEntry,\n referencedAssets: assets,\n referencedEntries: entries,\n locale: localeCode,\n });\n return experience;\n }\n catch (error) {\n handleError(errorMessagesWhileFetching.experienceReferences, error);\n }\n }\n catch (error) {\n handleError(errorMessagesWhileFetching.experience, error);\n }\n}\n\nexport { DeepReference, EditorModeEntityStore, EntityStore, EntityStoreBase, MEDIA_QUERY_REGEXP, VisualEditorMode, buildCfStyles, buildStyleTag, builtInStyles, calculateNodeDefaultHeight, checkIsAssembly, checkIsAssemblyDefinition, checkIsAssemblyEntry, checkIsAssemblyNode, columnsBuiltInStyles, columnsDefinition, containerBuiltInStyles, containerDefinition, createExperience, defineDesignTokens, designTokensRegistry, doesMismatchMessageSchema, fetchById, fetchBySlug, findOutermostCoordinates, gatherDeepReferencesFromExperienceEntry, gatherDeepReferencesFromTree, generateRandomId, getActiveBreakpointIndex, getDataFromTree, getDesignTokenRegistration, getElementCoordinates, getFallbackBreakpointIndex, getInsertionData, getValueForBreakpoint, isContentfulStructureComponent, isDeepPath, isEmptyStructureWithRelativeHeight, isExperienceEntry, isLink, isLinkToAsset, mediaQueryMatcher, optionalBuiltInStyles, parseDataSourcePathIntoFieldset, parseDataSourcePathWithL1DeepBindings, sectionBuiltInStyles, sectionDefinition, sendMessage, singleColumnBuiltInStyles, singleColumnDefinition, supportedModes, transformBoundContentValue, tryParseMessage, validateExperienceBuilderConfig };\n//# sourceMappingURL=index.js.map\n","const SCROLL_STATES = {\n Start: 'scrollStart',\n IsScrolling: 'isScrolling',\n End: 'scrollEnd',\n};\nconst OUTGOING_EVENTS = {\n Connected: 'connected',\n DesignTokens: 'registerDesignTokens',\n HoveredSection: 'hoveredSection',\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 UpdateHoveredComponentCoordinates: 'updateHoveredComponentCoordinates',\n CanvasScroll: 'canvasScrolling',\n CanvasError: 'canvasError',\n ComponentMoveStarted: 'componentMoveStarted',\n ComponentMoveEnded: 'componentMoveEnded',\n OutsideCanvasClick: 'outsideCanvasClick',\n};\nconst INCOMING_EVENTS = {\n RequestEditorMode: 'requestEditorMode',\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 InitEditor: 'initEditor',\n MouseMove: 'mouseMove',\n};\nconst INTERNAL_EVENTS = {\n ComponentsRegistered: 'cfComponentsRegistered',\n VisualEditorInitialize: 'cfVisualEditorInitialize',\n};\nconst VISUAL_EDITOR_EVENTS = {\n Ready: 'cfVisualEditorReady',\n};\nconst VISUAL_EDITOR_CONTAINER_ID = 'cf-visual-editor';\nconst CONTENTFUL_COMPONENT_CATEGORY = 'contentful-component';\nconst CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';\nconst 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};\nconst ASSEMBLY_NODE_TYPE = 'assembly';\nconst ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';\nconst ASSEMBLY_BLOCK_NODE_TYPE = 'assemblyBlock';\nconst ASSEMBLY_NODE_TYPES = [ASSEMBLY_NODE_TYPE, ASSEMBLY_BLOCK_NODE_TYPE];\nconst LATEST_SCHEMA_VERSION = '2023-09-28';\nconst CF_STYLE_ATTRIBUTES = [\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 'cfBorder',\n 'cfBorderRadius',\n 'cfGap',\n 'cfFontSize',\n 'cfFontWeight',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n 'cfTextAlign',\n 'cfTextTransform',\n 'cfTextBold',\n 'cfTextItalic',\n 'cfTextUnderline',\n // For backwards compatibility\n // we need to keep those in this constant array\n // so that omit() in <VisualEditorBlock> and <CompositionBlock>\n // can filter them out and not pass as props\n 'cfBackgroundImageScaling',\n 'cfBackgroundImageAlignment',\n 'cfBackgroundImageAlignmentVertical',\n 'cfBackgroundImageAlignmentHorizontal',\n];\nconst EMPTY_CONTAINER_HEIGHT = '80px';\nconst DEFAULT_IMAGE_WIDTH = '500px';\nvar PostMessageMethods;\n(function (PostMessageMethods) {\n PostMessageMethods[\"REQUEST_ENTITIES\"] = \"REQUEST_ENTITIES\";\n PostMessageMethods[\"REQUESTED_ENTITIES\"] = \"REQUESTED_ENTITIES\";\n})(PostMessageMethods || (PostMessageMethods = {}));\nconst SUPPORTED_IMAGE_FORMATS = ['jpg', 'png', 'webp', 'gif', 'avif'];\n\nexport { 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, INCOMING_EVENTS, INTERNAL_EVENTS, LATEST_SCHEMA_VERSION, OUTGOING_EVENTS, PostMessageMethods, SCROLL_STATES, SUPPORTED_IMAGE_FORMATS, VISUAL_EDITOR_CONTAINER_ID, VISUAL_EDITOR_EVENTS };\n//# sourceMappingURL=constants.js.map\n","import type { ComponentDefinition } from '@contentful/experiences-core/types';\nimport { ASSEMBLY_DEFAULT_CATEGORY } from '@contentful/experiences-core/constants';\n\nexport type Breakpoints = Array<BreakpointItem>;\n\nexport type Rect = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n width: number;\n height: number;\n};\nexport type BreakpointItem = {\n id: string;\n query: string;\n displayName: string;\n previewSize: string;\n};\n\nexport const isRelativePreviewSize = (width: string) => {\n // For now, we solely allow 100% as relative value\n return width === '100%';\n};\n\nexport const checkIsDesignComponentDefinition = (component?: ComponentDefinition) =>\n component?.category === ASSEMBLY_DEFAULT_CATEGORY;\n\nexport const getTooltipPositions = ({\n previewSize,\n tooltipRect,\n coordinates,\n}: {\n previewSize: string;\n tooltipRect?: DOMRect;\n coordinates?: Rect;\n}) => {\n if (!coordinates || !tooltipRect) {\n return { display: 'none' };\n }\n\n /**\n * By default, the tooltip floats to the left of the element\n */\n const newTooltipStyles = { display: 'flex' };\n\n // If the preview size is relative, we don't change the floating direction\n if (!isRelativePreviewSize(previewSize)) {\n const previewSizeMatch = previewSize.match(/(\\d{1,})px/);\n if (!previewSizeMatch) {\n return { display: 'none' };\n }\n const previewSizePx = parseInt(previewSizeMatch[1]);\n\n /**\n * If the element is at the right edge of the canvas, and the element isn't wide enough to fit the tooltip width,\n * we float the tooltip to the right of the element.\n */\n if (\n tooltipRect.width > previewSizePx - coordinates.right &&\n tooltipRect.width > coordinates.width\n ) {\n newTooltipStyles['float'] = 'right';\n }\n }\n\n const tooltipHeight = tooltipRect.height === 0 ? 32 : tooltipRect.height;\n\n /**\n * For elements with small heights, we don't want the tooltip covering the content in the element,\n * so we show the tooltip at the top or bottom.\n */\n if (tooltipHeight * 2 > coordinates.height) {\n /**\n * If there's enough space for the tooltip at the top of the element, we show the tooltip at the top of the element,\n * else we show the tooltip at the bottom.\n */\n if (tooltipHeight < coordinates.top) {\n newTooltipStyles['bottom'] = coordinates.height;\n } else {\n newTooltipStyles['top'] = coordinates.height;\n }\n }\n /**\n * If the component draws outside of the borders of the canvas to the left we move the tooltip to the right\n * so that it is fully visible.\n */\n if (coordinates.left < 0) {\n newTooltipStyles['left'] = -coordinates.left;\n }\n\n /**\n * If for any reason, the element's top is negative, we show the tooltip at the bottom\n */\n if (coordinates.top < 0) {\n newTooltipStyles['top'] = coordinates.height;\n }\n\n return newTooltipStyles;\n};\n","import { Rect, getTooltipPositions } from '@components/Draggable/canvasToolsUtils';\nimport classNames from 'classnames';\nimport React, { useMemo, useRef } from 'react';\nimport styles from './styles.module.css';\n\ninterface Props {\n coordinates: Rect | null;\n id: string;\n label: string;\n isContainer: boolean;\n isAssemblyBlock: boolean;\n}\n\nconst Tooltip: React.FC<Props> = ({ coordinates, id, label, isAssemblyBlock, isContainer }) => {\n const tooltipRef = useRef<HTMLDivElement>(null);\n\n const previewSize = '100%'; // This should be based on breakpoints and added to usememo dependency array\n\n const tooltipStyles = useMemo(() => {\n const tooltipRect = tooltipRef.current?.getBoundingClientRect();\n\n const draggableRect = document\n .querySelector(`[data-ctfl-draggable-id=\"${id}\"]`)\n ?.getBoundingClientRect();\n\n const newTooltipStyles = getTooltipPositions({\n previewSize,\n tooltipRect,\n coordinates: draggableRect,\n });\n return newTooltipStyles;\n\n // Ignore eslint because we intentionally want to trigger this whenever a user clicks on a container/component which is tracked by these coordinates of the component being clicked being changed\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [coordinates, id, tooltipRef.current]);\n\n return (\n <div\n ref={tooltipRef}\n style={tooltipStyles}\n className={classNames(styles.overlay, {\n [styles.overlayContainer]: isContainer,\n [styles.overlayAssembly]: isAssemblyBlock,\n })}>\n {label}\n </div>\n );\n};\n\nexport default Tooltip;\n","import { DragStart, DragUpdate } from '@hello-pangea/dnd';\nimport { create } from 'zustand';\n\nexport type DraggedItem = DragStart & Partial<DragUpdate>;\n\nexport interface DraggedItemStore {\n componentId: string;\n draggedItem?: DraggedItem;\n isDraggingOnCanvas: boolean;\n onBeforeCaptureId: string;\n mouseX: number;\n mouseY: number;\n scrollY: number;\n domRect?: DOMRect;\n\n // actions\n setComponentId: (id: string) => void;\n updateItem: (item?: DraggedItem) => void;\n setOnBeforeCaptureId: (draggableId: string) => void;\n setMousePosition: (x: number, y: number) => void;\n setScrollY: (y: number) => void;\n setDraggingOnCanvas: (isDraggingOnCanvas: boolean) => void;\n setDomRect: (domRect?: DOMRect) => void;\n}\n\nexport const useDraggedItemStore = create<DraggedItemStore>((set) => ({\n draggedItem: undefined,\n domRect: undefined,\n componentId: '',\n isDraggingOnCanvas: false,\n onBeforeCaptureId: '',\n mouseX: 0,\n mouseY: 0,\n scrollY: 0,\n setComponentId(id) {\n set({ componentId: id });\n },\n updateItem: (item) => {\n set({ draggedItem: item });\n },\n setDraggingOnCanvas: (isDraggingOnCanvas) => {\n set({ isDraggingOnCanvas });\n },\n setOnBeforeCaptureId: (onBeforeCaptureId) => {\n set({ onBeforeCaptureId });\n },\n setMousePosition(x, y) {\n set({ mouseX: x, mouseY: y });\n },\n setDomRect(domRect) {\n set({ domRect });\n },\n setScrollY(y) {\n set({ scrollY: y });\n },\n}));\n","import { CONTENTFUL_COMPONENTS } from '@contentful/experiences-core/constants';\n\nexport const DRAGGABLE_HEIGHT = 30;\nexport const DRAGGABLE_WIDTH = 50;\nexport const DRAG_PADDING = 4;\n\nexport const ROOT_ID = 'root';\nexport const COMPONENT_LIST_ID = 'component-list';\nexport const NEW_COMPONENT_ID = 'ctfl-new-draggable';\nexport const CTFL_ZONE_ID = 'data-ctfl-zone-id';\nexport const CTFL_DRAGGABLE_ID = 'data-ctfl-draggable-id';\nexport const CTFL_DRAGGING_ELEMENT = 'data-ctfl-dragging-element';\n\nexport const HITBOX = {\n WIDTH: 70,\n HEIGHT: 20,\n INITIAL_OFFSET: 10,\n OFFSET_INCREMENT: 8,\n MIN_HEIGHT: 45,\n MIN_DEPTH_HEIGHT: 20,\n DEEP_ZONE: 5,\n};\n\nexport const builtInComponents = [\n CONTENTFUL_COMPONENTS.container.id,\n CONTENTFUL_COMPONENTS.section.id,\n CONTENTFUL_COMPONENTS.columns.id,\n CONTENTFUL_COMPONENTS.singleColumn.id,\n];\n\nexport enum TreeAction {\n REMOVE_NODE,\n ADD_NODE,\n MOVE_NODE,\n UPDATE_NODE,\n REORDER_NODE,\n REPLACE_NODE,\n}\n\nexport enum HitboxDirection {\n TOP,\n LEFT,\n RIGHT,\n BOTTOM,\n SELF_VERTICAL,\n SELF_HORIZONTAL,\n}\n\nexport enum DraggablePosition {\n CENTERED,\n MOUSE_POSITION,\n}\n","import { useDraggedItemStore } from '@/store/draggedItem';\nimport { COMPONENT_LIST_ID, DRAGGABLE_HEIGHT, DRAGGABLE_WIDTH } from '@/types/constants';\nimport { Direction } from '@hello-pangea/dnd';\nimport React, { CSSProperties } from 'react';\n\nexport interface PlaceholderParams {\n dropzoneElementId: string;\n direction: Direction;\n elementIndex: number;\n totalIndexes: number;\n isDraggingOver: boolean;\n}\n\ninterface PlaceholderProps extends PlaceholderParams {\n id: string;\n}\n\nconst calcOffsetLeft = (\n parentElement: Element | null,\n placeholderWidth: number,\n nodeWidth: number,\n) => {\n if (!parentElement) {\n return 0;\n }\n\n const alignItems = window.getComputedStyle(parentElement).alignItems;\n\n if (alignItems === 'center') {\n return -(placeholderWidth - nodeWidth) / 2;\n }\n\n if (alignItems === 'end') {\n return -placeholderWidth + nodeWidth + 2;\n }\n\n return 0;\n};\n\nconst calcOffsetTop = (\n parentElement: Element | null,\n placeholderHeight: number,\n nodeHeight: number,\n) => {\n if (!parentElement) {\n return 0;\n }\n\n const alignItems = window.getComputedStyle(parentElement).alignItems;\n\n if (alignItems === 'center') {\n return -(placeholderHeight - nodeHeight) / 2;\n }\n\n if (alignItems === 'end') {\n return -placeholderHeight + nodeHeight + 2;\n }\n\n return 0;\n};\n\nconst getPaddingOffset = (element: Element): [number, number] => {\n const paddingLeft = parseFloat(window.getComputedStyle(element).paddingLeft);\n const paddingRight = parseFloat(window.getComputedStyle(element).paddingRight);\n const paddingTop = parseFloat(window.getComputedStyle(element).paddingTop);\n const paddingBottom = parseFloat(window.getComputedStyle(element).paddingBottom);\n\n const horizontalOffset = paddingLeft + paddingRight;\n const verticalOffset = paddingTop + paddingBottom;\n\n return [horizontalOffset, verticalOffset];\n};\n/**\n * Calculate the size and position of the dropzone indicator\n * when dragging a new component onto the canvas\n */\nconst calcNewComponentStyles = (params: CalcStylesParams): CSSProperties => {\n const { destinationIndex, elementIndex, dropzoneElementId, id, direction, totalIndexes } = params;\n\n const isEnd = destinationIndex === totalIndexes && elementIndex === totalIndexes - 1;\n const isHorizontal = direction === 'horizontal';\n const isRightAlign = isHorizontal && isEnd;\n const isBottomAlign = !isHorizontal && isEnd;\n\n const dropzone = document.querySelector(`[data-rfd-droppable-id=\"${dropzoneElementId}\"]`);\n const element = document.querySelector(`[data-ctfl-draggable-id=\"${id}\"]`);\n\n if (!dropzone || !element) {\n return emptyStyles;\n }\n\n const elementSizes = element.getBoundingClientRect();\n const dropzoneSizes = dropzone.getBoundingClientRect();\n\n const [horizontalPadding, verticalPadding] = getPaddingOffset(dropzone);\n\n const width = isHorizontal ? DRAGGABLE_WIDTH : dropzoneSizes.width - horizontalPadding;\n const height = isHorizontal ? dropzoneSizes.height - verticalPadding : DRAGGABLE_HEIGHT;\n const top = isHorizontal\n ? calcOffsetTop(element.parentElement, height, elementSizes.height)\n : -height;\n const left = isHorizontal\n ? -width\n : calcOffsetLeft(element.parentElement, width, elementSizes.width);\n\n return {\n width,\n height,\n top: !isBottomAlign ? top : 'unset',\n right: isRightAlign ? -width : 'unset',\n bottom: isBottomAlign ? -height : 'unset',\n left: !isRightAlign ? left : 'unset',\n };\n};\n\n/**\n * Calculate the size and position of the dropzone indicator\n * when moving an existing component on the canvas\n */\nconst calcMovementStyles = (params: CalcStylesParams): CSSProperties => {\n const {\n destinationIndex,\n sourceIndex,\n destinationId,\n sourceId,\n elementIndex,\n dropzoneElementId,\n id,\n direction,\n totalIndexes,\n draggableId,\n } = params;\n\n const isEnd = destinationIndex === totalIndexes && elementIndex === totalIndexes - 1;\n const isHorizontal = direction === 'horizontal';\n const isSameZone = destinationId === sourceId;\n const isBelowSourceIndex = destinationIndex > sourceIndex;\n const isRightAlign = isHorizontal && (isEnd || (isSameZone && isBelowSourceIndex));\n const isBottomAlign = !isHorizontal && (isEnd || (isSameZone && isBelowSourceIndex));\n\n const dropzone = document.querySelector(`[data-rfd-droppable-id=\"${dropzoneElementId}\"]`);\n const draggable = document.querySelector(`[data-rfd-draggable-id=\"${draggableId}\"]`);\n const element = document.querySelector(`[data-ctfl-draggable-id=\"${id}\"]`);\n\n if (!dropzone || !element || !draggable) {\n return emptyStyles;\n }\n\n const elementSizes = element.getBoundingClientRect();\n const dropzoneSizes = dropzone.getBoundingClientRect();\n const draggableSizes = draggable.getBoundingClientRect();\n\n const [horizontalPadding, verticalPadding] = getPaddingOffset(dropzone);\n\n const width = isHorizontal ? draggableSizes.width : dropzoneSizes.width - horizontalPadding;\n const height = isHorizontal ? dropzoneSizes.height - verticalPadding : draggableSizes.height;\n const top = isHorizontal\n ? calcOffsetTop(element.parentElement, height, elementSizes.height)\n : -height;\n const left = isHorizontal\n ? -width\n : calcOffsetLeft(element.parentElement, width, elementSizes.width);\n\n return {\n width,\n height,\n top: !isBottomAlign ? top : 'unset',\n right: isRightAlign ? -width : 'unset',\n bottom: isBottomAlign ? -height : 'unset',\n left: !isRightAlign ? left : 'unset',\n };\n};\n\ninterface CalcStylesParams extends PlaceholderProps {\n sourceIndex: number;\n sourceId: string;\n destinationIndex: number;\n destinationId: string;\n draggableId: string;\n}\n\nconst emptyStyles = { width: 0, height: 0 };\n\nconst calcPlaceholderStyles = (params: CalcStylesParams): CSSProperties => {\n const { isDraggingOver, sourceId } = params;\n\n if (!isDraggingOver) {\n return emptyStyles;\n }\n\n if (sourceId === COMPONENT_LIST_ID) {\n return calcNewComponentStyles(params);\n }\n\n return calcMovementStyles(params);\n};\n\nconst Placeholder: React.FC<PlaceholderProps> = (props) => {\n const sourceIndex = useDraggedItemStore((state) => state.draggedItem?.source.index) ?? -1;\n const draggableId = useDraggedItemStore((state) => state.draggedItem?.draggableId) ?? '';\n const sourceId = useDraggedItemStore((state) => state.draggedItem?.source.droppableId) ?? '';\n const destinationIndex =\n useDraggedItemStore((state) => state.draggedItem?.destination?.index) ?? -1;\n const destinationId =\n useDraggedItemStore((state) => state.draggedItem?.destination?.droppableId) ?? '';\n\n const { elementIndex, totalIndexes, isDraggingOver } = props;\n\n const isActive = destinationIndex === elementIndex;\n const isEnd = destinationIndex === totalIndexes && elementIndex === totalIndexes - 1;\n const isVisible = isEnd || isActive;\n\n const isComponentList = destinationId === COMPONENT_LIST_ID;\n\n return (\n !isComponentList &&\n isDraggingOver &&\n isVisible && (\n <div\n style={{\n ...calcPlaceholderStyles({\n ...props,\n sourceId,\n sourceIndex,\n destinationId,\n destinationIndex,\n draggableId,\n }),\n backgroundColor: 'rgba(var(--exp-builder-blue300-rgb), 0.5)',\n position: 'absolute',\n }}\n />\n )\n );\n};\n\nexport default Placeholder;\n","import { useDraggedItemStore } from '@/store/draggedItem';\nimport { DraggablePosition } from '@/types/constants';\nimport { MutableRefObject, useEffect } from 'react';\n\ninterface Params {\n draggableRef: MutableRefObject<HTMLElement | null>;\n draggableId: string;\n position: DraggablePosition;\n}\n\nexport default function useDraggablePosition({ draggableId, draggableRef, position }: Params) {\n const isDraggingOnCanvas = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n const draggingId = useDraggedItemStore((state) => state.onBeforeCaptureId);\n const preDragDomRect = useDraggedItemStore((state) => state.domRect);\n\n useEffect(() => {\n const el: HTMLElement | null = draggableRef?.current;\n\n if (!isDraggingOnCanvas || draggingId !== draggableId || !el) {\n return;\n }\n\n const isCentered = position === DraggablePosition.CENTERED || !preDragDomRect;\n\n const domRect = isCentered ? el.getBoundingClientRect() : preDragDomRect;\n\n const { mouseX, mouseY } = useDraggedItemStore.getState();\n\n const top = isCentered ? mouseY - domRect.height / 2 : domRect.top;\n const left = isCentered ? mouseX - domRect.width / 2 : domRect.left;\n\n el.style.position = 'fixed';\n el.style.left = `${left}px`;\n el.style.top = `${top}px`;\n el.style.width = `${domRect.width}px`;\n el.style.height = `${domRect.height}px`;\n }, [draggableRef, draggableId, isDraggingOnCanvas, draggingId, position, preDragDomRect]);\n}\n","import React, { useRef } from 'react';\nimport { CSSProperties, ReactNode, SyntheticEvent } from 'react';\nimport { Draggable } from '@hello-pangea/dnd';\nimport classNames from 'classnames';\nimport styles from './styles.module.css';\nimport { Rect } from '@components/Draggable/canvasToolsUtils';\nimport Tooltip from './Tooltip';\nimport Placeholder, { PlaceholderParams } from './Placeholder';\nimport {\n ComponentDefinition,\n ComponentDefinitionVariableType,\n} from '@contentful/experiences-core/types';\nimport useDraggablePosition from '@/hooks/useDraggablePosition';\nimport { DraggablePosition } from '@/types/constants';\nimport { useDraggedItemStore } from '@/store/draggedItem';\n\nfunction getStyle(style, snapshot) {\n if (!snapshot.isDropAnimating) {\n return style;\n }\n return {\n ...style,\n // cannot be 0, but make it super tiny\n transitionDuration: `0.001s`,\n };\n}\n\ninterface DraggableComponentProps {\n placeholder: PlaceholderParams;\n wrapperProps: Record<string, string | undefined>;\n children: ReactNode;\n id: string;\n index: number;\n isAssemblyBlock?: boolean;\n isSelected?: boolean;\n onClick?: (e: SyntheticEvent) => void;\n onMouseDown?: (e: SyntheticEvent) => void;\n onMouseUp?: (e: SyntheticEvent) => void;\n onMouseOver?: (e: SyntheticEvent) => void;\n onMouseOut?: (e: SyntheticEvent) => void;\n coordinates: Rect | null;\n isContainer: boolean;\n blockId?: string;\n userIsDragging?: boolean;\n style?: CSSProperties;\n isDragDisabled?: boolean;\n definition: ComponentDefinition<ComponentDefinitionVariableType>;\n}\n\nexport const DraggableComponent: React.FC<DraggableComponentProps> = ({\n children,\n id,\n index,\n isAssemblyBlock = false,\n isSelected = false,\n onClick = () => null,\n coordinates,\n userIsDragging,\n style,\n wrapperProps,\n isContainer,\n blockId,\n isDragDisabled = false,\n placeholder,\n definition,\n ...rest\n}) => {\n const ref = useRef<HTMLElement | null>(null);\n const setDomRect = useDraggedItemStore((state) => state.setDomRect);\n\n useDraggablePosition({\n draggableId: id,\n draggableRef: ref,\n position: DraggablePosition.MOUSE_POSITION,\n });\n\n return (\n <Draggable key={id} draggableId={id} index={index} isDragDisabled={isDragDisabled}>\n {(provided, snapshot) => (\n <div\n data-ctfl-draggable-id={id}\n data-test-id={`draggable-${blockId ?? 'node'}`}\n ref={(refNode) => {\n provided?.innerRef(refNode);\n ref.current = refNode;\n }}\n {...wrapperProps}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n {...rest}\n className={classNames(styles.DraggableComponent, wrapperProps.className, {\n [styles.isAssemblyBlock]: isAssemblyBlock,\n [styles.isDragging]: snapshot.isDragging,\n [styles.isSelected]: isSelected,\n [styles.userIsDragging]: userIsDragging,\n })}\n style={{\n ...style,\n ...getStyle(provided.draggableProps.style, snapshot),\n }}\n onMouseDown={(e) => {\n if (isDragDisabled) {\n return;\n }\n\n e.stopPropagation();\n setDomRect(e.currentTarget.getBoundingClientRect());\n }}\n onClick={onClick}>\n <Tooltip\n id={id}\n coordinates={coordinates}\n isAssemblyBlock={isAssemblyBlock}\n isContainer={isContainer}\n label={definition.name || 'No label specified'}\n />\n <Placeholder {...placeholder} id={id} />\n {children}\n </div>\n )}\n </Draggable>\n );\n};\n","import { sendMessage, getElementCoordinates } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\n/**\n * This function gets the element co-ordinates of a specified component in the DOM and its parent\n * and sends the DOM Rect to the client app\n */\nexport const sendSelectedComponentCoordinates = (instanceId?: string) => {\n if (!instanceId) return;\n let selectedElement = document.querySelector(`[data-cf-node-id=\"${instanceId}\"]`);\n\n let selectedAssemblyChild: Element | null | undefined = undefined;\n\n const [rootNodeId, nodeLocation] = instanceId.split('---');\n\n if (nodeLocation) {\n selectedAssemblyChild = selectedElement;\n selectedElement = document.querySelector(`[data-cf-node-id=\"${rootNodeId}\"]`);\n }\n\n // Finds the first parent that is a VisualEditorBlock\n let parent = selectedElement?.parentElement;\n while (parent) {\n if (parent?.dataset?.cfNodeId) {\n break;\n }\n parent = parent?.parentElement;\n }\n\n if (selectedElement) {\n sendMessage(OUTGOING_EVENTS.UpdateSelectedComponentCoordinates, {\n selectedNodeCoordinates: getElementCoordinates(selectedElement),\n selectedAssemblyChildCoordinates: selectedAssemblyChild\n ? getElementCoordinates(selectedAssemblyChild)\n : null,\n parentCoordinates: parent ? getElementCoordinates(parent) : null,\n });\n }\n};\n","import type {\n ComponentRegistration,\n ComponentDefinition,\n Link,\n} from '@contentful/experiences-core/types';\n\nimport { ASSEMBLY_DEFAULT_CATEGORY } from '@contentful/experiences-core/constants';\n\n// Note: During development, the hot reloading might empty this and it\n// stays empty leading to not rendering assemblies. Ideally, this is\n// integrated into the state machine to keep track of its state.\nexport const assembliesRegistry = new Map<string, Link<'Entry'>>([]);\nexport const setAssemblies = (assemblies: Link<'Entry'>[]) => {\n for (const assembly of assemblies) {\n assembliesRegistry.set(assembly.sys.id, assembly);\n }\n};\n\nexport const componentRegistry = new Map<string, ComponentRegistration>();\n\nexport const getComponentRegistration = (id: string) => componentRegistry.get(id);\n\nexport const addComponentRegistration = (componentRegistration: ComponentRegistration) => {\n componentRegistry.set(componentRegistration.definition.id, componentRegistration);\n};\n\nexport const createAssemblyRegistration = ({\n definitionId,\n definitionName,\n component,\n}: {\n definitionId: string;\n definitionName?: string;\n component: ComponentRegistration['component'];\n}) => {\n const componentRegistration = componentRegistry.get(definitionId);\n\n if (componentRegistration) {\n return componentRegistration;\n }\n\n const definition = {\n id: definitionId,\n name: definitionName || 'Component',\n variables: {} as ComponentDefinition['variables'],\n children: true,\n category: ASSEMBLY_DEFAULT_CATEGORY,\n };\n\n addComponentRegistration({ component, definition });\n\n return componentRegistry.get(definitionId);\n};\n","import { defineDesignTokens } from '@contentful/experiences-core';\nimport type {\n ComponentRegistration,\n ExperienceDataSource,\n ExperienceUnboundValues,\n DesignTokensDefinition,\n} from '@contentful/experiences-core/types';\nimport { create } from 'zustand';\nimport { componentRegistry } from './registries';\nimport { isEqual } from 'lodash-es';\n\nexport interface InitEditorParams {\n componentRegistry: Map<string, ComponentRegistration>;\n designTokens: DesignTokensDefinition;\n initialLocale: string;\n}\nexport interface EditorStore {\n dataSource: ExperienceDataSource;\n locale: string | null;\n selectedNodeId: string | null;\n unboundValues: ExperienceUnboundValues;\n // updaters\n setDataSource: (data: ExperienceDataSource) => void;\n setUnboundValues: (values: ExperienceUnboundValues) => void;\n setLocale: (locale: string) => void;\n setSelectedNodeId: (id: string) => void;\n\n initializeEditor: (params: InitEditorParams) => void;\n}\n\nexport const useEditorStore = create<EditorStore>((set, get) => ({\n dataSource: {},\n unboundValues: {},\n isDragging: false,\n dragItem: '',\n selectedNodeId: null,\n locale: null,\n\n setSelectedNodeId: (id: string) => {\n set({ selectedNodeId: id });\n },\n setDataSource(data) {\n const dataSource = get().dataSource;\n const newDataSource = { ...dataSource, ...data };\n if (isEqual(dataSource, newDataSource)) {\n return;\n }\n set({ dataSource: newDataSource });\n },\n setUnboundValues(values) {\n set({ unboundValues: values });\n },\n setLocale(locale) {\n const currentLocale = get().locale;\n\n if (locale === currentLocale) {\n return;\n }\n\n set({ locale });\n },\n initializeEditor({ componentRegistry: initialRegistry, designTokens, initialLocale }) {\n initialRegistry.forEach((registration) => {\n componentRegistry.set(registration.definition.id, registration);\n });\n\n // Re-register the design tokens with the Visual Editor's instance of the experiences-core package\n defineDesignTokens(designTokens);\n\n set({ locale: initialLocale });\n },\n}));\n","import { useEffect } from 'react';\nimport type { ExperienceTreeNode } from '@contentful/experiences-core/types';\nimport { sendSelectedComponentCoordinates } from '@/communication/sendSelectedComponentCoordinates';\nimport { useEditorStore } from '@/store/editor';\nimport { getElementCoordinates } from '@contentful/experiences-core';\n/**\n * This hook gets the element co-ordinates of a specified element in the DOM\n * and sends the DOM Rect to the client app\n */\nexport const useSelectedInstanceCoordinates = ({ node }: { node: ExperienceTreeNode }) => {\n const selectedNodeId = useEditorStore((state) => state.selectedNodeId);\n\n useEffect(() => {\n if (selectedNodeId !== node.data.id) {\n return;\n }\n\n // Allows the drop animation to finish before\n // calculating the components coordinates\n setTimeout(() => {\n sendSelectedComponentCoordinates(node.data.id);\n }, 10);\n }, [node, selectedNodeId]);\n\n const selectedElement = node.data.id\n ? document.querySelector(`[data-cf-node-id=\"${selectedNodeId}\"]`)\n : undefined;\n return selectedElement ? getElementCoordinates(selectedElement) : null;\n};\n","import { useEffect, useState } from 'react';\nimport { buildStyleTag } from '@contentful/experiences-core';\nimport type { CSSProperties } from '@contentful/experiences-core/types';\n\n/**\n *\n * @param styles: the list of styles to apply\n * @param nodeId: [Optional] the id of node that these styles will be applied to\n * @returns className: the className that was used\n * Builds and adds a style tag in the document. Returns the className to be attached to the element.\n * In editor mode the nodeId is used as the identifier in order to avoid creating endless tags as the styles are tweeked\n * In preview/delivery mode the styles don't change oftem so we're using the md5 hash of the content of the tag\n */\nexport const useStyleTag = ({ styles, nodeId }: { styles: CSSProperties; nodeId?: string }) => {\n const [className, setClassName] = useState('');\n\n useEffect(() => {\n if (Object.keys(styles).length === 0) {\n return;\n }\n\n const [className, styleRule] = buildStyleTag({ styles, nodeId });\n\n setClassName(className);\n\n const existingTag = document.querySelector(`[data-cf-styles=\"${className}\"]`);\n\n if (existingTag) {\n // editor mode - update existing\n if (nodeId) {\n existingTag.innerHTML = styleRule;\n }\n // preview/delivery mode - here we don't need to update the existing tag because\n // the className is based on the md5 hash of the content so it hasn't changed\n return;\n }\n\n const styleTag = document.createElement('style');\n styleTag.dataset['cfStyles'] = className;\n\n document.head.appendChild(styleTag).innerHTML = styleRule;\n }, [styles, nodeId]);\n\n return { className };\n};\n","import { get } from 'lodash-es';\nimport type { ExperienceUnboundValues, PrimitiveValue } from '@contentful/experiences-core/types';\n\nexport const getUnboundValues = ({\n key,\n fallback,\n unboundValues,\n}: {\n key: string;\n fallback: PrimitiveValue;\n unboundValues: ExperienceUnboundValues;\n}): PrimitiveValue => {\n const lodashPath = `${key}.value`;\n\n return get(unboundValues, lodashPath, fallback) as PrimitiveValue;\n};\n","import { EditorModeEntityStore } from '@contentful/experiences-core';\nimport { create } from 'zustand';\n\nexport interface EntityState {\n entityStore: EditorModeEntityStore;\n // Set to true when entities were fetched from the parent app.\n // Reset to false when we receive a tree update and need to validate\n // again whether all necessary entities are fetched.\n areEntitiesFetched: boolean;\n // updaters\n setEntitiesFetched: (fetched: boolean) => void;\n resetEntityStore: (\n locale: string,\n entities?: EditorModeEntityStore['entities'],\n ) => EditorModeEntityStore;\n}\n\nexport const useEntityStore = create<EntityState>((set) => ({\n entityStore: new EditorModeEntityStore({ locale: 'en-US', entities: [] }),\n areEntitiesFetched: false,\n\n setEntitiesFetched(fetched) {\n set({ areEntitiesFetched: fetched });\n },\n resetEntityStore(locale, entities = []): EditorModeEntityStore {\n console.debug(\n `[experiences-sdk-react] Resetting entity store because the locale changed to '${locale}'.`,\n );\n const newEntityStore = new EditorModeEntityStore({ locale, entities });\n set({\n entityStore: newEntityStore,\n areEntitiesFetched: false,\n });\n\n return newEntityStore;\n },\n}));\n","import { useEditorStore } from '@/store/editor';\nimport {\n buildCfStyles,\n calculateNodeDefaultHeight,\n isLinkToAsset,\n isEmptyStructureWithRelativeHeight,\n isContentfulStructureComponent,\n transformBoundContentValue,\n} from '@contentful/experiences-core';\nimport {\n CF_STYLE_ATTRIBUTES,\n ASSEMBLY_NODE_TYPE,\n EMPTY_CONTAINER_HEIGHT,\n CONTENTFUL_COMPONENTS,\n} from '@contentful/experiences-core/constants';\nimport type {\n StyleProps,\n PrimitiveValue,\n ExperienceTreeNode,\n ResolveDesignValueType,\n ComponentRegistration,\n Link,\n} from '@contentful/experiences-core/types';\nimport { useMemo } from 'react';\nimport { useStyleTag } from '../../hooks/useStyleTag';\nimport { omit } from 'lodash-es';\nimport { getUnboundValues } from '@/utils/getUnboundValues';\nimport { useEntityStore } from '@/store/entityStore';\nimport type { RenderDropzoneFunction } from './Dropzone.types';\nimport { DRAG_PADDING } from '../../types/constants';\n\ntype ComponentProps = StyleProps | Record<string, PrimitiveValue | Link<'Entry'> | Link<'Asset'>>;\n\ntype UseComponentProps = {\n node: ExperienceTreeNode;\n resolveDesignValue: ResolveDesignValueType;\n areEntitiesFetched: boolean;\n definition: ComponentRegistration['definition'];\n renderDropzone: RenderDropzoneFunction;\n userIsDragging: boolean;\n};\n\nexport const useComponentProps = ({\n node,\n areEntitiesFetched,\n resolveDesignValue,\n renderDropzone,\n definition,\n userIsDragging,\n}: UseComponentProps) => {\n const unboundValues = useEditorStore((state) => state.unboundValues);\n const dataSource = useEditorStore((state) => state.dataSource);\n const entityStore = useEntityStore((state) => state.entityStore);\n const props: ComponentProps = useMemo(() => {\n // Don't enrich the assembly wrapper node with props\n if (!definition || node.type === ASSEMBLY_NODE_TYPE) {\n return {};\n }\n\n return Object.entries(definition.variables).reduce(\n (acc, [variableName, variableDefinition]) => {\n const variableMapping = node.data.props[variableName];\n if (!variableMapping) {\n return {\n ...acc,\n [variableName]: variableDefinition.defaultValue,\n };\n }\n\n if (variableMapping.type === 'DesignValue') {\n const valueByBreakpoint = resolveDesignValue(\n variableMapping.valuesByBreakpoint,\n variableName,\n );\n const designValue =\n variableName === 'cfHeight'\n ? calculateNodeDefaultHeight({\n blockId: node.data.blockId,\n children: node.children,\n value: valueByBreakpoint,\n })\n : valueByBreakpoint;\n\n return {\n ...acc,\n [variableName]: designValue,\n };\n } else if (variableMapping.type === 'BoundValue') {\n const [, uuid, path] = variableMapping.path.split('/');\n const binding = dataSource[uuid] as Link<'Entry' | 'Asset'>;\n\n const variableDefinition = definition.variables[variableName];\n let boundValue = transformBoundContentValue(\n node.data.props,\n entityStore,\n binding,\n resolveDesignValue,\n variableName,\n variableDefinition,\n variableMapping.path,\n );\n\n // In some cases, there may be an asset linked in the path, so we need to consider this scenario:\n // If no 'boundValue' is found, we also attempt to extract the value associated with the second-to-last item in the path.\n // If successful, it means we have identified the linked asset.\n\n if (!boundValue) {\n const maybeBoundAsset = areEntitiesFetched\n ? entityStore.getValue(binding, path.split('/').slice(0, -2))\n : undefined;\n\n if (isLinkToAsset(maybeBoundAsset)) {\n boundValue = maybeBoundAsset;\n }\n }\n\n const value = boundValue || variableDefinition.defaultValue;\n\n return {\n ...acc,\n [variableName]: value,\n };\n } else {\n const value = getUnboundValues({\n key: variableMapping.key,\n fallback: variableDefinition.defaultValue,\n unboundValues: unboundValues || {},\n });\n\n return {\n ...acc,\n [variableName]: value,\n };\n }\n },\n {},\n );\n }, [\n definition,\n node.data.props,\n node.children,\n node.data.blockId,\n resolveDesignValue,\n dataSource,\n areEntitiesFetched,\n unboundValues,\n node.type,\n entityStore,\n ]);\n\n const cfStyles = buildCfStyles(props);\n\n // Separate the component styles from the editor wrapper styles\n const { margin, height, width, maxWidth, ...componentStyles } = cfStyles;\n\n // Styles that will be applied to the editor wrapper (draggable) element\n const { className: wrapperClass } = useStyleTag({\n styles:\n // To ensure that assembly nodes are rendered like they are rendered in\n // the assembly editor, we need to use a normal block instead of a flex box.\n node.type === ASSEMBLY_NODE_TYPE\n ? {\n display: 'block !important',\n width: '100%',\n }\n : {\n margin,\n maxWidth,\n width,\n height,\n },\n nodeId: `editor-${node.data.id}`,\n });\n\n // Styles that will be applied to the component element\n const { className: componentClass } = useStyleTag({\n styles: {\n ...componentStyles,\n margin: 0,\n width: '100%',\n height: '100%',\n maxWidth: 'none',\n ...(isEmptyStructureWithRelativeHeight(node.children.length, node?.data.blockId, height) && {\n minHeight: EMPTY_CONTAINER_HEIGHT,\n }),\n ...(userIsDragging &&\n isContentfulStructureComponent(node?.data.blockId) &&\n node?.data.blockId !== CONTENTFUL_COMPONENTS.columns.id && {\n padding: addExtraDropzonePadding(componentStyles.padding?.toString() || '0 0 0 0'),\n }),\n },\n nodeId: node.data.id,\n });\n\n const wrapperProps = {\n className: wrapperClass,\n 'data-cf-node-id': node.data.id,\n 'data-cf-node-block-id': node.data.blockId,\n 'data-cf-node-block-type': node.type,\n };\n\n //List explicit style props that will end up being passed to the component\n const stylesToKeep = ['cfImageAsset'];\n const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));\n\n const componentProps = {\n className: componentClass,\n editorMode: true,\n node,\n renderDropzone,\n ...omit(props, stylesToRemove, ['cfHyperlink', 'cfOpenInNewTab']),\n ...(definition.children ? { children: renderDropzone(node) } : {}),\n };\n\n return { componentProps, wrapperProps };\n};\n\nconst addExtraDropzonePadding = (padding: string) =>\n padding\n .split(' ')\n .map((value) => {\n if (value.endsWith('px')) {\n const parsedValue = parseInt(value.replace(/px$/, ''), 10);\n return (parsedValue < DRAG_PADDING ? DRAG_PADDING : parsedValue) + 'px';\n }\n return `${DRAG_PADDING}px`;\n })\n .join(' ');\n","import React, { forwardRef } from 'react';\nimport styleInject from 'style-inject';\nimport { documentToReactComponents } from '@contentful/rich-text-react-renderer';\nimport { BLOCKS } from '@contentful/rich-text-types';\n\nconst CONTENTFUL_DEFAULT_CATEGORY = 'Contentful';\nconst 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};\nvar PostMessageMethods;\n(function (PostMessageMethods) {\n PostMessageMethods[\"REQUEST_ENTITIES\"] = \"REQUEST_ENTITIES\";\n PostMessageMethods[\"REQUESTED_ENTITIES\"] = \"REQUESTED_ENTITIES\";\n})(PostMessageMethods || (PostMessageMethods = {}));\n\nfunction combineClasses(...classes) {\n return classes\n .filter((val) => val)\n .map((c) => c.trim())\n .join(' ');\n}\n\nconst Button = ({ children, className, label, onClick, onNavigate, target, url, ...props }) => {\n const classes = combineClasses('cf-button', className);\n const handleClick = (event) => {\n if (onNavigate && url) {\n event.preventDefault();\n onNavigate(url, target);\n }\n onClick && onClick(event);\n };\n const button = (React.createElement(\"button\", { className: classes, \"data-url\": url, \"data-target\": target, onClick: handleClick, ...props }, label ? label : children));\n return url ? (React.createElement(\"a\", { href: url, target: target }, button)) : (button);\n};\n\nconst ButtonComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.button.id,\n name: CONTENTFUL_COMPONENTS.button.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: [\n 'cfMargin',\n 'cfMaxWidth',\n 'cfLetterSpacing',\n 'cfTextItalic',\n 'cfTextUnderline',\n 'cfTextBold',\n 'cfLineHeight',\n 'cfBorder',\n 'cfBorderRadius',\n ],\n tooltip: {\n description: 'Drop onto the canvas to add button that can be used to trigger an action.',\n },\n variables: {\n cfFontSize: {\n displayName: 'Font Size',\n type: 'Text',\n group: 'style',\n description: 'The font size of the button.',\n defaultValue: '16px',\n },\n cfFontWeight: {\n displayName: 'Font Weight',\n type: 'Text',\n group: 'style',\n description: 'The font weight of the button.',\n defaultValue: '600',\n },\n cfTextColor: {\n displayName: 'Text Color',\n type: 'Text',\n group: 'style',\n description: 'The text color of the button.',\n defaultValue: 'rgba(255, 255, 255, 1)',\n },\n cfBackgroundColor: {\n displayName: 'Background color',\n type: 'Text',\n group: 'style',\n description: 'The background color of the button.',\n defaultValue: 'rgba(0, 0, 0, 1)',\n },\n cfPadding: {\n displayName: 'Padding',\n type: 'Text',\n group: 'style',\n description: 'The padding of the button.',\n defaultValue: '6px 12px 6px 12px',\n },\n cfWidth: {\n displayName: 'Width',\n type: 'Text',\n group: 'style',\n description: 'The width of the button.',\n defaultValue: 'fit-content',\n },\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the button.',\n defaultValue: 'fit-content',\n },\n cfTextAlign: {\n displayName: 'Text Align',\n type: 'Text',\n group: 'style',\n description: 'The text align of the button.',\n defaultValue: 'center',\n },\n label: {\n displayName: 'Label',\n type: 'Text',\n defaultValue: 'Button',\n },\n url: {\n displayName: 'URL',\n type: 'Text',\n defaultValue: '/',\n },\n target: {\n displayName: 'Target',\n type: 'Text',\n defaultValue: '',\n },\n },\n};\n\nvar css_248z$5 = \".cf-heading {\\n white-space: pre-line;\\n}\\n\";\nstyleInject(css_248z$5);\n\nconst Heading = ({ children, className, text, type = 'h1', ...props }) => {\n const Tag = type;\n const classes = combineClasses('cf-heading', className);\n return (React.createElement(Tag, { className: classes, ...props }, text ? text : children));\n};\n\nconst HeadingComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.heading.id,\n name: CONTENTFUL_COMPONENTS.heading.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: [\n 'cfMargin',\n 'cfPadding',\n 'cfFontWeight',\n 'cfLetterSpacing',\n 'cfTextAlign',\n 'cfTextColor',\n 'cfTextTransform',\n 'cfTextItalic',\n 'cfTextUnderline',\n 'cfWidth',\n 'cfMaxWidth',\n 'cfBackgroundColor',\n 'cfBorder',\n 'cfBorderRadius',\n ],\n tooltip: {\n description: 'Drop onto the canvas to add a heading.',\n },\n variables: {\n // Built-in style variables with default values changed\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the button.',\n defaultValue: 'fit-content',\n },\n cfFontSize: {\n displayName: 'Font Size',\n type: 'Text',\n group: 'style',\n description: 'The font size of the heading.',\n defaultValue: '32px',\n },\n cfLineHeight: {\n displayName: 'Line Height',\n type: 'Text',\n group: 'style',\n description: 'The line height of the heading.',\n defaultValue: '48px',\n },\n cfTextBold: {\n displayName: 'Bold',\n type: 'Boolean',\n group: 'style',\n description: 'The text bold of the heading.',\n defaultValue: true,\n },\n // Component specific variables\n text: {\n displayName: 'text',\n type: 'Text',\n description: 'The text to display in the heading.',\n defaultValue: 'Heading',\n },\n type: {\n displayName: 'Type',\n type: 'Text',\n defaultValue: 'h1',\n description: 'Determines the HTML tag of the heading. Value can be h1, h2, h3, h4, h5, or h6.',\n validations: {\n in: [\n { value: 'h1', displayName: 'H1' },\n { value: 'h2', displayName: 'H2' },\n { value: 'h3', displayName: 'H3' },\n { value: 'h4', displayName: 'H4' },\n { value: 'h5', displayName: 'H5' },\n { value: 'h6', displayName: 'H6' },\n ],\n },\n },\n },\n};\n\nvar css_248z$4 = \".cf-richtext {\\n white-space: pre-line;\\n}\\n\";\nstyleInject(css_248z$4);\n\nconst RichText = ({ as = 'p', className, value, ...props }) => {\n const classes = combineClasses('cf-richtext', className);\n const Tag = as;\n return documentToReactComponents(value, {\n renderNode: {\n [BLOCKS.PARAGRAPH]: (_node, children) => {\n return (React.createElement(Tag, { className: classes, ...props }, children));\n },\n },\n });\n};\n\nconst RichTextComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.richText.id,\n name: CONTENTFUL_COMPONENTS.richText.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: [\n 'cfMargin',\n 'cfPadding',\n 'cfFontWeight',\n 'cfLetterSpacing',\n 'cfTextTransform',\n 'cfMaxWidth',\n 'cfBackgroundColor',\n 'cfBorder',\n 'cfBorderRadius',\n ],\n tooltip: {\n description: 'Drop onto the canvas to add text with Rich text formatting options.',\n },\n variables: {\n // Built-in style variables with default values changed\n cfLineHeight: {\n displayName: 'Line Height',\n type: 'Text',\n group: 'style',\n description: 'The line height of the heading.',\n defaultValue: '24px',\n },\n cfTextAlign: {\n displayName: 'Text Align',\n type: 'Text',\n group: 'style',\n description: 'The text alignment of the heading.',\n defaultValue: 'center',\n },\n cfWidth: {\n displayName: 'Width',\n type: 'Text',\n group: 'style',\n description: 'The width of the button.',\n defaultValue: 'fit-content',\n },\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the button.',\n defaultValue: 'fit-content',\n },\n value: {\n displayName: 'Value',\n description: 'The text to display.',\n type: 'RichText',\n defaultValue: {\n nodeType: 'document',\n data: {},\n content: [\n {\n nodeType: 'paragraph',\n data: {},\n content: [\n {\n nodeType: 'text',\n value: 'Rich text',\n marks: [],\n data: {},\n },\n ],\n },\n ],\n },\n },\n },\n};\n\nvar css_248z$3 = \".cf-text {\\n white-space: pre-line;\\n}\\n\";\nstyleInject(css_248z$3);\n\nconst Text = ({ as = 'p', children, className, value, url, target, onNavigate, onClick, ...props }) => {\n const handleClick = (event) => {\n if (onNavigate && url) {\n event.preventDefault();\n onNavigate(url, target);\n }\n onClick && onClick(event);\n };\n const Tag = as;\n const textAsTag = (React.createElement(Tag, { className: combineClasses('cf-text', className), onClick: handleClick, \"data-url\": url, ...(target ? { 'data-target': target } : {}), ...props }, value ? value : children));\n if (!url) {\n return textAsTag;\n }\n return (React.createElement(\"a\", { className: \"cf-text-link\", href: url, ...(target ? { target } : {}) }, textAsTag));\n};\n\nconst TextComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.text.id,\n name: CONTENTFUL_COMPONENTS.text.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: [\n 'cfMargin',\n 'cfPadding',\n 'cfFontSize',\n 'cfFontWeight',\n 'cfLineHeight',\n 'cfLetterSpacing',\n 'cfTextColor',\n 'cfTextAlign',\n 'cfTextTransform',\n 'cfTextBold',\n 'cfTextItalic',\n 'cfTextUnderline',\n 'cfBackgroundColor',\n 'cfBorder',\n 'cfBorderRadius',\n 'cfWidth',\n 'cfMaxWidth',\n ],\n tooltip: {\n description: 'Drop onto the canvas to add plain text.',\n },\n variables: {\n cfHeight: {\n displayName: 'Height',\n type: 'Text',\n group: 'style',\n description: 'The height of the button.',\n defaultValue: 'fit-content',\n },\n value: {\n displayName: 'Value',\n description: 'The text to display. If not provided, children will be used instead.',\n type: 'Text',\n defaultValue: 'Text',\n },\n as: {\n displayName: 'As',\n description: 'Renders the text in a specific HTML tag.',\n type: 'Text',\n defaultValue: 'p',\n validations: {\n in: [\n { value: 'p', displayName: 'p' },\n { value: 'span', displayName: 'span' },\n { value: 'div', displayName: 'div' },\n { value: 'label', displayName: 'label' },\n { value: 'caption', displayName: 'caption' },\n { value: 'small', displayName: 'small' },\n { value: 'strong', displayName: 'strong' },\n { value: 'em', displayName: 'em' },\n ],\n },\n },\n url: {\n displayName: 'URL',\n type: 'Text',\n defaultValue: '',\n },\n target: {\n displayName: 'Target',\n type: 'Text',\n defaultValue: '',\n },\n },\n};\n\nvar css_248z$2 = \".cf-no-image {\\n position: relative;\\n}\\n\\n.cf-no-image img {\\n background-color: var(--cf-color-gray100);\\n outline-offset: -2px;\\n outline: 2px solid rgba(var(--cf-color-gray400-rgb), 0.5);\\n}\\n\\n[data-ctfl-draggable-id] .cf-no-image {\\n width: 100%;\\n height: 100%;\\n}\\n\\n[data-ctfl-draggable-id] .cf-no-image img {\\n width: 100%;\\n}\\n\\n.cf-no-image svg {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n transform: translate(-50%, -50%);\\n height: var(--cf-text-3xl);\\n width: var(--cf-text-3xl);\\n max-height: 100%;\\n max-width: 100%;\\n}\\n\\n.cf-no-image svg path {\\n fill: var(--cf-color-gray400);\\n}\\n\";\nstyleInject(css_248z$2);\n\nconst Image = ({ className = '', src, cfImageAsset, ...props }) => {\n if (!cfImageAsset && !src) {\n return (React.createElement(\"div\", { className: \"cf-no-image\" },\n React.createElement(\"img\", { className: className, src: \"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAA\", ...props }),\n React.createElement(\"svg\", { fill: \"none\", viewBox: \"0 0 17 16\", xmlns: \"http://www.w3.org/2000/svg\" },\n React.createElement(\"path\", { fill: \"#fff\", d: \"M13.5 2h-10a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1m-10 1h10v4.836l-1.543-1.543a1 1 0 0 0-1.414 0L3.836 13H3.5zm10 10H5.25l6-6 2.25 2.25zm-7-5.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3m0-2a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1\" }))));\n }\n if (typeof cfImageAsset === 'string') {\n return React.createElement(\"img\", { src: cfImageAsset, className: 'cf-image ' + className, ...props });\n }\n if (cfImageAsset) {\n return (React.createElement(\"img\", { src: cfImageAsset.url, srcSet: cfImageAsset.srcSet?.length ? cfImageAsset.srcSet?.join(', ') : undefined, sizes: cfImageAsset.sizes ? cfImageAsset.sizes : undefined, className: 'cf-image ' + className, ...props }));\n }\n if (src) {\n return React.createElement(\"img\", { src: src, className: 'cf-image ' + className, ...props });\n }\n};\n\nconst ImageComponentDefinition = {\n id: CONTENTFUL_COMPONENTS.image.id,\n name: CONTENTFUL_COMPONENTS.image.name,\n category: CONTENTFUL_DEFAULT_CATEGORY,\n builtInStyles: ['cfMargin', 'cfPadding', 'cfImageAsset', 'cfImageOptions'],\n tooltip: {\n description: 'Drop onto the canvas to upload an image.',\n },\n variables: {\n alt: {\n displayName: 'Alt',\n type: 'Text',\n description: 'Alternative text for the image',\n },\n },\n};\n\nvar css_248z$1 = \".contentful-container {\\n position: relative;\\n display: flex;\\n box-sizing: border-box;\\n pointer-events: all;\\n}\\n\\n.contentful-container::-webkit-scrollbar {\\n display: none; /* Safari and Chrome */\\n}\\n\\n.cf-single-column-wrapper {\\n position: relative;\\n}\\n\\n.cf-container-wrapper {\\n position: relative;\\n width: 100%;\\n}\\n\\n.cf-container-label {\\n position: absolute;\\n pointer-events: none;\\n top: 0;\\n left: 0;\\n right: 0;\\n bottom: 0;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n overflow-x: clip;\\n font-family: var(--exp-builder-font-stack-primary);\\n font-size: 12px;\\n color: var(--exp-builder-gray400);\\n z-index: 10;\\n}\\n\\n/* used by ContentfulSectionAsHyperlink.tsx */\\n\\n.contentful-container-link,\\n.contentful-container-link:active,\\n.contentful-container-link:visited,\\n.contentful-container-link:hover,\\n.contentful-container-link:read-write,\\n.contentful-container-link:focus-visible {\\n color: inherit;\\n text-decoration: unset;\\n outline: unset;\\n}\\n\";\nstyleInject(css_248z$1);\n\nconst Flex = forwardRef(({ id, children, onMouseEnter, onMouseUp, onMouseLeave, onMouseDown, onClick, flex, flexBasis, flexShrink, flexDirection, gap, justifyContent, justifyItems, justifySelf, alignItems, alignSelf, alignContent, order, flexWrap, flexGrow, className, cssStyles, ...props }, ref) => {\n return (React.createElement(\"div\", { id: id, ref: ref, style: {\n display: 'flex',\n flex,\n flexBasis,\n flexShrink,\n flexDirection,\n gap,\n justifyContent,\n justifyItems,\n justifySelf,\n alignItems,\n alignSelf,\n alignContent,\n order,\n flexWrap,\n flexGrow,\n ...cssStyles,\n }, className: className, onMouseEnter: onMouseEnter, onMouseUp: onMouseUp, onMouseDown: onMouseDown, onMouseLeave: onMouseLeave, onClick: onClick, ...props }, children));\n});\nFlex.displayName = 'Flex';\n\n/* eslint-disable */ /* TODO: fix eslint errors */\nconst ContentfulContainerAsHyperlink = (props) => {\n const { cfHyperlink, cfOpenInNewTab, editorMode, className, children } = props;\n if (editorMode === false) {\n let anchorTagProps = {};\n if (cfOpenInNewTab) {\n anchorTagProps = {\n target: '_blank',\n rel: 'noopener noreferrer',\n };\n }\n return (React.createElement(\"a\", { className: combineClasses(className, 'contentful-container', 'contentful-container-link'), href: cfHyperlink, ...anchorTagProps }, children));\n }\n const { renderDropzone, node } = props;\n const stopPropagationInEditorMode = (e) => {\n e.stopPropagation();\n e.preventDefault();\n };\n return renderDropzone(node, {\n ['data-test-id']: 'contentful-container',\n className: combineClasses(className, 'contentful-container', 'contentful-container-link'),\n zoneId: node.data.id,\n WrapperComponent: 'a',\n onClick: stopPropagationInEditorMode,\n });\n};\n\n/* eslint-disable */\nconst ContentfulContainer = (props) => {\n const { className, editorMode, children, cfHyperlink } = props;\n if (cfHyperlink) {\n return React.createElement(ContentfulContainerAsHyperlink, { ...props }, children);\n }\n if (editorMode === false) {\n return (React.createElement(Flex, { \"data-test-id\": \"contentful-container\", className: combineClasses(className, 'contentful-container') }, children));\n }\n // Extract properties that are only available in editor mode\n const { renderDropzone, node } = props;\n const isEmpty = !node.children.length;\n const renderDropzoneComponent = () => {\n return renderDropzone(node, {\n ['data-test-id']: 'contentful-container',\n id: 'ContentfulContainer',\n className: combineClasses('contentful-container', className),\n WrapperComponent: Flex,\n });\n };\n // Perform ternary so that we only render the wrapper div if the container is empty\n return isEmpty ? (React.createElement(\"div\", { className: \"cf-container-wrapper\", \"data-ctfl-draggable-id\": node.data.id },\n React.createElement(\"div\", { className: \"cf-container-label\" }, node.data.blockId === CONTENTFUL_COMPONENTS.section.id ? 'Section' : 'Container'),\n renderDropzoneComponent())) : (renderDropzoneComponent());\n};\n\nvar css_248z = \".Columns {\\n display: flex;\\n gap: 24px;\\n grid-template-columns: repeat(12, 1fr);\\n flex-direction: column;\\n min-height: 0; /* NEW */\\n min-width: 0; /* NEW; needed for Firefox */\\n}\\n\\n@media (min-width: 768px) {\\n .Columns {\\n display: grid;\\n }\\n}\\n\\n.cf-single-column-wrapper {\\n position: relative;\\n}\\n\\n.cf-single-column {\\n pointer-events: all;\\n}\\n\\n.cf-single-column-label {\\n pointer-events: none;\\n position: absolute;\\n z-index: -1;\\n top: 0;\\n left: 0;\\n right: 0;\\n bottom: 0;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n font-family: var(--exp-builder-font-stack-primary);\\n font-size: 12px;\\n color: var(--exp-builder-gray400);\\n z-index: 100;\\n}\\n\";\nstyleInject(css_248z);\n\nconst ColumnWrapper = forwardRef((props, ref) => {\n return (React.createElement(\"div\", { ref: ref, ...props, style: {\n ...(props.style || {}),\n display: 'grid',\n gridTemplateColumns: 'repeat(12, [col-start] 1fr)',\n } }, props.children));\n});\nColumnWrapper.displayName = 'ColumnWrapper';\nconst Columns = (props) => {\n const { editorMode, className, children } = props;\n if (!editorMode) {\n return (React.createElement(ColumnWrapper, { className: combineClasses(className, 'Columns') }, children));\n }\n const { node, renderDropzone } = props;\n return renderDropzone(node, {\n ['data-test-id']: 'contentful-columns',\n className: className,\n WrapperComponent: ColumnWrapper,\n });\n};\n\nconst SingleColumn = (props) => {\n const { className, editorMode, children } = props;\n if (editorMode === false) {\n return React.createElement(Flex, { className: className }, children);\n }\n const { renderDropzone, node, innerRef, Tooltip, style, dragHandleProps, draggableProps, cfColumnSpan, editorMode: edit, wrapperClassName, ...editorProps } = props;\n const isEmpty = !node.children.length;\n return (React.createElement(\"div\", { ref: innerRef, ...dragHandleProps, ...draggableProps, ...editorProps, className: combineClasses(wrapperClassName, 'cf-single-column-wrapper', isEmpty ? 'cf-single-column-empty' : ''), style: {\n ...style,\n gridColumn: `span ${cfColumnSpan}`,\n } },\n Tooltip,\n isEmpty && React.createElement(\"div\", { className: \"cf-single-column-label\" }, \"Column\"),\n renderDropzone(node, {\n ['data-test-id']: 'contentful-single-column',\n className: combineClasses('cf-single-column', className),\n WrapperComponent: Flex,\n })));\n};\n\nconst assemblyStyle = { display: 'contents' };\n// Feel free to do any magic as regards variable definitions for assemblies\n// Or if this isn't necessary by the time we figure that part out, we can bid this part farewell\nconst Assembly = (props) => {\n if (props.editorMode) {\n const { node } = props;\n return props.renderDropzone(node, {\n ['data-test-id']: 'contentful-assembly',\n className: props.className,\n style: assemblyStyle,\n });\n }\n // Using a display contents so assembly content/children\n // can appear as if they are direct children of the div wrapper's parent\n return React.createElement(\"div\", { \"data-test-id\": \"assembly\", ...props, style: assemblyStyle });\n};\n\nexport { Assembly, Button, ButtonComponentDefinition, Columns, ContentfulContainer, Heading, HeadingComponentDefinition, Image, ImageComponentDefinition, RichText, RichTextComponentDefinition, SingleColumn, Text, TextComponentDefinition };\n//# sourceMappingURL=index.js.map\n","import { EntityStoreBase } from '@contentful/experiences-core';\nimport type {\n ComponentTreeNode,\n ExperienceDataSource,\n ExperienceUnboundValues,\n ExperienceTreeNode,\n ComponentPropertyValue,\n ExperienceFields,\n} from '@contentful/experiences-core/types';\nimport type { Entry } from 'contentful';\nimport {\n ASSEMBLY_BLOCK_NODE_TYPE,\n ASSEMBLY_NODE_TYPE,\n} from '@contentful/experiences-core/constants';\nimport { assembliesRegistry } from '@/store/registries';\n\nexport const checkIsAssemblyEntry = (entry: Entry): boolean => {\n return Boolean(entry.fields?.componentSettings);\n};\n\nexport const deserializeAssemblyNode = ({\n node,\n nodeId,\n nodeLocation,\n parentId,\n assemblyDataSource,\n assemblyId,\n assemblyComponentId,\n assemblyUnboundValues,\n componentInstanceProps,\n componentInstanceUnboundValues,\n componentInstanceDataSource,\n}: {\n node: ComponentTreeNode;\n nodeId: string;\n nodeLocation: string | null;\n parentId?: string;\n assemblyDataSource: ExperienceDataSource;\n assemblyUnboundValues: ExperienceUnboundValues;\n assemblyId: string;\n assemblyComponentId: string;\n componentInstanceProps: Record<string, ComponentPropertyValue>;\n componentInstanceUnboundValues: ExperienceUnboundValues;\n componentInstanceDataSource: ExperienceDataSource;\n}): ExperienceTreeNode => {\n const childNodeVariable: Record<string, ComponentPropertyValue> = {};\n const dataSource: ExperienceDataSource = {};\n const unboundValues: ExperienceUnboundValues = {};\n\n for (const [variableName, variable] of Object.entries(node.variables)) {\n childNodeVariable[variableName] = variable;\n if (variable.type === 'ComponentValue') {\n const componentValueKey = variable.key;\n const instanceProperty = componentInstanceProps[componentValueKey];\n\n // For assembly, we look up the value in the assembly instance and\n // replace the componentValue with that one.\n if (instanceProperty?.type === 'UnboundValue') {\n const componentInstanceValue = componentInstanceUnboundValues[instanceProperty.key];\n unboundValues[instanceProperty.key] = componentInstanceValue;\n childNodeVariable[variableName] = {\n type: 'UnboundValue',\n key: instanceProperty.key,\n };\n } else if (instanceProperty?.type === 'BoundValue') {\n const [, dataSourceKey] = instanceProperty.path.split('/');\n const componentInstanceValue = componentInstanceDataSource[dataSourceKey];\n dataSource[dataSourceKey] = componentInstanceValue;\n childNodeVariable[variableName] = {\n type: 'BoundValue',\n path: instanceProperty.path,\n };\n }\n }\n }\n\n const isAssembly = assembliesRegistry.has(node.definitionId);\n\n const children: ExperienceTreeNode[] = node.children.map((child, childIndex) => {\n const newNodeLocation =\n nodeLocation === null ? `${childIndex}` : nodeLocation + '_' + childIndex;\n return deserializeAssemblyNode({\n node: child,\n nodeId: `${assemblyComponentId}---${newNodeLocation}`,\n parentId: nodeId,\n nodeLocation: newNodeLocation,\n assemblyId,\n assemblyDataSource,\n assemblyComponentId,\n assemblyUnboundValues,\n componentInstanceProps,\n componentInstanceUnboundValues,\n componentInstanceDataSource,\n });\n });\n\n return {\n // separate node type identifiers for assemblies and their blocks, so we can treat them differently in as much as we want\n type: isAssembly ? ASSEMBLY_NODE_TYPE : ASSEMBLY_BLOCK_NODE_TYPE,\n parentId,\n data: {\n id: nodeId,\n assembly: {\n id: assemblyId,\n componentId: assemblyComponentId,\n nodeLocation: nodeLocation || null,\n },\n blockId: node.definitionId,\n props: childNodeVariable,\n dataSource,\n unboundValues,\n breakpoints: [],\n },\n children,\n };\n};\n\nexport const resolveAssembly = ({\n node,\n entityStore,\n}: {\n node: ExperienceTreeNode;\n entityStore: EntityStoreBase | null;\n}) => {\n if (node.type !== ASSEMBLY_NODE_TYPE) {\n return node;\n }\n\n const componentId = node.data.blockId as string;\n const assembly = assembliesRegistry.get(componentId);\n\n if (!assembly) {\n console.warn(`Link to assembly with ID '${componentId}' not found`, {\n assembliesRegistry,\n });\n return node;\n }\n\n const componentFields = entityStore?.getValue(assembly, [\n 'fields',\n ]) as unknown as ExperienceFields;\n\n if (!componentFields) {\n console.warn(`Entry for assembly with ID '${componentId}' not found`, { entityStore });\n return node;\n }\n\n if (!componentFields.componentTree?.children) {\n console.warn(`Component tree for assembly with ID '${componentId}' not found`, {\n componentFields,\n });\n }\n\n const deserializedNode = deserializeAssemblyNode({\n node: {\n definitionId: node.data.blockId || '',\n variables: {},\n children: componentFields.componentTree?.children ?? [],\n },\n nodeLocation: null,\n nodeId: node.data.id,\n parentId: node.parentId,\n assemblyDataSource: {},\n assemblyId: assembly.sys.id,\n assemblyComponentId: node.data.id,\n assemblyUnboundValues: componentFields.unboundValues,\n componentInstanceProps: node.data.props,\n componentInstanceUnboundValues: node.data.unboundValues,\n componentInstanceDataSource: node.data.dataSource,\n });\n\n return deserializedNode;\n};\n","import React from 'react';\nimport type {\n ComponentRegistration,\n ExperienceTreeNode,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport { useMemo } from 'react';\nimport { useComponentProps } from './useComponentProps';\nimport { builtInComponents } from '@/types/constants';\nimport { ASSEMBLY_NODE_TYPE } from '@contentful/experiences-core/constants';\nimport { Assembly } from '@contentful/experiences-components-react';\nimport { resolveAssembly } from '@/utils/assemblyUtils';\nimport { componentRegistry, createAssemblyRegistration } from '@/store/registries';\nimport { useEntityStore } from '@/store/entityStore';\nimport type { RenderDropzoneFunction } from './Dropzone.types';\nimport { NoWrapDraggableProps } from '@components/Draggable/DraggableChildComponent';\n\ntype UseComponentProps = {\n node: ExperienceTreeNode;\n resolveDesignValue: ResolveDesignValueType;\n renderDropzone: RenderDropzoneFunction;\n userIsDragging: boolean;\n};\n\nexport const useComponent = ({\n node: rawNode,\n resolveDesignValue,\n renderDropzone,\n userIsDragging,\n}: UseComponentProps) => {\n const areEntitiesFetched = useEntityStore((state) => state.areEntitiesFetched);\n const entityStore = useEntityStore((state) => state.entityStore);\n\n const node = useMemo(() => {\n if (rawNode.type === ASSEMBLY_NODE_TYPE && areEntitiesFetched) {\n return resolveAssembly({\n node: rawNode,\n entityStore,\n });\n }\n\n return rawNode;\n }, [areEntitiesFetched, rawNode, entityStore]);\n\n const componentRegistration = useMemo(() => {\n const registration = componentRegistry.get(node.data.blockId as string);\n\n if (node.type === ASSEMBLY_NODE_TYPE && !registration) {\n return createAssemblyRegistration({\n definitionId: node.data.blockId as string,\n component: Assembly,\n }) as ComponentRegistration;\n } else if (!registration) {\n throw Error(\n `Component registration not found for component with id: \"${node.data.blockId}\". The component might of been removed. To proceed, remove the component manually from the layers tab.`,\n );\n }\n return registration as ComponentRegistration;\n }, [node]);\n\n const componentId = node.data.id;\n\n const { componentProps, wrapperProps } = useComponentProps({\n node,\n areEntitiesFetched,\n resolveDesignValue,\n renderDropzone,\n definition: componentRegistration.definition,\n userIsDragging,\n });\n\n // Only pass editor props to built-in components\n const { editorMode, renderDropzone: _renderDropzone, ...otherComponentProps } = componentProps;\n const elementToRender = builtInComponents.includes(node.data.blockId || '')\n ? (dragProps?: NoWrapDraggableProps) =>\n React.createElement(componentRegistration.component, { ...dragProps, ...componentProps })\n : node.type === ASSEMBLY_NODE_TYPE\n ? // Assembly.tsx requires renderDropzone and editorMode as well\n () => React.createElement(componentRegistration.component, componentProps)\n : () => React.createElement(componentRegistration.component, otherComponentProps);\n\n return {\n node,\n componentId,\n elementToRender,\n wrapperProps,\n definition: componentRegistration.definition,\n };\n};\n","import React from 'react';\nimport { CSSProperties, SyntheticEvent } from 'react';\nimport {\n Draggable,\n DraggableProvidedDragHandleProps,\n DraggableProvidedDraggableProps,\n} from '@hello-pangea/dnd';\nimport classNames from 'classnames';\nimport styles from './styles.module.css';\nimport { Rect } from '@components/Draggable/canvasToolsUtils';\nimport Tooltip from './Tooltip';\nimport {\n ComponentDefinition,\n ComponentDefinitionVariableType,\n} from '@contentful/experiences-core/types';\n\nexport type NoWrapDraggableProps = {\n ['data-ctfl-draggable-id']: string;\n wrapperClassName: string;\n Tooltip: React.ReactNode;\n innerRef: (element?: HTMLElement | null | undefined) => void;\n draggableProps: DraggableProvidedDraggableProps;\n dragHandleProps: DraggableProvidedDragHandleProps;\n style: CSSProperties;\n onClick: (e: SyntheticEvent<Element, Event>) => void;\n ['data-test-id']?: string;\n};\n\ntype DraggableChildComponentProps = {\n wrapperProps: Record<string, string | undefined>;\n elementToRender: (props: NoWrapDraggableProps) => JSX.Element;\n id: string;\n index: number;\n isAssemblyBlock?: boolean;\n isSelected?: boolean;\n onClick?: (e: SyntheticEvent) => void;\n coordinates: Rect | null;\n isContainer: boolean;\n blockId: string;\n userIsDragging?: boolean;\n style?: CSSProperties;\n isDragDisabled?: boolean;\n className?: string;\n definition: ComponentDefinition<ComponentDefinitionVariableType>;\n};\n\n/**\n * This component is meant to function the same as DraggableComponent except\n * with the difference that the draggable props are passed to the underlying\n * component. This removes an extra nexted `div` in editor mode that otherwise\n * is not visible in delivery mode.\n *\n * This is helpful for `flex` or `grid` layouts. Currently used by the SingleColumn\n * component.\n */\nexport const DraggableChildComponent: React.FC<DraggableChildComponentProps> = (props) => {\n const {\n elementToRender,\n id,\n index,\n isAssemblyBlock = false,\n isSelected = false,\n onClick = () => null,\n coordinates,\n userIsDragging,\n style,\n isContainer,\n blockId,\n isDragDisabled = false,\n wrapperProps,\n definition,\n } = props;\n\n return (\n <Draggable key={id} draggableId={id} index={index} isDragDisabled={isDragDisabled}>\n {(provided, snapshot) =>\n elementToRender({\n ['data-ctfl-draggable-id']: id,\n ['data-test-id']: `draggable-${blockId}`,\n innerRef: provided.innerRef,\n ...wrapperProps,\n draggableProps: provided.draggableProps,\n wrapperClassName: classNames(styles.DraggableComponent, wrapperProps.className, {\n [styles.isAssemblyBlock]: isAssemblyBlock,\n [styles.isDragging]: snapshot.isDragging,\n [styles.isSelected]: isSelected,\n [styles.userIsDragging]: userIsDragging,\n }),\n dragHandleProps: provided.dragHandleProps!,\n style: {\n ...style,\n ...provided.draggableProps.style,\n },\n onClick,\n Tooltip: (\n <Tooltip\n id={id}\n coordinates={coordinates}\n isAssemblyBlock={isAssemblyBlock}\n isContainer={isContainer}\n label={definition.name || 'No label specified'}\n />\n ),\n })\n }\n </Draggable>\n );\n};\n","import type { ExperienceTreeNode, ExperienceTree } from '@contentful/experiences-core/types';\nimport { ROOT_ID } from '../types/constants';\n\nexport type ItemSelector = {\n id: string;\n};\n\nfunction getItemFromTree(id: string, node: ExperienceTreeNode): ExperienceTreeNode | undefined {\n // Check if the current node's id matches the search id\n\n if (node.data.id === id) {\n return node;\n }\n\n // Recursively search through each child\n for (const child of node.children) {\n const foundNode = getItemFromTree(id, child);\n if (foundNode) {\n // Node found in children\n return foundNode;\n }\n }\n\n // If the node is not found in this branch of the tree, return undefined\n return undefined;\n}\n\nfunction findDepthById(node: ExperienceTreeNode, id: string, currentDepth: number = 1): number {\n if (node.data.id === id) {\n return currentDepth;\n }\n\n // If the node has children, check each one\n for (const child of node.children) {\n const childDepth = findDepthById(child, id, currentDepth + 1);\n if (childDepth !== -1) {\n return childDepth; // Found the node in a child\n }\n }\n\n return -1; // Node not found in this branch\n}\n\nexport const getChildFromTree = (\n parentId: string,\n index: number,\n node: ExperienceTreeNode,\n): ExperienceTreeNode | undefined => {\n // Check if the current node's id matches the search id\n\n if (node.data.id === parentId) {\n return node.children[index];\n }\n\n // Recursively search through each child\n for (const child of node.children) {\n const foundNode = getChildFromTree(parentId, index, child);\n if (foundNode) {\n // Node found in children\n return foundNode;\n }\n }\n\n // If the node is not found in this branch of the tree, return undefined\n return undefined;\n};\n\nexport const getItem = (\n selector: ItemSelector,\n tree: ExperienceTree,\n): ExperienceTreeNode | undefined => {\n return getItemFromTree(selector.id, {\n type: 'block',\n data: {\n id: ROOT_ID,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as any,\n children: tree.root.children,\n });\n};\n\nexport const getItemDepthFromNode = (selector: ItemSelector, node: ExperienceTreeNode): number => {\n return findDepthById(node, selector.id);\n};\n","import type { ExperienceTreeNode } from '@contentful/experiences-core/types';\nimport { isEqual } from 'lodash-es';\nimport { getChildFromTree } from './getItem';\n\nexport function updateNode(\n nodeId: string,\n updatedNode: ExperienceTreeNode,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === nodeId) {\n node.data = updatedNode.data;\n return;\n }\n\n node.children.forEach((childNode) => updateNode(nodeId, updatedNode, childNode));\n}\nexport function replaceNode(\n indexToReplace: number,\n updatedNode: ExperienceTreeNode,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === updatedNode.parentId) {\n node.children = [\n ...node.children.slice(0, indexToReplace),\n updatedNode,\n ...node.children.slice(indexToReplace + 1),\n ];\n return;\n }\n\n node.children.forEach((childNode) => replaceNode(indexToReplace, updatedNode, childNode));\n}\n\nexport function reorderChildrenNodes(\n nodeId: string,\n updatedChildren: ExperienceTreeNode[],\n node: ExperienceTreeNode,\n) {\n if (node.data.id === nodeId) {\n node.children = updatedChildren;\n return;\n }\n\n node.children.forEach((childNode) => reorderChildrenNodes(nodeId, updatedChildren, childNode));\n}\n\nexport function addChildToNode(\n nodeId: string,\n oldChildren: ExperienceTreeNode[],\n updatedChildren: ExperienceTreeNode[],\n node: ExperienceTreeNode,\n) {\n if (node.data.id !== nodeId) {\n node.children.forEach((childNode) =>\n addChildToNode(nodeId, oldChildren, updatedChildren, childNode),\n );\n }\n\n let changed = false;\n\n oldChildren.forEach((child, i) => {\n if (isEqual(child, updatedChildren[i])) {\n return;\n }\n\n changed = true;\n addChildNode(i, node.data.id, updatedChildren[i], node);\n });\n\n if (!changed) {\n // we iterated over the old children and didn't introduce a change.\n // that means the child node is added to the end of the array.\n addChildNode(\n oldChildren.length,\n node.data.id,\n updatedChildren[updatedChildren.length - 1],\n node,\n );\n }\n}\n\nexport function removeChildNode(\n indexToRemove: number,\n nodeId: string,\n parentNodeId: string,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === parentNodeId) {\n const childIndex = node.children.findIndex((child) => child.data.id === nodeId);\n\n node.children.splice(childIndex === -1 ? indexToRemove : childIndex, 1);\n return;\n }\n\n node.children.forEach((childNode) =>\n removeChildNode(indexToRemove, nodeId, parentNodeId, childNode),\n );\n}\n\nexport function addChildNode(\n indexToAdd: number,\n parentNodeId: string,\n nodeToAdd: ExperienceTreeNode,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === parentNodeId) {\n node.children = [\n ...node.children.slice(0, indexToAdd),\n nodeToAdd,\n ...node.children.slice(indexToAdd),\n ];\n\n return;\n }\n\n node.children.forEach((childNode) =>\n addChildNode(indexToAdd, parentNodeId, nodeToAdd, childNode),\n );\n}\n\nexport function reorderChildNode(\n oldIndex: number,\n newIndex: number,\n parentNodeId: string,\n node: ExperienceTreeNode,\n) {\n if (node.data.id === parentNodeId) {\n // Remove the child from the old position\n const [childToMove] = node.children.splice(oldIndex, 1);\n\n // Insert the child at the new position\n node.children.splice(newIndex, 0, childToMove);\n return;\n }\n\n node.children.forEach((childNode) =>\n reorderChildNode(oldIndex, newIndex, parentNodeId, childNode),\n );\n}\n\nexport function reparentChildNode(\n oldIndex: number,\n newIndex: number,\n sourceNodeId: string,\n destinationNodeId: string,\n node: ExperienceTreeNode,\n) {\n const nodeToMove = getChildFromTree(sourceNodeId, oldIndex, node);\n\n if (!nodeToMove) {\n return;\n }\n\n removeChildNode(oldIndex, nodeToMove.data.id, sourceNodeId, node);\n addChildNode(newIndex, destinationNodeId, nodeToMove, node);\n}\n","import { ExperienceTreeNode, ExperienceTree } from '@contentful/experiences-core/types';\n\nimport { getItem } from './getItem';\nimport { isEqual } from 'lodash-es';\nimport { ROOT_ID, TreeAction } from '@/types/constants';\nimport { TreeDiff } from '@/types/treeActions';\n\ninterface MissingNodeActionParams {\n index: number;\n nodeAdded: boolean;\n tree: ExperienceTree;\n child: ExperienceTreeNode;\n currentNode: ExperienceTreeNode;\n parentNodeId: string;\n}\n\nfunction missingNodeAction({\n index,\n nodeAdded,\n child,\n tree,\n parentNodeId,\n currentNode,\n}: MissingNodeActionParams): TreeDiff | null {\n if (nodeAdded) {\n return { type: TreeAction.ADD_NODE, indexToAdd: index, nodeToAdd: child, parentNodeId };\n }\n\n const item = getItem({ id: child.data.id }, tree);\n\n if (item) {\n const parentNode = getItem({ id: item.parentId! }, tree);\n\n if (!parentNode) {\n return null;\n }\n const sourceIndex = parentNode.children.findIndex((c) => c.data.id === child.data.id);\n\n return { type: TreeAction.MOVE_NODE, sourceIndex, destinationIndex: index, parentNodeId };\n }\n\n return {\n type: TreeAction.REPLACE_NODE,\n originalId: currentNode.children[index].data.id,\n indexToReplace: index,\n node: child,\n };\n}\n\ninterface MatchingNodeActionParams {\n index: number;\n originalIndex: number;\n nodeAdded: boolean;\n nodeRemoved: boolean;\n parentNodeId: string;\n}\n\nfunction matchingNodeAction({\n index,\n originalIndex,\n nodeRemoved,\n nodeAdded,\n parentNodeId,\n}: MatchingNodeActionParams): TreeDiff | null {\n if (index !== originalIndex && !nodeRemoved && !nodeAdded) {\n return {\n type: TreeAction.REORDER_NODE,\n sourceIndex: originalIndex,\n destinationIndex: index,\n parentNodeId,\n };\n }\n\n return null;\n}\n\ninterface CompareNodeParams {\n currentNode?: ExperienceTreeNode;\n updatedNode?: ExperienceTreeNode;\n originalTree: ExperienceTree;\n differences: Array<TreeDiff | null>;\n}\n\nfunction compareNodes({\n currentNode,\n updatedNode,\n originalTree,\n differences = [],\n}: CompareNodeParams): Array<TreeDiff | null> {\n // In the end, this map contains the list of nodes that are not present\n // in the updated tree and must be removed\n const map = new Map<string, number>();\n\n if (!currentNode || !updatedNode) {\n return differences;\n }\n\n // On each tree level, consider only the children of the current node to differentiate between added, removed, or replaced case\n const currentNodeCount = currentNode.children.length;\n const updatedNodeCount = updatedNode.children.length;\n const nodeRemoved = currentNodeCount > updatedNodeCount;\n const nodeAdded = currentNodeCount < updatedNodeCount;\n const parentNodeId = updatedNode.data.id;\n const isRoot = currentNode.data.id === ROOT_ID;\n\n /**\n * The data of the current node has changed, we need to update\n * this node to reflect the data change. (design, content, unbound values)\n */\n if (!isRoot && !isEqual(currentNode.data, updatedNode.data)) {\n differences.push({\n type: TreeAction.UPDATE_NODE,\n nodeId: currentNode.data.id,\n node: updatedNode,\n });\n }\n\n // Map children of the first tree by their ID\n currentNode.children.forEach((child, index) => map.set(child.data.id, index));\n\n // Compare with the second tree\n updatedNode.children.forEach((child, index) => {\n const childId = child.data.id;\n // The original tree does not have this node in the updated tree.\n if (!map.has(childId)) {\n const diff = missingNodeAction({\n index,\n child,\n nodeAdded,\n parentNodeId,\n tree: originalTree,\n currentNode,\n });\n if (diff?.type === TreeAction.REPLACE_NODE) {\n // Remove it from the deletion map to avoid adding another REMOVE_NODE action\n map.delete(diff.originalId);\n }\n return differences.push(diff);\n }\n\n const originalIndex = map.get(childId)!;\n\n const diff = matchingNodeAction({\n index,\n originalIndex,\n nodeAdded,\n nodeRemoved,\n parentNodeId,\n });\n\n differences.push(diff);\n map.delete(childId);\n\n compareNodes({\n currentNode: currentNode.children[originalIndex],\n updatedNode: child,\n originalTree,\n differences,\n });\n });\n\n map.forEach((index, key) => {\n // If the node count of the entire tree doesn't signify\n // a node was removed, don't add that as a diff\n if (!nodeRemoved) {\n return;\n }\n // Remaining nodes in the map are removed in the second tree\n differences.push({\n type: TreeAction.REMOVE_NODE,\n indexToRemove: index,\n parentNodeId,\n idToRemove: key,\n });\n });\n\n return differences;\n}\n\nexport function getTreeDiffs(\n tree1: ExperienceTreeNode,\n tree2: ExperienceTreeNode,\n originalTree: ExperienceTree,\n): TreeDiff[] {\n const differences: TreeDiff[] = [];\n\n compareNodes({\n currentNode: tree1,\n updatedNode: tree2,\n originalTree,\n differences,\n });\n\n return differences.filter((diff) => diff) as TreeDiff[];\n}\n","type NodeWithChildren<T> = {\n children: T[];\n};\n\n/**\n * @deprecated in favor of one in 'core' package\n */\nexport function treeVisit<T extends NodeWithChildren<T>>(\n initialNode: T,\n onNode: (node: T, index: number, depth: number) => void,\n) {\n // returns last used index\n const _treeVisit = (currentNode: T, currentIndex: number, currentDepth: number): number => {\n // Copy children in case of onNode removing it as we pass the node by reference\n const children = [...currentNode.children];\n onNode(currentNode, currentIndex, currentDepth);\n let nextAvailableIndex = currentIndex + 1;\n const lastUsedIndex = currentIndex;\n for (const child of children) {\n const lastUsedIndex = _treeVisit(child, nextAvailableIndex, currentDepth + 1);\n nextAvailableIndex = lastUsedIndex + 1;\n }\n return lastUsedIndex;\n };\n _treeVisit(initialNode, 0, 0);\n}\n\n/**\n * Traverses all nodes of a tree and maps all of them.\n * Intuitively works similarly to Array.map().\n * When returning mapped object from the mapper function\n * you _do not_ need to return about `.children[]` field.\n * This field is automatically managed by the treeMap() function.\n *\n * You can map each node to whatever you want, but shouldn't\n * modify the structure of the tree from the mapping function.\n * @deprecated in favor of one in 'core' package\n */\nexport function treeMap<T extends NodeWithChildren<T>, U>(\n node: T,\n onNode: (node: T) => Omit<U, 'children'>,\n): U {\n // Copy children in case of onNode removing it as we pass the node by reference\n const children = [...node.children];\n const newNode = {\n ...onNode(node),\n children: children.map((child) => treeMap(child, onNode)),\n } as U;\n\n return newNode;\n}\n","import type {\n Breakpoint,\n ExperienceTreeNode,\n ExperienceTree,\n} from '@contentful/experiences-core/types';\nimport { ROOT_ID, TreeAction } from '@/types/constants';\nimport { create } from 'zustand';\nimport { produce } from 'immer';\nimport {\n addChildNode,\n removeChildNode,\n reorderChildNode,\n reparentChildNode,\n replaceNode,\n updateNode,\n} from '@/utils/treeHelpers';\nimport { getTreeDiffs } from '@/utils/getTreeDiff';\nimport { treeVisit } from '@/utils/treeTraversal';\nimport { ASSEMBLY_NODE_TYPE } from '@contentful/experiences-core/constants';\nexport interface TreeStore {\n tree: ExperienceTree;\n breakpoints: Breakpoint[];\n updateTree: (tree: ExperienceTree) => void;\n updateTreeForced: (tree: ExperienceTree) => void;\n updateNodesByUpdatedEntity: (entityId: string) => void;\n addChild: (\n destinationIndex: number,\n destinationParentId: string,\n node: ExperienceTreeNode,\n ) => void;\n reorderChildren: (\n destinationIndex: number,\n destinationParentId: string,\n sourceIndex: number,\n ) => void;\n reparentChild: (\n destinationIndex: number,\n destinationParentId: string,\n sourceIndex: number,\n sourceParentId: string,\n ) => void;\n}\n\nconst isAssemblyNode = (node: ExperienceTreeNode) => {\n return node.type === ASSEMBLY_NODE_TYPE;\n};\n\nexport const useTreeStore = create<TreeStore>((set, get) => ({\n tree: {\n root: {\n children: [],\n type: 'root',\n data: {\n breakpoints: [],\n dataSource: {},\n id: ROOT_ID,\n props: {},\n unboundValues: {},\n },\n },\n },\n breakpoints: [],\n\n updateNodesByUpdatedEntity: (entityId: string) => {\n set(\n produce((draftState: TreeStore) => {\n treeVisit(draftState.tree.root, (node) => {\n if (isAssemblyNode(node) && node.data.blockId === entityId) {\n // Cannot use `structuredClone()` as node is probably a Proxy object with weird references\n updateNode(node.data.id, cloneDeepAsPOJO(node), draftState.tree.root);\n return;\n }\n const dataSourceIds = Object.values(node.data.dataSource).map((link) => link.sys.id);\n if (dataSourceIds.includes(entityId)) {\n // Cannot use `structuredClone()` as node is probably a Proxy object with weird references\n updateNode(node.data.id, cloneDeepAsPOJO(node), draftState.tree.root);\n }\n });\n }),\n );\n },\n\n /**\n * NOTE: this is for debugging purposes only as it causes ugly canvas flash.\n *\n * Force updates entire tree. Usually shouldn't be used as updateTree()\n * uses smart update algorithm based on diffs. But for troubleshooting\n * you may want to force update the tree so leaving this in.\n */\n updateTreeForced: (tree) => {\n set({\n tree,\n // Breakpoints must be updated, as we receive completely new tree with possibly new breakpoints\n breakpoints: tree?.root?.data?.breakpoints || [],\n });\n },\n updateTree: (tree) => {\n const currentTree = get().tree;\n\n /**\n * If we simply update the tree as in:\n *\n * `state.tree = tree`\n *\n * we end up causing a lot of unnecesary rerenders which can lead to\n * flickering of the component layout. Instead, we use this function\n * to deteremine exactly which nodes in the tree changed and combined\n * with immer, we end up updating only the changed nodes instead of\n * rerendering the entire tree.\n */\n const treeDiff = getTreeDiffs({ ...currentTree.root }, { ...tree.root }, currentTree);\n\n // The current and updated tree are the same, no tree update required.\n if (!treeDiff.length) {\n console.debug(\n `[exp-builder.visual-editor::updateTree()]: During smart-diffing no diffs. Skipping tree update.`,\n );\n return;\n }\n\n set(\n produce((state: TreeStore) => {\n treeDiff.map((diff) => {\n switch (diff.type) {\n case TreeAction.ADD_NODE:\n addChildNode(diff.indexToAdd, diff.parentNodeId, diff.nodeToAdd, state.tree.root);\n break;\n case TreeAction.REPLACE_NODE:\n replaceNode(diff.indexToReplace, diff.node, state.tree.root);\n break;\n case TreeAction.UPDATE_NODE:\n updateNode(diff.nodeId, diff.node, state.tree.root);\n break;\n case TreeAction.REMOVE_NODE:\n removeChildNode(\n diff.indexToRemove,\n diff.idToRemove,\n diff.parentNodeId,\n state.tree.root,\n );\n break;\n case TreeAction.MOVE_NODE:\n case TreeAction.REORDER_NODE:\n state.tree = tree;\n break;\n default:\n break;\n }\n });\n\n state.breakpoints = tree?.root?.data?.breakpoints || [];\n }),\n );\n },\n addChild: (index, parentId, node) => {\n set(\n produce((state: TreeStore) => {\n addChildNode(index, parentId, node, state.tree.root);\n }),\n );\n },\n reorderChildren: (destinationIndex, destinationParentId, sourceIndex) => {\n set(\n produce((state: TreeStore) => {\n reorderChildNode(sourceIndex, destinationIndex, destinationParentId, state.tree.root);\n }),\n );\n },\n reparentChild: (destinationIndex, destinationParentId, sourceIndex, sourceParentId) => {\n set(\n produce((state: TreeStore) => {\n reparentChildNode(\n sourceIndex,\n destinationIndex,\n sourceParentId,\n destinationParentId,\n state.tree.root,\n );\n }),\n );\n },\n}));\n\n// Serialize and deserialize an object again to remove all functions and references.\n// Some people refer to this as \"Plain Old JavaScript Object\" (POJO) as it solely contains plain data.\nfunction cloneDeepAsPOJO(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n","import { Direction } from '@hello-pangea/dnd';\nimport { create } from 'zustand';\n\nimport { produce } from 'immer';\nexport interface Zone {\n id: string;\n direction: Direction;\n}\n\ninterface State {\n hoveringZone: string;\n zones: Record<string, Zone>;\n}\n\ninterface Actions {\n upsertZone: (id: string, data: Partial<Zone>) => void;\n setHoveringZone: (zoneId: string) => void;\n}\n\nexport const useZoneStore = create<Actions & State>()((set) => ({\n zones: {},\n hoveringZone: '',\n setHoveringZone(zoneId) {\n set({\n hoveringZone: zoneId,\n });\n },\n upsertZone(id, data) {\n set(\n produce((state) => {\n state.zones[id] = { ...(state.zones[id] || {}), ...data };\n }),\n );\n },\n}));\n","import { DRAGGABLE_HEIGHT, DRAGGABLE_WIDTH, HITBOX, HitboxDirection } from '@/types/constants';\nimport { CSSProperties } from '@contentful/experiences-core/types';\n\nconst { WIDTH, HEIGHT, INITIAL_OFFSET, OFFSET_INCREMENT, MIN_HEIGHT, MIN_DEPTH_HEIGHT, DEEP_ZONE } =\n HITBOX;\n\ninterface Params {\n direction: HitboxDirection;\n domRect?: DOMRect;\n zoneDepth: number;\n scrollY: number;\n}\n\nconst calcOffsetDepth = (depth: number) => {\n return INITIAL_OFFSET - OFFSET_INCREMENT * depth;\n};\n\nexport const getHitboxStyles = ({ direction, zoneDepth, domRect }: Params): CSSProperties => {\n if (!domRect) {\n return {\n display: 'none',\n };\n }\n\n const { width, height, top, left, bottom, right } = domRect;\n\n const MAX_SELF_HEIGHT = DRAGGABLE_HEIGHT * 2;\n\n const isDeepZone = zoneDepth > DEEP_ZONE;\n const isAboveMaxHeight = height > MAX_SELF_HEIGHT;\n\n switch (direction) {\n case HitboxDirection.TOP:\n return {\n width,\n height: HEIGHT,\n top: top - calcOffsetDepth(zoneDepth) - scrollY,\n left,\n zIndex: 100 + zoneDepth,\n };\n case HitboxDirection.BOTTOM:\n return {\n width,\n height: HEIGHT,\n top: bottom + calcOffsetDepth(zoneDepth) - scrollY,\n left,\n zIndex: 100 + zoneDepth,\n };\n case HitboxDirection.LEFT:\n return {\n width: WIDTH,\n height: height - HEIGHT,\n left: left - calcOffsetDepth(zoneDepth) - WIDTH / 2,\n top: top + HEIGHT / 2 - scrollY,\n zIndex: 100 + zoneDepth,\n };\n case HitboxDirection.RIGHT:\n return {\n width: WIDTH,\n height: height - HEIGHT,\n left: right - calcOffsetDepth(zoneDepth) - WIDTH / 2,\n top: top + HEIGHT / 2 - scrollY,\n zIndex: 100 + zoneDepth,\n };\n case HitboxDirection.SELF_VERTICAL: {\n if (isAboveMaxHeight && !isDeepZone) {\n return { display: 'none' };\n }\n\n const selfHeight = isDeepZone ? MIN_DEPTH_HEIGHT : MIN_HEIGHT;\n return {\n width,\n height: selfHeight,\n left,\n top: top + height / 2 - selfHeight / 2 - scrollY,\n zIndex: 1000 + zoneDepth,\n };\n }\n case HitboxDirection.SELF_HORIZONTAL: {\n if (width > DRAGGABLE_WIDTH) {\n return { display: 'none' };\n }\n return {\n width: width - DRAGGABLE_WIDTH * 2,\n height,\n left: left + (DRAGGABLE_WIDTH * 2) / 2,\n top: top - scrollY,\n zIndex: 1000 + zoneDepth,\n };\n }\n default:\n return {};\n }\n};\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport styles from './styles.module.css';\nimport { useTreeStore } from '@/store/tree';\nimport { getItemDepthFromNode } from '@/utils/getItem';\nimport { CTFL_ZONE_ID, HitboxDirection, ROOT_ID } from '@/types/constants';\nimport { useZoneStore } from '@/store/zone';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport { createPortal } from 'react-dom';\nimport { getHitboxStyles } from '@/utils/getHitboxStyles';\n\ninterface Props {\n parentZoneId: string;\n zoneId: string;\n enableRootHitboxes: boolean;\n}\n\nconst Hitboxes: React.FC<Props> = ({ zoneId, parentZoneId, enableRootHitboxes }) => {\n const tree = useTreeStore((state) => state.tree);\n const isDraggingOnCanvas = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n const scrollY = useDraggedItemStore((state) => state.scrollY);\n const zoneDepth = useMemo(\n () => getItemDepthFromNode({ id: parentZoneId }, tree.root),\n [tree, parentZoneId],\n );\n const [fetchDomRect, setFetchDomRect] = useState(Date.now());\n\n useEffect(() => {\n /**\n * A bit hacky but we need to wait a very small amount\n * of time to fetch the dom getBoundingClientRect once a\n * drag starts because we need pre-drag styles like padding\n * applied before we calculate positions of hitboxes\n */\n setTimeout(() => {\n setFetchDomRect(Date.now());\n }, 50);\n }, [isDraggingOnCanvas]);\n\n const hitboxContainer = useMemo(() => {\n return document.querySelector('[data-ctfl-hitboxes]');\n }, []);\n\n const domRect = useMemo(() => {\n return document.querySelector(`[${CTFL_ZONE_ID}=\"${zoneId}\"]`)?.getBoundingClientRect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [zoneId, fetchDomRect]);\n\n const zones = useZoneStore((state) => state.zones);\n\n const zoneDirection = zones[parentZoneId]?.direction || 'vertical';\n const isVertical = zoneDirection === 'vertical';\n const isRoot = parentZoneId === ROOT_ID;\n const showRootHitboxes = isRoot && enableRootHitboxes;\n\n const getStyles = useCallback(\n (direction: HitboxDirection) => getHitboxStyles({ direction, zoneDepth, domRect, scrollY }),\n [zoneDepth, domRect, scrollY],\n );\n\n const ActiveHitboxes = (\n <>\n <div\n data-ctfl-zone-id={zoneId}\n className={styles.hitbox}\n style={getStyles(\n isVertical ? HitboxDirection.SELF_VERTICAL : HitboxDirection.SELF_HORIZONTAL,\n )}\n />\n {showRootHitboxes && (\n <div\n data-ctfl-zone-id={parentZoneId}\n className={styles.hitbox}\n style={getStyles(HitboxDirection.BOTTOM)}\n />\n )}\n {!isRoot && (\n <>\n <div\n data-ctfl-zone-id={parentZoneId}\n className={styles.hitbox}\n style={getStyles(isVertical ? HitboxDirection.TOP : HitboxDirection.LEFT)}\n />\n <div\n data-ctfl-zone-id={parentZoneId}\n className={styles.hitbox}\n style={getStyles(isVertical ? HitboxDirection.BOTTOM : HitboxDirection.RIGHT)}\n />\n </>\n )}\n </>\n );\n\n if (!hitboxContainer) {\n return null;\n }\n return createPortal(ActiveHitboxes, hitboxContainer);\n};\n\nexport default Hitboxes;\n","import React from 'react';\nimport { DraggableComponent } from '../Draggable/DraggableComponent';\nimport { isContentfulStructureComponent, sendMessage } from '@contentful/experiences-core';\nimport { useSelectedInstanceCoordinates } from '@/hooks/useSelectedInstanceCoordinates';\nimport { useEditorStore } from '@/store/editor';\nimport { useComponent } from './useComponent';\nimport type {\n ExperienceTreeNode,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport {\n CONTENTFUL_COMPONENTS,\n ASSEMBLY_BLOCK_NODE_TYPE,\n OUTGOING_EVENTS,\n ASSEMBLY_NODE_TYPE,\n} from '@contentful/experiences-core/constants';\nimport { DraggableChildComponent } from '@components/Draggable/DraggableChildComponent';\nimport { RenderDropzoneFunction } from './Dropzone.types';\nimport { PlaceholderParams } from '@components/Draggable/Placeholder';\nimport { ROOT_ID } from '@/types/constants';\nimport Hitboxes from './Hitboxes';\n\ntype EditorBlockProps = {\n placeholder: PlaceholderParams;\n node: ExperienceTreeNode;\n index: number;\n userIsDragging: boolean;\n draggingNewComponent: boolean | undefined;\n resolveDesignValue: ResolveDesignValueType;\n renderDropzone: RenderDropzoneFunction;\n zoneId: string;\n};\n\nexport const EditorBlock: React.FC<EditorBlockProps> = ({\n node: rawNode,\n resolveDesignValue,\n renderDropzone,\n draggingNewComponent,\n index,\n zoneId,\n userIsDragging,\n placeholder,\n}) => {\n const setSelectedNodeId = useEditorStore((state) => state.setSelectedNodeId);\n const selectedNodeId = useEditorStore((state) => state.selectedNodeId);\n const { node, componentId, wrapperProps, definition, elementToRender } = useComponent({\n node: rawNode,\n resolveDesignValue,\n renderDropzone,\n userIsDragging,\n });\n\n const coordinates = useSelectedInstanceCoordinates({ node });\n\n const isContainer = node.data.blockId === CONTENTFUL_COMPONENTS.container.id;\n const isSingleColumn = node.data.blockId === CONTENTFUL_COMPONENTS.singleColumn.id;\n const isAssemblyBlock = node.type === ASSEMBLY_BLOCK_NODE_TYPE;\n const isAssembly = node.type === ASSEMBLY_NODE_TYPE;\n const isStructureComponent = isContentfulStructureComponent(node.data.blockId);\n const isRootComponent = zoneId === ROOT_ID;\n\n const enableRootHitboxes = isRootComponent && !!draggingNewComponent;\n\n const onClick = (e: React.SyntheticEvent<Element, Event>) => {\n e.stopPropagation();\n\n if (!userIsDragging) {\n setSelectedNodeId(node.data.id);\n // if it is the assembly directly we just want to select it as a normal component\n if (isAssembly) {\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: node.data.id,\n });\n return;\n }\n\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n assembly: node.data.assembly,\n nodeId: node.data.id,\n });\n }\n };\n\n if (node.data.blockId === CONTENTFUL_COMPONENTS.singleColumn.id) {\n return (\n <>\n <DraggableChildComponent\n elementToRender={elementToRender}\n id={componentId}\n index={index}\n isAssemblyBlock={isAssemblyBlock}\n isDragDisabled={isSingleColumn}\n isSelected={selectedNodeId === componentId}\n userIsDragging={userIsDragging}\n isContainer={isContainer}\n blockId={node.data.blockId}\n coordinates={coordinates!}\n wrapperProps={wrapperProps}\n onClick={onClick}\n definition={definition}\n />\n {isStructureComponent && !isSingleColumn && userIsDragging && (\n <Hitboxes\n parentZoneId={zoneId}\n zoneId={componentId}\n enableRootHitboxes={enableRootHitboxes}\n />\n )}\n </>\n );\n }\n\n return (\n <DraggableComponent\n placeholder={placeholder}\n definition={definition}\n id={componentId}\n index={index}\n isAssemblyBlock={isAssemblyBlock}\n isDragDisabled={isAssemblyBlock}\n isSelected={selectedNodeId === componentId}\n userIsDragging={userIsDragging}\n isContainer={isContainer}\n blockId={node.data.blockId}\n coordinates={coordinates!}\n wrapperProps={wrapperProps}\n onClick={onClick}>\n {elementToRender()}\n {isStructureComponent && !isSingleColumn && userIsDragging && (\n <Hitboxes\n parentZoneId={zoneId}\n zoneId={componentId}\n enableRootHitboxes={enableRootHitboxes}\n />\n )}\n </DraggableComponent>\n );\n};\n","import React from 'react';\nimport styles from './EmptyContainer.module.css';\nimport classNames from 'classnames';\n\nexport interface EmptyContainerProps {\n isFirst?: boolean;\n isDragging?: boolean;\n isHoveringOnRoot?: boolean;\n}\n\nexport const EmptyContainer = ({ isDragging }: EmptyContainerProps) => {\n return (\n <div\n className={classNames(styles.container, {\n [styles.highlight]: isDragging,\n })}\n data-type=\"empty-container\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"37\"\n height=\"36\"\n fill=\"none\"\n className={styles.icon}>\n <rect\n width=\"11.676\"\n height=\"11.676\"\n x=\"18.512\"\n y=\".153\"\n rx=\"1.621\"\n transform=\"rotate(45 18.512 .153)\"\n />\n <rect\n width=\"11.676\"\n height=\"11.676\"\n x=\"9.254\"\n y=\"9.139\"\n rx=\"1.621\"\n transform=\"rotate(45 9.254 9.139)\"\n />\n <rect\n width=\"11.676\"\n height=\"11.676\"\n x=\"18.011\"\n y=\"18.625\"\n rx=\"1.621\"\n transform=\"rotate(45 18.01 18.625)\"\n />\n <rect\n width=\"11.676\"\n height=\"11.676\"\n x=\"30.557\"\n y=\"10.131\"\n rx=\"1.621\"\n transform=\"rotate(60 30.557 10.13)\"\n />\n <path\n fill=\"#fff\"\n stroke=\"#fff\"\n strokeWidth=\".243\"\n d=\"M31.113 17.038a.463.463 0 0 0-.683-.517l-1.763 1.032-1.033-1.763a.464.464 0 0 0-.8.469l1.034 1.763-1.763 1.033a.463.463 0 1 0 .468.8l1.763-1.033 1.033 1.763a.463.463 0 1 0 .8-.469l-1.033-1.763 1.763-1.033a.463.463 0 0 0 .214-.282Z\"\n />\n </svg>\n\n <span className={styles.label}>Add components to begin</span>\n </div>\n );\n};\n","import { ROOT_ID } from '../types/constants';\n\nexport const getZoneParents = (zoneId: string) => {\n const element = document.querySelector(`[data-rfd-droppable-id='${zoneId}']`);\n\n if (!element) {\n return [];\n }\n\n function getZonesToRoot(element: Element | null, parentIds: string[] = []) {\n if (!element) {\n return parentIds;\n }\n\n const attribute = element.getAttribute('data-rfd-droppable-id');\n\n if (attribute === ROOT_ID) {\n return parentIds;\n }\n\n if (attribute) {\n parentIds.push(attribute);\n }\n\n return getZonesToRoot(element.parentElement, parentIds);\n }\n\n return getZonesToRoot(element);\n};\n","import { CONTENTFUL_COMPONENTS } from '@contentful/experiences-core/constants';\nimport type {\n ExperienceTreeNode,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport { useEffect } from 'react';\nimport { useZoneStore } from '@/store/zone';\nimport { isContentfulStructureComponent } from '@contentful/experiences-core';\n\ninterface Params {\n resolveDesignValue: ResolveDesignValueType | undefined;\n node: ExperienceTreeNode | undefined;\n zoneId: string;\n}\n\nexport const useDropzoneDirection = ({ resolveDesignValue, node, zoneId }: Params) => {\n const zone = useZoneStore((state) => state.zones);\n const upsertZone = useZoneStore((state) => state.upsertZone);\n\n useEffect(() => {\n function getDirection() {\n if (!node || !node.data.blockId) {\n return 'vertical';\n }\n\n if (!isContentfulStructureComponent(node.data.blockId)) {\n return 'vertical';\n }\n\n if (node.data.blockId === CONTENTFUL_COMPONENTS.columns.id) {\n return 'horizontal';\n }\n\n const designValues = node.data.props['cfFlexDirection'];\n\n if (!designValues || !resolveDesignValue || designValues.type !== 'DesignValue') {\n return 'vertical';\n }\n\n const direction = resolveDesignValue(designValues.valuesByBreakpoint, 'cfFlexDirection');\n\n if (direction === 'row') {\n return 'horizontal';\n }\n\n return 'vertical';\n }\n\n upsertZone(zoneId, { direction: getDirection() });\n }, [node, resolveDesignValue, zoneId, upsertZone]);\n\n return zone[zoneId]?.direction || 'vertical';\n};\n","import React, { CSSProperties } from 'react';\nimport styles from '../Draggable/styles.module.css';\nimport { useComponent } from './useComponent';\nimport type {\n ExperienceTreeNode,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport { RenderDropzoneFunction } from './Dropzone.types';\nimport { DraggableProvided, DraggableStateSnapshot } from '@hello-pangea/dnd';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport {\n ASSEMBLY_BLOCK_NODE_TYPE,\n CONTENTFUL_COMPONENTS,\n} from '@contentful/experiences-core/constants';\nimport classNames from 'classnames';\n\nfunction getStyle(style: CSSProperties = {}, snapshot?: DraggableStateSnapshot) {\n if (!snapshot?.isDropAnimating) {\n return style;\n }\n\n return {\n ...style,\n // cannot be 0, but make it super tiny\n transitionDuration: `0.001s`,\n };\n}\n\ntype EditorBlockCloneProps = {\n node: ExperienceTreeNode;\n resolveDesignValue: ResolveDesignValueType;\n provided?: DraggableProvided;\n snapshot?: DraggableStateSnapshot;\n renderDropzone: RenderDropzoneFunction;\n};\n\nexport const EditorBlockClone: React.FC<EditorBlockCloneProps> = ({\n node: rawNode,\n resolveDesignValue,\n snapshot,\n provided,\n renderDropzone,\n}) => {\n const userIsDragging = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n\n const { node, wrapperProps, elementToRender } = useComponent({\n node: rawNode,\n resolveDesignValue,\n renderDropzone,\n userIsDragging,\n });\n\n const isAssemblyBlock = node.type === ASSEMBLY_BLOCK_NODE_TYPE;\n const isSingleColumn = node.data.blockId === CONTENTFUL_COMPONENTS.singleColumn.id;\n\n if (isSingleColumn) {\n return elementToRender();\n }\n\n return (\n <div\n ref={provided?.innerRef}\n data-ctfl-dragging-element\n {...wrapperProps}\n {...provided?.draggableProps}\n {...provided?.dragHandleProps}\n className={classNames(\n styles.DraggableComponent,\n wrapperProps.className,\n styles.DraggableClone,\n {\n [styles.isAssemblyBlock]: isAssemblyBlock,\n [styles.isDragging]: snapshot?.isDragging,\n },\n )}\n style={getStyle(provided?.draggableProps.style, snapshot)}>\n {elementToRender()}\n </div>\n );\n};\n","import React, { ElementType } from 'react';\nimport type { ResolveDesignValueType } from '@contentful/experiences-core/types';\nimport { ComponentData } from '@/types/Config';\nimport { useTreeStore } from '@/store/tree';\nimport styles from './styles.module.css';\nimport classNames from 'classnames';\nimport { ROOT_ID } from '@/types/constants';\n\nimport { RenderDropzoneFunction } from './Dropzone.types';\nimport { EditorBlockClone } from './EditorBlockClone';\n\ntype DropzoneProps = {\n zoneId: string;\n node?: ComponentData;\n resolveDesignValue?: ResolveDesignValueType;\n className?: string;\n WrapperComponent?: ElementType | string;\n renderDropzone: RenderDropzoneFunction;\n};\n\nexport function DropzoneClone({\n node,\n zoneId,\n resolveDesignValue,\n className,\n WrapperComponent = 'div',\n renderDropzone,\n ...rest\n}: DropzoneProps) {\n const tree = useTreeStore((state) => state.tree);\n const content = node?.children || tree.root?.children || [];\n\n const isRootZone = zoneId === ROOT_ID;\n\n if (!resolveDesignValue) {\n return null;\n }\n\n return (\n <WrapperComponent\n className={classNames(\n styles.container,\n {\n [styles.isRoot]: isRootZone,\n [styles.isEmptyZone]: !content.length,\n },\n className,\n )}\n node={node}\n {...rest}>\n {content.map((item) => {\n const componentId = item.data.id;\n\n return (\n <EditorBlockClone\n key={componentId}\n node={item}\n resolveDesignValue={resolveDesignValue}\n renderDropzone={renderDropzone}\n />\n );\n })}\n </WrapperComponent>\n );\n}\n","import React, { ElementType, useCallback } from 'react';\nimport { Droppable } from '@hello-pangea/dnd';\nimport type { ResolveDesignValueType } from '@contentful/experiences-core/types';\nimport { EditorBlock } from './EditorBlock';\nimport { ComponentData } from '@/types/Config';\nimport { useTreeStore } from '@/store/tree';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport styles from './styles.module.css';\nimport classNames from 'classnames';\nimport { ROOT_ID } from '@/types/constants';\nimport { EmptyContainer } from '@components/EmptyContainer/EmptyContainer';\nimport { getZoneParents } from '@/utils/zone';\nimport { useZoneStore } from '@/store/zone';\nimport { useDropzoneDirection } from '@/hooks/useDropzoneDirection';\nimport { ASSEMBLY_NODE_TYPES, CONTENTFUL_COMPONENTS } from '@contentful/experiences-core/constants';\nimport { RenderDropzoneFunction } from './Dropzone.types';\nimport { EditorBlockClone } from './EditorBlockClone';\nimport { DropzoneClone } from './DropzoneClone';\n\ntype DropzoneProps = {\n zoneId: string;\n node?: ComponentData;\n resolveDesignValue?: ResolveDesignValueType;\n className?: string;\n WrapperComponent?: ElementType | string;\n};\n\nexport function Dropzone({\n node,\n zoneId,\n resolveDesignValue,\n className,\n WrapperComponent = 'div',\n ...rest\n}: DropzoneProps) {\n const userIsDragging = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n const draggedItem = useDraggedItemStore((state) => state.draggedItem);\n const newComponentId = useDraggedItemStore((state) => state.componentId);\n const hoveringZone = useZoneStore((state) => state.hoveringZone);\n const tree = useTreeStore((state) => state.tree);\n const content = node?.children || tree.root?.children || [];\n\n const direction = useDropzoneDirection({ resolveDesignValue, node, zoneId });\n\n const draggedSourceId = draggedItem && draggedItem.source.droppableId;\n const draggedDestinationId = draggedItem && draggedItem.destination?.droppableId;\n\n const isDraggingNewComponent = !!newComponentId;\n const isHoveringZone = hoveringZone === zoneId;\n const isRootZone = zoneId === ROOT_ID;\n const isDestination = draggedDestinationId === zoneId;\n const isEmptyCanvas = isRootZone && !content.length;\n\n const isAssembly = ASSEMBLY_NODE_TYPES.includes(node?.type || '');\n\n // To avoid a circular dependency, we create the recursive rendering function here and trickle it down\n const renderDropzone: RenderDropzoneFunction = useCallback(\n (node, props) => {\n return (\n <Dropzone\n zoneId={node.data.id}\n node={node}\n resolveDesignValue={resolveDesignValue}\n {...props}\n />\n );\n },\n [resolveDesignValue],\n );\n\n const renderClonedDropzone: RenderDropzoneFunction = useCallback(\n (node, props) => {\n return (\n <DropzoneClone\n zoneId={node.data.id}\n node={node}\n resolveDesignValue={resolveDesignValue}\n renderDropzone={renderClonedDropzone}\n {...props}\n />\n );\n },\n [resolveDesignValue],\n );\n\n if (!resolveDesignValue) {\n return null;\n }\n\n /**\n * The Rules of Dropzones\n *\n * 1. A dropzone is disabled unless the mouse is hovering over it\n *\n * 2. Dragging a new component onto the canvas has no addtional rules\n * besides rule #1\n *\n * 3. Dragging a component that is a direct descendant of the root\n * (parentId === ROOT_ID) then only the Root Dropzone is enabled\n *\n * 4. Dragging a nested component (parentId !== ROOT_ID) then the Root\n * Dropzone is disabled, all other Dropzones follow rule #1\n *\n * 5. Assemblies and the SingleColumn component are always disabled\n *\n */\n const isDropzoneEnabled = () => {\n if (node?.data.blockId === CONTENTFUL_COMPONENTS.columns.id) {\n return false;\n }\n\n if (isAssembly) {\n return false;\n }\n\n if (isDraggingNewComponent) {\n return isHoveringZone;\n }\n\n const draggingParentIds = getZoneParents(draggedSourceId || '');\n\n if (!draggingParentIds.length) {\n return isRootZone;\n }\n\n return isHoveringZone && !isRootZone;\n };\n\n return (\n <Droppable\n droppableId={zoneId}\n direction={direction}\n isDropDisabled={!isDropzoneEnabled()}\n renderClone={(provided, snapshot, rubic) => (\n <EditorBlockClone\n node={content[rubic.source.index]}\n resolveDesignValue={resolveDesignValue}\n provided={provided}\n snapshot={snapshot}\n renderDropzone={renderClonedDropzone}\n />\n )}>\n {(provided, snapshot) => {\n return (\n <WrapperComponent\n {...(provided || { droppableProps: {} }).droppableProps}\n ref={provided?.innerRef}\n id={zoneId}\n data-ctfl-zone-id={zoneId}\n className={classNames(\n styles.container,\n {\n [styles.isEmptyCanvas]: isEmptyCanvas,\n [styles.isDragging]: userIsDragging && !isAssembly,\n [styles.isDestination]: isDestination && !isAssembly,\n [styles.isRoot]: isRootZone,\n [styles.isEmptyZone]: !content.length,\n },\n className,\n )}\n node={node}\n {...rest}>\n {isEmptyCanvas ? (\n <EmptyContainer isDragging={isRootZone && userIsDragging} />\n ) : (\n content.map((item, i) => {\n const componentId = item.data.id;\n\n return (\n <EditorBlock\n placeholder={{\n isDraggingOver: snapshot?.isDraggingOver,\n totalIndexes: content.length,\n elementIndex: i,\n dropzoneElementId: zoneId,\n direction,\n }}\n index={i}\n zoneId={zoneId}\n key={componentId}\n userIsDragging={userIsDragging}\n draggingNewComponent={isDraggingNewComponent}\n node={item}\n resolveDesignValue={resolveDesignValue}\n renderDropzone={renderDropzone}\n />\n );\n })\n )}\n {provided?.placeholder}\n </WrapperComponent>\n );\n }}\n </Droppable>\n );\n}\n","import useDraggablePosition from '@/hooks/useDraggablePosition';\nimport {\n COMPONENT_LIST_ID,\n DRAGGABLE_HEIGHT,\n DRAGGABLE_WIDTH,\n DraggablePosition,\n NEW_COMPONENT_ID,\n} from '@/types/constants';\nimport { Draggable, Droppable } from '@hello-pangea/dnd';\nimport React, { useRef } from 'react';\n\ninterface Props {\n id: string;\n}\n\nfunction getStyle(style, snapshot) {\n if (!snapshot.isDropAnimating) {\n return style;\n }\n return {\n ...style,\n // cannot be 0, but make it super tiny\n transitionDuration: `0.001s`,\n };\n}\n\nconst DraggableContainer: React.FC<Props> = ({ id }) => {\n const ref = useRef<HTMLElement | null>(null);\n\n useDraggablePosition({\n draggableId: id,\n draggableRef: ref,\n position: DraggablePosition.CENTERED,\n });\n\n return (\n <div\n id={COMPONENT_LIST_ID}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n pointerEvents: 'none',\n zIndex: -1,\n }}>\n <Droppable droppableId={COMPONENT_LIST_ID} isDropDisabled>\n {(provided) => (\n <div {...provided.droppableProps} ref={provided.innerRef}>\n <Draggable draggableId={id} key={id} index={0}>\n {(provided, snapshot) => (\n <div\n id={NEW_COMPONENT_ID}\n data-ctfl-dragging-element\n ref={(node) => {\n provided.innerRef(node);\n ref.current = node;\n }}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n style={{\n ...getStyle(provided.draggableProps.style, snapshot),\n width: DRAGGABLE_WIDTH,\n height: DRAGGABLE_HEIGHT,\n pointerEvents: 'none',\n }}\n />\n )}\n </Draggable>\n {provided.placeholder}\n </div>\n )}\n </Droppable>\n </div>\n );\n};\n\nexport default DraggableContainer;\n","import type {\n ValuesByBreakpoint,\n Breakpoint,\n PrimitiveValue,\n ResolveDesignValueType,\n} from '@contentful/experiences-core/types';\nimport {\n mediaQueryMatcher,\n getFallbackBreakpointIndex,\n getActiveBreakpointIndex,\n getValueForBreakpoint,\n} from '@contentful/experiences-core';\nimport { useCallback, useEffect, useState } from 'react';\n\n// TODO: In order to support integrations without React, we should extract this heavy logic into simple\n// functions that we can reuse in other frameworks.\n\n/*\n * Registers media query change listeners for each breakpoint (except for \"*\").\n * It will always assume the last matching media query in the list. It therefore,\n * assumes that the breakpoints are sorted beginning with the default value (query: \"*\")\n * and then decending by screen width. For mobile-first designs, the order would be ascending\n */\nexport const useBreakpoints = (breakpoints: Breakpoint[]) => {\n const [mediaQueryMatches, setMediaQueryMatches] = useState<Record<string, boolean>>({});\n\n const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);\n\n // Register event listeners to update the media query states\n useEffect(() => {\n const [mediaQueryMatchers, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);\n // Store the media query state in the beginning to initialise the state\n setMediaQueryMatches(initialMediaQueryMatches);\n const eventListeners = mediaQueryMatchers.map(({ id, signal }) => {\n const onChange = () =>\n setMediaQueryMatches((prev) => ({\n ...prev,\n [id]: signal.matches,\n }));\n\n signal.addEventListener('change', onChange);\n return onChange;\n });\n\n return () => {\n eventListeners.forEach((eventListener, index) => {\n mediaQueryMatchers[index].signal.removeEventListener('change', eventListener);\n });\n };\n // Only re-setup all listeners when the breakpoint definition changed\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [breakpoints]);\n\n const activeBreakpointIndex = getActiveBreakpointIndex(\n breakpoints,\n mediaQueryMatches,\n fallbackBreakpointIndex,\n );\n\n const resolveDesignValue: ResolveDesignValueType = useCallback(\n (valuesByBreakpoint: ValuesByBreakpoint, variableName: string): PrimitiveValue => {\n return getValueForBreakpoint(\n valuesByBreakpoint,\n breakpoints,\n activeBreakpointIndex,\n variableName,\n );\n },\n [activeBreakpointIndex, breakpoints],\n );\n\n return { resolveDesignValue };\n};\n","import type { HoveredElement } from '@contentful/experiences-core/types';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { ASSEMBLY_NODE_TYPE, OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\nexport class MouseOverHandler {\n private currentHoveredElementId: string | null = null;\n\n private getMargins = (element: HTMLElement) => {\n if (typeof window === 'undefined') return undefined;\n const styles = window.getComputedStyle(element);\n const top = parseInt(styles.marginTop);\n const bottom = parseInt(styles.marginBottom);\n const left = parseInt(styles.marginLeft);\n const right = parseInt(styles.marginRight);\n\n return { top, bottom, left, right };\n };\n\n private getBoundingClientRect(element: Element) {\n const isAssembly = element.getAttribute('data-cf-node-block-type') === ASSEMBLY_NODE_TYPE;\n if (!isAssembly) {\n return element.getBoundingClientRect();\n } else {\n // As we use `display: contents` for assemblies, there is no real \"block\"\n // in the DOM and thus the browser fails to calculate the bounding rect.\n // Instead, we calculate it for each child and add it up:\n if (!element.firstElementChild) {\n return { left: 0, top: 0, width: 0, height: 0 };\n }\n const firstChildRect = element.firstElementChild.getBoundingClientRect();\n let fullHeight = firstChildRect.height;\n let nextChild = element.firstElementChild.nextElementSibling;\n while (nextChild) {\n const nextChildRect = nextChild.getBoundingClientRect();\n fullHeight += nextChildRect.height;\n nextChild = nextChild.nextElementSibling;\n }\n // The root of a assembly positions its first level containers vertically.\n // So we just need to add up the height and use the remaining properties from the first child.\n return {\n left: firstChildRect.left,\n top: firstChildRect.top,\n width: firstChildRect.width,\n height: fullHeight,\n };\n }\n }\n\n private getFullCoordinates = (element: HTMLElement) => {\n const validChildren = Array.from(element.children).filter(\n (child) => child instanceof HTMLElement && child.dataset.cfNodeBlockType === 'block',\n );\n\n const { left, top, width, height } = this.getBoundingClientRect(element);\n const margins = this.getMargins(element);\n\n const childrenCoordinates = validChildren.map((child) => {\n const { left, top, width, height } = this.getBoundingClientRect(child);\n\n return { left, top, width, height, margins };\n });\n\n return {\n left,\n top,\n width,\n height,\n margins,\n childrenCoordinates,\n };\n };\n\n private getClosestComponentInformation = (\n element: HTMLElement | null,\n ): [HTMLElement | null, HoveredElement] | undefined => {\n let target = element;\n\n // If the target is outside on the root or anywhere else on the iframes body\n if (target?.id === 'VisualEditorRoot' || target?.tagName === 'BODY') {\n const rootElement = document.getElementById('VisualEditorRoot');\n const hoveredRootElement = {\n nodeId: 'root',\n blockType: 'root',\n blockId: 'root',\n };\n return [rootElement, hoveredRootElement];\n }\n // Find the closest contentful container or direct parent that is a contentful container\n while (target) {\n if (\n // is itself a section?\n target.dataset.cfNodeId ||\n // Or a direct child of a section\n (target.parentElement && target.parentElement.dataset.cfNodeBlockId === 'ContentfulSection')\n ) {\n const sectionId = target.dataset.cfNodeId;\n const sectionBlockId = target.dataset.cfNodeBlockId;\n const sectionBlockType = target.dataset.cfNodeBlockType;\n\n const hoveredElement = {\n nodeId: sectionId,\n blockId: sectionBlockId,\n blockType: sectionBlockType,\n };\n\n return [target, hoveredElement];\n\n break;\n }\n\n target = target.parentElement;\n }\n };\n\n private getNewlyHoveredElement = (element: HTMLElement | null) => {\n let parentElement: HoveredElement | null = null;\n\n let parentSectionIndex = -1;\n\n const [hoveredElement, hoveredInfo] = this.getClosestComponentInformation(element) || [\n null,\n null,\n ];\n\n if (!hoveredElement) return;\n\n // if hovered element is already hovered and the information is already sent\n // ignore the rest and don't proceed.\n if (hoveredInfo.nodeId === this.currentHoveredElementId) return;\n\n let parentHTMLElement: HTMLElement | null = hoveredElement?.parentElement || null;\n\n while (parentHTMLElement) {\n const parentIsRoot = parentHTMLElement.id === 'VisualEditorRoot';\n if (parentHTMLElement.dataset.cfNodeId || parentIsRoot) {\n parentElement = {\n nodeId: parentIsRoot ? 'root' : parentHTMLElement.dataset.cfNodeId,\n blockType: parentHTMLElement.dataset.cfNodeBlockType,\n blockId: parentHTMLElement.dataset.cfNodeBlockId,\n };\n const parentChildrenElements = parentHTMLElement.children;\n parentSectionIndex = Array.from(parentChildrenElements).findIndex(\n (child) => child === hoveredElement,\n );\n break;\n }\n parentHTMLElement = parentHTMLElement.parentElement;\n }\n\n const coordinates = this.getFullCoordinates(hoveredElement);\n\n return { coordinates, hoveredElement: hoveredInfo, parentElement, parentSectionIndex };\n };\n\n handleMouseMove = (target: HTMLElement | null): void => {\n const hoveredElementInfo = this.getNewlyHoveredElement(target);\n\n if (!hoveredElementInfo) {\n return;\n }\n\n const { coordinates, hoveredElement, parentElement, parentSectionIndex } = hoveredElementInfo;\n this.currentHoveredElementId = hoveredElementInfo.hoveredElement.nodeId || null;\n\n sendMessage(OUTGOING_EVENTS.NewHoveredElement, {\n hoveredElement,\n parentElement,\n parentSectionIndex,\n coordinates,\n });\n };\n\n onMouseMove = (event: MouseEvent) => {\n const target: HTMLElement | null = event.target as HTMLElement;\n this.handleMouseMove(target);\n };\n\n onMouseLeave = () => {\n this.currentHoveredElementId = null;\n };\n\n attachEvent(): void {\n document.addEventListener('mousemove', this.onMouseMove);\n document.addEventListener('mouseout', this.onMouseLeave);\n }\n\n detachEvent(): void {\n document.removeEventListener('mousemove', this.onMouseMove);\n document.removeEventListener('mouseout', this.onMouseLeave);\n }\n}\n","import { MouseOverHandler } from './MouseOverHandler';\n\n/**\n * This function gets the element co-ordinates of a specified component in the DOM and its parent\n * and sends the DOM Rect to the client app\n */\nexport const sendHoveredComponentCoordinates = (instanceId?: string) => {\n const selectedElement: HTMLElement | null | undefined = instanceId\n ? (document.querySelector(`[data-cf-node-id=\"${instanceId}\"]`) as HTMLElement)\n : undefined;\n\n const mouseOverHandler = new MouseOverHandler();\n mouseOverHandler.handleMouseMove(selectedElement || null);\n};\n","export default class DragState {\n private isDraggingItem;\n private isDragStartedOnParent;\n\n constructor() {\n this.isDragStartedOnParent = false;\n this.isDraggingItem = false;\n }\n\n get isDragging() {\n return this.isDraggingItem;\n }\n\n get isDraggingOnParent() {\n return this.isDragStartedOnParent;\n }\n\n public updateIsDragging(isDraggingItem: boolean) {\n this.isDraggingItem = isDraggingItem;\n }\n public updateIsDragStartedOnParent(isDragStartedOnParent: boolean) {\n this.isDragStartedOnParent = isDragStartedOnParent;\n }\n\n public resetState() {\n this.isDraggingItem = false;\n this.isDragStartedOnParent = false;\n }\n}\n","import { CTFL_DRAGGING_ELEMENT, NEW_COMPONENT_ID } from '../types/constants';\nimport DragState from './dragState';\n\nclass SimulateDnD extends DragState {\n private draggingElement: Element | null;\n\n constructor() {\n super();\n this.draggingElement = null;\n }\n\n public setupDrag() {\n this.updateIsDragStartedOnParent(true);\n }\n\n public startDrag(coordX: number, coordY: number) {\n this.draggingElement = document.getElementById(NEW_COMPONENT_ID);\n this.updateIsDragging(true);\n this.simulateMouseEvent(coordX, coordY, 'mousedown');\n }\n\n public updateDrag(coordX: number, coordY: number) {\n if (!this.draggingElement) {\n this.draggingElement = document.querySelector(`[${CTFL_DRAGGING_ELEMENT}]`);\n }\n\n this.simulateMouseEvent(coordX, coordY);\n }\n\n public endDrag(coordX: number, coordY: number) {\n this.simulateMouseEvent(coordX, coordY, 'mouseup');\n this.reset();\n }\n\n public reset() {\n this.draggingElement = null;\n this.resetState();\n }\n\n private simulateMouseEvent(coordX: number, coordY: number, eventName = 'mousemove') {\n if (!this.draggingElement) {\n return;\n }\n\n const options = {\n bubbles: true,\n cancelable: true,\n view: window,\n pageX: 0,\n pageY: 0,\n clientX: coordX,\n clientY: coordY,\n };\n\n const event = new MouseEvent(eventName, options);\n this.draggingElement.dispatchEvent(event);\n }\n}\n\nexport default new SimulateDnD();\n","import { useCallback, useEffect, useState } from 'react';\nimport {\n sendMessage,\n getDataFromTree,\n doesMismatchMessageSchema,\n tryParseMessage,\n gatherDeepReferencesFromTree,\n DeepReference,\n isLink,\n EditorModeEntityStore,\n} from '@contentful/experiences-core';\nimport {\n OUTGOING_EVENTS,\n INCOMING_EVENTS,\n SCROLL_STATES,\n PostMessageMethods,\n} from '@contentful/experiences-core/constants';\nimport {\n ExperienceTree,\n ExperienceTreeNode,\n ComponentPropertyValue,\n ComponentRegistration,\n Link,\n ExperienceDataSource,\n ManagementEntity,\n} from '@contentful/experiences-core/types';\nimport { sendSelectedComponentCoordinates } from '@/communication/sendSelectedComponentCoordinates';\nimport { useTreeStore } from '@/store/tree';\nimport { useEditorStore } from '@/store/editor';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport { Assembly } from '@contentful/experiences-components-react';\nimport { addComponentRegistration, assembliesRegistry, setAssemblies } from '@/store/registries';\nimport { sendHoveredComponentCoordinates } from '@/communication/sendHoveredComponentCoordinates';\nimport { useEntityStore } from '@/store/entityStore';\nimport SimulateDnD from '@/utils/simulateDnD';\nimport { UnresolvedLink } from 'contentful';\n\nexport function useEditorSubscriber() {\n const entityStore = useEntityStore((state) => state.entityStore);\n const areEntitiesFetched = useEntityStore((state) => state.areEntitiesFetched);\n const setEntitiesFetched = useEntityStore((state) => state.setEntitiesFetched);\n const { updateTree, updateNodesByUpdatedEntity } = useTreeStore((state) => ({\n updateTree: state.updateTree,\n updateNodesByUpdatedEntity: state.updateNodesByUpdatedEntity,\n }));\n const unboundValues = useEditorStore((state) => state.unboundValues);\n const dataSource = useEditorStore((state) => state.dataSource);\n const setLocale = useEditorStore((state) => state.setLocale);\n const setUnboundValues = useEditorStore((state) => state.setUnboundValues);\n const setDataSource = useEditorStore((state) => state.setDataSource);\n const setSelectedNodeId = useEditorStore((state) => state.setSelectedNodeId);\n const selectedNodeId = useEditorStore((state) => state.selectedNodeId);\n const resetEntityStore = useEntityStore((state) => state.resetEntityStore);\n\n const setComponentId = useDraggedItemStore((state) => state.setComponentId);\n const setDraggingOnCanvas = useDraggedItemStore((state) => state.setDraggingOnCanvas);\n const setMousePosition = useDraggedItemStore((state) => state.setMousePosition);\n const setScrollY = useDraggedItemStore((state) => state.setScrollY);\n\n // TODO: As we have disabled the useEffect, we can remove these states\n const [, /* isFetchingEntities */ setFetchingEntities] = useState(false);\n\n const reloadApp = () => {\n sendMessage(OUTGOING_EVENTS.CanvasReload, {});\n // Wait a moment to ensure that the message was sent\n setTimeout(() => {\n // Received a hot reload message from webpack dev server -> reload the canvas\n window.location.reload();\n }, 50);\n };\n\n useEffect(() => {\n sendMessage(OUTGOING_EVENTS.RequestComponentTreeUpdate);\n }, []);\n\n /**\n * Fills up entityStore with entities from newDataSource and from the tree.\n * Also manages \"entity status\" variables (areEntitiesFetched, isFetchingEntities)\n */\n const fetchMissingEntities = useCallback(\n async (\n entityStore: EditorModeEntityStore,\n newDataSource: ExperienceDataSource,\n tree: ExperienceTree,\n ) => {\n // if we realize that there's nothing missing and nothing to fill-fetch before we do any async call,\n // then we can simply return and not lock the EntityStore at all.\n const startFetching = () => {\n setEntitiesFetched(false);\n setFetchingEntities(true);\n };\n const endFetching = () => {\n setEntitiesFetched(true);\n setFetchingEntities(false);\n };\n\n // Prepare L1 entities and deepReferences\n const entityLinksL1 = [\n ...Object.values(newDataSource),\n ...assembliesRegistry.values(), // we count assemblies here as \"L1 entities\", for convenience. Even though they're not headEntities.\n ];\n const deepReferences = gatherDeepReferencesFromTree(tree.root, newDataSource);\n\n /**\n * Checks only for _missing_ L1 entities\n * WARNING: Does NOT check for entity staleness/versions. If an entity is stale, it will NOT be considered missing.\n * If ExperienceBuilder wants to update stale entities, it should post `▼UPDATED_ENTITY` message to SDK.\n */\n const isMissingL1Entities = (entityLinks: UnresolvedLink<'Entry' | 'Asset'>[]): boolean => {\n const { missingAssetIds, missingEntryIds } = entityStore.getMissingEntityIds(entityLinks);\n return Boolean(missingAssetIds.length) || Boolean(missingEntryIds.length);\n };\n\n /**\n * PRECONDITION: all L1 entities are fetched\n */\n const isMissingL2Entities = (deepReferences: DeepReference[]): boolean => {\n const referentLinks = deepReferences\n .map((deepReference) => deepReference.extractReferent(entityStore))\n .filter(isLink);\n const { missingAssetIds, missingEntryIds } = entityStore.getMissingEntityIds(referentLinks);\n return Boolean(missingAssetIds.length) || Boolean(missingEntryIds.length);\n };\n\n /**\n * POST_CONDITION: entityStore is has all L1 entities (aka headEntities)\n */\n const fillupL1 = async ({\n entityLinksL1,\n }: {\n entityLinksL1: UnresolvedLink<'Entry' | 'Asset'>[];\n }) => {\n const { missingAssetIds, missingEntryIds } = entityStore.getMissingEntityIds(entityLinksL1);\n await entityStore.fetchEntities({ missingAssetIds, missingEntryIds });\n };\n\n /**\n * PRECONDITION: all L1 entites are fetched\n */\n const fillupL2 = async ({ deepReferences }: { deepReferences: DeepReference[] }) => {\n const referentLinks = deepReferences\n .map((deepReference) => deepReference.extractReferent(entityStore))\n .filter(isLink);\n const { missingAssetIds, missingEntryIds } = entityStore.getMissingEntityIds(referentLinks);\n await entityStore.fetchEntities({ missingAssetIds, missingEntryIds });\n };\n\n try {\n if (isMissingL1Entities(entityLinksL1)) {\n startFetching();\n await fillupL1({ entityLinksL1 });\n }\n if (isMissingL2Entities(deepReferences)) {\n startFetching();\n await fillupL2({ deepReferences });\n }\n } catch (error) {\n console.error('[experiences-sdk-react] Failed fetching entities');\n console.error(error);\n throw error; // TODO: The original catch didn't let's rethrow; for the moment throw to see if we have any errors\n } finally {\n endFetching();\n }\n },\n [setEntitiesFetched /* setFetchingEntities, assembliesRegistry */],\n );\n\n useEffect(() => {\n const onMessage = async (event: MessageEvent) => {\n let reason;\n if ((reason = doesMismatchMessageSchema(event))) {\n if (\n event.origin.startsWith('http://localhost') &&\n `${event.data}`.includes('webpackHotUpdate')\n ) {\n reloadApp();\n } else {\n console.warn(\n `[experiences-sdk-react::onMessage] Ignoring alien incoming message from origin [${event.origin}], due to: [${reason}]`,\n event,\n );\n }\n return;\n }\n\n const eventData = tryParseMessage(event);\n if (eventData.eventType === PostMessageMethods.REQUESTED_ENTITIES) {\n // Expected message: This message is handled in the EntityStore to store fetched entities\n return;\n }\n console.debug(\n `[experiences-sdk-react::onMessage] Received message [${eventData.eventType}]`,\n eventData,\n );\n\n const { payload } = eventData;\n\n switch (eventData.eventType) {\n case INCOMING_EVENTS.ExperienceUpdated: {\n const {\n tree,\n locale,\n changedNode,\n changedValueType,\n assemblies,\n }: {\n tree: ExperienceTree;\n assemblies: Link<'Entry'>[];\n locale: string;\n entitiesResolved?: boolean;\n changedNode?: ExperienceTreeNode;\n changedValueType?: ComponentPropertyValue['type'];\n } = payload;\n\n // Make sure to first store the assemblies before setting the tree and thus triggering a rerender\n if (assemblies) {\n setAssemblies(assemblies);\n // If the assemblyEntry is not yet fetched, this will be done below by\n // the imperative calls to fetchMissingEntities.\n }\n\n let newEntityStore = entityStore;\n if (entityStore.locale !== locale) {\n newEntityStore = resetEntityStore(locale);\n setLocale(locale);\n }\n\n // Below are mutually exclusive cases\n if (changedNode) {\n /**\n * On single node updates, we want to skip the process of getting the data (datasource and unbound values)\n * from tree. Since we know the updated node, we can skip that recursion everytime the tree updates and\n * just update the relevant data we need from the relevant node.\n *\n * We still update the tree here so we don't have a stale \"tree\"\n */\n if (changedValueType === 'BoundValue') {\n const newDataSource = { ...dataSource, ...changedNode.data.dataSource };\n setDataSource(newDataSource);\n await fetchMissingEntities(newEntityStore, newDataSource, tree);\n } else if (changedValueType === 'UnboundValue') {\n setUnboundValues({\n ...unboundValues,\n ...changedNode.data.unboundValues,\n });\n }\n } else {\n const { dataSource, unboundValues } = getDataFromTree(tree);\n setDataSource(dataSource);\n setUnboundValues(unboundValues);\n await fetchMissingEntities(newEntityStore, dataSource, tree);\n }\n // Update the tree when all necessary data is fetched and ready for rendering.\n updateTree(tree);\n break;\n }\n case INCOMING_EVENTS.AssembliesRegistered: {\n const { assemblies }: { assemblies: ComponentRegistration['definition'][] } = payload;\n\n assemblies.forEach((definition) => {\n addComponentRegistration({\n component: Assembly,\n definition,\n });\n });\n break;\n }\n case INCOMING_EVENTS.AssembliesAdded: {\n const {\n assembly,\n assemblyDefinition,\n }: {\n assembly: ManagementEntity;\n assemblyDefinition?: ComponentRegistration['definition'];\n } = payload;\n entityStore.updateEntity(assembly);\n // Using a Map here to avoid setting state and rerending all existing assemblies when a new assembly is added\n // TODO: Figure out if we can extend this love to data source and unbound values. Maybe that'll solve the blink\n // of all bound and unbound values when new values are added\n assembliesRegistry.set(assembly.sys.id, {\n sys: { id: assembly.sys.id, linkType: 'Entry', type: 'Link' },\n } as Link<'Entry'>);\n if (assemblyDefinition) {\n addComponentRegistration({\n component: Assembly,\n definition: assemblyDefinition,\n });\n }\n\n break;\n }\n case INCOMING_EVENTS.CanvasResized: {\n const { selectedNodeId } = payload;\n if (selectedNodeId) {\n sendSelectedComponentCoordinates(selectedNodeId);\n }\n break;\n }\n case INCOMING_EVENTS.HoverComponent: {\n const { hoveredNodeId } = payload;\n sendHoveredComponentCoordinates(hoveredNodeId);\n break;\n }\n case INCOMING_EVENTS.ComponentDraggingChanged: {\n const { isDragging } = payload;\n\n if (!isDragging) {\n setComponentId('');\n setDraggingOnCanvas(false);\n SimulateDnD.reset();\n }\n break;\n }\n case INCOMING_EVENTS.UpdatedEntity: {\n const { entity: updatedEntity, shouldRerender } = payload as {\n entity: ManagementEntity;\n shouldRerender?: boolean;\n };\n if (updatedEntity) {\n const storedEntity = entityStore.entities.find(\n (entity) => entity.sys.id === updatedEntity.sys.id,\n ) as unknown as ManagementEntity | undefined;\n\n const didEntityChange = storedEntity?.sys.version !== updatedEntity.sys.version;\n entityStore.updateEntity(updatedEntity);\n // We traverse the whole tree, so this is a opt-in feature to only use it when required.\n if (shouldRerender && didEntityChange) {\n updateNodesByUpdatedEntity(updatedEntity.sys.id);\n }\n }\n break;\n }\n case INCOMING_EVENTS.RequestEditorMode: {\n break;\n }\n case INCOMING_EVENTS.ComponentDragCanceled: {\n if (SimulateDnD.isDragging) {\n //simulate a mouseup event to cancel the drag\n SimulateDnD.endDrag(0, 0);\n }\n break;\n }\n case INCOMING_EVENTS.ComponentDragStarted: {\n SimulateDnD.setupDrag();\n setComponentId(payload.id || '');\n setDraggingOnCanvas(true);\n\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: '',\n });\n break;\n }\n case INCOMING_EVENTS.ComponentDragEnded: {\n SimulateDnD.reset();\n setComponentId('');\n setDraggingOnCanvas(false);\n break;\n }\n case INCOMING_EVENTS.SelectComponent: {\n const { selectedNodeId: nodeId } = payload;\n setSelectedNodeId(nodeId);\n sendSelectedComponentCoordinates(nodeId);\n break;\n }\n case INCOMING_EVENTS.MouseMove: {\n const { mouseX, mouseY } = payload;\n setMousePosition(mouseX, mouseY);\n\n if (SimulateDnD.isDraggingOnParent && !SimulateDnD.isDragging) {\n SimulateDnD.startDrag(mouseX, mouseY);\n } else {\n SimulateDnD.updateDrag(mouseX, mouseY);\n }\n\n break;\n }\n case INCOMING_EVENTS.ComponentMoveEnded: {\n const { mouseX, mouseY } = payload;\n SimulateDnD.endDrag(mouseX, mouseY);\n break;\n }\n default:\n console.error(\n `[experiences-sdk-react::onMessage] Logic error, unsupported eventType: [${eventData.eventType}]`,\n );\n }\n };\n\n window.addEventListener('message', onMessage);\n\n return () => {\n window.removeEventListener('message', onMessage);\n };\n }, [\n entityStore,\n setComponentId,\n setDraggingOnCanvas,\n setDataSource,\n setLocale,\n setSelectedNodeId,\n dataSource,\n areEntitiesFetched,\n fetchMissingEntities,\n setUnboundValues,\n unboundValues,\n updateTree,\n updateNodesByUpdatedEntity,\n setMousePosition,\n resetEntityStore,\n ]);\n\n /*\n * Handles on scroll business\n */\n useEffect(() => {\n let timeoutId = 0;\n let isScrolling = false;\n\n const onScroll = () => {\n setScrollY(window.scrollY);\n if (isScrolling === false) {\n sendMessage(OUTGOING_EVENTS.CanvasScroll, SCROLL_STATES.Start);\n }\n\n sendMessage(OUTGOING_EVENTS.CanvasScroll, SCROLL_STATES.IsScrolling);\n isScrolling = true;\n\n clearTimeout(timeoutId);\n\n timeoutId = window.setTimeout(() => {\n if (isScrolling === false) {\n return;\n }\n\n isScrolling = false;\n sendMessage(OUTGOING_EVENTS.CanvasScroll, SCROLL_STATES.End);\n\n /**\n * On scroll end, send new co-ordinates of selected node\n */\n if (selectedNodeId) {\n sendSelectedComponentCoordinates(selectedNodeId);\n }\n }, 150);\n };\n\n window.addEventListener('scroll', onScroll, { capture: true, passive: true });\n\n return () => {\n window.removeEventListener('scroll', onScroll, { capture: true });\n clearTimeout(timeoutId);\n };\n }, [selectedNodeId, setScrollY]);\n}\n","import { sendMessage } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\nexport const onComponentMoved = (options: {\n nodeId: string;\n sourceParentId: string;\n destinationParentId: string;\n sourceIndex: number;\n destinationIndex: number;\n}) => {\n sendMessage(OUTGOING_EVENTS.ComponentMoved, options);\n};\n","import { v4 as uuidv4 } from 'uuid';\n\nexport const generateId = (type: string | number) => `${type}-${uuidv4()}`;\n","import { ExperienceTreeNode } from '@contentful/experiences-core/types';\nimport { generateId } from './generate-id';\n\ninterface Params {\n blockId: string;\n parentId: string;\n}\n\nexport const createTreeNode = ({ blockId, parentId }: Params) => {\n const node: ExperienceTreeNode = {\n type: 'block',\n data: {\n id: generateId(blockId),\n blockId,\n props: {},\n dataSource: {},\n breakpoints: [],\n unboundValues: {},\n },\n parentId,\n children: [],\n };\n\n return node;\n};\n","import { sendMessage } from '@contentful/experiences-core';\nimport { ExperienceTreeNode } from '@contentful/experiences-core/types';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\nexport const onComponentDropped = ({\n node,\n index,\n parentBlockId,\n parentType,\n parentId,\n}: {\n node: ExperienceTreeNode;\n index?: number;\n parentType?: string;\n parentBlockId?: string;\n parentId?: string;\n}) => {\n sendMessage(OUTGOING_EVENTS.ComponentDropped, {\n node,\n index: index ?? node.children.length,\n parentNode: {\n type: parentType,\n data: {\n blockId: parentBlockId,\n id: parentId,\n },\n },\n });\n};\n","import { onComponentDropped } from '@/communication/onComponentDrop';\nimport { getItem } from './getItem';\nimport type { ExperienceTreeNode, ExperienceTree } from '@contentful/experiences-core/types';\nimport { generateId } from './generate-id';\nimport { ROOT_ID } from '../types/constants';\n\ninterface OnDropParams {\n data: ExperienceTree;\n componentType: string;\n destinationZoneId: string;\n destinationIndex: number;\n}\nexport const onDrop = ({\n destinationIndex,\n componentType,\n destinationZoneId,\n data,\n}: OnDropParams) => {\n const parentId = destinationZoneId;\n\n const parentNode = getItem({ id: parentId }, data);\n\n const parentIsRoot = parentId === ROOT_ID;\n\n const emptyComponentData: ExperienceTreeNode = {\n type: 'block',\n parentId,\n children: [],\n data: {\n blockId: componentType,\n id: generateId(componentType),\n breakpoints: [],\n dataSource: {},\n props: {},\n unboundValues: {},\n },\n };\n\n onComponentDropped({\n node: emptyComponentData,\n index: destinationIndex,\n parentType: parentIsRoot ? 'root' : parentNode?.type,\n parentBlockId: parentNode?.data.blockId,\n parentId: parentIsRoot ? 'root' : parentId,\n });\n};\n","import { onComponentMoved } from '@/communication/onComponentMoved';\nimport { useTreeStore } from '@/store/tree';\nimport { ROOT_ID } from '@/types/constants';\nimport { createTreeNode } from '@/utils/createTreeNode';\nimport { onDrop } from '@/utils/onDrop';\nimport { CONTENTFUL_COMPONENTS } from '@contentful/experiences-core/constants';\nimport { DropResult } from '@hello-pangea/dnd';\n\nexport default function useCanvasInteractions() {\n const tree = useTreeStore((state) => state.tree);\n const reorderChildren = useTreeStore((state) => state.reorderChildren);\n const reparentChild = useTreeStore((state) => state.reparentChild);\n const addChild = useTreeStore((state) => state.addChild);\n\n const onAddComponent = (droppedItem: DropResult) => {\n const { destination, draggableId } = droppedItem;\n\n if (!destination) {\n return;\n }\n\n const droppingOnRoot = destination.droppableId === ROOT_ID;\n const isValidRootComponent = draggableId === CONTENTFUL_COMPONENTS.container.id;\n\n let node = createTreeNode({ blockId: draggableId, parentId: destination.droppableId });\n\n if (droppingOnRoot && !isValidRootComponent) {\n const wrappingContainer = createTreeNode({\n blockId: CONTENTFUL_COMPONENTS.container.id,\n parentId: destination.droppableId,\n });\n const childNode = createTreeNode({\n blockId: draggableId,\n parentId: wrappingContainer.data.id,\n });\n\n node = wrappingContainer;\n node.children = [childNode];\n }\n\n addChild(destination.index, destination.droppableId, node);\n\n onDrop({\n data: tree,\n componentType: draggableId,\n destinationIndex: destination.index,\n destinationZoneId: destination.droppableId,\n });\n };\n\n const onMoveComponent = (droppedItem: DropResult) => {\n const { destination, source, draggableId } = droppedItem;\n\n if (!destination || !source) {\n return;\n }\n\n if (destination.droppableId === source.droppableId) {\n reorderChildren(destination.index, destination.droppableId, source.index);\n }\n\n if (destination.droppableId !== source.droppableId) {\n reparentChild(destination.index, destination.droppableId, source.index, source.droppableId);\n }\n\n onComponentMoved({\n nodeId: draggableId,\n destinationIndex: destination.index,\n destinationParentId: destination.droppableId,\n sourceIndex: source.index,\n sourceParentId: source.droppableId,\n });\n };\n\n return { onAddComponent, onMoveComponent };\n}\n","import {\n DragStart,\n DragUpdate,\n DropResult,\n OnBeforeDragStartResponder,\n OnDragEndResponder,\n OnDragUpdateResponder,\n ResponderProvided,\n} from '@hello-pangea/dnd';\nimport React from 'react';\n\ninterface TestDNDContainerProps extends React.PropsWithChildren {\n onDragUpdate: OnDragUpdateResponder;\n onBeforeDragStart: OnBeforeDragStartResponder;\n onDragEnd: OnDragEndResponder;\n}\n\nconst TestDNDContainer: React.FC<TestDNDContainerProps> = ({\n onDragEnd,\n onBeforeDragStart,\n onDragUpdate,\n children,\n}) => {\n const handleDragStart = (event: React.DragEvent<HTMLDivElement>) => {\n const draggedItem = event.nativeEvent as unknown as DragStart;\n const start: DragStart = {\n mode: draggedItem.mode,\n draggableId: draggedItem.draggableId,\n type: draggedItem.type,\n source: draggedItem.source,\n };\n onBeforeDragStart(start);\n };\n\n const handleDrag = (event: React.DragEvent<HTMLDivElement>) => {\n const draggedItem = event.nativeEvent as unknown as DragUpdate;\n const update: DragUpdate = {\n mode: draggedItem.mode,\n draggableId: draggedItem.draggableId,\n type: draggedItem.type,\n source: draggedItem.source,\n destination: draggedItem.destination,\n combine: draggedItem.combine,\n };\n onDragUpdate(update, {} as ResponderProvided);\n };\n\n const handleDragEnd = (event: React.DragEvent<HTMLDivElement>) => {\n const draggedItem = event.nativeEvent as unknown as DropResult;\n const result: DropResult = {\n mode: draggedItem.mode,\n draggableId: draggedItem.draggableId,\n type: draggedItem.type,\n source: draggedItem.source,\n destination: draggedItem.destination,\n combine: draggedItem.combine,\n reason: draggedItem.reason,\n };\n onDragEnd(result, {} as ResponderProvided);\n };\n\n return (\n <div\n data-test-id=\"dnd-context-substitute\"\n onDragStart={handleDragStart}\n onDrag={handleDrag}\n onDragEnd={handleDragEnd}>\n {children}\n </div>\n );\n};\n\nexport default TestDNDContainer;\n","import useCanvasInteractions from '@/hooks/useCanvasInteractions';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport { useEditorStore } from '@/store/editor';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\nimport {\n DragDropContext,\n OnBeforeCaptureResponder,\n OnBeforeDragStartResponder,\n OnDragEndResponder,\n OnDragUpdateResponder,\n} from '@hello-pangea/dnd';\nimport React, { useRef } from 'react';\nimport type { ReactNode } from 'react';\nimport TestDNDContainer from './TestDNDContainer';\nimport { COMPONENT_LIST_ID } from '@/types/constants';\nimport SimulateDnD from '@/utils/simulateDnD';\n\ntype Props = {\n children: ReactNode;\n};\n\nexport const DNDProvider = ({ children }: Props) => {\n const setSelectedNodeId = useEditorStore((state) => state.setSelectedNodeId);\n const draggedItem = useDraggedItemStore((state) => state.draggedItem);\n const setOnBeforeCaptureId = useDraggedItemStore((state) => state.setOnBeforeCaptureId);\n const setDraggingOnCanvas = useDraggedItemStore((state) => state.setDraggingOnCanvas);\n const updateItem = useDraggedItemStore((state) => state.updateItem);\n const { onAddComponent, onMoveComponent } = useCanvasInteractions();\n const selectedNodeId = useEditorStore((state) => state.selectedNodeId);\n const prevSelectedNodeId = useRef<string | null>(null);\n\n const isTestRun =\n typeof window !== 'undefined' && Object.prototype.hasOwnProperty.call(window, 'Cypress');\n\n const dragStart: OnBeforeDragStartResponder = ({ source }) => {\n prevSelectedNodeId.current = selectedNodeId;\n\n //Unselect the current node when dragging and remove the outline\n setSelectedNodeId('');\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: '',\n });\n if (source.droppableId !== COMPONENT_LIST_ID) {\n sendMessage(OUTGOING_EVENTS.ComponentMoveStarted);\n }\n };\n\n const beforeCapture: OnBeforeCaptureResponder = ({ draggableId }) => {\n setDraggingOnCanvas(true);\n setOnBeforeCaptureId(draggableId);\n };\n\n const dragUpdate: OnDragUpdateResponder = (update) => {\n updateItem(update);\n };\n\n const dragEnd: OnDragEndResponder = (dropResult) => {\n setDraggingOnCanvas(false);\n setOnBeforeCaptureId('');\n updateItem(undefined);\n SimulateDnD.reset();\n\n if (!dropResult.destination) {\n if (!draggedItem?.destination) {\n // User cancel drag\n sendMessage(OUTGOING_EVENTS.ComponentDragCanceled);\n //select the previously selected node if drag was canceled\n if (prevSelectedNodeId.current) {\n setSelectedNodeId(prevSelectedNodeId.current);\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: prevSelectedNodeId.current,\n });\n prevSelectedNodeId.current = null;\n }\n return;\n }\n // Use the destination from the draggedItem (when clicking the canvas)\n dropResult.destination = draggedItem.destination;\n }\n\n // New component added to canvas\n if (dropResult.source.droppableId.startsWith('component-list')) {\n onAddComponent(dropResult);\n } else {\n onMoveComponent(dropResult);\n }\n\n // If a node was previously selected prior to dragging, re-select it\n setSelectedNodeId(dropResult.draggableId);\n sendMessage(OUTGOING_EVENTS.ComponentMoveEnded);\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n nodeId: dropResult.draggableId,\n });\n };\n\n return (\n <DragDropContext\n onBeforeCapture={beforeCapture}\n onDragUpdate={dragUpdate}\n onBeforeDragStart={dragStart}\n onDragEnd={dragEnd}>\n {isTestRun ? (\n <TestDNDContainer\n onDragEnd={dragEnd}\n onBeforeDragStart={dragStart}\n onDragUpdate={dragUpdate}>\n {children}\n </TestDNDContainer>\n ) : (\n children\n )}\n </DragDropContext>\n );\n};\n","import React, { CSSProperties, useCallback, useRef, useState } from 'react';\nimport { useEffect } from 'react';\nimport { Dropzone } from '../Dropzone/Dropzone';\nimport DraggableContainer from '../Draggable/DraggableComponentList';\nimport type { ExperienceTree } from '@contentful/experiences-core/types';\n\nimport { COMPONENT_LIST_ID, DRAGGABLE_HEIGHT, ROOT_ID } from '@/types/constants';\nimport { useTreeStore } from '@/store/tree';\nimport { useDraggedItemStore } from '@/store/draggedItem';\nimport styles from './render.module.css';\nimport { useBreakpoints } from '@/hooks/useBreakpoints';\nimport { useEditorSubscriber } from '@/hooks/useEditorSubscriber';\nimport { DNDProvider } from './DNDProvider';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\nimport { useEditorStore } from '@/store/editor';\n\ninterface Props {\n onChange?: (data: ExperienceTree) => void;\n}\n\nexport const RootRenderer: React.FC<Props> = ({ onChange }) => {\n useEditorSubscriber();\n\n const dragItem = useDraggedItemStore((state) => state.componentId);\n const userIsDragging = useDraggedItemStore((state) => state.isDraggingOnCanvas);\n const breakpoints = useTreeStore((state) => state.breakpoints);\n const setSelectedNodeId = useEditorStore((state) => state.setSelectedNodeId);\n const draggableSourceId = useDraggedItemStore((state) => state.draggedItem?.source.droppableId);\n const draggingNewComponent = !!draggableSourceId?.startsWith(COMPONENT_LIST_ID);\n const containerRef = useRef<HTMLDivElement>(null);\n const { resolveDesignValue } = useBreakpoints(breakpoints);\n const [containerStyles, setContainerStyles] = useState<CSSProperties>({});\n const tree = useTreeStore((state) => state.tree);\n\n const handleClickOutside = useCallback(\n (e: MouseEvent) => {\n const element = e.target as HTMLElement;\n\n const isRoot = element.getAttribute('data-ctfl-zone-id') === ROOT_ID;\n const clickedOnCanvas = element.closest(`[data-ctfl-root]`);\n\n if (clickedOnCanvas && !isRoot) {\n return;\n }\n\n sendMessage(OUTGOING_EVENTS.OutsideCanvasClick, {\n outsideCanvasClick: true,\n });\n sendMessage(OUTGOING_EVENTS.ComponentSelected, {\n selectedId: '',\n });\n setSelectedNodeId('');\n },\n [setSelectedNodeId],\n );\n\n const handleResizeCanvas = useCallback(() => {\n const parentElement = containerRef.current?.parentElement;\n if (!parentElement) {\n return;\n }\n\n let siblingHeight = 0;\n\n for (const child of parentElement.children) {\n if (!child.hasAttribute('data-ctfl-root')) {\n siblingHeight += child.getBoundingClientRect().height;\n }\n }\n\n if (!siblingHeight) {\n /**\n * DRAGGABLE_HEIGHT is subtracted here due to an uninteded scrolling effect\n * when dragging a new component onto the canvas\n *\n * The DRAGGABLE_HEIGHT is then added as margin bottom to offset this value\n * so that visually there is no difference to the user.\n */\n setContainerStyles({\n minHeight: `${window.innerHeight - DRAGGABLE_HEIGHT}px`,\n });\n return;\n }\n\n setContainerStyles({\n minHeight: `${window.innerHeight - siblingHeight}px`,\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [containerRef.current]);\n\n useEffect(() => {\n if (onChange) onChange(tree);\n }, [tree, onChange]);\n\n useEffect(() => {\n document.addEventListener('click', handleClickOutside);\n return () => {\n document.removeEventListener('click', handleClickOutside);\n };\n }, [handleClickOutside]);\n\n useEffect(() => {\n handleResizeCanvas();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [containerRef.current]);\n\n return (\n <DNDProvider>\n {dragItem && <DraggableContainer id={dragItem} />}\n\n <div data-ctfl-root className={styles.container} ref={containerRef} style={containerStyles}>\n {/* \n This hitbox is required so that users can\n add sections to the top of the document.\n */}\n {userIsDragging && draggingNewComponent && (\n <div className={styles.hitbox} data-ctfl-zone-id={ROOT_ID} />\n )}\n <Dropzone zoneId={ROOT_ID} resolveDesignValue={resolveDesignValue} />\n {/* \n This hitbox is required so that users can\n add sections to the bottom of the document.\n */}\n {userIsDragging && draggingNewComponent && (\n <div data-ctfl-zone-id={ROOT_ID} className={styles.hitboxLower} />\n )}\n </div>\n <div data-ctfl-hitboxes />\n </DNDProvider>\n );\n};\n","import { useEditorStore } from '@/store/editor';\nimport { useEntityStore } from '@/store/entityStore';\n\nimport { INTERNAL_EVENTS, VISUAL_EDITOR_EVENTS } from '@contentful/experiences-core/constants';\nimport { useEffect, useState } from 'react';\n\nexport const useInitializeEditor = () => {\n const initializeEditor = useEditorStore((state) => state.initializeEditor);\n const [initialized, setInitialized] = useState(false);\n const resetEntityStore = useEntityStore((state) => state.resetEntityStore);\n\n useEffect(() => {\n const onVisualEditorInitialize = (event) => {\n if (!event.detail) return;\n const {\n componentRegistry,\n designTokens,\n locale: initialLocale,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n entities,\n } = event.detail;\n\n initializeEditor({\n initialLocale,\n componentRegistry,\n designTokens,\n });\n\n // if entities is set to [], then everything will still work as EntityStore will\n // request entities on demand via ▲REQUEST_ENTITY\n resetEntityStore(initialLocale, entities);\n setInitialized(true);\n };\n\n // Listen for VisualEditorComponents internal event\n window.addEventListener(INTERNAL_EVENTS.VisualEditorInitialize, onVisualEditorInitialize);\n\n // Clean up the event listener\n return () => {\n window.removeEventListener(INTERNAL_EVENTS.VisualEditorInitialize, onVisualEditorInitialize);\n };\n }, [initializeEditor, resetEntityStore]);\n\n useEffect(() => {\n if (initialized) {\n return;\n }\n\n // Dispatch Visual Editor Ready event\n window.dispatchEvent(new CustomEvent(VISUAL_EDITOR_EVENTS.Ready));\n }, [initialized]);\n\n return initialized;\n};\n","import React, { useEffect } from 'react';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { RootRenderer } from './RootRenderer/RootRenderer';\nimport SimulateDnD from '@/utils/simulateDnD';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\nimport { useInitializeEditor } from '@/hooks/useInitializeEditor';\nimport { useZoneStore } from '@/store/zone';\nimport { CTFL_ZONE_ID, NEW_COMPONENT_ID } from '@/types/constants';\nimport { useDraggedItemStore } from '@/store/draggedItem';\n\nexport const VisualEditorRoot = () => {\n const initialized = useInitializeEditor();\n const setMousePosition = useDraggedItemStore((state) => state.setMousePosition);\n const setHoveringZone = useZoneStore((state) => state.setHoveringZone);\n\n useEffect(() => {\n const onMouseMove = (e: MouseEvent) => {\n setMousePosition(e.clientX, e.clientY);\n\n const target = e.target as HTMLElement;\n const zoneId = target.closest(`[${CTFL_ZONE_ID}]`)?.getAttribute(CTFL_ZONE_ID);\n\n if (zoneId) {\n setHoveringZone(zoneId);\n }\n\n if (!SimulateDnD.isDragging) {\n return;\n }\n\n if (target.id === NEW_COMPONENT_ID) {\n return;\n }\n\n SimulateDnD.updateDrag(e.clientX, e.clientY);\n\n sendMessage(OUTGOING_EVENTS.MouseMove, {\n clientX: e.pageX,\n clientY: e.pageY - window.scrollY,\n });\n };\n\n document.addEventListener('mousemove', onMouseMove);\n\n return () => {\n document.removeEventListener('mousemove', onMouseMove);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!initialized) return null;\n\n return <RootRenderer />;\n};\n"],"names":["INCOMING_EVENTS","CONTENTFUL_COMPONENTS","EMPTY_CONTAINER_HEIGHT","PostMessageMethods","treeVisit","styles","getStyle","get","css_248z$2","css_248z$1","css_248z","SimulateDnD","uuidv4"],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAMA,iBAAe,GAAG;AACxB,IAAI,iBAAiB,EAAE,mBAAmB;AAC1C,IAAI,iBAAiB,EAAE,sBAAsB;AAC7C,IAAI,wBAAwB,EAAE,0BAA0B;AACxD,IAAI,qBAAqB,EAAE,uBAAuB;AAClD,IAAI,oBAAoB,EAAE,sBAAsB;AAChD,IAAI,kBAAkB,EAAE,oBAAoB;AAC5C,IAAI,kBAAkB,EAAE,oBAAoB;AAC5C,IAAI,aAAa,EAAE,eAAe;AAClC,IAAI,eAAe,EAAE,iBAAiB;AACtC,IAAI,cAAc,EAAE,gBAAgB;AACpC,IAAI,aAAa,EAAE,eAAe;AAClC,IAAI,eAAe,EAAE,iBAAiB;AACtC,IAAI,oBAAoB,EA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