@tiptap/vue-2 3.29.2 → 3.30.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/dist/index.cjs +74 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -2
- package/dist/index.d.ts +51 -2
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -1
- package/dist/menus/index.cjs +31 -30
- package/dist/menus/index.cjs.map +1 -1
- package/dist/menus/index.d.cts +1 -0
- package/dist/menus/index.d.ts +1 -0
- package/dist/menus/index.js +31 -30
- package/dist/menus/index.js.map +1 -1
- package/package.json +7 -7
- package/src/VueWidgetRenderer.ts +135 -0
- package/src/index.ts +1 -0
- package/src/menus/FloatingMenu.ts +42 -34
- package/src/utils/createWidgetConstructor.ts +38 -0
package/dist/menus/index.d.cts
CHANGED
|
@@ -221,6 +221,7 @@ interface FloatingMenuInterface extends Vue {
|
|
|
221
221
|
appendTo: FloatingMenuPluginProps['appendTo'];
|
|
222
222
|
shouldShow: FloatingMenuPluginProps['shouldShow'];
|
|
223
223
|
getPluginKey: () => FloatingMenuPluginProps['pluginKey'];
|
|
224
|
+
isDestroyed: boolean;
|
|
224
225
|
}
|
|
225
226
|
declare const FloatingMenu: Component;
|
|
226
227
|
|
package/dist/menus/index.d.ts
CHANGED
|
@@ -221,6 +221,7 @@ interface FloatingMenuInterface extends Vue {
|
|
|
221
221
|
appendTo: FloatingMenuPluginProps['appendTo'];
|
|
222
222
|
shouldShow: FloatingMenuPluginProps['shouldShow'];
|
|
223
223
|
getPluginKey: () => FloatingMenuPluginProps['pluginKey'];
|
|
224
|
+
isDestroyed: boolean;
|
|
224
225
|
}
|
|
225
226
|
declare const FloatingMenu: Component;
|
|
226
227
|
|
package/dist/menus/index.js
CHANGED
|
@@ -2445,36 +2445,32 @@ var FloatingMenu = {
|
|
|
2445
2445
|
default: null
|
|
2446
2446
|
}
|
|
2447
2447
|
},
|
|
2448
|
-
|
|
2449
|
-
editor
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
return;
|
|
2454
|
-
}
|
|
2455
|
-
if (!this.$el) {
|
|
2456
|
-
return;
|
|
2457
|
-
}
|
|
2458
|
-
;
|
|
2459
|
-
this.$el.style.visibility = "hidden";
|
|
2460
|
-
this.$el.style.position = "absolute";
|
|
2461
|
-
this.$el.remove();
|
|
2462
|
-
this.$nextTick(() => {
|
|
2463
|
-
editor.registerPlugin(
|
|
2464
|
-
FloatingMenuPlugin({
|
|
2465
|
-
pluginKey: this.getPluginKey(),
|
|
2466
|
-
editor,
|
|
2467
|
-
element: this.$el,
|
|
2468
|
-
updateDelay: this.updateDelay,
|
|
2469
|
-
resizeDelay: this.resizeDelay,
|
|
2470
|
-
options: this.options,
|
|
2471
|
-
appendTo: this.appendTo,
|
|
2472
|
-
shouldShow: this.shouldShow
|
|
2473
|
-
})
|
|
2474
|
-
);
|
|
2475
|
-
});
|
|
2476
|
-
}
|
|
2448
|
+
mounted() {
|
|
2449
|
+
const editor = this.editor;
|
|
2450
|
+
const el = this.$el;
|
|
2451
|
+
if (!editor || !el) {
|
|
2452
|
+
return;
|
|
2477
2453
|
}
|
|
2454
|
+
el.style.visibility = "hidden";
|
|
2455
|
+
el.style.position = "absolute";
|
|
2456
|
+
el.remove();
|
|
2457
|
+
this.$nextTick(() => {
|
|
2458
|
+
if (this.isDestroyed) {
|
|
2459
|
+
return;
|
|
2460
|
+
}
|
|
2461
|
+
editor.registerPlugin(
|
|
2462
|
+
FloatingMenuPlugin({
|
|
2463
|
+
pluginKey: this.getPluginKey(),
|
|
2464
|
+
editor,
|
|
2465
|
+
element: el,
|
|
2466
|
+
updateDelay: this.updateDelay,
|
|
2467
|
+
resizeDelay: this.resizeDelay,
|
|
2468
|
+
options: this.options,
|
|
2469
|
+
appendTo: this.appendTo,
|
|
2470
|
+
shouldShow: this.shouldShow
|
|
2471
|
+
})
|
|
2472
|
+
);
|
|
2473
|
+
});
|
|
2478
2474
|
},
|
|
2479
2475
|
render(createElement) {
|
|
2480
2476
|
var _a, _b;
|
|
@@ -2491,7 +2487,12 @@ var FloatingMenu = {
|
|
|
2491
2487
|
);
|
|
2492
2488
|
},
|
|
2493
2489
|
beforeDestroy() {
|
|
2494
|
-
this.
|
|
2490
|
+
this.isDestroyed = true;
|
|
2491
|
+
const editor = this.editor;
|
|
2492
|
+
if (!editor) {
|
|
2493
|
+
return;
|
|
2494
|
+
}
|
|
2495
|
+
editor.unregisterPlugin(this.getPluginKey());
|
|
2495
2496
|
},
|
|
2496
2497
|
methods: {
|
|
2497
2498
|
getPluginKey() {
|