@vonaffenfels/contentful-slate-editor 1.0.81 → 1.1.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/package.json +3 -3
- package/src/components/EditorField.js +0 -1
- package/src/index.js +13 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonaffenfels/contentful-slate-editor",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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.1.0",
|
|
95
95
|
"webpack": "5.88.2"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "d768183ee1ab268e8c52315f91176ff8d610b81b",
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public"
|
|
100
100
|
}
|
|
@@ -99,7 +99,6 @@ const EditorField = ({
|
|
|
99
99
|
setIsLoadingCount(++isLoadingCountGlobal);
|
|
100
100
|
|
|
101
101
|
try {
|
|
102
|
-
console.log("KIENZ_DEBUG: :101 / executeLoader", sdk, sdk?.entry?.sys?.id);
|
|
103
102
|
const loaderResult = await fetch(`/api/loader/?portal=${portal}&block=${block}`, {
|
|
104
103
|
method: "POST",
|
|
105
104
|
body: JSON.stringify({
|
package/src/index.js
CHANGED
|
@@ -18,7 +18,8 @@ import Dialog from "./components/Dialog";
|
|
|
18
18
|
export const BaseContentfulApp = (props) => {
|
|
19
19
|
init(async (sdk) => {
|
|
20
20
|
const rootContainer = document.getElementById('root');
|
|
21
|
-
const RendererWrapperComponent = props?.RendererWrapperComponent || (({children}) => <div
|
|
21
|
+
const RendererWrapperComponent = props?.RendererWrapperComponent || (({children}) => <div
|
|
22
|
+
className="h-full">{children}</div>);
|
|
22
23
|
const wrapperProps = {
|
|
23
24
|
sdk,
|
|
24
25
|
value: sdk.parameters?.invocation?.value || sdk?.field?.getValue(),
|
|
@@ -30,10 +31,14 @@ export const BaseContentfulApp = (props) => {
|
|
|
30
31
|
let config = {};
|
|
31
32
|
|
|
32
33
|
if (wrapperProps.portal) {
|
|
33
|
-
|
|
34
|
+
try {
|
|
35
|
+
config = await props.getByPortal(wrapperProps.portal);
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
if (props.getDomain) {
|
|
38
|
+
config.domain = props.getDomain(wrapperProps.portal);
|
|
39
|
+
}
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.error(`Error in getting config for portal ${wrapperProps.portal}`, e);
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
|
|
@@ -44,7 +49,9 @@ export const BaseContentfulApp = (props) => {
|
|
|
44
49
|
},
|
|
45
50
|
{
|
|
46
51
|
location: locations.LOCATION_ENTRY_FIELD,
|
|
47
|
-
component: <RendererWrapperComponent {...wrapperProps}><Field
|
|
52
|
+
component: <RendererWrapperComponent {...wrapperProps}><Field
|
|
53
|
+
sdk={sdk}
|
|
54
|
+
elementPropsMap={elementPropsMap}/></RendererWrapperComponent>,
|
|
48
55
|
},
|
|
49
56
|
{
|
|
50
57
|
location: locations.LOCATION_ENTRY_EDITOR,
|
|
@@ -60,7 +67,7 @@ export const BaseContentfulApp = (props) => {
|
|
|
60
67
|
},
|
|
61
68
|
{
|
|
62
69
|
location: locations.LOCATION_DIALOG,
|
|
63
|
-
component: <Dialog sdk={sdk} elementPropsMap={elementPropsMap} activeConfig={config}
|
|
70
|
+
component: <Dialog sdk={sdk} elementPropsMap={elementPropsMap} activeConfig={config}/>,
|
|
64
71
|
},
|
|
65
72
|
];
|
|
66
73
|
|