@contentful/experiences-core 1.7.1-dev-20240611T1717-53ee8ba.0 → 1.7.2-dev-20240613T0816-4d3b2da.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/entity/EntityStore.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1052 -568
- package/dist/index.js.map +1 -1
- package/dist/utils/styleUtils/ssrStyles.d.ts +163 -0
- package/package.json +3 -3
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Entry, Asset } from 'contentful/dist/types/types';
|
|
2
|
+
import { ComponentPropertyValue } from '@contentful/experiences-validators';
|
|
3
|
+
import { Experience, StyleProps, DesignTokensDefinition } from '../../types.js';
|
|
4
|
+
|
|
5
|
+
type FlattenedDesignTokens = Record<string, string | {
|
|
6
|
+
width?: string;
|
|
7
|
+
style?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
}>;
|
|
10
|
+
declare const detachExperienceStyles: (experience: Experience) => string | undefined;
|
|
11
|
+
declare const isCfStyleAttribute: (variableName: string) => variableName is keyof StyleProps;
|
|
12
|
+
declare const maybePopulateDesignTokenValue: (variableName: string, variableValue: unknown, mapOfDesignVariableKeys: FlattenedDesignTokens) => unknown;
|
|
13
|
+
declare const resolveBackgroundImageBinding: ({ variableData, getBoundEntityById, dataSource, unboundValues, componentVariablesOverwrites, componentSettings, }: {
|
|
14
|
+
variableData: ComponentPropertyValue;
|
|
15
|
+
getBoundEntityById: (id: string) => Entry | Asset | undefined;
|
|
16
|
+
unboundValues?: Record<string, {
|
|
17
|
+
value?: string | number | boolean | Record<any, any> | undefined;
|
|
18
|
+
}> | undefined;
|
|
19
|
+
dataSource?: Record<string, {
|
|
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;
|
|
76
|
+
}) => string | undefined;
|
|
77
|
+
declare const indexByBreakpoint: ({ variables, breakpointIds, getBoundEntityById, unboundValues, dataSource, componentVariablesOverwrites, componentSettings, }: {
|
|
78
|
+
variables: Record<string, ComponentPropertyValue>;
|
|
79
|
+
breakpointIds: string[];
|
|
80
|
+
getBoundEntityById: (id: string) => Entry | Asset | undefined;
|
|
81
|
+
unboundValues?: Record<string, {
|
|
82
|
+
value?: string | number | boolean | Record<any, any> | undefined;
|
|
83
|
+
}> | undefined;
|
|
84
|
+
dataSource?: Record<string, {
|
|
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;
|
|
141
|
+
}) => Record<string, Record<string, unknown>>;
|
|
142
|
+
/**
|
|
143
|
+
* Flattens the object from
|
|
144
|
+
* {
|
|
145
|
+
* color: {
|
|
146
|
+
* [key]: [value]
|
|
147
|
+
* }
|
|
148
|
+
* }
|
|
149
|
+
*
|
|
150
|
+
* to
|
|
151
|
+
*
|
|
152
|
+
* {
|
|
153
|
+
* 'color.key': [value]
|
|
154
|
+
* }
|
|
155
|
+
*/
|
|
156
|
+
declare const flattenDesignTokenRegistry: (designTokenRegistry: DesignTokensDefinition) => FlattenedDesignTokens;
|
|
157
|
+
declare const toCSSString: (breakpointStyles: Record<string, string>) => string;
|
|
158
|
+
declare const toMediaQuery: (breakpointPayload: {
|
|
159
|
+
condition: string;
|
|
160
|
+
cssByClassName: Record<string, string>;
|
|
161
|
+
}) => string;
|
|
162
|
+
|
|
163
|
+
export { detachExperienceStyles, flattenDesignTokenRegistry, indexByBreakpoint, isCfStyleAttribute, maybePopulateDesignTokenValue, resolveBackgroundImageBinding, toCSSString, toMediaQuery };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-core",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2-dev-20240613T0816-4d3b2da.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.7.
|
|
68
|
+
"@contentful/experiences-validators": "1.7.2-dev-20240613T0816-4d3b2da.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": "5f0c68749aad81312ac7eb5d2c9eb579c80bde64"
|
|
75
75
|
}
|