@contentful/experiences-core 1.8.2-dev-20240627T0348-ac210ce.0 → 1.8.3-dev-20240627T1831-38d15cb.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/index.js.map +1 -1
- package/dist/utils/isLink.d.ts +1 -1
- package/dist/utils/styleUtils/ssrStyles.d.ts +9 -121
- package/dist/utils/styleUtils/stylesUtils.d.ts +3 -3
- package/dist/utils/transformers/transformBoundContentValue.d.ts +1 -1
- package/dist/utils/utils.d.ts +2 -2
- package/package.json +3 -3
package/dist/utils/isLink.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnresolvedLink, Entry, Asset } from 'contentful';
|
|
2
2
|
|
|
3
|
-
declare const isLink: (maybeLink: UnresolvedLink<
|
|
3
|
+
declare const isLink: (maybeLink: UnresolvedLink<"Entry" | "Asset"> | Entry | Asset | string | unknown) => maybeLink is UnresolvedLink<"Entry" | "Asset">;
|
|
4
4
|
|
|
5
5
|
export { isLink };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entry, Asset } from 'contentful/dist/types/types';
|
|
2
|
-
import { ComponentPropertyValue } from '@contentful/experiences-validators';
|
|
2
|
+
import { ComponentPropertyValue, ExperienceUnboundValues, ExperienceDataSource, ExperienceComponentSettings } from '@contentful/experiences-validators';
|
|
3
3
|
import { Experience, StyleProps, DesignTokensDefinition } from '../../types.js';
|
|
4
4
|
|
|
5
5
|
type FlattenedDesignTokens = Record<string, string | {
|
|
@@ -13,131 +13,19 @@ declare const maybePopulateDesignTokenValue: (variableName: string, variableValu
|
|
|
13
13
|
declare const resolveBackgroundImageBinding: ({ variableData, getBoundEntityById, dataSource, unboundValues, componentVariablesOverwrites, componentSettings, }: {
|
|
14
14
|
variableData: ComponentPropertyValue;
|
|
15
15
|
getBoundEntityById: (id: string) => Entry | Asset | undefined;
|
|
16
|
-
unboundValues?:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
sys: {
|
|
21
|
-
type: "Link";
|
|
22
|
-
id: string;
|
|
23
|
-
linkType: "Entry" | "Asset";
|
|
24
|
-
};
|
|
25
|
-
}> | undefined;
|
|
26
|
-
componentSettings?: {
|
|
27
|
-
variableDefinitions: Record<string, {
|
|
28
|
-
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink";
|
|
29
|
-
displayName?: string | undefined;
|
|
30
|
-
defaultValue?: string | number | boolean | Record<any, any> | {
|
|
31
|
-
type: "DesignValue";
|
|
32
|
-
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
33
|
-
} | {
|
|
34
|
-
path: string;
|
|
35
|
-
type: "BoundValue";
|
|
36
|
-
} | {
|
|
37
|
-
type: "HyperlinkValue";
|
|
38
|
-
linkTargetKey: string;
|
|
39
|
-
overrides?: {} | undefined;
|
|
40
|
-
} | {
|
|
41
|
-
type: "UnboundValue";
|
|
42
|
-
key: string;
|
|
43
|
-
} | {
|
|
44
|
-
type: "ComponentValue";
|
|
45
|
-
key: string;
|
|
46
|
-
} | undefined;
|
|
47
|
-
description?: string | undefined;
|
|
48
|
-
group?: string | undefined;
|
|
49
|
-
validations?: {
|
|
50
|
-
required?: boolean | undefined;
|
|
51
|
-
format?: "URL" | undefined;
|
|
52
|
-
in?: {
|
|
53
|
-
value: string | number;
|
|
54
|
-
displayName?: string | undefined;
|
|
55
|
-
}[] | undefined;
|
|
56
|
-
} | undefined;
|
|
57
|
-
}>;
|
|
58
|
-
} | undefined;
|
|
59
|
-
componentVariablesOverwrites?: Record<string, {
|
|
60
|
-
type: "DesignValue";
|
|
61
|
-
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
62
|
-
} | {
|
|
63
|
-
path: string;
|
|
64
|
-
type: "BoundValue";
|
|
65
|
-
} | {
|
|
66
|
-
type: "UnboundValue";
|
|
67
|
-
key: string;
|
|
68
|
-
} | {
|
|
69
|
-
type: "HyperlinkValue";
|
|
70
|
-
linkTargetKey: string;
|
|
71
|
-
overrides?: {} | undefined;
|
|
72
|
-
} | {
|
|
73
|
-
type: "ComponentValue";
|
|
74
|
-
key: string;
|
|
75
|
-
}> | undefined;
|
|
16
|
+
unboundValues?: ExperienceUnboundValues;
|
|
17
|
+
dataSource?: ExperienceDataSource;
|
|
18
|
+
componentSettings?: ExperienceComponentSettings;
|
|
19
|
+
componentVariablesOverwrites?: Record<string, ComponentPropertyValue>;
|
|
76
20
|
}) => string | undefined;
|
|
77
21
|
declare const indexByBreakpoint: ({ variables, breakpointIds, getBoundEntityById, unboundValues, dataSource, componentVariablesOverwrites, componentSettings, }: {
|
|
78
22
|
variables: Record<string, ComponentPropertyValue>;
|
|
79
23
|
breakpointIds: string[];
|
|
80
24
|
getBoundEntityById: (id: string) => Entry | Asset | undefined;
|
|
81
|
-
unboundValues?:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
sys: {
|
|
86
|
-
type: "Link";
|
|
87
|
-
id: string;
|
|
88
|
-
linkType: "Entry" | "Asset";
|
|
89
|
-
};
|
|
90
|
-
}> | undefined;
|
|
91
|
-
componentVariablesOverwrites?: Record<string, {
|
|
92
|
-
type: "DesignValue";
|
|
93
|
-
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
94
|
-
} | {
|
|
95
|
-
path: string;
|
|
96
|
-
type: "BoundValue";
|
|
97
|
-
} | {
|
|
98
|
-
type: "UnboundValue";
|
|
99
|
-
key: string;
|
|
100
|
-
} | {
|
|
101
|
-
type: "HyperlinkValue";
|
|
102
|
-
linkTargetKey: string;
|
|
103
|
-
overrides?: {} | undefined;
|
|
104
|
-
} | {
|
|
105
|
-
type: "ComponentValue";
|
|
106
|
-
key: string;
|
|
107
|
-
}> | undefined;
|
|
108
|
-
componentSettings?: {
|
|
109
|
-
variableDefinitions: Record<string, {
|
|
110
|
-
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink";
|
|
111
|
-
displayName?: string | undefined;
|
|
112
|
-
defaultValue?: string | number | boolean | Record<any, any> | {
|
|
113
|
-
type: "DesignValue";
|
|
114
|
-
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
115
|
-
} | {
|
|
116
|
-
path: string;
|
|
117
|
-
type: "BoundValue";
|
|
118
|
-
} | {
|
|
119
|
-
type: "HyperlinkValue";
|
|
120
|
-
linkTargetKey: string;
|
|
121
|
-
overrides?: {} | undefined;
|
|
122
|
-
} | {
|
|
123
|
-
type: "UnboundValue";
|
|
124
|
-
key: string;
|
|
125
|
-
} | {
|
|
126
|
-
type: "ComponentValue";
|
|
127
|
-
key: string;
|
|
128
|
-
} | undefined;
|
|
129
|
-
description?: string | undefined;
|
|
130
|
-
group?: string | undefined;
|
|
131
|
-
validations?: {
|
|
132
|
-
required?: boolean | undefined;
|
|
133
|
-
format?: "URL" | undefined;
|
|
134
|
-
in?: {
|
|
135
|
-
value: string | number;
|
|
136
|
-
displayName?: string | undefined;
|
|
137
|
-
}[] | undefined;
|
|
138
|
-
} | undefined;
|
|
139
|
-
}>;
|
|
140
|
-
} | undefined;
|
|
25
|
+
unboundValues?: ExperienceUnboundValues;
|
|
26
|
+
dataSource?: ExperienceDataSource;
|
|
27
|
+
componentVariablesOverwrites?: Record<string, ComponentPropertyValue>;
|
|
28
|
+
componentSettings?: ExperienceComponentSettings;
|
|
141
29
|
}) => Record<string, Record<string, unknown>>;
|
|
142
30
|
/**
|
|
143
31
|
* Flattens the object from
|
|
@@ -4,7 +4,7 @@ import { PrimitiveValue } from '@contentful/experiences-validators';
|
|
|
4
4
|
declare const toCSSAttribute: (key: string) => string;
|
|
5
5
|
declare const buildStyleTag: ({ styles, nodeId }: {
|
|
6
6
|
styles: CSSProperties;
|
|
7
|
-
nodeId?: string
|
|
7
|
+
nodeId?: string;
|
|
8
8
|
}) => string[];
|
|
9
9
|
declare const buildCfStyles: ({ cfHorizontalAlignment, cfVerticalAlignment, cfFlexDirection, cfFlexWrap, cfMargin, cfPadding, cfBackgroundColor, cfWidth, cfHeight, cfMaxWidth, cfBorder, cfBorderRadius, cfGap, cfBackgroundImageUrl, cfBackgroundImageOptions, cfFontSize, cfFontWeight, cfImageOptions, cfLineHeight, cfLetterSpacing, cfTextColor, cfTextAlign, cfTextTransform, cfTextBold, cfTextItalic, cfTextUnderline, cfColumnSpan, }: Partial<StyleProps>) => CSSProperties;
|
|
10
10
|
/**
|
|
@@ -13,8 +13,8 @@ declare const buildCfStyles: ({ cfHorizontalAlignment, cfVerticalAlignment, cfFl
|
|
|
13
13
|
* If a container component has children => height: 'fit-content'
|
|
14
14
|
*/
|
|
15
15
|
declare const calculateNodeDefaultHeight: ({ blockId, children, value, }: {
|
|
16
|
-
blockId?: string
|
|
17
|
-
children: ExperienceTreeNode[
|
|
16
|
+
blockId?: string;
|
|
17
|
+
children: ExperienceTreeNode["children"];
|
|
18
18
|
value: PrimitiveValue;
|
|
19
19
|
}) => string | number | boolean | Record<any, any> | undefined;
|
|
20
20
|
|
|
@@ -3,6 +3,6 @@ import { UnresolvedLink } from 'contentful';
|
|
|
3
3
|
import { EntityStoreBase } from '../../entity/EntityStoreBase.js';
|
|
4
4
|
import { ComponentTreeNode } from '@contentful/experiences-validators';
|
|
5
5
|
|
|
6
|
-
declare const transformBoundContentValue: (variables: ComponentTreeNode[
|
|
6
|
+
declare const transformBoundContentValue: (variables: ComponentTreeNode["variables"], entityStore: EntityStoreBase, binding: UnresolvedLink<"Entry" | "Asset">, resolveDesignValue: ResolveDesignValueType, variableName: string, variableDefinition: ComponentDefinitionVariable, path: string) => BoundComponentPropertyTypes;
|
|
7
7
|
|
|
8
8
|
export { transformBoundContentValue };
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -29,12 +29,12 @@ declare const getInsertionData: ({ dropReceiverParentNode, dropReceiverNode, fle
|
|
|
29
29
|
declare const generateRandomId: (letterCount: number) => string;
|
|
30
30
|
declare const checkIsAssemblyNode: ({ componentId, usedComponents, }: {
|
|
31
31
|
componentId: string;
|
|
32
|
-
usedComponents: ExperienceEntry[
|
|
32
|
+
usedComponents: ExperienceEntry["fields"]["usedComponents"];
|
|
33
33
|
}) => boolean;
|
|
34
34
|
/** @deprecated use `checkIsAssemblyNode` instead. Will be removed with SDK v5. */
|
|
35
35
|
declare const checkIsAssembly: ({ componentId, usedComponents, }: {
|
|
36
36
|
componentId: string;
|
|
37
|
-
usedComponents: ExperienceEntry[
|
|
37
|
+
usedComponents: ExperienceEntry["fields"]["usedComponents"];
|
|
38
38
|
}) => boolean;
|
|
39
39
|
/**
|
|
40
40
|
* This check assumes that the entry is already ensured to be an experience, i.e. the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-core",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.3-dev-20240627T1831-38d15cb.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"vitest": "^1.0.4"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@contentful/experiences-validators": "1.8.
|
|
68
|
+
"@contentful/experiences-validators": "1.8.3-dev-20240627T1831-38d15cb.0",
|
|
69
69
|
"@contentful/rich-text-types": "^16.3.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"contentful": ">=10.6.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "0627de8a1e3794ea329b8f91d2439cb1863ba033"
|
|
75
75
|
}
|