@contentful/experiences-sdk-react 1.1.0 → 1.2.0-beta.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.d.ts +3 -1
- package/dist/index.js +431 -4
- package/dist/index.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/sdkVersion.d.ts +1 -1
- package/dist/src/utils/ssrStyles.d.ts +155 -0
- package/dist/src/utils/ssrStyles.spec.d.ts +1 -0
- package/dist/src/utils/ssrStylesCustomComponentWithBuiltInStyles.spec.d.ts +1 -0
- package/dist/src/utils/ssrStylesDesignTokenResolution.spec.d.ts +1 -0
- package/dist/src/utils/ssrStylesPattern.spec.d.ts +1 -0
- package/dist/src/utils/ssrStylesStructureComponent.spec.d.ts +1 -0
- package/package.json +6 -5
package/dist/src/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { useFetchById, useFetchBySlug } from './hooks';
|
|
|
3
3
|
export { defineComponents, maintainBasicComponentIdsWithoutPrefix } from './core/componentRegistry';
|
|
4
4
|
export { defineDesignTokens, VisualEditorMode, fetchById, fetchBySlug, createExperience, } from '@contentful/experiences-core';
|
|
5
5
|
export { CONTENTFUL_COMPONENTS, LATEST_SCHEMA_VERSION, CF_STYLE_ATTRIBUTES, } from '@contentful/experiences-core/constants';
|
|
6
|
+
export { detachExperienceStyles } from './utils/ssrStyles';
|
|
6
7
|
export type { ExternalSDKMode, ComponentDefinition } from '@contentful/experiences-core/types';
|
package/dist/src/sdkVersion.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.1.0
|
|
1
|
+
export declare const SDK_VERSION = "1.1.0";
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { DesignTokensDefinition, Experience, StyleProps } from '@contentful/experiences-core/types';
|
|
2
|
+
import { ComponentPropertyValue, ExperienceComponentSettings, ExperienceDataSource, ExperienceUnboundValues } from '@contentful/experiences-validators';
|
|
3
|
+
import { Asset, Entry } from 'contentful/dist/types/types';
|
|
4
|
+
export declare const detachExperienceStyles: (experience: Experience) => string | undefined;
|
|
5
|
+
export declare const isCfStyleAttribute: (variableName: any) => variableName is keyof StyleProps;
|
|
6
|
+
export declare const maybePopulateDesignTokenValue: (variableName: string, variableValue: any, mapOfDesignVariableKeys: Record<string, any>) => any;
|
|
7
|
+
export declare const resolveBackgroundImageBinding: ({ variableData, getBoundEntityById, dataSource, unboundValues, componentVariablesOverwrites, componentSettings, }: {
|
|
8
|
+
variableData: ComponentPropertyValue;
|
|
9
|
+
getBoundEntityById: (id: string) => Entry | Asset | undefined;
|
|
10
|
+
unboundValues?: Record<string, {
|
|
11
|
+
value?: string | number | boolean | Record<any, any> | undefined;
|
|
12
|
+
}> | undefined;
|
|
13
|
+
dataSource?: Record<string, {
|
|
14
|
+
sys: {
|
|
15
|
+
type: "Link";
|
|
16
|
+
id: string;
|
|
17
|
+
linkType: "Entry" | "Asset";
|
|
18
|
+
};
|
|
19
|
+
}> | undefined;
|
|
20
|
+
componentSettings?: {
|
|
21
|
+
variableDefinitions: Record<string, {
|
|
22
|
+
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink";
|
|
23
|
+
displayName?: string | undefined;
|
|
24
|
+
defaultValue?: string | number | boolean | Record<any, any> | {
|
|
25
|
+
type: "DesignValue";
|
|
26
|
+
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
27
|
+
} | {
|
|
28
|
+
path: string;
|
|
29
|
+
type: "BoundValue";
|
|
30
|
+
} | {
|
|
31
|
+
type: "HyperlinkValue";
|
|
32
|
+
linkTargetKey: string;
|
|
33
|
+
overrides?: {} | undefined;
|
|
34
|
+
} | {
|
|
35
|
+
type: "UnboundValue";
|
|
36
|
+
key: string;
|
|
37
|
+
} | {
|
|
38
|
+
type: "ComponentValue";
|
|
39
|
+
key: string;
|
|
40
|
+
} | undefined;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
group?: string | undefined;
|
|
43
|
+
validations?: {
|
|
44
|
+
required?: boolean | undefined;
|
|
45
|
+
format?: "URL" | undefined;
|
|
46
|
+
in?: {
|
|
47
|
+
value: string | number;
|
|
48
|
+
displayName?: string | undefined;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
} | undefined;
|
|
53
|
+
componentVariablesOverwrites?: Record<string, {
|
|
54
|
+
type: "DesignValue";
|
|
55
|
+
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
56
|
+
} | {
|
|
57
|
+
path: string;
|
|
58
|
+
type: "BoundValue";
|
|
59
|
+
} | {
|
|
60
|
+
type: "UnboundValue";
|
|
61
|
+
key: string;
|
|
62
|
+
} | {
|
|
63
|
+
type: "HyperlinkValue";
|
|
64
|
+
linkTargetKey: string;
|
|
65
|
+
overrides?: {} | undefined;
|
|
66
|
+
} | {
|
|
67
|
+
type: "ComponentValue";
|
|
68
|
+
key: string;
|
|
69
|
+
}> | undefined;
|
|
70
|
+
}) => string | undefined;
|
|
71
|
+
export declare const indexByBreakpoint: ({ variables, breakpointIds, getBoundEntityById, unboundValues, dataSource, componentVariablesOverwrites, componentSettings, }: {
|
|
72
|
+
variables: Record<string, ComponentPropertyValue>;
|
|
73
|
+
breakpointIds: string[];
|
|
74
|
+
getBoundEntityById: (id: string) => Entry | Asset | undefined;
|
|
75
|
+
unboundValues?: Record<string, {
|
|
76
|
+
value?: string | number | boolean | Record<any, any> | undefined;
|
|
77
|
+
}> | undefined;
|
|
78
|
+
dataSource?: Record<string, {
|
|
79
|
+
sys: {
|
|
80
|
+
type: "Link";
|
|
81
|
+
id: string;
|
|
82
|
+
linkType: "Entry" | "Asset";
|
|
83
|
+
};
|
|
84
|
+
}> | undefined;
|
|
85
|
+
componentVariablesOverwrites?: Record<string, {
|
|
86
|
+
type: "DesignValue";
|
|
87
|
+
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
88
|
+
} | {
|
|
89
|
+
path: string;
|
|
90
|
+
type: "BoundValue";
|
|
91
|
+
} | {
|
|
92
|
+
type: "UnboundValue";
|
|
93
|
+
key: string;
|
|
94
|
+
} | {
|
|
95
|
+
type: "HyperlinkValue";
|
|
96
|
+
linkTargetKey: string;
|
|
97
|
+
overrides?: {} | undefined;
|
|
98
|
+
} | {
|
|
99
|
+
type: "ComponentValue";
|
|
100
|
+
key: string;
|
|
101
|
+
}> | undefined;
|
|
102
|
+
componentSettings?: {
|
|
103
|
+
variableDefinitions: Record<string, {
|
|
104
|
+
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink";
|
|
105
|
+
displayName?: string | undefined;
|
|
106
|
+
defaultValue?: string | number | boolean | Record<any, any> | {
|
|
107
|
+
type: "DesignValue";
|
|
108
|
+
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
109
|
+
} | {
|
|
110
|
+
path: string;
|
|
111
|
+
type: "BoundValue";
|
|
112
|
+
} | {
|
|
113
|
+
type: "HyperlinkValue";
|
|
114
|
+
linkTargetKey: string;
|
|
115
|
+
overrides?: {} | undefined;
|
|
116
|
+
} | {
|
|
117
|
+
type: "UnboundValue";
|
|
118
|
+
key: string;
|
|
119
|
+
} | {
|
|
120
|
+
type: "ComponentValue";
|
|
121
|
+
key: string;
|
|
122
|
+
} | undefined;
|
|
123
|
+
description?: string | undefined;
|
|
124
|
+
group?: string | undefined;
|
|
125
|
+
validations?: {
|
|
126
|
+
required?: boolean | undefined;
|
|
127
|
+
format?: "URL" | undefined;
|
|
128
|
+
in?: {
|
|
129
|
+
value: string | number;
|
|
130
|
+
displayName?: string | undefined;
|
|
131
|
+
}[] | undefined;
|
|
132
|
+
} | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
} | undefined;
|
|
135
|
+
}) => Record<string, Record<string, any>>;
|
|
136
|
+
/**
|
|
137
|
+
* Flattens the object from
|
|
138
|
+
* {
|
|
139
|
+
* color: {
|
|
140
|
+
* [key]: [value]
|
|
141
|
+
* }
|
|
142
|
+
* }
|
|
143
|
+
*
|
|
144
|
+
* to
|
|
145
|
+
*
|
|
146
|
+
* {
|
|
147
|
+
* 'color.key': [value]
|
|
148
|
+
* }
|
|
149
|
+
*/
|
|
150
|
+
export declare const flattenDesignTokenRegistry: (designTokenRegistry: DesignTokensDefinition) => Record<string, string | object>;
|
|
151
|
+
export declare const toCSSString: (breakpointStyles: Record<string, string>) => string;
|
|
152
|
+
export declare const toMediaQuery: (breakpointPayload: {
|
|
153
|
+
condition: string;
|
|
154
|
+
cssByClassName: Record<string, string>;
|
|
155
|
+
}) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-sdk-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-beta.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/src/index.d.ts",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"depcruise": "depcruise src"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@contentful/experiences-components-react": "
|
|
35
|
-
"@contentful/experiences-core": "
|
|
36
|
-
"@contentful/experiences-visual-editor-react": "
|
|
34
|
+
"@contentful/experiences-components-react": "1.2.0-beta.0",
|
|
35
|
+
"@contentful/experiences-core": "1.2.0-beta.0",
|
|
36
|
+
"@contentful/experiences-visual-editor-react": "1.2.0-beta.0",
|
|
37
37
|
"@contentful/rich-text-types": "^16.2.1",
|
|
38
38
|
"classnames": "^2.3.2",
|
|
39
39
|
"csstype": "^3.1.2",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"@testing-library/user-event": "^14.4.3",
|
|
55
55
|
"@types/jest": "^29.5.6",
|
|
56
56
|
"@types/lodash-es": "^4.17.12",
|
|
57
|
+
"@types/md5": "^2.3.5",
|
|
57
58
|
"@types/node": "^20.11.10",
|
|
58
59
|
"@types/react": "^18.0.28",
|
|
59
60
|
"@types/react-dom": "^18.0.11",
|
|
@@ -88,5 +89,5 @@
|
|
|
88
89
|
"dist",
|
|
89
90
|
"package.json"
|
|
90
91
|
],
|
|
91
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "44171088cdd5b5f827d43161cda6c684116b2d29"
|
|
92
93
|
}
|