dn-react-text-editor 0.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.
Files changed (48) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +222 -0
  3. package/dist/attach_file.d.mts +28 -0
  4. package/dist/attach_file.d.ts +28 -0
  5. package/dist/attach_file.js +169 -0
  6. package/dist/attach_file.mjs +144 -0
  7. package/dist/cn.d.mts +3 -0
  8. package/dist/cn.d.ts +3 -0
  9. package/dist/cn.js +32 -0
  10. package/dist/cn.mjs +7 -0
  11. package/dist/index.d.mts +9 -0
  12. package/dist/index.d.ts +9 -0
  13. package/dist/index.js +735 -0
  14. package/dist/index.mjs +698 -0
  15. package/dist/plugins/drag_and_drop.d.mts +12 -0
  16. package/dist/plugins/drag_and_drop.d.ts +12 -0
  17. package/dist/plugins/drag_and_drop.js +57 -0
  18. package/dist/plugins/drag_and_drop.mjs +32 -0
  19. package/dist/plugins/keymap.d.mts +6 -0
  20. package/dist/plugins/keymap.d.ts +6 -0
  21. package/dist/plugins/keymap.js +59 -0
  22. package/dist/plugins/keymap.mjs +34 -0
  23. package/dist/plugins/placehoder.d.mts +5 -0
  24. package/dist/plugins/placehoder.d.ts +5 -0
  25. package/dist/plugins/placehoder.js +114 -0
  26. package/dist/plugins/placehoder.mjs +89 -0
  27. package/dist/plugins/trailing_paragraph.d.mts +5 -0
  28. package/dist/plugins/trailing_paragraph.d.ts +5 -0
  29. package/dist/plugins/trailing_paragraph.js +46 -0
  30. package/dist/plugins/trailing_paragraph.mjs +21 -0
  31. package/dist/plugins/upload_placeholder.d.mts +7 -0
  32. package/dist/plugins/upload_placeholder.d.ts +7 -0
  33. package/dist/plugins/upload_placeholder.js +94 -0
  34. package/dist/plugins/upload_placeholder.mjs +68 -0
  35. package/dist/prosemirror/index.d.mts +7 -0
  36. package/dist/prosemirror/index.d.ts +7 -0
  37. package/dist/prosemirror/index.js +36 -0
  38. package/dist/prosemirror/index.mjs +8 -0
  39. package/dist/schema.d.mts +7 -0
  40. package/dist/schema.d.ts +7 -0
  41. package/dist/schema.js +286 -0
  42. package/dist/schema.mjs +261 -0
  43. package/dist/text_editor.d.mts +36 -0
  44. package/dist/text_editor.d.ts +36 -0
  45. package/dist/text_editor.js +729 -0
  46. package/dist/text_editor.mjs +696 -0
  47. package/package.json +56 -0
  48. package/tsup.config.ts +10 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,698 @@
1
+ // src/text_editor.tsx
2
+ import React from "react";
3
+ import {
4
+ EditorState as EditorState2
5
+ } from "prosemirror-state";
6
+ import { EditorView as EditorView3 } from "prosemirror-view";
7
+ import { useEffect, useRef } from "react";
8
+ import { baseKeymap } from "prosemirror-commands";
9
+ import { keymap } from "prosemirror-keymap";
10
+
11
+ // src/plugins/drag_and_drop.tsx
12
+ import { Plugin } from "prosemirror-state";
13
+ function dragAndDropPlugin({ attachFile }) {
14
+ return new Plugin({
15
+ props: {
16
+ handleDOMEvents: {
17
+ drop(view, event) {
18
+ const files = event.dataTransfer?.files;
19
+ if (!files || files.length === 0) {
20
+ return;
21
+ }
22
+ event.preventDefault();
23
+ const pos = view.state.selection.$from.pos || view.posAtCoords({
24
+ left: event.clientX,
25
+ top: event.clientY
26
+ })?.pos || null;
27
+ if (pos === null) {
28
+ return;
29
+ }
30
+ const medias = Array.from(files).filter(
31
+ (file) => file.type.startsWith("image/") || file.type.startsWith("video/")
32
+ );
33
+ attachFile(view, medias);
34
+ return true;
35
+ }
36
+ }
37
+ }
38
+ });
39
+ }
40
+
41
+ // src/plugins/upload_placeholder.tsx
42
+ import { Plugin as Plugin2 } from "prosemirror-state";
43
+ import { Decoration, DecorationSet } from "prosemirror-view";
44
+ var uploadPlaceholderPlugin = new Plugin2({
45
+ state: {
46
+ init() {
47
+ return DecorationSet.empty;
48
+ },
49
+ apply(tr, set) {
50
+ set = set.map(tr.mapping, tr.doc);
51
+ const action = tr.getMeta(this);
52
+ if (action && action.add) {
53
+ const { type, width, height } = action.add;
54
+ const widget = document.createElement("div");
55
+ widget.className = "upload-placeholder";
56
+ widget.style.width = `100%`;
57
+ if (type.startsWith("image/") || type.startsWith("video/")) {
58
+ widget.style.aspectRatio = `${width} / ${height}`;
59
+ widget.style.maxWidth = `${width}px`;
60
+ } else {
61
+ widget.style.height = "80px";
62
+ }
63
+ const progress = document.createElement("div");
64
+ progress.className = "upload-progress";
65
+ widget.appendChild(progress);
66
+ const deco = Decoration.widget(action.add.pos, widget, {
67
+ id: action.add.id
68
+ });
69
+ set = set.add(tr.doc, [deco]);
70
+ } else if (action && action.progress) {
71
+ const found = set.find(
72
+ void 0,
73
+ void 0,
74
+ (spec) => spec.id === action.progress.id
75
+ );
76
+ if (found.length) {
77
+ const widget = found[0].type.toDOM;
78
+ const progress = widget.querySelector(".upload-progress");
79
+ if (progress) {
80
+ progress.innerHTML = `${Math.round(action.progress.progress)}%`;
81
+ }
82
+ }
83
+ } else if (action && action.remove) {
84
+ set = set.remove(
85
+ set.find(void 0, void 0, (spec) => spec.id === action.remove.id)
86
+ );
87
+ }
88
+ return set;
89
+ }
90
+ },
91
+ props: {
92
+ decorations(state) {
93
+ return this.getState(state);
94
+ }
95
+ }
96
+ });
97
+ var findPlaceholder = (state, id) => {
98
+ const decos = uploadPlaceholderPlugin.getState(state);
99
+ if (!decos) {
100
+ return null;
101
+ }
102
+ const found = decos.find(void 0, void 0, (spec) => spec.id === id);
103
+ return found.length ? found[0].from : null;
104
+ };
105
+
106
+ // src/plugins/placehoder.tsx
107
+ import "prosemirror-model";
108
+ import { Plugin as Plugin3 } from "prosemirror-state";
109
+ import "prosemirror-view";
110
+ var getFirstChildDescendants = (view) => {
111
+ const nodes = [];
112
+ view.state.doc?.descendants((n) => {
113
+ nodes.push(n);
114
+ });
115
+ return nodes;
116
+ };
117
+ function placeholderPlugin(text) {
118
+ const update = (view) => {
119
+ const decos = uploadPlaceholderPlugin.getState(view.state);
120
+ if (decos && decos.find().length > 0 || view.state.doc.content.content.some((e) => e.type.name !== "paragraph") || view.state.doc.childCount > 1 || getFirstChildDescendants(view).length > 1 || view.state.doc.textContent) {
121
+ view.dom.removeAttribute("data-placeholder");
122
+ } else {
123
+ view.dom.setAttribute("data-placeholder", text);
124
+ }
125
+ };
126
+ return new Plugin3({
127
+ view(view) {
128
+ update(view);
129
+ return { update };
130
+ }
131
+ });
132
+ }
133
+
134
+ // src/text_editor.tsx
135
+ import { DOMSerializer, DOMParser } from "prosemirror-model";
136
+ import { history } from "prosemirror-history";
137
+
138
+ // src/plugins/keymap.tsx
139
+ import { undo, redo } from "prosemirror-history";
140
+ import { chainCommands, splitBlockAs } from "prosemirror-commands";
141
+ import { splitListItem } from "prosemirror-schema-list";
142
+ function buildKeymap(schema) {
143
+ const keys = {};
144
+ function bind(key, cmd) {
145
+ keys[key] = cmd;
146
+ }
147
+ bind("Mod-z", undo);
148
+ bind("Shift-Mod-z", redo);
149
+ bind("Mod-y", redo);
150
+ const li = schema.nodes.list_item;
151
+ bind(
152
+ "Enter",
153
+ chainCommands(splitListItem(li), (state, dispatch) => {
154
+ const { $head } = state.selection;
155
+ if ($head.parent.type === state.schema.nodes.paragraph) {
156
+ splitBlockAs((n) => {
157
+ return {
158
+ type: n.type,
159
+ attrs: n.attrs
160
+ };
161
+ })(state, dispatch);
162
+ return true;
163
+ }
164
+ return false;
165
+ })
166
+ );
167
+ return keys;
168
+ }
169
+
170
+ // src/schema.tsx
171
+ import { Schema } from "prosemirror-model";
172
+ import { addListNodes } from "prosemirror-schema-list";
173
+ function createSchema() {
174
+ const customSchema = new Schema({
175
+ nodes: {
176
+ doc: { content: "block+" },
177
+ paragraph: {
178
+ attrs: { align: { default: null } },
179
+ content: "inline*",
180
+ group: "block",
181
+ parseDOM: [
182
+ {
183
+ tag: "p",
184
+ getAttrs(dom) {
185
+ return {
186
+ align: dom.style.textAlign || null
187
+ };
188
+ }
189
+ }
190
+ ],
191
+ toDOM(node) {
192
+ return [
193
+ "p",
194
+ {
195
+ style: node.attrs.align ? `text-align: ${node.attrs.align}` : null
196
+ },
197
+ 0
198
+ ];
199
+ }
200
+ },
201
+ text: {
202
+ group: "inline"
203
+ },
204
+ hard_break: {
205
+ inline: true,
206
+ group: "inline",
207
+ selectable: false,
208
+ parseDOM: [{ tag: "br" }],
209
+ toDOM() {
210
+ return ["br"];
211
+ }
212
+ },
213
+ heading: {
214
+ attrs: { level: { default: 1 }, align: { default: null } },
215
+ content: "inline*",
216
+ group: "block",
217
+ defining: true,
218
+ parseDOM: [
219
+ {
220
+ tag: "h1",
221
+ getAttrs(node) {
222
+ return {
223
+ level: 1,
224
+ algin: node.style.textAlign || null
225
+ };
226
+ }
227
+ },
228
+ {
229
+ tag: "h2",
230
+ getAttrs(node) {
231
+ return {
232
+ level: 2,
233
+ algin: node.style.textAlign || null
234
+ };
235
+ }
236
+ },
237
+ {
238
+ tag: "h3",
239
+ getAttrs(node) {
240
+ return {
241
+ level: 3,
242
+ algin: node.style.textAlign || null
243
+ };
244
+ }
245
+ },
246
+ {
247
+ tag: "h4",
248
+ getAttrs(node) {
249
+ return {
250
+ level: 4,
251
+ algin: node.style.textAlign || null
252
+ };
253
+ }
254
+ },
255
+ {
256
+ tag: "h5",
257
+ getAttrs(node) {
258
+ return {
259
+ level: 5,
260
+ algin: node.style.textAlign || null
261
+ };
262
+ }
263
+ },
264
+ {
265
+ tag: "h6",
266
+ getAttrs(node) {
267
+ return {
268
+ level: 6,
269
+ algin: node.style.textAlign || null
270
+ };
271
+ }
272
+ }
273
+ ],
274
+ toDOM(node) {
275
+ return [
276
+ "h" + node.attrs.level,
277
+ {
278
+ id: node.textContent.toLowerCase().replace(/\s+/g, "-"),
279
+ style: node.attrs.align ? `text-align: ${node.attrs.align};` : null
280
+ },
281
+ 0
282
+ ];
283
+ }
284
+ },
285
+ horizontal_rule: {
286
+ group: "block",
287
+ parseDOM: [{ tag: "hr" }],
288
+ toDOM() {
289
+ return ["hr"];
290
+ }
291
+ },
292
+ image: {
293
+ attrs: {
294
+ src: { validate: "string" },
295
+ alt: { default: null, validate: "string|null" },
296
+ title: {
297
+ default: null,
298
+ validate: "string|null"
299
+ },
300
+ width: {
301
+ default: null,
302
+ validate: "number|null"
303
+ },
304
+ height: {
305
+ default: null,
306
+ validate: "number|null"
307
+ }
308
+ },
309
+ inline: false,
310
+ group: "block",
311
+ draggable: true,
312
+ parseDOM: [
313
+ {
314
+ tag: "img",
315
+ getAttrs(dom) {
316
+ return {
317
+ src: dom.getAttribute("src"),
318
+ alt: dom.getAttribute("alt"),
319
+ width: dom.getAttribute("width"),
320
+ height: dom.getAttribute("height")
321
+ };
322
+ }
323
+ }
324
+ ],
325
+ toDOM(node) {
326
+ const { src, alt, srcSet, sizes, width, height } = node.attrs;
327
+ return [
328
+ "img",
329
+ {
330
+ src,
331
+ alt,
332
+ srcSet,
333
+ sizes,
334
+ width,
335
+ height
336
+ }
337
+ ];
338
+ }
339
+ }
340
+ },
341
+ marks: {
342
+ link: {
343
+ attrs: {
344
+ href: { default: "" },
345
+ title: { default: null }
346
+ },
347
+ inclusive: false,
348
+ parseDOM: [
349
+ {
350
+ tag: "a[href]",
351
+ getAttrs(dom) {
352
+ return {
353
+ href: dom.getAttribute("href"),
354
+ title: dom.getAttribute("title")
355
+ };
356
+ }
357
+ }
358
+ ],
359
+ toDOM(node) {
360
+ const { href, title } = node.attrs;
361
+ const target = "_blank";
362
+ const rel = "noopener noreferrer";
363
+ return [
364
+ "a",
365
+ { href, title: title || href, target, rel },
366
+ 0
367
+ ];
368
+ }
369
+ },
370
+ bold: {
371
+ parseDOM: [
372
+ { tag: "strong" },
373
+ {
374
+ tag: "b",
375
+ getAttrs: (node) => node.style.fontWeight != "normal" && null
376
+ },
377
+ {
378
+ style: "font-weight=400",
379
+ clearMark: (m) => m.type.name == "strong"
380
+ },
381
+ {
382
+ style: "font-weight",
383
+ getAttrs: (value) => /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null
384
+ }
385
+ ],
386
+ toDOM() {
387
+ return ["strong", 0];
388
+ }
389
+ },
390
+ italic: {
391
+ parseDOM: [
392
+ { tag: "em" },
393
+ { tag: "i" },
394
+ { style: "font-style=italic" },
395
+ {
396
+ style: "font-style=normal",
397
+ clearMark: (m) => m.type.name == "em"
398
+ }
399
+ ],
400
+ toDOM() {
401
+ return ["em", 0];
402
+ }
403
+ },
404
+ underline: {
405
+ parseDOM: [
406
+ { tag: "u" },
407
+ {
408
+ style: "text-decoration",
409
+ getAttrs: (value) => value === "underline" && null
410
+ }
411
+ ],
412
+ toDOM() {
413
+ return ["u", 0];
414
+ }
415
+ }
416
+ }
417
+ });
418
+ const prosemirrorSchema = new Schema({
419
+ nodes: addListNodes(
420
+ customSchema.spec.nodes,
421
+ "paragraph block*",
422
+ "block"
423
+ ),
424
+ marks: customSchema.spec.marks
425
+ });
426
+ return prosemirrorSchema;
427
+ }
428
+
429
+ // src/text_editor.tsx
430
+ import { debounceTime, filter, Subject } from "rxjs";
431
+
432
+ // src/cn.ts
433
+ function cn(...classes) {
434
+ return classes.filter(Boolean).join(" ").trim();
435
+ }
436
+
437
+ // src/attach_file.tsx
438
+ import "prosemirror-view";
439
+ function createAttachFile({
440
+ schema,
441
+ generateMetadata,
442
+ uploadFile = (file) => {
443
+ return {
444
+ src: URL.createObjectURL(file),
445
+ alt: file.name
446
+ };
447
+ }
448
+ }) {
449
+ const attachEachFile = async (view, file, pos) => {
450
+ const metadata = generateMetadata ? await generateMetadata(file) : {};
451
+ const id = {};
452
+ view.focus();
453
+ const tr = view.state.tr;
454
+ if (!tr.selection.empty) {
455
+ tr.deleteSelection();
456
+ }
457
+ tr.setMeta(uploadPlaceholderPlugin, {
458
+ add: {
459
+ id,
460
+ pos: pos ?? tr.selection.from,
461
+ type: file.type,
462
+ ...metadata
463
+ }
464
+ });
465
+ view.dispatch(tr);
466
+ const $pos = findPlaceholder(view.state, id);
467
+ if (!$pos) {
468
+ return;
469
+ }
470
+ try {
471
+ const { src, alt } = await uploadFile(file);
472
+ const tr2 = view.state.tr.setMeta(uploadPlaceholderPlugin, {
473
+ remove: { id }
474
+ });
475
+ const createNode = () => {
476
+ if (file.type.startsWith("image/")) {
477
+ return schema.nodes.image.create({
478
+ src,
479
+ alt,
480
+ width: metadata.width,
481
+ height: metadata.height
482
+ });
483
+ }
484
+ if (file.type.startsWith("video/")) {
485
+ return schema.nodes.video.create({
486
+ src,
487
+ width: metadata.width,
488
+ height: metadata.height,
489
+ poster: metadata.poster
490
+ });
491
+ }
492
+ };
493
+ const node = createNode();
494
+ if (!node) {
495
+ return;
496
+ }
497
+ view.dispatch(tr2.replaceWith($pos, $pos, node));
498
+ } catch (e) {
499
+ view.dispatch(
500
+ tr.setMeta(uploadPlaceholderPlugin, { remove: { id } })
501
+ );
502
+ }
503
+ };
504
+ return async (view, files, pos) => {
505
+ for (let i = 0; i < files.length; i++) {
506
+ const file = files[i];
507
+ await attachEachFile(view, file, pos);
508
+ }
509
+ };
510
+ }
511
+
512
+ // src/text_editor.tsx
513
+ function createTextEditor(options = {}) {
514
+ const schema = createSchema();
515
+ const prosemirrorParser = DOMParser.fromSchema(schema);
516
+ const prosemirrorSerializer = DOMSerializer.fromSchema(schema);
517
+ const attachFile = createAttachFile({
518
+ schema,
519
+ generateMetadata: options.attachFile?.generateMetadata,
520
+ uploadFile: options.attachFile?.uploadFile
521
+ });
522
+ function Component({
523
+ ref,
524
+ state,
525
+ editor,
526
+ mode = "html",
527
+ container,
528
+ autoFocus,
529
+ name,
530
+ placeholder,
531
+ className,
532
+ defaultValue,
533
+ onClick,
534
+ onChange,
535
+ updateDelay = 0,
536
+ ...props
537
+ } = {}) {
538
+ const containerRef = useRef(null);
539
+ const inputRef = useRef(null);
540
+ useEffect(() => {
541
+ const element = containerRef.current;
542
+ if (!element) {
543
+ return;
544
+ }
545
+ const subject = new Subject();
546
+ const wrapper = document.createElement("div");
547
+ const toInnerHTML = (value) => {
548
+ if (mode === "html") {
549
+ return value;
550
+ }
551
+ return value.split("\n").map((line) => `<p>${line}</p>`).join("");
552
+ };
553
+ wrapper.innerHTML = toInnerHTML(
554
+ defaultValue ? String(defaultValue) : ""
555
+ );
556
+ const view = new EditorView3(element, {
557
+ ...editor,
558
+ attributes: (state2) => {
559
+ const propsAttributes = (() => {
560
+ if (typeof editor?.attributes === "function") {
561
+ return editor.attributes(state2);
562
+ }
563
+ return editor?.attributes;
564
+ })();
565
+ return {
566
+ ...propsAttributes,
567
+ class: cn(propsAttributes?.class, className),
568
+ spellcheck: propsAttributes?.spellcheck || "false"
569
+ };
570
+ },
571
+ state: EditorState2.create({
572
+ ...state,
573
+ schema: state?.schema || schema,
574
+ doc: state?.doc || prosemirrorParser.parse(wrapper),
575
+ plugins: [
576
+ ...state?.plugins || [],
577
+ history({
578
+ newGroupDelay: updateDelay
579
+ }),
580
+ keymap(buildKeymap(schema)),
581
+ keymap(baseKeymap),
582
+ uploadPlaceholderPlugin,
583
+ attachFile ? dragAndDropPlugin({
584
+ attachFile
585
+ }) : null,
586
+ placeholder && placeholderPlugin(placeholder)
587
+ ].filter((e) => !!e)
588
+ }),
589
+ dispatchTransaction(tr) {
590
+ let result;
591
+ if (editor?.dispatchTransaction) {
592
+ result = editor.dispatchTransaction(tr);
593
+ } else {
594
+ view.updateState(view.state.apply(tr));
595
+ }
596
+ subject.next(tr);
597
+ return result;
598
+ }
599
+ });
600
+ function setValue(value) {
601
+ const wrap = document.createElement("div");
602
+ wrap.innerHTML = toInnerHTML(value);
603
+ const doc = prosemirrorParser.parse(wrap);
604
+ const tr = view.state.tr.replaceWith(
605
+ 0,
606
+ view.state.doc.content.size,
607
+ doc.content
608
+ );
609
+ view.dispatch(tr);
610
+ }
611
+ function clear() {
612
+ const tr = view.state.tr.replaceWith(
613
+ 0,
614
+ view.state.doc.content.size,
615
+ schema.nodes.doc.createAndFill()
616
+ );
617
+ view.dispatch(tr);
618
+ }
619
+ function toHTML() {
620
+ const fragment = prosemirrorSerializer.serializeFragment(
621
+ view.state.doc.content
622
+ );
623
+ const container2 = document.createElement("div");
624
+ container2.appendChild(fragment);
625
+ return container2.innerHTML;
626
+ }
627
+ function toTextContent() {
628
+ const state2 = view.state;
629
+ return state2.doc.textBetween(0, state2.doc.content.size, "\n");
630
+ }
631
+ const sub = subject.pipe(
632
+ filter((tr) => tr.docChanged),
633
+ debounceTime(updateDelay)
634
+ ).subscribe(() => {
635
+ if (inputRef.current) {
636
+ switch (mode) {
637
+ case "text":
638
+ inputRef.current.value = toTextContent();
639
+ break;
640
+ default:
641
+ inputRef.current.value = toHTML();
642
+ break;
643
+ }
644
+ const event = new Event("input", { bubbles: true });
645
+ inputRef.current.dispatchEvent(event);
646
+ }
647
+ });
648
+ if (autoFocus) {
649
+ view.focus();
650
+ }
651
+ const textEditorController = {
652
+ view,
653
+ subject,
654
+ set value(value) {
655
+ setValue(value);
656
+ },
657
+ get value() {
658
+ switch (mode) {
659
+ case "text":
660
+ return toTextContent();
661
+ default:
662
+ return toHTML();
663
+ }
664
+ },
665
+ clear
666
+ };
667
+ if (typeof ref === "function") {
668
+ ref(textEditorController);
669
+ } else if (ref) {
670
+ ref.current = textEditorController;
671
+ }
672
+ return () => {
673
+ sub.unsubscribe();
674
+ view.destroy();
675
+ element.innerHTML = "";
676
+ };
677
+ }, []);
678
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ React.createElement(
679
+ "input",
680
+ {
681
+ ref: inputRef,
682
+ type: "hidden",
683
+ name,
684
+ onInput: onChange
685
+ }
686
+ ));
687
+ }
688
+ return {
689
+ schema,
690
+ attachFile,
691
+ Component
692
+ };
693
+ }
694
+ export {
695
+ createAttachFile,
696
+ createSchema,
697
+ createTextEditor
698
+ };
@@ -0,0 +1,12 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { AttachFile } from '../attach_file.mjs';
3
+ import 'prosemirror-view';
4
+ import '../schema.mjs';
5
+ import 'orderedmap';
6
+ import 'prosemirror-model';
7
+
8
+ declare function dragAndDropPlugin({ attachFile }: {
9
+ attachFile: AttachFile;
10
+ }): Plugin<any>;
11
+
12
+ export { dragAndDropPlugin };
@@ -0,0 +1,12 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { AttachFile } from '../attach_file.js';
3
+ import 'prosemirror-view';
4
+ import '../schema.js';
5
+ import 'orderedmap';
6
+ import 'prosemirror-model';
7
+
8
+ declare function dragAndDropPlugin({ attachFile }: {
9
+ attachFile: AttachFile;
10
+ }): Plugin<any>;
11
+
12
+ export { dragAndDropPlugin };