@tiptap/extension-drag-handle-vue-2 3.10.6 → 3.10.8

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
@@ -37,8 +37,13 @@ module.exports = __toCommonJS(index_exports);
37
37
 
38
38
  // src/DragHandle.ts
39
39
  var import_extension_drag_handle = require("@tiptap/extension-drag-handle");
40
+
41
+ // src/Vue.ts
40
42
  var import_vue = __toESM(require("vue"), 1);
41
- var DragHandle = import_vue.default.extend({
43
+ var Vue = import_vue.default;
44
+
45
+ // src/DragHandle.ts
46
+ var DragHandle = Vue.extend({
42
47
  name: "DragHandleVue",
43
48
  props: {
44
49
  pluginKey: {
@@ -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 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"]}
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 defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\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'> & {\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: Vue.CreateElement) {\n return h(\n 'div',\n {\n class: this.class,\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,mCAKO;;;ACLP,iBAAuB;AAMhB,IAAM,MAAsB,WAAAA;;;ADW5B,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,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,GAAsB;AAC3B,WAAO;AAAA,MACL;AAAA,MACA;AAAA,QACE,OAAO,KAAK;AAAA,MACd;AAAA,MACA,KAAK,OAAO;AAAA,IACd;AAAA,EACF;AACF,CAAC;;;ADtFD,IAAO,gBAAQ;","names":["VueDefault"]}
package/dist/index.d.cts CHANGED
@@ -1,11 +1,10 @@
1
1
  import * as vue_types_vue from 'vue/types/vue';
2
- import * as Vue from 'vue';
3
- import Vue__default from 'vue';
4
- import { Node as Node$3 } from 'prosemirror-model';
5
- import { PluginKey as PluginKey$1 } from 'prosemirror-state';
6
- import { Plugin, PluginKey, Transaction, EditorState } from '@tiptap/pm/state';
7
- import { NodeType as NodeType$1, MarkType as MarkType$1, Node as Node$2, Fragment, ParseOptions, Schema, Slice, Mark as Mark$1, ResolvedPos, MarkSpec, DOMOutputSpec, NodeSpec } from '@tiptap/pm/model';
8
- import { EditorView, EditorProps, NodeViewConstructor, MarkViewConstructor, NodeView, MarkView } from '@tiptap/pm/view';
2
+ import * as prosemirror_model from 'prosemirror-model';
3
+ import * as prosemirror_state from 'prosemirror-state';
4
+ import * as vue from 'vue';
5
+ import { MarkType as MarkType$1, MarkSpec, Mark as Mark$1, DOMOutputSpec, NodeType as NodeType$1, NodeSpec, Node as Node$2, Slice, ParseOptions, Schema, ResolvedPos, Fragment } from '@tiptap/pm/model';
6
+ import { EditorState, Plugin, Transaction, PluginKey } from '@tiptap/pm/state';
7
+ import { EditorView, EditorProps, NodeView, MarkView, NodeViewConstructor, MarkViewConstructor } from '@tiptap/pm/view';
9
8
  import { Transform } from '@tiptap/pm/transform';
10
9
  import { DragHandlePluginProps } from '@tiptap/extension-drag-handle';
11
10
 
@@ -156,7 +155,7 @@ interface MarkConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
156
155
  storage: Storage;
157
156
  parent: ParentConfig<MarkConfig<Options, Storage>>['addAttributes'];
158
157
  editor?: Editor;
159
- }) => Attributes$1 | {};
158
+ }) => Attributes | {};
160
159
  }
161
160
  /**
162
161
  * The Mark class is used to create custom mark extensions.
@@ -453,7 +452,7 @@ interface NodeConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
453
452
  storage: Storage;
454
453
  parent: ParentConfig<NodeConfig<Options, Storage>>['addAttributes'];
455
454
  editor?: Editor;
456
- }) => Attributes$1 | {};
455
+ }) => Attributes | {};
457
456
  }
458
457
  /**
459
458
  * The Node class is used to create custom node extensions.
@@ -872,6 +871,7 @@ declare class Extendable<Options = any, Storage = any, Config = ExtensionConfig<
872
871
  configure(options?: Partial<Options>): Extendable<Options, Storage, ExtensionConfig<Options, Storage> | NodeConfig<Options, Storage> | MarkConfig<Options, Storage>>;
873
872
  extend<ExtendedOptions = Options, ExtendedStorage = Storage, ExtendedConfig = ExtensionConfig<ExtendedOptions, ExtendedStorage> | NodeConfig<ExtendedOptions, ExtendedStorage> | MarkConfig<ExtendedOptions, ExtendedStorage>>(extendedConfig?: Partial<ExtendedConfig>): Extendable<ExtendedOptions, ExtendedStorage>;
874
873
  }
874
+
875
875
  type AnyExtension = Extendable;
876
876
  type Extensions = AnyExtension[];
877
877
  type ParentConfig<T> = Partial<{
@@ -1261,17 +1261,71 @@ interface EditorOptions {
1261
1261
  */
1262
1262
  type HTMLContent = string;
1263
1263
  /**
1264
- * Loosely describes a JSON representation of a Prosemirror document or node
1264
+ * A Tiptap JSON node or document. Tiptap JSON is the standard format for
1265
+ * storing and manipulating Tiptap content. It is equivalent to the JSON
1266
+ * representation of a Prosemirror node.
1267
+ *
1268
+ * Tiptap JSON documents are trees of nodes. The root node is usually of type
1269
+ * `doc`. Nodes can have other nodes as children. Nodes can also have marks and
1270
+ * attributes. Text nodes (nodes with type `text`) have a `text` property and no
1271
+ * children.
1272
+ *
1273
+ * @example
1274
+ * ```ts
1275
+ * const content: JSONContent = {
1276
+ * type: 'doc',
1277
+ * content: [
1278
+ * {
1279
+ * type: 'paragraph',
1280
+ * content: [
1281
+ * {
1282
+ * type: 'text',
1283
+ * text: 'Hello ',
1284
+ * },
1285
+ * {
1286
+ * type: 'text',
1287
+ * text: 'world',
1288
+ * marks: [{ type: 'bold' }],
1289
+ * },
1290
+ * ],
1291
+ * },
1292
+ * ],
1293
+ * }
1294
+ * ```
1265
1295
  */
1266
1296
  type JSONContent = {
1297
+ /**
1298
+ * The type of the node
1299
+ */
1267
1300
  type?: string;
1301
+ /**
1302
+ * The attributes of the node. Attributes can have any JSON-serializable value.
1303
+ */
1268
1304
  attrs?: Record<string, any> | undefined;
1305
+ /**
1306
+ * The children of the node. A node can have other nodes as children.
1307
+ */
1269
1308
  content?: JSONContent[];
1309
+ /**
1310
+ * A list of marks of the node. Inline nodes can have marks.
1311
+ */
1270
1312
  marks?: {
1313
+ /**
1314
+ * The type of the mark
1315
+ */
1271
1316
  type: string;
1317
+ /**
1318
+ * The attributes of the mark. Attributes can have any JSON-serializable value.
1319
+ */
1272
1320
  attrs?: Record<string, any>;
1273
1321
  [key: string]: any;
1274
1322
  }[];
1323
+ /**
1324
+ * The text content of the node. This property is only present on text nodes
1325
+ * (i.e. nodes with `type: 'text'`).
1326
+ *
1327
+ * Text nodes cannot have children, but they can have marks.
1328
+ */
1275
1329
  text?: string;
1276
1330
  [key: string]: any;
1277
1331
  };
@@ -1333,7 +1387,7 @@ type Attribute = {
1333
1387
  keepOnSplit?: boolean;
1334
1388
  isRequired?: boolean;
1335
1389
  };
1336
- type Attributes$1 = {
1390
+ type Attributes = {
1337
1391
  [key: string]: Attribute;
1338
1392
  };
1339
1393
  type ExtensionAttribute = {
@@ -1484,7 +1538,6 @@ type MarkdownParseHelpers = {
1484
1538
  attrs?: any;
1485
1539
  };
1486
1540
  };
1487
-
1488
1541
  /**
1489
1542
  * Return shape for parser-level `parse` handlers.
1490
1543
  * - a single JSON-like node
@@ -1664,59 +1717,6 @@ declare class NodePos {
1664
1717
  }): void;
1665
1718
  }
1666
1719
 
1667
- interface InsertContentOptions {
1668
- /**
1669
- * Options for parsing the content.
1670
- */
1671
- parseOptions?: ParseOptions;
1672
- /**
1673
- * Whether to update the selection after inserting the content.
1674
- */
1675
- updateSelection?: boolean;
1676
- applyInputRules?: boolean;
1677
- applyPasteRules?: boolean;
1678
- }
1679
-
1680
- interface InsertContentAtOptions {
1681
- /**
1682
- * Options for parsing the content.
1683
- */
1684
- parseOptions?: ParseOptions;
1685
- /**
1686
- * Whether to update the selection after inserting the content.
1687
- */
1688
- updateSelection?: boolean;
1689
- /**
1690
- * Whether to apply input rules after inserting the content.
1691
- */
1692
- applyInputRules?: boolean;
1693
- /**
1694
- * Whether to apply paste rules after inserting the content.
1695
- */
1696
- applyPasteRules?: boolean;
1697
- /**
1698
- * Whether to throw an error if the content is invalid.
1699
- */
1700
- errorOnInvalidContent?: boolean;
1701
- }
1702
-
1703
- interface SetContentOptions {
1704
- /**
1705
- * Options for parsing the content.
1706
- * @default {}
1707
- */
1708
- parseOptions?: ParseOptions;
1709
- /**
1710
- * Whether to throw an error if the content is invalid.
1711
- */
1712
- errorOnInvalidContent?: boolean;
1713
- /**
1714
- * Whether to emit an update event.
1715
- * @default true
1716
- */
1717
- emitUpdate?: boolean;
1718
- }
1719
-
1720
1720
  declare module '@tiptap/core' {
1721
1721
  interface Commands<ReturnType> {
1722
1722
  blur: {
@@ -1954,6 +1954,19 @@ declare module '@tiptap/core' {
1954
1954
  };
1955
1955
  }
1956
1956
  }
1957
+
1958
+ interface InsertContentOptions {
1959
+ /**
1960
+ * Options for parsing the content.
1961
+ */
1962
+ parseOptions?: ParseOptions;
1963
+ /**
1964
+ * Whether to update the selection after inserting the content.
1965
+ */
1966
+ updateSelection?: boolean;
1967
+ applyInputRules?: boolean;
1968
+ applyPasteRules?: boolean;
1969
+ }
1957
1970
  declare module '@tiptap/core' {
1958
1971
  interface Commands<ReturnType> {
1959
1972
  insertContent: {
@@ -1974,6 +1987,29 @@ declare module '@tiptap/core' {
1974
1987
  };
1975
1988
  }
1976
1989
  }
1990
+
1991
+ interface InsertContentAtOptions {
1992
+ /**
1993
+ * Options for parsing the content.
1994
+ */
1995
+ parseOptions?: ParseOptions;
1996
+ /**
1997
+ * Whether to update the selection after inserting the content.
1998
+ */
1999
+ updateSelection?: boolean;
2000
+ /**
2001
+ * Whether to apply input rules after inserting the content.
2002
+ */
2003
+ applyInputRules?: boolean;
2004
+ /**
2005
+ * Whether to apply paste rules after inserting the content.
2006
+ */
2007
+ applyPasteRules?: boolean;
2008
+ /**
2009
+ * Whether to throw an error if the content is invalid.
2010
+ */
2011
+ errorOnInvalidContent?: boolean;
2012
+ }
1977
2013
  declare module '@tiptap/core' {
1978
2014
  interface Commands<ReturnType> {
1979
2015
  insertContentAt: {
@@ -2243,6 +2279,23 @@ declare module '@tiptap/core' {
2243
2279
  };
2244
2280
  }
2245
2281
  }
2282
+
2283
+ interface SetContentOptions {
2284
+ /**
2285
+ * Options for parsing the content.
2286
+ * @default {}
2287
+ */
2288
+ parseOptions?: ParseOptions;
2289
+ /**
2290
+ * Whether to throw an error if the content is invalid.
2291
+ */
2292
+ errorOnInvalidContent?: boolean;
2293
+ /**
2294
+ * Whether to emit an update event.
2295
+ * @default true
2296
+ */
2297
+ emitUpdate?: boolean;
2298
+ }
2246
2299
  declare module '@tiptap/core' {
2247
2300
  interface Commands<ReturnType> {
2248
2301
  setContent: {
@@ -2545,6 +2598,7 @@ declare module '@tiptap/core' {
2545
2598
  };
2546
2599
  }
2547
2600
  }
2601
+
2548
2602
  declare class Editor extends EventEmitter<EditorEvents> {
2549
2603
  private commandManager;
2550
2604
  extensionManager: ExtensionManager;
@@ -2730,13 +2784,13 @@ type DragHandleProps = Omit<Optional<DragHandlePluginProps, 'pluginKey'>, 'eleme
2730
2784
  pos: number;
2731
2785
  }) => void;
2732
2786
  };
2733
- declare const DragHandle: vue_types_vue.ExtendedVue<Vue__default<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue__default>, unknown, unknown, unknown, {
2734
- pluginKey: string | PluginKey$1<any> | undefined;
2787
+ declare const DragHandle: vue_types_vue.ExtendedVue<vue.default<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => vue.default>, unknown, unknown, unknown, {
2788
+ pluginKey: string | prosemirror_state.PluginKey<any> | undefined;
2735
2789
  editor: Editor;
2736
2790
  computePositionConfig: {} | undefined;
2737
2791
  onNodeChange: (((data: {
2738
2792
  editor: Editor;
2739
- node: Node$3 | null;
2793
+ node: prosemirror_model.Node | null;
2740
2794
  pos: number;
2741
2795
  }) => void) & ((data: {
2742
2796
  node: Node | null;
@@ -2746,6 +2800,6 @@ declare const DragHandle: vue_types_vue.ExtendedVue<Vue__default<Record<string,
2746
2800
  onElementDragStart: ((e: DragEvent) => void) | undefined;
2747
2801
  onElementDragEnd: ((e: DragEvent) => void) | undefined;
2748
2802
  class: string | undefined;
2749
- }, {}, Vue.ComponentOptionsMixin, Vue.ComponentOptionsMixin>;
2803
+ }, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin>;
2750
2804
 
2751
2805
  export { DragHandle, type DragHandleProps, DragHandle as default };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import * as vue_types_vue from 'vue/types/vue';
2
- import * as Vue from 'vue';
3
- import Vue__default from 'vue';
4
- import { Node as Node$3 } from 'prosemirror-model';
5
- import { PluginKey as PluginKey$1 } from 'prosemirror-state';
6
- import { Plugin, PluginKey, Transaction, EditorState } from '@tiptap/pm/state';
7
- import { NodeType as NodeType$1, MarkType as MarkType$1, Node as Node$2, Fragment, ParseOptions, Schema, Slice, Mark as Mark$1, ResolvedPos, MarkSpec, DOMOutputSpec, NodeSpec } from '@tiptap/pm/model';
8
- import { EditorView, EditorProps, NodeViewConstructor, MarkViewConstructor, NodeView, MarkView } from '@tiptap/pm/view';
2
+ import * as prosemirror_model from 'prosemirror-model';
3
+ import * as prosemirror_state from 'prosemirror-state';
4
+ import * as vue from 'vue';
5
+ import { MarkType as MarkType$1, MarkSpec, Mark as Mark$1, DOMOutputSpec, NodeType as NodeType$1, NodeSpec, Node as Node$2, Slice, ParseOptions, Schema, ResolvedPos, Fragment } from '@tiptap/pm/model';
6
+ import { EditorState, Plugin, Transaction, PluginKey } from '@tiptap/pm/state';
7
+ import { EditorView, EditorProps, NodeView, MarkView, NodeViewConstructor, MarkViewConstructor } from '@tiptap/pm/view';
9
8
  import { Transform } from '@tiptap/pm/transform';
10
9
  import { DragHandlePluginProps } from '@tiptap/extension-drag-handle';
11
10
 
@@ -156,7 +155,7 @@ interface MarkConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
156
155
  storage: Storage;
157
156
  parent: ParentConfig<MarkConfig<Options, Storage>>['addAttributes'];
158
157
  editor?: Editor;
159
- }) => Attributes$1 | {};
158
+ }) => Attributes | {};
160
159
  }
161
160
  /**
162
161
  * The Mark class is used to create custom mark extensions.
@@ -453,7 +452,7 @@ interface NodeConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
453
452
  storage: Storage;
454
453
  parent: ParentConfig<NodeConfig<Options, Storage>>['addAttributes'];
455
454
  editor?: Editor;
456
- }) => Attributes$1 | {};
455
+ }) => Attributes | {};
457
456
  }
458
457
  /**
459
458
  * The Node class is used to create custom node extensions.
@@ -872,6 +871,7 @@ declare class Extendable<Options = any, Storage = any, Config = ExtensionConfig<
872
871
  configure(options?: Partial<Options>): Extendable<Options, Storage, ExtensionConfig<Options, Storage> | NodeConfig<Options, Storage> | MarkConfig<Options, Storage>>;
873
872
  extend<ExtendedOptions = Options, ExtendedStorage = Storage, ExtendedConfig = ExtensionConfig<ExtendedOptions, ExtendedStorage> | NodeConfig<ExtendedOptions, ExtendedStorage> | MarkConfig<ExtendedOptions, ExtendedStorage>>(extendedConfig?: Partial<ExtendedConfig>): Extendable<ExtendedOptions, ExtendedStorage>;
874
873
  }
874
+
875
875
  type AnyExtension = Extendable;
876
876
  type Extensions = AnyExtension[];
877
877
  type ParentConfig<T> = Partial<{
@@ -1261,17 +1261,71 @@ interface EditorOptions {
1261
1261
  */
1262
1262
  type HTMLContent = string;
1263
1263
  /**
1264
- * Loosely describes a JSON representation of a Prosemirror document or node
1264
+ * A Tiptap JSON node or document. Tiptap JSON is the standard format for
1265
+ * storing and manipulating Tiptap content. It is equivalent to the JSON
1266
+ * representation of a Prosemirror node.
1267
+ *
1268
+ * Tiptap JSON documents are trees of nodes. The root node is usually of type
1269
+ * `doc`. Nodes can have other nodes as children. Nodes can also have marks and
1270
+ * attributes. Text nodes (nodes with type `text`) have a `text` property and no
1271
+ * children.
1272
+ *
1273
+ * @example
1274
+ * ```ts
1275
+ * const content: JSONContent = {
1276
+ * type: 'doc',
1277
+ * content: [
1278
+ * {
1279
+ * type: 'paragraph',
1280
+ * content: [
1281
+ * {
1282
+ * type: 'text',
1283
+ * text: 'Hello ',
1284
+ * },
1285
+ * {
1286
+ * type: 'text',
1287
+ * text: 'world',
1288
+ * marks: [{ type: 'bold' }],
1289
+ * },
1290
+ * ],
1291
+ * },
1292
+ * ],
1293
+ * }
1294
+ * ```
1265
1295
  */
1266
1296
  type JSONContent = {
1297
+ /**
1298
+ * The type of the node
1299
+ */
1267
1300
  type?: string;
1301
+ /**
1302
+ * The attributes of the node. Attributes can have any JSON-serializable value.
1303
+ */
1268
1304
  attrs?: Record<string, any> | undefined;
1305
+ /**
1306
+ * The children of the node. A node can have other nodes as children.
1307
+ */
1269
1308
  content?: JSONContent[];
1309
+ /**
1310
+ * A list of marks of the node. Inline nodes can have marks.
1311
+ */
1270
1312
  marks?: {
1313
+ /**
1314
+ * The type of the mark
1315
+ */
1271
1316
  type: string;
1317
+ /**
1318
+ * The attributes of the mark. Attributes can have any JSON-serializable value.
1319
+ */
1272
1320
  attrs?: Record<string, any>;
1273
1321
  [key: string]: any;
1274
1322
  }[];
1323
+ /**
1324
+ * The text content of the node. This property is only present on text nodes
1325
+ * (i.e. nodes with `type: 'text'`).
1326
+ *
1327
+ * Text nodes cannot have children, but they can have marks.
1328
+ */
1275
1329
  text?: string;
1276
1330
  [key: string]: any;
1277
1331
  };
@@ -1333,7 +1387,7 @@ type Attribute = {
1333
1387
  keepOnSplit?: boolean;
1334
1388
  isRequired?: boolean;
1335
1389
  };
1336
- type Attributes$1 = {
1390
+ type Attributes = {
1337
1391
  [key: string]: Attribute;
1338
1392
  };
1339
1393
  type ExtensionAttribute = {
@@ -1484,7 +1538,6 @@ type MarkdownParseHelpers = {
1484
1538
  attrs?: any;
1485
1539
  };
1486
1540
  };
1487
-
1488
1541
  /**
1489
1542
  * Return shape for parser-level `parse` handlers.
1490
1543
  * - a single JSON-like node
@@ -1664,59 +1717,6 @@ declare class NodePos {
1664
1717
  }): void;
1665
1718
  }
1666
1719
 
1667
- interface InsertContentOptions {
1668
- /**
1669
- * Options for parsing the content.
1670
- */
1671
- parseOptions?: ParseOptions;
1672
- /**
1673
- * Whether to update the selection after inserting the content.
1674
- */
1675
- updateSelection?: boolean;
1676
- applyInputRules?: boolean;
1677
- applyPasteRules?: boolean;
1678
- }
1679
-
1680
- interface InsertContentAtOptions {
1681
- /**
1682
- * Options for parsing the content.
1683
- */
1684
- parseOptions?: ParseOptions;
1685
- /**
1686
- * Whether to update the selection after inserting the content.
1687
- */
1688
- updateSelection?: boolean;
1689
- /**
1690
- * Whether to apply input rules after inserting the content.
1691
- */
1692
- applyInputRules?: boolean;
1693
- /**
1694
- * Whether to apply paste rules after inserting the content.
1695
- */
1696
- applyPasteRules?: boolean;
1697
- /**
1698
- * Whether to throw an error if the content is invalid.
1699
- */
1700
- errorOnInvalidContent?: boolean;
1701
- }
1702
-
1703
- interface SetContentOptions {
1704
- /**
1705
- * Options for parsing the content.
1706
- * @default {}
1707
- */
1708
- parseOptions?: ParseOptions;
1709
- /**
1710
- * Whether to throw an error if the content is invalid.
1711
- */
1712
- errorOnInvalidContent?: boolean;
1713
- /**
1714
- * Whether to emit an update event.
1715
- * @default true
1716
- */
1717
- emitUpdate?: boolean;
1718
- }
1719
-
1720
1720
  declare module '@tiptap/core' {
1721
1721
  interface Commands<ReturnType> {
1722
1722
  blur: {
@@ -1954,6 +1954,19 @@ declare module '@tiptap/core' {
1954
1954
  };
1955
1955
  }
1956
1956
  }
1957
+
1958
+ interface InsertContentOptions {
1959
+ /**
1960
+ * Options for parsing the content.
1961
+ */
1962
+ parseOptions?: ParseOptions;
1963
+ /**
1964
+ * Whether to update the selection after inserting the content.
1965
+ */
1966
+ updateSelection?: boolean;
1967
+ applyInputRules?: boolean;
1968
+ applyPasteRules?: boolean;
1969
+ }
1957
1970
  declare module '@tiptap/core' {
1958
1971
  interface Commands<ReturnType> {
1959
1972
  insertContent: {
@@ -1974,6 +1987,29 @@ declare module '@tiptap/core' {
1974
1987
  };
1975
1988
  }
1976
1989
  }
1990
+
1991
+ interface InsertContentAtOptions {
1992
+ /**
1993
+ * Options for parsing the content.
1994
+ */
1995
+ parseOptions?: ParseOptions;
1996
+ /**
1997
+ * Whether to update the selection after inserting the content.
1998
+ */
1999
+ updateSelection?: boolean;
2000
+ /**
2001
+ * Whether to apply input rules after inserting the content.
2002
+ */
2003
+ applyInputRules?: boolean;
2004
+ /**
2005
+ * Whether to apply paste rules after inserting the content.
2006
+ */
2007
+ applyPasteRules?: boolean;
2008
+ /**
2009
+ * Whether to throw an error if the content is invalid.
2010
+ */
2011
+ errorOnInvalidContent?: boolean;
2012
+ }
1977
2013
  declare module '@tiptap/core' {
1978
2014
  interface Commands<ReturnType> {
1979
2015
  insertContentAt: {
@@ -2243,6 +2279,23 @@ declare module '@tiptap/core' {
2243
2279
  };
2244
2280
  }
2245
2281
  }
2282
+
2283
+ interface SetContentOptions {
2284
+ /**
2285
+ * Options for parsing the content.
2286
+ * @default {}
2287
+ */
2288
+ parseOptions?: ParseOptions;
2289
+ /**
2290
+ * Whether to throw an error if the content is invalid.
2291
+ */
2292
+ errorOnInvalidContent?: boolean;
2293
+ /**
2294
+ * Whether to emit an update event.
2295
+ * @default true
2296
+ */
2297
+ emitUpdate?: boolean;
2298
+ }
2246
2299
  declare module '@tiptap/core' {
2247
2300
  interface Commands<ReturnType> {
2248
2301
  setContent: {
@@ -2545,6 +2598,7 @@ declare module '@tiptap/core' {
2545
2598
  };
2546
2599
  }
2547
2600
  }
2601
+
2548
2602
  declare class Editor extends EventEmitter<EditorEvents> {
2549
2603
  private commandManager;
2550
2604
  extensionManager: ExtensionManager;
@@ -2730,13 +2784,13 @@ type DragHandleProps = Omit<Optional<DragHandlePluginProps, 'pluginKey'>, 'eleme
2730
2784
  pos: number;
2731
2785
  }) => void;
2732
2786
  };
2733
- declare const DragHandle: vue_types_vue.ExtendedVue<Vue__default<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue__default>, unknown, unknown, unknown, {
2734
- pluginKey: string | PluginKey$1<any> | undefined;
2787
+ declare const DragHandle: vue_types_vue.ExtendedVue<vue.default<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => vue.default>, unknown, unknown, unknown, {
2788
+ pluginKey: string | prosemirror_state.PluginKey<any> | undefined;
2735
2789
  editor: Editor;
2736
2790
  computePositionConfig: {} | undefined;
2737
2791
  onNodeChange: (((data: {
2738
2792
  editor: Editor;
2739
- node: Node$3 | null;
2793
+ node: prosemirror_model.Node | null;
2740
2794
  pos: number;
2741
2795
  }) => void) & ((data: {
2742
2796
  node: Node | null;
@@ -2746,6 +2800,6 @@ declare const DragHandle: vue_types_vue.ExtendedVue<Vue__default<Record<string,
2746
2800
  onElementDragStart: ((e: DragEvent) => void) | undefined;
2747
2801
  onElementDragEnd: ((e: DragEvent) => void) | undefined;
2748
2802
  class: string | undefined;
2749
- }, {}, Vue.ComponentOptionsMixin, Vue.ComponentOptionsMixin>;
2803
+ }, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin>;
2750
2804
 
2751
2805
  export { DragHandle, type DragHandleProps, DragHandle as default };
package/dist/index.js CHANGED
@@ -4,7 +4,12 @@ import {
4
4
  DragHandlePlugin,
5
5
  dragHandlePluginDefaultKey
6
6
  } from "@tiptap/extension-drag-handle";
7
- import Vue from "vue";
7
+
8
+ // src/Vue.ts
9
+ import VueDefault from "vue";
10
+ var Vue = VueDefault;
11
+
12
+ // src/DragHandle.ts
8
13
  var DragHandle = Vue.extend({
9
14
  name: "DragHandleVue",
10
15
  props: {
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 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":[]}
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 defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\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'> & {\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: Vue.CreateElement) {\n return h(\n 'div',\n {\n class: this.class,\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,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACLP,OAAO,gBAAgB;AAMhB,IAAM,MAAsB;;;ADW5B,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,GAAsB;AAC3B,WAAO;AAAA,MACL;AAAA,MACA;AAAA,QACE,OAAO,KAAK;AAAA,MACd;AAAA,MACA,KAAK,OAAO;AAAA,IACd;AAAA,EACF;AACF,CAAC;;;AEtFD,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.10.6",
4
+ "version": "3.10.8",
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.10.6",
41
- "@tiptap/pm": "^3.10.6",
42
- "@tiptap/vue-2": "^3.10.6"
40
+ "@tiptap/extension-drag-handle": "^3.10.8",
41
+ "@tiptap/pm": "^3.10.8",
42
+ "@tiptap/vue-2": "^3.10.8"
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.10.6",
48
- "@tiptap/pm": "^3.10.6",
49
- "@tiptap/vue-2": "^3.10.6"
47
+ "@tiptap/extension-drag-handle": "^3.10.8",
48
+ "@tiptap/pm": "^3.10.8",
49
+ "@tiptap/vue-2": "^3.10.8"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsup",
package/src/DragHandle.ts CHANGED
@@ -5,7 +5,9 @@ import {
5
5
  DragHandlePlugin,
6
6
  dragHandlePluginDefaultKey,
7
7
  } from '@tiptap/extension-drag-handle'
8
- import Vue, { type PropType } from 'vue'
8
+ import { type PropType } from 'vue'
9
+
10
+ import { Vue } from './Vue.js'
9
11
 
10
12
  type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>
11
13
 
@@ -77,7 +79,7 @@ export const DragHandle = Vue.extend({
77
79
  editor.unregisterPlugin(pluginKey as string)
78
80
  },
79
81
 
80
- render(h) {
82
+ render(h: Vue.CreateElement) {
81
83
  return h(
82
84
  'div',
83
85
  {
package/src/Vue.ts ADDED
@@ -0,0 +1,8 @@
1
+ import type { VueConstructor } from 'vue'
2
+ import VueDefault from 'vue'
3
+
4
+ // With nodenext module resolution, TypeScript treats the default import as the module type.
5
+ // We need to explicitly type it as VueConstructor to access static methods like extend and observable.
6
+ // This is necessary because Vue 2's type definitions export Vue as VueConstructor, but nodenext
7
+ // doesn't correctly infer the default export type.
8
+ export const Vue: VueConstructor = VueDefault as unknown as VueConstructor