@tiptap/extension-drag-handle-vue-3 3.0.8 → 3.1.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 +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/DragHandle.ts +10 -1
package/dist/index.cjs
CHANGED
|
@@ -72,7 +72,15 @@ var DragHandle = (0, import_vue.defineComponent)({
|
|
|
72
72
|
});
|
|
73
73
|
return () => {
|
|
74
74
|
var _a;
|
|
75
|
-
return (0, import_vue.h)(
|
|
75
|
+
return (0, import_vue.h)(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
ref: root,
|
|
79
|
+
class: props.class,
|
|
80
|
+
style: { visibility: "hidden", position: "absolute" }
|
|
81
|
+
},
|
|
82
|
+
(_a = slots.default) == null ? void 0 : _a.call(slots)
|
|
83
|
+
);
|
|
76
84
|
};
|
|
77
85
|
}
|
|
78
86
|
});
|
package/dist/index.cjs.map
CHANGED
|
@@ -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 { DragHandlePluginProps } from '@tiptap/extension-drag-handle'\nimport {\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n} from '@tiptap/extension-drag-handle'\nimport type { Editor } from '@tiptap/vue-3'\nimport type { PropType } from 'vue'\nimport { defineComponent, h, onBeforeUnmount, onMounted, ref } 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 = defineComponent({\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 class: {\n type: String as PropType<DragHandleProps['class']>,\n default: 'drag-handle',\n },\n },\n\n setup(props, { slots }) {\n const root = ref<HTMLElement | null>(null)\n\n onMounted(() => {\n const { editor, pluginKey, onNodeChange, computePositionConfig } = props\n\n editor.registerPlugin(\n DragHandlePlugin({\n editor,\n element: root.value as HTMLElement,\n pluginKey,\n computePositionConfig: { ...defaultComputePositionConfig, ...computePositionConfig },\n onNodeChange,\n }).plugin,\n )\n })\n\n onBeforeUnmount(() => {\n const { pluginKey, editor } = props\n\n editor.unregisterPlugin(pluginKey as string)\n })\n\n return ()
|
|
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 { DragHandlePluginProps } from '@tiptap/extension-drag-handle'\nimport {\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n} from '@tiptap/extension-drag-handle'\nimport type { Editor } from '@tiptap/vue-3'\nimport type { PropType } from 'vue'\nimport { defineComponent, h, onBeforeUnmount, onMounted, ref } 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 = defineComponent({\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 class: {\n type: String as PropType<DragHandleProps['class']>,\n default: 'drag-handle',\n },\n },\n\n setup(props, { slots }) {\n const root = ref<HTMLElement | null>(null)\n\n onMounted(() => {\n const { editor, pluginKey, onNodeChange, computePositionConfig } = props\n\n editor.registerPlugin(\n DragHandlePlugin({\n editor,\n element: root.value as HTMLElement,\n pluginKey,\n computePositionConfig: { ...defaultComputePositionConfig, ...computePositionConfig },\n onNodeChange,\n }).plugin,\n )\n })\n\n onBeforeUnmount(() => {\n const { pluginKey, editor } = props\n\n editor.unregisterPlugin(pluginKey as string)\n })\n\n return () =>\n h(\n 'div',\n {\n ref: root,\n class: props.class,\n style: { visibility: 'hidden', position: 'absolute' },\n },\n slots.default?.(),\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mCAIO;AAGP,iBAAoE;AAS7D,IAAM,iBAAa,4BAAgB;AAAA,EACxC,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACX;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,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,MAAM,OAAO,EAAE,MAAM,GAAG;AACtB,UAAM,WAAO,gBAAwB,IAAI;AAEzC,8BAAU,MAAM;AACd,YAAM,EAAE,QAAQ,WAAW,cAAc,sBAAsB,IAAI;AAEnE,aAAO;AAAA,YACL,+CAAiB;AAAA,UACf;AAAA,UACA,SAAS,KAAK;AAAA,UACd;AAAA,UACA,uBAAuB,EAAE,GAAG,2DAA8B,GAAG,sBAAsB;AAAA,UACnF;AAAA,QACF,CAAC,EAAE;AAAA,MACL;AAAA,IACF,CAAC;AAED,oCAAgB,MAAM;AACpB,YAAM,EAAE,WAAW,OAAO,IAAI;AAE9B,aAAO,iBAAiB,SAAmB;AAAA,IAC7C,CAAC;AAED,WAAO,MAAG;AAtEd;AAuEM;AAAA,QACE;AAAA,QACA;AAAA,UACE,KAAK;AAAA,UACL,OAAO,MAAM;AAAA,UACb,OAAO,EAAE,YAAY,UAAU,UAAU,WAAW;AAAA,QACtD;AAAA,SACA,WAAM,YAAN;AAAA,MACF;AAAA;AAAA,EACJ;AACF,CAAC;;;AD7ED,IAAO,gBAAQ;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,15 @@ var DragHandle = defineComponent({
|
|
|
49
49
|
});
|
|
50
50
|
return () => {
|
|
51
51
|
var _a;
|
|
52
|
-
return h(
|
|
52
|
+
return h(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
ref: root,
|
|
56
|
+
class: props.class,
|
|
57
|
+
style: { visibility: "hidden", position: "absolute" }
|
|
58
|
+
},
|
|
59
|
+
(_a = slots.default) == null ? void 0 : _a.call(slots)
|
|
60
|
+
);
|
|
53
61
|
};
|
|
54
62
|
}
|
|
55
63
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/DragHandle.ts","../src/index.ts"],"sourcesContent":["import type { DragHandlePluginProps } from '@tiptap/extension-drag-handle'\nimport {\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n} from '@tiptap/extension-drag-handle'\nimport type { Editor } from '@tiptap/vue-3'\nimport type { PropType } from 'vue'\nimport { defineComponent, h, onBeforeUnmount, onMounted, ref } 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 = defineComponent({\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 class: {\n type: String as PropType<DragHandleProps['class']>,\n default: 'drag-handle',\n },\n },\n\n setup(props, { slots }) {\n const root = ref<HTMLElement | null>(null)\n\n onMounted(() => {\n const { editor, pluginKey, onNodeChange, computePositionConfig } = props\n\n editor.registerPlugin(\n DragHandlePlugin({\n editor,\n element: root.value as HTMLElement,\n pluginKey,\n computePositionConfig: { ...defaultComputePositionConfig, ...computePositionConfig },\n onNodeChange,\n }).plugin,\n )\n })\n\n onBeforeUnmount(() => {\n const { pluginKey, editor } = props\n\n editor.unregisterPlugin(pluginKey as string)\n })\n\n return ()
|
|
1
|
+
{"version":3,"sources":["../src/DragHandle.ts","../src/index.ts"],"sourcesContent":["import type { DragHandlePluginProps } from '@tiptap/extension-drag-handle'\nimport {\n defaultComputePositionConfig,\n DragHandlePlugin,\n dragHandlePluginDefaultKey,\n} from '@tiptap/extension-drag-handle'\nimport type { Editor } from '@tiptap/vue-3'\nimport type { PropType } from 'vue'\nimport { defineComponent, h, onBeforeUnmount, onMounted, ref } 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 = defineComponent({\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 class: {\n type: String as PropType<DragHandleProps['class']>,\n default: 'drag-handle',\n },\n },\n\n setup(props, { slots }) {\n const root = ref<HTMLElement | null>(null)\n\n onMounted(() => {\n const { editor, pluginKey, onNodeChange, computePositionConfig } = props\n\n editor.registerPlugin(\n DragHandlePlugin({\n editor,\n element: root.value as HTMLElement,\n pluginKey,\n computePositionConfig: { ...defaultComputePositionConfig, ...computePositionConfig },\n onNodeChange,\n }).plugin,\n )\n })\n\n onBeforeUnmount(() => {\n const { pluginKey, editor } = props\n\n editor.unregisterPlugin(pluginKey as string)\n })\n\n return () =>\n h(\n 'div',\n {\n ref: root,\n class: props.class,\n style: { visibility: 'hidden', position: 'absolute' },\n },\n slots.default?.(),\n )\n },\n})\n","import { DragHandle } from './DragHandle.js'\n\nexport * from './DragHandle.js'\n\nexport default DragHandle\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB,GAAG,iBAAiB,WAAW,WAAW;AAS7D,IAAM,aAAa,gBAAgB;AAAA,EACxC,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACX;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,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,MAAM,OAAO,EAAE,MAAM,GAAG;AACtB,UAAM,OAAO,IAAwB,IAAI;AAEzC,cAAU,MAAM;AACd,YAAM,EAAE,QAAQ,WAAW,cAAc,sBAAsB,IAAI;AAEnE,aAAO;AAAA,QACL,iBAAiB;AAAA,UACf;AAAA,UACA,SAAS,KAAK;AAAA,UACd;AAAA,UACA,uBAAuB,EAAE,GAAG,8BAA8B,GAAG,sBAAsB;AAAA,UACnF;AAAA,QACF,CAAC,EAAE;AAAA,MACL;AAAA,IACF,CAAC;AAED,oBAAgB,MAAM;AACpB,YAAM,EAAE,WAAW,OAAO,IAAI;AAE9B,aAAO,iBAAiB,SAAmB;AAAA,IAC7C,CAAC;AAED,WAAO,MAAG;AAtEd;AAuEM;AAAA,QACE;AAAA,QACA;AAAA,UACE,KAAK;AAAA,UACL,OAAO,MAAM;AAAA,UACb,OAAO,EAAE,YAAY,UAAU,UAAU,WAAW;AAAA,QACtD;AAAA,SACA,WAAM,YAAN;AAAA,MACF;AAAA;AAAA,EACJ;AACF,CAAC;;;AC7ED,IAAO,gBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-drag-handle-vue-3",
|
|
3
3
|
"description": "drag handle extension for tiptap with vue 3",
|
|
4
|
-
"version": "3.0
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"vue": "^3.0.0",
|
|
40
|
-
"@tiptap/extension-drag-handle": "^3.0
|
|
41
|
-
"@tiptap/pm": "^3.0
|
|
42
|
-
"@tiptap/vue-3": "^3.0
|
|
40
|
+
"@tiptap/extension-drag-handle": "^3.1.0",
|
|
41
|
+
"@tiptap/pm": "^3.1.0",
|
|
42
|
+
"@tiptap/vue-3": "^3.1.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"vue": "^3.0.0",
|
|
46
|
-
"@tiptap/extension-drag-handle": "^3.0
|
|
47
|
-
"@tiptap/pm": "^3.0
|
|
48
|
-
"@tiptap/vue-3": "^3.0
|
|
46
|
+
"@tiptap/extension-drag-handle": "^3.1.0",
|
|
47
|
+
"@tiptap/pm": "^3.1.0",
|
|
48
|
+
"@tiptap/vue-3": "^3.1.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup",
|
package/src/DragHandle.ts
CHANGED
|
@@ -68,6 +68,15 @@ export const DragHandle = defineComponent({
|
|
|
68
68
|
editor.unregisterPlugin(pluginKey as string)
|
|
69
69
|
})
|
|
70
70
|
|
|
71
|
-
return () =>
|
|
71
|
+
return () =>
|
|
72
|
+
h(
|
|
73
|
+
'div',
|
|
74
|
+
{
|
|
75
|
+
ref: root,
|
|
76
|
+
class: props.class,
|
|
77
|
+
style: { visibility: 'hidden', position: 'absolute' },
|
|
78
|
+
},
|
|
79
|
+
slots.default?.(),
|
|
80
|
+
)
|
|
72
81
|
},
|
|
73
82
|
})
|