@tiptap/vue-2 3.20.2 → 3.20.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/dist/menus/index.cjs +55 -11
- package/dist/menus/index.cjs.map +1 -1
- package/dist/menus/index.d.cts +9 -0
- package/dist/menus/index.d.ts +9 -0
- package/dist/menus/index.js +54 -10
- package/dist/menus/index.js.map +1 -1
- package/package.json +7 -7
- package/src/menus/BubbleMenu.ts +33 -4
- package/src/menus/FloatingMenu.ts +32 -4
package/dist/menus/index.cjs
CHANGED
|
@@ -1998,12 +1998,14 @@ var BubbleMenuPlugin = (options) => {
|
|
|
1998
1998
|
};
|
|
1999
1999
|
|
|
2000
2000
|
// src/menus/BubbleMenu.ts
|
|
2001
|
+
var import_state2 = require("@tiptap/pm/state");
|
|
2001
2002
|
var BubbleMenu = {
|
|
2002
2003
|
name: "BubbleMenu",
|
|
2004
|
+
inheritAttrs: false,
|
|
2003
2005
|
props: {
|
|
2004
2006
|
pluginKey: {
|
|
2005
2007
|
type: [String, Object],
|
|
2006
|
-
default:
|
|
2008
|
+
default: void 0
|
|
2007
2009
|
},
|
|
2008
2010
|
editor: {
|
|
2009
2011
|
type: Object,
|
|
@@ -2045,7 +2047,7 @@ var BubbleMenu = {
|
|
|
2045
2047
|
options: this.options,
|
|
2046
2048
|
editor,
|
|
2047
2049
|
element: el,
|
|
2048
|
-
pluginKey: this.
|
|
2050
|
+
pluginKey: this.getPluginKey(),
|
|
2049
2051
|
appendTo: this.appendTo,
|
|
2050
2052
|
shouldShow: this.shouldShow,
|
|
2051
2053
|
getReferencedVirtualElement: this.getReferencedVirtualElement
|
|
@@ -2054,16 +2056,36 @@ var BubbleMenu = {
|
|
|
2054
2056
|
});
|
|
2055
2057
|
},
|
|
2056
2058
|
render(createElement) {
|
|
2057
|
-
|
|
2059
|
+
var _a, _b;
|
|
2060
|
+
const vnodeData = (_b = (_a = this.$vnode) == null ? void 0 : _a.data) != null ? _b : {};
|
|
2061
|
+
return createElement(
|
|
2062
|
+
"div",
|
|
2063
|
+
{
|
|
2064
|
+
attrs: this.$attrs,
|
|
2065
|
+
on: this.$listeners,
|
|
2066
|
+
class: [vnodeData.staticClass, vnodeData.class],
|
|
2067
|
+
style: [vnodeData.staticStyle, vnodeData.style]
|
|
2068
|
+
},
|
|
2069
|
+
this.$slots.default
|
|
2070
|
+
);
|
|
2058
2071
|
},
|
|
2059
2072
|
beforeDestroy() {
|
|
2060
|
-
this.editor.unregisterPlugin(this.
|
|
2073
|
+
this.editor.unregisterPlugin(this.getPluginKey());
|
|
2074
|
+
},
|
|
2075
|
+
methods: {
|
|
2076
|
+
getPluginKey() {
|
|
2077
|
+
var _a;
|
|
2078
|
+
if (!this.generatedPluginKey) {
|
|
2079
|
+
this.generatedPluginKey = (_a = this.pluginKey) != null ? _a : new import_state2.PluginKey("bubbleMenu");
|
|
2080
|
+
}
|
|
2081
|
+
return this.generatedPluginKey;
|
|
2082
|
+
}
|
|
2061
2083
|
}
|
|
2062
2084
|
};
|
|
2063
2085
|
|
|
2064
2086
|
// ../extension-floating-menu/src/floating-menu-plugin.ts
|
|
2065
2087
|
var import_core3 = require("@tiptap/core");
|
|
2066
|
-
var
|
|
2088
|
+
var import_state3 = require("@tiptap/pm/state");
|
|
2067
2089
|
var FloatingMenuView = class {
|
|
2068
2090
|
constructor({
|
|
2069
2091
|
editor,
|
|
@@ -2350,19 +2372,21 @@ var FloatingMenuView = class {
|
|
|
2350
2372
|
}
|
|
2351
2373
|
};
|
|
2352
2374
|
var FloatingMenuPlugin = (options) => {
|
|
2353
|
-
return new
|
|
2354
|
-
key: typeof options.pluginKey === "string" ? new
|
|
2375
|
+
return new import_state3.Plugin({
|
|
2376
|
+
key: typeof options.pluginKey === "string" ? new import_state3.PluginKey(options.pluginKey) : options.pluginKey,
|
|
2355
2377
|
view: (view) => new FloatingMenuView({ view, ...options })
|
|
2356
2378
|
});
|
|
2357
2379
|
};
|
|
2358
2380
|
|
|
2359
2381
|
// src/menus/FloatingMenu.ts
|
|
2382
|
+
var import_state4 = require("@tiptap/pm/state");
|
|
2360
2383
|
var FloatingMenu = {
|
|
2361
2384
|
name: "FloatingMenu",
|
|
2385
|
+
inheritAttrs: false,
|
|
2362
2386
|
props: {
|
|
2363
2387
|
pluginKey: {
|
|
2364
2388
|
type: [String, Object],
|
|
2365
|
-
default:
|
|
2389
|
+
default: void 0
|
|
2366
2390
|
},
|
|
2367
2391
|
editor: {
|
|
2368
2392
|
type: Object,
|
|
@@ -2404,7 +2428,7 @@ var FloatingMenu = {
|
|
|
2404
2428
|
this.$nextTick(() => {
|
|
2405
2429
|
editor.registerPlugin(
|
|
2406
2430
|
FloatingMenuPlugin({
|
|
2407
|
-
pluginKey: this.
|
|
2431
|
+
pluginKey: this.getPluginKey(),
|
|
2408
2432
|
editor,
|
|
2409
2433
|
element: this.$el,
|
|
2410
2434
|
updateDelay: this.updateDelay,
|
|
@@ -2419,10 +2443,30 @@ var FloatingMenu = {
|
|
|
2419
2443
|
}
|
|
2420
2444
|
},
|
|
2421
2445
|
render(createElement) {
|
|
2422
|
-
|
|
2446
|
+
var _a, _b;
|
|
2447
|
+
const vnodeData = (_b = (_a = this.$vnode) == null ? void 0 : _a.data) != null ? _b : {};
|
|
2448
|
+
return createElement(
|
|
2449
|
+
"div",
|
|
2450
|
+
{
|
|
2451
|
+
attrs: this.$attrs,
|
|
2452
|
+
on: this.$listeners,
|
|
2453
|
+
class: [vnodeData.staticClass, vnodeData.class],
|
|
2454
|
+
style: [vnodeData.staticStyle, vnodeData.style]
|
|
2455
|
+
},
|
|
2456
|
+
this.$slots.default
|
|
2457
|
+
);
|
|
2423
2458
|
},
|
|
2424
2459
|
beforeDestroy() {
|
|
2425
|
-
this.editor.unregisterPlugin(this.
|
|
2460
|
+
this.editor.unregisterPlugin(this.getPluginKey());
|
|
2461
|
+
},
|
|
2462
|
+
methods: {
|
|
2463
|
+
getPluginKey() {
|
|
2464
|
+
var _a;
|
|
2465
|
+
if (!this.generatedPluginKey) {
|
|
2466
|
+
this.generatedPluginKey = (_a = this.pluginKey) != null ? _a : new import_state4.PluginKey("floatingMenu");
|
|
2467
|
+
}
|
|
2468
|
+
return this.generatedPluginKey;
|
|
2469
|
+
}
|
|
2426
2470
|
}
|
|
2427
2471
|
};
|
|
2428
2472
|
// Annotate the CommonJS export names for ESM import in node:
|