@vonaffenfels/slate-editor 1.2.0 → 1.2.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonaffenfels/slate-editor",
3
- "version": "1.2.0",
3
+ "version": "1.2.11",
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": "fe9b4ce59e9b4dfae924c580f3a1247c180f4d9b",
75
+ "gitHead": "fa0c31b3c84bf9dfc1ce3707da9fb135834adb85",
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
- .resizable-left {
437
- max-width: calc(100vw - 300px);
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: calc(100vw - 300px);
450
- position: relative;
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 {
@@ -1,5 +1,9 @@
1
1
  #sidebar-editor-wrapper {
2
- padding-top: 45px;
2
+ @media (max-width: 768px) {
3
+ padding-top: 66px;
4
+ }
5
+
6
+ padding-top: 51px;
3
7
  height: 100%;
4
8
  flex-basis: 400px;
5
9
  flex-shrink: 0;
@@ -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 {Spinner} from '@contentful/forma-36-react-components';
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
- <button className='button button--secondary'>Live-Seite öffnen</button>
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>}/>
@@ -121,6 +121,7 @@ export const ElementAutocomplete = ({
121
121
  width="medium"
122
122
  itemToString={(item) => ""}
123
123
  renderItem={(item) => `${item.label}`}
124
+ className="!static" // fix for toolbar overflow
124
125
  {...props}
125
126
  />
126
127
  );
@@ -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>;