md-editor-v3 6.0.0-2 → 6.0.0-4
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/lib/cjs/MdEditor.cjs +5 -7
- package/lib/cjs/chunks/index4.cjs +3 -1
- package/lib/es/MdEditor.mjs +5 -7
- package/lib/es/chunks/index4.mjs +3 -1
- package/lib/preview.css +0 -5
- package/lib/style.css +15 -9
- package/lib/types/MdCatalog/MdCatalog.d.ts +2 -2
- package/lib/umd/index.js +30 -30
- package/lib/umd/preview.js +1 -1
- package/package.json +1 -1
package/lib/cjs/MdEditor.cjs
CHANGED
|
@@ -2208,7 +2208,7 @@ const tooltipField = state.StateField.define({
|
|
|
2208
2208
|
provide: (f) => view.showTooltip.from(f)
|
|
2209
2209
|
});
|
|
2210
2210
|
const createFloatingToolbarPlugin = (options) => {
|
|
2211
|
-
const
|
|
2211
|
+
const showTooltip2 = (view2, pos) => {
|
|
2212
2212
|
view2.dispatch({
|
|
2213
2213
|
effects: tooltipEffect.of({
|
|
2214
2214
|
pos,
|
|
@@ -2216,6 +2216,8 @@ const createFloatingToolbarPlugin = (options) => {
|
|
|
2216
2216
|
arrow: true,
|
|
2217
2217
|
create: () => {
|
|
2218
2218
|
const dom2 = document.createElement("div");
|
|
2219
|
+
const appNode = document.createElement("div");
|
|
2220
|
+
dom2.appendChild(appNode);
|
|
2219
2221
|
const app = vue.createApp(Toolbar);
|
|
2220
2222
|
options.privide(app);
|
|
2221
2223
|
app.mount(dom2);
|
|
@@ -2229,12 +2231,12 @@ const createFloatingToolbarPlugin = (options) => {
|
|
|
2229
2231
|
const state2 = update.state;
|
|
2230
2232
|
const sel = state2.selection.main;
|
|
2231
2233
|
if (!sel.empty) {
|
|
2232
|
-
|
|
2234
|
+
showTooltip2(update.view, sel.from);
|
|
2233
2235
|
} else {
|
|
2234
2236
|
const pos = sel.head;
|
|
2235
2237
|
const line = state2.doc.lineAt(pos);
|
|
2236
2238
|
if (/^\s*$/.test(line.text)) {
|
|
2237
|
-
|
|
2239
|
+
showTooltip2(update.view, pos);
|
|
2238
2240
|
} else {
|
|
2239
2241
|
update.view.dispatch({ effects: tooltipEffect.of(null) });
|
|
2240
2242
|
}
|
|
@@ -3343,16 +3345,12 @@ const CustomScrollbar = /* @__PURE__ */ vue.defineComponent({
|
|
|
3343
3345
|
isDragging = false;
|
|
3344
3346
|
document.body.style.userSelect = "";
|
|
3345
3347
|
};
|
|
3346
|
-
const hideNativeScrollbar = (el) => {
|
|
3347
|
-
el.classList.add(`${config.prefix}-custom-scrollbar--hide-native`);
|
|
3348
|
-
};
|
|
3349
3348
|
const bindScrollEl = (el) => {
|
|
3350
3349
|
if (scrollEl.value) {
|
|
3351
3350
|
scrollEl.value.removeEventListener("scroll", onScroll);
|
|
3352
3351
|
}
|
|
3353
3352
|
scrollEl.value = el;
|
|
3354
3353
|
if (scrollEl.value) {
|
|
3355
|
-
hideNativeScrollbar(scrollEl.value);
|
|
3356
3354
|
scrollEl.value.addEventListener("scroll", onScroll);
|
|
3357
3355
|
updateThumb();
|
|
3358
3356
|
} else {
|
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -2207,7 +2207,7 @@ const tooltipField = StateField.define({
|
|
|
2207
2207
|
provide: (f) => showTooltip.from(f)
|
|
2208
2208
|
});
|
|
2209
2209
|
const createFloatingToolbarPlugin = (options) => {
|
|
2210
|
-
const
|
|
2210
|
+
const showTooltip2 = (view, pos) => {
|
|
2211
2211
|
view.dispatch({
|
|
2212
2212
|
effects: tooltipEffect.of({
|
|
2213
2213
|
pos,
|
|
@@ -2215,6 +2215,8 @@ const createFloatingToolbarPlugin = (options) => {
|
|
|
2215
2215
|
arrow: true,
|
|
2216
2216
|
create: () => {
|
|
2217
2217
|
const dom = document.createElement("div");
|
|
2218
|
+
const appNode = document.createElement("div");
|
|
2219
|
+
dom.appendChild(appNode);
|
|
2218
2220
|
const app = createApp(Toolbar);
|
|
2219
2221
|
options.privide(app);
|
|
2220
2222
|
app.mount(dom);
|
|
@@ -2228,12 +2230,12 @@ const createFloatingToolbarPlugin = (options) => {
|
|
|
2228
2230
|
const state = update.state;
|
|
2229
2231
|
const sel = state.selection.main;
|
|
2230
2232
|
if (!sel.empty) {
|
|
2231
|
-
|
|
2233
|
+
showTooltip2(update.view, sel.from);
|
|
2232
2234
|
} else {
|
|
2233
2235
|
const pos = sel.head;
|
|
2234
2236
|
const line = state.doc.lineAt(pos);
|
|
2235
2237
|
if (/^\s*$/.test(line.text)) {
|
|
2236
|
-
|
|
2238
|
+
showTooltip2(update.view, pos);
|
|
2237
2239
|
} else {
|
|
2238
2240
|
update.view.dispatch({ effects: tooltipEffect.of(null) });
|
|
2239
2241
|
}
|
|
@@ -3342,16 +3344,12 @@ const CustomScrollbar = /* @__PURE__ */ defineComponent({
|
|
|
3342
3344
|
isDragging = false;
|
|
3343
3345
|
document.body.style.userSelect = "";
|
|
3344
3346
|
};
|
|
3345
|
-
const hideNativeScrollbar = (el) => {
|
|
3346
|
-
el.classList.add(`${prefix}-custom-scrollbar--hide-native`);
|
|
3347
|
-
};
|
|
3348
3347
|
const bindScrollEl = (el) => {
|
|
3349
3348
|
if (scrollEl.value) {
|
|
3350
3349
|
scrollEl.value.removeEventListener("scroll", onScroll);
|
|
3351
3350
|
}
|
|
3352
3351
|
scrollEl.value = el;
|
|
3353
3352
|
if (scrollEl.value) {
|
|
3354
|
-
hideNativeScrollbar(scrollEl.value);
|
|
3355
3353
|
scrollEl.value.addEventListener("scroll", onScroll);
|
|
3356
3354
|
updateThumb();
|
|
3357
3355
|
} else {
|
package/lib/es/chunks/index4.mjs
CHANGED
package/lib/preview.css
CHANGED
package/lib/style.css
CHANGED
|
@@ -134,10 +134,6 @@
|
|
|
134
134
|
transition: background 0.2s;
|
|
135
135
|
}.md-editor-custom-scrollbar__thumb:hover {
|
|
136
136
|
background: var(--md-scrollbar-thumb-hover-color);
|
|
137
|
-
}.md-editor-custom-scrollbar--hide-native {
|
|
138
|
-
scrollbar-width: none;
|
|
139
|
-
}.md-editor-custom-scrollbar--hide-native::-webkit-scrollbar {
|
|
140
|
-
display: none;
|
|
141
137
|
}.md-editor-content {
|
|
142
138
|
position: relative;
|
|
143
139
|
display: flex;
|
|
@@ -159,6 +155,14 @@
|
|
|
159
155
|
}.md-editor-input-wrapper {
|
|
160
156
|
height: 100%;
|
|
161
157
|
box-sizing: border-box;
|
|
158
|
+
}.md-editor-preview-wrapper {
|
|
159
|
+
position: relative;
|
|
160
|
+
height: 100%;
|
|
161
|
+
box-sizing: border-box;
|
|
162
|
+
overflow: auto;
|
|
163
|
+
scrollbar-width: none;
|
|
164
|
+
}.md-editor-preview-wrapper::-webkit-scrollbar {
|
|
165
|
+
display: none;
|
|
162
166
|
}.md-editor-html {
|
|
163
167
|
font-size: 16px;
|
|
164
168
|
word-break: break-all;
|
|
@@ -178,6 +182,9 @@
|
|
|
178
182
|
line-height: 1.5;
|
|
179
183
|
list-style: none;
|
|
180
184
|
font-feature-settings: 'tnum';
|
|
185
|
+
scrollbar-width: none;
|
|
186
|
+
}.md-editor-catalog-editor::-webkit-scrollbar {
|
|
187
|
+
display: none;
|
|
181
188
|
}.md-editor-catalog-fixed {
|
|
182
189
|
position: absolute;
|
|
183
190
|
top: 0;
|
|
@@ -433,6 +440,10 @@
|
|
|
433
440
|
overflow: hidden;
|
|
434
441
|
background-color: var(--md-bk-hover-color);
|
|
435
442
|
color: var(--md-color);
|
|
443
|
+
}.md-editor .cm-scroller {
|
|
444
|
+
scrollbar-width: none;
|
|
445
|
+
}.md-editor .cm-scroller::-webkit-scrollbar {
|
|
446
|
+
display: none;
|
|
436
447
|
}.md-editor .cm-scroller .cm-content[contenteditable='true'] {
|
|
437
448
|
margin: 10px;
|
|
438
449
|
min-height: calc(100% - 20px);
|
|
@@ -601,11 +612,6 @@
|
|
|
601
612
|
width: 18px;
|
|
602
613
|
height: 18px;
|
|
603
614
|
padding: 3px;
|
|
604
|
-
}.md-editor-preview-wrapper {
|
|
605
|
-
position: relative;
|
|
606
|
-
height: 100%;
|
|
607
|
-
box-sizing: border-box;
|
|
608
|
-
overflow: auto;
|
|
609
615
|
}.md-editor-preview {
|
|
610
616
|
font-size: 16px;
|
|
611
617
|
word-break: break-all;
|
|
@@ -18,7 +18,7 @@ declare const MdCatalog: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
18
18
|
};
|
|
19
19
|
mdHeadingId: {
|
|
20
20
|
type: PropType<MdHeadingId>;
|
|
21
|
-
default:
|
|
21
|
+
default: MdHeadingId;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* 指定滚动的容器,选择器需带上对应的符号,默认预览框
|
|
@@ -99,7 +99,7 @@ declare const MdCatalog: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
99
99
|
};
|
|
100
100
|
mdHeadingId: {
|
|
101
101
|
type: PropType<MdHeadingId>;
|
|
102
|
-
default:
|
|
102
|
+
default: MdHeadingId;
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
105
|
* 指定滚动的容器,选择器需带上对应的符号,默认预览框
|