@contentful/experiences-sdk-react 1.30.0-beta.0 → 1.30.0-dev-20250124T1739-560b81b.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.
@@ -8,7 +8,7 @@ import { Assembly, ContentfulContainer, Columns, SingleColumn } from '@contentfu
8
8
  import { resolveAssembly } from '../../core/preview/assemblyUtils.js';
9
9
  import PreviewUnboundImage from './PreviewUnboundImage.js';
10
10
 
11
- const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, getPatternChildNodeClassName, wrappingPatternIds: parentWrappingPatternIds = new Set(), }) => {
11
+ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, getPatternChildNodeClassName, }) => {
12
12
  const isAssembly = useMemo(() => checkIsAssemblyNode({
13
13
  componentId: rawNode.definitionId,
14
14
  usedComponents: entityStore.usedComponents,
@@ -21,12 +21,6 @@ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern
21
21
  })
22
22
  : rawNode;
23
23
  }, [entityStore, isAssembly, rawNode]);
24
- const wrappingPatternIds = useMemo(() => {
25
- if (isAssembly) {
26
- return new Set([node.definitionId, ...parentWrappingPatternIds]);
27
- }
28
- return parentWrappingPatternIds;
29
- }, [isAssembly, node, parentWrappingPatternIds]);
30
24
  const componentRegistration = useMemo(() => {
31
25
  const registration = getComponentRegistration(node.definitionId);
32
26
  if (isAssembly && !registration) {
@@ -95,32 +89,27 @@ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern
95
89
  for (const slotId in componentRegistration.definition.slots) {
96
90
  const slotNode = node.children.find((child) => child.slotId === slotId);
97
91
  if (slotNode) {
98
- props[slotId] = (jsx(CompositionBlock, { node: slotNode, locale: locale, hyperlinkPattern: hyperlinkPattern, entityStore: entityStore, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds }));
92
+ props[slotId] = (jsx(CompositionBlock, { node: slotNode, locale: locale, hyperlinkPattern: hyperlinkPattern, entityStore: entityStore, resolveDesignValue: resolveDesignValue }));
99
93
  }
100
94
  }
101
95
  }
102
96
  return props;
103
97
  }, [
98
+ resolveDesignValue,
104
99
  node.variables,
105
100
  node.id,
106
101
  node.children,
107
- resolveDesignValue,
108
102
  componentRegistration,
109
103
  isAssembly,
110
104
  getPatternChildNodeClassName,
111
105
  entityStore,
112
106
  hyperlinkPattern,
113
107
  locale,
114
- wrappingPatternIds,
115
108
  ]);
116
109
  const className = useClassName({ props: nodeProps, node });
117
110
  if (!componentRegistration) {
118
111
  return null;
119
112
  }
120
- // When detecting a circular dependency, we stop silently. The editor mode will render an actionable error.
121
- if (parentWrappingPatternIds.has(node.definitionId)) {
122
- return null;
123
- }
124
113
  const { component } = componentRegistration;
125
114
  // Retrieves the CSS class name for a given child node ID.
126
115
  const _getPatternChildNodeClassName = (childNodeId) => {
@@ -137,7 +126,7 @@ const CompositionBlock = ({ node: rawNode, locale, entityStore, hyperlinkPattern
137
126
  ? node.children.map((childNode, index) => {
138
127
  return (jsx(CompositionBlock, { getPatternChildNodeClassName: isAssembly || getPatternChildNodeClassName
139
128
  ? _getPatternChildNodeClassName
140
- : undefined, node: childNode, locale: locale, hyperlinkPattern: hyperlinkPattern, entityStore: entityStore, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds }, index));
129
+ : undefined, node: childNode, locale: locale, hyperlinkPattern: hyperlinkPattern, entityStore: entityStore, resolveDesignValue: resolveDesignValue }, index));
141
130
  })
142
131
  : null;
143
132
  if ([CONTENTFUL_COMPONENTS.container.id, CONTENTFUL_COMPONENTS.section.id].includes(node.definitionId)) {
@@ -1 +1 @@
1
- {"version":3,"file":"CompositionBlock.js","sources":["../../../../src/blocks/preview/CompositionBlock.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport type { UnresolvedLink } from 'contentful';\nimport {\n EntityStore,\n resolveHyperlinkPattern,\n sanitizeNodeProps,\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 PrimitiveValue,\n ResolveDesignValueType,\n StyleProps,\n} from '@contentful/experiences-core/types';\nimport { createAssemblyRegistration, getComponentRegistration } from '../../core/componentRegistry';\nimport { checkIsAssemblyNode, transformBoundContentValue } from '@contentful/experiences-core';\nimport { useClassName } from '../../hooks/useClassName';\nimport {\n Assembly,\n Columns,\n ContentfulContainer,\n SingleColumn,\n} from '@contentful/experiences-components-react';\n\nimport { resolveAssembly } from '../../core/preview/assemblyUtils';\nimport { Entry } from 'contentful';\nimport PreviewUnboundImage from './PreviewUnboundImage';\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 wrappingPatternIds?: Set<string>;\n};\n\nexport const CompositionBlock = ({\n node: rawNode,\n locale,\n entityStore,\n hyperlinkPattern,\n resolveDesignValue,\n getPatternChildNodeClassName,\n wrappingPatternIds: parentWrappingPatternIds = new Set(),\n}: CompositionBlockProps) => {\n const isAssembly = useMemo(\n () =>\n checkIsAssemblyNode({\n componentId: rawNode.definitionId,\n usedComponents: entityStore.usedComponents,\n }),\n [entityStore.usedComponents, rawNode.definitionId],\n );\n\n const node = useMemo(() => {\n return isAssembly\n ? resolveAssembly({\n node: rawNode,\n entityStore,\n })\n : rawNode;\n }, [entityStore, isAssembly, rawNode]);\n\n const wrappingPatternIds = useMemo(() => {\n if (isAssembly) {\n return new Set([node.definitionId, ...parentWrappingPatternIds]);\n }\n return parentWrappingPatternIds;\n }, [isAssembly, node, parentWrappingPatternIds]);\n\n const componentRegistration = useMemo(() => {\n const registration = getComponentRegistration(node.definitionId as string);\n\n if (isAssembly && !registration) {\n return createAssemblyRegistration({\n definitionId: node.definitionId as string,\n component: Assembly,\n });\n }\n return registration;\n }, [isAssembly, node.definitionId]);\n\n const nodeProps = useMemo(() => {\n // 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 cfSsrClassName = resolveDesignValue(\n cfSsrClassNameValues?.valuesByBreakpoint,\n 'cfSsrClassName',\n );\n\n // Don't enrich the assembly wrapper node with props\n if (!componentRegistration || isAssembly) {\n return { cfSsrClassName };\n }\n\n const propMap: Record<string, PrimitiveValue> = {\n cfSsrClassName:\n node.id && getPatternChildNodeClassName\n ? getPatternChildNodeClassName(node.id)\n : cfSsrClassName,\n };\n\n const props = Object.entries(componentRegistration.definition.variables).reduce(\n (acc, [variableName, variableDefinition]) => {\n const variable = node.variables[variableName];\n if (!variable) return acc;\n\n switch (variable.type) {\n case 'DesignValue':\n acc[variableName] = resolveDesignValue(variable.valuesByBreakpoint, variableName);\n break;\n case 'BoundValue': {\n const [, uuid] = variable.path.split('/');\n const binding = entityStore.dataSource[uuid] as UnresolvedLink<'Entry' | 'Asset'>;\n\n const value = transformBoundContentValue(\n node.variables,\n entityStore,\n binding,\n resolveDesignValue,\n variableName,\n variableDefinition,\n variable.path,\n );\n acc[variableName] = value ?? variableDefinition.defaultValue;\n break;\n }\n\n case 'HyperlinkValue': {\n const binding = entityStore.dataSource[variable.linkTargetKey];\n const hyperlinkEntry = entityStore.getEntryOrAsset(binding, variable.linkTargetKey);\n\n const value = resolveHyperlinkPattern(\n componentRegistration.definition.hyperlinkPattern ||\n hyperlinkPattern ||\n HYPERLINK_DEFAULT_PATTERN,\n hyperlinkEntry as Entry,\n locale,\n );\n if (value) {\n acc[variableName] = value;\n }\n break;\n }\n case 'UnboundValue': {\n const uuid = variable.key;\n acc[variableName] =\n entityStore.unboundValues[uuid]?.value ?? variableDefinition.defaultValue;\n break;\n }\n case 'ComponentValue':\n // We're rendering a pattern entry. Content cannot be set for ComponentValue type properties\n // directly in the pattern so we can safely use the default value\n // This can either a design (style) or a content variable\n acc[variableName] = variableDefinition.defaultValue;\n break;\n default:\n break;\n }\n return acc;\n },\n propMap,\n );\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 props[slotId] = (\n <CompositionBlock\n node={slotNode}\n locale={locale}\n hyperlinkPattern={hyperlinkPattern}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n wrappingPatternIds={wrappingPatternIds}\n />\n );\n }\n }\n }\n\n return props;\n }, [\n node.variables,\n node.id,\n node.children,\n resolveDesignValue,\n componentRegistration,\n isAssembly,\n getPatternChildNodeClassName,\n entityStore,\n hyperlinkPattern,\n locale,\n wrappingPatternIds,\n ]);\n\n const className = useClassName({ props: nodeProps, node });\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 (isAssembly) {\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?.[childNodeId];\n if (!classesForNode) return undefined;\n return resolveDesignValue(classesForNode.valuesByBreakpoint, 'cfSsrClassName') 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 isAssembly || 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 />\n );\n })\n : null;\n\n if (\n [CONTENTFUL_COMPONENTS.container.id, CONTENTFUL_COMPONENTS.section.id].includes(\n node.definitionId,\n )\n ) {\n return (\n <ContentfulContainer\n editorMode={false}\n cfHyperlink={(nodeProps as StyleProps).cfHyperlink}\n cfOpenInNewTab={(nodeProps as StyleProps).cfOpenInNewTab}\n className={className}>\n {children}\n </ContentfulContainer>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.columns.id) {\n return (\n <Columns editorMode={false} className={className}>\n {children}\n </Columns>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.singleColumn.id) {\n return (\n <SingleColumn editorMode={false} className={className}>\n {children}\n </SingleColumn>\n );\n }\n\n if (\n node.definitionId === CONTENTFUL_COMPONENTS.image.id &&\n node.variables.cfImageAsset?.type === 'UnboundValue'\n ) {\n return <PreviewUnboundImage node={node} nodeProps={nodeProps} component={component} />;\n }\n\n return React.createElement(\n component,\n {\n ...sanitizeNodeProps(nodeProps),\n className,\n },\n children ?? (typeof nodeProps.children === 'string' ? nodeProps.children : null),\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;;;;AA0CO,MAAM,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,GAClC,KAAI;IAC1B,MAAM,UAAU,GAAG,OAAO,CACxB,MACE,mBAAmB,CAAC;QAClB,WAAW,EAAE,OAAO,CAAC,YAAY;QACjC,cAAc,EAAE,WAAW,CAAC,cAAc;KAC3C,CAAC,EACJ,CAAC,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CACnD,CAAC;AAEF,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAK;AACxB,QAAA,OAAO,UAAU;cACb,eAAe,CAAC;AACd,gBAAA,IAAI,EAAE,OAAO;gBACb,WAAW;aACZ,CAAC;cACF,OAAO,CAAC;K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AO,SAAS,CAAC,QAAQ,KAAK,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CACjF,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"CompositionBlock.js","sources":["../../../../src/blocks/preview/CompositionBlock.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport type { UnresolvedLink } from 'contentful';\nimport {\n EntityStore,\n resolveHyperlinkPattern,\n sanitizeNodeProps,\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 PrimitiveValue,\n ResolveDesignValueType,\n StyleProps,\n} from '@contentful/experiences-core/types';\nimport { createAssemblyRegistration, getComponentRegistration } from '../../core/componentRegistry';\nimport { checkIsAssemblyNode, transformBoundContentValue } from '@contentful/experiences-core';\nimport { useClassName } from '../../hooks/useClassName';\nimport {\n Assembly,\n Columns,\n ContentfulContainer,\n SingleColumn,\n} from '@contentful/experiences-components-react';\n\nimport { resolveAssembly } from '../../core/preview/assemblyUtils';\nimport { Entry } from 'contentful';\nimport PreviewUnboundImage from './PreviewUnboundImage';\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};\n\nexport const CompositionBlock = ({\n node: rawNode,\n locale,\n entityStore,\n hyperlinkPattern,\n resolveDesignValue,\n getPatternChildNodeClassName,\n}: CompositionBlockProps) => {\n const isAssembly = useMemo(\n () =>\n checkIsAssemblyNode({\n componentId: rawNode.definitionId,\n usedComponents: entityStore.usedComponents,\n }),\n [entityStore.usedComponents, rawNode.definitionId],\n );\n\n const node = useMemo(() => {\n return isAssembly\n ? resolveAssembly({\n node: rawNode,\n entityStore,\n })\n : rawNode;\n }, [entityStore, isAssembly, rawNode]);\n\n const componentRegistration = useMemo(() => {\n const registration = getComponentRegistration(node.definitionId as string);\n\n if (isAssembly && !registration) {\n return createAssemblyRegistration({\n definitionId: node.definitionId as string,\n component: Assembly,\n });\n }\n return registration;\n }, [isAssembly, node.definitionId]);\n\n const nodeProps = useMemo(() => {\n // 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 cfSsrClassName = resolveDesignValue(\n cfSsrClassNameValues?.valuesByBreakpoint,\n 'cfSsrClassName',\n );\n\n // Don't enrich the assembly wrapper node with props\n if (!componentRegistration || isAssembly) {\n return { cfSsrClassName };\n }\n\n const propMap: Record<string, PrimitiveValue> = {\n cfSsrClassName:\n node.id && getPatternChildNodeClassName\n ? getPatternChildNodeClassName(node.id)\n : cfSsrClassName,\n };\n\n const props = Object.entries(componentRegistration.definition.variables).reduce(\n (acc, [variableName, variableDefinition]) => {\n const variable = node.variables[variableName];\n if (!variable) return acc;\n\n switch (variable.type) {\n case 'DesignValue':\n acc[variableName] = resolveDesignValue(variable.valuesByBreakpoint, variableName);\n break;\n case 'BoundValue': {\n const [, uuid] = variable.path.split('/');\n const binding = entityStore.dataSource[uuid] as UnresolvedLink<'Entry' | 'Asset'>;\n\n const value = transformBoundContentValue(\n node.variables,\n entityStore,\n binding,\n resolveDesignValue,\n variableName,\n variableDefinition,\n variable.path,\n );\n acc[variableName] = value ?? variableDefinition.defaultValue;\n break;\n }\n\n case 'HyperlinkValue': {\n const binding = entityStore.dataSource[variable.linkTargetKey];\n const hyperlinkEntry = entityStore.getEntryOrAsset(binding, variable.linkTargetKey);\n\n const value = resolveHyperlinkPattern(\n componentRegistration.definition.hyperlinkPattern ||\n hyperlinkPattern ||\n HYPERLINK_DEFAULT_PATTERN,\n hyperlinkEntry as Entry,\n locale,\n );\n if (value) {\n acc[variableName] = value;\n }\n break;\n }\n case 'UnboundValue': {\n const uuid = variable.key;\n acc[variableName] =\n entityStore.unboundValues[uuid]?.value ?? variableDefinition.defaultValue;\n break;\n }\n case 'ComponentValue':\n // We're rendering a pattern entry. Content cannot be set for ComponentValue type properties\n // directly in the pattern so we can safely use the default value\n // This can either a design (style) or a content variable\n acc[variableName] = variableDefinition.defaultValue;\n break;\n default:\n break;\n }\n return acc;\n },\n propMap,\n );\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 props[slotId] = (\n <CompositionBlock\n node={slotNode}\n locale={locale}\n hyperlinkPattern={hyperlinkPattern}\n entityStore={entityStore}\n resolveDesignValue={resolveDesignValue}\n />\n );\n }\n }\n }\n\n return props;\n }, [\n resolveDesignValue,\n node.variables,\n node.id,\n node.children,\n componentRegistration,\n isAssembly,\n getPatternChildNodeClassName,\n entityStore,\n hyperlinkPattern,\n locale,\n ]);\n\n const className = useClassName({ props: nodeProps, node });\n\n if (!componentRegistration) {\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 (isAssembly) {\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?.[childNodeId];\n if (!classesForNode) return undefined;\n return resolveDesignValue(classesForNode.valuesByBreakpoint, 'cfSsrClassName') 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 isAssembly || 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 />\n );\n })\n : null;\n\n if (\n [CONTENTFUL_COMPONENTS.container.id, CONTENTFUL_COMPONENTS.section.id].includes(\n node.definitionId,\n )\n ) {\n return (\n <ContentfulContainer\n editorMode={false}\n cfHyperlink={(nodeProps as StyleProps).cfHyperlink}\n cfOpenInNewTab={(nodeProps as StyleProps).cfOpenInNewTab}\n className={className}>\n {children}\n </ContentfulContainer>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.columns.id) {\n return (\n <Columns editorMode={false} className={className}>\n {children}\n </Columns>\n );\n }\n\n if (node.definitionId === CONTENTFUL_COMPONENTS.singleColumn.id) {\n return (\n <SingleColumn editorMode={false} className={className}>\n {children}\n </SingleColumn>\n );\n }\n\n if (\n node.definitionId === CONTENTFUL_COMPONENTS.image.id &&\n node.variables.cfImageAsset?.type === 'UnboundValue'\n ) {\n return <PreviewUnboundImage node={node} nodeProps={nodeProps} component={component} />;\n }\n\n return React.createElement(\n component,\n {\n ...sanitizeNodeProps(nodeProps),\n className,\n },\n children ?? (typeof nodeProps.children === 'string' ? nodeProps.children : null),\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;;;;MAyCa,gBAAgB,GAAG,CAAC,EAC/B,IAAI,EAAE,OAAO,EACb,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,GACN,KAAI;IAC1B,MAAM,UAAU,GAAG,OAAO,CACxB,MACE,mBAAmB,CAAC;QAClB,WAAW,EAAE,OAAO,CAAC,YAAY;QACjC,cAAc,EAAE,WAAW,CAAC,cAAc;KAC3C,CAAC,EACJ,CAAC,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CACnD,CAAC;AAEF,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAK;AACxB,QAAA,OAAO,UAAU;cACb,eAAe,CAAC;AACd,gBAAA,IAAI,EAAE,OAAO;gBACb,WAAW;aACZ,CAAC;cACF,OAAO,CAAC;KACb,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvC,IAAA,MAAM,qBAAqB,GAAG,OAAO,CAAC,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AE,SAAS,EAAA,QAAA,EAC7C,QAAQ,EAAA,CACD,EACV;KACH;IAED,IAAI,IAAI,CAAC,YAAY,KAAK,qBAAqB,CAAC,YAAY,CAAC,EAAE,EAAE;AAC/D,QAAA,QACEA,GAAA,CAAC,YAAY,EAAA,EAAC,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAA,QAAA,EAClD,QAAQ,EAAA,CACI,EACf;KACH;IAED,IACE,IAAI,CAAC,YAAY,KAAK,qBAAqB,CAAC,KAAK,CAAC,EAAE;QACpD,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,KAAK,cAAc,EACpD;AACA,QAAA,OAAOA,GAAC,CAAA,mBAAmB,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC;KACxF;AAED,IAAA,OAAO,KAAK,CAAC,aAAa,CACxB,SAAS,EACT;QACE,GAAG,iBAAiB,CAAC,SAAS,CAAC;QAC/B,SAAS;KACV,EACD,QAAQ,KAAK,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CACjF,CAAC;AACJ;;;;"}
@@ -6,7 +6,7 @@ import { sdkFeatures } from '../core/sdkFeatures.js';
6
6
 
7
7
  const useDetectCanvasMode = ({ isClientSide = false } = {}) => {
8
8
  const [mounted, setMounted] = useState(false);
9
- const receivedModeMessage = useRef(false);
9
+ const recievedModeMessage = useRef(false);
10
10
  const [mode, setMode] = useState(() => {
11
11
  // if we are client side and running in an iframe, then initialize to read only,
12
12
  // Editor mode can be requested later.
@@ -29,7 +29,7 @@ const useDetectCanvasMode = ({ isClientSide = false } = {}) => {
29
29
  }
30
30
  const isEditorMode = eventData.eventType === INCOMING_EVENTS.RequestEditorMode;
31
31
  const mode = isEditorMode ? StudioCanvasMode.EDITOR : StudioCanvasMode.READ_ONLY;
32
- receivedModeMessage.current = true;
32
+ recievedModeMessage.current = true;
33
33
  setMode(mode);
34
34
  if (typeof window !== 'undefined') {
35
35
  // Once we definitely know that we are in editor mode, we set this flag so future postMessage connect calls are not made
@@ -43,7 +43,7 @@ const useDetectCanvasMode = ({ isClientSide = false } = {}) => {
43
43
  }, []);
44
44
  useEffect(() => {
45
45
  const handleHandshakeTimeout = () => {
46
- if (!receivedModeMessage.current) {
46
+ if (!recievedModeMessage.current) {
47
47
  setMode(StudioCanvasMode.NONE);
48
48
  }
49
49
  };
@@ -54,19 +54,14 @@ const useDetectCanvasMode = ({ isClientSide = false } = {}) => {
54
54
  window.addEventListener('message', onMessage);
55
55
  sendMessage(OUTGOING_EVENTS.Connected, undefined);
56
56
  sendMessage(OUTGOING_EVENTS.SDKFeatures, sdkFeatures);
57
- // FIXME: This causes a race condition by setting the mode sometimes to NONE when
58
- // reloading the canvas due to a save event.
59
- const handshakeTimeout = setTimeout(handleHandshakeTimeout, 100);
60
- return () => {
61
- window.removeEventListener('message', onMessage);
62
- clearTimeout(handshakeTimeout);
63
- };
57
+ setTimeout(handleHandshakeTimeout, 100);
64
58
  }
65
59
  }
66
60
  else {
67
61
  setMounted(true);
68
62
  }
69
- }, [mode, mounted, onMessage]);
63
+ return () => window.removeEventListener('message', onMessage);
64
+ }, [mounted, onMessage]);
70
65
  return mode;
71
66
  };
72
67
  function inIframe() {
@@ -1 +1 @@
1
- {"version":3,"file":"useDetectCanvasMode.js","sources":["../../../src/hooks/useDetectCanvasMode.tsx"],"sourcesContent":["'use client';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n doesMismatchMessageSchema,\n sendMessage,\n tryParseMessage,\n} from '@contentful/experiences-core';\nimport {\n INCOMING_EVENTS,\n OUTGOING_EVENTS,\n StudioCanvasMode,\n} from '@contentful/experiences-core/constants';\nimport { sdkFeatures } from '../core/sdkFeatures';\n\ntype useDetectCanvasModeArgs = {\n /** If running from a known client side only situation (ie: useFetchBySlug),\n * set this to true to kick in editor mode check sooner (which avoids a render cycle) */\n isClientSide?: boolean;\n};\n\nexport const useDetectCanvasMode = ({ isClientSide = false }: useDetectCanvasModeArgs = {}) => {\n const [mounted, setMounted] = useState(false);\n const receivedModeMessage = useRef(false);\n const [mode, setMode] = useState<StudioCanvasMode>(() => {\n // if we are client side and running in an iframe, then initialize to read only,\n // Editor mode can be requested later.\n if (isClientSide && inIframe()) {\n return StudioCanvasMode.READ_ONLY;\n } else {\n return StudioCanvasMode.NONE;\n }\n });\n\n const onMessage = useCallback((event: MessageEvent) => {\n if (doesMismatchMessageSchema(event)) {\n return;\n }\n const eventData = tryParseMessage(event);\n const isRequestingCanvasMode =\n eventData.eventType === INCOMING_EVENTS.RequestEditorMode ||\n eventData.eventType === INCOMING_EVENTS.RequestReadOnlyMode;\n\n if (!isRequestingCanvasMode) {\n return;\n }\n\n const isEditorMode = eventData.eventType === INCOMING_EVENTS.RequestEditorMode;\n const mode = isEditorMode ? StudioCanvasMode.EDITOR : StudioCanvasMode.READ_ONLY;\n\n receivedModeMessage.current = true;\n setMode(mode);\n\n if (typeof window !== 'undefined') {\n // Once we definitely know that we are in editor mode, we set this flag so future postMessage connect calls are not made\n if (!window.__EB__) {\n window.__EB__ = {};\n }\n window.__EB__.isReadOnlyMode = !isEditorMode;\n window.__EB__.isEditorMode = isEditorMode;\n }\n\n window.removeEventListener('message', onMessage);\n }, []);\n\n useEffect(() => {\n const handleHandshakeTimeout = () => {\n if (!receivedModeMessage.current) {\n setMode(StudioCanvasMode.NONE);\n }\n };\n\n // Only run check after component is mounted on the client to avoid hydration ssr issues\n if (mounted) {\n // Double check if we are in editor mode by listening to postMessage events\n if (typeof window !== 'undefined') {\n window.addEventListener('message', onMessage);\n sendMessage(OUTGOING_EVENTS.Connected, undefined);\n sendMessage(OUTGOING_EVENTS.SDKFeatures, sdkFeatures);\n\n // FIXME: This causes a race condition by setting the mode sometimes to NONE when\n // reloading the canvas due to a save event.\n const handshakeTimeout = setTimeout(handleHandshakeTimeout, 100);\n\n return () => {\n window.removeEventListener('message', onMessage);\n clearTimeout(handshakeTimeout);\n };\n }\n } else {\n setMounted(true);\n }\n }, [mode, mounted, onMessage]);\n\n return mode;\n};\n\nfunction inIframe() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return false;\n }\n}\n"],"names":[],"mappings":";;;;;;AAoBO;;AAEL;;;;AAIE;;;;;;AAKF;AAEA;AACE;;;AAGA;;AAGE;;;;;AAOF;AAEA;;AAGA;;AAEE;AACE;;AAEF;AACA;;AAGF;;;;AAKE;AACE;;AAEJ;;;;AAKE;AACE;AACA;AACA;;;;AAMA;AACE;;AAEF;;;;;;;AAON;AACF;AAEA;AACE;AACE;;;AAEA;;AAEJ;;"}
1
+ {"version":3,"file":"useDetectCanvasMode.js","sources":["../../../src/hooks/useDetectCanvasMode.tsx"],"sourcesContent":["'use client';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n doesMismatchMessageSchema,\n sendMessage,\n tryParseMessage,\n} from '@contentful/experiences-core';\nimport {\n INCOMING_EVENTS,\n OUTGOING_EVENTS,\n StudioCanvasMode,\n} from '@contentful/experiences-core/constants';\nimport { sdkFeatures } from '../core/sdkFeatures';\n\ntype useDetectCanvasModeArgs = {\n /** If running from a known client side only situation (ie: useFetchBySlug),\n * set this to true to kick in editor mode check sooner (which avoids a render cycle) */\n isClientSide?: boolean;\n};\n\nexport const useDetectCanvasMode = ({ isClientSide = false }: useDetectCanvasModeArgs = {}) => {\n const [mounted, setMounted] = useState(false);\n const recievedModeMessage = useRef(false);\n const [mode, setMode] = useState<StudioCanvasMode>(() => {\n // if we are client side and running in an iframe, then initialize to read only,\n // Editor mode can be requested later.\n if (isClientSide && inIframe()) {\n return StudioCanvasMode.READ_ONLY;\n } else {\n return StudioCanvasMode.NONE;\n }\n });\n\n const onMessage = useCallback((event: MessageEvent) => {\n if (doesMismatchMessageSchema(event)) {\n return;\n }\n const eventData = tryParseMessage(event);\n const isRequestingCanvasMode =\n eventData.eventType === INCOMING_EVENTS.RequestEditorMode ||\n eventData.eventType === INCOMING_EVENTS.RequestReadOnlyMode;\n\n if (!isRequestingCanvasMode) {\n return;\n }\n\n const isEditorMode = eventData.eventType === INCOMING_EVENTS.RequestEditorMode;\n const mode = isEditorMode ? StudioCanvasMode.EDITOR : StudioCanvasMode.READ_ONLY;\n\n recievedModeMessage.current = true;\n setMode(mode);\n\n if (typeof window !== 'undefined') {\n // Once we definitely know that we are in editor mode, we set this flag so future postMessage connect calls are not made\n if (!window.__EB__) {\n window.__EB__ = {};\n }\n window.__EB__.isReadOnlyMode = !isEditorMode;\n window.__EB__.isEditorMode = isEditorMode;\n }\n\n window.removeEventListener('message', onMessage);\n }, []);\n\n useEffect(() => {\n const handleHandshakeTimeout = () => {\n if (!recievedModeMessage.current) {\n setMode(StudioCanvasMode.NONE);\n }\n };\n\n // Only run check after component is mounted on the client to avoid hydration ssr issues\n if (mounted) {\n // Double check if we are in editor mode by listening to postMessage events\n if (typeof window !== 'undefined') {\n window.addEventListener('message', onMessage);\n sendMessage(OUTGOING_EVENTS.Connected, undefined);\n sendMessage(OUTGOING_EVENTS.SDKFeatures, sdkFeatures);\n\n setTimeout(handleHandshakeTimeout, 100);\n }\n } else {\n setMounted(true);\n }\n\n return () => window.removeEventListener('message', onMessage);\n }, [mounted, onMessage]);\n\n return mode;\n};\n\nfunction inIframe() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return false;\n }\n}\n"],"names":[],"mappings":";;;;;;AAoBO;;AAEL;;;;AAIE;;;;;;AAKF;AAEA;AACE;;;AAGA;;AAGE;;;;;AAOF;AAEA;;AAGA;;AAEE;AACE;;AAEF;AACA;;AAGF;;;;AAKE;AACE;;AAEJ;;;;AAKE;AACE;AACA;AACA;AAEA;;;;;;;AAON;AAEA;AACF;AAEA;AACE;AACE;;;AAEA;;AAEJ;;"}
@@ -27,16 +27,6 @@ const useFetchByBase = (fetchMethod, mode) => {
27
27
  }
28
28
  })();
29
29
  }, [fetchMethod, mode]);
30
- // When a save event caused a canvas reload, the `receivedModeMessage` might time out and set the
31
- // mode temporarily to NONE. If it's set to a valid mode afterward, we ignore the fetch result.
32
- if (mode === StudioCanvasMode.EDITOR || mode === StudioCanvasMode.READ_ONLY) {
33
- return {
34
- error: undefined,
35
- experience: undefined,
36
- isLoading: false,
37
- mode,
38
- };
39
- }
40
30
  return {
41
31
  error,
42
32
  experience,
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchByBase.js","sources":["../../../src/hooks/useFetchByBase.ts"],"sourcesContent":["'use client';\nimport { useEffect, useState } from 'react';\nimport { EntityStore } from '@contentful/experiences-core';\nimport type { Experience } from '@contentful/experiences-core/types';\nimport { StudioCanvasMode } from '@contentful/experiences-core/constants';\n\nexport const useFetchByBase = (\n fetchMethod: () => Promise<Experience<EntityStore> | undefined>,\n mode: StudioCanvasMode,\n) => {\n const [experience, setExperience] = useState<Experience<EntityStore>>();\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error>();\n\n useEffect(() => {\n (async () => {\n // if we are in editor/read only mode, we don't want to fetch the experience here\n // it is passed via postMessage instead\n if (mode === StudioCanvasMode.EDITOR || mode === StudioCanvasMode.READ_ONLY) {\n return;\n }\n setIsLoading(true);\n setError(undefined);\n try {\n const exp = await fetchMethod();\n setExperience(exp);\n } catch (error) {\n setError(error as Error);\n } finally {\n setIsLoading(false);\n }\n })();\n }, [fetchMethod, mode]);\n\n // When a save event caused a canvas reload, the `receivedModeMessage` might time out and set the\n // mode temporarily to NONE. If it's set to a valid mode afterward, we ignore the fetch result.\n if (mode === StudioCanvasMode.EDITOR || mode === StudioCanvasMode.READ_ONLY) {\n return {\n error: undefined,\n experience: undefined,\n isLoading: false,\n mode,\n };\n }\n\n return {\n error,\n experience,\n isLoading,\n mode,\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAkBM;;;;;AAKA;AACE;;;;;;;;;;AAQN;;;AAIA;;AAEI;AACA;AACA;;;;;;;;;;AAWN;;"}
1
+ {"version":3,"file":"useFetchByBase.js","sources":["../../../src/hooks/useFetchByBase.ts"],"sourcesContent":["'use client';\nimport { useEffect, useState } from 'react';\nimport { EntityStore } from '@contentful/experiences-core';\nimport type { Experience } from '@contentful/experiences-core/types';\nimport { StudioCanvasMode } from '@contentful/experiences-core/constants';\n\nexport const useFetchByBase = (\n fetchMethod: () => Promise<Experience<EntityStore> | undefined>,\n mode: StudioCanvasMode,\n) => {\n const [experience, setExperience] = useState<Experience<EntityStore>>();\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error>();\n\n useEffect(() => {\n (async () => {\n // if we are in editor/read only mode, we don't want to fetch the experience here\n // it is passed via postMessage instead\n if (mode === StudioCanvasMode.EDITOR || mode === StudioCanvasMode.READ_ONLY) {\n return;\n }\n setIsLoading(true);\n setError(undefined);\n try {\n const exp = await fetchMethod();\n setExperience(exp);\n } catch (error) {\n setError(error as Error);\n } finally {\n setIsLoading(false);\n }\n })();\n }, [fetchMethod, mode]);\n\n return {\n error,\n experience,\n isLoading,\n mode,\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAkBM;;;;;AAKA;AACE;;;;;;;;;;AAQN;;;;;;;AAQF;;"}
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.30.0-beta.0";
11
+ declare const SDK_VERSION = "1.30.0-dev-20250124T1739-560b81b.0";
12
12
 
13
13
  type ExperienceRootProps = {
14
14
  experience?: Experience<EntityStore> | string | null;
@@ -25,21 +25,13 @@ type UseFetchByIdArgs = {
25
25
  hyperlinkPattern?: string;
26
26
  };
27
27
  declare const useFetchById: ({ id, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchByIdArgs) => {
28
- experience: {
29
- hyperlinkPattern: string | undefined;
30
- entityStore?: _contentful_experiences_core.EntityStore | undefined;
31
- };
32
- error: undefined;
33
- isLoading: boolean;
34
- mode: _contentful_experiences_core_constants.StudioCanvasMode.READ_ONLY | _contentful_experiences_core_constants.StudioCanvasMode.EDITOR;
35
- } | {
36
28
  experience: {
37
29
  hyperlinkPattern: string | undefined;
38
30
  entityStore?: _contentful_experiences_core.EntityStore | undefined;
39
31
  };
40
32
  error: Error | undefined;
41
33
  isLoading: boolean;
42
- mode: _contentful_experiences_core_constants.StudioCanvasMode.NONE;
34
+ mode: _contentful_experiences_core_constants.StudioCanvasMode;
43
35
  };
44
36
 
45
37
  type UseFetchBySlugArgs = {
@@ -51,21 +43,13 @@ type UseFetchBySlugArgs = {
51
43
  hyperlinkPattern?: string;
52
44
  };
53
45
  declare const useFetchBySlug: ({ slug, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchBySlugArgs) => {
54
- experience: {
55
- hyperlinkPattern: string | undefined;
56
- entityStore?: _contentful_experiences_core.EntityStore | undefined;
57
- };
58
- error: undefined;
59
- isLoading: boolean;
60
- mode: _contentful_experiences_core_constants.StudioCanvasMode.READ_ONLY | _contentful_experiences_core_constants.StudioCanvasMode.EDITOR;
61
- } | {
62
46
  experience: {
63
47
  hyperlinkPattern: string | undefined;
64
48
  entityStore?: _contentful_experiences_core.EntityStore | undefined;
65
49
  };
66
50
  error: Error | undefined;
67
51
  isLoading: boolean;
68
- mode: _contentful_experiences_core_constants.StudioCanvasMode.NONE;
52
+ mode: _contentful_experiences_core_constants.StudioCanvasMode;
69
53
  };
70
54
 
71
55
  /**
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = '1.30.0-beta.0';
1
+ const SDK_VERSION = '1.30.0-dev-20250124T1739-560b81b.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.30.0-beta.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
1
+ {"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '1.30.0-dev-20250124T1739-560b81b.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
@@ -7,7 +7,6 @@ type CompositionBlockProps = {
7
7
  hyperlinkPattern?: string | undefined;
8
8
  resolveDesignValue: ResolveDesignValueType;
9
9
  getPatternChildNodeClassName?: (childNodeId: string) => string | undefined;
10
- wrappingPatternIds?: Set<string>;
11
10
  };
12
- export declare const CompositionBlock: ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, getPatternChildNodeClassName, wrappingPatternIds: parentWrappingPatternIds, }: CompositionBlockProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ export declare const CompositionBlock: ({ node: rawNode, locale, entityStore, hyperlinkPattern, resolveDesignValue, getPatternChildNodeClassName, }: CompositionBlockProps) => import("react/jsx-runtime").JSX.Element | null;
13
12
  export {};
@@ -2,13 +2,8 @@ import { EntityStore } from '@contentful/experiences-core';
2
2
  import type { Experience } from '@contentful/experiences-core/types';
3
3
  import { StudioCanvasMode } from '@contentful/experiences-core/constants';
4
4
  export declare const useFetchByBase: (fetchMethod: () => Promise<Experience<EntityStore> | undefined>, mode: StudioCanvasMode) => {
5
- error: undefined;
6
- experience: undefined;
7
- isLoading: boolean;
8
- mode: StudioCanvasMode.READ_ONLY | StudioCanvasMode.EDITOR;
9
- } | {
10
5
  error: Error | undefined;
11
6
  experience: Experience<EntityStore> | undefined;
12
7
  isLoading: boolean;
13
- mode: StudioCanvasMode.NONE;
8
+ mode: StudioCanvasMode;
14
9
  };
@@ -7,19 +7,11 @@ export type UseFetchByIdArgs = {
7
7
  hyperlinkPattern?: string;
8
8
  };
9
9
  export declare const useFetchById: ({ id, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchByIdArgs) => {
10
- experience: {
11
- hyperlinkPattern: string | undefined;
12
- entityStore?: import("@contentful/experiences-core").EntityStore | undefined;
13
- };
14
- error: undefined;
15
- isLoading: boolean;
16
- mode: import("@contentful/experiences-core/constants").StudioCanvasMode.READ_ONLY | import("@contentful/experiences-core/constants").StudioCanvasMode.EDITOR;
17
- } | {
18
10
  experience: {
19
11
  hyperlinkPattern: string | undefined;
20
12
  entityStore?: import("@contentful/experiences-core").EntityStore | undefined;
21
13
  };
22
14
  error: Error | undefined;
23
15
  isLoading: boolean;
24
- mode: import("@contentful/experiences-core/constants").StudioCanvasMode.NONE;
16
+ mode: import("@contentful/experiences-core/constants").StudioCanvasMode;
25
17
  };
@@ -8,19 +8,11 @@ export type UseFetchBySlugArgs = {
8
8
  hyperlinkPattern?: string;
9
9
  };
10
10
  export declare const useFetchBySlug: ({ slug, localeCode, client, experienceTypeId, hyperlinkPattern, }: UseFetchBySlugArgs) => {
11
- experience: {
12
- hyperlinkPattern: string | undefined;
13
- entityStore?: import("@contentful/experiences-core").EntityStore | undefined;
14
- };
15
- error: undefined;
16
- isLoading: boolean;
17
- mode: import("@contentful/experiences-core/constants").StudioCanvasMode.READ_ONLY | import("@contentful/experiences-core/constants").StudioCanvasMode.EDITOR;
18
- } | {
19
11
  experience: {
20
12
  hyperlinkPattern: string | undefined;
21
13
  entityStore?: import("@contentful/experiences-core").EntityStore | undefined;
22
14
  };
23
15
  error: Error | undefined;
24
16
  isLoading: boolean;
25
- mode: import("@contentful/experiences-core/constants").StudioCanvasMode.NONE;
17
+ mode: import("@contentful/experiences-core/constants").StudioCanvasMode;
26
18
  };
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.30.0-beta.0";
1
+ export declare const SDK_VERSION = "1.30.0-dev-20250124T1739-560b81b.0";
@@ -1,12 +1,105 @@
1
- import type { ExperienceEntry, ExperienceTreeNode, SchemaVersions } from '@contentful/experiences-core/types';
1
+ import type { ExperienceTreeNode, SchemaVersions } from '@contentful/experiences-core/types';
2
2
  type createAssemblyEntryArgs = {
3
- schemaVersion?: SchemaVersions;
4
- id?: string;
3
+ schemaVersion: SchemaVersions;
4
+ id: string;
5
5
  };
6
6
  export declare const defaultAssemblyId = "assembly-id";
7
7
  export declare const assemblyGeneratedVariableName = "text_uuid1Assembly";
8
8
  export declare const assemblyGeneratedDesignVariableName = "cfWidth_uuid2Assembly";
9
- export declare const createAssemblyEntry: ({ schemaVersion, id, }?: createAssemblyEntryArgs) => ExperienceEntry;
9
+ export declare const createAssemblyEntry: ({ schemaVersion, id, }: createAssemblyEntryArgs) => {
10
+ sys: {
11
+ id: string;
12
+ type: string;
13
+ contentType: {
14
+ sys: {
15
+ id: string;
16
+ type: string;
17
+ linkType: string;
18
+ };
19
+ };
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ revision: number;
23
+ space: {
24
+ sys: {
25
+ type: string;
26
+ linkType: string;
27
+ id: string;
28
+ };
29
+ };
30
+ environment: {
31
+ sys: {
32
+ type: string;
33
+ linkType: string;
34
+ id: string;
35
+ };
36
+ };
37
+ };
38
+ metadata: {
39
+ tags: never[];
40
+ };
41
+ fields: {
42
+ title: string;
43
+ slug: string;
44
+ componentTree: {
45
+ children: {
46
+ definitionId: string;
47
+ variables: {
48
+ cfWidth: {
49
+ type: string;
50
+ key: string;
51
+ };
52
+ };
53
+ children: {
54
+ definitionId: string;
55
+ variables: {
56
+ text: {
57
+ key: string;
58
+ type: string;
59
+ };
60
+ };
61
+ children: never[];
62
+ }[];
63
+ }[];
64
+ breakpoints: {
65
+ id: string;
66
+ query: string;
67
+ previewSize: string;
68
+ displayName: string;
69
+ }[];
70
+ schemaVersion: "2023-09-28";
71
+ };
72
+ dataSource: {};
73
+ unboundValues: {
74
+ unbound_uuid1Assembly: {
75
+ value: string;
76
+ };
77
+ };
78
+ componentSettings: {
79
+ variableDefinitions: {
80
+ text_uuid1Assembly: {
81
+ displayName: string;
82
+ type: "Text";
83
+ defaultValue: {
84
+ type: "UnboundValue";
85
+ key: string;
86
+ };
87
+ };
88
+ cfWidth_uuid2Assembly: {
89
+ displayName: string;
90
+ type: "Text";
91
+ group: string;
92
+ defaultValue: {
93
+ type: "DesignValue";
94
+ valuesByBreakpoint: {
95
+ desktop: string;
96
+ };
97
+ };
98
+ };
99
+ };
100
+ };
101
+ };
102
+ };
10
103
  type createAssemblyNodeArgs = {
11
104
  id: string;
12
105
  blockId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-sdk-react",
3
- "version": "1.30.0-beta.0",
3
+ "version": "1.30.0-dev-20250124T1739-560b81b.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.30.0-beta.0",
45
- "@contentful/experiences-core": "1.30.0-beta.0",
46
- "@contentful/experiences-validators": "1.30.0-beta.0",
47
- "@contentful/experiences-visual-editor-react": "1.30.0-beta.0",
44
+ "@contentful/experiences-components-react": "1.30.0-dev-20250124T1739-560b81b.0",
45
+ "@contentful/experiences-core": "1.30.0-dev-20250124T1739-560b81b.0",
46
+ "@contentful/experiences-validators": "1.30.0-dev-20250124T1739-560b81b.0",
47
+ "@contentful/experiences-visual-editor-react": "1.30.0-dev-20250124T1739-560b81b.0",
48
48
  "@contentful/rich-text-types": "^17.0.0",
49
49
  "classnames": "^2.3.2",
50
50
  "csstype": "^3.1.2",
@@ -102,5 +102,5 @@
102
102
  "dist",
103
103
  "package.json"
104
104
  ],
105
- "gitHead": "45ca050ef033d85d4505afd35860069171fcc179"
105
+ "gitHead": "5c79b509edb4485c183c4a9b5b44900498698825"
106
106
  }