@vonaffenfels/slate-editor 1.0.18 → 1.0.19
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/BlockEditor.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/SidebarEditor.js +9 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonaffenfels/slate-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"cssnano": "^5.0.1",
|
|
72
72
|
"escape-html": "^1.0.3"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "c07e5c97a79341c38e8439ac3e160a02b802db2f",
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
}
|
package/src/SidebarEditor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
useState, useEffect,
|
|
2
|
+
Fragment, useState, useEffect,
|
|
3
3
|
} from "react";
|
|
4
4
|
import {SidebarEditorField} from "./SidebarEditor/SidebarEditorField";
|
|
5
5
|
import {ToolMargin} from "./Tools/Margin";
|
|
@@ -391,8 +391,13 @@ const BlockSelect = ({
|
|
|
391
391
|
|
|
392
392
|
let storyGroups = groupArrayToObject(stories);
|
|
393
393
|
|
|
394
|
-
const renderOptions = (obj) => Object.keys(obj).map(key => {
|
|
394
|
+
const renderOptions = (obj) => Object.keys(obj).map((key, index) => {
|
|
395
395
|
const option = obj[key];
|
|
396
|
+
|
|
397
|
+
if (!option) {
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
|
|
396
401
|
if (option.title && option.id) {
|
|
397
402
|
return (
|
|
398
403
|
<option key={option.id} value={option.id}>
|
|
@@ -401,7 +406,7 @@ const BlockSelect = ({
|
|
|
401
406
|
);
|
|
402
407
|
} else if (typeof option === "object") {
|
|
403
408
|
return (
|
|
404
|
-
|
|
409
|
+
<Fragment key={`${key}-${index}`}>
|
|
405
410
|
<option
|
|
406
411
|
disabled
|
|
407
412
|
style={{
|
|
@@ -409,7 +414,7 @@ const BlockSelect = ({
|
|
|
409
414
|
fontWeight: option.level === 0 ? "bold" : "normal",
|
|
410
415
|
}}>{key}</option>
|
|
411
416
|
{renderOptions(option)}
|
|
412
|
-
|
|
417
|
+
</Fragment>
|
|
413
418
|
);
|
|
414
419
|
}
|
|
415
420
|
});
|