@byline/richtext-lexical 3.3.0 → 3.4.0

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.
@@ -140,26 +140,45 @@ html[data-theme="dark"] .LexicalEditorTheme__textCode,
140
140
  background-color: rgb(240, 242, 245);
141
141
  font-family: Menlo, Consolas, Monaco, monospace;
142
142
  display: block;
143
- padding: 8px 8px 8px 52px;
143
+ /* No left padding: the sticky gutter must sit flush at the block's left
144
+ * edge. Any left padding offsets the gutter rightward and leaves a strip
145
+ * to its left where scrolled code text peeks through. The gutter's own
146
+ * padding + margin-right provides the spacing before the code. */
147
+ padding: 8px 8px 8px 0;
144
148
  line-height: 1.53;
145
149
  font-size: 15px;
146
150
  margin: 0;
147
151
  margin-top: 8px;
148
152
  margin-bottom: 8px;
149
153
  tab-size: 2;
150
- /* white-space: pre; */
154
+ /* Code lines must NOT wrap. The data-gutter line numbers track logical
155
+ * (newline-separated) lines; if lines wrap, the visual line count exceeds
156
+ * the gutter and the numbers no longer line up. Overflow scrolls within
157
+ * the block instead. max-width/box-sizing keep the scroll inside the code
158
+ * element rather than blowing out the editor width. */
159
+ white-space: pre;
151
160
  overflow-x: auto;
152
161
  position: relative;
162
+ max-width: 100%;
163
+ box-sizing: border-box;
153
164
  }
154
165
 
155
166
  .LexicalEditorTheme__code:before {
156
167
  content: attr(data-gutter);
157
- position: absolute;
158
- background-color: #eee;
168
+ /* sticky + float keeps the gutter pinned to the left edge while the code
169
+ * scrolls horizontally (previously position: absolute, which scrolled out
170
+ * of view with the content, leaving the line numbers behind). */
171
+ position: sticky;
172
+ float: left;
159
173
  left: 0;
160
174
  top: 0;
175
+ z-index: 3;
176
+ min-height: 100%;
177
+ background-color: #eee;
161
178
  border-right: 1px solid #ccc;
162
179
  padding: 8px;
180
+ margin-right: 10px;
181
+ margin-top: -8px;
163
182
  color: #777;
164
183
  white-space: pre-wrap;
165
184
  text-align: right;
@@ -12,6 +12,10 @@
12
12
  display: flex;
13
13
  flex: 1 1 0%;
14
14
  height: 100%;
15
+ /* Allow shrinking below content min-content so a wide (white-space:pre)
16
+ * code block inside the editor scrolls internally instead of stretching
17
+ * this field — and the form column — across the sidebar. */
18
+ min-width: 0;
15
19
  }
16
20
 
17
21
  .label-row,
@@ -26,4 +30,7 @@
26
30
  flex: 1 1 0%;
27
31
  flex-direction: column;
28
32
  gap: 0.25rem;
33
+ /* Same rationale as .wrapper — keep the editor body from growing to the
34
+ * code block's intrinsic width. */
35
+ min-width: 0;
29
36
  }