@vonaffenfels/contentful-slate-editor 1.0.28 → 1.0.30
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.30",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepublish": "yarn run build",
|
|
6
6
|
"dev": "yarn run start",
|
|
@@ -89,10 +89,10 @@
|
|
|
89
89
|
"webpack-dev-server": "^4.0.0-beta.2"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@vonaffenfels/slate-editor": "^1.0.
|
|
92
|
+
"@vonaffenfels/slate-editor": "^1.0.30",
|
|
93
93
|
"webpack": "5.88.2"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "fe88a0b3ce82331fa3d7193a4cd62b8e2c8ecfb9",
|
|
96
96
|
"publishConfig": {
|
|
97
97
|
"access": "public"
|
|
98
98
|
}
|
package/src/components/Dialog.js
CHANGED
|
@@ -21,27 +21,18 @@ const Dialog = ({
|
|
|
21
21
|
},
|
|
22
22
|
];
|
|
23
23
|
const [value, setValue] = useState(sdk.parameters.invocation.value || defaultValue);
|
|
24
|
-
const [loadedStorybookStories, setLoadedStorybookStories] = useState([]);
|
|
25
|
-
|
|
26
|
-
const loadStories = async () => {
|
|
27
|
-
setLoadedStorybookStories(await storybookStories());
|
|
28
|
-
};
|
|
29
24
|
|
|
30
25
|
const saveChanges = () => {
|
|
31
26
|
sdk.close(value);
|
|
32
27
|
};
|
|
33
28
|
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
loadStories();
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
29
|
switch (sdk.parameters.invocation.type) {
|
|
39
30
|
case "cloudinary":
|
|
40
31
|
return <DialogCloudinary sdk={sdk} config={sdk.parameters.invocation}/>;
|
|
41
32
|
default:
|
|
42
33
|
return <div className="relative flex h-full max-h-full justify-between">
|
|
43
34
|
<BlockEditor
|
|
44
|
-
storybookStories={
|
|
35
|
+
storybookStories={storybookStories}
|
|
45
36
|
onChange={setValue}
|
|
46
37
|
elementPropsMap={elementPropsMap}
|
|
47
38
|
value={value}
|
|
@@ -35,7 +35,6 @@ const EditorField = ({
|
|
|
35
35
|
},
|
|
36
36
|
];
|
|
37
37
|
const [value, setValue] = useState(validateValue(loadedValue));
|
|
38
|
-
const [stories, setStories] = useState([]);
|
|
39
38
|
const [externalValue, setExternalValue] = useState(value);
|
|
40
39
|
const [isLoadingCount, setIsLoadingCount] = useState(isLoadingCount);
|
|
41
40
|
const isVisible = useOnScreen(wrapperRef);
|
|
@@ -66,8 +65,6 @@ const EditorField = ({
|
|
|
66
65
|
if (windowSdk) {
|
|
67
66
|
windowSdk.startAutoResizer();
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
storybookStories().then(s => setStories(s));
|
|
71
68
|
}, []);
|
|
72
69
|
|
|
73
70
|
useEffect(() => {
|
|
@@ -104,7 +101,7 @@ const EditorField = ({
|
|
|
104
101
|
config={JSON.parse("{}")}
|
|
105
102
|
elementPropsMap={elementPropsMap}
|
|
106
103
|
storybookComponentLoader={componentLoader}
|
|
107
|
-
storybookStories={
|
|
104
|
+
storybookStories={storybookStories}
|
|
108
105
|
isLoading={isLoadingCount !== 0}
|
|
109
106
|
storybookComponentDataLoader={async (block, attributes) => {
|
|
110
107
|
let loaderResult = {};
|