@contentful/experiences-sdk-react 1.37.1-dev-20250514T1115-cc6f809.0 → 1.37.1-dev-20250515T1211-cc16b86.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.
- package/dist/core/preview/assemblyUtils.js +0 -8
- package/dist/core/preview/assemblyUtils.js.map +1 -1
- package/dist/core/sdkFeatures.js +0 -2
- package/dist/core/sdkFeatures.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/sdkVersion.js +1 -1
- package/dist/sdkVersion.js.map +1 -1
- package/dist/src/sdkVersion.d.ts +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { checkIsAssemblyNode } from '@contentful/experiences-core';
|
|
2
1
|
import md5 from 'md5';
|
|
3
2
|
import { shouldUsePrebinding, resolvePrebindingPath } from '../../utils/prebindingUtils.js';
|
|
4
3
|
import { PATTERN_PROPERTY_DIVIDER } from '@contentful/experiences-core/constants';
|
|
@@ -88,13 +87,6 @@ const deserializeAssemblyNode = ({ node, componentInstanceVariables, componentSe
|
|
|
88
87
|
};
|
|
89
88
|
};
|
|
90
89
|
const resolveAssembly = ({ node, parentPatternProperties, patternNodeIdsChain, entityStore, }) => {
|
|
91
|
-
const isAssembly = checkIsAssemblyNode({
|
|
92
|
-
componentId: node.definitionId,
|
|
93
|
-
usedComponents: entityStore.usedComponents,
|
|
94
|
-
});
|
|
95
|
-
if (!isAssembly) {
|
|
96
|
-
return node;
|
|
97
|
-
}
|
|
98
90
|
const componentId = node.definitionId;
|
|
99
91
|
const assembly = entityStore.usedComponents?.find((component) => component.sys.id === componentId);
|
|
100
92
|
if (!assembly || !('fields' in assembly)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assemblyUtils.js","sources":["../../../../src/core/preview/assemblyUtils.ts"],"sourcesContent":["import {
|
|
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 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 assembly definition on the instance, this function will replace all\n * ComponentValue in the definitions tree with the actual value on the instance. */\nexport const deserializeAssemblyNode = ({\n node,\n componentInstanceVariables,\n componentSettings,\n patternProperties,\n}: {\n node: ComponentTreeNode;\n componentInstanceVariables: ComponentTreeNode['variables'];\n componentSettings: ExperienceComponentSettings;\n patternProperties: Record<string, PatternProperty>;\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 patternProperties,\n variable: instanceProperty,\n });\n const path = resolvePrebindingPath({\n componentSettings,\n componentValueKey,\n patternProperties,\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 deserializeAssemblyNode({\n node: child,\n componentInstanceVariables,\n componentSettings,\n patternProperties,\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 patternProperties: node.patternProperties,\n };\n};\n\nexport const resolveAssembly = ({\n node,\n parentPatternProperties,\n patternNodeIdsChain,\n entityStore,\n}: {\n node: ComponentTreeNode;\n entityStore: EntityStore;\n parentPatternProperties: Record<string, PatternProperty>;\n patternNodeIdsChain: 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 patternProperties: Record<string, PatternProperty> = {};\n\n const allPatternProperties = {\n ...parentPatternProperties,\n ...(node.patternProperties || {}),\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, patternPropertyDefinitionId] =\n patternPropertyKey.split(PATTERN_PROPERTY_DIVIDER);\n\n const hashedNodeChain = md5(patternNodeIdsChain || '');\n\n const isMatchingNode = hashKey === hashedNodeChain;\n\n if (!isMatchingNode) continue;\n\n patternProperties[patternPropertyDefinitionId] = patternProperty;\n }\n\n const componentFields = assembly.fields;\n\n const deserializedNode = deserializeAssemblyNode({\n node: {\n definitionId: node.definitionId,\n id: node.id,\n variables: node.variables,\n children: componentFields.componentTree.children,\n patternProperties,\n },\n componentInstanceVariables: node.variables,\n componentSettings: componentFields.componentSettings!,\n patternProperties,\n });\n\n entityStore.addAssemblyUnboundValues(componentFields.unboundValues);\n\n return deserializedNode;\n};\n"],"names":[],"mappings":";;;;AAYA;AACmF;AAC5E,MAAM,uBAAuB,GAAG,CAAC,EACtC,IAAI,EACJ,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,GAMlB,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;gBACjB,iBAAiB;AACjB,gBAAA,QAAQ,EAAE,gBAAgB;AAC3B,aAAA,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,qBAAqB,CAAC;gBACjC,iBAAiB;gBACjB,iBAAiB;gBACjB,iBAAiB;AAClB,aAAA,CAAC,CAAC;AAEH,YAAA,IAAI,aAAa,IAAI,IAAI,EAAE;gBACzB,SAAS,CAAC,YAAY,CAAC,GAAG;AACxB,oBAAA,IAAI,EAAE,YAAY;oBAClB,IAAI;iBACL,CAAC;;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AAc,GAAG,OAAO,KAAK,eAAe,CAAC;AAEnD,QAAA,IAAI,CAAC,cAAc;YAAE,SAAS;AAE9B,QAAA,iBAAiB,CAAC,2BAA2B,CAAC,GAAG,eAAe,CAAC;KAClE;AAED,IAAA,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC;IAExC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAC/C,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;YAChD,iBAAiB;AAClB,SAAA;QACD,0BAA0B,EAAE,IAAI,CAAC,SAAS;QAC1C,iBAAiB,EAAE,eAAe,CAAC,iBAAkB;QACrD,iBAAiB;AAClB,KAAA,CAAC,CAAC;AAEH,IAAA,WAAW,CAAC,wBAAwB,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;AAEpE,IAAA,OAAO,gBAAgB,CAAC;AAC1B;;;;"}
|
package/dist/core/sdkFeatures.js
CHANGED
|
@@ -4,8 +4,6 @@ const sdkFeatures = {
|
|
|
4
4
|
hasVersionHistory: true,
|
|
5
5
|
cfVisibility: true,
|
|
6
6
|
patternResolution: true,
|
|
7
|
-
// [SPA-2602] allow merging the default and overwriting design values for patterns by breakpoint
|
|
8
|
-
patternBreakpointDesignValues: true,
|
|
9
7
|
};
|
|
10
8
|
|
|
11
9
|
export { sdkFeatures };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkFeatures.js","sources":["../../../src/core/sdkFeatures.ts"],"sourcesContent":["// Object to store the SDK features that are enabled/disabled\nexport const sdkFeatures: Record<string, unknown> = {\n hasSDKVersionUI: true,\n hasVersionHistory: true,\n cfVisibility: true,\n patternResolution: true,\n
|
|
1
|
+
{"version":3,"file":"sdkFeatures.js","sources":["../../../src/core/sdkFeatures.ts"],"sourcesContent":["// Object to store the SDK features that are enabled/disabled\nexport const sdkFeatures: Record<string, unknown> = {\n hasSDKVersionUI: true,\n hasVersionHistory: true,\n cfVisibility: true,\n patternResolution: true,\n};\n"],"names":[],"mappings":"AAAA;AACa,MAAA,WAAW,GAA4B;AAClD,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,iBAAiB,EAAE,IAAI;;;;;"}
|
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.37.1-dev-
|
|
11
|
+
declare const SDK_VERSION = "1.37.1-dev-20250515T1211-cc16b86.0";
|
|
12
12
|
|
|
13
13
|
type ExperienceRootProps = {
|
|
14
14
|
experience?: Experience<EntityStore> | string | null;
|
package/dist/sdkVersion.js
CHANGED
package/dist/sdkVersion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '1.37.1-dev-
|
|
1
|
+
{"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '1.37.1-dev-20250515T1211-cc16b86.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
|
package/dist/src/sdkVersion.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.37.1-dev-
|
|
1
|
+
export declare const SDK_VERSION = "1.37.1-dev-20250515T1211-cc16b86.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-sdk-react",
|
|
3
|
-
"version": "1.37.1-dev-
|
|
3
|
+
"version": "1.37.1-dev-20250515T1211-cc16b86.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.37.1-dev-
|
|
45
|
-
"@contentful/experiences-core": "1.37.1-dev-
|
|
46
|
-
"@contentful/experiences-validators": "1.37.1-dev-
|
|
47
|
-
"@contentful/experiences-visual-editor-react": "1.37.1-dev-
|
|
44
|
+
"@contentful/experiences-components-react": "1.37.1-dev-20250515T1211-cc16b86.0",
|
|
45
|
+
"@contentful/experiences-core": "1.37.1-dev-20250515T1211-cc16b86.0",
|
|
46
|
+
"@contentful/experiences-validators": "1.37.1-dev-20250515T1211-cc16b86.0",
|
|
47
|
+
"@contentful/experiences-visual-editor-react": "1.37.1-dev-20250515T1211-cc16b86.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": "
|
|
105
|
+
"gitHead": "c83183fcc4806863fa99836ba2ef1dfc4be409f1"
|
|
106
106
|
}
|