remons-markdown-editor 1.0.0-beta.11 → 1.0.0-beta.13
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/index.cjs +25 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +86 -87
- package/dist/index.js +25 -14
- package/dist/index.js.map +1 -1
- package/package.json +79 -79
- package/readme.md +309 -309
package/dist/index.css
CHANGED
|
@@ -41,93 +41,85 @@
|
|
|
41
41
|
min-height: 20px;
|
|
42
42
|
text-align: center;
|
|
43
43
|
}
|
|
44
|
-
html,
|
|
45
|
-
body {
|
|
46
|
-
margin: 0;
|
|
47
|
-
padding: 0;
|
|
48
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
49
|
-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
50
|
-
sans-serif;
|
|
51
|
-
-webkit-font-smoothing: antialiased;
|
|
52
|
-
-moz-osx-font-smoothing: grayscale;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
--remons-md-editor-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
--remons-md-editor-
|
|
78
|
-
--remons-md-editor-
|
|
79
|
-
|
|
80
|
-
/*
|
|
81
|
-
--remons-md-editor-color-
|
|
82
|
-
--remons-md-editor-color-
|
|
83
|
-
|
|
84
|
-
/*
|
|
85
|
-
--remons-md-editor-
|
|
86
|
-
--remons-md-editor-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
--remons-md-editor-color-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
--remons-md-editor-
|
|
96
|
-
--remons-md-editor-
|
|
97
|
-
--remons-md-editor-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
--remons-md-editor-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
--remons-md-editor-
|
|
107
|
-
--remons-md-editor-
|
|
108
|
-
|
|
109
|
-
/*
|
|
110
|
-
--remons-md-editor-color-
|
|
111
|
-
--remons-md-editor-color-
|
|
112
|
-
|
|
113
|
-
/*
|
|
114
|
-
--remons-md-editor-
|
|
115
|
-
--remons-md-editor-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
--remons-md-editor-color-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
--remons-md-editor-bg-cell-active: #1a3a5c;
|
|
124
|
-
--remons-md-editor-color-cell-active: #58a6ff;
|
|
125
|
-
--remons-md-editor-color-hint: #8b949e;
|
|
126
|
-
--remons-md-editor-color-label: #8b949e;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.ant-anchor-link-title {
|
|
130
|
-
white-space: inherit !important;
|
|
44
|
+
html,
|
|
45
|
+
body {
|
|
46
|
+
margin: 0;
|
|
47
|
+
padding: 0;
|
|
48
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
49
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
50
|
+
sans-serif;
|
|
51
|
+
-webkit-font-smoothing: antialiased;
|
|
52
|
+
-moz-osx-font-smoothing: grayscale;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#markdown-editor {
|
|
56
|
+
height: 100vh;
|
|
57
|
+
width: 100vw;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ===== CSS 自定义属性(主题变量) ===== */
|
|
62
|
+
/* 浅色主题(默认) */
|
|
63
|
+
:root,
|
|
64
|
+
[data-theme="light"] {
|
|
65
|
+
/* 背景色 */
|
|
66
|
+
--remons-md-editor-bg-primary: #f3f3f3;
|
|
67
|
+
--remons-md-editor-bg-white: rgba(255, 255, 255, 0.6);
|
|
68
|
+
--remons-md-editor-bg-hover: #e1e4e8;
|
|
69
|
+
--remons-md-editor-bg-active: #d0d7de;
|
|
70
|
+
--remons-md-editor-bg-fullscreen: #fff;
|
|
71
|
+
|
|
72
|
+
/* 文字颜色 */
|
|
73
|
+
--remons-md-editor-color-text: #24292f;
|
|
74
|
+
--remons-md-editor-color-text-hover: #0969da;
|
|
75
|
+
|
|
76
|
+
/* 边框 */
|
|
77
|
+
--remons-md-editor-color-border: rgba(255, 255, 255, 0.8);
|
|
78
|
+
--remons-md-editor-color-border-light: #d0d7de;
|
|
79
|
+
|
|
80
|
+
/* 焦点 */
|
|
81
|
+
--remons-md-editor-color-focus: #0969da;
|
|
82
|
+
--remons-md-editor-color-focus-shadow: rgba(9, 105, 218, 0.1);
|
|
83
|
+
|
|
84
|
+
/* 工具选择器 */
|
|
85
|
+
--remons-md-editor-bg-picker: #fff;
|
|
86
|
+
--remons-md-editor-bg-cell-active: #ddf4ff;
|
|
87
|
+
--remons-md-editor-color-cell-active: #91caff;
|
|
88
|
+
--remons-md-editor-color-hint: #999;
|
|
89
|
+
--remons-md-editor-color-label: #666;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ===== 深色主题 ===== */
|
|
93
|
+
[data-theme="dark"] {
|
|
94
|
+
/* 背景色 */
|
|
95
|
+
--remons-md-editor-bg-primary: #1a1d23;
|
|
96
|
+
--remons-md-editor-bg-white: rgba(46, 51, 80, 0.8);
|
|
97
|
+
--remons-md-editor-bg-hover: #4a5163;
|
|
98
|
+
--remons-md-editor-bg-active: #5a6278;
|
|
99
|
+
--remons-md-editor-bg-fullscreen: #1a1d23;
|
|
100
|
+
|
|
101
|
+
/* 文字颜色 */
|
|
102
|
+
--remons-md-editor-color-text: #c9d1d9;
|
|
103
|
+
--remons-md-editor-color-text-hover: #58a6ff;
|
|
104
|
+
|
|
105
|
+
/* 边框 */
|
|
106
|
+
--remons-md-editor-color-border: rgba(255, 255, 255, 0.1);
|
|
107
|
+
--remons-md-editor-color-border-light: #3a3f4b;
|
|
108
|
+
|
|
109
|
+
/* 焦点 */
|
|
110
|
+
--remons-md-editor-color-focus: #58a6ff;
|
|
111
|
+
--remons-md-editor-color-focus-shadow: rgba(88, 166, 255, 0.15);
|
|
112
|
+
|
|
113
|
+
/* 工具选择器 */
|
|
114
|
+
--remons-md-editor-bg-picker: #2e3350;
|
|
115
|
+
--remons-md-editor-bg-cell-active: #1a3a5c;
|
|
116
|
+
--remons-md-editor-color-cell-active: #58a6ff;
|
|
117
|
+
--remons-md-editor-color-hint: #8b949e;
|
|
118
|
+
--remons-md-editor-color-label: #8b949e;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ant-anchor-link-title {
|
|
122
|
+
white-space: inherit !important;
|
|
131
123
|
}@font-face {
|
|
132
124
|
font-family: 'Inter';
|
|
133
125
|
font-style: normal;
|
|
@@ -189,6 +181,13 @@ body {
|
|
|
189
181
|
display: flex;
|
|
190
182
|
flex-direction: column;
|
|
191
183
|
border: 1px solid var(--markdown-editor-color-border);
|
|
184
|
+
border-radius: 12px;
|
|
185
|
+
background: var(--remons-md-editor-bg-primary);
|
|
186
|
+
}
|
|
187
|
+
.markdown-editor-app .ant-btn:hover {
|
|
188
|
+
border: none !important;
|
|
189
|
+
background-color: var(--remons-md-editor-bg-hover) !important;
|
|
190
|
+
color: var(--remons-md-editor-color-text-hover) !important;
|
|
192
191
|
}
|
|
193
192
|
.markdown-editor-app.fullscreen {
|
|
194
193
|
position: fixed;
|
package/dist/index.js
CHANGED
|
@@ -247,25 +247,36 @@ var containerWidgetPlugin = ViewPlugin.fromClass(class {
|
|
|
247
247
|
}
|
|
248
248
|
}, {
|
|
249
249
|
decorations: (value) => value.decorations,
|
|
250
|
-
eventHandlers: {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
eventHandlers: {
|
|
251
|
+
mousedown: (event, view) => {
|
|
252
|
+
if (event.target.classList.contains("container-edit-btn")) {
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
return false;
|
|
257
|
+
},
|
|
258
|
+
click: (event, view) => {
|
|
259
|
+
const target = event.target;
|
|
260
|
+
if (target.classList.contains("container-edit-btn")) {
|
|
261
|
+
event.preventDefault();
|
|
262
|
+
event.stopPropagation();
|
|
263
|
+
if (target.__typeName) {
|
|
264
|
+
const containers = findContainers(view.state.doc.toString());
|
|
265
|
+
const buttonPos = view.posAtDOM(target);
|
|
266
|
+
for (const container of containers) {
|
|
267
|
+
const headerLine = view.state.doc.lineAt(container.startPos);
|
|
268
|
+
if (buttonPos >= headerLine.from - 5 && buttonPos <= headerLine.to + 5) {
|
|
269
|
+
const callback = view.state.facet(containerEditCallback);
|
|
270
|
+
if (callback) callback(view, container.typeName, container.propsLineFrom, container.propsLineTo, { ...container.props });
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
262
273
|
}
|
|
263
274
|
}
|
|
275
|
+
return false;
|
|
264
276
|
}
|
|
265
277
|
return false;
|
|
266
278
|
}
|
|
267
|
-
|
|
268
|
-
} }
|
|
279
|
+
}
|
|
269
280
|
});
|
|
270
281
|
//#endregion
|
|
271
282
|
//#region src/components/Toolbar/buttons.tsx
|