@contentful/experiences-sdk-react 1.42.0-dev-20250630T1149-4da2e67.0 → 1.42.0-prerelease-20250620T0958-8e54295.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ import { resolveMaybePrebindingDefaultValuePath } from '../../utils/prebindingUt
10
10
  import PreviewUnboundImage from './PreviewUnboundImage.js';
11
11
  import { parseComponentProps } from '../../utils/parseComponentProps.js';
12
12
 
13
- const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, getPatternChildNodeClassName, wrappingPatternIds: parentWrappingPatternIds = new Set(), wrappingParameters: parentWrappingParameters = {}, patternRootNodeIdsChain: parentPatternRootNodeIdsChain = '', }) => {
13
+ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, getPatternChildNodeClassName, wrappingPatternIds: parentWrappingPatternIds = new Set(), wrappingPatternProperties: parentWrappingPatternProperties = {}, patternRootNodeIdsChain: parentPatternRootNodeIdsChain = '', }) => {
14
14
  const isPatternNode = useMemo(() => {
15
15
  return checkIsAssemblyNode({
16
16
  componentId: rawNode.definitionId,
@@ -32,14 +32,20 @@ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern
32
32
  return resolvePattern({
33
33
  node: rawNode,
34
34
  entityStore,
35
- parentParameters: parentWrappingParameters,
35
+ parentPatternProperties: parentWrappingPatternProperties,
36
36
  patternRootNodeIdsChain,
37
37
  });
38
38
  }
39
39
  else {
40
40
  return rawNode;
41
41
  }
42
- }, [entityStore, isPatternNode, rawNode, parentWrappingParameters, patternRootNodeIdsChain]);
42
+ }, [
43
+ entityStore,
44
+ isPatternNode,
45
+ rawNode,
46
+ parentWrappingPatternProperties,
47
+ patternRootNodeIdsChain,
48
+ ]);
43
49
  const wrappingPatternIds = useMemo(() => {
44
50
  if (isPatternNode) {
45
51
  return new Set([node.definitionId, ...parentWrappingPatternIds]);
@@ -49,12 +55,12 @@ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern
49
55
  // Merge the pattern properties of the current node with the parent's pattern properties
50
56
  // to ensure nested patterns receive relevant pattern properties that were bubbled up
51
57
  // during assembly serialization.
52
- const wrappingParameters = useMemo(() => {
58
+ const wrappingPatternProperties = useMemo(() => {
53
59
  if (isPatternNode) {
54
- return { ...parentWrappingParameters, ...(rawNode.parameters || {}) };
60
+ return { ...parentWrappingPatternProperties, ...(rawNode.parameters || {}) };
55
61
  }
56
- return parentWrappingParameters;
57
- }, [isPatternNode, rawNode, parentWrappingParameters]);
62
+ return parentWrappingPatternProperties;
63
+ }, [isPatternNode, rawNode, parentWrappingPatternProperties]);
58
64
  const componentRegistration = useMemo(() => {
59
65
  const registration = getComponentRegistration(node.definitionId);
60
66
  if (isPatternNode && !registration) {
@@ -131,7 +137,7 @@ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern
131
137
  for (const slotId in componentRegistration.definition.slots) {
132
138
  const slotNode = node.children.find((child) => child.slotId === slotId);
133
139
  if (slotNode) {
134
- slotsProps[slotId] = (jsx(CompositionBlock, { node: slotNode, locale: locale, hyperlinkPattern: hyperlinkPattern, entityStore: entityStore, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, wrappingParameters: wrappingParameters, patternRootNodeIdsChain: patternRootNodeIdsChain }));
140
+ slotsProps[slotId] = (jsx(CompositionBlock, { node: slotNode, locale: locale, hyperlinkPattern: hyperlinkPattern, entityStore: entityStore, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, wrappingPatternProperties: wrappingPatternProperties, patternRootNodeIdsChain: patternRootNodeIdsChain }));
135
141
  }
136
142
  }
137
143
  }
@@ -162,7 +168,7 @@ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern
162
168
  hyperlinkPattern,
163
169
  locale,
164
170
  wrappingPatternIds,
165
- wrappingParameters,
171
+ wrappingPatternProperties,
166
172
  patternRootNodeIdsChain,
167
173
  ]);
168
174
  // do not inject the stylesheet into the dom because it's already been done on the server side
@@ -191,7 +197,7 @@ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern
191
197
  ? node.children.map((childNode, index) => {
192
198
  return (jsx(CompositionBlock, { getPatternChildNodeClassName: isPatternNode || getPatternChildNodeClassName
193
199
  ? _getPatternChildNodeClassName
194
- : undefined, node: childNode, locale: locale, hyperlinkPattern: hyperlinkPattern, entityStore: entityStore, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, wrappingParameters: wrappingParameters, patternRootNodeIdsChain: patternRootNodeIdsChain }, index));
200
+ : undefined, node: childNode, locale: locale, hyperlinkPattern: hyperlinkPattern, entityStore: entityStore, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, wrappingPatternProperties: wrappingPatternProperties, patternRootNodeIdsChain: patternRootNodeIdsChain }, index));
195
201
  })
196
202
  : null;
197
203
  if (isContainerOrSection(node.definitionId)) {
@@ -1 +1 @@
1
- {"version":3,"file":"CompositionBlock.js","sources":["../../../../src/blocks/preview/CompositionBlock.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react';\nimport type { UnresolvedLink } from 'contentful';\nimport { Entry } from 'contentful';\nimport {\n checkIsAssemblyEntry,\n checkIsAssemblyNode,\n EntityStore,\n resolveHyperlinkPattern,\n sanitizeNodeProps,\n transformBoundContentValue,\n} from '@contentful/experiences-core';\nimport {\n CONTENTFUL_COMPONENTS,\n HYPERLINK_DEFAULT_PATTERN,\n} from '@contentful/experiences-core/constants';\nimport type {\n ComponentTreeNode,\n DesignValue,\n Parameter,\n PrimitiveValue,\n ResolveDesignValueType,\n StyleProps,\n} from '@contentful/experiences-core/types';\nimport { createAssemblyRegistration, getComponentRegistration } from '../../core/componentRegistry';\nimport { useInjectStylesheet } from '../../hooks/useInjectStylesheet';\nimport {\n Assembly,\n Columns,\n ContentfulContainer,\n SingleColumn,\n} from '@contentful/experiences-components-react';\nimport { resolvePattern } from '../../core/preview/assemblyUtils';\nimport { resolveMaybePrebindingDefaultValuePath } from '../../utils/prebindingUtils';\nimport PreviewUnboundImage from './PreviewUnboundImage';\nimport { parseComponentProps } from '../../utils/parseComponentProps';\n\ntype CompositionBlockProps = {\n node: ComponentTreeNode;\n locale: string;\n entityStore: EntityStore;\n hyperlinkPattern?: string | undefined;\n resolveDesignValue: ResolveDesignValueType;\n getPatternChildNodeClassName?: (childNodeId: string) => string | undefined;\n /** Set of definition IDs of wrapping patterns to prevent circular dependencies. */\n wrappingPatternIds?: Set<string>;\n /**\n * Chained IDs to ensure uniqueness across multiple instances of the same pattern\n * when storing & accessing cfSsrClassName.\n */\n patternRootNodeIdsChain?: string;\n wrappingParameters?: Record<string, Parameter>;\n};\n\nexport const CompositionBlock = ({\n node: rawNode,\n locale,\n entityStore,\n hyperlinkPattern,\n resolveDesignValue,\n getPatternChildNodeClassName,\n wrappingPatternIds: parentWrappingPatternIds = new Set(),\n wrappingParameters: parentWrappingParameters = {},\n patternRootNodeIdsChain: parentPatternRootNodeIdsChain = '',\n}: CompositionBlockProps) => {\n const isPatternNode = useMemo(() => {\n return checkIsAssemblyNode({\n componentId: rawNode.definitionId,\n usedComponents: entityStore.usedComponents,\n });\n }, [entityStore.usedComponents, rawNode.definitionId]);\n\n const isPatternEntry = useMemo(() => {\n return checkIsAssemblyEntry({ fields: entityStore.experienceEntryFields } as unknown as Entry);\n }, [entityStore]);\n\n const patternRootNodeIdsChain = useMemo(() => {\n if (isPatternNode) {\n // Pattern nodes are chained without a separator (following the format for prebinding/parameters)\n return `${parentPatternRootNodeIdsChain}${rawNode.id}`;\n }\n return parentPatternRootNodeIdsChain;\n }, [isPatternNode, parentPatternRootNodeIdsChain, rawNode.id]);\n\n const node = useMemo(() => {\n if (isPatternNode) {\n return resolvePattern({\n node: rawNode,\n entityStore,\n parentParameters: parentWrappingParameters,\n patternRootNodeIdsChain,\n });\n } else {\n return rawNode;\n }\n }, [entityStore, isPatternNode, rawNode, parentWrappingParameters, patternRootNodeIdsChain]);\n\n const wrappingPatternIds = useMemo(() => {\n if (isPatternNode) {\n return new Set([node.definitionId, ...parentWrappingPatternIds]);\n }\n return parentWrappingPatternIds;\n }, [isPatternNode, node, parentWrappingPatternIds]);\n\n // Merge the pattern properties of the current node with the parent's pattern properties\n // to ensure nested patterns receive relevant pattern properties that were bubbled up\n // during assembly serialization.\n const wrappingParameters = useMemo(() => {\n if (isPatternNode) {\n return { ...parentWrappingParameters, ...(rawNode.parameters || {}) };\n }\n return parentWrappingParameters;\n }, [isPatternNode, rawNode, parentWrappingParameters]);\n\n const componentRegistration = useMemo(() => {\n const registration = getComponentRegistration(node.definitionId as string);\n\n if (isPatternNode && !registration) {\n return createAssemblyRegistration({\n definitionId: node.definitionId as string,\n component: Assembly,\n });\n }\n return registration;\n }, [isPatternNode, node.definitionId]);\n\n const { ssrProps, contentProps, props, mediaQuery } = useMemo(() => {\n // In SSR, we store the className under breakpoints[0] which is resolved here to the actual string\n const cfSsrClassNameValues = node.variables.cfSsrClassName as DesignValue | undefined;\n const mainBreakpoint = entityStore.breakpoints[0];\n const cfSsrClassName = cfSsrClassNameValues?.valuesByBreakpoint?.[mainBreakpoint.id] as\n | string\n | undefined;\n\n // Don't enrich the assembly wrapper node with props\n if (!componentRegistration || isPatternNode) {\n const ssrProps = { cfSsrClassName };\n const props: Record<string, PrimitiveValue> = { className: cfSsrClassName };\n return {\n ssrProps,\n props,\n customDesignProps: {},\n };\n }\n\n const ssrProps: Record<string, string | undefined> = {\n cfSsrClassName:\n node.id && getPatternChildNodeClassName\n ? getPatternChildNodeClassName(node.id)\n : cfSsrClassName,\n };\n\n const {\n contentProps = {},\n styleProps = {},\n customDesignProps = {},\n mediaQuery,\n } = parseComponentProps({\n breakpoints: entityStore.breakpoints,\n mainBreakpoint,\n componentDefinition: componentRegistration.definition,\n patternRootNodeIdsChain,\n node,\n resolveDesignValue,\n resolveBoundValue: ({ binding, propertyName, dataType }) => {\n const [, uuid] = binding.path.split('/');\n const boundEntityLink = entityStore.dataSource[uuid] as UnresolvedLink<'Entry' | 'Asset'>;\n return transformBoundContentValue(\n node.variables,\n entityStore,\n boundEntityLink,\n resolveDesignValue,\n propertyName,\n dataType,\n binding.path,\n );\n },\n resolveHyperlinkValue: ({ linkTargetKey }) => {\n const boundEntity = entityStore.dataSource[linkTargetKey];\n const hyperlinkEntry = entityStore.getEntryOrAsset(boundEntity, linkTargetKey);\n\n return resolveHyperlinkPattern(\n componentRegistration.definition.hyperlinkPattern ||\n hyperlinkPattern ||\n HYPERLINK_DEFAULT_PATTERN,\n hyperlinkEntry as Entry,\n locale,\n );\n },\n resolveUnboundValue: ({ mappingKey, defaultValue }) => {\n return entityStore.unboundValues[mappingKey]?.value ?? defaultValue;\n },\n resolvePrebindingValue: ({ mappingKey, propertyName, dataType, resolveBoundValue }) => {\n if (isPatternEntry) {\n const path = resolveMaybePrebindingDefaultValuePath({\n componentValueKey: mappingKey,\n entityStore,\n });\n\n if (path) {\n return resolveBoundValue({\n propertyName,\n dataType,\n binding: {\n type: 'BoundValue',\n path,\n },\n });\n }\n }\n },\n });\n\n const slotsProps: Record<string, ReactNode> = {};\n\n if (componentRegistration.definition.slots) {\n for (const slotId in componentRegistration.definition.slots) {\n const slotNode = node.children.find((child) => child.slotId === slotId);\n if (slotNode) {\n slotsProps[slotId] = (\n <CompositionBlock\n node={slotNode}\n locale={locale}\n hyperlinkPattern={hyperlinkPattern}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n wrappingPatternIds={wrappingPatternIds}\n wrappingParameters={wrappingParameters}\n patternRootNodeIdsChain={patternRootNodeIdsChain}\n />\n );\n }\n }\n }\n\n const props: Record<string, PrimitiveValue> = {\n className: ssrProps.cfSsrClassName ?? mediaQuery?.className,\n ...styleProps,\n ...contentProps,\n ...customDesignProps,\n ...slotsProps,\n };\n\n return {\n ssrProps,\n contentProps,\n slotsProps,\n styleProps,\n customDesignProps,\n mediaQuery,\n props,\n };\n }, [\n node,\n isPatternEntry,\n entityStore,\n componentRegistration,\n isPatternNode,\n getPatternChildNodeClassName,\n resolveDesignValue,\n hyperlinkPattern,\n locale,\n wrappingPatternIds,\n wrappingParameters,\n patternRootNodeIdsChain,\n ]);\n\n // do not inject the stylesheet into the dom because it's already been done on the server side\n useInjectStylesheet(ssrProps.cfSsrClassName ? undefined : mediaQuery?.css);\n\n if (!componentRegistration) {\n return null;\n }\n\n // When detecting a circular dependency, we stop silently. The editor mode will render an actionable error.\n if (parentWrappingPatternIds.has(node.definitionId)) {\n return null;\n }\n\n const { component } = componentRegistration;\n\n // Retrieves the CSS class name for a given child node ID.\n const _getPatternChildNodeClassName = (childNodeId: string) => {\n if (isPatternNode) {\n const nodeIdsChain = `${patternRootNodeIdsChain}-${childNodeId}`;\n // @ts-expect-error -- property cfSsrClassName is a map (id to classNames) that is added during rendering in ssrStyles\n const classesForNode: DesignValue | undefined = node.variables.cfSsrClassName?.[nodeIdsChain];\n if (!classesForNode) return undefined;\n return resolveDesignValue(classesForNode.valuesByBreakpoint) as string;\n }\n return getPatternChildNodeClassName?.(childNodeId);\n };\n\n const children =\n componentRegistration.definition.children === true\n ? node.children.map((childNode: ComponentTreeNode, index) => {\n return (\n <CompositionBlock\n getPatternChildNodeClassName={\n isPatternNode || getPatternChildNodeClassName\n ? _getPatternChildNodeClassName\n : undefined\n }\n node={childNode}\n key={index}\n locale={locale}\n hyperlinkPattern={hyperlinkPattern}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n wrappingPatternIds={wrappingPatternIds}\n wrappingParameters={wrappingParameters}\n patternRootNodeIdsChain={patternRootNodeIdsChain}\n />\n );\n })\n : null;\n\n if (isContainerOrSection(node.definitionId)) {\n return (\n <ContentfulContainer\n editorMode={false}\n cfHyperlink={(contentProps as StyleProps).cfHyperlink}\n cfOpenInNewTab={(contentProps as StyleProps).cfOpenInNewTab}\n className={props.className as string | undefined}>\n {children}\n </ContentfulContainer>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.columns.id) {\n return (\n <Columns editorMode={false} className={props.className as string | undefined}>\n {children}\n </Columns>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.singleColumn.id) {\n return (\n <SingleColumn editorMode={false} className={props.className as string | undefined}>\n {children}\n </SingleColumn>\n );\n }\n\n if (\n node.definitionId === CONTENTFUL_COMPONENTS.image.id &&\n node.variables.cfImageAsset?.type === 'UnboundValue'\n ) {\n return (\n <PreviewUnboundImage\n node={node}\n nodeProps={props}\n component={component}\n breakpoints={entityStore.breakpoints}\n patternRootNodeIdsChain={patternRootNodeIdsChain}\n />\n );\n }\n\n return React.createElement(\n component,\n sanitizeNodeProps(props),\n children ?? (typeof props.children === 'string' ? props.children : null),\n );\n};\n\nconst isContainerOrSection = (\n nodeDefinitionId: string,\n): nodeDefinitionId is 'contentful-container' | 'contentful-section' =>\n [CONTENTFUL_COMPONENTS.container.id, CONTENTFUL_COMPONENTS.section.id].includes(\n nodeDefinitionId as 'contentful-container' | 'contentful-section',\n );\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;AAqDa,MAAA,gBAAgB,GAAG,CAAC,EAC/B,IAAI,EAAE,OAAO,EACb,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAAE,wBAAwB,GAAG,IAAI,GAAG,EAAE,EACxD,kBAAkB,EAAE,wBAAwB,GAAG,EAAE,EACjD,uBAAuB,EAAE,6BAA6B,GAAG,EAAE,GACrC,KAAI;AAC1B,IAAA,MAAM,aAAa,GAAG,OAAO,CAAC,MAAK;AACjC,QAAA,OAAO,mBAAmB,CAAC;YACzB,WAAW,EAAE,OAAO,CAAC,YAAY;YACjC,cAAc,EAAE,WAAW,CAAC,cAAc;AAC3C,SAAA,CAAC,CAAC;KACJ,EAAE,CAAC,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;AAEvD,IAAA,MAAM,cAA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,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,KAAK,cAAc,EACpD;QACA,QACEA,GAAC,CAAA,mBAAmB,EAClB,EAAA,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,KAAK,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,uBAAuB,EAAE,uBAAuB,EAChD,CAAA,EACF;KACH;AAED,IAAA,OAAO,KAAK,CAAC,aAAa,CACxB,SAAS,EACT,iBAAiB,CAAC,KAAK,CAAC,EACxB,QAAQ,KAAK,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CACzE,CAAC;AACJ,EAAE;AAEF,MAAM,oBAAoB,GAAG,CAC3B,gBAAwB,KAExB,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,EAAE,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAC7E,gBAAiE,CAClE;;;;"}
1
+ {"version":3,"file":"CompositionBlock.js","sources":["../../../../src/blocks/preview/CompositionBlock.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react';\nimport type { UnresolvedLink } from 'contentful';\nimport { Entry } from 'contentful';\nimport {\n checkIsAssemblyEntry,\n checkIsAssemblyNode,\n EntityStore,\n resolveHyperlinkPattern,\n sanitizeNodeProps,\n transformBoundContentValue,\n} from '@contentful/experiences-core';\nimport {\n CONTENTFUL_COMPONENTS,\n HYPERLINK_DEFAULT_PATTERN,\n} from '@contentful/experiences-core/constants';\nimport type {\n ComponentTreeNode,\n DesignValue,\n PatternProperty,\n PrimitiveValue,\n ResolveDesignValueType,\n StyleProps,\n} from '@contentful/experiences-core/types';\nimport { createAssemblyRegistration, getComponentRegistration } from '../../core/componentRegistry';\nimport { useInjectStylesheet } from '../../hooks/useInjectStylesheet';\nimport {\n Assembly,\n Columns,\n ContentfulContainer,\n SingleColumn,\n} from '@contentful/experiences-components-react';\nimport { resolvePattern } from '../../core/preview/assemblyUtils';\nimport { resolveMaybePrebindingDefaultValuePath } from '../../utils/prebindingUtils';\nimport PreviewUnboundImage from './PreviewUnboundImage';\nimport { parseComponentProps } from '../../utils/parseComponentProps';\n\ntype CompositionBlockProps = {\n node: ComponentTreeNode;\n locale: string;\n entityStore: EntityStore;\n hyperlinkPattern?: string | undefined;\n resolveDesignValue: ResolveDesignValueType;\n getPatternChildNodeClassName?: (childNodeId: string) => string | undefined;\n /** Set of definition IDs of wrapping patterns to prevent circular dependencies. */\n wrappingPatternIds?: Set<string>;\n /**\n * Chained IDs to ensure uniqueness across multiple instances of the same pattern\n * when storing & accessing cfSsrClassName.\n */\n patternRootNodeIdsChain?: string;\n wrappingPatternProperties?: Record<string, PatternProperty>;\n};\n\nexport const CompositionBlock = ({\n node: rawNode,\n locale,\n entityStore,\n hyperlinkPattern,\n resolveDesignValue,\n getPatternChildNodeClassName,\n wrappingPatternIds: parentWrappingPatternIds = new Set(),\n wrappingPatternProperties: parentWrappingPatternProperties = {},\n patternRootNodeIdsChain: parentPatternRootNodeIdsChain = '',\n}: CompositionBlockProps) => {\n const isPatternNode = useMemo(() => {\n return checkIsAssemblyNode({\n componentId: rawNode.definitionId,\n usedComponents: entityStore.usedComponents,\n });\n }, [entityStore.usedComponents, rawNode.definitionId]);\n\n const isPatternEntry = useMemo(() => {\n return checkIsAssemblyEntry({ fields: entityStore.experienceEntryFields } as unknown as Entry);\n }, [entityStore]);\n\n const patternRootNodeIdsChain = useMemo(() => {\n if (isPatternNode) {\n // Pattern nodes are chained without a separator (following the format for prebinding/parameters)\n return `${parentPatternRootNodeIdsChain}${rawNode.id}`;\n }\n return parentPatternRootNodeIdsChain;\n }, [isPatternNode, parentPatternRootNodeIdsChain, rawNode.id]);\n\n const node = useMemo(() => {\n if (isPatternNode) {\n return resolvePattern({\n node: rawNode,\n entityStore,\n parentPatternProperties: parentWrappingPatternProperties,\n patternRootNodeIdsChain,\n });\n } else {\n return rawNode;\n }\n }, [\n entityStore,\n isPatternNode,\n rawNode,\n parentWrappingPatternProperties,\n patternRootNodeIdsChain,\n ]);\n\n const wrappingPatternIds = useMemo(() => {\n if (isPatternNode) {\n return new Set([node.definitionId, ...parentWrappingPatternIds]);\n }\n return parentWrappingPatternIds;\n }, [isPatternNode, node, parentWrappingPatternIds]);\n\n // Merge the pattern properties of the current node with the parent's pattern properties\n // to ensure nested patterns receive relevant pattern properties that were bubbled up\n // during assembly serialization.\n const wrappingPatternProperties = useMemo(() => {\n if (isPatternNode) {\n return { ...parentWrappingPatternProperties, ...(rawNode.parameters || {}) };\n }\n return parentWrappingPatternProperties;\n }, [isPatternNode, rawNode, parentWrappingPatternProperties]);\n\n const componentRegistration = useMemo(() => {\n const registration = getComponentRegistration(node.definitionId as string);\n\n if (isPatternNode && !registration) {\n return createAssemblyRegistration({\n definitionId: node.definitionId as string,\n component: Assembly,\n });\n }\n return registration;\n }, [isPatternNode, node.definitionId]);\n\n const { ssrProps, contentProps, props, mediaQuery } = useMemo(() => {\n // In SSR, we store the className under breakpoints[0] which is resolved here to the actual string\n const cfSsrClassNameValues = node.variables.cfSsrClassName as DesignValue | undefined;\n const mainBreakpoint = entityStore.breakpoints[0];\n const cfSsrClassName = cfSsrClassNameValues?.valuesByBreakpoint?.[mainBreakpoint.id] as\n | string\n | undefined;\n\n // Don't enrich the assembly wrapper node with props\n if (!componentRegistration || isPatternNode) {\n const ssrProps = { cfSsrClassName };\n const props: Record<string, PrimitiveValue> = { className: cfSsrClassName };\n return {\n ssrProps,\n props,\n customDesignProps: {},\n };\n }\n\n const ssrProps: Record<string, string | undefined> = {\n cfSsrClassName:\n node.id && getPatternChildNodeClassName\n ? getPatternChildNodeClassName(node.id)\n : cfSsrClassName,\n };\n\n const {\n contentProps = {},\n styleProps = {},\n customDesignProps = {},\n mediaQuery,\n } = parseComponentProps({\n breakpoints: entityStore.breakpoints,\n mainBreakpoint,\n componentDefinition: componentRegistration.definition,\n patternRootNodeIdsChain,\n node,\n resolveDesignValue,\n resolveBoundValue: ({ binding, propertyName, dataType }) => {\n const [, uuid] = binding.path.split('/');\n const boundEntityLink = entityStore.dataSource[uuid] as UnresolvedLink<'Entry' | 'Asset'>;\n return transformBoundContentValue(\n node.variables,\n entityStore,\n boundEntityLink,\n resolveDesignValue,\n propertyName,\n dataType,\n binding.path,\n );\n },\n resolveHyperlinkValue: ({ linkTargetKey }) => {\n const boundEntity = entityStore.dataSource[linkTargetKey];\n const hyperlinkEntry = entityStore.getEntryOrAsset(boundEntity, linkTargetKey);\n\n return resolveHyperlinkPattern(\n componentRegistration.definition.hyperlinkPattern ||\n hyperlinkPattern ||\n HYPERLINK_DEFAULT_PATTERN,\n hyperlinkEntry as Entry,\n locale,\n );\n },\n resolveUnboundValue: ({ mappingKey, defaultValue }) => {\n return entityStore.unboundValues[mappingKey]?.value ?? defaultValue;\n },\n resolvePrebindingValue: ({ mappingKey, propertyName, dataType, resolveBoundValue }) => {\n if (isPatternEntry) {\n const path = resolveMaybePrebindingDefaultValuePath({\n componentValueKey: mappingKey,\n entityStore,\n });\n\n if (path) {\n return resolveBoundValue({\n propertyName,\n dataType,\n binding: {\n type: 'BoundValue',\n path,\n },\n });\n }\n }\n },\n });\n\n const slotsProps: Record<string, ReactNode> = {};\n\n if (componentRegistration.definition.slots) {\n for (const slotId in componentRegistration.definition.slots) {\n const slotNode = node.children.find((child) => child.slotId === slotId);\n if (slotNode) {\n slotsProps[slotId] = (\n <CompositionBlock\n node={slotNode}\n locale={locale}\n hyperlinkPattern={hyperlinkPattern}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n wrappingPatternIds={wrappingPatternIds}\n wrappingPatternProperties={wrappingPatternProperties}\n patternRootNodeIdsChain={patternRootNodeIdsChain}\n />\n );\n }\n }\n }\n\n const props: Record<string, PrimitiveValue> = {\n className: ssrProps.cfSsrClassName ?? mediaQuery?.className,\n ...styleProps,\n ...contentProps,\n ...customDesignProps,\n ...slotsProps,\n };\n\n return {\n ssrProps,\n contentProps,\n slotsProps,\n styleProps,\n customDesignProps,\n mediaQuery,\n props,\n };\n }, [\n node,\n isPatternEntry,\n entityStore,\n componentRegistration,\n isPatternNode,\n getPatternChildNodeClassName,\n resolveDesignValue,\n hyperlinkPattern,\n locale,\n wrappingPatternIds,\n wrappingPatternProperties,\n patternRootNodeIdsChain,\n ]);\n\n // do not inject the stylesheet into the dom because it's already been done on the server side\n useInjectStylesheet(ssrProps.cfSsrClassName ? undefined : mediaQuery?.css);\n\n if (!componentRegistration) {\n return null;\n }\n\n // When detecting a circular dependency, we stop silently. The editor mode will render an actionable error.\n if (parentWrappingPatternIds.has(node.definitionId)) {\n return null;\n }\n\n const { component } = componentRegistration;\n\n // Retrieves the CSS class name for a given child node ID.\n const _getPatternChildNodeClassName = (childNodeId: string) => {\n if (isPatternNode) {\n const nodeIdsChain = `${patternRootNodeIdsChain}-${childNodeId}`;\n // @ts-expect-error -- property cfSsrClassName is a map (id to classNames) that is added during rendering in ssrStyles\n const classesForNode: DesignValue | undefined = node.variables.cfSsrClassName?.[nodeIdsChain];\n if (!classesForNode) return undefined;\n return resolveDesignValue(classesForNode.valuesByBreakpoint) as string;\n }\n return getPatternChildNodeClassName?.(childNodeId);\n };\n\n const children =\n componentRegistration.definition.children === true\n ? node.children.map((childNode: ComponentTreeNode, index) => {\n return (\n <CompositionBlock\n getPatternChildNodeClassName={\n isPatternNode || getPatternChildNodeClassName\n ? _getPatternChildNodeClassName\n : undefined\n }\n node={childNode}\n key={index}\n locale={locale}\n hyperlinkPattern={hyperlinkPattern}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n wrappingPatternIds={wrappingPatternIds}\n wrappingPatternProperties={wrappingPatternProperties}\n patternRootNodeIdsChain={patternRootNodeIdsChain}\n />\n );\n })\n : null;\n\n if (isContainerOrSection(node.definitionId)) {\n return (\n <ContentfulContainer\n editorMode={false}\n cfHyperlink={(contentProps as StyleProps).cfHyperlink}\n cfOpenInNewTab={(contentProps as StyleProps).cfOpenInNewTab}\n className={props.className as string | undefined}>\n {children}\n </ContentfulContainer>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.columns.id) {\n return (\n <Columns editorMode={false} className={props.className as string | undefined}>\n {children}\n </Columns>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.singleColumn.id) {\n return (\n <SingleColumn editorMode={false} className={props.className as string | undefined}>\n {children}\n </SingleColumn>\n );\n }\n\n if (\n node.definitionId === CONTENTFUL_COMPONENTS.image.id &&\n node.variables.cfImageAsset?.type === 'UnboundValue'\n ) {\n return (\n <PreviewUnboundImage\n node={node}\n nodeProps={props}\n component={component}\n breakpoints={entityStore.breakpoints}\n patternRootNodeIdsChain={patternRootNodeIdsChain}\n />\n );\n }\n\n return React.createElement(\n component,\n sanitizeNodeProps(props),\n children ?? (typeof props.children === 'string' ? props.children : null),\n );\n};\n\nconst isContainerOrSection = (\n nodeDefinitionId: string,\n): nodeDefinitionId is 'contentful-container' | 'contentful-section' =>\n [CONTENTFUL_COMPONENTS.container.id, CONTENTFUL_COMPONENTS.section.id].includes(\n nodeDefinitionId as 'contentful-container' | 'contentful-section',\n );\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;AAqDa,MAAA,gBAAgB,GAAG,CAAC,EAC/B,IAAI,EAAE,OAAO,EACb,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAAE,wBAAwB,GAAG,IAAI,GAAG,EAAE,EACxD,yBAAyB,EAAE,+BAA+B,GAAG,EAAE,EAC/D,uBAAuB,EAAE,6BAA6B,GAAG,EAAE,GACrC,KAAI;AAC1B,IAAA,MAAM,aAAa,GAAG,OAAO,CAAC,MAAK;AACjC,QAAA,OAAO,mBAAmB,CAAC;YACzB,WAAW,EAAE,OAAO,CAAC,YAAY;YACjC,cAAc,EAAE,WAAW,CAAC,cAAc;AAC3C,SAAA,CAAC,CAAC;KACJ,EAAE,CAAC,WAAW,CAA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KACH;IAED,IACE,IAAI,CAAC,YAAY,KAAK,qBAAqB,CAAC,KAAK,CAAC,EAAE;QACpD,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,KAAK,cAAc,EACpD;QACA,QACEA,GAAC,CAAA,mBAAmB,EAClB,EAAA,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,KAAK,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,uBAAuB,EAAE,uBAAuB,EAChD,CAAA,EACF;KACH;AAED,IAAA,OAAO,KAAK,CAAC,aAAa,CACxB,SAAS,EACT,iBAAiB,CAAC,KAAK,CAAC,EACxB,QAAQ,KAAK,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CACzE,CAAC;AACJ,EAAE;AAEF,MAAM,oBAAoB,GAAG,CAC3B,gBAAwB,KAExB,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,EAAE,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAC7E,gBAAiE,CAClE;;;;"}
@@ -1,26 +1,9 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import React from 'react';
3
3
  import { sendMessage } from '@contentful/experiences-core';
4
+ import '../styles/ErrorBoundary.css.js';
4
5
  import { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';
5
6
 
6
- const styles = {
7
- errorMessage: {
8
- margin: '24px',
9
- fontSize: 'var(--exp-builder-font-size-m)',
10
- fontFamily: 'var(--exp-builder-font-stack-primary)',
11
- color: 'var(--exp-builder-red800)',
12
- padding: '16px',
13
- backgroundColor: 'var(--exp-builder-red200)',
14
- },
15
- title: {
16
- marginTop: 0,
17
- fontSize: 'var(--exp-builder-font-size-l)',
18
- },
19
- moreDetails: {
20
- cursor: 'pointer',
21
- color: 'var(--exp-builder-blue700)',
22
- },
23
- };
24
7
  class ErrorBoundary extends React.Component {
25
8
  constructor(props) {
26
9
  super(props);
@@ -40,7 +23,7 @@ class ErrorBoundary extends React.Component {
40
23
  }
41
24
  render() {
42
25
  if (this.state.hasError) {
43
- return (jsxs("div", { style: styles.errorMessage, children: [jsx("h2", { style: styles.title, children: `Something went wrong while rendering the experience` }), jsxs("div", { children: ["The Experience Builder SDK has encountered an error. It may be that the SDK has not been set up properly or an imported component has thrown this error. Try to refresh the page and find more guidance in our", ' ', jsx("a", { href: "https://www.contentful.com/developers/docs/tutorials/general/experience-builder/", rel: "noreferrer", target: "_blank", children: "documentation" }), "."] }), jsx("br", {}), jsxs("span", { style: styles.moreDetails, onClick: () => this.setState((prevState) => ({
26
+ return (jsxs("div", { className: "cf-error-message", children: [jsx("h2", { className: "title", children: `Something went wrong while rendering the experience` }), jsxs("div", { children: ["The Experience Builder SDK has encountered an error. It may be that the SDK has not been set up properly or an imported component has thrown this error. Try to refresh the page and find more guidance in our", ' ', jsx("a", { href: "https://www.contentful.com/developers/docs/tutorials/general/experience-builder/", rel: "noreferrer", target: "_blank", children: "documentation" }), "."] }), jsx("br", {}), jsxs("span", { className: "more-details", onClick: () => this.setState((prevState) => ({
44
27
  showErrorDetails: !prevState.showErrorDetails,
45
28
  })), children: [this.state.showErrorDetails ? 'Hide' : 'See', " details"] }), this.state.showErrorDetails && (jsx("code", { children: this.state.error?.stack?.split('\n').map((i, key) => {
46
29
  return jsx("div", { children: i }, key);
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sources":["../../../src/components/ErrorBoundary.tsx"],"sourcesContent":["import React, { ErrorInfo, ReactElement } from 'react';\nimport { sendMessage } from '@contentful/experiences-core';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\n('use client');\n\nconst styles = {\n errorMessage: {\n margin: '24px',\n fontSize: 'var(--exp-builder-font-size-m)',\n fontFamily: 'var(--exp-builder-font-stack-primary)',\n color: 'var(--exp-builder-red800)',\n padding: '16px',\n backgroundColor: 'var(--exp-builder-red200)',\n },\n title: {\n marginTop: 0,\n fontSize: 'var(--exp-builder-font-size-l)',\n },\n moreDetails: {\n cursor: 'pointer',\n color: 'var(--exp-builder-blue700)',\n },\n};\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.name !== '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 style={styles.errorMessage}>\n <h2 style={styles.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 style={styles.moreDetails}\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"],"names":["_jsxs","_jsx"],"mappings":";;;;;AAMA,MAAM,MAAM,GAAG;AACb,IAAA,YAAY,EAAE;AACZ,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,QAAQ,EAAE,gCAAgC;AAC1C,QAAA,UAAU,EAAE,uCAAuC;AACnD,QAAA,KAAK,EAAE,2BAA2B;AAClC,QAAA,OAAO,EAA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AA,QAAA,EAAA,CAAA,gNAAA,EAGgC,GAAG,EACjCC,GACE,CAAA,GAAA,EAAA,EAAA,IAAI,EAAC,kFAAkF,EACvF,GAAG,EAAC,YAAY,EAChB,MAAM,EAAC,QAAQ,EAEb,QAAA,EAAA,eAAA,EAAA,CAAA,EAAA,GAAA,CAAA,EAAA,CAEA,EACNA,GAAA,CAAA,IAAA,EAAA,EAAA,CAAM,EACND,IAAA,CAAA,MAAA,EAAA,EACE,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,OAAO,EAAE,MACP,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,MAAM;AAC5B,4BAAA,gBAAgB,EAAE,CAAC,SAAS,CAAC,gBAAgB;yBAC9C,CAAC,CAAC,aAEJ,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,MAAM,GAAG,KAAK,EAAA,UAAA,CAAA,EAAA,CACxC,EACN,IAAI,CAAC,KAAK,CAAC,gBAAgB,KAC1BC,GAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EACG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAI;AACnD,4BAAA,OAAOA,GAAgB,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,CAAC,EAAP,EAAA,GAAG,CAAW,CAAC;AAClC,yBAAC,CAAC,EAAA,CACG,CACR,CAAA,EAAA,CACG,EACN;SACH;AACD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;KAC5B;AACF;;;;"}
1
+ {"version":3,"file":"ErrorBoundary.js","sources":["../../../src/components/ErrorBoundary.tsx"],"sourcesContent":["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\n('use client');\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.name !== '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"],"names":["_jsxs","_jsx"],"mappings":";;;;;;AAOa,MAAA,aAAc,SAAQ,KAAK,CAAC,SAGxC,CAAA;AACC,IAAA,WAAA,CAAY,KAAiC,EAAA;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC;KACzF;AAED,IAAA,OAAO,wBAAwB,GAAA;AAC7B,QAAA,OAAO,EAAE,QAAQ,EAAE,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AK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAI;AACnD,4BAAA,OAAOA,GAAgB,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,CAAC,EAAP,EAAA,GAAG,CAAW,CAAC;AAClC,yBAAC,CAAC,EAAA,CACG,CACR,CAAA,EAAA,CACG,EACN;SACH;AACD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;KAC5B;AACF;;;;"}
@@ -5,7 +5,6 @@ import { builtInStyles, optionalBuiltInStyles, sendMessage, breakpointsRegistry,
5
5
  import { validateComponentDefinition } from '@contentful/experiences-validators';
6
6
  import { withComponentWrapper } from '../utils/withComponentWrapper.js';
7
7
  import { SDK_VERSION } from '../sdkVersion.js';
8
- import '@contentful/experiences-components-react/dist/index.css';
9
8
 
10
9
  const CssVarRegex = /var\(--[\w-]+\)/;
11
10
  const cloneObject = (targetObject) => {
@@ -1 +1 @@
1
- {"version":3,"file":"componentRegistry.js","sources":["../../../src/core/componentRegistry.ts"],"sourcesContent":["import * as Components from '@contentful/experiences-components-react';\nimport type {\n ComponentRegistration,\n ComponentDefinition,\n ComponentRegistrationOptions,\n DesignTokensDefinition,\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 breakpointsRegistry,\n optionalBuiltInStyles,\n sendMessage,\n} from '@contentful/experiences-core';\nimport { validateComponentDefinition } from '@contentful/experiences-validators';\nimport { withComponentWrapper } from '../utils/withComponentWrapper';\nimport { SDK_VERSION } from '../constants';\nimport {\n sectionDefinition,\n containerDefinition,\n columnsDefinition,\n singleColumnDefinition,\n dividerDefinition,\n} from '@contentful/experiences-components-react';\n\nimport '@contentful/experiences-components-react/dist/index.css';\n\nconst CssVarRegex = /var\\(--[\\w-]+\\)/;\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 (componentDefinition.id === CONTENTFUL_COMPONENTS.container.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 if (!clone.variables) {\n clone.variables = {};\n }\n\n // Enforce the presence of this property for toggling visibility on any node\n clone.variables['cfVisibility'] = builtInStyleDefinitions['cfVisibility'];\n\n for (const style of clone.builtInStyles || []) {\n if (builtInStyleDefinitions[style]) {\n clone.variables[style] = builtInStyleDefinitions[style] as any; // TODO: fix type\n }\n if (optionalBuiltInStyles[style]) {\n clone.variables[style] = optionalBuiltInStyles[style] as any; // TODO: fix type\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 options,\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 options: { wrapComponent: false },\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 divider: {\n // Don't wrap this component `withComponentWrapper`. Need to explicitly ignore dragProps\n component: Components.ContentfulDivider,\n definition: dividerDefinition,\n options: {\n wrapComponent: false,\n },\n },\n carousel: enrichComponentDefinition({\n component: Components.Carousel,\n definition: Components.carouselDefinition,\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 [DEFAULT_COMPONENT_REGISTRATIONS.divider.definition.id, DEFAULT_COMPONENT_REGISTRATIONS.divider],\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 DEFAULT_COMPONENT_REGISTRATIONS.divider.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 .map(({ definition }) => definition)\n // Pattern definitions are empty placeholder within the SDK without variables\n // We don't send those to the editor as they would overwrite the actual correct definitions.\n .filter((definition) => definition.category !== ASSEMBLY_DEFAULT_CATEGORY);\n\n sendMessage(OUTGOING_EVENTS.RegisteredComponents, {\n definitions: registeredDefinitions,\n });\n};\n\nexport const runRegisteredComponentValidations = () => {\n Array.from(componentRegistry.values()).map(({ definition }) => {\n const validation = validateComponentDefinition(definition);\n if (!validation.success) {\n throw new Error(\n `Invalid component definition for component '${definition.name}'. Failed with errors: \\n${JSON.stringify(validation.errors, null, 2)}`,\n );\n }\n });\n};\n\nconst getSingleCssVariableValue = (\n element: HTMLDivElement,\n cssVariableValue: string,\n cssAttribute: any,\n) => {\n element.style[cssAttribute] = cssVariableValue;\n const styles = getComputedStyle(element);\n const resolvedValue = styles.getPropertyValue(cssAttribute);\n return resolvedValue;\n};\n\nconst getAllCssVariableValues = (\n element: HTMLDivElement,\n cssVariable: Record<string, string>,\n cssAttribute: any,\n) => {\n const resolvedCssVariables = {} as Record<string, string>;\n\n Object.keys(cssVariable).forEach((key) => {\n const cssVariableValue = cssVariable[key];\n if (CssVarRegex.test(cssVariableValue)) {\n const resolvedValue = getSingleCssVariableValue(element, cssVariableValue, cssAttribute);\n resolvedCssVariables[cssVariableValue] = resolvedValue;\n }\n });\n return resolvedCssVariables;\n};\n\ntype CssMapType = {\n variable?: Record<string, string>;\n property: string;\n};\n\nconst resolveCssVariables = (designTokensDefinition: DesignTokensDefinition) => {\n const {\n spacing,\n sizing,\n color,\n borderRadius,\n fontSize,\n lineHeight,\n letterSpacing,\n textColor,\n border,\n } = designTokensDefinition;\n const resolvedCssVariables = {} as Record<string, string>;\n\n // Create an element\n const element = document.createElement('div');\n document.body.appendChild(element);\n\n const cssProperties: CssMapType[] = [\n { variable: spacing, property: 'margin' },\n { variable: sizing, property: 'width' },\n { variable: color, property: 'background-color' },\n { variable: borderRadius, property: 'border-radius' },\n { variable: fontSize, property: 'font-size' },\n { variable: lineHeight, property: 'line-height' },\n { variable: letterSpacing, property: 'letter-spacing' },\n { variable: textColor, property: 'color' },\n ];\n\n cssProperties.forEach(({ variable, property }) => {\n if (variable) {\n const rawResolvedValues = getAllCssVariableValues(element, variable, property);\n Object.assign(resolvedCssVariables, rawResolvedValues);\n }\n });\n\n if (border) {\n const tempResolvedValue = {} as Record<string, string>;\n Object.keys(border).forEach((borderKey) => {\n const { width, style, color } = border[borderKey];\n\n if (width && CssVarRegex.test(width)) {\n const resolvedValue = getSingleCssVariableValue(element, width, 'border-width');\n tempResolvedValue[width] = resolvedValue;\n }\n if (style && CssVarRegex.test(style)) {\n const resolvedValue = getSingleCssVariableValue(element, style, 'border-style');\n tempResolvedValue[style] = resolvedValue;\n }\n if (color && CssVarRegex.test(color)) {\n const resolvedValue = getSingleCssVariableValue(element, color, 'border-color');\n tempResolvedValue[color] = resolvedValue;\n }\n Object.assign(resolvedCssVariables, tempResolvedValue);\n });\n }\n\n document.body.removeChild(element);\n return resolvedCssVariables;\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.RegisteredBreakpoints, {\n breakpoints: breakpointsRegistry,\n });\n\n sendMessage(OUTGOING_EVENTS.DesignTokens, {\n designTokens: designTokensRegistry,\n resolvedCssVariables: resolveCssVariables(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?.experimentalComponents?.carousel) {\n componentRegistry.set(\n CONTENTFUL_COMPONENTS.carousel.id,\n DEFAULT_COMPONENT_REGISTRATIONS.carousel,\n );\n }\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\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: {},\n children: true,\n category: ASSEMBLY_DEFAULT_CATEGORY,\n };\n\n addComponentRegistration({ component, definition });\n\n return componentRegistry.get(definitionId);\n};\n\n/**\n * @deprecated This method is used to maintain the basic component ids (without the prefix 'contentful-') in order to be compatible\n * with experiences created with an older alpha version of the SDK. Components in these experiences should be migrated to use\n * the components with the 'contentful-' prefix. To do so, load the experience in the editor, and replace any older basic components\n * (marked with [OLD] in the UI) with the new components (without the [OLD]). This method (and functionality for the older components)\n * will be removed in the next major release.\n */\nexport const maintainBasicComponentIdsWithoutPrefix = () => {\n optionalBuiltInComponents.forEach((id) => {\n if (componentRegistry.has(id) && id.startsWith('contentful-')) {\n const registeredComponent = componentRegistry.get(id)!;\n const definition = registeredComponent.definition;\n const newDefinition = cloneObject(definition);\n newDefinition.name = newDefinition.name + '[OLD]';\n const newId = id.replace('contentful-', '');\n newDefinition.id = newId;\n const newRegisteredComponent = { ...registeredComponent, definition: newDefinition };\n componentRegistry.set(newId, newRegisteredComponent);\n }\n });\n};\n"],"names":["builtInStyleDefinitions"],"mappings":";;;;;;;;;AAiCA,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC,MAAM,WAAW,GAAG,CAAI,YAAe,KAAO;AAC5C,IAAA,IAAI,OAAO,eAAe,KAAK,WAAW,EAAE;AAC1C,QAAA,OAAO,eAAe,CAAC,YAAY,CAAC,CAAC;KACtC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,iCAAiC,GAAG,CAAC,mBAAwC,KAAI;AACrF,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAC/C,IAAA,KAAK,MAAM,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C,EAAE,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE;YAC7D,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC;AACvD,YAAA,MAAM,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC;AAClD,YAAA,MAAM,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;YAC9C,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,OAAO,CAAC;YAClD,MAAM,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AAC5C,YAAA,aAAa,CAAC,EAAE,GAAG,KAAK,CAAC;YACzB,MAAM,sBAAsB,GAAG,EAAE,GAAG,mBAAmB,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AACrF,YAAA,iBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;SACtD;AACH,KAAC,CAAC,CAAC;AACL;;;;"}
1
+ {"version":3,"file":"componentRegistry.js","sources":["../../../src/core/componentRegistry.ts"],"sourcesContent":["import * as Components from '@contentful/experiences-components-react';\nimport type {\n ComponentRegistration,\n ComponentDefinition,\n ComponentRegistrationOptions,\n DesignTokensDefinition,\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 breakpointsRegistry,\n optionalBuiltInStyles,\n sendMessage,\n} from '@contentful/experiences-core';\nimport { validateComponentDefinition } from '@contentful/experiences-validators';\nimport { withComponentWrapper } from '../utils/withComponentWrapper';\nimport { SDK_VERSION } from '../constants';\nimport {\n sectionDefinition,\n containerDefinition,\n columnsDefinition,\n singleColumnDefinition,\n dividerDefinition,\n} from '@contentful/experiences-components-react';\n\nconst CssVarRegex = /var\\(--[\\w-]+\\)/;\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 (componentDefinition.id === CONTENTFUL_COMPONENTS.container.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 if (!clone.variables) {\n clone.variables = {};\n }\n\n // Enforce the presence of this property for toggling visibility on any node\n clone.variables['cfVisibility'] = builtInStyleDefinitions['cfVisibility'];\n\n for (const style of clone.builtInStyles || []) {\n if (builtInStyleDefinitions[style]) {\n clone.variables[style] = builtInStyleDefinitions[style] as any; // TODO: fix type\n }\n if (optionalBuiltInStyles[style]) {\n clone.variables[style] = optionalBuiltInStyles[style] as any; // TODO: fix type\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 options,\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 options: { wrapComponent: false },\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 divider: {\n // Don't wrap this component `withComponentWrapper`. Need to explicitly ignore dragProps\n component: Components.ContentfulDivider,\n definition: dividerDefinition,\n options: {\n wrapComponent: false,\n },\n },\n carousel: enrichComponentDefinition({\n component: Components.Carousel,\n definition: Components.carouselDefinition,\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 [DEFAULT_COMPONENT_REGISTRATIONS.divider.definition.id, DEFAULT_COMPONENT_REGISTRATIONS.divider],\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 DEFAULT_COMPONENT_REGISTRATIONS.divider.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 .map(({ definition }) => definition)\n // Pattern definitions are empty placeholder within the SDK without variables\n // We don't send those to the editor as they would overwrite the actual correct definitions.\n .filter((definition) => definition.category !== ASSEMBLY_DEFAULT_CATEGORY);\n\n sendMessage(OUTGOING_EVENTS.RegisteredComponents, {\n definitions: registeredDefinitions,\n });\n};\n\nexport const runRegisteredComponentValidations = () => {\n Array.from(componentRegistry.values()).map(({ definition }) => {\n const validation = validateComponentDefinition(definition);\n if (!validation.success) {\n throw new Error(\n `Invalid component definition for component '${definition.name}'. Failed with errors: \\n${JSON.stringify(validation.errors, null, 2)}`,\n );\n }\n });\n};\n\nconst getSingleCssVariableValue = (\n element: HTMLDivElement,\n cssVariableValue: string,\n cssAttribute: any,\n) => {\n element.style[cssAttribute] = cssVariableValue;\n const styles = getComputedStyle(element);\n const resolvedValue = styles.getPropertyValue(cssAttribute);\n return resolvedValue;\n};\n\nconst getAllCssVariableValues = (\n element: HTMLDivElement,\n cssVariable: Record<string, string>,\n cssAttribute: any,\n) => {\n const resolvedCssVariables = {} as Record<string, string>;\n\n Object.keys(cssVariable).forEach((key) => {\n const cssVariableValue = cssVariable[key];\n if (CssVarRegex.test(cssVariableValue)) {\n const resolvedValue = getSingleCssVariableValue(element, cssVariableValue, cssAttribute);\n resolvedCssVariables[cssVariableValue] = resolvedValue;\n }\n });\n return resolvedCssVariables;\n};\n\ntype CssMapType = {\n variable?: Record<string, string>;\n property: string;\n};\n\nconst resolveCssVariables = (designTokensDefinition: DesignTokensDefinition) => {\n const {\n spacing,\n sizing,\n color,\n borderRadius,\n fontSize,\n lineHeight,\n letterSpacing,\n textColor,\n border,\n } = designTokensDefinition;\n const resolvedCssVariables = {} as Record<string, string>;\n\n // Create an element\n const element = document.createElement('div');\n document.body.appendChild(element);\n\n const cssProperties: CssMapType[] = [\n { variable: spacing, property: 'margin' },\n { variable: sizing, property: 'width' },\n { variable: color, property: 'background-color' },\n { variable: borderRadius, property: 'border-radius' },\n { variable: fontSize, property: 'font-size' },\n { variable: lineHeight, property: 'line-height' },\n { variable: letterSpacing, property: 'letter-spacing' },\n { variable: textColor, property: 'color' },\n ];\n\n cssProperties.forEach(({ variable, property }) => {\n if (variable) {\n const rawResolvedValues = getAllCssVariableValues(element, variable, property);\n Object.assign(resolvedCssVariables, rawResolvedValues);\n }\n });\n\n if (border) {\n const tempResolvedValue = {} as Record<string, string>;\n Object.keys(border).forEach((borderKey) => {\n const { width, style, color } = border[borderKey];\n\n if (width && CssVarRegex.test(width)) {\n const resolvedValue = getSingleCssVariableValue(element, width, 'border-width');\n tempResolvedValue[width] = resolvedValue;\n }\n if (style && CssVarRegex.test(style)) {\n const resolvedValue = getSingleCssVariableValue(element, style, 'border-style');\n tempResolvedValue[style] = resolvedValue;\n }\n if (color && CssVarRegex.test(color)) {\n const resolvedValue = getSingleCssVariableValue(element, color, 'border-color');\n tempResolvedValue[color] = resolvedValue;\n }\n Object.assign(resolvedCssVariables, tempResolvedValue);\n });\n }\n\n document.body.removeChild(element);\n return resolvedCssVariables;\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.RegisteredBreakpoints, {\n breakpoints: breakpointsRegistry,\n });\n\n sendMessage(OUTGOING_EVENTS.DesignTokens, {\n designTokens: designTokensRegistry,\n resolvedCssVariables: resolveCssVariables(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?.experimentalComponents?.carousel) {\n componentRegistry.set(\n CONTENTFUL_COMPONENTS.carousel.id,\n DEFAULT_COMPONENT_REGISTRATIONS.carousel,\n );\n }\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\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: {},\n children: true,\n category: ASSEMBLY_DEFAULT_CATEGORY,\n };\n\n addComponentRegistration({ component, definition });\n\n return componentRegistry.get(definitionId);\n};\n\n/**\n * @deprecated This method is used to maintain the basic component ids (without the prefix 'contentful-') in order to be compatible\n * with experiences created with an older alpha version of the SDK. Components in these experiences should be migrated to use\n * the components with the 'contentful-' prefix. To do so, load the experience in the editor, and replace any older basic components\n * (marked with [OLD] in the UI) with the new components (without the [OLD]). This method (and functionality for the older components)\n * will be removed in the next major release.\n */\nexport const maintainBasicComponentIdsWithoutPrefix = () => {\n optionalBuiltInComponents.forEach((id) => {\n if (componentRegistry.has(id) && id.startsWith('contentful-')) {\n const registeredComponent = componentRegistry.get(id)!;\n const definition = registeredComponent.definition;\n const newDefinition = cloneObject(definition);\n newDefinition.name = newDefinition.name + '[OLD]';\n const newId = id.replace('contentful-', '');\n newDefinition.id = newId;\n const newRegisteredComponent = { ...registeredComponent, definition: newDefinition };\n componentRegistry.set(newId, newRegisteredComponent);\n }\n });\n};\n"],"names":["builtInStyleDefinitions"],"mappings":";;;;;;;;AA+BA,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC,MAAM,WAAW,GAAG,CAAI,YAAe,KAAO;AAC5C,IAAA,IAAI,OAAO,eAAe,KAAK,WAAW,EAAE;AAC1C,QAAA,OAAO,eAAe,CAAC,YAAY,CAAC,CAAC;KACtC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,iCAAiC,GAAG,CAAC,mBAAwC,KAAI;AACrF,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAC/C,IAAA,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,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,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE;YAC7D,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC;AACvD,YAAA,MAAM,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC;AAClD,YAAA,MAAM,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;YAC9C,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,OAAO,CAAC;YAClD,MAAM,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AAC5C,YAAA,aAAa,CAAC,EAAE,GAAG,KAAK,CAAC;YACzB,MAAM,sBAAsB,GAAG,EAAE,GAAG,mBAAmB,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AACrF,YAAA,iBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;SACtD;AACH,KAAC,CAAC,CAAC;AACL;;;;"}
@@ -88,29 +88,29 @@ const deserializePatternNode = ({ node, componentInstanceVariables, componentSet
88
88
  parameters: node.parameters,
89
89
  };
90
90
  };
91
- const resolvePattern = ({ node, parentParameters, patternRootNodeIdsChain, entityStore, }) => {
91
+ const resolvePattern = ({ node, parentPatternProperties, patternRootNodeIdsChain, entityStore, }) => {
92
92
  const componentId = node.definitionId;
93
93
  const assembly = entityStore.usedComponents?.find((component) => component.sys.id === componentId);
94
94
  if (!assembly || !('fields' in assembly)) {
95
95
  return node;
96
96
  }
97
97
  const parameters = {};
98
- const allParameters = {
99
- ...parentParameters,
98
+ const allPatternProperties = {
99
+ ...parentPatternProperties,
100
100
  ...(node.parameters || {}),
101
101
  };
102
- for (const [parameterKey, parameter] of Object.entries(allParameters)) {
102
+ for (const [patternPropertyKey, patternProperty] of Object.entries(allPatternProperties)) {
103
103
  /**
104
104
  * Bubbled up pattern properties are a concatenation of the node id
105
105
  * and the pattern property definition id. We need to split them so
106
106
  * that the node only uses the pattern property definition id.
107
107
  */
108
- const [hashKey, parameterId] = parameterKey.split(PATTERN_PROPERTY_DIVIDER);
108
+ const [hashKey, parameterDefinitionId] = patternPropertyKey.split(PATTERN_PROPERTY_DIVIDER);
109
109
  const hashedNodeChain = md5(patternRootNodeIdsChain || '');
110
110
  const isMatchingNode = hashKey === hashedNodeChain;
111
111
  if (!isMatchingNode)
112
112
  continue;
113
- parameters[parameterId] = parameter;
113
+ parameters[parameterDefinitionId] = patternProperty;
114
114
  }
115
115
  const componentFields = assembly.fields;
116
116
  const deserializedNode = deserializePatternNode({
@@ -1 +1 @@
1
- {"version":3,"file":"assemblyUtils.js","sources":["../../../../src/core/preview/assemblyUtils.ts"],"sourcesContent":["import { EntityStore } from '@contentful/experiences-core';\nimport md5 from 'md5';\nimport type {\n ComponentPropertyValue,\n ComponentTreeNode,\n DesignValue,\n ExperienceComponentSettings,\n Parameter,\n} from '@contentful/experiences-core/types';\nimport { resolvePrebindingPath, shouldUsePrebinding } from '../../utils/prebindingUtils';\nimport { PATTERN_PROPERTY_DIVIDER } from '@contentful/experiences-core/constants';\n\n/** While unfolding the pattern definition on the instance, this function will replace all\n * ComponentValue in the definitions tree with the actual value on the instance. */\nexport const deserializePatternNode = ({\n node,\n componentInstanceVariables,\n componentSettings,\n parameters,\n entityStore,\n}: {\n node: ComponentTreeNode;\n componentInstanceVariables: ComponentTreeNode['variables'];\n componentSettings: ExperienceComponentSettings;\n parameters: Record<string, Parameter>;\n entityStore: EntityStore;\n}): ComponentTreeNode => {\n const variables: Record<string, ComponentPropertyValue> = {};\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 const variableDefinition = componentSettings.variableDefinitions?.[componentValueKey];\n const defaultValue = variableDefinition?.defaultValue;\n\n const usePrebinding = shouldUsePrebinding({\n componentSettings,\n componentValueKey,\n parameters: parameters,\n variable: instanceProperty,\n });\n const path = resolvePrebindingPath({\n componentSettings,\n componentValueKey,\n parameters: parameters,\n entityStore,\n });\n\n if (usePrebinding && path) {\n variables[variableName] = {\n type: 'BoundValue',\n path,\n };\n\n // For assembly, we look up the variable in the assembly instance and\n // replace the ComponentValue with that one.\n } else if (instanceProperty?.type === 'UnboundValue') {\n variables[variableName] = {\n type: 'UnboundValue',\n key: instanceProperty.key,\n };\n } else if (instanceProperty?.type === 'NoValue') {\n variables[variableName] = instanceProperty;\n } else if (instanceProperty?.type === 'BoundValue') {\n variables[variableName] = {\n type: 'BoundValue',\n path: instanceProperty.path,\n };\n } else if (instanceProperty?.type === 'HyperlinkValue') {\n variables[variableName] = {\n type: 'HyperlinkValue',\n linkTargetKey: instanceProperty.linkTargetKey,\n };\n } else if (instanceProperty?.type === 'DesignValue') {\n variables[variableName] = {\n type: 'DesignValue',\n valuesByBreakpoint: instanceProperty.valuesByBreakpoint,\n };\n } else if (!instanceProperty && defaultValue) {\n // So far, we only automatically fallback to the defaultValue for design properties\n if (variableDefinition.group === 'style') {\n variables[variableName] = {\n type: 'DesignValue',\n valuesByBreakpoint: (defaultValue as DesignValue).valuesByBreakpoint,\n };\n }\n }\n }\n }\n\n const children: ComponentTreeNode[] = node.children.map((child) =>\n deserializePatternNode({\n node: child,\n componentInstanceVariables,\n componentSettings,\n parameters,\n entityStore,\n }),\n );\n\n return {\n definitionId: node.definitionId,\n id: node.id,\n variables,\n children,\n slotId: node.slotId,\n displayName: node.displayName,\n parameters: node.parameters,\n };\n};\n\nexport const resolvePattern = ({\n node,\n parentParameters,\n patternRootNodeIdsChain,\n entityStore,\n}: {\n node: ComponentTreeNode;\n entityStore: EntityStore;\n parentParameters: Record<string, Parameter>;\n patternRootNodeIdsChain: string;\n}) => {\n const componentId = node.definitionId as string;\n const assembly = entityStore.usedComponents?.find(\n (component) => component.sys.id === componentId,\n );\n\n if (!assembly || !('fields' in assembly)) {\n return node;\n }\n\n const parameters: Record<string, Parameter> = {};\n\n const allParameters = {\n ...parentParameters,\n ...(node.parameters || {}),\n };\n\n for (const [parameterKey, parameter] of Object.entries(allParameters)) {\n /**\n * Bubbled up pattern properties are a concatenation of the node id\n * and the pattern property definition id. We need to split them so\n * that the node only uses the pattern property definition id.\n */\n const [hashKey, parameterId] = parameterKey.split(PATTERN_PROPERTY_DIVIDER);\n\n const hashedNodeChain = md5(patternRootNodeIdsChain || '');\n\n const isMatchingNode = hashKey === hashedNodeChain;\n\n if (!isMatchingNode) continue;\n\n parameters[parameterId] = parameter;\n }\n\n const componentFields = assembly.fields;\n\n const deserializedNode = deserializePatternNode({\n node: {\n definitionId: node.definitionId,\n id: node.id,\n variables: node.variables,\n children: componentFields.componentTree.children,\n parameters: parameters,\n },\n componentInstanceVariables: node.variables,\n componentSettings: componentFields.componentSettings!,\n parameters: parameters,\n entityStore,\n });\n\n entityStore.addAssemblyUnboundValues(componentFields.unboundValues);\n\n return deserializedNode;\n};\n"],"names":[],"mappings":";;;;AAYA;AACmF;AACtE,MAAA,sBAAsB,GAAG,CAAC,EACrC,IAAI,EACJ,0BAA0B,EAC1B,iBAAiB,EACjB,UAAU,EACV,WAAW,GAOZ,KAAuB;IACtB,MAAM,SAAS,GAA2C,EAAE,CAAC;AAE7D,IAAA,KAAK,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AACrE,QAAA,SAAS,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC;AACnC,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,gBAAgB,EAAE;AACtC,YAAA,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC;AACvC,YAAA,MAAM,gBAAgB,GAAG,0BAA0B,CAAC,iBAAiB,CAAC,CAAC;YACvE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,CAAC;AACtF,YAAA,MAAM,YAAY,GAAG,kBAAkB,EAAE,YA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["import { EntityStore } from '@contentful/experiences-core';\nimport md5 from 'md5';\nimport type {\n ComponentPropertyValue,\n ComponentTreeNode,\n DesignValue,\n ExperienceComponentSettings,\n PatternProperty,\n} from '@contentful/experiences-core/types';\nimport { resolvePrebindingPath, shouldUsePrebinding } from '../../utils/prebindingUtils';\nimport { PATTERN_PROPERTY_DIVIDER } from '@contentful/experiences-core/constants';\n\n/** While unfolding the pattern definition on the instance, this function will replace all\n * ComponentValue in the definitions tree with the actual value on the instance. */\nexport const deserializePatternNode = ({\n node,\n componentInstanceVariables,\n componentSettings,\n parameters,\n entityStore,\n}: {\n node: ComponentTreeNode;\n componentInstanceVariables: ComponentTreeNode['variables'];\n componentSettings: ExperienceComponentSettings;\n parameters: Record<string, PatternProperty>;\n entityStore: EntityStore;\n}): ComponentTreeNode => {\n const variables: Record<string, ComponentPropertyValue> = {};\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 const variableDefinition = componentSettings.variableDefinitions?.[componentValueKey];\n const defaultValue = variableDefinition?.defaultValue;\n\n const usePrebinding = shouldUsePrebinding({\n componentSettings,\n componentValueKey,\n parameters: parameters,\n variable: instanceProperty,\n });\n const path = resolvePrebindingPath({\n componentSettings,\n componentValueKey,\n parameters: parameters,\n entityStore,\n });\n\n if (usePrebinding && path) {\n variables[variableName] = {\n type: 'BoundValue',\n path,\n };\n\n // For assembly, we look up the variable in the assembly instance and\n // replace the ComponentValue with that one.\n } else if (instanceProperty?.type === 'UnboundValue') {\n variables[variableName] = {\n type: 'UnboundValue',\n key: instanceProperty.key,\n };\n } else if (instanceProperty?.type === 'NoValue') {\n variables[variableName] = instanceProperty;\n } else if (instanceProperty?.type === 'BoundValue') {\n variables[variableName] = {\n type: 'BoundValue',\n path: instanceProperty.path,\n };\n } else if (instanceProperty?.type === 'HyperlinkValue') {\n variables[variableName] = {\n type: 'HyperlinkValue',\n linkTargetKey: instanceProperty.linkTargetKey,\n };\n } else if (instanceProperty?.type === 'DesignValue') {\n variables[variableName] = {\n type: 'DesignValue',\n valuesByBreakpoint: instanceProperty.valuesByBreakpoint,\n };\n } else if (!instanceProperty && defaultValue) {\n // So far, we only automatically fallback to the defaultValue for design properties\n if (variableDefinition.group === 'style') {\n variables[variableName] = {\n type: 'DesignValue',\n valuesByBreakpoint: (defaultValue as DesignValue).valuesByBreakpoint,\n };\n }\n }\n }\n }\n\n const children: ComponentTreeNode[] = node.children.map((child) =>\n deserializePatternNode({\n node: child,\n componentInstanceVariables,\n componentSettings,\n parameters,\n entityStore,\n }),\n );\n\n return {\n definitionId: node.definitionId,\n id: node.id,\n variables,\n children,\n slotId: node.slotId,\n displayName: node.displayName,\n parameters: node.parameters,\n };\n};\n\nexport const resolvePattern = ({\n node,\n parentPatternProperties,\n patternRootNodeIdsChain,\n entityStore,\n}: {\n node: ComponentTreeNode;\n entityStore: EntityStore;\n parentPatternProperties: Record<string, PatternProperty>;\n patternRootNodeIdsChain: string;\n}) => {\n const componentId = node.definitionId as string;\n const assembly = entityStore.usedComponents?.find(\n (component) => component.sys.id === componentId,\n );\n\n if (!assembly || !('fields' in assembly)) {\n return node;\n }\n\n const parameters: Record<string, PatternProperty> = {};\n\n const allPatternProperties = {\n ...parentPatternProperties,\n ...(node.parameters || {}),\n };\n\n for (const [patternPropertyKey, patternProperty] of Object.entries(allPatternProperties)) {\n /**\n * Bubbled up pattern properties are a concatenation of the node id\n * and the pattern property definition id. We need to split them so\n * that the node only uses the pattern property definition id.\n */\n const [hashKey, parameterDefinitionId] = patternPropertyKey.split(PATTERN_PROPERTY_DIVIDER);\n\n const hashedNodeChain = md5(patternRootNodeIdsChain || '');\n\n const isMatchingNode = hashKey === hashedNodeChain;\n\n if (!isMatchingNode) continue;\n\n parameters[parameterDefinitionId] = patternProperty;\n }\n\n const componentFields = assembly.fields;\n\n const deserializedNode = deserializePatternNode({\n node: {\n definitionId: node.definitionId,\n id: node.id,\n variables: node.variables,\n children: componentFields.componentTree.children,\n parameters: parameters,\n },\n componentInstanceVariables: node.variables,\n componentSettings: componentFields.componentSettings!,\n parameters: parameters,\n entityStore,\n });\n\n entityStore.addAssemblyUnboundValues(componentFields.unboundValues);\n\n return deserializedNode;\n};\n"],"names":[],"mappings":";;;;AAYA;AACmF;AACtE,MAAA,sBAAsB,GAAG,CAAC,EACrC,IAAI,EACJ,0BAA0B,EAC1B,iBAAiB,EACjB,UAAU,EACV,WAAW,GAOZ,KAAuB;IACtB,MAAM,SAAS,GAA2C,EAAE,CAAC;AAE7D,IAAA,KAAK,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AACrE,QAAA,SAAS,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC;AACnC,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,gBAAgB,EAAE;AACtC,YAAA,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC;AACvC,YAAA,MAAM,gBAAgB,GAAG,0BAA0B,CAAC,iBAAiB,CAAC,CAAC;YACvE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,CAAC;AACtF,YAAA,MAAM,YAAY,GAAG,kBAAkB,EAAE,YAAY,CAAC;YAEtD,MAAM,aAAa,GAAG,mBAAmB,CAAC;gBACxC,iBAAiB;gBACjB,iBAAiB;AACjB,gBAAA,UAAU,EAAE,UAAU;AACtB,gBAAA,QAAQ,EAAE,gBAAgB;AAC3B,aAAA,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,qBAAqB,CAAC;gBACjC,iBAAiB;gBACjB,iBAAiB;AACjB,gBAAA,UAAU,EAAE,UAAU;gBACtB,WAAW;AACZ,aAAA,CAAC,CAAC;AAEH,YAAA,IAAI,aAAa,IAAI,IAAI,EAAE;gBACzB,SAAS,CAAC,YAAY,CAAC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GAAG,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;AAE3D,QAAA,MAAM,cAAc,GAAG,OAAO,KAAK,eAAe,CAAC;AAEnD,QAAA,IAAI,CAAC,cAAc;YAAE,SAAS;AAE9B,QAAA,UAAU,CAAC,qBAAqB,CAAC,GAAG,eAAe,CAAC;KACrD;AAED,IAAA,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC;IAExC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,IAAI,EAAE;YACJ,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,SAAS,EAAE,IAAI,CAAC,SAAS;AACzB,YAAA,QAAQ,EAAE,eAAe,CAAC,aAAa,CAAC,QAAQ;AAChD,YAAA,UAAU,EAAE,UAAU;AACvB,SAAA;QACD,0BAA0B,EAAE,IAAI,CAAC,SAAS;QAC1C,iBAAiB,EAAE,eAAe,CAAC,iBAAkB;AACrD,QAAA,UAAU,EAAE,UAAU;QACtB,WAAW;AACZ,KAAA,CAAC,CAAC;AAEH,IAAA,WAAW,CAAC,wBAAwB,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;AAEpE,IAAA,OAAO,gBAAgB,CAAC;AAC1B;;;;"}
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import * as _contentful_experiences_core_constants from '@contentful/experiences
8
8
  export { CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, LATEST_SCHEMA_VERSION } from '@contentful/experiences-core/constants';
9
9
  import { ContentfulClientApi } from 'contentful';
10
10
 
11
- declare const SDK_VERSION = "1.42.0-dev-20250630T1149-4da2e67.0";
11
+ declare const SDK_VERSION = "1.42.0-prerelease-20250620T0958-8e54295.0";
12
12
 
13
13
  type ExperienceRootProps = {
14
14
  experience?: Experience<EntityStore> | string | null;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = '1.42.0-dev-20250630T1149-4da2e67.0';
1
+ const SDK_VERSION = '1.42.0-prerelease-20250620T0958-8e54295.0';
2
2
 
3
3
  export { SDK_VERSION };
4
4
  //# sourceMappingURL=sdkVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '1.42.0-dev-20250630T1149-4da2e67.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
1
+ {"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '1.42.0-prerelease-20250620T0958-8e54295.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { EntityStore } from '@contentful/experiences-core';
2
- import type { ComponentTreeNode, Parameter, ResolveDesignValueType } from '@contentful/experiences-core/types';
2
+ import type { ComponentTreeNode, PatternProperty, ResolveDesignValueType } from '@contentful/experiences-core/types';
3
3
  type CompositionBlockProps = {
4
4
  node: ComponentTreeNode;
5
5
  locale: string;
@@ -14,7 +14,7 @@ type CompositionBlockProps = {
14
14
  * when storing & accessing cfSsrClassName.
15
15
  */
16
16
  patternRootNodeIdsChain?: string;
17
- wrappingParameters?: Record<string, Parameter>;
17
+ wrappingPatternProperties?: Record<string, PatternProperty>;
18
18
  };
19
- export declare const CompositionBlock: ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, getPatternChildNodeClassName, wrappingPatternIds: parentWrappingPatternIds, wrappingParameters: parentWrappingParameters, patternRootNodeIdsChain: parentPatternRootNodeIdsChain, }: CompositionBlockProps) => import("react/jsx-runtime").JSX.Element | null;
19
+ export declare const CompositionBlock: ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, getPatternChildNodeClassName, wrappingPatternIds: parentWrappingPatternIds, wrappingPatternProperties: parentWrappingPatternProperties, patternRootNodeIdsChain: parentPatternRootNodeIdsChain, }: CompositionBlockProps) => import("react/jsx-runtime").JSX.Element | null;
20
20
  export {};
@@ -1,4 +1,5 @@
1
1
  import React, { ErrorInfo, ReactElement } from 'react';
2
+ import '../styles/ErrorBoundary.css';
2
3
  export declare class ErrorBoundary extends React.Component<{
3
4
  children: ReactElement;
4
5
  }, {
@@ -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>>;
@@ -1,5 +1,4 @@
1
1
  import type { ComponentRegistration, ComponentRegistrationOptions } from '@contentful/experiences-core/types';
2
- import '@contentful/experiences-components-react/dist/index.css';
3
2
  export declare const enrichComponentDefinition: ({ component, definition, options, }: ComponentRegistration) => ComponentRegistration;
4
3
  export declare const componentRegistry: Map<string, ComponentRegistration>;
5
4
  export declare const optionalBuiltInComponents: string[];
@@ -0,0 +1 @@
1
+ export { Flex } from '../components/Flex';
@@ -1,17 +1,17 @@
1
1
  import { EntityStore } from '@contentful/experiences-core';
2
- import type { ComponentTreeNode, ExperienceComponentSettings, Parameter } from '@contentful/experiences-core/types';
2
+ import type { ComponentTreeNode, ExperienceComponentSettings, PatternProperty } from '@contentful/experiences-core/types';
3
3
  /** While unfolding the pattern definition on the instance, this function will replace all
4
4
  * ComponentValue in the definitions tree with the actual value on the instance. */
5
5
  export declare const deserializePatternNode: ({ node, componentInstanceVariables, componentSettings, parameters, entityStore, }: {
6
6
  node: ComponentTreeNode;
7
7
  componentInstanceVariables: ComponentTreeNode["variables"];
8
8
  componentSettings: ExperienceComponentSettings;
9
- parameters: Record<string, Parameter>;
9
+ parameters: Record<string, PatternProperty>;
10
10
  entityStore: EntityStore;
11
11
  }) => ComponentTreeNode;
12
- export declare const resolvePattern: ({ node, parentParameters, patternRootNodeIdsChain, entityStore, }: {
12
+ export declare const resolvePattern: ({ node, parentPatternProperties, patternRootNodeIdsChain, entityStore, }: {
13
13
  node: ComponentTreeNode;
14
14
  entityStore: EntityStore;
15
- parentParameters: Record<string, Parameter>;
15
+ parentPatternProperties: Record<string, PatternProperty>;
16
16
  patternRootNodeIdsChain: string;
17
17
  }) => ComponentTreeNode;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.42.0-dev-20250630T1149-4da2e67.0";
1
+ export declare const SDK_VERSION = "1.42.0-prerelease-20250620T0958-8e54295.0";
@@ -1,15 +1,15 @@
1
1
  import { EntityStore } from '@contentful/experiences-core';
2
- import { ComponentPropertyValue, ExperienceComponentSettings, Parameter } from '@contentful/experiences-validators';
2
+ import { ComponentPropertyValue, ExperienceComponentSettings, PatternProperty } from '@contentful/experiences-validators';
3
3
  export declare const shouldUsePrebinding: ({ componentValueKey, componentSettings, parameters, variable, }: {
4
4
  componentValueKey: string;
5
5
  componentSettings: ExperienceComponentSettings;
6
- parameters: Record<string, Parameter>;
6
+ parameters: Record<string, PatternProperty>;
7
7
  variable: ComponentPropertyValue;
8
8
  }) => boolean;
9
9
  export declare const resolvePrebindingPath: ({ componentValueKey, componentSettings, parameters, entityStore, }: {
10
10
  componentValueKey: string;
11
11
  componentSettings: ExperienceComponentSettings;
12
- parameters: Record<string, Parameter>;
12
+ parameters: Record<string, PatternProperty>;
13
13
  entityStore: EntityStore;
14
14
  }) => string;
15
15
  export declare const resolveMaybePrebindingDefaultValuePath: ({ componentValueKey, entityStore, }: {
@@ -0,0 +1,7 @@
1
+ import styleInject from 'style-inject';
2
+
3
+ var css_248z = ".cf-error-message {\n margin: 24px;\n font-size: var(--exp-builder-font-size-m);\n font-family: var(--exp-builder-font-stack-primary);\n color: var(--exp-builder-red800);\n padding: 16px;\n background-color: var(--exp-builder-red200);\n}\n\n.cf-error-message .title {\n margin-top: 0;\n font-size: var(--exp-builder-font-size-l);\n}\n\n.cf-error-message .more-details {\n cursor: pointer;\n color: var(--exp-builder-blue700);\n}\n";
4
+ styleInject(css_248z);
5
+
6
+ export { css_248z as default };
7
+ //# sourceMappingURL=ErrorBoundary.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,19 +1,19 @@
1
1
  const shouldUsePrebinding = ({ componentValueKey, componentSettings, parameters, variable, }) => {
2
2
  const { parameterDefinitions, variableMappings } = componentSettings;
3
3
  const variableMapping = variableMappings?.[componentValueKey];
4
- const parameterDefinition = parameterDefinitions?.[variableMapping?.parameterId || ''];
5
- const parameter = parameters?.[variableMapping?.parameterId || ''];
6
- const isValidForPrebinding = !!parameterDefinition && !!parameter && !!variableMapping;
4
+ const patternPropertyDefinition = parameterDefinitions?.[variableMapping?.parameterDefinitionId || ''];
5
+ const patternProperty = parameters?.[variableMapping?.parameterDefinitionId || ''];
6
+ const isValidForPrebinding = !!patternPropertyDefinition && !!patternProperty && !!variableMapping;
7
7
  return isValidForPrebinding && variable?.type === 'NoValue';
8
8
  };
9
9
  const resolvePrebindingPath = ({ componentValueKey, componentSettings, parameters, entityStore, }) => {
10
10
  const variableMapping = componentSettings.variableMappings?.[componentValueKey];
11
11
  if (!variableMapping)
12
12
  return '';
13
- const parameter = parameters?.[variableMapping.parameterId];
14
- if (!parameter)
13
+ const patternProperty = parameters?.[variableMapping.parameterDefinitionId];
14
+ if (!patternProperty)
15
15
  return '';
16
- const dataSourceKey = parameter.path.split('/')[1];
16
+ const dataSourceKey = patternProperty.path.split('/')[1];
17
17
  const entityLink = entityStore.dataSource[dataSourceKey];
18
18
  if (!entityLink)
19
19
  return '';
@@ -24,28 +24,28 @@ const resolvePrebindingPath = ({ componentValueKey, componentSettings, parameter
24
24
  const fieldPath = variableMapping?.pathsByContentType?.[contentType]?.path;
25
25
  if (!fieldPath)
26
26
  return '';
27
- return parameter.path + fieldPath;
27
+ return patternProperty.path + fieldPath;
28
28
  };
29
29
  const resolveMaybePrebindingDefaultValuePath = ({ componentValueKey, entityStore, }) => {
30
30
  if (!entityStore.experienceEntryFields?.componentSettings)
31
31
  return;
32
32
  const componentSettings = entityStore.experienceEntryFields.componentSettings;
33
- const mapping = componentSettings.variableMappings?.[componentValueKey];
34
- if (!mapping)
33
+ const prebinding = componentSettings.variableMappings?.[componentValueKey];
34
+ if (!prebinding)
35
35
  return;
36
- const mappingId = mapping.parameterId || '';
37
- const prebinding = componentSettings.parameterDefinitions?.[mappingId];
38
- if (!prebinding || !prebinding?.defaultSource)
36
+ const mappingId = prebinding.parameterDefinitionId || '';
37
+ const mapping = componentSettings.parameterDefinitions?.[mappingId];
38
+ if (!mapping || !mapping?.defaultValue)
39
39
  return;
40
- const { contentTypeId, link } = prebinding.defaultSource;
41
- if (contentTypeId in prebinding.contentTypes) {
40
+ const [[contentTypeId, defaultEntryLink]] = Object.entries(mapping.defaultValue);
41
+ if (contentTypeId in mapping.contentTypes) {
42
42
  return resolvePrebindingPath({
43
43
  componentValueKey,
44
44
  entityStore,
45
45
  componentSettings,
46
46
  parameters: {
47
47
  [mappingId]: {
48
- path: `/${link.sys.id}`,
48
+ path: `/${defaultEntryLink.sys.id}`,
49
49
  type: 'BoundValue',
50
50
  },
51
51
  },
@@ -1 +1 @@
1
- {"version":3,"file":"prebindingUtils.js","sources":["../../../src/utils/prebindingUtils.ts"],"sourcesContent":["import { EntityStore } from '@contentful/experiences-core';\nimport {\n ComponentPropertyValue,\n ExperienceComponentSettings,\n Parameter,\n} from '@contentful/experiences-validators';\n\nexport const shouldUsePrebinding = ({\n componentValueKey,\n componentSettings,\n parameters,\n variable,\n}: {\n componentValueKey: string;\n componentSettings: ExperienceComponentSettings;\n parameters: Record<string, Parameter>;\n variable: ComponentPropertyValue;\n}) => {\n const { parameterDefinitions, variableMappings } = componentSettings;\n\n const variableMapping = variableMappings?.[componentValueKey];\n\n const parameterDefinition = parameterDefinitions?.[variableMapping?.parameterId || ''];\n const parameter = parameters?.[variableMapping?.parameterId || ''];\n\n const isValidForPrebinding = !!parameterDefinition && !!parameter && !!variableMapping;\n\n return isValidForPrebinding && variable?.type === 'NoValue';\n};\n\nexport const resolvePrebindingPath = ({\n componentValueKey,\n componentSettings,\n parameters,\n entityStore,\n}: {\n componentValueKey: string;\n componentSettings: ExperienceComponentSettings;\n parameters: Record<string, Parameter>;\n entityStore: EntityStore;\n}) => {\n const variableMapping = componentSettings.variableMappings?.[componentValueKey];\n\n if (!variableMapping) return '';\n\n const parameter = parameters?.[variableMapping.parameterId];\n\n if (!parameter) return '';\n\n const dataSourceKey = parameter.path.split('/')[1];\n\n const entityLink = entityStore.dataSource[dataSourceKey];\n if (!entityLink) return '';\n\n const entity = entityStore.getEntityFromLink(entityLink);\n if (!entity || entity.sys.type === 'Asset') return '';\n\n const contentType = entity.sys.contentType.sys.id;\n\n const fieldPath = variableMapping?.pathsByContentType?.[contentType]?.path;\n\n if (!fieldPath) return '';\n\n return parameter.path + fieldPath;\n};\n\nexport const resolveMaybePrebindingDefaultValuePath = ({\n componentValueKey,\n entityStore,\n}: {\n componentValueKey: string;\n entityStore: EntityStore;\n}): string | undefined => {\n if (!entityStore.experienceEntryFields?.componentSettings) return;\n\n const componentSettings = entityStore.experienceEntryFields.componentSettings;\n const mapping = componentSettings.variableMappings?.[componentValueKey];\n if (!mapping) return;\n\n const mappingId = mapping.parameterId || '';\n const prebinding = componentSettings.parameterDefinitions?.[mappingId];\n if (!prebinding || !prebinding?.defaultSource) return;\n\n const { contentTypeId, link } = prebinding.defaultSource;\n if (contentTypeId in prebinding.contentTypes) {\n return resolvePrebindingPath({\n componentValueKey,\n entityStore,\n componentSettings,\n parameters: {\n [mappingId]: {\n path: `/${link.sys.id}`,\n type: 'BoundValue',\n },\n },\n });\n }\n};\n"],"names":[],"mappings":"AAOO,MAAM,mBAAmB,GAAG,CAAC,EAClC,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,QAAQ,GAMT,KAA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ACnB,iBAAA;AACF,aAAA;AACF,SAAA,CAAC,CAAC;KACJ;AACH;;;;"}
1
+ {"version":3,"file":"prebindingUtils.js","sources":["../../../src/utils/prebindingUtils.ts"],"sourcesContent":["import { EntityStore } from '@contentful/experiences-core';\nimport {\n ComponentPropertyValue,\n ExperienceComponentSettings,\n PatternProperty,\n} from '@contentful/experiences-validators';\n\nexport const shouldUsePrebinding = ({\n componentValueKey,\n componentSettings,\n parameters,\n variable,\n}: {\n componentValueKey: string;\n componentSettings: ExperienceComponentSettings;\n parameters: Record<string, PatternProperty>;\n variable: ComponentPropertyValue;\n}) => {\n const { parameterDefinitions, variableMappings } = componentSettings;\n\n const variableMapping = variableMappings?.[componentValueKey];\n\n const patternPropertyDefinition =\n parameterDefinitions?.[variableMapping?.parameterDefinitionId || ''];\n const patternProperty = parameters?.[variableMapping?.parameterDefinitionId || ''];\n\n const isValidForPrebinding =\n !!patternPropertyDefinition && !!patternProperty && !!variableMapping;\n\n return isValidForPrebinding && variable?.type === 'NoValue';\n};\n\nexport const resolvePrebindingPath = ({\n componentValueKey,\n componentSettings,\n parameters,\n entityStore,\n}: {\n componentValueKey: string;\n componentSettings: ExperienceComponentSettings;\n parameters: Record<string, PatternProperty>;\n entityStore: EntityStore;\n}) => {\n const variableMapping = componentSettings.variableMappings?.[componentValueKey];\n\n if (!variableMapping) return '';\n\n const patternProperty = parameters?.[variableMapping.parameterDefinitionId];\n\n if (!patternProperty) return '';\n\n const dataSourceKey = patternProperty.path.split('/')[1];\n\n const entityLink = entityStore.dataSource[dataSourceKey];\n if (!entityLink) return '';\n\n const entity = entityStore.getEntityFromLink(entityLink);\n if (!entity || entity.sys.type === 'Asset') return '';\n\n const contentType = entity.sys.contentType.sys.id;\n\n const fieldPath = variableMapping?.pathsByContentType?.[contentType]?.path;\n\n if (!fieldPath) return '';\n\n return patternProperty.path + fieldPath;\n};\n\nexport const resolveMaybePrebindingDefaultValuePath = ({\n componentValueKey,\n entityStore,\n}: {\n componentValueKey: string;\n entityStore: EntityStore;\n}): string | undefined => {\n if (!entityStore.experienceEntryFields?.componentSettings) return;\n\n const componentSettings = entityStore.experienceEntryFields.componentSettings;\n const prebinding = componentSettings.variableMappings?.[componentValueKey];\n if (!prebinding) return;\n\n const mappingId = prebinding.parameterDefinitionId || '';\n const mapping = componentSettings.parameterDefinitions?.[mappingId];\n if (!mapping || !mapping?.defaultValue) return;\n\n const [[contentTypeId, defaultEntryLink]] = Object.entries(mapping.defaultValue);\n if (contentTypeId in mapping.contentTypes) {\n return resolvePrebindingPath({\n componentValueKey,\n entityStore,\n componentSettings,\n parameters: {\n [mappingId]: {\n path: `/${defaultEntryLink.sys.id}`,\n type: 'BoundValue',\n },\n },\n });\n }\n};\n"],"names":[],"mappings":"AAOO,MAAM,mBAAmB,GAAG,CAAC,EAClC,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,QAAQ,GAMT,KAAI;AACH,IAAA,MAAM,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,GAAG,iBAAiB,CAAC;AAErE,IAAA,MAAM,eAAe,GAAG,gBAAgB,GAAG,iBAAiB,CAAC,CAAC;IAE9D,MAAM,yBAAyB,GAC7B,oBAAoB,GAAG,eAAe,EAAE,qBAAqB,IAAI,EAAE,CAAC,CAAC;IACvE,MAAM,eAAe,GAAG,UAAU,GAAG,eAAe,EAAE,qBAAqB,IAAI,EAAE,CAAC,CAAC;AAEnF,IAAA,MAAM,oBAAoB,GACxB,CAAC,CAAC,yBAAyB,IAAI,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,eAAe,CAAC;AAExE,IAAA,OAAO,oBAAoB,IAAI,QAAQ,EAAE,IAAI,KAAK,SAAS,CAAC;AAC9D,EAAE;AAEK,MAAM,qBAAqB,GAAG,CAAC,EACpC,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,WAAW,GAMZ,KAAI;IACH,MAAM,eAAe,GAAG,iBAAiB,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,CAAC;A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IAAA,MAAM,SAAS,GAAG,UAAU,CAAC,qBAAqB,IAAI,EAAE,CAAC;IACzD,MAAM,OAAO,GAAG,iBAAiB,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;AACpE,IAAA,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,YAAY;QAAE,OAAO;AAE/C,IAAA,MAAM,CAAC,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACjF,IAAA,IAAI,aAAa,IAAI,OAAO,CAAC,YAAY,EAAE;AACzC,QAAA,OAAO,qBAAqB,CAAC;YAC3B,iBAAiB;YACjB,WAAW;YACX,iBAAiB;AACjB,YAAA,UAAU,EAAE;gBACV,CAAC,SAAS,GAAG;AACX,oBAAA,IAAI,EAAE,CAAI,CAAA,EAAA,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAA;AACnC,oBAAA,IAAI,EAAE,YAAY;AACnB,iBAAA;AACF,aAAA;AACF,SAAA,CAAC,CAAC;KACJ;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-sdk-react",
3
- "version": "1.42.0-dev-20250630T1149-4da2e67.0",
3
+ "version": "1.42.0-prerelease-20250620T0958-8e54295.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "typings": "./dist/src/index.d.ts",
@@ -41,10 +41,10 @@
41
41
  "depcruise": "depcruise src"
42
42
  },
43
43
  "dependencies": {
44
- "@contentful/experiences-components-react": "1.42.0-dev-20250630T1149-4da2e67.0",
45
- "@contentful/experiences-core": "1.42.0-dev-20250630T1149-4da2e67.0",
46
- "@contentful/experiences-validators": "1.42.0-dev-20250630T1149-4da2e67.0",
47
- "@contentful/experiences-visual-editor-react": "1.42.0-dev-20250630T1149-4da2e67.0",
44
+ "@contentful/experiences-components-react": "1.42.0-prerelease-20250620T0958-8e54295.0",
45
+ "@contentful/experiences-core": "1.42.0-prerelease-20250620T0958-8e54295.0",
46
+ "@contentful/experiences-validators": "1.42.0-prerelease-20250620T0958-8e54295.0",
47
+ "@contentful/experiences-visual-editor-react": "1.42.0-prerelease-20250620T0958-8e54295.0",
48
48
  "@contentful/rich-text-types": "^17.0.0",
49
49
  "classnames": "^2.3.2",
50
50
  "csstype": "^3.1.2",
@@ -76,12 +76,14 @@
76
76
  "jest": "^29.5.0",
77
77
  "jest-environment-jsdom": "^29.5.0",
78
78
  "jsdom": "^24.0.0",
79
+ "postcss-import": "^16.0.1",
79
80
  "react": "^18.2.0",
80
81
  "react-dom": "^18.2.0",
81
82
  "relative-deps": "^1.0.7",
82
83
  "rollup-plugin-dts": "^6.1.0",
83
84
  "rollup-plugin-node-externals": "^7.0.1",
84
85
  "rollup-plugin-peer-deps-external": "^2.2.4",
86
+ "rollup-plugin-postcss": "^4.0.2",
85
87
  "rollup-plugin-preserve-directives": "^0.4.0",
86
88
  "semantic-release": "23.0.2",
87
89
  "ts-jest": "^29.1.0",
@@ -100,5 +102,5 @@
100
102
  "dist",
101
103
  "package.json"
102
104
  ],
103
- "gitHead": "f4cc2d3ae847f4b034779e582ba04477c8f7da4d"
105
+ "gitHead": "b717fe763bc85a8538d0d1628d794bb68313f731"
104
106
  }