File size: 2,191 Bytes
4e7644b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
.markdownCopy {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  height: 20px;
  color: var(--ant-color-text);
}

.controlGroup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.previewToggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.previewLabel {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

.markdownViewer {
  flex: 1;
  min-height: 300px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background-color: #fff;
  max-width: 100%;

  :global {
    .x-markdown {
      max-width: 100%;
      overflow-wrap: break-word;
      word-break: break-word;
    }

    pre {
      border-radius: 6px;
      overflow-x: auto;
      height: auto;
      margin: 0;

      code {
        background: transparent;
        padding: 0;
        margin: 0;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
          monospace;
        font-size: 13px;
        line-height: 1.6;
        white-space: pre-wrap;
        word-break: break-word;
      }
    }

    table {
      border-collapse: collapse;
      width: auto;
      margin: 1em 0;
      display: table !important;
      max-width: 100%;
      overflow-x: auto;

      thead,
      tbody,
      tfoot {
        display: table-header-group;
      }

      tbody {
        display: table-row-group;
      }

      tr {
        display: table-row;
      }

      th,
      td {
        display: table-cell;
        border: 1px solid #d0d7de;
        padding: 8px 12px;
        text-align: left;
      }

      th {
        background: #f6f8fa;
        font-weight: 600;
      }

      tr:nth-child(2n) {
        background: #f6f8fa;
      }
    }
  }
}

.textareaContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.textarea {
  font-family: monospace;
  font-size: 13px;
  resize: vertical;
  height: min(100%, clamp(280px, 50vh, 640px));
  min-height: min(240px, 100%);
  max-height: 100%;
  padding: 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
}