@vonaffenfels/slate-editor 1.2.0 → 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/dist/BlockEditor.css +2 -2
- package/dist/BlockEditor.js +3 -3
- package/dist/index.css +2 -2
- package/dist/index.js +4 -4
- package/package.json +2 -2
- package/scss/editor.scss +17 -5
- package/scss/sidebarEditor.scss +5 -1
- package/src/BlockEditor.js +6 -3
- package/src/Toolbar/Toolbar.js +3 -3
- package/src/Translation/TranslationToolbarButton.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonaffenfels/slate-editor",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"cssnano": "^5.0.1",
|
|
73
73
|
"escape-html": "^1.0.3"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "2fb71335ee7a1a3578e463b6c9c37ddb99e1f018",
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
}
|
package/scss/editor.scss
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;
|
|
4
4
|
|
|
5
|
+
input {
|
|
6
|
+
background-image: none !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
.block-editor-wrapper {
|
|
6
10
|
|
|
7
11
|
position: relative;
|
|
@@ -433,21 +437,29 @@
|
|
|
433
437
|
.resizable {
|
|
434
438
|
|
|
435
439
|
&.enabled {
|
|
436
|
-
|
|
437
|
-
|
|
440
|
+
@media (max-width: 360px) {
|
|
441
|
+
.resizable-left {
|
|
442
|
+
max-width: calc(100vw - 300px);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.resizable-right {
|
|
446
|
+
width: 100%;
|
|
447
|
+
}
|
|
438
448
|
}
|
|
439
449
|
}
|
|
440
450
|
|
|
441
451
|
.resizable-left {
|
|
442
452
|
scrollbar-width: none;
|
|
443
|
-
max-width: 100vw;
|
|
444
453
|
position: relative;
|
|
445
454
|
}
|
|
446
455
|
|
|
447
456
|
.resizable-right {
|
|
448
457
|
scrollbar-width: none;
|
|
449
|
-
max-width:
|
|
450
|
-
|
|
458
|
+
max-width: 300px;
|
|
459
|
+
height: 100%;
|
|
460
|
+
position: absolute;
|
|
461
|
+
right: 0;
|
|
462
|
+
top: 0;
|
|
451
463
|
}
|
|
452
464
|
|
|
453
465
|
.resizable-x-handle {
|
package/scss/sidebarEditor.scss
CHANGED
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/Toolbar/Toolbar.js
CHANGED
|
@@ -138,7 +138,7 @@ export const Toolbar = ({
|
|
|
138
138
|
})}
|
|
139
139
|
>
|
|
140
140
|
<div className="toolbar-btns">
|
|
141
|
-
<div className="flex grow items-center">
|
|
141
|
+
<div className="flex grow items-center overflow-x-auto">
|
|
142
142
|
<div className="flex">
|
|
143
143
|
<FormatButtonBold/>
|
|
144
144
|
<FormatButtonItalic/>
|
|
@@ -177,7 +177,7 @@ export const Toolbar = ({
|
|
|
177
177
|
</ToobarHoverExpandButton>
|
|
178
178
|
</div>
|
|
179
179
|
|
|
180
|
-
<div>
|
|
180
|
+
<div className="shrink-0">
|
|
181
181
|
<ElementAutocomplete
|
|
182
182
|
isLoading={isLoadingStories}
|
|
183
183
|
storybookStories={storybookStories}
|
|
@@ -193,7 +193,7 @@ export const Toolbar = ({
|
|
|
193
193
|
className="!w-auto !border-0 !bg-green-600 !text-xs font-bold text-white hover:!bg-green-700"
|
|
194
194
|
onClick={onSaveClick}>Änderungen speichern</button>}
|
|
195
195
|
{buttons && (
|
|
196
|
-
<div>{buttons}</div>
|
|
196
|
+
<div className="shink-0">{buttons}</div>
|
|
197
197
|
)}
|
|
198
198
|
</div>
|
|
199
199
|
</Menu>;
|
|
@@ -5,6 +5,7 @@ import {Modal} from '@contentful/f36-components';
|
|
|
5
5
|
import {
|
|
6
6
|
Select, Button, Paragraph,
|
|
7
7
|
} from '@contentful/f36-components';
|
|
8
|
+
import classNames from "classnames";
|
|
8
9
|
|
|
9
10
|
export const TranslationToolbarButton = ({
|
|
10
11
|
sdk,
|
|
@@ -12,6 +13,7 @@ export const TranslationToolbarButton = ({
|
|
|
12
13
|
locale,
|
|
13
14
|
setLocale,
|
|
14
15
|
translateFromLocale = "de",
|
|
16
|
+
className,
|
|
15
17
|
}) => {
|
|
16
18
|
const [loading, setLoading] = useState(false);
|
|
17
19
|
const [error, setError] = useState(null);
|
|
@@ -74,16 +76,18 @@ export const TranslationToolbarButton = ({
|
|
|
74
76
|
translateEditorValue(translateFromValue, locale);
|
|
75
77
|
};
|
|
76
78
|
|
|
77
|
-
return <div className="flex gap-2">
|
|
79
|
+
return <div className={classNames("flex gap-2", className)}>
|
|
78
80
|
{!!error && <ErrorOverlay title={error.title} message={error.message} />}
|
|
79
81
|
{locale !== sdk.locales.default &&
|
|
80
82
|
<Button
|
|
81
83
|
variant="secondary"
|
|
84
|
+
className="shrink-0"
|
|
82
85
|
onClick={onAutoTranslateClick}
|
|
83
86
|
size="small">{loading ? "Wird übersetzt..." : "Automatisch Übersetzen"}</Button>}
|
|
84
87
|
<Select
|
|
85
88
|
value={locale}
|
|
86
89
|
onChange={handleOnChange}
|
|
90
|
+
className="shrink-0"
|
|
87
91
|
>
|
|
88
92
|
{Object.keys(sdk?.locales?.names || {}).map((locale) => {
|
|
89
93
|
return <Select.Option key={locale} value={locale}>{sdk.locales.names[locale]}</Select.Option>;
|