@vonaffenfels/slate-editor 1.0.12 → 1.0.18
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 +2 -2
- package/dist/BlockEditor.js +1 -1
- package/dist/index.css +2 -2
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/scss/editor.scss +24 -48
- package/scss/sidebarEditor.scss +5 -1
- package/src/Nodes/Element.js +0 -2
- package/src/SidebarEditor/AssetList.js +6 -3
- package/src/SidebarEditor/SidebarEditorField.js +28 -2
- package/src/SidebarEditor.js +54 -13
- package/src/dev/testComponents/TestStory.stories.js +16 -1
- package/src/dev/testComponents/TestStory2.js +75 -0
- package/src/dev/testComponents/TestStory2.stories.js +197 -0
- package/src/dev/testComponents/TestStory3.js +75 -0
- package/src/dev/testComponents/TestStory3.stories.js +197 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonaffenfels/slate-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
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": "520a4758b336e266e7ae0e3617b17a7cd8ed2a0e",
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
}
|
package/scss/editor.scss
CHANGED
|
@@ -47,16 +47,10 @@
|
|
|
47
47
|
height: 100%;
|
|
48
48
|
z-index: 100;
|
|
49
49
|
overflow-y: auto;
|
|
50
|
-
padding:
|
|
50
|
+
padding: 45px 0 0 0;
|
|
51
51
|
position: relative;
|
|
52
52
|
|
|
53
|
-
span[data-slate-node="text"] {
|
|
54
|
-
/* eslint-disable-next-line */
|
|
55
|
-
font-family: "Font TWO BR", sans-serif;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
53
|
p[data-slate-node="element"] {
|
|
59
|
-
padding-bottom: 20px;
|
|
60
54
|
position: relative;
|
|
61
55
|
//outline: #CECECE dashed;
|
|
62
56
|
|
|
@@ -74,9 +68,6 @@
|
|
|
74
68
|
|
|
75
69
|
h1[data-slate-node="element"] {
|
|
76
70
|
position: relative;
|
|
77
|
-
font-size: 26px;
|
|
78
|
-
font-weight: bold;
|
|
79
|
-
padding-bottom: 20px;
|
|
80
71
|
|
|
81
72
|
&:after {
|
|
82
73
|
content: "h1";
|
|
@@ -92,9 +83,6 @@
|
|
|
92
83
|
|
|
93
84
|
h2[data-slate-node="element"] {
|
|
94
85
|
position: relative;
|
|
95
|
-
font-size: 24px;
|
|
96
|
-
padding-bottom: 20px;
|
|
97
|
-
font-weight: bold;
|
|
98
86
|
|
|
99
87
|
&:after {
|
|
100
88
|
content: "h2";
|
|
@@ -110,9 +98,6 @@
|
|
|
110
98
|
|
|
111
99
|
h3[data-slate-node="element"] {
|
|
112
100
|
position: relative;
|
|
113
|
-
font-size: 20px;
|
|
114
|
-
padding-bottom: 20px;
|
|
115
|
-
font-weight: bold;
|
|
116
101
|
|
|
117
102
|
&:after {
|
|
118
103
|
content: "h3";
|
|
@@ -128,9 +113,6 @@
|
|
|
128
113
|
|
|
129
114
|
h4[data-slate-node="element"] {
|
|
130
115
|
position: relative;
|
|
131
|
-
font-size: 16px;
|
|
132
|
-
padding-bottom: 20px;
|
|
133
|
-
font-weight: bold;
|
|
134
116
|
|
|
135
117
|
&:after {
|
|
136
118
|
content: "h4";
|
|
@@ -146,9 +128,6 @@
|
|
|
146
128
|
|
|
147
129
|
h5[data-slate-node="element"] {
|
|
148
130
|
position: relative;
|
|
149
|
-
font-size: 14px;
|
|
150
|
-
padding-bottom: 20px;
|
|
151
|
-
font-weight: bold;
|
|
152
131
|
|
|
153
132
|
&:after {
|
|
154
133
|
content: "h5";
|
|
@@ -164,9 +143,6 @@
|
|
|
164
143
|
|
|
165
144
|
h6[data-slate-node="element"] {
|
|
166
145
|
position: relative;
|
|
167
|
-
font-size: 12px;
|
|
168
|
-
padding-bottom: 20px;
|
|
169
|
-
font-weight: bold;
|
|
170
146
|
|
|
171
147
|
&:after {
|
|
172
148
|
content: "h6";
|
|
@@ -180,36 +156,14 @@
|
|
|
180
156
|
}
|
|
181
157
|
}
|
|
182
158
|
|
|
183
|
-
ul[data-slate-node="element"] {
|
|
184
|
-
list-style: circle;
|
|
185
|
-
padding-bottom: 20px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
ol[data-slate-node="element"] {
|
|
189
|
-
list-style: decimal;
|
|
190
|
-
padding-bottom: 20px;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
159
|
.arrow-list {
|
|
194
160
|
list-style-type: "🠆" !important;
|
|
195
161
|
}
|
|
196
|
-
|
|
162
|
+
|
|
197
163
|
.arrow-list li::before {
|
|
198
164
|
content: none !important;
|
|
199
165
|
}
|
|
200
166
|
|
|
201
|
-
a[data-slate-node="element"] {
|
|
202
|
-
color: rgb(var(--color-secondary));
|
|
203
|
-
text-decoration: underline;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
blockquote[data-slate-node="element"] {
|
|
207
|
-
display: block;
|
|
208
|
-
border-left: 5px solid #CECECE;
|
|
209
|
-
padding: 1em;
|
|
210
|
-
margin-bottom: 20px;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
167
|
div[data-slate-editor="true"] {
|
|
214
168
|
height: 100%;
|
|
215
169
|
}
|
|
@@ -454,4 +408,26 @@ button:hover {
|
|
|
454
408
|
|
|
455
409
|
button:active {
|
|
456
410
|
background-color: #0262C9 !important;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
button.button--secondary {
|
|
414
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
|
|
415
|
+
width: 100%;
|
|
416
|
+
padding: 8px 0.75rem !important;
|
|
417
|
+
color: #036fe3 !important;
|
|
418
|
+
border: 1px solid #036fe3 !important;
|
|
419
|
+
transition: all 100ms ease-in-out;
|
|
420
|
+
background-color: transparent !important;
|
|
421
|
+
font-size: 0.875rem !important;
|
|
422
|
+
border-radius: 4px !important;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
button.button--secondary:hover {
|
|
426
|
+
background-color: #036fe3 !important;
|
|
427
|
+
color: #FFFFFF !important;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
button.button--secondary:active {
|
|
431
|
+
background-color: #0262C9 !important;
|
|
432
|
+
color: #FFFFFF !important;
|
|
457
433
|
}
|
package/scss/sidebarEditor.scss
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
p, label {
|
|
15
|
+
p, label, b {
|
|
16
16
|
color: rgb(90, 101, 124);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
input[type="checkbox"] {
|
|
52
52
|
margin-right: 4px;
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
option[disabled] {
|
|
56
|
+
color: rgba(0, 0, 0, 0.3)
|
|
57
|
+
}
|
|
54
58
|
|
|
55
59
|
/* button[data-test-id="cf-ui-button"] span {
|
|
56
60
|
color: #036fe3 !important;
|
package/src/Nodes/Element.js
CHANGED
|
@@ -4,11 +4,13 @@ import {
|
|
|
4
4
|
import {IconButton} from "../SidebarEditor";
|
|
5
5
|
import {swapArrayElements} from "../helper/array";
|
|
6
6
|
|
|
7
|
+
// Hallo :)
|
|
7
8
|
export const AssetList = ({
|
|
8
9
|
assets,
|
|
9
10
|
onChange,
|
|
10
11
|
sdk,
|
|
11
12
|
cloudinary = false,
|
|
13
|
+
onAddClick,
|
|
12
14
|
}) => {
|
|
13
15
|
const renderAssets = assets.filter(Boolean).map((asset, index) => (
|
|
14
16
|
<>
|
|
@@ -22,7 +24,8 @@ export const AssetList = ({
|
|
|
22
24
|
onMoveClick={(direction) => handleMoveClick(direction, index)}
|
|
23
25
|
onDeleteClick={() => handleDeleteClick(index)}
|
|
24
26
|
/>
|
|
25
|
-
|
|
27
|
+
<hr className="my-2" style={{borderColor: "#cfd9e0"}}/>
|
|
28
|
+
{onAddClick && index === assets.length - 1 && <button onClick={onAddClick} className="button--secondary">Hinzufügen</button>}
|
|
26
29
|
</>
|
|
27
30
|
));
|
|
28
31
|
|
|
@@ -108,7 +111,7 @@ export const Asset = ({
|
|
|
108
111
|
<div className="flex flex-col">
|
|
109
112
|
<div className="flex">
|
|
110
113
|
<div className="grow">
|
|
111
|
-
<b className="mt-[3px] block break-
|
|
114
|
+
<b className="mt-[3px] block" style={{wordBreak: "break-word"}}>{title}</b>
|
|
112
115
|
</div>
|
|
113
116
|
<div className="ml-2 shrink-0">
|
|
114
117
|
{!!onMoveClick && (
|
|
@@ -118,7 +121,7 @@ export const Asset = ({
|
|
|
118
121
|
</div>
|
|
119
122
|
)}
|
|
120
123
|
<a className="mr-1" target="_blank" href={href} rel="noreferrer">
|
|
121
|
-
<IconButton size="small">
|
|
124
|
+
<IconButton size="small">Asset</IconButton>
|
|
122
125
|
</a>
|
|
123
126
|
<IconButton size="small" onClick={onDeleteClick}>⨯</IconButton>
|
|
124
127
|
</div>
|
|
@@ -196,7 +196,15 @@ export const SidebarEditorField = ({
|
|
|
196
196
|
<details className="mb-2">
|
|
197
197
|
<summary>{value.length || 0} {value.length === 1 ? "Element" : "Elemente"}</summary>
|
|
198
198
|
<div className="mt-4">
|
|
199
|
-
<AssetList
|
|
199
|
+
<AssetList
|
|
200
|
+
assets={value}
|
|
201
|
+
sdk={sdk}
|
|
202
|
+
onChange={v => onChange(fieldKey, v)}
|
|
203
|
+
onAddClick={() => {
|
|
204
|
+
sdk.dialogs.selectMultipleEntries({contentTypes: field.control.contentTypes}).then(contents => {
|
|
205
|
+
onChange(fieldKey, [...value, ...contents]);
|
|
206
|
+
});
|
|
207
|
+
}} />
|
|
200
208
|
</div>
|
|
201
209
|
</details>
|
|
202
210
|
)}
|
|
@@ -235,7 +243,25 @@ export const SidebarEditorField = ({
|
|
|
235
243
|
<details className="mb-2">
|
|
236
244
|
<summary>{value.length || 0} {value.length === 1 ? "Element" : "Elemente"}</summary>
|
|
237
245
|
<div className="mt-4">
|
|
238
|
-
<AssetList
|
|
246
|
+
<AssetList
|
|
247
|
+
cloudinary
|
|
248
|
+
assets={value}
|
|
249
|
+
sdk={sdk}
|
|
250
|
+
onChange={v => onChange(fieldKey, v)}
|
|
251
|
+
onAddClick={() => {
|
|
252
|
+
sdk.dialogs.openCurrentApp({
|
|
253
|
+
width: "fullWidth",
|
|
254
|
+
title: "Select Images",
|
|
255
|
+
shouldCloseOnOverlayClick: true,
|
|
256
|
+
shouldCloseOnEscapePress: true,
|
|
257
|
+
parameters: {
|
|
258
|
+
type: "cloudinary",
|
|
259
|
+
multiple: true,
|
|
260
|
+
},
|
|
261
|
+
}).then((data) => {
|
|
262
|
+
onChange(fieldKey, [...value, ...(data?.assets || [])]);
|
|
263
|
+
});
|
|
264
|
+
}} />
|
|
239
265
|
</div>
|
|
240
266
|
</details>
|
|
241
267
|
)}
|
package/src/SidebarEditor.js
CHANGED
|
@@ -161,8 +161,6 @@ const SidebarEditor = ({
|
|
|
161
161
|
|
|
162
162
|
useEffect(() => resetVersions, [storybookElement?.editorAttributes?.ref]);
|
|
163
163
|
|
|
164
|
-
console.log({storybookElement});
|
|
165
|
-
|
|
166
164
|
return (
|
|
167
165
|
<div id="sidebar-editor">
|
|
168
166
|
<div>
|
|
@@ -231,7 +229,7 @@ const SidebarEditor = ({
|
|
|
231
229
|
})}
|
|
232
230
|
{Object.keys(fields.tables).map(tableKey => {
|
|
233
231
|
return (
|
|
234
|
-
<details key={`accordion-item-${tableKey}`}>
|
|
232
|
+
<details key={`accordion-item-${tableKey}`} className="mb-2">
|
|
235
233
|
<summary>{tableKey}</summary>
|
|
236
234
|
<div className="mt-4">
|
|
237
235
|
{Object.keys(fields.tables[tableKey]).map(key => {
|
|
@@ -244,7 +242,11 @@ const SidebarEditor = ({
|
|
|
244
242
|
fieldKey={key}
|
|
245
243
|
story={storybookElement}
|
|
246
244
|
field={field}
|
|
247
|
-
onChange={
|
|
245
|
+
onChange={(
|
|
246
|
+
key, value, mvpField, mvpIndex,
|
|
247
|
+
) => handleFieldValueChange(
|
|
248
|
+
key, value, mvpField, mvpIndex,
|
|
249
|
+
)}
|
|
248
250
|
/>;
|
|
249
251
|
})}
|
|
250
252
|
</div>
|
|
@@ -365,6 +367,53 @@ const BlockSelect = ({
|
|
|
365
367
|
});
|
|
366
368
|
};
|
|
367
369
|
|
|
370
|
+
function groupArrayToObject(array) {
|
|
371
|
+
const result = {};
|
|
372
|
+
|
|
373
|
+
array.forEach(item => {
|
|
374
|
+
const parts = item.title.split('/');
|
|
375
|
+
let currentLevel = result;
|
|
376
|
+
|
|
377
|
+
parts.forEach((part, index) => {
|
|
378
|
+
if (!currentLevel[part]) {
|
|
379
|
+
currentLevel[part] = {level: index};
|
|
380
|
+
}
|
|
381
|
+
currentLevel = currentLevel[part];
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
currentLevel.title = item.title;
|
|
385
|
+
currentLevel.shortTitle = parts[parts.length - 1];
|
|
386
|
+
currentLevel.id = item.id;
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
return result;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
let storyGroups = groupArrayToObject(stories);
|
|
393
|
+
|
|
394
|
+
const renderOptions = (obj) => Object.keys(obj).map(key => {
|
|
395
|
+
const option = obj[key];
|
|
396
|
+
if (option.title && option.id) {
|
|
397
|
+
return (
|
|
398
|
+
<option key={option.id} value={option.id}>
|
|
399
|
+
{option.shortTitle}
|
|
400
|
+
</option>
|
|
401
|
+
);
|
|
402
|
+
} else if (typeof option === "object") {
|
|
403
|
+
return (
|
|
404
|
+
<>
|
|
405
|
+
<option
|
|
406
|
+
disabled
|
|
407
|
+
style={{
|
|
408
|
+
color: "rgba(0, 0, 0, 0.3)",
|
|
409
|
+
fontWeight: option.level === 0 ? "bold" : "normal",
|
|
410
|
+
}}>{key}</option>
|
|
411
|
+
{renderOptions(option)}
|
|
412
|
+
</>
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
|
|
368
417
|
return (
|
|
369
418
|
<div className={className}>
|
|
370
419
|
<label className="block">Element</label>
|
|
@@ -373,15 +422,7 @@ const BlockSelect = ({
|
|
|
373
422
|
className="font-bold"
|
|
374
423
|
>
|
|
375
424
|
<option>Element wählen</option>
|
|
376
|
-
{
|
|
377
|
-
<option
|
|
378
|
-
key={`variant-option-${s.id}`}
|
|
379
|
-
selected={active?.block === s.id}
|
|
380
|
-
value={s.id}
|
|
381
|
-
>
|
|
382
|
-
{s.title}
|
|
383
|
-
</option>
|
|
384
|
-
))}
|
|
425
|
+
{renderOptions(storyGroups)}
|
|
385
426
|
</select>
|
|
386
427
|
</div>
|
|
387
428
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import TestStory from "./TestStory";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: "Test Story",
|
|
4
|
+
title: "Elemente/Test/Test Story",
|
|
5
5
|
id: "TestStory",
|
|
6
6
|
component: TestStory,
|
|
7
7
|
storyContext: ["layout"],
|
|
@@ -171,6 +171,21 @@ export default {
|
|
|
171
171
|
control: {type: "text"},
|
|
172
172
|
table: {category: "Kategorie"},
|
|
173
173
|
},
|
|
174
|
+
testText4: {
|
|
175
|
+
name: "Text 4",
|
|
176
|
+
control: {type: "text"},
|
|
177
|
+
table: {category: "Kategorie 2"},
|
|
178
|
+
},
|
|
179
|
+
testText5: {
|
|
180
|
+
name: "Text 5",
|
|
181
|
+
control: {type: "text"},
|
|
182
|
+
table: {category: "Kategorie 2"},
|
|
183
|
+
},
|
|
184
|
+
testText6: {
|
|
185
|
+
name: "Text 6",
|
|
186
|
+
control: {type: "text"},
|
|
187
|
+
table: {category: "Kategorie 2"},
|
|
188
|
+
},
|
|
174
189
|
},
|
|
175
190
|
};
|
|
176
191
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export default function TestStory2({
|
|
2
|
+
title,
|
|
3
|
+
mvp,
|
|
4
|
+
...props
|
|
5
|
+
}) {
|
|
6
|
+
return <div className="bg-green flex flex-col space-y-8 p-4 text-black">
|
|
7
|
+
<h1>{title}</h1>
|
|
8
|
+
<div className="grid grid-cols-4">
|
|
9
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-1">
|
|
10
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad aperiam beatae consequatur consequuntur deserunt exercitationem fugit, magni necessitatibus pariatur quae quia, quisquam saepe sunt, tenetur!
|
|
11
|
+
</div>
|
|
12
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-2">
|
|
13
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias, obcaecati, unde! In labore nesciunt optio, possimus praesentium sunt temporibus vero.
|
|
14
|
+
</div>
|
|
15
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-3">
|
|
16
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi, rem, sapiente! At consequatur cum distinctio dolorem doloribus eligendi labore necessitatibus nemo officia, perspiciatis porro quisquam quos, saepe vitae voluptas. Eligendi?
|
|
17
|
+
</div>
|
|
18
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-4">
|
|
19
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad alias beatae doloribus ex, impedit labore maxime perspiciatis quas. Alias aspernatur cupiditate, error impedit ipsa libero obcaecati reprehenderit sit sunt veniam.
|
|
20
|
+
</div>
|
|
21
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-5">
|
|
22
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores at consequatur cupiditate dolore, dolorem, eligendi et eum explicabo harum illum inventore maxime molestias porro quod recusandae, reiciendis repellat repudiandae saepe sint tempora tempore temporibus veniam voluptates. Dignissimos explicabo iusto reprehenderit.
|
|
23
|
+
</div>
|
|
24
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-6">
|
|
25
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad aperiam beatae consequatur consequuntur deserunt exercitationem fugit, magni necessitatibus pariatur quae quia, quisquam saepe sunt, tenetur!
|
|
26
|
+
</div>
|
|
27
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-7">
|
|
28
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias, obcaecati, unde! In labore nesciunt optio, possimus praesentium sunt temporibus vero.
|
|
29
|
+
</div>
|
|
30
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-8">
|
|
31
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi, rem, sapiente! At consequatur cum distinctio dolorem doloribus eligendi labore necessitatibus nemo officia, perspiciatis porro quisquam quos, saepe vitae voluptas. Eligendi?
|
|
32
|
+
</div>
|
|
33
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-9">
|
|
34
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad alias beatae doloribus ex, impedit labore maxime perspiciatis quas. Alias aspernatur cupiditate, error impedit ipsa libero obcaecati reprehenderit sit sunt veniam.
|
|
35
|
+
</div>
|
|
36
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-10">
|
|
37
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores at consequatur cupiditate dolore, dolorem, eligendi et eum explicabo harum illum inventore maxime molestias porro quod recusandae, reiciendis repellat repudiandae saepe sint tempora tempore temporibus veniam voluptates. Dignissimos explicabo iusto reprehenderit.
|
|
38
|
+
</div>
|
|
39
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-11">
|
|
40
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad aperiam beatae consequatur consequuntur deserunt exercitationem fugit, magni necessitatibus pariatur quae quia, quisquam saepe sunt, tenetur!
|
|
41
|
+
</div>
|
|
42
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-12">
|
|
43
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias, obcaecati, unde! In labore nesciunt optio, possimus praesentium sunt temporibus vero.
|
|
44
|
+
</div>
|
|
45
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-13">
|
|
46
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi, rem, sapiente! At consequatur cum distinctio dolorem doloribus eligendi labore necessitatibus nemo officia, perspiciatis porro quisquam quos, saepe vitae voluptas. Eligendi?
|
|
47
|
+
</div>
|
|
48
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-14">
|
|
49
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad alias beatae doloribus ex, impedit labore maxime perspiciatis quas. Alias aspernatur cupiditate, error impedit ipsa libero obcaecati reprehenderit sit sunt veniam.
|
|
50
|
+
</div>
|
|
51
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-15">
|
|
52
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores at consequatur cupiditate dolore, dolorem, eligendi et eum explicabo harum illum inventore maxime molestias porro quod recusandae, reiciendis repellat repudiandae saepe sint tempora tempore temporibus veniam voluptates. Dignissimos explicabo iusto reprehenderit.
|
|
53
|
+
</div>
|
|
54
|
+
<div className="border border-black p-4" data-teasermanager-slot="test-16">
|
|
55
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad aperiam beatae consequatur consequuntur deserunt exercitationem fugit, magni necessitatibus pariatur quae quia, quisquam saepe sunt, tenetur!
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<h2>Props</h2>
|
|
59
|
+
{!!mvp && mvp.length > 0 && (
|
|
60
|
+
<ul>
|
|
61
|
+
{mvp.map(m => (
|
|
62
|
+
<li key={m.feld1}>
|
|
63
|
+
<b>{m.feld1}</b>:
|
|
64
|
+
<span>{m.feld2}</span>
|
|
65
|
+
</li>
|
|
66
|
+
))}
|
|
67
|
+
</ul>
|
|
68
|
+
)}
|
|
69
|
+
<div>{JSON.stringify({
|
|
70
|
+
...props,
|
|
71
|
+
mvp,
|
|
72
|
+
title,
|
|
73
|
+
})}</div>
|
|
74
|
+
</div>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import TestStory2 from "./TestStory2";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Elemente/Test/Test Story 2",
|
|
5
|
+
id: "TestStory2",
|
|
6
|
+
component: TestStory2,
|
|
7
|
+
storyContext: ["layout"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
title: {
|
|
10
|
+
name: "Titel",
|
|
11
|
+
control: {type: "text"},
|
|
12
|
+
},
|
|
13
|
+
text: {
|
|
14
|
+
name: "Text",
|
|
15
|
+
control: {type: "text"},
|
|
16
|
+
},
|
|
17
|
+
boolean: {
|
|
18
|
+
name: "Boolean",
|
|
19
|
+
control: {type: "boolean"},
|
|
20
|
+
},
|
|
21
|
+
number: {
|
|
22
|
+
name: "Number",
|
|
23
|
+
control: {
|
|
24
|
+
type: "number",
|
|
25
|
+
min:1,
|
|
26
|
+
max:30,
|
|
27
|
+
step: 2,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
range: {
|
|
31
|
+
name: "Range",
|
|
32
|
+
control: {
|
|
33
|
+
type: "range",
|
|
34
|
+
min:1,
|
|
35
|
+
max:30,
|
|
36
|
+
step: 1,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
object: {
|
|
40
|
+
name: "Object",
|
|
41
|
+
control: {type: "object"},
|
|
42
|
+
},
|
|
43
|
+
radio: {
|
|
44
|
+
name: "Radio",
|
|
45
|
+
control: {
|
|
46
|
+
type: "radio",
|
|
47
|
+
options: {
|
|
48
|
+
"Option 1": "option1",
|
|
49
|
+
"Option 2": "option2",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
inlineRadio: {
|
|
54
|
+
name: "Inline Radio",
|
|
55
|
+
control: {
|
|
56
|
+
type: "inline-radio",
|
|
57
|
+
options: {
|
|
58
|
+
"Option 1": "option1",
|
|
59
|
+
"Option 2": "option2",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
check: {
|
|
64
|
+
name: "Check",
|
|
65
|
+
control: {
|
|
66
|
+
type: "check",
|
|
67
|
+
options: {
|
|
68
|
+
"Option 1": "option1",
|
|
69
|
+
"Option 2": "option2",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
inlineCheck: {
|
|
74
|
+
name: "Inline Check",
|
|
75
|
+
control: {
|
|
76
|
+
type: "inline-check",
|
|
77
|
+
options: {
|
|
78
|
+
"Option 1": "option1",
|
|
79
|
+
"Option 2": "option2",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
select: {
|
|
84
|
+
name: "Select",
|
|
85
|
+
control: {
|
|
86
|
+
type: "select",
|
|
87
|
+
options: {
|
|
88
|
+
"Option 1": "option1",
|
|
89
|
+
"Option 2": "option2",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
mutliSelect: {
|
|
94
|
+
name: "Multi Select",
|
|
95
|
+
control: {
|
|
96
|
+
type: "multi-select",
|
|
97
|
+
options: {
|
|
98
|
+
"Option 1": "option1",
|
|
99
|
+
"Option 2": "option2",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
color: {
|
|
104
|
+
name: "Color",
|
|
105
|
+
control: {type: "color"},
|
|
106
|
+
},
|
|
107
|
+
date: {
|
|
108
|
+
name: "Date",
|
|
109
|
+
control: {type: "date"},
|
|
110
|
+
},
|
|
111
|
+
contentfulAsset: {
|
|
112
|
+
name: "Contentful Asset",
|
|
113
|
+
control: {
|
|
114
|
+
type: 'contentful-content',
|
|
115
|
+
contentTypes: ["asset"],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
contentfulAssets: {
|
|
119
|
+
name: "Contentful Assets",
|
|
120
|
+
control: {
|
|
121
|
+
type: 'contentful-contents',
|
|
122
|
+
contentTypes: ["asset"],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
cloudinaryImage: {
|
|
126
|
+
name: "Cloudinary Image",
|
|
127
|
+
control: {type: 'cloudinary-image'},
|
|
128
|
+
},
|
|
129
|
+
cloudinaryImages: {
|
|
130
|
+
name: "Cloudinary Images",
|
|
131
|
+
control: {type: 'cloudinary-images'},
|
|
132
|
+
},
|
|
133
|
+
mvp: {
|
|
134
|
+
name: "MVP",
|
|
135
|
+
control: {
|
|
136
|
+
type: "mvp",
|
|
137
|
+
fields: {
|
|
138
|
+
feld1: {
|
|
139
|
+
name: "Feld 1",
|
|
140
|
+
control: {type: "text"},
|
|
141
|
+
},
|
|
142
|
+
feld2: {
|
|
143
|
+
name: "Feld 2",
|
|
144
|
+
control: {type: "text"},
|
|
145
|
+
},
|
|
146
|
+
feld3: {
|
|
147
|
+
name: "Feld 3",
|
|
148
|
+
control: {
|
|
149
|
+
type: "select",
|
|
150
|
+
options: {
|
|
151
|
+
"Option 1": "option1",
|
|
152
|
+
"Option 2": "option2",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
testText1: {
|
|
160
|
+
name: "Text 1",
|
|
161
|
+
control: {type: "text"},
|
|
162
|
+
table: {category: "Kategorie"},
|
|
163
|
+
},
|
|
164
|
+
testText2: {
|
|
165
|
+
name: "Text 2",
|
|
166
|
+
control: {type: "text"},
|
|
167
|
+
table: {category: "Kategorie"},
|
|
168
|
+
},
|
|
169
|
+
testText3: {
|
|
170
|
+
name: "Text 3",
|
|
171
|
+
control: {type: "text"},
|
|
172
|
+
table: {category: "Kategorie"},
|
|
173
|
+
},
|
|
174
|
+
testText4: {
|
|
175
|
+
name: "Text 4",
|
|
176
|
+
control: {type: "text"},
|
|
177
|
+
table: {category: "Kategorie 2"},
|
|
178
|
+
},
|
|
179
|
+
testText5: {
|
|
180
|
+
name: "Text 5",
|
|
181
|
+
control: {type: "text"},
|
|
182
|
+
table: {category: "Kategorie 2"},
|
|
183
|
+
},
|
|
184
|
+
testText6: {
|
|
185
|
+
name: "Text 6",
|
|
186
|
+
control: {type: "text"},
|
|
187
|
+
table: {category: "Kategorie 2"},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export const TestStoryVariant1 = (args) => <TestStory2 {...args} />;
|
|
193
|
+
export const TestStoryVariant2 = (args) => <TestStory2 {...args} />;
|
|
194
|
+
|
|
195
|
+
TestStoryVariant1.args = {text: "Test 1"};
|
|
196
|
+
|
|
197
|
+
TestStoryVariant2.args = {text: "Test 2"};
|