tiptap-markdown-react 0.8.0 → 0.8.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/README.md +3 -1
- package/dist/components/MathEditorPopover.d.ts +6 -3
- package/dist/index.js +231 -110
- package/dist/index.js.map +1 -1
- package/dist/labels.d.ts +2 -0
- package/dist/style.css +146 -89
- package/package.json +1 -1
package/dist/labels.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export interface ToolbarLabels {
|
|
|
48
48
|
mathPlaceholder: string;
|
|
49
49
|
mathDone: string;
|
|
50
50
|
mathCancel: string;
|
|
51
|
+
mathNewInline: string;
|
|
52
|
+
mathNewBlock: string;
|
|
51
53
|
}
|
|
52
54
|
export declare const defaultToolbarLabels: ToolbarLabels;
|
|
53
55
|
export interface ColorPaletteLabels {
|
package/dist/style.css
CHANGED
|
@@ -326,6 +326,11 @@
|
|
|
326
326
|
.tiptap-mathematics-render.block-math-error {
|
|
327
327
|
color: #c0392b;
|
|
328
328
|
}
|
|
329
|
+
|
|
330
|
+
/* 编辑中:占位仍在,视觉交给浮层预览,避免正文公式与预览叠两份 */
|
|
331
|
+
.tiptap-mathematics-render.tmr-math-editing {
|
|
332
|
+
visibility: hidden;
|
|
333
|
+
}
|
|
329
334
|
/* 代码块 NodeView:白底、细边框、顶部 header 放语言选择(Radix 下拉)+ 删除。 */
|
|
330
335
|
._wrapper_5i2vi_2 {
|
|
331
336
|
position: relative;
|
|
@@ -526,7 +531,7 @@
|
|
|
526
531
|
color: #22863a;
|
|
527
532
|
}
|
|
528
533
|
/* 顶部操作栏:横跨宽度、内容居中、细线灰图标。配色映射到可覆盖的 --tmr-* 变量。 */
|
|
529
|
-
.
|
|
534
|
+
._toolbar_z6tes_2 {
|
|
530
535
|
--sb-accent: var(--tmr-accent, #ff6719);
|
|
531
536
|
--sb-text: var(--tmr-text, #363737);
|
|
532
537
|
--sb-muted: var(--tmr-toolbar-muted, #6b6b6b);
|
|
@@ -539,7 +544,7 @@
|
|
|
539
544
|
z-index: 8;
|
|
540
545
|
}
|
|
541
546
|
|
|
542
|
-
.
|
|
547
|
+
._inner_z6tes_15 {
|
|
543
548
|
display: flex;
|
|
544
549
|
align-items: center;
|
|
545
550
|
justify-content: safe center;
|
|
@@ -551,7 +556,7 @@
|
|
|
551
556
|
overflow-x: auto;
|
|
552
557
|
}
|
|
553
558
|
|
|
554
|
-
.
|
|
559
|
+
._btn_z6tes_27 {
|
|
555
560
|
display: inline-flex;
|
|
556
561
|
align-items: center;
|
|
557
562
|
justify-content: center;
|
|
@@ -569,28 +574,28 @@
|
|
|
569
574
|
transition: background 0.15s, color 0.15s;
|
|
570
575
|
}
|
|
571
576
|
|
|
572
|
-
.
|
|
577
|
+
._btn_z6tes_27:hover:not(:disabled) {
|
|
573
578
|
background: #f3f3f3;
|
|
574
579
|
color: var(--sb-text);
|
|
575
580
|
}
|
|
576
581
|
|
|
577
|
-
.
|
|
582
|
+
._btnActive_z6tes_50 {
|
|
578
583
|
color: var(--sb-accent);
|
|
579
584
|
background: #fff3ec;
|
|
580
585
|
}
|
|
581
586
|
|
|
582
|
-
.
|
|
587
|
+
._btnActive_z6tes_50:hover {
|
|
583
588
|
color: var(--sb-accent);
|
|
584
589
|
background: #ffe8da;
|
|
585
590
|
}
|
|
586
591
|
|
|
587
|
-
.
|
|
592
|
+
._btn_z6tes_27:disabled {
|
|
588
593
|
opacity: 0.3;
|
|
589
594
|
cursor: not-allowed;
|
|
590
595
|
}
|
|
591
596
|
|
|
592
597
|
/* 表内浮动工具条(BubbleMenu portal 到 body,拿不到 .toolbar 变量,故写死配色) */
|
|
593
|
-
.
|
|
598
|
+
._tableBubble_z6tes_66 {
|
|
594
599
|
display: flex;
|
|
595
600
|
align-items: center;
|
|
596
601
|
gap: 2px;
|
|
@@ -602,7 +607,7 @@
|
|
|
602
607
|
}
|
|
603
608
|
|
|
604
609
|
/* 文字型图标(引用等) */
|
|
605
|
-
.
|
|
610
|
+
._txtIcon_z6tes_78 {
|
|
606
611
|
font-family: 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
607
612
|
font-size: 16px;
|
|
608
613
|
font-weight: 600;
|
|
@@ -610,7 +615,7 @@
|
|
|
610
615
|
}
|
|
611
616
|
|
|
612
617
|
/* 文字颜色 / 高亮图标:字母 + 底部当前色条 */
|
|
613
|
-
.
|
|
618
|
+
._colorIcon_z6tes_86 {
|
|
614
619
|
display: inline-flex;
|
|
615
620
|
flex-direction: column;
|
|
616
621
|
align-items: center;
|
|
@@ -618,20 +623,20 @@
|
|
|
618
623
|
line-height: 1;
|
|
619
624
|
}
|
|
620
625
|
|
|
621
|
-
.
|
|
626
|
+
._colorIconGlyph_z6tes_94 {
|
|
622
627
|
font-family: 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
623
628
|
font-size: 15px;
|
|
624
629
|
font-weight: 600;
|
|
625
630
|
}
|
|
626
631
|
|
|
627
|
-
.
|
|
632
|
+
._colorIconBar_z6tes_100 {
|
|
628
633
|
width: 16px;
|
|
629
634
|
height: 3px;
|
|
630
635
|
border-radius: 1.5px;
|
|
631
636
|
}
|
|
632
637
|
|
|
633
638
|
/* A▾ 上标/下标下拉触发器 */
|
|
634
|
-
.
|
|
639
|
+
._scriptTrigger_z6tes_107 {
|
|
635
640
|
display: inline-flex;
|
|
636
641
|
align-items: center;
|
|
637
642
|
gap: 3px;
|
|
@@ -646,12 +651,12 @@
|
|
|
646
651
|
transition: background 0.15s, color 0.15s;
|
|
647
652
|
}
|
|
648
653
|
|
|
649
|
-
.
|
|
654
|
+
._scriptTrigger_z6tes_107:hover {
|
|
650
655
|
background: #f3f3f3;
|
|
651
656
|
color: var(--sb-text);
|
|
652
657
|
}
|
|
653
658
|
|
|
654
|
-
.
|
|
659
|
+
._scriptTriggerGlyph_z6tes_127 {
|
|
655
660
|
font-family: 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
656
661
|
font-size: 16px;
|
|
657
662
|
font-weight: 600;
|
|
@@ -659,7 +664,7 @@
|
|
|
659
664
|
text-underline-offset: 2px;
|
|
660
665
|
}
|
|
661
666
|
|
|
662
|
-
.
|
|
667
|
+
._divider_z6tes_135 {
|
|
663
668
|
width: 1px;
|
|
664
669
|
height: 20px;
|
|
665
670
|
margin: 0 8px;
|
|
@@ -668,7 +673,7 @@
|
|
|
668
673
|
}
|
|
669
674
|
|
|
670
675
|
/* ── Style / Size / More 下拉触发器 ── */
|
|
671
|
-
.
|
|
676
|
+
._styleTrigger_z6tes_144 {
|
|
672
677
|
display: inline-flex;
|
|
673
678
|
align-items: center;
|
|
674
679
|
justify-content: space-between;
|
|
@@ -688,16 +693,16 @@
|
|
|
688
693
|
transition: background 0.15s;
|
|
689
694
|
}
|
|
690
695
|
|
|
691
|
-
.
|
|
696
|
+
._styleTrigger_z6tes_144:hover:not(:disabled) {
|
|
692
697
|
background: #f3f3f3;
|
|
693
698
|
}
|
|
694
699
|
|
|
695
|
-
.
|
|
700
|
+
._styleTrigger_z6tes_144:disabled {
|
|
696
701
|
opacity: 0.3;
|
|
697
702
|
cursor: not-allowed;
|
|
698
703
|
}
|
|
699
704
|
|
|
700
|
-
.
|
|
705
|
+
._styleTriggerLabel_z6tes_173 {
|
|
701
706
|
flex: 1;
|
|
702
707
|
text-align: left;
|
|
703
708
|
overflow: hidden;
|
|
@@ -705,19 +710,19 @@
|
|
|
705
710
|
text-overflow: ellipsis;
|
|
706
711
|
}
|
|
707
712
|
|
|
708
|
-
.
|
|
713
|
+
._styleTriggerCaret_z6tes_181 {
|
|
709
714
|
color: var(--sb-muted);
|
|
710
715
|
flex: none;
|
|
711
716
|
}
|
|
712
717
|
|
|
713
718
|
/* 下拉项:图标 + 文字 */
|
|
714
|
-
.
|
|
719
|
+
._styleItem_z6tes_187 {
|
|
715
720
|
display: inline-flex;
|
|
716
721
|
align-items: center;
|
|
717
722
|
gap: 12px;
|
|
718
723
|
}
|
|
719
724
|
|
|
720
|
-
.
|
|
725
|
+
._styleIcon_z6tes_193 {
|
|
721
726
|
display: inline-flex;
|
|
722
727
|
justify-content: center;
|
|
723
728
|
align-items: center;
|
|
@@ -727,19 +732,19 @@
|
|
|
727
732
|
}
|
|
728
733
|
|
|
729
734
|
/* 上标 / 下标图标 */
|
|
730
|
-
.
|
|
735
|
+
._scriptGlyph_z6tes_203 {
|
|
731
736
|
display: inline-block;
|
|
732
737
|
text-align: center;
|
|
733
738
|
font-family: 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
734
739
|
}
|
|
735
740
|
|
|
736
|
-
.
|
|
737
|
-
.
|
|
741
|
+
._scriptGlyph_z6tes_203 sup,
|
|
742
|
+
._scriptGlyph_z6tes_203 sub {
|
|
738
743
|
font-size: 0.7em;
|
|
739
744
|
}
|
|
740
745
|
|
|
741
746
|
/* ── Radix 下拉菜单面板(替代 antd .ant-dropdown-menu) ── */
|
|
742
|
-
.
|
|
747
|
+
._menu_z6tes_215 {
|
|
743
748
|
min-width: 200px;
|
|
744
749
|
padding: 6px;
|
|
745
750
|
background: #fff;
|
|
@@ -750,7 +755,7 @@
|
|
|
750
755
|
z-index: 1000;
|
|
751
756
|
}
|
|
752
757
|
|
|
753
|
-
.
|
|
758
|
+
._menuItem_z6tes_226 {
|
|
754
759
|
display: flex;
|
|
755
760
|
align-items: center;
|
|
756
761
|
width: 100%;
|
|
@@ -766,126 +771,178 @@
|
|
|
766
771
|
outline: none;
|
|
767
772
|
}
|
|
768
773
|
|
|
769
|
-
.
|
|
774
|
+
._menuItem_z6tes_226:hover:not(:disabled) {
|
|
770
775
|
background: #f3f3f3;
|
|
771
776
|
}
|
|
772
777
|
|
|
773
|
-
.
|
|
778
|
+
._menuItem_z6tes_226:disabled {
|
|
774
779
|
opacity: 0.35;
|
|
775
780
|
cursor: not-allowed;
|
|
776
781
|
}
|
|
777
782
|
|
|
778
783
|
/* 选中态:品牌色高亮 */
|
|
779
|
-
.
|
|
784
|
+
._menuItemSelected_z6tes_252 {
|
|
780
785
|
background: #fff3ec;
|
|
781
786
|
color: var(--sb-accent);
|
|
782
787
|
}
|
|
783
788
|
|
|
784
|
-
.
|
|
789
|
+
._menuItemSelected_z6tes_252 ._styleIcon_z6tes_193 {
|
|
785
790
|
color: var(--sb-accent);
|
|
786
791
|
}
|
|
787
792
|
|
|
788
|
-
.
|
|
793
|
+
._menuItemSelected_z6tes_252:hover:not(:disabled) {
|
|
789
794
|
background: #ffe8da;
|
|
790
795
|
}
|
|
791
796
|
|
|
792
797
|
/* Radix Popover 内容(承载 ColorPalette),面板自带阴影,这里只兜底 z-index */
|
|
793
|
-
.
|
|
798
|
+
._popoverContent_z6tes_266 {
|
|
794
799
|
z-index: 1000;
|
|
795
800
|
}
|
|
796
801
|
|
|
797
|
-
.
|
|
802
|
+
._mathAnchor_z6tes_270 {
|
|
798
803
|
position: fixed;
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
align-items: center;
|
|
803
|
-
justify-content: center;
|
|
804
|
-
background: rgb(0 0 0 / 24%);
|
|
804
|
+
width: 0;
|
|
805
|
+
height: 0;
|
|
806
|
+
pointer-events: none;
|
|
805
807
|
}
|
|
806
808
|
|
|
807
|
-
.
|
|
808
|
-
|
|
809
|
-
padding:
|
|
810
|
-
background:
|
|
811
|
-
border
|
|
812
|
-
box-shadow:
|
|
813
|
-
|
|
814
|
-
0 0 0 1px rgba(0, 0, 0, 0.06);
|
|
809
|
+
._mathContent_z6tes_277 {
|
|
810
|
+
z-index: 1100;
|
|
811
|
+
padding: 0;
|
|
812
|
+
background: transparent;
|
|
813
|
+
border: none;
|
|
814
|
+
box-shadow: none;
|
|
815
|
+
outline: none;
|
|
815
816
|
}
|
|
816
817
|
|
|
817
|
-
.
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
818
|
+
._mathStack_z6tes_286 {
|
|
819
|
+
display: flex;
|
|
820
|
+
flex-direction: column;
|
|
821
|
+
align-items: flex-start;
|
|
822
|
+
gap: 8px;
|
|
822
823
|
}
|
|
823
824
|
|
|
824
|
-
.
|
|
825
|
-
|
|
825
|
+
._mathStackBlock_z6tes_293 {
|
|
826
|
+
align-items: stretch;
|
|
826
827
|
width: 100%;
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
._mathHint_z6tes_298 {
|
|
831
|
+
display: inline-flex;
|
|
832
|
+
align-items: center;
|
|
833
|
+
gap: 6px;
|
|
834
|
+
padding: 4px 10px;
|
|
830
835
|
border-radius: 6px;
|
|
831
|
-
|
|
836
|
+
background: var(--tmr-code-bg, #f4f4f4);
|
|
837
|
+
color: var(--tmr-muted, #777777);
|
|
832
838
|
font-size: 13px;
|
|
833
|
-
line-height: 1.
|
|
834
|
-
|
|
835
|
-
|
|
839
|
+
line-height: 1.4;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
._mathHintBlock_z6tes_310 {
|
|
843
|
+
width: 100%;
|
|
844
|
+
padding: 10px 14px;
|
|
845
|
+
border-radius: 8px;
|
|
836
846
|
}
|
|
837
847
|
|
|
838
|
-
.
|
|
839
|
-
|
|
840
|
-
|
|
848
|
+
._mathHintIcon_z6tes_316 {
|
|
849
|
+
font-family: ui-serif, Georgia, 'Times New Roman', serif;
|
|
850
|
+
font-size: 12px;
|
|
851
|
+
opacity: 0.85;
|
|
841
852
|
}
|
|
842
853
|
|
|
843
|
-
.
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
padding:
|
|
854
|
+
._mathPreviewInline_z6tes_322 {
|
|
855
|
+
display: inline-flex;
|
|
856
|
+
max-width: min(440px, calc(100vw - 24px));
|
|
857
|
+
padding: 4px 10px;
|
|
847
858
|
overflow-x: auto;
|
|
848
|
-
background: #f7f7f7;
|
|
849
859
|
border-radius: 6px;
|
|
860
|
+
background: #fff3ec;
|
|
861
|
+
color: var(--tmr-text, #363737);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
._mathPreviewBlock_z6tes_332 {
|
|
865
|
+
width: 100%;
|
|
866
|
+
min-height: 48px;
|
|
867
|
+
padding: 14px 16px;
|
|
868
|
+
overflow-x: auto;
|
|
869
|
+
border-radius: 8px;
|
|
870
|
+
background: var(--tmr-code-bg, #f4f4f4);
|
|
850
871
|
text-align: center;
|
|
872
|
+
color: var(--tmr-text, #363737);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
._mathPreviewBlock_z6tes_332 .katex-display {
|
|
876
|
+
margin: 0;
|
|
851
877
|
}
|
|
852
878
|
|
|
853
|
-
.
|
|
879
|
+
._mathField_z6tes_347 {
|
|
854
880
|
display: flex;
|
|
855
|
-
|
|
881
|
+
align-items: center;
|
|
856
882
|
gap: 8px;
|
|
857
|
-
|
|
883
|
+
width: min(440px, calc(100vw - 24px));
|
|
884
|
+
padding: 6px 6px 6px 14px;
|
|
885
|
+
background: var(--tmr-popover-bg, #fff);
|
|
886
|
+
border: 1px solid var(--tmr-toolbar-border, #ececec);
|
|
887
|
+
border-radius: 999px;
|
|
888
|
+
box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
|
|
858
889
|
}
|
|
859
890
|
|
|
860
|
-
.
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
border:
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
891
|
+
._mathFieldBlock_z6tes_359 {
|
|
892
|
+
align-items: flex-start;
|
|
893
|
+
width: 100%;
|
|
894
|
+
border-radius: 12px;
|
|
895
|
+
padding: 10px 10px 10px 14px;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
._mathInput_z6tes_366 {
|
|
899
|
+
flex: 1;
|
|
900
|
+
min-width: 0;
|
|
901
|
+
margin: 0;
|
|
902
|
+
padding: 4px 0;
|
|
903
|
+
border: none;
|
|
904
|
+
background: transparent;
|
|
905
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
867
906
|
font-size: 13px;
|
|
868
|
-
|
|
907
|
+
line-height: 1.45;
|
|
908
|
+
color: var(--tmr-text, #363737);
|
|
909
|
+
resize: none;
|
|
869
910
|
}
|
|
870
911
|
|
|
871
|
-
.
|
|
872
|
-
|
|
912
|
+
._mathInput_z6tes_366:focus {
|
|
913
|
+
outline: none;
|
|
873
914
|
}
|
|
874
915
|
|
|
875
|
-
.
|
|
876
|
-
|
|
877
|
-
|
|
916
|
+
._mathDone_z6tes_384 {
|
|
917
|
+
display: inline-flex;
|
|
918
|
+
align-items: center;
|
|
919
|
+
gap: 4px;
|
|
920
|
+
flex-shrink: 0;
|
|
921
|
+
height: 28px;
|
|
922
|
+
padding: 0 10px;
|
|
923
|
+
border: none;
|
|
924
|
+
border-radius: 999px;
|
|
925
|
+
background: var(--tmr-accent, #ff6719);
|
|
878
926
|
color: #fff;
|
|
927
|
+
font-size: 12px;
|
|
928
|
+
font-weight: 600;
|
|
929
|
+
cursor: pointer;
|
|
879
930
|
}
|
|
880
931
|
|
|
881
|
-
.
|
|
932
|
+
._mathDone_z6tes_384:hover:not(:disabled) {
|
|
882
933
|
filter: brightness(0.95);
|
|
883
934
|
}
|
|
884
935
|
|
|
885
|
-
.
|
|
936
|
+
._mathDone_z6tes_384:disabled {
|
|
886
937
|
opacity: 0.35;
|
|
887
938
|
cursor: not-allowed;
|
|
888
939
|
}
|
|
940
|
+
|
|
941
|
+
._mathDoneKbd_z6tes_409 {
|
|
942
|
+
font-size: 11px;
|
|
943
|
+
font-weight: 500;
|
|
944
|
+
opacity: 0.85;
|
|
945
|
+
}
|
|
889
946
|
/* 颜色面板:None 清除行 + 10×6 色板 + THEME 品牌色 */
|
|
890
947
|
._palette_x5lrq_2 {
|
|
891
948
|
padding: 14px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiptap-markdown-react",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.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",
|