@tiptap/extension-drag-handle-vue-2 3.20.2 → 3.20.3
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/package.json +7 -7
- package/dist/index.cjs +0 -123
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -3006
- package/dist/index.d.ts +0 -3006
- package/dist/index.js +0 -91
- package/dist/index.js.map +0 -1
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.20.
|
|
4
|
+
"version": "3.20.3",
|
|
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/
|
|
41
|
-
"@tiptap/
|
|
42
|
-
"@tiptap/vue-2": "^3.20.
|
|
40
|
+
"@tiptap/pm": "^3.20.3",
|
|
41
|
+
"@tiptap/extension-drag-handle": "^3.20.3",
|
|
42
|
+
"@tiptap/vue-2": "^3.20.3"
|
|
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.20.
|
|
48
|
-
"@tiptap/pm": "^3.20.
|
|
49
|
-
"@tiptap/vue-2": "^3.20.
|
|
47
|
+
"@tiptap/extension-drag-handle": "^3.20.3",
|
|
48
|
+
"@tiptap/pm": "^3.20.3",
|
|
49
|
+
"@tiptap/vue-2": "^3.20.3"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup",
|
package/dist/index.cjs
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
DragHandle: () => DragHandle,
|
|
34
|
-
default: () => index_default
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(index_exports);
|
|
37
|
-
|
|
38
|
-
// src/DragHandle.ts
|
|
39
|
-
var import_extension_drag_handle = require("@tiptap/extension-drag-handle");
|
|
40
|
-
|
|
41
|
-
// src/Vue.ts
|
|
42
|
-
var import_vue = __toESM(require("vue"), 1);
|
|
43
|
-
var Vue = import_vue.default;
|
|
44
|
-
|
|
45
|
-
// src/DragHandle.ts
|
|
46
|
-
var DragHandle = Vue.extend({
|
|
47
|
-
name: "DragHandleVue",
|
|
48
|
-
props: {
|
|
49
|
-
pluginKey: {
|
|
50
|
-
type: [String, Object],
|
|
51
|
-
default: () => import_extension_drag_handle.dragHandlePluginDefaultKey
|
|
52
|
-
},
|
|
53
|
-
editor: {
|
|
54
|
-
type: Object,
|
|
55
|
-
required: true
|
|
56
|
-
},
|
|
57
|
-
computePositionConfig: {
|
|
58
|
-
type: Object,
|
|
59
|
-
default: () => ({})
|
|
60
|
-
},
|
|
61
|
-
onNodeChange: {
|
|
62
|
-
type: Function,
|
|
63
|
-
default: null
|
|
64
|
-
},
|
|
65
|
-
onElementDragStart: {
|
|
66
|
-
type: Function,
|
|
67
|
-
default: null
|
|
68
|
-
},
|
|
69
|
-
onElementDragEnd: {
|
|
70
|
-
type: Function,
|
|
71
|
-
default: null
|
|
72
|
-
},
|
|
73
|
-
class: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: "drag-handle"
|
|
76
|
-
},
|
|
77
|
-
nested: {
|
|
78
|
-
type: [Boolean, Object],
|
|
79
|
-
default: false
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
mounted() {
|
|
83
|
-
const { editor, pluginKey, onNodeChange, onElementDragStart, onElementDragEnd, nested } = this.$props;
|
|
84
|
-
const nestedOptions = (0, import_extension_drag_handle.normalizeNestedOptions)(nested);
|
|
85
|
-
editor.registerPlugin(
|
|
86
|
-
(0, import_extension_drag_handle.DragHandlePlugin)({
|
|
87
|
-
editor,
|
|
88
|
-
element: this.$el,
|
|
89
|
-
pluginKey,
|
|
90
|
-
computePositionConfig: { ...import_extension_drag_handle.defaultComputePositionConfig, ...this.computePositionConfig },
|
|
91
|
-
onNodeChange,
|
|
92
|
-
onElementDragStart,
|
|
93
|
-
onElementDragEnd,
|
|
94
|
-
nestedOptions
|
|
95
|
-
}).plugin
|
|
96
|
-
);
|
|
97
|
-
},
|
|
98
|
-
// eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle
|
|
99
|
-
beforeDestroy() {
|
|
100
|
-
const { pluginKey, editor } = this.$props;
|
|
101
|
-
editor.unregisterPlugin(pluginKey);
|
|
102
|
-
},
|
|
103
|
-
render(h) {
|
|
104
|
-
return h(
|
|
105
|
-
"div",
|
|
106
|
-
{
|
|
107
|
-
class: this.class,
|
|
108
|
-
attrs: {
|
|
109
|
-
"data-dragging": "false"
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
this.$slots.default
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
// src/index.ts
|
|
118
|
-
var index_default = DragHandle;
|
|
119
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
-
0 && (module.exports = {
|
|
121
|
-
DragHandle
|
|
122
|
-
});
|
|
123
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,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,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;;;AD7GD,IAAO,gBAAQ;","names":["VueDefault"]}
|