@mdaemon/html-editor 1.0.4 → 1.0.6

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/styles.css CHANGED
@@ -39,15 +39,7 @@
39
39
  z-index: 10;
40
40
  }
41
41
  .md-toolbar.md-toolbar-sliding {
42
- flex-wrap: nowrap;
43
- overflow-x: auto;
44
- }
45
- .md-toolbar.md-toolbar-sliding::-webkit-scrollbar {
46
- height: 6px;
47
- }
48
- .md-toolbar.md-toolbar-sliding::-webkit-scrollbar-thumb {
49
- background: #ccc;
50
- border-radius: 3px;
42
+ flex-wrap: wrap;
51
43
  }
52
44
 
53
45
  .md-toolbar-group {
@@ -63,6 +55,30 @@
63
55
  margin: 0 4px;
64
56
  }
65
57
 
58
+ .md-toolbar-primary {
59
+ display: flex;
60
+ flex-wrap: wrap;
61
+ align-items: center;
62
+ gap: 2px;
63
+ width: 100%;
64
+ }
65
+
66
+ .md-toolbar-overflow {
67
+ display: none;
68
+ flex-wrap: wrap;
69
+ align-items: center;
70
+ gap: 2px;
71
+ width: 100%;
72
+ }
73
+ .md-toolbar-overflow.md-toolbar-overflow-visible {
74
+ display: flex;
75
+ }
76
+
77
+ .md-toolbar-toggle-btn {
78
+ margin-left: auto;
79
+ flex-shrink: 0;
80
+ }
81
+
66
82
  .md-toolbar-btn {
67
83
  display: flex;
68
84
  align-items: center;
@@ -97,6 +113,14 @@
97
113
  font-family: inherit;
98
114
  font-style: normal;
99
115
  font-weight: bold;
116
+ display: flex;
117
+ align-items: center;
118
+ justify-content: center;
119
+ }
120
+ .md-toolbar-btn-icon svg {
121
+ display: block;
122
+ width: 16px;
123
+ height: 16px;
100
124
  }
101
125
  .md-toolbar-btn-icon.md-icon-bold {
102
126
  font-weight: bold;
@@ -154,7 +178,7 @@
154
178
  border: 1px solid #ccc;
155
179
  border-radius: 3px;
156
180
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
157
- z-index: 100;
181
+ z-index: 1000;
158
182
  }
159
183
 
160
184
  .md-toolbar-dropdown-item {
@@ -625,6 +649,158 @@
625
649
  background: #1a6399;
626
650
  }
627
651
 
652
+ .md-image-upload-dialog {
653
+ width: 500px;
654
+ }
655
+
656
+ .md-image-upload-tabs {
657
+ display: flex;
658
+ gap: 4px;
659
+ margin-bottom: 16px;
660
+ border-bottom: 1px solid #ccc;
661
+ padding-bottom: 8px;
662
+ }
663
+
664
+ .md-image-upload-tab {
665
+ padding: 6px 16px;
666
+ border: 1px solid #ccc;
667
+ border-radius: 3px;
668
+ background: transparent;
669
+ cursor: pointer;
670
+ font-size: 13px;
671
+ }
672
+ .md-image-upload-tab:hover {
673
+ background: #f0f0f0;
674
+ }
675
+ .md-image-upload-tab.md-image-upload-tab-active {
676
+ background: #207ab7;
677
+ color: #fff;
678
+ border-color: #207ab7;
679
+ }
680
+
681
+ .md-image-upload-dropzone {
682
+ display: flex;
683
+ flex-direction: column;
684
+ align-items: center;
685
+ justify-content: center;
686
+ gap: 12px;
687
+ padding: 32px 16px;
688
+ border: 2px dashed #ccc;
689
+ border-radius: 3px;
690
+ cursor: pointer;
691
+ transition: border-color 0.2s, background-color 0.2s;
692
+ text-align: center;
693
+ }
694
+ .md-image-upload-dropzone:hover {
695
+ border-color: #207ab7;
696
+ background: rgba(32, 122, 183, 0.03);
697
+ }
698
+ .md-image-upload-dropzone.md-image-upload-dropzone-active {
699
+ border-color: #207ab7;
700
+ background: rgba(32, 122, 183, 0.08);
701
+ }
702
+
703
+ .md-image-upload-dropzone-icon {
704
+ color: #999;
705
+ }
706
+
707
+ .md-image-upload-dropzone-text {
708
+ color: #666;
709
+ font-size: 13px;
710
+ max-width: 100%;
711
+ overflow: hidden;
712
+ text-overflow: ellipsis;
713
+ white-space: nowrap;
714
+ }
715
+
716
+ .md-image-upload-row {
717
+ display: flex;
718
+ align-items: center;
719
+ gap: 8px;
720
+ margin-bottom: 12px;
721
+ }
722
+ .md-image-upload-row label {
723
+ width: 60px;
724
+ font-size: 13px;
725
+ color: #666;
726
+ flex-shrink: 0;
727
+ }
728
+ .md-image-upload-row input {
729
+ flex: 1;
730
+ padding: 8px 12px;
731
+ border: 1px solid #ccc;
732
+ border-radius: 3px;
733
+ font-size: 14px;
734
+ }
735
+ .md-image-upload-row input:focus {
736
+ outline: none;
737
+ border-color: #207ab7;
738
+ }
739
+
740
+ .md-image-upload-preview {
741
+ margin-bottom: 12px;
742
+ text-align: center;
743
+ border: 1px solid #ccc;
744
+ border-radius: 3px;
745
+ padding: 8px;
746
+ background: #fafafa;
747
+ }
748
+ .md-image-upload-preview img {
749
+ max-width: 100%;
750
+ max-height: 200px;
751
+ object-fit: contain;
752
+ }
753
+
754
+ .md-image-upload-error {
755
+ color: #cc0000;
756
+ font-size: 13px;
757
+ margin-bottom: 12px;
758
+ padding: 8px;
759
+ background: #fff0f0;
760
+ border: 1px solid #ffcccc;
761
+ border-radius: 3px;
762
+ }
763
+
764
+ .md-image-upload-progress {
765
+ display: flex;
766
+ align-items: center;
767
+ gap: 12px;
768
+ margin-bottom: 12px;
769
+ }
770
+
771
+ .md-image-upload-progress-bar {
772
+ flex: 1;
773
+ height: 8px;
774
+ background: #e0e0e0;
775
+ border-radius: 4px;
776
+ overflow: hidden;
777
+ }
778
+
779
+ .md-image-upload-progress-fill {
780
+ height: 100%;
781
+ width: 0%;
782
+ background: #207ab7;
783
+ border-radius: 4px;
784
+ transition: width 0.2s;
785
+ }
786
+
787
+ .md-image-upload-progress-text {
788
+ font-size: 12px;
789
+ color: #666;
790
+ min-width: 40px;
791
+ }
792
+
793
+ .md-image-upload-footer {
794
+ display: flex;
795
+ justify-content: flex-end;
796
+ gap: 8px;
797
+ margin-top: 16px;
798
+ }
799
+
800
+ .md-editor-dragover .md-editor-content {
801
+ box-shadow: 0 0 10px 1px rgba(32, 122, 183, 0.5) inset;
802
+ }
803
+
628
804
  .md-editor-oxide-dark {
629
805
  background: #222f3e;
630
806
  border-color: #364049;
@@ -689,4 +865,29 @@
689
865
  }
690
866
  .md-editor-oxide-dark .md-editor-body table th {
691
867
  background: #1a252f;
868
+ }
869
+ .md-editor-oxide-dark .md-image-upload-dropzone {
870
+ border-color: #364049;
871
+ }
872
+ .md-editor-oxide-dark .md-image-upload-dropzone:hover, .md-editor-oxide-dark .md-image-upload-dropzone.md-image-upload-dropzone-active {
873
+ border-color: #207ab7;
874
+ background: rgba(32, 122, 183, 0.1);
875
+ }
876
+ .md-editor-oxide-dark .md-image-upload-dropzone-icon {
877
+ color: #666;
878
+ }
879
+ .md-editor-oxide-dark .md-image-upload-dropzone-text {
880
+ color: #aaa;
881
+ }
882
+ .md-editor-oxide-dark .md-image-upload-preview {
883
+ background: #1a252f;
884
+ border-color: #364049;
885
+ }
886
+ .md-editor-oxide-dark .md-image-upload-error {
887
+ background: #3a1c1c;
888
+ border-color: #6b2c2c;
889
+ color: #ff8888;
890
+ }
891
+ .md-editor-oxide-dark .md-image-upload-progress-bar {
892
+ background: #364049;
692
893
  }
@@ -0,0 +1,2 @@
1
+ declare module '@mdaemon/html-editor/styles';
2
+ declare module '@mdaemon/html-editor/styles.css';
package/package.json CHANGED
@@ -1,17 +1,26 @@
1
1
  {
2
2
  "name": "@mdaemon/html-editor",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A TinyMCE-compatible HTML editor built on TipTap",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
+ "style": "dist/styles.css",
8
9
  "exports": {
9
10
  ".": {
10
11
  "types": "./dist/index.d.ts",
11
12
  "import": "./dist/index.mjs",
12
13
  "require": "./dist/index.js"
13
14
  },
14
- "./styles": "./dist/styles.css"
15
+ "./styles": {
16
+ "types": "./dist/styles.d.ts",
17
+ "default": "./dist/styles.css"
18
+ },
19
+ "./styles.css": {
20
+ "types": "./dist/styles.d.ts",
21
+ "default": "./dist/styles.css"
22
+ },
23
+ "./dist/styles.css": "./dist/styles.css"
15
24
  },
16
25
  "publishConfig": {
17
26
  "access": "public"
@@ -25,7 +34,9 @@
25
34
  "test": "jest",
26
35
  "test:coverage": "jest --coverage",
27
36
  "lint": "eslint src --ext .ts",
28
- "typecheck": "tsc --noEmit"
37
+ "typecheck": "tsc --noEmit",
38
+ "demo": "vite test",
39
+ "update:tiptap": "npm install @tiptap/core@latest @tiptap/extension-character-count@latest @tiptap/extension-code-block-lowlight@latest @tiptap/extension-color@latest @tiptap/extension-font-family@latest @tiptap/extension-highlight@latest @tiptap/extension-image@latest @tiptap/extension-link@latest @tiptap/extension-placeholder@latest @tiptap/extension-table@latest @tiptap/extension-table-cell@latest @tiptap/extension-table-header@latest @tiptap/extension-table-row@latest @tiptap/extension-text-align@latest @tiptap/extension-text-style@latest @tiptap/extension-underline@latest @tiptap/pm@latest @tiptap/starter-kit@latest"
29
40
  },
30
41
  "keywords": [
31
42
  "html-editor",
@@ -40,24 +51,24 @@
40
51
  },
41
52
  "license": "LGPL-3.0-or-later",
42
53
  "dependencies": {
43
- "@tiptap/core": "^3.19.0",
44
- "@tiptap/extension-character-count": "^3.19.0",
45
- "@tiptap/extension-code-block-lowlight": "^3.19.0",
46
- "@tiptap/extension-color": "^3.19.0",
47
- "@tiptap/extension-font-family": "^3.19.0",
48
- "@tiptap/extension-highlight": "^3.19.0",
49
- "@tiptap/extension-image": "^3.19.0",
50
- "@tiptap/extension-link": "^3.19.0",
51
- "@tiptap/extension-placeholder": "^3.19.0",
52
- "@tiptap/extension-table": "^3.19.0",
53
- "@tiptap/extension-table-cell": "^3.19.0",
54
- "@tiptap/extension-table-header": "^3.19.0",
55
- "@tiptap/extension-table-row": "^3.19.0",
56
- "@tiptap/extension-text-align": "^3.19.0",
57
- "@tiptap/extension-text-style": "^3.19.0",
58
- "@tiptap/extension-underline": "^3.19.0",
59
- "@tiptap/pm": "^3.19.0",
60
- "@tiptap/starter-kit": "^3.19.0",
54
+ "@tiptap/core": "^3.22.3",
55
+ "@tiptap/extension-character-count": "^3.22.3",
56
+ "@tiptap/extension-code-block-lowlight": "^3.22.3",
57
+ "@tiptap/extension-color": "^3.22.3",
58
+ "@tiptap/extension-font-family": "^3.22.3",
59
+ "@tiptap/extension-highlight": "^3.22.3",
60
+ "@tiptap/extension-image": "^3.22.3",
61
+ "@tiptap/extension-link": "^3.22.3",
62
+ "@tiptap/extension-placeholder": "^3.22.3",
63
+ "@tiptap/extension-table": "^3.22.3",
64
+ "@tiptap/extension-table-cell": "^3.22.3",
65
+ "@tiptap/extension-table-header": "^3.22.3",
66
+ "@tiptap/extension-table-row": "^3.22.3",
67
+ "@tiptap/extension-text-align": "^3.22.3",
68
+ "@tiptap/extension-text-style": "^3.22.3",
69
+ "@tiptap/extension-underline": "^3.22.3",
70
+ "@tiptap/pm": "^3.22.3",
71
+ "@tiptap/starter-kit": "^3.22.3",
61
72
  "lowlight": "^3.3.0"
62
73
  },
63
74
  "devDependencies": {