@vonaffenfels/slate-editor 1.0.26 → 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/dist/BlockEditor.css +1 -1
- package/dist/BlockEditor.js +1 -1
- package/dist/Renderer.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/BlockEditor.js +30 -3
- package/src/Blocks/LayoutBlock.js +55 -0
- package/src/Serializer/Serializer.js +2 -0
- package/src/SidebarEditor/AssetList.js +57 -9
- package/src/SidebarEditor/SidebarEditorField.js +13 -4
- package/src/SidebarEditor.js +101 -90
- package/src/Toolbar/Block.js +16 -1
- package/src/Toolbar/Layout.js +67 -0
- package/src/dev/App.js +1 -10
- package/src/plugins/ListItem.js +3 -3
package/src/Toolbar/Layout.js
CHANGED
|
@@ -204,6 +204,73 @@ export const InsertGridButton = () => {
|
|
|
204
204
|
}}>
|
|
205
205
|
<span>1 | 1 | 1 | 1</span>
|
|
206
206
|
</InsertLayoutButton>
|
|
207
|
+
<InsertLayoutButton insert={{
|
|
208
|
+
"type": "layout",
|
|
209
|
+
"children": [
|
|
210
|
+
{
|
|
211
|
+
"type": "layout-slot",
|
|
212
|
+
"attributes": {"name": "grid-1"},
|
|
213
|
+
"children": [
|
|
214
|
+
{
|
|
215
|
+
"type": "paragraph",
|
|
216
|
+
"children": [
|
|
217
|
+
{"text": ""},
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"type": "layout-slot",
|
|
224
|
+
"attributes": {"name": "grid-1"},
|
|
225
|
+
"children": [
|
|
226
|
+
{
|
|
227
|
+
"type": "paragraph",
|
|
228
|
+
"children": [
|
|
229
|
+
{"text": ""},
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"type": "layout-slot",
|
|
236
|
+
"attributes": {"name": "grid-1"},
|
|
237
|
+
"children": [
|
|
238
|
+
{
|
|
239
|
+
"type": "paragraph",
|
|
240
|
+
"children": [
|
|
241
|
+
{"text": ""},
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"type": "layout-slot",
|
|
248
|
+
"attributes": {"name": "grid-1"},
|
|
249
|
+
"children": [
|
|
250
|
+
{
|
|
251
|
+
"type": "paragraph",
|
|
252
|
+
"children": [
|
|
253
|
+
{"text": ""},
|
|
254
|
+
],
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"type": "layout-slot",
|
|
260
|
+
"attributes": {"name": "grid-1"},
|
|
261
|
+
"children": [
|
|
262
|
+
{
|
|
263
|
+
"type": "paragraph",
|
|
264
|
+
"children": [
|
|
265
|
+
{"text": ""},
|
|
266
|
+
],
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
}}>
|
|
272
|
+
<span>1 | 1 | 1 | 1 | 1</span>
|
|
273
|
+
</InsertLayoutButton>
|
|
207
274
|
<InsertLayoutButton insert={{
|
|
208
275
|
"type": "layout",
|
|
209
276
|
"children": [
|
package/src/dev/App.js
CHANGED
|
@@ -23,22 +23,13 @@ function App() {
|
|
|
23
23
|
},
|
|
24
24
|
];
|
|
25
25
|
const [value, setValue] = useState(SampleValue);
|
|
26
|
-
const [loadedStorybookStories, setLoadedStorybookStories] = useState([]);
|
|
27
|
-
|
|
28
|
-
const loadStories = async () => {
|
|
29
|
-
setLoadedStorybookStories(await storybookStories());
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
loadStories();
|
|
34
|
-
}, []);
|
|
35
26
|
|
|
36
27
|
return (
|
|
37
28
|
<div className="editor-demo-wrapper">
|
|
38
29
|
<div className="editor-demo block-editor-content">
|
|
39
30
|
<div className="editor-demo-editor container">
|
|
40
31
|
<BlockEditor
|
|
41
|
-
storybookStories={
|
|
32
|
+
storybookStories={storybookStories}
|
|
42
33
|
onChange={setValue}
|
|
43
34
|
elementPropsMap={{}}
|
|
44
35
|
value={value}
|
package/src/plugins/ListItem.js
CHANGED
|
@@ -21,9 +21,9 @@ export const ListItemPlugin = {
|
|
|
21
21
|
event.preventDefault();
|
|
22
22
|
Transforms.insertNodes(editor, {
|
|
23
23
|
at: editor.selection.anchor.path,
|
|
24
|
-
match: node => {
|
|
25
|
-
|
|
26
|
-
},
|
|
24
|
+
// match: node => {
|
|
25
|
+
// return node.type === "list-item";
|
|
26
|
+
// },
|
|
27
27
|
type: "list-item",
|
|
28
28
|
children: [{text: ""}],
|
|
29
29
|
});
|