tiptap-markdown-react 0.11.0 → 0.12.1

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_1h61e_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,18 +609,31 @@
611
609
  line-height: 1.3;
612
610
  }
613
611
 
614
- ._row_fzqxj_25 {
612
+ ._row_1h61e_25 {
615
613
  display: flex;
616
614
  align-items: center;
617
- gap: 4px;
615
+ /* 行内不留统一 gap:按钮的内边距各不相同(chip 有边框、图标按钮 4px、文字按钮更宽),
616
+ 同一个盒子间距看起来并不一致。间距一律由下面 .toggle / .iconGroup / .textBtn 的
617
+ margin 补足,目标都是「视觉上看过去 8px」。 */
618
+ gap: 0;
618
619
  /* 窄屏(手机)允许折行,浮动条不会横向溢出 */
619
620
  flex-wrap: wrap;
620
621
  }
621
622
 
622
- ._field_fzqxj_33 {
623
+ /* 第二行起(替换 / 只读提示)与查找行之间用细线分开 */
624
+ ._row_1h61e_25 + ._row_1h61e_25 {
625
+ margin-top: 2px;
626
+ padding-top: 8px;
627
+ border-top: 1px solid var(--fb-border);
628
+ }
629
+
630
+ ._field_1h61e_43 {
623
631
  display: inline-flex;
624
632
  align-items: center;
625
633
  gap: 6px;
634
+ flex: none;
635
+ /* 两个输入框(带不带放大镜图标)总宽一致,左右边缘都对得齐 */
636
+ width: 228px;
626
637
  height: 30px;
627
638
  padding: 0 8px;
628
639
  box-sizing: border-box;
@@ -631,17 +642,17 @@
631
642
  background: #fff;
632
643
  }
633
644
 
634
- ._field_fzqxj_33:focus-within {
645
+ ._field_1h61e_43:focus-within {
635
646
  border-color: var(--fb-accent);
636
647
  }
637
648
 
638
- ._fieldIcon_fzqxj_49 {
649
+ ._fieldIcon_1h61e_62 {
639
650
  flex: none;
640
651
  color: var(--fb-muted);
641
652
  }
642
653
 
643
- ._input_fzqxj_54 {
644
- width: 190px;
654
+ ._input_1h61e_67 {
655
+ width: 100%;
645
656
  min-width: 0;
646
657
  border: none;
647
658
  outline: none;
@@ -650,28 +661,30 @@
650
661
  font: inherit;
651
662
  }
652
663
 
653
- /* 计数:等宽数字,避免 1 / 9 → 1 / 10 时宽度跳动 */
654
- ._counter_fzqxj_65 {
664
+ /* 计数:在输入框内右侧,等宽数字避免 1 / 9 → 1 / 10 时跳动;
665
+ 圈到 12px 是为了不跟输入文字抢宽度(长文案时靠 input 的 min-width:0 让位) */
666
+ ._counter_1h61e_79 {
655
667
  flex: none;
656
- min-width: 46px;
657
- padding: 0 2px;
668
+ margin-left: auto;
669
+ padding-left: 6px;
658
670
  color: var(--fb-muted);
671
+ font-size: 12px;
672
+ white-space: nowrap;
659
673
  font-variant-numeric: tabular-nums;
660
- text-align: right;
661
674
  }
662
675
 
663
- ._counterInvalid_fzqxj_74 {
676
+ ._counterInvalid_1h61e_89 {
664
677
  color: var(--tmr-danger, #d4380d);
665
678
  }
666
679
 
667
- ._btn_fzqxj_78 {
680
+ ._btn_1h61e_93 {
668
681
  display: inline-flex;
669
682
  align-items: center;
670
683
  justify-content: center;
671
684
  flex: none;
672
685
  height: 30px;
673
- min-width: 30px;
674
- padding: 0 8px;
686
+ min-width: 24px;
687
+ padding: 0 4px;
675
688
  border: none;
676
689
  border-radius: 6px;
677
690
  background: transparent;
@@ -681,43 +694,52 @@
681
694
  transition: background 0.15s, color 0.15s;
682
695
  }
683
696
 
684
- ._btn_fzqxj_78:hover:not(:disabled) {
697
+ ._btn_1h61e_93:hover:not(:disabled) {
685
698
  background: #f3f3f3;
686
699
  color: var(--fb-text);
687
700
  }
688
701
 
689
- ._btn_fzqxj_78:disabled {
702
+ ._btn_1h61e_93:disabled {
690
703
  opacity: 0.3;
691
704
  cursor: not-allowed;
692
705
  }
693
706
 
694
- /* 三个开关用短标记(Aa / ab / .*),省宽度且不依赖文案 */
695
- ._toggle_fzqxj_106 {
707
+ /* 查找开关用短标记(Aa / ab),省宽度且不依赖文案;带边框才读得出是控件。
708
+ 有边框 → 边框就是视觉边缘,与前面控件(输入框边框 / 另一个 chip)留 8px 即视觉 8px。 */
709
+ ._toggle_1h61e_29 {
710
+ min-width: 28px;
711
+ margin-left: 8px;
712
+ padding: 0 6px;
713
+ border: 1px solid var(--fb-border);
696
714
  font-family: var(--tmr-mono-font, ui-monospace, SFMono-Regular, Menlo, monospace);
697
715
  font-size: 13px;
698
716
  }
699
717
 
700
- ._toggleOn_fzqxj_111 {
701
- color: var(--fb-accent);
702
- background: #fff3ec;
718
+ ._toggle_1h61e_29:hover:not(:disabled) {
719
+ border-color: var(--fb-muted);
703
720
  }
704
721
 
705
- ._toggleOn_fzqxj_111:hover:not(:disabled) {
722
+ ._toggleOn_1h61e_135,
723
+ ._toggleOn_1h61e_135:hover:not(:disabled) {
706
724
  color: var(--fb-accent);
707
- background: #ffe8da;
725
+ border-color: var(--fb-accent);
726
+ background: #fff3ec;
708
727
  }
709
728
 
710
- ._textBtn_fzqxj_121 {
711
- padding: 0 10px;
712
- color: var(--fb-text);
729
+ /* 上一条 / 下一条 / 关闭 是一组图标按钮:组内零间距,字形之间只隔各自 4px 内边距(=8px);
730
+ 组与左侧 chip 之间补 4px margin,加上图标自身的 4px,视觉同为 8px。 */
731
+ ._iconGroup_1h61e_29 {
732
+ display: inline-flex;
733
+ gap: 0;
734
+ margin-left: 4px;
713
735
  }
714
736
 
715
- ._spacer_fzqxj_126 {
737
+ ._spacer_1h61e_150 {
716
738
  flex: 1 1 auto;
717
739
  min-width: 0;
718
740
  }
719
741
 
720
- ._readOnly_fzqxj_131 {
742
+ ._readOnly_1h61e_155 {
721
743
  color: var(--fb-muted);
722
744
  font-size: 13px;
723
745
  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.1",
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",