@tiptap/extension-drag-handle-vue-2 3.23.6 → 3.25.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
@@ -95,7 +95,7 @@ var DragHandle = Vue.extend({
95
95
  }).plugin
96
96
  );
97
97
  },
98
- // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle
98
+ // oxlint-disable-next-line vue/no-deprecated-destroyed-lifecycle
99
99
  beforeDestroy() {
100
100
  const { pluginKey, editor } = this.$props;
101
101
  editor.unregisterPlugin(pluginKey);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/DragHandle.ts","../src/Vue.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 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<Optional<DragHandlePluginProps, 'pluginKey'>, 'element' | 'nestedOptions'> & {\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 } = 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 // 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: 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 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mCAOO;;;ACPP,iBAAuB;AAMhB,IAAM,MAAsB,WAAAA;;;ADuB5B,IAAM,aAAa,IAAI,OAAO;AAAA,EACnC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OAAO;AAAA,IACd;AAAA,EACF;AACF,CAAC;;;AD7GD,IAAO,gBAAQ;","names":["VueDefault"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/DragHandle.ts","../src/Vue.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 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 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mCAOO;;;ACPP,iBAAuB;AAMhB,IAAM,MAAsB,WAAAA;;;AD0B5B,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,IAEA,QAAQ;AAAA,MACN,MAAM,CAAC,SAAS,MAAM;AAAA,MACtB,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,UAAU;AACR,UAAM,EAAE,QAAQ,WAAW,cAAc,oBAAoB,kBAAkB,OAAO,IACpF,KAAK;AAEP,UAAM,oBAAgB,qDAAuB,MAAM;AAEnD,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,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,GAAsB;AAC3B,WAAO;AAAA,MACL;AAAA,MACA;AAAA,QACE,OAAO,KAAK;AAAA,QACZ,OAAO;AAAA,UACL,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,KAAK,OAAO;AAAA,IACd;AAAA,EACF;AACF,CAAC;;;ADjHD,IAAO,gBAAQ;","names":["VueDefault"]}
package/dist/index.d.cts CHANGED
@@ -69,6 +69,12 @@ interface MarkConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
69
69
  * Keep mark after split node
70
70
  */
71
71
  keepOnSplit?: boolean | (() => boolean);
72
+ /**
73
+ * Whether this mark is removed by `unsetAllMarks`.
74
+ * Set to `false` for semantic marks (comments, suggestions) that should survive "clear formatting".
75
+ * @default true
76
+ */
77
+ clearable?: boolean | (() => boolean);
72
78
  /**
73
79
  * Inclusive
74
80
  */
@@ -1818,6 +1824,7 @@ declare class ExtensionManager {
1818
1824
  */
1819
1825
  baseExtensions: Extensions;
1820
1826
  splittableMarks: string[];
1827
+ nonClearableMarks: string[];
1821
1828
  constructor(extensions: Extensions, editor: Editor);
1822
1829
  static resolve: typeof resolveExtensions;
1823
1830
  static sort: typeof sortExtensions;
@@ -2737,10 +2744,15 @@ declare module '@tiptap/core' {
2737
2744
  interface Commands<ReturnType> {
2738
2745
  unsetAllMarks: {
2739
2746
  /**
2740
- * Remove all marks in the current selection.
2747
+ * Remove all clearable marks in the current selection.
2748
+ * Marks with `clearable: false` are preserved
2749
+ * @param options.ignoreClearable If true, removes all marks regardless of `clearable` setting. Defaults to `false`.
2741
2750
  * @example editor.commands.unsetAllMarks()
2751
+ * @example editor.commands.unsetAllMarks({ ignoreClearable: true })
2742
2752
  */
2743
- unsetAllMarks: () => ReturnType;
2753
+ unsetAllMarks: (options?: {
2754
+ ignoreClearable?: boolean;
2755
+ }) => ReturnType;
2744
2756
  };
2745
2757
  }
2746
2758
  }
package/dist/index.d.ts CHANGED
@@ -69,6 +69,12 @@ interface MarkConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
69
69
  * Keep mark after split node
70
70
  */
71
71
  keepOnSplit?: boolean | (() => boolean);
72
+ /**
73
+ * Whether this mark is removed by `unsetAllMarks`.
74
+ * Set to `false` for semantic marks (comments, suggestions) that should survive "clear formatting".
75
+ * @default true
76
+ */
77
+ clearable?: boolean | (() => boolean);
72
78
  /**
73
79
  * Inclusive
74
80
  */
@@ -1818,6 +1824,7 @@ declare class ExtensionManager {
1818
1824
  */
1819
1825
  baseExtensions: Extensions;
1820
1826
  splittableMarks: string[];
1827
+ nonClearableMarks: string[];
1821
1828
  constructor(extensions: Extensions, editor: Editor);
1822
1829
  static resolve: typeof resolveExtensions;
1823
1830
  static sort: typeof sortExtensions;
@@ -2737,10 +2744,15 @@ declare module '@tiptap/core' {
2737
2744
  interface Commands<ReturnType> {
2738
2745
  unsetAllMarks: {
2739
2746
  /**
2740
- * Remove all marks in the current selection.
2747
+ * Remove all clearable marks in the current selection.
2748
+ * Marks with `clearable: false` are preserved
2749
+ * @param options.ignoreClearable If true, removes all marks regardless of `clearable` setting. Defaults to `false`.
2741
2750
  * @example editor.commands.unsetAllMarks()
2751
+ * @example editor.commands.unsetAllMarks({ ignoreClearable: true })
2742
2752
  */
2743
- unsetAllMarks: () => ReturnType;
2753
+ unsetAllMarks: (options?: {
2754
+ ignoreClearable?: boolean;
2755
+ }) => ReturnType;
2744
2756
  };
2745
2757
  }
2746
2758
  }
package/dist/index.js CHANGED
@@ -63,7 +63,7 @@ var DragHandle = Vue.extend({
63
63
  }).plugin
64
64
  );
65
65
  },
66
- // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle
66
+ // oxlint-disable-next-line vue/no-deprecated-destroyed-lifecycle
67
67
  beforeDestroy() {
68
68
  const { pluginKey, editor } = this.$props;
69
69
  editor.unregisterPlugin(pluginKey);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/DragHandle.ts","../src/Vue.ts","../src/index.ts"],"sourcesContent":["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<Optional<DragHandlePluginProps, 'pluginKey'>, 'element' | 'nestedOptions'> & {\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 } = 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 // 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: 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 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 { DragHandle } from './DragHandle.js'\n\nexport * from './DragHandle.js'\n\nexport default DragHandle\n"],"mappings":";AACA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACPP,OAAO,gBAAgB;AAMhB,IAAM,MAAsB;;;ADuB5B,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,IAEA,QAAQ;AAAA,MACN,MAAM,CAAC,SAAS,MAAM;AAAA,MACtB,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,UAAU;AACR,UAAM,EAAE,QAAQ,WAAW,cAAc,oBAAoB,kBAAkB,OAAO,IAAI,KAAK;AAE/F,UAAM,gBAAgB,uBAAuB,MAAM;AAEnD,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,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,GAAsB;AAC3B,WAAO;AAAA,MACL;AAAA,MACA;AAAA,QACE,OAAO,KAAK;AAAA,QACZ,OAAO;AAAA,UACL,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,KAAK,OAAO;AAAA,IACd;AAAA,EACF;AACF,CAAC;;;AE7GD,IAAO,gBAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/DragHandle.ts","../src/Vue.ts","../src/index.ts"],"sourcesContent":["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 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 { DragHandle } from './DragHandle.js'\n\nexport * from './DragHandle.js'\n\nexport default DragHandle\n"],"mappings":";AACA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACPP,OAAO,gBAAgB;AAMhB,IAAM,MAAsB;;;AD0B5B,IAAM,aAAa,IAAI,OAAO;AAAA,EACnC,MAAM;AAAA,EAEN,OAAO;AAAA,I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AAC;;;AEjHD,IAAO,gBAAQ;","names":[]}
package/package.json CHANGED
@@ -1,23 +1,30 @@
1
1
  {
2
2
  "name": "@tiptap/extension-drag-handle-vue-2",
3
+ "version": "3.25.0",
3
4
  "description": "drag handle extension for tiptap with vue 2",
4
- "version": "3.23.6",
5
- "homepage": "https://tiptap.dev",
6
5
  "keywords": [
7
6
  "tiptap",
8
7
  "tiptap extension"
9
8
  ],
9
+ "homepage": "https://tiptap.dev",
10
10
  "license": "MIT",
11
- "funding": {
12
- "type": "github",
13
- "url": "https://github.com/sponsors/ueberdosis"
14
- },
15
11
  "repository": {
16
12
  "type": "git",
17
13
  "url": "https://github.com/ueberdosis/tiptap",
18
14
  "directory": "packages/extension-drag-handle-vue-2"
19
15
  },
16
+ "funding": {
17
+ "type": "github",
18
+ "url": "https://github.com/sponsors/ueberdosis"
19
+ },
20
+ "files": [
21
+ "src",
22
+ "dist"
23
+ ],
20
24
  "type": "module",
25
+ "main": "dist/index.cjs",
26
+ "module": "dist/index.js",
27
+ "types": "dist/index.d.ts",
21
28
  "exports": {
22
29
  ".": {
23
30
  "types": {
@@ -28,28 +35,20 @@
28
35
  "require": "./dist/index.cjs"
29
36
  }
30
37
  },
31
- "main": "dist/index.cjs",
32
- "module": "dist/index.js",
33
- "types": "dist/index.d.ts",
34
- "files": [
35
- "src",
36
- "dist"
37
- ],
38
- "peerDependencies": {
39
- "vue": "^2.0.0",
40
- "@tiptap/extension-drag-handle": "3.23.6",
41
- "@tiptap/pm": "3.23.6",
42
- "@tiptap/vue-2": "3.23.6"
43
- },
44
38
  "devDependencies": {
45
39
  "vue": "^2.0.0",
46
40
  "vue-ts-types": "1.6.2",
47
- "@tiptap/extension-drag-handle": "^3.23.6",
48
- "@tiptap/vue-2": "^3.23.6",
49
- "@tiptap/pm": "^3.23.6"
41
+ "@tiptap/extension-drag-handle": "^3.25.0",
42
+ "@tiptap/pm": "^3.25.0",
43
+ "@tiptap/vue-2": "^3.25.0"
44
+ },
45
+ "peerDependencies": {
46
+ "vue": "^2.0.0",
47
+ "@tiptap/extension-drag-handle": "3.25.0",
48
+ "@tiptap/vue-2": "3.25.0",
49
+ "@tiptap/pm": "3.25.0"
50
50
  },
51
51
  "scripts": {
52
- "build": "tsup",
53
- "lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
52
+ "build": "tsup"
54
53
  }
55
54
  }
package/src/DragHandle.ts CHANGED
@@ -13,7 +13,10 @@ import { Vue } from './Vue.js'
13
13
 
14
14
  type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>
15
15
 
16
- export type DragHandleProps = Omit<Optional<DragHandlePluginProps, 'pluginKey'>, 'element' | 'nestedOptions'> & {
16
+ export type DragHandleProps = Omit<
17
+ Optional<DragHandlePluginProps, 'pluginKey'>,
18
+ 'element' | 'nestedOptions'
19
+ > & {
17
20
  class?: string
18
21
  onNodeChange?: (data: { node: Node | null; editor: Editor; pos: number }) => void
19
22
  /**
@@ -74,7 +77,8 @@ export const DragHandle = Vue.extend({
74
77
  },
75
78
 
76
79
  mounted() {
77
- const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd, nested } = this.$props
80
+ const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd, nested } =
81
+ this.$props
78
82
 
79
83
  const nestedOptions = normalizeNestedOptions(nested)
80
84
 
@@ -92,7 +96,7 @@ export const DragHandle = Vue.extend({
92
96
  )
93
97
  },
94
98
 
95
- // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle
99
+ // oxlint-disable-next-line vue/no-deprecated-destroyed-lifecycle
96
100
  beforeDestroy() {
97
101
  const { pluginKey, editor } = this.$props
98
102