@tiptap/extension-drag-handle-vue-2 3.7.2 → 3.9.0
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 +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/DragHandle.ts +13 -1
package/dist/index.cjs
CHANGED
|
@@ -57,20 +57,30 @@ var DragHandle = import_vue.default.extend({
|
|
|
57
57
|
type: Function,
|
|
58
58
|
default: null
|
|
59
59
|
},
|
|
60
|
+
onElementDragStart: {
|
|
61
|
+
type: Function,
|
|
62
|
+
default: null
|
|
63
|
+
},
|
|
64
|
+
onElementDragEnd: {
|
|
65
|
+
type: Function,
|
|
66
|
+
default: null
|
|
67
|
+
},
|
|
60
68
|
class: {
|
|
61
69
|
type: String,
|
|
62
70
|
default: "drag-handle"
|
|
63
71
|
}
|
|
64
72
|
},
|
|
65
73
|
mounted() {
|
|
66
|
-
const { editor, pluginKey, onNodeChange } = this.$props;
|
|
74
|
+
const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd } = this.$props;
|
|
67
75
|
editor.registerPlugin(
|
|
68
76
|
(0, import_extension_drag_handle.DragHandlePlugin)({
|
|
69
77
|
editor,
|
|
70
78
|
element: this.$el,
|
|
71
79
|
pluginKey,
|
|
72
80
|
computePositionConfig: { ...import_extension_drag_handle.defaultComputePositionConfig, ...this.computePositionConfig },
|
|
73
|
-
onNodeChange
|
|
81
|
+
onNodeChange,
|
|
82
|
+
onElementDragStart,
|
|
83
|
+
onElementDragEnd
|
|
74
84
|
}).plugin
|
|
75
85
|
);
|
|
76
86
|
},
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/DragHandle.ts"],"sourcesContent":["import { DragHandle } from './DragHandle.js'\n\nexport * from './DragHandle.js'\n\nexport default DragHandle\n","import type { Editor } from '@tiptap/core'\nimport {\n type DragHandlePluginProps,\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { type PropType } from 'vue'\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type DragHandleProps = Omit<Optional<DragHandlePluginProps, 'pluginKey'>, 'element'> & {\n class?: string\n onNodeChange?: (data: { node: Node | null; editor: Editor; pos: number }) => void\n}\n\nexport const DragHandle = Vue.extend({\n name: 'DragHandleVue',\n\n props: {\n pluginKey: {\n type: [String, Object] as PropType<DragHandleProps['pluginKey']>,\n default: () => dragHandlePluginDefaultKey,\n },\n\n editor: {\n type: Object as PropType<DragHandleProps['editor']>,\n required: true,\n },\n\n computePositionConfig: {\n type: Object as PropType<DragHandleProps['computePositionConfig']>,\n default: () => ({}),\n },\n\n onNodeChange: {\n type: Function as PropType<DragHandleProps['onNodeChange']>,\n default: null,\n },\n\n class: {\n type: String as PropType<DragHandleProps['class']>,\n default: 'drag-handle',\n },\n },\n\n mounted() {\n const { editor, pluginKey, onNodeChange } = this.$props\n\n editor.registerPlugin(\n DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n computePositionConfig: { ...defaultComputePositionConfig, ...this.computePositionConfig },\n onNodeChange,\n }).plugin,\n )\n },\n\n // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle\n beforeDestroy() {\n const { pluginKey, editor } = this.$props\n\n editor.unregisterPlugin(pluginKey as string)\n },\n\n render(h) {\n return h(\n 'div',\n {\n class: this.class,\n },\n this.$slots.default,\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mCAKO;AACP,iBAAmC;AAS5B,IAAM,aAAa,WAAAA,QAAI,OAAO;AAAA,EACnC,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS,MAAM;AAAA,IACjB;AAAA,IAEA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IAEA,uBAAuB;AAAA,MACrB,MAAM;AAAA,MACN,SAAS,OAAO,CAAC;AAAA,IACnB;AAAA,IAEA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,UAAU;AACR,UAAM,EAAE,QAAQ,WAAW,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/DragHandle.ts"],"sourcesContent":["import { DragHandle } from './DragHandle.js'\n\nexport * from './DragHandle.js'\n\nexport default DragHandle\n","import type { Editor } from '@tiptap/core'\nimport {\n type DragHandlePluginProps,\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { type PropType } from 'vue'\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type DragHandleProps = Omit<Optional<DragHandlePluginProps, 'pluginKey'>, 'element'> & {\n class?: string\n onNodeChange?: (data: { node: Node | null; editor: Editor; pos: number }) => void\n}\n\nexport const DragHandle = Vue.extend({\n name: 'DragHandleVue',\n\n props: {\n pluginKey: {\n type: [String, Object] as PropType<DragHandleProps['pluginKey']>,\n default: () => dragHandlePluginDefaultKey,\n },\n\n editor: {\n type: Object as PropType<DragHandleProps['editor']>,\n required: true,\n },\n\n computePositionConfig: {\n type: Object as PropType<DragHandleProps['computePositionConfig']>,\n default: () => ({}),\n },\n\n onNodeChange: {\n type: Function as PropType<DragHandleProps['onNodeChange']>,\n default: null,\n },\n\n onElementDragStart: {\n type: Function as PropType<DragHandleProps['onElementDragStart']>,\n default: null,\n },\n\n onElementDragEnd: {\n type: Function as PropType<DragHandleProps['onElementDragEnd']>,\n default: null,\n },\n\n class: {\n type: String as PropType<DragHandleProps['class']>,\n default: 'drag-handle',\n },\n },\n\n mounted() {\n const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd } = this.$props\n\n editor.registerPlugin(\n DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n computePositionConfig: { ...defaultComputePositionConfig, ...this.computePositionConfig },\n onNodeChange,\n onElementDragStart,\n onElementDragEnd,\n }).plugin,\n )\n },\n\n // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle\n beforeDestroy() {\n const { pluginKey, editor } = this.$props\n\n editor.unregisterPlugin(pluginKey as string)\n },\n\n render(h) {\n return h(\n 'div',\n {\n class: this.class,\n },\n this.$slots.default,\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mCAKO;AACP,iBAAmC;AAS5B,IAAM,aAAa,WAAAA,QAAI,OAAO;AAAA,EACnC,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS,MAAM;AAAA,IACjB;AAAA,IAEA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IAEA,uBAAuB;AAAA,MACrB,MAAM;AAAA,MACN,SAAS,OAAO,CAAC;AAAA,IACnB;AAAA,IAEA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,UAAU;AACR,UAAM,EAAE,QAAQ,WAAW,cAAc,oBAAoB,iBAAiB,IAAI,KAAK;AAEvF,WAAO;AAAA,UACL,+CAAiB;AAAA,QACf;AAAA,QACA,SAAS,KAAK;AAAA,QACd;AAAA,QACA,uBAAuB,EAAE,GAAG,2DAA8B,GAAG,KAAK,sBAAsB;AAAA,QACxF;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,EAAE;AAAA,IACL;AAAA,EACF;AAAA;AAAA,EAGA,gBAAgB;AACd,UAAM,EAAE,WAAW,OAAO,IAAI,KAAK;AAEnC,WAAO,iBAAiB,SAAmB;AAAA,EAC7C;AAAA,EAEA,OAAO,GAAG;AACR,WAAO;AAAA,MACL;AAAA,MACA;AAAA,QACE,OAAO,KAAK;AAAA,MACd;AAAA,MACA,KAAK,OAAO;AAAA,IACd;AAAA,EACF;AACF,CAAC;;;ADpFD,IAAO,gBAAQ;","names":["Vue"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -2549,6 +2549,7 @@ declare class Editor extends EventEmitter<EditorEvents> {
|
|
|
2549
2549
|
private commandManager;
|
|
2550
2550
|
extensionManager: ExtensionManager;
|
|
2551
2551
|
private css;
|
|
2552
|
+
private className;
|
|
2552
2553
|
schema: Schema;
|
|
2553
2554
|
private editorView;
|
|
2554
2555
|
isFocused: boolean;
|
|
@@ -2742,6 +2743,8 @@ declare const DragHandle: vue_types_vue.ExtendedVue<Vue__default<Record<string,
|
|
|
2742
2743
|
editor: Editor;
|
|
2743
2744
|
pos: number;
|
|
2744
2745
|
}) => void)) | undefined;
|
|
2746
|
+
onElementDragStart: ((e: DragEvent) => void) | undefined;
|
|
2747
|
+
onElementDragEnd: ((e: DragEvent) => void) | undefined;
|
|
2745
2748
|
class: string | undefined;
|
|
2746
2749
|
}, {}, Vue.ComponentOptionsMixin, Vue.ComponentOptionsMixin>;
|
|
2747
2750
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2549,6 +2549,7 @@ declare class Editor extends EventEmitter<EditorEvents> {
|
|
|
2549
2549
|
private commandManager;
|
|
2550
2550
|
extensionManager: ExtensionManager;
|
|
2551
2551
|
private css;
|
|
2552
|
+
private className;
|
|
2552
2553
|
schema: Schema;
|
|
2553
2554
|
private editorView;
|
|
2554
2555
|
isFocused: boolean;
|
|
@@ -2742,6 +2743,8 @@ declare const DragHandle: vue_types_vue.ExtendedVue<Vue__default<Record<string,
|
|
|
2742
2743
|
editor: Editor;
|
|
2743
2744
|
pos: number;
|
|
2744
2745
|
}) => void)) | undefined;
|
|
2746
|
+
onElementDragStart: ((e: DragEvent) => void) | undefined;
|
|
2747
|
+
onElementDragEnd: ((e: DragEvent) => void) | undefined;
|
|
2745
2748
|
class: string | undefined;
|
|
2746
2749
|
}, {}, Vue.ComponentOptionsMixin, Vue.ComponentOptionsMixin>;
|
|
2747
2750
|
|
package/dist/index.js
CHANGED
|
@@ -24,20 +24,30 @@ var DragHandle = Vue.extend({
|
|
|
24
24
|
type: Function,
|
|
25
25
|
default: null
|
|
26
26
|
},
|
|
27
|
+
onElementDragStart: {
|
|
28
|
+
type: Function,
|
|
29
|
+
default: null
|
|
30
|
+
},
|
|
31
|
+
onElementDragEnd: {
|
|
32
|
+
type: Function,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
27
35
|
class: {
|
|
28
36
|
type: String,
|
|
29
37
|
default: "drag-handle"
|
|
30
38
|
}
|
|
31
39
|
},
|
|
32
40
|
mounted() {
|
|
33
|
-
const { editor, pluginKey, onNodeChange } = this.$props;
|
|
41
|
+
const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd } = this.$props;
|
|
34
42
|
editor.registerPlugin(
|
|
35
43
|
DragHandlePlugin({
|
|
36
44
|
editor,
|
|
37
45
|
element: this.$el,
|
|
38
46
|
pluginKey,
|
|
39
47
|
computePositionConfig: { ...defaultComputePositionConfig, ...this.computePositionConfig },
|
|
40
|
-
onNodeChange
|
|
48
|
+
onNodeChange,
|
|
49
|
+
onElementDragStart,
|
|
50
|
+
onElementDragEnd
|
|
41
51
|
}).plugin
|
|
42
52
|
);
|
|
43
53
|
},
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/DragHandle.ts","../src/index.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport {\n type DragHandlePluginProps,\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { type PropType } from 'vue'\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type DragHandleProps = Omit<Optional<DragHandlePluginProps, 'pluginKey'>, 'element'> & {\n class?: string\n onNodeChange?: (data: { node: Node | null; editor: Editor; pos: number }) => void\n}\n\nexport const DragHandle = Vue.extend({\n name: 'DragHandleVue',\n\n props: {\n pluginKey: {\n type: [String, Object] as PropType<DragHandleProps['pluginKey']>,\n default: () => dragHandlePluginDefaultKey,\n },\n\n editor: {\n type: Object as PropType<DragHandleProps['editor']>,\n required: true,\n },\n\n computePositionConfig: {\n type: Object as PropType<DragHandleProps['computePositionConfig']>,\n default: () => ({}),\n },\n\n onNodeChange: {\n type: Function as PropType<DragHandleProps['onNodeChange']>,\n default: null,\n },\n\n class: {\n type: String as PropType<DragHandleProps['class']>,\n default: 'drag-handle',\n },\n },\n\n mounted() {\n const { editor, pluginKey, onNodeChange } = this.$props\n\n editor.registerPlugin(\n DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n computePositionConfig: { ...defaultComputePositionConfig, ...this.computePositionConfig },\n onNodeChange,\n }).plugin,\n )\n },\n\n // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle\n beforeDestroy() {\n const { pluginKey, editor } = this.$props\n\n editor.unregisterPlugin(pluginKey as string)\n },\n\n render(h) {\n return h(\n 'div',\n {\n class: this.class,\n },\n this.$slots.default,\n )\n },\n})\n","import { DragHandle } from './DragHandle.js'\n\nexport * from './DragHandle.js'\n\nexport default DragHandle\n"],"mappings":";AACA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,SAA4B;AAS5B,IAAM,aAAa,IAAI,OAAO;AAAA,EACnC,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS,MAAM;AAAA,IACjB;AAAA,IAEA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IAEA,uBAAuB;AAAA,MACrB,MAAM;AAAA,MACN,SAAS,OAAO,CAAC;AAAA,IACnB;AAAA,IAEA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,UAAU;AACR,UAAM,EAAE,QAAQ,WAAW,
|
|
1
|
+
{"version":3,"sources":["../src/DragHandle.ts","../src/index.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport {\n type DragHandlePluginProps,\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { type PropType } from 'vue'\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type DragHandleProps = Omit<Optional<DragHandlePluginProps, 'pluginKey'>, 'element'> & {\n class?: string\n onNodeChange?: (data: { node: Node | null; editor: Editor; pos: number }) => void\n}\n\nexport const DragHandle = Vue.extend({\n name: 'DragHandleVue',\n\n props: {\n pluginKey: {\n type: [String, Object] as PropType<DragHandleProps['pluginKey']>,\n default: () => dragHandlePluginDefaultKey,\n },\n\n editor: {\n type: Object as PropType<DragHandleProps['editor']>,\n required: true,\n },\n\n computePositionConfig: {\n type: Object as PropType<DragHandleProps['computePositionConfig']>,\n default: () => ({}),\n },\n\n onNodeChange: {\n type: Function as PropType<DragHandleProps['onNodeChange']>,\n default: null,\n },\n\n onElementDragStart: {\n type: Function as PropType<DragHandleProps['onElementDragStart']>,\n default: null,\n },\n\n onElementDragEnd: {\n type: Function as PropType<DragHandleProps['onElementDragEnd']>,\n default: null,\n },\n\n class: {\n type: String as PropType<DragHandleProps['class']>,\n default: 'drag-handle',\n },\n },\n\n mounted() {\n const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd } = this.$props\n\n editor.registerPlugin(\n DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n computePositionConfig: { ...defaultComputePositionConfig, ...this.computePositionConfig },\n onNodeChange,\n onElementDragStart,\n onElementDragEnd,\n }).plugin,\n )\n },\n\n // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle\n beforeDestroy() {\n const { pluginKey, editor } = this.$props\n\n editor.unregisterPlugin(pluginKey as string)\n },\n\n render(h) {\n return h(\n 'div',\n {\n class: this.class,\n },\n this.$slots.default,\n )\n },\n})\n","import { DragHandle } from './DragHandle.js'\n\nexport * from './DragHandle.js'\n\nexport default DragHandle\n"],"mappings":";AACA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,SAA4B;AAS5B,IAAM,aAAa,IAAI,OAAO;AAAA,EACnC,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS,MAAM;AAAA,IACjB;AAAA,IAEA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IAEA,uBAAuB;AAAA,MACrB,MAAM;AAAA,MACN,SAAS,OAAO,CAAC;AAAA,IACnB;AAAA,IAEA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,UAAU;AACR,UAAM,EAAE,QAAQ,WAAW,cAAc,oBAAoB,iBAAiB,IAAI,KAAK;AAEvF,WAAO;AAAA,MACL,iBAAiB;AAAA,QACf;AAAA,QACA,SAAS,KAAK;AAAA,QACd;AAAA,QACA,uBAAuB,EAAE,GAAG,8BAA8B,GAAG,KAAK,sBAAsB;AAAA,QACxF;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,EAAE;AAAA,IACL;AAAA,EACF;AAAA;AAAA,EAGA,gBAAgB;AACd,UAAM,EAAE,WAAW,OAAO,IAAI,KAAK;AAEnC,WAAO,iBAAiB,SAAmB;AAAA,EAC7C;AAAA,EAEA,OAAO,GAAG;AACR,WAAO;AAAA,MACL;AAAA,MACA;AAAA,QACE,OAAO,KAAK;AAAA,MACd;AAAA,MACA,KAAK,OAAO;AAAA,IACd;AAAA,EACF;AACF,CAAC;;;ACpFD,IAAO,gBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-drag-handle-vue-2",
|
|
3
3
|
"description": "drag handle extension for tiptap with vue 2",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.9.0",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"vue": "^2.0.0",
|
|
40
|
-
"@tiptap/extension-drag-handle": "^3.
|
|
41
|
-
"@tiptap/pm": "^3.
|
|
42
|
-
"@tiptap/vue-2": "^3.
|
|
40
|
+
"@tiptap/extension-drag-handle": "^3.9.0",
|
|
41
|
+
"@tiptap/pm": "^3.9.0",
|
|
42
|
+
"@tiptap/vue-2": "^3.9.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"vue": "^2.0.0",
|
|
46
46
|
"vue-ts-types": "1.6.2",
|
|
47
|
-
"@tiptap/extension-drag-handle": "^3.
|
|
48
|
-
"@tiptap/pm": "^3.
|
|
49
|
-
"@tiptap/vue-2": "^3.
|
|
47
|
+
"@tiptap/extension-drag-handle": "^3.9.0",
|
|
48
|
+
"@tiptap/pm": "^3.9.0",
|
|
49
|
+
"@tiptap/vue-2": "^3.9.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup",
|
package/src/DragHandle.ts
CHANGED
|
@@ -38,6 +38,16 @@ export const DragHandle = Vue.extend({
|
|
|
38
38
|
default: null,
|
|
39
39
|
},
|
|
40
40
|
|
|
41
|
+
onElementDragStart: {
|
|
42
|
+
type: Function as PropType<DragHandleProps['onElementDragStart']>,
|
|
43
|
+
default: null,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
onElementDragEnd: {
|
|
47
|
+
type: Function as PropType<DragHandleProps['onElementDragEnd']>,
|
|
48
|
+
default: null,
|
|
49
|
+
},
|
|
50
|
+
|
|
41
51
|
class: {
|
|
42
52
|
type: String as PropType<DragHandleProps['class']>,
|
|
43
53
|
default: 'drag-handle',
|
|
@@ -45,7 +55,7 @@ export const DragHandle = Vue.extend({
|
|
|
45
55
|
},
|
|
46
56
|
|
|
47
57
|
mounted() {
|
|
48
|
-
const { editor, pluginKey, onNodeChange } = this.$props
|
|
58
|
+
const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd } = this.$props
|
|
49
59
|
|
|
50
60
|
editor.registerPlugin(
|
|
51
61
|
DragHandlePlugin({
|
|
@@ -54,6 +64,8 @@ export const DragHandle = Vue.extend({
|
|
|
54
64
|
pluginKey,
|
|
55
65
|
computePositionConfig: { ...defaultComputePositionConfig, ...this.computePositionConfig },
|
|
56
66
|
onNodeChange,
|
|
67
|
+
onElementDragStart,
|
|
68
|
+
onElementDragEnd,
|
|
57
69
|
}).plugin,
|
|
58
70
|
)
|
|
59
71
|
},
|