@@ -7,6 +7,7 @@ import DiffViewer from "@/components/messages2/DiffViewer.vue";
7
7
import CodeEditor from " @/components/CodeEditor.vue" ;
8
8
import { useSagaDiagramStore } from " @/stores/SagaDiagramStore" ;
9
9
import { ref , watch , computed } from " vue" ;
10
+ import { EditorView } from " @codemirror/view" ;
10
11
11
12
// Import the images directly
12
13
import CommandIcon from " @/assets/command.svg" ;
@@ -16,6 +17,23 @@ import TimeoutIcon from "@/assets/timeout.svg";
16
17
import EventIcon from " @/assets/event.svg" ;
17
18
import SagaTimeoutIcon from " @/assets/SagaTimeoutIcon.svg" ;
18
19
20
+ // Define the monospace theme for CodeEditor
21
+ const monospaceTheme = EditorView .baseTheme ({
22
+ " &" : {
23
+ fontFamily: " monospace" ,
24
+ fontSize: " 0.75rem" ,
25
+ backgroundColor: " #f2f2f2" ,
26
+ },
27
+ " .cm-editor" : {
28
+ fontFamily: " monospace" ,
29
+ fontSize: " 0.75rem" ,
30
+ backgroundColor: " #f2f2f2" ,
31
+ },
32
+ " .cm-scroller" : {
33
+ backgroundColor: " #f2f2f2" ,
34
+ },
35
+ });
36
+
19
37
// Define types for JSON values and properties
20
38
type JsonValue = string | number | boolean | null | JsonObject | JsonArray ;
21
39
interface JsonObject {
@@ -181,7 +199,7 @@ const hasStateChanges = computed(() => {
181
199
182
200
<!-- Initial state display -->
183
201
<div v-else-if =" update.IsFirstNode" class =" json-container" >
184
- <CodeEditor css = " monospace-code " :model-value =" sagaUpdateStateChanges.formattedState || ''" language =" json" :showCopyToClipboard =" false" :showGutter =" false" />
202
+ <CodeEditor :model-value =" sagaUpdateStateChanges.formattedState || ''" language =" json" :showCopyToClipboard =" false" :showGutter =" false" :extensions = " [monospaceTheme] " />
185
203
</div >
186
204
187
205
<!-- No changes message -->
@@ -408,6 +426,14 @@ const hasStateChanges = computed(() => {
408
426
background-color : transparent ;
409
427
}
410
428
429
+ /* Override CodeEditor wrapper styles */
430
+ .json-container :deep(.wrapper ) {
431
+ border-radius : 0 ;
432
+ border : none ;
433
+ background-color : #f2f2f2 ;
434
+ margin-top : 0 ;
435
+ }
436
+
411
437
.no-changes-message {
412
438
padding : 1rem ;
413
439
text-align : center ;
@@ -422,23 +448,6 @@ const hasStateChanges = computed(() => {
422
448
color : #a94442 ;
423
449
}
424
450
425
- /* Monospace font styling that matches DiffViewer */
426
- :deep(.monospace-code ) {
427
- border-radius : 0 ;
428
- border : none ;
429
- background-color : #f2f2f2 ;
430
- }
431
-
432
- :deep(.monospace-code ) .cm-editor {
433
- font-family : monospace ;
434
- font-size : 0.75rem ;
435
- background-color : #f2f2f2 ;
436
- }
437
-
438
- :deep(.monospace-code ) .cm-scroller {
439
- background-color : #f2f2f2 ;
440
- }
441
-
442
451
@-webkit-keyframes blink-border {
443
452
0% ,
444
453
100% {
0 commit comments