md-editor-v3 6.0.0-3 → 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.
@@ -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 showVueTooltip = (view2, pos) => {
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
- showVueTooltip(update.view, sel.from);
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
- showVueTooltip(update.view, pos);
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 {
@@ -2207,7 +2207,7 @@ const tooltipField = StateField.define({
2207
2207
  provide: (f) => showTooltip.from(f)
2208
2208
  });
2209
2209
  const createFloatingToolbarPlugin = (options) => {
2210
- const showVueTooltip = (view, pos) => {
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
- showVueTooltip(update.view, sel.from);
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
- showVueTooltip(update.view, pos);
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/preview.css CHANGED
@@ -97,11 +97,6 @@
97
97
  width: 18px;
98
98
  height: 18px;
99
99
  padding: 3px;
100
- }.md-editor-preview-wrapper {
101
- position: relative;
102
- height: 100%;
103
- box-sizing: border-box;
104
- overflow: auto;
105
100
  }.md-editor-preview {
106
101
  font-size: 16px;
107
102
  word-break: break-all;
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;