@tiptap/extension-drag-handle-vue-2 2.26.3 → 2.27.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 CHANGED
@@ -14,7 +14,7 @@ const DragHandle = Vue__default.default.extend({
14
14
  props: {
15
15
  pluginKey: {
16
16
  type: [String, Object],
17
- default: extensionDragHandle.dragHandlePluginDefaultKey,
17
+ default: () => extensionDragHandle.dragHandlePluginDefaultKey,
18
18
  },
19
19
  editor: {
20
20
  type: Object,
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/DragHandle.ts"],"sourcesContent":["import { Editor } from '@tiptap/core'\nimport {\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n DragHandlePluginProps,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { 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 tippyOptions: {\n type: Object as PropType<DragHandleProps['tippyOptions']>,\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 {\n editor,\n pluginKey,\n onNodeChange,\n tippyOptions,\n } = this.$props\n\n editor.registerPlugin(DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n tippyOptions,\n onNodeChange,\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('div', {\n class: this.class,\n }, this.$slots.default)\n },\n})\n"],"names":["Vue","dragHandlePluginDefaultKey","DragHandlePlugin"],"mappings":";;;;;;;;;;;AAea,MAAA,UAAU,GAAGA,oBAAG,CAAC,MAAM,CAAC;AACnC,IAAA,IAAI,EAAE,eAAe;AAErB,IAAA,KAAK,EAAE;AACL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAA2C;AAChE,YAAA,OAAO,EAAEC,8CAA0B;AACpC,SAAA;AAED,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA6C;AACnD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAmD;AACzD,YAAA,OAAO,EAAE,OAAO,EAAE,CAAC;AACpB,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,QAAqD;AAC3D,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AAED,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA4C;AAClD,YAAA,OAAO,EAAE,aAAa;AACvB,SAAA;AACF,KAAA;IAED,OAAO,GAAA;AACL,QAAA,MAAM,EACJ,MAAM,EACN,SAAS,EACT,YAAY,EACZ,YAAY,GACb,GAAG,IAAI,CAAC,MAAM;AAEf,QAAA,MAAM,CAAC,cAAc,CAACC,oCAAgB,CAAC;YACrC,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,GAAkB;YAChC,SAAS;YACT,YAAY;YACZ,YAAY;AACb,SAAA,CAAC,CAAC;KACJ;;IAGD,aAAa,GAAA;QACX,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM;AAEzC,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAmB,CAAC;KAC7C;AAED,IAAA,MAAM,CAAC,CAAC,EAAA;QACN,OAAO,CAAC,CAAC,KAAK,EAAE;YACd,KAAK,EAAE,IAAI,CAAC,KAAK;AAClB,SAAA,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;KACxB;AACF,CAAA;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/DragHandle.ts"],"sourcesContent":["import { Editor } from '@tiptap/core'\nimport {\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n DragHandlePluginProps,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { 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 tippyOptions: {\n type: Object as PropType<DragHandleProps['tippyOptions']>,\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 {\n editor,\n pluginKey,\n onNodeChange,\n tippyOptions,\n } = this.$props\n\n editor.registerPlugin(DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n tippyOptions,\n onNodeChange,\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('div', {\n class: this.class,\n }, this.$slots.default)\n },\n})\n"],"names":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,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;KACxB;AACF,CAAA;;;;;"}
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ const DragHandle = Vue.extend({
6
6
  props: {
7
7
  pluginKey: {
8
8
  type: [String, Object],
9
- default: dragHandlePluginDefaultKey,
9
+ default: () => dragHandlePluginDefaultKey,
10
10
  },
11
11
  editor: {
12
12
  type: Object,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/DragHandle.ts"],"sourcesContent":["import { Editor } from '@tiptap/core'\nimport {\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n DragHandlePluginProps,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { 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 tippyOptions: {\n type: Object as PropType<DragHandleProps['tippyOptions']>,\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 {\n editor,\n pluginKey,\n onNodeChange,\n tippyOptions,\n } = this.$props\n\n editor.registerPlugin(DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n tippyOptions,\n onNodeChange,\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('div', {\n class: this.class,\n }, this.$slots.default)\n },\n})\n"],"names":[],"mappings":";;;AAea,MAAA,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC;AACnC,IAAA,IAAI,EAAE,eAAe;AAErB,IAAA,KAAK,EAAE;AACL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAA2C;AAChE,YAAA,OAAO,EAAE,0BAA0B;AACpC,SAAA;AAED,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA6C;AACnD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAmD;AACzD,YAAA,OAAO,EAAE,OAAO,EAAE,CAAC;AACpB,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,QAAqD;AAC3D,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AAED,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA4C;AAClD,YAAA,OAAO,EAAE,aAAa;AACvB,SAAA;AACF,KAAA;IAED,OAAO,GAAA;AACL,QAAA,MAAM,EACJ,MAAM,EACN,SAAS,EACT,YAAY,EACZ,YAAY,GACb,GAAG,IAAI,CAAC,MAAM;AAEf,QAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;YACrC,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,GAAkB;YAChC,SAAS;YACT,YAAY;YACZ,YAAY;AACb,SAAA,CAAC,CAAC;KACJ;;IAGD,aAAa,GAAA;QACX,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM;AAEzC,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAmB,CAAC;KAC7C;AAED,IAAA,MAAM,CAAC,CAAC,EAAA;QACN,OAAO,CAAC,CAAC,KAAK,EAAE;YACd,KAAK,EAAE,IAAI,CAAC,KAAK;AAClB,SAAA,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;KACxB;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/DragHandle.ts"],"sourcesContent":["import { Editor } from '@tiptap/core'\nimport {\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n DragHandlePluginProps,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { 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 tippyOptions: {\n type: Object as PropType<DragHandleProps['tippyOptions']>,\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 {\n editor,\n pluginKey,\n onNodeChange,\n tippyOptions,\n } = this.$props\n\n editor.registerPlugin(DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n tippyOptions,\n onNodeChange,\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('div', {\n class: this.class,\n }, this.$slots.default)\n },\n})\n"],"names":[],"mappings":";;;AAea,MAAA,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC;AACnC,IAAA,IAAI,EAAE,eAAe;AAErB,IAAA,KAAK,EAAE;AACL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAA2C;AAChE,YAAA,OAAO,EAAE,MAAM,0BAA0B;AAC1C,SAAA;AAED,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA6C;AACnD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAAmD;AACzD,YAAA,OAAO,EAAE,OAAO,EAAE,CAAC;AACpB,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,QAAqD;AAC3D,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AAED,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA4C;AAClD,YAAA,OAAO,EAAE,aAAa;AACvB,SAAA;AACF,KAAA;IAED,OAAO,GAAA;AACL,QAAA,MAAM,EACJ,MAAM,EACN,SAAS,EACT,YAAY,EACZ,YAAY,GACb,GAAG,IAAI,CAAC,MAAM;AAEf,QAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;YACrC,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,GAAkB;YAChC,SAAS;YACT,YAAY;YACZ,YAAY;AACb,SAAA,CAAC,CAAC;KACJ;;IAGD,aAAa,GAAA;QACX,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM;AAEzC,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAmB,CAAC;KAC7C;AAED,IAAA,MAAM,CAAC,CAAC,EAAA;QACN,OAAO,CAAC,CAAC,KAAK,EAAE;YACd,KAAK,EAAE,IAAI,CAAC,KAAK;AAClB,SAAA,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;KACxB;AACF,CAAA;;;;"}
package/dist/index.umd.js CHANGED
@@ -9,7 +9,7 @@
9
9
  props: {
10
10
  pluginKey: {
11
11
  type: [String, Object],
12
- default: extensionDragHandle.dragHandlePluginDefaultKey,
12
+ default: () => extensionDragHandle.dragHandlePluginDefaultKey,
13
13
  },
14
14
  editor: {
15
15
  type: Object,
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/DragHandle.ts"],"sourcesContent":["import { Editor } from '@tiptap/core'\nimport {\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n DragHandlePluginProps,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { 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 tippyOptions: {\n type: Object as PropType<DragHandleProps['tippyOptions']>,\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 {\n editor,\n pluginKey,\n onNodeChange,\n tippyOptions,\n } = this.$props\n\n editor.registerPlugin(DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n tippyOptions,\n onNodeChange,\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('div', {\n class: this.class,\n }, this.$slots.default)\n },\n})\n"],"names":["dragHandlePluginDefaultKey","DragHandlePlugin"],"mappings":";;;;;;AAea,QAAA,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC;EACnC,IAAA,IAAI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editor } from '@tiptap/core'\nimport {\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n DragHandlePluginProps,\n} from '@tiptap/extension-drag-handle'\nimport Vue, { 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 tippyOptions: {\n type: Object as PropType<DragHandleProps['tippyOptions']>,\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 {\n editor,\n pluginKey,\n onNodeChange,\n tippyOptions,\n } = this.$props\n\n editor.registerPlugin(DragHandlePlugin({\n editor,\n element: this.$el as HTMLElement,\n pluginKey,\n tippyOptions,\n onNodeChange,\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('div', {\n class: this.class,\n }, this.$slots.default)\n },\n})\n"],"names":["dragHandlePluginDefaultKey","DragHandlePlugin"],"mappings":";;;;;;AAea,QAAA,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC;EACnC,IAAA,IAAI,EAAE,eAAe;EAErB,IAAA,KAAK,EAAE;EACL,QAAA,SAAS,EAAE;EACT,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAA2C;EAChE,YAAA,OAAO,EAAE,MAAMA,8CAA0B;EAC1C,SAAA;EAED,QAAA,MAAM,EAAE;EACN,YAAA,IAAI,EAAE,MAA6C;EACnD,YAAA,QAAQ,EAAE,IAAI;EACf,SAAA;EAED,QAAA,YAAY,EAAE;EACZ,YAAA,IAAI,EAAE,MAAmD;EACzD,YAAA,OAAO,EAAE,OAAO,EAAE,CAAC;EACpB,SAAA;EAED,QAAA,YAAY,EAAE;EACZ,YAAA,IAAI,EAAE,QAAqD;EAC3D,YAAA,OAAO,EAAE,IAAI;EACd,SAAA;EAED,QAAA,KAAK,EAAE;EACL,YAAA,IAAI,EAAE,MAA4C;EAClD,YAAA,OAAO,EAAE,aAAa;EACvB,SAAA;EACF,KAAA;MAED,OAAO,GAAA;EACL,QAAA,MAAM,EACJ,MAAM,EACN,SAAS,EACT,YAAY,EACZ,YAAY,GACb,GAAG,IAAI,CAAC,MAAM;EAEf,QAAA,MAAM,CAAC,cAAc,CAACC,oCAAgB,CAAC;cACrC,MAAM;cACN,OAAO,EAAE,IAAI,CAAC,GAAkB;cAChC,SAAS;cACT,YAAY;cACZ,YAAY;EACb,SAAA,CAAC,CAAC;OACJ;;MAGD,aAAa,GAAA;UACX,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM;EAEzC,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAmB,CAAC;OAC7C;EAED,IAAA,MAAM,CAAC,CAAC,EAAA;UACN,OAAO,CAAC,CAAC,KAAK,EAAE;cACd,KAAK,EAAE,IAAI,CAAC,KAAK;EAClB,SAAA,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;OACxB;EACF,CAAA;;;;;;;;;;;"}
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": "2.26.3",
4
+ "version": "2.27.0",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -40,9 +40,9 @@
40
40
  "vue": "^2.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@tiptap/extension-drag-handle": "^2.26.3",
44
- "@tiptap/pm": "^2.26.3",
45
- "@tiptap/vue-2": "^2.26.3",
43
+ "@tiptap/extension-drag-handle": "^2.27.0",
44
+ "@tiptap/pm": "^2.27.0",
45
+ "@tiptap/vue-2": "^2.27.0",
46
46
  "vue": "^2.0.0",
47
47
  "vue-ts-types": "1.6.2"
48
48
  },
package/src/DragHandle.ts CHANGED
@@ -19,7 +19,7 @@ export const DragHandle = Vue.extend({
19
19
  props: {
20
20
  pluginKey: {
21
21
  type: [String, Object] as PropType<DragHandleProps['pluginKey']>,
22
- default: dragHandlePluginDefaultKey,
22
+ default: () => dragHandlePluginDefaultKey,
23
23
  },
24
24
 
25
25
  editor: {