@contentful/experiences-sdk-react 0.0.1-alpha.2

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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +115 -0
  3. package/dist/VisualEditorInjectScript-DPer6DO3.js +38 -0
  4. package/dist/VisualEditorInjectScript-DPer6DO3.js.map +1 -0
  5. package/dist/VisualEditorLoader-CY2fhqS5.js +28 -0
  6. package/dist/VisualEditorLoader-CY2fhqS5.js.map +1 -0
  7. package/dist/index.d.ts +122 -0
  8. package/dist/index.js +859 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/src/ExperienceRoot.d.ts +14 -0
  11. package/dist/src/blocks/editor/VisualEditorInjectScript.d.ts +4 -0
  12. package/dist/src/blocks/editor/VisualEditorLoader.d.ts +7 -0
  13. package/dist/src/blocks/editor/VisualEditorRoot.d.ts +9 -0
  14. package/dist/src/blocks/preview/CompositionBlock.d.ts +10 -0
  15. package/dist/src/blocks/preview/CompositionBlock.spec.d.ts +1 -0
  16. package/dist/src/blocks/preview/DeprecatedPreviewDeliveryRoot.d.ts +12 -0
  17. package/dist/src/blocks/preview/PreviewDeliveryRoot.d.ts +8 -0
  18. package/dist/src/blocks/preview/PreviewDeliveryRoot.test.d.ts +1 -0
  19. package/dist/src/components/Assembly.d.ts +3 -0
  20. package/dist/src/components/ErrorBoundary.d.ts +25 -0
  21. package/dist/src/components/Flex.d.ts +64 -0
  22. package/dist/src/constants.d.ts +3 -0
  23. package/dist/src/core/componentRegistry.d.ts +23 -0
  24. package/dist/src/core/componentRegistry.test.d.ts +1 -0
  25. package/dist/src/core/index.d.ts +1 -0
  26. package/dist/src/core/preview/assemblyUtils.d.ts +10 -0
  27. package/dist/src/core/preview/assemblyUtils.spec.d.ts +1 -0
  28. package/dist/src/hooks/index.d.ts +5 -0
  29. package/dist/src/hooks/useBreakpoints.d.ts +4 -0
  30. package/dist/src/hooks/useBreakpoints.spec.d.ts +1 -0
  31. package/dist/src/hooks/useDetectEditorMode.d.ts +7 -0
  32. package/dist/src/hooks/useExperienceBuilder.d.ts +41 -0
  33. package/dist/src/hooks/useExperienceBuilder.test.d.ts +1 -0
  34. package/dist/src/hooks/useFetchByBase.d.ts +8 -0
  35. package/dist/src/hooks/useFetchById.d.ts +16 -0
  36. package/dist/src/hooks/useFetchById.spec.d.ts +1 -0
  37. package/dist/src/hooks/useFetchBySlug.d.ts +16 -0
  38. package/dist/src/hooks/useFetchBySlug.spec.d.ts +1 -0
  39. package/dist/src/hooks/useFetchExperience.d.ts +27 -0
  40. package/dist/src/hooks/useFetchExperience.test.d.ts +1 -0
  41. package/dist/src/hooks/useInitializeVisualEditor.d.ts +7 -0
  42. package/dist/src/hooks/usePrevious.d.ts +6 -0
  43. package/dist/src/hooks/useStyleTag.d.ts +16 -0
  44. package/dist/src/index.d.ts +19 -0
  45. package/dist/src/sdkVersion.d.ts +1 -0
  46. package/dist/src/utils/withComponentWrapper.d.ts +36 -0
  47. package/dist/src/utils/withComponentWrapper.spec.d.ts +1 -0
  48. package/dist/test/__fixtures__/assembly.d.ts +96 -0
  49. package/dist/test/__fixtures__/composition.d.ts +7 -0
  50. package/dist/test/__fixtures__/entities.d.ts +9 -0
  51. package/dist/test/components/Test.d.ts +1 -0
  52. package/dist/test/components/Test.spec.d.ts +1 -0
  53. package/dist/vite.config.d.ts +2 -0
  54. package/package.json +92 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/sdkVersion.ts","../../src/utils/withComponentWrapper.tsx","../../src/constants.ts","../../src/core/componentRegistry.ts","../../src/hooks/useStyleTag.ts","../../src/core/preview/assemblyUtils.ts","../../src/components/Assembly.tsx","../../src/blocks/preview/CompositionBlock.tsx","../../src/hooks/useExperienceBuilder.ts","../../src/hooks/useBreakpoints.ts","../../src/hooks/useFetchExperience.ts","../../src/hooks/useFetchByBase.ts","../../src/hooks/useDetectEditorMode.tsx","../../src/hooks/useFetchById.ts","../../src/hooks/useFetchBySlug.ts","../../src/hooks/usePrevious.ts","../../src/blocks/preview/DeprecatedPreviewDeliveryRoot.tsx","../../src/blocks/preview/PreviewDeliveryRoot.tsx","../../src/components/ErrorBoundary.tsx","../../src/hooks/useInitializeVisualEditor.ts","../../src/blocks/editor/VisualEditorRoot.tsx","../../src/ExperienceRoot.tsx","../../src/index.ts"],"sourcesContent":["export const SDK_VERSION = '0.0.1-alpha.1';\n","import { ComponentRegistration } from '@contentful/experiences-core/types';\nimport React from 'react';\n\ninterface CFProps {\n /**\n * Classes to be applied to the container component if `wrapComponent` is true, or directly to the child component if false.\n */\n className?: string;\n /**\n * Classes to be applied to the child component if `wrapComponent` is true, or directly to the child component if false.\n */\n classes?: string;\n onMouseDown?: React.MouseEventHandler;\n onMouseUp?: React.MouseEventHandler;\n onClick?: React.MouseEventHandler;\n /**\n * Prop required by Experience Builder to identify the component.\n */\n 'data-cf-node-id'?: string;\n /**\n * Prop required by Experience Builder to identify the component.\n */\n 'data-cf-node-block-id'?: string;\n /**\n * Prop required by Experience Builder to identify the component's type.\n */\n 'data-cf-node-block-type'?: string;\n}\n\n/**\n * Sets up a component to be consumed by Experience Builder. This function can be used to wrap a component with a container component, or to pass props to the component directly.\n * @param Component Component to be used by Experience Builder.\n * @param options Options for the `withComponentWrapper` function.\n * @default { wrapComponent: true, wrapContainerTag: 'div' }\n * @returns A component that can be passed to `defineComponents`.\n */\nexport function withComponentWrapper<T extends object>(\n Component: React.ElementType<T>,\n options: ComponentRegistration['options'] = {\n wrapComponent: true,\n wrapContainerTag: 'div',\n },\n) {\n const Wrapped = ({\n classes = '',\n className = '',\n 'data-cf-node-id': dataCfNodeId,\n 'data-cf-node-block-id': dataCfNodeBlockId,\n 'data-cf-node-block-type': dataCfNodeBlockType,\n onClick,\n onMouseDown,\n onMouseUp,\n ...props\n }: CFProps & T) => {\n const Tag = options.wrapContainerTag || 'div';\n const cfProps = {\n 'data-cf-node-id': dataCfNodeId,\n 'data-cf-node-block-id': dataCfNodeBlockId,\n 'data-cf-node-block-type': dataCfNodeBlockType,\n onClick,\n onMouseDown,\n onMouseUp,\n };\n\n const component = options.wrapComponent ? (\n <Tag className={className} {...cfProps}>\n {typeof Component === 'string' ? (\n React.createElement(Component, { className: classes, ...props })\n ) : (\n <Component className={classes} {...(props as T)} />\n )}\n </Tag>\n ) : (\n React.createElement(Component, {\n className: classes + className ? classes + ' ' + className : undefined,\n ...cfProps,\n ...(props as T),\n })\n );\n return component;\n };\n\n return Wrapped;\n}\n","import type { SchemaVersions } from '@contentful/experiences-core/types';\n\n// this is the array of version which currently LATEST_SCHEMA_VERSION is compatible with\nexport const compatibleVersions: SchemaVersions[] = ['2023-08-23', '2023-09-28'];\n\nexport { SDK_VERSION } from './sdkVersion';\n","import * as Components from '@contentful/experiences-components-react';\nimport type {\n ComponentRegistration,\n ComponentDefinition,\n ComponentRegistrationOptions,\n} from '@contentful/experiences-core/types';\nimport {\n OUTGOING_EVENTS,\n INTERNAL_EVENTS,\n CONTENTFUL_COMPONENTS,\n ASSEMBLY_DEFAULT_CATEGORY,\n} from '@contentful/experiences-core/constants';\nimport {\n builtInStyles as builtInStyleDefinitions,\n designTokensRegistry,\n optionalBuiltInStyles,\n sendMessage,\n containerDefinition,\n sectionDefinition,\n columnsDefinition,\n singleColumnDefinition,\n} from '@contentful/experiences-core';\nimport { withComponentWrapper } from '../utils/withComponentWrapper';\nimport { SDK_VERSION } from '../constants';\n\nconst cloneObject = <T>(targetObject: T): T => {\n if (typeof structuredClone !== 'undefined') {\n return structuredClone(targetObject);\n }\n\n return JSON.parse(JSON.stringify(targetObject));\n};\n\nconst applyComponentDefinitionFallbacks = (componentDefinition: ComponentDefinition) => {\n const clone = cloneObject(componentDefinition);\n for (const variable of Object.values(clone.variables)) {\n variable.group = variable.group ?? 'content';\n }\n return clone;\n};\n\nconst applyBuiltInStyleDefinitions = (componentDefinition: ComponentDefinition) => {\n if ([CONTENTFUL_COMPONENTS.container.id].includes(componentDefinition.id)) {\n return componentDefinition;\n }\n\n const clone = cloneObject(componentDefinition);\n\n // set margin built-in style by default\n if (!clone.builtInStyles) {\n clone.builtInStyles = ['cfMargin'];\n }\n\n for (const style of Object.values(clone.builtInStyles || [])) {\n if (builtInStyleDefinitions[style]) {\n clone.variables[style] = builtInStyleDefinitions[style];\n }\n if (optionalBuiltInStyles[style]) {\n clone.variables[style] = optionalBuiltInStyles[style];\n }\n }\n return clone;\n};\n\nexport const enrichComponentDefinition = ({\n component,\n definition,\n options,\n}: ComponentRegistration): ComponentRegistration => {\n const definitionWithFallbacks = applyComponentDefinitionFallbacks(definition);\n const definitionWithBuiltInStyles = applyBuiltInStyleDefinitions(definitionWithFallbacks);\n return {\n component: withComponentWrapper(component, options),\n definition: definitionWithBuiltInStyles,\n };\n};\n\nconst DEFAULT_COMPONENT_REGISTRATIONS = {\n container: {\n component: Components.ContentfulContainer,\n definition: containerDefinition,\n },\n section: {\n component: Components.ContentfulContainer,\n definition: sectionDefinition,\n },\n columns: {\n component: Components.Columns,\n definition: columnsDefinition,\n },\n singleColumn: {\n component: Components.SingleColumn,\n definition: singleColumnDefinition,\n },\n button: enrichComponentDefinition({\n component: Components.Button,\n definition: Components.ButtonComponentDefinition,\n options: {\n wrapComponent: false,\n },\n }),\n heading: enrichComponentDefinition({\n component: Components.Heading,\n definition: Components.HeadingComponentDefinition,\n options: {\n wrapComponent: false,\n },\n }),\n image: enrichComponentDefinition({\n component: Components.Image,\n definition: Components.ImageComponentDefinition,\n }),\n richText: enrichComponentDefinition({\n component: Components.RichText,\n definition: Components.RichTextComponentDefinition,\n options: {\n wrapComponent: false,\n },\n }),\n text: enrichComponentDefinition({\n component: Components.Text,\n definition: Components.TextComponentDefinition,\n options: {\n wrapComponent: false,\n },\n }),\n} satisfies Record<string, ComponentRegistration>;\n\n// pre-filling with the default component registrations\nexport const componentRegistry = new Map<string, ComponentRegistration>([\n [DEFAULT_COMPONENT_REGISTRATIONS.section.definition.id, DEFAULT_COMPONENT_REGISTRATIONS.section],\n [\n DEFAULT_COMPONENT_REGISTRATIONS.container.definition.id,\n DEFAULT_COMPONENT_REGISTRATIONS.container,\n ],\n [\n DEFAULT_COMPONENT_REGISTRATIONS.singleColumn.definition.id,\n DEFAULT_COMPONENT_REGISTRATIONS.singleColumn,\n ],\n [DEFAULT_COMPONENT_REGISTRATIONS.columns.definition.id, DEFAULT_COMPONENT_REGISTRATIONS.columns],\n [DEFAULT_COMPONENT_REGISTRATIONS.button.definition.id, DEFAULT_COMPONENT_REGISTRATIONS.button],\n [DEFAULT_COMPONENT_REGISTRATIONS.heading.definition.id, DEFAULT_COMPONENT_REGISTRATIONS.heading],\n [DEFAULT_COMPONENT_REGISTRATIONS.image.definition.id, DEFAULT_COMPONENT_REGISTRATIONS.image],\n [\n DEFAULT_COMPONENT_REGISTRATIONS.richText.definition.id,\n DEFAULT_COMPONENT_REGISTRATIONS.richText,\n ],\n [DEFAULT_COMPONENT_REGISTRATIONS.text.definition.id, DEFAULT_COMPONENT_REGISTRATIONS.text],\n]);\n\nexport const optionalBuiltInComponents = [\n DEFAULT_COMPONENT_REGISTRATIONS.button.definition.id,\n DEFAULT_COMPONENT_REGISTRATIONS.heading.definition.id,\n DEFAULT_COMPONENT_REGISTRATIONS.image.definition.id,\n DEFAULT_COMPONENT_REGISTRATIONS.richText.definition.id,\n DEFAULT_COMPONENT_REGISTRATIONS.text.definition.id,\n];\n\nexport const sendRegisteredComponentsMessage = () => {\n // Send the definitions (without components) via the connection message to the experience builder\n const registeredDefinitions = Array.from(componentRegistry.values());\n\n sendMessage(OUTGOING_EVENTS.RegisteredComponents, {\n definitions: registeredDefinitions,\n });\n};\n\nexport const sendConnectedEventWithRegisteredComponents = () => {\n // Send the definitions (without components) via the connection message to the experience builder\n const registeredDefinitions = Array.from(componentRegistry.values()).map(\n ({ definition }) => definition,\n );\n\n sendMessage(OUTGOING_EVENTS.Connected, {\n sdkVersion: SDK_VERSION,\n definitions: registeredDefinitions,\n });\n\n sendMessage(OUTGOING_EVENTS.DesignTokens, {\n designTokens: designTokensRegistry,\n });\n};\n\n/**\n * Registers multiple components and their component definitions at once\n * @param componentRegistrations - ComponentRegistration[]\n * @returns void\n */\nexport const defineComponents = (\n componentRegistrations: ComponentRegistration[],\n options?: ComponentRegistrationOptions,\n) => {\n if (options?.enabledBuiltInComponents) {\n for (const id of optionalBuiltInComponents) {\n if (!options.enabledBuiltInComponents.includes(id)) {\n componentRegistry.delete(id);\n }\n }\n }\n\n for (const registration of componentRegistrations) {\n // Fill definitions with fallbacks values\n const enrichedComponentRegistration = enrichComponentDefinition(registration);\n componentRegistry.set(\n enrichedComponentRegistration.definition.id,\n enrichedComponentRegistration,\n );\n }\n\n if (typeof window !== 'undefined') {\n window.dispatchEvent(new CustomEvent(INTERNAL_EVENTS.ComponentsRegistered));\n }\n};\n\n/**\n * use this function only in tests\n */\nexport const resetComponentRegistry = () => {\n componentRegistry.clear();\n for (const registration of Object.values(DEFAULT_COMPONENT_REGISTRATIONS)) {\n componentRegistry.set(registration.definition.id, registration);\n }\n};\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 { useEffect, useState } from 'react';\n\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 { checkIsAssemblyNode, EntityStore } from '@contentful/experiences-core';\nimport type {\n CompositionComponentPropValue,\n CompositionNode,\n} from '@contentful/experiences-core/types';\n\nexport const deserializeAssemblyNode = ({\n node,\n componentInstanceVariables,\n}: {\n node: CompositionNode;\n componentInstanceVariables: CompositionNode['variables'];\n}): CompositionNode => {\n const variables: Record<string, CompositionComponentPropValue> = {};\n\n for (const [variableName, variable] of Object.entries(node.variables)) {\n variables[variableName] = variable;\n if (variable.type === 'ComponentValue') {\n const componentValueKey = variable.key;\n const instanceProperty = componentInstanceVariables[componentValueKey];\n\n // For assembly, we look up the variable in the assembly instance and\n // replace the componentValue with that one.\n if (instanceProperty?.type === 'UnboundValue') {\n variables[variableName] = {\n type: 'UnboundValue',\n key: instanceProperty.key,\n };\n } else if (instanceProperty?.type === 'BoundValue') {\n variables[variableName] = {\n type: 'BoundValue',\n path: instanceProperty.path,\n };\n }\n }\n }\n\n const children: CompositionNode[] = node.children.map((child) =>\n deserializeAssemblyNode({\n node: child,\n componentInstanceVariables,\n }),\n );\n\n return {\n definitionId: node.definitionId,\n variables,\n children,\n };\n};\n\nexport const resolveAssembly = ({\n node,\n entityStore,\n}: {\n node: CompositionNode;\n entityStore: EntityStore;\n}) => {\n const isAssembly = checkIsAssemblyNode({\n componentId: node.definitionId,\n usedComponents: entityStore.usedComponents,\n });\n\n if (!isAssembly) {\n return node;\n }\n\n const componentId = node.definitionId as string;\n const assembly = entityStore.experienceEntryFields?.usedComponents?.find(\n (component) => component.sys.id === componentId,\n );\n\n if (!assembly || !('fields' in assembly)) {\n return node;\n }\n\n const componentFields = assembly.fields;\n\n const deserializedNode = deserializeAssemblyNode({\n node: {\n definitionId: node.definitionId,\n variables: {},\n children: componentFields.componentTree.children,\n },\n componentInstanceVariables: node.variables,\n });\n\n entityStore.addAssemblyUnboundValues(componentFields.unboundValues);\n\n return deserializedNode;\n};\n","import React from 'react';\n\nconst assemblyStyle = { display: 'contents' };\n\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\nexport const Assembly = ({ ...props }) => {\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 <div data-test-id=\"assembly\" {...props} style={assemblyStyle} />;\n};\n","import React, { useMemo } from 'react';\nimport type { UnresolvedLink } from 'contentful';\nimport { omit } from 'lodash-es';\nimport {\n EntityStore,\n isEmptyStructureWithRelativeHeight,\n isDeepPath,\n} from '@contentful/experiences-core';\nimport {\n CF_STYLE_ATTRIBUTES,\n CONTENTFUL_COMPONENTS,\n EMPTY_CONTAINER_HEIGHT,\n} from '@contentful/experiences-core/constants';\nimport type {\n CompositionNode,\n CompositionVariableValueType,\n ResolveDesignValueType,\n StyleProps,\n} from '@contentful/experiences-core/types';\nimport { createAssemblyRegistration, getComponentRegistration } from '../../core/componentRegistry';\nimport {\n buildCfStyles,\n checkIsAssemblyNode,\n transformContentValue,\n} from '@contentful/experiences-core';\nimport { useStyleTag } from '../../hooks/useStyleTag';\nimport {\n Columns,\n ContentfulContainer,\n SingleColumn,\n} from '@contentful/experiences-components-react';\n\nimport { resolveAssembly } from '../../core/preview/assemblyUtils';\nimport { Assembly } from '../../components/Assembly';\n\ntype CompositionBlockProps = {\n node: CompositionNode;\n locale: string;\n entityStore: EntityStore;\n resolveDesignValue: ResolveDesignValueType;\n};\n\nexport const CompositionBlock = ({\n node: rawNode,\n locale,\n entityStore,\n resolveDesignValue,\n}: CompositionBlockProps) => {\n const isAssembly = useMemo(\n () =>\n checkIsAssemblyNode({\n componentId: rawNode.definitionId,\n usedComponents: entityStore.usedComponents,\n }),\n [entityStore.usedComponents, rawNode.definitionId],\n );\n\n const node = useMemo(() => {\n return isAssembly\n ? resolveAssembly({\n node: rawNode,\n entityStore,\n })\n : rawNode;\n }, [entityStore, isAssembly, rawNode]);\n\n const componentRegistration = useMemo(() => {\n const registration = getComponentRegistration(node.definitionId as string);\n\n if (isAssembly && !registration) {\n return createAssemblyRegistration({\n definitionId: node.definitionId as string,\n component: Assembly,\n });\n }\n return registration;\n }, [isAssembly, node.definitionId]);\n\n const nodeProps = useMemo(() => {\n // Don't enrich the assembly wrapper node with props\n if (!componentRegistration || isAssembly) {\n return {};\n }\n\n const propMap: Record<string, CompositionVariableValueType> = {};\n\n return Object.entries(node.variables).reduce((acc, [variableName, variable]) => {\n switch (variable.type) {\n case 'DesignValue':\n acc[variableName] = resolveDesignValue(variable.valuesByBreakpoint, variableName);\n break;\n case 'BoundValue': {\n const variableDefinition = componentRegistration.definition.variables[variableName];\n if (isDeepPath(variable.path)) {\n const [, uuid] = variable.path.split('/');\n const link = entityStore.dataSource[uuid] as UnresolvedLink<'Entry' | 'Asset'>;\n const boundValue = entityStore.getValueDeep(link, variable.path);\n const value = boundValue || variableDefinition.defaultValue;\n acc[variableName] = transformContentValue(value, variableDefinition);\n break;\n }\n const [, uuid, ...path] = variable.path.split('/');\n const binding = entityStore.dataSource[uuid] as UnresolvedLink<'Entry' | 'Asset'>;\n let value = entityStore.getValue(binding, path.slice(0, -1));\n if (!value) {\n const foundAssetValue = entityStore.getValue(binding, [\n ...path.slice(0, -2),\n 'fields',\n 'file',\n ]);\n if (foundAssetValue) {\n value = foundAssetValue;\n }\n }\n acc[variableName] = transformContentValue(value, variableDefinition);\n break;\n }\n case 'UnboundValue': {\n const uuid = variable.key;\n acc[variableName] = entityStore.unboundValues[uuid]?.value;\n break;\n }\n default:\n break;\n }\n return acc;\n }, propMap);\n }, [componentRegistration, isAssembly, node.variables, resolveDesignValue, entityStore]);\n\n const cfStyles = buildCfStyles(nodeProps);\n\n if (\n isEmptyStructureWithRelativeHeight(node.children.length, node.definitionId, cfStyles.height)\n ) {\n cfStyles.minHeight = EMPTY_CONTAINER_HEIGHT;\n }\n\n const { className } = useStyleTag({ styles: cfStyles });\n\n if (!componentRegistration) {\n return null;\n }\n\n const { component } = componentRegistration;\n\n const children =\n componentRegistration.definition.children === true\n ? node.children.map((childNode: CompositionNode, index) => {\n return (\n <CompositionBlock\n node={childNode}\n key={index}\n locale={locale}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n />\n );\n })\n : null;\n\n if (\n [CONTENTFUL_COMPONENTS.container.id, CONTENTFUL_COMPONENTS.section.id].includes(\n node.definitionId,\n )\n ) {\n return (\n <ContentfulContainer\n editorMode={false}\n cfHyperlink={(nodeProps as StyleProps).cfHyperlink}\n cfOpenInNewTab={(nodeProps as StyleProps).cfOpenInNewTab}\n className={className}>\n {children}\n </ContentfulContainer>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.columns.id) {\n return (\n <Columns editorMode={false} className={className}>\n {children}\n </Columns>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.singleColumn.id) {\n return (\n <SingleColumn editorMode={false} className={className}>\n {children}\n </SingleColumn>\n );\n }\n\n return React.createElement(\n component,\n {\n ...omit(nodeProps, CF_STYLE_ATTRIBUTES, ['cfHyperlink', 'cfOpenInNewTab']),\n className,\n },\n children,\n );\n};\n","import { useMemo } from 'react';\nimport type { DeprecatedExperience, ExternalSDKMode } from '@contentful/experiences-core/types';\nimport type { ContentfulClientApi } from 'contentful';\nimport { defineComponents } from '../core/componentRegistry';\n\ntype UseExperienceBuilderProps = {\n /**\n * Id of the content type of the target experience\n */\n experienceTypeId: string;\n /**\n * Instance of a Delivery or Preview client from \"contentful\" package\n */\n client: ContentfulClientApi<undefined>;\n /**\n * Mode defines the behaviour of the sdk.\n * - `preview` - fetching and rendering draft data. Will automatically switch to `editor` mode if open from contentful web app.\n * - `delivery` - fetching and rendering of published data. Can not be switched to `editor` mode. */\n mode?: ExternalSDKMode;\n};\n\n/**\n * @deprecated This hook is deprecated. Use fetchBySlug or fetchById instead\n */\nexport const useExperienceBuilder = ({\n experienceTypeId,\n client,\n mode = 'delivery',\n}: UseExperienceBuilderProps) => {\n const experience = useMemo<DeprecatedExperience>(\n () => ({\n client,\n experienceTypeId,\n mode,\n }),\n [mode, client, experienceTypeId],\n );\n\n return {\n /**\n * @deprecated please fetch the experience using `useFetchExperience` hook or fetch the data manually using `fetchers` or `client` and create experience with `createExperience` function\n *\n * @example\n *\n * import { useFetchExperience } from '@contentful/experiences-sdk-react'\n *\n * const { fetchBySlug, fetchById, experience, isFetching } = useFetchExperience({ client, mode })\n */\n experience,\n /**\n * @deprecated please import the function from the library\n *\n * @example\n *\n * import { defineComponents } from '@contentful/experiences-sdk-react'\n */\n defineComponents,\n };\n};\n","import type {\n ValuesByBreakpoint,\n Breakpoint,\n CompositionVariableValueType,\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 [mediaQueryMatchers, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);\n\n const [mediaQueryMatches, setMediaQueryMatches] =\n useState<Record<string, boolean>>(initialMediaQueryMatches);\n\n const fallbackBreakpointIndex = getFallbackBreakpointIndex(breakpoints);\n\n // Register event listeners to update the media query states\n useEffect(() => {\n const eventListeners = mediaQueryMatchers.map(({ id, signal }) => {\n const onChange = () =>\n setMediaQueryMatches((prev) => ({\n ...prev,\n [id]: signal.matches,\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 }, [mediaQueryMatchers]);\n\n const activeBreakpointIndex = getActiveBreakpointIndex(\n breakpoints,\n mediaQueryMatches,\n fallbackBreakpointIndex,\n );\n\n const resolveDesignValue: ResolveDesignValueType = useCallback(\n (\n valuesByBreakpoint: ValuesByBreakpoint,\n variableName: string,\n ): CompositionVariableValueType => {\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 { ContentfulClientApi } from 'contentful';\nimport { useCallback, useState } from 'react';\nimport {\n EntityStore,\n fetchBySlug as fetchBySlugCore,\n fetchById as fetchByIdCore,\n} from '@contentful/experiences-core';\nimport { Experience, ExternalSDKMode } from '@contentful/experiences-core/types';\n\ntype useClientsideExperienceFetchersProps = {\n /** @deprecated mode no longer required */\n mode?: ExternalSDKMode;\n client: ContentfulClientApi<undefined>;\n};\n\n/**\n * @deprecated please use `useFetchBySlug` or `useFetchById` hooks instead\n */\nexport const useFetchExperience = ({ client }: useClientsideExperienceFetchersProps) => {\n const [experience, setExperience] = useState<Experience<EntityStore> | undefined>(undefined);\n const [isFetching, setIsFetching] = useState(false);\n const [error, setError] = useState<Error>();\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 const fetchBySlug = useCallback(\n async ({\n experienceTypeId,\n slug,\n localeCode,\n }: {\n experienceTypeId: string;\n slug: string;\n localeCode: string;\n }): Promise<Experience<EntityStore> | undefined> => {\n setIsFetching(true);\n setError(undefined);\n try {\n const experience = await fetchBySlugCore({\n client,\n experienceTypeId,\n localeCode,\n slug,\n });\n\n setExperience(experience);\n\n return experience;\n } catch (error) {\n setError(error as Error);\n } finally {\n setIsFetching(false);\n }\n },\n [client],\n );\n\n /**\n * Fetch experience entry using id as the identifier\n * @param {string} experienceTypeId - id of the content type associated with the experience\n * @param {string} id - id 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 const fetchById = useCallback(\n async ({\n experienceTypeId,\n id,\n localeCode,\n }: {\n experienceTypeId: string;\n id: string;\n localeCode: string;\n }): Promise<Experience<EntityStore> | undefined> => {\n setIsFetching(true);\n setError(undefined);\n try {\n const experience = await fetchByIdCore({\n client,\n experienceTypeId,\n localeCode,\n id,\n });\n\n setExperience(experience);\n return experience;\n } catch (error) {\n setError(error as Error);\n } finally {\n setIsFetching(false);\n }\n },\n [client],\n );\n\n return {\n fetchBySlug,\n fetchById,\n error,\n experience,\n isFetching,\n };\n};\n","import { useEffect, useState } from 'react';\nimport { EntityStore } from '@contentful/experiences-core';\nimport type { Experience } from '@contentful/experiences-core/types';\n\nexport const useFetchByBase = (\n fetchMethod: () => Promise<Experience<EntityStore> | undefined>,\n isEditorMode: boolean,\n) => {\n const [experience, setExperience] = useState<Experience<EntityStore>>();\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error>();\n\n useEffect(() => {\n (async () => {\n // if we are in editor mode, we don't want to fetch the experience here\n // it is passed via postMessage instead\n if (isEditorMode) {\n return;\n }\n setIsLoading(true);\n setError(undefined);\n try {\n const exp = await fetchMethod();\n setExperience(exp);\n } catch (error) {\n setError(error as Error);\n } finally {\n setIsLoading(false);\n }\n })();\n }, [fetchMethod, isEditorMode]);\n\n return {\n error,\n experience,\n isLoading,\n isEditorMode,\n };\n};\n","import { useEffect, useRef, useState } from 'react';\nimport {\n doesMismatchMessageSchema,\n sendMessage,\n tryParseMessage,\n} from '@contentful/experiences-core';\nimport { INCOMING_EVENTS, OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\ntype UseDetectEditorModeArgs = {\n /** If running from a known client side only situation (ie: useFetchBySlug),\n * set this to true to kick in editor mode check sooner (which avoids a render cycle) */\n isClientSide?: boolean;\n};\n\nexport const useDetectEditorMode = ({ isClientSide = false }: UseDetectEditorModeArgs = {}) => {\n const [mounted, setMounted] = useState(false);\n const [isEditorMode, setIsEditorMode] = useState(isClientSide ? inIframe() : false);\n const receivedMessage = useRef(false);\n\n useEffect(() => {\n const onMessage = (event: MessageEvent) => {\n if (doesMismatchMessageSchema(event)) {\n return;\n }\n const eventData = tryParseMessage(event);\n\n if (eventData.eventType === INCOMING_EVENTS.RequestEditorMode) {\n setIsEditorMode(true);\n receivedMessage.current = true;\n if (typeof window !== 'undefined') {\n //Once we definitely know that we are in editor mode, we set this flag so future postMessage connect calls are not made\n window.__EB__.isEditorMode = true;\n window.removeEventListener('message', onMessage);\n }\n }\n };\n\n //Only run check after component is mounted on the client to avoid hydration ssr issues\n if (mounted) {\n setIsEditorMode(inIframe());\n //Double check if we are in editor mode by listening to postMessage events\n if (typeof window !== 'undefined' && !window.__EB__?.isEditorMode) {\n window.addEventListener('message', onMessage);\n sendMessage(OUTGOING_EVENTS.Connected);\n\n setTimeout(() => {\n if (!receivedMessage.current) {\n // if message is not received back in time, set editorMode back to false\n setIsEditorMode(false);\n }\n }, 100);\n }\n } else {\n setMounted(true);\n }\n\n return () => window.removeEventListener('message', onMessage);\n }, [mounted]);\n\n return isEditorMode;\n};\n\nfunction inIframe() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return false;\n }\n}\n","import { useCallback } from 'react';\nimport type { ContentfulClientApi } from 'contentful';\nimport type { ExternalSDKMode } from '@contentful/experiences-core/types';\nimport { useFetchByBase } from './useFetchByBase';\nimport { fetchById } from '@contentful/experiences-core';\nimport { useDetectEditorMode } from './useDetectEditorMode';\n\nexport type UseFetchByIdArgs = {\n /** @deprecated mode no longer used */\n mode?: ExternalSDKMode;\n client: ContentfulClientApi<undefined>;\n id: string;\n experienceTypeId: string;\n localeCode: string;\n};\n\nexport const useFetchById = ({ id, localeCode, client, experienceTypeId }: UseFetchByIdArgs) => {\n const isEditorMode = useDetectEditorMode({ isClientSide: typeof window !== 'undefined' });\n\n const fetchMethod = useCallback(() => {\n return fetchById({ id, localeCode, client, experienceTypeId });\n }, [id, localeCode, client, experienceTypeId]);\n\n return useFetchByBase(fetchMethod, isEditorMode);\n};\n","import { useCallback } from 'react';\nimport type { ContentfulClientApi } from 'contentful';\nimport type { ExternalSDKMode } from '@contentful/experiences-core/types';\nimport { useFetchByBase } from './useFetchByBase';\nimport { fetchBySlug } from '@contentful/experiences-core';\nimport { useDetectEditorMode } from './useDetectEditorMode';\n\nexport type UseFetchBySlugArgs = {\n /** @deprecated mode no longer needed */\n mode?: ExternalSDKMode;\n client: ContentfulClientApi<undefined>;\n slug: string;\n experienceTypeId: string;\n localeCode: string;\n};\n\nexport const useFetchBySlug = ({\n slug,\n localeCode,\n client,\n experienceTypeId,\n}: UseFetchBySlugArgs) => {\n const isEditorMode = useDetectEditorMode({ isClientSide: typeof window !== 'undefined' });\n\n const fetchMethod = useCallback(() => {\n return fetchBySlug({ slug, localeCode, client, experienceTypeId });\n }, [slug, localeCode, client, experienceTypeId]);\n\n return useFetchByBase(fetchMethod, isEditorMode);\n};\n","import { useEffect, useRef } from 'react';\n\n/**\n * Returns the value of the argument from the previous render\n * @param {T} value\n * @returns {T | undefined} previous value\n */\nexport function usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T>();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n}\n","import React, { useEffect, useRef } from 'react';\nimport type { DeprecatedExperience } from '@contentful/experiences-core/types';\nimport { CompositionBlock } from './CompositionBlock';\nimport { compatibleVersions } from '../../constants';\nimport { useBreakpoints, useFetchExperience } from '../../hooks';\nimport { usePrevious } from '../../hooks/usePrevious';\n\ntype DeprecatedPreviewDeliveryRootProps = {\n deprecatedExperience: DeprecatedExperience;\n locale: string;\n slug?: string;\n};\n\n/**\n * @deprecated Remove after the BETA release\n * @returns\n */\nexport const DeprecatedPreviewDeliveryRoot = ({\n locale,\n slug,\n deprecatedExperience,\n}: DeprecatedPreviewDeliveryRootProps) => {\n const attemptedToFetch = useRef<boolean>(false);\n const previousLocale = usePrevious(locale);\n\n const { experienceTypeId, client } = deprecatedExperience;\n\n const { fetchBySlug, experience, isFetching } = useFetchExperience({\n client,\n });\n\n const entityStore = experience?.entityStore;\n\n useEffect(() => {\n // TODO: Test it, it is crucial\n // will make it fetch on each locale change as well as if experience entry hasn't been fetched yet at least once\n const shouldFetch =\n (client && !entityStore && !attemptedToFetch.current) || previousLocale !== locale;\n // this useEffect is meant to trigger fetching for the first time if it hasn't been done earlier\n // if not yet fetched and not fetchin at the moment\n if (shouldFetch && !isFetching && slug) {\n attemptedToFetch.current = true;\n fetchBySlug({\n experienceTypeId,\n localeCode: locale,\n slug,\n }).catch(() => {\n // noop\n });\n }\n }, [\n experienceTypeId,\n entityStore,\n isFetching,\n fetchBySlug,\n client,\n slug,\n locale,\n previousLocale,\n ]);\n\n const { resolveDesignValue } = useBreakpoints(entityStore?.breakpoints ?? []);\n\n if (!entityStore?.experienceEntryFields || !entityStore?.schemaVersion) {\n return null;\n }\n\n if (!compatibleVersions.includes(entityStore.schemaVersion)) {\n console.warn(\n `[experiences-sdk-react] Contenful composition schema version: ${entityStore.schemaVersion} does not match the compatible schema versions: ${compatibleVersions}. Aborting.`,\n );\n return null;\n }\n\n return (\n <>\n {entityStore.experienceEntryFields.componentTree.children.map((childNode, index) => (\n <CompositionBlock\n key={index}\n node={childNode}\n locale={locale}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n />\n ))}\n </>\n );\n};\n","import React from 'react';\nimport { EntityStore } from '@contentful/experiences-core';\nimport type { Experience } from '@contentful/experiences-core/types';\nimport { CompositionBlock } from './CompositionBlock';\nimport { compatibleVersions } from '../../constants';\nimport { useBreakpoints } from '../../hooks';\n\ntype DeliveryRootProps = {\n experience: Experience<EntityStore>;\n locale: string;\n};\n\nexport const PreviewDeliveryRoot = ({ locale, experience }: DeliveryRootProps) => {\n const { entityStore } = experience;\n\n const { resolveDesignValue } = useBreakpoints(entityStore?.breakpoints ?? []);\n\n if (!entityStore?.experienceEntryFields || !entityStore?.schemaVersion) {\n return null;\n }\n\n if (!compatibleVersions.includes(entityStore.schemaVersion)) {\n console.warn(\n `[experiences-sdk-react] Contentful composition schema version: ${entityStore.schemaVersion} does not match the compatible schema versions: ${compatibleVersions}. Aborting.`,\n );\n return null;\n }\n\n return (\n <>\n {entityStore.experienceEntryFields.componentTree.children.map((childNode, index) => (\n <CompositionBlock\n key={index}\n node={childNode}\n locale={locale}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n />\n ))}\n </>\n );\n};\n","import React, { ErrorInfo, ReactElement } from 'react';\nimport { sendMessage } from '@contentful/experiences-core';\nimport '../styles/ErrorBoundary.css';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\nclass ImportedComponentError extends Error {}\n\nexport class ErrorBoundary extends React.Component<\n { children: ReactElement },\n { hasError: boolean; error: Error | null; errorInfo: ErrorInfo | null; showErrorDetails: boolean }\n> {\n constructor(props: { children: ReactElement }) {\n super(props);\n this.state = { hasError: false, error: null, errorInfo: null, showErrorDetails: false };\n }\n\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n this.setState({ error, errorInfo });\n if (!(error instanceof ImportedComponentError)) {\n sendMessage(OUTGOING_EVENTS.CanvasError, error);\n } else {\n throw error;\n }\n }\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"cf-error-message\">\n <h2 className=\"title\">{`Something went wrong while rendering the experience`}</h2>\n <div>\n The Experience Builder SDK has encountered an error. It may be that the SDK has not been\n set up properly or an imported component has thrown this error. Try to refresh the page\n and find more guidance in our{' '}\n <a\n href=\"https://www.contentful.com/developers/docs/tutorials/general/experience-builder/\"\n rel=\"noreferrer\"\n target=\"_blank\">\n documentation\n </a>\n .\n </div>\n <br />\n <span\n className=\"more-details\"\n onClick={() =>\n this.setState((prevState) => ({\n showErrorDetails: !prevState.showErrorDetails,\n }))\n }>\n {this.state.showErrorDetails ? 'Hide' : 'See'} details\n </span>\n {this.state.showErrorDetails && (\n <code>\n {this.state.error?.stack?.split('\\n').map((i, key) => {\n return <div key={key}>{i}</div>;\n })}\n </code>\n )}\n </div>\n );\n }\n return this.props.children;\n }\n}\n\nexport class ImportedComponentErrorBoundary extends React.Component<{ children: ReactElement }> {\n componentDidCatch(error: Error, _errorInfo: ErrorInfo) {\n const err = new ImportedComponentError(error.message);\n err.stack = error.stack;\n throw err;\n }\n\n render() {\n return this.props.children;\n }\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { EntityStore } from '@contentful/experiences-core';\nimport {\n componentRegistry,\n sendConnectedEventWithRegisteredComponents,\n sendRegisteredComponentsMessage,\n} from '../core/componentRegistry';\nimport { INTERNAL_EVENTS, VISUAL_EDITOR_EVENTS } from '@contentful/experiences-core/constants';\nimport { designTokensRegistry } from '@contentful/experiences-core';\n\ntype InitializeVisualEditorParams = {\n initialLocale: string;\n initialEntities?: EntityStore['entities'];\n};\n\nexport const useInitializeVisualEditor = (params: InitializeVisualEditorParams) => {\n const { initialLocale, initialEntities } = params;\n const [locale, setLocale] = useState<string>(initialLocale);\n\n const hasConnectEventBeenSent = useRef(false);\n\n // sends component definitions to the web app\n // InternalEvents.COMPONENTS_REGISTERED is triggered by defineComponents function\n useEffect(() => {\n if (!hasConnectEventBeenSent.current) {\n // sending CONNECT but with the registered components now\n sendConnectedEventWithRegisteredComponents();\n hasConnectEventBeenSent.current = true;\n }\n\n const onComponentsRegistered = () => {\n sendRegisteredComponentsMessage();\n };\n\n if (typeof window !== 'undefined') {\n window.addEventListener(INTERNAL_EVENTS.ComponentsRegistered, onComponentsRegistered);\n }\n\n return () => {\n if (typeof window !== 'undefined') {\n window.removeEventListener(INTERNAL_EVENTS.ComponentsRegistered, onComponentsRegistered);\n }\n };\n }, []);\n\n useEffect(() => {\n setLocale(initialLocale);\n }, [initialLocale]);\n\n useEffect(() => {\n const onVisualEditorReady = () => {\n window.dispatchEvent(\n new CustomEvent(INTERNAL_EVENTS.VisualEditorInitialize, {\n detail: {\n componentRegistry,\n designTokens: designTokensRegistry,\n locale,\n entities: initialEntities ?? [],\n },\n }),\n );\n };\n\n window.addEventListener(VISUAL_EDITOR_EVENTS.Ready, onVisualEditorReady);\n return () => {\n window.removeEventListener(VISUAL_EDITOR_EVENTS.Ready, onVisualEditorReady);\n };\n }, [locale, initialEntities]);\n};\n","import React, { Suspense } from 'react';\nimport { EntityStore, VisualEditorMode } from '@contentful/experiences-core';\nimport { ErrorBoundary } from '../../components/ErrorBoundary';\nimport { useInitializeVisualEditor } from '../../hooks/useInitializeVisualEditor';\n\nconst VisualEditorLoader = React.lazy(() => import('./VisualEditorLoader'));\n\ntype VisualEditorRootProps = {\n visualEditorMode: VisualEditorMode;\n initialEntities: EntityStore['entities'];\n initialLocale: string;\n};\n\nexport const VisualEditorRoot: React.FC<VisualEditorRootProps> = ({\n visualEditorMode,\n initialEntities,\n initialLocale,\n}) => {\n useInitializeVisualEditor({\n initialLocale,\n initialEntities,\n });\n\n return (\n <ErrorBoundary>\n <Suspense fallback={<div>Loading...</div>}>\n <VisualEditorLoader visualEditorMode={visualEditorMode} />\n </Suspense>\n </ErrorBoundary>\n );\n};\n\nexport default VisualEditorRoot;\n","import React from 'react';\nimport {\n VisualEditorMode,\n isDeprecatedExperience,\n validateExperienceBuilderConfig,\n} from '@contentful/experiences-core';\nimport { EntityStore } from '@contentful/experiences-core';\nimport type { DeprecatedExperience, Experience } from '@contentful/experiences-core/types';\nimport { DeprecatedPreviewDeliveryRoot } from './blocks/preview/DeprecatedPreviewDeliveryRoot';\nimport { PreviewDeliveryRoot } from './blocks/preview/PreviewDeliveryRoot';\nimport VisualEditorRoot from './blocks/editor/VisualEditorRoot';\nimport { useDetectEditorMode } from './hooks/useDetectEditorMode';\n\ntype ExperienceRootProps = {\n experience?: Experience<EntityStore> | DeprecatedExperience;\n locale: string;\n /**\n * @deprecated\n */\n slug?: string;\n visualEditorMode?: VisualEditorMode;\n};\n\nexport const ExperienceRoot = ({\n locale,\n experience,\n slug,\n visualEditorMode = VisualEditorMode.LazyLoad,\n}: ExperienceRootProps) => {\n const isEditorMode = useDetectEditorMode();\n\n validateExperienceBuilderConfig({\n locale,\n isEditorMode,\n });\n\n if (isEditorMode) {\n const entityStore =\n experience && !isDeprecatedExperience(experience) ? experience.entityStore : undefined;\n return (\n <VisualEditorRoot\n visualEditorMode={visualEditorMode}\n initialEntities={entityStore?.entities || []}\n initialLocale={locale}\n />\n );\n }\n\n if (!experience) return null;\n\n if (isDeprecatedExperience(experience)) {\n return (\n <DeprecatedPreviewDeliveryRoot\n deprecatedExperience={experience as DeprecatedExperience}\n locale={locale}\n slug={slug}\n />\n );\n }\n\n return <PreviewDeliveryRoot locale={locale} experience={experience} />;\n};\n","import { SDK_VERSION } from './sdkVersion';\n\nexport { ExperienceRoot } from './ExperienceRoot';\nexport { useExperienceBuilder, useFetchExperience, useFetchById, useFetchBySlug } from './hooks';\nexport { defineComponents } from './core/componentRegistry';\nexport {\n calculateNodeDefaultHeight,\n /** @deprecated use `checkIsAssemblyNode` instead. Will be removed with SDK v5. */\n checkIsAssembly,\n checkIsAssemblyNode,\n checkIsAssemblyEntry,\n defineDesignTokens,\n supportedModes,\n VisualEditorMode,\n fetchById,\n fetchBySlug,\n createExperience,\n} from '@contentful/experiences-core';\nexport {\n /** @deprecated use `CONTENTFUL_COMPONENTS.section.id` instead. This will be removed in version 4. */\n CONTENTFUL_SECTION_ID,\n /** @deprecated use `CONTENTFUL_COMPONENTS.container.id` instead. This will be removed in version 4. */\n CONTENTFUL_CONTAINER_ID,\n CONTENTFUL_COMPONENTS,\n OUTGOING_EVENTS,\n INCOMING_EVENTS,\n CONTENTFUL_COMPONENT_CATEGORY,\n LATEST_SCHEMA_VERSION,\n CF_STYLE_ATTRIBUTES,\n // We still need to expose those, so in the editor we can check for both to support older SDK versions\n /** @deprecated use `ASSEMBLY_BLOCK_NODE_TYPE` instead. This will be removed in version 5. */\n DESIGN_COMPONENT_BLOCK_NODE_TYPE,\n /** @deprecated use `ASSEMBLY_NODE_TYPE` instead. This will be removed in version 5. */\n DESIGN_COMPONENT_NODE_TYPE,\n /** @deprecated use `ASSEMBLY_NODE_TYPES` instead. This will be removed in version 5. */\n DESIGN_COMPONENT_NODE_TYPES,\n ASSEMBLY_BLOCK_NODE_TYPE,\n ASSEMBLY_NODE_TYPE,\n ASSEMBLY_NODE_TYPES,\n SCROLL_STATES,\n} from '@contentful/experiences-core/constants';\n\n// Simple state store to store a few things that are needed across the SDK\nif (typeof window !== 'undefined') {\n window.__EB__ = {\n sdkVersion: SDK_VERSION,\n };\n}\n\nexport type {\n InternalSDKMode,\n ExternalSDKMode,\n ComponentDefinition,\n} from '@contentful/experiences-core/types';\nexport { EntityStore } from '@contentful/experiences-core';\n"],"names":["_jsx","builtInStyleDefinitions","fetchBySlug","fetchBySlugCore","fetchById","fetchByIdCore","_jsxs"],"mappings":";;;;;;;;;;;AAAO,MAAM,WAAW,GAAG,eAAe;;AC6B1C;;;;;;AAMG;AACa,SAAA,oBAAoB,CAClC,SAA+B,EAC/B,OAA4C,GAAA;AAC1C,IAAA,a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,EAAE;AACtC,QAAA,QACEA,GAAC,CAAA,6BAA6B,EAC5B,EAAA,oBAAoB,EAAE,UAAkC,EACxD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EAAA,CACV,EACF;KACH;IAED,OAAOA,GAAA,CAAC,mBAAmB,EAAA,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAA,CAAI,CAAC;AACzE;;ACnBA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,MAAM,GAAG;AACd,QAAA,UAAU,EAAE,WAAW;KACxB,CAAC;AACJ;;;;"}
@@ -0,0 +1,14 @@
1
+ import { VisualEditorMode } from '@contentful/experiences-core';
2
+ import { EntityStore } from '@contentful/experiences-core';
3
+ import type { DeprecatedExperience, Experience } from '@contentful/experiences-core/types';
4
+ type ExperienceRootProps = {
5
+ experience?: Experience<EntityStore> | DeprecatedExperience;
6
+ locale: string;
7
+ /**
8
+ * @deprecated
9
+ */
10
+ slug?: string;
11
+ visualEditorMode?: VisualEditorMode;
12
+ };
13
+ export declare const ExperienceRoot: ({ locale, experience, slug, visualEditorMode, }: ExperienceRootProps) => import("react/jsx-runtime").JSX.Element | null;
14
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This component injects the visual editor script into the page
3
+ */
4
+ export default function VisualEditorInjectScript(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { VisualEditorMode } from '@contentful/experiences-core';
3
+ type VisualEditorLoaderProps = {
4
+ visualEditorMode: VisualEditorMode;
5
+ };
6
+ export declare const VisualEditorLoader: React.FC<VisualEditorLoaderProps>;
7
+ export default VisualEditorLoader;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { EntityStore, VisualEditorMode } from '@contentful/experiences-core';
3
+ type VisualEditorRootProps = {
4
+ visualEditorMode: VisualEditorMode;
5
+ initialEntities: EntityStore['entities'];
6
+ initialLocale: string;
7
+ };
8
+ export declare const VisualEditorRoot: React.FC<VisualEditorRootProps>;
9
+ export default VisualEditorRoot;
@@ -0,0 +1,10 @@
1
+ import { EntityStore } from '@contentful/experiences-core';
2
+ import type { CompositionNode, ResolveDesignValueType } from '@contentful/experiences-core/types';
3
+ type CompositionBlockProps = {
4
+ node: CompositionNode;
5
+ locale: string;
6
+ entityStore: EntityStore;
7
+ resolveDesignValue: ResolveDesignValueType;
8
+ };
9
+ export declare const CompositionBlock: ({ node: rawNode, locale, entityStore, resolveDesignValue, }: CompositionBlockProps) => import("react/jsx-runtime").JSX.Element | null;
10
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { DeprecatedExperience } from '@contentful/experiences-core/types';
2
+ type DeprecatedPreviewDeliveryRootProps = {
3
+ deprecatedExperience: DeprecatedExperience;
4
+ locale: string;
5
+ slug?: string;
6
+ };
7
+ /**
8
+ * @deprecated Remove after the BETA release
9
+ * @returns
10
+ */
11
+ export declare const DeprecatedPreviewDeliveryRoot: ({ locale, slug, deprecatedExperience, }: DeprecatedPreviewDeliveryRootProps) => import("react/jsx-runtime").JSX.Element | null;
12
+ export {};
@@ -0,0 +1,8 @@
1
+ import { EntityStore } from '@contentful/experiences-core';
2
+ import type { Experience } from '@contentful/experiences-core/types';
3
+ type DeliveryRootProps = {
4
+ experience: Experience<EntityStore>;
5
+ locale: string;
6
+ };
7
+ export declare const PreviewDeliveryRoot: ({ locale, experience }: DeliveryRootProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const Assembly: ({ ...props }: {
2
+ [x: string]: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import React, { ErrorInfo, ReactElement } from 'react';
2
+ import '../styles/ErrorBoundary.css';
3
+ export declare class ErrorBoundary extends React.Component<{
4
+ children: ReactElement;
5
+ }, {
6
+ hasError: boolean;
7
+ error: Error | null;
8
+ errorInfo: ErrorInfo | null;
9
+ showErrorDetails: boolean;
10
+ }> {
11
+ constructor(props: {
12
+ children: ReactElement;
13
+ });
14
+ static getDerivedStateFromError(): {
15
+ hasError: boolean;
16
+ };
17
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
18
+ render(): import("react/jsx-runtime").JSX.Element;
19
+ }
20
+ export declare class ImportedComponentErrorBoundary extends React.Component<{
21
+ children: ReactElement;
22
+ }> {
23
+ componentDidCatch(error: Error, _errorInfo: ErrorInfo): void;
24
+ render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
25
+ }
@@ -0,0 +1,64 @@
1
+ import React, { MouseEventHandler } from 'react';
2
+ import type * as CSS from 'csstype';
3
+ export interface FlexProps {
4
+ /**
5
+ * Child nodes to be rendered in the component */
6
+ children?: React.ReactNode;
7
+ /**
8
+ * A shorthand property for flex-grow, flex-shrink, flex-basis
9
+ */
10
+ flex?: CSS.Property.Flex;
11
+ /**
12
+ * Defines the initial size of a flexbox item.
13
+ * */
14
+ flexBasis?: CSS.Property.FlexBasis;
15
+ /**
16
+ * Defines how much a flexbox item should shrink if there's not enough space available. */
17
+ flexShrink?: CSS.Property.FlexShrink;
18
+ /**
19
+ * Defines if flexbox items appear on a single line or on multiple lines within a flexbox container. */
20
+ flexWrap?: CSS.Property.FlexWrap;
21
+ /**
22
+ * Defines how flexbox items are ordered within a flexbox container. */
23
+ flexDirection?: CSS.Property.FlexDirection;
24
+ /**
25
+ * Defines how much a flexbox item should grow if there's space available. */
26
+ flexGrow?: CSS.Property.FlexGrow;
27
+ /**
28
+ * Defines a gap between flexbox items. */
29
+ gap?: string;
30
+ /**
31
+ * Defines how flexbox/grid items are aligned according to the main axis, within a flexbox/grid container. */
32
+ justifyContent?: CSS.Property.JustifyContent;
33
+ /**
34
+ * Defines the default justify-self for all items of the box, giving them all a default way of justifying each box along the appropriate axis. */
35
+ justifyItems?: CSS.Property.JustifyContent;
36
+ /**
37
+ * Sets the way a box is justified inside its alignment container along the appropriate axis. */
38
+ justifySelf?: CSS.Property.JustifySelf;
39
+ /**
40
+ * Defines how flexbox items are aligned according to the cross axis, within a line of a flexbox container.
41
+ */
42
+ alignItems?: CSS.Property.AlignItems;
43
+ /**
44
+ * Works like align-items, but applies only to a single flexbox item, instead of all of them.
45
+ */
46
+ alignSelf?: CSS.Property.AlignItems;
47
+ /**
48
+ * Defines how each line is aligned within a flexbox/grid container.
49
+ */
50
+ alignContent?: CSS.Property.AlignContent;
51
+ /**
52
+ * Defines the order of a flexbox item
53
+ */
54
+ order?: CSS.Property.Order;
55
+ onMouseEnter?: MouseEventHandler<HTMLDivElement>;
56
+ onMouseLeave?: MouseEventHandler<HTMLDivElement>;
57
+ onMouseUp?: MouseEventHandler<HTMLDivElement>;
58
+ onMouseDown?: MouseEventHandler<HTMLDivElement>;
59
+ onClick?: MouseEventHandler<HTMLDivElement>;
60
+ className?: string;
61
+ cssStyles?: Record<string, string>;
62
+ id?: string;
63
+ }
64
+ export declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ import type { SchemaVersions } from '@contentful/experiences-core/types';
2
+ export declare const compatibleVersions: SchemaVersions[];
3
+ export { SDK_VERSION } from './sdkVersion';
@@ -0,0 +1,23 @@
1
+ import type { ComponentRegistration, ComponentRegistrationOptions } from '@contentful/experiences-core/types';
2
+ export declare const enrichComponentDefinition: ({ component, definition, options, }: ComponentRegistration) => ComponentRegistration;
3
+ export declare const componentRegistry: Map<string, ComponentRegistration>;
4
+ export declare const optionalBuiltInComponents: string[];
5
+ export declare const sendRegisteredComponentsMessage: () => void;
6
+ export declare const sendConnectedEventWithRegisteredComponents: () => void;
7
+ /**
8
+ * Registers multiple components and their component definitions at once
9
+ * @param componentRegistrations - ComponentRegistration[]
10
+ * @returns void
11
+ */
12
+ export declare const defineComponents: (componentRegistrations: ComponentRegistration[], options?: ComponentRegistrationOptions) => void;
13
+ /**
14
+ * use this function only in tests
15
+ */
16
+ export declare const resetComponentRegistry: () => void;
17
+ export declare const getComponentRegistration: (id: string) => ComponentRegistration | undefined;
18
+ export declare const addComponentRegistration: (componentRegistration: ComponentRegistration) => void;
19
+ export declare const createAssemblyRegistration: ({ definitionId, definitionName, component, }: {
20
+ definitionId: string;
21
+ definitionName?: string | undefined;
22
+ component: ComponentRegistration['component'];
23
+ }) => ComponentRegistration | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { Flex } from '../components/Flex';
@@ -0,0 +1,10 @@
1
+ import { EntityStore } from '@contentful/experiences-core';
2
+ import type { CompositionNode } from '@contentful/experiences-core/types';
3
+ export declare const deserializeAssemblyNode: ({ node, componentInstanceVariables, }: {
4
+ node: CompositionNode;
5
+ componentInstanceVariables: CompositionNode['variables'];
6
+ }) => CompositionNode;
7
+ export declare const resolveAssembly: ({ node, entityStore, }: {
8
+ node: CompositionNode;
9
+ entityStore: EntityStore;
10
+ }) => CompositionNode;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export { useExperienceBuilder } from './useExperienceBuilder';
2
+ export { useBreakpoints } from './useBreakpoints';
3
+ export { useFetchExperience } from './useFetchExperience';
4
+ export * from './useFetchById';
5
+ export * from './useFetchBySlug';
@@ -0,0 +1,4 @@
1
+ import type { Breakpoint, ResolveDesignValueType } from '@contentful/experiences-core/types';
2
+ export declare const useBreakpoints: (breakpoints: Breakpoint[]) => {
3
+ resolveDesignValue: ResolveDesignValueType;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ type UseDetectEditorModeArgs = {
2
+ /** If running from a known client side only situation (ie: useFetchBySlug),
3
+ * set this to true to kick in editor mode check sooner (which avoids a render cycle) */
4
+ isClientSide?: boolean;
5
+ };
6
+ export declare const useDetectEditorMode: ({ isClientSide }?: UseDetectEditorModeArgs) => boolean;
7
+ export {};
@@ -0,0 +1,41 @@
1
+ import type { DeprecatedExperience, ExternalSDKMode } from '@contentful/experiences-core/types';
2
+ import type { ContentfulClientApi } from 'contentful';
3
+ type UseExperienceBuilderProps = {
4
+ /**
5
+ * Id of the content type of the target experience
6
+ */
7
+ experienceTypeId: string;
8
+ /**
9
+ * Instance of a Delivery or Preview client from "contentful" package
10
+ */
11
+ client: ContentfulClientApi<undefined>;
12
+ /**
13
+ * Mode defines the behaviour of the sdk.
14
+ * - `preview` - fetching and rendering draft data. Will automatically switch to `editor` mode if open from contentful web app.
15
+ * - `delivery` - fetching and rendering of published data. Can not be switched to `editor` mode. */
16
+ mode?: ExternalSDKMode;
17
+ };
18
+ /**
19
+ * @deprecated This hook is deprecated. Use fetchBySlug or fetchById instead
20
+ */
21
+ export declare const useExperienceBuilder: ({ experienceTypeId, client, mode, }: UseExperienceBuilderProps) => {
22
+ /**
23
+ * @deprecated please fetch the experience using `useFetchExperience` hook or fetch the data manually using `fetchers` or `client` and create experience with `createExperience` function
24
+ *
25
+ * @example
26
+ *
27
+ * import { useFetchExperience } from '@contentful/experiences-sdk-react'
28
+ *
29
+ * const { fetchBySlug, fetchById, experience, isFetching } = useFetchExperience({ client, mode })
30
+ */
31
+ experience: DeprecatedExperience;
32
+ /**
33
+ * @deprecated please import the function from the library
34
+ *
35
+ * @example
36
+ *
37
+ * import { defineComponents } from '@contentful/experiences-sdk-react'
38
+ */
39
+ defineComponents: (componentRegistrations: import("@contentful/experiences-core/types").ComponentRegistration[], options?: import("@contentful/experiences-core/types").ComponentRegistrationOptions | undefined) => void;
40
+ };
41
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { EntityStore } from '@contentful/experiences-core';
2
+ import type { Experience } from '@contentful/experiences-core/types';
3
+ export declare const useFetchByBase: (fetchMethod: () => Promise<Experience<EntityStore> | undefined>, isEditorMode: boolean) => {
4
+ error: Error | undefined;
5
+ experience: Experience<EntityStore> | undefined;
6
+ isLoading: boolean;
7
+ isEditorMode: boolean;
8
+ };
@@ -0,0 +1,16 @@
1
+ import type { ContentfulClientApi } from 'contentful';
2
+ import type { ExternalSDKMode } from '@contentful/experiences-core/types';
3
+ export type UseFetchByIdArgs = {
4
+ /** @deprecated mode no longer used */
5
+ mode?: ExternalSDKMode;
6
+ client: ContentfulClientApi<undefined>;
7
+ id: string;
8
+ experienceTypeId: string;
9
+ localeCode: string;
10
+ };
11
+ export declare const useFetchById: ({ id, localeCode, client, experienceTypeId }: UseFetchByIdArgs) => {
12
+ error: Error | undefined;
13
+ experience: import("@contentful/experiences-core/types").Experience<import("@contentful/experiences-core/dist/entity/EntityStore").EntityStore> | undefined;
14
+ isLoading: boolean;
15
+ isEditorMode: boolean;
16
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { ContentfulClientApi } from 'contentful';
2
+ import type { ExternalSDKMode } from '@contentful/experiences-core/types';
3
+ export type UseFetchBySlugArgs = {
4
+ /** @deprecated mode no longer needed */
5
+ mode?: ExternalSDKMode;
6
+ client: ContentfulClientApi<undefined>;
7
+ slug: string;
8
+ experienceTypeId: string;
9
+ localeCode: string;
10
+ };
11
+ export declare const useFetchBySlug: ({ slug, localeCode, client, experienceTypeId, }: UseFetchBySlugArgs) => {
12
+ error: Error | undefined;
13
+ experience: import("@contentful/experiences-core/types").Experience<import("@contentful/experiences-core/dist/entity/EntityStore").EntityStore> | undefined;
14
+ isLoading: boolean;
15
+ isEditorMode: boolean;
16
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { ContentfulClientApi } from 'contentful';
2
+ import { EntityStore } from '@contentful/experiences-core';
3
+ import { Experience, ExternalSDKMode } from '@contentful/experiences-core/types';
4
+ type useClientsideExperienceFetchersProps = {
5
+ /** @deprecated mode no longer required */
6
+ mode?: ExternalSDKMode;
7
+ client: ContentfulClientApi<undefined>;
8
+ };
9
+ /**
10
+ * @deprecated please use `useFetchBySlug` or `useFetchById` hooks instead
11
+ */
12
+ export declare const useFetchExperience: ({ client }: useClientsideExperienceFetchersProps) => {
13
+ fetchBySlug: ({ experienceTypeId, slug, localeCode, }: {
14
+ experienceTypeId: string;
15
+ slug: string;
16
+ localeCode: string;
17
+ }) => Promise<Experience<EntityStore> | undefined>;
18
+ fetchById: ({ experienceTypeId, id, localeCode, }: {
19
+ experienceTypeId: string;
20
+ id: string;
21
+ localeCode: string;
22
+ }) => Promise<Experience<EntityStore> | undefined>;
23
+ error: Error | undefined;
24
+ experience: Experience<EntityStore> | undefined;
25
+ isFetching: boolean;
26
+ };
27
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { EntityStore } from '@contentful/experiences-core';
2
+ type InitializeVisualEditorParams = {
3
+ initialLocale: string;
4
+ initialEntities?: EntityStore['entities'];
5
+ };
6
+ export declare const useInitializeVisualEditor: (params: InitializeVisualEditorParams) => void;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns the value of the argument from the previous render
3
+ * @param {T} value
4
+ * @returns {T | undefined} previous value
5
+ */
6
+ export declare function usePrevious<T>(value: T): T | undefined;
@@ -0,0 +1,16 @@
1
+ import type { CSSProperties } from '@contentful/experiences-core/types';
2
+ /**
3
+ *
4
+ * @param styles: the list of styles to apply
5
+ * @param nodeId: [Optional] the id of node that these styles will be applied to
6
+ * @returns className: the className that was used
7
+ * Builds and adds a style tag in the document. Returns the className to be attached to the element.
8
+ * In editor mode the nodeId is used as the identifier in order to avoid creating endless tags as the styles are tweeked
9
+ * In preview/delivery mode the styles don't change oftem so we're using the md5 hash of the content of the tag
10
+ */
11
+ export declare const useStyleTag: ({ styles, nodeId }: {
12
+ styles: CSSProperties;
13
+ nodeId?: string | undefined;
14
+ }) => {
15
+ className: string;
16
+ };