@vonaffenfels/contentful-slate-editor 1.0.10 → 1.0.11
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 +2 -2
- package/src/components/Field.js +1 -1
- package/src/dev.js +1 -0
- package/src/index.js +6 -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.0.11",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepublish": "yarn run build",
|
|
6
6
|
"dev": "yarn run start",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@vonaffenfels/slate-editor": "^1.0.10",
|
|
93
93
|
"webpack": "5.73.0"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "f4fba8f7e03159a1ac6f9136c562b8854f52ba76",
|
|
96
96
|
"publishConfig": {
|
|
97
97
|
"access": "public"
|
|
98
98
|
}
|
package/src/components/Field.js
CHANGED
|
@@ -19,7 +19,7 @@ const Field = ({sdk}) => {
|
|
|
19
19
|
shouldCloseOnOverlayClick: false,
|
|
20
20
|
shouldCloseOnEscapePress: false,
|
|
21
21
|
minHeight: 500,
|
|
22
|
-
parameters: {value: sdk.field.getValue()},
|
|
22
|
+
parameters: {value: sdk.field.getValue(), portal: sdk.entry.fields.portal.getValue()},
|
|
23
23
|
}).then((data) => {
|
|
24
24
|
if (data) {
|
|
25
25
|
sdk.field.setValue(data);
|
package/src/dev.js
CHANGED
package/src/index.js
CHANGED
|
@@ -9,16 +9,16 @@ import '@contentful/forma-36-react-components/dist/styles.css';
|
|
|
9
9
|
import '@contentful/forma-36-fcss/dist/styles.css';
|
|
10
10
|
import '@contentful/forma-36-tokens/dist/css/index.css';
|
|
11
11
|
import '@vonaffenfels/slate-editor/dist/index.css';
|
|
12
|
-
import './scss/index.scss';
|
|
13
12
|
|
|
14
13
|
import EntryEditor from './components/EntryEditor';
|
|
15
14
|
import Config from './components/ConfigScreen';
|
|
16
15
|
import Field from './components/Field';
|
|
17
16
|
import Dialog from "./components/Dialog";
|
|
18
17
|
|
|
19
|
-
export const BaseContentfulApp = () => {
|
|
18
|
+
export const BaseContentfulApp = (props) => {
|
|
20
19
|
init((sdk) => {
|
|
21
20
|
const rootContainer = document.getElementById('root');
|
|
21
|
+
const RendererWrapperComponent = props.RendererWrapperComponent || (({children}) => <div>{children}</div>);
|
|
22
22
|
|
|
23
23
|
const ComponentLocationSettings = [
|
|
24
24
|
{
|
|
@@ -27,21 +27,21 @@ export const BaseContentfulApp = () => {
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
location: locations.LOCATION_ENTRY_FIELD,
|
|
30
|
-
component: <Field sdk={sdk}
|
|
30
|
+
component: <RendererWrapperComponent sdk={sdk}><Field sdk={sdk}/></RendererWrapperComponent>,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
location: locations.LOCATION_ENTRY_EDITOR,
|
|
34
|
-
component: <EntryEditor
|
|
34
|
+
component: <RendererWrapperComponent sdk={sdk}><EntryEditor
|
|
35
35
|
sdk={sdk}
|
|
36
36
|
onStorybookElementClick={element => {
|
|
37
37
|
const storybookElementChangeEvent = new CustomEvent("storybookElementChange", {detail: element});
|
|
38
38
|
|
|
39
39
|
window.parent.document.dispatchEvent(storybookElementChangeEvent);
|
|
40
|
-
}}
|
|
40
|
+
}}/></RendererWrapperComponent>,
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
location: locations.LOCATION_DIALOG,
|
|
44
|
-
component: <Dialog sdk={sdk}
|
|
44
|
+
component: <RendererWrapperComponent sdk={sdk}><Dialog sdk={sdk}/></RendererWrapperComponent>,
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
47
|
|