tiptap-markdown-react 0.11.0 → 0.12.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.
package/dist/style.css CHANGED
@@ -3,33 +3,31 @@
3
3
 
4
4
  /* 编辑器最外层:查找替换浮动条的粘性范围就是它(超出编辑器范围后浮动条随之离场)。
5
5
  正文的滚动容器仍是 .editorScroll(宿主传的 className 依然落在它身上,契约不变)。 */
6
- ._editorHost_teucm_6 {
6
+ ._editorHost_1k0bn_6 {
7
7
  position: relative;
8
8
  }
9
9
 
10
10
  /* 浮动条的粘性锚点:高度 0,不占布局、不推挤正文;sticky 让浮动条在「最近的滚动容器」
11
11
  里粘住(宿主的外层滚动容器或页面本身),正文滚动时不会把条子卷上去。
12
12
  注意:锚点必须在 DOM 里排在正文之前——排在后面的话它的自然位置在正文底部,粘性范围就错了。 */
13
- ._findBarAnchor_teucm_13 {
13
+ ._findBarAnchor_1k0bn_13 {
14
14
  position: sticky;
15
- top: 4px;
15
+ top: 0;
16
16
  height: 0;
17
17
  z-index: 7;
18
18
  }
19
19
 
20
- /* 浮动条本体:相对锚点绝对定位,浮在正文右上角 */
21
- ._findBar_teucm_13 {
20
+ /* 浮动条本体:绝对定位浮在正文之上,具体落点由 findBarOffset 决定(默认右上 4px) */
21
+ ._findBar_1k0bn_13 {
22
22
  position: absolute;
23
- top: 0;
24
- right: 4px;
25
23
  }
26
24
 
27
- ._editorScroll_teucm_5 {
25
+ ._editorScroll_1k0bn_5 {
28
26
  margin-top: 24px;
29
27
  position: relative;
30
28
  }
31
29
 
32
- ._editorContent_teucm_32 {
30
+ ._editorContent_1k0bn_30 {
33
31
  outline: none;
34
32
  padding: 0;
35
33
  font-family: var(
@@ -52,7 +50,7 @@
52
50
  }
53
51
 
54
52
  /* placeholder:空文档第一段显示占位符 */
55
- ._editorContent_teucm_32 p.is-editor-empty:first-child::before {
53
+ ._editorContent_1k0bn_30 p.is-editor-empty:first-child::before {
56
54
  content: attr(data-placeholder);
57
55
  float: left;
58
56
  height: 0;
@@ -60,7 +58,7 @@
60
58
  pointer-events: none;
61
59
  }
62
60
 
63
- ._editorContent_teucm_32 h1 {
61
+ ._editorContent_1k0bn_30 h1 {
64
62
  font-family: inherit;
65
63
  font-size: 1.55em;
66
64
  font-weight: 700;
@@ -68,7 +66,7 @@
68
66
  line-height: 1.3;
69
67
  }
70
68
 
71
- ._editorContent_teucm_32 h2 {
69
+ ._editorContent_1k0bn_30 h2 {
72
70
  font-family: inherit;
73
71
  font-size: 1.3em;
74
72
  font-weight: 700;
@@ -76,7 +74,7 @@
76
74
  line-height: 1.3;
77
75
  }
78
76
 
79
- ._editorContent_teucm_32 h3 {
77
+ ._editorContent_1k0bn_30 h3 {
80
78
  font-family: inherit;
81
79
  font-size: 1.12em;
82
80
  font-weight: 600;
@@ -84,21 +82,21 @@
84
82
  }
85
83
 
86
84
  /* h4-h6:延续 h1-h3 尺寸梯度递减;字号差变小后靠字重保持标题感,h6 字色稍弱。 */
87
- ._editorContent_teucm_32 h4 {
85
+ ._editorContent_1k0bn_30 h4 {
88
86
  font-family: inherit;
89
87
  font-size: 1.05em;
90
88
  font-weight: 600;
91
89
  margin: 0.7em 0 0.3em;
92
90
  }
93
91
 
94
- ._editorContent_teucm_32 h5 {
92
+ ._editorContent_1k0bn_30 h5 {
95
93
  font-family: inherit;
96
94
  font-size: 0.95em;
97
95
  font-weight: 600;
98
96
  margin: 0.7em 0 0.3em;
99
97
  }
100
98
 
101
- ._editorContent_teucm_32 h6 {
99
+ ._editorContent_1k0bn_30 h6 {
102
100
  font-family: inherit;
103
101
  font-size: 0.88em;
104
102
  font-weight: 600;
@@ -106,25 +104,25 @@
106
104
  color: var(--tmr-muted, #777777);
107
105
  }
108
106
 
109
- ._editorContent_teucm_32 p {
107
+ ._editorContent_1k0bn_30 p {
110
108
  margin: 0.7em 0;
111
109
  }
112
110
 
113
- ._editorContent_teucm_32 ul,
114
- ._editorContent_teucm_32 ol {
111
+ ._editorContent_1k0bn_30 ul,
112
+ ._editorContent_1k0bn_30 ol {
115
113
  padding-left: 1.5em;
116
114
  margin: 0.7em 0;
117
115
  }
118
116
 
119
- ._editorContent_teucm_32 ul {
117
+ ._editorContent_1k0bn_30 ul {
120
118
  list-style: disc;
121
119
  }
122
120
 
123
- ._editorContent_teucm_32 ol {
121
+ ._editorContent_1k0bn_30 ol {
124
122
  list-style: decimal;
125
123
  }
126
124
 
127
- ._editorContent_teucm_32 blockquote {
125
+ ._editorContent_1k0bn_30 blockquote {
128
126
  border-left: 3px solid var(--tmr-accent, #ff6719);
129
127
  padding-left: 1em;
130
128
  margin: 0.9em 0;
@@ -132,13 +130,13 @@
132
130
  font-style: italic;
133
131
  }
134
132
 
135
- ._editorContent_teucm_32 a {
133
+ ._editorContent_1k0bn_30 a {
136
134
  color: var(--tmr-accent, #ff6719);
137
135
  text-decoration: underline;
138
136
  }
139
137
 
140
138
  /* 仅行内代码加灰底;代码块内的 <code>(在 pre 内)由 NodeView 自管,排除掉 */
141
- ._editorContent_teucm_32 code:not(pre code) {
139
+ ._editorContent_1k0bn_30 code:not(pre code) {
142
140
  background: var(--tmr-code-bg, #f4f4f4);
143
141
  padding: 0.15em 0.4em;
144
142
  border-radius: 4px;
@@ -153,13 +151,13 @@
153
151
  );
154
152
  }
155
153
 
156
- ._editorContent_teucm_32 hr {
154
+ ._editorContent_1k0bn_30 hr {
157
155
  border: none;
158
156
  border-top: 1px solid var(--tmr-border, #e6e6e6);
159
157
  margin: 1.5em 0;
160
158
  }
161
159
 
162
- ._editorContent_teucm_32 img {
160
+ ._editorContent_1k0bn_30 img {
163
161
  max-width: 100%;
164
162
  height: auto;
165
163
  border-radius: 6px;
@@ -168,21 +166,21 @@
168
166
  }
169
167
 
170
168
  /* 选中的图片高亮 */
171
- ._editorContent_teucm_32 img.ProseMirror-selectednode {
169
+ ._editorContent_1k0bn_30 img.ProseMirror-selectednode {
172
170
  outline: 2px solid var(--tmr-accent, #ff6719);
173
171
  }
174
172
 
175
173
  /* 表格:细边框、表头浅灰;外包 .tableWrapper(编辑器 NodeView + SSR renderWrapper)
176
174
  * 桌面:width:100% + 允许换行,整表落在阅读列内(与改前一致)
177
175
  * 窄屏:max-content + nowrap,避免列被挤扁,wrapper 内横滑 */
178
- ._editorContent_teucm_32 .tableWrapper {
176
+ ._editorContent_1k0bn_30 .tableWrapper {
179
177
  max-width: 100%;
180
178
  overflow-x: auto;
181
179
  -webkit-overflow-scrolling: touch;
182
180
  margin: 1em 0;
183
181
  }
184
182
 
185
- ._editorContent_teucm_32 table {
183
+ ._editorContent_1k0bn_30 table {
186
184
  border-collapse: collapse;
187
185
  table-layout: auto;
188
186
  width: 100%;
@@ -192,12 +190,12 @@
192
190
  }
193
191
 
194
192
  /* 无 wrapper 的遗留 HTML(旧缓存)仍给一点外边距 */
195
- ._editorContent_teucm_32 :not(.tableWrapper) > table {
193
+ ._editorContent_1k0bn_30 :not(.tableWrapper) > table {
196
194
  margin: 1em 0;
197
195
  }
198
196
 
199
- ._editorContent_teucm_32 table td,
200
- ._editorContent_teucm_32 table th {
197
+ ._editorContent_1k0bn_30 table td,
198
+ ._editorContent_1k0bn_30 table th {
201
199
  border: 1px solid var(--tmr-border, #e6e6e6);
202
200
  padding: 8px 12px;
203
201
  vertical-align: top;
@@ -208,27 +206,27 @@
208
206
  word-break: break-word;
209
207
  }
210
208
 
211
- ._editorContent_teucm_32 table th {
209
+ ._editorContent_1k0bn_30 table th {
212
210
  background: var(--tmr-table-header-bg, #f7f7f7);
213
211
  font-weight: 600;
214
212
  }
215
213
 
216
214
  @media (max-width: 640px) {
217
- ._editorContent_teucm_32 table {
215
+ ._editorContent_1k0bn_30 table {
218
216
  width: max-content;
219
217
  min-width: 100%;
220
218
  max-width: none;
221
219
  }
222
220
 
223
- ._editorContent_teucm_32 table td,
224
- ._editorContent_teucm_32 table th {
221
+ ._editorContent_1k0bn_30 table td,
222
+ ._editorContent_1k0bn_30 table th {
225
223
  white-space: nowrap;
226
224
  word-break: normal;
227
225
  }
228
226
  }
229
227
 
230
228
  /* 选中的单元格高亮 */
231
- ._editorContent_teucm_32 table .selectedCell::after {
229
+ ._editorContent_1k0bn_30 table .selectedCell::after {
232
230
  content: '';
233
231
  position: absolute;
234
232
  inset: 0;
@@ -237,7 +235,7 @@
237
235
  }
238
236
 
239
237
  /* 列宽拖拽手柄 */
240
- ._editorContent_teucm_32 table .column-resize-handle {
238
+ ._editorContent_1k0bn_30 table .column-resize-handle {
241
239
  position: absolute;
242
240
  right: -2px;
243
241
  top: 0;
@@ -250,30 +248,30 @@
250
248
  /* 任务清单:复选框与首行文字在同一行高内垂直居中。
251
249
  li 是 flex 容器,项内段落的外边距不会塌到 li 外(不像普通 ul/ol),只会把正文往下推,
252
250
  所以项内段落清零外边距,项间距改由 li 按 ul/ol 的 0.7em 承担。 */
253
- ._editorContent_teucm_32 ul[data-type='taskList'] {
251
+ ._editorContent_1k0bn_30 ul[data-type='taskList'] {
254
252
  list-style: none;
255
253
  padding-left: 0.2em;
256
254
  }
257
255
 
258
- ._editorContent_teucm_32 ul[data-type='taskList'] li {
256
+ ._editorContent_1k0bn_30 ul[data-type='taskList'] li {
259
257
  display: flex;
260
258
  align-items: flex-start;
261
259
  gap: 0.5em;
262
260
  margin: 0.7em 0;
263
261
  }
264
262
 
265
- ._editorContent_teucm_32 ul[data-type='taskList'] li > div > p {
263
+ ._editorContent_1k0bn_30 ul[data-type='taskList'] li > div > p {
266
264
  margin: 0;
267
265
  }
268
266
 
269
267
  /* 项内第二段起保留半档间距,避免多段任务项的段落粘成一片(首段仍不带外边距) */
270
- ._editorContent_teucm_32 ul[data-type='taskList'] li > div > p + p {
268
+ ._editorContent_1k0bn_30 ul[data-type='taskList'] li > div > p + p {
271
269
  margin-top: 0.35em;
272
270
  }
273
271
 
274
272
  /* label 撑满一行行高并居中,框心落在首行文字中线上;
275
273
  1lh 即该元素当前行高,随 --tmr-line-height(数字或长度写法)一起变,不靠手调偏移。 */
276
- ._editorContent_teucm_32 ul[data-type='taskList'] li > label {
274
+ ._editorContent_1k0bn_30 ul[data-type='taskList'] li > label {
277
275
  display: flex;
278
276
  align-items: center;
279
277
  flex: 0 0 auto;
@@ -281,18 +279,18 @@
281
279
  user-select: none;
282
280
  }
283
281
 
284
- ._editorContent_teucm_32 ul[data-type='taskList'] li > div {
282
+ ._editorContent_1k0bn_30 ul[data-type='taskList'] li > div {
285
283
  flex: 1;
286
284
  }
287
285
 
288
- ._editorContent_teucm_32 ul[data-type='taskList'] input[type='checkbox'] {
286
+ ._editorContent_1k0bn_30 ul[data-type='taskList'] input[type='checkbox'] {
289
287
  margin: 0;
290
288
  accent-color: var(--tmr-accent, #ff6719);
291
289
  cursor: pointer;
292
290
  }
293
291
 
294
292
  /* 脚注/引文圆标:与正文字垂直居中;配色对齐工具栏 active(浅橙底 + accent 字) */
295
- ._editorContent_teucm_32 span.citation-ref {
293
+ ._editorContent_1k0bn_30 span.citation-ref {
296
294
  display: inline-flex;
297
295
  align-items: center;
298
296
  justify-content: center;
@@ -329,7 +327,7 @@
329
327
  border-color 0.15s ease;
330
328
  }
331
329
 
332
- ._editorContent_teucm_32 span.citation-ref a {
330
+ ._editorContent_1k0bn_30 span.citation-ref a {
333
331
  color: inherit;
334
332
  text-decoration: none;
335
333
  display: flex;
@@ -341,26 +339,26 @@
341
339
  pointer-events: none;
342
340
  }
343
341
 
344
- ._editorContent_teucm_32 span.citation-ref:hover,
345
- ._editorContent_teucm_32 span.citation-ref:focus-within,
346
- ._editorContent_teucm_32 span.citation-ref[data-tmr-citation-active] {
342
+ ._editorContent_1k0bn_30 span.citation-ref:hover,
343
+ ._editorContent_1k0bn_30 span.citation-ref:focus-within,
344
+ ._editorContent_1k0bn_30 span.citation-ref[data-tmr-citation-active] {
347
345
  background: var(--tmr-citation-bg-hover, var(--tmr-accent, #ff6719));
348
346
  border-color: var(--tmr-citation-bg-hover, var(--tmr-accent, #ff6719));
349
347
  color: var(--tmr-citation-fg-hover, #ffffff);
350
348
  }
351
349
 
352
- ._editorContent_teucm_32 .tiptap-mathematics-render[data-type='inline-math'] {
350
+ ._editorContent_1k0bn_30 .tiptap-mathematics-render[data-type='inline-math'] {
353
351
  display: inline;
354
352
  }
355
353
 
356
- ._editorContent_teucm_32 .tiptap-mathematics-render[data-type='block-math'] {
354
+ ._editorContent_1k0bn_30 .tiptap-mathematics-render[data-type='block-math'] {
357
355
  margin: 0.9em 0;
358
356
  overflow-x: auto;
359
357
  text-align: center;
360
358
  }
361
359
 
362
360
  /* 导入占位:进度写在光标处,不进 Markdown */
363
- ._editorContent_teucm_32 .tmr-import-placeholder {
361
+ ._editorContent_1k0bn_30 .tmr-import-placeholder {
364
362
  display: flex;
365
363
  align-items: center;
366
364
  gap: 0.5em;
@@ -370,16 +368,16 @@
370
368
  user-select: none;
371
369
  }
372
370
 
373
- ._editorContent_teucm_32 .tmr-import-placeholder-spin {
371
+ ._editorContent_1k0bn_30 .tmr-import-placeholder-spin {
374
372
  width: 0.7em;
375
373
  height: 0.7em;
376
374
  border: 1.5px solid var(--tmr-border, #e6e6e6);
377
375
  border-top-color: var(--tmr-accent, #ff6719);
378
376
  border-radius: 50%;
379
- animation: _tmr-import-spin_teucm_1 0.7s linear infinite;
377
+ animation: _tmr-import-spin_1k0bn_1 0.7s linear infinite;
380
378
  }
381
379
 
382
- @keyframes _tmr-import-spin_teucm_1 {
380
+ @keyframes _tmr-import-spin_1k0bn_1 {
383
381
  to {
384
382
  transform: rotate(360deg);
385
383
  }
@@ -589,7 +587,7 @@
589
587
  }
590
588
  /* 查找替换浮动条。配色走 --tmr-* 变量(与工具栏/评论同一套),宿主可覆盖。 */
591
589
 
592
- ._bar_fzqxj_3 {
590
+ ._bar_1lvby_3 {
593
591
  --fb-accent: var(--tmr-accent, #ff6719);
594
592
  --fb-text: var(--tmr-text, #363737);
595
593
  --fb-muted: var(--tmr-toolbar-muted, #6b6b6b);
@@ -611,7 +609,7 @@
611
609
  line-height: 1.3;
612
610
  }
613
611
 
614
- ._row_fzqxj_25 {
612
+ ._row_1lvby_25 {
615
613
  display: flex;
616
614
  align-items: center;
617
615
  gap: 4px;
@@ -619,10 +617,20 @@
619
617
  flex-wrap: wrap;
620
618
  }
621
619
 
622
- ._field_fzqxj_33 {
620
+ /* 第二行起(替换 / 只读提示)与查找行之间用细线分开 */
621
+ ._row_1lvby_25 + ._row_1lvby_25 {
622
+ margin-top: 2px;
623
+ padding-top: 8px;
624
+ border-top: 1px solid var(--fb-border);
625
+ }
626
+
627
+ ._field_1lvby_40 {
623
628
  display: inline-flex;
624
629
  align-items: center;
625
630
  gap: 6px;
631
+ flex: none;
632
+ /* 两个输入框(带不带放大镜图标)总宽一致,左右边缘都对得齐 */
633
+ width: 228px;
626
634
  height: 30px;
627
635
  padding: 0 8px;
628
636
  box-sizing: border-box;
@@ -631,17 +639,17 @@
631
639
  background: #fff;
632
640
  }
633
641
 
634
- ._field_fzqxj_33:focus-within {
642
+ ._field_1lvby_40:focus-within {
635
643
  border-color: var(--fb-accent);
636
644
  }
637
645
 
638
- ._fieldIcon_fzqxj_49 {
646
+ ._fieldIcon_1lvby_59 {
639
647
  flex: none;
640
648
  color: var(--fb-muted);
641
649
  }
642
650
 
643
- ._input_fzqxj_54 {
644
- width: 190px;
651
+ ._input_1lvby_64 {
652
+ width: 100%;
645
653
  min-width: 0;
646
654
  border: none;
647
655
  outline: none;
@@ -651,7 +659,7 @@
651
659
  }
652
660
 
653
661
  /* 计数:等宽数字,避免 1 / 9 → 1 / 10 时宽度跳动 */
654
- ._counter_fzqxj_65 {
662
+ ._counter_1lvby_75 {
655
663
  flex: none;
656
664
  min-width: 46px;
657
665
  padding: 0 2px;
@@ -660,11 +668,11 @@
660
668
  text-align: right;
661
669
  }
662
670
 
663
- ._counterInvalid_fzqxj_74 {
671
+ ._counterInvalid_1lvby_84 {
664
672
  color: var(--tmr-danger, #d4380d);
665
673
  }
666
674
 
667
- ._btn_fzqxj_78 {
675
+ ._btn_1lvby_88 {
668
676
  display: inline-flex;
669
677
  align-items: center;
670
678
  justify-content: center;
@@ -681,43 +689,52 @@
681
689
  transition: background 0.15s, color 0.15s;
682
690
  }
683
691
 
684
- ._btn_fzqxj_78:hover:not(:disabled) {
692
+ ._btn_1lvby_88:hover:not(:disabled) {
685
693
  background: #f3f3f3;
686
694
  color: var(--fb-text);
687
695
  }
688
696
 
689
- ._btn_fzqxj_78:disabled {
697
+ ._btn_1lvby_88:disabled {
690
698
  opacity: 0.3;
691
699
  cursor: not-allowed;
692
700
  }
693
701
 
694
- /* 三个开关用短标记(Aa / ab / .*),省宽度且不依赖文案 */
695
- ._toggle_fzqxj_106 {
702
+ /* 三个查找开关用短标记(Aa / ab / .*),省宽度且不依赖文案;带边框才读得出是控件 */
703
+ ._toggle_1lvby_116 {
704
+ min-width: 32px;
705
+ padding: 0 7px;
706
+ border: 1px solid var(--fb-border);
696
707
  font-family: var(--tmr-mono-font, ui-monospace, SFMono-Regular, Menlo, monospace);
697
708
  font-size: 13px;
698
709
  }
699
710
 
700
- ._toggleOn_fzqxj_111 {
711
+ ._toggle_1lvby_116:hover:not(:disabled) {
712
+ border-color: var(--fb-muted);
713
+ }
714
+
715
+ ._toggleOn_1lvby_128,
716
+ ._toggleOn_1lvby_128:hover:not(:disabled) {
701
717
  color: var(--fb-accent);
718
+ border-color: var(--fb-accent);
702
719
  background: #fff3ec;
703
720
  }
704
721
 
705
- ._toggleOn_fzqxj_111:hover:not(:disabled) {
706
- color: var(--fb-accent);
707
- background: #ffe8da;
722
+ /* 关闭与上/下一条拉开一点:它不是「第三个导航」 */
723
+ ._closeBtn_1lvby_136 {
724
+ margin-left: 4px;
708
725
  }
709
726
 
710
- ._textBtn_fzqxj_121 {
727
+ ._textBtn_1lvby_140 {
711
728
  padding: 0 10px;
712
729
  color: var(--fb-text);
713
730
  }
714
731
 
715
- ._spacer_fzqxj_126 {
732
+ ._spacer_1lvby_145 {
716
733
  flex: 1 1 auto;
717
734
  min-width: 0;
718
735
  }
719
736
 
720
- ._readOnly_fzqxj_131 {
737
+ ._readOnly_1lvby_150 {
721
738
  color: var(--fb-muted);
722
739
  font-size: 13px;
723
740
  white-space: nowrap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiptap-markdown-react",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "A batteries-included, self-styled Markdown WYSIWYG editor and reader suite built on Tiptap v3. Markdown in/out, SSR/static rendering, table of contents, themeable via CSS variables, zero Ant Design.",
5
5
  "type": "module",
6
6
  "license": "MIT",