@vonaffenfels/contentful-slate-editor 1.0.78 → 1.0.81
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonaffenfels/contentful-slate-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.81",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepublish": "yarn run build",
|
|
6
6
|
"dev": "yarn run start",
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
"webpack-watch-files-plugin": "^1.2.1"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@vonaffenfels/slate-editor": "^1.0.
|
|
94
|
+
"@vonaffenfels/slate-editor": "^1.0.81",
|
|
95
95
|
"webpack": "5.88.2"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "a8759bb4528cbe15162eea2db425d570110eaaf7",
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public"
|
|
100
100
|
}
|
|
@@ -24,6 +24,7 @@ const EditorField = ({
|
|
|
24
24
|
locale,
|
|
25
25
|
onStorybookElementClick,
|
|
26
26
|
elementPropsMap,
|
|
27
|
+
activeConfig,
|
|
27
28
|
}) => {
|
|
28
29
|
const wrapperRef = useRef();
|
|
29
30
|
const loadedValue = fieldSdk.getValue(locale);
|
|
@@ -160,6 +161,7 @@ const EditorField = ({
|
|
|
160
161
|
isLoading={isLoadingCount !== 0}
|
|
161
162
|
storybookComponentDataLoader={async (block, attributes) => await getLoaderResult(block, attributes)}
|
|
162
163
|
onStorybookElementClick={onStorybookElementClick}
|
|
164
|
+
activeConfig={activeConfig}
|
|
163
165
|
/>
|
|
164
166
|
</div>;
|
|
165
167
|
};
|
|
@@ -7,6 +7,7 @@ const Entry = ({
|
|
|
7
7
|
sdk,
|
|
8
8
|
onStorybookElementClick,
|
|
9
9
|
elementPropsMap,
|
|
10
|
+
activeConfig,
|
|
10
11
|
}) => {
|
|
11
12
|
const field = sdk.parameters.instance.contentField;
|
|
12
13
|
const fieldSdk = sdk.entry.fields[field];
|
|
@@ -42,6 +43,7 @@ const Entry = ({
|
|
|
42
43
|
sdk={sdk}
|
|
43
44
|
portal={portal}
|
|
44
45
|
onStorybookElementClick={onStorybookElementClick}
|
|
46
|
+
activeConfig={activeConfig}
|
|
45
47
|
/>;
|
|
46
48
|
};
|
|
47
49
|
|
package/src/index.js
CHANGED
|
@@ -27,10 +27,14 @@ export const BaseContentfulApp = (props) => {
|
|
|
27
27
|
};
|
|
28
28
|
const elementPropsMap = props?.getElementPropsMap?.(wrapperProps.contentType) || props?.elementPropsMap;
|
|
29
29
|
|
|
30
|
-
let config;
|
|
30
|
+
let config = {};
|
|
31
31
|
|
|
32
|
-
if (
|
|
33
|
-
config = await props.getByPortal(
|
|
32
|
+
if (wrapperProps.portal) {
|
|
33
|
+
config = await props.getByPortal(wrapperProps.portal);
|
|
34
|
+
|
|
35
|
+
if (props.getDomain) {
|
|
36
|
+
config.domain = props.getDomain(wrapperProps.portal);
|
|
37
|
+
}
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
const ComponentLocationSettings = [
|
|
@@ -51,7 +55,8 @@ export const BaseContentfulApp = (props) => {
|
|
|
51
55
|
const storybookElementChangeEvent = new CustomEvent("storybookElementChange", {detail: element});
|
|
52
56
|
|
|
53
57
|
window.parent.document.dispatchEvent(storybookElementChangeEvent);
|
|
54
|
-
}}
|
|
58
|
+
}}
|
|
59
|
+
activeConfig={config}/></RendererWrapperComponent>,
|
|
55
60
|
},
|
|
56
61
|
{
|
|
57
62
|
location: locations.LOCATION_DIALOG,
|