@tiptap/extension-drag-handle-vue-2 3.30.3 → 3.30.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/index.cjs CHANGED
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
19
19
  }
20
20
  return to;
21
21
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
23
23
  value: mod,
24
24
  enumerable: true
25
25
  }) : target, mod));
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["VueDefault","dragHandlePluginDefaultKey","defaultComputePositionConfig"],"sources":["../src/Vue.ts","../src/DragHandle.ts","../src/index.ts"],"sourcesContent":["import type { VueConstructor } from 'vue'\nimport VueDefault from 'vue'\n\n// With nodenext module resolution, TypeScript treats the default import as the module type.\n// We need to explicitly type it as VueConstructor to access static methods like extend and observable.\n// This is necessary because Vue 2's type definitions export Vue as VueConstructor, but nodenext\n// doesn't correctly infer the default export type.\nexport const Vue: VueConstructor = VueDefault as unknown as VueConstructor\n","import type { Editor } from '@tiptap/core'\nimport {\n type DragHandlePluginProps,\n type NestedOptions,\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n normalizeNestedOptions,\n} from '@tiptap/extension-drag-handle'\nimport { type PropType } from 'vue'\n\nimport { Vue } from './Vue.js'\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type DragHandleProps = Omit<\n Optional<DragHandlePluginProps, 'pluginKey'>,\n 'element' | 'nestedOptions'\n> & {\n class?: string\n onNodeChange?: (data: { node: Node | null; editor: Editor; pos: number }) => void\n /**\n * Enable drag handles for nested content (list items, blockquotes, etc.).\n *\n * When enabled, the drag handle will appear for nested blocks, not just\n * top-level blocks. A rule-based scoring system determines which node\n * to target based on cursor position and configured rules.\n *\n * @default false\n */\n nested?: boolean | NestedOptions\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 nested: {\n type: [Boolean, Object] as PropType<DragHandleProps['nested']>,\n default: false,\n },\n },\n\n mounted() {\n const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd, nested } =\n this.$props\n\n const nestedOptions = normalizeNestedOptions(nested)\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 nestedOptions,\n }).plugin,\n )\n },\n\n // oxlint-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: Vue.CreateElement) {\n return h(\n 'div',\n {\n class: this.class,\n attrs: {\n 'data-dragging': 'false',\n },\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACiCA,MAAa,aD1BsBA,IAAAA,QC0BL,OAAO;CACnC,MAAM;CAEN,OAAO;EACL,WAAW;GACT,MAAM,CAAC,QAAQ,MAAM;GACrB,eAAeC,8BAAAA;EACjB;EAEA,QAAQ;GACN,MAAM;GACN,UAAU;EACZ;EAEA,uBAAuB;GACrB,MAAM;GACN,gBAAgB,CAAC;EACnB;EAEA,cAAc;GACZ,MAAM;GACN,SAAS;EACX;EAEA,oBAAoB;GAClB,MAAM;GACN,SAAS;EACX;EAEA,kBAAkB;GAChB,MAAM;GACN,SAAS;EACX;EAEA,OAAO;GACL,MAAM;GACN,SAAS;EACX;EAEA,QAAQ;GACN,MAAM,CAAC,SAAS,MAAM;GACtB,SAAS;EACX;CACF;CAEA,UAAU;EACR,MAAM,EAAE,QAAQ,WAAW,cAAc,oBAAoB,kBAAkB,WAC7E,KAAK;EAEP,MAAM,iBAAA,GAAA,8BAAA,uBAAA,CAAuC,MAAM;EAEnD,OAAO,gBAAA,GAAA,8BAAA,iBAAA,CACY;GACf;GACA,SAAS,KAAK;GACd;GACA,uBAAuB;IAAE,GAAGC,8BAAAA;IAA8B,GAAG,KAAK;GAAsB;GACxF;GACA;GACA;GACA;EACF,CAAC,CAAC,CAAC,MACL;CACF;CAGA,gBAAgB;EACd,MAAM,EAAE,WAAW,WAAW,KAAK;EAEnC,OAAO,iBAAiB,SAAmB;CAC7C;CAEA,OAAO,GAAsB;EAC3B,OAAO,EACL,OACA;GACE,OAAO,KAAK;GACZ,OAAO,EACL,iBAAiB,QACnB;EACF,GACA,KAAK,OAAO,OACd;CACF;AACF,CAAC;;;ACjHD,IAAA,cAAe"}
1
+ {"version":3,"file":"index.cjs","names":["VueDefault","dragHandlePluginDefaultKey","normalizeNestedOptions","DragHandlePlugin","defaultComputePositionConfig"],"sources":["../src/Vue.ts","../src/DragHandle.ts","../src/index.ts"],"sourcesContent":["import type { VueConstructor } from 'vue'\nimport VueDefault from 'vue'\n\n// With nodenext module resolution, TypeScript treats the default import as the module type.\n// We need to explicitly type it as VueConstructor to access static methods like extend and observable.\n// This is necessary because Vue 2's type definitions export Vue as VueConstructor, but nodenext\n// doesn't correctly infer the default export type.\nexport const Vue: VueConstructor = VueDefault as unknown as VueConstructor\n","import type { Editor } from '@tiptap/core'\nimport {\n type DragHandlePluginProps,\n type NestedOptions,\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n normalizeNestedOptions,\n} from '@tiptap/extension-drag-handle'\nimport { type PropType } from 'vue'\n\nimport { Vue } from './Vue.js'\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type DragHandleProps = Omit<\n Optional<DragHandlePluginProps, 'pluginKey'>,\n 'element' | 'nestedOptions'\n> & {\n class?: string\n onNodeChange?: (data: { node: Node | null; editor: Editor; pos: number }) => void\n /**\n * Enable drag handles for nested content (list items, blockquotes, etc.).\n *\n * When enabled, the drag handle will appear for nested blocks, not just\n * top-level blocks. A rule-based scoring system determines which node\n * to target based on cursor position and configured rules.\n *\n * @default false\n */\n nested?: boolean | NestedOptions\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 nested: {\n type: [Boolean, Object] as PropType<DragHandleProps['nested']>,\n default: false,\n },\n },\n\n mounted() {\n const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd, nested } =\n this.$props\n\n const nestedOptions = normalizeNestedOptions(nested)\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 nestedOptions,\n }).plugin,\n )\n },\n\n // oxlint-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: Vue.CreateElement) {\n return h(\n 'div',\n {\n class: this.class,\n attrs: {\n 'data-dragging': 'false',\n },\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACiCA,MAAa,aD1BsBA,IAAAA,QC0BL,OAAO;CACnC,MAAM;CAEN,OAAO;EACL,WAAW;GACT,MAAM,CAAC,QAAQ,MAAM;GACrB,eAAeC,8BAAAA;EACjB;EAEA,QAAQ;GACN,MAAM;GACN,UAAU;EACZ;EAEA,uBAAuB;GACrB,MAAM;GACN,gBAAgB,CAAC;EACnB;EAEA,cAAc;GACZ,MAAM;GACN,SAAS;EACX;EAEA,oBAAoB;GAClB,MAAM;GACN,SAAS;EACX;EAEA,kBAAkB;GAChB,MAAM;GACN,SAAS;EACX;EAEA,OAAO;GACL,MAAM;GACN,SAAS;EACX;EAEA,QAAQ;GACN,MAAM,CAAC,SAAS,MAAM;GACtB,SAAS;EACX;CACF;CAEA,UAAU;EACR,MAAM,EAAE,QAAQ,WAAW,cAAc,oBAAoB,kBAAkB,WAC7E,KAAK;EAEP,MAAM,iBAAA,GAAgBC,8BAAAA,uBAAAA,CAAuB,MAAM;EAEnD,OAAO,gBAAA,GACLC,8BAAAA,iBAAAA,CAAiB;GACf;GACA,SAAS,KAAK;GACd;GACA,uBAAuB;IAAE,GAAGC,8BAAAA;IAA8B,GAAG,KAAK;GAAsB;GACxF;GACA;GACA;GACA;EACF,CAAC,CAAC,CAAC,MACL;CACF;CAGA,gBAAgB;EACd,MAAM,EAAE,WAAW,WAAW,KAAK;EAEnC,OAAO,iBAAiB,SAAmB;CAC7C;CAEA,OAAO,GAAsB;EAC3B,OAAO,EACL,OACA;GACE,OAAO,KAAK;GACZ,OAAO,EACL,iBAAiB,QACnB;EACF,GACA,KAAK,OAAO,OACd;CACF;AACF,CAAC;;;ACjHD,IAAA,cAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiptap/extension-drag-handle-vue-2",
3
- "version": "3.30.3",
3
+ "version": "3.30.4",
4
4
  "description": "drag handle extension for tiptap with vue 2",
5
5
  "keywords": [
6
6
  "tiptap",
@@ -41,15 +41,15 @@
41
41
  "devDependencies": {
42
42
  "vue": "^2.0.0",
43
43
  "vue-ts-types": "1.6.2",
44
- "@tiptap/extension-drag-handle": "^3.30.3",
45
- "@tiptap/vue-2": "^3.30.3",
46
- "@tiptap/pm": "^3.30.3"
44
+ "@tiptap/extension-drag-handle": "^3.30.4",
45
+ "@tiptap/pm": "^3.30.4",
46
+ "@tiptap/vue-2": "^3.30.4"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "vue": "^2.0.0",
50
- "@tiptap/extension-drag-handle": "3.30.3",
51
- "@tiptap/pm": "3.30.3",
52
- "@tiptap/vue-2": "3.30.3"
50
+ "@tiptap/extension-drag-handle": "3.30.4",
51
+ "@tiptap/pm": "3.30.4",
52
+ "@tiptap/vue-2": "3.30.4"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "vp pack"