|
48 | 48 | <Button :action="() => linkModal?.hide()"><XIcon /> Cancel</Button> |
49 | 49 | <Button |
50 | 50 | color="primary" |
51 | | - :disabled="linkValidationErrorMessage || !linkUrl" |
| 51 | + :disabled="!!linkValidationErrorMessage || !linkUrl" |
52 | 52 | :action=" |
53 | 53 | () => { |
54 | 54 | if (editor) markdownCommands.replaceSelection(editor, linkMarkdown) |
|
189 | 189 | <Button :action="() => videoModal?.hide()"><XIcon /> Cancel</Button> |
190 | 190 | <Button |
191 | 191 | color="primary" |
192 | | - :disabled="linkValidationErrorMessage || !linkUrl" |
| 192 | + :disabled="!!linkValidationErrorMessage || !linkUrl" |
193 | 193 | :action=" |
194 | 194 | () => { |
195 | 195 | if (editor) markdownCommands.replaceSelection(editor, videoMarkdown) |
|
230 | 230 | </div> |
231 | 231 | </div> |
232 | 232 | <div ref="editorRef" :class="{ hide: previewMode }" /> |
233 | | - <div v-if="!previewMode" class="info-blurb"> |
| 233 | + <div v-if="!previewMode" class="info-blurb mt-2"> |
234 | 234 | <div class="info-blurb"> |
235 | 235 | <InfoIcon /> |
236 | 236 | <span |
|
270 | 270 | import { history, historyKeymap, indentWithTab } from '@codemirror/commands' |
271 | 271 | import { markdown } from '@codemirror/lang-markdown' |
272 | 272 | import { Compartment, EditorState } from '@codemirror/state' |
273 | | -import { EditorView, keymap, placeholder as cm_placeholder } from '@codemirror/view' |
| 273 | +import { placeholder as cm_placeholder, EditorView, keymap } from '@codemirror/view' |
274 | 274 | import { |
275 | 275 | AlignLeftIcon, |
276 | 276 | BoldIcon, |
@@ -345,19 +345,32 @@ onMounted(() => { |
345 | 345 |
|
346 | 346 | const theme = EditorView.theme({ |
347 | 347 | // in defaults.scss there's references to .cm-content and such to inherit global styles |
| 348 | + '&': { |
| 349 | + borderRadius: 'var(--radius-md)', |
| 350 | + background: 'var(--color-button-bg)', |
| 351 | + border: '0.25rem solid transparent', |
| 352 | + transition: 'border-color 0.1s ease-in-out', |
| 353 | + }, |
| 354 | + '&.cm-focused': { |
| 355 | + 'box-shadow': 'inset 0 0 0 transparent, 0 0 0 0.25rem var(--color-brand-shadow)', |
| 356 | + color: 'var(--color-contrast)', |
| 357 | + outline: 'none', |
| 358 | + }, |
| 359 | + '.cm-focused': { |
| 360 | + border: 'none', |
| 361 | + }, |
348 | 362 | '.cm-content': { |
349 | 363 | marginBlockEnd: '0.5rem', |
350 | 364 | padding: '0.5rem', |
351 | 365 | minHeight: '200px', |
352 | 366 | caretColor: 'var(--color-contrast)', |
353 | 367 | width: '100%', |
354 | | - overflowX: 'scroll', |
355 | | - maxHeight: props.maxHeight ? `${props.maxHeight}px` : 'unset', |
356 | | - overflowY: 'scroll', |
357 | 368 | }, |
358 | 369 | '.cm-scroller': { |
| 370 | + borderRadius: 'var(--radius-md)', |
359 | 371 | height: '100%', |
360 | | - overflow: 'visible', |
| 372 | + maxHeight: props.maxHeight ? `${props.maxHeight}px` : 'unset', |
| 373 | + overflow: 'auto', |
361 | 374 | }, |
362 | 375 | }) |
363 | 376 |
|
@@ -581,23 +594,35 @@ watch( |
581 | 594 | editorThemeCompartment.reconfigure( |
582 | 595 | EditorView.theme({ |
583 | 596 | // in defaults.scss there's references to .cm-content and such to inherit global styles |
| 597 | + '&': { |
| 598 | + borderRadius: 'var(--radius-md)', |
| 599 | + background: 'var(--color-button-bg)', |
| 600 | + border: '0.25rem solid transparent', |
| 601 | + transition: 'border-color 0.1s ease-in-out', |
| 602 | + }, |
| 603 | + '&.cm-focused': { |
| 604 | + 'box-shadow': 'inset 0 0 0 transparent, 0 0 0 0.25rem var(--color-brand-shadow)', |
| 605 | + color: 'var(--color-contrast)', |
| 606 | + outline: 'none', |
| 607 | + }, |
| 608 | + '.cm-focused': { |
| 609 | + border: 'none', |
| 610 | + }, |
584 | 611 | '.cm-content': { |
585 | 612 | marginBlockEnd: '0.5rem', |
586 | 613 | padding: '0.5rem', |
587 | 614 | minHeight: '200px', |
588 | 615 | caretColor: 'var(--color-contrast)', |
589 | 616 | width: '100%', |
590 | | - overflowX: 'scroll', |
591 | | - maxHeight: props.maxHeight ? `${props.maxHeight}px` : 'unset', |
592 | | - overflowY: 'scroll', |
593 | | -
|
594 | 617 | opacity: newValue ? 0.6 : 1, |
595 | 618 | pointerEvents: newValue ? 'none' : 'all', |
596 | 619 | cursor: newValue ? 'not-allowed' : 'auto', |
597 | 620 | }, |
598 | 621 | '.cm-scroller': { |
| 622 | + borderRadius: 'var(--radius-md)', |
599 | 623 | height: '100%', |
600 | | - overflow: 'visible', |
| 624 | + maxHeight: props.maxHeight ? `${props.maxHeight}px` : 'unset', |
| 625 | + overflow: 'auto', |
601 | 626 | }, |
602 | 627 | }), |
603 | 628 | ), |
@@ -957,8 +982,4 @@ function openVideoModal() { |
957 | 982 | pointer-events: none; |
958 | 983 | cursor: not-allowed; |
959 | 984 | } |
960 | | -
|
961 | | -:deep(.cm-content) { |
962 | | - overflow: auto; |
963 | | -} |
964 | 985 | </style> |
0 commit comments