@blocknote/core 0.14.1 → 0.14.2
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/blocknote.js +1955 -1856
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +5 -5
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +2 -2
- package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +2 -2
- package/src/api/exporters/markdown/markdownExporter.ts +1 -1
- package/src/api/parsers/acceptedMIMETypes.ts +6 -0
- package/src/api/parsers/fileDropExtension.ts +51 -0
- package/src/api/parsers/handleFileInsertion.ts +99 -0
- package/src/api/parsers/pasteExtension.ts +16 -16
- package/src/editor/BlockNoteEditor.ts +6 -7
- package/src/editor/BlockNoteExtensions.ts +5 -1
- package/src/extensions/FilePanel/FilePanelPlugin.ts +4 -4
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +2 -2
- package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +12 -4
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +11 -2
- package/src/extensions/SideMenu/SideMenuPlugin.ts +59 -17
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +7 -5
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +1 -1
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +46 -24
- package/src/i18n/locales/ar.ts +87 -128
- package/types/src/api/parsers/acceptedMIMETypes.d.ts +1 -0
- package/types/src/api/parsers/fileDropExtension.d.ts +6 -0
- package/types/src/api/parsers/handleFileInsertion.d.ts +3 -0
- package/types/src/editor/BlockNoteEditor.d.ts +1 -1
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
- package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +1 -1
|
@@ -20,7 +20,7 @@ class SuggestionMenuView<
|
|
|
20
20
|
> {
|
|
21
21
|
public state?: SuggestionMenuState;
|
|
22
22
|
public emitUpdate: (triggerCharacter: string) => void;
|
|
23
|
-
|
|
23
|
+
private rootEl?: Document | ShadowRoot;
|
|
24
24
|
pluginState: SuggestionPluginState;
|
|
25
25
|
|
|
26
26
|
constructor(
|
|
@@ -37,15 +37,17 @@ class SuggestionMenuView<
|
|
|
37
37
|
emitUpdate(menuName, this.state);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
this.rootEl = this.editor._tiptapEditor.view.root;
|
|
41
|
+
|
|
40
42
|
// Setting capture=true ensures that any parent container of the editor that
|
|
41
43
|
// gets scrolled will trigger the scroll event. Scroll events do not bubble
|
|
42
44
|
// and so won't propagate to the document by default.
|
|
43
|
-
|
|
45
|
+
this.rootEl.addEventListener("scroll", this.handleScroll, true);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
handleScroll = () => {
|
|
47
49
|
if (this.state?.show) {
|
|
48
|
-
const decorationNode =
|
|
50
|
+
const decorationNode = this.rootEl?.querySelector(
|
|
49
51
|
`[data-decoration-id="${this.pluginState!.decorationId}"]`
|
|
50
52
|
);
|
|
51
53
|
this.state.referencePos = decorationNode!.getBoundingClientRect();
|
|
@@ -79,7 +81,7 @@ class SuggestionMenuView<
|
|
|
79
81
|
return;
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
const decorationNode =
|
|
84
|
+
const decorationNode = this.rootEl?.querySelector(
|
|
83
85
|
`[data-decoration-id="${this.pluginState!.decorationId}"]`
|
|
84
86
|
);
|
|
85
87
|
|
|
@@ -95,7 +97,7 @@ class SuggestionMenuView<
|
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
destroy() {
|
|
98
|
-
|
|
100
|
+
this.rootEl?.removeEventListener("scroll", this.handleScroll, true);
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
closeMenu = () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
1
2
|
import { Block, PartialBlock } from "../../blocks/defaultBlocks";
|
|
2
3
|
import { checkDefaultBlockTypeInSchema } from "../../blocks/defaultBlockTypeGuards";
|
|
3
|
-
import { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
4
4
|
import {
|
|
5
5
|
BlockSchema,
|
|
6
6
|
InlineContentSchema,
|
|
@@ -36,7 +36,7 @@ export type TableHandlesState<
|
|
|
36
36
|
| undefined;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
function setHiddenDragImage() {
|
|
39
|
+
function setHiddenDragImage(rootEl: Document | ShadowRoot) {
|
|
40
40
|
if (dragImageElement) {
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
@@ -46,12 +46,20 @@ function setHiddenDragImage() {
|
|
|
46
46
|
dragImageElement.style.opacity = "0";
|
|
47
47
|
dragImageElement.style.height = "1px";
|
|
48
48
|
dragImageElement.style.width = "1px";
|
|
49
|
-
|
|
49
|
+
if (rootEl instanceof Document) {
|
|
50
|
+
rootEl.body.appendChild(dragImageElement);
|
|
51
|
+
} else {
|
|
52
|
+
rootEl.appendChild(dragImageElement);
|
|
53
|
+
}
|
|
50
54
|
}
|
|
51
55
|
|
|
52
|
-
function unsetHiddenDragImage() {
|
|
56
|
+
function unsetHiddenDragImage(rootEl: Document | ShadowRoot) {
|
|
53
57
|
if (dragImageElement) {
|
|
54
|
-
|
|
58
|
+
if (rootEl instanceof Document) {
|
|
59
|
+
rootEl.body.removeChild(dragImageElement);
|
|
60
|
+
} else {
|
|
61
|
+
rootEl.removeChild(dragImageElement);
|
|
62
|
+
}
|
|
55
63
|
dragImageElement = undefined;
|
|
56
64
|
}
|
|
57
65
|
}
|
|
@@ -73,9 +81,13 @@ function domCellAround(target: Element | null): Element | null {
|
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
// Hides elements in the DOMwith the provided class names.
|
|
76
|
-
function hideElementsWithClassNames(
|
|
84
|
+
function hideElementsWithClassNames(
|
|
85
|
+
classNames: string[],
|
|
86
|
+
rootEl: Document | ShadowRoot
|
|
87
|
+
) {
|
|
77
88
|
classNames.forEach((className) => {
|
|
78
|
-
const elementsToHide =
|
|
89
|
+
const elementsToHide = rootEl.querySelectorAll(className);
|
|
90
|
+
|
|
79
91
|
for (let i = 0; i < elementsToHide.length; i++) {
|
|
80
92
|
(elementsToHide[i] as HTMLElement).style.visibility = "hidden";
|
|
81
93
|
}
|
|
@@ -116,13 +128,16 @@ export class TableHandlesView<
|
|
|
116
128
|
|
|
117
129
|
pmView.dom.addEventListener("mousemove", this.mouseMoveHandler);
|
|
118
130
|
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
pmView.root.addEventListener(
|
|
132
|
+
"dragover",
|
|
133
|
+
this.dragOverHandler as EventListener
|
|
134
|
+
);
|
|
135
|
+
pmView.root.addEventListener("drop", this.dropHandler as EventListener);
|
|
121
136
|
|
|
122
137
|
// Setting capture=true ensures that any parent container of the editor that
|
|
123
138
|
// gets scrolled will trigger the scroll event. Scroll events do not bubble
|
|
124
139
|
// and so won't propagate to the document by default.
|
|
125
|
-
|
|
140
|
+
pmView.root.addEventListener("scroll", this.scrollHandler, true);
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
mouseMoveHandler = (event: MouseEvent) => {
|
|
@@ -220,11 +235,14 @@ export class TableHandlesView<
|
|
|
220
235
|
event.preventDefault();
|
|
221
236
|
event.dataTransfer!.dropEffect = "move";
|
|
222
237
|
|
|
223
|
-
hideElementsWithClassNames(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
238
|
+
hideElementsWithClassNames(
|
|
239
|
+
[
|
|
240
|
+
"column-resize-handle",
|
|
241
|
+
"prosemirror-dropcursor-block",
|
|
242
|
+
"prosemirror-dropcursor-inline",
|
|
243
|
+
],
|
|
244
|
+
this.pmView.root
|
|
245
|
+
);
|
|
228
246
|
|
|
229
247
|
// The mouse cursor coordinates, bounded to the table's bounding box. The
|
|
230
248
|
// bounding box is shrunk by 1px on each side to ensure that the bounded
|
|
@@ -242,7 +260,7 @@ export class TableHandlesView<
|
|
|
242
260
|
|
|
243
261
|
// Gets the table cell element that the bounded mouse cursor coordinates lie
|
|
244
262
|
// in.
|
|
245
|
-
const tableCellElements =
|
|
263
|
+
const tableCellElements = this.pmView.root
|
|
246
264
|
.elementsFromPoint(boundedMouseCoords.left, boundedMouseCoords.top)
|
|
247
265
|
.filter(
|
|
248
266
|
(element) => element.tagName === "TD" || element.tagName === "TH"
|
|
@@ -343,7 +361,7 @@ export class TableHandlesView<
|
|
|
343
361
|
|
|
344
362
|
scrollHandler = () => {
|
|
345
363
|
if (this.state?.show) {
|
|
346
|
-
const tableElement =
|
|
364
|
+
const tableElement = this.pmView.root.querySelector(
|
|
347
365
|
`[data-node-type="blockContainer"][data-id="${this.tableId}"] table`
|
|
348
366
|
)!;
|
|
349
367
|
const cellElement = tableElement.querySelector(
|
|
@@ -360,11 +378,15 @@ export class TableHandlesView<
|
|
|
360
378
|
|
|
361
379
|
destroy() {
|
|
362
380
|
this.pmView.dom.removeEventListener("mousemove", this.mouseMoveHandler);
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
381
|
+
this.pmView.root.removeEventListener(
|
|
382
|
+
"dragover",
|
|
383
|
+
this.dragOverHandler as EventListener
|
|
384
|
+
);
|
|
385
|
+
this.pmView.root.removeEventListener(
|
|
386
|
+
"drop",
|
|
387
|
+
this.dropHandler as EventListener
|
|
388
|
+
);
|
|
389
|
+
this.pmView.root.removeEventListener("scroll", this.scrollHandler, true);
|
|
368
390
|
}
|
|
369
391
|
}
|
|
370
392
|
|
|
@@ -559,7 +581,7 @@ export class TableHandlesProsemirrorPlugin<
|
|
|
559
581
|
})
|
|
560
582
|
);
|
|
561
583
|
|
|
562
|
-
setHiddenDragImage();
|
|
584
|
+
setHiddenDragImage(this.editor._tiptapEditor.view.root);
|
|
563
585
|
event.dataTransfer!.setDragImage(dragImageElement!, 0, 0);
|
|
564
586
|
event.dataTransfer!.effectAllowed = "move";
|
|
565
587
|
};
|
|
@@ -595,7 +617,7 @@ export class TableHandlesProsemirrorPlugin<
|
|
|
595
617
|
})
|
|
596
618
|
);
|
|
597
619
|
|
|
598
|
-
setHiddenDragImage();
|
|
620
|
+
setHiddenDragImage(this.editor._tiptapEditor.view.root);
|
|
599
621
|
event.dataTransfer!.setDragImage(dragImageElement!, 0, 0);
|
|
600
622
|
event.dataTransfer!.effectAllowed = "copyMove";
|
|
601
623
|
};
|
|
@@ -618,7 +640,7 @@ export class TableHandlesProsemirrorPlugin<
|
|
|
618
640
|
this.editor._tiptapEditor.state.tr.setMeta(tableHandlesPluginKey, null)
|
|
619
641
|
);
|
|
620
642
|
|
|
621
|
-
unsetHiddenDragImage();
|
|
643
|
+
unsetHiddenDragImage(this.editor._tiptapEditor.view.root);
|
|
622
644
|
};
|
|
623
645
|
|
|
624
646
|
/**
|
package/src/i18n/locales/ar.ts
CHANGED
|
@@ -3,182 +3,141 @@ import type { Dictionary } from "../dictionary";
|
|
|
3
3
|
export const ar: Dictionary = {
|
|
4
4
|
slash_menu: {
|
|
5
5
|
heading: {
|
|
6
|
-
title: "
|
|
7
|
-
subtext: "يستخدم
|
|
8
|
-
aliases: ["
|
|
6
|
+
title: "عنوان 1",
|
|
7
|
+
subtext: "يستخدم لعناوين المستوى الأعلى",
|
|
8
|
+
aliases: ["ع", "عنوان1", "ع1"],
|
|
9
9
|
group: "العناوين",
|
|
10
10
|
},
|
|
11
11
|
heading_2: {
|
|
12
|
-
title: "
|
|
12
|
+
title: "عنوان 2",
|
|
13
13
|
subtext: "يستخدم للأقسام الرئيسية",
|
|
14
|
-
aliases: ["
|
|
14
|
+
aliases: ["ع2", "عنوان2", "عنوان فرعي"],
|
|
15
15
|
group: "العناوين",
|
|
16
16
|
},
|
|
17
17
|
heading_3: {
|
|
18
|
-
title: "
|
|
19
|
-
subtext: "يستخدم للأقسام الفرعية
|
|
20
|
-
aliases: ["
|
|
18
|
+
title: "عنوان 3",
|
|
19
|
+
subtext: "يستخدم للأقسام الفرعية والعناوين المجموعة",
|
|
20
|
+
aliases: ["ع3", "عنوان3", "عنوان فرعي"],
|
|
21
21
|
group: "العناوين",
|
|
22
22
|
},
|
|
23
23
|
numbered_list: {
|
|
24
24
|
title: "قائمة مرقمة",
|
|
25
|
-
subtext: "
|
|
26
|
-
aliases: [
|
|
27
|
-
"ol",
|
|
28
|
-
"li",
|
|
29
|
-
"list",
|
|
30
|
-
"numberedlist",
|
|
31
|
-
"numbered list",
|
|
32
|
-
"قائمة",
|
|
33
|
-
"قائمة مرقمة",
|
|
34
|
-
],
|
|
25
|
+
subtext: "تستخدم لعرض قائمة مرقمة",
|
|
26
|
+
aliases: ["ق", "عناصر قائمة", "قائمة", "قائمة مرقمة"],
|
|
35
27
|
group: "الكتل الأساسية",
|
|
36
28
|
},
|
|
37
29
|
bullet_list: {
|
|
38
|
-
title: "قائمة
|
|
39
|
-
subtext: "
|
|
40
|
-
aliases: [
|
|
41
|
-
"ul",
|
|
42
|
-
"li",
|
|
43
|
-
"list",
|
|
44
|
-
"bulletlist",
|
|
45
|
-
"bullet list",
|
|
46
|
-
"قائمة",
|
|
47
|
-
"قائمة نقاط",
|
|
48
|
-
],
|
|
30
|
+
title: "قائمة نقطية",
|
|
31
|
+
subtext: "تستخدم لعرض قائمة غير مرتبة",
|
|
32
|
+
aliases: ["ق", "عناصر قائمة", "قائمة", "قائمة نقطية"],
|
|
49
33
|
group: "الكتل الأساسية",
|
|
50
34
|
},
|
|
51
35
|
check_list: {
|
|
52
|
-
title: "قائمة
|
|
53
|
-
subtext: "
|
|
36
|
+
title: "قائمة تحقق",
|
|
37
|
+
subtext: "تستخدم لعرض قائمة بمربعات التحقق",
|
|
54
38
|
aliases: [
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"list",
|
|
58
|
-
"checklist",
|
|
59
|
-
"check list",
|
|
60
|
-
"checked list",
|
|
61
|
-
"checkbox",
|
|
39
|
+
"قوائم غير مرتبة",
|
|
40
|
+
"عناصر قائمة",
|
|
62
41
|
"قائمة",
|
|
63
|
-
"قائمة
|
|
64
|
-
"قائمة
|
|
42
|
+
"قائمة تحقق",
|
|
43
|
+
"قائمة التحقق",
|
|
44
|
+
"قائمة مشطوبة",
|
|
45
|
+
"مربع التحقق",
|
|
65
46
|
],
|
|
66
47
|
group: "الكتل الأساسية",
|
|
67
48
|
},
|
|
68
49
|
paragraph: {
|
|
69
50
|
title: "فقرة",
|
|
70
|
-
subtext: "
|
|
71
|
-
aliases: ["
|
|
51
|
+
subtext: "تستخدم لنص الوثيقة الأساسي",
|
|
52
|
+
aliases: ["ف", "فقرة"],
|
|
72
53
|
group: "الكتل الأساسية",
|
|
73
54
|
},
|
|
74
55
|
table: {
|
|
75
56
|
title: "جدول",
|
|
76
57
|
subtext: "يستخدم للجداول",
|
|
77
|
-
aliases: ["
|
|
58
|
+
aliases: ["جدول"],
|
|
78
59
|
group: "متقدم",
|
|
79
60
|
},
|
|
80
61
|
image: {
|
|
81
62
|
title: "صورة",
|
|
82
|
-
subtext: "
|
|
83
|
-
aliases: [
|
|
84
|
-
|
|
85
|
-
"رفع الصورة",
|
|
86
|
-
"رفع",
|
|
87
|
-
"image",
|
|
88
|
-
"upload",
|
|
89
|
-
"img",
|
|
90
|
-
"picture",
|
|
91
|
-
"media",
|
|
92
|
-
"url",
|
|
93
|
-
],
|
|
94
|
-
group: "الوسائط",
|
|
63
|
+
subtext: "إدراج صورة",
|
|
64
|
+
aliases: ["صورة", "رفع صورة", "تحميل", "صورة", "صورة", "وسائط", "رابط"],
|
|
65
|
+
group: "وسائط",
|
|
95
66
|
},
|
|
96
67
|
video: {
|
|
97
68
|
title: "فيديو",
|
|
98
|
-
subtext: "
|
|
69
|
+
subtext: "إدراج فيديو",
|
|
99
70
|
aliases: [
|
|
100
71
|
"فيديو",
|
|
101
|
-
"رفع
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"media",
|
|
108
|
-
"url",
|
|
72
|
+
"رفع فيديو",
|
|
73
|
+
"تحميل",
|
|
74
|
+
"فيديو",
|
|
75
|
+
"فيلم",
|
|
76
|
+
"وسائط",
|
|
77
|
+
"رابط",
|
|
109
78
|
],
|
|
110
|
-
group: "
|
|
79
|
+
group: "وسائط",
|
|
111
80
|
},
|
|
112
81
|
audio: {
|
|
113
82
|
title: "صوت",
|
|
114
|
-
subtext: "
|
|
115
|
-
aliases: [
|
|
116
|
-
|
|
117
|
-
"رفع الصوت",
|
|
118
|
-
"رفع",
|
|
119
|
-
"audio",
|
|
120
|
-
"upload",
|
|
121
|
-
"mp3",
|
|
122
|
-
"sound",
|
|
123
|
-
"media",
|
|
124
|
-
"url",
|
|
125
|
-
],
|
|
126
|
-
group: "الوسائط",
|
|
83
|
+
subtext: "إدراج صوت",
|
|
84
|
+
aliases: ["صوت", "رفع صوت", "تحميل", "صوت", "صوت", "وسائط", "رابط"],
|
|
85
|
+
group: "وسائط",
|
|
127
86
|
},
|
|
128
87
|
file: {
|
|
129
88
|
title: "ملف",
|
|
130
|
-
subtext: "
|
|
131
|
-
aliases: ["
|
|
132
|
-
group: "
|
|
89
|
+
subtext: "إدراج ملف",
|
|
90
|
+
aliases: ["ملف", "تحميل", "تضمين", "وسائط", "رابط"],
|
|
91
|
+
group: "وسائط",
|
|
133
92
|
},
|
|
134
93
|
},
|
|
135
94
|
placeholders: {
|
|
136
|
-
default: "أدخل
|
|
137
|
-
heading: "
|
|
95
|
+
default: "أدخل نصًا أو اكتب '/' للأوامر",
|
|
96
|
+
heading: "عنوان",
|
|
138
97
|
bulletListItem: "قائمة",
|
|
139
98
|
numberedListItem: "قائمة",
|
|
140
99
|
checkListItem: "قائمة",
|
|
141
100
|
},
|
|
142
101
|
file_blocks: {
|
|
143
102
|
image: {
|
|
144
|
-
add_button_text: "
|
|
103
|
+
add_button_text: "إضافة صورة",
|
|
145
104
|
},
|
|
146
105
|
video: {
|
|
147
|
-
add_button_text: "
|
|
106
|
+
add_button_text: "إضافة فيديو",
|
|
148
107
|
},
|
|
149
108
|
audio: {
|
|
150
|
-
add_button_text: "
|
|
109
|
+
add_button_text: "إضافة صوت",
|
|
151
110
|
},
|
|
152
111
|
file: {
|
|
153
|
-
add_button_text: "
|
|
112
|
+
add_button_text: "إضافة ملف",
|
|
154
113
|
},
|
|
155
114
|
},
|
|
156
115
|
// from react package:
|
|
157
116
|
side_menu: {
|
|
158
|
-
add_block_label: "
|
|
159
|
-
drag_handle_label: "
|
|
117
|
+
add_block_label: "إضافة محتوي",
|
|
118
|
+
drag_handle_label: "فتح قائمة المحتويات",
|
|
160
119
|
},
|
|
161
120
|
drag_handle: {
|
|
162
121
|
delete_menuitem: "حذف",
|
|
163
|
-
colors_menuitem: "
|
|
122
|
+
colors_menuitem: "ألوان",
|
|
164
123
|
},
|
|
165
124
|
table_handle: {
|
|
166
|
-
delete_column_menuitem: "حذف
|
|
167
|
-
delete_row_menuitem: "حذف
|
|
168
|
-
add_left_menuitem: "
|
|
169
|
-
add_right_menuitem: "
|
|
170
|
-
add_above_menuitem: "
|
|
171
|
-
add_below_menuitem: "
|
|
125
|
+
delete_column_menuitem: "حذف عمود",
|
|
126
|
+
delete_row_menuitem: "حذف صف",
|
|
127
|
+
add_left_menuitem: "إضافة عمود إلى اليسار",
|
|
128
|
+
add_right_menuitem: "إضافة عمود إلى اليمين",
|
|
129
|
+
add_above_menuitem: "إضافة صف أعلى",
|
|
130
|
+
add_below_menuitem: "إضافة صف أسفل",
|
|
172
131
|
},
|
|
173
132
|
suggestion_menu: {
|
|
174
133
|
no_items_title: "لم يتم العثور على عناصر",
|
|
175
|
-
loading: "
|
|
134
|
+
loading: "جارٍ التحميل…",
|
|
176
135
|
},
|
|
177
136
|
color_picker: {
|
|
178
|
-
text_title: "
|
|
179
|
-
background_title: "
|
|
137
|
+
text_title: "نص",
|
|
138
|
+
background_title: "خلفية",
|
|
180
139
|
colors: {
|
|
181
|
-
default: "
|
|
140
|
+
default: "افتراضي",
|
|
182
141
|
gray: "رمادي",
|
|
183
142
|
brown: "بني",
|
|
184
143
|
red: "أحمر",
|
|
@@ -186,7 +145,7 @@ export const ar: Dictionary = {
|
|
|
186
145
|
yellow: "أصفر",
|
|
187
146
|
green: "أخضر",
|
|
188
147
|
blue: "أزرق",
|
|
189
|
-
purple: "
|
|
148
|
+
purple: "أرجواني",
|
|
190
149
|
pink: "وردي",
|
|
191
150
|
},
|
|
192
151
|
},
|
|
@@ -201,11 +160,11 @@ export const ar: Dictionary = {
|
|
|
201
160
|
secondary_tooltip: "Mod+I",
|
|
202
161
|
},
|
|
203
162
|
underline: {
|
|
204
|
-
tooltip: "
|
|
163
|
+
tooltip: "تحته خط",
|
|
205
164
|
secondary_tooltip: "Mod+U",
|
|
206
165
|
},
|
|
207
166
|
strike: {
|
|
208
|
-
tooltip: "
|
|
167
|
+
tooltip: "مشطوب",
|
|
209
168
|
secondary_tooltip: "Mod+Shift+X",
|
|
210
169
|
},
|
|
211
170
|
code: {
|
|
@@ -213,15 +172,15 @@ export const ar: Dictionary = {
|
|
|
213
172
|
secondary_tooltip: "",
|
|
214
173
|
},
|
|
215
174
|
colors: {
|
|
216
|
-
tooltip: "
|
|
175
|
+
tooltip: "ألوان",
|
|
217
176
|
},
|
|
218
177
|
link: {
|
|
219
178
|
tooltip: "إنشاء رابط",
|
|
220
179
|
secondary_tooltip: "Mod+K",
|
|
221
180
|
},
|
|
222
181
|
file_caption: {
|
|
223
|
-
tooltip: "
|
|
224
|
-
input_placeholder: "
|
|
182
|
+
tooltip: "تحرير التسمية التوضيحية",
|
|
183
|
+
input_placeholder: "تحرير التسمية التوضيحية",
|
|
225
184
|
},
|
|
226
185
|
file_replace: {
|
|
227
186
|
tooltip: {
|
|
@@ -247,10 +206,10 @@ export const ar: Dictionary = {
|
|
|
247
206
|
},
|
|
248
207
|
file_download: {
|
|
249
208
|
tooltip: {
|
|
250
|
-
image: "
|
|
251
|
-
video: "
|
|
252
|
-
audio: "
|
|
253
|
-
file: "
|
|
209
|
+
image: "تنزيل الصورة",
|
|
210
|
+
video: "تنزيل الفيديو",
|
|
211
|
+
audio: "تنزيل الصوت",
|
|
212
|
+
file: "تنزيل الملف",
|
|
254
213
|
} as Record<string, string>,
|
|
255
214
|
},
|
|
256
215
|
file_delete: {
|
|
@@ -262,21 +221,21 @@ export const ar: Dictionary = {
|
|
|
262
221
|
} as Record<string, string>,
|
|
263
222
|
},
|
|
264
223
|
file_preview_toggle: {
|
|
265
|
-
tooltip: "تبديل
|
|
224
|
+
tooltip: "تبديل المعاينة",
|
|
266
225
|
},
|
|
267
226
|
nest: {
|
|
268
|
-
tooltip: "
|
|
227
|
+
tooltip: "محتويات متداخلة",
|
|
269
228
|
secondary_tooltip: "Tab",
|
|
270
229
|
},
|
|
271
230
|
unnest: {
|
|
272
|
-
tooltip: "إلغاء
|
|
231
|
+
tooltip: "إلغاء التداخل",
|
|
273
232
|
secondary_tooltip: "Shift+Tab",
|
|
274
233
|
},
|
|
275
234
|
align_left: {
|
|
276
235
|
tooltip: "محاذاة النص إلى اليسار",
|
|
277
236
|
},
|
|
278
237
|
align_center: {
|
|
279
|
-
tooltip: "محاذاة النص
|
|
238
|
+
tooltip: "محاذاة النص في المنتصف",
|
|
280
239
|
},
|
|
281
240
|
align_right: {
|
|
282
241
|
tooltip: "محاذاة النص إلى اليمين",
|
|
@@ -289,20 +248,20 @@ export const ar: Dictionary = {
|
|
|
289
248
|
upload: {
|
|
290
249
|
title: "تحميل",
|
|
291
250
|
file_placeholder: {
|
|
292
|
-
image: "تحميل
|
|
293
|
-
video: "تحميل
|
|
294
|
-
audio: "تحميل
|
|
295
|
-
file: "تحميل
|
|
251
|
+
image: "تحميل صورة",
|
|
252
|
+
video: "تحميل فيديو",
|
|
253
|
+
audio: "تحميل صوت",
|
|
254
|
+
file: "تحميل ملف",
|
|
296
255
|
} as Record<string, string>,
|
|
297
256
|
upload_error: "خطأ: فشل التحميل",
|
|
298
257
|
},
|
|
299
258
|
embed: {
|
|
300
259
|
title: "تضمين",
|
|
301
260
|
embed_button: {
|
|
302
|
-
image: "تضمين
|
|
303
|
-
video: "تضمين
|
|
304
|
-
audio: "تضمين
|
|
305
|
-
file: "تضمين
|
|
261
|
+
image: "تضمين صورة",
|
|
262
|
+
video: "تضمين فيديو",
|
|
263
|
+
audio: "تضمين صوت",
|
|
264
|
+
file: "تضمين ملف",
|
|
306
265
|
} as Record<string, string>,
|
|
307
266
|
url_placeholder: "أدخل الرابط",
|
|
308
267
|
},
|
|
@@ -312,15 +271,15 @@ export const ar: Dictionary = {
|
|
|
312
271
|
tooltip: "إزالة الرابط",
|
|
313
272
|
},
|
|
314
273
|
edit: {
|
|
315
|
-
text: "
|
|
316
|
-
tooltip: "
|
|
274
|
+
text: "تحرير الرابط",
|
|
275
|
+
tooltip: "تحرير",
|
|
317
276
|
},
|
|
318
277
|
open: {
|
|
319
|
-
tooltip: "
|
|
278
|
+
tooltip: "فتح في تبويب جديد",
|
|
320
279
|
},
|
|
321
280
|
form: {
|
|
322
|
-
title_placeholder: "
|
|
323
|
-
url_placeholder: "
|
|
281
|
+
title_placeholder: "تحرير العنوان",
|
|
282
|
+
url_placeholder: "تحرير الرابط",
|
|
324
283
|
},
|
|
325
284
|
},
|
|
326
285
|
generic: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const acceptedMIMETypes: readonly ["blocknote/html", "Files", "text/html", "text/plain"];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Extension } from "@tiptap/core";
|
|
2
|
+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
3
|
+
import { InlineContentSchema, StyleSchema } from "../../schema";
|
|
4
|
+
export declare const createDropFileExtension: <BSchema extends Record<string, import("../../schema").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>) => Extension<{
|
|
5
|
+
editor: BlockNoteEditor<BSchema, I, S>;
|
|
6
|
+
}, undefined>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
2
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
|
|
3
|
+
export declare function handleFileInsertion<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(event: DragEvent | ClipboardEvent, editor: BlockNoteEditor<BSchema, I, S>): Promise<void>;
|
|
@@ -18,7 +18,7 @@ import { Dictionary } from "../i18n/dictionary";
|
|
|
18
18
|
import "./Block.css";
|
|
19
19
|
import "./editor.css";
|
|
20
20
|
export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema> = {
|
|
21
|
-
|
|
21
|
+
disableExtensions: string[];
|
|
22
22
|
/**
|
|
23
23
|
* A dictionary object containing translations for the editor.
|
|
24
24
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Extensions } from "@tiptap/core";
|
|
2
1
|
import type { BlockNoteEditor } from "./BlockNoteEditor";
|
|
3
2
|
import * as Y from "yjs";
|
|
4
3
|
import { BlockNoteDOMAttributes, BlockSpecs, InlineContentSchema, InlineContentSpecs, StyleSchema, StyleSpecs } from "../schema";
|
|
@@ -22,4 +21,5 @@ export declare const getBlockNoteExtensions: <BSchema extends Record<string, imp
|
|
|
22
21
|
provider: any;
|
|
23
22
|
renderCursor?: (user: any) => HTMLElement;
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
disableExtensions: string[] | undefined;
|
|
25
|
+
}) => import("@tiptap/core").AnyExtension[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
1
2
|
import { Block, PartialBlock } from "../../blocks/defaultBlocks";
|
|
2
|
-
import { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
3
3
|
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
|
|
4
4
|
import { DefaultSuggestionItem } from "./DefaultSuggestionItem";
|
|
5
5
|
export declare function insertOrUpdateBlock<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, block: PartialBlock<BSchema, I, S>): Block<BSchema, I, S>;
|