@vonaffenfels/slate-editor 1.1.71 → 1.2.10
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/.babelrc +43 -43
- package/README.md +5 -5
- package/componentLoader.js +93 -93
- package/dist/BlockEditor.css +4 -1871
- package/dist/BlockEditor.js +336 -3960
- package/dist/BlockEditor.js.LICENSE.txt +61 -0
- package/dist/Renderer.js +2 -2081
- package/dist/Renderer.js.LICENSE.txt +15 -0
- package/dist/fromHTML.js +1 -78
- package/dist/index.css +4 -1871
- package/dist/index.js +336 -4037
- package/dist/index.js.LICENSE.txt +69 -0
- package/dist/toHTML.js +2 -1689
- package/dist/toHTML.js.LICENSE.txt +23 -0
- package/dist/toText.js +2 -1689
- package/dist/toText.js.LICENSE.txt +23 -0
- package/package.json +2 -2
- package/postcss.config.js +6 -6
- package/scss/demo.scss +148 -148
- package/scss/editor.scss +17 -5
- package/scss/sidebarEditor.scss +185 -181
- package/scss/toolbar.scss +161 -161
- package/src/BlockEditor.js +6 -3
- package/src/Blocks/EmptyBlock.js +11 -11
- package/src/Blocks/EmptyWrapper.js +4 -4
- package/src/Blocks/ErrorBoundary.js +40 -40
- package/src/Blocks/LayoutBlock.js +274 -274
- package/src/Blocks/LayoutSlot.js +90 -90
- package/src/CollapsableMenu/CollapsableMenu.js +48 -48
- package/src/Context/StorybookContext.js +6 -6
- package/src/ElementAutocomplete.js +133 -133
- package/src/Loader.js +137 -137
- package/src/Nodes/Default.js +158 -158
- package/src/Nodes/Leaf.js +54 -54
- package/src/Nodes/Text.js +97 -97
- package/src/ObjectId.js +3 -3
- package/src/Renderer.js +73 -73
- package/src/Serializer/Html.js +42 -42
- package/src/Serializer/Serializer.js +371 -371
- package/src/Serializer/Text.js +17 -17
- package/src/Serializer/ads.js +174 -174
- package/src/Serializer/index.js +3 -3
- package/src/SidebarEditor/AssetList.js +181 -181
- package/src/SidebarEditor/Fields/CloudinaryContentSelect.js +89 -89
- package/src/SidebarEditor/Fields/ColorPicker.js +89 -89
- package/src/SidebarEditor/Fields/ContentfulContentSelect.js +62 -62
- package/src/SidebarEditor/Fields/DateTime.js +55 -55
- package/src/SidebarEditor/Fields/MVP.js +66 -66
- package/src/SidebarEditor/Fields/MultiSelect.js +13 -13
- package/src/SidebarEditor/Fields/RemoteMultiSelect.js +40 -40
- package/src/SidebarEditor/Fields/RemoteSelect.js +39 -39
- package/src/SidebarEditor/Fields/Select.js +47 -47
- package/src/SidebarEditor/Fields/StreamSelect.js +15 -15
- package/src/SidebarEditor/Fields/Switch.js +34 -34
- package/src/SidebarEditor/Fields/Textarea.js +21 -21
- package/src/SidebarEditor/Resizable.js +85 -85
- package/src/Storybook.js +151 -151
- package/src/Toolbar/Align.js +64 -64
- package/src/Toolbar/Anchor.js +94 -94
- package/src/Toolbar/Block.js +135 -135
- package/src/Toolbar/Element.js +44 -44
- package/src/Toolbar/Formats.js +71 -71
- package/src/Toolbar/Insert.js +28 -28
- package/src/Toolbar/Layout.js +399 -399
- package/src/Toolbar/Link.js +164 -164
- package/src/Toolbar/Toolbar.js +235 -235
- package/src/Tools/Margin.js +51 -51
- package/src/Translation/TranslationToolbarButton.js +119 -115
- package/src/dev/draftToSlate.json +3147 -3147
- package/src/dev/index.css +2 -2
- package/src/dev/index.html +10 -10
- package/src/dev/index.js +4 -4
- package/src/dev/sampleValue1.json +4294 -4294
- package/src/dev/sampleValueValid.json +410 -410
- package/src/dev/testComponents/TestStory.js +74 -74
- package/src/dev/testComponents/TestStory.stories.js +216 -216
- package/src/dev/testComponents/TestStory2.js +74 -74
- package/src/dev/testComponents/TestStory2.stories.js +197 -197
- package/src/dev/testComponents/TestStory3.js +74 -74
- package/src/dev/testComponents/TestStory3.stories.js +197 -197
- package/src/dev/testSampleValue.json +746 -746
- package/src/fromHTML.js +4 -4
- package/src/helper/array.js +8 -8
- package/src/index.js +10 -10
- package/src/plugins/ListItem.js +48 -48
- package/src/plugins/SoftBreak.js +23 -23
- package/src/toHTML.js +6 -6
- package/src/toText.js +6 -6
- package/src/util/reduceContentfulResponse.js +64 -64
- package/src/util.js +19 -19
- package/storyLoader.js +47 -47
- package/tailwind.config.js +4 -4
- package/webpack.config.build.js +55 -55
- package/webpack.config.dev.js +60 -60
- package/webpack.config.js +130 -130
- package/webpack.config.watch.js +4 -4
package/scss/toolbar.scss
CHANGED
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
.toolbar {
|
|
2
|
-
background-color: rgba(255, 255, 255, 0.95);
|
|
3
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
4
|
-
display: none;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
font-family: Arial, sans-serif;
|
|
8
|
-
padding: 5px;
|
|
9
|
-
position: absolute;
|
|
10
|
-
z-index: 500;
|
|
11
|
-
|
|
12
|
-
&.toolbar-static {
|
|
13
|
-
display: block;
|
|
14
|
-
position: fixed;
|
|
15
|
-
width: 100%;
|
|
16
|
-
max-width: 100%;
|
|
17
|
-
top: 0px;
|
|
18
|
-
left: 0px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.active {
|
|
22
|
-
display: block;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.toolbar-btns {
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.toolbar-btn {
|
|
31
|
-
border-radius: 3px;
|
|
32
|
-
color: black;
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
font-weight: bold;
|
|
35
|
-
margin-right: 5px;
|
|
36
|
-
padding: 5px 7px;
|
|
37
|
-
z-index: 500;
|
|
38
|
-
position: relative;
|
|
39
|
-
display: block;
|
|
40
|
-
|
|
41
|
-
&.active {
|
|
42
|
-
background-color: rgba(0, 0, 0, 0.3);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&:last-child {
|
|
46
|
-
margin-right: 0px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&:hover, &:active {
|
|
50
|
-
background-color: rgba(0, 0, 0, 0.2);
|
|
51
|
-
|
|
52
|
-
.toolbar-btn-config {
|
|
53
|
-
display: block;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.toolbar-btn-config {
|
|
58
|
-
position: absolute;
|
|
59
|
-
top: 28px;
|
|
60
|
-
left: 0px;
|
|
61
|
-
display: none;
|
|
62
|
-
background-color: rgba(255, 255, 255, 0.95);
|
|
63
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
64
|
-
padding: 5px 7px;
|
|
65
|
-
|
|
66
|
-
.toolbar-btn-config-inner {
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-direction: column;
|
|
69
|
-
|
|
70
|
-
.toolbar-btn-config-row {
|
|
71
|
-
min-width: 250px;
|
|
72
|
-
padding: 5px 7px;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: row;
|
|
75
|
-
|
|
76
|
-
.toolbar-form-label {
|
|
77
|
-
flex-grow: 0;
|
|
78
|
-
padding: 0 7px 0 0;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.toolbar-form-input {
|
|
82
|
-
flex-grow: 1;
|
|
83
|
-
|
|
84
|
-
input {
|
|
85
|
-
padding: 5px;
|
|
86
|
-
border: 1px solid grey;
|
|
87
|
-
background-color: white;
|
|
88
|
-
color: black;
|
|
89
|
-
|
|
90
|
-
&[type="checkbox"] {
|
|
91
|
-
&:checked {
|
|
92
|
-
color: white;
|
|
93
|
-
background-color: black;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.toolbar-btn {
|
|
100
|
-
display: flex;
|
|
101
|
-
flex-grow: 1;
|
|
102
|
-
border: 1px solid black;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.toolbar-btn-expand {
|
|
110
|
-
z-index: 500;
|
|
111
|
-
display: block;
|
|
112
|
-
max-height: 28px;
|
|
113
|
-
overflow: hidden;
|
|
114
|
-
|
|
115
|
-
.toolbar-btn-expand-inner {
|
|
116
|
-
display: flex;
|
|
117
|
-
flex-direction: column;
|
|
118
|
-
|
|
119
|
-
.toolbar-btn.active {
|
|
120
|
-
order: -1;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
&:hover {
|
|
125
|
-
.toolbar-btn-expand-inner {
|
|
126
|
-
background-color: rgba(255, 255, 255, 0.95);
|
|
127
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
overflow: visible;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
.toolbar-btn-expand-right {
|
|
137
|
-
z-index: 500;
|
|
138
|
-
display: block;
|
|
139
|
-
max-height: 28px;
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
|
|
142
|
-
.toolbar-btn-expand-inner {
|
|
143
|
-
left: 100%;
|
|
144
|
-
display: flex;
|
|
145
|
-
flex-direction: column;
|
|
146
|
-
|
|
147
|
-
.toolbar-btn.active {
|
|
148
|
-
order: -1;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&:hover {
|
|
153
|
-
.toolbar-btn-expand-inner {
|
|
154
|
-
background-color: rgba(255, 255, 255, 0.95);
|
|
155
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
overflow: visible;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
}
|
|
1
|
+
.toolbar {
|
|
2
|
+
background-color: rgba(255, 255, 255, 0.95);
|
|
3
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
4
|
+
display: none;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
font-family: Arial, sans-serif;
|
|
8
|
+
padding: 5px;
|
|
9
|
+
position: absolute;
|
|
10
|
+
z-index: 500;
|
|
11
|
+
|
|
12
|
+
&.toolbar-static {
|
|
13
|
+
display: block;
|
|
14
|
+
position: fixed;
|
|
15
|
+
width: 100%;
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
top: 0px;
|
|
18
|
+
left: 0px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.active {
|
|
22
|
+
display: block;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.toolbar-btns {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.toolbar-btn {
|
|
31
|
+
border-radius: 3px;
|
|
32
|
+
color: black;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
margin-right: 5px;
|
|
36
|
+
padding: 5px 7px;
|
|
37
|
+
z-index: 500;
|
|
38
|
+
position: relative;
|
|
39
|
+
display: block;
|
|
40
|
+
|
|
41
|
+
&.active {
|
|
42
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:last-child {
|
|
46
|
+
margin-right: 0px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:hover, &:active {
|
|
50
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
51
|
+
|
|
52
|
+
.toolbar-btn-config {
|
|
53
|
+
display: block;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.toolbar-btn-config {
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: 28px;
|
|
60
|
+
left: 0px;
|
|
61
|
+
display: none;
|
|
62
|
+
background-color: rgba(255, 255, 255, 0.95);
|
|
63
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
64
|
+
padding: 5px 7px;
|
|
65
|
+
|
|
66
|
+
.toolbar-btn-config-inner {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
|
|
70
|
+
.toolbar-btn-config-row {
|
|
71
|
+
min-width: 250px;
|
|
72
|
+
padding: 5px 7px;
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: row;
|
|
75
|
+
|
|
76
|
+
.toolbar-form-label {
|
|
77
|
+
flex-grow: 0;
|
|
78
|
+
padding: 0 7px 0 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.toolbar-form-input {
|
|
82
|
+
flex-grow: 1;
|
|
83
|
+
|
|
84
|
+
input {
|
|
85
|
+
padding: 5px;
|
|
86
|
+
border: 1px solid grey;
|
|
87
|
+
background-color: white;
|
|
88
|
+
color: black;
|
|
89
|
+
|
|
90
|
+
&[type="checkbox"] {
|
|
91
|
+
&:checked {
|
|
92
|
+
color: white;
|
|
93
|
+
background-color: black;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.toolbar-btn {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-grow: 1;
|
|
102
|
+
border: 1px solid black;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.toolbar-btn-expand {
|
|
110
|
+
z-index: 500;
|
|
111
|
+
display: block;
|
|
112
|
+
max-height: 28px;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
|
|
115
|
+
.toolbar-btn-expand-inner {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
|
|
119
|
+
.toolbar-btn.active {
|
|
120
|
+
order: -1;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:hover {
|
|
125
|
+
.toolbar-btn-expand-inner {
|
|
126
|
+
background-color: rgba(255, 255, 255, 0.95);
|
|
127
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
overflow: visible;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
.toolbar-btn-expand-right {
|
|
137
|
+
z-index: 500;
|
|
138
|
+
display: block;
|
|
139
|
+
max-height: 28px;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
|
|
142
|
+
.toolbar-btn-expand-inner {
|
|
143
|
+
left: 100%;
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
|
|
147
|
+
.toolbar-btn.active {
|
|
148
|
+
order: -1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&:hover {
|
|
153
|
+
.toolbar-btn-expand-inner {
|
|
154
|
+
background-color: rgba(255, 255, 255, 0.95);
|
|
155
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
overflow: visible;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
}
|
|
162
162
|
}
|
package/src/BlockEditor.js
CHANGED
|
@@ -17,7 +17,9 @@ import "../scss/editor.scss";
|
|
|
17
17
|
import {ListItemPlugin} from "./plugins/ListItem";
|
|
18
18
|
import ErrorBoundary from "../src/Blocks/ErrorBoundary";
|
|
19
19
|
import SidebarEditor from './SidebarEditor';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
Button, Spinner,
|
|
22
|
+
} from '@contentful/forma-36-react-components';
|
|
21
23
|
import {ObjectId} from "./ObjectId";
|
|
22
24
|
import {Resizable} from "./SidebarEditor/Resizable";
|
|
23
25
|
import {Loader} from "./Loader";
|
|
@@ -421,10 +423,11 @@ export default function BlockEditor({
|
|
|
421
423
|
sdk={contentfulSdk}
|
|
422
424
|
setEditorValue={onSlateChange}
|
|
423
425
|
locale={locale}
|
|
426
|
+
className="shrink-0"
|
|
424
427
|
setLocale={setLocale}/>
|
|
425
428
|
{liveLink && (
|
|
426
|
-
<a href={liveLink} target="_blank" rel="noreferrer">
|
|
427
|
-
<
|
|
429
|
+
<a href={liveLink} target="_blank" rel="noreferrer" className='shrink-0'>
|
|
430
|
+
<Button className='whitespace-nowrap' icon="ExternalLink" buttonType='naked'>Live ansehen</Button>
|
|
428
431
|
</a>
|
|
429
432
|
)}
|
|
430
433
|
</div>}/>
|
package/src/Blocks/EmptyBlock.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
export const EmptyBlock = () => {
|
|
4
|
-
if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") {
|
|
5
|
-
// hide this in production
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return <span className="editor-empty-element" style={{minHeight: 200, display: "inline-block"}}>
|
|
10
|
-
Unbekanntes Element
|
|
11
|
-
</span>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const EmptyBlock = () => {
|
|
4
|
+
if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") {
|
|
5
|
+
// hide this in production
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return <span className="editor-empty-element" style={{minHeight: 200, display: "inline-block"}}>
|
|
10
|
+
Unbekanntes Element
|
|
11
|
+
</span>;
|
|
12
12
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
export const EmptyWrapper = ({children}) => {
|
|
4
|
-
return <>{children}</>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const EmptyWrapper = ({children}) => {
|
|
4
|
+
return <>{children}</>;
|
|
5
5
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
export default class ErrorBoundary extends React.Component {
|
|
4
|
-
constructor(props) {
|
|
5
|
-
super(props);
|
|
6
|
-
this.state = {
|
|
7
|
-
hasError: false,
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
static getDerivedStateFromError(error) {
|
|
12
|
-
return {hasError: true};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
componentDidCatch(error, errorInfo) {
|
|
16
|
-
const groupName = `Error in ${this.props.name}`;
|
|
17
|
-
console.groupCollapsed(groupName);
|
|
18
|
-
console.error("Error", error);
|
|
19
|
-
console.error("Info", errorInfo);
|
|
20
|
-
console.groupEnd(groupName);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
if (this.state.hasError) {
|
|
25
|
-
|
|
26
|
-
if (this.props.fallback) {
|
|
27
|
-
return this.props.fallback;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (this.props.isEditor) {
|
|
31
|
-
return <div className="storybook-element-error">
|
|
32
|
-
<p>Error in Element {this.props.name}</p>
|
|
33
|
-
</div>;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return this.props.children;
|
|
40
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export default class ErrorBoundary extends React.Component {
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props);
|
|
6
|
+
this.state = {
|
|
7
|
+
hasError: false,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static getDerivedStateFromError(error) {
|
|
12
|
+
return {hasError: true};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
componentDidCatch(error, errorInfo) {
|
|
16
|
+
const groupName = `Error in ${this.props.name}`;
|
|
17
|
+
console.groupCollapsed(groupName);
|
|
18
|
+
console.error("Error", error);
|
|
19
|
+
console.error("Info", errorInfo);
|
|
20
|
+
console.groupEnd(groupName);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
render() {
|
|
24
|
+
if (this.state.hasError) {
|
|
25
|
+
|
|
26
|
+
if (this.props.fallback) {
|
|
27
|
+
return this.props.fallback;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (this.props.isEditor) {
|
|
31
|
+
return <div className="storybook-element-error">
|
|
32
|
+
<p>Error in Element {this.props.name}</p>
|
|
33
|
+
</div>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return this.props.children;
|
|
40
|
+
}
|
|
41
41
|
}
|